@opentok/client 2.24.3 → 2.24.4

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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.24.3 a6b62172c
2
+ * @license OpenTok.js 2.24.4 aae6dca9e
3
3
  *
4
- * Copyright (c) 2010-2022 TokBox, Inc.
4
+ * Copyright (c) 2010-2023 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: Thu, 08 Dec 2022 08:19:34 GMT
8
+ * Date: Wed, 11 Jan 2023 00:20:19 GMT
9
9
  */
10
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=332)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){(function(t){
11
11
  /*!
@@ -14,7 +14,7 @@
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,i=void 0,o=void 0,s=function(e,t){f[r]=e,f[r+1]=t,2===(r+=2)&&(o?o(p):v())},a="undefined"!=typeof window?window:void 0,c=a||{},u=c.MutationObserver||c.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(p,1)}}var f=new Array(1e3);function p(){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,y,v=void 0;function w(e,t){var n=this,r=new this.constructor(E);void 0===r[T]&&G(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return O(i,r,o,n._result)}))}else Z(n,r,e,t);return r}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(E);return _(t,e),t}l?v=function(){return t.nextTick(p)}:u?(g=0,b=new u(p),y=document.createTextNode(""),b.observe(y,{characterData:!0}),v=function(){y.data=g=++g%2}):d?((m=new MessageChannel).port1.onmessage=p,v=function(){return m.port2.postMessage(0)}):v=void 0===a?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:h()}catch(e){return h()}}():h();var T=Math.random().toString(36).substring(2);function E(){}function x(t,n,r){n.constructor===t.constructor&&r===w&&n.constructor.resolve===S?function(e,t){1===t._state?I(e,t._result):2===t._state?R(e,t._result):Z(t,void 0,(function(t){return _(e,t)}),(function(t){return R(e,t)}))}(t,n):void 0===r?I(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?_(e,n):I(e,n))}),(function(t){r||(r=!0,R(e,t))}),e._label);!r&&i&&(r=!0,R(e,i))}),e)}(t,n,r):I(t,n)}function _(e,t){if(e===t)R(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)I(e,t);else{var n=void 0;try{n=t.then}catch(t){return void R(e,t)}x(e,t,n)}var r,i}function C(e){e._onerror&&e._onerror(e._result),k(e)}function I(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(k,e))}function R(e,t){void 0===e._state&&(e._state=2,e._result=t,s(C,e))}function Z(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?O(n,r,i,o):i(o);e._subscribers.length=0}}function O(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 R(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;void 0!==n._state||(o&&c?_(n,s):!1===c?R(n,a):1===t?I(n,s):2===t&&R(n,s))}var V=0;function G(e){e[T]=V++,e._state=void 0,e._result=void 0,e._subscribers=[]}var A=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(E),this.promise[T]||G(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&I(this.promise,this._result))):R(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===w&&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===W){var a=new n(E);s?R(a,o):x(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?R(r,n):this._result[t]=n),0===this._remaining&&I(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;Z(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),W=function(){function t(e){this[T]=V++,this._result=this._state=void 0,this._subscribers=[],E!==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){_(e,t)}),(function(t){R(e,t)}))}catch(t){R(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 W.prototype.then=w,W.all=function(e){return new A(this,e).promise},W.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."))}))},W.resolve=S,W.reject=function(e){var t=new this(E);return R(t,e),t},W._setScheduler=function(e){o=e},W._setAsap=function(e){s=e},W._asap=s,W.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=W},W.Promise=W,W},e.exports=n()}).call(this,n(44))},function(e,t,n){"use strict";const r=n(400),i=n(191),o=n(123),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,n){"use strict";const r=n(542).parse();e.exports=r},function(e,t,n){e.exports=n(534)},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(1))},function(e,t,n){"use strict";const r=n(28),i=n(18),o=n(2)("Events"),s=n(9),a=n(405);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){"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",FAILED_SET_CONFIGURATION:"OT_FAILED_SET_CONFIGURATION",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",INVALID_ENCRYPTION_SECRET:"OT_INVALID_ENCRYPTION_SECRET"}},function(e,t,n){"use strict";const r=n(245),i=n(249),o=n(6),s=n(2);r.logging=s("OT.$"),r.ElementCollection=n(246),r.env=n(3),r.ajax=n(244),r.statable=n(551),r.Analytics=n(26),r.Collection=n(248),r.domExtras=n(552),r.Error=n(250),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(142),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){var r=n(84),i=n(42),o=n(192),s=n(25),a=n(69),c=n(31),u=Object.prototype.hasOwnProperty,l=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=l},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(7),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){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(174),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();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){var r=n(536),i=n(537),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r=n(30),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(208),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 l(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:l,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++)l(arguments[r],n);return t},extend:function(e,t,n){return l(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,n){"use strict";const r=n(248),i={publishers:new r("guid"),subscribers:new r("widgetId"),sessions:new r};e.exports=i},function(e,t,n){"use strict";const r=n(2)("GlobalExceptionHandler"),i=n(6),o=n(27),s=n(550),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 l=()=>void 0!==i?i:t&&t.code,d=()=>void 0!==n?n:t&&t.message,h=c.getTitleByCode(l());r.error(`OT.exception :: title: ${h} (${l()}) msg: ${d()}`);try{const e={partnerId:s.session?s.session.apiKey:s.apiKey,sessionId:s.session?s.session.sessionId:s.sessionId};u.logError(l(),"tb.exception",h,{details:d()},e);const n=new a.ExceptionEvent(o.EXCEPTION,d(),h,l(),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(0),i=r(n(47)),o=r(n(37));const s=n(130),a=n(27);e.exports=function(e){void 0===e&&(e={});const t=e.logging||n(2)("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 l=!1,d=!1,h=!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 l||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),l=!0),[]}},{key:"streams",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),d=!0),[]}},{key:"archives",get:function(){return h||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),h=!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.CaptionReceivedEvent=function(e,t,n){return new s("caption",!1,{caption:e,streamId:t,isFinal: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(0),i=r(n(4)),o=r(n(5));e.exports=function(e){void 0===e&&(e={});const r=e.getNativeEnumerateDevices||n(288)(),s=e.getNativeMediaDevices||n(642)(),a=(e.currentAudioOutputDevice||n(108)).getCurrentAudioOutputDeviceId,c=e.env||n(3),u=e.global||(void 0!==typeof window?window:global),l={},d={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return l.getNativeMediaDevices=()=>s(),l.hasEnumerateDevicesCapability=()=>"function"==typeof r(),l.hasDeviceChangeCapability=()=>{const e=s();return!(!e||!("ondevicechange"in e))},l.hasSetSinkIdCapability=()=>"setSinkId"in(null==u?void 0:u.HTMLMediaElement.prototype),l.hasAudioOutputApiSupport=()=>l.hasSetSinkIdCapability()&&l.hasDeviceChangeCapability(),l.hasEnumerateDevicesBug=()=>c.isSafari&&13.1===c.version,l.getMediaDevices=()=>l.hasEnumerateDevicesCapability()?r()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:d[e.kind]}))):t.reject(new Error("This browser does not support enumerateDevices APIs")),l.getInputMediaDevices=()=>l.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),l.getAudioOutputMediaDevices=()=>l.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),l.shouldAskForDevices=()=>l.hasEnumerateDevicesCapability()?l.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 l.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}),l.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},l.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},l.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,l.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=l.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),l}}).call(this,n(1))},function(e,t,n){var r=n(18),i=n(116);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";var r=n(0),i=r(n(16)),o=r(n(4)),s=r(n(5)),a=r(n(47)),c=r(n(14));const u=n(241),l=n(538),d=n(143),h=n(35)(),f=n(553),p=n(6),m=n(555),g=n(558);let b=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?h.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new d:i,s=t.ajax,a=t.queue,u=t.getUserAgentClientHintData,l=void 0===u?g:u,f=t.userAgentData,p=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=l,this.userAgentData=p,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(){const e=this._analytics.proxyUrl,t=this.sessionInfo.messagingURL;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:f(e,t),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);m(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 l({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();p(b),e.exports=b},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",SUBSCRIBER_CAPTION_RECEIVED:"captionReceived",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";(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 l(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 l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return e}function d(){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 h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.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 p(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,l=m(c,u);for(n=0;n<u;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(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):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(1))},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(41),i=n(361),o=n(362),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(178),i=n(118),o=n(25);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(45);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(57),i=n(199),o=n(129),s=n(200),a=n(201);(e.exports=function(e,t){var n,i,c,u,l;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),l={value:t,configurable:n,enumerable:i,writable:c},u?o(s(u),l):l}).gs=function(e,t,n){var c,u,l,d;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],r(t)?i(t)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=t,t=n=void 0):t=void 0,r(e)?(c=a.call(e,"c"),u=a.call(e,"e")):(c=!0,u=!1),d={get:t,set:n,configurable:c,enumerable:u},l?o(s(l),d):d}},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(0),i=r(n(16)),o=r(n(47));const s=n(207),a=n(58),c=n(479),u=n(526),l=n(2)("StaticConfig"),d=n(101).prependProxyToUrlIfNeeded,h=a({version:"v2.24.3",buildHash:"a6b62172c",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"]),p={apiUrl:"apiURL",loggingUrl:"loggingURL"},m=u(e=>p[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)({},h,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=d(n,u),r.get(`${n}/project/${o}/config.json`,{headers:{"X-TB-TOKEN-AUTH":s}}).then(e=>e.data)})().catch(e=>(l.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)({},h,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(1))},function(e,t,n){var r=n(505),i=n(511),o=n(89),s=n(12),a=n(516);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){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(8);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(78);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(360),i=n(365);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(15).Symbol;e.exports=r},function(e,t,n){var r=n(84),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],l=o?o(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),s?i(n,u,l):r(n,u,l)}return n}},function(e,t,n){var r=n(389),i=n(113),o=n(390),s=n(186),a=n(187),c=n(30),u=n(175),l=u(r),d=u(i),h=u(o),f=u(s),p=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 l:return"[object DataView]";case d:return"[object Map]";case h:return"[object Promise]";case f:return"[object Set]";case p:return"[object WeakMap]"}return t}),e.exports=m},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=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!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 p(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 p(e,t)),1!==u.length||l||a(f)},p.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(408)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(422)()?n(92).Symbol:n(425)},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(523),i=n(141)((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(589);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";const r=n(51),i=n(35)();t.check=function(e){void 0===e&&(e={});const t=e.env||n(3),r=e.hasGetUserMediaCapability||n(597),o=e.hasPeerConnectionCapability||n(598),s=e.logging||n(2)("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";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}const o=n(9),s=n(62),a=n(273),c=n(131),u=n(274),l=n(2)("SDPHelpers"),d={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=d.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:o(...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=d.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},mediaDirections:{INACTIVE:"inactive",RECVONLY:"recvonly"}};e.exports=d,d.getMLineIndex=function(e,t){const n="m="+t;return a(e,e=>-1!==e.indexOf(n))},d.getMLine=function(e,t){const n=d.getMLineIndex(e,t);return n>-1?e[n]:void 0},d.hasMediaType=(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return a(r,e=>n.test(e))>=0},d.hasMLinePayloadType=function(e,t,n){const r=d.getMLine(e,t);return d.getMLinePayloadTypes(r,t).indexOf(n)>-1},d.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(" ")},d.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},d.changeMediaDirection=function(e,t){const n=d.splitSections(e);let r=n.shift();return n.forEach(e=>{const n=e.includes("m=video")?(e=>{const n=t===d.mediaDirections.RECVONLY?"a=inactive":"a=recvonly",r=new RegExp(n,"g");return e.replace(r,"a="+t)})(e):e;r+=n}),r},d.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(" "))},d.removeMediaEncoding=function(e,t,n){let r,i,o,s,a=e.split("\r\n");const c=d.getMLineIndex(a,t),u=c>-1?a[c]:void 0,l=[];if(-1===c)return a.join("\r\n");if(r=d.getMLinePayloadTypes(u,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]=d.removeTypesFromMLine(u,l)),a.join("\r\n")},d.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")},d.removeVideoCodec=function(e,t){return d.removeMediaEncoding(e,"video",t)};const h=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]),d.hasMLinePayloadType(e,"video",i);default:return l.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};d.getAttributesForMediaType=function(e,t){let n,r,i,o,a,c,u,l,f,p;const m=d.getMLineIndex(e,t),g=new RegExp(`m=(?!${t}).+ `,"i"),b=new RegExp("a=ssrc:\\d+ .*","i"),y=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),v=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),w=[];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(y),c=e[t].match(b),void 0===n&&(a||c)&&(n=t,a&&(o=/^(FID|SIM)$/.test(a[1])?a[2]:a[1])),u=e[t].match(`a=ssrc:${o} msid:(.+)`),u&&(l=u[1]);const s=b.test(e[t]),d=y.test(e[t]);void 0!==n&&(void 0!==r||s||d?t===e.length-1&&(r=t):r=t-1);const h=e[t].match(/a=mid:(.+)/);h&&(f=h[1],p=t),i=v.exec(e[t]),i&&3===i.length&&w.push({lineIndex:t,name:i[1],value:i[2]})}return w.ssrcStartIndex=n,w.ssrcEndIndex=r,w.msid=l,w.mid=f,w.midIndex=p,w.isUsingRTX=h.bind(null,e,w),w.filterByName=function(e){return this.filter(t=>t.name===e)},w.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return s(w.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},w},d.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!d.getMLine(n,"audio"))return l.debug("No audio m-line, not enabling dtx."),e;const r=d.getAttributesForMediaType(n,"audio"),i=r.getRtpNumber("opus");if(!i)return l.debug("Could not find rtp number for opus, not enabling dtx."),e;const o=r.find(e=>e.name==="fmtp:"+i);if(!o)return l.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 f=(e,t,n)=>{const r=t.split("\r\n");if(!d.getMLine(r,"audio"))return l.debug("No audio m-line, not enabling stereo."),t;const i=d.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return l.debug("Could not find rtp number for opus, not enabling stereo."),t;const s=i.find(e=>e.name==="fmtp:"+o);if(!s)return l.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let a,c=r[s.lineIndex];switch(e){case"send":a=/sprop-stereo=\d+([\s;]*)/,a.test(s.value)?c=c.replace(a,n?"sprop-stereo=1$1":""):n&&(c+="; sprop-stereo=1");break;case"receive":a=/([^-])stereo=\d+([\s;]*)/,a.test(s.value)?c=c.replace(a,n?"$1stereo=1$2":"$1"):n&&(c+="; stereo=1");break;default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return c=c.replace(/[;\s]*$/,""),r[s.lineIndex]=c,r.join("\r\n")};d.modifySendStereo=f.bind(null,"send"),d.modifyReceiveStereo=f.bind(null,"receive"),d.setAudioBitrate=(e,t)=>{const n=d.getAudioBitrate(e);if(void 0!==n)return l.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!d.getMLine(r,"audio"))return l.debug("No audio m-line, not setting audio bitrate"),e;const i=d.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return l.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 l.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")},d.removeVideoOrientation=e=>{let t=e.split("\r\n");return t=t.filter(e=>!e.includes("urn:3gpp:video-orientation")),t.join("\r\n")},d.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),d.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),d.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},d.MAX_SSRCS=10,d.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),d.getSSRCGroup=e=>{const t=d.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},d.getSSRCGroupSSRCs=e=>{const t=d.getSSRCGroup(e);return t?t.value.split(" ").slice(0,d.MAX_SSRCS):[]},d.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");c(n,t).length&&Array.prototype.push.apply(n,t)}),u(n)},d.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=d.getAttributesForMediaType(t,"video"),r=d.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=d.getSSRCGroupSSRCs(n),i=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=i,o=d.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")},d.enableSimulcast=function(e,t){let n,r;const i=e.split("\r\n");if(!d.getMLine(i,"video"))return l.debug("No video m-line, not enabling simulcast."),e;const o=d.getAttributesForMediaType(i,"video");if(o.filterByName("ssrc-group:SIM").length>0)return l.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),d.filterExcessSSRCs(e);if(!o.msid)return l.debug("No local stream attached, not enabling simulcast."),e;const s=o.isUsingRTX(),a=[],c=[];for(r=0;r<t;++r)a.push(1e4+r),s&&c.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]} ${c[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:${c[r]} cname:localCname`,`a=ssrc:${c[r]} msid:${o.msid}`);return n.unshift(o.ssrcStartIndex,o.ssrcEndIndex-o.ssrcStartIndex+1),i.splice(...n),i.join("\r\n")},d.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),i=d.getMLineIndex(r,"video");if(-1===i)return e;const o=d.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 c=a.map(e=>e[1]);let u=o.filter(e=>-1===c.indexOf(e));"top"===n?u.unshift(...c):"bottom"===n?u.push(...c):(l.error(`Unexpected location param: ${n}; not changing ${t} priority`),u=o);const h=r[i].replace(o.join(" "),u.join(" "));return r[i]=h,r.join("\r\n")},d.getSetupRole=e=>{for(var t,n=r(e.split(/\r\n|\r|\n/));!(t=n()).done;){const e=t.value.match(/^a=setup:(\w+)/);if(e)return e[1]}return""},d.setSetupRole=(e,t)=>e.split(/\r\n|\r|\n/).map(e=>e.match(/^a=setup:(\w+)/)?"a=setup:"+t:e).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),i=n(384),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(78);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(99);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(140),o=n(236),s=n(61);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(513);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(612)(n(273));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(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(379),i=n(19),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(15),i=n(380),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(85)(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(30),i=n(19);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";if("Node"===n(8).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";(function(t){var r=n(0),i=r(n(4)),o=r(n(5));const s=n(155),a=n(50),c=n(9),u=n(58),l=n(131),d=n(272),h=n(17),f=n(6),p=n(250),m=n(156),g=n(53),b=n(74),y=n(615);e.exports=function(e){void 0===e&&(e={});const r=e.hasValidPeerConnection||n(616),v=e.applySdpTransform||n(157),w=e.createPeerConnection||n(617),S=e.env||n(3),T=e.sdpTransformDefaults||n(619),E=e.getStatsAdapter||n(275),x=e.getRtcStatsReportAdapter||n(278),_=e.getSynchronizationSources||n(623),C=e.IceCandidateProcessor||n(624),I=e.logging||n(2),R=e.offerProcessor||n(626),Z=e.PeerConnectionChannels||n(628),k=e.subscribeProcessor||n(630),O=n(631),V=e.changeMediaDirection||n(633),G=V.changeMediaDirectionToInactive,A=V.changeMediaDirectionToRecvOnly,W=e.Qos||n(279).default,N=e.global||(void 0!==typeof window?window:global),L=e.debounce||n(637),X=e.needsToSwapH264Profiles||n(639).once,M=e.NativeRTCIceCandidate||N.RTCIceCandidate,F=e.NativeRTCSessionDescription||N.RTCSessionDescription,P=e.Errors||n(7),j=e.OTErrorClass||n(22),U=e.ExceptionCodes||n(10),H=e.hasPictureInPictureBug||n(640),Y=()=>{};return function(e){void 0===e&&(e={});let n=!1;const V=e,D=V.iceConfig,B=void 0===D?{servers:[]}:D,K=V.sendMessage,J=V.isPublisher,z=V.offerOverrides,Q=V.answerOverrides,q=V.p2p,$=V.codecFlags,ee=V.sourceStreamId,te=V.keyStore,ne=V.sFrameClientStore,re=V.isE2ee;let ie,oe=e,se=oe.logAnalyticsEvent,ae=void 0===se?Y:se,ce=oe.remoteConnectionId,ue=!1;const le=X();let de,he,fe,pe=0,me=!1;const ge=new O(ae),be=m();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")}}K(e,t)}const ve=a();ae("createPeerConnection","Attempt");const we={};we.id=h();const Se=I("PeerConnection:"+we.id);Se.debug("construct",{id:we.id,options:e});const Te=T,Ee=e=>"relay"===B.transportPolicy&&null!=e&&-1===e.candidate.indexOf("typ relay"),xe=d(e,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage"]);let _e,Ce,Ie,Re,Ze,ke=[];const Oe=(()=>{let e=xe.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&xe.capableSimulcastStreams>1;n!==e&&void 0===xe.overrideSimulcastEnabled&&(e=n,we.generateOffer())}}})(),Ve=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e&&!we.iceConnectionStateIsConnected()?we.generateOffer():Se.debug("iceRestart is going to wait until we disconnect and then restart ice"))}}})(),Ge={clean(){delete this.promise,delete this.resolve,delete this.reject}};Ge.promise=new t((e,t)=>{Ge.resolve=e,Ge.reject=t});let Ae=new C,We="new";Object.defineProperty(we,"signalingState",{get:()=>_e.signalingState,set:e=>(_e.signalingState=e,e)}),f(we),we.addOptions=e=>{ce=e.remoteConnectionId,ae=e.logAnalyticsEvent},we.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(re){e.next=2;break}return e.abrupt("return");case 2:return fe=y(t),e.next=5,ne.createSender(fe);case 5:return he=e.sent,e.next=8,te.get();case 8:return n=e.sent,e.next=11,he.setSenderEncryptionKey(n);case 11:te.on("keyChanged",e=>{he.setSenderEncryptionKey(e)}),_e.getTransceivers().forEach(e=>he.encrypt(e.mid,e.sender));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we.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()-ve,10),hasRelayCandidates:n,proxyInfo:""},_e&&_e.proxyInfo&&(t.proxyInfo=_e.proxyInfo),ae("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),Ge.resolve();const Ne=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,te.get();case 2:if(t=e.sent,fe=y(ce),de=ne.getReceiver(fe),de){e.next=14;break}return e.next=8,ne.createReceiver(fe);case 8:de=e.sent,de.addReceiver(fe),de.setReceiverEncryptionKey(fe,t),te.on("keyChanged",e=>{de.setReceiverEncryptionKey(fe,e)}),de.addEventListener("decryptFailed",()=>{we.trigger("decryptFailed")}),de.addEventListener("decryptionRestored",()=>{we.trigger("decryptRestored")});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=e=>{if(Se.debug("internalCreatePeerConnection: called"),_e)return Se.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,_e);if(ke.push(e),!(ke.length>1)){if(Se.debug(`Creating peer connection config "${JSON.stringify(xe)}".`),0===B.servers.length&&(Se.error("No ice servers present"),ae("Error","noIceServers")),"relay"===B.transportPolicy){const e=e=>e&&0===e.indexOf("turn");B.servers=B.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)}xe.iceTransportPolicy=B.transportPolicy,xe.iceServers=B.servers,re&&(xe.forceEncodedVideoInsertableStreams=!0,xe.forceEncodedAudioInsertableStreams=!0,xe.encodedInsertableStreams=!0),r(N.RTCPeerConnection).then(e=>{if(!e)throw Se.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return w({window:N,config:xe})}).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(J||!re){e.next=3;break}return e.next=3,Ne();case 3:Xe(null,t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>Xe(e))}},Xe=(e,t)=>{if(e)return De({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(ke=[]);Se.debug("OT attachEventsToPeerConnection"),_e=t,Ae&&Ae.setPeerConnection(t),Ce=new Z(_e),xe.channels&&Ce.addMany(xe.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:Se}),r=e=>{Ge.resolve(),Ee(e.candidate)?Se.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:Ue(t),!J&&de&&de.decrypt(t.transceiver.mid,t.receiver);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let a=_e.iceConnectionState;const c=e=>{_e?(Se.debug("iceconnectionstatechange",_e.iceConnectionState),"connected"===_e.iceConnectionState?("disconnected"===a&&we.clearFailedTimeout(),we.emit("iceConnected"),Ve.set(!1)):"completed"===_e.iceConnectionState&&S.isLegacyEdge&&setTimeout(()=>Je.startCollecting(_e),1e3)):Se.debug("iceconnectionstatechange on peerConnection that no longer exists",we);const t=e.target.iceConnectionState;we.trigger("iceConnectionStateChange",t),ae("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(Ve.get()?(Se.debug("Restarting ice!"),we.generateOffer()):b()||(Ze=setTimeout(()=>{ae("attachEventsToPeerConnection","iceconnectionstatechange","failed"),a="failed",we.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==a&&"failed"===t&&De({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=()=>{ae("peerConnection:negotiationNeeded","Event"),J&&we.generateOffer(),we.trigger("negotiationNeeded")};_e.addEventListener("track",s),_e.addEventListener("icecandidate",r),_e.addEventListener("signalingstatechange",Pe),_e.addEventListener("negotiationneeded",u),_e.addEventListener("iceconnectionstatechange",c),be.add(()=>{_e&&(_e.removeEventListener("track",s),_e.removeEventListener("icecandidate",r),_e.removeEventListener("signalingstatechange",Pe),_e.removeEventListener("negotiationneeded",u),_e.removeEventListener("iceconnectionstatechange",c))}),Me(null)},Me=()=>{for(;ke.length;)ke.shift().call(null)},Fe=()=>{Ae&&(Ae.destroy(),Ae=null),ke=[],Je.stopCollecting(),be.releaseAll(),Ge.clean(),null!==_e&&(_e.destroy&&_e.destroy(),_e=null,we.trigger("close")),we.off()},Pe=e=>{const t=e.target.signalingState;if(we.emit("signalingStateChange",t),"stable"===t&&we.emit("signalingStateStable"),t&&t!==We)switch(We=t,Se.debug("stateChange: "+We),We){case"closed":Fe()}},je=()=>{let e;if(_e.getRemoteStreams)e=_e.getRemoteStreams();else{if(!_e.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=_e.remoteStreams}return Array.prototype.slice.call(e)},Ue=e=>{var t;const n=e.track,r=e.transceiver,i=e.stream||(null==(t=e.streams)?void 0:t[0]);ae("createPeerConnection","TrackAdded"),we.trigger("trackAdded",{stream:i,track:n,transceiver:r})},He=(e,t,n)=>{ue=!1,De({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Ye=e=>{if(ue)return void(ie=e);ue=!0,ae("peerConnection:processOffer","Event");const t=new F({type:"offer",sdp:e.content.sdp}),n=e=>{ue=!1,Ae&&Ae.process(),ye("answer",e),S.isLegacyEdge||Je.startCollecting(_e,J),ie&&(Ye(ie),ie=null)},r=e=>we.trigger("remoteVideoSupported",e);Le(()=>{R(_e,N.RTCPeerConnection,N.RTCSessionDescription,F,Te,t,$,q,n,He,r,le,ee)})};we.generateOffer=L(()=>{ge.enqueueOfferAnswer(()=>(()=>{var e,t;if("closed"===(null==(e=_e)||null==(t=e.signalingState)?void 0:t.toLowerCase()))return;ae("peerConnection:processSubscribe","Event"),Se.debug("processSubscribe: Sending offer to subscriber.");let n=Oe.get()?xe.capableSimulcastStreams:1;"P2P"===ee&&!q&&(n=1),Le(()=>{k({peerConnection:_e,NativeRTCSessionDescription:F,sdpTransforms:Te,numSimulcastStreams:n,removeVideoOrientation:H(),offerOverrides:z,offerConstraints:{iceRestart:Ve.get()},replaceBaselineProfile:le}).then(e=>{Se.debug("processSubscribe: got offer, waiting for _readyToSendOffer"),Ie=e,Ge.promise.then(()=>{Se.debug("processSubscribe: sending offer"),ye("offer",Ie)})},e=>{De({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),Ve.set(!1)})})())},100);const De=e=>{let t=e.reason,n=e.prefix;Se.error(t,"in state",_e?{connectionState:_e.connectionState,iceConnectionState:_e.iceConnectionState,iceGatheringState:_e.iceGatheringState,signalingState:_e.signalingState}:"(none)"),we.trigger("error",{reason:t,prefix:n})};function Be(e){this.track=e}we.addTrack=(e,n)=>{const r=new t((e,t)=>{Le(n=>{if(n)return t(n);e()})}).then(()=>{if(_e.addTrack)return _e.addTrack(e,n);const t=_e.getLocalStreams()[0];if(void 0===t)throw new Error("PeerConnection has no existing streams, cannot addTrack");t.addTrack(e),we.generateOffer()}).then(()=>new t(e=>{we.once("signalingStateStable",()=>{e()})}));return s(r,15e3,"Renegotiation timed out")},we.setIceConfig=e=>{try{S.isFirefox&&(e.certificates=_e.getConfiguration().certificates),_e.setConfiguration(e)}catch(e){throw new p("A peer connection failed to set configuration with "+e.message,P.FAILED_SET_CONFIGURATION)}return Ve.set(!0),_e},we.removeTrack=e=>{const n=t.resolve().then(()=>e instanceof Be?(_e.getLocalStreams()[0].removeTrack(e.track),void we.generateOffer()):_e.removeTrack(e)).then(()=>new t(e=>{we.once("signalingStateStable",()=>{e()})}));return s(n,15e3,"Renegotiation timed out")},we.addLocalStream=e=>new t((t,n)=>{Le(r=>{if(r)n(r);else{try{e.getTracks&&e.getTracks().forEach(t=>_e.addTrack(t,e))}catch(e){return void n(e)}t()}})}),we.getLocalStreams=()=>_e.getLocalStreams(),we.getSenders=()=>_e.getSenders?_e.getSenders():_e.getLocalStreams()[0].getTracks().map(e=>new Be(e)),we.disconnect=()=>{var e;Ae&&(Ae.destroy(),Ae=null),(null==(e=_e)?void 0:e.signalingState)&&"closed"!==_e.signalingState.toLowerCase()&&(_e.close(),he=null,fe=null,setTimeout(Fe))},we.iceRestart=()=>Ve.set(!0),we.clearFailedTimeout=()=>clearTimeout(Ze);const Ke=e=>{const n=e?G:A;return new t(e=>{ge.enqueueOfferAnswer((0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(_e);case 2:ge.setResolved(),e();case 4:case"end":return t.stop()}}),t)}))))})};we.changeMediaDirectionToRecvOnly=()=>Ke(!1),we.changeMediaDirectionToInactive=()=>Ke(!0),we.processMessage=(e,t)=>{switch(Se.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),Se.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Oe.set(t.content.simulcastEnabled),we.generateOffer(),r();break;case"offer":Ye(t),r();break;case"answer":case"pranswer":(e=>{ae("peerConnection:processAnswer","Event");const t=e=>{De({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Re=new F({type:"answer",sdp:v(Te,"remote","answer",c({replaceBaselineProfile:le},Q),e.content.sdp).local}),_e.setRemoteDescription(Re).then(()=>{Se.debug("processAnswer: setRemoteDescription Success"),Ae&&Ae.process()}).catch(t),ge.setResolved(),S.isLegacyEdge||Je.startCollecting(_e,J)):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new M(t.content);if(Ee(n))return Se.debug("Ignore candidate",n.candidate),we;Ae&&Ae.addIceCandidate(n).catch(e=>{Se.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:Se.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function r(){pe+=1,Je.handleOfferMessageReceived(),pe>1&&(ae("Renegotiation","Attempt"),me=!0)}return we},we.stopTransceivers=e=>{_e.getTransceivers().forEach(t=>{e.includes(t.mid)&&t.stop()})},we.remoteStreams=()=>_e?je():[],we.remoteTracks=()=>_e?_e.getReceivers?Array.prototype.slice.apply(_e.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],je().map(e=>e.getTracks())):[],we.remoteDescription=()=>_e.remoteDescription,we.getStats=e=>{if(_e)E(_e,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},we.getRtcStatsReport=e=>{if(_e)x(_e,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},we.getSynchronizationSources=e=>{if(!J){if(!_e){const t=U.PEER_CONNECTION_NOT_CONNECTED;return void e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}_(_e,e)}};we.getDataChannel=(e,t,n)=>{_e?function e(t,n,r,i){let o;const s=Ce.get(n,r);if(!s){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new p(`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 p("Cannot create a DataChannel before there is a connection."))},we.getSourceStreamId=()=>ee,we.iceConnectionStateIsConnected=()=>_e&&["connected","completed"].indexOf(_e.iceConnectionState)>-1,we.findAndReplaceTrack=(e,n)=>t.resolve().then(()=>{const r=_e.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)}),we.hasRelayCandidates=()=>n,we.getNegotiatedCodecs=()=>{if(!_e.localDescription||!_e.remoteDescription)return null;const e=e=>l(g.getCodecs(_e.localDescription.sdp,e),g.getCodecs(_e.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},we.on("signalingStateStable",()=>{me&&(me=!1,ae("Renegotiation","Success",we.getNegotiatedCodecs()))}),we.on("error",e=>{let t=e.prefix;me&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(me=!1,ae("Renegotiation","Failure"))}),we.on("close",()=>{me&&(me=!1,ae("Renegotiation","Cancel"))});const Je=new W;return Je.on("stats",e=>{e.dataChannels=Ce.sampleQos(),we.trigger("qos",{parsedStats:e,simulcastEnabled:Oe.get()})}),we}}}).call(this,n(1))},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(49),i=n(659),o=n(11),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 l(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 d(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function h(e,t){return"packetsLost"in t?e+t.packetsLost:e}const f={isVideoStat(e,t){const n=d(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=d(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(h,0)},getAudioPacketsLost(e){return e.filter(t=>this.isAudioRemoteInboundRtpStat(t,e)).reduce(h,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 d=["packetsSent","packetsLost","bytesSent"],h=t?e=>r(e,["packetsReceived","packetsLost","bytesReceived"]):e=>r(e,d);if(o&&o.length>0){const e=(e=>{const t=d.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:l(e,n)},i(h(e),Number))}return s&&(u.audio=i(h(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(79),i=n(115),o=n(84),s=n(177),a=n(383),c=n(180),u=n(56),l=n(386),d=n(388),h=n(183),f=n(185),p=n(43),m=n(391),g=n(392),b=n(190),y=n(12),v=n(66),w=n(396),S=n(11),T=n(398),E=n(31),x=n(55),_={};_["[object Arguments]"]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_["[object Object]"]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_["[object Function]"]=_["[object WeakMap]"]=!1,e.exports=function e(t,n,C,I,R,Z){var k,O=1&n,V=2&n,G=4&n;if(C&&(k=R?C(t,I,R,Z):C(t)),void 0!==k)return k;if(!S(t))return t;var A=y(t);if(A){if(k=m(t),!O)return u(t,k)}else{var W=p(t),N="[object Function]"==W||"[object GeneratorFunction]"==W;if(v(t))return c(t,O);if("[object Object]"==W||"[object Arguments]"==W||N&&!R){if(k=V||N?{}:b(t),!O)return V?d(t,a(k,t)):l(t,s(k,t))}else{if(!_[W])return R?t:{};k=g(t,W,O)}}Z||(Z=new r);var L=Z.get(t);if(L)return L;Z.set(t,k),T(t)?t.forEach((function(r){k.add(e(r,n,C,r,t,Z))})):w(t)&&t.forEach((function(r,i){k.set(i,e(r,n,C,i,t,Z))}));var X=A?void 0:(G?V?f:h:V?x:E)(t);return i(X||t,(function(r,i){X&&(r=t[i=r]),o(k,i,e(r,n,C,i,t,Z))})),k}},function(e,t,n){var r=n(80),i=n(355),o=n(356),s=n(357),a=n(358),c=n(359);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(350),i=n(351),o=n(352),s=n(353),a=n(354);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(54);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(40)(Object,"create");e.exports=r},function(e,t,n){var r=n(374);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(54),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(381),i=n(68),o=n(117),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(89),i=n(193),o=n(125);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(423)()?globalThis:n(424)},function(e,t,n){var r=n(114),i=n(456),o=n(457);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(458);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(87),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(498);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(60),i=n(48);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(239),i=n(31);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";const r=n(240),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(7),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),l=n(72),d=new t,h=r.sessions.length()>0,f=r.publishers.length()>0;let p;if(h){const e=r.sessions.find(e=>"connected"===e.currentState);p=e?e.sessionId:r.sessions.find().sessionId}else p="";const m={sessionId:p,apiKey:l.value};if(f||h){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:d})}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:d})}else c=e},getProxyUrl:()=>c,clearProxyUrl:()=>{c=null}}},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";const r=n(3);e.exports=()=>"Chrome"===r.name&&r.version>=58||-1!==["Firefox","Edge","Safari","Opera"].indexOf(r.name)},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){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(1))},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,n){"use strict";const r=!!window.crypto,i=!!RTCRtpSender.prototype.createEncodedStreams||!!RTCRtpSender.prototype.createdEncodedVideoStreams,o=!!window.Worker,s=()=>r&&i&&o;e.exports=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||n(52).once,r=e.isE2eeSupported||s;return t()&&r()}},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(40)(n(15),"Map");e.exports=r},function(e,t,n){var r=n(366),i=n(373),o=n(375),s=n(376),a=n(377);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(174),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(85)(e))},function(e,t,n){var r=n(69),i=n(382),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(387),i=n(181),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(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(403),i=n(194)(r);e.exports=i},function(e,t,n){var r=n(54),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(196)()?Object.setPrototypeOf:n(197)},function(e,t,n){"use strict";var r=n(57),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(414)()?Object.assign:n(415)},function(e,t,n){"use strict";const r=n(2)("Event"),i=n(9),o=n(131);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(34),i=n(455),o=n(88),s=n(461),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(19);e.exports=function(e){return i(e)&&r(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(217),i=n(484),o=n(485),s=n(219),a=n(496),c=n(223),u=n(497),l=n(226),d=n(227),h=n(97),f=Math.max;e.exports=function(e,t,n,p,m,g,b,y){var v=2&t;if(!v&&"function"!=typeof e)throw new TypeError("Expected a function");var w=p?p.length:0;if(w||(t&=-97,p=m=void 0),b=void 0===b?b:f(h(b),0),y=void 0===y?y:h(y),w-=m?m.length:0,64&t){var S=p,T=m;p=m=void 0}var E=v?void 0:c(e),x=[e,t,n,p,m,S,T,g,b,y];if(E&&u(x,E),e=x[0],t=x[1],n=x[2],p=x[3],m=x[4],!(y=x[9]=void 0===x[9]?v?0:e.length:f(x[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?o(e,t,y):32!=t&&33!=t||m.length?s.apply(void 0,x):a(e,t,n,p);else var _=i(e,t,n);return d((E?r:l)(_,x),e,t)}},function(e,t,n){var r=n(87),i=n(137);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(30),i=n(121),o=n(19),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,l=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)==l}},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(520),i=n(193),o=n(125);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){var r=n(88),i=n(54),o=n(126),s=n(55),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 l=t[n],d=s(l),h=-1,f=d.length;++h<f;){var p=d[h],m=e[p];(void 0===m||i(m,a[p])&&!c.call(e,p))&&(e[p]=l[p])}return e}));e.exports=u},function(e,t,n){"use strict";var r=n(0)(n(47));const i=n(59),o=n(58);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(module,exports,__webpack_require__){"use strict";const extendES5Native=__webpack_require__(562),webrtcAdapter=__webpack_require__(563),logging=__webpack_require__(2)("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(0)(n(14));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(574),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){"use strict";var r=n(579);
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(p):v())},a="undefined"!=typeof window?window:void 0,c=a||{},u=c.MutationObserver||c.WebKitMutationObserver,l="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(p,1)}}var f=new Array(1e3);function p(){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,y,v=void 0;function w(e,t){var n=this,r=new this.constructor(E);void 0===r[T]&&G(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return O(i,r,o,n._result)}))}else Z(n,r,e,t);return r}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(E);return _(t,e),t}l?v=function(){return t.nextTick(p)}:u?(g=0,b=new u(p),y=document.createTextNode(""),b.observe(y,{characterData:!0}),v=function(){y.data=g=++g%2}):d?((m=new MessageChannel).port1.onmessage=p,v=function(){return m.port2.postMessage(0)}):v=void 0===a?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:h()}catch(e){return h()}}():h();var T=Math.random().toString(36).substring(2);function E(){}function x(t,n,r){n.constructor===t.constructor&&r===w&&n.constructor.resolve===S?function(e,t){1===t._state?I(e,t._result):2===t._state?R(e,t._result):Z(t,void 0,(function(t){return _(e,t)}),(function(t){return R(e,t)}))}(t,n):void 0===r?I(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?_(e,n):I(e,n))}),(function(t){r||(r=!0,R(e,t))}),e._label);!r&&i&&(r=!0,R(e,i))}),e)}(t,n,r):I(t,n)}function _(e,t){if(e===t)R(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)I(e,t);else{var n=void 0;try{n=t.then}catch(t){return void R(e,t)}x(e,t,n)}var r,i}function C(e){e._onerror&&e._onerror(e._result),k(e)}function I(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(k,e))}function R(e,t){void 0===e._state&&(e._state=2,e._result=t,s(C,e))}function Z(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?O(n,r,i,o):i(o);e._subscribers.length=0}}function O(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 R(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;void 0!==n._state||(o&&c?_(n,s):!1===c?R(n,a):1===t?I(n,s):2===t&&R(n,s))}var V=0;function G(e){e[T]=V++,e._state=void 0,e._result=void 0,e._subscribers=[]}var A=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(E),this.promise[T]||G(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&I(this.promise,this._result))):R(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===w&&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===W){var a=new n(E);s?R(a,o):x(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?R(r,n):this._result[t]=n),0===this._remaining&&I(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;Z(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),W=function(){function t(e){this[T]=V++,this._result=this._state=void 0,this._subscribers=[],E!==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){_(e,t)}),(function(t){R(e,t)}))}catch(t){R(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 W.prototype.then=w,W.all=function(e){return new A(this,e).promise},W.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."))}))},W.resolve=S,W.reject=function(e){var t=new this(E);return R(t,e),t},W._setScheduler=function(e){o=e},W._setAsap=function(e){s=e},W._asap=s,W.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=W},W.Promise=W,W},e.exports=n()}).call(this,n(44))},function(e,t,n){"use strict";const r=n(400),i=n(191),o=n(123),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,n){"use strict";const r=n(542).parse();e.exports=r},function(e,t,n){e.exports=n(534)},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(1))},function(e,t,n){"use strict";const r=n(28),i=n(18),o=n(2)("Events"),s=n(9),a=n(405);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){"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",FAILED_SET_CONFIGURATION:"OT_FAILED_SET_CONFIGURATION",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",INVALID_ENCRYPTION_SECRET:"OT_INVALID_ENCRYPTION_SECRET"}},function(e,t,n){"use strict";const r=n(245),i=n(249),o=n(6),s=n(2);r.logging=s("OT.$"),r.ElementCollection=n(246),r.env=n(3),r.ajax=n(244),r.statable=n(551),r.Analytics=n(26),r.Collection=n(248),r.domExtras=n(552),r.Error=n(250),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(142),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){var r=n(84),i=n(42),o=n(192),s=n(25),a=n(69),c=n(31),u=Object.prototype.hasOwnProperty,l=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=l},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(7),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){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(174),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();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){var r=n(536),i=n(537),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r=n(30),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(208),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 l(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:l,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++)l(arguments[r],n);return t},extend:function(e,t,n){return l(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,n){"use strict";const r=n(248),i={publishers:new r("guid"),subscribers:new r("widgetId"),sessions:new r};e.exports=i},function(e,t,n){"use strict";const r=n(2)("GlobalExceptionHandler"),i=n(6),o=n(27),s=n(550),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 l=()=>void 0!==i?i:t&&t.code,d=()=>void 0!==n?n:t&&t.message,h=c.getTitleByCode(l());r.error(`OT.exception :: title: ${h} (${l()}) msg: ${d()}`);try{const e={partnerId:s.session?s.session.apiKey:s.apiKey,sessionId:s.session?s.session.sessionId:s.sessionId};u.logError(l(),"tb.exception",h,{details:d()},e);const n=new a.ExceptionEvent(o.EXCEPTION,d(),h,l(),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(0),i=r(n(47)),o=r(n(37));const s=n(130),a=n(27);e.exports=function(e){void 0===e&&(e={});const t=e.logging||n(2)("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 l=!1,d=!1,h=!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 l||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),l=!0),[]}},{key:"streams",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),d=!0),[]}},{key:"archives",get:function(){return h||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),h=!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.CaptionReceivedEvent=function(e,t,n){return new s("caption",!1,{caption:e,streamId:t,isFinal: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(0),i=r(n(4)),o=r(n(5));e.exports=function(e){void 0===e&&(e={});const r=e.getNativeEnumerateDevices||n(288)(),s=e.getNativeMediaDevices||n(642)(),a=(e.currentAudioOutputDevice||n(108)).getCurrentAudioOutputDeviceId,c=e.env||n(3),u=e.global||(void 0!==typeof window?window:global),l={},d={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return l.getNativeMediaDevices=()=>s(),l.hasEnumerateDevicesCapability=()=>"function"==typeof r(),l.hasDeviceChangeCapability=()=>{const e=s();return!(!e||!("ondevicechange"in e))},l.hasSetSinkIdCapability=()=>"setSinkId"in(null==u?void 0:u.HTMLMediaElement.prototype),l.hasAudioOutputApiSupport=()=>l.hasSetSinkIdCapability()&&l.hasDeviceChangeCapability(),l.hasEnumerateDevicesBug=()=>c.isSafari&&13.1===c.version,l.getMediaDevices=()=>l.hasEnumerateDevicesCapability()?r()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:d[e.kind]}))):t.reject(new Error("This browser does not support enumerateDevices APIs")),l.getInputMediaDevices=()=>l.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),l.getAudioOutputMediaDevices=()=>l.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),l.shouldAskForDevices=()=>l.hasEnumerateDevicesCapability()?l.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 l.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}),l.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},l.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},l.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,l.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=l.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),l}}).call(this,n(1))},function(e,t,n){var r=n(18),i=n(116);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";var r=n(0),i=r(n(16)),o=r(n(4)),s=r(n(5)),a=r(n(47)),c=r(n(14));const u=n(241),l=n(538),d=n(143),h=n(35)(),f=n(553),p=n(6),m=n(555),g=n(558);let b=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?h.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new d:i,s=t.ajax,a=t.queue,u=t.getUserAgentClientHintData,l=void 0===u?g:u,f=t.userAgentData,p=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=l,this.userAgentData=p,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(){const e=this._analytics.proxyUrl,t=this.sessionInfo.messagingURL;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:f(e,t),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);m(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 l({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();p(b),e.exports=b},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",SUBSCRIBER_CAPTION_RECEIVED:"captionReceived",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";(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 l(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 l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return e}function d(){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 h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.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 p(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,l=m(c,u);for(n=0;n<u;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(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):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(1))},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(41),i=n(361),o=n(362),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(178),i=n(118),o=n(25);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(45);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(57),i=n(199),o=n(129),s=n(200),a=n(201);(e.exports=function(e,t){var n,i,c,u,l;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),l={value:t,configurable:n,enumerable:i,writable:c},u?o(s(u),l):l}).gs=function(e,t,n){var c,u,l,d;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],r(t)?i(t)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=t,t=n=void 0):t=void 0,r(e)?(c=a.call(e,"c"),u=a.call(e,"e")):(c=!0,u=!1),d={get:t,set:n,configurable:c,enumerable:u},l?o(s(l),d):d}},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(0),i=r(n(16)),o=r(n(47));const s=n(207),a=n(58),c=n(479),u=n(526),l=n(2)("StaticConfig"),d=n(101).prependProxyToUrlIfNeeded,h=a({version:"v2.24.4",buildHash:"aae6dca9e",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"]),p={apiUrl:"apiURL",loggingUrl:"loggingURL"},m=u(e=>p[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)({},h,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=d(n,u),r.get(`${n}/project/${o}/config.json`,{headers:{"X-TB-TOKEN-AUTH":s}}).then(e=>e.data)})().catch(e=>(l.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)({},h,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(1))},function(e,t,n){var r=n(505),i=n(511),o=n(89),s=n(12),a=n(516);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){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(8);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(78);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(360),i=n(365);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(15).Symbol;e.exports=r},function(e,t,n){var r=n(84),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],l=o?o(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),s?i(n,u,l):r(n,u,l)}return n}},function(e,t,n){var r=n(389),i=n(113),o=n(390),s=n(186),a=n(187),c=n(30),u=n(175),l=u(r),d=u(i),h=u(o),f=u(s),p=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 l:return"[object DataView]";case d:return"[object Map]";case h:return"[object Promise]";case f:return"[object Set]";case p:return"[object WeakMap]"}return t}),e.exports=m},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=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!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 p(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 p(e,t)),1!==u.length||l||a(f)},p.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(408)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(422)()?n(92).Symbol:n(425)},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(523),i=n(141)((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(589);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";const r=n(51),i=n(35)();t.check=function(e){void 0===e&&(e={});const t=e.env||n(3),r=e.hasGetUserMediaCapability||n(597),o=e.hasPeerConnectionCapability||n(598),s=e.logging||n(2)("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";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}const o=n(9),s=n(62),a=n(273),c=n(131),u=n(274),l=n(2)("SDPHelpers"),d={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=d.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:o(...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=d.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},mediaDirections:{INACTIVE:"inactive",RECVONLY:"recvonly"}};e.exports=d,d.getMLineIndex=function(e,t){const n="m="+t;return a(e,e=>-1!==e.indexOf(n))},d.getMLine=function(e,t){const n=d.getMLineIndex(e,t);return n>-1?e[n]:void 0},d.hasMediaType=(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return a(r,e=>n.test(e))>=0},d.hasMLinePayloadType=function(e,t,n){const r=d.getMLine(e,t);return d.getMLinePayloadTypes(r,t).indexOf(n)>-1},d.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(" ")},d.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},d.changeMediaDirection=function(e,t){const n=d.splitSections(e);let r=n.shift();return n.forEach(e=>{const n=e.includes("m=video")?(e=>{const n=t===d.mediaDirections.RECVONLY?"a=inactive":"a=recvonly",r=new RegExp(n,"g");return e.replace(r,"a="+t)})(e):e;r+=n}),r},d.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(" "))},d.removeMediaEncoding=function(e,t,n){let r,i,o,s,a=e.split("\r\n");const c=d.getMLineIndex(a,t),u=c>-1?a[c]:void 0,l=[];if(-1===c)return a.join("\r\n");if(r=d.getMLinePayloadTypes(u,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]=d.removeTypesFromMLine(u,l)),a.join("\r\n")},d.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")},d.removeVideoCodec=function(e,t){return d.removeMediaEncoding(e,"video",t)};const h=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]),d.hasMLinePayloadType(e,"video",i);default:return l.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};d.getAttributesForMediaType=function(e,t){let n,r,i,o,a,c,u,l,f,p;const m=d.getMLineIndex(e,t),g=new RegExp(`m=(?!${t}).+ `,"i"),b=new RegExp("a=ssrc:\\d+ .*","i"),y=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),v=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),w=[];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(y),c=e[t].match(b),void 0===n&&(a||c)&&(n=t,a&&(o=/^(FID|SIM)$/.test(a[1])?a[2]:a[1])),u=e[t].match(`a=ssrc:${o} msid:(.+)`),u&&(l=u[1]);const s=b.test(e[t]),d=y.test(e[t]);void 0!==n&&(void 0!==r||s||d?t===e.length-1&&(r=t):r=t-1);const h=e[t].match(/a=mid:(.+)/);h&&(f=h[1],p=t),i=v.exec(e[t]),i&&3===i.length&&w.push({lineIndex:t,name:i[1],value:i[2]})}return w.ssrcStartIndex=n,w.ssrcEndIndex=r,w.msid=l,w.mid=f,w.midIndex=p,w.isUsingRTX=h.bind(null,e,w),w.filterByName=function(e){return this.filter(t=>t.name===e)},w.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return s(w.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},w},d.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!d.getMLine(n,"audio"))return l.debug("No audio m-line, not enabling dtx."),e;const r=d.getAttributesForMediaType(n,"audio"),i=r.getRtpNumber("opus");if(!i)return l.debug("Could not find rtp number for opus, not enabling dtx."),e;const o=r.find(e=>e.name==="fmtp:"+i);if(!o)return l.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 f=(e,t,n)=>{const r=t.split("\r\n");if(!d.getMLine(r,"audio"))return l.debug("No audio m-line, not enabling stereo."),t;const i=d.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return l.debug("Could not find rtp number for opus, not enabling stereo."),t;const s=i.find(e=>e.name==="fmtp:"+o);if(!s)return l.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let a,c=r[s.lineIndex];switch(e){case"send":a=/sprop-stereo=\d+([\s;]*)/,a.test(s.value)?c=c.replace(a,n?"sprop-stereo=1$1":""):n&&(c+="; sprop-stereo=1");break;case"receive":a=/([^-])stereo=\d+([\s;]*)/,a.test(s.value)?c=c.replace(a,n?"$1stereo=1$2":"$1"):n&&(c+="; stereo=1");break;default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return c=c.replace(/[;\s]*$/,""),r[s.lineIndex]=c,r.join("\r\n")};d.modifySendStereo=f.bind(null,"send"),d.modifyReceiveStereo=f.bind(null,"receive"),d.setAudioBitrate=(e,t)=>{const n=d.getAudioBitrate(e);if(void 0!==n)return l.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!d.getMLine(r,"audio"))return l.debug("No audio m-line, not setting audio bitrate"),e;const i=d.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return l.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 l.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")},d.removeVideoOrientation=e=>{let t=e.split("\r\n");return t=t.filter(e=>!e.includes("urn:3gpp:video-orientation")),t.join("\r\n")},d.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),d.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),d.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},d.MAX_SSRCS=10,d.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),d.getSSRCGroup=e=>{const t=d.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},d.getSSRCGroupSSRCs=e=>{const t=d.getSSRCGroup(e);return t?t.value.split(" ").slice(0,d.MAX_SSRCS):[]},d.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");c(n,t).length&&Array.prototype.push.apply(n,t)}),u(n)},d.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=d.getAttributesForMediaType(t,"video"),r=d.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=d.getSSRCGroupSSRCs(n),i=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=i,o=d.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")},d.enableSimulcast=function(e,t){let n,r;const i=e.split("\r\n");if(!d.getMLine(i,"video"))return l.debug("No video m-line, not enabling simulcast."),e;const o=d.getAttributesForMediaType(i,"video");if(o.filterByName("ssrc-group:SIM").length>0)return l.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),d.filterExcessSSRCs(e);if(!o.msid)return l.debug("No local stream attached, not enabling simulcast."),e;const s=o.isUsingRTX(),a=[],c=[];for(r=0;r<t;++r)a.push(1e4+r),s&&c.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]} ${c[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:${c[r]} cname:localCname`,`a=ssrc:${c[r]} msid:${o.msid}`);return n.unshift(o.ssrcStartIndex,o.ssrcEndIndex-o.ssrcStartIndex+1),i.splice(...n),i.join("\r\n")},d.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),i=d.getMLineIndex(r,"video");if(-1===i)return e;const o=d.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 c=a.map(e=>e[1]);let u=o.filter(e=>-1===c.indexOf(e));"top"===n?u.unshift(...c):"bottom"===n?u.push(...c):(l.error(`Unexpected location param: ${n}; not changing ${t} priority`),u=o);const h=r[i].replace(o.join(" "),u.join(" "));return r[i]=h,r.join("\r\n")},d.getSetupRole=e=>{for(var t,n=r(e.split(/\r\n|\r|\n/));!(t=n()).done;){const e=t.value.match(/^a=setup:(\w+)/);if(e)return e[1]}return""},d.setSetupRole=(e,t)=>e.split(/\r\n|\r|\n/).map(e=>e.match(/^a=setup:(\w+)/)?"a=setup:"+t:e).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),i=n(384),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(78);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(99);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(140),o=n(236),s=n(61);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(513);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(612)(n(273));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(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(379),i=n(19),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(15),i=n(380),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(85)(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(30),i=n(19);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";if("Node"===n(8).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";(function(t){var r=n(0),i=r(n(4)),o=r(n(5));const s=n(155),a=n(50),c=n(9),u=n(58),l=n(131),d=n(272),h=n(17),f=n(6),p=n(250),m=n(156),g=n(53),b=n(74),y=n(615);e.exports=function(e){void 0===e&&(e={});const r=e.hasValidPeerConnection||n(616),v=e.applySdpTransform||n(157),w=e.createPeerConnection||n(617),S=e.env||n(3),T=e.sdpTransformDefaults||n(619),E=e.getStatsAdapter||n(275),x=e.getRtcStatsReportAdapter||n(278),_=e.getSynchronizationSources||n(623),C=e.IceCandidateProcessor||n(624),I=e.logging||n(2),R=e.offerProcessor||n(626),Z=e.PeerConnectionChannels||n(628),k=e.subscribeProcessor||n(630),O=n(631),V=e.changeMediaDirection||n(633),G=V.changeMediaDirectionToInactive,A=V.changeMediaDirectionToRecvOnly,W=e.Qos||n(279).default,N=e.global||(void 0!==typeof window?window:global),L=e.debounce||n(637),X=e.needsToSwapH264Profiles||n(639).once,M=e.NativeRTCIceCandidate||N.RTCIceCandidate,F=e.NativeRTCSessionDescription||N.RTCSessionDescription,P=e.Errors||n(7),j=e.OTErrorClass||n(22),U=e.ExceptionCodes||n(10),H=e.hasPictureInPictureBug||n(640),Y=()=>{};return function(e){void 0===e&&(e={});let n=!1;const V=e,D=V.iceConfig,B=void 0===D?{servers:[]}:D,K=V.sendMessage,J=V.isPublisher,z=V.offerOverrides,Q=V.answerOverrides,q=V.p2p,$=V.codecFlags,ee=V.sourceStreamId,te=V.keyStore,ne=V.sFrameClientStore,re=V.isE2ee;let ie,oe=e,se=oe.logAnalyticsEvent,ae=void 0===se?Y:se,ce=oe.remoteConnectionId,ue=!1;const le=X();let de,he,fe,pe=0,me=!1;const ge=new O(ae),be=m();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")}}K(e,t)}const ve=a();ae("createPeerConnection","Attempt");const we={};we.id=h();const Se=I("PeerConnection:"+we.id);Se.debug("construct",{id:we.id,options:e});const Te=T,Ee=e=>"relay"===B.transportPolicy&&null!=e&&-1===e.candidate.indexOf("typ relay"),xe=d(e,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage"]);let _e,Ce,Ie,Re,Ze,ke=[];const Oe=(()=>{let e=xe.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&xe.capableSimulcastStreams>1;n!==e&&void 0===xe.overrideSimulcastEnabled&&(e=n,we.generateOffer())}}})(),Ve=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e&&!we.iceConnectionStateIsConnected()?we.generateOffer():Se.debug("iceRestart is going to wait until we disconnect and then restart ice"))}}})(),Ge={clean(){delete this.promise,delete this.resolve,delete this.reject}};Ge.promise=new t((e,t)=>{Ge.resolve=e,Ge.reject=t});let Ae=new C,We="new";Object.defineProperty(we,"signalingState",{get:()=>_e.signalingState,set:e=>(_e.signalingState=e,e)}),f(we),we.addOptions=e=>{ce=e.remoteConnectionId,ae=e.logAnalyticsEvent},we.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(re){e.next=2;break}return e.abrupt("return");case 2:return fe=y(t),e.next=5,ne.createSender(fe);case 5:return he=e.sent,e.next=8,te.get();case 8:return n=e.sent,e.next=11,he.setSenderEncryptionKey(n);case 11:te.on("keyChanged",e=>{he.setSenderEncryptionKey(e)}),_e.getTransceivers().forEach(e=>he.encrypt(e.mid,e.sender));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we.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()-ve,10),hasRelayCandidates:n,proxyInfo:""},_e&&_e.proxyInfo&&(t.proxyInfo=_e.proxyInfo),ae("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),Ge.resolve();const Ne=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,te.get();case 2:if(t=e.sent,fe=y(ce),de=ne.getReceiver(fe),de){e.next=14;break}return e.next=8,ne.createReceiver(fe);case 8:de=e.sent,de.addReceiver(fe),de.setReceiverEncryptionKey(fe,t),te.on("keyChanged",e=>{de.setReceiverEncryptionKey(fe,e)}),de.addEventListener("decryptFailed",()=>{we.trigger("decryptFailed")}),de.addEventListener("decryptionRestored",()=>{we.trigger("decryptRestored")});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=e=>{if(Se.debug("internalCreatePeerConnection: called"),_e)return Se.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,_e);if(ke.push(e),!(ke.length>1)){if(Se.debug(`Creating peer connection config "${JSON.stringify(xe)}".`),0===B.servers.length&&(Se.error("No ice servers present"),ae("Error","noIceServers")),"relay"===B.transportPolicy){const e=e=>e&&0===e.indexOf("turn");B.servers=B.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)}xe.iceTransportPolicy=B.transportPolicy,xe.iceServers=B.servers,re&&(xe.forceEncodedVideoInsertableStreams=!0,xe.forceEncodedAudioInsertableStreams=!0,xe.encodedInsertableStreams=!0),r(N.RTCPeerConnection).then(e=>{if(!e)throw Se.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return w({window:N,config:xe})}).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(J||!re){e.next=3;break}return e.next=3,Ne();case 3:Xe(null,t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>Xe(e))}},Xe=(e,t)=>{if(e)return De({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(ke=[]);Se.debug("OT attachEventsToPeerConnection"),_e=t,Ae&&Ae.setPeerConnection(t),Ce=new Z(_e),xe.channels&&Ce.addMany(xe.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:Se}),r=e=>{Ge.resolve(),Ee(e.candidate)?Se.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:Ue(t),!J&&de&&de.decrypt(t.transceiver.mid,t.receiver);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let a=_e.iceConnectionState;const c=e=>{_e?(Se.debug("iceconnectionstatechange",_e.iceConnectionState),"connected"===_e.iceConnectionState?("disconnected"===a&&we.clearFailedTimeout(),we.emit("iceConnected"),Ve.set(!1)):"completed"===_e.iceConnectionState&&S.isLegacyEdge&&setTimeout(()=>Je.startCollecting(_e),1e3)):Se.debug("iceconnectionstatechange on peerConnection that no longer exists",we);const t=e.target.iceConnectionState;we.trigger("iceConnectionStateChange",t),ae("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(Ve.get()?(Se.debug("Restarting ice!"),we.generateOffer()):b()||(Ze=setTimeout(()=>{ae("attachEventsToPeerConnection","iceconnectionstatechange","failed"),a="failed",we.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==a&&"failed"===t&&De({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=()=>{ae("peerConnection:negotiationNeeded","Event"),J&&we.generateOffer(),we.trigger("negotiationNeeded")};_e.addEventListener("track",s),_e.addEventListener("icecandidate",r),_e.addEventListener("signalingstatechange",Pe),_e.addEventListener("negotiationneeded",u),_e.addEventListener("iceconnectionstatechange",c),be.add(()=>{_e&&(_e.removeEventListener("track",s),_e.removeEventListener("icecandidate",r),_e.removeEventListener("signalingstatechange",Pe),_e.removeEventListener("negotiationneeded",u),_e.removeEventListener("iceconnectionstatechange",c))}),Me(null)},Me=()=>{for(;ke.length;)ke.shift().call(null)},Fe=()=>{Ae&&(Ae.destroy(),Ae=null),ke=[],Je.stopCollecting(),be.releaseAll(),Ge.clean(),null!==_e&&(_e.destroy&&_e.destroy(),_e=null,we.trigger("close")),we.off()},Pe=e=>{const t=e.target.signalingState;if(we.emit("signalingStateChange",t),"stable"===t&&we.emit("signalingStateStable"),t&&t!==We)switch(We=t,Se.debug("stateChange: "+We),We){case"closed":Fe()}},je=()=>{let e;if(_e.getRemoteStreams)e=_e.getRemoteStreams();else{if(!_e.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=_e.remoteStreams}return Array.prototype.slice.call(e)},Ue=e=>{var t;const n=e.track,r=e.transceiver,i=e.stream||(null==(t=e.streams)?void 0:t[0]);ae("createPeerConnection","TrackAdded"),we.trigger("trackAdded",{stream:i,track:n,transceiver:r})},He=(e,t,n)=>{ue=!1,De({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Ye=e=>{if(ue)return void(ie=e);ue=!0,ae("peerConnection:processOffer","Event");const t=new F({type:"offer",sdp:e.content.sdp}),n=e=>{ue=!1,Ae&&Ae.process(),ye("answer",e),S.isLegacyEdge||Je.startCollecting(_e,J),ie&&(Ye(ie),ie=null)},r=e=>we.trigger("remoteVideoSupported",e);Le(()=>{R(_e,N.RTCPeerConnection,N.RTCSessionDescription,F,Te,t,$,q,n,He,r,le,ee)})};we.generateOffer=L(()=>{ge.enqueueOfferAnswer(()=>(()=>{var e,t;if("closed"===(null==(e=_e)||null==(t=e.signalingState)?void 0:t.toLowerCase()))return;ae("peerConnection:processSubscribe","Event"),Se.debug("processSubscribe: Sending offer to subscriber.");let n=Oe.get()?xe.capableSimulcastStreams:1;"P2P"===ee&&!q&&(n=1),Le(()=>{k({peerConnection:_e,NativeRTCSessionDescription:F,sdpTransforms:Te,numSimulcastStreams:n,removeVideoOrientation:H(),offerOverrides:z,offerConstraints:{iceRestart:Ve.get()},replaceBaselineProfile:le}).then(e=>{Se.debug("processSubscribe: got offer, waiting for _readyToSendOffer"),Ie=e,Ge.promise.then(()=>{Se.debug("processSubscribe: sending offer"),ye("offer",Ie)})},e=>{De({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),Ve.set(!1)})})())},100);const De=e=>{let t=e.reason,n=e.prefix;Se.error(t,"in state",_e?{connectionState:_e.connectionState,iceConnectionState:_e.iceConnectionState,iceGatheringState:_e.iceGatheringState,signalingState:_e.signalingState}:"(none)"),we.trigger("error",{reason:t,prefix:n})};function Be(e){this.track=e}we.addTrack=(e,n)=>{const r=new t((e,t)=>{Le(n=>{if(n)return t(n);e()})}).then(()=>{if(_e.addTrack)return _e.addTrack(e,n);const t=_e.getLocalStreams()[0];if(void 0===t)throw new Error("PeerConnection has no existing streams, cannot addTrack");t.addTrack(e),we.generateOffer()}).then(()=>new t(e=>{we.once("signalingStateStable",()=>{e()})}));return s(r,15e3,"Renegotiation timed out")},we.setIceConfig=e=>{try{S.isFirefox&&(e.certificates=_e.getConfiguration().certificates),_e.setConfiguration(e)}catch(e){throw new p("A peer connection failed to set configuration with "+e.message,P.FAILED_SET_CONFIGURATION)}return Ve.set(!0),_e},we.removeTrack=e=>{const n=t.resolve().then(()=>e instanceof Be?(_e.getLocalStreams()[0].removeTrack(e.track),void we.generateOffer()):_e.removeTrack(e)).then(()=>new t(e=>{we.once("signalingStateStable",()=>{e()})}));return s(n,15e3,"Renegotiation timed out")},we.addLocalStream=e=>new t((t,n)=>{Le(r=>{if(r)n(r);else{try{e.getTracks&&e.getTracks().forEach(t=>_e.addTrack(t,e))}catch(e){return void n(e)}t()}})}),we.getLocalStreams=()=>_e.getLocalStreams(),we.getSenders=()=>_e.getSenders?_e.getSenders():_e.getLocalStreams()[0].getTracks().map(e=>new Be(e)),we.disconnect=()=>{var e;Ae&&(Ae.destroy(),Ae=null),(null==(e=_e)?void 0:e.signalingState)&&"closed"!==_e.signalingState.toLowerCase()&&(_e.close(),he=null,fe=null,setTimeout(Fe))},we.iceRestart=()=>Ve.set(!0),we.clearFailedTimeout=()=>clearTimeout(Ze);const Ke=e=>{const n=e?G:A;return new t(e=>{ge.enqueueOfferAnswer((0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(_e);case 2:ge.setResolved(),e();case 4:case"end":return t.stop()}}),t)}))))})};we.changeMediaDirectionToRecvOnly=()=>Ke(!1),we.changeMediaDirectionToInactive=()=>Ke(!0),we.processMessage=(e,t)=>{switch(Se.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),Se.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Oe.set(t.content.simulcastEnabled),we.generateOffer(),r();break;case"offer":Ye(t),r();break;case"answer":case"pranswer":(e=>{ae("peerConnection:processAnswer","Event");const t=e=>{e.includes("Failed to parse SessionDescription. a=extmap-allow-mixed Expects at least 2 fields.")&&(e="SessionDescription issue has been fixed in Chrome 71 and above. Please update your browser."),De({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Re=new F({type:"answer",sdp:v(Te,"remote","answer",c({replaceBaselineProfile:le},Q),e.content.sdp).local}),_e.setRemoteDescription(Re).then(()=>{Se.debug("processAnswer: setRemoteDescription Success"),Ae&&Ae.process()}).catch(t),ge.setResolved(),S.isLegacyEdge||Je.startCollecting(_e,J)):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new M(t.content);if(Ee(n))return Se.debug("Ignore candidate",n.candidate),we;Ae&&Ae.addIceCandidate(n).catch(e=>{Se.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:Se.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function r(){pe+=1,Je.handleOfferMessageReceived(),pe>1&&(ae("Renegotiation","Attempt"),me=!0)}return we},we.stopTransceivers=e=>{_e.getTransceivers().forEach(t=>{e.includes(t.mid)&&t.stop()})},we.remoteStreams=()=>_e?je():[],we.remoteTracks=()=>_e?_e.getReceivers?Array.prototype.slice.apply(_e.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],je().map(e=>e.getTracks())):[],we.remoteDescription=()=>_e.remoteDescription,we.getStats=e=>{if(_e)E(_e,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},we.getRtcStatsReport=e=>{if(_e)x(_e,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},we.getSynchronizationSources=e=>{if(!J){if(!_e){const t=U.PEER_CONNECTION_NOT_CONNECTED;return void e(new p(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}_(_e,e)}};we.getDataChannel=(e,t,n)=>{_e?function e(t,n,r,i){let o;const s=Ce.get(n,r);if(!s){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new p(`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 p("Cannot create a DataChannel before there is a connection."))},we.getSourceStreamId=()=>ee,we.iceConnectionStateIsConnected=()=>_e&&["connected","completed"].indexOf(_e.iceConnectionState)>-1,we.findAndReplaceTrack=(e,n)=>t.resolve().then(()=>{const r=_e.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)}),we.hasRelayCandidates=()=>n,we.getNegotiatedCodecs=()=>{if(!_e.localDescription||!_e.remoteDescription)return null;const e=e=>l(g.getCodecs(_e.localDescription.sdp,e),g.getCodecs(_e.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},we.on("signalingStateStable",()=>{me&&(me=!1,ae("Renegotiation","Success",we.getNegotiatedCodecs()))}),we.on("error",e=>{let t=e.prefix;me&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(me=!1,ae("Renegotiation","Failure"))}),we.on("close",()=>{me&&(me=!1,ae("Renegotiation","Cancel"))});const Je=new W;return Je.on("stats",e=>{e.dataChannels=Ce.sampleQos(),we.trigger("qos",{parsedStats:e,simulcastEnabled:Oe.get()})}),we}}}).call(this,n(1))},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(49),i=n(659),o=n(11),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 l(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 d(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function h(e,t){return"packetsLost"in t?e+t.packetsLost:e}const f={isVideoStat(e,t){const n=d(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=d(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(h,0)},getAudioPacketsLost(e){return e.filter(t=>this.isAudioRemoteInboundRtpStat(t,e)).reduce(h,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 d=["packetsSent","packetsLost","bytesSent"],h=t?e=>r(e,["packetsReceived","packetsLost","bytesReceived"]):e=>r(e,d);if(o&&o.length>0){const e=(e=>{const t=d.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:l(e,n)},i(h(e),Number))}return s&&(u.audio=i(h(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(79),i=n(115),o=n(84),s=n(177),a=n(383),c=n(180),u=n(56),l=n(386),d=n(388),h=n(183),f=n(185),p=n(43),m=n(391),g=n(392),b=n(190),y=n(12),v=n(66),w=n(396),S=n(11),T=n(398),E=n(31),x=n(55),_={};_["[object Arguments]"]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_["[object Object]"]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_["[object Function]"]=_["[object WeakMap]"]=!1,e.exports=function e(t,n,C,I,R,Z){var k,O=1&n,V=2&n,G=4&n;if(C&&(k=R?C(t,I,R,Z):C(t)),void 0!==k)return k;if(!S(t))return t;var A=y(t);if(A){if(k=m(t),!O)return u(t,k)}else{var W=p(t),N="[object Function]"==W||"[object GeneratorFunction]"==W;if(v(t))return c(t,O);if("[object Object]"==W||"[object Arguments]"==W||N&&!R){if(k=V||N?{}:b(t),!O)return V?d(t,a(k,t)):l(t,s(k,t))}else{if(!_[W])return R?t:{};k=g(t,W,O)}}Z||(Z=new r);var L=Z.get(t);if(L)return L;Z.set(t,k),T(t)?t.forEach((function(r){k.add(e(r,n,C,r,t,Z))})):w(t)&&t.forEach((function(r,i){k.set(i,e(r,n,C,i,t,Z))}));var X=A?void 0:(G?V?f:h:V?x:E)(t);return i(X||t,(function(r,i){X&&(r=t[i=r]),o(k,i,e(r,n,C,i,t,Z))})),k}},function(e,t,n){var r=n(80),i=n(355),o=n(356),s=n(357),a=n(358),c=n(359);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(350),i=n(351),o=n(352),s=n(353),a=n(354);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(54);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(40)(Object,"create");e.exports=r},function(e,t,n){var r=n(374);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(54),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(381),i=n(68),o=n(117),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(89),i=n(193),o=n(125);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(423)()?globalThis:n(424)},function(e,t,n){var r=n(114),i=n(456),o=n(457);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(458);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(87),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(498);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(60),i=n(48);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(239),i=n(31);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";const r=n(240),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(7),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),l=n(72),d=new t,h=r.sessions.length()>0,f=r.publishers.length()>0;let p;if(h){const e=r.sessions.find(e=>"connected"===e.currentState);p=e?e.sessionId:r.sessions.find().sessionId}else p="";const m={sessionId:p,apiKey:l.value};if(f||h){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:d})}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:d})}else c=e},getProxyUrl:()=>c,clearProxyUrl:()=>{c=null}}},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";const r=n(3);e.exports=()=>"Chrome"===r.name&&r.version>=58||-1!==["Firefox","Edge","Safari","Opera"].indexOf(r.name)},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){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(1))},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,n){"use strict";const r=!!window.crypto,i=!!RTCRtpSender.prototype.createEncodedStreams||!!RTCRtpSender.prototype.createdEncodedVideoStreams,o=!!window.Worker,s=()=>r&&i&&o;e.exports=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||n(52).once,r=e.isE2eeSupported||s;return t()&&r()}},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(40)(n(15),"Map");e.exports=r},function(e,t,n){var r=n(366),i=n(373),o=n(375),s=n(376),a=n(377);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(174),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(85)(e))},function(e,t,n){var r=n(69),i=n(382),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(387),i=n(181),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(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(403),i=n(194)(r);e.exports=i},function(e,t,n){var r=n(54),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(196)()?Object.setPrototypeOf:n(197)},function(e,t,n){"use strict";var r=n(57),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(414)()?Object.assign:n(415)},function(e,t,n){"use strict";const r=n(2)("Event"),i=n(9),o=n(131);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(34),i=n(455),o=n(88),s=n(461),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(19);e.exports=function(e){return i(e)&&r(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(217),i=n(484),o=n(485),s=n(219),a=n(496),c=n(223),u=n(497),l=n(226),d=n(227),h=n(97),f=Math.max;e.exports=function(e,t,n,p,m,g,b,y){var v=2&t;if(!v&&"function"!=typeof e)throw new TypeError("Expected a function");var w=p?p.length:0;if(w||(t&=-97,p=m=void 0),b=void 0===b?b:f(h(b),0),y=void 0===y?y:h(y),w-=m?m.length:0,64&t){var S=p,T=m;p=m=void 0}var E=v?void 0:c(e),x=[e,t,n,p,m,S,T,g,b,y];if(E&&u(x,E),e=x[0],t=x[1],n=x[2],p=x[3],m=x[4],!(y=x[9]=void 0===x[9]?v?0:e.length:f(x[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?o(e,t,y):32!=t&&33!=t||m.length?s.apply(void 0,x):a(e,t,n,p);else var _=i(e,t,n);return d((E?r:l)(_,x),e,t)}},function(e,t,n){var r=n(87),i=n(137);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(30),i=n(121),o=n(19),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,l=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)==l}},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(520),i=n(193),o=n(125);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){var r=n(88),i=n(54),o=n(126),s=n(55),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 l=t[n],d=s(l),h=-1,f=d.length;++h<f;){var p=d[h],m=e[p];(void 0===m||i(m,a[p])&&!c.call(e,p))&&(e[p]=l[p])}return e}));e.exports=u},function(e,t,n){"use strict";var r=n(0)(n(47));const i=n(59),o=n(58);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(module,exports,__webpack_require__){"use strict";const extendES5Native=__webpack_require__(562),webrtcAdapter=__webpack_require__(563),logging=__webpack_require__(2)("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(0)(n(14));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(574),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){"use strict";var r=n(579);
18
18
  /*!
19
19
  * The buffer module from node.js, for the browser.
20
20
  *
@@ -23,7 +23,7 @@
23
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(580),a=Object.prototype.hasOwnProperty,c=Array.prototype.slice,u="foo"===function(){}.name;function l(e){return Object.prototype.toString.call(e)}function d(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 h=e.exports=y,f=/\s*function\s+([^\(\s]*)\s*/;function p(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=p(e);return"[Function"+(t?": "+t:"")+"]"}function b(e,t,n,r,i){throw new h.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function y(e,t){e||b(e,!0,t,"==",h.ok)}function v(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(d(e)&&d(t)&&l(e)===l(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=w(e),o=w(t);if(i&&!o||!i&&o)return!1;if(i)return e=c.call(e),t=c.call(t),v(e,t,n);var a,u,l=E(e),d=E(t);if(l.length!==d.length)return!1;for(l.sort(),d.sort(),u=l.length-1;u>=0;u--)if(l[u]!==d[u])return!1;for(u=l.length-1;u>=0;u--)if(a=l[u],!v(e[a],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(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 T(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}h.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=p(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(h.AssertionError,Error),h.fail=b,h.ok=y,h.equal=function(e,t,n){e!=t&&b(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&b(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){v(e,t,!1)||b(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){v(e,t,!0)||b(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){v(e,t,!1)&&b(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){v(t,n,!0)&&b(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&b(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&b(e,t,n,"!==",h.notStrictEqual)},h.throws=function(e,t,n){T(!0,e,t,n)},h.doesNotThrow=function(e,t,n){T(!1,e,t,n)},h.ifError=function(e){if(e)throw e},h.strict=r((function e(t,n){t||b(t,!0,n,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var E=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(587),i=n(265),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(268),i=n(6),o=n(2)("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(595),i=n(2)("StylableComponent"),o=n(596),s=n(269);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(51),i=n(35)(),o=n(26),s=n(72),a=n(148),c=n(52).once,u=n(599),l=n(8),d=n(2)("systemRequirements"),h=n(600),f=n(601),p=i.onlyLocal(),m=new o,g=r(()=>{m.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:s.value,payload:{userAgent:l.env.userAgent}})}),b=r(()=>{n(602)()});let y=!1;e.exports={check(){d.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?l.env.name.toLowerCase()in p.minimumVersion:n,i=t.userAgent,o=void 0===i?navigator.userAgent:i;a.onLoad(()=>{if(y)return;const e=new f(h);let t;y=!0,e.on("close",()=>{y=!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(0),i=r(n(37)),o=r(n(603));const s=n(607);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(1))},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(2)("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 l=s(i,o);return l.local===o?r.debug(c+": not modified"):r.debug(`${c}: modified to:\n${l.local}`),l}},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(0);t.__esModule=!0,t.default=void 0;var i=r(n(59));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(39);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(281)(),o=e.electronExtensionHelper||n(645)(),s=e.Errors||n(7),a=e.firefoxExtensionHelper||n(647),c=e.getDisplayMediaExtensionHelper||n(289),u=e.otError||n(13)(),l=e.OTHelpers||n(8),d={extensionByKind:{},extensionClasses:{},registerExtensionHelper:(e,t)=>{d.extensionClasses[e]=t,t.autoRegisters&&t.isSupportedInThisBrowser&&d.registerExtension(e)},registerExtension:function(e){if(null==d.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=d.extensionClasses[e].register(...n);d.extensionByKind[e]=i}},h=()=>{const e=r(Object.keys(d.extensionClasses).sort(e=>"electron"===e?-1:1),e=>d.extensionClasses[e].isSupportedInThisBrowser);return void 0===e?{}:{name:e,proto:d.extensionClasses[e],instance:d.extensionByKind[e]}};d.pickHelper=()=>h(),d.checkCapability=e=>{const t={supported:!1,extensionRequired:void 0,extensionRegistered:void 0,extensionInstalled:void 0,supportedSources:{}},n=h();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"===l.env.name?n:void 0,e(t)})}else setTimeout(e.bind(null,t))},d.registerExtensionHelper("electron",o),d.registerExtensionHelper("getDisplayMedia",c),d.registerExtensionHelper("chrome",i),d.registerExtensionHelper("firefox",a);const f=()=>{};return d.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)=>{d.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=d.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";l.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"===l.env.name&&l.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)))}})})},d}}).call(this,n(1))},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(7),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}`,l=o[s]||{},d="string"==typeof l?l:l[e],h="Publisher"===c?r.UNABLE_TO_PUBLISH:r.UNABLE_TO_SUBSCRIBE;if(!d){const e=new Error(u);return e.code=h,e}const f="ICEWorkflow"===s?"Publisher"===c?r.PUBLISHER_ICE_WORKFLOW_FAILED:r.SUBSCRIBER_ICE_WORKFLOW_FAILED:d===t.STREAM_LIMIT_EXCEEDED?r.STREAM_LIMIT_EXCEEDED:h;return i(d,new Error(u),f)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||n(8),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(0),i=r(n(4)),o=r(n(5)),s=r(n(47)),a=r(n(14));const c=n(6),u=n(664),l=n(2)("WidgetView"),d=n(8),h=n(3),f=n(166),p=f.default,m=f.CancellationError,g=n(167),b=n(666),y=n(667),v=n(668),w=n(669),S=n(670),T=n(63),E=n(110);E();e.exports=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?l:n,f=t.OTHelpers,x=void 0===f?d:f,_=t.waitForVideoToBePlaying,C=void 0===_?y:_,I=t.VideoElementFacade,R=void 0===I?E():I,Z=t.env,k=void 0===Z?h:Z;const O=u({window:void 0!==typeof window?window:global}),V=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,l=n.height,d=void 0===l?198:l,h=n.fitMode,f=void 0===h?"cover":h,p=n.mirror,m=void 0!==p&&p,g=n.insertMode,b=n.classNames,y=n.style,E=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=E,this._fitMode=f,this._insertDefaultUI=o;const _=T(this._widgetContainer);if(_.on("click",this.userGesture.bind(this)),_.on("touchstart",this.userGesture.bind(this),!!O&&{passive:!0}),this.once("destroy",()=>_.removeAll()),this._widgetContainer.classList.add("OT_widget-container"),this._widgetContainer.style.width="100%",this._widgetContainer.style.height="100%",!1!==o){this._container=w(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(d),this._container.style.overflow="hidden",v(this._container),m&&x.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=x(this._container).observeSize(()=>v(this._container))[0],n=x.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 C=document.createElement("div");C.classList.add("OT_video-loading");const I=document.createElement("div");I.classList.add("OT_video-loading-spinner"),C.appendChild(I),this._widgetContainer.appendChild(C),y&&y.backgroundImageURI&&this.setBackgroundImageURI(y.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>`,x.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&&(x.removeElement(this._container),this._container=null)},t.setBackgroundImageURI=function(e){x.css(this._posterContainer,"backgroundImage",`url(${e})`),x.css(this._posterContainer,"backgroundSize","contain"),x.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,C(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 R({defaultAudioVolume:parseFloat(n),fallbackText:i,fitMode:this._fitMode,_inject:t,muted:o,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,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 p;return this._cancelBind=e,this.once("destroy",()=>e.cancel()),e},t._triggerVideoElementCreated=function(){const e=e=>{this.trigger("videoElementCreated",e),this._insertDefaultUI&&x.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()||!(t.getVideoTracks().length>0)){e.next=5;break}return r.debug("Waiting for correct resolution"),e.next=4,b(this._videoElementFacade,5e3);case 4:r.debug(`Resolution: ${this._videoElementFacade.videoWidth()}x${this._videoElementFacade.videoHeight()}`);case 5: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,l,d,h,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}),l=!!this._videoElementFacade,h=this._getNewBindCancellation(),l){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(d=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,h);case 24:return l||this._triggerVideoElementCreated(),V(h),f=C(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"),V(h),d&&(d.remove&&d.remove(),d=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?!x.isDisplayNone(this._posterContainer):(this._showPoster=e,x[e?"show":"hide"](this._posterContainer),this.showPoster())},t.poster=function(e){return void 0===e?x.css(this._posterContainer,"backgroundImage"):(this._poster=e,x.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(665)),i=o(n(303));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(1))},function(e,t,n){"use strict";e.exports=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(4)),o=r(n(5)),s=r(n(16));const a=n(59),c=n(149),u=n(9),l=n(58),d=n(62),h=n(276),f=n(49),p=n(51),m=n(683),g=n(17),b=n(259),y=n(195),v=n(166),w=v.CancellationError,S=v.default,T=n(3),E=n(693),x=n(313),_=n(76),C=n(27),I=n(6),R=n(109),Z=n(130),k=n(26),O=n(75),V=n(156),G=n(694),A=n(165)(),W=n(695),N=n(696),L=n(167),X=n(24)().getInputMediaDevices,M=n(697),F=n(270),P=n(311),j=n(698),U=n(699),H=n(292),Y=H.setVideoContentHint,D=H.getVideoContentHint,B=n(168),K=n(312),J=n(700),z=J.AudioFallbackStateMachine,Q=J.AudioFallbackVideoStates;e.exports=function(e){void 0===e&&(e={});let r=e,v=(0,s.default)({},r);["processPubOptions"].forEach(e=>{c(v[e],e+" dependency must be injected into Publisher")});const H=v.AnalyticsHelper||k,J=v.AudioFallbackStateMachine||z,q=v.calculateCapableSimulcastStreams||n(252),$=v.createChromeMixin||n(282)(),ee=v.deviceHelpers||n(24)(),te=v.EnvironmentLoader||n(148),ne=v.Errors||n(7),re=v.Events||n(23)(),ie=v.ExceptionCodes||n(10),oe=v.interpretPeerConnectionError||n(163)(),se=v.IntervalRunner||O,ae=v.logging||n(2)("Publisher"),ce=v.Microphone||n(293)(),ue=v.otError||n(13)(),le=v.OTErrorClass||n(22),de=v.OTHelpers||n(8),he=v.parseIceServers||n(103).parseIceServers,fe=v.PUBLISH_MAX_DELAY||n(267),pe=v.PublisherPeerConnection||n(297)(),me=v.PublishingState||n(302)(),ge=v.StreamChannel||n(151),be=v.systemRequirements||n(154),ye=v.VideoOrientation||n(152)(),ve=v.WidgetView||A,we=v.global||(void 0!==typeof window?window:global),Se=v.createSendMethod||n(309),Te=v.setEncodersActiveState||E,Ee=v.MediaProcessor||n(701),xe=n(706),_e=v.shouldLogMediaProcessorEvents||n(707),Ce=v.processPubOptions;return function(e){var n=this;void 0===e&&(e={});let r=I({});const c=new y,v=new K,E=e=>c.get(e);I(this);const k=V();let O,A,z,Ie=new H;be.check()||be.upgrade();const Re={};let Ze,ke,Oe,Ve,Ge,Ae,We,Ne,Le,Xe,Me,Fe,Pe,je,Ue,He=!1;const Ye={},De={};let Be;let Ke,Je,ze=!1;const Qe=()=>this.session||Je||{isConnected:()=>!1},qe=[],$e=new Ee;function et(){return{connectionId:Qe().isConnected()?Qe().connection.connectionId:null,streamId:A,widgetType:"Publisher"}}this.once("publishComplete",e=>{var t;e||(He=!0,Me=(null==(t=this.session)?void 0:t.sessionInfo.p2pEnabled)?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{Me=e,v.finishTransitionTo(Me)}),this.on("audioAcquisitionProblem",e=>{let t=e.method;Et("publisher:audioAcquisitionProblem","Event",{didPublishComplete:He,method:t})});const tt=e=>{const t=Object.keys(ne).map(e=>ne[e]),n=ue(t.indexOf(e.name)>-1?e.name:ne.MEDIA_ERR_ABORTED,e,ie.UNABLE_TO_PUBLISH);ae.error(`onStreamAvailableError ${n.name}: ${n.message}`),Oe.set("Failed"),O&&(O.destroy(),O=null);const r={failureReason:"GetUserMedia",failureCode:ie.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};_t("Failure",{},r),le.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ie}),this.trigger("publishComplete",n)},nt=e=>{const t=l(e);t.code=ie.UNABLE_TO_PUBLISH,ae.error("OT.Publisher.onScreenSharingError "+t.message),Oe.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),_t("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),O&&(O.destroy(),O=null)},rt=e=>{const t=l(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==(void 0!==typeof window?window:global).location.protocol&&(pt?t.message+=" Note: https:// is required for screen sharing.":F()&&"localhost"!==de.env.hostName&&(t.message+=` Note: ${de.env.name} requires HTTPS for camera and microphone access.`)),n&&!pt&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),ae.error(t.message),Oe.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=ie.UNABLE_TO_PUBLISH,O&&(O.destroy(),O=null),_t("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent(new Z(C.ACCESS_DENIED))},it=e=>{throw e.name===ne.USER_MEDIA_ACCESS_DENIED||e.name===ne.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?rt(e):Ce.isScreenSharing?nt(e):tt(e),e},ot=()=>{Et("accessDialog","Opened"),this.dispatchEvent(new Z(C.ACCESS_DIALOG_OPENED,!0))},st=()=>{Et("accessDialog","Closed"),this.dispatchEvent(new Z(C.ACCESS_DIALOG_CLOSED,!1))},at=g(),ct={};let ut=!1,lt={},dt=!1,ht=Ce(e,"OT.Publisher",()=>Oe&&Oe.isDestroyed());ht.on({accessDialogOpened:ot,accessDialogClosed:st});const ft=ht,pt=ft.isScreenSharing,mt=ft.isCustomAudioTrack,gt=ft.isCustomVideoTrack,bt=ft.shouldAllowAudio,yt=ft.properties,vt=ft.getUserMedia;function wt(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const St=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>wt(e)),r.on("streamChange",()=>{wt(e);const t=z.getAudioTracks().map(e=>St(e,"ended",()=>{dt=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>wt(e)),r.on("streamChange",()=>{wt(e),Tt()||z.getTracks().forEach(t=>{t.addEventListener&&(e.push(St(t,"mute",()=>{sn()})),e.push(St(t,"unmute",()=>{sn()})))})})}();const Tt=()=>{if(pt)return!0;const e=["text","detail"].includes(yt.videoContentHint);return gt&&e},Et=e.logAnalyticsEvent||((e,t,n,r,i)=>{let o=u({action:e,variation:t,payload:n},et(),r);"Failure"===t&&(o=u(lt,o)),lt=f(o,"sessionId","connectionId","partnerId"),Ie.logEvent(o,i)}),xt=()=>{if(!_e(this.session))return void $e.disableLogging();const e=this.session.apiKey;$e.enableLogging(e)},_t=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason&&("Attempt"===e&&(Ge=(new Date).getTime(),Ke&&(Ke.stop(),ae.error("_connectivityAttemptPinger should have been cleaned up")),Ke=new se(()=>{Et("Publish","Attempting",t,(0,s.default)({},et(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e?(Ke?(Ke.stop(),Ke=void 0):ae.warn(`Received connectivity event: "${e}" without "Attempt"`),Et("Publish",e,(0,s.default)({videoInputDevices:We,audioInputDevices:Ae,videoInputDeviceCount:We?We.length:void 0,audioInputDeviceCount:Ae?Ae.length:void 0,selectedVideoInputDeviceId:Ne,selectedAudioInputDeviceId:Le},t),(0,s.default)({attemptDuration:(new Date).getTime()-Ge},n))):Et("Publish",e,t,n))},Ct=(e,t)=>{Et("ICERestart",e,t)},It=(e,t,n)=>{"Attempt"===t?(Ye[e]=(new Date).getTime(),Et(e,t,n)):"Failure"!==t&&"Success"!==t||Et(e,t,n,{attemptDuration:(new Date).getTime()-Ye[e]})},Rt=function(e,t){void 0===t&&(t={}),It("RoutedToRelayedTransition",e,t)},Zt=function(e,t){void 0===t&&(t={}),It("RelayedToRoutedTransition",e,t)},kt=p(()=>{Et("GetStats","Called")}),Ot=p(()=>{Et("GetRtcStatsReport","Called")}),Vt=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:A,width:O.width,height:O.height,audioTrack:z&&z.getAudioTracks().length>0,hasAudio:on(),publishAudio:yt.publishAudio,videoTrack:z&&z.getVideoTracks().length>0,hasVideo:rn(),publishVideo:yt.publishVideo,audioSource:mt?"Custom":void 0,duration:Ze?Math.round(((new Date).getTime()-Ze.getTime())/1e3):0,remoteConnectionId:i,scalableVideo:r,sourceStreamId:B(s)};let c=(pt&&gt?"Screen":pt&&e.videoSource)||gt&&"Custom"||yt.constraints.video&&"Camera"||null;h(c)&&(c=m(c)),a.videoSource=c;const l={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},d=u({},a,n,l);Ie.logQOS(d),this.trigger("qos",d)},Gt=()=>{var e,t;let n=(null==(e=yt.videoDimensions)?void 0:e.width)||640,r=(null==(t=yt.videoDimensions)?void 0:t.height)||480;if(yt.publishVideo){var i;const e=null==(i=O)?void 0:i.video();n=(null==e?void 0:e.videoWidth())||n,r=(null==e?void 0:e.videoHeight())||r}return{width:n,height:r}},At=()=>{Oe.isDestroyed()?O&&O.destroyVideo():(ae.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),Oe.set("MediaBound"),L().catch(ae.error),O.loading(!!this.session&&!this.stream),ut=!0)},Wt=e=>{const t=ue(ne.CONNECT_FAILED,e,ie.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,_t("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),Oe.set("Failed"),this.trigger("publishComplete",t),le.handleJsException({error:t,target:this,analytics:Ie})},Nt=()=>{z&&(r.emit("streamDestroy"),we.MediaStreamTrack&&we.MediaStreamTrack.prototype.stop?z.getTracks().forEach(e=>e.stop()):z.stop())},Lt=()=>{const e=T.isiOS&&T.iOSVersion>=15&&T.iOSVersion<15.2,t=z.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&O&&O.rebindSrcObject()})},Xt=()=>{const e=T.isiOS&&T.iOSVersion>=13.3,t=z.getAudioTracks()[0];e&&t&&(t.onmute=()=>Un(t),t.onunmute=()=>Hn(t))},Mt=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},O){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",O.bindVideo(z,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ft=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(ae.debug("OT.Publisher.onStreamAvailable"),Oe.set("BindingMedia"),void 0!==yt.videoContentHint&&Y(t,yt.videoContentHint),Nt(),z=t,!yt.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(yt.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),ae.error("Error applying video filter: "+e.t0);case 14:r.emit("streamChange"),Xt(),Lt(),Ne=(o=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=d(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(z.getVideoTracks(),We),Le=o(z.getAudioTracks(),Ae),ke=new ce(z,!yt.publishAudio),En(),wn(),n.accessAllowed=!0,n.dispatchEvent(new Z(C.ACCESS_ALLOWED,!1));case 25:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}(),Pt=e=>{let t,n;ae.error("OT.Publisher.onPublishingTimeout"),dt?(t=ne.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=ne.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:ie.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};_t("Failure",{},r),le.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ie}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),this.session=null,Oe.isDestroyed()||Oe.set("MediaBound"),this.trigger("publishComplete",ue(t,new Error(n),ie.UNABLE_TO_PUBLISH))},jt=e=>{const t=ue(ne.MEDIA_ERR_DECODE,e,ie.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,ae.error("OT.Publisher.onVideoError:",t),Et("stream",null,{reason:t.message});const n=Oe.isAttemptingToPublish();Oe.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),le.handleJsException({error:t,target:this,analytics:Ie})};this._setWebRTCStream=e=>{z=e},this._setCurrentVideoFilter=e=>{Rn=e},this._getCurrentVideoFilter=()=>Rn,this._getMediaProcessor=()=>$e,this._removePeerConnection=e=>{if(!e)return;const t=E(e).peerConnectionId;delete ct[t],e.destroy()},this._removeSubscriber=e=>{this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===Me&&this._.startRelayedToRoutedTransition(),zt(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const Ut=e=>{const t=E(e),n=t.remoteSubscriberId,r=t.peerConnectionId;ae.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),Et("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},Ht=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,s,a,c,u,l,d,h,f,p;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&&ut)){e.next=5;break}return ae.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 5:return c=E(t)||{},u=c.remoteConnectionId,l=void 0===u?"(not found)":u,d=c.peerConnectionId,h=oe(void 0,o,s,l,"Publisher"),f={hasRelayCandidates:t&&t.hasRelayCandidates()},p={failureReason:s||"PeerConnectionError",failureCode:h.code,failureMessage:h.message},Oe.isPublishing()?p.reason="Non-fatal":n.trigger("publishComplete",h),_t("Failure",f,p),le.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+o,code:h.code,target:n,analytics:Ie}),e.next=14,ct[d];case 14:e.sent.destroy(),delete ct[d];case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Yt=e=>this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===e.getSourceStreamId(),Dt=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,s,a,c,u,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.session.sessionInfo.isAdaptiveEnabled,s=r.getSourceStreamId(),De[s]=t,"disconnected"===t&&setTimeout(()=>{const e=n.session._.isSocketReconnecting,t=n.session._.getSocket().is("connected")&&!e();if("disconnected"===De[s]&&t){const e=E(r).remoteConnectionId;Ct("Attempt",{remoteConnectionId:e}),r.iceRestart()}},2e3),"connected"!==t){e.next=14;break}if(clearTimeout(Be),!o){e.next=14;break}return e.next=9,$t();case 9:return a=e.sent.iceConnectionStateIsConnected(),e.next=12,en();case 12:c=e.sent.iceConnectionStateIsConnected(),a&&c&&dn();case 14:if("failed"!==t){e.next=21;break}if(u=n.session._.isSocketReconnecting,l=n.session._.getSocket(),l.is("connected")&&!u()){e.next=20;break}return e.abrupt("return");case 20:o&&s===Me&&"P2P"===s?n._.startRelayedToRoutedTransition():Be=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)}}(),Bt=e=>{e.setP2PMaxBitrate(),e.startEncryption(this.session.connection.id),Yt(e)&&Rt("Success")},Kt=n=>{let r=n.peerConnectionId,i=n.send,o=n.log,s=n.logQoS,a=n.sourceStreamId;if(Qt(r))return t.reject(new Error("PeerConnection already exists"));const c=q({isChromiumEdge:de.env.isChromiumEdge,browserName:de.env.name,isScreenSharing:pt,isCustomVideoTrack:gt,sessionInfo:this.session.sessionInfo,constraints:yt.constraints,videoDimensions:Gt(),capableSimulcastScreenshare:yt.capableSimulcastScreenshare});return ct[r]=t.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(z)]).then(n=>{let r=n[0],u=n[1],l=z;if(!u){l=z.clone();const e=l.getVideoTracks()[0];e&&(e.stop(),l.removeTrack(e))}const d=new pe({iceConfig:r,sendMessage:(e,t)=>{"offer"===e&&this.trigger("connected"),i(e,t)},webRTCStream:l,channels:yt.channels,capableSimulcastStreams:c,overrideSimulcastEnabled:e._enableSimulcast,logAnalyticsEvent:o,offerOverrides:{enableDtx:yt.enableDtx,enableStereo:yt.enableStereo,audioBitrate:yt.audioBitrate,priorityVideoCodec:yt._priorityVideoCodec||this.session.sessionInfo.priorityVideoCodec,codecFlags:yt._codecFlags||this.session._.getCodecFlags()},answerOverrides:this.session.sessionInfo.p2pEnabled?void 0:{audioBitrate:yt.audioBitrate},sourceStreamId:a,isP2pEnabled:this.session.sessionInfo.p2pEnabled,sessionId:this.session.id,keyStore:this.session.keyStore,sFrameClientStore:this.session.sFrameClientStore,isE2ee:this.session._.isE2ee()});return d.on({disconnected:()=>Ut(d),error:e=>{let t=e.reason,n=e.prefix;return Ht(d,{reason:t,prefix:n})},qos:s,iceRestartSuccess:()=>(e=>{const t=E(e).remoteConnectionId;Ct("Success",{remoteConnectionId:t})})(d),iceRestartFailure:()=>(e=>{const t=E(e).remoteConnectionId;Ct("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})})(d),iceConnectionStateChange:e=>Dt(e,d),audioAcquisitionProblem:()=>{dt=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})}}),d.once("connected",()=>Bt(d)),new t((e,t)=>{const n=e=>{t(e)};d.once("error",n),d.init(Ve,r=>{if(r)return t(r);d.off("error",n),e(d)})})}),Qt(r)},Jt=()=>t.all(Object.keys(ct).map(Qt)),zt=e=>Jt().then(t=>t.filter(t=>E(t).remoteSubscriberId===e)),Qt=e=>ct[e],qt=e=>{const t=Object.keys(ct).find(t=>t.endsWith("~"+e));return ct[t]},$t=()=>qt("MANTIS"),en=()=>qt("P2P");let tn=$(this,{name:yt.name,publishAudio:yt.publishAudio,publishVideo:yt.publishVideo,audioSource:yt.audioSource,showControls:yt.showControls,shouldAllowAudio:bt,logAnalyticsEvent:Et});const nn=()=>{this.off("publishComplete",sn),tn&&tn.reset(),k.releaseAll(),this.disconnect(),ke=null,Nt(),z=null,O&&(O.destroy(),O=null),this.session&&this._.unpublishFromSession(this.session,"reset"),$e.getVideoFilter()&&xn(),this.id=null,this.stream=null,ut=!1,this.session=null,Oe.isDestroyed()||Oe.set("NotPublishing")},rn=()=>{if(!z||0===z.getVideoTracks().length)return!1;const e=["text","detail"].includes(yt.videoContentHint),t=gt&&e,n=de.env.isChromium&&(pt||t);return z.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,yt.publishVideo)},on=()=>!(!z||0===z.getAudioTracks().length)&&(z.getAudioTracks().length>0&&z.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,yt.publishAudio)),sn=e=>{if(O&&(O.audioOnly(!rn()),O.showPoster(!rn())),tn&&tn.setAudioOnly(!rn()&&on()),this.stream){let t;ze&&(t="low",ze=!1),this.stream.setChannelActiveState("audio",on(),e),this.stream.setChannelActiveState("video",rn(),e,t)}else this.off("publishComplete",sn),this.once("publishComplete",sn)},an=(e,n)=>{let r=!1;if("function"==typeof e?n=e:r="rtcStatsReport"===e,r?Ot():kt(),!r||P)Jt().then(e=>{if(0===e.length){const e=ie.PEER_CONNECTION_NOT_CONNECTED;throw ue(ne.PEER_CONNECTION_NOT_CONNECTED,new Error(le.getTitleByCode(e)),e)}return e}).then(e=>this.session.sessionInfo.isAdaptiveEnabled?e.filter(e=>e.getSourceStreamId()===Me):e).then(e=>t.all(e.map(e=>x(r?e.getRtcStatsReport.bind(e):e.getStats.bind(e))().then(t=>({pc:e,stats:t}))))).then(e=>{const t=Ze?Ze.getTime():Date.now(),i=e.map(e=>{let n=e.pc,i=e.stats;const o=E(n),s=o.remoteConnectionId,a=o.remoteSubscriberId;return u(s.match(/^symphony\./)?{}:{subscriberId:a,connectionId:s},r?{rtcStatsReport:i}:{stats:_.normalizeStats(i,!1,t)})});n(null,i)}).catch(n);else{const e=ie.GET_RTC_STATS_REPORT_NOT_SUPPORTED;n(ue(ne.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(le.getTitleByCode(e)),e))}},cn=(e,t)=>{const n={name:yt.name||"",streamId:this.streamId,subscriberAudioFallbackEnabled:yt.subscriberAudioFallbackEnabled,channels:qe,minBitrate:yt.minVideoBitrate,sourceStreamId:e,e2ee:this.session._.isE2ee(),publisherAudioFallbackEnabled:yt.publisherAudioFallbackEnabled};this.session._.streamCreate(n,t)},un=e=>{z.getAudioTracks().forEach(function(){var t=(0,o.default)(i.default.mark((function t(n){var r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=n.clone()).enabled=!1,t.prev=2,t.next=5,e.findAndReplaceTrack(n,r);case 5:t.next=10;break;case 7:return t.prev=7,t.t0=t.catch(2),t.abrupt("return");case 10:Re[n.id]=r;case 11:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}())},ln=e=>{z.getAudioTracks().forEach(function(){var t=(0,o.default)(i.default.mark((function t(n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.findAndReplaceTrack(Re[n.id],n);case 3:t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return");case 8:delete Re[n.id];case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}())},dn=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 Pe=!1,e.next=3,$t();case 3:if(!(t=e.sent)){e.next=17;break}return n.trigger("sourceStreamIdChanged","P2P"),e.next=8,R(5e3);case 8:if(!Pe){e.next=11;break}return ae.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 11:return un(t),e.next=14,t.changeMediaDirectionToInactive();case 14:if(!(de.env.isFirefox&&de.env.version<96)){e.next=17;break}return e.next=17,fn();case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),hn=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 Pe=!0,e.next=3,$t();case 3:if(!(t=e.sent)){e.next=10;break}return ln(t),e.next=8,t.changeMediaDirectionToRecvOnly();case 8:Fe&&clearTimeout(Fe),n.trigger("sourceStreamIdChanged","MANTIS");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fn=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,$t();case 2:(t=e.sent)&&(Fe=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"!==Me){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,R(3e3);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,fn();case 9:case"end":return e.stop()}}),e)}))),3e4));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pn=()=>{Rt("Attempt");const e=e=>{const t=U(e);this.trigger("streamCreateForP2PComplete",t),Rt("Failure",{reason:t.message})};if(!this.session)return void Rt("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{Rt("Failure",{reason:"Timeout"})},fe);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),ae.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),cn("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},mn=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:if("P2P"===Me){e.next=2;break}return e.abrupt("return");case 2:if(Zt("Attempt"),n.session){e.next=6;break}return Zt("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 6:if(n.streamId){e.next=9;break}return Zt("Failure",{reason:"No streamId available"}),e.abrupt("return");case 9:return e.next=11,hn();case 11:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=15,en();case 15:e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),Zt("Success"),n.trigger("streamDestroyForP2PComplete");case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();this.publish=e=>(ae.debug("OT.Publisher: publish"),(Oe.isAttemptingToPublish()||Oe.isPublishing())&&nn(),Oe.set("GetUserMedia"),yt.style&&this.setStyle(yt.style,null,!0),yt.classNames="OT_root OT_publisher",te.onLoad(()=>{ae.debug("OT.Publisher: publish: environment loaded"),O=new ve(e,(0,s.default)({},yt,{widgetType:"publisher"})),bt&&W({publisher:this,widgetView:O}),O.on("error",jt),this.id=O.domId(),this.element=O.domElement,this.element&&tn&&tn.init(O),O.on("videoDimensionsChanged",(e,t)=>{yt.publishVideo&&(this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new re.VideoDimensionsChangedEvent(this,e,t)))}),O.on("mediaStopped",e=>{const t=new re.MediaStoppedEvent(this,e);if(this.dispatchEvent(t),!t.isDefaultPrevented())if(e){const t=String(e.kind).toLowerCase();"audio"===t?wn():"video"===t?En():ae.warn("Track with invalid kind has ended: "+e.kind)}else this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}),O.on("videoElementCreated",e=>{const t=new re.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),vt().catch(it).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 Ae=ht.audioDevices,We=ht.videoDevices,(r=!!yt.videoFilter)&&(In=j(t,We)),e.next=6,Ft(t);case 6:return yt.publishVideo||n._toggleVideo(yt.publishVideo,Gt()),pt||gt||r||(In=j(t,We),yt.publishVideo&&Mn(In)),e.abrupt("return",Mt().catch(e=>{if(!(e instanceof w))throw e}).then(()=>{At(),Oe.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{ae.error("OT.Publisher.publish failed to bind video: "+e),Wt(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,Jt().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=yn(t))||!gn(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=yn(t))||!bn(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 gn=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},bn=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},yn=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},vn=e=>z&&z[`get${b(e)}Tracks`]().length>0&&z[`get${b(e)}Tracks`]().every(e=>"ended"!==e.readyState),wn=e=>{const t=vn("audio")&&yt.publishAudio;tn&&tn.setMuted(!t),ke&&ke.muted(!t),Ue&&Ue.originalTrack&&(Ue.originalTrack.enabled=t),sn(e)};let Sn;this.publishAudio=e=>{Et("publishAudio","Attempt",{publishAudio:e}),yt.publishAudio=e;try{wn(),Et("publishAudio","Success",{publishAudio:e})}catch(e){Et("publishAudio","Failure",{message:e.message})}return this},this.publishCaptions=e=>{this.stream.setChannelActiveState("data",e)};let Tn=!1;const En=()=>{const e=vn("video")&&yt.publishVideo;if("Chrome"===T.name&&T.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,Jt();case 5:r=t.sent,n.isCanceled()||r.forEach(t=>{Te(t,e)});case 7:case"end":return t.stop()}}),t)})))(),gt&&$e){const t=$e.getOriginalVideoTrack();t&&(t.enabled=e)}if(gt&&je){const t=je.originalTrack;t&&(t.enabled=e)}z&&z.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),sn()},xn=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 t=$e.getOriginalVideoTrack(),e.prev=1,e.next=4,$e.destroy();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),ae.warn("Error cleaning up mediaProcessor: "+e.t0);case 9:t.stop();case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),_n=e=>!Rn&&!je&&e===Xn(),Cn=(e,t)=>!(!Rn&&!je)||(e?In!==t:void 0!==t);let In,Rn;this._toggleVideo=N(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,s,a,c,u,l,d,h;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(pt||gt||Tn)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Fn();case 4:if(s=e.sent,a=Ln()){e.next=8;break}throw ue(ne.NOT_SUPPORTED,new Error("Publisher._toggleVideo cannot toggleVideo when you have no video source."));case 8:if(c=null==(o=s.find(e=>e.label===a.label))?void 0:o.deviceId,Cn(t,c)){e.next=11;break}return e.abrupt("return");case 11:if("ended"!==a.readyState){e.next=14;break}return Tn=!0,e.abrupt("return");case 14:if(t&&de.env.isAndroid&&de.env.isChrome&&a&&a.stop&&a.stop(),t){e.next=31;break}e.prev=16,u=M(n),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(16),e.abrupt("return");case 23:if(c&&(In=c),Mn(u.label),!(l=$e.getVideoFilter())){e.next=30;break}return Rn=l,e.next=30,xn();case 30:je&&(je.destroy(),je.stopOriginalTrack());case 31:if(!In||-1!==s.findIndex(e=>e.deviceId===In)){e.next=33;break}throw ue(ne.NO_DEVICES_FOUND,new Error("Previous device no longer available - deviceId not found"));case 33:if(r.emit("streamDestroy"),!t){e.next=64;break}if(!_n(In)){e.next=37;break}return e.abrupt("return");case 37:return e.prev=37,e.next=40,Nn(In);case 40:u=e.sent,e.next=47;break;case 43:throw e.prev=43,e.t1=e.catch(37),ae.error(`Error getting new track for current device(${In}): ${e.t1}`),e.t1;case 47:if(u){e.next=50;break}return ae.error("Failed to enable video. It was not possible to get a new track from the camera"),e.abrupt("return");case 50:if(!Rn){e.next=59;break}return d=$e.getOriginalVideoTrack(),e.next=54,$e.setVideoFilter(Rn);case 54:return e.next=56,$e.setMediaStream(z);case 56:return e.next=58,$e.setVideoTrack(u);case 58:u=e.sent;case 59:if(!je){e.next=64;break}return d=je.originalTrack,e.next=63,je.setTrack(u);case 63:u=e.sent;case 64:return e.prev=64,e.next=67,Wn(a,u);case 67:null==(h=d)||h.stop(),e.next=73;break;case 70:throw e.prev=70,e.t2=e.catch(64),e.t2;case 73:case"end":return e.stop()}}),e,null,[[16,20],[37,43],[64,70]])})));return function(t,n){return e.apply(this,arguments)}}());const Zn=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:if(null==(r=tn)||r.videoDisabledIndicator.disableVideo(!1),null==(o=tn)||o.videoDisabledIndicator.setWarning(!1),!yt.publishVideo){e.next=8;break}return e.next=5,Jt();case 5:e.sent.forEach(e=>{Te(e,!0)}),n.stream.setChannelActiveState("video",!0,"auto","low");case 8:t===Q.SUSPENDED_VIDEO?n.trigger("videoEnabled"):n.trigger("videoDisableWarningLifted");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),kn=()=>{var e;yt.publishVideo&&(null==(e=tn)||e.videoDisabledIndicator.setWarning(!0),this.stream.setChannelActiveState("video",!0,"auto","medium"));this.trigger("videoDisableWarning")},On=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(!yt.publishVideo){e.next=7;break}return null==(t=tn)||t.videoDisabledIndicator.disableVideo(!0),e.next=4,Jt();case 4:e.sent.forEach(e=>{Te(e,!1)}),n.stream.setChannelActiveState("video",!1,"auto","critical");case 7:n.trigger("videoDisabled");case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let Vn;if(yt.publisherAudioFallbackEnabled){Vn=new J;const e={[Q.ACTIVE_VIDEO]:Zn,[Q.ACTIVE_VIDEO_WITH_WARNING]:kn,[Q.SUSPENDED_VIDEO]:On};Vn.on("stateChange",t=>{let n=t.previousState,r=t.state;try{e[r](n)}catch(e){throw ae.error("Audio fallback error: "+e),e}})}this.publishVideo=e=>{if(yt.publishVideo===e)return this;Et("publishVideo","Attempt",{publishVideo:e});const t=Gt();var n,r;yt.publishVideo=e,yt.publisherAudioFallbackEnabled&&(Vn.reset(),null==(n=tn)||n.videoDisabledIndicator.disableVideo(!1),null==(r=tn)||r.videoDisabledIndicator.setWarning(!1),ze=!0);try{this._toggleVideo(yt.publishVideo,t),En(),Et("publishVideo","Success",{publishVideo:e})}catch(e){Et("publishVideo","Failure",{message:e.message})}return this},this.setVideoContentHint=e=>Y(z,e),this.getVideoContentHint=()=>D(z),this.destroy=function(e,t){return Oe.isAttemptingToPublish()&&this.session&&_t("Cancel",{reason:"destroy"}),Oe.isDestroyed()||(Oe.set("Destroyed"),nn(),ht&&(ht.off(),ht=null),tn&&(tn.destroy(),tn=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new re.DestroyedEvent(C.PUBLISHER_DESTROYED,this,e)),this.off(),je&&(je.destroy(),je.stopOriginalTrack()),Ue&&(Ue.destroy(),Ue.stopOriginalTrack())),this},this.disconnect=()=>{Object.keys(ct).forEach(e=>{const t=Qt(e);delete ct[e],t.then(e=>this._removePeerConnection(e))}),qe.length=0},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}`;ae.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${u}`),ae.debug(n);const l=Qt(u),d=()=>{const a=Se({socket:this.session._.getSocket(),uri:n.uri,content:{peerId:i,sourceStreamId:o}});Kt({peerConnectionId:u,send:a,log:function(e,t,n,r,a){void 0===r&&(r={});const c=(0,s.default)({peerId:i,sourceStreamId:B(o)},r);return Et(e,t,n,c,a)},logQoS:e=>{o===Me&&Vt((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=>{ae.error("OT.Publisher failed to create a peerConnection",e)})},h=this.session.sessionInfo.isAdaptiveEnabled;switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(l)l.then(t=>t.processMessage(e,n));else{if(h&&en())return;d()}}},this.getImgData=function(){if(!ut)return ae.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=O&&O.video();return e?e.imgData():null};const Gn=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&z.getAudioTracks().length?e.replaceTrack(z.getAudioTracks()[0]):"video"===e.track.kind&&z.getVideoTracks().length?e.replaceTrack(z.getVideoTracks()[0]):void 0)},An=function(e){return void 0===e&&(e=Gn),Jt().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;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!de.env.isLegacyEdge&&we.RTCRtpSender&&"function"==typeof we.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw ue(ne.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),ie.UNABLE_TO_PUBLISH);case 2:if(!gt&&!pt){t.next=4;break}throw ue(ne.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(Ln()){t.next=7;break}throw ue(ne.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,Fn();case 10:if(n=t.sent,n.filter(e=>e.deviceId!==In).length>0){t.next=14;break}return t.abrupt("return",In);case 14:for(;n[e%n.length].deviceId===In;)e+=1;return r.emit("streamDestroy"),o=n[e%n.length],s=o.deviceId,t.next=20,zn(s);case 20:return t.abrupt("return",In);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=N((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),ae.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 Wn=function(){var e=(0,o.default)(i.default.mark((function e(s,a){var c,u,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jt();case 2:return c=e.sent,e.next=5,t.all(c.map(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,t.findAndReplaceTrack(s,a);case 2:t.setP2PMaxBitrate();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:if(z.removeTrack(s),z.addTrack(a),s&&s.stop){try{u=a instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(a).toString().includes("MediaStreamTrackGenerator")}catch(e){u=!1}u||s.stop()}"Firefox"!==de.env.name&&"Safari"!==de.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=z),(l=O&&O.video())&&l.refreshTracks(),r.emit("streamChange"),En();case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Nn=function(){var t=(0,o.default)(i.default.mark((function t(n){var r,o,s,a,c,u,d;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Xn(),Mn(n),(s=l(e)).audioSource=null,s.videoSource=n,ht=Ce(s,"OT.Publisher.getTrackFromDeviceId",()=>Oe&&Oe.isDestroyed()),ht.on({accessDialogOpened:ot,accessDialogClosed:st}),a=ht.getUserMedia,t.prev=8,t.next=11,a();case 11:c=t.sent,t.next=18;break;case 14:throw t.prev=14,t.t0=t.catch(8),ae.error(t.t0),t.t0;case 18:return u=null==(r=c)?void 0:r.getVideoTracks(),(d=u[0])||Mn(o),t.abrupt("return",d);case 21:case"end":return t.stop()}}),t,null,[[8,14]])})));return function(e){return t.apply(this,arguments)}}(),Ln=()=>z.getVideoTracks()[0],Xn=()=>Xe,Mn=e=>{Xe=e},Fn=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,ee.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw ue(ne.NO_DEVICES_FOUND,new Error("No video devices available"),ie.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)}}(),Pn=function(){var e=(0,o.default)(i.default.mark((function e(n,o){var s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jt();case 2:return s=e.sent,e.next=5,t.all(s.map(e=>e.findAndReplaceTrack(n,o)));case 5:o&&z.addTrack(o),n&&z.removeTrack(n),(a=O&&O.video())&&a.refreshTracks(),tn&&(o&&!n&&tn.addAudioTrack(),n&&!o&&tn.removeAudioTrack());try{c=o instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(o).toString().includes("MediaStreamTrackGenerator")}catch(e){c=!1}n&&n.stop&&!c&&n.stop(),o&&(wn(),ke=new ce(z,!yt.publishAudio)),r.emit("streamChange"),sn();case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),jn=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=z.getAudioTracks()[0])&&(o.onmute=()=>Un(o),o.onunmute=()=>Hn(o)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),ae.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),Un=e=>{let t=!1;yt.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,jn(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)},Hn=e=>{var t;on()&&(rn()?this.videoElement().pause():jn(e)),null==this||null==(t=this.session)||t.trigger("gsmCallEnded")},Yn=!(de.env.isLegacyEdge||!we.RTCRtpSender||"function"!=typeof we.RTCRtpSender.prototype.replaceTrack),Dn=()=>ue(ne.CANCEL,new Error("Operation did not succeed due to a new request."));let Bn;const Kn=function(){var t=(0,o.default)(i.default.mark((function t(r){var o,s,a,c,u,d,h,f,p,m,g;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Yn){t.next=2;break}throw ue(ne.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 2:if(Bn&&Bn.cancel(),Bn=new S,o=Bn,s=e=>{if(o.isCanceled())throw e.getTracks(e=>e.stop()),Dn();return Kn(e.getAudioTracks()[0])},a=n.getAudioSource()){t.next=7;break}throw ue(ne.NOT_SUPPORTED,new Error("Publisher#setAudioSource cannot add an audio source when you started without one."));case 7:if(!(r instanceof MediaStreamTrack)){t.next=26;break}if(!o.isCanceled()){t.next=10;break}throw Dn();case 10:if(!Ue){t.next=23;break}return t.prev=11,t.next=14,Ue.setTrack(r);case 14:return c=t.sent,t.next=17,Pn(a,c);case 17:return t.abrupt("return",t.sent);case 20:t.prev=20,t.t0=t.catch(11),ae.error("Error setting track on audioMediaProcessorConnector: "+t.t0);case 23:return t.abrupt("return",Pn(a,r));case 26:if("string"!=typeof r){t.next=73;break}return(u=l(e)).audioSource=r,u.videoSource=null,ht=Ce(u,"OT.Publisher.setAudioSource",()=>o.isCanceled()||Oe&&Oe.isDestroyed()),ht.on({accessDialogOpened:ot,accessDialogClosed:st}),d=a.label,h=a.getConstraints&&a.getSettings().deviceId||void 0,a&&a.stop(),f=ht.getUserMedia,t.prev=36,t.t1=s,t.next=40,f();case 40:return t.t2=t.sent,t.next=43,(0,t.t1)(t.t2);case 43:return t.abrupt("return",t.sent);case 46:if(t.prev=46,t.t3=t.catch(36),!o.isCanceled()){t.next=50;break}throw Dn();case 50:if((p=l(e)).videoSource=null,p.audioSource=h,p.audioSource||!d){t.next=60;break}return t.next=56,X();case 56:if(m=t.sent.find(e=>e.label===d),!o.isCanceled()){t.next=59;break}throw Dn();case 59:m&&(p.audioSource=m.deviceId);case 60:if(p.audioSource){t.next=63;break}throw t.t3.message+=" (could not determine previous audio device)",ue(ne.NOT_FOUND,t.t3);case 63:return ht=Ce(p,"OT.Publisher.setAudioSource",()=>o.isCanceled()||Oe&&Oe.isDestroyed()),t.next=66,ht.getUserMedia().catch(e=>{throw e.message+=" (could not obtain previous audio device)",e});case 66:return g=t.sent,t.next=69,s(g);case 69:throw t.t3.message+=" (reverted to previous audio device)",t.t3;case 71:t.next=74;break;case 73:throw ue(ne.INVALID_PARAMETER,new Error("Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack."));case 74:case"end":return t.stop()}}),t,null,[[11,20],[36,46]])})));return function(e){return t.apply(this,arguments)}}();this.setAudioSource=Kn,this.getAudioSource=()=>z&&z.getAudioTracks().length>0?z.getAudioTracks()[0]:null;const Jn=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=ue(ne.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=ue(ne.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!de.env.isLegacyEdge&&we.RTCRtpSender&&"function"==typeof we.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw ue(ne.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),ie.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(o=!z||0===z.getVideoTracks().length,!(gt||pt||o)){e.next=9;break}throw r;case 9:return e.next=11,X();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,zn(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=Jn;const zn=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,s,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=In,In=t,yt.publishVideo){e.next=4;break}return e.abrupt("return");case 4:if(o=Ln(),yt.publishVideo&&de.env.isAndroid&&(de.env.isChrome||de.env.isFirefox)&&o&&o.stop&&o.stop(),!_n(t)){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,e.next=11,Nn(t);case 11:s=e.sent,e.next=19;break;case 14:throw e.prev=14,e.t0=e.catch(8),In=r,ae.error(e.t0),e.t0;case 19:if(s){e.next=22;break}return ae.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 22:if(!Rn){e.next=27;break}return a=$e.getOriginalVideoTrack(),e.next=26,$e.setVideoTrack(s);case 26:s=e.sent;case 27:if(!je){e.next=32;break}return a=je.originalTrack,e.next=31,je.setTrack(s);case 31:s=e.sent;case 32:return e.next=34,Wn(o,s);case 34:null==(n=a)||n.stop(),yt.publishVideo&&(Tn=!1);case 36:case"end":return e.stop()}}),e,null,[[8,14]])})));return function(t){return e.apply(this,arguments)}}();this.getVideoSource=()=>{const e={},t=!z||0===z.getVideoTracks().length;return e.track=z&&yt.publishVideo&&z.getVideoTracks()[0]||null,e.deviceId=pt||gt||!In?null:In,e.type=gt?"custom":pt?"screen":t?null:"camera",e},this._={setIceConfig:e=>(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Jt();case 2:t.sent.forEach(t=>t.setIceConfig(e));case 4:case"end":return t.stop()}}),t)})))(),publishToSession:(e,n)=>{n&&(Ie=n),Je=e,this.session=e;const r=g();A=r,this.streamId=r,_t("Attempt",{dataChannels:yt.channels,properties:G(yt)});const i=new t((e,t)=>{ut?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))}))});ae.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(yt.scalableFramerates),this._setScalableVideoLayers(yt.scalableVideoLayers),this.stream&&(this.stream.setChannelActiveState("audio",on()),this.stream.setChannelActiveState("video",rn())),ae.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=U(e);throw _t("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),Oe.isAttemptingToPublish()&&this.trigger("publishComplete",t),le.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:Ie}),t};ae.debug("publishToSession: waiting for loaded");const a=i.then(()=>e._.getVideoCodecsCompatible(z)).then(n=>{if(ae.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{Pt(e)},fe);this.once("publishComplete",()=>{clearTimeout(r)}),Oe.set("PublishingToSession");const i=n&&O&&O.video(),o=z.getVideoTracks().length>0,a=null!==yt.videoSource&&!1!==yt.videoSource;i&&o&&a&&qe.push(new ge({id:"video1",type:"video",active:yt.publishVideo,orientation:ye.ROTATED_NORMAL,frameRate:yt.frameRate,width:this.videoWidth(),height:this.videoHeight(),e2ee:e._.isE2ee(),source:pt?"screen":gt?"custom":"camera",fitMode:yt.fitMode}));const c=z.getAudioTracks().length>0,u=null!==yt.audioSource&&!1!==yt.audioSource;return u&&c&&qe.push(new ge({id:"audio1",type:"audio",active:yt.publishAudio})),u&&c&&qe.push(new ge({id:"caption1",type:"data",active:yt.publishCaptions})),this._.streamChannels=qe,ae.debug("publishToSession: creating rumor stream id"),new t((e,t)=>{cn(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(ae.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,Ve=he(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";ae.warn(`The publisher ${at} 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||Oe.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),k.releaseAll(),this.disconnect(),Oe.isAttemptingToPublish()){_t("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",ue("mediaStopped"===t?ne.MEDIA_ENDED:ne.CANCEL,e))}return this.session=null,Et("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>A&&e.id===A?this._.unpublishFromSession(t,n):(ae.warn(`The publisher ${at} is trying to destroy a stream ${e.id} that is not attached to it (it has ${A||"no stream"} attached to it)`),this),streamDestroyed:e=>{["reset"].indexOf(e)<0&&(Oe.isDestroyed()||Oe.set("MediaBound"));const t=new re.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEvent(t),t.isDefaultPrevented()||this.destroy()},archivingStatus:e=>(tn&&tn.setArchivingStatus(e),e),webRtcStream:()=>z,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,vt().catch(it);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),ae.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,Nt(),z=n,r.emit("streamChange"),ke=new ce(z,!yt.publishAudio),e.prev=11,Mt(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof w)){e.next=19;break}return e.abrupt("return");case 19:throw ae.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,An(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),ae.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=Qt(Object.keys(ct)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new de.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(e){void 0===e&&(e=!1),Jt().then(t=>{t.forEach(t=>{const n=E(t).remoteConnectionId;Ct("Attempt",{remoteConnectionId:n}),ae.debug("Publisher: ice restart attempt"),t.iceRestart(),e&&t.generateOffer()})})},getState:()=>Oe,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,Jt();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:Ft,startRoutedToRelayedTransition:()=>{v.startTransitionTo("P2P"),pn()},startRelayedToRoutedTransition:()=>{v.startTransitionTo("MANTIS",()=>mn())},forceMuteAudio:function(){Et("publishAudio","Attempt",{publishAudio:!1}),yt.publishAudio=!1;try{wn("auto"),this.dispatchEvent(new re.MuteForcedEvent),Et("publishAudio","Success",{publishAudio:!1})}catch(e){Et("publishAudio","Failure",{message:e.message})}}.bind(this),setCongestionLevel:e=>{Vn?Vn.setCongestionLevel(e):ae.warn("Audio Fallback is not enabled")}},this.detectDevices=function(){ae.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){ae.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return ae.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){ae.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return ae.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){ae.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){ae.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return at},this.videoElement=function(){const e=O&&O.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==Oe.current)throw new Error("assignStream called when publisher is not successfully publishing");k.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),k.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),Oe.set("Publishing"),O.loading(!ut),Ze=new Date,this.dispatchEvent(new re.StreamEvent("streamCreated",e,null,!1)),_t("Success"),this.trigger("publishComplete",null,this)},this.isWebRTC=!0,this.isLoading=function(){return O&&O.loading()},this.videoWidth=()=>Gt().width,this.videoHeight=()=>Gt().height,this.getStats=function(e){(e=>{an(e)})((t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>new t((e,t)=>{an("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),Oe=new me(e=>{ae.error("OT.Publisher State Change Failed: ",e.message),ae.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(Et("applyVideoFilter","Attempt",{videoFilter:t}),e.prev=1,!je){e.next=4;break}throw ue(ne.NOT_SUPPORTED,new Error("Cannot apply video filter when videoMediaProcessorConnector is set."));case 4:if(Ee.isSupported()){e.next=7;break}throw ue(ne.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 7:if($e.isValidVideoFilter(t)){e.next=9;break}throw ue(ne.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 9:if(z){e.next=14;break}return Et("applyVideoFilter","Failure",{message:r="Ignoring. No mediaStream"}),ae.warn(r),e.abrupt("return");case 14:if(!pt){e.next=16;break}throw ue(ne.INVALID_PARAMETER,new Error("Video filters can not be applied to screen share"));case 16:if(xt(),yt.publishVideo){e.next=21;break}return Rn=t,Et("applyVideoFilter","Success",{videoFilter:t}),e.abrupt("return");case 21:if(!$e.getVideoFilter()){e.next=36;break}if(!$e.canUpdateVideoFilter(t.type)){e.next=34;break}return e.prev=23,e.next=26,$e.updateVideoFilter(t);case 26:return Rn=t,Et("applyVideoFilter","Success",{videoFilter:t}),e.abrupt("return");case 31:e.prev=31,e.t0=e.catch(23),ae.warn("Error updating video filter: "+e.t0);case 34:return e.next=36,n.clearVideoFilter();case 36:if(o=z.getVideoTracks(),s=o[0]){e.next=42;break}return Et("applyVideoFilter","Failure",{message:r="Ignoring. No video"}),ae.warn(r),e.abrupt("return");case 42:return e.next=44,$e.setVideoFilter(t);case 44:return e.next=46,$e.setMediaStream(z);case 46:if(!(a=e.sent)){e.next=50;break}return e.next=50,Wn(s,a);case 50:e.next=57;break;case 52:throw e.prev=52,e.t1=e.catch(1),ae.error("Error applying video filter: "+e.t1),Et("applyVideoFilter","Failure",{message:e.t1.message}),e.t1;case 57:Rn=t,Et("applyVideoFilter","Success",{videoFilter:t});case 59:case"end":return e.stop()}}),e,null,[[1,52],[23,31]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>(Et("getVideoFilter","Attempt"),Et("getVideoFilter","Success"),Rn||null),this.setVideoMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,s,a,c,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Et("setVideoMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!n.getVideoFilter()){e.next=4;break}throw Et("setVideoMediaProcessorConnector","Failure",{message:"Tried to set video MediaProcessorConnector when video filter applied."}),ue(ne.NOT_SUPPORTED,new Error("setVideoMediaProcessorConnector: Cannot use this method when videoFilter is set."));case 4:if(!je){e.next=14;break}return r=z.getVideoTracks(),o=r[0],e.next=8,Nn(In);case 8:return s=e.sent,e.next=11,Wn(o,s);case 11:je.destroy(),je.stopOriginalTrack(),je=null;case 14:if(t){e.next=17;break}return Et("setVideoMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 17:if(xe.isValidConnector(t)){e.next=20;break}throw Et("setVideoMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),ue(ne.INVALID_PARAMETER,new Error("setVideoMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 20:if(je=new xe(t),a=z.getVideoTracks(),c=a[0]){e.next=28;break}return Et("setVideoMediaProcessorConnector","Failure",{message:u="Connector not set as no video track is present."}),ae.warn("setVideoMediaProcessorConnector: "+u),je=null,e.abrupt("return");case 28:return e.prev=28,e.next=31,je.setTrack(c);case 31:return o=e.sent,e.next=34,Wn(c,o);case 34:e.next=42;break;case 36:throw e.prev=36,e.t0=e.catch(28),je=null,ae.error("setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),Et("setVideoMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 42:Et("setVideoMediaProcessorConnector","Success");case 43:case"end":return e.stop()}}),e,null,[[28,36]])})));return function(t){return e.apply(this,arguments)}}(),this.setAudioMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Et("setAudioMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!Ue){e.next=7;break}return r=z.getAudioTracks(),o=r[0],e.next=5,Pn(o,Ue.originalTrack);case 5:Ue.destroy(),Ue=null;case 7:if(t){e.next=10;break}return Et("setAudioMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 10:if(xe.isValidConnector(t)){e.next=13;break}throw Et("setAudioMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),ue(ne.INVALID_PARAMETER,new Error("setAudioMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 13:if(s=z.getAudioTracks(),a=s[0]){e.next=20;break}return Et("setAudioMediaProcessorConnector","Failure",{message:c="Connector not set as no audio track is present."}),ae.warn("setAudioMediaProcessorConnector: "+c),Ue=null,e.abrupt("return");case 20:return Ue=new xe(t),e.prev=21,e.next=24,Ue.setTrack(a);case 24:return o=e.sent,e.next=27,Pn(n.getAudioSource(),o);case 27:e.next=35;break;case 29:throw e.prev=29,e.t0=e.catch(21),Ue=null,ae.error("setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),Et("setAudioMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 35:Et("setAudioMediaProcessorConnector","Success");case 36:case"end":return e.stop()}}),e,null,[[21,29]])})));return function(t){return e.apply(this,arguments)}}(),this.clearVideoFilter=(0,o.default)(i.default.mark((function e(){var t,n,r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Et("clearVideoFilter","Attempt"),yt.publishVideo||$e.getVideoFilter()){e.next=5;break}return Rn=null,Et("clearVideoFilter","Success"),e.abrupt("return");case 5:if($e.getVideoFilter()||Rn){e.next=10;break}return Et("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),ae.debug(t),e.abrupt("return");case 10:if(Ee.isSupported()){e.next=15;break}return Et("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),ae.warn(t),e.abrupt("return");case 15:if(z){e.next=20;break}return Et("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),ae.warn(t),e.abrupt("return");case 20:return n=Rn,Rn=null,r=z.getVideoTracks(),o=r[0],e.prev=23,e.next=26,Nn(In);case 26:s=e.sent,e.next=33;break;case 29:return e.prev=29,e.t0=e.catch(23),ae.error(e.t0),e.abrupt("return");case 33:if(s){e.next=36;break}return ae.warn("Failed to clear filter because there is no video track."),e.abrupt("return");case 36:return e.prev=36,e.next=39,Wn(o,s);case 39:return e.next=41,xn();case 41:e.next=46;break;case 43:e.prev=43,e.t1=e.catch(36),Rn=n;case 46:Et("clearVideoFilter","Success");case 47:case"end":return e.stop()}}),e,null,[[23,29],[36,43]])})))}}}).call(this,n(1))},function(e,t,n){"use strict";const r=n(52).once;e.exports=function(e,t){void 0===t&&(t={});const i=t.hasE2eeCapability||n(111),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(2)("Stream"),i=n(8),o=n(21),s=n(6),a=n(23)(),c=["name","archiving"];e.exports=function(e,t,n,u,l,d){const h=this;let f;this.id=e,this.streamId=e,this.name=t,this.creationTime=Number(n),this.connection=u,this.channel=d,this.publisher=o.publishers.find({streamId:this.id}),s(this);const p=function(e,t,n,r){let i=t;switch(i){case"active":i="audio"===e.type?"hasAudio":"hasVideo",h[i]=r;break;case"disableWarning":if(i="audio"===e.type?"audioDisableWarning":"videoDisableWarning",h[i]=r,!h["audio"===e.type?"hasAudio":"hasVideo"])return;break;case"fitMode":i="defaultFitMode",h[i]=r;break;case"source":i="audio"===e.type?"audioType":"videoType",h[i]=r;break;case"videoDimensions":h.videoDimensions=r;break;case"orientation":case"width":case"height":return}"screen"===h.videoType&&"hasVideo"===i&&!1===r||h.dispatchEvent(new a.StreamUpdatedEvent(h,i,n,r))},m=function(){return h.publisher?h.publisher:o.subscribers.find(e=>e.stream&&e.stream.id===h.id&&e.session.id===l.id)},g=function(){return!h.publisher};this.getChannelsOfType=function(e){return h.channel.filter(t=>t.type===e)},this.getChannel=function(e){for(let t=0;t<h.channel.length;++t)if(h.channel[t].id===e)return h.channel[t];return null};const b=this.getChannelsOfType("audio")[0],y=this.getChannelsOfType("video")[0];this.hasAudio=null!=b&&b.active,this.hasVideo=null!=y&&y.active,this.videoType=y&&y.source,this.defaultFitMode=y&&y.fitMode,this.videoDimensions={},y&&(this.videoDimensions.width=y.width,this.videoDimensions.height=y.height,this.videoDimensions.orientation=y.orientation,y.on("update",p),this.frameRate=y.frameRate),b&&b.on("update",p),this.setChannelActiveState=function(e,t,n,r){const i={active:t};n&&(i.activeReason=n),r&&(i.congestionLevel=r),v(e,i)},this.setVideoDimensions=function(e,t){v("video",{width:e,height:t,orientation:0})},this.setRestrictFrameRate=function(e){v("video",{restrictFrameRate:e})},this.setPreferredResolution=function(e){if(!g())return void r.warn("setPreferredResolution has no affect when called by a publisher");if(l.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=h.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;l._.subscriberChannelUpdate(h,m(),t,{preferredWidth:t.preferredWidth||0,preferredHeight:t.preferredHeight||0})}},this.getPreferredResolution=function(){const e=h.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(l.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=h.getChannelsOfType("video")[0];t&&(t.preferredFrameRate=e?parseFloat(e):null,l._.subscriberChannelUpdate(h,m(),t,{preferredFrameRate:t.preferredFrameRate||0}))},this.getPreferredFrameRate=function(){const e=h.getChannelsOfType("video")[0];return e?e.preferredFrameRate:null};let v=function(e,t){let n;if(h.publisher)n=e=>l._.streamChannelUpdate(h,e,t);else{const e=m();n=n=>l._.subscriberChannelUpdate(h,e,n,t)}h.getChannelsOfType(e).forEach(n)};this.destroyed=!1,this.destroyedReason=void 0,this.destroy=function(e,t){void 0===e&&(e="clientDisconnected"),f=e,h.destroyed=!0,h.destroyedReason=f,!0!==t&&h.dispatchEvent(new a.DestroyedEvent("destroyed",h,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=h[e],i=t;switch(e){case"name":h[e]=i;break;case"archiving":var o=m();h.publisher&&o&&o._.archivingStatus(i),h[e]=i}const s=new a.StreamUpdatedEvent(h,e,n,i);h.dispatchEvent(s)},this._.update=function(e){for(const t in e)e.hasOwnProperty(t)&&h._.updateProperty(t,e[t])},this._.forceMute=function(e){e.hasOwnProperty("channels")&&e.channels.includes("audio")&&h.publisher&&h.publisher._.forceMuteAudio()},this._.updateChannel=function(e,t){const n=h.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(170),o=n(6),s=n(23)(),a=n(740);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(40),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){var r=n(42),i=n(31);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(378),i=n(65),o=n(12),s=n(66),a=n(67),c=n(86),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),l=!n&&i(e),d=!n&&!l&&s(e),h=!n&&!l&&!d&&c(e),f=n||l||d||h,p=f?r(e.length,String):[],m=p.length;for(var g in e)!t&&!u.call(e,g)||f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||p.push(g);return p}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){(function(e){var r=n(15),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(85)(e))},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(120),i=n(121),o=n(119),s=n(181),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(184),i=n(119),o=n(31);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(120),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(184),i=n(182),o=n(55);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(40)(n(15),"Set");e.exports=r},function(e,t,n){var r=n(40)(n(15),"WeakMap");e.exports=r},function(e,t,n){var r=n(15).Uint8Array;e.exports=r},function(e,t,n){var r=n(122);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(87),i=n(121),o=n(69);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},function(e,t,n){var r=n(114);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(88),i=n(126);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(124),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(406)()?WeakMap:n(407)},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(198),o=n(32),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(409)},function(e,t,n){"use strict";var r=n(45),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(412),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(45),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(419)()?String.prototype.contains:n(420)},function(e,t,n){"use strict";var r=n(90),i=n(91),o=n(421),s=n(450),a=n(451),c=n(46).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(426);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(430),o=n(129),s=n(70),a=n(32),c=n(33),u=n(431),l=n(46),d=Object.defineProperty,h=Object.defineProperties;e.exports=r=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");h(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,h(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[l.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)):d(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}))}))),d(r.prototype,l.iterator,c((function(){return this})))},function(e,t,n){"use strict";var r=n(57),i=n(128),o=n(433),s=n(434),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(462)},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(20);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(20),i=n(467),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(212)),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(44))},function(e,t,n){"use strict";(function(t){var r=n(20),i=n(468),o=n(470),s=n(209),a=n(471),c=n(474),u=n(475),l=n(213);e.exports=function(e){return new t((function(t,n){var d=e.data,h=e.headers;r.isFormData(d)&&delete h["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(p+":"+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(l("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(l("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||u(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(h[e.xsrfHeaderName]=b)}if("setRequestHeader"in f&&r.forEach(h,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete h[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)})),d||(d=null),f.send(d)}))}}).call(this,n(1))},function(e,t,n){"use strict";var r=n(469);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(20);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 l=i.concat(o).concat(s).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(d,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(480),i=n(482);e.exports=function(e,t,n){return r(i,e,t,n)}},function(e,t,n){var r=n(89),i=n(218),o=i?function(e,t){return i.set(e,t),e}:r;e.exports=o},function(e,t,n){var r=n(187),i=r&&new r;e.exports=i},function(e,t,n){var r=n(220),i=n(221),o=n(486),s=n(96),a=n(222),c=n(228),u=n(495),l=n(138),d=n(15);e.exports=function e(t,n,h,f,p,m,g,b,y,v){var w=128&n,S=1&n,T=2&n,E=24&n,x=512&n,_=T?void 0:s(t);return function C(){for(var I=arguments.length,R=Array(I),Z=I;Z--;)R[Z]=arguments[Z];if(E)var k=c(C),O=o(R,k);if(f&&(R=r(R,f,p,E)),m&&(R=i(R,m,g,E)),I-=O,E&&I<v){var V=l(R,k);return a(t,n,e,C.placeholder,h,R,V,b,y,v-I)}var G=S?h:this,A=T?G[t]:t;return I=R.length,b?R=u(R,b):x&&I>1&&R.reverse(),w&&y<I&&(R.length=y),this&&this!==d&&this instanceof C&&(A=_||s(A)),A.apply(G,R)}}},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,l=n(s-a,0),d=Array(u+l),h=!i;++c<u;)d[c]=t[c];for(;++o<a;)(h||o<s)&&(d[r[o]]=e[o]);for(;l--;)d[c++]=e[o++];return d}},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,l=t.length,d=n(s-c,0),h=Array(d+l),f=!i;++o<d;)h[o]=e[o];for(var p=o;++u<l;)h[p+u]=t[u];for(;++a<c;)(f||o<s)&&(h[p+r[a]]=e[o++]);return h}},function(e,t,n){var r=n(487),i=n(226),o=n(227);e.exports=function(e,t,n,s,a,c,u,l,d,h){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var p=[e,t,a,f?c:void 0,f?u:void 0,f?void 0:c,f?void 0:u,l,d,h],m=n.apply(void 0,p);return r(e)&&i(m,p),m.placeholder=s,o(m,e,t)}},function(e,t,n){var r=n(218),i=n(224),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(87),i=n(137);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(217),i=n(194)(r);e.exports=i},function(e,t,n){var r=n(492),i=n(493),o=n(125),s=n(494);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(499),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(507),i=n(19);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(93),i=n(232),o=n(95);e.exports=function(e,t,n,s,a,c){var u=1&n,l=e.length,d=t.length;if(l!=d&&!(u&&d>l))return!1;var h=c.get(e),f=c.get(t);if(h&&f)return h==t&&f==e;var p=-1,m=!0,g=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<l;){var b=e[p],y=t[p];if(s)var v=u?s(y,b,p,t,e,c):s(b,y,p,e,t,c);if(void 0!==v){if(v)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!==y&&!a(b,y,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(512),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(514),i=n(515);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t,n){var r=n(120),i=n(521);e.exports=function e(t,n,o,s,a){var c=-1,u=t.length;for(o||(o=i),a||(a=[]);++c<u;){var l=t[c];n>0&&o(l)?n>1?e(l,n-1,o,s,a):r(a,l):s||(a[a.length]=l)}return a}},function(e,t,n){var r=n(528)();e.exports=r},function(e,t,n){"use strict";var r=n(529),i=n(530);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=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=v(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"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),h=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+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},y=n(531);function v(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 v=e=u.join(a);if(v=v.trim(),!n&&1===e.split("#").length){var w=c.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=s.exec(v);if(S){var T=(S=S[0]).toLowerCase();this.protocol=T,v=v.substr(S.length)}if(n||S||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===v.substr(0,2);!E||S&&g[S]||(v=v.substr(2),this.slashes=!0)}if(!g[S]&&(E||S&&!b[S])){for(var x,_,C=-1,I=0;I<h.length;I++){-1!==(R=v.indexOf(h[I]))&&(-1===C||R<C)&&(C=R)}-1!==(_=-1===C?v.lastIndexOf("@"):v.lastIndexOf("@",C))&&(x=v.slice(0,_),v=v.slice(_+1),this.auth=decodeURIComponent(x)),C=-1;for(I=0;I<d.length;I++){var R;-1!==(R=v.indexOf(d[I]))&&(-1===C||R<C)&&(C=R)}-1===C&&(C=v.length),this.host=v.slice(0,C),v=v.slice(C),this.parseHost(),this.hostname=this.hostname||"";var Z="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!Z)for(var k=this.hostname.split(/\./),O=(I=0,k.length);I<O;I++){var V=k[I];if(V&&!V.match(f)){for(var G="",A=0,W=V.length;A<W;A++)V.charCodeAt(A)>127?G+="x":G+=V[A];if(!G.match(f)){var N=k.slice(0,I),L=k.slice(I+1),X=V.match(p);X&&(N.push(X[1]),L.unshift(X[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Z||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+M,this.href+=this.host,Z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[T])for(I=0,O=l.length;I<O;I++){var P=l[I];if(-1!==v.indexOf(P)){var j=encodeURIComponent(P);j===P&&(j=escape(P)),v=v.split(P).join(j)}}var U=v.indexOf("#");-1!==U&&(this.hash=v.substr(U),v=v.slice(0,U));var H=v.indexOf("?");if(-1!==H?(this.search=v.substr(H),this.query=v.substr(H+1),t&&(this.query=y.parse(this.query)),v=v.slice(0,H)):t&&(this.search="",this.query={}),v&&(this.pathname=v),b[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},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=y.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(v(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 l=c[u];"protocol"!==l&&(n[l]=e[l])}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 d=Object.keys(e),h=0;h<d.length;h++){var f=d[h];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 p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.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||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=w||v||n.host&&e.pathname,T=S,E=n.pathname&&n.pathname.split("/")||[],x=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!b[n.protocol]);if(x&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),S=S&&(""===p[0]||""===E[0])),w)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,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(x)n.hostname=n.host=E.shift(),(Z=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=Z.shift(),n.host=n.hostname=Z.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(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var _=E.slice(-1)[0],C=(n.host||e.host||E.length>1)&&("."===_||".."===_)||""===_,I=0,R=E.length;R>=0;R--)"."===(_=E[R])?E.splice(R,1):".."===_?(E.splice(R,1),I++):I&&(E.splice(R,1),I--);if(!S&&!T)for(;I--;I)E.unshift("..");!S||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),C&&"/"!==E.join("/").substr(-1)&&E.push("");var Z,k=""===E[0]||E[0]&&"/"===E[0].charAt(0);x&&(n.hostname=n.host=k?"":E.length?E.shift():"",(Z=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=Z.shift(),n.host=n.hostname=Z.shift()));return(S=S||n.host&&E.length)&&!k&&E.unshift(""),E.length?n.pathname=E.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(18),i=n(17),o=n(2)("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(1))},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(245),i=n(3),o=n(247),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(246);e.exports=function(e,t){return new r(e,t)}},function(e,t,n){"use strict";const r=n(18),i={attributes:n(540),css:n(541),classNames:n(546),observers:n(548)},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(18),i=n(6),o=n(2)("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(2)("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,l=i.setWarning,d=void 0===l?"":l,h=i.canSet,f=void 0!==h&&h,p=i.warnOnSet,m=o,g=!1,b=!(void 0!==p&&p);const y={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. ${d}`.trim()):r.warn(`${a} is deprecated, and will be removed in the future. ${d}`.trim()))}};Object.defineProperty(e,t,y)}},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 l=r.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=l}))),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(0)(n(14));const i=n(50);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(255),i=n(578),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,l=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&&l({channelCount:2}),["echoCancellation","autoGainControl","noiseSuppression"].forEach(t=>{const n=!u&&e[t];l({[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(575),i=n(192)((function(e,t,n){r(e,t,n)}));e.exports=i},function(e,t,n){var r=n(64),i=n(54);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(61),i=n(260);e.exports=function(e){return i(r(e).toLowerCase())}},function(e,t,n){var r=n(583)("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(585),i=n(262),o=n(586);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(100),i=n(592)(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(58);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);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(34),i=n(78),o=n(608),s=n(60),a=n(42),c=n(611),u=n(141),l=n(185),d=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,l(e),n),u&&(n=i(n,7,c));for(var d=t.length;d--;)o(n,t[d]);return n}));e.exports=d},function(e,t,n){var r=n(206),i=n(36),o=n(97),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(613);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){"use strict";const r=n(620),i=n(278),o=n(104)();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(30),i=n(12),o=n(19);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(31);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){"use strict";const r=n(104)(),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(0);t.__esModule=!0,t.default=void 0;var i=r(n(105)),o=r(n(37)),s=r(n(14)),a=n(28),c=r(n(39)),u=r(n(634)),l=r(n(636)),d=r(n(50));const h=(0,r(n(2)).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,d.default)()),(0,s.default)((0,i.default)(t),"offerMessagesReceived",0),(0,s.default)((0,i.default)(t),"prevStats",{timeStamp:(0,d.default)()}),(0,s.default)((0,i.default)(t),"changeCounters",{videoCodec:new l.default,audioCodec:new l.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,d.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?h.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 p=f;t.default=p},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(17),i=n(160).default,o=n(7),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,l=t.Errors,d=void 0===l?o:l,h=t.otError,f=void 0===h?s():h;const p=!a&&!!u.navigator.webkitGetUserMedia&&!u.navigator.userAgent.match(/android/i)&&void 0!==u.chrome;return{isSupportedInThisBrowser:p,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=p,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(d.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(d.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(d.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=p&&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(d.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(d.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(106);e.exports=function(e){void 0===e&&(e={});const o=e.Archiving||n(641),s=e.AudioLevelMeter||n(283),a=e.AudioLevelTransformer||n(145),c=e.BackingBar||n(284),u=e.Chrome||n(146),l=e.MuteButton||n(285)(),d=e.NamePanel||n(286),h=e.VideoDisabledIndicator||n(287),f=e.StylableComponent||n(153),p=e.logging||n(2)("createChromeMixin");return function(e,n){let m,g,b,y=void 0===n?{}:n,v=y.name,w=y.publishAudio,S=y.publishVideo,T=y.audioSource,E=y.showControls,x=y.shouldAllowAudio,_=y.logAnalyticsEvent;const C={},I=r(),R=t=>{if(!1===t)return"off";const n=e.getStyle("buttonDisplayMode");return!1===n?"on":n};let Z=new t((t,n)=>{C.init=n=>{e.getStyle("showArchiveStatus")||_("showArchiveStatus","createChrome",{mode:"off"});const r={backingBar:new c({nameMode:v?e.getStyle("nameDisplayMode"):"off",muteMode:R(e.getStyle("buttonDisplayMode"))}),name:new d({name:v,mode:e.getStyle("nameDisplayMode")}),archive:new o({show:Boolean(e.getStyle("showArchiveStatus"))&&"off"!==e.getStyle("archiveStatusDisplayMode"),archiving:!1}),muteButton:new l({muted:!1===w,mode:R.call(null,e.getStyle("buttonDisplayMode"))})};m=new s({mode:e.getStyle("audioLevelDisplayMode")});const f=new a,p=new i(()=>{const t=w?f.transform(e.loudness):0;m.setValue(t)});m.watchVisibilityChanged(e=>{e?p.start():p.stop()}),m.audioOnly(!S&&w),r.audioLevel=m,r.videoDisabledIndicator=new h({mode:e.getStyle("videoDisabledDisplayMode")}),n&&n.domElement&&(b=n,g=new u({parent:b.domElement}).set(r).on({muted:()=>e.publishAudio(!1),unmuted:()=>e.publishAudio(!0)}),null!==T&&!1!==T||C.removeAudioTrack(),t())},C.reset=()=>{n(new Error("Chrome still being created")),g&&(g.destroy(),g=null)},C.destroy=()=>{C.reset(),I.releaseAll(),Z=null}});Z.catch(e=>{e&&"Chrome still being created"===e.message||p.error("createChromeMixin failed to setup UI",e)}),C.setAudioOnly=e=>{m&&m.audioOnly(e)},C.setArchivingStatus=e=>{g&&g.archive.setArchiving(e)},C.setMuted=e=>{g&&g.muteButton&&g.muteButton.muted(e)},C.removeAudioTrack=()=>{g&&g.muteButton&&g.muteButton.remove()},C.addAudioTrack=()=>{g&&g.muteButton&&g.muteButton.add()},C.videoDisabledIndicator={disableVideo:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return null==(e=g)?void 0:e.videoDisabledIndicator.disableVideo(...n)},setWarning:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return null==(e=g)?void 0:e.videoDisabledIndicator.setWarning(...n)}},f(e,{showArchiveStatus:!0,nameDisplayMode:"auto",buttonDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioLevelDisplayMode:x?"auto":"off",archiveStatusDisplayMode:"auto",backgroundImageURI:null},E,e=>{_("SetStyle","Publisher",e,null,.1)});const k=(e,t)=>{Z.then(()=>{switch(e){case"nameDisplayMode":g.name.setDisplayMode(t),g.backingBar.setNameMode(t);break;case"showArchiveStatus":_("showArchiveStatus","styleChange",{mode:t?"on":"off"}),g.archive.setShowArchiveStatus(Boolean(t));break;case"archiveStatusDisplayMode":g.archive.setShowArchiveStatus("off"!==t);break;case"buttonDisplayMode":g.muteButton.setDisplayMode(t),g.backingBar.setMuteMode(t);break;case"audioLevelDisplayMode":g.audioLevel.setDisplayMode(t);break;case"backgroundImageURI":b.setBackgroundImageURI(t)}})};return e.on("styleValueChanged",k),I.add(()=>e.off("styleValueChanged",k)),C}}}).call(this,n(1))},function(e,t,n){"use strict";(function(t){const r=n(107),i=n(38),o=n(8),s=n(28);e.exports=function(e){const n=this,a=new s;let c,u,l,d,h=!0,f=!1,p="auto";const m=e.maxValue||1,g=e.minValue||0;function b(){const e=(f&&"auto"===p||"on"===p)&&h;d!==e&&(d=e,a.emit("visibilityChanged",e))}r(n,{audioOnly:{get:()=>f,set(e){f=e,b()}}}),n.setValue=function(e){l=e,function(){const e=(l-g)/(m-g);u.style.transform=`scale(${Math.sqrt(e)})`}()},n.watchVisibilityChanged=function(e){return a.on("visibilityChanged",e),t.resolve().then(()=>{e(d)}),function(){a.removeListener("visibilityChanged",e)}};const y={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,y),n.setDisplayMode=function(e){p=e,b()},n.getDisplayMode=function(){return p},n.showAfterLoading=function(){h=!0,b()},n.hideWhileLoading=function(){h=!1,b()},b()}}).call(this,n(1))},function(e,t,n){"use strict";const r=n(38);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(8),i=n(38),o=n(107);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(38),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";const r=n(38),i=n(8);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";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(160).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(l){switch(l.label){case 0:n=0,c=function(){var c,u,l;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===(l=o(u,n))||null==l||n>=s)throw u;return"number"!=typeof l?[3,4]:[4,new e((function(e){return i().setTimeout(e,l)}))];case 3:return r.sent(),[3,5];case 4:if(!0!==l)throw new Error("onFailure must return boolean, or delay in ms");r.label=5;case 5:return[3,6];case 6:return[2]}}))},l.label=1;case 1:return(n+=1)?[5,c()]:[3,3];case 2:return"object"==typeof(u=l.sent())?[2,u.value]:[3,1];case 3:return[2]}}))}))}}}.call(this,n(1))},function(e,t,n){"use strict";const r=n(2)("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(107);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(7),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(0),i=r(n(16)),o=r(n(4)),s=r(n(5)),a=r(n(14));const c=n(6),u=n(63),l=n(652),d=n(653),h=n(654),f=n(109),p=n(3),m=n(24)().hasAudioOutputApiSupport,g=n(296),b=n(108).getCurrentAudioOutputDeviceId;function y(e,t){const n=document.createElement("video");return d(n),n.autoplay=!0,n.playsinline=!0,n.innerHTML=e,n.setAttribute("autoplay",""),n.setAttribute("playsinline",""),!0===t&&(n.muted="true"),n}function v(){const e=y("");return e.setAttribute("style","display:none"),e}e.exports=function(e){void 0===e&&(e={});const r=e.audioContext||n(159)(),d=e.canBeOrientatedMixin||n(655),w=e.document||(void 0!==typeof window?window:global).document,S=e.listenForTracksEnded||n(656)(),T=e.logging||n(2),E=e.OTHelpers||n(8),x=e.videoElementErrorMap||n(294)(),_=e.WebaudioAudioLevelSampler||n(147),C=e.global||(void 0!==typeof window?window:global);let I=1;return function(){function e(e,t){var n=this;let r=e._inject,i=void 0===r?{}:r,l=i.createVideoElement,h=void 0===l?y:l,f=i.createAudioOnlyVideoElement,m=void 0===f?v:f,b=e.muted,w=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=T("NativeVideoElementWrapper:"+I),I+=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 E=!1;this._domElement=h(w,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",x(e.target.error))},!1),this._domElementEvents.on("pause",()=>{E||(this.logging.warn("Video element paused, auto-resuming. If you intended to do this, use publishVideo(false) or subscribeToVideo(false) instead."),E=!0),this.play()}),this.on("destroyed",()=>{this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll()}),d(this,()=>this._domElement),p.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=p.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 C.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=E.createElement("canvas",{width:this.videoWidth(),height:this.videoHeight(),style:{display:"none"}});w.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 E.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 _(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,l,d,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,!p.isSafari){e.next=5;break}return e.next=5,g();case 5:if(!p.isiOS||!p.isSafari){e.next=15;break}if("publisher"!==this._widgetType){e.next=14;break}if(r=p.iOSVersion>=14&&p.iOSVersion<=14.2,i=this._stream.getVideoTracks(),s=i[0],a=void 0===s?{}:s,c=this._stream.getAudioTracks(),u=c[0],l=void 0===u?{}:u,!r||h(n)||!a.enabled){e.next=12;break}return e.abrupt("return");case 12:if(!l.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(),d=e.t0||{},f=d.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&&(E.removeElement(this._domElement),this._domElement=null),this._domAudioOnlyVideoElement&&(E.removeElement(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElement=null),this.trigger("destroyed"),l("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(1))},function(e,t,n){"use strict";(function(t){e.exports=()=>new t(e=>setTimeout(e))}).call(this,n(1))},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(4)),o=r(n(5));const s=n(9),a=n(49),c=n(62),u=n(6),l=n(298),d=n(299),h=n(658);e.exports=function(e){void 0===e&&(e={});const r=e.getStatsHelpers||n(76),f=e.OTHelpers||n(8),p=e.PeerConnection||n(73)(),m=e.setCertificates||n(164)(),g=e.watchAudioAcquisition||n(660);return function(e){var n=this;let b,y,v=e.iceConfig,w=e.webRTCStream,S=e.channels,T=e.sendMessage,E=e.capableSimulcastStreams,x=e.overrideSimulcastEnabled,_=e.logAnalyticsEvent,C=e.offerOverrides,I=e.answerOverrides,R=e.sourceStreamId,Z=e.isP2pEnabled,k=e.sessionId,O=e.keyStore,V=e.sFrameClientStore,G=e.isE2ee,A=!1;const W=function(){this.destroy(),A&&(A=!1,this.trigger("iceRestartFailure")),this.trigger("disconnected")},N=function(e){let t=e.reason,n=e.prefix;this.trigger("error",{reason:t,prefix:n})},L=function(e){A&&b.iceConnectionStateIsConnected()&&(A=!1,this.trigger("iceRestartSuccess")),"connected"===e&&("Chrome"===f.env.name&&(y&&y(),y=g(b.getStats.bind(b),()=>this.trigger("audioAcquisitionProblem"))),this.trigger("connected")),this.trigger("iceConnectionStateChange",e)};u(this),this.startEncryption=e=>{b&&b.startEncryption(e)},this.changeMediaDirectionToInactive=()=>{b&&b.changeMediaDirectionToInactive()},this.changeMediaDirectionToRecvOnly=()=>{b&&b.changeMediaDirectionToRecvOnly()},this.getDataChannel=function(e,t,n){b.getDataChannel(e,t,n)},this.getSourceStreamId=()=>b.getSourceStreamId(),this.destroy=function(){y&&(y(),y=null),b&&(b.disconnect(),b=null),this.off()},this.processMessage=function(e,t){b.processMessage(e,t)},this.addTrack=function(e,t,n){return b.addTrack(e,t,n)},this.removeTrack=function(e){return b.removeTrack(e)},this.getLocalStreams=function(){return b.getLocalStreams()},this.init=function(e,t){l(R)&&d(v);const n={iceConfig:v.needRumorIceServersFallback?s(v,{servers:[...e,...v.servers]}):v,channels:S,capableSimulcastStreams:E,overrideSimulcastEnabled:x};m(n,(e,n)=>{if(e)return void t(e);const r=s({logAnalyticsEvent:_,isPublisher:!0,offerOverrides:C,answerOverrides:I,sourceStreamId:R,p2p:Z,sessionId:k,keyStore:O,sFrameClientStore:V,isE2ee:G},n);b=new p(s({sendMessage:T},r)),b.on({close:W,error:N,qos:e=>this.trigger("qos",e),iceConnectionStateChange:L},this),b.addLocalStream(w).then(()=>{t(void 0)}).catch(t)})},this.setIceConfig=e=>{b.setIceConfig(e)},this.generateOffer=()=>{b.generateOffer()},this.getSenders=function(){return b.getSenders()},this.iceRestart=function(){b&&(A=!0,b.iceRestart())},this.hasRelayCandidates=()=>b.hasRelayCandidates(),this.iceConnectionStateIsConnected=function(){return b.iceConnectionStateIsConnected()},this.findAndReplaceTrack=(e,t)=>b.findAndReplaceTrack(e,t),this._testOnlyGetFramesEncoded=()=>new t((e,t)=>{b.getStats((n,i)=>{if(n)return void t(n);const o=c(i,e=>r.isVideoStat(e,i)&&r.isOutboundStat(e));o?e(a(o,["timestamp","framesEncoded"])):t(new Error("Could not find framesEncoded in getStats report"))})}),this.getStats=e=>b.getStats(e),this.getRtcStatsReport=e=>b.getRtcStatsReport(e),this.setP2PMaxBitrate=(0,o.default)(i.default.mark((function e(){var t,r,o,s,a,c,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"===n.getSourceStreamId()){e.next=2;break}return e.abrupt("return");case 2:if(r=n.getSenders().find(e=>"video"===e.track.kind)){e.next=5;break}return e.abrupt("return");case 5:return o=(null==r||null==(t=r.track)||null==t.getSettings?void 0:t.getSettings())||{},s=o.width,a=o.height,c=h(s,a),(u=r.getParameters()).encodings.forEach(e=>{e.maxBitrate=c}),e.prev=9,e.next=12,r.setParameters(u);case 12:e.next=16;break;case 14:e.prev=14,e.t0=e.catch(9);case 16:case"end":return e.stop()}}),e,null,[[9,14]])})))}}}).call(this,n(1))},function(e,t,n){"use strict";const r=n(657);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(8),a=e.PeerConnection||n(73)(),c=e.SinglePeerConnectionAdapter||n(661)(),u=e.setCertificates||n(164)(),l=e.Errors||n(7),d=e.ExceptionCodes||n(10),h=e.OTErrorClass||n(22),f=e.watchSubscriberAudio||n(662);return function(e){let n=e.clientCandidates,p=e.iceConfig,m=e.send,g=e.logAnalyticsEvent,b=e.p2p,y=e.codecFlags,v=e.sourceStreamId,w=e.remoteConnectionId,S=e._singlePeerConnectionController,T=e.keyStore,E=e.sFrameClientStore,x=e.isE2ee;const _=this;let C,I=!1,R=!1,Z=null;const k=!!S;let O=!1;const V=[],G=[],A=function(){this.destroy(),R&&this.trigger("iceRestartFailure",this),this.trigger("disconnected",this)},W=e=>{this.trigger("remoteStreamRemoved",e,this)},N=e=>{O||(e.onremovetrack=t=>{(e=>{const t="video"===e.kind?V:G,n=t.indexOf(e);n>-1&&t.splice(n,1)})(t),k&&C&&C.removeTrack(t),setTimeout(()=>{V.length||G.length||W(e)},100)},O=!0)},L=e=>{const t=e.stream;(e=>{const t="video"===e.kind?V:G;t.includes(e)||t.push(e)})(e.track),N(t),this.trigger("remoteTrackAdded",e,this)},X=e=>{this.trigger("remoteVideoSupported",e)},M=()=>{this.trigger("decryptFailed")},F=()=>{this.trigger("decryptRestored")},P=function(e){let t=e.reason,n=e.prefix;this.trigger("error",null,t,this,n)},j=function(e){!R||"connected"!==e&&"completed"!==e||(R=!1,this.trigger("iceRestartSuccess")),"connected"===e&&this.trigger("connected"),this.trigger("iceConnectionStateChange",e)},U=function(e){this.trigger("signalingStateChange",e)},H=function(e){this.trigger("signalingStateStable",e)},Y=(e,t)=>{"answer"!==e&&"pranswer"!==e||this.trigger("connected"),m(e,t)};i(this),this._hasAudioTracks=()=>G.length>0,this._hasVideoTracks=()=>V.length>0,this._getVideoTracks=()=>V,this._getAudioTracks=()=>G,this._getTracks=()=>[...G,...V],this.close=function(){I||(I=!0,C&&(C.disconnect(),C=null),this.off())},this.destroy=function(){this.stopAudioStatsWatcher(),I||this.close()},this.getDataChannel=function(e,t,n){C.getDataChannel(e,t,n)},this.getSourceStreamId=()=>C.getSourceStreamId(),this.processMessage=function(e,t){C.processMessage(e,t)},this.remoteDescription=function(){return C.remoteDescription()},this.getStats=function(e){if(C)C.getStats(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(h.getTitleByCode(n),l.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getSynchronizationSources=function(e){if(C)C.getSynchronizationSources(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(h.getTitleByCode(n),l.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getRtcStatsReport=function(e){if(C)C.getRtcStatsReport(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(h.getTitleByCode(n),l.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.setIceConfig=e=>{C.setIceConfig(e)},this.generateOffer=()=>{C.generateOffer()},this.startAudioStatsWatcher=function(e){Z||(Z=f(C.getStats.bind(C),e=>{this.stopAudioStatsWatcher(),this.trigger("audioLevelStuckWarning",e)},e))},this.stopAudioStatsWatcher=function(){Z&&Z.stop(),Z=null};const D=function(e){return function(t){const n="video"===e?V:G;C&&C.remoteTracks().forEach(r=>{r.kind===e&&r.enabled!==t&&n.includes(r)&&(r.enabled=t)})}};this.subscribeToAudio=D("audio"),this.subscribeToVideo=D("video"),this.hasRelayCandidates=function(){return C.hasRelayCandidates()},this.iceRestart=function(){return R=!0,C.iceRestart()},this.iceConnectionStateIsConnected=function(){return C.iceConnectionStateIsConnected()},this.init=function(e){o(v)&&s(p);u({iceConfig:p},(t,i)=>{if(t)return void e(t);const o=r({logAnalyticsEvent:g,clientCandidates:n,codecFlags:y,sourceStreamId:v,keyStore:T,sFrameClientStore:E,isE2ee:x},i),s=r({sendMessage:Y,p2p:b},o,{remoteConnectionId:w});C=k?new c(s,S):new a(s),C.on({iceConnected:()=>_.emit("iceConnected"),close:A,trackAdded:L,signalingStateChange:U,signalingStateStable:H,error:P,qos:e=>this.trigger("qos",e),iceConnectionStateChange:j,remoteVideoSupported:X,decryptFailed:M,decryptRestored:F},_),!k&&C.remoteTracks().length>0?C.remoteStreams().forEach(e=>{e.getTracks().forEach(t=>L({stream:e,track:t}))}):e(void 0,_)})}}}},function(e,t,n){"use strict";e.exports=(e,t)=>{e.forEach((n,r)=>{(n.id||n)===(t.id||t)&&e.splice(r,1)})}},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(1);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(0),i=r(n(16)),o=r(n(4)),s=r(n(5));const a=n(142),c=n(255),u=n(9),l=n(277),d=n(59),h=n(51),f=n(166).CancellationError,p=n(17),m=n(28),g=n(50),b=n(268),y=n(27),v=n(6),w=n(671),S=n(106),T=n(63),E=n(672),x=n(7),_=n(165)(),C=n(673),I=n(283),R=n(145),Z=n(284),k=n(146),O=n(3),V=n(7),G=n(23)(),A=n(10),W=n(76),N=n(306),L=n(307),X=n(674),M=n(163)(),F=n(2)("Subscriber"),P=n(285)(),j=n(286),U=n(13)(),H=n(22),Y=n(8),D=n(153),B=n(144)(void 0!==typeof window?window:global),K=n(73)({global:B}),J=n(300)({PeerConnection:K}),z=n(308),Q=n(287),q=n(677),$=n(678),ee=n(679),te=n(309),ne=n(103).parseIceServers,re=n(680),ie=n(681),oe=n(682),se=n(311),ae=n(168),ce=n(312),ue=(e,t)=>e.connection.id===t.connection.id;e.exports=function(e){let n=void 0===e?{}:e,r=n.AudioLevelMeter,B=void 0===r?I:r,K=n.AudioLevelTransformer,le=void 0===K?R:K,de=n.BackingBar,he=void 0===de?Z:de,fe=n.Chrome,pe=void 0===fe?k:fe,me=n.env,ge=void 0===me?O:me,be=n.Errors,ye=void 0===be?V:be,ve=n.Events,we=void 0===ve?G:ve,Se=n.ExceptionCodes,Te=void 0===Se?A:Se,Ee=n.audioLevelSampler,xe=void 0===Ee?X:Ee,_e=n.getStatsHelpers,Ce=void 0===_e?W:_e,Ie=n.hasAudioOutputLevelStatCapability,Re=void 0===Ie?N:Ie,Ze=n.hasRemoteStreamsWithWebAudio,ke=void 0===Ze?L:Ze,Oe=n.interpretPeerConnectionError,Ve=void 0===Oe?M:Oe,Ge=n.logging,Ae=void 0===Ge?F:Ge,We=n.MuteButton,Ne=void 0===We?P:We,Le=n.NamePanel,Xe=void 0===Le?j:Le,Me=n.otError,Fe=void 0===Me?U:Me,Pe=n.OTErrorClass,je=void 0===Pe?H:Pe,Ue=n.OTHelpers,He=void 0===Ue?Y:Ue,Ye=n.StylableComponent,De=void 0===Ye?D:Ye,Be=n.SubscriberPeerConnection,Ke=void 0===Be?J:Be,Je=n.SubscribingState,ze=void 0===Je?z:Je,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,it=void 0===rt?ee:rt,ot=n.createSendMethod,st=void 0===ot?te:ot,at=n.parseIceServers,ct=void 0===at?ne:at,ut=n.document,lt=void 0===ut?(void 0!==typeof window?window:global).document:ut,dt=n.WidgetView,ht=void 0===dt?_:dt;const ft=function e(n,r,_){var I=this;if(void 0===r&&(r={}),void 0===_&&(_=()=>{}),void 0===r.analytics)throw new Error("Subscriber requires an instance of analytics");const R=r.analytics,Z=p(),k=e.hasAudioOutputLevelStatCapability()||ke(),O=this,V={},G={},A={},W={},N={},L=new ce;let X,M,F,P,j,U,H,Y,D,K,J,z,Q,q,$=!1,ee=n||Z,te=r.session,ne=r.stream;const de=r._singlePeerConnectionController,fe=void 0!==de;let me,be,ve,Se,Ee,_e=!1,Ie={},Re=null,Ze=!1,Oe=!0,Ge=[],We=a({},r,{showControls:!0,testNetwork:!1,fitMode:ne.defaultFitMode||"cover",insertDefaultUI:!0});const Le=te.sessionInfo.isAdaptiveEnabled,Me={P2P:y.SUBSCRIBER_DISCONNECTED,MANTIS:y.SUBSCRIBER_DISCONNECTED},Pe="Chrome"===ge.name&&ge.version>=58||ge.isChromiumEdge||ge.isOpera,Ue=te._.getSocket(),Ye=()=>l(G),Be=e=>G[e],Ke=()=>G[Ee],Je=function(){var e=(0,s.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G[t];case 2:null==(n=e.sent)||n.close(),delete G[t];case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Qe=e=>{delete A[e]},$e=()=>{Ye().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(G).forEach(e=>{delete G[e]})},tt=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:Tt,audioVolume:be},r=Le&&"P2P"===Ee,e.prev=4,e.next=7,X.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||U.isDestroyed())){e.next=13;break}return e.abrupt("return");case 13:if(!e.t0.message.includes("bufferFailed")){e.next=16;break}return I._.startRelayedToRoutedTransition(),e.abrupt("return");case 16:throw Tt(e.t0),e.t0;case 18:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t){return e.apply(this,arguments)}}(),rt=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?Mt():Xt(),!r||se){e.next=7;break}return i=Te.GET_RTC_STATS_REPORT_NOT_SUPPORTED,n(Fe(x.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(je.getTitleByCode(i)),i)),e.abrupt("return");case 7:if(Ke()){e.next=11;break}return i=Te.PEER_CONNECTION_NOT_CONNECTED,n(Fe(ye.PEER_CONNECTION_NOT_CONNECTED,new Error(je.getTitleByCode(i)),i)),e.abrupt("return");case 11:return e.next=13,Ke();case 13:s=e.sent,(r?s.getRtcStatsReport:s.getStats)((e,t)=>{e?(e.code===Te.PEER_CONNECTION_NOT_CONNECTED&&(e=Fe(ye.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)}}(),ot=e=>!(!D||!me)&&("video"===e?D.getVideoTracks().length>0&&me.getVideoTracks().length>0:D.getAudioTracks().length>0&&me.getAudioTracks().length>0),at=(e,t,n,r,i)=>{let o=u({action:e,variation:t,payload:n,streamId:ne?ne.id:null,sessionId:te?te.sessionId:null,connectionId:te&&te.isConnected()?te.connection.connectionId:null,partnerId:te&&te.sessionInfo?te.sessionInfo.partnerId:null,subscriberId:Z,widgetType:"Subscriber"},r);("Failure"===t||"iceconnectionstatechange"===t&&"closed"===n)&&(o=u(o,Ie));const s=[o];i&&s.push(i),R.logEvent(...s)},ut=(e,t,n)=>{"Attempt"===t?(W[e]=(new Date).getTime(),at(e,t,n)):"Failure"!==t&&"Success"!==t||at(e,t,n,{attemptDuration:(new Date).getTime()-W[e]})},dt=function(e,t){void 0===t&&(t={}),ut("RoutedToRelayedTransition",e,t)},ht=function(e,t){void 0===t&&(t={}),ut("RelayedToRoutedTransition",e,t)},ft=ie({onInvalidTransition(e,t){const n=`Invalid state transition: Event '${e}' not possible in state '${t}'`;Ae.error(n),at("Subscriber:InvalidStateTransition","Event",{details:n})}});{const e="Unable to subscribe to stream in a reasonable amount of time";re({connectivityState:ft,onWarning(){pt("Warning",{})},onTimeout:()=>{if(X&&X.addError(e),U.isAttemptingToSubscribe()){U.set("Failed"),this._disconnect({noStateTransition:!0});const t=Fe(x.TIMEOUT,new Error(e),Te.UNABLE_TO_SUBSCRIBE);ft.fail({options:{failureReason:"Subscribe",failureMessage:e,failureCode:Te.UNABLE_TO_SUBSCRIBE},error:t})}},warningMs:15e3,timeoutMs:3e4})}if(V.promise=new t((e,t)=>{V.resolve=e,V.reject=t}),We.testNetwork&&te.sessionInfo.p2pEnabled&&Ae.warn("You cannot test your network with a relayed session. Use a routed session."),this.id=ee,this.widgetId=Z,this.session=te,this.stream=We.stream,ne=We.stream,this.streamId=ne.id,!te)return je.handleJsException({errorMsg:"OT.Subscriber must be passed a session option",code:2e3,target:this,analytics:R}),null;v(this),O.once("subscribeComplete",(function(){try{_(...arguments)}catch(e){Ae.error("Completion handler threw an exception",e)}})),te.on("captionReceived",e=>{e.streamId===O.streamId&&(this.dispatchEvent(e),this.trigger(y.SUBSCRIBER_CAPTION_RECEIVED,e))});ft.observe({onEnterConnecting(){pt("Attempt",null,{})},onEnterConnected(){pt("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;pt((e=>{let t=e.transition,n=e.from;return"fail"===t?"connected"===n?"Disconnect":"Failure":"disconnect"===t&&"connected"===n?"Disconnect":"Cancel"})(e),s,i)}}),ft.observe({onEnterConnected:()=>{this.trigger("subscribeComplete",void 0,this)},onEnterDisconnected:function(e,t){let n=e.from,r=(void 0===t?{}:t).error;"connecting"===n&&I.trigger("subscribeComplete",r||new Error("An unknown error occurred"),I)}}),oe({connectivityState:ft,logAttempt(){at("Subscribe","Attempting",null,{connectionId:te&&te.isConnected()?te.connection.connectionId:null})}});const pt=(e,t,n)=>{"Attempt"===e&&(z=(new Date).getTime()),at("Subscribe",e,t,"Failure"===e||"Success"===e||"Cancel"===e?(0,i.default)({},n,{attemptDuration:(new Date).getTime()-z}):n)},mt=(e,t)=>{at("ICERestart",e,t)},gt=e=>{var t,n;let r=e.parsedStats,o=e.remoteConnectionId,s=e.peerId,a=e.sourceStreamId;const c={widgetType:"Subscriber",width:X.width,height:X.height,audioTrack:ot("audio"),hasAudio:ne&&ne.hasAudio,subscribeToAudio:q,audioVolume:this.getAudioVolume(),videoTrack:ot("video"),connectionId:te?te.connection.connectionId:null,hasVideo:ne&&ne.hasVideo,subscribeToVideo:We.subscribeToVideo,congestionLevel:Re,streamId:ne.id,subscriberId:Z,duration:Math.round((g()-j)/1e3),remoteConnectionId:o,peerId:s,sourceStreamId:ae(a),preferredResolutionHeight:null==(t=We.preferredResolution)?void 0:t.height,preferredResolutionWidth:null==(n=We.preferredResolution)?void 0:n.width,preferredFrameRate:We.preferredFrameRate,audioFallback:!K&&"auto"===J},l=u(c,r);R.logQOS(l),this.trigger("qos",(0,i.default)({},R.commonQoSFields(),l))},bt=()=>{!U.isSubscribing()&&X&&X.video()&&($=!0,Ze||(ft.connect(),Ze=!0),Ae.debug("OT.Subscriber.onLoaded"),U.set("Subscribing"),j=g(),X.loading(!1),M&&M.showAfterLoading(),_e&&ne.setRestrictFrameRate(!0),P&&P.audioOnly(X.audioOnly()),this.setAudioVolume(be),this.trigger("loaded",this))},yt=()=>ne&&ne.hasAudio&&q&&this.getAudioVolume()>0&&!this.isAudioBlocked(),vt=e=>{let t=!1;if(!("audioLevelStuckAt0"===e&&(!yt()||ne&&ne.hasVideo))&&(at("subscriber:onAudioWarning","Event",{reason:e}),X)){if(X.rebindSrcObject(),at("subscriber:rebindSrcObject","Called"),"audioLevelStuck"===e)return;t=!0}wt(t)},wt=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),!Pe){e.next=6;break}return e.next=4,Ke();case 4:e.sent.startAudioStatsWatcher(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),St=()=>{Ae.debug("OT.Subscriber has been disconnected from the Publisher's PeerConnection"),ft.fail({options:{failureReason:"PeerConnectionError",failureCode:Te.UNABLE_TO_PUBLISH,failureMessage:"PeerConnection disconnected"},error:Fe(ye.DISCONNECTED,new Error("ClientDisconnected"))}),this._disconnect({noStateTransition:!0}),(U.isAttemptingToSubscribe()||U.isSubscribing())&&U.set("Failed")},Tt=e=>{const t=Fe(ye.MEDIA_ERR_DECODE,e,e.code||Te.P2P_CONNECTION_FAILED);t.message="OT.Subscriber while playing stream: "+t.message,Ae.error("OT.Subscriber.onVideoError"),ft.fail({options:{failureReason:"VideoElement",failureMessage:t.message,failureCode:t.code||Te.P2P_CONNECTION_FAILED},error:t});const n=U.isAttemptingToSubscribe();U.set("Failed"),n||O.trigger("error",t.message),je.handleJsException({error:t,code:Te.UNABLE_TO_SUBSCRIBE,target:O,analytics:R})},Et=e=>{const t=E(e);je.handleJsException({error:t,code:t.code,target:O,analytics:R}),this._disconnect({noStateTransition:!0});const n={failureReason:"Subscribe",failureMessage:"OT.Subscriber PeerConnection Error: "+t.message,failureCode:Te.P2P_CONNECTION_FAILED};Nt(t.code,t.message),ft.fail({options:n,error:Fe(t.name,new Error("Subscribe: Subscriber PeerConnection with connection (not found) failed: "+t.message),t.code)}),t.name===x.STREAM_NOT_FOUND&&this._destroy({reason:"streamNotFound",noStateTransition:!0})},xt=(e,t,n,r)=>{if("SetRemoteDescription"===r&&!Oe&&t.match(/Unsupported video without audio for fallback/)){let e;return X&&X.addError("The stream is unable to be played.","Your browser does not support the video format."),e="Safari"===He.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 Tt(e)}if("ICEWorkflow"===r&&te.sessionInfo.reconnection&&$)return void Ae.debug("Ignoring peer connection failure due to possibility of reconnection.");let i;i="ICEWorkflow"===r?Te.SUBSCRIBER_ICE_WORKFLOW_FAILED:e===Te.STREAM_LIMIT_EXCEEDED?e:Te.P2P_CONNECTION_FAILED;const o={failureReason:r||"PeerConnectionError",failureMessage:"OT.Subscriber PeerConnection Error: "+t,failureCode:i},s=Ve(e,t,r,"(not found)","Subscriber");if(ft.fail({options:o,error:s}),U.isAttemptingToSubscribe()){const e={hasRelayCandidates:n&&n.hasRelayCandidates()};at("createPeerConnection","Failure",e,o),U.set("Failed")}else U.isSubscribing()&&(U.set("Failed"),this.trigger("error",t));this._disconnect({noStateTransition:!0}),404===Number(e)&&this._destroy({noStateTransition:!0}),je.handleJsException({error:s,errorMsg:"OT.Subscriber PeerConnection Error: "+t,code:i,target:this,analytics:R}),Nt(e)},_t=e=>{const t=e._hasVideoTracks(),n=e._hasAudioTracks(),r=ne&&ne.hasVideo&&!t,i=ne&&ne.hasAudio&&!n;return!(r||i)},Ct=function(){var e=(0,s.default)(o.default.mark((function e(t,n){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,w(()=>_t(n));case 3:e.next=12;break;case 5:if(e.prev=5,e.t0=e.catch(0),"TIMEOUT"!==e.t0.message){e.next=11;break}Ae.error("The expected tracks never arrived"),e.next=12;break;case 11:throw e.t0;case 12:return r=n.getSourceStreamId(),fe&&"MANTIS"===r&&de.subscriberComplete(),e.next=16,It(t.stream,n);case 16:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),It=function(){var e=(0,s.default)(o.default.mark((function e(n,r){var i,s,a,c,u,l,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return me=n,fe&&(me=new MediaStream(r._getTracks())),i=1===Object.keys(A).length,s=null==r?void 0:r.getSourceStreamId(),a=te.sessionInfo,D=n,s&&(A[s]=n),Ae.debug("OT.Subscriber.onRemoteStreamAdded with sourceStreamId",s),U.set("BindingRemoteStream"),I.subscribeToAudio(q),J="loading",I.subscribeToVideo(We.subscribeToVideo,"loading"),a.p2pEnabled||"P2P"===s||(I.setPreferredResolution(We.preferredResolution),I.setPreferredFrameRate(We.preferredFrameRate)),r&&r._getVideoTracks().forEach(e=>{(void 0!==typeof window?window:global).webkitMediaStream?e.enabled=!1:e.enabled=ne.hasVideo&&We.subscribeToVideo}),e.next=16,tt(me);case 16:if(wt(),!U.isDestroyed()){e.next=19;break}throw new Error("Subscriber destroyed");case 19:return r&&(void 0!==typeof window?window:global).webkitMediaStream&&r._getVideoTracks().forEach(e=>{e.enabled=ne.hasVideo&&We.subscribeToVideo}),(c=X&&X.video())&&c.orientation({width:ne.videoDimensions.width,height:ne.videoDimensions.height,videoOrientation:ne.videoDimensions.orientation}),(u=M&&M.videoUnsupportedIndicator)&&u.setVideoUnsupported(!Oe),l=new t((e,t)=>{const n=X&&X.video();n&&n.domElement()?e():(X.once("videoElementCreated",e),O.once("destroyed",t))}),e.next=27,l;case 27:return e.next=29,V.promise;case 29:i?U.set("Subscribing"):bt(),H&&"webRTCStream"in H&&r._hasAudioTracks()&&H.webRTCStream(n),((d=He.env).isSafari||d.isChromiumEdge||d.isOpera||"Chrome"===d.name&&d.version>=58||d.isFirefox&&d.version>=96)&&(Se&&(Se.destroy(),Se=null),r&&(Se=it(r.getStats.bind(r)))),i||I.trigger("streamAdded",I),L.finishTransitionTo(Ee);case 35:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Rt=e=>{Ae.debug("OT.Subscriber.onStreamRemoved");const t=X&&X.video();t&&t.stream===e&&X.destroyVideo(),Qe(Ee),me=null,this.trigger("streamRemoved",this)},Zt=e=>{Oe!==e&&this.dispatchEvent(new we.VideoEnabledChangedEvent(e?"videoEnabled":"videoDisabled",{reason:e?"codecChanged":"codecNotSupported"})),Oe=e},kt=e=>{X.setAudioBlockedUi(e);const t=M&&M.audioBlockedIndicator;t&&t.setAudioBlocked(e);const n=M&&M.videoUnsupportedIndicator;n&&n.setVideoUnsupported(!e&&!Oe)};this.on("audioBlocked",()=>{kt(!0)}),this.on("audioUnblocked",()=>{kt(!1)});const Ot={new:y.SUBSCRIBER_DISCONNECTED,checking:y.SUBSCRIBER_DISCONNECTED,connected:y.SUBSCRIBER_CONNECTED,completed:y.SUBSCRIBER_CONNECTED,disconnected:y.SUBSCRIBER_DISCONNECTED},Vt=(e,t)=>{const n=Ot[e],r=t.getSourceStreamId(),i=Me[r];n&&n!==i&&(Me[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=te._.isSocketReconnecting,"disconnected"!==Me[r]||!Ue.is("connected")||t()){e.next=4;break}return e.next=4,I._.iceRestart("peer connection disconnected");case 4:case"end":return e.stop()}}),e)}))),2e3),X&&X.loading(n!==y.SUBSCRIBER_CONNECTED),Ae.debug("OT.Subscriber.connectionStateChanged to "+e),this.dispatchEvent(new we.ConnectionStateChangedEvent(n,this)))},Gt=()=>{mt("Success")},At=()=>{mt("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."})};F={get:()=>ne.getChannelsOfType("audio").length>0?O.getStyle("buttonDisplayMode"):"off",update(){const e=F.get();M&&(M.muteButton.setDisplayMode(e),M.backingBar.setMuteMode(e))}};const Wt=()=>{const e={backingBar:new he({nameMode:We.name?this.getStyle("nameDisplayMode"):"off",muteMode:F.get()}),name:new Xe({name:We.name,mode:this.getStyle("nameDisplayMode")}),muteButton:new Ne({muted:0===be,mode:F.get()})};if(k){const t=new le;P=new B({mode:O.getStyle("audioLevelDisplayMode")});const n=new S(()=>{P.setValue(t.transform(this.loudness))});P.watchVisibilityChanged(e=>{e?n.start():n.stop()}),P.setDisplayMode(this.getStyle("audioLevelDisplayMode")),P.audioOnly(!1),e.audioLevel=P}e.videoDisabledIndicator=new qe({mode:this.getStyle("videoDisabledDisplayMode")}),e.audioBlockedIndicator=new et({mode:this.getStyle("audioBlockedDisplayMode")}),e.videoUnsupportedIndicator=new nt({mode:this.getStyle("videoUnsupportedDisplayMode")}),X&&X.domElement&&(M=new pe({parent:X.domElement}).set(e).on({muted(){O.setAudioVolume(0)},unmuted(){O.setAudioVolume(ve)}},this),M.hideWhileLoading())},Nt=(e,t)=>{let n,r;X&&(e===Te.STREAM_LIMIT_EXCEEDED?(n="The stream was unable to connect.",r="The limit for the number of media streams has been reached."):"Tried to subscribe to an encrypted stream without enabling encryption"===t?(n="Unable to subscribe to an encrypted stream without enabling encryption.",r=""):(n="The stream was unable to connect due to a network error.",r=Ze?"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."),X.addError(n,r))};function Lt(e){Ye().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)}}());const t=e||!me||!me.getVideoTracks().length;X&&(X.audioOnly(t),X.showPoster(t)),P&&P.audioOnly(t)}De(this,{nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioBlockedDisplayMode:"auto",backgroundImageURI:null,showArchiveStatus:!0,showMicButton:!0},We.showControls,e=>{at("SetStyle","Subscriber",e,null,.1)});const Xt=h(()=>{at("GetStats","Called")}),Mt=h(()=>{at("GetRtcStatsReport","Called")}),Ft=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 Y&&(Y.destroy(),Y=void 0),e.prev=1,e.next=4,w(()=>t._hasAudioTracks());case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return");case 9:H=xe(t),H?Y=C({subscriber:I,audioLevelSampler:H}):Object.prototype.hasOwnProperty.call(I,"loudness")||(Object.defineProperty(I,"loudness",{value:void 0,configurable:!0,writable:!1}),Ae.error("No suitable audio level samplers found, audio level visualisation will not work"));case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}(),Pt=(e,t)=>{if(N[t]){N[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=>{Le&&"P2P"===e.getSourceStreamId()&&dt("Success")})(e)),n.on("disconnected",St),n.on("error",xt),n.once("remoteTrackAdded",(0,s.default)(o.default.mark((function t(){var n=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ft(e);case 2:return t.prev=2,t.next=5,Ct(...n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),Ae.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[2,7]])})))),n.on("audioLevelStuckWarning",vt),n.on("signalingStateStable",(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:O.trigger("signalingStateStable"),X&&X.video()&&D&&H&&"webRTCStream"in H&&e._hasAudioTracks()&&H.webRTCStream(D);case 3:case"end":return t.stop()}}),t)})))),n.on("iceConnectionStateChange",t=>Vt(t,e)),n.on("iceRestartSuccess",Gt),n.on("iceRestartFailure",At),n.on("remoteVideoSupported",Zt),n.on("remoteStreamRemoved",Rt),n.on("decryptFailed",()=>this.trigger("encryptionSecretMismatch")),n.on("decryptRestored",()=>this.trigger("encryptionSecretMatch")),N[t]=N},jt=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 dt("Attempt"),e.next=3,Be("MANTIS");case 3:if(null==(t=e.sent)?void 0:t.iceConnectionStateIsConnected()){e.next=7;break}return dt("Failure",{reason:"Attempted to transition to Relayed without being connected in Routed mode."}),e.abrupt("return");case 7:Ue.subscriberCreate(ne.id,Z,$t,"P2P",te._.isE2ee(),(e,t)=>{e&&!ft.is("disconnected")&&dt("Failure",e),Ae.debug("message received when created a subscriber with source",t)});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ut=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(!We.testNetwork&&!ue(ne,te)&&"P2P"===Ee){e.next=2;break}return e.abrupt("return");case 2:if(ht("Attempt"),D=A.MANTIS,me=D,!fe){e.next=10;break}return e.next=8,Be("MANTIS");case 8:t=e.sent,me=new MediaStream(t._getTracks());case 10:return e.next=12,tt(me);case 12:return X.loading(!1),Je("P2P"),Ee="MANTIS",Qe("P2P"),e.next=18,Ke();case 18:return n=e.sent,e.next=21,Ft(n);case 21:ht("Success");case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();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 U.isDestroyed()||(U.set("Destroyed"),Se&&(Se.destroy(),Se=null),Ie={sessionId:te.sessionId,connectionId:te&&te.isConnected()?te.connection.connectionId:null,partnerId:te&&te.sessionInfo?te.sessionInfo.partnerId:null,streamId:ne&&!ne.destroyed?ne.id:null},this._disconnect({reason:n,noStateTransition:o}),M&&(M.destroy(),M=null),X&&(X.destroy(),X.off(),X=null,this.element=null),ne&&!ne.destroyed&&at("unsubscribe",null,{streamId:ne.id}),ne.off(Q,this),this.id=null,ee=null,this.stream=null,ne=null,this.streamId=null,this.session=null,te=null,We=null,!0!==r&&(this.dispatchEvent(new we.DestroyedEvent(y.SUBSCRIBER_DESTROYED,this,n)),this.off())),this},this.destroy=function(e,t){void 0===e&&(e="Unsubscribe"),Ae.warn("Subscriber#destroy is deprecated and will be removed. Please use Session#unsubscribe instead"),I._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&&!ft.is("disconnected")){const e="Unsubscribe"===r?void 0:Fe(ye.STREAM_DESTROYED,new Error("Stream was destroyed before it could be subscribed to"));ft.disconnect({payload:{reason:r},error:e})}U.isDestroyed()||U.isFailed()||U.set("NotSubscribing"),X&&X.destroyVideo(),Ue.is("connected")&&ne&&!ne.destroyed&&Ue.subscriberDestroy(ne.id,I.widgetId),$e()},this.disconnect=()=>{Ae.warn("Subscriber#disconnect is deprecated and will be removed. Please use Session#unsubscribe instead"),this._disconnect({reason:"Unsubscribe"})};const Ht=function(){var e=(0,s.default)(o.default.mark((function e(t){var n,r,s,a,c,u,l;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:te.apiKey,sessionId:te.sessionId,streamId:ne.id,subscriberId:I.widgetId},a=["/v2/partner",o.apiKey,"session",o.sessionId,"stream",o.streamId,"subscriber",o.subscriberId].join("/"),c=st({socket:I.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 at(e,t,r,c,a)},l=e=>{Ee===s&&gt((0,i.default)({},e,{peerId:n,remoteConnectionId:r,sourceStreamId:s}))},e.abrupt("return",I._setupPeerConnection({send:c,log:u,logQoS:l,sourceStreamId:s}));case 6:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}();function Yt(e){const t=X&&X.video();if(t)try{t.setAudioVolume(e)}catch(e){Ae.warn("setAudioVolume: "+e),0===be&&(Ae.info("Using subscribeToAudio to mute Audio because setAudioVolume(0) failed"),O.subscribeToAudio(!1))}M&&M.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 Ae.debug(`OT.Subscriber.processMessage: Received ${t} message from ${n}`),Ae.debug(r),i=d(r,"content.peerId"),s=d(r,"content.sourceStreamId"),e.next=6,Be(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,Ht({peerId:i,fromConnectionId:n,sourceStreamId:s});case 14:a=e.sent,fe?a.processMessage("offer",r):I.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 Ae.info("Video was not re-enabled because it was manually disabled");Ae.info("Video has been re-enabled")}else Ae.warn("Due to high packet loss and low bandwidth, video has been disabled");this.subscribeToVideo(e,"auto");at("updateQuality","video",e?{videoEnabled:!0}:{videoDisabled:!0})},this.getImgData=()=>{if(!this.isSubscribing())return Ae.error("OT.Subscriber.getImgData: Cannot getImgData before the Subscriber is subscribing."),null;const e=X&&X.video();return e?e.imgData():null},this.getStats=e=>{(e=>{rt(e)})((t,n)=>{if(t)return void e(t);const r={timestamp:0};n.forEach(e=>{if(Ce.isInboundStat(e)){const t=Ce.isVideoStat(e,n),i=Ce.isAudioStat(e,n);(i||t)&&(r.timestamp=Ce.normalizeTimestamp(e.timestamp)),t?(c(r,{video:Ce.parseStatCategory(e)}),Se&&c(r,{video:{frameRate:Se.getFrameRateFromStat(e)}})):i&&c(r,{audio:Ce.parseStatCategory(e)})}}),e(null,r)})},this.getRtcStatsReport=()=>new t((e,t)=>{rt("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 at("setAudioVolume","Attempt",{audioVolume:t}),isNaN(t)?(Ae.error("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),at("setAudioVolume","Failure",{message:"value should be an integer between 0 and 100"}),this):(t!==e&&Ae.warn("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),t===be?(Yt(be),at("setAudioVolume","Success",{audioVolume:be,message:"Requested volume is same as already set audioVolume"}),this):(be>0&&(ve=be),be=t,Yt(be),be>0&&!q&&(ve=be,this.subscribeToAudio(!0)),at("setAudioVolume","Success",{audioVolume:be}),this))},this.getAudioVolume=()=>{const e=X&&X.video();if(e)try{return e.getAudioVolume()}catch(e){Ae.warn("getAudioVolume "+e)}return be},this.subscribeToAudio=e=>{const t=b(e,!0);Ye().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)}}()),ne&&0!==Ye().length&&ne.setChannelActiveState("audio",t);const n=q!==t;return q=t,n&&this.setAudioVolume(t?ve:0),at("subscribeToAudio","Event",{subscribeToAudio:t}),this};const Dt={auto:"quality",publishVideo:"publishVideo",subscribeToVideo:"subscribeToVideo"};if("Safari"===ge.name){const e=()=>{!lt.hidden&&We.subscribeToVideo&&(Ae.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)})}var Bt,Kt;if(this.subscribeToVideo=(e,t)=>{const n=b(e,!0),r=!n&&"auto"===t;return r&&(Re=2),at("subscribeToVideo","Attempt",{subscribeToVideo:n,reason:t}),Lt(!n||!ne.hasVideo||!D),ne.hasVideo&&!ot("video")?(n&&Ae.info("Subscriber is audio-only due to incompatibility, can't subscribeToVideo."),We.subscribeToVideo=!1,at("subscribeToVideo","Failure",{message:"No video tracks available"}),this):(M&&M.videoDisabledIndicator&&M.videoDisabledIndicator.disableVideo(r),Ye().length>0&&te&&ne&&(n!==We.subscribeToVideo||t!==J)&&ne.setChannelActiveState("video",n,t),We.subscribeToVideo=n,J=t,K=n,at("subscribeToVideo","Success",{subscribeToVideo:n,reason:t}),"loading"!==t&&this.dispatchEvent(new we.VideoEnabledChangedEvent(n?"videoEnabled":"videoDisabled",{reason:Dt[t]||"subscribeToVideo"})),this)},this.setPreferredResolution=e=>{if(U.isDestroyed()||0===Ye().length&&"Connecting"===!U.current)return void Ae.warn("Cannot set the max Resolution when not subscribing to a publisher");if(We.preferredResolution=e,te.sessionInfo.p2pEnabled)return void Ae.warn("OT.Subscriber.setPreferredResolution will not work in a P2P Session");if(!U.isStreamAdded())return;const t=ne.getPreferredResolution();t&&e&&t.width===e.width&&t.height===e.height||!t&&!e||ne.setPreferredResolution(e)},this.setPreferredFrameRate=e=>{if(U.isDestroyed()||0===Ye().length&&"Connecting"===!U.current)return void Ae.warn("Cannot set the max frameRate when not subscribing to a publisher");if(We.preferredFrameRate=e,te.sessionInfo.p2pEnabled)return void Ae.warn("OT.Subscriber.setPreferredFrameRate will not work in a P2P Session");const t=ne.getPreferredFrameRate();e&&t&&t===e||!t&&!e||ne.setPreferredFrameRate(e)},this.isSubscribing=()=>U.isSubscribing(),this.isWebRTC=!0,this.isLoading=()=>X&&X.loading(),this.isAudioBlocked=()=>Boolean(X&&X.isAudioBlocked()),this.videoElement=()=>{const e=X&&X.video();return e?e.domElement():null},this.videoWidth=()=>{const e=X&&X.video();return e?e.videoWidth():void 0},this.videoHeight=()=>{const e=X&&X.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=te.getPublisherForStream(ne))&&t._.webRtcStream()){e.next=5;break}ft.fail({payload:{reason:"streamNotFound"},error:Fe(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 V.resolve(),e.prev=6,e.next=9,It(t._.webRtcStream());case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Ae.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,We.testNetwork&&I.setAudioVolume(0),0===Ye().length&&U.set("Connecting"),Ee=c,G[c]=new t((t,n)=>{te._.getIceConfig().then(r=>{r.needRumorIceServersFallback&&(r.servers=[...Ge||[],...r.servers||[]]);const o={iceConfig:r,subscriberId:I.widgetId,send:i,logAnalyticsEvent:s,p2p:te.sessionInfo.p2pEnabled,sourceStreamId:c,remoteConnectionId:ne.connection.id,_singlePeerConnectionController:"MANTIS"===c&&de,keyStore:te.keyStore,sFrameClientStore:te.sFrameClientStore,isE2ee:te._.isE2ee()};Object.prototype.hasOwnProperty.call(We,"codecFlags")&&(o.codecFlags=We.codecFlags);const u=new e.SubscriberPeerConnection(o);u.once("iceConnected",V.resolve),u.once("error",V.reject),u.on("qos",a),Pt(u,c),u.init(e=>{e?n(e):t(u)})})}),n.abrupt("return",G[c]);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),this.restrictFrameRate=e=>(Ae.debug(`OT.Subscriber.restrictFrameRate(${e})`),at("restrictFrameRate",e.toString(),{streamId:ne.id}),te.sessionInfo.p2pEnabled&&Ae.warn("OT.Subscriber.restrictFrameRate: Cannot restrictFrameRate on a P2P session"),"boolean"!=typeof e?Ae.error("OT.Subscriber.restrictFrameRate: expected a boolean value got a "+typeof e):(_e=e,ne.setRestrictFrameRate(e)),this),this.on("styleValueChanged",(e,t)=>{if(M)switch(e){case"nameDisplayMode":M.name.setDisplayMode(t),M.backingBar.setNameMode(t);break;case"videoUnsupportedDisplayMode":M.videoUnsupportedIndicator.setDisplayMode(t);break;case"videoDisabledDisplayMode":M.videoDisabledIndicator.setDisplayMode(t);break;case"audioBlockedDisplayMode":M.audioBlockedIndicator.setDisplayMode(t);break;case"showArchiveStatus":M.archive.setShowArchiveStatus(t);break;case"buttonDisplayMode":F.update();break;case"audioLevelDisplayMode":M.audioLevel.setDisplayMode(t);break;case"bugDisplayMode":break;case"backgroundImageURI":X.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(Ke()){r.next=3;break}return n(new He.Error("Cannot create a DataChannel before there is a publisher connection.")),r.abrupt("return");case 3:return r.next=5,Ke();case 5:r.sent.getDataChannel(e,t,n);case 6:case"end":return r.stop()}}),r)})))(),iceRestart:(e,t)=>(0,s.default)(o.default.mark((function n(){var r;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return void 0===t&&(t=!1),n.next=3,Be("MANTIS");case 3:(r=n.sent)?(mt("Attempt",{reason:e}),Ae.debug("Subscriber: iceRestart attempt"),r.iceRestart(),t&&r.generateOffer()):Ae.debug("Subscriber: Skipping ice restart, we have no peer connection");case 5:case"end":return n.stop()}}),n)})))(),unblockAudio:()=>X&&X.unblockAudio(),webRtcStream:()=>D,setIceConfig:(Bt=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ye().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:return e.abrupt("return",e.sent.setIceConfig(t));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)}))),function(e){return Bt.apply(this,arguments)}),privateEvents:new m,startRoutedToRelayedTransition(){We.testNetwork||ue(ne,te)||(L.startTransitionTo("P2P"),jt())},startRelayedToRoutedTransition(){L.startTransitionTo("MANTIS",()=>Ut())},setSinkId(e){if(X&&X.video())return X.setSinkId(e);Ae.debug("Called setAudioOutputDevice on a subscriber without a video element")},pauseAndPlayVideoElement(){X&&X.pauseAndPlayVideoElement()}},U=new ze(e=>{Ae.error("OT.Subscriber State Change Failed: ",e.message),Ae.debug(e)}),Ae.debug("OT.Subscriber: subscribe to "+ne.id),U.set("Init"),!ne)return Ae.error("OT.Subscriber: No stream parameter."),!1;Q={updated:e=>{const t=X&&X.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 we.VideoDimensionsChangedEvent(this,e.oldValue,e.newValue));break;case"videoDisableWarning":M&&M.videoDisabledIndicator.setWarning(e.newValue),this.dispatchEvent(new we.VideoDisableWarningEvent(e.newValue?"videoDisableWarning":"videoDisableWarningLifted")),Re=e.newValue?1:null;break;case"hasVideo":Lt(!ne.hasVideo||!We.subscribeToVideo),ge.isSafari&&!ne.hasVideo&&X&&X.bindAudioTrackOnly(),this.dispatchEvent(new we.VideoEnabledChangedEvent(ne.hasVideo?"videoEnabled":"videoDisabled",{reason:"publishVideo"}));break;case"hasAudio":F.update()}}},ne.on(Q,this),We.name=We.name||ne.name,We.classNames="OT_root OT_subscriber",We.style&&this.setStyle(We.style,null,!0),ve=100,We.subscribeToVideo=b(We.subscribeToVideo,!0),We.subscribeToAudio=b(We.subscribeToAudio,!0),this.subscribeToAudio(We.subscribeToAudio),this.setAudioVolume(void 0!==(Kt=We).audioVolume?Kt.audioVolume:!1===Kt.subscribeToAudio?0:100),X=new e.WidgetView(n,(0,i.default)({},We,{widgetType:"subscriber"})),X.on("error",Tt),X.on("audioBlocked",()=>this.trigger("audioBlocked")),X.on("audioUnblocked",()=>this.trigger("audioUnblocked")),X.on("amrLogEvent",(e,t,n)=>{at(e,t,{},n)}),this.id=X.domId(),ee=X.domId(),this.element=X.domElement,X.on("videoElementCreated",e=>{const t=new we.VideoElementCreatedEvent(e),n=this;$?this.dispatchEvent(t):this.once("loaded",()=>{n.dispatchEvent(t)})}),this.element&&Wt.call(this);const Jt=ne.getChannelsOfType("audio"),zt=ne.getChannelsOfType("video"),Qt=ne.getChannelsOfType("data");let qt=Qt.some(e=>"caption1"===e.id&&e.active);this.subscribeToCaptions=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:n=b(t,!0),r={active:n},qt=n,at("subscribeToCaptions","Attempt",{subscribeToCaptions:n}),Ue.subscriberChannelUpdate(ne.id,I.widgetId,"caption1",r),at("subscribeToCaptions","Success",{subscribeToCaptions:n});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.isSubscribedToCaptions=()=>qt;const $t=Jt.map(e=>({id:e.id,type:e.type,active:We.subscribeToAudio})).concat(zt.map(e=>{const t={id:e.id,type:e.type,active:We.subscribeToVideo,restrictFrameRate:void 0!==We.restrictFrameRate&&We.restrictFrameRate};return void 0!==We.preferredFrameRate&&(t.preferredFrameRate=parseFloat(We.preferredFrameRate)),void 0!==We.preferredHeight&&(t.preferredHeight=parseInt(We.preferredHeight,10)),void 0!==We.preferredWidth&&(t.preferredWidth=parseInt(We.preferredWidth,10)),t})).concat(Qt.map(e=>({id:e.id,type:e.type,active:e.active}))),en=!We.testNetwork&&ue(ne,te);if(ft.beginConnect(),en)return this._subscribeToSelf(),this;const tn=()=>{Ue.subscriberCreate(ne.id,Z,$t,null,te._.isE2ee(),(e,t)=>{e&&!ft.is("disconnected")&&Et(e),Ge=ct(t)})};return fe?de.addSubscriber(tn):tn(),this};return ft.hasAudioOutputLevelStatCapability=Re,ft.WidgetView=ht,ft.SubscriberPeerConnection=Ke,ft}}).call(this,n(1))},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(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(0)(n(16));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 l(e){return d(this||{},e)}function d(e,t){return h(e,new s(t,l)),e._fsm(),e}function h(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)}}l.version="3.0.1",l.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,l);return h(e.prototype,n),e.prototype._fsm.config=n,e},l.apply=d,l.defaults={wildcard:"*",init:{name:"init",from:"none"}},e.exports=l},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(104)();e.exports=r},function(e,t,n){"use strict";var r=n(0)(n(14));let i=function(){function e(){(0,r.default)(this,"processTransition",()=>{}),this.routedToRelayedOngoing=!1,this.relayedToRoutedPending=!1}var t=e.prototype;return t.startTransitionTo=function(e,t){void 0===t&&(t=()=>{}),"P2P"===e?this.startRoutedToRelayed():"MANTIS"===e&&this.startRelayedToRouted(t)},t.finishTransitionTo=function(e){"P2P"===e&&this.finishRoutedToRelayed()},t.startRoutedToRelayed=function(){this.routedToRelayedOngoing=!0},t.finishRoutedToRelayed=function(){this.routedToRelayedOngoing=!1,this.relayedToRoutedPending&&(this.relayedToRoutedPending=!1,this.processTransition())},t.startRelayedToRouted=function(e){this.routedToRelayedOngoing?(this.relayedToRoutedPending=!0,this.processTransition=e):e()},e}();e.exports=i},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(1))},function(e,t,n){"use strict";const r={isSupported:()=>"undefined"!=typeof MediaStreamTrackProcessor&&"undefined"!=typeof MediaStreamTrackGenerator,setMetadata:n(702).setVonageMetadata,createProcessor:n(315).createVonageMediaProcessor};e.exports=r},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"BackgroundTransformer",(function(){return $i})),n.d(t,"BlurRadius",(function(){return Ct})),n.d(t,"ErrorFunction",(function(){return vt})),n.d(t,"MediapipeHelper",(function(){return jt})),n.d(t,"PipelineInfoData",(function(){return wt})),n.d(t,"SelfieSegmentationType",(function(){return bo})),n.d(t,"VonageMediaProcessor",(function(){return co})),n.d(t,"WarningType",(function(){return yt})),n.d(t,"createVonageMediaProcessor",(function(){return yo})),n.d(t,"getSupportedBrowserFeatures",(function(){return Gt})),n.d(t,"getVonageFaceDetection",(function(){return fo})),n.d(t,"getVonageFaceMash",(function(){return po})),n.d(t,"getVonageHands",(function(){return lo})),n.d(t,"getVonageHolistic",(function(){return ho})),n.d(t,"getVonageObjectron",(function(){return mo})),n.d(t,"getVonagePose",(function(){return go})),n.d(t,"getVonageSelfieSegmentation",(function(){return uo})),n.d(t,"isSupported",(function(){return Vt}));var i=Object.defineProperty,o=(e,t,n)=>(((e,t,n)=>{t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class s{}s.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},s.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer",readable_null:"Readable is null",writable_null:"Writable is null"};var a={exports:{}},c=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)}},u=c,l=Object.prototype.toString;function d(e){return Array.isArray(e)}function h(e){return typeof e>"u"}function f(e){return"[object ArrayBuffer]"===l.call(e)}function p(e){return null!==e&&"object"==typeof e}function m(e){if("[object Object]"!==l.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function g(e){return"[object Function]"===l.call(e)}function b(e,t){if(!(null===e||typeof e>"u"))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 y={isArray:d,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===l.call(e)},isArrayBufferView:function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:p,isPlainObject:m,isUndefined:h,isDate:function(e){return"[object Date]"===l.call(e)},isFile:function(e){return"[object File]"===l.call(e)},isBlob:function(e){return"[object Blob]"===l.call(e)},isFunction:g,isStream:function(e){return p(e)&&g(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===l.call(e)},isStandardBrowserEnv:function(){return(!(typeof navigator<"u")||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&(typeof window<"u"&&typeof document<"u")},forEach:b,merge:function e(){var t={};function n(n,r){m(t[r])&&m(n)?t[r]=e(t[r],n):m(n)?t[r]=e({},n):d(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?u(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=y;function w(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 i=[];v.forEach(t,(function(e,t){null===e||typeof e>"u"||(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(w(t)+"="+w(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},T=y;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){T.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var x=E,_=y,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)},Z=R,k=y,O=k.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var s=[];s.push(e+"="+encodeURIComponent(t)),k.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),k.isString(r)&&s.push("path="+r),k.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(){}},V=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},G=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},A=y,W=["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"],N=y,L=N.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=N.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function X(e){this.message=e}X.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},X.prototype.__CANCEL__=!0;var M=X,F=y,P=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(Z("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},j=O,U=S,H=function(e,t){return e&&!V(t)?G(e,t):t},Y=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]&&W.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i},D=L,B=R,K=ie,J=M,z=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)}F.isFormData(i)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+l)}var d=H(t.baseURL,t.url);function h(){if(c){var r="getAllResponseHeaders"in c?Y(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};P((function(t){e(t),a()}),(function(e){n(e),a()}),i),c=null}}if(c.open(t.method.toUpperCase(),U(d,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){!c||4!==c.readyState||0===c.status&&(!c.responseURL||0!==c.responseURL.indexOf("file:"))||setTimeout(h)},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},F.isStandardBrowserEnv()){var f=(t.withCredentials||D(d))&&t.xsrfCookieName?j.read(t.xsrfCookieName):void 0;f&&(o[t.xsrfHeaderName]=f)}"setRequestHeader"in c&&F.forEach(o,(function(e,t){typeof i>"u"&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,e)})),F.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))),i||(i=null),c.send(i)}))},Q=y,q=function(e,t){_.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},$=C,ee={"Content-Type":"application/x-www-form-urlencoded"};function te(e,t){!Q.isUndefined(e)&&Q.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ne,re={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest<"u"||typeof r<"u"&&"[object process]"===Object.prototype.toString.call(r))&&(ne=z),ne),transformRequest:[function(e,t){return q(t,"Accept"),q(t,"Content-Type"),Q.isFormData(e)||Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e)?e:Q.isArrayBufferView(e)?e.buffer:Q.isURLSearchParams(e)?(te(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Q.isObject(e)||t&&"application/json"===t["Content-Type"]?(te(t,"application/json"),function(e,t,n){if(Q.isString(e))try{return(t||JSON.parse)(e),Q.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||re.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&Q.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i)throw"SyntaxError"===e.name?$(e,this,"E_JSON_PARSE"):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, */*"}}};Q.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),Q.forEach(["post","put","patch"],(function(e){re.headers[e]=Q.merge(ee)}));var ie=re,oe=y,se=ie,ae=function(e){return!(!e||!e.__CANCEL__)},ce=y,ue=function(e,t,n){var r=this||se;return oe.forEach(n,(function(n){e=n.call(r,e,t)})),e},le=ae,de=ie,he=M;function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he("canceled")}var pe=y,me=function(e,t){t=t||{};var n={};function r(e,t){return pe.isPlainObject(e)&&pe.isPlainObject(t)?pe.merge(e,t):pe.isPlainObject(t)?pe.merge({},t):pe.isArray(t)?t.slice():t}function i(n){return pe.isUndefined(t[n])?pe.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function o(e){if(!pe.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return pe.isUndefined(t[n])?pe.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 pe.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||i,r=t(e);pe.isUndefined(r)&&t!==a||(n[e]=r)})),n},ge="0.25.0",be=ge,ye={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){ye[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var ve={};ye.transitional=function(e,t,n){function r(e,t){return"[Axios v"+be+"] 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 we=y,Se=S,Te=x,Ee=function(t){return fe(t),t.headers=t.headers||{},t.data=ue.call(t,t.data,t.headers,t.transformRequest),t.headers=ce.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ce.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||de.adapter)(t).then((function(e){return fe(t),e.data=ue.call(t,e.data,e.headers,t.transformResponse),e}),(function(n){return le(n)||(fe(t),n&&n.response&&(n.response.data=ue.call(t,n.response.data,n.response.headers,t.transformResponse))),e.reject(n)}))},xe=me,_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:ye},Ce=_e.validators;function Ie(e){this.defaults=e,this.interceptors={request:new Te,response:new Te}}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=xe(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: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=[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 l=i.shift(),d=i.shift();try{u=l(u)}catch(e){d(e);break}}try{s=Ee(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=xe(this.defaults,e),Se(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},we.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(xe(n||{},{method:e,url:t,data:(n||{}).data}))}})),we.forEach(["post","put","patch"],(function(e){Ie.prototype[e]=function(t,n,r){return this.request(xe(r||{},{method:e,url:t,data:n}))}}));var Re=Ie,Ze=M;function ke(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 Ze(e),n(r.reason))}))}ke.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ke.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},ke.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},ke.source=function(){var e;return{token:new ke((function(t){e=t})),cancel:e}};var Oe=ke,Ve=y,Ge=y,Ae=c,We=Re,Ne=me;var Le=function e(t){var n=new We(t),r=Ae(We.prototype.request,n);return Ge.extend(r,We.prototype,n),Ge.extend(r,n),r.create=function(n){return e(Ne(t,n))},r}(ie);Le.Axios=We,Le.Cancel=M,Le.CancelToken=Oe,Le.isCancel=ae,Le.VERSION=ge,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 Ve.isObject(e)&&!0===e.isAxiosError},a.exports=Le,a.exports.default=Le;var Xe=a.exports;class Me{isEmpty(){return!this.isPresent()}static of(e){if(null!=e)return new Fe(e);throw new TypeError("The passed value was null or undefined.")}static ofNonNull(e){return Me.of(e)}static ofNullable(e){return null!=e?new Fe(e):new Pe}static empty(){return new Pe}static from(e){switch(e.kind){case"present":return Me.of(e.value);case"empty":return Me.empty();default:throw new TypeError("The passed value was not an Option type.")}}}class Fe extends Me{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:Me.empty()}map(e){const t=e(this.payload);return Me.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 Pe extends Me{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 Me.empty()}flatMap(e){return Me.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}}function je(){return globalThis._vonageMediaProcessorMetadata}class Ue{constructor(){const e=je();this._report={action:Me.empty(),applicationId:Me.ofNullable(void 0!==e&&null!=e?e.appId:null),timestamp:Date.now(),fps:Me.empty(),framesTransformed:Me.empty(),guid:Me.empty(),highestFrameTransformCpu:Me.empty(),message:Me.empty(),source:Me.ofNullable(void 0!==e&&null!=e?e.sourceType:null),transformedFps:Me.empty(),transformerType:Me.empty(),variation:Me.empty(),videoHeight:Me.empty(),videoWidth:Me.empty(),version:"2.0.0",error:Me.empty(),proxyUrl:Me.ofNullable(void 0!==e&&null!=e?e.proxyUrl:null)}}action(e){return this._report.action=Me.ofNullable(e),this}framesTransformed(e){return this._report.framesTransformed=Me.ofNullable(e),this}fps(e){return this._report.fps=Me.ofNullable(e),this}guid(e){return this._report.guid=Me.ofNullable(e),this}message(e){return this._report.message=Me.ofNullable(e),this}transformedFps(e){return this._report.transformedFps=Me.ofNullable(e),this}transformerType(e){return this._report.transformerType=Me.ofNullable(e),this}variation(e){return this._report.variation=Me.ofNullable(e),this}videoHeight(e){return this._report.videoHeight=Me.ofNullable(e),this}videoWidth(e){return this._report.videoWidth=Me.ofNullable(e),this}error(e){return this._report.error=Me.ofNullable(e),this}build(){return this._report}}class He{static report(t){return new e((e,n)=>{if(t.applicationId.isEmpty()||t.source.isEmpty())return void e("success");let r=Xe.create(),i="hlg.tokbox.com/prod/logging/vcp_webrtc";if(t.proxyUrl.isEmpty())i="https://"+i;else{let e;e="/"!==t.proxyUrl.get().slice(t.proxyUrl.get().length-1)?t.proxyUrl.get()+"/":t.proxyUrl.get(),i=e+i}r.post(i,(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,De=new Uint8Array(16);function Be(){if(!Ye&&!(Ye=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&"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(De)}var Ke=/^(?:[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&&Ke.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||Be)();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 lt(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 dt(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)lt(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)lt(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function ht(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))throw"string"!=typeof t?new TypeError("`methodNames` element must be a string"):new Error(t+" is not Emittery method");return e}const ft=e=>e===it||e===ot;class pt{static mixin(e,t){return t=ht(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 pt}),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){(pt.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 dt(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 dt(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=lt(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){typeof n<"u"&&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+lt(this,n).size+lt(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=ht(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(pt.prototype).filter(e=>"constructor"!==e);Object.defineProperty(pt,"listenerAdded",{value:it,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(pt,"listenerRemoved",{value:ot,writable:!1,enumerable:!0,configurable:!1});var gt=pt;function bt(e){return function(e){if(function(e){return"object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message}(e))return e;try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}}(e).message}var yt=(e=>(e.FPS_DROP="fps_drop",e))(yt||{}),vt=(e=>(e.start="start",e.transform="transform",e.flush="flush",e))(vt||{}),wt=(e=>(e.pipeline_ended="pipeline_ended",e.pipeline_ended_with_error="pipeline_ended_with_error",e.pipeline_started="pipeline_started",e.pipeline_started_with_error="pipeline_started_with_error",e.pipeline_restarted="pipeline_restarted",e.pipeline_restarted_with_error="pipeline_restarted_with_error",e))(wt||{});class St 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();He.report(n)}setTrackExpectedRate(e){this.trackExpectedRate_=e}async start(e){if(this.controller_=e,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(s.errors.transformer_start).transformerType(this.transformerType_).variation("Error").error(bt(e)).build();He.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"start"};this.emit("error",n)}}async transform(e,t){var n,r,i,o;if(0===this.mediaTransformerQosReportStartTimestamp_&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),e instanceof VideoFrame&&(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_)console.warn("[Pipeline] flush from transform"),e.close(),this.flush(t),t.terminate();else try{await(null==(o=(i=this.transformer_).transform)?void 0:o.call(i,e,t)),++this.framesTransformed_,500===this.framesTransformed_&&this.mediaTransformerQosReport()}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(s.errors.transformer_transform).transformerType(this.transformerType_).variation("Error").error(bt(e)).build();He.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(s.errors.transformer_flush).transformerType(this.transformerType_).variation("Error").error(bt(e)).build();He.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();He.report(t)}stop(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),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:"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();He.report(r),this.mediaTransformerQosReportStartTimestamp_=0,this.framesFromSource_=0,this.framesTransformed_=0}}class Tt extends gt{constructor(e){super(),this.transformers_=[],this.trackExpectedRate_=-1;for(let t=0;t<e.length;t++){let n=new St(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(),this.emit("pipelineInfo","pipeline_ended")}).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),this.emit("pipelineInfo","pipeline_ended_with_error")})}catch{return this.emit("pipelineInfo","pipeline_started_with_error"),void this.destroy()}this.emit("pipelineInfo","pipeline_started"),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();He.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(s.errors.transformer_none).variation("Error").build();return He.report(e),void t("[MediaProcessor] Need to set transformers.")}if(!this.readable_){const e=(new Ue).action("MediaProcessor").guid(this.uuid_).message(s.errors.readable_null).variation("Error").build();return He.report(e),void t("[MediaProcessor] Readable is null.")}if(!this.writable_){const e=(new Ue).action("MediaProcessor").guid(this.uuid_).message(s.errors.writable_null).variation("Error").build();return He.report(e),void t("[MediaProcessor] Writable is null.")}let n=!1;this.pipeline_&&(n=!0,this.pipeline_.clearListeners(),this.pipeline_.destroy()),this.pipeline_=new Tt(this.transformers_),this.pipeline_.on("warn",e=>{this.emit("warn",e)}),this.pipeline_.on("error",e=>{this.emit("error",e)}),this.pipeline_.on("pipelineInfo",e=>{n&&("pipeline_started"===e?e=wt.pipeline_restarted:"pipeline_started_with_error"===e&&(e=wt.pipeline_restarted_with_error)),this.emit("pipelineInfo",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(s.updates.transformer_new).variation("Update").build();return He.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();He.report(t),e()})}}class xt{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 _t{constructor(e){this.insertableStreamHelper_=new xt,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")})}}var Ct=(e=>(e.Low="Low",e.High="High",e))(Ct||{});const It=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]));var Rt=function(){var t=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(n){var r,i,o=typeof(n=n||{})<"u"?n:{};o.ready=new e((function(e,t){r=e,i=t}));var s,a={};for(s in o)o.hasOwnProperty(s)&&(a[s]=o[s]);var c="./this.program",u=function(e,t){throw t},l="";typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),t&&(l=t),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var d,h=o.print||console.log.bind(console),f=o.printErr||console.warn.bind(console);for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);a=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.quit&&(u=o.quit),o.wasmBinary&&(d=o.wasmBinary);var p=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&V("no native wasm support detected");var m,g,b,y,v,w=!1,S=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function T(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&S)return S.decode(e.subarray(t,i));for(var o="";t<i;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|c:(7&s)<<18|a<<12|c<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var u=s-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}function E(e,t){return e?T(y,e,t):""}function x(e,t){return e%t>0&&(e+=t-e%t),e}function _(e){g=e,o.HEAP8=b=new Int8Array(e),o.HEAP16=new Int16Array(e),o.HEAP32=v=new Int32Array(e),o.HEAPU8=y=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=new Float64Array(e)}o.INITIAL_MEMORY;var C,I=[],R=[],Z=[];var k=0,O=null;function V(e){o.onAbort&&o.onAbort(e),f(e="Aborted("+e+")"),w=!0,e+=". Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw i(t),t}o.preloadedImages={},o.preloadedAudios={};var G,A,W;function N(e){return e.startsWith("data:application/octet-stream;base64,")}function L(e){try{if(e==G&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}catch(e){V(e)}}function X(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?C.get(n)():C.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}N(G="tflite-simd.wasm")||(A=G,G=o.locateFile?o.locateFile(A,l):l+A),W=function(){return performance.now()};function M(e){try{return m.grow(e-g.byteLength+65535>>>16),_(m.buffer),1}catch{}}var F={};function P(){if(!P.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var t in F)void 0===F[t]?delete e[t]:e[t]=F[t];var n=[];for(var t in e)n.push(t+"="+e[t]);P.strings=n}return P.strings}var j={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=j.buffers[e];0===t||10===t?((1===e?h:f)(T(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){return j.varargs+=4,v[j.varargs-4>>2]},getStr:function(e){return E(e)},get64:function(e,t){return e}};var U={a:function(e,t,n,r){V("Assertion failed: "+E(e)+", at: "+[t?E(t):"unknown filename",n,r?E(r):"unknown function"])},e:function(e,t){V("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")},d:function(e,t){V("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")},b:function(){V("")},n:function(e,t){var n;if(0===e)n=Date.now();else{if(1!==e&&4!==e)return function(e){v[Y()>>2]=e}(28),-1;n=W()}return v[t>>2]=n/1e3|0,v[t+4>>2]=n%1e3*1e3*1e3|0,0},h:function(){return 2147483648},l:function(e,t,n){y.copyWithin(e,t,t+n)},m:function(e){var t=y.length,n=2147483648;if((e>>>=0)>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),M(Math.min(n,x(Math.max(e,i),65536))))return!0}return!1},p:function(e){for(var t=W();W()-t<e;);},f:function(e,t){var n=0;return P().forEach((function(r,i){var o=t+n;v[e+4*i>>2]=o,function(e,t,n){for(var r=0;r<e.length;++r)b[t++>>0]=e.charCodeAt(r);n||(b[t>>0]=0)}(r,o),n+=r.length+1})),0},g:function(e,t){var n=P();v[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),v[t>>2]=r,0},j:function(e){!function(e,t){!function(e){p||(o.onExit&&o.onExit(e),w=!0),u(e,new D(e))}(e)}(e)},i:function(e){return 0},k:function(e,t,n,r,i){},c:function(e,t,n,r){for(var i=0,o=0;o<n;o++){for(var s=v[t+8*o>>2],a=v[t+(8*o+4)>>2],c=0;c<a;c++)j.printChar(e,y[s+c]);i+=a}return v[r>>2]=i,0},o:function e(t,n){e.randomDevice||(e.randomDevice=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){V("randomDevice")}}());for(var r=0;r<n;r++)b[t+r>>0]=e.randomDevice();return 0}};(function(){var t={a:U};function n(e,t){var n=e.exports;o.asm=n,_((m=o.asm.q).buffer),C=o.asm.E,function(e){R.unshift(e)}(o.asm.r),function(e){if(k--,o.monitorRunDependencies&&o.monitorRunDependencies(k),0==k&&O){var t=O;O=null,t()}}()}function r(e){n(e.instance)}function s(n){return(d||"function"!=typeof fetch?e.resolve().then((function(){return L(G)})):fetch(G,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+G+"'";return e.arrayBuffer()})).catch((function(){return L(G)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){f("failed to asynchronously prepare wasm: "+e),V(e)}))}if(k++,o.monitorRunDependencies&&o.monitorRunDependencies(k),o.instantiateWasm)try{return o.instantiateWasm(t,n)}catch(e){return f("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||N(G)||"function"!=typeof fetch?s(r):fetch(G,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(e){return f("wasm streaming compile failed: "+e),f("falling back to ArrayBuffer instantiation"),s(r)}))}))).catch(i)})(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.r).apply(null,arguments)},o._getModelBufferMemoryOffset=function(){return(o._getModelBufferMemoryOffset=o.asm.s).apply(null,arguments)},o._getInputMemoryOffset=function(){return(o._getInputMemoryOffset=o.asm.t).apply(null,arguments)},o._getInputHeight=function(){return(o._getInputHeight=o.asm.u).apply(null,arguments)},o._getInputWidth=function(){return(o._getInputWidth=o.asm.v).apply(null,arguments)},o._getInputChannelCount=function(){return(o._getInputChannelCount=o.asm.w).apply(null,arguments)},o._getOutputMemoryOffset=function(){return(o._getOutputMemoryOffset=o.asm.x).apply(null,arguments)},o._getOutputHeight=function(){return(o._getOutputHeight=o.asm.y).apply(null,arguments)},o._getOutputWidth=function(){return(o._getOutputWidth=o.asm.z).apply(null,arguments)},o._getOutputChannelCount=function(){return(o._getOutputChannelCount=o.asm.A).apply(null,arguments)},o._loadModel=function(){return(o._loadModel=o.asm.B).apply(null,arguments)},o._runInference=function(){return(o._runInference=o.asm.C).apply(null,arguments)},o._isGPUEnabled=function(){return(o._isGPUEnabled=o.asm.D).apply(null,arguments)};var H,Y=o.___errno_location=function(){return(Y=o.___errno_location=o.asm.F).apply(null,arguments)};function D(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function B(e){function t(){H||(H=!0,o.calledRun=!0,!w&&(X(R),r(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;X(Z)}()))}k>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),I.unshift(e);var e;X(I)}(),k>0)||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t())}if(O=function e(){H||B(),H||(O=e)},o.run=B,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return B(),n.ready}}();class Zt{constructor(){o(this,"selectedTFLite"),o(this,"isSIMDSupported",!1),o(this,"isThreadsSupported",!1),o(this,"inputWidth",0),o(this,"inputHeight",0),o(this,"inputChannelCount",0),o(this,"inputMemoryOffset",0),o(this,"outputWidth",0),o(this,"outputHeight",0),o(this,"outputChannelCount",0),o(this,"outputMemoryOffset",0)}}async function kt(t="https://d3opqjmqzxf057.cloudfront.net/vonage-tensorflow-wasm/tflite-simd-wasm/1.1.3/",n="https://d3opqjmqzxf057.cloudfront.net/ml/selfie_segmentation/4.0.0/"){let r=new Zt;return new e((function(i,o){(async function(){return Rt({locateFile:function(e){return t+e}})})().then(t=>{if(null===t)throw console.error("loadTFLite null"),"loadTFLite null";(async function(t){return new e(async(e,i)=>{const o=t;if(typeof o>"u")return i("TFLite backend unavailable: wasmSimd");const s="selfie_segmentation_landscape";console.log("Loading tflite model:",s);let a=n+(s+".tflite");console.log("TFLite modelUrl: "+a);try{const e=await(await fetch(a)).arrayBuffer();console.log("Model buffer size:",e.byteLength);const t=o._getModelBufferMemoryOffset();console.log("Model buffer memory offset:",t),console.log("Loading model buffer..."),o.HEAPU8.set(new Uint8Array(e),t);const n=o._loadModel(e.byteLength);if(console.log("Load model result:",n),0!==n)return void i("Cannot load model");r.inputWidth=o._getInputWidth(),r.inputHeight=o._getInputHeight(),r.inputChannelCount=o._getInputChannelCount(),r.inputMemoryOffset=o._getInputMemoryOffset(),console.log("Input memory offset:",r.inputMemoryOffset),console.log("Input height:",r.inputHeight),console.log("Input width:",r.inputWidth),console.log("Input channels:",r.inputChannelCount),r.outputMemoryOffset=o._getOutputMemoryOffset(),r.outputWidth=o._getOutputWidth(),r.outputHeight=o._getOutputHeight(),r.outputChannelCount=o._getOutputChannelCount(),console.log("Output memory offset:",r.outputMemoryOffset),console.log("Output height:",r.outputHeight),console.log("Output width:",r.outputWidth),console.log("Output channels:",r.outputChannelCount),r.selectedTFLite=o}catch(e){return void i(e)}e()})})(t).then(e=>{i(r)}).catch(e=>{console.error("loadTFLiteModel error"),o("loadTFLiteModel error")})}).catch(e=>{console.error("loadTFLite error:",e),o("loadTFLite error:"+e)})}))}class Ot{constructor(){o(this,"canvas",new OffscreenCanvas(0,0)),o(this,"context",this.canvas.getContext("2d",{willReadFrequently:!0})),o(this,"pixelCount",0),o(this,"inputOffset",0),o(this,"outputOffset",0),o(this,"infos"),o(this,"mask")}async init(e,t){await this.initWasm(e,t),this.infos&&(this.canvas.width=this.infos.inputWidth,this.canvas.height=this.infos.inputHeight,this.pixelCount=this.infos.inputWidth*this.infos.inputHeight,this.mask=new ImageData(this.infos.inputWidth,this.infos.inputHeight),this.inputOffset=this.infos.inputMemoryOffset/4,this.outputOffset=this.infos.outputMemoryOffset/4)}async initWasm(e,t){this.infos=await kt(e,t)}getOutputDimensions(){var e,t,n,r;return{width:null!=(t=null==(e=this.infos)?void 0:e.outputWidth)?t:0,height:null!=(r=null==(n=this.infos)?void 0:n.outputHeight)?r:0}}async process(e){if(!this.mask||!this.infos)return;const t=this.infos.inputWidth,n=this.infos.inputHeight;this.context.drawImage(e,0,0,e.width,e.height,0,0,t,n);const r=this.context.getImageData(0,0,t,n),i=this.infos.selectedTFLite.HEAPF32;for(let e=0;e<this.pixelCount;e++){const t=this.inputOffset+3*e;i[t]=r.data[4*e]/255,i[t+1]=r.data[4*e+1]/255,i[t+2]=r.data[4*e+2]/255}this.infos.selectedTFLite._runInference();for(let e=0;e<this.pixelCount;e++){const t=this.infos.selectedTFLite.HEAPF32[this.outputOffset+e];this.mask.data[4*e]=this.mask.data[4*e+3]=255*t}return createImageBitmap(this.mask)}isGpuSupported(){var e,t,n;return null!=(n=null==(t=null==(e=this.infos)?void 0:e.selectedTFLite)?void 0:t._isGPUEnabled())&&n}}async function Vt(e,t){const{wasm:n,insertableStreams:r,simd:i,webgl:o}=await Gt(e,t);if(!n.supported)throw n.message;if(!r.supported)throw r.message;if(!i.supported)throw i.message;if(!o.supported)throw o.message}async function Gt(t,n){const r=new Ot;await r.initWasm(t,n);const i={wasm:{supported:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate,message:"Your browser does not support WebAssembly features."},simd:{supported:await It(),message:"Your browser does not support simd features."},insertableStreams:{supported:!0},gpu:{supported:r.isGpuSupported(),message:"Your browser does not support gpu features."},webgl:OffscreenCanvas?new OffscreenCanvas(0,0).getContext("webgl2")?{supported:!0}:{supported:!1,message:"Your browser does not support webgl 2"}:{supported:!1,message:"Your browser does not support offscreen canvas"}};try{await new e((e,t)=>{typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u"?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}catch(e){i.insertableStreams.supported=!1,i.insertableStreams.message=e}return i}const At={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(e,t){return t=new T(new v(t)),f&&e.prototype&&f(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).J(o(s.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var R,Z,k=typeof TextDecoder<"u",O=typeof TextEncoder<"u";function V(e){if(O)e=(Z||(Z=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var s=e.charCodeAt(++i);if(56320<=s&&57343>=s){o=1024*(o-55296)+s-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var G={},A=null;function W(e,t){void 0===t&&(t=0),L(),t=G[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function N(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=A[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}L();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function L(){if(!A){A={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));G[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===A[o]&&(A[o]=i)}}}}var X,M="function"==typeof Uint8Array.prototype.slice;function F(e,t,n){return t===n?X||(X=new Uint8Array(0)):M?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var P=0;function j(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&U(this,e)}function U(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?N(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function H(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,r)))))}function Y(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((n=(t<<0|n<<8|r<<16|i<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))}j.prototype.reset=function(){this.g=this.j};var D=[];function B(){this.g=new Uint8Array(64),this.h=0}function K(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function J(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,D.length?(n=D.pop(),t&&(n.v=t.v),e&&U(n,e),e=n):e=new j(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function z(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var n=7&(t=H(e.g));return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function Q(e,t,n){var r=e.g.i,i=H(e.g);return i=e.g.g+i,e.g.i=i,n(t,e),e.g.g=i,e.g.i=r,t}function q(e){var t,n=H(e.g),r=(e=e.g).g;if(e.g+=n,e=e.h,k)(t=R)||(t=R=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,s,a=[],c=null;r<n;)128>(i=e[r++])?a.push(i):224>i?r>=n?a.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,a.push(65533)):a.push((31&i)<<6|63&o)):240>i?r>=n-1?a.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,a.push(65533)):a.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?a.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30!=0||128!=(192&(t=e[r++]))||128!=(192&(s=e[r++]))?(r--,a.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&s,i-=65536,a.push(55296+(i>>10&1023),56320+(1023&i))):a.push(65533),8192<=a.length&&(c=I(c,a),a.length=0);t=I(c,a)}return t}function $(){this.h=[],this.i=0,this.g=new B}function ee(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function te(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var s=n[o];0!==s.length&&(t.set(s,i),i+=s.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ne(e,t,n){if(null!=n){K(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?P=0:(0,P=2147483648):isNaN(r)?(0,P=2147483647):34028234663852886e22<r?(0,P=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,P=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),r=8388607&Math.round(8388608*r),0,P=(n<<31|t+127<<23|r)>>>0),n=P,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}B.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},B.prototype.length=function(){return this.h},B.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,F(e,0,t)},J.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var re="function"==typeof Uint8Array;function ie(e,t,n){if(null!=e)return"object"==typeof e?re&&e instanceof Uint8Array?n(e):oe(e,t,n):t(e)}function oe(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ie(e[i],t,n);return Array.isArray(e)&&e.W&&ue(r),r}for(i in r={},e)r[i]=ie(e[i],t,n);return r}function se(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ae,ce={W:{value:!0,configurable:!0}};function ue(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,ce),e}function le(e,t,n){var r=ae;if(ae=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.i=null,this.g=e,e=(r=this.g.length)-1,r&&null!==(r=this.g[e])&&"object"==typeof r&&r.constructor===Object?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?ue(r):this.g[e]=de):(he(this),(r=this.h[e])?ue(r):this.h[e]=de)}var de=Object.freeze(ue([]));function he(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function fe(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function pe(e){var t=void 0!==t&&t,n=fe(e,1,t);return null==n&&(n=de),n===de&&ge(e,1,n=ue([]),t),n}function me(e,t,n){return null==(e=null==(e=fe(e,t))?e:+e)?void 0===n?0:n:e}function ge(e,t,n,r){void 0!==r&&r||t>=e.l?(he(e),e.h[t]=n):e.g[t+e.j]=n}function be(e,t){e.i||(e.i={});var n=e.i[1];if(!n){var r=pe(e);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.i[1]=n}return n}function ye(e,t,n,r){var i=be(e,n);t=t||new n,e=pe(e),null!=r?(i.splice(r,0,t),e.splice(r,0,ve(t))):(i.push(t),e.push(ve(t)))}function ve(e,t){if(e.i)for(var n in e.i){var r=e.i[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&ve(r[i]);else r&&ve(r)}return e.g}function we(e,t){return null==(e=fe(e,t))?0:e}function Se(e,t){return null==(e=fe(e,t))?"":e}function Te(e,t){if(e=e.m){ee(t,t.g.end());for(var n=0;n<e.length;n++)ee(t,e[n])}}function Ee(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=H(t.g);(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!z(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=F(t.g.h,n,t.g.g),(n=e.m)?n.push(t):e.m=[t]),!0}function xe(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{a(n.next(e))}catch(e){i(e)}}function s(e){try{a(n.throw(e))}catch(e){i(e)}}function a(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,s)}a((n=n.apply(t,void 0)).next())}))}function _e(e){le.call(this,e)}function Ce(e,t){for(;z(t);)switch(t.i){case 8:var n=H(t.g);ge(e,1,n);break;case 21:ge(e,2,n=Y(t.g));break;case 26:ge(e,3,n=q(t));break;case 34:ge(e,4,n=q(t));break;default:if(!Ee(e,t))return e}return e}function Ie(e){le.call(this,e,-1,Re)}le.prototype.toJSON=function(){return oe(ve(this),se,W)},le.prototype.toString=function(){return ve(this).toString()},p(_e,le),p(Ie,le),Ie.prototype.addClassification=function(e,t){ye(this,e,_e,t)};var Re=[1];function Ze(e){le.call(this,e)}function ke(e,t){for(;z(t);)switch(t.i){case 13:var n=Y(t.g);ge(e,1,n);break;case 21:ge(e,2,n=Y(t.g));break;case 29:ge(e,3,n=Y(t.g));break;case 37:ge(e,4,n=Y(t.g));break;case 45:ge(e,5,n=Y(t.g));break;default:if(!Ee(e,t))return e}return e}function Oe(e){le.call(this,e,-1,Ve)}p(Ze,le),p(Oe,le);var Ve=[1];function Ge(e){le.call(this,e)}function Ae(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function We(e){return be(e,_e).map((function(e){return{index:we(e,1),Y:me(e,2),label:null!=fe(e,3)?Se(e,3):void 0,displayName:null!=fe(e,4)?Se(e,4):void 0}}))}function Ne(e){return{x:me(e,1),y:me(e,2),z:me(e,3),visibility:null!=fe(e,4)?me(e,4):void 0}}function Le(e,t){this.h=e,this.g=t,this.l=0}function Xe(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Ae(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Ae(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Me(e){this.g=e}p(Ge,le);var Fe=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Pe(e,t){return t+e}function je(e,t){window[e]=t}function Ue(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Pe,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function He(t){return xe(t,(function t(){var n,r,i,o,s,a,u,l,d,h,f,p=this;return E(t,(function(t){switch(t.g){case 1:return n=p,p.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(p,p.j),y(t,function(){return xe(this,(function e(){return E(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Fe),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return je("createMediapipeSolutionsWasm",{locateFile:p.locateFile}),je("createMediapipeSolutionsPackedAssets",{locateFile:p.locateFile}),a=r.filter((function(e){return void 0!==e.data})),u=r.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(t){var r=Ye(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),d=e.all(u.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return xe(n,(function e(){var t,n,r=this;return E(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,y(e,t(n),2);r.h=e.h,e.g=0}))}))})),h=xe(n,(function e(){var t=this;return E(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,Ye(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(t,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),y(t,createMediapipeSolutionsWasm(Module),6);case 6:p.h=t.h,p.l=new OffscreenCanvas(1,1),p.h.canvas=p.l,s=p.h.GL.createContext(p.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),p.h.GL.makeContextCurrent(s),t.g=4;break;case 7:if(p.l=document.createElement("canvas"),!(f=p.l.getContext("webgl2",{}))&&!(f=p.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();p.D=f,p.h.canvas=p.l,p.h.createContext(p.l,!0,!0,{});case 4:p.i=new p.h.SolutionWasm,p.R=!1,t.g=0}}))}))}function Ye(e,t){return xe(e,(function e(){var n,r,i=this;return E(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function De(e,t,n){return xe(e,(function e(){var r,i,o,s,c,u,l,d,h,f,p,m,g,b,v=this;return E(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(v.G=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){e.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(e,function(e,t,n){return xe(e,(function e(){var r,i=this;return E(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new Le(i.h,i.D),i.s[t]=r),e.return(Xe(r,n,i.G))):e.return(void 0)}))}))}(v,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=w.get(_);e:{var I=new Ge;for(C=new J(C);z(C);)switch(C.i){case 13:var R=Y(C.g);ge(I,1,R);break;case 21:ge(I,2,R=Y(C.g));break;case 29:ge(I,3,R=Y(C.g));break;case 37:ge(I,4,R=Y(C.g));break;case 45:ge(I,5,R=Y(C.g));break;case 48:for(var Z=C.g,k=128,O=0,V=R=0;4>V&&128<=k;V++)O|=(127&(k=Z.h[Z.g++]))<<7*V;if(128<=k&&(O|=(127&(k=Z.h[Z.g++]))<<28,R|=(127&k)>>4),128<=k)for(V=0;5>V&&128<=k;V++)R|=(127&(k=Z.h[Z.g++]))<<7*V+3;128>k?(Z=O>>>0,(R=2147483648&(k=R>>>0))&&(k=~k>>>0,0==(Z=1+~Z>>>0)&&(k=k+1>>>0)),Z=4294967296*k+(Z>>>0),R=R?-Z:Z):(Z.l=!0,R=void 0),ge(I,6,R);break;default:if(!Ee(I,C))break e}}I={Z:me(I,1),$:me(I,2),height:me(I,3),width:me(I,4),rotation:me(I,5,0),X:we(I,6)},R=S.get(_);e:for(C=new Oe,R=new J(R);z(R);)switch(R.i){case 10:ye(C,Z=Q(R,new Ze,ke),Ze,void 0);break;default:if(!Ee(C,R))break e}C=be(C,Ze).map(Ne),Z=T.get(_);e:for(R=new Ie,Z=new J(Z);z(Z);)switch(Z.i){case 10:R.addClassification(Q(Z,new _e,Ce));break;default:if(!Ee(R,Z))break e}I={T:I,O:C,M:We(R)},x.push(I)}w=x}else w=[];r[d]=w,e.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,e.g=7;break}if(void 0===f){e.g=3;break}if("float_list"===h.type){r[d]=f,e.g=7;break}if("proto"===h.type){r[d]=f,e.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=v.s[d])||(p=new Le(v.h,v.D),v.s[d]=p),y(e,Xe(p,f,v.G),13);case 13:m=e.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),e.g=3;break;case 14:g[b]=e.h;case 3:s=l.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function Be(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.C=De(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Ke(e){switch(void 0===e&&(e=0),e){case 1:return"selfie_segmentation_landscape.tflite";default:return"selfie_segmentation.tflite"}}function Je(e){var t=this;e=e||{},this.g=new Ue({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:Ke(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){return xe(t,(function t(){var n,r,i,o=this;return E(t,(function(t){return 1==t.g?(n=Ke(e),r="third_party/mediapipe/modules/selfie_segmentation/"+n,y(t,Ye(o.g,n),2)):(i=t.h,o.g.overrideFile(r,i),t.return(!0))}))}))}}}})}(t=Ue.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return xe(this,(function e(){var t=this;return E(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={K:o.K,L:o.L},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.K=c.onChange,o.L=e[u],r.push(function(e){return function(){return xe(n,(function t(){var n=this;return E(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return xe(this,(function e(){var t=this;return E(e,(function(e){return 1==e.g?y(e,He(t),2):3!=e.g?y(e,function(e){return xe(e,(function e(){var t,n,r,i,o,s,c,u,l=this;return E(e,(function(e){if(1==e.g)return l.g.graph&&l.g.graph.url&&l.P===l.g.graph.url?e.return():(l.o=!0,l.g.graph&&l.g.graph.url?(l.P=l.g.graph.url,y(e,Ye(l,l.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,l.i.loadGraph(t)),n=a(Object.keys(l.B)),r=n.next();!r.done;r=n.next())i=r.value,l.i.overrideFile(i,l.B[i]);if(l.B={},l.g.listeners)for(o=a(l.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Be(l,c);u=l.j,l.j={},l.setOptions(u),e.g=0}))}))}(t),3):y(e,function(e){return xe(e,(function e(){var t,n,r,i,o,s,c=this;return E(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=a(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return y(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=a(c.A),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return xe(this,(function n(){var r,i,o,s,c,u,l,d,h,f=this;return E(n,(function(n){switch(n.g){case 1:return f.g.inputs?(r=1e3*(null==t?performance.now():t),y(n,f.C,2)):n.return();case 2:return y(n,f.initialize(),3);case 3:for(i=new f.h.PacketDataList,o=a(Object.keys(e)),s=o.next();!s.done;s=o.next())if(c=s.value,u=f.g.inputs[c]){e:{var p=f,m=e[c];switch(u.type){case"video":var g=p.m[u.stream];if(g||(g=new Le(p.h,p.D),p.m[u.stream]=g),0===(p=g).l&&(p.l=p.h.createTexture()),typeof HTMLVideoElement<"u"&&m instanceof HTMLVideoElement){var b=m.videoWidth;g=m.videoHeight}else typeof HTMLImageElement<"u"&&m instanceof HTMLImageElement?(b=m.naturalWidth,g=m.naturalHeight):(b=m.width,g=m.height);g={glName:p.l,width:b,height:g},(b=p.g).canvas.width=g.width,b.canvas.height=g.height,b.activeTexture(b.TEXTURE0),p.h.bindTexture2d(p.l),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,m),p.h.bindTexture2d(0),p=g;break e;case"detections":for((g=p.m[u.stream])||(g=new Me(p.h),p.m[u.stream]=g),(p=g).data||(p.data=new p.g.DetectionListData),p.data.reset(m.length),g=0;g<m.length;++g){b=m[g];var v=p.data,w=v.setBoundingBox,S=g,T=b.T,E=new Ge;ge(E,1,T.Z),ge(E,2,T.$),ge(E,3,T.height),ge(E,4,T.width),ge(E,5,T.rotation),ge(E,6,T.X);var x=T=new $;ne(x,1,fe(E,1)),ne(x,2,fe(E,2)),ne(x,3,fe(E,3)),ne(x,4,fe(E,4)),ne(x,5,fe(E,5));var _=fe(E,6);if(null!=_&&null!=_){K(x.g,48);var C=x.g,I=_;_=0>I;var R=(I=Math.abs(I))>>>0;for(I=Math.floor((I-R)/4294967296),I>>>=0,_&&(I=~I>>>0,4294967295<(R=1+(~R>>>0))&&(R=0,4294967295<++I&&(I=0))),_=P=R,R=I;0<R||127<_;)C.push(127&_|128),_=(_>>>7|R<<25)>>>0,R>>>=7;C.push(_)}if(Te(E,x),T=te(T),w.call(v,S,T),b.O)for(v=0;v<b.O.length;++v)x=!!(E=b.O[v]).visibility,S=(w=p.data).addNormalizedLandmark,T=g,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),ge(x=new Ze,1,E.x),ge(x,2,E.y),ge(x,3,E.z),E.visibility&&ge(x,4,E.visibility),ne(C=E=new $,1,fe(x,1)),ne(C,2,fe(x,2)),ne(C,3,fe(x,3)),ne(C,4,fe(x,4)),ne(C,5,fe(x,5)),Te(x,C),E=te(E),S.call(w,T,E);if(b.M)for(v=0;v<b.M.length;++v){if(S=(w=p.data).addClassification,T=g,E=b.M[v],ge(x=new _e,2,E.Y),E.index&&ge(x,1,E.index),E.label&&ge(x,3,E.label),E.displayName&&ge(x,4,E.displayName),C=E=new $,null!=(R=fe(x,1))&&null!=R)if(K(C.g,8),_=C.g,0<=R)K(_,R);else{for(I=0;9>I;I++)_.push(127&R|128),R>>=7;_.push(1)}ne(C,2,fe(x,2)),null!=(_=fe(x,3))&&(_=V(_),K(C.g,26),K(C.g,_.length),ee(C,C.g.end()),ee(C,_)),null!=(_=fe(x,4))&&(_=V(_),K(C.g,34),K(C.g,_.length),ee(C,C.g.end()),ee(C,_)),Te(x,C),E=te(E),S.call(w,T,E)}}p=p.data;break e;default:p={}}}switch(l=p,d=u.stream,u.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},l),{stream:d,timestamp:r}));break;case"detections":(h=l).stream=d,h.timestamp=r,i.pushDetectionList(h);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return f.i.send(i),y(n,f.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",Ue),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Je.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return xe(this,(function e(){var t=this;return E(e,(function(e){return y(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return xe(this,(function t(){var n=this;return E(t,(function(t){return y(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},C("SelfieSegmentation",Je),C("VERSION","0.1.1632777926")}).call(At);const Wt={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ra=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={fa:t,ga:!0},e.g=e.o||e.u}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ga)throw t.fa;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.s):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(s){s.done?i(s.value):e.resolve(s.value).then(n,r).then(t,o)}(t.next())}))}(new T(new v(t)))}m.prototype.s=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).M(o(s.length-1),t),i=n.next()}while(!i.done)}))},t}));var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(){throw Error("Invalid UTF8")}function R(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Z,k,O=typeof TextDecoder<"u",V=typeof TextEncoder<"u",G={},A=null;function W(e){var t;void 0===t&&(t=0),L(),t=G[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function N(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=A[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}L();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function L(){if(!A){A={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));G[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===A[o]&&(A[o]=i)}}}}var X,M="function"==typeof Uint8Array;function F(e){return M&&null!=e&&e instanceof Uint8Array}function P(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var j="function"==typeof Uint8Array.prototype.slice,U=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function Y(){return Error("Failed to read varint, encoding is invalid.")}function D(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&B(this,e)}function B(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return N(e);if(e.constructor===P)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||F(t)?t:"string"==typeof t?N(t):null,(e=e.L=t)?new Uint8Array(e):X||(X=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function K(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function J(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,K(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,K(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,K(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,K(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return K(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw Y();return K(e),r}D.prototype.reset=function(){this.g=this.j};var z=[];function Q(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,z.length?(n=z.pop(),t&&(n.v=t.v),e&&B(n,e),e=n):e=new D(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=J(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(0==(128&e.h[t++])){e.g=t,K(e);break e}throw Y()}break;case 1:(e=e.g).g+=8,K(e);break;case 2:2!=e.h?te(e):(t=J(e.g)>>>0,(e=e.g).g+=t,K(e));break;case 5:(e=e.g).g+=4,K(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}Q.prototype.length=function(){return this.g.length},Q.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new Q}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function se(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ae(e){var t;return null==(t=oe?e[oe]:e.N)?0:t}function ce(e){return se(e,1),e}function ue(e){return!!Array.isArray(e)&&!!(2&ae(e))}function le(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");se(e,2)}function de(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(ce([]));function fe(e){if(ue(e.m))throw Error("Cannot mutate an immutable Message")}var pe,me=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function ge(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function be(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,r){r=void 0!==r&&r,fe(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function ve(e,t,n,r){n=void 0===n||n;var i=be(e,t,r=void 0!==r&&r);return null==i&&(i=he),ue(e.m)?n&&(le(i),Object.freeze(i)):(i===he||ue(i))&&ye(e,t,i=ce(i.slice()),r),i}function we(e,t,n){return null==(e=null==(e=be(e,t))?e:+e)?void 0===n?0:n:e}function Se(e,t,n,r){e.j||(e.j={});var i=ue(e.m),o=e.j[n];if(!o){r=ve(e,n,!0,void 0!==r&&r),o=[],i=i||ue(r);for(var s=0;s<r.length;s++)o[s]=new t(r[s]),i&&le(o[s].m);i&&(le(o),Object.freeze(o)),e.j[n]=o}return o}function Te(e,t,n,r,i){var o=void 0!==o&&o;return fe(e),o=Se(e,n,t,o),n=r||new n,e=ve(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function Ee(e,t){return null==(e=be(e,t))?0:e}function xe(e,t){return null==(e=be(e,t))?"":e}function _e(e){var t=Re;return Ie(e,t=void 0===t?Ze:t)}function Ce(e,t){if(null!=e){if(Array.isArray(e))e=Ie(e,t);else if(de(e)){var n,r={};for(n in e)r[n]=Ce(e[n],t);e=r}else e=t(e);return e}}function Ie(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=Ce(n[r],t);return Array.isArray(e)&&1&ae(e)&&ce(n),n}function Re(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(F(e))return W(e);if(e instanceof P){var t=e.L;return t=null==t||"string"==typeof t?t:M&&t instanceof Uint8Array?W(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?_e(e):e)}function Ze(e){return F(e)?new Uint8Array(e):e}function ke(e,t,n){e||(e=pe),pe=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&de(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=he;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=he}}function Oe(){ke.apply(this,arguments)}if(ke.prototype.toJSON=function(){return _e(this.m)},ke.prototype.toString=function(){return this.m.toString()},p(Oe,ke),me){var Ve={};Object.defineProperties(Oe,(Ve[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Ve))}function Ge(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],s=o.ja;s||(i.F=o.pa||o.ha.P,o.ba?(i.U=Fe(o.ba),s=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.da?(i.T=Pe(o.X.g,o.da),s=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):s=i.F,o.ja=s),s(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ca){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ae=Symbol();function We(e,t,n){return e[Ae]||(e[Ae]=function(e,r){return t(e,r,n)})}function Ne(e){var t=e[Ae];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ae]=t}return t}function Le(e){var t=function(e){var t=e.ba;return t?Ne(t):(t=e.oa)?We(e.X.g,t,e.da):void 0}(e),n=e.X,r=e.ha.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Xe(e,t,n,r,i,o){var s=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),s++);s<e.length;){n=e[s++];for(var a=s+1;a<e.length&&"number"!=typeof e[a];)a++;var c=e[s++];switch(a-=s){case 0:r(t,n,c);break;case 1:r(t,n,c,e[s++]);break;case 2:i(t,n,c,e[s++],e[s++]);break;case 3:a=e[s++];var u=e[s++],l=e[s++];Array.isArray(l)?i(t,n,c,a,u,l):o(t,n,c,a,u,l);break;case 4:o(t,n,c,e[s++],e[s++],e[s++],e[s++]);break;default:throw Error("unexpected number of binary field arguments: "+a)}}return t}var Me=Symbol();function Fe(e){var t=e[Me];if(!t){var n=Be(e);t=function(e,t){return nt(e,t,n)},e[Me]=t}return t}function Pe(e,t){var n=e[Me];return n||(n=function(e,n){return Ge(e,n,t)},e[Me]=n),n}var je=Symbol();function Ue(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ye(e,t,n,r,i){var o=Fe(i),s=n.P;e.push(t,(function(e,t,n){return s(e,t,n,r,o)}))}function De(e,t,n,r,i,o){var s=Pe(r,o),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,s)}))}function Be(e){return e[je]||Xe(e,e[je]=[],Ue,He,Ye,De)}var Ke=Symbol();function Je(e,t){e[0]=t}function ze(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function Qe(e,t,n,r,i,o){var s=n.O,a=Ne(i);e[t]=function(e,t,n){return s(e,t,n,r,a,o)}}function qe(e,t,n,r,i,o,s){var a=n.O,c=We(r,i,o);e[t]=function(e,t,n){return a(e,t,n,r,c,s)}}function $e(e){return e[Ke]||Xe(e,e[Ke]={},Je,ze,Qe,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=Le(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var s=i.g.h;i=o===(i=i.g.g)?X||(X=new Uint8Array(0)):j?s.slice(o,i):new Uint8Array(s.subarray(o,i)),(o=r.ca)?o.push(i):r.ca=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(B(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Ge(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,Be(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var s=t[o];e.set(s,i),i+=s.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],s=e.h[e.g+3];return e.g+=4,K(e),e=2*((i=(r<<0|i<<8|o<<16|s<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,ye(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=be(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?U=0:(0,U=2147483648):isNaN(r)?(0,U=2147483647):34028234663852886e22<r?(0,U=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,U=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,U=(n<<31|t+127<<23|8388607&r)>>>0),n=U,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),st=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,s=e=0;4>s&&128<=i;s++)i=r.h[r.g++],K(r),o|=(127&i)<<7*s;if(128<=i&&(i=r.h[r.g++],K(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)i=r.h[r.g++],K(r),e|=(127&i)<<7*s+3;if(!(128>i))throw Y();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),ye(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=be(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=U=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=it((function(e,t,n){return 0===e.h&&(ye(t,n,J(e.g)),!0)}),(function(e,t,n){if(null!=(t=be(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=J(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,K(e),e=e.h,O)(r=Z)||(r=Z=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var s,a,c,u=[],l=null;o<i;)128>(s=e[o++])?u.push(s):224>s?o>=i?I():(a=e[o++],194>s||128!=(192&a)?(o--,I()):u.push((31&s)<<6|63&a)):240>s?o>=i-1?I():128!=(192&(a=e[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=e[o++]))?(o--,I()):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?I():128!=(192&(a=e[o++]))||a-144+(s<<28)>>30!=0||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,I()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&c,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):I(),8192<=u.length&&(l=R(l,u),u.length=0);r=R(l,u)}return ye(t,n,r),!0}),(function(e,t,n){if(null!=(t=be(t,n))){var r=!1;if(r=void 0!==r&&r,V){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(k||(k=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),s=0;s<t.length;s++){var a=t.charCodeAt(s);if(128>a)o[i++]=a;else{if(2048>a)o[i++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&s<t.length){var c=t.charCodeAt(++s);if(56320<=c&&57343>=c){a=1024*(a-55296)+c-56320+65536,o[i++]=a>>18|240,o[i++]=a>>12&63|128,o[i++]=a>>6&63|128,o[i++]=63&a|128;continue}s--}if(r)throw Error("Found an unpaired surrogate");a=65533}o[i++]=a>>12|224,o[i++]=a>>6&63|128}o[i++]=63&a|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),ut=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Te(t,n,r),n=e.g.i,r=J(e.g)>>>0;var o=e.g.g+r,s=o-n;if(0>=s&&(e.g.i=o,i(t,e),s=o-e.g.g),s)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-s)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Se(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var s=o.g.end();ie(o,s),s.push(o.h),o=s,i(t[r],e),s=e;var a=o.pop();for(a=s.h+s.g.length()-a;127<a;)o.push(127&a|128),a>>>=7,s.h++;o.push(a),s.h++}}));function lt(){Oe.apply(this,arguments)}if(p(lt,Oe),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ht(e){lt.call(this,e)}function ft(){return[1,at,2,ot,3,ct,4,ct]}function pt(e){lt.call(this,e,-1,gt)}function mt(){return[1,ut,ht,ft]}p(ht,lt),p(pt,lt),pt.prototype.addClassification=function(e,t){return Te(this,1,ht,e,t),this};var gt=[1];function bt(e){lt.call(this,e)}function yt(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function vt(e){lt.call(this,e,-1,St)}function wt(){return[1,ut,bt,yt]}p(bt,lt),p(vt,lt);var St=[1];function Tt(e){lt.call(this,e)}function Et(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,st]}function xt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function _t(e){return Se(e,ht,1).map((function(e){return{index:Ee(e,1),score:we(e,2),label:null!=be(e,3)?xe(e,3):void 0,displayName:null!=be(e,4)?xe(e,4):void 0}}))}function Ct(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=be(e,4)?we(e,4):void 0}}function It(e){return e.map((function(e){return Se(tt(e,vt,wt),bt,1).map(Ct)}))}function Rt(e,t){this.h=e,this.g=t,this.l=0}function Zt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=xt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=xt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),qa:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function kt(e){this.g=e}p(Tt,lt);var Ot=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Vt(e,t){return t+e}function Gt(e,t){window[e]=t}function At(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.$=!0,this.D=e.resolve(),this.Z="",this.C={},this.locateFile=t&&t.locateFile||Vt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.aa=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Wt(t){var n,r,i,o,s,a,u,l,d,h,f;return E((function(p){switch(p.g){case 1:return t.$?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(p,E((function(e){switch(e.g){case 1:return e.o=2,y(e,WebAssembly.instantiate(Ot),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(r=p.h,"object"==typeof window)return Gt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Gt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=n.filter((function(e){return void 0!==e.data})),u=n.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(n){var r=Nt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),d=e.all(u.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.aa)):e.resolve()}))).then((function(){var e,n,r;return E((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0}))})),h=E((function(e){return t.g.graph&&t.g.graph.url?e=y(e,Nt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(p,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.aa)})),importScripts.apply(null,c(i)),o=t,y(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,s=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,na:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(s),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(f=t.l.getContext("webgl2",{}))&&!(f=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.G=f,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.$=!1,p.g=0}}))}function Nt(e,t){var n,r;return E((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function Lt(e,t,n){var r,i,o,s,c,u,l,d,h,f,p,m,g,b;return E((function(v){switch(v.g){case 1:if(!n)return v.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(e.I=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){v.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(v,function(e,t,n){var r;return E((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Rt(e.h,e.G),e.u[t]=r),i.return(Zt(r,n,e.I))):i.return(void 0)}))}(e,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=tt(w.get(_),Tt,Et);C={ea:{ka:we(C,1),la:we(C,2),height:we(C,3),width:we(C,4),rotation:we(C,5,0),ia:Ee(C,6)},Y:Se(tt(S.get(_),vt,wt),bt,1).map(Ct),V:_t(tt(T.get(_),pt,mt))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===f){v.g=3;break}if("float_list"===h.type){r[d]=f,v.g=7;break}if("proto"===h.type){r[d]=f,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=e.u[d])||(p=new Rt(e.h,e.G),e.u[d]=p),y(v,Zt(p,f,e.I),13);case 13:m=v.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),v.g=3;break;case 14:g[b]=v.h;case 3:s=l.next(),v.g=2;break;case 4:return v.return(r)}}))}function Xt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.D=Lt(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Mt(e){return void 0===e&&(e=0),1===e?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function Ft(e){var t=this;e=e||{},this.g=new At({locateFile:e.locateFile,files:function(e){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:Mt(e.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:It},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:It},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(e){return e.map((function(e){return _t(tt(e,pt,mt))[0]}))}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return E((function(o){return 1==o.g?(n=Mt(e),r="third_party/mediapipe/modules/hand_landmark/"+n,y(o,Nt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=At.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return E((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={R:o.R,S:o.S},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.R=c.onChange,o.S=e[u],r.push(function(e){return function(){return E((function(t){if(1==t.g)return y(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return E((function(t){return 1==t.g?y(t,Wt(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return E((function(l){if(1==l.g)return e.g.graph&&e.g.graph.url&&e.Z===e.g.graph.url?l.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Z=e.g.graph.url,y(l,Nt(e,e.g.graph.url),3)):void(l.g=2));for(2!=l.g&&(t=l.h,e.i.loadGraph(t)),n=a(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=a(e.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Xt(e,c);u=e.j,e.j={},e.setOptions(u),l.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,s;return E((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=a(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return y(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=a(e.B),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,s,c,u,l,d,h=this;return E((function(f){switch(f.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(f,h.D,2)):f.return();case 2:return y(f,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(e)),o=i.next();!o.done;o=i.next())if(s=o.value,c=h.g.inputs[s]){e:{var p=e[s];switch(c.type){case"video":var m=h.o[c.stream];if(m||(m=new Rt(h.h,h.G),h.o[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement)var g=p.videoWidth,b=p.videoHeight;else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(g=p.naturalWidth,b=p.naturalHeight):(g=p.width,b=p.height);b={glName:m.l,width:g,height:b},(g=m.g).canvas.width=b.width,g.canvas.height=b.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,p),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.o[c.stream])||(m=new kt(h.h),h.o[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(p.length),b=0;b<p.length;++b){g=p[b];var v=m.data,w=v.setBoundingBox,S=b,T=g.ea,E=new Tt;if(ye(E,1,T.ka),ye(E,2,T.la),ye(E,3,T.height),ye(E,4,T.width),ye(E,5,T.rotation),ye(E,6,T.ia),T=rt(E,Et),w.call(v,S,T),g.Y)for(v=0;v<g.Y.length;++v){var x=!!(E=g.Y[v]).visibility;S=(w=m.data).addNormalizedLandmark,T=b,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),ye(x=new bt,1,E.x),ye(x,2,E.y),ye(x,3,E.z),E.visibility&&ye(x,4,E.visibility),E=rt(x,yt),S.call(w,T,E)}if(g.V)for(v=0;v<g.V.length;++v)S=(w=m.data).addClassification,T=b,E=g.V[v],ye(x=new ht,2,E.score),E.index&&ye(x,1,E.index),E.label&&ye(x,3,E.label),E.displayName&&ye(x,4,E.displayName),E=rt(x,ft),S.call(w,T,E)}m=m.data;break e;default:m={}}}switch(u=m,l=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:l,timestamp:n}));break;case"detections":(d=u).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return h.i.send(r),y(f,h.D,4);case 4:r.delete(),f.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",At),C("OptionType",{BOOL:0,NUMBER:1,ma:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Ft.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return E((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return E((function(n){return y(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("Hands",Ft),C("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),C("VERSION","0.4.1646424915")}).call(Wt);var Nt={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.da=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(s){s.done?i(s.value):e.resolve(s.value).then(n,r).then(t,o)}(t.next())}))}(new T(new v(t)))}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).J(o(s.length-1),t),i=n.next()}while(!i.done)}))},t}));var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(e){!function(e){_.setTimeout((function(){throw e}),0)}(e)}function R(e,t){I(Error("Invalid wire type: "+e+" (at position "+t+")"))}function Z(){I(Error("Failed to read varint, encoding is invalid."))}function k(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var O,V,G=typeof TextDecoder<"u",A=typeof TextEncoder<"u";function W(e){if(A)e=(V||(V=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var s=e.charCodeAt(++i);if(56320<=s&&57343>=s){o=1024*(o-55296)+s-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var N={},L=null;function X(e){var t;void 0===t&&(t=0),F(),t=N[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function M(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=L[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}F();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function F(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));N[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===L[o]&&(L[o]=i)}}}}var P,j="function"==typeof Uint8Array;function U(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}U.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:j&&e instanceof Uint8Array?X(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function Y(e,t,n){return t===n?P||(P=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function B(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.m=0,this.l=!1,this.u=t,e&&K(this,e)}function K(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return M(e);if(e.constructor===U){if(null==e.g)var t=P||(P=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||j&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?M(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.m=0,e.i=e.h.length,e.g=e.m}function J(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.l=!0,Z()}function z(e){e.g>e.i&&(e.l=!0,I(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}B.prototype.reset=function(){this.g=this.m},B.prototype.j=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,z(this),n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,z(this),n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,z(this),n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,z(this),n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,z(this),n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]?(this.l=!0,Z(),n):(z(this),n))))))},B.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,z(this),e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var Q=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,Q.length?(n=Q.pop(),t&&(n.u=t.u),e&&K(n,e),e=n):e=new B(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=e.g.j();return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,R(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(0==(128&e.h[t])){e.g=t+1,z(e);break e}t++}e.l=!0,Z()}break;case 1:(e=e.g).g+=8,z(e);break;case 2:2!=e.h?re(e):(t=e.g.j(),(e=e.g).g+=t,z(e));break;case 5:(e=e.g).g+=4,z(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,I(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,I(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,R(e.h,e.l)}}function ie(e,t,n){e.N||(e=Y(e.g.h,n,e.g.g),(n=t.o)?n.push(e):t.o=[e])}function oe(e,t,n){var r=e.g.i,i=e.g.j(),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}function se(e,t,n){var r=e.g.j();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,Y(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var ae=[];function ce(){this.h=[],this.i=0,this.g=new q}function ue(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function le(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),ue(e,e.g.end()),ue(e,n)}var de,he="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function fe(e,t){Object.isFrozen(e)||(he?e[he]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function pe(e){return e?null==(t=he?e[he]:e.g)?0:t:0;var t}function me(e){return Array.isArray(e)&&fe(e,1),e}function ge(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");fe(e,2)}function be(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function ye(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return j&&null!=e&&e instanceof Uint8Array?X(e):e;default:return e}}function ve(e,t){if(null!=e)return Array.isArray(e)||be(e)?we(e,t):t(e)}function we(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=ve(e[r],t);return 1&pe(e)&&me(n),n}for(r in n={},e)n[r]=ve(e[r],t);return n}function Se(e,t,n){var r=de;if(de=null,e||(e=r),r=this.constructor.ba,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.$||0),this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,r&&be(r=this.h[e])?(this.l=e-this.j,this.i=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?me(r):this.h[e]=Ee):(xe(this),(r=this.i[e])?me(r):this.i[e]=Ee)}var Te,Ee=Object.freeze(me([]));function xe(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function _e(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function Ce(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=_e(e,t,r);return null==i&&(i=Ee),i===Ee?ke(e,t,i=me([]),r):n&&Array.isArray(i)&&2&pe(i)&&ke(e,t,i=i.slice(),r),i}function Ie(e){var t=Ce(e,3,!1);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function Re(e,t,n){return null==(e=_e(e,t))?n:e}function Ze(e,t,n){return null==(e=null==(e=_e(e,t))?e:+e)?void 0===n?0:n:e}function ke(e,t,n,r){void 0!==r&&r||t>=e.l?(xe(e),e.i[t]=n):e.h[t+e.j]=n}function Oe(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=_e(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function Ve(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=Ce(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&pe(i)),s=0;s<i.length;s++)r[s]=new t(i[s]),o&&ge(r[s].h);o&&(ge(r),Object.freeze(r)),e.g[n]=r}return r}function Ge(e,t,n,r,i){var o=Ve(e,r,t);n=n||new r,e=Ce(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ae(n))):(o.push(n),e.push(Ae(n)))}function Ae(e){if(e.g)for(var t in e.g){var n=e.g[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&Ae(n[r]);else n&&Ae(n)}return e.h}function We(e,t){if(e=e.o){ue(t,t.g.end());for(var n=0;n<e.length;n++)ue(t,e[n])}}function Ne(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],s=e[2],a=e[3];return function(e,n,r){return t(e,n,r,o,s,a)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function Le(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Ne(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Xe(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var s=r[o];0!==s.length&&(e.set(s,t),t+=s.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function Me(e,t,n){if(ae.length){var r=ae.pop();e&&(K(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.m=0,t.i=0,t.g=0,t.l=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>ae.length&&ae.push(e)}}function Fe(e,t,n){if(null!=(t=_e(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,D=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=D)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function Pe(e,t,n){return 5===e.h&&(ke(t,n,e.g.o()),!0)}function je(e,t,n){return(5===e.h||2===e.h)&&(t=Ce(t,n),2==e.h?se(e,B.prototype.o,t):t.push(e.g.o()),!0)}function Ue(e,t,n){return 0===e.h&&(ke(t,n,J(e.g)),!0)}function He(e,t,n){return 0===e.h&&(ke(t,n,e.g.j()),!0)}function Ye(e,t,n){if(2!==e.h)return!1;var r,i=e.g.j(),o=(e=e.g).g;if(e.g+=i,z(e),e=e.h,G)(r=O)||(r=O=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var s,a,c,u=[],l=null;o<i;)128>(s=e[o++])?u.push(s):224>s?o>=i?u.push(65533):(a=e[o++],194>s||128!=(192&a)?(o--,u.push(65533)):u.push((31&s)<<6|63&a)):240>s?o>=i-1?u.push(65533):128!=(192&(a=e[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=e[o++]))?(o--,u.push(65533)):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?u.push(65533):128!=(192&(a=e[o++]))||a-144+(s<<28)>>30!=0||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,u.push(65533)):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&c,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):u.push(65533),8192<=u.length&&(l=k(l,u),u.length=0);r=k(l,u)}return ke(t,n,r),!0}function De(e,t,n,r,i){if(2!==e.h)return!1;e=oe(e,new r,i);var o=void 0!==o&&o;return t.g||(t.g={}),r=e&&Ae(e),t.g[n]=e,ke(t,n,r,o),!0}function Be(e,t,n,r,i){return 2===e.h&&(Ge(t,n,e=oe(e,new r,i),r,void 0),!0)}function Ke(e,t,n){return(0===e.h||2===e.h)&&(t=Ce(t,n),2==e.h?se(e,B.prototype.j,t):t.push(e.g.j()),!0)}function Je(e,t,n){return 0===e.h&&(ke(t,n,J(e.g)),!0)}function ze(e){Se.call(this,e,-1,et)}function Qe(e,t){return Le(e,t,Te||(Te={1:He,2:He,3:je,4:Je}))}Se.prototype.toJSON=function(){return we(Ae(this),ye)},Se.prototype.toString=function(){return Ae(this).toString()},p(ze,Se),ze.prototype.getRows=function(){return _e(this,1)},ze.prototype.getCols=function(){return _e(this,2)},ze.prototype.getPackedDataList=function(){return Ie(this)},ze.prototype.getLayout=function(){return Re(this,4,0)};var qe,$e,et=[3];function tt(e){Se.call(this,e)}function nt(e,t){var n=_e(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}Fe(t,e,2),null!=(r=_e(e,3))&&le(t,3,W(r)),null!=(r=_e(e,4))&&le(t,4,W(r)),We(e,t)}function rt(e,t){return Le(e,t,qe||(qe={1:He,2:Pe,3:Ye,4:Ye}))}function it(e){Se.call(this,e,-1,ct)}function ot(e,t){return Le(e,t,$e||($e={1:[Be,tt,rt]}))}p(tt,Se),p(it,Se),it.prototype.addClassification=function(e,t){return Ge(this,1,e,tt,t),this};var st,at,ct=[1];function ut(e){Se.call(this,e)}function lt(e,t){Fe(t,e,1),Fe(t,e,2),Fe(t,e,3),Fe(t,e,4),Fe(t,e,5),We(e,t)}function dt(e,t){return Le(e,t,st||(st={1:Pe,2:Pe,3:Pe,4:Pe,5:Pe}))}function ht(e){Se.call(this,e,-1,gt)}function ft(e,t){return Le(e,t,at||(at={1:[Be,ut,dt]}))}p(ut,Se),p(ht,Se);var pt,mt,gt=[1];function bt(e){Se.call(this,e)}function yt(e,t){Fe(t,e,1),Fe(t,e,2),Fe(t,e,3),Fe(t,e,4),Fe(t,e,5);var n=_e(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=D=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}We(e,t)}function vt(e,t){return Le(e,t,pt||(pt={1:Pe,2:Pe,3:Pe,4:Pe,5:Pe,6:Ue}))}function wt(e){Se.call(this,e,-1,Et)}function St(e,t){return Le(e,t,mt||(mt={1:Je,2:Je,3:je,4:Ke}))}p(bt,Se),p(wt,Se),wt.prototype.getVertexType=function(){return Re(this,1,0)},wt.prototype.getPrimitiveType=function(){return Re(this,2,0)},wt.prototype.getVertexBufferList=function(){return Ie(this)},wt.prototype.getIndexBufferList=function(){return Ce(this,4)};var Tt,Et=[3,4];function xt(e){Se.call(this,e)}function _t(e,t){return Le(e,t,Tt||(Tt={1:[De,wt,St],2:[De,ze,Qe]}))}p(xt,Se),xt.prototype.getMesh=function(){return Oe(this,wt,1)},xt.prototype.getPoseTransformMatrix=function(){return Oe(this,ze,2)};var Ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],It=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Rt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Zt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],kt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ot=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Vt=[].concat(c(Ct),c(It),c(Rt),c(Zt),c(kt),c(Ot));function Gt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function At(e){return Ve(e,tt,1).map((function(e){return{index:Re(e,1,0),score:Ze(e,2),label:null!=_e(e,3)?Re(e,3,""):void 0,displayName:null!=_e(e,4)?Re(e,4,""):void 0}}))}function Wt(e){return{x:Ze(e,1),y:Ze(e,2),z:Ze(e,3),visibility:null!=_e(e,4)?Ze(e,4):void 0}}function Nt(e){return Ve(Me(e,ht,ft),ut,1).map(Wt)}function Lt(e,t){this.h=e,this.g=t,this.l=0}function Xt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Gt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Gt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),ca:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Mt(e){this.g=e}var Ft=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Pt(e,t){return t+e}function jt(e,t){window[e]=t}function Ut(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Pt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Ht(t){var n,r,i,o,s,a,u,l,d,h,f;return E((function(p){switch(p.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(p,E((function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Ft),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(r=p.h,"object"==typeof window)return jt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),jt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=n.filter((function(e){return void 0!==e.data})),u=n.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(n){var r=Yt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),d=e.all(u.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return E((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0}))})),h=E((function(e){return t.g.graph&&t.g.graph.url?e=y(e,Yt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(p,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,y(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,s=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,aa:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(s),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(f=t.l.getContext("webgl2",{}))&&!(f=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.D=f,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,p.g=0}}))}function Yt(e,t){var n,r;return E((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function Dt(e,t,n){var r,i,o,s,c,u,l,d,h,f,p,m,g,b;return E((function(v){switch(v.g){case 1:if(!n)return v.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(e.G=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){v.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(v,function(e,t,n){var r;return E((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new Lt(e.h,e.D),e.s[t]=r),i.return(Xt(r,n,e.G))):i.return(void 0)}))}(e,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=Me(w.get(_),bt,vt);C={T:{X:Ze(C,1),Y:Ze(C,2),height:Ze(C,3),width:Ze(C,4),rotation:Ze(C,5,0),W:Re(C,6,0)},O:Nt(S.get(_)),M:At(Me(T.get(_),it,ot))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===f){v.g=3;break}if("float_list"===h.type){r[d]=f,v.g=7;break}if("proto"===h.type){r[d]=f,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=e.s[d])||(p=new Lt(e.h,e.D),e.s[d]=p),y(v,Xt(p,f,e.G),13);case 13:m=v.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),v.g=3;break;case 14:g[b]=v.h;case 3:s=l.next(),v.g=2;break;case 4:return v.return(r)}}))}function Bt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.C=Dt(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Kt(e){return e.map(Jt)}function Jt(e){var t=(e=Me(e,xt,_t)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}function zt(e){var t=this;e=e||{},this.g=new Ut({locateFile:e.locateFile,files:[{url:"holistic_solution_packed_assets_loader.js"},{simd:!1,url:"holistic_solution_wasm_bin.js"},{simd:!0,url:"holistic_solution_simd_wasm_bin.js"}],graph:{url:"holistic.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:"left_hand_landmarks right_hand_landmarks face_landmarks pose_landmarks world_landmarks segmentation_mask image_transformed multi_face_geometry".split(" "),outs:{image:{type:"texture",stream:"image_transformed"},leftHandLandmarks:{type:"proto",stream:"left_hand_landmarks",transform:Nt},rightHandLandmarks:{type:"proto",stream:"right_hand_landmarks",transform:Nt},faceLandmarks:{type:"proto",stream:"face_landmarks",transform:Nt},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:Nt},ea:{type:"proto",stream:"world_landmarks",transform:Nt},segmentationMask:{type:"texture",stream:"segmentation_mask"},multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:Kt}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,default:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i,o;return E((function(s){if(1==s.g){switch(n="",e){case 1:n="pose_landmark_full.tflite";break;case 2:n="pose_landmark_heavy.tflite";break;default:n="pose_landmark_lite.tflite"}return r="third_party/mediapipe/modules/pose_landmark/"+n,i=t.g.locateFile(n,""),y(s,fetch(i),3)}return 2!=s.g?y(s,s.h.arrayBuffer(),2):(o=s.h,t.g.overrideFile(r,o),y(s,t.g.reset(),0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},refineFaceLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineFaceLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}})}(t=Ut.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return E((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={K:o.K,L:o.L},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.K=c.onChange,o.L=e[u],r.push(function(e){return function(){return E((function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return E((function(t){return 1==t.g?y(t,Ht(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return E((function(l){if(1==l.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?l.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,y(l,Yt(e,e.g.graph.url),3)):void(l.g=2));for(2!=l.g&&(t=l.h,e.i.loadGraph(t)),n=a(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=a(e.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Bt(e,c);u=e.j,e.j={},e.setOptions(u),l.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,s;return E((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=a(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return y(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=a(e.A),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,s,c,u,l,d,h=this;return E((function(f){switch(f.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(f,h.C,2)):f.return();case 2:return y(f,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(e)),o=i.next();!o.done;o=i.next())if(s=o.value,c=h.g.inputs[s]){e:{var p=e[s];switch(c.type){case"video":var m=h.m[c.stream];if(m||(m=new Lt(h.h,h.D),h.m[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement)var g=p.videoWidth,b=p.videoHeight;else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(g=p.naturalWidth,b=p.naturalHeight):(g=p.width,b=p.height);b={glName:m.l,width:g,height:b},(g=m.g).canvas.width=b.width,g.canvas.height=b.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,p),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.m[c.stream])||(m=new Mt(h.h),h.m[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(p.length),b=0;b<p.length;++b){g=p[b];var v=m.data,w=v.setBoundingBox,S=b,T=g.T,E=new bt;if(ke(E,1,T.X),ke(E,2,T.Y),ke(E,3,T.height),ke(E,4,T.width),ke(E,5,T.rotation),ke(E,6,T.W),T=Xe(E,yt),w.call(v,S,T),g.O)for(v=0;v<g.O.length;++v){var x=!!(E=g.O[v]).visibility;S=(w=m.data).addNormalizedLandmark,T=b,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),ke(x=new ut,1,E.x),ke(x,2,E.y),ke(x,3,E.z),E.visibility&&ke(x,4,E.visibility),E=Xe(x,lt),S.call(w,T,E)}if(g.M)for(v=0;v<g.M.length;++v)S=(w=m.data).addClassification,T=b,E=g.M[v],ke(x=new tt,2,E.score),E.index&&ke(x,1,E.index),E.label&&ke(x,3,E.label),E.displayName&&ke(x,4,E.displayName),E=Xe(x,nt),S.call(w,T,E)}m=m.data;break e;default:m={}}}switch(u=m,l=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:l,timestamp:n}));break;case"detections":(d=u).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return h.i.send(r),y(f,h.C,4);case 4:r.delete(),f.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",Ut),C("OptionType",{BOOL:0,NUMBER:1,Z:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=zt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return E((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return E((function(n){return y(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("Holistic",zt),C("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),C("FACEMESH_LIPS",Ct),C("FACEMESH_LEFT_EYE",It),C("FACEMESH_LEFT_EYEBROW",Rt),C("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),C("FACEMESH_RIGHT_EYE",Zt),C("FACEMESH_RIGHT_EYEBROW",kt),C("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),C("FACEMESH_FACE_OVAL",Ot),C("FACEMESH_CONTOURS",Vt),C("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),C("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),C("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),C("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),C("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),C("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),C("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),C("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var s=0;s<t;s++){var a=1===e.getLayout()?o*t+s:s*n+o;i[o][s]=r[a]}return i})),C("VERSION","0.5.1635989137")}).call(Nt);const Lt={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.na=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={da:t,ea:!0},e.g=e.o||e.u}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ea)throw t.da;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.s):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(s){s.done?i(s.value):e.resolve(s.value).then(n,r).then(t,o)}(t.next())}))}(new T(new v(t)))}m.prototype.s=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).M(o(s.length-1),t),i=n.next()}while(!i.done)}))},t}));var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(){throw Error("Invalid UTF8")}function R(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Z,k,O=typeof TextDecoder<"u",V=typeof TextEncoder<"u",G={},A=null;function W(e){var t;void 0===t&&(t=0),L(),t=G[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function N(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=A[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}L();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function L(){if(!A){A={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));G[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===A[o]&&(A[o]=i)}}}}var X,M="function"==typeof Uint8Array;function F(e){return M&&null!=e&&e instanceof Uint8Array}function P(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var j="function"==typeof Uint8Array.prototype.slice,U=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function Y(){return Error("Failed to read varint, encoding is invalid.")}function D(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&B(this,e)}function B(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return N(e);if(e.constructor===P)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||F(t)?t:"string"==typeof t?N(t):null,(e=e.L=t)?new Uint8Array(e):X||(X=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function K(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function J(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,K(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,K(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,K(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,K(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return K(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw Y();return K(e),r}D.prototype.reset=function(){this.g=this.j};var z=[];function Q(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,z.length?(n=z.pop(),t&&(n.v=t.v),e&&B(n,e),e=n):e=new D(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=J(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(0==(128&e.h[t++])){e.g=t,K(e);break e}throw Y()}break;case 1:(e=e.g).g+=8,K(e);break;case 2:2!=e.h?te(e):(t=J(e.g)>>>0,(e=e.g).g+=t,K(e));break;case 5:(e=e.g).g+=4,K(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}Q.prototype.length=function(){return this.g.length},Q.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new Q}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function se(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ae(e){var t;return null==(t=oe?e[oe]:e.N)?0:t}function ce(e){return se(e,1),e}function ue(e){return!!Array.isArray(e)&&!!(2&ae(e))}function le(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");se(e,2)}function de(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(ce([]));function fe(e){if(ue(e.m))throw Error("Cannot mutate an immutable Message")}var pe,me=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function ge(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function be(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,r){r=void 0!==r&&r,fe(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function ve(e,t,n,r){n=void 0===n||n;var i=be(e,t,r=void 0!==r&&r);return null==i&&(i=he),ue(e.m)?n&&(le(i),Object.freeze(i)):(i===he||ue(i))&&ye(e,t,i=ce(i.slice()),r),i}function we(e,t,n){return null==(e=null==(e=be(e,t))?e:+e)?void 0===n?0:n:e}function Se(e,t,n,r){e.j||(e.j={});var i=ue(e.m),o=e.j[n];if(!o){r=ve(e,n,!0,void 0!==r&&r),o=[],i=i||ue(r);for(var s=0;s<r.length;s++)o[s]=new t(r[s]),i&&le(o[s].m);i&&(le(o),Object.freeze(o)),e.j[n]=o}return o}function Te(e,t,n,r,i){var o=void 0!==o&&o;return fe(e),o=Se(e,n,t,o),n=r||new n,e=ve(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function Ee(e,t){return null==(e=be(e,t))?0:e}function xe(e,t){return null==(e=be(e,t))?"":e}function _e(e){var t=Re;return Ie(e,t=void 0===t?Ze:t)}function Ce(e,t){if(null!=e){if(Array.isArray(e))e=Ie(e,t);else if(de(e)){var n,r={};for(n in e)r[n]=Ce(e[n],t);e=r}else e=t(e);return e}}function Ie(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=Ce(n[r],t);return Array.isArray(e)&&1&ae(e)&&ce(n),n}function Re(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(F(e))return W(e);if(e instanceof P){var t=e.L;return t=null==t||"string"==typeof t?t:M&&t instanceof Uint8Array?W(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?_e(e):e)}function Ze(e){return F(e)?new Uint8Array(e):e}function ke(e,t,n){e||(e=pe),pe=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&de(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=he;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=he}}function Oe(){ke.apply(this,arguments)}if(ke.prototype.toJSON=function(){return _e(this.m)},ke.prototype.toString=function(){return this.m.toString()},p(Oe,ke),me){var Ve={};Object.defineProperties(Oe,(Ve[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Ve))}function Ge(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],s=o.ha;s||(i.F=o.la||o.fa.P,o.aa?(i.U=Fe(o.aa),s=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.ca?(i.T=Pe(o.X.g,o.ca),s=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):s=i.F,o.ha=s),s(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ba){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ae=Symbol();function We(e,t,n){return e[Ae]||(e[Ae]=function(e,r){return t(e,r,n)})}function Ne(e){var t=e[Ae];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ae]=t}return t}function Le(e){var t=function(e){var t=e.aa;return t?Ne(t):(t=e.ka)?We(e.X.g,t,e.ca):void 0}(e),n=e.X,r=e.fa.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Xe(e,t,n,r,i,o){var s=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),s++);s<e.length;){n=e[s++];for(var a=s+1;a<e.length&&"number"!=typeof e[a];)a++;var c=e[s++];switch(a-=s){case 0:r(t,n,c);break;case 1:r(t,n,c,e[s++]);break;case 2:i(t,n,c,e[s++],e[s++]);break;case 3:a=e[s++];var u=e[s++],l=e[s++];Array.isArray(l)?i(t,n,c,a,u,l):o(t,n,c,a,u,l);break;case 4:o(t,n,c,e[s++],e[s++],e[s++],e[s++]);break;default:throw Error("unexpected number of binary field arguments: "+a)}}return t}var Me=Symbol();function Fe(e){var t=e[Me];if(!t){var n=Be(e);t=function(e,t){return nt(e,t,n)},e[Me]=t}return t}function Pe(e,t){var n=e[Me];return n||(n=function(e,n){return Ge(e,n,t)},e[Me]=n),n}var je=Symbol();function Ue(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ye(e,t,n,r,i){var o=Fe(i),s=n.P;e.push(t,(function(e,t,n){return s(e,t,n,r,o)}))}function De(e,t,n,r,i,o){var s=Pe(r,o),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,s)}))}function Be(e){return e[je]||Xe(e,e[je]=[],Ue,He,Ye,De)}var Ke=Symbol();function Je(e,t){e[0]=t}function ze(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function Qe(e,t,n,r,i,o){var s=n.O,a=Ne(i);e[t]=function(e,t,n){return s(e,t,n,r,a,o)}}function qe(e,t,n,r,i,o,s){var a=n.O,c=We(r,i,o);e[t]=function(e,t,n){return a(e,t,n,r,c,s)}}function $e(e){return e[Ke]||Xe(e,e[Ke]={},Je,ze,Qe,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=Le(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var s=i.g.h;i=o===(i=i.g.g)?X||(X=new Uint8Array(0)):j?s.slice(o,i):new Uint8Array(s.subarray(o,i)),(o=r.ba)?o.push(i):r.ba=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(B(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Ge(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,Be(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var s=t[o];e.set(s,i),i+=s.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],s=e.h[e.g+3];return e.g+=4,K(e),e=2*((i=(r<<0|i<<8|o<<16|s<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,ye(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=be(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?U=0:(0,U=2147483648):isNaN(r)?(0,U=2147483647):34028234663852886e22<r?(0,U=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,U=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,U=(n<<31|t+127<<23|8388607&r)>>>0),n=U,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),st=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,s=e=0;4>s&&128<=i;s++)i=r.h[r.g++],K(r),o|=(127&i)<<7*s;if(128<=i&&(i=r.h[r.g++],K(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)i=r.h[r.g++],K(r),e|=(127&i)<<7*s+3;if(!(128>i))throw Y();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),ye(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=be(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=U=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=it((function(e,t,n){return 0===e.h&&(ye(t,n,J(e.g)),!0)}),(function(e,t,n){if(null!=(t=be(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=J(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,K(e),e=e.h,O)(r=Z)||(r=Z=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var s,a,c,u=[],l=null;o<i;)128>(s=e[o++])?u.push(s):224>s?o>=i?I():(a=e[o++],194>s||128!=(192&a)?(o--,I()):u.push((31&s)<<6|63&a)):240>s?o>=i-1?I():128!=(192&(a=e[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=e[o++]))?(o--,I()):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?I():128!=(192&(a=e[o++]))||a-144+(s<<28)>>30!=0||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,I()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&c,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):I(),8192<=u.length&&(l=R(l,u),u.length=0);r=R(l,u)}return ye(t,n,r),!0}),(function(e,t,n){if(null!=(t=be(t,n))){var r=!1;if(r=void 0!==r&&r,V){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(k||(k=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),s=0;s<t.length;s++){var a=t.charCodeAt(s);if(128>a)o[i++]=a;else{if(2048>a)o[i++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&s<t.length){var c=t.charCodeAt(++s);if(56320<=c&&57343>=c){a=1024*(a-55296)+c-56320+65536,o[i++]=a>>18|240,o[i++]=a>>12&63|128,o[i++]=a>>6&63|128,o[i++]=63&a|128;continue}s--}if(r)throw Error("Found an unpaired surrogate");a=65533}o[i++]=a>>12|224,o[i++]=a>>6&63|128}o[i++]=63&a|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),ut=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Te(t,n,r),n=e.g.i,r=J(e.g)>>>0;var o=e.g.g+r,s=o-n;if(0>=s&&(e.g.i=o,i(t,e),s=o-e.g.g),s)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-s)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Se(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var s=o.g.end();ie(o,s),s.push(o.h),o=s,i(t[r],e),s=e;var a=o.pop();for(a=s.h+s.g.length()-a;127<a;)o.push(127&a|128),a>>>=7,s.h++;o.push(a),s.h++}}));function lt(){Oe.apply(this,arguments)}if(p(lt,Oe),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ht(e){lt.call(this,e)}function ft(){return[1,at,2,ot,3,ct,4,ct]}function pt(e){lt.call(this,e,-1,gt)}function mt(){return[1,ut,ht,ft]}p(ht,lt),p(pt,lt),pt.prototype.addClassification=function(e,t){return Te(this,1,ht,e,t),this};var gt=[1];function bt(e){lt.call(this,e)}function yt(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function vt(e){lt.call(this,e,-1,St)}function wt(){return[1,ut,bt,yt]}p(bt,lt),p(vt,lt);var St=[1];function Tt(e){lt.call(this,e)}function Et(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,st]}p(Tt,lt);var xt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],_t=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ct=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],It=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Rt=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Zt=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],kt=[].concat(c(xt),c(_t),c(Ct),c(It),c(Rt),c(Zt));function Ot(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Vt(e){return Se(e,ht,1).map((function(e){return{index:Ee(e,1),ga:we(e,2),label:null!=be(e,3)?xe(e,3):void 0,displayName:null!=be(e,4)?xe(e,4):void 0}}))}function Gt(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=be(e,4)?we(e,4):void 0}}function At(e,t){this.h=e,this.g=t,this.l=0}function Wt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=Ot(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Ot(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Nt(e){this.g=e}var Lt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Xt(e,t){return t+e}function Mt(e,t){window[e]=t}function Ft(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=e.resolve(),this.Y="",this.C={},this.locateFile=t&&t.locateFile||Xt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Pt(t){var n,r,i,o,s,a,u,l,d,h,f;return E((function(p){switch(p.g){case 1:return t.Z?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(p,E((function(e){switch(e.g){case 1:return e.o=2,y(e,WebAssembly.instantiate(Lt),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(r=p.h,"object"==typeof window)return Mt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Mt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=n.filter((function(e){return void 0!==e.data})),u=n.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(n){var r=jt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),d=e.all(u.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.$)):e.resolve()}))).then((function(){var e,n,r;return E((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0}))})),h=E((function(e){return t.g.graph&&t.g.graph.url?e=y(e,jt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(p,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.$)})),importScripts.apply(null,c(i)),o=t,y(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,s=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ja:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(s),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(f=t.l.getContext("webgl2",{}))&&!(f=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.G=f,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.Z=!1,p.g=0}}))}function jt(e,t){var n,r;return E((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function Ut(e,t,n){var r,i,o,s,c,u,l,d,h,f,p,m,g,b;return E((function(v){switch(v.g){case 1:if(!n)return v.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(e.I=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){v.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(v,function(e,t,n){var r;return E((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new At(e.h,e.G),e.u[t]=r),i.return(Wt(r,n,e.I))):i.return(void 0)}))}(e,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=tt(w.get(_),Tt,Et);C={boundingBox:{xCenter:we(C,1),yCenter:we(C,2),height:we(C,3),width:we(C,4),rotation:we(C,5,0),rectId:Ee(C,6)},landmarks:Se(tt(S.get(_),vt,wt),bt,1).map(Gt),V:Vt(tt(T.get(_),pt,mt))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===f){v.g=3;break}if("float_list"===h.type){r[d]=f,v.g=7;break}if("proto"===h.type){r[d]=f,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=e.u[d])||(p=new At(e.h,e.G),e.u[d]=p),y(v,Wt(p,f,e.I),13);case 13:m=v.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),v.g=3;break;case 14:g[b]=v.h;case 3:s=l.next(),v.g=2;break;case 4:return v.return(r)}}))}function Ht(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.D=Ut(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Yt(e){var t=this;e=e||{};var n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Ft({locateFile:e.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(e){var i,o,s,c,u;return E((function(l){switch(l.g){case 1:i=a("short"===e?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),o=i.next();case 2:if(o.done){l.g=4;break}return s=o.value,c="third_party/mediapipe/modules/face_detection/"+s,y(l,jt(t.g,s),5);case 5:u=l.h,t.g.overrideFile(c,u),o=i.next(),l.g=2;break;case 4:return n.url="short"===e?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===e?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",l.return(!0)}}))}},minDetectionConfidence:r}})}(t=Ft.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return E((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={R:o.R,S:o.S},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.R=c.onChange,o.S=e[u],r.push(function(e){return function(){return E((function(t){if(1==t.g)return y(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return E((function(t){return 1==t.g?y(t,Pt(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return E((function(l){if(1==l.g)return e.g.graph&&e.g.graph.url&&e.Y===e.g.graph.url?l.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Y=e.g.graph.url,y(l,jt(e,e.g.graph.url),3)):void(l.g=2));for(2!=l.g&&(t=l.h,e.i.loadGraph(t)),n=a(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=a(e.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Ht(e,c);u=e.j,e.j={},e.setOptions(u),l.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,s;return E((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=a(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return y(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=a(e.B),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,s,c,u,l,d,h=this;return E((function(f){switch(f.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(f,h.D,2)):f.return();case 2:return y(f,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(e)),o=i.next();!o.done;o=i.next())if(s=o.value,c=h.g.inputs[s]){e:{var p=e[s];switch(c.type){case"video":var m=h.o[c.stream];if(m||(m=new At(h.h,h.G),h.o[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement)var g=p.videoWidth,b=p.videoHeight;else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(g=p.naturalWidth,b=p.naturalHeight):(g=p.width,b=p.height);b={glName:m.l,width:g,height:b},(g=m.g).canvas.width=b.width,g.canvas.height=b.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,p),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.o[c.stream])||(m=new Nt(h.h),h.o[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(p.length),b=0;b<p.length;++b){g=p[b];var v=m.data,w=v.setBoundingBox,S=b,T=g.boundingBox,E=new Tt;if(ye(E,1,T.xCenter),ye(E,2,T.yCenter),ye(E,3,T.height),ye(E,4,T.width),ye(E,5,T.rotation),ye(E,6,T.rectId),T=rt(E,Et),w.call(v,S,T),g.landmarks)for(v=0;v<g.landmarks.length;++v){var x=!!(E=g.landmarks[v]).visibility;S=(w=m.data).addNormalizedLandmark,T=b,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),ye(x=new bt,1,E.x),ye(x,2,E.y),ye(x,3,E.z),E.visibility&&ye(x,4,E.visibility),E=rt(x,yt),S.call(w,T,E)}if(g.V)for(v=0;v<g.V.length;++v)S=(w=m.data).addClassification,T=b,E=g.V[v],ye(x=new ht,2,E.ga),E.index&&ye(x,1,E.index),E.label&&ye(x,3,E.label),E.displayName&&ye(x,4,E.displayName),E=rt(x,ft),S.call(w,T,E)}m=m.data;break e;default:m={}}}switch(u=m,l=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:l,timestamp:n}));break;case"detections":(d=u).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return h.i.send(r),y(f,h.D,4);case 4:r.delete(),f.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",Ft),C("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Yt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return E((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return E((function(n){return y(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("FaceDetection",Yt),C("FACEDETECTION_LIPS",xt),C("FACEDETECTION_LEFT_EYE",_t),C("FACEDETECTION_LEFT_EYEBROW",Ct),C("FACEDETECTION_RIGHT_EYE",It),C("FACEDETECTION_RIGHT_EYEBROW",Rt),C("FACEDETECTION_FACE_OVAL",Zt),C("FACEDETECTION_CONTOURS",kt),C("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),C("VERSION","0.4.1646425229")}).call(Lt);const Xt={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(e,t){return t=new T(new v(t)),f&&e.prototype&&f(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).J(o(s.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var R,Z,k=typeof TextDecoder<"u",O=typeof TextEncoder<"u";function V(e){if(O)e=(Z||(Z=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var s=e.charCodeAt(++i);if(56320<=s&&57343>=s){o=1024*(o-55296)+s-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var G={},A=null;function W(e,t){void 0===t&&(t=0),L(),t=G[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function N(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=A[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}L();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function L(){if(!A){A={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));G[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===A[o]&&(A[o]=i)}}}}var X,M="function"==typeof Uint8Array.prototype.slice;function F(e,t,n){return t===n?X||(X=new Uint8Array(0)):M?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var P=0;function j(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=t,e&&U(this,e)}function U(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?N(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.l=0,e.j=e.h.length,e.g=e.l}function H(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.m=!0}j.prototype.reset=function(){this.g=this.l},j.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},j.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var Y=[];function D(){this.g=new Uint8Array(64),this.h=0}function B(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function K(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,Y.length?(n=Y.pop(),t&&(n.v=t.v),e&&U(n,e),e=n):e=new j(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function J(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function z(e,t,n){var r=e.g.j,i=e.g.i(),o=e.g.g+i;if(e.g.j=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.j=r,t}function Q(e){return e.g.o()}function q(e){var t,n=e.g.i(),r=(e=e.g).g;if(e.g+=n,e=e.h,k)(t=R)||(t=R=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,s,a=[],c=null;r<n;)128>(i=e[r++])?a.push(i):224>i?r>=n?a.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,a.push(65533)):a.push((31&i)<<6|63&o)):240>i?r>=n-1?a.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,a.push(65533)):a.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?a.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30!=0||128!=(192&(t=e[r++]))||128!=(192&(s=e[r++]))?(r--,a.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&s,i-=65536,a.push(55296+(i>>10&1023),56320+(1023&i))):a.push(65533),8192<=a.length&&(c=I(c,a),a.length=0);t=I(c,a)}return t}function $(e,t,n){var r=e.g.i();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}function ee(e,t){2==e.h?$(e,j.prototype.o,t):t.push(Q(e))}function te(){this.h=[],this.i=0,this.g=new D}function ne(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var s=n[o];0!==s.length&&(t.set(s,i),i+=s.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ie(e,t,n){if(null!=n){B(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?P=0:(0,P=2147483648):isNaN(r)?(0,P=2147483647):34028234663852886e22<r?(0,P=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,P=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,P=(n<<31|t+127<<23|8388607&r)>>>0),n=P,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}D.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},D.prototype.length=function(){return this.h},D.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,F(e,0,t)},K.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var oe="function"==typeof Uint8Array;function se(e,t,n){if(null!=e)return"object"==typeof e?oe&&e instanceof Uint8Array?n(e):ae(e,t,n):t(e)}function ae(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=se(e[i],t,n);return Array.isArray(e)&&e.W&&de(r),r}for(i in r={},e)r[i]=se(e[i],t,n);return r}function ce(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ue,le={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,le),e}function he(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,!r||(null===(r=this.h[e])||"object"!=typeof r||Array.isArray(r)||oe&&r instanceof Uint8Array)?void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE:(this.l=e-this.j,this.i=r),n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?de(r):this.h[e]=fe):(pe(this),(r=this.i[e])?de(r):this.i[e]=fe)}var fe=Object.freeze(de([]));function pe(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function me(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ge(e,t){var n=void 0!==n&&n,r=me(e,t,n);return null==r&&(r=fe),r===fe&&we(e,t,r=de([]),n),r}function be(e){var t=ge(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function ye(e,t,n){return null==(e=me(e,t))?n:e}function ve(e,t,n){return null==(e=null==(e=me(e,t))?e:+e)?void 0===n?0:n:e}function we(e,t,n,r){void 0!==r&&r||t>=e.l?(pe(e),e.i[t]=n):e.h[t+e.j]=n}function Se(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var r=me(e,n,!1);r&&(e.g[n]=new t(r))}return e.g[n]}function Te(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var r=ge(e,1);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.g[1]=n}return n}function Ee(e,t,n){var r=void 0!==r&&r;e.g||(e.g={});var i=n&&_e(n);e.g[t]=n,we(e,t,i,r)}function xe(e,t,n,r){var i=Te(e,n);t=t||new n,e=ge(e,1),null!=r?(i.splice(r,0,t),e.splice(r,0,_e(t))):(i.push(t),e.push(_e(t)))}function _e(e,t){if(e.g)for(var n in e.g){var r=e.g[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&_e(r[i]);else r&&_e(r)}return e.h}function Ce(e,t){if(e=e.o){ne(t,t.g.end());for(var n=0;n<e.length;n++)ne(t,e[n])}}function Ie(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=t.g.i();(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!J(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=F(t.g.h,n,t.g.g),(n=e.o)?n.push(t):e.o=[t]),!0}function Re(e){he.call(this,e,-1,ke)}function Ze(e,t){for(;J(t);)switch(t.i){case 8:var n=t.g.i();we(e,1,n);break;case 16:we(e,2,n=t.g.i());break;case 29:case 26:ee(t,e.getPackedDataList());break;case 32:we(e,4,n=H(t.g));break;default:if(!Ie(e,t))return e}return e}he.prototype.toJSON=function(){return ae(_e(this),ce,W)},he.prototype.toString=function(){return _e(this).toString()},p(Re,he),Re.prototype.getRows=function(){return me(this,1)},Re.prototype.getCols=function(){return me(this,2)},Re.prototype.getPackedDataList=function(){return be(this)},Re.prototype.getLayout=function(){return ye(this,4,0)};var ke=[3];function Oe(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{a(n.next(e))}catch(e){i(e)}}function s(e){try{a(n.throw(e))}catch(e){i(e)}}function a(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,s)}a((n=n.apply(t,void 0)).next())}))}function Ve(e){he.call(this,e)}function Ge(e,t){for(;J(t);)switch(t.i){case 8:var n=t.g.i();we(e,1,n);break;case 21:we(e,2,n=Q(t));break;case 26:we(e,3,n=q(t));break;case 34:we(e,4,n=q(t));break;default:if(!Ie(e,t))return e}return e}function Ae(e){he.call(this,e,-1,We)}p(Ve,he),p(Ae,he),Ae.prototype.addClassification=function(e,t){return xe(this,e,Ve,t),this};var We=[1];function Ne(e){he.call(this,e)}function Le(e,t){for(;J(t);)switch(t.i){case 13:var n=Q(t);we(e,1,n);break;case 21:we(e,2,n=Q(t));break;case 29:we(e,3,n=Q(t));break;case 37:we(e,4,n=Q(t));break;case 45:we(e,5,n=Q(t));break;default:if(!Ie(e,t))return e}return e}function Xe(e){he.call(this,e,-1,Fe)}function Me(e){e:{var t=new Xe;for(e=new K(e);J(e);)switch(e.i){case 10:xe(t,z(e,new Ne,Le),Ne,void 0);break;default:if(!Ie(t,e))break e}}return t}p(Ne,he),p(Xe,he);var Fe=[1];function Pe(e){he.call(this,e)}function je(e){he.call(this,e,-1,He)}function Ue(e,t){for(;J(t);)switch(t.i){case 8:var n=H(t.g);we(e,1,n);break;case 16:we(e,2,n=H(t.g));break;case 29:case 26:ee(t,e.getVertexBufferList());break;case 32:case 34:n=t;var r=e.getIndexBufferList();2==n.h?$(n,j.prototype.i,r):r.push(n.g.i());break;default:if(!Ie(e,t))return e}return e}p(Pe,he),p(je,he),je.prototype.getVertexType=function(){return ye(this,1,0)},je.prototype.getPrimitiveType=function(){return ye(this,2,0)},je.prototype.getVertexBufferList=function(){return be(this)},je.prototype.getIndexBufferList=function(){return ge(this,4)};var He=[3,4];function Ye(e){he.call(this,e)}function De(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Be(e){return Te(e,Ve).map((function(e){return{index:ye(e,1,0),Y:ve(e,2),label:null!=me(e,3)?ye(e,3,""):void 0,displayName:null!=me(e,4)?ye(e,4,""):void 0}}))}function Ke(e){return{x:ve(e,1),y:ve(e,2),z:ve(e,3),visibility:null!=me(e,4)?ve(e,4):void 0}}function Je(e,t){this.h=e,this.g=t,this.l=0}function ze(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=De(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=De(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Qe(e){this.g=e}p(Ye,he),Ye.prototype.getMesh=function(){return Se(this,je,1)},Ye.prototype.getPoseTransformMatrix=function(){return Se(this,Re,2)};var qe=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function $e(e,t){return t+e}function et(e,t){window[e]=t}function tt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||$e,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function nt(t){return Oe(t,(function t(){var n,r,i,o,s,a,u,l,d,h,f,p=this;return E(t,(function(t){switch(t.g){case 1:return n=p,p.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(p,p.j),y(t,function(){return Oe(this,(function e(){return E(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(qe),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return et("createMediapipeSolutionsWasm",{locateFile:p.locateFile}),et("createMediapipeSolutionsPackedAssets",{locateFile:p.locateFile}),a=r.filter((function(e){return void 0!==e.data})),u=r.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(t){var r=rt(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),d=e.all(u.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return Oe(n,(function e(){var t,n,r=this;return E(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,y(e,t(n),2);r.h=e.h,e.g=0}))}))})),h=Oe(n,(function e(){var t=this;return E(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,rt(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(t,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),y(t,createMediapipeSolutionsWasm(Module),6);case 6:p.h=t.h,p.l=new OffscreenCanvas(1,1),p.h.canvas=p.l,s=p.h.GL.createContext(p.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),p.h.GL.makeContextCurrent(s),t.g=4;break;case 7:if(p.l=document.createElement("canvas"),!(f=p.l.getContext("webgl2",{}))&&!(f=p.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();p.D=f,p.h.canvas=p.l,p.h.createContext(p.l,!0,!0,{});case 4:p.i=new p.h.SolutionWasm,p.R=!1,t.g=0}}))}))}function rt(e,t){return Oe(e,(function e(){var n,r,i=this;return E(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function it(e,t,n){return Oe(e,(function e(){var r,i,o,s,c,u,l,d,h,f,p,m,g,b,v=this;return E(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(v.G=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){e.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(e,function(e,t,n){return Oe(e,(function e(){var r,i=this;return E(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new Je(i.h,i.D),i.s[t]=r),e.return(ze(r,n,i.G))):e.return(void 0)}))}))}(v,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=w.get(_);e:{var I=new Pe;for(C=new K(C);J(C);)switch(C.i){case 13:var R=Q(C);we(I,1,R);break;case 21:we(I,2,R=Q(C));break;case 29:we(I,3,R=Q(C));break;case 37:we(I,4,R=Q(C));break;case 45:we(I,5,R=Q(C));break;case 48:we(I,6,R=H(C.g));break;default:if(!Ie(I,C))break e}}I={Z:ve(I,1),$:ve(I,2),height:ve(I,3),width:ve(I,4),rotation:ve(I,5,0),X:ye(I,6,0)},C=Te(Me(S.get(_)),Ne).map(Ke);var Z=T.get(_);e:for(R=new Ae,Z=new K(Z);J(Z);)switch(Z.i){case 10:R.addClassification(z(Z,new Ve,Ge));break;default:if(!Ie(R,Z))break e}I={T:I,O:C,M:Be(R)},x.push(I)}w=x}else w=[];r[d]=w,e.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,e.g=7;break}if(void 0===f){e.g=3;break}if("float_list"===h.type){r[d]=f,e.g=7;break}if("proto"===h.type){r[d]=f,e.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=v.s[d])||(p=new Je(v.h,v.D),v.s[d]=p),y(e,ze(p,f,v.G),13);case 13:m=e.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),e.g=3;break;case 14:g[b]=e.h;case 3:s=l.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ot(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.C=it(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function st(e){var t=(e=function(e){e:{var t=new Ye;for(e=new K(e);J(e);)switch(e.i){case 10:var n=z(e,new je,Ue);Ee(t,1,n);break;case 18:Ee(t,2,n=z(e,new Re,Ze));break;default:if(!Ie(t,e))break e}}return t}(e)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}(t=tt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return Oe(this,(function e(){var t=this;return E(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={K:o.K,L:o.L},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.K=c.onChange,o.L=e[u],r.push(function(e){return function(){return Oe(n,(function t(){var n=this;return E(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return Oe(this,(function e(){var t=this;return E(e,(function(e){return 1==e.g?y(e,nt(t),2):3!=e.g?y(e,function(e){return Oe(e,(function e(){var t,n,r,i,o,s,c,u,l=this;return E(e,(function(e){if(1==e.g)return l.g.graph&&l.g.graph.url&&l.P===l.g.graph.url?e.return():(l.o=!0,l.g.graph&&l.g.graph.url?(l.P=l.g.graph.url,y(e,rt(l,l.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,l.i.loadGraph(t)),n=a(Object.keys(l.B)),r=n.next();!r.done;r=n.next())i=r.value,l.i.overrideFile(i,l.B[i]);if(l.B={},l.g.listeners)for(o=a(l.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,ot(l,c);u=l.j,l.j={},l.setOptions(u),e.g=0}))}))}(t),3):y(e,function(e){return Oe(e,(function e(){var t,n,r,i,o,s,c=this;return E(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=a(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return y(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=a(c.A),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return Oe(this,(function n(){var r,i,o,s,c,u,l,d,h,f=this;return E(n,(function(n){switch(n.g){case 1:return f.g.inputs?(r=1e3*(null==t?performance.now():t),y(n,f.C,2)):n.return();case 2:return y(n,f.initialize(),3);case 3:for(i=new f.h.PacketDataList,o=a(Object.keys(e)),s=o.next();!s.done;s=o.next())if(c=s.value,u=f.g.inputs[c]){e:{var p=f,m=e[c];switch(u.type){case"video":var g=p.m[u.stream];if(g||(g=new Je(p.h,p.D),p.m[u.stream]=g),0===(p=g).l&&(p.l=p.h.createTexture()),typeof HTMLVideoElement<"u"&&m instanceof HTMLVideoElement){var b=m.videoWidth;g=m.videoHeight}else typeof HTMLImageElement<"u"&&m instanceof HTMLImageElement?(b=m.naturalWidth,g=m.naturalHeight):(b=m.width,g=m.height);g={glName:p.l,width:b,height:g},(b=p.g).canvas.width=g.width,b.canvas.height=g.height,b.activeTexture(b.TEXTURE0),p.h.bindTexture2d(p.l),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,m),p.h.bindTexture2d(0),p=g;break e;case"detections":for((g=p.m[u.stream])||(g=new Qe(p.h),p.m[u.stream]=g),(p=g).data||(p.data=new p.g.DetectionListData),p.data.reset(m.length),g=0;g<m.length;++g){b=m[g];var v=p.data,w=v.setBoundingBox,S=g,T=b.T,E=new Pe;we(E,1,T.Z),we(E,2,T.$),we(E,3,T.height),we(E,4,T.width),we(E,5,T.rotation),we(E,6,T.X);var x=T=new te;ie(x,1,me(E,1)),ie(x,2,me(E,2)),ie(x,3,me(E,3)),ie(x,4,me(E,4)),ie(x,5,me(E,5));var _=me(E,6);if(null!=_&&null!=_){B(x.g,48);var C=x.g,I=_;_=0>I;var R=(I=Math.abs(I))>>>0;for(I=Math.floor((I-R)/4294967296),I>>>=0,_&&(I=~I>>>0,4294967295<(R=1+(~R>>>0))&&(R=0,4294967295<++I&&(I=0))),_=P=R,R=I;0<R||127<_;)C.push(127&_|128),_=(_>>>7|R<<25)>>>0,R>>>=7;C.push(_)}if(Ce(E,x),T=re(T),w.call(v,S,T),b.O)for(v=0;v<b.O.length;++v)x=!!(E=b.O[v]).visibility,S=(w=p.data).addNormalizedLandmark,T=g,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),we(x=new Ne,1,E.x),we(x,2,E.y),we(x,3,E.z),E.visibility&&we(x,4,E.visibility),ie(C=E=new te,1,me(x,1)),ie(C,2,me(x,2)),ie(C,3,me(x,3)),ie(C,4,me(x,4)),ie(C,5,me(x,5)),Ce(x,C),E=re(E),S.call(w,T,E);if(b.M)for(v=0;v<b.M.length;++v){if(S=(w=p.data).addClassification,T=g,E=b.M[v],we(x=new Ve,2,E.Y),E.index&&we(x,1,E.index),E.label&&we(x,3,E.label),E.displayName&&we(x,4,E.displayName),C=E=new te,null!=(R=me(x,1))&&null!=R)if(B(C.g,8),_=C.g,0<=R)B(_,R);else{for(I=0;9>I;I++)_.push(127&R|128),R>>=7;_.push(1)}ie(C,2,me(x,2)),null!=(_=me(x,3))&&(_=V(_),B(C.g,26),B(C.g,_.length),ne(C,C.g.end()),ne(C,_)),null!=(_=me(x,4))&&(_=V(_),B(C.g,34),B(C.g,_.length),ne(C,C.g.end()),ne(C,_)),Ce(x,C),E=re(E),S.call(w,T,E)}}p=p.data;break e;default:p={}}}switch(l=p,d=u.stream,u.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},l),{stream:d,timestamp:r}));break;case"detections":(h=l).stream=d,h.timestamp=r,i.pushDetectionList(h);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return f.i.send(i),y(n,f.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",tt),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var at={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(st)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Te(Me(e),Ne).map(Ke)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ut=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],lt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],ht=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ft=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],pt=[].concat(c(ct),c(ut),c(lt),c(dt),c(ht),c(ft));function mt(e){e=e||{},e=Object.assign(Object.assign({},at),e),this.g=new tt(e)}(t=mt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return Oe(this,(function e(){var t=this;return E(e,(function(e){return y(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Oe(this,(function t(){var n=this;return E(t,(function(t){return y(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},C("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),C("FaceMesh",mt),C("FACEMESH_LIPS",ct),C("FACEMESH_LEFT_EYE",ut),C("FACEMESH_LEFT_EYEBROW",lt),C("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),C("FACEMESH_RIGHT_EYE",dt),C("FACEMESH_RIGHT_EYEBROW",ht),C("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),C("FACEMESH_FACE_OVAL",ft),C("FACEMESH_CONTOURS",pt),C("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),C("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var s=0;s<t;s++){var a=1===e.getLayout()?o*t+s:s*n+o;i[o][s]=r[a]}return i})),C("VERSION","0.4.1633559619")}).call(Xt);const Mt={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ka=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={V:t,X:!0},e.g=e.m||e.s}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.X)throw t.V;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(s){s.done?i(s.value):e.resolve(s.value).then(n,r).then(t,o)}(t.next())}))}(new T(new v(t)))}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.G(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.m(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.H(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.F(),this.B()},t.prototype.F=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.G=function(e){var t=this.j();e.K(t.resolve,t.reject)},t.prototype.H=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.K(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.K=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).K(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).K(o(s.length-1),t),i=n.next()}while(!i.done)}))},t}));var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(e){throw e}function R(e,t){I(Error("Invalid wire type: "+e+" (at position "+t+")"))}function Z(){I(Error("Failed to read varint, encoding is invalid."))}function k(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var O,V,G=typeof TextDecoder<"u",A=typeof TextEncoder<"u";function W(e){if(A)e=(V||(V=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var s=e.charCodeAt(++i);if(56320<=s&&57343>=s){o=1024*(o-55296)+s-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var N={},L=null;function X(e){var t;void 0===t&&(t=0),F(),t=N[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function M(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=L[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}F();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function F(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));N[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===L[o]&&(L[o]=i)}}}}var P,j="function"==typeof Uint8Array;function U(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var H="function"==typeof Uint8Array.prototype.slice;function Y(e,t,n){return t===n?P||(P=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function B(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.v=t,e&&K(this,e)}function K(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return M(e);if(e.constructor===U){if(null==e.g)var t=P||(P=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||j&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?M(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function J(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.j=!0,Z()}function z(e){e.g>e.i&&(e.j=!0,I(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function Q(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,z(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,z(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,z(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,z(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,z(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,Z(),r):(z(e),r))))))}function q(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,z(e),(t<<0|n<<8|r<<16|i<<24)>>>0}B.prototype.reset=function(){this.g=this.l},B.prototype.m=function(){var e=q(this),t=2*(e>>31)+1,n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))};var $=[];function ee(){this.g=new Uint8Array(64),this.h=0}function te(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ne(e,t){for(;127<t;)te(e,127&t|128),t>>>=7;te(e,t)}function re(e){var t={},n=void 0!==t.O&&t.O;this.m={v:void 0!==t.v&&t.v},this.O=n,t=this.m,$.length?(n=$.pop(),t&&(n.v=t.v),e&&K(n,e),e=n):e=new B(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ie(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=Q(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,R(n,e.l),!1)}function oe(e){switch(e.h){case 0:if(0!=e.h)oe(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(0==(128&e.h[t])){e.g=t+1,z(e);break e}t++}e.j=!0,Z()}break;case 1:(e=e.g).g+=8,z(e);break;case 2:2!=e.h?oe(e):(t=Q(e.g),(e=e.g).g+=t,z(e));break;case 5:(e=e.g).g+=4,z(e);break;case 3:for(t=e.i;;){if(!ie(e)){e.j=!0,I(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,I(Error("Unmatched end-group tag")));break}oe(e)}break;default:e.j=!0,R(e.h,e.l)}}function se(e,t,n){var r=e.g.i,i=Q(e.g),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}ee.prototype.length=function(){return this.h},ee.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,Y(e,0,t)},re.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var ae=[];function ce(){this.h=[],this.i=0,this.g=new ee}function ue(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function le(e,t,n){ne(e.g,8*t+2),ne(e.g,n.length),ue(e,e.g.end()),ue(e,n)}var de,he="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function fe(e){return Object.isFrozen(e)||(he?e[he]|=1:void 0!==e.g?e.g|=1:Object.defineProperties(e,{g:{value:1,configurable:!0,writable:!0,enumerable:!1}})),e}function pe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function me(e,t){if(null!=e)return Array.isArray(e)||pe(e)?ge(e,t):t(e)}function ge(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=me(e[r],t);var i;if(t=Array.isArray(e))t=1&(null==(i=he?e[he]:e.g)?0:i);return t&&fe(n),n}for(n in i={},e)i[n]=me(e[n],t);return i}function be(e){return e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(j&&null!=e&&e instanceof Uint8Array)return X(e);if(e instanceof U){if(null==e.g)e="";else{var t=e.g;t=null==t||"string"==typeof t?t:j&&t instanceof Uint8Array?X(t):null,e=e.g=t}return e}}return e}(e),Array.isArray(e)?ge(e,be):e}function ye(e,t,n){var r=de;if(de=null,e||(e=r),r=this.constructor.ha,e||(e=r?[r]:[]),this.i=(r?0:-1)-(this.constructor.fa||0),this.l=this.g=null,this.u=e,e=(r=this.u.length)-1,r&&pe(r=this.u[e])?(this.j=e-this.i,this.h=r):void 0!==t&&-1<t?(this.j=Math.max(t,e+1-this.i),this.h=null):this.j=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.j?(e+=this.i,(r=this.u[e])?Array.isArray(r)&&fe(r):this.u[e]=ve):(we(this),(r=this.h[e])?Array.isArray(r)&&fe(r):this.h[e]=ve)}var ve=Object.freeze(fe([]));function we(e){var t=e.j+e.i;e.u[t]||(e.h=e.u[t]={})}function Se(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.j?e.h?e.h[t]:void 0:e.u[t+e.i]}function Te(e,t,n){var r=Se(e,t,n=void 0!==n&&n);return null==r&&(r=ve),r===ve&&_e(e,t,r=fe(r.slice()),n),r}function Ee(e,t){var n=Te(e,t);if(e.l||(e.l={}),!e.l[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.l[t]=!0}return n}function xe(e,t,n){return null==(e=null==(e=Se(e,t))?e:+e)?void 0===n?0:n:e}function _e(e,t,n,r){void 0!==r&&r||t>=e.j?(we(e),e.h[t]=n):e.u[t+e.i]=n}function Ce(e,t,n,r){n!==r?_e(e,t,n):_e(e,t,void 0,!1)}function Ie(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=Se(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function Re(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=Te(e,n,!1);r=[];for(var o=0;o<i.length;o++)r[o]=new t(i[o]);e.g[n]=r}return r}function Ze(e,t,n,r,i){var o=Re(e,r,t);n=n||new r,e=Te(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.u)):(o.push(n),e.push(n.u))}function ke(e,t){return null==(e=Se(e,t))?0:e}function Oe(e,t){return null==(e=Se(e,t))?"":e}function Ve(e,t){if(e=e.m){ue(t,t.g.end());for(var n=0;n<e.length;n++)ue(t,e[n])}}ye.prototype.toJSON=function(){return ge(this.u,be)},ye.prototype.toString=function(){return this.u.toString()};var Ge=Symbol();function Ae(e,t,n){return e[Ge]||(e[Ge]=function(e,r){return t(e,r,n)})}function We(e){var t=e[Ge];if(!t){var n=e[Xe]||(e[Xe]=e());t=function(e,t){return Me(e,t,n)},e[Ge]=t}return t}function Ne(e){var t=function(e){var t=e.da;if(t)return We(t);if(t=e.ia){var n=e.Y;return delete e.Y,Ae(e.W.g,t,n)}}(e),n=e.W,r=e.ea;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Le(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=We(e[2]);return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],s=e[3],a=We(e[2]);return function(e,n,r){return t(e,n,r,o,a,s)};case 5:var c=e[1],u=Ae(c,e[3],e[4]);return function(e,n,r){return t(e,n,r,c,u)};case 6:var l=e[1],d=e[5],h=Ae(l,e[3],e[4]);return function(e,n,r){return t(e,n,r,l,h,d)};default:throw Error("Unsupported number of parameters, expected [2-6], got "+e.length)}}var Xe=Symbol();function Me(e,t,n){for(;ie(t)&&4!=t.h;){var r=t.i,i=n[r];if(i)Array.isArray(i)&&(i=n[r]=Le(i));else{var o=n[0];o&&(o=o[r])&&(i=n[r]=Ne(o))}i&&i(t,e,r)||(r=e,o=(i=t).l,oe(i),i.O||(i=Y(i.g.h,o,i.g.g),(o=r.m)?o.push(i):r.m=[i]))}return e}function Fe(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var s=r[o];0!==s.length&&(e.set(s,t),t+=s.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function Pe(e,t,n){if(ae.length){var r=ae.pop();e&&(K(r.g,e),r.i=-1,r.h=-1),e=r}else e=new re(e);try{return Me(new t,e,n[Xe]||(n[Xe]=n()))}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.v=!1,e.i=-1,e.h=-1,e.j=!1,100>ae.length&&ae.push(e)}}function je(e,t,n){if(null!=(t=Se(t,n))){ne(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,D=(n<<31|t+127<<23|8388607&r)>>>0),te(e,(n=D)>>>0&255),te(e,n>>>8&255),te(e,n>>>16&255),te(e,n>>>24&255)}}function Ue(e,t,n){if(1!==e.h)return!1;var r=e.g;e=q(r);var i=q(r);r=2*(i>>31)+1;var o=i>>>20&2047;return e=4294967296*(1048575&i)+e,Ce(t,n,2047==o?e?NaN:1/0*r:0==o?r*Math.pow(2,-1074)*e:r*Math.pow(2,o-1075)*(e+4503599627370496),0),!0}function He(e,t,n){return 5===e.h&&(_e(t,n,e.g.m()),!0)}function Ye(e,t,n){if(5!==e.h&&2!==e.h)return!1;if(t=Te(t,n),2==e.h){n=B.prototype.m;var r=Q(e.g);for(r=e.g.g+r;e.g.g<r;)t.push(n.call(e.g))}else t.push(e.g.m());return!0}function De(e,t,n){return 5===e.h&&(Ce(t,n,e=e.g.m(),0),!0)}function Be(e,t,n){return 0===e.h&&(_e(t,n,J(e.g)),!0)}function Ke(e,t,n){return 0===e.h&&(_e(t,n,Q(e.g)),!0)}function Je(e,t,n){return 0===e.h&&(Ce(t,n,e=Q(e.g),0),!0)}function ze(e,t,n){return 0===e.h&&(Ce(t,n,e=!!Q(e.g),!1),!0)}function Qe(e,t,n){if(2!==e.h)return!1;var r,i=Q(e.g),o=(e=e.g).g;if(e.g+=i,z(e),e=e.h,G)(r=O)||(r=O=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var s,a,c,u=[],l=null;o<i;)128>(s=e[o++])?u.push(s):224>s?o>=i?u.push(65533):(a=e[o++],194>s||128!=(192&a)?(o--,u.push(65533)):u.push((31&s)<<6|63&a)):240>s?o>=i-1?u.push(65533):128!=(192&(a=e[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=e[o++]))?(o--,u.push(65533)):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?u.push(65533):128!=(192&(a=e[o++]))||a-144+(s<<28)>>30!=0||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,u.push(65533)):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&c,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):u.push(65533),8192<=u.length&&(l=k(l,u),u.length=0);r=k(l,u)}return _e(t,n,r),!0}function qe(e,t,n,r,i){return 2===e.h&&(e=se(e,new r,i),t.g||(t.g={}),r=e&&e.u,t.g[n]=e,_e(t,n,r,!1),!0)}function $e(e,t,n,r,i){return 2===e.h&&(Ze(t,n,e=se(e,new r,i),r,void 0),!0)}function et(e,t,n){return 0===e.h&&(_e(t,n,J(e.g)),!0)}function tt(e){ye.call(this,e)}function nt(){return{1:Ke,2:He,3:Qe,4:Qe}}function rt(e,t){var n=Se(e,1);if(null!=n&&null!=n){ne(t.g,8);var r=t.g;if(0<=n)ne(r,n);else{for(var i=0;9>i;i++)te(r,127&n|128),n>>=7;te(r,1)}}je(t,e,2),null!=(r=Se(e,3))&&le(t,3,W(r)),null!=(r=Se(e,4))&&le(t,4,W(r)),Ve(e,t)}function it(e){ye.call(this,e,-1,st)}function ot(){return{1:[$e,tt,nt]}}p(tt,ye),p(it,ye),it.prototype.addClassification=function(e,t){return Ze(this,1,e,tt,t),this};var st=[1];function at(e){ye.call(this,e)}function ct(){return{1:He,2:He,3:He,4:He,5:He}}function ut(e,t){je(t,e,1),je(t,e,2),je(t,e,3),je(t,e,4),je(t,e,5),Ve(e,t)}function lt(e){ye.call(this,e,-1,ht)}function dt(){return{1:[$e,at,ct]}}p(at,ye),p(lt,ye);var ht=[1];function ft(e){ye.call(this,e)}function pt(){return{1:He,2:He,3:He,4:He,5:He,6:Be}}function mt(e,t){je(t,e,1),je(t,e,2),je(t,e,3),je(t,e,4),je(t,e,5);var n=Se(e,6);if(null!=n&&null!=n){ne(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=D=o,o=i;0<o||127<n;)te(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;te(r,n)}Ve(e,t)}function gt(e){ye.call(this,e,-1,wt)}function bt(){return{1:et,2:et,3:Ye,4:[qe,yt,vt],5:Ke,6:Ke,7:Ye,8:Ye,9:Ye}}function yt(e){ye.call(this,e)}function vt(){return{1:He,2:He,3:He}}p(ft,ye),p(gt,ye),p(yt,ye);var wt=[3,7,8,9];function St(e){ye.call(this,e)}function Tt(){return{1:De,2:De,3:De}}function Et(e){ye.call(this,e)}function xt(){return{1:De,2:De,3:De}}function _t(e){ye.call(this,e)}function Ct(){return{1:Je,2:[qe,Et,xt],3:[qe,St,Tt],4:ze}}function It(e){ye.call(this,e,-1,Zt)}function Rt(){return{1:Je,2:[$e,_t,Ct],3:De,4:Ye,5:Ye,6:Ye}}p(St,ye),p(Et,ye),p(_t,ye),p(It,ye);var Zt=[2,4,5,6];function kt(e){ye.call(this,e,-1,Vt)}function Ot(){return{1:Je,2:[$e,It,Rt],3:[qe,gt,bt],4:Ue,5:Ye,6:Ye}}p(kt,ye);var Vt=[2,5,6];function Gt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function At(e){return Re(e,tt,1).map((function(e){return{index:ke(e,1),$:xe(e,2),label:null!=Se(e,3)?Oe(e,3):void 0,displayName:null!=Se(e,4)?Oe(e,4):void 0}}))}function Wt(e){return{x:xe(e,1),y:xe(e,2),z:xe(e,3),visibility:null!=Se(e,4)?xe(e,4):void 0}}function Nt(e,t){this.h=e,this.g=t,this.l=0}function Lt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Gt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Gt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={J:n.getAttribLocation(r,"aVertex"),I:n.getAttribLocation(r,"aTex"),ja:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.J),n.disableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Xt(e){this.g=e}var Mt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ft(e,t){return t+e}function Pt(e,t){window[e]=t}function jt(t){if(this.g=t,this.listeners={},this.j={},this.G={},this.m={},this.s={},this.H=this.o=this.S=!0,this.D=e.resolve(),this.R="",this.C={},this.locateFile=t&&t.locateFile||Ft,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.T=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Ut(t){var n,r,i,o,s,a,u,l,d,h,f;return E((function(p){switch(p.g){case 1:return t.S?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(p,E((function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Mt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(r=p.h,"object"==typeof window)return Pt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Pt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=n.filter((function(e){return void 0!==e.data})),u=n.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(n){var r=Ht(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),d=e.all(u.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.T)):e.resolve()}))).then((function(){var e,n,r;return E((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0}))})),h=E((function(e){return t.g.graph&&t.g.graph.url?e=y(e,Ht(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(p,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.T)})),importScripts.apply(null,c(i)),o=t,y(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,s=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ga:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(s),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(f=t.l.getContext("webgl2",{}))&&!(f=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.F=f,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.S=!1,p.g=0}}))}function Ht(e,t){var n,r;return E((function(i){return t in e.G?i.return(e.G[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.G[t]=r,i.return(r))}))}function Yt(e,t,n){var r,i,o,s,c,u,l,d,h,f,p,m,g,b;return E((function(v){switch(v.g){case 1:if(!n)return v.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(e.H=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){v.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(v,function(e,t,n){var r;return E((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new Nt(e.h,e.F),e.s[t]=r),i.return(Lt(r,n,e.H))):i.return(void 0)}))}(e,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=Pe(w.get(_),ft,pt);C={U:{aa:xe(C,1),ba:xe(C,2),height:xe(C,3),width:xe(C,4),rotation:xe(C,5,0),Z:ke(C,6)},P:Re(Pe(S.get(_),lt,dt),at,1).map(Wt),N:At(Pe(T.get(_),it,ot))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===f){v.g=3;break}if("float_list"===h.type){r[d]=f,v.g=7;break}if("proto"===h.type){r[d]=f,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=e.s[d])||(p=new Nt(e.h,e.F),e.s[d]=p),y(v,Lt(p,f,e.H),13);case 13:m=v.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),v.g=3;break;case 14:g[b]=v.h;case 3:s=l.next(),v.g=2;break;case 4:return v.return(r)}}))}function Dt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.D=Yt(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Bt(e){var t=ke(e,1),n=Ie(e,St,3);return{id:t,point2d:n={x:xe(n,1),y:xe(n,2),depth:xe(n,3)},point3d:{x:xe(e=Ie(e,Et,2),1),y:xe(e,2),z:xe(e,3)}}}function Kt(e){var t=Pe(e,kt,Ot);e=[],t=Re(t,It,2);for(var n=0;n<t.length;n++)e.push({id:ke(t[n],1),keypoints:Re(t[n],_t,2).map(Bt),visibility:xe(t[n],3),scale:Ee(t[n],6),translation:Ee(t[n],5),rotation:Ee(t[n],4)});return e}function Jt(e){switch(e){case"Camera":return"Camera";case"Chair":return"Chair";case"Cup":return"Coffee cup, Mug";default:return"Footwear"}}(t=jt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return E((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={L:o.L,M:o.M},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.L=c.onChange,o.M=e[u],r.push(function(e){return function(){return E((function(t){if(1==t.g)return y(t,e.L(e.M),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return E((function(t){return 1==t.g?y(t,Ut(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return E((function(l){if(1==l.g)return e.g.graph&&e.g.graph.url&&e.R===e.g.graph.url?l.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.R=e.g.graph.url,y(l,Ht(e,e.g.graph.url),3)):void(l.g=2));for(2!=l.g&&(t=l.h,e.i.loadGraph(t)),n=a(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=a(e.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Dt(e,c);u=e.j,e.j={},e.setOptions(u),l.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,s;return E((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.A){c.g=2;break}t=a(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return y(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=a(e.B),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);e.i.changeOptions(r),r.delete(),e.B=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,s,c,u,l,d,h=this;return E((function(f){switch(f.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(f,h.D,2)):f.return();case 2:return y(f,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(e)),o=i.next();!o.done;o=i.next())if(s=o.value,c=h.g.inputs[s]){e:{var p=e[s];switch(c.type){case"video":var m=h.m[c.stream];if(m||(m=new Nt(h.h,h.F),h.m[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement)var g=p.videoWidth,b=p.videoHeight;else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(g=p.naturalWidth,b=p.naturalHeight):(g=p.width,b=p.height);b={glName:m.l,width:g,height:b},(g=m.g).canvas.width=b.width,g.canvas.height=b.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,p),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.m[c.stream])||(m=new Xt(h.h),h.m[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(p.length),b=0;b<p.length;++b){g=p[b];var v=m.data,w=v.setBoundingBox,S=b,T=g.U,E=new ft;if(_e(E,1,T.aa),_e(E,2,T.ba),_e(E,3,T.height),_e(E,4,T.width),_e(E,5,T.rotation),_e(E,6,T.Z),T=Fe(E,mt),w.call(v,S,T),g.P)for(v=0;v<g.P.length;++v){var x=!!(E=g.P[v]).visibility;S=(w=m.data).addNormalizedLandmark,T=b,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),_e(x=new at,1,E.x),_e(x,2,E.y),_e(x,3,E.z),E.visibility&&_e(x,4,E.visibility),E=Fe(x,ut),S.call(w,T,E)}if(g.N)for(v=0;v<g.N.length;++v)S=(w=m.data).addClassification,T=b,E=g.N[v],_e(x=new tt,2,E.$),E.index&&_e(x,1,E.index),E.label&&_e(x,3,E.label),E.displayName&&_e(x,4,E.displayName),E=Fe(x,rt),S.call(w,T,E)}m=m.data;break e;default:m={}}}switch(u=m,l=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:l,timestamp:n}));break;case"detections":(d=u).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return h.i.send(r),y(f,h.D,4);case 4:r.delete(),f.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",jt),C("OptionType",{BOOL:0,NUMBER:1,ca:2,0:"BOOL",1:"NUMBER",2:"STRING"});var zt={focalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_x"}},focalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_y"}},principalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_x"}},principalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_y"}},allowedLabels:{type:2,graphOptionXref:{calculatorName:"ConstantSidePacketCalculatorAllowedLabels",calculatorType:"ConstantSidePacketCalculator",fieldName:"string_value"}}};function Qt(e){var t=this;e=e||{},this.g=new jt({locateFile:e.locateFile,files:[{url:"objectron_solution_packed_assets_loader.js"},{simd:!1,url:"objectron_solution_wasm_bin.js"},{simd:!0,url:"objectron_solution_simd_wasm_bin.js"}],graph:{url:"objectron.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["lifted_objects","image_transformed"],outs:{image:"image_transformed",objectDetections:{type:"proto",stream:"lifted_objects",transform:Kt}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,default:!1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumObjects:{type:1,default:5,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorMaxNumObjects",fieldName:"int_value"}},staticImageMode:{type:0,default:!0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"objectrongpusubgraph__ConstantSidePacketCalculator",fieldName:"bool_value"}},minDetectionConfidence:{type:1,default:.5,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"objectrongpusubgraph__objectdetectionoidv4subgraph__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,default:.99,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"objectrongpusubgraph__boxlandmarksubgraph__ThresholdingCalculator",fieldName:"threshold"}},modelName:{default:"Shoe",onChange:function(e){var n,r,i,o;return E((function(s){return 1==s.g?(n=e,t.g.setOptions({allowedLabels:Jt(n)},zt),r=function(e){switch(e){case"Camera":return"object_detection_3d_camera.tflite";case"Chair":return"object_detection_3d_chair.tflite";case"Cup":return"object_detection_3d_cup.tflite";default:return"object_detection_3d_sneakers.tflite"}}(n),i="object_detection_3d.tflite",y(s,Ht(t.g,r),2)):(o=s.h,t.g.overrideFile(i,o),s.return(!0))}))}},focalLength:{default:[1,1],onChange:function(e){var n;return E((function(r){return n=e,t.h=n,t.g.setOptions({focalX:n[0],focalY:n[1]},zt),r.return(!0)}))}},principalPoint:{default:[0,0],onChange:function(e){var n;return E((function(r){return n=e,t.i=n,t.g.setOptions({principalX:n[0],principalY:n[1]},zt),r.return(!0)}))}},imageSize:{onChange:function(e){var n,r,i,o;return E((function(s){if(void 0===t.h||void 0===t.i)return console.error('"focalLength" and "principalPoint" must be set if setting image size'),s.return();r=[(n=e)[0]/2,n[1]/2],i=[t.h[0]/r[0],t.h[1]/r[1]],o=[t.i[0]/r[0],t.i[1]/r[1]],t.setOptions({focalLength:i,principalPoint:o}),s.g=0}))}}}})}(t=Qt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return E((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return E((function(n){return y(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("Objectron",Qt),C("BOX_CONNECTIONS",[[1,2],[2,4],[4,3],[3,1],[5,6],[6,8],[8,7],[7,5],[1,5],[2,6],[3,7],[4,8]]),C("BOX_KEYPOINTS",{CENTER:0,BACK_BOTTOM_LEFT:1,FRONT_BOTTOM_LEFT:2,BACK_TOP_LEFT:3,FRONT_TOP_LEFT:4,BACK_BOTTOM_RIGHT:5,FRONT_BOTTOM_RIGHT:6,BACK_TOP_RIGHT:7,FRONT_TOP_RIGHT:8}),C("VERSION","0.4.1636596145")}).call(Mt);const Ft={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in n))break e;n=n[s]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function s(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var a=i[t[o]];"function"==typeof a&&"function"!=typeof a.prototype[e]&&r(a.prototype,e,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return e}));var u,l="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var d;e:{var h={};try{h.__proto__={a:!0},d=h.a;break e}catch{}d=!1}u=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function b(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,b(e.g,t),S(e)}return e.g.i=null,r.call(e.g,o),S(e)}function S(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,b(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function T(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=S(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(b(e.g,t),t=S(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),S(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(s){s.done?i(s.value):e.resolve(s.value).then(n,r).then(t,o)}(t.next())}))}(new T(new v(t)))}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,s=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),s},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=a(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=a(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){s[t]=n,0==--a&&e(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).J(o(s.length-1),t),i=n.next()}while(!i.done)}))},t}));var x="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||x})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var _=this||self;function C(e,t){e=e.split(".");var n,r=_;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function I(e){!function(e){_.setTimeout((function(){throw e}),0)}(e)}function R(e,t){I(Error("Invalid wire type: "+e+" (at position "+t+")"))}function Z(){I(Error("Failed to read varint, encoding is invalid."))}function k(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var O,V,G=typeof TextDecoder<"u",A=typeof TextEncoder<"u";function W(e){if(A)e=(V||(V=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var s=e.charCodeAt(++i);if(56320<=s&&57343>=s){o=1024*(o-55296)+s-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var N={},L=null;function X(e){var t;void 0===t&&(t=0),F(),t=N[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var s=e[i],a=e[i+1],c=e[i+2],u=t[s>>2];s=t[(3&s)<<4|a>>4],a=t[(15&a)<<2|c>>6],c=t[63&c],n[o++]=u+s+a+c}switch(u=0,c=r,e.length-i){case 2:c=t[(15&(u=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|u>>4]+c+r}return n.join("")}function M(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=L[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}F();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;t(i<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function F(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));N[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===L[o]&&(L[o]=i)}}}}var P,j="function"==typeof Uint8Array;function U(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}U.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:j&&e instanceof Uint8Array?X(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function Y(e,t,n){return t===n?P||(P=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function B(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.u=t,e&&K(this,e)}function K(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return M(e);if(e.constructor===U){if(null==e.g)var t=P||(P=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||j&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?M(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function J(e){e.g>e.i&&(e.j=!0,I(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function z(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,J(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,J(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,J(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,J(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,J(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,Z(),r):(J(e),r))))))}B.prototype.reset=function(){this.g=this.l};var Q=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,Q.length?(n=Q.pop(),t&&(n.u=t.u),e&&K(n,e),e=n):e=new B(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=z(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,R(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(0==(128&e.h[t])){e.g=t+1,J(e);break e}t++}e.j=!0,Z()}break;case 1:(e=e.g).g+=8,J(e);break;case 2:2!=e.h?re(e):(t=z(e.g),(e=e.g).g+=t,J(e));break;case 5:(e=e.g).g+=4,J(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,I(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,I(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,R(e.h,e.l)}}function ie(e,t,n){e.N||(e=Y(e.g.h,n,e.g.g),(n=t.m)?n.push(e):t.m=[e])}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,Y(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var oe=[];function se(){this.h=[],this.i=0,this.g=new q}function ae(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function ce(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),ae(e,e.g.end()),ae(e,n)}var ue,le="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function de(e,t){Object.isFrozen(e)||(le?e[le]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function he(e){return e?null==(t=le?e[le]:e.g)?0:t:0;var t}function fe(e){return Array.isArray(e)&&de(e,1),e}function pe(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");de(e,2)}function me(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function ge(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return j&&null!=e&&e instanceof Uint8Array?X(e):e;default:return e}}function be(e,t){if(null!=e)return Array.isArray(e)||me(e)?ye(e,t):t(e)}function ye(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=be(e[r],t);return 1&he(e)&&fe(n),n}for(r in n={},e)n[r]=be(e[r],t);return n}function ve(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.aa||0),this.i=null,this.g=e,e=(r=this.g.length)-1,r&&me(r=this.g[e])?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?fe(r):this.g[e]=Te):(Ee(this),(r=this.h[e])?fe(r):this.h[e]=Te)}var we,Se,Te=Object.freeze(fe([]));function Ee(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function xe(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function _e(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=xe(e,t,r);return null==i&&(i=Te),i===Te?Ie(e,t,i=fe([]),r):n&&Array.isArray(i)&&2&he(i)&&Ie(e,t,i=i.slice(),r),i}function Ce(e,t,n){return null==(e=null==(e=xe(e,t))?e:+e)?void 0===n?0:n:e}function Ie(e,t,n,r){void 0!==r&&r||t>=e.l?(Ee(e),e.h[t]=n):e.g[t+e.j]=n}function Re(e,t,n){e.i||(e.i={});var r=e.i[n];if(!r){var i=_e(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&he(i)),s=0;s<i.length;s++)r[s]=new t(i[s]),o&&pe(r[s].g);o&&(pe(r),Object.freeze(r)),e.i[n]=r}return r}function Ze(e,t,n,r,i){var o=Re(e,r,t);n=n||new r,e=_e(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,ke(n))):(o.push(n),e.push(ke(n)))}function ke(e){if(e.i)for(var t in e.i){var n=e.i[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&ke(n[r]);else n&&ke(n)}return e.g}function Oe(e,t){return null==(e=xe(e,t))?0:e}function Ve(e,t){return null==(e=xe(e,t))?"":e}function Ge(e,t){if(e=e.m){ae(t,t.g.end());for(var n=0;n<e.length;n++)ae(t,e[n])}}function Ae(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],s=e[2],a=e[3];return function(e,n,r){return t(e,n,r,o,s,a)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function We(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Ae(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Ne(e,t){var n=new se;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var s=r[o];0!==s.length&&(e.set(s,t),t+=s.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function Le(e,t,n){if(oe.length){var r=oe.pop();e&&(K(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>oe.length&&oe.push(e)}}function Xe(e,t,n){if(null!=(t=xe(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,D=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=D)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function Me(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],s=e.h[e.g+3];return e.g+=4,J(e),e=2*((i=(r<<0|i<<8|o<<16|s<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ie(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}function Fe(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,s=e=0;4>s&&128<=i;s++)o|=(127&(i=r.h[r.g++]))<<7*s;if(128<=i&&(o|=(127&(i=r.h[r.g++]))<<28,e|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)e|=(127&(i=r.h[r.g++]))<<7*s+3;return 128>i?(r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),e=e?-r:r):(r.j=!0,Z(),e=void 0),Ie(t,n,e),!0}function Pe(e,t,n){return 0===e.h&&(Ie(t,n,z(e.g)),!0)}function je(e,t,n){if(2!==e.h)return!1;var r,i=z(e.g),o=(e=e.g).g;if(e.g+=i,J(e),e=e.h,G)(r=O)||(r=O=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var s,a,c,u=[],l=null;o<i;)128>(s=e[o++])?u.push(s):224>s?o>=i?u.push(65533):(a=e[o++],194>s||128!=(192&a)?(o--,u.push(65533)):u.push((31&s)<<6|63&a)):240>s?o>=i-1?u.push(65533):128!=(192&(a=e[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=e[o++]))?(o--,u.push(65533)):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?u.push(65533):128!=(192&(a=e[o++]))||a-144+(s<<28)>>30!=0||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,u.push(65533)):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&c,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):u.push(65533),8192<=u.length&&(l=k(l,u),u.length=0);r=k(l,u)}return Ie(t,n,r),!0}function Ue(e,t,n,r,i){if(2!==e.h)return!1;var o=new r,s=e.g.i,a=z(e.g),c=e.g.g+a;if(e.g.i=c,i(o,e),0!==(i=c-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+a+" bytes, instead read "+(a-i)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=c,e.g.i=s,Ze(t,n,o,r,void 0),!0}function He(e){ve.call(this,e)}function Ye(e,t){var n=xe(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}Xe(t,e,2),null!=(r=xe(e,3))&&ce(t,3,W(r)),null!=(r=xe(e,4))&&ce(t,4,W(r)),Ge(e,t)}function De(e,t){return We(e,t,we||(we={1:Pe,2:Me,3:je,4:je}))}function Be(e){ve.call(this,e,-1,Qe)}function Ke(e,t){return We(e,t,Se||(Se={1:[Ue,He,De]}))}ve.prototype.toJSON=function(){return ye(ke(this),ge)},ve.prototype.toString=function(){return ke(this).toString()},p(He,ve),p(Be,ve),Be.prototype.addClassification=function(e,t){return Ze(this,1,e,He,t),this};var Je,ze,Qe=[1];function qe(e){ve.call(this,e)}function $e(e,t){Xe(t,e,1),Xe(t,e,2),Xe(t,e,3),Xe(t,e,4),Xe(t,e,5),Ge(e,t)}function et(e,t){return We(e,t,Je||(Je={1:Me,2:Me,3:Me,4:Me,5:Me}))}function tt(e){ve.call(this,e,-1,it)}function nt(e,t){return We(e,t,ze||(ze={1:[Ue,qe,et]}))}p(qe,ve),p(tt,ve);var rt,it=[1];function ot(e){ve.call(this,e)}function st(e,t){Xe(t,e,1),Xe(t,e,2),Xe(t,e,3),Xe(t,e,4),Xe(t,e,5);var n=xe(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=D=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Ge(e,t)}function at(e,t){return We(e,t,rt||(rt={1:Me,2:Me,3:Me,4:Me,5:Me,6:Fe}))}function ct(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function ut(e){return Re(e,He,1).map((function(e){return{index:Oe(e,1),X:Ce(e,2),label:null!=xe(e,3)?Ve(e,3):void 0,displayName:null!=xe(e,4)?Ve(e,4):void 0}}))}function lt(e){return{x:Ce(e,1),y:Ce(e,2),z:Ce(e,3),visibility:null!=xe(e,4)?Ce(e,4):void 0}}function dt(e){return Re(Le(e,tt,nt),qe,1).map(lt)}function ht(e,t){this.h=e,this.g=t,this.l=0}function ft(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=ct(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=ct(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function pt(e){this.g=e}p(ot,ve);var mt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function gt(e,t){return t+e}function bt(e,t){window[e]=t}function yt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||gt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=a(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function vt(t){var n,r,i,o,s,a,u,l,d,h,f;return E((function(p){switch(p.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(p,E((function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(mt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(r=p.h,"object"==typeof window)return bt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),bt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=n.filter((function(e){return void 0!==e.data})),u=n.filter((function(e){return void 0===e.data})),l=e.all(a.map((function(n){var r=wt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),d=e.all(u.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return E((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0}))})),h=E((function(e){return t.g.graph&&t.g.graph.url?e=y(e,wt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(p,e.all([d,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,y(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,s=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(s),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(f=t.l.getContext("webgl2",{}))&&!(f=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.D=f,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,p.g=0}}))}function wt(e,t){var n,r;return E((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function St(e,t,n){var r,i,o,s,c,u,l,d,h,f,p,m,g,b;return E((function(v){switch(v.g){case 1:if(!n)return v.return(t);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())c=s.value,"string"!=typeof(u=n[c])&&"texture"===u.type&&void 0!==t[u.stream]&&++i;1<i&&(e.G=!1),l=a(Object.keys(n)),s=l.next();case 2:if(s.done){v.g=4;break}if(d=s.value,"string"==typeof(h=n[d]))return g=r,b=d,y(v,function(e,t,n){var r;return E((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new ht(e.h,e.D),e.s[t]=r),i.return(ft(r,n,e.G))):i.return(void 0)}))}(e,d,t[h]),14);if(f=t[h.stream],"detection_list"===h.type){if(f){for(var w=f.getRectList(),S=f.getLandmarksList(),T=f.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=Le(w.get(_),ot,at);C={T:{Y:Ce(C,1),Z:Ce(C,2),height:Ce(C,3),width:Ce(C,4),rotation:Ce(C,5,0),W:Oe(C,6)},O:dt(S.get(_)),M:ut(Le(T.get(_),Be,Ke))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(f){for(w=Array(f.size()),S=0;S<f.size();S++)w[S]=f.get(S);f.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===f){v.g=3;break}if("float_list"===h.type){r[d]=f,v.g=7;break}if("proto"===h.type){r[d]=f,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(p=e.s[d])||(p=new ht(e.h,e.D),e.s[d]=p),y(v,ft(p,f,e.G),13);case 13:m=v.h,r[d]=m;case 7:h.transform&&r[d]&&(r[d]=h.transform(r[d])),v.g=3;break;case 14:g[b]=v.h;case 3:s=l.next(),v.g=2;break;case 4:return v.return(r)}}))}function Tt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=a(t.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<t.wants.length;++s)o[r[s]]=i.get(s);var a=e.listeners[n];a&&(e.C=St(e,o,t.outs).then((function(n){n=a(n);for(var i=0;i<t.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Et(e){switch(void 0===e&&(e=0),e){case 1:return"pose_landmark_full.tflite";case 2:return"pose_landmark_heavy.tflite";default:return"pose_landmark_lite.tflite"}}function xt(e){var t=this;e=e||{},this.g=new yt({locateFile:e.locateFile,files:function(e){return[{url:"pose_solution_packed_assets_loader.js"},{simd:!1,url:"pose_solution_wasm_bin.js"},{simd:!0,url:"pose_solution_simd_wasm_bin.js"},{data:!0,url:Et(e.modelComplexity)}]},graph:{url:"pose_web.binarypb"},listeners:[{wants:["pose_landmarks","world_landmarks","segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:dt},poseWorldLandmarks:{type:"proto",stream:"world_landmarks",transform:dt},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return E((function(o){return 1==o.g?(n=Et(e),r="third_party/mediapipe/modules/pose_landmark/"+n,y(o,wt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=yt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return E((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(e)),c=s.next();!c.done;o={K:o.K,L:o.L},c=s.next()){var u=c.value;u in this.j&&this.j[u]===e[u]||(this.j[u]=e[u],void 0!==(c=t[u])&&(c.onChange&&(o.K=c.onChange,o.L=e[u],r.push(function(e){return function(){return E((function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(u={valueNumber:1===c.type?e[u]:0,valueBoolean:0===c.type&&e[u],valueString:2===c.type?e[u]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),u),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return E((function(t){return 1==t.g?y(t,vt(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return E((function(l){if(1==l.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?l.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,y(l,wt(e,e.g.graph.url),3)):void(l.g=2));for(2!=l.g&&(t=l.h,e.i.loadGraph(t)),n=a(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=a(e.g.listeners),s=o.next();!s.done;s=o.next())c=s.value,Tt(e,c);u=e.j,e.j={},e.setOptions(u),l.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,s;return E((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=a(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return y(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=a(e.A),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,s,c,u,l,d,h=this;return E((function(f){switch(f.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(f,h.C,2)):f.return();case 2:return y(f,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(e)),o=i.next();!o.done;o=i.next())if(s=o.value,c=h.g.inputs[s]){e:{var p=e[s];switch(c.type){case"video":var m=h.m[c.stream];if(m||(m=new ht(h.h,h.D),h.m[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement)var g=p.videoWidth,b=p.videoHeight;else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(g=p.naturalWidth,b=p.naturalHeight):(g=p.width,b=p.height);b={glName:m.l,width:g,height:b},(g=m.g).canvas.width=b.width,g.canvas.height=b.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,p),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.m[c.stream])||(m=new pt(h.h),h.m[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(p.length),b=0;b<p.length;++b){g=p[b];var v=m.data,w=v.setBoundingBox,S=b,T=g.T,E=new ot;if(Ie(E,1,T.Y),Ie(E,2,T.Z),Ie(E,3,T.height),Ie(E,4,T.width),Ie(E,5,T.rotation),Ie(E,6,T.W),T=Ne(E,st),w.call(v,S,T),g.O)for(v=0;v<g.O.length;++v){var x=!!(E=g.O[v]).visibility;S=(w=m.data).addNormalizedLandmark,T=b,E=Object.assign(Object.assign({},E),{visibility:x?E.visibility:0}),Ie(x=new qe,1,E.x),Ie(x,2,E.y),Ie(x,3,E.z),E.visibility&&Ie(x,4,E.visibility),E=Ne(x,$e),S.call(w,T,E)}if(g.M)for(v=0;v<g.M.length;++v)S=(w=m.data).addClassification,T=b,E=g.M[v],Ie(x=new He,2,E.X),E.index&&Ie(x,1,E.index),E.label&&Ie(x,3,E.label),E.displayName&&Ie(x,4,E.displayName),E=Ne(x,Ye),S.call(w,T,E)}m=m.data;break e;default:m={}}}switch(u=m,l=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:l,timestamp:n}));break;case"detections":(d=u).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return h.i.send(r),y(f,h.C,4);case 4:r.delete(),f.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",yt),C("OptionType",{BOOL:0,NUMBER:1,$:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=xt.prototype).reset=function(){this.g.reset()},t.close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return E((function(t){return y(t,e.g.initialize(),0)}))},t.send=function(e,t){var n=this;return E((function(r){return y(r,n.g.send(e,t),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("Pose",xt),C("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),C("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),C("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),C("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),C("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),C("VERSION","0.5.1635988162")}).call(Ft);const Pt=class{constructor(){o(this,"mediapipeMap_",new Map)}getVersion(e){switch(e){case"face_detection":return Lt.VERSION;case"face_mesh":return Xt.VERSION;case"hands":return Wt.VERSION;case"holistic":return Nt.VERSION;case"objectron":return Mt.VERSION;case"selfie_segmentation":return At.VERSION;case"pose":return Ft.VERSION;default:return""}}initialize(t){return new e(async(e,n)=>{if(0!=t.mediaPipeModelConfigArray.length){for(let e=0;e<t.mediaPipeModelConfigArray.length;e++){const r=t.mediaPipeModelConfigArray[e];if(this.mediapipeMap_.has(r.modelType))return void n("setting same type is not supported");if("function"!=typeof r.listener)return void n(`[${r.modelType}] ResultsListener must be provided`);let i;switch(r.modelType){case"face_mesh":i=new Xt.FaceMesh({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"face_mesh/"+this.getVersion("face_mesh"))+"/"+e});break;case"face_detection":i=new Lt.FaceDetection({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"face_detection/"+this.getVersion("face_detection"))+"/"+e});break;case"hands":i=new Wt.Hands({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"hands/"+this.getVersion("hands"))+"/"+e});break;case"holistic":i=new Nt.Holistic({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"holistic/"+this.getVersion("holistic"))+"/"+e});break;case"objectron":i=new Mt.Objectron({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"objectron/"+this.getVersion("objectron"))+"/"+e});break;case"selfie_segmentation":i=new At.SelfieSegmentation({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"selfie_segmentation/"+this.getVersion("selfie_segmentation"))+"/"+e});break;case"pose":i=new Ft.Pose({locateFile:(e,t)=>(r.assetsUri||Pt.defaultAssetsBaseUrl+"pose/"+this.getVersion("pose"))+"/"+e});break;default:return void n("unknown model type")}i.onResults(r.listener),r.options&&i.setOptions(r.options);try{await i.initialize(),this.mediapipeMap_.set(r.modelType,i)}catch(e){return void n(e)}}e()}else n("no model was selected")})}close(t){return new e((n,r)=>{let i=[];if(t){let e=this.mediapipeMap_.get(t);if(!e)return void r("model not exit");this.mediapipeMap_.delete(t),i.push(e.close())}else{for(const[e,t]of this.mediapipeMap_.entries())i.push(t.close());this.mediapipeMap_.clear()}e.all(i).then(()=>{n()}).catch(e=>{r(e)})})}send(t,n){return new e((r,i)=>{let o=[];if(n){let e=this.mediapipeMap_.get(n);if(!e)return void i("model not exit");o.push(e.send({image:t}))}else for(const[e,n]of this.mediapipeMap_.entries())o.push(n.send({image:t}));e.all(o).then(()=>{r()}).catch(e=>{i(e)})})}reset(e){if(e){let t=this.mediapipeMap_.get(e);t&&"function"==typeof t.reset&&t.reset()}else for(const[e,t]of this.mediapipeMap_.entries())t&&"function"==typeof t.reset&&t.reset()}};let jt=Pt;o(jt,"defaultAssetsBaseUrl","https://d3opqjmqzxf057.cloudfront.net/ml/mediapipe/");const Ut=new WeakMap,Ht=new WeakMap,Yt=new WeakMap,Dt=Symbol("anyProducer"),Bt=e.resolve(),Kt=Symbol("listenerAdded"),Jt=Symbol("listenerRemoved");let zt=!1;function Qt(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function qt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function $t(e,t){const n=Ht.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function en(e,t){const n="string"==typeof t||"symbol"==typeof t?t:Dt,r=Yt.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function tn(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)en(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)en(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function nn(e){if(void 0===e)return sn;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!sn.includes(t))throw"string"!=typeof t?new TypeError("`methodNames` element must be a string"):new Error(t+" is not Emittery method");return e}const rn=e=>e===Kt||e===Jt;class on{static mixin(e,t){return t=nn(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 on}),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 zt;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||zt}static set isDebugEnabled(e){zt=e}constructor(e={}){Ut.set(this,new Set),Ht.set(this,new Map),Yt.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)=>{try{r=JSON.stringify(r)}catch{r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}"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){(on.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){qt(t),e=Array.isArray(e)?e:[e];for(const n of e)Qt(n),$t(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),rn(n)||this.emit(Kt,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){qt(t),e=Array.isArray(e)?e:[e];for(const n of e)Qt(n),$t(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),rn(n)||this.emit(Jt,{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)Qt(t);return tn(this,e)}async emit(t,n){Qt(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=Yt.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(Dt)){const t=e.all([n,r]);for(const e of i.get(Dt))e.enqueue(t)}}(this,t,n);const r=$t(this,t),i=Ut.get(this),o=[...r],s=rn(t)?[]:[...i];await Bt,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){Qt(e),this.logIfDebugEnabled("emitSerial",e,t);const n=$t(this,e),r=Ut.get(this),i=[...n],o=[...r];await Bt;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 qt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),Ut.get(this).add(e),this.emit(Kt,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return tn(this)}offAny(e){qt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(Jt,{listener:e}),Ut.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){$t(this,t).clear();const e=en(this,t);for(const t of e)t.finish();e.clear()}else{Ut.get(this).clear();for(const e of Ht.get(this).values())e.clear();for(const e of Yt.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){typeof n<"u"&&Qt(n),t+=Ut.get(this).size;for(const e of Ht.get(this).values())t+=e.size;for(const e of Yt.get(this).values())t+=e.size}else t+=Ut.get(this).size+$t(this,n).size+en(this,n).size+en(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=nn(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 sn=Object.getOwnPropertyNames(on.prototype).filter(e=>"constructor"!==e);Object.defineProperty(on,"listenerAdded",{value:Kt,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(on,"listenerRemoved",{value:Jt,writable:!1,enumerable:!0,configurable:!1});var an=on,cn=(e=>(e[e.INIT=0]="INIT",e[e.FORWARD=1]="FORWARD",e[e.TERMINATE=2]="TERMINATE",e))(cn||{});function un(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let ln=0;function dn(t,n,r,i,o){const s=ln++;return t.postMessage({id:s,type:n,functionName:r,args:i},i.filter(e=>un(e))),new e(e=>{o.set(s,e)})}async function hn(e,t){const n=new Map;return async function(e,t,n){const r={};return Object.getOwnPropertyNames(e.prototype).forEach(e=>{r[e]=(...r)=>dn(t,cn.FORWARD,e,r,n)}),r.terminate=async(...e)=>{const i=await dn(t,cn.TERMINATE,"",e,n);return t.terminate(),r.worker=void 0,i},r.worker=t,r}(e,await async function(e,t,n){const r=new t;if(r.addEventListener("message",({data:e})=>{var t;null==(t=n.get(e.id))||t(e.result),n.delete(e.id)}),!await dn(r,cn.INIT,"",[e.workerId],n))throw"Failed to instantiate workerized class";return r}(e,t,n),n)}function fn(e,t){const{id:n}=e,r=Array.isArray(t)?t:[t];postMessage({id:n,result:t},r.filter(e=>un(e)))}function pn(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}const mn={};pn()&&function(){const e={};onmessage=async t=>{const n=t.data;switch(n.type){case cn.INIT:!function(e,t){if(!e.args)throw"Missing className while initializing worker";const[n]=e.args,r=mn[n];if(!r)throw"unknown worker class "+n;t.instance=new r(e.args.slice(1)),fn(e,void 0!==typeof t.instance)}(n,e);break;case cn.FORWARD:!async function(e,t){const{functionName:n,args:r}=e;if(!t.instance)throw"instance not initialized";if(!n)throw"missing function name to call";if(!t.instance[n])throw`undefined function [${n}] in class ${t.instance.constructor.workerId}`;fn(e,await t.instance[n](...null!=r?r:[]))}(n,e);break;case cn.TERMINATE:!async function(e,t){const{args:n}=e;if(!t.instance)throw"instance not initialized";let r;t.instance.terminate&&(r=await t.instance.terminate(...null!=n?n:[])),fn(e,r)}(n,e)}}}();class gn{static async createVideoReadable(t){return new e((e,n)=>{const r=document.createElement("video");let i=new AbortController,o=new AbortController;r.addEventListener("canplay",()=>{i.abort(),r.muted=!0,r.loop=!0,r.play().then(()=>{try{const t=r.captureStream(),n=new MediaStreamTrackProcessor(t.getVideoTracks()[0]);e(n.readable)}catch(e){n(e)}})},{once:!0,signal:o.signal}),r.addEventListener("error",e=>{o.abort(),n("loading error:"+e)},{once:!0,signal:i.signal}),r.crossOrigin="anonymous",r.src=t})}static async createImageCanvas(e){const t=await(await fetch(e)).blob();return await createImageBitmap(t)}}async function bn(t){return new e(e=>{setTimeout(()=>{e()},t)})}var yn=(e=>(e.PUSH="PUSH",e.POP="POP",e))(yn||{});class vn{constructor(e){o(this,"context"),o(this,"extension"),o(this,"queries",[]),o(this,"activeQuery"),this.context=e,this.extension=e.getExtension("EXT_disjoint_timer_query_webgl2")}start(){}stop(){this.activeQuery&&this.context.endQuery(this.extension.TIME_ELAPSED_EXT)}pushContext(e){this.createQuery("PUSH",e)}popContext(e){this.createQuery("POP",e)}createQuery(e,t){this.activeQuery&&this.context.endQuery(this.extension.TIME_ELAPSED_EXT),this.activeQuery=this.context.createQuery(),this.context.beginQuery(this.extension.TIME_ELAPSED_EXT,this.activeQuery),this.queries.push({name:t,action:e,query:this.activeQuery})}async getResolvedQueries(){const t=(await e.all([...this.queries].map(e=>this.resolveQuery(e)))).filter(e=>e);for(let e=1;e<t.length;++e)t[e].timestamp+=t[e-1].duration+t[e-1].timestamp;return t}async resolveQuery(e){if(await this.awaitQueryAvailable(e)){if(!this.context.getParameter(this.extension.GPU_DISJOINT_EXT))return{...e,duration:this.context.getQueryParameter(e.query,this.context.QUERY_RESULT),timestamp:0};console.log("Disjointed query",e)}else console.log("Unawaitable query",e)}async awaitQueryAvailable(e){for(let t=0;t<10;++t){if(this.context.getQueryParameter(e.query,this.context.QUERY_RESULT_AVAILABLE))return e;await bn(200)}}}
24
24
  /* @license twgl.js 5.2.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
25
25
  Available via the MIT license.
26
- see: http://github.com/greggman/twgl.js for details */const wn={};{const e=wn;e[5120]=Int8Array,e[5121]=Uint8Array,e[5122]=Int16Array,e[5123]=Uint16Array,e[5124]=Int32Array,e[5125]=Uint32Array,e[5126]=Float32Array,e[32819]=Uint16Array,e[32820]=Uint16Array,e[33635]=Uint16Array,e[5131]=Uint16Array,e[33640]=Uint32Array,e[35899]=Uint32Array,e[35902]=Uint32Array,e[36269]=Uint32Array,e[34042]=Uint32Array}function Sn(e){if(e instanceof Int8Array)return 5120;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return 5121;if(e instanceof Int16Array)return 5122;if(e instanceof Uint16Array)return 5123;if(e instanceof Int32Array)return 5124;if(e instanceof Uint32Array)return 5125;if(e instanceof Float32Array)return 5126;throw new Error("unsupported typed array type")}function Tn(e){if(e===Int8Array)return 5120;if(e===Uint8Array||e===Uint8ClampedArray)return 5121;if(e===Int16Array)return 5122;if(e===Uint16Array)return 5123;if(e===Int32Array)return 5124;if(e===Uint32Array)return 5125;if(e===Float32Array)return 5126;throw new Error("unsupported typed array type")}function En(e){const t=wn[e];if(!t)throw new Error("unknown gl type");return t}const xn=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function _n(...e){console.error(...e)}const Cn=new Map;function In(e,t){if(!e||"object"!=typeof e)return!1;let n=Cn.get(t);n||(n=new WeakMap,Cn.set(t,n));let r=n.get(e);if(void 0===r){const i=Object.prototype.toString.call(e);r=i.substring(8,i.length-1)===t,n.set(e,r)}return r}function Rn(e,t){return typeof WebGLTexture<"u"&&In(t,"WebGLTexture")}const Zn=34962,kn="";function On(e,t,n,r){if(function(e,t){return typeof WebGLBuffer<"u"&&In(t,"WebGLBuffer")}(0,t))return t;n=n||Zn;const i=e.createBuffer();return function(e,t,n,r,i){e.bindBuffer(t,n),e.bufferData(t,r,i||35044)}(e,n,i,t,r),i}function Vn(e){return"indices"===e}const Gn=/coord|texture/i,An=/color|colour/i;function Wn(e,t,n){return e.numComponents||e.size||function(e,t){let n;if(n=Gn.test(e)?2:An.test(e)?4:3,t%n>0)throw new Error(`Can not guess numComponents for attribute '${e}'. Tried ${n} but ${t} values is not evenly divisible by ${n}. You should specify it.`);return n}(t,n||function(e){return e.length?e:e.data}(e).length)}function Nn(e,t){if(xn(e))return e;if(xn(e.data))return e.data;Array.isArray(e)&&(e={data:e});let n=e.type?Xn(e.type):void 0;return n||(n=Vn(t)?Uint16Array:Float32Array),new n(e.data)}function Ln(e){return"number"==typeof e?e:e?Tn(e):5126}function Xn(e){return"number"==typeof e?En(e):e||Float32Array}function Mn(e,t){return{buffer:t.buffer,numValues:24,type:Ln(t.type),arrayType:Xn(t.type)}}function Fn(e,t){const n=t.data||t,r=Xn(t.type),i=n*r.BYTES_PER_ELEMENT,o=e.createBuffer();return e.bindBuffer(Zn,o),e.bufferData(Zn,i,t.drawType||35044),{buffer:o,numValues:n,type:Tn(r),arrayType:r}}function Pn(e,t,n){const r=Nn(t,n);return{arrayType:r.constructor,buffer:On(e,r,void 0,t.drawType),type:Sn(r),numValues:0}}function jn(e,t){const n={};return Object.keys(t).forEach((function(r){if(!Vn(r)){const i=t[r],o=i.attrib||i.name||i.attribName||kn+r;if(i.value){if(!Array.isArray(i.value)&&!xn(i.value))throw new Error("array.value is not array or typedarray");n[o]={value:i.value}}else{let t;t=i.buffer&&i.buffer instanceof WebGLBuffer?Mn:"number"==typeof i||"number"==typeof i.data?Fn:Pn;const{buffer:s,type:a,numValues:c,arrayType:u}=t(e,i,r),l=void 0!==i.normalize?i.normalize:function(e){return e===Int8Array||e===Uint8Array}(u),d=Wn(i,r,c);n[o]={buffer:s,numComponents:d,type:a,normalize:l,stride:i.stride||0,offset:i.offset||0,divisor:void 0===i.divisor?void 0:i.divisor,drawType:i.drawType}}}})),e.bindBuffer(Zn,null),n}const Un=["position","positions","a_position"];function Hn(e,t,n){const r=jn(e,t),i=Object.assign({},n||{});i.attribs=Object.assign({},n?n.attribs:{},r);const o=t.indices;if(o){const t=Nn(o,"indices");i.indices=On(e,t,34963),i.numElements=t.length,i.elementType=Sn(t)}else i.numElements||(i.numElements=function(e,t){let n,r;for(r=0;r<Un.length&&(n=Un[r],!(n in t)&&(n=kn+n,!(n in t)));++r);r===Un.length&&(n=Object.keys(t)[0]);const i=t[n];if(!i.buffer)return 1;e.bindBuffer(Zn,i.buffer);const o=e.getBufferParameter(Zn,34660);e.bindBuffer(Zn,null);const s=o/function(e,t){return 5120===t||5121===t?1:5122===t||5123===t?2:5124===t||5125===t||5126===t?4:0}(0,i.type),a=i.numComponents||i.size,c=s/a;if(c%1!=0)throw new Error(`numComponents ${a} not correct for length ${length}`);return c}(e,i.attribs));return i}function Yn(e){return!!e.texStorage2D}const Dn=function(){const e={},t={};return function(n,r){return function(n){const r=n.constructor.name;if(!e[r]){for(const e in n)if("number"==typeof n[e]){const r=t[n[e]];t[n[e]]=r?`${r} | ${e}`:e}e[r]=!0}}(n),t[r]||("number"==typeof r?"0x"+r.toString(16):r)}}(),Bn={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},Kn=xn,Jn=function(){let e;return function(){return e=e||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),zn=6407,Qn=6408,qn=6402,$n=33071,er=3553,tr=34067,nr=32879,rr=35866,ir=10242,or=10243,sr=5120,ar=5121,cr=5123,ur=5125,lr=5126,dr=5131,hr=36193,fr=33319,pr=33320,mr=36244,gr=36248,br=36249;let yr;function vr(e){if(!yr){const e={};e[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[ar,dr,hr,lr]},e[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[ar,dr,hr,lr]},e[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[ar,dr,hr,lr]},e[zn]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[ar,dr,hr,lr,33635]},e[Qn]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[ar,dr,hr,lr,32819,32820]},e[qn]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[ur,cr]},e[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[ar]},e[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[sr]},e[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[lr,dr]},e[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[lr]},e[33330]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[ar]},e[33329]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[sr]},e[33332]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[cr]},e[33331]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5122]},e[33334]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ur]},e[33333]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5124]},e[33323]={textureFormat:fr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[ar]},e[36757]={textureFormat:fr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[sr]},e[33327]={textureFormat:fr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[lr,dr]},e[33328]={textureFormat:fr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[lr]},e[33336]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[ar]},e[33335]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[sr]},e[33338]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[cr]},e[33337]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5122]},e[33340]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[ur]},e[33339]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5124]},e[32849]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[ar]},e[35905]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[ar]},e[36194]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[ar,33635]},e[36758]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[sr]},e[35898]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[lr,dr,35899]},e[35901]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[lr,dr,35902]},e[34843]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[lr,dr]},e[34837]={textureFormat:zn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[lr]},e[36221]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[ar]},e[36239]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[sr]},e[36215]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[cr]},e[36233]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[5122]},e[36209]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[ur]},e[36227]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5124]},e[32856]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[ar]},e[35907]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[ar]},e[36759]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[sr]},e[32855]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[ar,32820,33640]},e[32854]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[ar,32819]},e[32857]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[33640]},e[34842]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[lr,dr]},e[34836]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[lr]},e[36220]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ar]},e[36238]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[sr]},e[36975]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[33640]},e[36214]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[cr]},e[36232]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5122]},e[36226]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[5124]},e[36208]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[ur]},e[33189]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[cr,ur]},e[33190]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ur]},e[36012]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[lr]},e[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[34042]},e[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[36269]},Object.keys(e).forEach((function(t){const n=e[t];n.bytesPerElementMap={},n.bytesPerElement.forEach((function(e,t){const r=n.type[t];n.bytesPerElementMap[r]=e}))})),yr=e}return yr[e]}function wr(e){const t=vr(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function Sr(e){return 0==(e&e-1)}function Tr(e,t,n,r,i){if(i%1!=0)throw"can't guess dimensions";if(n||r){if(r){if(!n&&(n=i/r)%1)throw"can't guess dimensions"}else if((r=i/n)%1)throw"can't guess dimensions"}else{const e=Math.sqrt(i/(t===tr?6:1));e%1==0?(n=e,r=e):(n=i,r=1)}return{width:n,height:r}}function Er(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(37443,t.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(37441,t.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(37440,t.flipY)}function xr(e){e.pixelStorei(3317,4),Yn(e)&&(e.pixelStorei(3314,0),e.pixelStorei(32878,0),e.pixelStorei(3316,0),e.pixelStorei(3315,0),e.pixelStorei(32877,0))}function _r(e,t,n,r){r.minMag&&(n.call(e,t,10241,r.minMag),n.call(e,t,10240,r.minMag)),r.min&&n.call(e,t,10241,r.min),r.mag&&n.call(e,t,10240,r.mag),r.wrap&&(n.call(e,t,ir,r.wrap),n.call(e,t,or,r.wrap),(t===nr||function(e,t){return typeof WebGLSampler<"u"&&In(t,"WebGLSampler")}(0,t))&&n.call(e,t,32882,r.wrap)),r.wrapR&&n.call(e,t,32882,r.wrapR),r.wrapS&&n.call(e,t,ir,r.wrapS),r.wrapT&&n.call(e,t,or,r.wrapT),r.minLod&&n.call(e,t,33082,r.minLod),r.maxLod&&n.call(e,t,33083,r.maxLod),r.baseLevel&&n.call(e,t,33084,r.baseLevel),r.maxLevel&&n.call(e,t,33085,r.maxLevel)}function Cr(e,t,n){const r=n.target||er;e.bindTexture(r,t),_r(e,r,e.texParameteri,n)}function Ir(e,t,n,r,i,o){o=o||Qn;const s=(n=n||Bn.textureOptions).target||er;if(r=r||n.width,i=i||n.height,e.bindTexture(s,t),function(e,t,n,r){if(!Yn(e))return Sr(t)&&Sr(n);const i=vr(r);if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}(e,r,i,o))e.generateMipmap(s);else{const t=function(e){const t=vr(e);if(!t)throw"unknown internal format";return t.textureFilterable}(o)?9729:9728;e.texParameteri(s,10241,t),e.texParameteri(s,10240,t),e.texParameteri(s,ir,$n),e.texParameteri(s,or,$n)}}function Rr(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function Zr(e,t){return(t=t||{}).cubeFaceOrder||[34069,34070,34071,34072,34073,34074]}function kr(e,t){const n=Zr(0,t).map((function(e,t){return{face:e,ndx:t}}));return n.sort((function(e,t){return e.face-t.face})),n}function Or(e,t,n,r){const i=(r=r||Bn.textureOptions).target||er,o=r.level||0;let s=n.width,a=n.height;const c=r.internalFormat||r.format||Qn,u=wr(c),l=r.format||u.format,d=r.type||u.type;if(Er(e,r),e.bindTexture(i,t),i===tr){const u=n.width,h=n.height;let f,p;if(u/6===h)f=h,p=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===u)f=u,p=[0,0,0,1,0,2,0,3,0,4,0,5];else if(u/3==h/2)f=u/3,p=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(u/2!=h/3)throw"can't figure out cube map from element: "+(n.src?n.src:n.nodeName);f=u/2,p=[0,0,1,0,0,1,1,1,0,2,1,2]}const m=Jn();m?(m.canvas.width=f,m.canvas.height=f,s=f,a=f,kr(0,r).forEach((function(t){const r=p[2*t.ndx+0]*f,i=p[2*t.ndx+1]*f;m.drawImage(n,r,i,f,f,0,0,f,f),e.texImage2D(t.face,o,c,l,d,m.canvas)})),m.canvas.width=1,m.canvas.height=1):typeof createImageBitmap<"u"&&(s=f,a=f,kr(0,r).forEach((function(u){const h=p[2*u.ndx+0]*f,m=p[2*u.ndx+1]*f;e.texImage2D(u.face,o,c,f,f,0,l,d,null),createImageBitmap(n,h,m,f,f,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(n){Er(e,r),e.bindTexture(i,t),e.texImage2D(u.face,o,c,l,d,n),Rr(r)&&Ir(e,t,r,s,a,c)}))})))}else if(i===nr||i===rr){const t=Math.min(n.width,n.height),r=Math.max(n.width,n.height),s=r/t;if(s%1!=0)throw"can not compute 3D dimensions of element";const a=n.width===r?1:0,u=n.height===r?1:0;e.pixelStorei(3317,1),e.pixelStorei(3314,n.width),e.pixelStorei(32878,0),e.pixelStorei(32877,0),e.texImage3D(i,o,c,t,t,t,0,l,d,null);for(let r=0;r<s;++r){const s=r*t*a,c=r*t*u;e.pixelStorei(3316,s),e.pixelStorei(3315,c),e.texSubImage3D(i,o,0,0,r,t,t,1,l,d,n)}xr(e)}else e.texImage2D(i,o,c,l,d,n);Rr(r)&&Ir(e,t,r,s,a,c),Cr(e,t,r)}function Vr(){}function Gr(e,t){return void 0!==t||function(e){if(typeof document<"u"){const t=document.createElement("a");return t.href=e,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}{const t=new URL(location.href).origin;return new URL(e,location.href).origin===t}}(e)?t:"anonymous"}function Ar(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof ImageData<"u"&&e instanceof ImageData||typeof HTMLElement<"u"&&e instanceof HTMLElement}function Wr(e,t,n){return Ar(e)?(setTimeout((function(){n(null,e)})),e):function(e,t,n){let r;if(n=n||Vr,t=Gr(e,t=void 0!==t?t:Bn.crossOrigin),typeof Image<"u"){r=new Image,void 0!==t&&(r.crossOrigin=t);const i=function(){r.removeEventListener("error",o),r.removeEventListener("load",s),r=null},o=function(){const t="couldn't load image: "+e;_n(t),n(t,r),i()},s=function(){n(null,r),i()};return r.addEventListener("error",o),r.addEventListener("load",s),r.src=e,r}if(typeof ImageBitmap<"u"){let i,o;const s=function(){n(i,o)},a={};t&&(a.mode="cors"),fetch(e,a).then((function(e){if(!e.ok)throw e;return e.blob()})).then((function(e){return createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(e){o=e,setTimeout(s)})).catch((function(e){i=e,setTimeout(s)})),r=null}return r}(e,t,n)}function Nr(e,t,n){const r=(n=n||Bn.textureOptions).target||er;if(e.bindTexture(r,t),!1===n.color)return;const i=function(e){return Kn(e=e||Bn.textureColor)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(n.color);if(r===tr)for(let t=0;t<6;++t)e.texImage2D(34069+t,0,Qn,1,1,0,Qn,ar,i);else r===nr||r===rr?e.texImage3D(r,0,Qn,1,1,1,0,Qn,ar,i):e.texImage2D(r,0,Qn,1,1,0,Qn,ar,i)}function Lr(e,t,n,r){r=r||Vr;const i=n.src;if(6!==i.length)throw"there must be 6 urls for a cubemap";const o=n.level||0,s=n.internalFormat||n.format||Qn,a=wr(s),c=n.format||a.format,u=n.type||ar,l=n.target||er;if(l!==tr)throw"target must be TEXTURE_CUBE_MAP";Nr(e,t,n),n=Object.assign({},n);let d=6;const h=[],f=Zr(0,n);let p;p=i.map((function(i,a){return Wr(i,n.crossOrigin,function(i){return function(a,f){--d,a?h.push(a):f.width!==f.height?h.push("cubemap face img is not a square: "+f.src):(Er(e,n),e.bindTexture(l,t),5===d?Zr().forEach((function(t){e.texImage2D(t,o,s,c,u,f)})):e.texImage2D(i,o,s,c,u,f),Rr(n)&&e.generateMipmap(l)),0===d&&r(h.length?h:void 0,t,p)}}(f[a]))}))}function Xr(e,t,n,r){r=r||Vr;const i=n.src,o=n.internalFormat||n.format||Qn,s=wr(o),a=n.format||s.format,c=n.type||ar,u=n.target||rr;if(u!==nr&&u!==rr)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";Nr(e,t,n),n=Object.assign({},n);let l=i.length;const d=[];let h;const f=n.level||0;let p=n.width,m=n.height;const g=i.length;let b=!0;h=i.map((function(i,s){return Wr(i,n.crossOrigin,function(i){return function(s,y){if(--l,s)d.push(s);else{if(Er(e,n),e.bindTexture(u,t),b){b=!1,p=n.width||y.width,m=n.height||y.height,e.texImage3D(u,f,o,p,m,g,0,a,c,null);for(let t=0;t<g;++t)e.texSubImage3D(u,f,0,0,t,p,m,1,a,c,y)}else{let t,n=y;(y.width!==p||y.height!==m)&&(t=Jn(),n=t.canvas,t.canvas.width=p,t.canvas.height=m,t.drawImage(y,0,0,p,m)),e.texSubImage3D(u,f,0,0,i,p,m,1,a,c,n),t&&n===t.canvas&&(t.canvas.width=0,t.canvas.height=0)}Rr(n)&&e.generateMipmap(u)}0===l&&r(d.length?d:void 0,t,h)}}(s))}))}function Mr(e,t,n,r){const i=(r=r||Bn.textureOptions).target||er;e.bindTexture(i,t);let o=r.width,s=r.height,a=r.depth;const c=r.level||0,u=r.internalFormat||r.format||Qn,l=wr(u),d=r.format||l.format,h=r.type||function(e,t,n){return Kn(t)?Sn(t):n||ar}(0,n,l.type);if(Kn(n))n instanceof Uint8ClampedArray&&(n=new Uint8Array(n.buffer));else{const e=En(h);n=new e(n)}const f=function(e,t){const n=vr(e);if(!n)throw"unknown internal format";const r=n.bytesPerElementMap[t];if(void 0===r)throw"unknown internal format";return r}(u,h),p=n.byteLength/f;if(p%1)throw"length wrong size for format: "+Dn(e,d);let m;if(i===nr||i===rr)if(o||s||a)!o||s&&a?!s||o&&a?(m=Tr(0,i,o,s,p/a),o=m.width,s=m.height):(m=Tr(0,i,o,a,p/s),o=m.width,a=m.height):(m=Tr(0,i,s,a,p/o),s=m.width,a=m.height);else{const e=Math.cbrt(p);if(e%1!=0)throw"can't guess cube size of array of numElements: "+p;o=e,s=e,a=e}else m=Tr(0,i,o,s,p),o=m.width,s=m.height;if(xr(e),e.pixelStorei(3317,r.unpackAlignment||1),Er(e,r),i===tr){const t=p/6*(f/n.BYTES_PER_ELEMENT);kr(0,r).forEach(r=>{const i=t*r.ndx,a=n.subarray(i,i+t);e.texImage2D(r.face,c,u,o,s,0,d,h,a)})}else i===nr||i===rr?e.texImage3D(i,c,u,o,s,a,0,d,h,n):e.texImage2D(i,c,u,o,s,0,d,h,n);return{width:o,height:s,depth:a,type:h}}function Fr(e,t,n){n=n||Vr,t=t||Bn.textureOptions;const r=e.createTexture(),i=t.target||er;let o=t.width||1,s=t.height||1;const a=t.internalFormat||Qn;e.bindTexture(i,r),i===tr&&(e.texParameteri(i,ir,$n),e.texParameteri(i,or,$n));let c=t.src;if(c)if("function"==typeof c&&(c=c(e,t)),"string"==typeof c)!function(e,t,n,r){r=r||Vr,Nr(e,t,n=n||Bn.textureOptions),Wr((n=Object.assign({},n)).src,n.crossOrigin,(function(i,o){i?r(i,t,o):(Or(e,t,o,n),r(null,t,o))}))}(e,r,t,n);else if(Kn(c)||Array.isArray(c)&&("number"==typeof c[0]||Array.isArray(c[0])||Kn(c[0]))){const n=Mr(e,r,c,t);o=n.width,s=n.height}else Array.isArray(c)&&("string"==typeof c[0]||Ar(c[0]))?i===tr?Lr(e,r,t,n):Xr(e,r,t,n):(Or(e,r,c,t),o=c.width,s=c.height);else!function(e,t,n){const r=n.target||er;e.bindTexture(r,t);const i=n.level||0,o=n.internalFormat||n.format||Qn,s=wr(o),a=n.format||s.format,c=n.type||s.type;if(Er(e,n),r===tr)for(let t=0;t<6;++t)e.texImage2D(34069+t,i,o,n.width,n.height,0,a,c,null);else r===nr||r===rr?e.texImage3D(r,i,o,n.width,n.height,n.depth,0,a,c,null):e.texImage2D(r,i,o,n.width,n.height,0,a,c,null)}(e,r,t);return Rr(t)&&Ir(e,r,t,o,s,a),Cr(e,r,t),r}const Pr=_n;function jr(e){return typeof document<"u"&&document.getElementById?document.getElementById(e):null}const Ur=33984,Hr=34962,Yr=34067,Dr=35866,Br={};function Kr(e,t){return Br[t].bindPoint}function Jr(e,t){return function(n){e.uniform1i(t,n)}}function zr(e,t){return function(n){e.uniform1iv(t,n)}}function Qr(e,t){return function(n){e.uniform2iv(t,n)}}function qr(e,t){return function(n){e.uniform3iv(t,n)}}function $r(e,t){return function(n){e.uniform4iv(t,n)}}function ei(e,t,n,r){const i=Kr(0,t);return Yn(e)?function(t){let o,s;Rn(0,t)?(o=t,s=null):(o=t.texture,s=t.sampler),e.uniform1i(r,n),e.activeTexture(Ur+n),e.bindTexture(i,o),e.bindSampler(n,s)}:function(t){e.uniform1i(r,n),e.activeTexture(Ur+n),e.bindTexture(i,t)}}function ti(e,t,n,r,i){const o=Kr(0,t),s=new Int32Array(i);for(let e=0;e<i;++e)s[e]=n+e;return Yn(e)?function(t){e.uniform1iv(r,s),t.forEach((function(t,r){let i,a;e.activeTexture(Ur+s[r]),Rn(0,t)?(i=t,a=null):(i=t.texture,a=t.sampler),e.bindSampler(n,a),e.bindTexture(o,i)}))}:function(t){e.uniform1iv(r,s),t.forEach((function(t,n){e.activeTexture(Ur+s[n]),e.bindTexture(o,t)}))}}function ni(e,t){return function(n){if(n.value)switch(e.disableVertexAttribArray(t),n.value.length){case 4:e.vertexAttrib4fv(t,n.value);break;case 3:e.vertexAttrib3fv(t,n.value);break;case 2:e.vertexAttrib2fv(t,n.value);break;case 1:e.vertexAttrib1fv(t,n.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n.numComponents||n.size,n.type||5126,n.normalize||!1,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function ri(e,t){return function(n){if(n.value){if(e.disableVertexAttribArray(t),4!==n.value.length)throw new Error("The length of an integer constant value must be 4!");e.vertexAttrib4iv(t,n.value)}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||5124,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function ii(e,t){return function(n){if(n.value){if(e.disableVertexAttribArray(t),4!==n.value.length)throw new Error("The length of an unsigned integer constant value must be 4!");e.vertexAttrib4uiv(t,n.value)}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||5125,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function oi(e,t,n){const r=n.size,i=n.count;return function(n){e.bindBuffer(Hr,n.buffer);const o=n.size||n.numComponents||r,s=o/i,a=n.type||5126,c=Br[a].size*o,u=n.normalize||!1,l=n.offset||0,d=c/i;for(let r=0;r<i;++r)e.enableVertexAttribArray(t+r),e.vertexAttribPointer(t+r,s,a,u,c,l+d*r),e.vertexAttribDivisor&&e.vertexAttribDivisor(t+r,n.divisor||0)}}Br[5126]={Type:Float32Array,size:4,setter:function(e,t){return function(n){e.uniform1f(t,n)}},arraySetter:function(e,t){return function(n){e.uniform1fv(t,n)}}},Br[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(n){e.uniform2fv(t,n)}},cols:2},Br[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(n){e.uniform3fv(t,n)}},cols:3},Br[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(n){e.uniform4fv(t,n)}},cols:4},Br[5124]={Type:Int32Array,size:4,setter:Jr,arraySetter:zr},Br[35667]={Type:Int32Array,size:8,setter:Qr,cols:2},Br[35668]={Type:Int32Array,size:12,setter:qr,cols:3},Br[35669]={Type:Int32Array,size:16,setter:$r,cols:4},Br[5125]={Type:Uint32Array,size:4,setter:function(e,t){return function(n){e.uniform1ui(t,n)}},arraySetter:function(e,t){return function(n){e.uniform1uiv(t,n)}}},Br[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(n){e.uniform2uiv(t,n)}},cols:2},Br[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(n){e.uniform3uiv(t,n)}},cols:3},Br[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(n){e.uniform4uiv(t,n)}},cols:4},Br[35670]={Type:Uint32Array,size:4,setter:Jr,arraySetter:zr},Br[35671]={Type:Uint32Array,size:8,setter:Qr,cols:2},Br[35672]={Type:Uint32Array,size:12,setter:qr,cols:3},Br[35673]={Type:Uint32Array,size:16,setter:$r,cols:4},Br[35674]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2fv(t,!1,n)}},rows:2,cols:2},Br[35675]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3fv(t,!1,n)}},rows:3,cols:3},Br[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4fv(t,!1,n)}},rows:4,cols:4},Br[35685]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x3fv(t,!1,n)}},rows:2,cols:3},Br[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x4fv(t,!1,n)}},rows:2,cols:4},Br[35687]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x2fv(t,!1,n)}},rows:3,cols:2},Br[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x4fv(t,!1,n)}},rows:3,cols:4},Br[35689]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x2fv(t,!1,n)}},rows:4,cols:2},Br[35690]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x3fv(t,!1,n)}},rows:4,cols:3},Br[35678]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[35680]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[35679]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[35682]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36289]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36292]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36293]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36298]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36299]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[36300]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36303]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36306]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36307]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[36308]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36311]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr};const si={};si[5126]={size:4,setter:ni},si[35664]={size:8,setter:ni},si[35665]={size:12,setter:ni},si[35666]={size:16,setter:ni},si[5124]={size:4,setter:ri},si[35667]={size:8,setter:ri},si[35668]={size:12,setter:ri},si[35669]={size:16,setter:ri},si[5125]={size:4,setter:ii},si[36294]={size:8,setter:ii},si[36295]={size:12,setter:ii},si[36296]={size:16,setter:ii},si[35670]={size:4,setter:ri},si[35671]={size:8,setter:ri},si[35672]={size:12,setter:ri},si[35673]={size:16,setter:ri},si[35674]={size:4,setter:oi,count:2},si[35675]={size:9,setter:oi,count:3},si[35676]={size:16,setter:oi,count:4};const ai=/ERROR:\s*\d+:(\d+)/gi;const ci=/^[ \t]*\n/;function ui(e){let t=0;return ci.test(e)&&(t=1,e=e.replace(ci,"")),{lineOffset:t,shaderSource:e}}function li(e,t,n,r){if(r=r||Pr,!e.getShaderParameter(n,35713)){const i=e.getShaderInfoLog(n),{lineOffset:o,shaderSource:s}=ui(e.getShaderSource(n)),a=`${function(e,t="",n=0){const r=[...t.matchAll(ai)],i=new Map(r.map((e,n)=>{const i=parseInt(e[1]),o=r[n+1],s=o?o.index:t.length;return[i-1,t.substring(e.index,s)]}));return e.split("\n").map((e,t)=>{const r=i.get(t);return`${t+1+n}: ${e}${r?"\n\n^^^ "+r:""}`}).join("\n")}(s,i,o)}\nError compiling ${Dn(e,t)}: ${i}`;return r(a),a}return""}function di(e,t,n){let r,i,o;if("function"==typeof t&&(n=t,t=void 0),"function"==typeof e)n=e,e=void 0;else if(e&&!Array.isArray(e)){const t=e;n=t.errorCallback,e=t.attribLocations,r=t.transformFeedbackVaryings,i=t.transformFeedbackMode,o=t.callback}const s=n||Pr,a=[],c={errorCallback(e,...t){a.push(e),s(e,...t)},transformFeedbackVaryings:r,transformFeedbackMode:i,callback:o,errors:a};{let n={};Array.isArray(e)?e.forEach((function(e,r){n[e]=t?t[r]:r})):n=e||{},c.attribLocations=n}return c}const hi=["VERTEX_SHADER","FRAGMENT_SHADER"];function fi(e,t){return t.indexOf("frag")>=0?35632:t.indexOf("vert")>=0?35633:void 0}const pi=(t=0)=>new e(e=>setTimeout(e,t));function mi(e,t,n,r,i){const o=di(n,r,i),s=new Set(t),a=function(e,t,n){const r=e.createProgram(),{attribLocations:i,transformFeedbackVaryings:o,transformFeedbackMode:s}=di(n);for(let n=0;n<t.length;++n){let i=t[n];if("string"==typeof i){const t=jr(i),o=t?t.text:i;let s=e[hi[n]];t&&t.type&&(s=fi(0,t.type)||s),i=e.createShader(s),e.shaderSource(i,ui(o).shaderSource),e.compileShader(i),e.attachShader(r,i)}}Object.entries(i).forEach(([t,n])=>e.bindAttribLocation(r,n,t));{let t=o;t&&(t.attribs&&(t=t.attribs),Array.isArray(t)||(t=Object.keys(t)),e.transformFeedbackVaryings(r,t,s||35981))}return e.linkProgram(r),r}(e,t,o);function c(e,t){const n=function(e,t,n){if(n=n||Pr,!e.getProgramParameter(t,35714)){const r=e.getProgramInfoLog(t);n("Error in program linking: "+r);const i=e.getAttachedShaders(t).map(t=>li(e,e.getShaderParameter(t,e.SHADER_TYPE),t,n));return`${r}\n${i.filter(e=>e).join("\n")}`}}(e,t,o.errorCallback);return n&&function(e,t,n){const r=e.getAttachedShaders(t);for(const t of r)n.has(t)&&e.deleteShader(t);e.deleteProgram(t)}(e,t,s),n}if(!o.callback)return c(e,a)?void 0:a;(async function(e,t){const n=e.getExtension("KHR_parallel_shader_compile"),r=n?(e,t)=>e.getProgramParameter(t,n.COMPLETION_STATUS_KHR):()=>!0;let i=0;do{await pi(i),i=1e3/60}while(!r(e,t))})(e,a).then(()=>{const t=c(e,a);o.callback(t,t?void 0:a)})}function gi(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const bi=/(\.|\[|]|\w+)/g,yi=e=>e>="0"&&e<="9";function vi(e,t,n,r){const i=e.split(bi).filter(e=>""!==e);let o=0,s="";for(;;){const e=i[o++];s+=e;const a=yi(e[0]),c=a?parseInt(e):e;if(a&&(s+=i[o++]),o===i.length){n[c]=t;break}{const e=i[o++],t="["===e,a=n[c]||(t?[]:{});n[c]=a,n=a,r[s]=r[s]||function(e){return function(t){wi(e,t)}}(a),s+=e}}}function wi(e,t){for(const n in t){const r=e[n];"function"==typeof r?r(t[n]):wi(e[n],t[n])}}function Si(e,t){const n=function(e,t){let n=0;function r(t,r,i){const o=r.name.endsWith("[0]"),s=r.type,a=Br[s];if(!a)throw new Error("unknown type: 0x"+s.toString(16));let c;if(a.bindPoint){const t=n;n+=r.size,c=o?a.arraySetter(e,s,t,i,r.size):a.setter(e,s,t,i,r.size)}else c=a.arraySetter&&o?a.arraySetter(e,i):a.setter(e,i);return c.location=i,c}const i={},o={},s=e.getProgramParameter(t,35718);for(let n=0;n<s;++n){const s=e.getActiveUniform(t,n);if(gi(s))continue;let a=s.name;a.endsWith("[0]")&&(a=a.substr(0,a.length-3));const c=e.getUniformLocation(t,s.name);if(c){const e=r(0,s,c);i[a]=e,vi(a,e,o,i)}}return i}(e,t),r=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;++i){const r=e.getActiveAttrib(t,i);if(gi(r))continue;const o=e.getAttribLocation(t,r.name),s=si[r.type],a=s.setter(e,o,s);a.location=o,n[r.name]=a}return n}(e,t),i={program:t,uniformSetters:n,attribSetters:r};return Yn(e)&&(i.uniformBlockSpec=function(e,t){const n=e.getProgramParameter(t,35718),r=[],i=[];for(let o=0;o<n;++o){i.push(o),r.push({});const n=e.getActiveUniform(t,o);r[o].name=n.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(n){const o=n[0],s=n[1];e.getActiveUniforms(t,i,e[o]).forEach((function(e,t){r[t][s]=e}))}));const o={},s=e.getProgramParameter(t,35382);for(let n=0;n<s;++n){const r=e.getActiveUniformBlockName(t,n),i={index:e.getUniformBlockIndex(t,r),usedByVertexShader:e.getActiveUniformBlockParameter(t,n,35396),usedByFragmentShader:e.getActiveUniformBlockParameter(t,n,35398),size:e.getActiveUniformBlockParameter(t,n,35392),uniformIndices:e.getActiveUniformBlockParameter(t,n,35395)};i.used=i.usedByVertexShader||i.usedByFragmentShader,o[r]=i}return{blockSpecs:o,uniformData:r}}(e,t),i.transformFeedbackInfo=function(e,t){const n={},r=e.getProgramParameter(t,35971);for(let i=0;i<r;++i){const r=e.getTransformFeedbackVarying(t,i);n[r.name]={index:i,type:r.type,size:r.size}}return n}(e,t)),i}const Ti=/\s|{|}|;/;function Ei(e,t,n,r,i){const o=di(n,r,i),s=[];if(t=t.map((function(e){if(!Ti.test(e)){const t=jr(e);if(t)e=t.text;else{const t="no element with id: "+e;o.errorCallback(t),s.push(t)}}return e})),s.length)return function(e,t){return e.errorCallback(t),e.callback&&setTimeout(()=>{e.callback(`${t}\n${e.errors.join("\n")}`)}),null}(o,"");const a=o.callback;a&&(o.callback=(t,n)=>{a(t,t?void 0:Si(e,n))});const c=function(e,t,n,r,i){return mi(e,t,n,r,i)}(e,t,o);return c?Si(e,c):null}const xi=36161,_i=36096,Ci=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],Ii={};Ii[34041]=33306,Ii[6401]=36128,Ii[36168]=36128,Ii[6402]=_i,Ii[33189]=_i,Ii[33190]=_i,Ii[36012]=_i,Ii[35056]=33306,Ii[36013]=33306;const Ri={};Ri[32854]=!0,Ri[32855]=!0,Ri[36194]=!0,Ri[34041]=!0,Ri[33189]=!0,Ri[6401]=!0,Ri[36168]=!0;function Zi(e,t,n,r){const i=36160,o=e.createFramebuffer();e.bindFramebuffer(i,o),n=n||e.drawingBufferWidth,r=r||e.drawingBufferHeight;const s=[],a={framebuffer:o,attachments:[],width:n,height:r};return(t=t||Ci).forEach((function(t,o){let c=t.attachment;const u=t.samples,l=t.format;let d=t.attachmentPoint||function(e,t){return Ii[e]||Ii[t]}(l,t.internalFormat);if(d||(d=36064+o),function(e){return e>=36064&&e<36096}(d)&&s.push(d),!c)if(void 0!==u||function(e){return Ri[e]}(l))c=e.createRenderbuffer(),e.bindRenderbuffer(xi,c),u>1?e.renderbufferStorageMultisample(xi,u,l,n,r):e.renderbufferStorage(xi,l,n,r);else{const i=Object.assign({},t);i.width=n,i.height=r,void 0===i.auto&&(i.auto=!1,i.min=i.min||i.minMag||9729,i.mag=i.mag||i.minMag||9729,i.wrapS=i.wrapS||i.wrap||33071,i.wrapT=i.wrapT||i.wrap||33071),c=Fr(e,i)}if(function(e,t){return typeof WebGLRenderbuffer<"u"&&In(t,"WebGLRenderbuffer")}(0,c))e.framebufferRenderbuffer(i,d,xi,c);else{if(!Rn(0,c))throw new Error("unknown attachment type");void 0!==t.layer?e.framebufferTextureLayer(i,d,c,t.level||0,t.layer):e.framebufferTexture2D(i,d,t.target||3553,c,t.level||0)}a.attachments.push(c)})),e.drawBuffers&&e.drawBuffers(s),a}function ki(e,t){return()=>t instanceof WebGLTexture?t:Fr(e,{src:t,wrap:e.CLAMP_TO_EDGE})}class Oi{constructor(e){o(this,"id","_"),o(this,"context"),o(this,"output"),o(this,"fbi"),o(this,"options"),o(this,"programInfo"),o(this,"bufferInfo"),o(this,"profiler"),o(this,"lastRun");const{context:t,width:n,height:r}=e;this.context=t,this.options=e;const i=this.buildDefines();this.programInfo=Ei(this.context,[i+this.getVertexShader(),i+this.getFragmentShader()]),this.bufferInfo=Hn(this.context,this.getBuffers()),this.fbi=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],n,r),this.output=this.fbi.attachments[0]}resizeOutput(e,t){this.fbi=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],e,t),this.options.width=e,this.options.height=t,this.output=this.fbi.attachments[0]}getDefines(){return{}}getBuffers(){return{position:{numComponents:2,data:[-1,-1,-1,1,1,-1,1,1,-1,1,1,-1]},texture_coord:{numComponents:2,data:[0,0,0,1,1,0,1,1,0,1,1,0]}}}buildDefines(){let e="";const t=this.getDefines();for(let n in t)e+=`#define ${n} ${t[n].toFixed(1)}\n`;return e}run(e){var t,n,r,i,o,s;null==(t=this.profiler)||t.pushContext(`[${this.id}] PROG : ${this.constructor.name}`),null==(n=this.profiler)||n.pushContext(`[${this.id}] UNIFORMS`);for(const t in e)"function"==typeof e[t]&&(null==(r=this.profiler)||r.pushContext(`[${this.id}] UNI : ${t}`),e[t]=e[t](),null==(i=this.profiler)||i.popContext(`[${this.id}] UNI : ${t}`));null==(o=this.profiler)||o.popContext(`[${this.id}] UNIFORMS`);const a=Date.now();let c=0;this.lastRun&&(c=(a-this.lastRun)/1e3),this.lastRun=a,this.context.viewport(0,0,this.context.canvas.width,this.context.canvas.height),this.context.useProgram(this.programInfo.program),function(e,t,n){n.vertexArrayObject?e.bindVertexArray(n.vertexArrayObject):(function(e,t){for(const n in t){const r=e[n];r&&r(t[n])}}(t.attribSetters||t,n.attribs),n.indices&&e.bindBuffer(34963,n.indices))}(this.context,this.programInfo,this.bufferInfo),function e(t,...n){const r=t.uniformSetters||t,i=n.length;for(let t=0;t<i;++t){const i=n[t];if(Array.isArray(i)){const t=i.length;for(let n=0;n<t;++n)e(r,i[n])}else for(const e in i){const t=r[e];t&&t(i[e])}}}(this.programInfo,{delta:c,canvas:[this.context.canvas.width,this.context.canvas.height],...e}),function(e,t,n){n=n||36160,t?(e.bindFramebuffer(n,t.framebuffer),e.viewport(0,0,t.width,t.height)):(e.bindFramebuffer(n,null),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight))}(this.context,this.options.disableFramebuffer?null:this.fbi),function(e,t,n,r,i,o){n=void 0===n?4:n;const s=t.indices,a=t.elementType,c=void 0===r?t.numElements:r;i=void 0===i?0:i,a||s?void 0!==o?e.drawElementsInstanced(n,c,void 0===a?5123:t.elementType,i,o):e.drawElements(n,c,void 0===a?5123:t.elementType,i):void 0!==o?e.drawArraysInstanced(n,i,c,o):e.drawArrays(n,i,c)}(this.context,this.bufferInfo),null==(s=this.profiler)||s.popContext(`[${this.id}] PROG : ${this.constructor.name}`)}setProfiler(e){this.profiler=e}}class Vi extends Oi{getDefines(){var e;return{RADIUS:null!=(e=this.options.radius)?e:1}}getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\nuniform sampler2D mask;\n\nvec4 loop();\n\nvoid main() { gl_FragColor = loop(); }\n"+this.createLoopFunction()}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}createLoopFunction(){var e;let t=null!=(e=this.options.radius)?e:1;return`\n\n vec4 loop() { \n vec4 result = vec4(0,0,0,0);\n float factorSum = 0.;\n\n vec2 normalizedRadius = vec2(-${t}.) / canvas;\n vec2 normalizedIncrement = vec2(1.) / canvas;\n vec2 diff = normalizedRadius;\n float maxLength = length(normalizedRadius);\n\n for(int y=-${t}; y<${t+1}; ++y) {\n for(int x=-${t}; x<${t+1}; ++x) {\n float factor = (1.- texture2D(mask, _texture_coord + diff).a) * (maxLength - length(diff)) / maxLength;\n result += factor * texture2D(texture, _texture_coord + diff);\n factorSum += factor;\n diff.x += normalizedIncrement.x;\n }\n diff.y += normalizedIncrement.y;\n diff.x = normalizedRadius.x;\n }\n return result / factorSum;\n }`}}class Gi extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform sampler2D background;\nuniform sampler2D foreground;\nuniform sampler2D threshold;\n\nvoid main() {\n vec4 backgroundColor = texture2D(background, _texture_coord);\n vec4 foregroundColor = texture2D(foreground, _texture_coord);\n vec4 tresholdColor = texture2D(threshold, _texture_coord);\n gl_FragColor = foregroundColor * tresholdColor.a +\n backgroundColor * (1. - tresholdColor.a);\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n _texture_coord.y = 1. - texture_coord.y;\n}\n"}}class Ai{constructor(){o(this,"steps",[]),o(this,"profiler")}addStep(e){this.steps.push(e)}async run(){for(const e of this.steps)e.program.run(e.getUniforms())}resizeOutput(e,t){var n,r;null==(n=this.profiler)||n.pushContext(`PIP [${this.constructor.name}]`);for(const n of this.steps)n.preventResize||n.program.resizeOutput(e,t);null==(r=this.profiler)||r.popContext(`PIP [${this.constructor.name}]`)}setProfiler(e){this.profiler=e;for(const t of this.steps)t.program.setProfiler(e)}setId(e){for(const t of this.steps)t.program.id=e}}class Wi extends Ai{constructor(){super(...arguments),o(this,"preciseMaskEnabled",!1)}}class Ni extends Wi{constructor(e,t){super(),o(this,"inputImage"),o(this,"inputMask"),o(this,"blur"),this.context=e,this.radius=t;const n={context:e,height:e.canvas.height,width:e.canvas.width};this.blur=new Vi({...n,radius:t,...this.getBlurTextureSize(e.canvas.width,e.canvas.height)});const r=new Gi({...n,disableFramebuffer:!0});this.addStep({program:this.blur,preventResize:!0,getUniforms:()=>({texture:ki(e,this.inputImage),mask:ki(e,this.inputMask)})}),this.addStep({program:r,getUniforms:()=>({background:ki(e,this.blur.output),foreground:ki(e,this.inputImage),threshold:ki(e,this.inputMask)})})}getBlurTextureSize(e,t){const n=this.radius>10?8:2;return{width:Math.max(2,e/n),height:Math.max(2,t/n)}}setData(e,t){this.inputImage=e,this.inputMask=t}resizeOutput(e,t){super.resizeOutput(e,t);const n=this.getBlurTextureSize(e,t);this.blur.resizeOutput(n.width,n.height)}}class Li extends Wi{constructor(e){super(),o(this,"inputImage"),o(this,"inputBackgroundImage"),o(this,"inputMask"),o(this,"preciseMaskEnabled",!0),this.context=e;const t={context:e,height:e.canvas.height,width:e.canvas.width},n=new Gi({...t,disableFramebuffer:!0});this.addStep({program:n,getUniforms:()=>({background:ki(e,this.inputBackgroundImage),foreground:ki(e,this.inputImage),threshold:ki(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class Xi extends Li{constructor(){super(...arguments),o(this,"frameReader"),o(this,"preciseMaskEnabled",!0)}set inputVideo(e){this.frameReader=e.getReader(),this.readNextVideoFrame()}async run(){this.frameReader&&(await super.run(),this.readNextVideoFrame())}async readNextVideoFrame(){var e;const t=await(null==(e=this.frameReader)?void 0:e.read());null!=t&&t.value&&(this.inputBackgroundImage=await createImageBitmap(t.value),t.value.close())}}var Mi=(e=>(e[e.LINEAR=0]="LINEAR",e[e.GAUSSIAN=1]="GAUSSIAN",e))(Mi||{});class Fi extends Oi{getDefines(){var e;return{RADIUS:null!=(e=this.options.radius)?e:1}}getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvec4 loop();\n\nvoid main() { gl_FragColor = loop(); }\n"+this.createLoopFunction()}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}createLoopFunction(){var e;let t=null!=(e=this.options.radius)?e:1;return`\n\n vec4 loop() { \n vec4 result = vec4(0,0,0,0);\n float factorSum = 0.;\n\n vec2 normalizedRadius = vec2(-${t}.) / canvas;\n vec2 normalizedIncrement = vec2(1.) / canvas;\n vec2 diff = normalizedRadius;\n\n for(int y=-${t}; y<${t+1}; ++y) {\n for(int x=-${t}; x<${t+1}; ++x) {\n float factor = 1.;\n result += factor * texture2D(texture, _texture_coord + diff);\n factorSum += factor;\n diff.x += normalizedIncrement.x;\n }\n diff.y += normalizedIncrement.y;\n diff.x = normalizedRadius.x;\n }\n return result / factorSum;\n }`}getFactor(e,t){switch(this.options.type){case 1:return this.getLinearFactor(e,t);case 0:default:return this.getLinearFactor(e,t)}}getLinearFactor(e,t){return 1}getGaussianFactor(e,t){var n;const r=1/(2*Math.PI*Math.max(null!=(n=this.options.radius)?n:1,1)**2),i=r*-(e**2+t**2);return r*Math.E**i}}class Pi extends Wi{constructor(e,t){super(),o(this,"inputImage"),o(this,"inputMask"),this.context=e;const n={context:e,height:e.canvas.height,width:e.canvas.width},r=new Fi({...n,radius:t,type:Mi.GAUSSIAN}),i=new Gi({...n,disableFramebuffer:!0});this.addStep({program:r,getUniforms:()=>({texture:ki(e,this.inputImage)})}),this.addStep({program:i,getUniforms:()=>({background:ki(e,this.inputImage),foreground:ki(e,r.output),threshold:ki(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class ji extends Oi{constructor(e){super(e),o(this,"fbi2"),this.fbi2=Zi(e.context,[{format:e.context.RGBA,type:e.context.UNSIGNED_BYTE,min:e.context.LINEAR,mag:e.context.LINEAR,wrap:e.context.CLAMP_TO_EDGE}],e.width,e.height)}run(e){const t=this.fbi;this.fbi=this.fbi2,this.fbi2=t,this.output=this.fbi.attachments[0],super.run({...e,previous_rendering:this.fbi2.attachments[0]})}resizeOutput(e,t){super.resizeOutput(e,t),this.fbi2=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],e,t)}}class Ui extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\n// uniform float treshold;\nuniform sampler2D image_now;\nuniform sampler2D image_before;\nuniform sampler2D mask_now;\nuniform sampler2D mask_before;\nuniform sampler2D previous_rendering;\nuniform vec2 canvas;\n\nuniform float delta;\n\nfloat current_factor = 0.69;\nfloat previous_factor = 0.74;\nfloat threshold_activation = 0.54;\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nfloat getThreshold() {\n vec4 color = vec4(0.);\n for (float y = -6.; y < 7.; y += 1.) {\n for (float x = -6.; x < 7.; x += 1.) {\n vec4 image_now_color =\n texture2D(image_now, _texture_coord + vec2(x, y) / canvas);\n vec4 image_before_color =\n texture2D(image_before, _texture_coord + vec2(x, y) / canvas);\n color += abs(image_before_color - image_now_color);\n }\n }\n return (color.x + color.y + color.z) / (3. * 9.);\n}\n\nvoid main() {\n float treshold_input = .4;\n float treshold_previous_rendering = .98;\n\n vec4 mask_now_color = texture2D(mask_now, _texture_coord);\n vec4 mask_before_color = texture2D(mask_before, _texture_coord);\n vec4 previous_rendering_color = texture2D(previous_rendering, _texture_coord);\n\n vec3 mask_diff = abs(mask_before_color.xyz - mask_now_color.xyz);\n float flickering = mask_diff.x;\n float threshold = getThreshold();\n if (threshold < threshold_activation) {\n gl_FragColor = vec4(flickering, 0., 0., 1.) * current_factor +\n previous_rendering_color * previous_factor;\n gl_FragColor *= (1. - threshold);\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Hi extends Oi{getFragmentShader(){return"#version 300 es\n// https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/jointBilateralFilterStage.ts\n\nprecision highp float;\nuniform sampler2D input_frame;\nuniform sampler2D segmentation_mask;\nuniform sampler2D threshold;\nuniform vec2 texel_size;\nuniform float step;\nuniform float radius;\nuniform float offset;\nuniform float sigma_texel;\nuniform float sigma_color;\n\nin vec2 _texture_coord;\nout vec4 outColor;\n\nfloat gaussian(float x, float sigma) {\n float coeff = -0.5 / (sigma * sigma * 4.0 + 1.0e-6);\n return exp((x * x) * coeff);\n}\n\nvoid main() {\n vec2 centerCoord = _texture_coord;\n vec3 centerColor = texture(input_frame, centerCoord).rgb;\n float newVal = 0.0;\n float spaceWeight = 0.0;\n float colorWeight = 0.0;\n float totalWeight = 0.0;\n // Subsample kernel space.\n for (float i = -radius + offset; i <= radius; i += step) {\n for (float j = -radius + offset; j <= radius; j += step) {\n vec2 shift = vec2(j, i) * texel_size;\n vec2 coord = vec2(centerCoord + shift);\n vec3 frameColor = texture(input_frame, coord).rgb;\n float threshold = texture(threshold, coord).a;\n float outVal = texture(segmentation_mask, coord).a;\n\n spaceWeight = gaussian(distance(centerCoord, coord), sigma_texel);\n colorWeight = gaussian(distance(centerColor, frameColor), sigma_color);\n totalWeight += spaceWeight * colorWeight;\n newVal += spaceWeight * colorWeight * outVal * threshold;\n }\n }\n newVal /= totalWeight;\n outColor = vec4(vec3(0.), newVal);\n}"}getVertexShader(){return"#version 300 es\nin vec2 position;\nin vec2 texture_coord;\nout vec2 _texture_coord;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n _texture_coord = texture_coord;\n}"}}class Yi extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvoid main() {\n int count = 0;\n for (float y = -1.; y < 2.; y += 1.) {\n for (float x = -1.; x < 2.; x += 1.) {\n vec2 coord = _texture_coord + vec2(y, x) / canvas;\n vec4 color = texture2D(texture, coord);\n if (color.r > .1) {\n count++;\n }\n }\n }\n if (count > 5) {\n gl_FragColor = texture2D(texture, _texture_coord);\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Di extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvoid main() {\n vec4 color = texture2D(texture, _texture_coord);\n for (float y = -2.; y < 3.; y += 1.) {\n for (float x = -2.; x < 3.; x += 1.) {\n vec2 coord = _texture_coord;\n coord += vec2(y, x) / canvas;\n color += texture2D(texture, coord) * (1. / 4.);\n }\n }\n\n gl_FragColor = color;\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Bi extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform sampler2D threshold;\nuniform sampler2D inputs;\n\nvoid main() {\n vec4 inputs_color = texture2D(inputs, _texture_coord);\n vec4 threshold_color = texture2D(threshold, _texture_coord);\n if (threshold_color.r < .1 && inputs_color.r > .5) {\n gl_FragColor = inputs_color;\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Ki extends Ai{constructor(e,t,n){super(),o(this,"inputImage"),o(this,"inputMask"),o(this,"previousInputImage"),o(this,"previousInputMask"),o(this,"output"),o(this,"options",{currentThresholdMinimum:0,currentThresholdMaximum:1,previousThresholdMinimum:0,previousThresholdMaximum:1,thresholdMinimum:0,thresholdMaximum:1,thresholdFactor:1}),this.context=e;const r={context:e,height:n,width:t},i=new Ui(r),s=new Fi({...r,radius:1,type:Mi.GAUSSIAN}),a=new Bi(r),c=new Di(r),u=new Yi(r),l=new Hi({...r});let d=1;d*=Math.max(2.5,480/144);const h=Math.max(1,.66*Math.sqrt(d));this.addStep({program:i,getUniforms:()=>({image_now:ki(e,this.inputImage),image_before:ki(e,this.previousInputImage),mask_now:ki(e,this.inputMask),mask_before:ki(e,this.previousInputMask),current_threshold_minimum:this.options.currentThresholdMinimum,current_threshold_maximum:this.options.currentThresholdMaximum,previous_threshold_minimum:this.options.previousThresholdMinimum,previous_threshold_maximum:this.options.previousThresholdMaximum,threshold_minimum:this.options.thresholdMinimum,threshold_maximum:this.options.thresholdMaximum,threshold_factor:this.options.thresholdFactor})}),this.addStep({program:a,getUniforms:()=>({inputs:ki(e,this.inputMask),threshold:ki(e,i.output)})}),this.addStep({program:u,getUniforms:()=>({texture:ki(e,a.output)})}),this.addStep({program:c,getUniforms:()=>({texture:ki(e,u.output)})}),this.addStep({program:s,getUniforms:()=>({texture:ki(e,c.output)})}),this.addStep({program:l,getUniforms:()=>({input_frame:ki(e,this.inputImage),segmentation_mask:ki(e,this.inputMask),threshold:ki(e,s.output),texel_size:[1/640,1/480],step:h,radius:d,offset:h>1?.5*h:0,sigma_texel:Math.max(1/640,1/480)*d,sigma_color:.1})}),this.output=l.output}setData(e,t){this.previousInputImage=this.inputImage?this.inputImage:e,this.previousInputMask=this.inputMask?this.inputMask:t,this.inputImage=e,this.inputMask=t}setOptions(e){this.options=e}}class Ji extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\nuniform sampler2D texture;\n\nvoid main() { gl_FragColor = texture2D(texture, _texture_coord); }\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\nuniform bool invert_y;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n if (invert_y) {\n _texture_coord.y = 1. - texture_coord.y;\n }\n}\n"}}class zi extends Ai{constructor(e,t,n){super(),o(this,"inputImage"),this.context=e;const r={context:e,height:n,width:t};this.addStep({program:new Ji({...r,disableFramebuffer:!0}),getUniforms:()=>({texture:ki(e,this.inputImage),invert_y:!0})})}setData(e){this.inputImage=e}}class Qi{constructor(e){o(this,"resize"),o(this,"canvas"),o(this,"context"),this.canvas=new OffscreenCanvas(0,0),this.context=this.canvas.getContext("webgl2"),this.canvas.width=e.width,this.canvas.height=e.height,this.resize=new zi(this.context,e.width,e.height)}resizeForeground(e,t){this.canvas.width=e,this.canvas.height=t,this.resize.resizeOutput(e,t)}async process(e){var t,n;return this.canvas.width=this.canvas.width,null==(t=this.resize)||t.setData(e),null==(n=this.resize)||n.run(),this.canvas}}class qi{constructor(e,t){o(this,"improveMaskSegmentation"),o(this,"backgroundResizer"),o(this,"backgroundImage"),o(this,"backgroundVideo"),o(this,"profiler"),o(this,"activePipeline"),o(this,"canvas"),o(this,"options"),o(this,"context"),o(this,"virtualBGImage"),this.id=e,this.canvas=new OffscreenCanvas(0,0),this.context=this.canvas.getContext("webgl2"),this.canvas.width=t.foregroundWidth,this.canvas.height=t.foregroundHeight,this.improveMaskSegmentation=new Ki(this.context,t.maskWidth,t.maskHeight),this.backgroundImage=new Li(this.context),this.backgroundVideo=new Xi(this.context),this.backgroundResizer=new Qi({width:t.foregroundWidth,height:t.foregroundHeight})}setBackgroundOptions(e){switch(e.transformerType){case"BackgroundBlur":this.activePipeline=new Ni(this.context,this.getBlurSize(e.radius));break;case"SilhouetteBlur":this.activePipeline=new Pi(this.context,this.getBlurSize(e.radius));break;case"VideoBackground":this.activePipeline=this.backgroundVideo;break;case"VirtualBackground":this.activePipeline=this.backgroundImage}this.options=e}setFlickeringOptions(e){var t;null==(t=this.improveMaskSegmentation)||t.setOptions(e)}setVideoBGReadable(e){this.backgroundVideo.inputVideo=e}async setVirtualBGImage(e){this.virtualBGImage=e,this.backgroundImage.inputBackgroundImage=await this.backgroundResizer.process(e)}async process(e,t){var n,r,i,o,s,a,c;if(this.activePipeline&&e.width&&(null==t?void 0:t.width)){const u=`[${this.id}] background-filter`;null==(n=this.profiler)||n.pushContext(u);let l=t;((null==(r=this.options)?void 0:r.selfieSegmentationType)&&"PRECISE"===(null==(i=this.options)?void 0:i.selfieSegmentationType)||!(null!=(o=this.options)&&o.selfieSegmentationType)&&this.activePipeline.preciseMaskEnabled)&&(this.improveMaskSegmentation.setId(this.id),this.improveMaskSegmentation.setProfiler(this.profiler),this.improveMaskSegmentation.setData(e,t),this.improveMaskSegmentation.run(),l=this.improveMaskSegmentation.output),this.activePipeline.setId(this.id),this.activePipeline.setProfiler(this.profiler),null==(s=this.activePipeline)||s.setData(e,l),null==(a=this.activePipeline)||a.run(),null==(c=this.profiler)||c.popContext(u)}}async resizeForeground(e,t){var n;this.canvas.width=e,this.canvas.height=t,this.backgroundImage.resizeOutput(e,t),this.backgroundVideo.resizeOutput(e,t),this.backgroundResizer.resizeForeground(e,t),null==(n=this.activePipeline)||n.resizeOutput(e,t),this.virtualBGImage&&(this.backgroundImage.inputBackgroundImage=await this.backgroundResizer.process(this.virtualBGImage))}async profile(e){const t=new vn(this.context);return this.profiler=t,t.start(),await bn(e),this.profiler=void 0,t.stop(),t.getResolvedQueries()}getBlurSize(e=Ct.Low){switch(e){case Ct.Low:return 5;case Ct.High:return 12}return e}}class $i{constructor(){o(this,"selfieSegmentation",new Ot),o(this,"backgroundFilter"),o(this,"previousDimensions",{width:0,height:0})}async init(e,t){await this.selfieSegmentation.init(t.wasmAssetUriPath,t.tfliteAssetUriPath);const{width:n,height:r}=this.selfieSegmentation.getOutputDimensions();this.backgroundFilter=new qi(e,{foregroundWidth:1,foregroundHeight:1,maskWidth:n,maskHeight:r})}async transform(e,t){var n,r,i,o;const s=await createImageBitmap(e),a=await this.selfieSegmentation.process(s);a?((s.width!==this.previousDimensions.width||s.height!==this.previousDimensions.height)&&(this.previousDimensions.width=s.width,this.previousDimensions.height=s.height,await(null==(n=this.backgroundFilter)?void 0:n.resizeForeground(s.width,s.height))),await(null==(r=this.backgroundFilter)?void 0:r.process(s,a)),e.close(),t.enqueue(new VideoFrame(null==(i=this.backgroundFilter)?void 0:i.canvas,{timestamp:null!=(o=e.timestamp)?o:0,alpha:"discard"}))):t.enqueue(e)}async setBackgroundOptions(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setBackgroundOptions(e))}async setVideoBGReadable(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setVideoBGReadable(e))}async setVirtualBGImage(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setVirtualBGImage(e))}setFlickeringOptions(e){var t;null==(t=this.backgroundFilter)||t.setFlickeringOptions(e)}async profile(e){var t,n;return null!=(n=null==(t=this.backgroundFilter)?void 0:t.profile(e))?n:[]}}const eo=class{constructor(){o(this,"backgroundTransformer",new $i),o(this,"mediaProcessor",new Et),o(this,"rate",30),o(this,"resolveOnMediaProcessor"),o(this,"eventsQueue",[])}async init(e,t){await this.backgroundTransformer.init(e,t),await this.mediaProcessor.setTransformers([this.backgroundTransformer]),this.mediaProcessor.setTrackExpectedRate(this.rate),this.mediaProcessor.onAny((e,t)=>{this.resolveOnMediaProcessor?(this.resolveOnMediaProcessor({name:e,data:t}),this.resolveOnMediaProcessor=void 0):this.eventsQueue.push({name:e,data:t})})}async onMediaProcessorEvent(){return await new e(e=>{this.eventsQueue.length>0?e(this.eventsQueue.shift()):this.resolveOnMediaProcessor=e})}async setTrackExpectedRate(e){this.rate=e,this.mediaProcessor.setTrackExpectedRate(e)}async transform(e,t){this.mediaProcessor.transform(e,t)}async setBackgroundOptions(e){var t;await(null==(t=this.backgroundTransformer)?void 0:t.setBackgroundOptions(e))}setVideoBGReadable(e){this.backgroundTransformer.setVideoBGReadable(e)}async setVirtualBGImage(e){await this.backgroundTransformer.setVirtualBGImage(e)}async terminate(){await this.mediaProcessor.destroy()}setFlickeringOptions(e){this.backgroundTransformer.setFlickeringOptions(e)}setVonageMetadata(e){!function(e){globalThis._vonageMediaProcessorMetadata=e}(e)}async profile(e){return JSON.stringify(await this.backgroundTransformer.profile(e))}};let to=eo;!function(e,t){t.workerId=e,pn()&&(mn[t.workerId]=t)}("ProcessorWorker",eo);const no="dmFyIGVkPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgdGQ9KEssdGUscmUpPT50ZSBpbiBLP2VkKEssdGUse2VudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwLHZhbHVlOnJlfSk6S1t0ZV09cmU7dmFyIHA9KEssdGUscmUpPT4odGQoSyx0eXBlb2YgdGUhPSJzeW1ib2wiP3RlKyIiOnRlLHJlKSxyZSk7KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBLPShyPT4ocltyLklOSVQ9MF09IklOSVQiLHJbci5GT1JXQVJEPTFdPSJGT1JXQVJEIixyW3IuVEVSTUlOQVRFPTJdPSJURVJNSU5BVEUiLHIpKShLfHx7fSk7ZnVuY3Rpb24gdGUocil7cmV0dXJuW0ltYWdlQml0bWFwLFJlYWRhYmxlU3RyZWFtLFdyaXRhYmxlU3RyZWFtXS5zb21lKGU9PnIgaW5zdGFuY2VvZiBlKX1mdW5jdGlvbiByZShyLGUpe2NvbnN0e2lkOnR9PXIsbj1BcnJheS5pc0FycmF5KGUpP2U6W2VdO3Bvc3RNZXNzYWdlKHtpZDp0LHJlc3VsdDplfSxuLmZpbHRlcihpPT50ZShpKSkpfWFzeW5jIGZ1bmN0aW9uIHFpKHIsZSl7Y29uc3R7ZnVuY3Rpb25OYW1lOnQsYXJnczpufT1yO2lmKCFlLmluc3RhbmNlK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xOZT01MTIxLFp0PTUxMjIsZXI9NTEyMyx0cj01MTI0LHJyPTUxMjUsbnI9NTEyNixTcz0zMjgxOSxJcz0zMjgyMCxGcz0zMzYzNSxQcz01MTMxLERzPTMzNjQwLE1zPTM1ODk5LENzPTM1OTAyLE9zPTM2MjY5LE5zPTM0MDQyLGJuPXt9O3tjb25zdCByPWJuO3JbSnRdPUludDhBcnJheSxyW05lXT1VaW50OEFycmF5LHJbWnRdPUludDE2QXJyYXkscltlcl09VWludDE2QXJyYXksclt0cl09SW50MzJBcnJheSxyW3JyXT1VaW50MzJBcnJheSxyW25yXT1GbG9hdDMyQXJyYXkscltTc109VWludDE2QXJyYXkscltJc109VWludDE2QXJyYXkscltGc109VWludDE2QXJyYXkscltQc109VWludDE2QXJyYXkscltEc109VWludDMyQXJyYXkscltNc109VWludDMyQXJyYXkscltDc109VWludDMyQXJyYXkscltPc109VWludDMyQXJyYXkscltOc109VWludDMyQXJyYXl9ZnVuY3Rpb24gaXIocil7aWYociBpbnN0YW5jZW9mIEludDhBcnJheSlyZXR1cm4gSnQ7aWYociBpbnN0YW5jZW9mIFVpbnQ4QXJyYXl8fHIgaW5zdGFuY2VvZiBVaW50OENsYW1wZWRBcnJheSlyZXR1cm4gTmU7aWYociBpbnN0YW5jZW9mIEludDE2QXJyYXkpcmV0dXJuIFp0O2lmKHIgaW5zdGFuY2VvZiBVaW50MTZBcnJheSlyZXR1cm4gZXI7aWYociBpbnN0YW5jZW9mIEludDMyQXJyYXkpcmV0dXJuIHRyO2lmKHIgaW5zdGFuY2VvZiBVaW50MzJBcnJheSlyZXR1cm4gcnI7aWYociBpbnN0YW5jZW9mIEZsb2F0MzJBcnJheSlyZXR1cm4gbnI7dGhyb3cgbmV3IEVycm9yKCJ1bnN1cHBvcnRlZCB0eXBlZCBhcnJheSB0eXBlIil9ZnVuY3Rpb24gdm4ocil7aWYocj09PUludDhBcnJheSlyZXR1cm4gSnQ7aWYocj09PVVpbnQ4QXJyYXl8fHI9PT1V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bnMucmFkaXVzKSE9bnVsbD90OjE7cmV0dXJuYAoKICAgICAgICB2ZWM0IGxvb3AoKSB7IAogICAgICAgICAgICB2ZWM0IHJlc3VsdCA9IHZlYzQoMCwwLDAsMCk7CiAgICAgICAgICAgIGZsb2F0IGZhY3RvclN1bSA9IDAuOwoKICAgICAgICAgICAgdmVjMiBub3JtYWxpemVkUmFkaXVzID0gdmVjMigtJHtlfS4pIC8gY2FudmFzOwogICAgICAgICAgICB2ZWMyIG5vcm1hbGl6ZWRJbmNyZW1lbnQgPSB2ZWMyKDEuKSAvIGNhbnZhczsKICAgICAgICAgICAgdmVjMiBkaWZmID0gbm9ybWFsaXplZFJhZGl1czsKICAgICAgICAgICAgZmxvYXQgbWF4TGVuZ3RoID0gbGVuZ3RoKG5vcm1hbGl6ZWRSYWRpdXMpOwoKICAgICAgICAgICAgZm9yKGludCB5PS0ke2V9OyB5PCR7ZSsxfTsgKyt5KSB7CiAgICAgICAgICAgICAgICBmb3IoaW50IHg9LSR7ZX07IHg8JHtlKzF9OyArK3gpIHsKICAgICAgICAgICAgICAgICAgICBmbG9hdCBmYWN0b3IgPSAoMS4tIHRleHR1cmUyRChtYXNrLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpLmEpICogKG1heExlbmd0aCAtIGxlbmd0aChkaWZmKSkgLyBtYXhMZW5ndGg7CiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZhY3RvciAqIHRleHR1cmUyRCh0ZXh0dXJlLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpOwogICAgICAgICAgICAgICAgICAgIGZhY3RvclN1bSArPSBmYWN0b3I7CiAgICAgICAgICAgICAgICAgICAgZGlmZi54ICs9IG5vcm1hbGl6ZWRJbmNyZW1lbnQueDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGRpZmYueSArPSBub3JtYWxpemVkSW5jcmVtZW50Lnk7CiAgICAgICAgICAgICAgICBkaWZmLnggPSBub3JtYWxpemVkUmFkaXVz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ApOwogICAgICAgICAgICBmbG9hdCBmYWN0b3JTdW0gPSAwLjsKCiAgICAgICAgICAgIHZlYzIgbm9ybWFsaXplZFJhZGl1cyA9IHZlYzIoLSR7ZX0uKSAvIGNhbnZhczsKICAgICAgICAgICAgdmVjMiBub3JtYWxpemVkSW5jcmVtZW50ID0gdmVjMigxLikgLyBjYW52YXM7CiAgICAgICAgICAgIHZlYzIgZGlmZiA9IG5vcm1hbGl6ZWRSYWRpdXM7CgogICAgICAgICAgICBmb3IoaW50IHk9LSR7ZX07IHk8JHtlKzF9OyArK3kpIHsKICAgICAgICAgICAgICAgIGZvcihpbnQgeD0tJHtlfTsgeDwke2UrMX07ICsreCkgewogICAgICAgICAgICAgICAgICAgIGZsb2F0IGZhY3RvciA9IDEuOwogICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmYWN0b3IgKiB0ZXh0dXJlMkQodGV4dHVyZSwgX3RleHR1cmVfY29vcmQgKyBkaWZmKTsKICAgICAgICAgICAgICAgICAgICBmYWN0b3JTdW0gKz0gZmFjdG9yOwogICAgICAgICAgICAgICAgICAgIGRpZmYueCArPSBub3JtYWxpemVkSW5jcmVtZW50Lng7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBkaWZmLnkgKz0gbm9ybWFsaXplZEluY3JlbWVudC55OwogICAgICAgICAgICAgICAgZGlmZi54ID0gbm9ybWFsaXplZFJhZGl1cy54OwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiByZXN1bHQgLyBmYWN0b3JTdW07CiAgICAgICAgfWB9Z2V0RmFjdG9yKGUsdCl7c3dpdGNoKHRoaXMub3B0aW9ucy50eXBlKXtjYXNlIDE6cmV0dXJuIHRoaXMuZ2V0TGluZWFyRmFjdG9yKGUsdCk7Y2FzZSAwOmRlZmF1bHQ6cmV0dXJuIHRoaXMuZ2V0TGluZWFyRmFjdG9yKGUsdCl9fWdldExpbmVhckZhY3RvcihlLHQpe3JldHVybiAxfWdldEdhdXNzaWFuR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hbnNmb3JtZXIpPT1udWxsP3ZvaWQgMDp0LnNldEJhY2tncm91bmRPcHRpb25zKGUpKX1zZXRWaWRlb0JHUmVhZGFibGUoZSl7dGhpcy5iYWNrZ3JvdW5kVHJhbnNmb3JtZXIuc2V0VmlkZW9CR1JlYWRhYmxlKGUpfWFzeW5jIHNldFZpcnR1YWxCR0ltYWdlKGUpe2F3YWl0IHRoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnNldFZpcnR1YWxCR0ltYWdlKGUpfWFzeW5jIHRlcm1pbmF0ZSgpe2F3YWl0IHRoaXMubWVkaWFQcm9jZXNzb3IuZGVzdHJveSgpfXNldEZsaWNrZXJpbmdPcHRpb25zKGUpe3RoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnNldEZsaWNrZXJpbmdPcHRpb25zKGUpfXNldFZvbmFnZU1ldGFkYXRhKGUpe2ZzKGUpfWFzeW5jIHByb2ZpbGUoZSl7cmV0dXJuIEpTT04uc3RyaW5naWZ5KGF3YWl0IHRoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnByb2ZpbGUoZSkpfX07bGV0IEJpPU5yOygoKT0+e1hpKCJQcm9jZXNzb3JXb3JrZXIiLE5yKX0pKCl9KSgpOwo=",ro=typeof window<"u"&&window.Blob&&new Blob([atob(no)],{type:"text/javascript;charset=utf-8"});function io(){const e=ro&&(window.URL||window.webkitURL).createObjectURL(ro);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+no)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const oo=class extends an{constructor(){super(...arguments),o(this,"rate",30),o(this,"worker")}async init(e){this.worker=await hn(to,io),await this.worker.init("worker_"+oo.initCount++,e),await this.worker.setVonageMetadata(je()),await this.setBackgroundOptions(e),this.listenWorker()}async setTrackExpectedRate(e){var t;await(null==(t=this.worker)?void 0:t.setTrackExpectedRate(e))}async setBackgroundOptions(e){var t,n,r;const{transformerType:i}=e;switch(i){case"VideoBackground":await(null==(t=this.worker)?void 0:t.setVideoBGReadable(await gn.createVideoReadable(e.backgroundAssetUri)));break;case"VirtualBackground":await(null==(n=this.worker)?void 0:n.setVirtualBGImage(await gn.createImageCanvas(e.backgroundAssetUri)))}await(null==(r=this.worker)?void 0:r.setBackgroundOptions(e))}async transform(e,t){var n;await(null==(n=this.worker)?void 0:n.transform(e,t))}async destroy(){var e;await(null==(e=this.worker)?void 0:e.terminate())}async setFlickeringOptions(e){var t;await(null==(t=this.worker)?void 0:t.setFlickeringOptions(e))}async profile(e){var t;const n=await(null==(t=this.worker)?void 0:t.profile(e));return JSON.parse(null!=n?n:"[]")}async listenWorker(){for(var e,t,n;null!=(e=this.worker)&&e.worker;){const{name:e,data:r}=await(null==(t=this.worker)?void 0:t.onMediaProcessorEvent());switch(e){case"error":case"warn":this.emit(e,r);break;case"pipelineInfo":switch(this.emit(e,r),r){case"pipeline_ended":case"pipeline_ended_with_error":return void await(null==(n=this.worker)?void 0:n.terminate())}}}}};let so=oo;o(so,"initCount",0);class ao{constructor(e){this.queries=e}async downloadSpeedscope(){this.download(await this.convertToSpeedscope())}download(e){const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([e],{type:"application/json"})),t.download=`profile-${+new Date}.speedscope.json`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}convertToSpeedscope(){const e=[],t={},n=[];let r=0;for(const i of this.queries){const o=[];for(const n of i)void 0===t[n.name]&&(t[n.name]=e.length,e.push({name:n.name})),o.push({type:n.action==yn.PUSH?"O":"C",frame:t[n.name],at:n.timestamp}),r=Math.max(r,n.timestamp+n.duration);n.push({events:o,type:"evented",name:"GPU Profile",unit:"nanoseconds",startValue:0,endValue:r})}const i={$schema:"https://www.speedscope.app/file-format-schema.json",shared:{frames:e},profiles:n};return JSON.stringify(i,null,2)}}class co extends an{constructor(){super(),o(this,"worker",new so),o(this,"connector",new _t(this.worker))}async init(e){await this.worker.init(e),this.worker.onAny((e,t)=>this.emit(e,t))}async setBackgroundOptions(e){await this.worker.setBackgroundOptions(e)}setTrackExpectedRate(e){this.worker.setTrackExpectedRate(e)}getConnector(){return this.connector}async profile(e){return this.worker.profile(e)}static async profile(t){const n=await e.all(this.instances.map(e=>e.profile(t)));return new ao(n)}static async create(e){const t=new this;return await t.init(e),this.instances.push(t),t}}function uo(){return At}function lo(){return Wt}function ho(){return Nt}function fo(){return Lt}function po(){return Xt}function mo(){return Mt}function go(){return Ft}o(co,"instances",[]);var bo=(e=>(e.FAST="FAST",e.PRECISE="PRECISE",e))(bo||{});async function yo(e){return await co.create(e)}}.call(this,n(1),n(44))},function(e,t,n){"use strict";const r=n(35)().onlyLocal(),i=n(101).prependProxyToUrlIfNeeded,o={getConfig:function(e){void 0===e&&(e={});const t=e,n=t.staticConfig,o=void 0===n?r:n,s=t.proxyUrl,a=i((e=>(e.apiUrl.includes("anvil.opentok.com")?"https://static.opentok.com":"https://www.dev.tokbox.com")+"/ml-transformers/v4.0.0")(o),s);return{mediapipeBaseAssetsUri:""+a,wasmAssetUriPath:a+"/",tfliteAssetUriPath:a+"/"}}};e.exports=o},function(e,t,n){"use strict";const r=n(18),i=n(11),o=n(708),s=n(709),a=n(710);e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(7),c=e.ExceptionCodes||n(10),u=e.logging||n(2)("publisherInit"),l=e.otError||n(13)(),d=e.OTHelpers||n(8),h=e.Publisher||n(169)(),f=e.sessionObjects||n(21);return function(e,n,p){let m;u.debug(`OT.initPublisher(${e})`),"string"!=typeof e||document.getElementById(e)||(e=n,n=p,p=arguments[3]),"function"==typeof e?(p=e,n=void 0,e=void 0):i(e)&&!d.isElementNode(e)&&(p=n,n=e,e=void 0),"function"==typeof n&&(p=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 h(n||{});f.publishers.add(g);const b=function(){p&&r(p)&&(p(...arguments),p=void 0)};void 0!==m&&(u.error(m),b(l(t.INVALID_PARAMETER,new Error(m),c.INVALID_PARAMETER)));const y=function(e){g.off("publishComplete",v),b(e)};let v=function(e){g.off("initSuccess",y),e&&b(e)};return g.once("initSuccess",y),g.once("publishComplete",v),g.publish(e),g}}},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(4)),o=r(n(5)),s=r(n(16));const a=n(28),c=n(711),u=n(11),l=n(18),d=n(9),h=n(27),f=n(6),p=n(26),m=n(35)(),g=n(75),b=n(313),y=n(713),v=n(714),w=n(715),S=n(101).prependProxyToUrlIfNeeded,T=n(102).getProxyUrl,E=n(716);e.exports=function(e){void 0===e&&(e={});const r=e.adaptIceServers||n(103).adaptIceServers,x=e.AnalyticsHelper||p,_=e.APIKEY||n(72),C=e.Capabilities||n(170),I=e.convertAnvilErrorCode||n(717),R=e.convertRumorError||n(319),Z=e.Errors||n(7),k=e.Events||n(23)(),O=e.Stream||n(171),V=e.ExceptionCodes||n(10),G=e.hasIceRestartsCapability||n(320),A=e.hasE2eeCapability||n(111),W=e.logging||n(2)("Session"),N=e.otError||n(13)(),L=e.OTErrorClass||n(22),X=e.OTHelpers||n(8),M=n(718),F=e.StaticConfig||m,P=e.staticConfig||F.onlyLocal(),j=e.Publisher||n(169)(),U=e.RaptorSocket||n(719).default(),H=e.SessionDispatcher||n(327),Y=e.sessionObjects||n(21),D=e.sessionTag||n(326),B=e.socketCloseCodes||n(77),K=e.Subscriber||n(305)(),J=e.systemRequirements||n(154),z=e.uuid||n(17),Q=v({otError:N}),q=e.global||(void 0!==typeof window?window:global),$=e.getSessionInfo||n(743)(),ee=n(143),te=e.KeyStore||n(746),ne=e.SFrameClientStore||n(748),re=e.SinglePeerConnectionController||n(750),ie=e.initPublisher||n(317)({Publisher:j});return function(e,n,p){var m=this;let v=void 0===p?{}:p,oe=v.iceConfig,se=v.connectionEventsSuppressed,ae=v.ipWhitelist,ce=void 0!==ae&&ae,ue=v.encryptionSecret,le=v._enableSinglePeerConnection;const de=T(),he=new x,fe=e=>"string"==typeof e?this.streams.get(e)||{id:e}:e;let pe,me,ge,be,ye,ve,we,Se;f(this),this._tag=D,J.check()||J.upgrade(),null==n&&(n=e,e=null),Q(oe),this.id=n,this.sessionId=n,this.keyStore=new te,this.sFrameClientStore=new ne;let Te=!0,Ee=!1,xe=e;const _e=this;let Ce=n,Ie=z(),Re=z(),Ze=W,ke=!1;const Oe=[];let Ve,Ge,Ae,We,Ne=null,Le=!1,Xe=!1;const Me=X.statable(this,["disconnected","connecting","connected","disconnecting"],"disconnected");let Fe;this.connection=null,this.connections=new X.Collection,this.streams=new X.Collection,this.archives=new X.Collection;const Pe=function(e){Me("disconnected"),e.code||(e.code=V.CONNECT_FAILED),Ze.error(`${e.name||"Unknown Error"}: ${e.message}`),L.handleJsException({error:e,target:this,analytics:he}),this.trigger("sessionConnectFailed",e)},je=function(e){Ee=!1;const t=e.reason;this.logEvent("Connect","Disconnected",{reason:e.reason});const n=new k.SessionDisconnectEvent("sessionDisconnected",t.replace("networkTimedout","networkDisconnected"));this.isConnected()&&this.disconnect(),Ge(),Ve.call(this,t),setTimeout(()=>{this.dispatchEvent(n),Ae.call(this,n.reason),n.isDefaultPrevented()||We.call(this,n.reason)})},Ue=function(e){se||e.id.match(/^symphony\./)||this.dispatchEvent(new k.ConnectionEvent(h.CONNECTION_CREATED,e))},He=function(e,t){e.id.match(/^symphony\./)||pe&&e.id===pe.id()||this.dispatchEvent(new k.ConnectionEvent(h.CONNECTION_DESTROYED,e,t))},Ye=function(e){!e||!e.connection||this.connection&&e.connection.id===this.connection.id||this.dispatchEvent(new k.StreamEvent(h.STREAM_CREATED,e,null,!1))},De=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 k.StreamPropertyChangedEvent(h.STREAM_PROPERTY_CHANGED,t,n,e.oldValue,r)))},Be=function(e,t){void 0===t&&(t="clientDisconnected");const n=new k.StreamEvent("streamDestroyed",e,t,!0);e.connection.id===this.connection.id?Y.publishers.where({streamId:e.id}).forEach((function(n){n._.unpublishStreamFromSession(e,this,t)}),this):this.dispatchEvent(n),(()=>{Y.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})})})()},Ke=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveStarted",e))},Je=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveDestroyed",e))},ze=function(e){const t=e.target,n=e.changedProperty,r=e.newValue;"status"===n&&"stopped"===r?this.dispatchEvent(new k.ArchiveEvent("archiveStopped",t)):this.dispatchEvent(new k.ArchiveEvent("archiveUpdated",t))},Qe=()=>Y.subscribers.forEach(e=>e._.pauseAndPlayVideoElement()),qe=function(){_e.token=null,ge=null,Me("disconnected"),pe=null,me&&(me.stop(),me=null),_e.connection=null,_e.capabilities=new C([],{hasE2eeCapability:A}),_e.connections.destroy(),_e.streams.destroy(),_e.archives.destroy()};Ge=function(){Re=z(),qe()},Ve=function(e){Y.publishers.where({session:this}).forEach(t=>{t.disconnect(e)}),Y.subscribers.where({session:this}).forEach(e=>{e._disconnect()})},Ae=function(e){Y.publishers.where({session:this}).forEach(t=>{t._.streamDestroyed(e)})},We=function(e){Y.subscribers.where({session:this}).forEach(t=>{t._destroy({reason:e})})};const $e=function(){Ze.debug("OT.Session: connecting to Raptor");const e=S(this.sessionInfo.messagingURL,de),t=["forceMute"];this.sessionInfo.isAdaptiveEnabled&&t.push("amr"),Xe&&t.push("spc"),pe=new U(Re,Ie,e,this.sessionInfo.symphonyAddress,H(this,{connectionEventsSuppressed:se}),he,t),pe.connect(ge,this.sessionInfo,{connectionEventsSuppressed:se},(e,t)=>{if(e){const t={};let n;if("ConnectToSession"===e.reason||"GetSessionState"===e.reason){const n=R(e);d(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:pe.socketId}),pe=null,this.logConnectivityEvent("Failure",t,n);const r=function(e,t){let n;switch(e){case"WebSocketConnection":if(n=c(B.codes,e=>e===t),n)return Z["SOCKET_"+n];break;case"ConnectToSession":case"GetSessionState":switch(t){case V.CONNECT_FAILED:return Z.CONNECT_FAILED;case V.UNEXPECTED_SERVER_RESPONSE:return Z.UNEXPECTED_SERVER_RESPONSE;case V.CONNECTION_LIMIT_EXCEEDED:return Z.CONNECTION_LIMIT_EXCEEDED}}}(e.reason,e.code);return r&&(e=N(r,new Error(e.message),e.code)),void Pe.call(this,e)}Ze.debug("OT.Session: Received session state from Raptor",t),this.connection=this.connections.get(pe.id()),this.connection&&(this.capabilities=this.connection.permissions),Me("connected"),this.logConnectivityEvent("Success",{connectionId:this.connection.id}),this.connection.on("destroyed",je,this),this.dispatchEvent(new k.SessionConnectEvent(h.SESSION_CONNECTED)),this.connections.on({add:Ue,remove:He},this),this.streams.on({add:Ye,remove:Be,update:De},this),this.archives.on({add:Ke,remove:Je,update:ze},this),this.connections._triggerAddEvents(),this.streams._triggerAddEvents(),this.archives._triggerAddEvents();X.env.isiOS&&X.env.iOSVersion>=13.3&&this.on("gsmCallEnded",Qe)})},et=e=>this.capabilities.permittedTo(e),tt=(e,t)=>{W.error(`${e.name}: ${e.message}`),"function"==typeof t&&t(e),L.handleJsException({error:e,target:this,analytics:he})},nt=e=>{const t=N(e.code,new Error(e.message),e.exceptionCode);return tt(t),t},rt=()=>this.isNot("connected")?nt(M.NOT_CONNECTED):et("forceMute")?null:nt(M.PERMISSION_DENIED),it=e=>"404"===e.code?nt(M.NOT_FOUND):"403"===e.code?nt(M.PERMISSION_DENIED):nt(M.UNEXPECTED_SERVER_RESPONSE);this.reportIssue=e=>{let t=e.id;return b(he.logEvent.bind(he))({action:"ReportIssue",variation:"Event",connectionId:Re,payload:{reportIssueId:t}},null)},this.logEvent=function(e,t,n,r){let i={action:e,variation:t,payload:n,sessionId:Ce,messagingServer:ye,p2p:be,partnerId:xe,connectionId:Re};r&&(i=d(r,i)),he.logEvent(i)},this.logConfigurationFileEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),"Attempt"===e)we=(new Date).getTime();else if("Failure"===e||"Success"===e){const e=(new Date).getTime()-we;d(n,{attemptDuration:e})}de&&(n.proxyUrl=de),this.logEvent("ConfigurationFile",e,t,(0,s.default)({},n))},this.logConnectivityEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),de&&(n.proxyUrl=de),"Attempt"===e&&(me&&(me.stop(),W.error("_connectivityAttemptPinger should have been cleaned up")),ve=(new Date).getTime(),me=new g(()=>{this.logEvent("Connect","Attempting",t,(0,s.default)({},n))},.2,6),me.start()),"Failure"===e||"Success"===e||"Cancel"===e){const r=r=>{me&&(me.stop(),me=void 0),this.logEvent("Connect",e,t,(0,s.default)({},n,{attemptDuration:(new Date).getTime()-ve,iceConfig:r,ipWhitelist:ce}))};"Success"===e?this._.getIceConfig().then(e=>{const t={includeServers:oe&&oe.includeServers||"all",transportPolicy:e.transportPolicy};t.servers=e.servers?e.servers.map(e=>({url:e.urls})):[],r(t)}):r()}else this.logEvent("Connect",e,t,n)},this.connect=function(){let r;for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];o.length>1&&("string"==typeof o[0]||"number"==typeof o[0])&&"string"==typeof o[1]?(null==e&&(xe=o[0].toString()),r=o[1]):r=o[0];const a=o[o.length-1];if(m.is("connecting","connected"))return Ze.warn("OT.Session: Cannot connect, the session is already "+m.currentState),m;he.sessionInfo=new ee,qe(),Me("connecting");const c=Re;function d(){const e=Re!==c;return e&&W.debug("Connection was interrupted"),e}if(m.token=!l(r)&&r,ge=!l(r)&&r,Te?Te=!1:Ie=z(),a&&l(a)){let e;const t=function(){e();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];a(void 0,...n)},n=function(){e(),a(...arguments)};e=()=>{m.off("sessionConnected",t),m.off("sessionConnectFailed",n)},m.once("sessionConnected",t),m.once("sessionConnectFailed",n)}if(null==xe||l(xe))return setTimeout(Pe.bind(m,N(Z.AUTHENTICATION_ERROR,new Error("API Key is undefined. You must pass an API Key to initSession."),V.AUTHENTICATION_ERROR))),m;if(!Ce||u(Ce)||Array.isArray(Ce)){let e;return Ce?(e="SessionID is not a string. You must use string as the session ID passed into OT.initSession().",Ce=Ce.toString()):e="SessionID is undefined. You must pass a sessionID to initSession.",setTimeout(Pe.bind(m,N(Z.INVALID_SESSION_ID,new Error(e),V.INVALID_SESSION_ID))),m.logConnectivityEvent("Attempt"),m.logConnectivityEvent("Failure",null,{failureReason:"ConnectToSession",failureCode:V.INVALID_SESSION_ID,failureMessage:e}),m}if(m.apiKey=xe.toString(),xe=xe.toString(),ue){if(!A())return setTimeout(Pe.bind(m,N(Z.UNSUPPORTED_BROWSER,new Error("E2E Encryption is not supported in your browser.")))),m;try{E(ue),m.keyStore.set(n,ue),Le=!0}catch(e){return setTimeout(Pe.bind(m,N(Z.INVALID_ENCRYPTION_SECRET,new Error("Invalid encryptionSecret: "+e.message)))),m}}0===_.value.length&&(_.value=xe);const h=Boolean(F.onlyLocal().configUrl),f=!0===ce&&Boolean(F.onlyLocal().ipWhitelistConfigUrl);h||f?m.logConfigurationFileEvent("Attempt"):m.logConfigurationFileEvent("Event",{message:"No configUrl, using local config only"});const p=h||f?F.get({partnerId:xe,token:r,useIpWhitelistConfigUrl:f,proxyUrl:de}):t.resolve(F.onlyLocal());return p.then(e=>((h||f)&&m.logConfigurationFileEvent("Success"),e),e=>((h||f)&&m.logConfigurationFileEvent("Failure",{failureMessage:e.message,failureStack:e.stack}),F.onlyLocal())).then(e=>{if(m.staticConfig=e,he.staticConfig=e,!1===e.apiEnabled)throw N(Z.API_KEY_DISABLED,new Error("The API KEY has been disabled. Access to the service is currently being restricted. Please contact support."));if(d())return;m.logConnectivityEvent("Attempt"),de?m.logEvent("SessionInfo","Attempt",null,{proxyUrl:de}):m.logEvent("SessionInfo","Attempt");const t=e=>{e.code=I(e.code),m.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)),Pe.call(m,e)},r=S(e.apiUrl,de);return $({anvilUrl:r,sessionId:n,token:ge,connectionId:Re,clientVersion:e.clientVersion}).then(n=>{if(d())return;if(n.partnerId&&n.partnerId!==xe){const e="Authentication Error: The API key does not match the token or session.";return void t(N(Z.AUTHENTICATION_ERROR,new Error(e),V.AUTHENTICATION_ERROR))}Xe=w(n,le),Xe&&(Fe=new re(m)),he.sessionInfo=n;const r={features:{reconnection:n.reconnection,renegotiation:G()&&n.renegotiation,simulcast:void 0!==n.simulcast&&(n.simulcast&&"Chrome"===X.env.name)}};if(de&&(r.proxyUrl=de),m.is("connecting")){m.sessionInfo=n,m._.setIceServers(m.sessionInfo.iceServers),be=n.p2pEnabled,ye=n.messagingServer,m.logEvent("SessionInfo","Success",null,r,{messagingServer:n.messagingServer});const t=e.sessionInfoOverrides;null!=t&&"object"==typeof t&&Object.keys(t).forEach(e=>{Object.defineProperty(m.sessionInfo,e,{value:t[e]})}),$e.call(m)}},t)}).catch(e=>{Pe.call(m,e)}),m},this.disconnect=function(){Fe&&(Fe.destroy(),Fe=null),pe&&pe.isNot("disconnected")?pe.isNot("disconnecting")&&(pe.isNot("connecting")||this.logConnectivityEvent("Cancel"),Me("disconnecting"),pe.disconnect(),this.off("gsmCallEnded",Qe)):Ge()},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 he.logError(1010,"OT.exception","We need to be connected before you can publish",null,{action:"Publish",variation:"Failure",failureReason:"unconnected",failureCode:V.NOT_CONNECTED,failureMessage:"We need to be connected before you can publish",sessionId:Ce,streamId:e&&e.stream?e.stream.id:null,p2p:this.sessionInfo?this.sessionInfo.p2pEnabled:void 0,messagingServer:this.sessionInfo?this.sessionInfo.messagingServer:null,partnerId:xe}),tt(N(Z.NOT_CONNECTED,new Error("We need to be connected before you can publish"),V.NOT_CONNECTED),n),null;if(!et("publish")){const e="This token does not allow publishing. The role must be at least `publisher` to enable this functionality",t={failureReason:"Permission",failureCode:V.UNABLE_TO_PUBLISH,failureMessage:e};return this.logEvent("Publish","Failure",null,t),tt(N(Z.PERMISSION_DENIED,new Error(e),V.UNABLE_TO_PUBLISH),n),null}if(!e||"string"==typeof e||X.isElementNode(e))e=ie(e,t);else{if(!(e instanceof j))return void tt(N(Z.INVALID_PARAMETER,new Error("Session.publish :: First parameter passed in is neither a string nor an instance of the Publisher"),V.UNABLE_TO_PUBLISH),n);"session"in e&&e.session&&"sessionId"in e.session&&(e.session.sessionId===this.sessionId?Ze.warn(`Cannot publish ${e.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`):Ze.warn(`Cannot publish ${e.guid()} publisher already attached to ${e.session.sessionId}. Please call session.unpublish(publisher) first.`))}return ke&&e._.forceMuteAudio(),e._.publishToSession(this,he).catch(e=>{throw e.message="Session.publish :: "+e.message,Ze.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"):Ze.error("OT.Session.unpublish: publisher parameter missing.")},this.setIceConfig=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q(n),he.logEvent({action:"setIceConfig",variation:"Attempt",payload:{newIceConfig:n}}),oe=(0,s.default)({},n),"all"!==n.includeServers){e.next=8;break}return e.next=6,_e._.getOtIceServerInfo();case 6:r=e.sent,n.customServers=n.customServers.concat(r.servers);case 8:return o=(e=>({iceServers:e.customServers,iceTransportPolicy:e.transportPolicy}))(n),e.prev=10,e.next=13,t.all(Y.publishers.map(e=>e._.setIceConfig(o)).concat(Y.subscribers.map(e=>e._.setIceConfig(o))));case 13:e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(10),he.logEvent({action:"setIceConfig",variation:"Failure",payload:{newIceConfig:n}}),e.t0;case 19:he.logEvent({action:"setIceConfig",variation:"Success",payload:{newIceConfig:n}});case 20:case"end":return e.stop()}}),e,null,[[10,15]])})));return function(t){return e.apply(this,arguments)}}(),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 tt(N(Z.NOT_CONNECTED,new Error("Session.subscribe :: Connection required to subscribe"),V.UNABLE_TO_SUBSCRIBE),r);if(!e)return void tt(N(Z.INVALID_PARAMETER,new Error("Session.subscribe :: stream cannot be null"),V.UNABLE_TO_SUBSCRIBE),r);if(!Object.prototype.hasOwnProperty.call(e,"streamId"))return void tt(N(Z.INVALID_PARAMETER,new Error("Session.subscribe :: invalid stream object"),V.UNABLE_TO_SUBSCRIBE),r);if(n&&!1===n.insertDefaultUI&&t)return void tt(N(Z.INVALID_PARAMETER,new Error("You cannot specify a target element if insertDefaultUI is false"),V.INVALID_PARAMETER),r);t&&!1===t.insertDefaultUI&&(n=t,t=void 0);const i=new K(t,d(n||{},{stream:e,session:this,analytics:he,_singlePeerConnectionController:Fe}),e=>{e?tt(e,r):r(null,i)});return Y.subscribers.add(i),i},this.unsubscribe=function(e){if(!e){const e="OT.Session.unsubscribe: subscriber cannot be null";throw Ze.error(e),new Error(e)}return e.stream?(Ze.debug("OT.Session.unsubscribe: subscriber "+e.id),e._destroy({reason:"Unsubscribe"}),!0):(Ze.warn("OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream"),!1)},this.getSubscribersForStream=function(e){return Y.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",Ze.error(n),new Error(n);t=e.id}return Y.publishers.where({streamId:t})[0]},this._={getProxyUrl:()=>de,isE2ee:()=>_e.sessionInfo.e2ee&&Le&&!!_e.capabilities.supportsE2ee,isSocketReconnecting:()=>Ee,getSocket:()=>pe,reconnecting:function(){Ee=!0,this.dispatchEvent(new k.SessionReconnectingEvent)}.bind(this),reconnected:function(){Ee=!1,this.dispatchEvent(new k.SessionReconnectedEvent),this.sessionInfo.reconnection&&(Y.publishers.where({session:this}).forEach(e=>{e._.iceRestart()}),this.sessionInfo.p2pEnabled||Y.subscribers.where({session:this}).forEach(e=>{e._.iceRestart("socket reconnected")}))}.bind(this),dispatchSignal:function(e,t,n){const r=new k.SignalEvent(t,n,e);r.target=this,this.trigger(h.SIGNAL,r),t&&this.dispatchEvent(r)}.bind(this),dispatchCaption:function(e,t){let n,r,i;try{const e=JSON.parse(t.data);n=e.caption.text,r=e.streamId,i=e.isFinal}catch(e){return void Ze.error("Caption parsing failed: "+e.message)}const o=new k.CaptionReceivedEvent(n,r,i);o.target=this,this.trigger(h.SUBSCRIBER_CAPTION_RECEIVED,o),this.dispatchEvent(o)}.bind(this),subscriberChannelUpdate:(e,t,n,r)=>pe?pe.subscriberChannelUpdate(e.id,t.widgetId,n.id,r):(Ze.warn("You are disconnected, cannot update subscriber properties ",r),null),streamCreate(e,t){let n=void 0===e?{}:e,r=n.name,i=n.streamId,o=n.subscriberAudioFallbackEnabled,s=n.channels,a=n.minBitrate,c=n.sourceStreamId,u=n.e2ee,l=n.publisherAudioFallbackEnabled;pe?pe.streamCreate({name:r,streamId:i,subscriberAudioFallbackEnabled:o,channels:s,minBitrate:a,maxBitrate:void 0,sourceStreamId:c,e2ee:u,publisherAudioFallbackEnabled:l},t):Ze.warn("You are disconnected, cannot create stream ",i)},streamDestroy(e,t){pe?pe.streamDestroy(e,t):Ze.warn("You are disconnected, cannot destroy stream ",e)},streamChannelUpdate(e,t,n){pe?pe.streamChannelUpdate(e.id,t.id,n):Ze.warn("You are disconnected, cannot update stream properties ",n)},setSocket(e){pe=e},setLogging(e){Ze=e},setState:Me,setIceServers(e){e&&(Se={iceServers:r(e),timestamp:Date.now()})},getOtIceServerInfo(){if(864e5-(Se?Date.now()-Se.timestamp:1/0)>3e5)return t.resolve({transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:Se&&Se.iceServers});if(!ge)return t.resolve({transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0});const e=P.clientVersion;return $({anvilUrl:(this.staticConfig||P).apiUrl,sessionId:n,token:ge,connectionId:Re,clientVersion:e}).then(e=>(_e._.setIceServers(e.iceServers),Se?{transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:Se&&Se.iceServers}:{transportPolicy:_e.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0}))},getCodecFlags:()=>({h264:_e.sessionInfo.h264,vp9:_e.sessionInfo.vp9,vp8:_e.sessionInfo.vp8}),getVideoCodecsCompatible:e=>y({RTCPeerConnection:q.RTCPeerConnection,env:X.env,stream:e,codecFlags:_e._.getCodecFlags()}),getIceConfig:()=>{if(!oe)return _e._.getOtIceServerInfo();const e=oe&&"relay"===oe.transportPolicy?"relay":_e.sessionInfo.clientCandidates;return("custom"===oe.includeServers?t.resolve({servers:[]}):_e._.getOtIceServerInfo()).then(t=>d(t,{transportPolicy:e,servers:[...t.servers,...oe.customServers]}))},forceMute:function(e){this.dispatchEvent(new k.MuteForcedEvent(e))}.bind(this),enableMuteOnEntry:()=>{ke=!0},addSubscriberToPeerConnectionsQueue:(e,t)=>{Oe.push({pc:e,message:t}),Ne||(Ne=setInterval(()=>{const e=Oe.shift();e?e.pc.processMessage("offer",e.message):(clearInterval(Ne),Ne=null)},100))},disableMuteOnEntry:()=>{ke=!1},privateEvents:new a},this.signal=function(e,t){let n=e,r=t||function(){};if(l(n)&&(r=n,n=null),this.isNot("connected")){const e="Unable to send signal - you are not connected to the session.";tt(N(Z.NOT_CONNECTED,new Error(e),500),r)}else pe.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&&Ze.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 Z.INVALID_PARAMETER;case 429:return Z.RATE_LIMIT_EXCEEDED;case 404:return Z.NOT_FOUND;case 500:return Z.NOT_CONNECTED;case 403:return Z.PERMISSION_DENIED;case 2001:return Z.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 tt(N(Z.NOT_CONNECTED,new Error(e),V.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 tt(N(Z.INVALID_PARAMETER,new Error(r),V.INVALID_PARAMETER),t);et("forceDisconnect")?pe.forceDisconnect(n,(function(e){if(e)tt(N(Z.INVALID_PARAMETER,new Error(r),V.INVALID_PARAMETER),t);else if(t&&l(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)}})):tt(N(Z.PERMISSION_DENIED,new Error("This token does not allow forceDisconnect. The role must be at least `moderator` to enable this functionality"),V.UNABLE_TO_FORCE_DISCONNECT),t)},this.forceUnpublish=function(e,t){void 0===t&&(t=()=>{});const n=e=>tt(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:V.INVALID_PARAMETER,name:Z.INVALID_PARAMETER},i={msg:"Cannot call forceUnpublish(). You are not connected to the session.",code:V.NOT_CONNECTED,name:Z.NOT_CONNECTED},o={msg:"This token does not allow forceUnpublish. The role must be at least `moderator` to enable this functionality",code:V.UNABLE_TO_FORCE_UNPUBLISH,name:Z.PERMISSION_DENIED},s={msg:"The stream does not exist.",name:Z.NOT_FOUND},a={msg:"An unexpected error occurred.",name:Z.UNEXPECTED_SERVER_RESPONSE,code:V.UNEXPECTED_SERVER_RESPONSE};if(!e)return void n(r);if(m.isNot("connected"))return void n(i);const c=fe(e);et("forceUnpublish")?pe.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=rt();r?n(r):e&&e.id?pe.forceMuteStream(e.id,e=>{e?n(it(e)):t()}):n(nt(M.INVALID_PARAMETER))}),this.forceMuteAll=e=>new t((t,n)=>{const r=rt();if(r)return void n(r);if(Array.isArray(e)&&!e.every(e=>e instanceof O)||e&&!Array.isArray(e))return void n(nt(M.INVALID_PARAMETER));const i=(e||[]).map(e=>e.id);pe.forceMuteAll(i,!0,e=>{e?n(it(e)):t()})}),this.disableForceMute=()=>new t((e,t)=>{const n=rt();n?t(n):pe.forceMuteAll([],!1,n=>{n?t(it(n)):e()})}),this.setEncryptionSecret=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(ue){e.next=3;break}return W.error("Encryption secret must first be set in initSession."),e.abrupt("return");case 3:e.prev=3,E(t),e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(3),N(Z.INVALID_ENCRYPTION_SECRET,new Error("setEncryptionSecret: "+e.t0.message));case 10:return e.prev=10,e.next=13,m.keyStore.set(n,t);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),Ze.error("Error in setEncryptionSecret}: "+e.t1.message);case 18:case"end":return e.stop()}}),e,null,[[3,7],[10,15]])})));return function(t){return e.apply(this,arguments)}}(),this.isConnected=()=>this.is("connected"),this.capabilities=new C([],{hasE2eeCapability:A})}}}).call(this,n(1))},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(52).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(18),i=n(22),o=n(6),s=n(2)("Dispatcher"),a=n(172),c=n(734),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"data":this.dispatchCaption(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.dispatchCaption=function(e){this.emit("caption",e.fromAddress,e.content)},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(17),i=n(8),o=n(737),s=n(738),a=n(321),c=n(739),u=n(35)().onlyLocal(),l={};e.exports=l,l.connections={},l.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}})},l.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:{}})},l.sessions={},l.sessions.get=function(e,t){return a({method:"read",uri:`/v2/partner/${e}/session/${t}`,content:{}})},l.streams={},l.streams.get=function(e,t,n){return a({method:"read",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:{}})},l.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},l.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.publisherAudioFallbackEnabled,u=t.subscriberAudioFallbackEnabled,d=t.channels,h=t.minBitrate,f=t.maxBitrate,p=t.sourceStreamId,m=t.e2ee,g={id:i,name:o,audioFallbackEnabled:s,publisherAudioFallbackEnabled:c,subscriberAudioFallbackEnabled:u,channel:d.map(e=>l.streams.channelFromOTChannel(e)),e2ee:m};return h&&(g.minBitrate=Math.round(h)),f&&(g.maxBitrate=Math.round(f)),p&&(g.sourceStreamId=p),"boolean"==typeof m&&(g.e2ee=m),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}`,content:g})},l.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})},l.streamChannels={},l.streamChannels.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/channel/${r}`,content:i})},l.subscribers={},l.subscribers.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,i=t.streamId,u=t.subscriberId,l=t.connectionId,d=t.channelsToSubscribeTo,h=t.sourceStreamId,f=t.e2ee,p={id:u,connection:l,keyManagementMethod:c,bundleSupport:o(),rtcpMuxSupport:s(),e2ee:f};return d&&(p.channel=d),h&&(p.sourceStreamId=h),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}/subscriber/${u}`,content:p})},l.subscribers.destroy=function(e,t,n,r){return a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:{}})},l.subscribers.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:i})},l.subscriberChannels={},l.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})},l.signals={},l.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})},l.forceMute={},l.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(39),i=n(72),o=n(173),s=n(324),a=n(326);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(0),i=r(n(4)),o=r(n(5));const s=n(328),a=n(50),c=n(173),u=n(742),l=n(323),d=n(2)("SessionDispatcher"),h=n(21),f=n(171),p=n(151),m=n(168);function g(e,t){if(t.streams.has(e.id))return;const n=function(e,t){const n=e.channel.map(e=>new p(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 y=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)}},v={};e.exports=function(e,t){let n=(void 0===t?{}:t).connectionEventsSuppressed;const r=new l;let s=!1;const u=new y(r);r.on("reconnecting",()=>{e._.reconnecting()}),r.on("reconnected",()=>{e._.reconnected()}),r.on("close",t=>{const n=e.connection;n&&(n.destroyedReason()?d.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(v).forEach(r=>{const i=v[r];if(i&&t.id===i.connection.id){g(i,e),delete v[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 d.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):d.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{v[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&&h.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=h.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):d.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):d.debug("stream#update that handle this reason is not currently implemented"):d.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):d.error("Unable to determine streamId, or the stream does not exist, for streamChannel message!")});const p=(t,n,r,s)=>{let u,l;const f={streamId:n},p=h.subscribers,m=h.publishers;switch(u=s.params.subscriber?{widgetId:s.params.subscriber}:f,t){case"offer":l=[].concat(p.where(u),m.where(f)).slice(0,1);break;case"answer":case"pranswer":l=[].concat(m.where(f),p.where(u)).slice(0,1);break;case"generateoffer":case"unsubscribe":l=m.where(f);break;case"candidate":l=[].concat(p.where(u),m.where(f));break;default:return void d.debug(`jsep#${t} is not currently implemented`)}if(0===l.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)),l.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),d.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",p.bind(null,"offer")),r.on("jsep#answer",p.bind(null,"answer")),r.on("jsep#pranswer",p.bind(null,"pranswer")),r.on("jsep#generateoffer",p.bind(null,"generateoffer")),r.on("jsep#unsubscribe",p.bind(null,"unsubscribe")),r.on("jsep#candidate",p.bind(null,"candidate")),r.on("subscriberChannel#updated",(t,n,r)=>{t&&e.streams.has(t)?e.streams.get(t)._.updateChannel(n,r):d.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)?h.subscribers.has(t)?h.subscribers.get(t).disableVideo(r.active):d.error("Unable to determine subscriberId, or the subscriber does not exist, for subscriberChannel#update message!"):d.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("caption",(t,n)=>{e._.dispatchCaption(t,n)}),r.on("archive#created",t=>{b(t,e)}),r.on("archive#updated",(t,n)=>{const r=e.archives.get(t);r?r._.update(n):d.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}),d.debug(`Received a request from RUMOR to start a transition to ${t} for the stream ID ${n} with the reason: ${r}`),h.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}),d.debug(`Received a request from RUMOR to start a transition from P2P to MANTIS for the stream ID ${n} with the reason: ${r}`),h.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(0),i=r(n(4)),o=r(n(5));const s=n(21),a=n(108).setCurrentAudioOutputDeviceId,c=n(330),u=n(24)(),l=u.getDefaultAudioOutputDeviceId,d=u.getAudioOutputMediaDevices,h=n(296),f=new(n(26)),p=(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,h();case 2:return e.prev=2,p("Attempt",{deviceId:t}),e.next=6,m(t);case 6:p("Success",{deviceId:t}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(2),p("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,d();case 2:return t=e.sent,n=l(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)}}(),y=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,p("Attempt",{deviceId:t}),e.next=4,m(t);case 4:p("Success",{deviceId:t}),a(t),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),p("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.next=13,y();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(1))},function(e,t,n){"use strict";n(333);const r=n(39),i=n(27),o=n(6),s=n(130),a=n(35)(),c=n(26),u=n(249),l=n(559),d=n(560),h=a.onlyLocal(),f={};f.noConflict=n(561)(),(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 p=n(144)(void 0!==typeof window?window:global),m=n(8),g=n(72),b=n(145),y=n(252),v=n(146),w=n(147),S=n(253),T=n(148),E=n(7),x=n(10),_=n(254),C=n(241),I=n(2)("OT"),R=n(123),Z=n(588),k=n(22),O=n(103).parseIceServers,V=n(267),G=n(21),A=n(151),W=n(153),N=n(154),L=n(73)({global:p}),X=n(13)({}),M=n(159)(),F=n(281)({otError:X}),P=n(282)(),j=n(288)({global:p}),U=n(24)({getNativeEnumerateDevices:j}),H=n(23)(),Y=n(161)(),D=n(643)({otError:X,global:p}),B=n(162)({chromeExtensionHelper:F,otError:X}),K=n(648)({deviceHelpers:U,generateConstraintInfo:_,getUserMediaHelper:D,global:p,OTHelpers:m,screenSharing:B}),J=n(651)({otError:X,processPubOptions:K}),z=n(163)({otError:X}),Q=n(75),q=n(293)(),$=n(294)({otError:X}),ee=n(295)({global:p,videoElementErrorMap:$}),te=n(164)({global:p}),ne=n(297)({PeerConnection:L,setCertificates:te}),re=n(300)({PeerConnection:L,setCertificates:te}),ie=n(302)(),oe=n(663)({otError:X}),se=n(110)({NativeVideoElementWrapper:ee}),ae=n(152)(),ce=n(165)({VideoElementFacade:se}),ue=n(305)({interpretPeerConnectionError:z,otError:X,SubscriberPeerConnection:re,WidgetView:ce}),le=n(169)({APIKEY:g,createChromeMixin:P,deviceHelpers:U,EnvironmentLoader:T,Errors:E,Events:H,ExceptionCodes:x,calculateCapableSimulcastStreams:y,global:p,interpretPeerConnectionError:z,IntervalRunner:Q,Microphone:q,otError:X,OTErrorClass:k,OTHelpers:m,parseIceServers:O,processPubOptions:K,PUBLISH_MAX_DELAY:V,PublisherPeerConnection:ne,PublishingState:ie,StreamChannel:A,systemRequirements:N,VideoOrientation:ae,WidgetView:ce}),de=n(317)({otError:X,Publisher:le}),he=n(318)({global:p,initPublisher:de,otError:X,Publisher:le,Subscriber:ue}),fe=n(752)({Session:he});o(f);const pe=n(753),me=n(756),ge=n(757);u(f,"$",{name:"OT.$",getMessage:"Please use an external library like jQuery to select elements from the page.",value:m}),f.APIKEY=g.value,f.AnalyserAudioLevelSampler=w,f.Archive=n(328),f.ArchiveEvent=H.ArchiveEvent,f.ArchiveUpdatedEvent=H.ArchiveUpdatedEvent,f.AudioLevelTransformer=b,f.AudioLevelUpdatedEvent=H.AudioLevelUpdatedEvent,f.Capabilities=n(170),f.Chrome=v,f.Connection=n(173),f.ConnectionCapabilities=f.Connection.Capabilities,f.ConnectionEvent=H.ConnectionEvent,Object.keys(R).forEach(e=>{f[e.toUpperCase()]=R[e].priority}),f.NONE=0,f.debug=I.debug,f.error=I.error,f.info=I.info,f.log=I.log,f.warn=I.warn,f.DestroyedEvent=H.DestroyedEvent,f.EnvLoadedEvent=H.EnvLoadedEvent,f.Error=k,f.Error.on(i.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=x,f.ExceptionEvent=H.ExceptionEvent,f.getDevices=n(758),f.getAudioOutputDevices=n(329),f.getActiveAudioOutputDevice=n(330),f.setAudioOutputDevice=n(759)(),f.GetAudioLevelSampler=S,f.HAS_REQUIREMENTS=1,f.IntervalRunner=Q,f.IssueReportedEvent=H.IssueReportedEvent,f.MediaStoppedEvent=H.MediaStoppedEvent,f.Microphone=q,f.NOT_HAS_REQUIREMENTS=0,f.PeerConnection=L,f.PeerConnection.QOS=n(279).default,f.Publisher=le,f.PublisherPeerConnection=ne,f.PublishingState=ie,f.MuteForcedEvent=H.MuteForcedEvent,f.Session=he,f.SessionConnectEvent=H.SessionConnectEvent,f.SessionDisconnectEvent=H.SessionDisconnectEvent,f.SessionDispatcher=n(327),f.Signal=n(325),f.SignalEvent=H.SignalEvent,f.Stream=n(171),f.StreamChannel=A,f.StreamEvent=H.StreamEvent,f.StreamPropertyChangedEvent=H.StreamPropertyChangedEvent,f.StreamUpdatedEvent=H.StreamUpdatedEvent,f.StylableComponent=W,f.Subscriber=ue,f.SubscriberPeerConnection=re,f.SubscribingState=n(308),f.VideoDimensionsChangedEvent=H.VideoDimensionsChangedEvent,f.VideoDisableWarningEvent=H.VideoDisableWarningEvent,f.VideoElement=se,f.VideoEnabledChangedEvent=H.VideoEnabledChangedEvent,f.VideoOrientation=ae,f.WidgetView=ce,f.getSupportedCodecs=pe,f.hasMediaProcessorSupport=me,f.hasEndToEndEncryptionSupport=ge,f._={AnalyticsHelper:c,getClientGuid:C.get,StaticConfig:a},Object.defineProperty(f,"version",{value:h.version});const be={};u(be,"version",{value:h.version,name:"OT.properties.version",getWarning:"Please use OT.version instead",warnOnSet:!0,setWarning:"Mutating version has no effect"}),l.forEach(e=>{let t,n;if(Array.isArray(e)){const r=e[0],i=e[1];n=r,t=h[i]||i}else t=h[e],n=e;const r=(i=n,d.includes(i));var i;u(be,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=be,f.audioContext=M,f.checkScreenSharingCapability=B.checkCapability,f.checkSystemRequirements=N.check,f.components={},f.generateSimpleStateMachine=Y,f.getErrorTitleByCode=k.getTitleByCode,f.getLogs=I.getLogs,f.getStatsAdpater=n(275),f.getStatsHelpers=n(76),f.getUserMedia=J,f.handleJsException=k.handleJsException,f.initPublisher=de,f.setProxyUrl=n(102).setProxyUrl,f.initSession=function(e,t,n){return null==t&&(t=e,e=null),0===g.value.length&&e&&(g.value=e,f.APIKEY=e),fe(e,t,n)};const ye=(e,t)=>()=>(console.warn(e+" is deprecated and will be removed in a future version of OpenTok"),t);Object.defineProperties(f,{isUnloaded:{get:ye("OT.isUnloaded",T.isUnloaded)},onLoad:{get:ye("OT.onLoad",T.onLoad)},onUnload:{get:ye("OT.onUnload",T.onUnload)},overrideGuidStorage:{get:ye("OT.overrideGuidStorage",C.override)}}),f.pickScreenSharingHelper=B.pickHelper,f.publishers=G.publishers,f.registerScreenSharingExtension=B.registerExtension,f.registerScreenSharingExtensionHelper=B.registerExtensionHelper,f.reportIssue=oe,f.sessions=G.sessions,f.setLogLevel=Z,f.shouldLog=I.shouldLog,f.subscribers=G.subscribers,f.unblockAudio=n(167),f.upgradeSystemRequirements=N.upgrade,T.onUnload(()=>{G.publishers.destroy(),G.subscribers.destroy(),G.sessions.destroy("unloaded")}),n(760)()},function(e,t,n){var r=n(334);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(348)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(335)(!1);var r=n(336),i=r(n(337)),o=r(n(338)),s=r(n(339)),a=r(n(340)),c=r(n(341)),u=r(n(342)),l=r(n(343)),d=r(n(344)),h=r(n(345)),f=r(n(346)),p=r(n(347));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("+l+") 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("+d+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-warning {\n background-image: url("+h+");\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("+p+");\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("+p+");\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/JRMlAAAAQ3RSTlMABAUHCQoLDhAQERwdHiAjLjAxOD9ASFBRVl1m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uOYqOsmQi2jgws4PA/DD/z0B2x0/veCs4naw0cgybezid7X9jV3rX2RSs0wfLkll4pBGcgifg+NYxe1kJ2ycTaRq66uG/wBOl0vjcw70xwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAGMElEQVR4Ae2aA7D0yBaAc7oH12vbRmlLaxYWb23btm3btm2899a2bWuYtPZ01cmtU9lJrib315yqr9I3Oem/5/s7acwEnehEJzoxCcX2O+wEeIgRBDDaGjAZOgQ6ihRpLklHZDJIXK1WWymMIhGGkVBKCWMM+Iv/f/b5t7faYtM/sGgIS7j8RNLjceUVl41GvGN1BFiHy9sgtRWaYbhvuVQ6o1VOvV5/tLe3dyssKoZuh8xClkDEi2MMS6ZjR0cScxdK/+HgnJsmLccYOx0e/PUGUqfTJDEHkV5go9lcMQoj4R8RpSIRRUr4a9baTJFCCNfqESKJ7RYJibK0xoi05EhFRTxMi1Rit6xHAuLaKRLwEVi6q1x+EhlVpd3d3Wfh4VQkQhRhxthYLg7SRGqdLlIp7UVOHf+JhEhEMscUolVje3p63saeeOFoKsT7fjj++BNuw2I/0ouUENmGaQcQEilQvUU6xuWC0kqmVWCt8df6kG7WLoFA20VSCOyNh0RKPT+SyrTWtQsvuvTYCy84z3+oAdbgAiLGIvHjTz6bFuu/B3lKKfVkFKknwih6EnnipZdfXQZzepAupXSGSCfwUGZtkrx3t/0dSQGnnXbmdocdetArQoj+4VR23wMP3bj/vnv9Sv/rBmkish09ca655thHSrlWq4TFF1vkNDxsgjiUnPqZnHPABIq47jx7pPMcecShfz7x1DO7D6eit99576X1113nVd8rqLGAuDaNitJonTGIqHgQGQjDsJglMrUH5iDSEQbRa6y2yrNvv/PuWVmV/PTzLz8steTit1B9FtGJeZrJksmWdBzBMcami4xUkaY1A1Qe94WIaPGBApJhaERrLrXkElf8+NPPz6YMLs1DDjn0Wn9PnI/UiQadM4jNEkhzVsEGE8nIHESM1j5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jcwMWMtMTAuOTQyLTUuMjg2LTE2LjQxMy04LjEtMTYuNDEzLTguNDQ2VjM0LjM2MnoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48L2c+PHBhdGggZD0iTTgxLjUgMTYuNUwxOS45OTggNzguMDAyIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+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,l=0,d=[],h=n(349);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(v(r.parts[s],t))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(v(r.parts[s],t));o[r.id]={id:r.id,refs:1,parts:a}}}}function p(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=d[d.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),d.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=d.indexOf(e);t>=0&&d.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 y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(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=l++;n=u||(u=b(t)),r=T.bind(null,n,s,!1),i=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",y(t,e.attrs),m(e,t),t}(t),r=x.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),r=E.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=p(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(p(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 w,S=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function T(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 E(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 x(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=h(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(81),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(81);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(81);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(81);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(80);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(80),i=n(113),o=n(114);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(18),i=n(363),o=n(11),s=n(175),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,h=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:a).test(s(e))}},function(e,t,n){var r=n(41),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(364),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(15)["__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(367),i=n(80),o=n(113);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(368),i=n(369),o=n(370),s=n(371),a=n(372);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(82);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(82),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(82),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(82);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(83);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(83);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(83);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(83);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(30),i=n(19);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(30),i=n(116),o=n(19),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(179)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(42),i=n(55);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(385),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(42),i=n(119);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(42),i=n(182);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(40)(n(15),"DataView");e.exports=r},function(e,t,n){var r=n(40)(n(15),"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(122),i=n(393),o=n(394),s=n(395),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 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(122);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(41),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(397),i=n(68),o=n(117),s=o&&o.isMap,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(43),i=n(19);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(399),i=n(68),o=n(117),s=o&&o.isSet,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(43),i=n(19);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(401)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(44))},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(402),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(404),i=n(176),o=n(89),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(195),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(45),o=n(127),s=n(410),a=n(32),c=n(411),u=n(33),l=n(202),d=n(453),h=n(46).toStringTag,f=n(454),p=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)&&(p(t)||(t=l(t))),m(e,"__weakMapData__",u("c","$weakMap$"+c())),t?(d(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,h,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(196)()||(r=n(197)),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(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),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(413);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(128);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(416),i=n(32),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(417)()?Object.keys:n(418)},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(45),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(127),o=n(201),s=n(33),a=n(46),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?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(92),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(33),a=n(203),c=n(92).Symbol,u=n(427),l=n(428),d=n(429),h=Object.create,f=Object.defineProperties,p=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=h(i.prototype),t=void 0===t?"":String(t),f(n,{__description__:s("",t),__name__:s("",u(t))}))},l(r),d(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)}))}),p(r.prototype,r.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),p(r.prototype,r.toStringTag,s("c","Symbol")),p(i.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),p(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(33),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(33),i=n(92).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(33),i=n(203),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(32);e.exports=function(){return r(this).length=0,this}},function(e,t,n){"use strict";var r,i=n(57),o=n(432),s=n(436),a=n(437),c=n(200),u=n(447),l=Function.prototype.bind,d=Object.defineProperty,h=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&&h.call(this,e)?i:(t.value=l.call(i,n.resolveContext?n.resolveContext(this):this),d(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(205),i=n(57);e.exports=function(e){return i(e)?e:r(e,"Cannot use %v",arguments[1])}},function(e,t,n){"use strict";var r=n(57),i=n(128),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(435),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(205),i=n(199);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(438),i=n(129),o=n(32);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(439)()?Array.from:n(440)},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(46).iterator,i=n(90),o=n(441),s=n(442),a=n(70),c=n(32),u=n(45),l=n(91),d=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(e){var t,n,m,g,b,y,v,w,S,T,E=arguments[1],x=arguments[2];if(e=Object(c(e)),u(E)&&a(E),this&&this!==Array&&o(this))t=this;else{if(!E){if(i(e))return 1!==(b=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(d(e)){for(g=new Array(b=e.length),n=0;n<b;++n)g[n]=e[n];return g}}g=[]}if(!d(e))if(void 0!==(S=e[r])){for(v=a(S).call(e),t&&(g=new t),w=v.next(),n=0;!w.done;)T=E?h.call(E,x,w.value,n):w.value,t?(f.value=T,p(g,n,f)):g[n]=T,w=v.next(),++n;b=n}else if(l(e)){for(b=e.length,t&&(g=new t),n=0,m=0;n<b;++n)T=e[n],n+1<b&&(y=T.charCodeAt(0))>=55296&&y<=56319&&(T+=e[++n]),T=E?h.call(E,x,T,m):T,t?(f.value=T,p(g,m,f)):g[m]=T,++m;b=m}if(void 0===b)for(b=s(e.length),t&&(g=new t(b)),n=0;n<b;++n)T=E?h.call(E,x,e[n],n):e[n],t?(f.value=T,p(g,n,f)):g[n]=T;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(443),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){"use strict";var r=n(444),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(445)()?Math.sign:n(446)},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(448),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(449)("forEach")},function(e,t,n){"use strict";var r=n(70),i=n(32),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 l,d=arguments[2],h=arguments[3];return n=Object(i(n)),r(u),l=a(n),h&&l.sort("function"==typeof h?o.call(h,n):void 0),"function"!=typeof e&&(e=l[e]),s.call(e,l,(function(e,r){return c.call(n,e)?s.call(u,d,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r,i=n(127),o=n(33),s=n(46),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__",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(452);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(90),i=n(45),o=n(91),s=n(46).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(90),i=n(70),o=n(91),s=n(202),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,l,d,h,f,p,m,g,b=arguments[2];if(a(e)||r(e)?n="array":o(e)?n="string":e=s(e),i(t),d=function(){h=!0},"array"!==n)if("string"!==n)for(l=e.next();!l.done;){if(c.call(t,b,l.value,d),h)return;l=e.next()}else for(p=e.length,f=0;f<p&&(m=e[f],f+1<p&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++f]),c.call(t,b,m,d),!h);++f);else u.call(e,(function(e){return c.call(t,b,e,d),h}))}},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(93),i=n(94),o=n(132),s=n(34),a=n(68),c=n(95),u=Math.min;e.exports=function(e,t,n){for(var l=n?o:i,d=e[0].length,h=e.length,f=h,p=Array(h),m=1/0,g=[];f--;){var b=e[f];f&&t&&(b=s(b,a(t))),m=u(b.length,m),p[f]=!n&&(t||d>=120&&b.length>=120)?new r(f&&b):void 0}b=e[0];var y=-1,v=p[0];e:for(;++y<d&&g.length<m;){var w=b[y],S=t?t(w):w;if(w=n||0!==w?w:0,!(v?c(v,S):l(g,S,n))){for(f=h;--f;){var T=p[f];if(!(T?c(T,S):l(e[f],S,n)))continue e}v&&v.push(S),g.push(w)}}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(206),i=n(459),o=n(460);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(133);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){"use strict";(function(t){var r=n(20),i=n(208),o=n(463),s=n(214);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(211));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(215),c.CancelToken=n(476),c.isCancel=n(210),c.all=function(e){return t.all(e)},c.spread=n(477),c.isAxiosError=n(478),e.exports=c,e.exports.default=c}).call(this,n(1))},function(e,t,n){"use strict";(function(t){var r=n(20),i=n(209),o=n(464),s=n(465),a=n(214);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(1))},function(e,t,n){"use strict";var r=n(20);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(20),i=n(466),o=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=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(1))},function(e,t,n){"use strict";var r=n(20);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(20);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 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(20);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(472),i=n(473);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(20),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(20);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(215);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(1))},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(49));r.placeholder=n(134),e.exports=r},function(e,t,n){var r=n(481),i=n(134),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,l){var d="function"==typeof n,h=n===Object(n);if(h&&(l=u,u=n,n=void 0),null==u)throw new TypeError;l||(l={});var f=!("cap"in l)||l.cap,p=!("curry"in l)||l.curry,m=!("fixed"in l)||l.fixed,g=!("immutable"in l)||l.immutable,b=!("rearg"in l)||l.rearg,y=d?u:i,v="curry"in l&&l.curry,w="fixed"in l&&l.fixed,S="rearg"in l&&l.rearg,T=d?u.runInContext():void 0,E=d?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},x=E.ary,_=E.assign,C=E.clone,I=E.curry,R=E.forEach,Z=E.isArray,k=E.isError,O=E.isFunction,V=E.isWeakMap,G=E.keys,A=E.rearg,W=E.toInteger,N=E.toPath,L=G(r.aryMethod),X={castArray:function(e){return function(){var t=arguments[0];return Z(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(!O(n))return e(n,Object(t));var r=[];return R(G(t),(function(e){O(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),R(r,(function(e){var t=e[1];O(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:W(t)+1;return I(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return I(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),l)}}};function M(e,t){if(f){var n=r.iterateeRearg[e];if(n)return function(e,t){return H(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)}}(A(s(e,n),t),n)}))}(t,n);var i=!d&&r.iterateeAry[e];if(i)return function(e,t){return H(e,(function(e){return"function"==typeof e?s(e,t):e}))}(t,i)}return t}function F(e,t,n){if(m&&(w||!r.skipFixed[e])){var i=r.methodSpread[e],s=i&&i.start;return void 0===s?x(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 P(e,t,n){return b&&n>1&&(S||!r.skipRearg[e])?A(t,r.methodRearg[e]||r.aryRearg[n]):t}function j(e,t){for(var n=-1,r=(t=N(t)).length,i=r-1,o=C(Object(e)),s=o;null!=s&&++n<r;){var a=t[n],c=s[a];null==c||O(c)||k(c)||V(c)||(s[a]=C(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=l;return function(t){var r=d?T:E,a=d?T[o]:n,c=_(_({},s),t);return e(r,i,a,c)}}function H(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=X[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))),R(L,(function(e){return R(r.aryMethod[e],(function(t){if(o==t){var n=r.methodSpread[o],a=n&&n.afterRearg;return i=a?F(o,P(o,s,e),e):P(o,F(o,s,e),e),i=function(e,t,n){return v||p&&n>1?I(t,n):t}(0,i=M(o,i),e),!1}})),!i})),i||(i=s),i==t&&(i=v?I(i,1):function(){return t.apply(this,arguments)}),i.convert=U(o,t),i.placeholder=t.placeholder=n,i}if(!h)return Y(n,u,y);var D=u,B=[];return R(L,(function(e){R(r.aryMethod[e],(function(e){var t=D[r.remap[e]||e];t&&B.push([e,Y(e,t,D)])}))})),R(G(D),(function(e){var t=D[e];if("function"==typeof t){for(var n=B.length;n--;)if(B[n][0]==e)return;t.convert=U(e,t),B.push([e,t])}})),R(B,(function(e){D[e[0]]=e[1]})),D.convert=function(e){return D.runInContext.convert(e)(void 0)},D.placeholder=D,R(G(D),(function(e){R(r.realToAlias[e]||[],(function(t){D[t]=D[e]}))})),D}},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(483),assign:n(177),clone:n(39),curry:n(501),forEach:n(115),isArray:n(12),isError:n(502),isFunction:n(18),isWeakMap:n(503),iteratee:n(504),keys:n(118),rearg:n(519),toInteger:n(97),toPath:n(522)}},function(e,t,n){var r=n(135);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(96),i=n(15);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(124),i=n(96),o=n(219),s=n(222),a=n(228),c=n(138),u=n(15);e.exports=function(e,t,n){var l=i(e);return function i(){for(var d=arguments.length,h=Array(d),f=d,p=a(i);f--;)h[f]=arguments[f];var m=d<3&&h[0]!==p&&h[d-1]!==p?[]:c(h,p);if((d-=m.length)<n)return s(e,t,o,i.placeholder,void 0,h,m,void 0,void 0,n-d);var g=this&&this!==u&&this instanceof i?l:e;return r(g,this,h)}}},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(136),i=n(223),o=n(488),s=n(490);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(489),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(136),i=n(225),o=n(137),s=n(12),a=n(19),c=n(491),u=Object.prototype.hasOwnProperty;function l(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)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},function(e,t,n){var r=n(136),i=n(225),o=n(56);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(115),i=n(94),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(56),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(124),i=n(96),o=n(15);e.exports=function(e,t,n,s){var a=1&t,c=i(e);return function t(){for(var i=-1,u=arguments.length,l=-1,d=s.length,h=Array(d+u),f=this&&this!==o&&this instanceof t?c:e;++l<d;)h[l]=s[l];for(;u--;)h[l++]=arguments[++i];return r(f,a?n:this,h)}}},function(e,t,n){var r=n(220),i=n(221),o=n(138),s=Math.min;e.exports=function(e,t){var n=e[1],a=t[1],c=n|a,u=c<131,l=128==a&&8==n||128==a&&256==n&&e[7].length<=t[8]||384==a&&t[7].length<=t[8]&&8==n;if(!u&&!l)return e;1&a&&(e[2]=t[2],c|=1&n?0:4);var d=t[3];if(d){var h=e[3];e[3]=h?r(h,d,t[4]):d,e[4]=h?o(e[3],"__lodash_placeholder__"):t[4]}return(d=t[5])&&(h=e[5],e[5]=h?i(h,d,t[6]):d,e[6]=h?o(e[5],"__lodash_placeholder__"):t[6]),(d=t[7])&&(e[7]=d),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(500),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(135);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(30),i=n(19),o=n(139);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(43),i=n(19);e.exports=function(e){return i(e)&&"[object WeakMap]"==r(e)}},function(e,t,n){var r=n(78),i=n(36);e.exports=function(e){return i("function"==typeof e?e:r(e,1))}},function(e,t,n){var r=n(506),i=n(510),o=n(235);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(79),i=n(230);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 l=(u=n[s])[0],d=e[l],h=u[1];if(c&&u[2]){if(void 0===d&&!(l in e))return!1}else{var f=new r;if(o)var p=o(d,h,l,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},function(e,t,n){var r=n(79),i=n(231),o=n(508),s=n(509),a=n(43),c=n(12),u=n(66),l=n(86),d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,p,m){var g=c(e),b=c(t),y=g?"[object Array]":a(e),v=b?"[object Array]":a(t),w=(y="[object Arguments]"==y?d:y)==d,S=(v="[object Arguments]"==v?d:v)==d,T=y==v;if(T&&u(e)){if(!u(t))return!1;g=!0,w=!1}if(T&&!w)return m||(m=new r),g||l(e)?i(e,t,n,f,p,m):o(e,t,y,n,f,p,m);if(!(1&n)){var E=w&&h.call(e,"__wrapped__"),x=S&&h.call(t,"__wrapped__");if(E||x){var _=E?e.value():e,C=x?t.value():t;return m||(m=new r),p(_,C,n,f,m)}}return!!T&&(m||(m=new r),s(e,t,n,f,p,m))}},function(e,t,n){var r=n(41),i=n(188),o=n(54),s=n(231),a=n(233),c=n(98),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){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||!d(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 p=1&r;if(f||(f=c),e.size!=t.size&&!p)return!1;var m=h.get(e);if(m)return m==t;r|=2,h.set(e,t);var g=s(f(e),f(t),r,u,d,h);return h.delete(e),g;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t,n){var r=n(183),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var d=l;d--;){var h=u[d];if(!(c?h in t:i.call(t,h)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);for(var g=c;++d<l;){var b=e[h=u[d]],y=t[h];if(o)var v=c?o(y,b,h,t,e,a):o(b,y,h,e,t,a);if(!(void 0===v?b===y||s(b,y,n,o,a):v)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(m=!1)}return a.delete(e),a.delete(t),m}},function(e,t,n){var r=n(234),i=n(31);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(230),i=n(59),o=n(237),s=n(140),a=n(234),c=n(235),u=n(48);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(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(41),i=n(34),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(60),i=n(65),o=n(12),s=n(67),a=n(116),c=n(48);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,d=!1;++u<l;){var h=c(t[u]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++u!=l?d:!!(l=null==e?0:e.length)&&a(l)&&s(h,l)&&(o(e)||i(e))}},function(e,t,n){var r=n(517),i=n(518),o=n(140),s=n(48);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(99);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(135),i=n(141),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(238);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(41),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(34),i=n(56),o=n(12),s=n(71),a=n(236),c=n(48),u=n(61);e.exports=function(e){return o(e)?r(e,c):s(e)?[e]:i(a(u(e)))}},function(e,t,n){var r=n(524),i=n(237);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(99),i=n(525),o=n(60);e.exports=function(e,t,n){for(var s=-1,a=t.length,c={};++s<a;){var u=t[s],l=r(e,u);n(l,u)&&i(c,o(u,e),l)}return c}},function(e,t,n){var r=n(84),i=n(60),o=n(67),s=n(11),a=n(48);e.exports=function(e,t,n,c){if(!s(e))return e;for(var u=-1,l=(t=i(t,e)).length,d=l-1,h=e;null!=h&&++u<l;){var f=a(t[u]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(u!=d){var m=h[f];void 0===(p=c?c(m,f,h):void 0)&&(p=s(m)?m:o(t[u+1])?[]:{})}r(h,f,p),h=h[f]}return e}},function(e,t,n){var r=n(216)("mapKeys",n(527));r.placeholder=n(134),e.exports=r},function(e,t,n){var r=n(64),i=n(100),o=n(36);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]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,f=String.fromCharCode;function p(e){throw new RangeError(d[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(l,".")).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 y(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 v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=36)e=h(e/35);return h(r+36*e/(e+38))}function S(e){var t,n,r,i,o,s,c,u,l,d,f,m=[],g=e.length,b=0,v=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&p("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&&p("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>h((a-b)/s))&&p("overflow"),b+=u*s,!(u<(l=c<=S?1:c>=S+26?26:c-S));c+=36)s>h(a/(d=36-l))&&p("overflow"),s*=d;S=w(b-o,t=m.length+1,0==o),h(b/t)>a-v&&p("overflow"),v+=h(b/t),b%=t,m.splice(b++,0,v)}return y(m)}function T(e){var t,n,r,i,o,s,c,u,l,d,m,g,y,S,T,E=[];for(g=(e=b(e)).length,t=128,n=0,o=72,s=0;s<g;++s)(m=e[s])<128&&E.push(f(m));for(r=i=E.length,i&&E.push("-");r<g;){for(c=a,s=0;s<g;++s)(m=e[s])>=t&&m<c&&(c=m);for(c-t>h((a-n)/(y=r+1))&&p("overflow"),n+=(c-t)*y,t=c,s=0;s<g;++s)if((m=e[s])<t&&++n>a&&p("overflow"),m==t){for(u=n,l=36;!(u<(d=l<=o?1:l>=o+26?26:l-o));l+=36)T=u-d,S=36-d,E.push(f(v(d+T%S,0))),u=h(T/S);E.push(f(v(u,0))),o=w(n,y,r==i),n=0,++r}++n,++t}return E.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:y},decode:S,encode:T,toASCII:function(e){return g(e,(function(e){return u.test(e)?"xn--"+T(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(85)(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(532),t.encode=t.stringify=n(533)},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 l=0;l<u;++l){var d,h,f,p,m=e[l].replace(a,"%20"),g=m.indexOf(n);g>=0?(d=m.substr(0,g),h=m.substr(g+1)):(d=m,h=""),f=decodeURIComponent(d),p=decodeURIComponent(h),r(s,f)?i(s[f])?s[f].push(p):s[f]=[s[f],p]:s[f]=p}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(535),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,l=n.regeneratorRuntime;if(l)u&&(e.exports=l);else{(l=n.regeneratorRuntime=u?e.exports:{}).wrap=g;var d={},h={};h[s]=function(){return this};var f=Object.getPrototypeOf,p=f&&f(f(I([])));p&&p!==r&&i.call(p,s)&&(h=p);var m=w.prototype=y.prototype=Object.create(h);v.prototype=m.constructor=w,w.constructor=v,w[c]=v.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},l.awrap=function(e){return{__await:e}},S(T.prototype),T.prototype[a]=function(){return this},l.AsyncIterator=T,l.async=function(e,t,n,r){var i=new T(g(e,t,n,r));return l.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]"},l.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}},l.values=I,C.prototype={constructor:C,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(_),!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,d):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),d},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),_(n),d}},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;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}}}function g(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new C(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 R()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=E(s,n);if(a){if(a===d)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===d)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 y(){}function v(){}function w(){}function S(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,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,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).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 E(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,E(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=b(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;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,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function I(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:R}}function R(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}).call(this,n(1))},function(e,t,n){var r,i,o=n(242),s=n(243),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,l=t||[],d=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var f=o();null==d&&(d=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==h&&(h=i=16383&(f[6]<<8|f[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,g=p-a+(m-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,c=m,i=h;var b=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;l[u++]=b>>>24&255,l[u++]=b>>>16&255,l[u++]=b>>>8&255,l[u++]=255&b;var y=p/4294967296*1e4&268435455;l[u++]=y>>>8&255,l[u++]=255&y,l[u++]=y>>>24&15|16,l[u++]=y>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var v=0;v<6;++v)l[u+v]=d[v];return t||s(l)}},function(e,t,n){var r=n(242),i=n(243);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(0)(n(16));const i=n(9),o=n(2)("analytics"),s=n(539),a=n(17),c=n(244),u=n(101).prependProxyToUrlIfNeeded,l=n(102).getProxyUrl,d=a(),h=new s;e.exports=function(e){var t=this;let n=e.loggingUrl,s=e.queue,a=void 0===s?h:s,f=e.ajax,p=void 0===f?c:f;this.loggingUrl=n,this.updateEndPoints=()=>{if(!this.proxyUrl){this.proxyUrl=l();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:d});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),p.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(0)(n(14));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(543),i=r.isiPhone,o=r.isiPad,s=r.isiOS,a=n(544),c=n(545),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},l=()=>{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()};let d;e.exports={parse:e=>(d={version:-1,name:"unknown"},l()?(d.name="Node",d.isNode=!0,d.version=parseInt(t.versions.node,10),d.userAgent=`${d.name} ${d.version}`):(e=>{if(e=e||(void 0!==typeof window?window:global).navigator,d.userAgent=e.userAgent.toLowerCase(),d.name="unknown",d.userAgent.indexOf("opera")>-1||d.userAgent.indexOf("opr/")>-1)d.name="Opera",d.isOpera=!0,null!==/opr\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1));else if(d.userAgent.indexOf("firefox")>-1)d.name="Firefox",d.isFirefox=!0,null!==/firefox\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1));else if(d.userAgent.match(/edge?\/(\d+)(?:\.\d+)+$/)){d.name="Edge",d.isEdge=!0;const e=RegExp.$1;d.version=parseInt(e,10)}else d.userAgent.indexOf("chrome")>-1?(d.name="Chrome",d.isElectron=u(e),d.isElectron?d.electronVersion=c(e.userAgent):d.isChrome=!0,null!==/chrome\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1))):e.vendor&&e.vendor.toLowerCase().indexOf("apple")>-1?(d.name="Safari",d.isSafari=!0,d.isiPhone=i(e.userAgent),d.isiPad=o(e.userAgent),d.isiOS=s(e.userAgent),d.isiOS&&(d.iOSVersion=a(e.userAgent)),(null!==/version\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)||null!==/fxios\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)||null!==/crios\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent))&&(d.version=parseFloat(RegExp.$1))):d.userAgent.indexOf("applewebkit")>-1&&-1===d.userAgent.indexOf("version")&&(d.isIosWebView=!0);d.isChromiumEdge="Edge"===d.name&&d.version>=79,d.isLegacyEdge="Edge"===d.name&&d.version<79,d.isLegacyElectron=d.isElectron&&d.electronVersion<7,d.isLegacyChrome=d.isChrome&&d.version<87,d.isChromium=!!(d.isChrome||d.isChromiumEdge||d.isElectron||d.isOpera),d.isAndroid=d.userAgent.indexOf("android")>-1,d.userAgent=e.userAgent,d.protocol=location.protocol,d.hostName=location.hostName,(-1===d.version||"unknown"===d.name||d.isiOS&&!d.iOSVersion)&&(d.error=!0)})(e),d),isNode:l}}).call(this,n(44))},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(547);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(549);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(118),i=n(43),o=n(65),s=n(12),a=n(25),c=n(66),u=n(69),l=n(86),d=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)||l(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(d.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:"Publisher ICEWorkflow failed",1554:"Subscriber 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(18);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(247),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(554);e.exports=(e,t)=>{if("string"==typeof e&&"string"==typeof t){const n=r(e),i=t.match(/(\w+:\/\/)(.*)/);return`${i[1]}${n}/${i[2]}`}return t}},function(e,t,n){"use strict";e.exports=e=>e.replace(/\/+$/,"").replace(/^.*:\/+/,"")},function(e,t,n){"use strict";const r=n(556);e.exports=function(e){void 0===e&&(e={});(e.isSessionProxied||n(557))(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(0),i=r(n(4)),o=r(n(5));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";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(29);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(564)||null,l=n(566)||null,d=n(570)||null,h=n(572)||null,f=n(573)||null,p={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."),p;a("adapter.js shimming chrome."),p.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(!d||!d.shimPeerConnection||!o.shimFirefox)return a("Firefox shim is not included in this adapter release."),p;a("adapter.js shimming firefox."),p.browserShim=d,f.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimSourceObject(i),d.shimPeerConnection(i),d.shimOnTrack(i),d.shimRemoveStream(i),d.shimSenderGetStats(i),d.shimReceiverGetStats(i),d.shimRTCDataChannel(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"edge":if(!l||!l.shimPeerConnection||!o.shimEdge)return a("MS edge shim is not included in this adapter release."),p;a("adapter.js shimming edge."),p.browserShim=l,f.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimPeerConnection(i),l.shimReplaceTrack(i),l.shimGetDisplayMedia(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"safari":if(!h||!o.shimSafari)return a("Safari shim is not included in this adapter release."),p;a("adapter.js shimming safari."),p.browserShim=h,f.shimCreateObjectURL(i),h.shimRTCIceServerUrls(i),h.shimCreateOfferLegacy(i),h.shimCallbacksAPI(i),h.shimLocalStreamsAPI(i),h.shimRemoteStreamsAPI(i),h.shimTrackEventTransceiver(i),h.shimGetUserMedia(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;default:a("Unsupported browser!")}return p}},function(e,t,n){"use strict";(function(t){var r=n(29),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(565),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]=l(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 l(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(1))},function(e,t,n){"use strict";(function(t){var r=n(29),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 l=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return l(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(1))},function(e,t,n){"use strict";var r=n(29),i=n(567),o=n(568);e.exports={shimGetUserMedia:n(569),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(29);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(251);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 l(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 d=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(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.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},d.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},d.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)}))}},d.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()},d.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)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.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},d.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 l=r.getMediaSections(i._localDescription.sdp);l[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+l.join("");var d=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),d&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){s.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.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}},d.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)},d.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))},d.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,l=n.dtlsTransport,d=n.localCapabilities,h=n.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!n.rejected){var f=r.getIceParameters(e,i),p=r.getDtlsParameters(e,i);u&&(p.role="server"),a.usingBundle&&0!==t||(a._gather(n.mid,t),"new"===c.state&&c.start(s,f,u?"controlling":"controlled"),"new"===l.state&&l.start(p));var m=o(d,h);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()},d.prototype.setRemoteDescription=function(i){var d=this;if(-1===["offer","answer"].indexOf(i.type))return t.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!s("setRemoteDescription",i.type,d.signalingState)||d._isClosed)return t.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+d.signalingState));var h={};d.remoteStreams.forEach((function(e){h[e.id]=e}));var f=[],p=r.splitSections(i.sdp),m=p.shift(),g=r.matchPrefix(m,"a=ice-lite").length>0,b=r.matchPrefix(m,"a=group:BUNDLE ").length>0;d.usingBundle=b;var y=r.matchPrefix(m,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(t,s){var c=r.splitLines(t),l=r.getKind(t),p=r.isRejected(t)&&0===r.matchPrefix(t,"a=bundle-only").length,y=c[0].substr(2).split(" ")[2],v=r.getDirection(t,m),w=r.parseMsid(t),S=r.getMid(t)||r.generateIdentifier();if(p||"application"===l&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))d.transceivers[s]={mid:S,kind:l,protocol:y,rejected:!0};else{var T,E,x,_,C,I,R,Z,k;!p&&d.transceivers[s]&&d.transceivers[s].rejected&&(d.transceivers[s]=d._createTransceiver(l,!0));var O,V,G=r.parseRtpParameters(t);p||(O=r.getIceParameters(t,m),(V=r.getDtlsParameters(t,m)).role="client"),R=r.parseRtpEncodingParameters(t);var A=r.parseRtcpParameters(t),W=r.matchPrefix(t,"a=end-of-candidates",m).length>0,N=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)&&!p&&b&&s>0&&d.transceivers[s]&&(d._disposeIceAndDtlsTransports(s),d.transceivers[s].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[s].iceTransport=d.transceivers[0].iceTransport,d.transceivers[s].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[s].rtpSender&&d.transceivers[s].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[s].rtpReceiver&&d.transceivers[s].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==i.type||p){if("answer"===i.type&&!p){E=(T=d.transceivers[s]).iceGatherer,x=T.iceTransport,_=T.dtlsTransport,C=T.rtpReceiver,I=T.sendEncodingParameters,Z=T.localCapabilities,d.transceivers[s].recvEncodingParameters=R,d.transceivers[s].remoteCapabilities=G,d.transceivers[s].rtcpParameters=A,N.length&&"new"===x.state&&(!g&&!W||b&&0!==s?N.forEach((function(e){a(T.iceTransport,e)})):x.setRemoteCandidates(N)),b&&0!==s||("new"===x.state&&x.start(E,O,"controlling"),"new"===_.state&&_.start(V)),!o(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,d._transceive(T,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!C||"sendrecv"!==v&&"sendonly"!==v?delete T.rtpReceiver:(k=C.track,w?(h[w.stream]||(h[w.stream]=new e.MediaStream),u(k,h[w.stream]),f.push([k,C,h[w.stream]])):(h.default||(h.default=new e.MediaStream),u(k,h.default),f.push([k,C,h.default])))}}else{(T=d.transceivers[s]||d._createTransceiver(l)).mid=S,T.iceGatherer||(T.iceGatherer=d._createIceGatherer(s,b)),N.length&&"new"===T.iceTransport.state&&(!W||b&&0!==s?N.forEach((function(e){a(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(N)),Z=e.RTCRtpReceiver.getCapabilities(l),n<15019&&(Z.codecs=Z.codecs.filter((function(e){return"rtx"!==e.name}))),I=T.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var L,X=!1;if("sendrecv"===v||"sendonly"===v){if(X=!T.rtpReceiver,C=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,l),X)k=C.track,w&&"-"===w.stream||(w?(h[w.stream]||(h[w.stream]=new e.MediaStream,Object.defineProperty(h[w.stream],"id",{get:function(){return w.stream}})),Object.defineProperty(k,"id",{get:function(){return w.track}}),L=h[w.stream]):(h.default||(h.default=new e.MediaStream),L=h.default)),L&&(u(k,L),T.associatedRemoteMediaStreams.push(L)),f.push([k,C,L])}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=Z,T.remoteCapabilities=G,T.rtpReceiver=C,T.rtcpParameters=A,T.sendEncodingParameters=I,T.recvEncodingParameters=R,d._transceive(d.transceivers[s],!1,X)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===i.type?"active":"passive"),d._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(h).forEach((function(t){var n=h[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}f.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&l(d,t,r,[n])}))}})),f.forEach((function(e){e[2]||l(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.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()},d.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")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.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))},d.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)}},d.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)}},d.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 l=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 l=t.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];s&&n>=15019&&"video"===a&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),t.wantReceive&&(t.rtpReceiver=new e.RTCRtpReceiver(t.dtlsTransport,a)),t.localCapabilities=u,t.sendEncodingParameters=l})),"max-compat"!==o._config.bundlePolicy&&(l+="a=group:BUNDLE "+o.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),l+="a=ice-options:trickle\r\n",o.transceivers.forEach((function(e,t){l+=i(e,e.localCapabilities,"offer",e.stream,o._dtlsRole),l+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===o.iceGatheringState||0!==t&&o.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,l+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(l+="a=end-of-candidates\r\n"))}));var d=new e.RTCSessionDescription({type:"offer",sdp:l});return t.resolve(d)},d.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 l=new e.RTCSessionDescription({type:"answer",sdp:a});return t.resolve(l)},d.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 l=i.transceivers[s];if(!l)return o(c("OperationError","Can not add ICE candidate"));if(l.rejected)return t();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return t();if(d.component&&1!==d.component)return t();if((0===s||s>0&&l.iceTransport!==i.transceivers[0].iceTransport)&&!a(l.iceTransport,d))return o(c("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),(n=r.getMediaSections(i._remoteDescription.sdp))[s]+="a="+(d.type?h:"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()}))},d.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 h=["createOffer","createAnswer"];return h.forEach((function(e){var t=d.prototype[e];d.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)}})),(h=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=d.prototype[e];d.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=d.prototype[e];d.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)}})),d}}).call(this,n(1))},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(1))},function(e,t,n){"use strict";(function(t){var r=n(29);e.exports={shimGetUserMedia:n(571),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(1))},function(e,t,n){"use strict";(function(t){var r=n(29),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 l=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return l(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 d=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},h=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)),d(e.audio,"autoGainControl","mozAutoGainControl"),d(e.audio,"noiseSuppression","mozNoiseSuppression")),h(e)},s&&s.prototype.getSettings){var f=s.prototype.getSettings;s.prototype.getSettings=function(){var e=f.apply(this,arguments);return d(e,"mozAutoGainControl","autoGainControl"),d(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var p=s.prototype.applyConstraints;s.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),d(e,"autoGainControl","mozAutoGainControl"),d(e,"noiseSuppression","mozNoiseSuppression")),p.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(1))},function(e,t,n){"use strict";(function(t){var r=n(29);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(1))},function(e,t,n){"use strict";var r=n(251),i=n(29);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 l={};Object.defineProperty(l,"maxMessageSize",{get:function(){return t}}),e._sctp=l}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(1))},function(e,t,n){var r=n(79),i=n(256),o=n(239),s=n(576),a=n(11),c=n(55),u=n(257);e.exports=function e(t,n,l,d,h){t!==n&&o(n,(function(o,c){if(h||(h=new r),a(o))s(t,n,c,l,e,d,h);else{var f=d?d(u(t,c),o,c+"",t,n,h):void 0;void 0===f&&(f=o),i(t,c,f)}}),c)}},function(e,t,n){var r=n(256),i=n(180),o=n(189),s=n(56),a=n(190),c=n(65),u=n(12),l=n(133),d=n(66),h=n(18),f=n(11),p=n(139),m=n(86),g=n(257),b=n(577);e.exports=function(e,t,n,y,v,w,S){var T=g(e,n),E=g(t,n),x=S.get(E);if(x)r(e,n,x);else{var _=w?w(T,E,n+"",e,t,S):void 0,C=void 0===_;if(C){var I=u(E),R=!I&&d(E),Z=!I&&!R&&m(E);_=E,I||R||Z?u(T)?_=T:l(T)?_=s(T):R?(C=!1,_=i(E,!0)):Z?(C=!1,_=o(E,!0)):_=[]:p(E)||c(E)?(_=T,c(T)?_=b(T):f(T)&&!h(T)||(_=a(E))):C=!1}C&&(S.set(E,_),v(_,E,y,w,S),S.delete(E)),r(e,n,_)}}},function(e,t,n){var r=n(42),i=n(55);e.exports=function(e){return r(e,i(e))}},function(e,t,n){"use strict";const r=n(149),i=n(258),o=n(259),s=n(264),a=n(2)("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 l(e){return e._inject&&e._inject.logging||a}function d(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 h(e,t){const n=l(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&&l(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 p=["user","environment","left","right"],m=(e,t)=>{if(void 0===e||p.indexOf(e)>=0)return e;l(t).warn("Invalid facingMode passed to Publisher. Expected one of: "+p.join(", "))};e.exports=function(e){const t=l(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:h("audio",e),video:h("video",e),usingOptionalMandatoryStyle:e.usingOptionalMandatoryStyle,enableRenegotiation:e.enableRenegotiation,enableStereo:e.enableStereo,noiseSuppression:e.noiseSuppression,autoGainControl:e.autoGainControl,echoCancellation:e.echoCancellation,disableAudioProcessing:e.disableAudioProcessing,videoDimensions:d("resolution",e.resolution,e=>c[e],`"${Object.keys(c).join('", "')}"`,t),frameRate:f(n,d("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";
26
+ see: http://github.com/greggman/twgl.js for details */const wn={};{const e=wn;e[5120]=Int8Array,e[5121]=Uint8Array,e[5122]=Int16Array,e[5123]=Uint16Array,e[5124]=Int32Array,e[5125]=Uint32Array,e[5126]=Float32Array,e[32819]=Uint16Array,e[32820]=Uint16Array,e[33635]=Uint16Array,e[5131]=Uint16Array,e[33640]=Uint32Array,e[35899]=Uint32Array,e[35902]=Uint32Array,e[36269]=Uint32Array,e[34042]=Uint32Array}function Sn(e){if(e instanceof Int8Array)return 5120;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return 5121;if(e instanceof Int16Array)return 5122;if(e instanceof Uint16Array)return 5123;if(e instanceof Int32Array)return 5124;if(e instanceof Uint32Array)return 5125;if(e instanceof Float32Array)return 5126;throw new Error("unsupported typed array type")}function Tn(e){if(e===Int8Array)return 5120;if(e===Uint8Array||e===Uint8ClampedArray)return 5121;if(e===Int16Array)return 5122;if(e===Uint16Array)return 5123;if(e===Int32Array)return 5124;if(e===Uint32Array)return 5125;if(e===Float32Array)return 5126;throw new Error("unsupported typed array type")}function En(e){const t=wn[e];if(!t)throw new Error("unknown gl type");return t}const xn=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function _n(...e){console.error(...e)}const Cn=new Map;function In(e,t){if(!e||"object"!=typeof e)return!1;let n=Cn.get(t);n||(n=new WeakMap,Cn.set(t,n));let r=n.get(e);if(void 0===r){const i=Object.prototype.toString.call(e);r=i.substring(8,i.length-1)===t,n.set(e,r)}return r}function Rn(e,t){return typeof WebGLTexture<"u"&&In(t,"WebGLTexture")}const Zn=34962,kn="";function On(e,t,n,r){if(function(e,t){return typeof WebGLBuffer<"u"&&In(t,"WebGLBuffer")}(0,t))return t;n=n||Zn;const i=e.createBuffer();return function(e,t,n,r,i){e.bindBuffer(t,n),e.bufferData(t,r,i||35044)}(e,n,i,t,r),i}function Vn(e){return"indices"===e}const Gn=/coord|texture/i,An=/color|colour/i;function Wn(e,t,n){return e.numComponents||e.size||function(e,t){let n;if(n=Gn.test(e)?2:An.test(e)?4:3,t%n>0)throw new Error(`Can not guess numComponents for attribute '${e}'. Tried ${n} but ${t} values is not evenly divisible by ${n}. You should specify it.`);return n}(t,n||function(e){return e.length?e:e.data}(e).length)}function Nn(e,t){if(xn(e))return e;if(xn(e.data))return e.data;Array.isArray(e)&&(e={data:e});let n=e.type?Xn(e.type):void 0;return n||(n=Vn(t)?Uint16Array:Float32Array),new n(e.data)}function Ln(e){return"number"==typeof e?e:e?Tn(e):5126}function Xn(e){return"number"==typeof e?En(e):e||Float32Array}function Mn(e,t){return{buffer:t.buffer,numValues:24,type:Ln(t.type),arrayType:Xn(t.type)}}function Fn(e,t){const n=t.data||t,r=Xn(t.type),i=n*r.BYTES_PER_ELEMENT,o=e.createBuffer();return e.bindBuffer(Zn,o),e.bufferData(Zn,i,t.drawType||35044),{buffer:o,numValues:n,type:Tn(r),arrayType:r}}function Pn(e,t,n){const r=Nn(t,n);return{arrayType:r.constructor,buffer:On(e,r,void 0,t.drawType),type:Sn(r),numValues:0}}function jn(e,t){const n={};return Object.keys(t).forEach((function(r){if(!Vn(r)){const i=t[r],o=i.attrib||i.name||i.attribName||kn+r;if(i.value){if(!Array.isArray(i.value)&&!xn(i.value))throw new Error("array.value is not array or typedarray");n[o]={value:i.value}}else{let t;t=i.buffer&&i.buffer instanceof WebGLBuffer?Mn:"number"==typeof i||"number"==typeof i.data?Fn:Pn;const{buffer:s,type:a,numValues:c,arrayType:u}=t(e,i,r),l=void 0!==i.normalize?i.normalize:function(e){return e===Int8Array||e===Uint8Array}(u),d=Wn(i,r,c);n[o]={buffer:s,numComponents:d,type:a,normalize:l,stride:i.stride||0,offset:i.offset||0,divisor:void 0===i.divisor?void 0:i.divisor,drawType:i.drawType}}}})),e.bindBuffer(Zn,null),n}const Un=["position","positions","a_position"];function Hn(e,t,n){const r=jn(e,t),i=Object.assign({},n||{});i.attribs=Object.assign({},n?n.attribs:{},r);const o=t.indices;if(o){const t=Nn(o,"indices");i.indices=On(e,t,34963),i.numElements=t.length,i.elementType=Sn(t)}else i.numElements||(i.numElements=function(e,t){let n,r;for(r=0;r<Un.length&&(n=Un[r],!(n in t)&&(n=kn+n,!(n in t)));++r);r===Un.length&&(n=Object.keys(t)[0]);const i=t[n];if(!i.buffer)return 1;e.bindBuffer(Zn,i.buffer);const o=e.getBufferParameter(Zn,34660);e.bindBuffer(Zn,null);const s=o/function(e,t){return 5120===t||5121===t?1:5122===t||5123===t?2:5124===t||5125===t||5126===t?4:0}(0,i.type),a=i.numComponents||i.size,c=s/a;if(c%1!=0)throw new Error(`numComponents ${a} not correct for length ${length}`);return c}(e,i.attribs));return i}function Yn(e){return!!e.texStorage2D}const Dn=function(){const e={},t={};return function(n,r){return function(n){const r=n.constructor.name;if(!e[r]){for(const e in n)if("number"==typeof n[e]){const r=t[n[e]];t[n[e]]=r?`${r} | ${e}`:e}e[r]=!0}}(n),t[r]||("number"==typeof r?"0x"+r.toString(16):r)}}(),Bn={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},Kn=xn,Jn=function(){let e;return function(){return e=e||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),zn=6407,Qn=6408,qn=6402,$n=33071,er=3553,tr=34067,nr=32879,rr=35866,ir=10242,or=10243,sr=5120,ar=5121,cr=5123,ur=5125,lr=5126,dr=5131,hr=36193,fr=33319,pr=33320,mr=36244,gr=36248,br=36249;let yr;function vr(e){if(!yr){const e={};e[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[ar,dr,hr,lr]},e[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[ar,dr,hr,lr]},e[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[ar,dr,hr,lr]},e[zn]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[ar,dr,hr,lr,33635]},e[Qn]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[ar,dr,hr,lr,32819,32820]},e[qn]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[ur,cr]},e[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[ar]},e[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[sr]},e[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[lr,dr]},e[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[lr]},e[33330]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[ar]},e[33329]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[sr]},e[33332]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[cr]},e[33331]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5122]},e[33334]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ur]},e[33333]={textureFormat:mr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5124]},e[33323]={textureFormat:fr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[ar]},e[36757]={textureFormat:fr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[sr]},e[33327]={textureFormat:fr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[lr,dr]},e[33328]={textureFormat:fr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[lr]},e[33336]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[ar]},e[33335]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[sr]},e[33338]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[cr]},e[33337]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5122]},e[33340]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[ur]},e[33339]={textureFormat:pr,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5124]},e[32849]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[ar]},e[35905]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[ar]},e[36194]={textureFormat:zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[ar,33635]},e[36758]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[sr]},e[35898]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[lr,dr,35899]},e[35901]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[lr,dr,35902]},e[34843]={textureFormat:zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[lr,dr]},e[34837]={textureFormat:zn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[lr]},e[36221]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[ar]},e[36239]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[sr]},e[36215]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[cr]},e[36233]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[5122]},e[36209]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[ur]},e[36227]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5124]},e[32856]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[ar]},e[35907]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[ar]},e[36759]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[sr]},e[32855]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[ar,32820,33640]},e[32854]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[ar,32819]},e[32857]={textureFormat:Qn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[33640]},e[34842]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[lr,dr]},e[34836]={textureFormat:Qn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[lr]},e[36220]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ar]},e[36238]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[sr]},e[36975]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[33640]},e[36214]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[cr]},e[36232]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5122]},e[36226]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[5124]},e[36208]={textureFormat:br,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[ur]},e[33189]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[cr,ur]},e[33190]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ur]},e[36012]={textureFormat:qn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[lr]},e[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[34042]},e[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[36269]},Object.keys(e).forEach((function(t){const n=e[t];n.bytesPerElementMap={},n.bytesPerElement.forEach((function(e,t){const r=n.type[t];n.bytesPerElementMap[r]=e}))})),yr=e}return yr[e]}function wr(e){const t=vr(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function Sr(e){return 0==(e&e-1)}function Tr(e,t,n,r,i){if(i%1!=0)throw"can't guess dimensions";if(n||r){if(r){if(!n&&(n=i/r)%1)throw"can't guess dimensions"}else if((r=i/n)%1)throw"can't guess dimensions"}else{const e=Math.sqrt(i/(t===tr?6:1));e%1==0?(n=e,r=e):(n=i,r=1)}return{width:n,height:r}}function Er(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(37443,t.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(37441,t.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(37440,t.flipY)}function xr(e){e.pixelStorei(3317,4),Yn(e)&&(e.pixelStorei(3314,0),e.pixelStorei(32878,0),e.pixelStorei(3316,0),e.pixelStorei(3315,0),e.pixelStorei(32877,0))}function _r(e,t,n,r){r.minMag&&(n.call(e,t,10241,r.minMag),n.call(e,t,10240,r.minMag)),r.min&&n.call(e,t,10241,r.min),r.mag&&n.call(e,t,10240,r.mag),r.wrap&&(n.call(e,t,ir,r.wrap),n.call(e,t,or,r.wrap),(t===nr||function(e,t){return typeof WebGLSampler<"u"&&In(t,"WebGLSampler")}(0,t))&&n.call(e,t,32882,r.wrap)),r.wrapR&&n.call(e,t,32882,r.wrapR),r.wrapS&&n.call(e,t,ir,r.wrapS),r.wrapT&&n.call(e,t,or,r.wrapT),r.minLod&&n.call(e,t,33082,r.minLod),r.maxLod&&n.call(e,t,33083,r.maxLod),r.baseLevel&&n.call(e,t,33084,r.baseLevel),r.maxLevel&&n.call(e,t,33085,r.maxLevel)}function Cr(e,t,n){const r=n.target||er;e.bindTexture(r,t),_r(e,r,e.texParameteri,n)}function Ir(e,t,n,r,i,o){o=o||Qn;const s=(n=n||Bn.textureOptions).target||er;if(r=r||n.width,i=i||n.height,e.bindTexture(s,t),function(e,t,n,r){if(!Yn(e))return Sr(t)&&Sr(n);const i=vr(r);if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}(e,r,i,o))e.generateMipmap(s);else{const t=function(e){const t=vr(e);if(!t)throw"unknown internal format";return t.textureFilterable}(o)?9729:9728;e.texParameteri(s,10241,t),e.texParameteri(s,10240,t),e.texParameteri(s,ir,$n),e.texParameteri(s,or,$n)}}function Rr(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function Zr(e,t){return(t=t||{}).cubeFaceOrder||[34069,34070,34071,34072,34073,34074]}function kr(e,t){const n=Zr(0,t).map((function(e,t){return{face:e,ndx:t}}));return n.sort((function(e,t){return e.face-t.face})),n}function Or(e,t,n,r){const i=(r=r||Bn.textureOptions).target||er,o=r.level||0;let s=n.width,a=n.height;const c=r.internalFormat||r.format||Qn,u=wr(c),l=r.format||u.format,d=r.type||u.type;if(Er(e,r),e.bindTexture(i,t),i===tr){const u=n.width,h=n.height;let f,p;if(u/6===h)f=h,p=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===u)f=u,p=[0,0,0,1,0,2,0,3,0,4,0,5];else if(u/3==h/2)f=u/3,p=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(u/2!=h/3)throw"can't figure out cube map from element: "+(n.src?n.src:n.nodeName);f=u/2,p=[0,0,1,0,0,1,1,1,0,2,1,2]}const m=Jn();m?(m.canvas.width=f,m.canvas.height=f,s=f,a=f,kr(0,r).forEach((function(t){const r=p[2*t.ndx+0]*f,i=p[2*t.ndx+1]*f;m.drawImage(n,r,i,f,f,0,0,f,f),e.texImage2D(t.face,o,c,l,d,m.canvas)})),m.canvas.width=1,m.canvas.height=1):typeof createImageBitmap<"u"&&(s=f,a=f,kr(0,r).forEach((function(u){const h=p[2*u.ndx+0]*f,m=p[2*u.ndx+1]*f;e.texImage2D(u.face,o,c,f,f,0,l,d,null),createImageBitmap(n,h,m,f,f,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(n){Er(e,r),e.bindTexture(i,t),e.texImage2D(u.face,o,c,l,d,n),Rr(r)&&Ir(e,t,r,s,a,c)}))})))}else if(i===nr||i===rr){const t=Math.min(n.width,n.height),r=Math.max(n.width,n.height),s=r/t;if(s%1!=0)throw"can not compute 3D dimensions of element";const a=n.width===r?1:0,u=n.height===r?1:0;e.pixelStorei(3317,1),e.pixelStorei(3314,n.width),e.pixelStorei(32878,0),e.pixelStorei(32877,0),e.texImage3D(i,o,c,t,t,t,0,l,d,null);for(let r=0;r<s;++r){const s=r*t*a,c=r*t*u;e.pixelStorei(3316,s),e.pixelStorei(3315,c),e.texSubImage3D(i,o,0,0,r,t,t,1,l,d,n)}xr(e)}else e.texImage2D(i,o,c,l,d,n);Rr(r)&&Ir(e,t,r,s,a,c),Cr(e,t,r)}function Vr(){}function Gr(e,t){return void 0!==t||function(e){if(typeof document<"u"){const t=document.createElement("a");return t.href=e,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}{const t=new URL(location.href).origin;return new URL(e,location.href).origin===t}}(e)?t:"anonymous"}function Ar(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof ImageData<"u"&&e instanceof ImageData||typeof HTMLElement<"u"&&e instanceof HTMLElement}function Wr(e,t,n){return Ar(e)?(setTimeout((function(){n(null,e)})),e):function(e,t,n){let r;if(n=n||Vr,t=Gr(e,t=void 0!==t?t:Bn.crossOrigin),typeof Image<"u"){r=new Image,void 0!==t&&(r.crossOrigin=t);const i=function(){r.removeEventListener("error",o),r.removeEventListener("load",s),r=null},o=function(){const t="couldn't load image: "+e;_n(t),n(t,r),i()},s=function(){n(null,r),i()};return r.addEventListener("error",o),r.addEventListener("load",s),r.src=e,r}if(typeof ImageBitmap<"u"){let i,o;const s=function(){n(i,o)},a={};t&&(a.mode="cors"),fetch(e,a).then((function(e){if(!e.ok)throw e;return e.blob()})).then((function(e){return createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(e){o=e,setTimeout(s)})).catch((function(e){i=e,setTimeout(s)})),r=null}return r}(e,t,n)}function Nr(e,t,n){const r=(n=n||Bn.textureOptions).target||er;if(e.bindTexture(r,t),!1===n.color)return;const i=function(e){return Kn(e=e||Bn.textureColor)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(n.color);if(r===tr)for(let t=0;t<6;++t)e.texImage2D(34069+t,0,Qn,1,1,0,Qn,ar,i);else r===nr||r===rr?e.texImage3D(r,0,Qn,1,1,1,0,Qn,ar,i):e.texImage2D(r,0,Qn,1,1,0,Qn,ar,i)}function Lr(e,t,n,r){r=r||Vr;const i=n.src;if(6!==i.length)throw"there must be 6 urls for a cubemap";const o=n.level||0,s=n.internalFormat||n.format||Qn,a=wr(s),c=n.format||a.format,u=n.type||ar,l=n.target||er;if(l!==tr)throw"target must be TEXTURE_CUBE_MAP";Nr(e,t,n),n=Object.assign({},n);let d=6;const h=[],f=Zr(0,n);let p;p=i.map((function(i,a){return Wr(i,n.crossOrigin,function(i){return function(a,f){--d,a?h.push(a):f.width!==f.height?h.push("cubemap face img is not a square: "+f.src):(Er(e,n),e.bindTexture(l,t),5===d?Zr().forEach((function(t){e.texImage2D(t,o,s,c,u,f)})):e.texImage2D(i,o,s,c,u,f),Rr(n)&&e.generateMipmap(l)),0===d&&r(h.length?h:void 0,t,p)}}(f[a]))}))}function Xr(e,t,n,r){r=r||Vr;const i=n.src,o=n.internalFormat||n.format||Qn,s=wr(o),a=n.format||s.format,c=n.type||ar,u=n.target||rr;if(u!==nr&&u!==rr)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";Nr(e,t,n),n=Object.assign({},n);let l=i.length;const d=[];let h;const f=n.level||0;let p=n.width,m=n.height;const g=i.length;let b=!0;h=i.map((function(i,s){return Wr(i,n.crossOrigin,function(i){return function(s,y){if(--l,s)d.push(s);else{if(Er(e,n),e.bindTexture(u,t),b){b=!1,p=n.width||y.width,m=n.height||y.height,e.texImage3D(u,f,o,p,m,g,0,a,c,null);for(let t=0;t<g;++t)e.texSubImage3D(u,f,0,0,t,p,m,1,a,c,y)}else{let t,n=y;(y.width!==p||y.height!==m)&&(t=Jn(),n=t.canvas,t.canvas.width=p,t.canvas.height=m,t.drawImage(y,0,0,p,m)),e.texSubImage3D(u,f,0,0,i,p,m,1,a,c,n),t&&n===t.canvas&&(t.canvas.width=0,t.canvas.height=0)}Rr(n)&&e.generateMipmap(u)}0===l&&r(d.length?d:void 0,t,h)}}(s))}))}function Mr(e,t,n,r){const i=(r=r||Bn.textureOptions).target||er;e.bindTexture(i,t);let o=r.width,s=r.height,a=r.depth;const c=r.level||0,u=r.internalFormat||r.format||Qn,l=wr(u),d=r.format||l.format,h=r.type||function(e,t,n){return Kn(t)?Sn(t):n||ar}(0,n,l.type);if(Kn(n))n instanceof Uint8ClampedArray&&(n=new Uint8Array(n.buffer));else{const e=En(h);n=new e(n)}const f=function(e,t){const n=vr(e);if(!n)throw"unknown internal format";const r=n.bytesPerElementMap[t];if(void 0===r)throw"unknown internal format";return r}(u,h),p=n.byteLength/f;if(p%1)throw"length wrong size for format: "+Dn(e,d);let m;if(i===nr||i===rr)if(o||s||a)!o||s&&a?!s||o&&a?(m=Tr(0,i,o,s,p/a),o=m.width,s=m.height):(m=Tr(0,i,o,a,p/s),o=m.width,a=m.height):(m=Tr(0,i,s,a,p/o),s=m.width,a=m.height);else{const e=Math.cbrt(p);if(e%1!=0)throw"can't guess cube size of array of numElements: "+p;o=e,s=e,a=e}else m=Tr(0,i,o,s,p),o=m.width,s=m.height;if(xr(e),e.pixelStorei(3317,r.unpackAlignment||1),Er(e,r),i===tr){const t=p/6*(f/n.BYTES_PER_ELEMENT);kr(0,r).forEach(r=>{const i=t*r.ndx,a=n.subarray(i,i+t);e.texImage2D(r.face,c,u,o,s,0,d,h,a)})}else i===nr||i===rr?e.texImage3D(i,c,u,o,s,a,0,d,h,n):e.texImage2D(i,c,u,o,s,0,d,h,n);return{width:o,height:s,depth:a,type:h}}function Fr(e,t,n){n=n||Vr,t=t||Bn.textureOptions;const r=e.createTexture(),i=t.target||er;let o=t.width||1,s=t.height||1;const a=t.internalFormat||Qn;e.bindTexture(i,r),i===tr&&(e.texParameteri(i,ir,$n),e.texParameteri(i,or,$n));let c=t.src;if(c)if("function"==typeof c&&(c=c(e,t)),"string"==typeof c)!function(e,t,n,r){r=r||Vr,Nr(e,t,n=n||Bn.textureOptions),Wr((n=Object.assign({},n)).src,n.crossOrigin,(function(i,o){i?r(i,t,o):(Or(e,t,o,n),r(null,t,o))}))}(e,r,t,n);else if(Kn(c)||Array.isArray(c)&&("number"==typeof c[0]||Array.isArray(c[0])||Kn(c[0]))){const n=Mr(e,r,c,t);o=n.width,s=n.height}else Array.isArray(c)&&("string"==typeof c[0]||Ar(c[0]))?i===tr?Lr(e,r,t,n):Xr(e,r,t,n):(Or(e,r,c,t),o=c.width,s=c.height);else!function(e,t,n){const r=n.target||er;e.bindTexture(r,t);const i=n.level||0,o=n.internalFormat||n.format||Qn,s=wr(o),a=n.format||s.format,c=n.type||s.type;if(Er(e,n),r===tr)for(let t=0;t<6;++t)e.texImage2D(34069+t,i,o,n.width,n.height,0,a,c,null);else r===nr||r===rr?e.texImage3D(r,i,o,n.width,n.height,n.depth,0,a,c,null):e.texImage2D(r,i,o,n.width,n.height,0,a,c,null)}(e,r,t);return Rr(t)&&Ir(e,r,t,o,s,a),Cr(e,r,t),r}const Pr=_n;function jr(e){return typeof document<"u"&&document.getElementById?document.getElementById(e):null}const Ur=33984,Hr=34962,Yr=34067,Dr=35866,Br={};function Kr(e,t){return Br[t].bindPoint}function Jr(e,t){return function(n){e.uniform1i(t,n)}}function zr(e,t){return function(n){e.uniform1iv(t,n)}}function Qr(e,t){return function(n){e.uniform2iv(t,n)}}function qr(e,t){return function(n){e.uniform3iv(t,n)}}function $r(e,t){return function(n){e.uniform4iv(t,n)}}function ei(e,t,n,r){const i=Kr(0,t);return Yn(e)?function(t){let o,s;Rn(0,t)?(o=t,s=null):(o=t.texture,s=t.sampler),e.uniform1i(r,n),e.activeTexture(Ur+n),e.bindTexture(i,o),e.bindSampler(n,s)}:function(t){e.uniform1i(r,n),e.activeTexture(Ur+n),e.bindTexture(i,t)}}function ti(e,t,n,r,i){const o=Kr(0,t),s=new Int32Array(i);for(let e=0;e<i;++e)s[e]=n+e;return Yn(e)?function(t){e.uniform1iv(r,s),t.forEach((function(t,r){let i,a;e.activeTexture(Ur+s[r]),Rn(0,t)?(i=t,a=null):(i=t.texture,a=t.sampler),e.bindSampler(n,a),e.bindTexture(o,i)}))}:function(t){e.uniform1iv(r,s),t.forEach((function(t,n){e.activeTexture(Ur+s[n]),e.bindTexture(o,t)}))}}function ni(e,t){return function(n){if(n.value)switch(e.disableVertexAttribArray(t),n.value.length){case 4:e.vertexAttrib4fv(t,n.value);break;case 3:e.vertexAttrib3fv(t,n.value);break;case 2:e.vertexAttrib2fv(t,n.value);break;case 1:e.vertexAttrib1fv(t,n.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n.numComponents||n.size,n.type||5126,n.normalize||!1,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function ri(e,t){return function(n){if(n.value){if(e.disableVertexAttribArray(t),4!==n.value.length)throw new Error("The length of an integer constant value must be 4!");e.vertexAttrib4iv(t,n.value)}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||5124,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function ii(e,t){return function(n){if(n.value){if(e.disableVertexAttribArray(t),4!==n.value.length)throw new Error("The length of an unsigned integer constant value must be 4!");e.vertexAttrib4uiv(t,n.value)}else e.bindBuffer(Hr,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||5125,n.stride||0,n.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,n.divisor||0)}}function oi(e,t,n){const r=n.size,i=n.count;return function(n){e.bindBuffer(Hr,n.buffer);const o=n.size||n.numComponents||r,s=o/i,a=n.type||5126,c=Br[a].size*o,u=n.normalize||!1,l=n.offset||0,d=c/i;for(let r=0;r<i;++r)e.enableVertexAttribArray(t+r),e.vertexAttribPointer(t+r,s,a,u,c,l+d*r),e.vertexAttribDivisor&&e.vertexAttribDivisor(t+r,n.divisor||0)}}Br[5126]={Type:Float32Array,size:4,setter:function(e,t){return function(n){e.uniform1f(t,n)}},arraySetter:function(e,t){return function(n){e.uniform1fv(t,n)}}},Br[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(n){e.uniform2fv(t,n)}},cols:2},Br[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(n){e.uniform3fv(t,n)}},cols:3},Br[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(n){e.uniform4fv(t,n)}},cols:4},Br[5124]={Type:Int32Array,size:4,setter:Jr,arraySetter:zr},Br[35667]={Type:Int32Array,size:8,setter:Qr,cols:2},Br[35668]={Type:Int32Array,size:12,setter:qr,cols:3},Br[35669]={Type:Int32Array,size:16,setter:$r,cols:4},Br[5125]={Type:Uint32Array,size:4,setter:function(e,t){return function(n){e.uniform1ui(t,n)}},arraySetter:function(e,t){return function(n){e.uniform1uiv(t,n)}}},Br[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(n){e.uniform2uiv(t,n)}},cols:2},Br[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(n){e.uniform3uiv(t,n)}},cols:3},Br[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(n){e.uniform4uiv(t,n)}},cols:4},Br[35670]={Type:Uint32Array,size:4,setter:Jr,arraySetter:zr},Br[35671]={Type:Uint32Array,size:8,setter:Qr,cols:2},Br[35672]={Type:Uint32Array,size:12,setter:qr,cols:3},Br[35673]={Type:Uint32Array,size:16,setter:$r,cols:4},Br[35674]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2fv(t,!1,n)}},rows:2,cols:2},Br[35675]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3fv(t,!1,n)}},rows:3,cols:3},Br[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4fv(t,!1,n)}},rows:4,cols:4},Br[35685]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x3fv(t,!1,n)}},rows:2,cols:3},Br[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x4fv(t,!1,n)}},rows:2,cols:4},Br[35687]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x2fv(t,!1,n)}},rows:3,cols:2},Br[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x4fv(t,!1,n)}},rows:3,cols:4},Br[35689]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x2fv(t,!1,n)}},rows:4,cols:2},Br[35690]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x3fv(t,!1,n)}},rows:4,cols:3},Br[35678]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[35680]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[35679]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[35682]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36289]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36292]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36293]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36298]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36299]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[36300]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36303]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr},Br[36306]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:3553},Br[36307]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:32879},Br[36308]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Yr},Br[36311]={Type:null,size:0,setter:ei,arraySetter:ti,bindPoint:Dr};const si={};si[5126]={size:4,setter:ni},si[35664]={size:8,setter:ni},si[35665]={size:12,setter:ni},si[35666]={size:16,setter:ni},si[5124]={size:4,setter:ri},si[35667]={size:8,setter:ri},si[35668]={size:12,setter:ri},si[35669]={size:16,setter:ri},si[5125]={size:4,setter:ii},si[36294]={size:8,setter:ii},si[36295]={size:12,setter:ii},si[36296]={size:16,setter:ii},si[35670]={size:4,setter:ri},si[35671]={size:8,setter:ri},si[35672]={size:12,setter:ri},si[35673]={size:16,setter:ri},si[35674]={size:4,setter:oi,count:2},si[35675]={size:9,setter:oi,count:3},si[35676]={size:16,setter:oi,count:4};const ai=/ERROR:\s*\d+:(\d+)/gi;const ci=/^[ \t]*\n/;function ui(e){let t=0;return ci.test(e)&&(t=1,e=e.replace(ci,"")),{lineOffset:t,shaderSource:e}}function li(e,t,n,r){if(r=r||Pr,!e.getShaderParameter(n,35713)){const i=e.getShaderInfoLog(n),{lineOffset:o,shaderSource:s}=ui(e.getShaderSource(n)),a=`${function(e,t="",n=0){const r=[...t.matchAll(ai)],i=new Map(r.map((e,n)=>{const i=parseInt(e[1]),o=r[n+1],s=o?o.index:t.length;return[i-1,t.substring(e.index,s)]}));return e.split("\n").map((e,t)=>{const r=i.get(t);return`${t+1+n}: ${e}${r?"\n\n^^^ "+r:""}`}).join("\n")}(s,i,o)}\nError compiling ${Dn(e,t)}: ${i}`;return r(a),a}return""}function di(e,t,n){let r,i,o;if("function"==typeof t&&(n=t,t=void 0),"function"==typeof e)n=e,e=void 0;else if(e&&!Array.isArray(e)){const t=e;n=t.errorCallback,e=t.attribLocations,r=t.transformFeedbackVaryings,i=t.transformFeedbackMode,o=t.callback}const s=n||Pr,a=[],c={errorCallback(e,...t){a.push(e),s(e,...t)},transformFeedbackVaryings:r,transformFeedbackMode:i,callback:o,errors:a};{let n={};Array.isArray(e)?e.forEach((function(e,r){n[e]=t?t[r]:r})):n=e||{},c.attribLocations=n}return c}const hi=["VERTEX_SHADER","FRAGMENT_SHADER"];function fi(e,t){return t.indexOf("frag")>=0?35632:t.indexOf("vert")>=0?35633:void 0}const pi=(t=0)=>new e(e=>setTimeout(e,t));function mi(e,t,n,r,i){const o=di(n,r,i),s=new Set(t),a=function(e,t,n){const r=e.createProgram(),{attribLocations:i,transformFeedbackVaryings:o,transformFeedbackMode:s}=di(n);for(let n=0;n<t.length;++n){let i=t[n];if("string"==typeof i){const t=jr(i),o=t?t.text:i;let s=e[hi[n]];t&&t.type&&(s=fi(0,t.type)||s),i=e.createShader(s),e.shaderSource(i,ui(o).shaderSource),e.compileShader(i),e.attachShader(r,i)}}Object.entries(i).forEach(([t,n])=>e.bindAttribLocation(r,n,t));{let t=o;t&&(t.attribs&&(t=t.attribs),Array.isArray(t)||(t=Object.keys(t)),e.transformFeedbackVaryings(r,t,s||35981))}return e.linkProgram(r),r}(e,t,o);function c(e,t){const n=function(e,t,n){if(n=n||Pr,!e.getProgramParameter(t,35714)){const r=e.getProgramInfoLog(t);n("Error in program linking: "+r);const i=e.getAttachedShaders(t).map(t=>li(e,e.getShaderParameter(t,e.SHADER_TYPE),t,n));return`${r}\n${i.filter(e=>e).join("\n")}`}}(e,t,o.errorCallback);return n&&function(e,t,n){const r=e.getAttachedShaders(t);for(const t of r)n.has(t)&&e.deleteShader(t);e.deleteProgram(t)}(e,t,s),n}if(!o.callback)return c(e,a)?void 0:a;(async function(e,t){const n=e.getExtension("KHR_parallel_shader_compile"),r=n?(e,t)=>e.getProgramParameter(t,n.COMPLETION_STATUS_KHR):()=>!0;let i=0;do{await pi(i),i=1e3/60}while(!r(e,t))})(e,a).then(()=>{const t=c(e,a);o.callback(t,t?void 0:a)})}function gi(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const bi=/(\.|\[|]|\w+)/g,yi=e=>e>="0"&&e<="9";function vi(e,t,n,r){const i=e.split(bi).filter(e=>""!==e);let o=0,s="";for(;;){const e=i[o++];s+=e;const a=yi(e[0]),c=a?parseInt(e):e;if(a&&(s+=i[o++]),o===i.length){n[c]=t;break}{const e=i[o++],t="["===e,a=n[c]||(t?[]:{});n[c]=a,n=a,r[s]=r[s]||function(e){return function(t){wi(e,t)}}(a),s+=e}}}function wi(e,t){for(const n in t){const r=e[n];"function"==typeof r?r(t[n]):wi(e[n],t[n])}}function Si(e,t){const n=function(e,t){let n=0;function r(t,r,i){const o=r.name.endsWith("[0]"),s=r.type,a=Br[s];if(!a)throw new Error("unknown type: 0x"+s.toString(16));let c;if(a.bindPoint){const t=n;n+=r.size,c=o?a.arraySetter(e,s,t,i,r.size):a.setter(e,s,t,i,r.size)}else c=a.arraySetter&&o?a.arraySetter(e,i):a.setter(e,i);return c.location=i,c}const i={},o={},s=e.getProgramParameter(t,35718);for(let n=0;n<s;++n){const s=e.getActiveUniform(t,n);if(gi(s))continue;let a=s.name;a.endsWith("[0]")&&(a=a.substr(0,a.length-3));const c=e.getUniformLocation(t,s.name);if(c){const e=r(0,s,c);i[a]=e,vi(a,e,o,i)}}return i}(e,t),r=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;++i){const r=e.getActiveAttrib(t,i);if(gi(r))continue;const o=e.getAttribLocation(t,r.name),s=si[r.type],a=s.setter(e,o,s);a.location=o,n[r.name]=a}return n}(e,t),i={program:t,uniformSetters:n,attribSetters:r};return Yn(e)&&(i.uniformBlockSpec=function(e,t){const n=e.getProgramParameter(t,35718),r=[],i=[];for(let o=0;o<n;++o){i.push(o),r.push({});const n=e.getActiveUniform(t,o);r[o].name=n.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(n){const o=n[0],s=n[1];e.getActiveUniforms(t,i,e[o]).forEach((function(e,t){r[t][s]=e}))}));const o={},s=e.getProgramParameter(t,35382);for(let n=0;n<s;++n){const r=e.getActiveUniformBlockName(t,n),i={index:e.getUniformBlockIndex(t,r),usedByVertexShader:e.getActiveUniformBlockParameter(t,n,35396),usedByFragmentShader:e.getActiveUniformBlockParameter(t,n,35398),size:e.getActiveUniformBlockParameter(t,n,35392),uniformIndices:e.getActiveUniformBlockParameter(t,n,35395)};i.used=i.usedByVertexShader||i.usedByFragmentShader,o[r]=i}return{blockSpecs:o,uniformData:r}}(e,t),i.transformFeedbackInfo=function(e,t){const n={},r=e.getProgramParameter(t,35971);for(let i=0;i<r;++i){const r=e.getTransformFeedbackVarying(t,i);n[r.name]={index:i,type:r.type,size:r.size}}return n}(e,t)),i}const Ti=/\s|{|}|;/;function Ei(e,t,n,r,i){const o=di(n,r,i),s=[];if(t=t.map((function(e){if(!Ti.test(e)){const t=jr(e);if(t)e=t.text;else{const t="no element with id: "+e;o.errorCallback(t),s.push(t)}}return e})),s.length)return function(e,t){return e.errorCallback(t),e.callback&&setTimeout(()=>{e.callback(`${t}\n${e.errors.join("\n")}`)}),null}(o,"");const a=o.callback;a&&(o.callback=(t,n)=>{a(t,t?void 0:Si(e,n))});const c=function(e,t,n,r,i){return mi(e,t,n,r,i)}(e,t,o);return c?Si(e,c):null}const xi=36161,_i=36096,Ci=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],Ii={};Ii[34041]=33306,Ii[6401]=36128,Ii[36168]=36128,Ii[6402]=_i,Ii[33189]=_i,Ii[33190]=_i,Ii[36012]=_i,Ii[35056]=33306,Ii[36013]=33306;const Ri={};Ri[32854]=!0,Ri[32855]=!0,Ri[36194]=!0,Ri[34041]=!0,Ri[33189]=!0,Ri[6401]=!0,Ri[36168]=!0;function Zi(e,t,n,r){const i=36160,o=e.createFramebuffer();e.bindFramebuffer(i,o),n=n||e.drawingBufferWidth,r=r||e.drawingBufferHeight;const s=[],a={framebuffer:o,attachments:[],width:n,height:r};return(t=t||Ci).forEach((function(t,o){let c=t.attachment;const u=t.samples,l=t.format;let d=t.attachmentPoint||function(e,t){return Ii[e]||Ii[t]}(l,t.internalFormat);if(d||(d=36064+o),function(e){return e>=36064&&e<36096}(d)&&s.push(d),!c)if(void 0!==u||function(e){return Ri[e]}(l))c=e.createRenderbuffer(),e.bindRenderbuffer(xi,c),u>1?e.renderbufferStorageMultisample(xi,u,l,n,r):e.renderbufferStorage(xi,l,n,r);else{const i=Object.assign({},t);i.width=n,i.height=r,void 0===i.auto&&(i.auto=!1,i.min=i.min||i.minMag||9729,i.mag=i.mag||i.minMag||9729,i.wrapS=i.wrapS||i.wrap||33071,i.wrapT=i.wrapT||i.wrap||33071),c=Fr(e,i)}if(function(e,t){return typeof WebGLRenderbuffer<"u"&&In(t,"WebGLRenderbuffer")}(0,c))e.framebufferRenderbuffer(i,d,xi,c);else{if(!Rn(0,c))throw new Error("unknown attachment type");void 0!==t.layer?e.framebufferTextureLayer(i,d,c,t.level||0,t.layer):e.framebufferTexture2D(i,d,t.target||3553,c,t.level||0)}a.attachments.push(c)})),e.drawBuffers&&e.drawBuffers(s),a}function ki(e,t){return()=>t instanceof WebGLTexture?t:Fr(e,{src:t,wrap:e.CLAMP_TO_EDGE})}class Oi{constructor(e){o(this,"id","_"),o(this,"context"),o(this,"output"),o(this,"fbi"),o(this,"options"),o(this,"programInfo"),o(this,"bufferInfo"),o(this,"profiler"),o(this,"lastRun");const{context:t,width:n,height:r}=e;this.context=t,this.options=e;const i=this.buildDefines();this.programInfo=Ei(this.context,[i+this.getVertexShader(),i+this.getFragmentShader()]),this.bufferInfo=Hn(this.context,this.getBuffers()),this.fbi=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],n,r),this.output=this.fbi.attachments[0]}resizeOutput(e,t){this.fbi=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],e,t),this.options.width=e,this.options.height=t,this.output=this.fbi.attachments[0]}getDefines(){return{}}getBuffers(){return{position:{numComponents:2,data:[-1,-1,-1,1,1,-1,1,1,-1,1,1,-1]},texture_coord:{numComponents:2,data:[0,0,0,1,1,0,1,1,0,1,1,0]}}}buildDefines(){let e="";const t=this.getDefines();for(let n in t)e+=`#define ${n} ${t[n].toFixed(1)}\n`;return e}run(e){var t,n,r,i,o,s;null==(t=this.profiler)||t.pushContext(`[${this.id}] PROG : ${this.constructor.name}`),null==(n=this.profiler)||n.pushContext(`[${this.id}] UNIFORMS`);for(const t in e)"function"==typeof e[t]&&(null==(r=this.profiler)||r.pushContext(`[${this.id}] UNI : ${t}`),e[t]=e[t](),null==(i=this.profiler)||i.popContext(`[${this.id}] UNI : ${t}`));null==(o=this.profiler)||o.popContext(`[${this.id}] UNIFORMS`);const a=Date.now();let c=0;this.lastRun&&(c=(a-this.lastRun)/1e3),this.lastRun=a,this.context.viewport(0,0,this.context.canvas.width,this.context.canvas.height),this.context.useProgram(this.programInfo.program),function(e,t,n){n.vertexArrayObject?e.bindVertexArray(n.vertexArrayObject):(function(e,t){for(const n in t){const r=e[n];r&&r(t[n])}}(t.attribSetters||t,n.attribs),n.indices&&e.bindBuffer(34963,n.indices))}(this.context,this.programInfo,this.bufferInfo),function e(t,...n){const r=t.uniformSetters||t,i=n.length;for(let t=0;t<i;++t){const i=n[t];if(Array.isArray(i)){const t=i.length;for(let n=0;n<t;++n)e(r,i[n])}else for(const e in i){const t=r[e];t&&t(i[e])}}}(this.programInfo,{delta:c,canvas:[this.context.canvas.width,this.context.canvas.height],...e}),function(e,t,n){n=n||36160,t?(e.bindFramebuffer(n,t.framebuffer),e.viewport(0,0,t.width,t.height)):(e.bindFramebuffer(n,null),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight))}(this.context,this.options.disableFramebuffer?null:this.fbi),function(e,t,n,r,i,o){n=void 0===n?4:n;const s=t.indices,a=t.elementType,c=void 0===r?t.numElements:r;i=void 0===i?0:i,a||s?void 0!==o?e.drawElementsInstanced(n,c,void 0===a?5123:t.elementType,i,o):e.drawElements(n,c,void 0===a?5123:t.elementType,i):void 0!==o?e.drawArraysInstanced(n,i,c,o):e.drawArrays(n,i,c)}(this.context,this.bufferInfo),null==(s=this.profiler)||s.popContext(`[${this.id}] PROG : ${this.constructor.name}`)}setProfiler(e){this.profiler=e}}class Vi extends Oi{getDefines(){var e;return{RADIUS:null!=(e=this.options.radius)?e:1}}getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\nuniform sampler2D mask;\n\nvec4 loop();\n\nvoid main() { gl_FragColor = loop(); }\n"+this.createLoopFunction()}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}createLoopFunction(){var e;let t=null!=(e=this.options.radius)?e:1;return`\n\n vec4 loop() { \n vec4 result = vec4(0,0,0,0);\n float factorSum = 0.;\n\n vec2 normalizedRadius = vec2(-${t}.) / canvas;\n vec2 normalizedIncrement = vec2(1.) / canvas;\n vec2 diff = normalizedRadius;\n float maxLength = length(normalizedRadius);\n\n for(int y=-${t}; y<${t+1}; ++y) {\n for(int x=-${t}; x<${t+1}; ++x) {\n float factor = (1.- texture2D(mask, _texture_coord + diff).a) * (maxLength - length(diff)) / maxLength;\n result += factor * texture2D(texture, _texture_coord + diff);\n factorSum += factor;\n diff.x += normalizedIncrement.x;\n }\n diff.y += normalizedIncrement.y;\n diff.x = normalizedRadius.x;\n }\n return result / factorSum;\n }`}}class Gi extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform sampler2D background;\nuniform sampler2D foreground;\nuniform sampler2D threshold;\n\nvoid main() {\n vec4 backgroundColor = texture2D(background, _texture_coord);\n vec4 foregroundColor = texture2D(foreground, _texture_coord);\n vec4 tresholdColor = texture2D(threshold, _texture_coord);\n gl_FragColor = foregroundColor * tresholdColor.a +\n backgroundColor * (1. - tresholdColor.a);\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n _texture_coord.y = 1. - texture_coord.y;\n}\n"}}class Ai{constructor(){o(this,"steps",[]),o(this,"profiler")}addStep(e){this.steps.push(e)}async run(){for(const e of this.steps)e.program.run(e.getUniforms())}resizeOutput(e,t){var n,r;null==(n=this.profiler)||n.pushContext(`PIP [${this.constructor.name}]`);for(const n of this.steps)n.preventResize||n.program.resizeOutput(e,t);null==(r=this.profiler)||r.popContext(`PIP [${this.constructor.name}]`)}setProfiler(e){this.profiler=e;for(const t of this.steps)t.program.setProfiler(e)}setId(e){for(const t of this.steps)t.program.id=e}}class Wi extends Ai{constructor(){super(...arguments),o(this,"preciseMaskEnabled",!1)}}class Ni extends Wi{constructor(e,t){super(),o(this,"inputImage"),o(this,"inputMask"),o(this,"blur"),this.context=e,this.radius=t;const n={context:e,height:e.canvas.height,width:e.canvas.width};this.blur=new Vi({...n,radius:t,...this.getBlurTextureSize(e.canvas.width,e.canvas.height)});const r=new Gi({...n,disableFramebuffer:!0});this.addStep({program:this.blur,preventResize:!0,getUniforms:()=>({texture:ki(e,this.inputImage),mask:ki(e,this.inputMask)})}),this.addStep({program:r,getUniforms:()=>({background:ki(e,this.blur.output),foreground:ki(e,this.inputImage),threshold:ki(e,this.inputMask)})})}getBlurTextureSize(e,t){const n=this.radius>10?8:2;return{width:Math.max(2,e/n),height:Math.max(2,t/n)}}setData(e,t){this.inputImage=e,this.inputMask=t}resizeOutput(e,t){super.resizeOutput(e,t);const n=this.getBlurTextureSize(e,t);this.blur.resizeOutput(n.width,n.height)}}class Li extends Wi{constructor(e){super(),o(this,"inputImage"),o(this,"inputBackgroundImage"),o(this,"inputMask"),o(this,"preciseMaskEnabled",!0),this.context=e;const t={context:e,height:e.canvas.height,width:e.canvas.width},n=new Gi({...t,disableFramebuffer:!0});this.addStep({program:n,getUniforms:()=>({background:ki(e,this.inputBackgroundImage),foreground:ki(e,this.inputImage),threshold:ki(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class Xi extends Li{constructor(){super(...arguments),o(this,"frameReader"),o(this,"preciseMaskEnabled",!0)}set inputVideo(e){this.frameReader=e.getReader(),this.readNextVideoFrame()}async run(){this.frameReader&&(await super.run(),this.readNextVideoFrame())}async readNextVideoFrame(){var e;const t=await(null==(e=this.frameReader)?void 0:e.read());null!=t&&t.value&&(this.inputBackgroundImage=await createImageBitmap(t.value),t.value.close())}}var Mi=(e=>(e[e.LINEAR=0]="LINEAR",e[e.GAUSSIAN=1]="GAUSSIAN",e))(Mi||{});class Fi extends Oi{getDefines(){var e;return{RADIUS:null!=(e=this.options.radius)?e:1}}getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvec4 loop();\n\nvoid main() { gl_FragColor = loop(); }\n"+this.createLoopFunction()}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}createLoopFunction(){var e;let t=null!=(e=this.options.radius)?e:1;return`\n\n vec4 loop() { \n vec4 result = vec4(0,0,0,0);\n float factorSum = 0.;\n\n vec2 normalizedRadius = vec2(-${t}.) / canvas;\n vec2 normalizedIncrement = vec2(1.) / canvas;\n vec2 diff = normalizedRadius;\n\n for(int y=-${t}; y<${t+1}; ++y) {\n for(int x=-${t}; x<${t+1}; ++x) {\n float factor = 1.;\n result += factor * texture2D(texture, _texture_coord + diff);\n factorSum += factor;\n diff.x += normalizedIncrement.x;\n }\n diff.y += normalizedIncrement.y;\n diff.x = normalizedRadius.x;\n }\n return result / factorSum;\n }`}getFactor(e,t){switch(this.options.type){case 1:return this.getLinearFactor(e,t);case 0:default:return this.getLinearFactor(e,t)}}getLinearFactor(e,t){return 1}getGaussianFactor(e,t){var n;const r=1/(2*Math.PI*Math.max(null!=(n=this.options.radius)?n:1,1)**2),i=r*-(e**2+t**2);return r*Math.E**i}}class Pi extends Wi{constructor(e,t){super(),o(this,"inputImage"),o(this,"inputMask"),this.context=e;const n={context:e,height:e.canvas.height,width:e.canvas.width},r=new Fi({...n,radius:t,type:Mi.GAUSSIAN}),i=new Gi({...n,disableFramebuffer:!0});this.addStep({program:r,getUniforms:()=>({texture:ki(e,this.inputImage)})}),this.addStep({program:i,getUniforms:()=>({background:ki(e,this.inputImage),foreground:ki(e,r.output),threshold:ki(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class ji extends Oi{constructor(e){super(e),o(this,"fbi2"),this.fbi2=Zi(e.context,[{format:e.context.RGBA,type:e.context.UNSIGNED_BYTE,min:e.context.LINEAR,mag:e.context.LINEAR,wrap:e.context.CLAMP_TO_EDGE}],e.width,e.height)}run(e){const t=this.fbi;this.fbi=this.fbi2,this.fbi2=t,this.output=this.fbi.attachments[0],super.run({...e,previous_rendering:this.fbi2.attachments[0]})}resizeOutput(e,t){super.resizeOutput(e,t),this.fbi2=Zi(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],e,t)}}class Ui extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\n// uniform float treshold;\nuniform sampler2D image_now;\nuniform sampler2D image_before;\nuniform sampler2D mask_now;\nuniform sampler2D mask_before;\nuniform sampler2D previous_rendering;\nuniform vec2 canvas;\n\nuniform float delta;\n\nfloat current_factor = 0.69;\nfloat previous_factor = 0.74;\nfloat threshold_activation = 0.54;\n\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nfloat getThreshold() {\n vec4 color = vec4(0.);\n for (float y = -6.; y < 7.; y += 1.) {\n for (float x = -6.; x < 7.; x += 1.) {\n vec4 image_now_color =\n texture2D(image_now, _texture_coord + vec2(x, y) / canvas);\n vec4 image_before_color =\n texture2D(image_before, _texture_coord + vec2(x, y) / canvas);\n color += abs(image_before_color - image_now_color);\n }\n }\n return (color.x + color.y + color.z) / (3. * 9.);\n}\n\nvoid main() {\n float treshold_input = .4;\n float treshold_previous_rendering = .98;\n\n vec4 mask_now_color = texture2D(mask_now, _texture_coord);\n vec4 mask_before_color = texture2D(mask_before, _texture_coord);\n vec4 previous_rendering_color = texture2D(previous_rendering, _texture_coord);\n\n vec3 mask_diff = abs(mask_before_color.xyz - mask_now_color.xyz);\n float flickering = mask_diff.x;\n float threshold = getThreshold();\n if (threshold < threshold_activation) {\n gl_FragColor = vec4(flickering, 0., 0., 1.) * current_factor +\n previous_rendering_color * previous_factor;\n gl_FragColor *= (1. - threshold);\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Hi extends Oi{getFragmentShader(){return"#version 300 es\n// https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/jointBilateralFilterStage.ts\n\nprecision highp float;\nuniform sampler2D input_frame;\nuniform sampler2D segmentation_mask;\nuniform sampler2D threshold;\nuniform vec2 texel_size;\nuniform float step;\nuniform float radius;\nuniform float offset;\nuniform float sigma_texel;\nuniform float sigma_color;\n\nin vec2 _texture_coord;\nout vec4 outColor;\n\nfloat gaussian(float x, float sigma) {\n float coeff = -0.5 / (sigma * sigma * 4.0 + 1.0e-6);\n return exp((x * x) * coeff);\n}\n\nvoid main() {\n vec2 centerCoord = _texture_coord;\n vec3 centerColor = texture(input_frame, centerCoord).rgb;\n float newVal = 0.0;\n float spaceWeight = 0.0;\n float colorWeight = 0.0;\n float totalWeight = 0.0;\n // Subsample kernel space.\n for (float i = -radius + offset; i <= radius; i += step) {\n for (float j = -radius + offset; j <= radius; j += step) {\n vec2 shift = vec2(j, i) * texel_size;\n vec2 coord = vec2(centerCoord + shift);\n vec3 frameColor = texture(input_frame, coord).rgb;\n float threshold = texture(threshold, coord).a;\n float outVal = texture(segmentation_mask, coord).a;\n\n spaceWeight = gaussian(distance(centerCoord, coord), sigma_texel);\n colorWeight = gaussian(distance(centerColor, frameColor), sigma_color);\n totalWeight += spaceWeight * colorWeight;\n newVal += spaceWeight * colorWeight * outVal * threshold;\n }\n }\n newVal /= totalWeight;\n outColor = vec4(vec3(0.), newVal);\n}"}getVertexShader(){return"#version 300 es\nin vec2 position;\nin vec2 texture_coord;\nout vec2 _texture_coord;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n _texture_coord = texture_coord;\n}"}}class Yi extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvoid main() {\n int count = 0;\n for (float y = -1.; y < 2.; y += 1.) {\n for (float x = -1.; x < 2.; x += 1.) {\n vec2 coord = _texture_coord + vec2(y, x) / canvas;\n vec4 color = texture2D(texture, coord);\n if (color.r > .1) {\n count++;\n }\n }\n }\n if (count > 5) {\n gl_FragColor = texture2D(texture, _texture_coord);\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Di extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform vec2 canvas;\nuniform sampler2D texture;\n\nvoid main() {\n vec4 color = texture2D(texture, _texture_coord);\n for (float y = -2.; y < 3.; y += 1.) {\n for (float x = -2.; x < 3.; x += 1.) {\n vec2 coord = _texture_coord;\n coord += vec2(y, x) / canvas;\n color += texture2D(texture, coord) * (1. / 4.);\n }\n }\n\n gl_FragColor = color;\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Bi extends ji{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\n\nuniform sampler2D threshold;\nuniform sampler2D inputs;\n\nvoid main() {\n vec4 inputs_color = texture2D(inputs, _texture_coord);\n vec4 threshold_color = texture2D(threshold, _texture_coord);\n if (threshold_color.r < .1 && inputs_color.r > .5) {\n gl_FragColor = inputs_color;\n }\n}\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n}\n"}}class Ki extends Ai{constructor(e,t,n){super(),o(this,"inputImage"),o(this,"inputMask"),o(this,"previousInputImage"),o(this,"previousInputMask"),o(this,"output"),o(this,"options",{currentThresholdMinimum:0,currentThresholdMaximum:1,previousThresholdMinimum:0,previousThresholdMaximum:1,thresholdMinimum:0,thresholdMaximum:1,thresholdFactor:1}),this.context=e;const r={context:e,height:n,width:t},i=new Ui(r),s=new Fi({...r,radius:1,type:Mi.GAUSSIAN}),a=new Bi(r),c=new Di(r),u=new Yi(r),l=new Hi({...r});let d=1;d*=Math.max(2.5,480/144);const h=Math.max(1,.66*Math.sqrt(d));this.addStep({program:i,getUniforms:()=>({image_now:ki(e,this.inputImage),image_before:ki(e,this.previousInputImage),mask_now:ki(e,this.inputMask),mask_before:ki(e,this.previousInputMask),current_threshold_minimum:this.options.currentThresholdMinimum,current_threshold_maximum:this.options.currentThresholdMaximum,previous_threshold_minimum:this.options.previousThresholdMinimum,previous_threshold_maximum:this.options.previousThresholdMaximum,threshold_minimum:this.options.thresholdMinimum,threshold_maximum:this.options.thresholdMaximum,threshold_factor:this.options.thresholdFactor})}),this.addStep({program:a,getUniforms:()=>({inputs:ki(e,this.inputMask),threshold:ki(e,i.output)})}),this.addStep({program:u,getUniforms:()=>({texture:ki(e,a.output)})}),this.addStep({program:c,getUniforms:()=>({texture:ki(e,u.output)})}),this.addStep({program:s,getUniforms:()=>({texture:ki(e,c.output)})}),this.addStep({program:l,getUniforms:()=>({input_frame:ki(e,this.inputImage),segmentation_mask:ki(e,this.inputMask),threshold:ki(e,s.output),texel_size:[1/640,1/480],step:h,radius:d,offset:h>1?.5*h:0,sigma_texel:Math.max(1/640,1/480)*d,sigma_color:.1})}),this.output=l.output}setData(e,t){this.previousInputImage=this.inputImage?this.inputImage:e,this.previousInputMask=this.inputMask?this.inputMask:t,this.inputImage=e,this.inputMask=t}setOptions(e){this.options=e}}class Ji extends Oi{getFragmentShader(){return"precision mediump float;\n\nvarying vec2 _texture_coord;\nuniform sampler2D texture;\n\nvoid main() { gl_FragColor = texture2D(texture, _texture_coord); }\n"}getVertexShader(){return"varying vec2 _texture_coord;\n\nattribute vec2 position;\nattribute vec2 texture_coord;\nuniform bool invert_y;\n\nvoid main() {\n gl_Position = vec4(position, 0., 1.);\n _texture_coord = texture_coord;\n if (invert_y) {\n _texture_coord.y = 1. - texture_coord.y;\n }\n}\n"}}class zi extends Ai{constructor(e,t,n){super(),o(this,"inputImage"),this.context=e;const r={context:e,height:n,width:t};this.addStep({program:new Ji({...r,disableFramebuffer:!0}),getUniforms:()=>({texture:ki(e,this.inputImage),invert_y:!0})})}setData(e){this.inputImage=e}}class Qi{constructor(e){o(this,"resize"),o(this,"canvas"),o(this,"context"),this.canvas=new OffscreenCanvas(0,0),this.context=this.canvas.getContext("webgl2"),this.canvas.width=e.width,this.canvas.height=e.height,this.resize=new zi(this.context,e.width,e.height)}resizeForeground(e,t){this.canvas.width=e,this.canvas.height=t,this.resize.resizeOutput(e,t)}async process(e){var t,n;return this.canvas.width=this.canvas.width,null==(t=this.resize)||t.setData(e),null==(n=this.resize)||n.run(),this.canvas}}class qi{constructor(e,t){o(this,"improveMaskSegmentation"),o(this,"backgroundResizer"),o(this,"backgroundImage"),o(this,"backgroundVideo"),o(this,"profiler"),o(this,"activePipeline"),o(this,"canvas"),o(this,"options"),o(this,"context"),o(this,"virtualBGImage"),this.id=e,this.canvas=new OffscreenCanvas(0,0),this.context=this.canvas.getContext("webgl2"),this.canvas.width=t.foregroundWidth,this.canvas.height=t.foregroundHeight,this.improveMaskSegmentation=new Ki(this.context,t.maskWidth,t.maskHeight),this.backgroundImage=new Li(this.context),this.backgroundVideo=new Xi(this.context),this.backgroundResizer=new Qi({width:t.foregroundWidth,height:t.foregroundHeight})}setBackgroundOptions(e){switch(e.transformerType){case"BackgroundBlur":this.activePipeline=new Ni(this.context,this.getBlurSize(e.radius));break;case"SilhouetteBlur":this.activePipeline=new Pi(this.context,this.getBlurSize(e.radius));break;case"VideoBackground":this.activePipeline=this.backgroundVideo;break;case"VirtualBackground":this.activePipeline=this.backgroundImage}this.options=e}setFlickeringOptions(e){var t;null==(t=this.improveMaskSegmentation)||t.setOptions(e)}setVideoBGReadable(e){this.backgroundVideo.inputVideo=e}async setVirtualBGImage(e){this.virtualBGImage=e,this.backgroundImage.inputBackgroundImage=await this.backgroundResizer.process(e)}async process(e,t){var n,r,i,o,s,a,c;if(this.activePipeline&&e.width&&(null==t?void 0:t.width)){const u=`[${this.id}] background-filter`;null==(n=this.profiler)||n.pushContext(u);let l=t;((null==(r=this.options)?void 0:r.selfieSegmentationType)&&"PRECISE"===(null==(i=this.options)?void 0:i.selfieSegmentationType)||!(null!=(o=this.options)&&o.selfieSegmentationType)&&this.activePipeline.preciseMaskEnabled)&&(this.improveMaskSegmentation.setId(this.id),this.improveMaskSegmentation.setProfiler(this.profiler),this.improveMaskSegmentation.setData(e,t),this.improveMaskSegmentation.run(),l=this.improveMaskSegmentation.output),this.activePipeline.setId(this.id),this.activePipeline.setProfiler(this.profiler),null==(s=this.activePipeline)||s.setData(e,l),null==(a=this.activePipeline)||a.run(),null==(c=this.profiler)||c.popContext(u)}}async resizeForeground(e,t){var n;this.canvas.width=e,this.canvas.height=t,this.backgroundImage.resizeOutput(e,t),this.backgroundVideo.resizeOutput(e,t),this.backgroundResizer.resizeForeground(e,t),null==(n=this.activePipeline)||n.resizeOutput(e,t),this.virtualBGImage&&(this.backgroundImage.inputBackgroundImage=await this.backgroundResizer.process(this.virtualBGImage))}async profile(e){const t=new vn(this.context);return this.profiler=t,t.start(),await bn(e),this.profiler=void 0,t.stop(),t.getResolvedQueries()}getBlurSize(e=Ct.Low){switch(e){case Ct.Low:return 5;case Ct.High:return 12}return e}}class $i{constructor(){o(this,"selfieSegmentation",new Ot),o(this,"backgroundFilter"),o(this,"previousDimensions",{width:0,height:0})}async init(e,t){await this.selfieSegmentation.init(t.wasmAssetUriPath,t.tfliteAssetUriPath);const{width:n,height:r}=this.selfieSegmentation.getOutputDimensions();this.backgroundFilter=new qi(e,{foregroundWidth:1,foregroundHeight:1,maskWidth:n,maskHeight:r})}async transform(e,t){var n,r,i,o;const s=await createImageBitmap(e),a=await this.selfieSegmentation.process(s);a?((s.width!==this.previousDimensions.width||s.height!==this.previousDimensions.height)&&(this.previousDimensions.width=s.width,this.previousDimensions.height=s.height,await(null==(n=this.backgroundFilter)?void 0:n.resizeForeground(s.width,s.height))),await(null==(r=this.backgroundFilter)?void 0:r.process(s,a)),e.close(),t.enqueue(new VideoFrame(null==(i=this.backgroundFilter)?void 0:i.canvas,{timestamp:null!=(o=e.timestamp)?o:0,alpha:"discard"}))):t.enqueue(e)}async setBackgroundOptions(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setBackgroundOptions(e))}async setVideoBGReadable(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setVideoBGReadable(e))}async setVirtualBGImage(e){var t;await(null==(t=this.backgroundFilter)?void 0:t.setVirtualBGImage(e))}setFlickeringOptions(e){var t;null==(t=this.backgroundFilter)||t.setFlickeringOptions(e)}async profile(e){var t,n;return null!=(n=null==(t=this.backgroundFilter)?void 0:t.profile(e))?n:[]}}const eo=class{constructor(){o(this,"backgroundTransformer",new $i),o(this,"mediaProcessor",new Et),o(this,"rate",30),o(this,"resolveOnMediaProcessor"),o(this,"eventsQueue",[])}async init(e,t){await this.backgroundTransformer.init(e,t),await this.mediaProcessor.setTransformers([this.backgroundTransformer]),this.mediaProcessor.setTrackExpectedRate(this.rate),this.mediaProcessor.onAny((e,t)=>{this.resolveOnMediaProcessor?(this.resolveOnMediaProcessor({name:e,data:t}),this.resolveOnMediaProcessor=void 0):this.eventsQueue.push({name:e,data:t})})}async onMediaProcessorEvent(){return await new e(e=>{this.eventsQueue.length>0?e(this.eventsQueue.shift()):this.resolveOnMediaProcessor=e})}async setTrackExpectedRate(e){this.rate=e,this.mediaProcessor.setTrackExpectedRate(e)}async transform(e,t){this.mediaProcessor.transform(e,t)}async setBackgroundOptions(e){var t;await(null==(t=this.backgroundTransformer)?void 0:t.setBackgroundOptions(e))}setVideoBGReadable(e){this.backgroundTransformer.setVideoBGReadable(e)}async setVirtualBGImage(e){await this.backgroundTransformer.setVirtualBGImage(e)}async terminate(){await this.mediaProcessor.destroy()}setFlickeringOptions(e){this.backgroundTransformer.setFlickeringOptions(e)}setVonageMetadata(e){!function(e){globalThis._vonageMediaProcessorMetadata=e}(e)}async profile(e){return JSON.stringify(await this.backgroundTransformer.profile(e))}};let to=eo;!function(e,t){t.workerId=e,pn()&&(mn[t.workerId]=t)}("ProcessorWorker",eo);const no="dmFyIGVkPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgdGQ9KEssdGUscmUpPT50ZSBpbiBLP2VkKEssdGUse2VudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwLHZhbHVlOnJlfSk6S1t0ZV09cmU7dmFyIHA9KEssdGUscmUpPT4odGQoSyx0eXBlb2YgdGUhPSJzeW1ib2wiP3RlKyIiOnRlLHJlKSxyZSk7KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBLPShyPT4ocltyLklOSVQ9MF09IklOSVQiLHJbci5GT1JXQVJEPTFdPSJGT1JXQVJEIixyW3IuVEVSTUlOQVRFPTJdPSJURVJNSU5BVEUiLHIpKShLfHx7fSk7ZnVuY3Rpb24gdGUocil7cmV0dXJuW0ltYWdlQml0bWFwLFJlYWRhYmxlU3RyZWFtLFdyaXRhYmxlU3RyZWFtXS5zb21lKGU9PnIgaW5zdGFuY2VvZiBlKX1mdW5jdGlvbiByZShyLGUpe2NvbnN0e2lkOnR9PXIsbj1BcnJheS5pc0FycmF5KGUpP2U6W2VdO3Bvc3RNZXNzYWdlKHtpZDp0LHJlc3VsdDplfSxuLmZpbHRlcihpPT50ZShpKSkpfWFzeW5jIGZ1bmN0aW9uIHFpKHIsZSl7Y29uc3R7ZnVuY3Rpb25OYW1lOnQsYXJnczpufT1yO2lmKCFlLmluc3RhbmNlKXRocm93Imluc3RhbmNlIG5vdCBpbml0aWFsaXplZCI7aWYoIXQpdGhyb3cibWlzc2luZyBmdW5jdGlvbiBuYW1lIHRvIGNhbGw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MzYzNSxQcz01MTMxLERzPTMzNjQwLE1zPTM1ODk5LENzPTM1OTAyLE9zPTM2MjY5LE5zPTM0MDQyLGJuPXt9O3tjb25zdCByPWJuO3JbSnRdPUludDhBcnJheSxyW05lXT1VaW50OEFycmF5LHJbWnRdPUludDE2QXJyYXkscltlcl09VWludDE2QXJyYXksclt0cl09SW50MzJBcnJheSxyW3JyXT1VaW50MzJBcnJheSxyW25yXT1GbG9hdDMyQXJyYXkscltTc109VWludDE2QXJyYXkscltJc109VWludDE2QXJyYXkscltGc109VWludDE2QXJyYXkscltQc109VWludDE2QXJyYXkscltEc109VWludDMyQXJyYXkscltNc109VWludDMyQXJyYXkscltDc109VWludDMyQXJyYXkscltPc109VWludDMyQXJyYXkscltOc109VWludDMyQXJyYXl9ZnVuY3Rpb24gaXIocil7aWYociBpbnN0YW5jZW9mIEludDhBcnJheSlyZXR1cm4gSnQ7aWYociBpbnN0YW5jZW9mIFVpbnQ4QXJyYXl8fHIgaW5zdGFuY2VvZiBVaW50OENsYW1wZWRBcnJheSlyZXR1cm4gTmU7aWYociBpbnN0YW5jZW9mIEludDE2QXJyYXkpcmV0dXJuIFp0O2lmKHIgaW5zdGFuY2VvZiBVaW50MTZBcnJheSlyZXR1cm4gZXI7aWYociBpbnN0YW5jZW9mIEludDMyQXJyYXkpcmV0dXJuIHRyO2lmKHIgaW5zdGFuY2VvZiBVaW50MzJBcnJheSlyZXR1cm4gcnI7aWYociBpbnN0YW5jZW9mIEZsb2F0MzJBcnJheSlyZXR1cm4gbnI7dGhyb3cgbmV3IEVycm9yKCJ1bnN1cHBvcnRlZCB0eXBlZCBhcnJheSB0eXBlIil9ZnVuY3Rpb24gdm4ocil7aWYocj09PUludDhBcnJheSlyZXR1cm4gSnQ7aWYocj09PVVpbnQ4QXJyYXl8fHI9PT1VaW50OENsYW1wZWRBcnJheSlyZXR1cm4gTmU7aWYocj09PUludDE2QXJyYXkpcmV0dXJuIFp0O2lmKHI9PT1VaW50MTZBcnJheSly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sdCA9IHZlYzQoMCwwLDAsMCk7CiAgICAgICAgICAgIGZsb2F0IGZhY3RvclN1bSA9IDAuOwoKICAgICAgICAgICAgdmVjMiBub3JtYWxpemVkUmFkaXVzID0gdmVjMigtJHtlfS4pIC8gY2FudmFzOwogICAgICAgICAgICB2ZWMyIG5vcm1hbGl6ZWRJbmNyZW1lbnQgPSB2ZWMyKDEuKSAvIGNhbnZhczsKICAgICAgICAgICAgdmVjMiBkaWZmID0gbm9ybWFsaXplZFJhZGl1czsKICAgICAgICAgICAgZmxvYXQgbWF4TGVuZ3RoID0gbGVuZ3RoKG5vcm1hbGl6ZWRSYWRpdXMpOwoKICAgICAgICAgICAgZm9yKGludCB5PS0ke2V9OyB5PCR7ZSsxfTsgKyt5KSB7CiAgICAgICAgICAgICAgICBmb3IoaW50IHg9LSR7ZX07IHg8JHtlKzF9OyArK3gpIHsKICAgICAgICAgICAgICAgICAgICBmbG9hdCBmYWN0b3IgPSAoMS4tIHRleHR1cmUyRChtYXNrLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpLmEpICogKG1heExlbmd0aCAtIGxlbmd0aChkaWZmKSkgLyBtYXhMZW5ndGg7CiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZhY3RvciAqIHRleHR1cmUyRCh0ZXh0dXJlLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpOwogICAgICAgICAgICAgICAgICAgIGZhY3RvclN1bSArPSBmYWN0b3I7CiAgICAgICAgICAgICAgICAgICAgZGlmZi54ICs9IG5vcm1hbGl6ZWRJbmNyZW1lbnQueDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGRpZmYueSArPSBub3JtYWxpemVkSW5jcmVtZW50Lnk7CiAgICAgICAgICAgICAgICBkaWZmLnggPSBub3JtYWxpemVkUmFkaXVzLng7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCAvIGZhY3RvclN1bTsKICAgICAgICB9YH19dmFyIE1mPWBw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lYzIoLSR7ZX0uKSAvIGNhbnZhczsKICAgICAgICAgICAgdmVjMiBub3JtYWxpemVkSW5jcmVtZW50ID0gdmVjMigxLikgLyBjYW52YXM7CiAgICAgICAgICAgIHZlYzIgZGlmZiA9IG5vcm1hbGl6ZWRSYWRpdXM7CgogICAgICAgICAgICBmb3IoaW50IHk9LSR7ZX07IHk8JHtlKzF9OyArK3kpIHsKICAgICAgICAgICAgICAgIGZvcihpbnQgeD0tJHtlfTsgeDwke2UrMX07ICsreCkgewogICAgICAgICAgICAgICAgICAgIGZsb2F0IGZhY3RvciA9IDEuOwogICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmYWN0b3IgKiB0ZXh0dXJlMkQodGV4dHVyZSwgX3RleHR1cmVfY29vcmQgKyBkaWZmKTsKICAgICAgICAgICAgICAgICAgICBmYWN0b3JTdW0gKz0gZmFjdG9yOwogICAgICAgICAgICAgICAgICAgIGRpZmYueCArPSBub3JtYWxpemVkSW5jcmVtZW50Lng7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBkaWZmLnkgKz0gbm9ybWFsaXplZEluY3JlbWVudC55OwogICAgICAgICAgICAgICAgZGlmZi54ID0gbm9ybWFsaXplZFJhZGl1cy54OwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiByZXN1bHQgLyBmYWN0b3JTdW07CiAgICAgICAgfWB9Z2V0RmFjdG9yKGUsdCl7c3dpdGNoKHRoaXMub3B0aW9ucy50eXBlKXtjYXNlIDE6cmV0dXJuIHRoaXMuZ2V0TGluZWFyRmFjdG9yKGUsdCk7Y2FzZSAwOmRlZmF1bHQ6cmV0dXJuIHRoaXMuZ2V0TGluZWFyRmFjdG9yKGUsdCl9fWdldExpbmVhckZhY3RvcihlLHQpe3JldHVybiAxfWdldEdhdXNzaWFuRmFjdG9yKGUsdCl7dmFyIHU7Y29uc3Qgbj1NYXRoLlBJKjIsaT1NYXRoLm1heCgodT10aGlzLm9wdGlvbnMucmFkaXVzKSE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7dGhpcy5iYWNrZ3JvdW5kVHJhbnNmb3JtZXIuc2V0VmlkZW9CR1JlYWRhYmxlKGUpfWFzeW5jIHNldFZpcnR1YWxCR0ltYWdlKGUpe2F3YWl0IHRoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnNldFZpcnR1YWxCR0ltYWdlKGUpfWFzeW5jIHRlcm1pbmF0ZSgpe2F3YWl0IHRoaXMubWVkaWFQcm9jZXNzb3IuZGVzdHJveSgpfXNldEZsaWNrZXJpbmdPcHRpb25zKGUpe3RoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnNldEZsaWNrZXJpbmdPcHRpb25zKGUpfXNldFZvbmFnZU1ldGFkYXRhKGUpe2ZzKGUpfWFzeW5jIHByb2ZpbGUoZSl7cmV0dXJuIEpTT04uc3RyaW5naWZ5KGF3YWl0IHRoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnByb2ZpbGUoZSkpfX07bGV0IEJpPU5yOygoKT0+e1hpKCJQcm9jZXNzb3JXb3JrZXIiLE5yKX0pKCl9KSgpOwo=",ro=typeof window<"u"&&window.Blob&&new Blob([atob(no)],{type:"text/javascript;charset=utf-8"});function io(){const e=ro&&(window.URL||window.webkitURL).createObjectURL(ro);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+no)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const oo=class extends an{constructor(){super(...arguments),o(this,"rate",30),o(this,"worker")}async init(e){this.worker=await hn(to,io),await this.worker.init("worker_"+oo.initCount++,e),await this.worker.setVonageMetadata(je()),await this.setBackgroundOptions(e),this.listenWorker()}async setTrackExpectedRate(e){var t;await(null==(t=this.worker)?void 0:t.setTrackExpectedRate(e))}async setBackgroundOptions(e){var t,n,r;const{transformerType:i}=e;switch(i){case"VideoBackground":await(null==(t=this.worker)?void 0:t.setVideoBGReadable(await gn.createVideoReadable(e.backgroundAssetUri)));break;case"VirtualBackground":await(null==(n=this.worker)?void 0:n.setVirtualBGImage(await gn.createImageCanvas(e.backgroundAssetUri)))}await(null==(r=this.worker)?void 0:r.setBackgroundOptions(e))}async transform(e,t){var n;await(null==(n=this.worker)?void 0:n.transform(e,t))}async destroy(){var e;await(null==(e=this.worker)?void 0:e.terminate())}async setFlickeringOptions(e){var t;await(null==(t=this.worker)?void 0:t.setFlickeringOptions(e))}async profile(e){var t;const n=await(null==(t=this.worker)?void 0:t.profile(e));return JSON.parse(null!=n?n:"[]")}async listenWorker(){for(var e,t,n;null!=(e=this.worker)&&e.worker;){const{name:e,data:r}=await(null==(t=this.worker)?void 0:t.onMediaProcessorEvent());switch(e){case"error":case"warn":this.emit(e,r);break;case"pipelineInfo":switch(this.emit(e,r),r){case"pipeline_ended":case"pipeline_ended_with_error":return void await(null==(n=this.worker)?void 0:n.terminate())}}}}};let so=oo;o(so,"initCount",0);class ao{constructor(e){this.queries=e}async downloadSpeedscope(){this.download(await this.convertToSpeedscope())}download(e){const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([e],{type:"application/json"})),t.download=`profile-${+new Date}.speedscope.json`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}convertToSpeedscope(){const e=[],t={},n=[];let r=0;for(const i of this.queries){const o=[];for(const n of i)void 0===t[n.name]&&(t[n.name]=e.length,e.push({name:n.name})),o.push({type:n.action==yn.PUSH?"O":"C",frame:t[n.name],at:n.timestamp}),r=Math.max(r,n.timestamp+n.duration);n.push({events:o,type:"evented",name:"GPU Profile",unit:"nanoseconds",startValue:0,endValue:r})}const i={$schema:"https://www.speedscope.app/file-format-schema.json",shared:{frames:e},profiles:n};return JSON.stringify(i,null,2)}}class co extends an{constructor(){super(),o(this,"worker",new so),o(this,"connector",new _t(this.worker))}async init(e){await this.worker.init(e),this.worker.onAny((e,t)=>this.emit(e,t))}async setBackgroundOptions(e){await this.worker.setBackgroundOptions(e)}setTrackExpectedRate(e){this.worker.setTrackExpectedRate(e)}getConnector(){return this.connector}async profile(e){return this.worker.profile(e)}static async profile(t){const n=await e.all(this.instances.map(e=>e.profile(t)));return new ao(n)}static async create(e){const t=new this;return await t.init(e),this.instances.push(t),t}}function uo(){return At}function lo(){return Wt}function ho(){return Nt}function fo(){return Lt}function po(){return Xt}function mo(){return Mt}function go(){return Ft}o(co,"instances",[]);var bo=(e=>(e.FAST="FAST",e.PRECISE="PRECISE",e))(bo||{});async function yo(e){return await co.create(e)}}.call(this,n(1),n(44))},function(e,t,n){"use strict";const r=n(35)().onlyLocal(),i=n(101).prependProxyToUrlIfNeeded,o={getConfig:function(e){void 0===e&&(e={});const t=e,n=t.staticConfig,o=((e,t)=>{let n=e.apiUrl.includes("anvil.opentok.com")?"https://static.opentok.com":"https://www.dev.tokbox.com";return t&&(n=t.includes("euproxy.opentok.com")?"https://static-eu.opentok.com":i(n,t)),n+"/ml-transformers/v4.0.0"})(void 0===n?r:n,t.proxyUrl);return{mediapipeBaseAssetsUri:""+o,wasmAssetUriPath:o+"/",tfliteAssetUriPath:o+"/"}}};e.exports=o},function(e,t,n){"use strict";const r=n(18),i=n(11),o=n(708),s=n(709),a=n(710);e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(7),c=e.ExceptionCodes||n(10),u=e.logging||n(2)("publisherInit"),l=e.otError||n(13)(),d=e.OTHelpers||n(8),h=e.Publisher||n(169)(),f=e.sessionObjects||n(21);return function(e,n,p){let m;u.debug(`OT.initPublisher(${e})`),"string"!=typeof e||document.getElementById(e)||(e=n,n=p,p=arguments[3]),"function"==typeof e?(p=e,n=void 0,e=void 0):i(e)&&!d.isElementNode(e)&&(p=n,n=e,e=void 0),"function"==typeof n&&(p=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 h(n||{});f.publishers.add(g);const b=function(){p&&r(p)&&(p(...arguments),p=void 0)};void 0!==m&&(u.error(m),b(l(t.INVALID_PARAMETER,new Error(m),c.INVALID_PARAMETER)));const y=function(e){g.off("publishComplete",v),b(e)};let v=function(e){g.off("initSuccess",y),e&&b(e)};return g.once("initSuccess",y),g.once("publishComplete",v),g.publish(e),g}}},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(4)),o=r(n(5)),s=r(n(16));const a=n(28),c=n(711),u=n(11),l=n(18),d=n(9),h=n(27),f=n(6),p=n(26),m=n(35)(),g=n(75),b=n(313),y=n(713),v=n(714),w=n(715),S=n(101).prependProxyToUrlIfNeeded,T=n(102).getProxyUrl,E=n(716);e.exports=function(e){void 0===e&&(e={});const r=e.adaptIceServers||n(103).adaptIceServers,x=e.AnalyticsHelper||p,_=e.APIKEY||n(72),C=e.Capabilities||n(170),I=e.convertAnvilErrorCode||n(717),R=e.convertRumorError||n(319),Z=e.Errors||n(7),k=e.Events||n(23)(),O=e.Stream||n(171),V=e.ExceptionCodes||n(10),G=e.hasIceRestartsCapability||n(320),A=e.hasE2eeCapability||n(111),W=e.logging||n(2)("Session"),N=e.otError||n(13)(),L=e.OTErrorClass||n(22),X=e.OTHelpers||n(8),M=n(718),F=e.StaticConfig||m,P=e.staticConfig||F.onlyLocal(),j=e.Publisher||n(169)(),U=e.RaptorSocket||n(719).default(),H=e.SessionDispatcher||n(327),Y=e.sessionObjects||n(21),D=e.sessionTag||n(326),B=e.socketCloseCodes||n(77),K=e.Subscriber||n(305)(),J=e.systemRequirements||n(154),z=e.uuid||n(17),Q=v({otError:N}),q=e.global||(void 0!==typeof window?window:global),$=e.getSessionInfo||n(743)(),ee=n(143),te=e.KeyStore||n(746),ne=e.SFrameClientStore||n(748),re=e.SinglePeerConnectionController||n(750),ie=e.initPublisher||n(317)({Publisher:j});return function(e,n,p){var m=this;let v=void 0===p?{}:p,oe=v.iceConfig,se=v.connectionEventsSuppressed,ae=v.ipWhitelist,ce=void 0!==ae&&ae,ue=v.encryptionSecret,le=v._enableSinglePeerConnection;const de=T(),he=new x,fe=e=>"string"==typeof e?this.streams.get(e)||{id:e}:e;let pe,me,ge,be,ye,ve,we,Se;f(this),this._tag=D,J.check()||J.upgrade(),null==n&&(n=e,e=null),Q(oe),this.id=n,this.sessionId=n,this.keyStore=new te,this.sFrameClientStore=new ne;let Te=!0,Ee=!1,xe=e;const _e=this;let Ce=n,Ie=z(),Re=z(),Ze=W,ke=!1;const Oe=[];let Ve,Ge,Ae,We,Ne=null,Le=!1,Xe=!1;const Me=X.statable(this,["disconnected","connecting","connected","disconnecting"],"disconnected");let Fe;this.connection=null,this.connections=new X.Collection,this.streams=new X.Collection,this.archives=new X.Collection;const Pe=function(e){Me("disconnected"),e.code||(e.code=V.CONNECT_FAILED),Ze.error(`${e.name||"Unknown Error"}: ${e.message}`),L.handleJsException({error:e,target:this,analytics:he}),this.trigger("sessionConnectFailed",e)},je=function(e){Ee=!1;const t=e.reason;this.logEvent("Connect","Disconnected",{reason:e.reason});const n=new k.SessionDisconnectEvent("sessionDisconnected",t.replace("networkTimedout","networkDisconnected"));this.isConnected()&&this.disconnect(),Ge(),Ve.call(this,t),setTimeout(()=>{this.dispatchEvent(n),Ae.call(this,n.reason),n.isDefaultPrevented()||We.call(this,n.reason)})},Ue=function(e){se||e.id.match(/^symphony\./)||this.dispatchEvent(new k.ConnectionEvent(h.CONNECTION_CREATED,e))},He=function(e,t){e.id.match(/^symphony\./)||pe&&e.id===pe.id()||this.dispatchEvent(new k.ConnectionEvent(h.CONNECTION_DESTROYED,e,t))},Ye=function(e){!e||!e.connection||this.connection&&e.connection.id===this.connection.id||this.dispatchEvent(new k.StreamEvent(h.STREAM_CREATED,e,null,!1))},De=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 k.StreamPropertyChangedEvent(h.STREAM_PROPERTY_CHANGED,t,n,e.oldValue,r)))},Be=function(e,t){void 0===t&&(t="clientDisconnected");const n=new k.StreamEvent("streamDestroyed",e,t,!0);e.connection.id===this.connection.id?Y.publishers.where({streamId:e.id}).forEach((function(n){n._.unpublishStreamFromSession(e,this,t)}),this):this.dispatchEvent(n),(()=>{Y.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})})})()},Ke=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveStarted",e))},Je=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveDestroyed",e))},ze=function(e){const t=e.target,n=e.changedProperty,r=e.newValue;"status"===n&&"stopped"===r?this.dispatchEvent(new k.ArchiveEvent("archiveStopped",t)):this.dispatchEvent(new k.ArchiveEvent("archiveUpdated",t))},Qe=()=>Y.subscribers.forEach(e=>e._.pauseAndPlayVideoElement()),qe=function(){_e.token=null,ge=null,Me("disconnected"),pe=null,me&&(me.stop(),me=null),_e.connection=null,_e.capabilities=new C([],{hasE2eeCapability:A}),_e.connections.destroy(),_e.streams.destroy(),_e.archives.destroy()};Ge=function(){Re=z(),qe()},Ve=function(e){Y.publishers.where({session:this}).forEach(t=>{t.disconnect(e)}),Y.subscribers.where({session:this}).forEach(e=>{e._disconnect()})},Ae=function(e){Y.publishers.where({session:this}).forEach(t=>{t._.streamDestroyed(e)})},We=function(e){Y.subscribers.where({session:this}).forEach(t=>{t._destroy({reason:e})})};const $e=function(){Ze.debug("OT.Session: connecting to Raptor");const e=S(this.sessionInfo.messagingURL,de),t=["forceMute"];this.sessionInfo.isAdaptiveEnabled&&t.push("amr"),Xe&&t.push("spc"),pe=new U(Re,Ie,e,this.sessionInfo.symphonyAddress,H(this,{connectionEventsSuppressed:se}),he,t),pe.connect(ge,this.sessionInfo,{connectionEventsSuppressed:se},(e,t)=>{if(e){const t={};let n;if("ConnectToSession"===e.reason||"GetSessionState"===e.reason){const n=R(e);d(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:pe.socketId}),pe=null,this.logConnectivityEvent("Failure",t,n);const r=function(e,t){let n;switch(e){case"WebSocketConnection":if(n=c(B.codes,e=>e===t),n)return Z["SOCKET_"+n];break;case"ConnectToSession":case"GetSessionState":switch(t){case V.CONNECT_FAILED:return Z.CONNECT_FAILED;case V.UNEXPECTED_SERVER_RESPONSE:return Z.UNEXPECTED_SERVER_RESPONSE;case V.CONNECTION_LIMIT_EXCEEDED:return Z.CONNECTION_LIMIT_EXCEEDED}}}(e.reason,e.code);return r&&(e=N(r,new Error(e.message),e.code)),void Pe.call(this,e)}Ze.debug("OT.Session: Received session state from Raptor",t),this.connection=this.connections.get(pe.id()),this.connection&&(this.capabilities=this.connection.permissions),Me("connected"),this.logConnectivityEvent("Success",{connectionId:this.connection.id}),this.connection.on("destroyed",je,this),this.dispatchEvent(new k.SessionConnectEvent(h.SESSION_CONNECTED)),this.connections.on({add:Ue,remove:He},this),this.streams.on({add:Ye,remove:Be,update:De},this),this.archives.on({add:Ke,remove:Je,update:ze},this),this.connections._triggerAddEvents(),this.streams._triggerAddEvents(),this.archives._triggerAddEvents();X.env.isiOS&&X.env.iOSVersion>=13.3&&this.on("gsmCallEnded",Qe)})},et=e=>this.capabilities.permittedTo(e),tt=(e,t)=>{W.error(`${e.name}: ${e.message}`),"function"==typeof t&&t(e),L.handleJsException({error:e,target:this,analytics:he})},nt=e=>{const t=N(e.code,new Error(e.message),e.exceptionCode);return tt(t),t},rt=()=>this.isNot("connected")?nt(M.NOT_CONNECTED):et("forceMute")?null:nt(M.PERMISSION_DENIED),it=e=>"404"===e.code?nt(M.NOT_FOUND):"403"===e.code?nt(M.PERMISSION_DENIED):nt(M.UNEXPECTED_SERVER_RESPONSE);this.reportIssue=e=>{let t=e.id;return b(he.logEvent.bind(he))({action:"ReportIssue",variation:"Event",connectionId:Re,payload:{reportIssueId:t}},null)},this.logEvent=function(e,t,n,r){let i={action:e,variation:t,payload:n,sessionId:Ce,messagingServer:ye,p2p:be,partnerId:xe,connectionId:Re};r&&(i=d(r,i)),he.logEvent(i)},this.logConfigurationFileEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),"Attempt"===e)we=(new Date).getTime();else if("Failure"===e||"Success"===e){const e=(new Date).getTime()-we;d(n,{attemptDuration:e})}de&&(n.proxyUrl=de),this.logEvent("ConfigurationFile",e,t,(0,s.default)({},n))},this.logConnectivityEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),de&&(n.proxyUrl=de),"Attempt"===e&&(me&&(me.stop(),W.error("_connectivityAttemptPinger should have been cleaned up")),ve=(new Date).getTime(),me=new g(()=>{this.logEvent("Connect","Attempting",t,(0,s.default)({},n))},.2,6),me.start()),"Failure"===e||"Success"===e||"Cancel"===e){const r=r=>{me&&(me.stop(),me=void 0),this.logEvent("Connect",e,t,(0,s.default)({},n,{attemptDuration:(new Date).getTime()-ve,iceConfig:r,ipWhitelist:ce}))};"Success"===e?this._.getIceConfig().then(e=>{const t={includeServers:oe&&oe.includeServers||"all",transportPolicy:e.transportPolicy};t.servers=e.servers?e.servers.map(e=>({url:e.urls})):[],r(t)}):r()}else this.logEvent("Connect",e,t,n)},this.connect=function(){let r;for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];o.length>1&&("string"==typeof o[0]||"number"==typeof o[0])&&"string"==typeof o[1]?(null==e&&(xe=o[0].toString()),r=o[1]):r=o[0];const a=o[o.length-1];if(m.is("connecting","connected"))return Ze.warn("OT.Session: Cannot connect, the session is already "+m.currentState),m;he.sessionInfo=new ee,qe(),Me("connecting");const c=Re;function d(){const e=Re!==c;return e&&W.debug("Connection was interrupted"),e}if(m.token=!l(r)&&r,ge=!l(r)&&r,Te?Te=!1:Ie=z(),a&&l(a)){let e;const t=function(){e();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];a(void 0,...n)},n=function(){e(),a(...arguments)};e=()=>{m.off("sessionConnected",t),m.off("sessionConnectFailed",n)},m.once("sessionConnected",t),m.once("sessionConnectFailed",n)}if(null==xe||l(xe))return setTimeout(Pe.bind(m,N(Z.AUTHENTICATION_ERROR,new Error("API Key is undefined. You must pass an API Key to initSession."),V.AUTHENTICATION_ERROR))),m;if(!Ce||u(Ce)||Array.isArray(Ce)){let e;return Ce?(e="SessionID is not a string. You must use string as the session ID passed into OT.initSession().",Ce=Ce.toString()):e="SessionID is undefined. You must pass a sessionID to initSession.",setTimeout(Pe.bind(m,N(Z.INVALID_SESSION_ID,new Error(e),V.INVALID_SESSION_ID))),m.logConnectivityEvent("Attempt"),m.logConnectivityEvent("Failure",null,{failureReason:"ConnectToSession",failureCode:V.INVALID_SESSION_ID,failureMessage:e}),m}if(m.apiKey=xe.toString(),xe=xe.toString(),ue){if(!A())return setTimeout(Pe.bind(m,N(Z.UNSUPPORTED_BROWSER,new Error("E2E Encryption is not supported in your browser.")))),m;try{E(ue),m.keyStore.set(n,ue),Le=!0}catch(e){return setTimeout(Pe.bind(m,N(Z.INVALID_ENCRYPTION_SECRET,new Error("Invalid encryptionSecret: "+e.message)))),m}}0===_.value.length&&(_.value=xe);const h=Boolean(F.onlyLocal().configUrl),f=!0===ce&&Boolean(F.onlyLocal().ipWhitelistConfigUrl);h||f?m.logConfigurationFileEvent("Attempt"):m.logConfigurationFileEvent("Event",{message:"No configUrl, using local config only"});const p=h||f?F.get({partnerId:xe,token:r,useIpWhitelistConfigUrl:f,proxyUrl:de}):t.resolve(F.onlyLocal());return p.then(e=>((h||f)&&m.logConfigurationFileEvent("Success"),e),e=>((h||f)&&m.logConfigurationFileEvent("Failure",{failureMessage:e.message,failureStack:e.stack}),F.onlyLocal())).then(e=>{if(m.staticConfig=e,he.staticConfig=e,!1===e.apiEnabled)throw N(Z.API_KEY_DISABLED,new Error("The API KEY has been disabled. Access to the service is currently being restricted. Please contact support."));if(d())return;m.logConnectivityEvent("Attempt"),de?m.logEvent("SessionInfo","Attempt",null,{proxyUrl:de}):m.logEvent("SessionInfo","Attempt");const t=e=>{e.code=I(e.code),m.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)),Pe.call(m,e)},r=S(e.apiUrl,de);return $({anvilUrl:r,sessionId:n,token:ge,connectionId:Re,clientVersion:e.clientVersion}).then(n=>{if(d())return;if(n.partnerId&&n.partnerId!==xe){const e="Authentication Error: The API key does not match the token or session.";return void t(N(Z.AUTHENTICATION_ERROR,new Error(e),V.AUTHENTICATION_ERROR))}Xe=w(n,le),Xe&&(Fe=new re(m)),he.sessionInfo=n;const r={features:{reconnection:n.reconnection,renegotiation:G()&&n.renegotiation,simulcast:void 0!==n.simulcast&&(n.simulcast&&"Chrome"===X.env.name)}};if(de&&(r.proxyUrl=de),m.is("connecting")){m.sessionInfo=n,m._.setIceServers(m.sessionInfo.iceServers),be=n.p2pEnabled,ye=n.messagingServer,m.logEvent("SessionInfo","Success",null,r,{messagingServer:n.messagingServer});const t=e.sessionInfoOverrides;null!=t&&"object"==typeof t&&Object.keys(t).forEach(e=>{Object.defineProperty(m.sessionInfo,e,{value:t[e]})}),$e.call(m)}},t)}).catch(e=>{Pe.call(m,e)}),m},this.disconnect=function(){Fe&&(Fe.destroy(),Fe=null),pe&&pe.isNot("disconnected")?pe.isNot("disconnecting")&&(pe.isNot("connecting")||this.logConnectivityEvent("Cancel"),Me("disconnecting"),pe.disconnect(),this.off("gsmCallEnded",Qe)):Ge()},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 he.logError(1010,"OT.exception","We need to be connected before you can publish",null,{action:"Publish",variation:"Failure",failureReason:"unconnected",failureCode:V.NOT_CONNECTED,failureMessage:"We need to be connected before you can publish",sessionId:Ce,streamId:e&&e.stream?e.stream.id:null,p2p:this.sessionInfo?this.sessionInfo.p2pEnabled:void 0,messagingServer:this.sessionInfo?this.sessionInfo.messagingServer:null,partnerId:xe}),tt(N(Z.NOT_CONNECTED,new Error("We need to be connected before you can publish"),V.NOT_CONNECTED),n),null;if(!et("publish")){const e="This token does not allow publishing. The role must be at least `publisher` to enable this functionality",t={failureReason:"Permission",failureCode:V.UNABLE_TO_PUBLISH,failureMessage:e};return this.logEvent("Publish","Failure",null,t),tt(N(Z.PERMISSION_DENIED,new Error(e),V.UNABLE_TO_PUBLISH),n),null}if(!e||"string"==typeof e||X.isElementNode(e))e=ie(e,t);else{if(!(e instanceof j))return void tt(N(Z.INVALID_PARAMETER,new Error("Session.publish :: First parameter passed in is neither a string nor an instance of the Publisher"),V.UNABLE_TO_PUBLISH),n);"session"in e&&e.session&&"sessionId"in e.session&&(e.session.sessionId===this.sessionId?Ze.warn(`Cannot publish ${e.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`):Ze.warn(`Cannot publish ${e.guid()} publisher already attached to ${e.session.sessionId}. Please call session.unpublish(publisher) first.`))}return ke&&e._.forceMuteAudio(),e._.publishToSession(this,he).catch(e=>{throw e.message="Session.publish :: "+e.message,Ze.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"):Ze.error("OT.Session.unpublish: publisher parameter missing.")},this.setIceConfig=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q(n),he.logEvent({action:"setIceConfig",variation:"Attempt",payload:{newIceConfig:n}}),oe=(0,s.default)({},n),"all"!==n.includeServers){e.next=8;break}return e.next=6,_e._.getOtIceServerInfo();case 6:r=e.sent,n.customServers=n.customServers.concat(r.servers);case 8:return o=(e=>({iceServers:e.customServers,iceTransportPolicy:e.transportPolicy}))(n),e.prev=10,e.next=13,t.all(Y.publishers.map(e=>e._.setIceConfig(o)).concat(Y.subscribers.map(e=>e._.setIceConfig(o))));case 13:e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(10),he.logEvent({action:"setIceConfig",variation:"Failure",payload:{newIceConfig:n}}),e.t0;case 19:he.logEvent({action:"setIceConfig",variation:"Success",payload:{newIceConfig:n}});case 20:case"end":return e.stop()}}),e,null,[[10,15]])})));return function(t){return e.apply(this,arguments)}}(),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 tt(N(Z.NOT_CONNECTED,new Error("Session.subscribe :: Connection required to subscribe"),V.UNABLE_TO_SUBSCRIBE),r);if(!e)return void tt(N(Z.INVALID_PARAMETER,new Error("Session.subscribe :: stream cannot be null"),V.UNABLE_TO_SUBSCRIBE),r);if(!Object.prototype.hasOwnProperty.call(e,"streamId"))return void tt(N(Z.INVALID_PARAMETER,new Error("Session.subscribe :: invalid stream object"),V.UNABLE_TO_SUBSCRIBE),r);if(n&&!1===n.insertDefaultUI&&t)return void tt(N(Z.INVALID_PARAMETER,new Error("You cannot specify a target element if insertDefaultUI is false"),V.INVALID_PARAMETER),r);t&&!1===t.insertDefaultUI&&(n=t,t=void 0);const i=new K(t,d(n||{},{stream:e,session:this,analytics:he,_singlePeerConnectionController:Fe}),e=>{e?tt(e,r):r(null,i)});return Y.subscribers.add(i),i},this.unsubscribe=function(e){if(!e){const e="OT.Session.unsubscribe: subscriber cannot be null";throw Ze.error(e),new Error(e)}return e.stream?(Ze.debug("OT.Session.unsubscribe: subscriber "+e.id),e._destroy({reason:"Unsubscribe"}),!0):(Ze.warn("OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream"),!1)},this.getSubscribersForStream=function(e){return Y.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",Ze.error(n),new Error(n);t=e.id}return Y.publishers.where({streamId:t})[0]},this._={getProxyUrl:()=>de,isE2ee:()=>_e.sessionInfo.e2ee&&Le&&!!_e.capabilities.supportsE2ee,isSocketReconnecting:()=>Ee,getSocket:()=>pe,reconnecting:function(){Ee=!0,this.dispatchEvent(new k.SessionReconnectingEvent)}.bind(this),reconnected:function(){Ee=!1,this.dispatchEvent(new k.SessionReconnectedEvent),this.sessionInfo.reconnection&&(Y.publishers.where({session:this}).forEach(e=>{e._.iceRestart()}),this.sessionInfo.p2pEnabled||Y.subscribers.where({session:this}).forEach(e=>{e._.iceRestart("socket reconnected")}))}.bind(this),dispatchSignal:function(e,t,n){const r=new k.SignalEvent(t,n,e);r.target=this,this.trigger(h.SIGNAL,r),t&&this.dispatchEvent(r)}.bind(this),dispatchCaption:function(e,t){let n,r,i;try{const e=JSON.parse(t.data);n=e.caption.text,r=e.streamId,i=e.isFinal}catch(e){return void Ze.error("Caption parsing failed: "+e.message)}const o=new k.CaptionReceivedEvent(n,r,i);o.target=this,this.trigger(h.SUBSCRIBER_CAPTION_RECEIVED,o),this.dispatchEvent(o)}.bind(this),subscriberChannelUpdate:(e,t,n,r)=>pe?pe.subscriberChannelUpdate(e.id,t.widgetId,n.id,r):(Ze.warn("You are disconnected, cannot update subscriber properties ",r),null),streamCreate(e,t){let n=void 0===e?{}:e,r=n.name,i=n.streamId,o=n.subscriberAudioFallbackEnabled,s=n.channels,a=n.minBitrate,c=n.sourceStreamId,u=n.e2ee,l=n.publisherAudioFallbackEnabled;pe?pe.streamCreate({name:r,streamId:i,subscriberAudioFallbackEnabled:o,channels:s,minBitrate:a,maxBitrate:void 0,sourceStreamId:c,e2ee:u,publisherAudioFallbackEnabled:l},t):Ze.warn("You are disconnected, cannot create stream ",i)},streamDestroy(e,t){pe?pe.streamDestroy(e,t):Ze.warn("You are disconnected, cannot destroy stream ",e)},streamChannelUpdate(e,t,n){pe?pe.streamChannelUpdate(e.id,t.id,n):Ze.warn("You are disconnected, cannot update stream properties ",n)},setSocket(e){pe=e},setLogging(e){Ze=e},setState:Me,setIceServers(e){e&&(Se={iceServers:r(e),timestamp:Date.now()})},getOtIceServerInfo(){if(864e5-(Se?Date.now()-Se.timestamp:1/0)>3e5)return t.resolve({transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:Se&&Se.iceServers});if(!ge)return t.resolve({transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0});const e=P.clientVersion;return $({anvilUrl:(this.staticConfig||P).apiUrl,sessionId:n,token:ge,connectionId:Re,clientVersion:e}).then(e=>(_e._.setIceServers(e.iceServers),Se?{transportPolicy:_e&&_e.sessionInfo&&_e.sessionInfo.clientCandidates,servers:Se&&Se.iceServers}:{transportPolicy:_e.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0}))},getCodecFlags:()=>({h264:_e.sessionInfo.h264,vp9:_e.sessionInfo.vp9,vp8:_e.sessionInfo.vp8}),getVideoCodecsCompatible:e=>y({RTCPeerConnection:q.RTCPeerConnection,env:X.env,stream:e,codecFlags:_e._.getCodecFlags()}),getIceConfig:()=>{if(!oe)return _e._.getOtIceServerInfo();const e=oe&&"relay"===oe.transportPolicy?"relay":_e.sessionInfo.clientCandidates;return("custom"===oe.includeServers?t.resolve({servers:[]}):_e._.getOtIceServerInfo()).then(t=>d(t,{transportPolicy:e,servers:[...t.servers,...oe.customServers]}))},forceMute:function(e){this.dispatchEvent(new k.MuteForcedEvent(e))}.bind(this),enableMuteOnEntry:()=>{ke=!0},addSubscriberToPeerConnectionsQueue:(e,t)=>{Oe.push({pc:e,message:t}),Ne||(Ne=setInterval(()=>{const e=Oe.shift();e?e.pc.processMessage("offer",e.message):(clearInterval(Ne),Ne=null)},100))},disableMuteOnEntry:()=>{ke=!1},privateEvents:new a},this.signal=function(e,t){let n=e,r=t||function(){};if(l(n)&&(r=n,n=null),this.isNot("connected")){const e="Unable to send signal - you are not connected to the session.";tt(N(Z.NOT_CONNECTED,new Error(e),500),r)}else pe.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&&Ze.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 Z.INVALID_PARAMETER;case 429:return Z.RATE_LIMIT_EXCEEDED;case 404:return Z.NOT_FOUND;case 500:return Z.NOT_CONNECTED;case 403:return Z.PERMISSION_DENIED;case 2001:return Z.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 tt(N(Z.NOT_CONNECTED,new Error(e),V.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 tt(N(Z.INVALID_PARAMETER,new Error(r),V.INVALID_PARAMETER),t);et("forceDisconnect")?pe.forceDisconnect(n,(function(e){if(e)tt(N(Z.INVALID_PARAMETER,new Error(r),V.INVALID_PARAMETER),t);else if(t&&l(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)}})):tt(N(Z.PERMISSION_DENIED,new Error("This token does not allow forceDisconnect. The role must be at least `moderator` to enable this functionality"),V.UNABLE_TO_FORCE_DISCONNECT),t)},this.forceUnpublish=function(e,t){void 0===t&&(t=()=>{});const n=e=>tt(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:V.INVALID_PARAMETER,name:Z.INVALID_PARAMETER},i={msg:"Cannot call forceUnpublish(). You are not connected to the session.",code:V.NOT_CONNECTED,name:Z.NOT_CONNECTED},o={msg:"This token does not allow forceUnpublish. The role must be at least `moderator` to enable this functionality",code:V.UNABLE_TO_FORCE_UNPUBLISH,name:Z.PERMISSION_DENIED},s={msg:"The stream does not exist.",name:Z.NOT_FOUND},a={msg:"An unexpected error occurred.",name:Z.UNEXPECTED_SERVER_RESPONSE,code:V.UNEXPECTED_SERVER_RESPONSE};if(!e)return void n(r);if(m.isNot("connected"))return void n(i);const c=fe(e);et("forceUnpublish")?pe.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=rt();r?n(r):e&&e.id?pe.forceMuteStream(e.id,e=>{e?n(it(e)):t()}):n(nt(M.INVALID_PARAMETER))}),this.forceMuteAll=e=>new t((t,n)=>{const r=rt();if(r)return void n(r);if(Array.isArray(e)&&!e.every(e=>e instanceof O)||e&&!Array.isArray(e))return void n(nt(M.INVALID_PARAMETER));const i=(e||[]).map(e=>e.id);pe.forceMuteAll(i,!0,e=>{e?n(it(e)):t()})}),this.disableForceMute=()=>new t((e,t)=>{const n=rt();n?t(n):pe.forceMuteAll([],!1,n=>{n?t(it(n)):e()})}),this.setEncryptionSecret=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(ue){e.next=3;break}return W.error("Encryption secret must first be set in initSession."),e.abrupt("return");case 3:e.prev=3,E(t),e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(3),N(Z.INVALID_ENCRYPTION_SECRET,new Error("setEncryptionSecret: "+e.t0.message));case 10:return e.prev=10,e.next=13,m.keyStore.set(n,t);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),Ze.error("Error in setEncryptionSecret}: "+e.t1.message);case 18:case"end":return e.stop()}}),e,null,[[3,7],[10,15]])})));return function(t){return e.apply(this,arguments)}}(),this.isConnected=()=>this.is("connected"),this.capabilities=new C([],{hasE2eeCapability:A})}}}).call(this,n(1))},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(52).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(18),i=n(22),o=n(6),s=n(2)("Dispatcher"),a=n(172),c=n(734),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"data":this.dispatchCaption(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.dispatchCaption=function(e){this.emit("caption",e.fromAddress,e.content)},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(17),i=n(8),o=n(737),s=n(738),a=n(321),c=n(739),u=n(35)().onlyLocal(),l={};e.exports=l,l.connections={},l.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}})},l.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:{}})},l.sessions={},l.sessions.get=function(e,t){return a({method:"read",uri:`/v2/partner/${e}/session/${t}`,content:{}})},l.streams={},l.streams.get=function(e,t,n){return a({method:"read",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:{}})},l.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},l.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.publisherAudioFallbackEnabled,u=t.subscriberAudioFallbackEnabled,d=t.channels,h=t.minBitrate,f=t.maxBitrate,p=t.sourceStreamId,m=t.e2ee,g={id:i,name:o,audioFallbackEnabled:s,publisherAudioFallbackEnabled:c,subscriberAudioFallbackEnabled:u,channel:d.map(e=>l.streams.channelFromOTChannel(e)),e2ee:m};return h&&(g.minBitrate=Math.round(h)),f&&(g.maxBitrate=Math.round(f)),p&&(g.sourceStreamId=p),"boolean"==typeof m&&(g.e2ee=m),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}`,content:g})},l.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})},l.streamChannels={},l.streamChannels.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/channel/${r}`,content:i})},l.subscribers={},l.subscribers.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,i=t.streamId,u=t.subscriberId,l=t.connectionId,d=t.channelsToSubscribeTo,h=t.sourceStreamId,f=t.e2ee,p={id:u,connection:l,keyManagementMethod:c,bundleSupport:o(),rtcpMuxSupport:s(),e2ee:f};return d&&(p.channel=d),h&&(p.sourceStreamId=h),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}/subscriber/${u}`,content:p})},l.subscribers.destroy=function(e,t,n,r){return a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:{}})},l.subscribers.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:i})},l.subscriberChannels={},l.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})},l.signals={},l.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})},l.forceMute={},l.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(39),i=n(72),o=n(173),s=n(324),a=n(326);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(0),i=r(n(4)),o=r(n(5));const s=n(328),a=n(50),c=n(173),u=n(742),l=n(323),d=n(2)("SessionDispatcher"),h=n(21),f=n(171),p=n(151),m=n(168);function g(e,t){if(t.streams.has(e.id))return;const n=function(e,t){const n=e.channel.map(e=>new p(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 y=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)}},v={};e.exports=function(e,t){let n=(void 0===t?{}:t).connectionEventsSuppressed;const r=new l;let s=!1;const u=new y(r);r.on("reconnecting",()=>{e._.reconnecting()}),r.on("reconnected",()=>{e._.reconnected()}),r.on("close",t=>{const n=e.connection;n&&(n.destroyedReason()?d.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(v).forEach(r=>{const i=v[r];if(i&&t.id===i.connection.id){g(i,e),delete v[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 d.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):d.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{v[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&&h.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=h.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):d.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):d.debug("stream#update that handle this reason is not currently implemented"):d.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):d.error("Unable to determine streamId, or the stream does not exist, for streamChannel message!")});const p=(t,n,r,s)=>{let u,l;const f={streamId:n},p=h.subscribers,m=h.publishers;switch(u=s.params.subscriber?{widgetId:s.params.subscriber}:f,t){case"offer":l=[].concat(p.where(u),m.where(f)).slice(0,1);break;case"answer":case"pranswer":l=[].concat(m.where(f),p.where(u)).slice(0,1);break;case"generateoffer":case"unsubscribe":l=m.where(f);break;case"candidate":l=[].concat(p.where(u),m.where(f));break;default:return void d.debug(`jsep#${t} is not currently implemented`)}if(0===l.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)),l.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),d.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",p.bind(null,"offer")),r.on("jsep#answer",p.bind(null,"answer")),r.on("jsep#pranswer",p.bind(null,"pranswer")),r.on("jsep#generateoffer",p.bind(null,"generateoffer")),r.on("jsep#unsubscribe",p.bind(null,"unsubscribe")),r.on("jsep#candidate",p.bind(null,"candidate")),r.on("subscriberChannel#updated",(t,n,r)=>{t&&e.streams.has(t)?e.streams.get(t)._.updateChannel(n,r):d.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)?h.subscribers.has(t)?h.subscribers.get(t).disableVideo(r.active):d.error("Unable to determine subscriberId, or the subscriber does not exist, for subscriberChannel#update message!"):d.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("caption",(t,n)=>{e._.dispatchCaption(t,n)}),r.on("archive#created",t=>{b(t,e)}),r.on("archive#updated",(t,n)=>{const r=e.archives.get(t);r?r._.update(n):d.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}),d.debug(`Received a request from RUMOR to start a transition to ${t} for the stream ID ${n} with the reason: ${r}`),h.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}),d.debug(`Received a request from RUMOR to start a transition from P2P to MANTIS for the stream ID ${n} with the reason: ${r}`),h.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(0),i=r(n(4)),o=r(n(5));const s=n(21),a=n(108).setCurrentAudioOutputDeviceId,c=n(330),u=n(24)(),l=u.getDefaultAudioOutputDeviceId,d=u.getAudioOutputMediaDevices,h=n(296),f=new(n(26)),p=(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,h();case 2:return e.prev=2,p("Attempt",{deviceId:t}),e.next=6,m(t);case 6:p("Success",{deviceId:t}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(2),p("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,d();case 2:return t=e.sent,n=l(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)}}(),y=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,p("Attempt",{deviceId:t}),e.next=4,m(t);case 4:p("Success",{deviceId:t}),a(t),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),p("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.next=13,y();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(1))},function(e,t,n){"use strict";n(333);const r=n(39),i=n(27),o=n(6),s=n(130),a=n(35)(),c=n(26),u=n(249),l=n(559),d=n(560),h=a.onlyLocal(),f={};f.noConflict=n(561)(),(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 p=n(144)(void 0!==typeof window?window:global),m=n(8),g=n(72),b=n(145),y=n(252),v=n(146),w=n(147),S=n(253),T=n(148),E=n(7),x=n(10),_=n(254),C=n(241),I=n(2)("OT"),R=n(123),Z=n(588),k=n(22),O=n(103).parseIceServers,V=n(267),G=n(21),A=n(151),W=n(153),N=n(154),L=n(73)({global:p}),X=n(13)({}),M=n(159)(),F=n(281)({otError:X}),P=n(282)(),j=n(288)({global:p}),U=n(24)({getNativeEnumerateDevices:j}),H=n(23)(),Y=n(161)(),D=n(643)({otError:X,global:p}),B=n(162)({chromeExtensionHelper:F,otError:X}),K=n(648)({deviceHelpers:U,generateConstraintInfo:_,getUserMediaHelper:D,global:p,OTHelpers:m,screenSharing:B}),J=n(651)({otError:X,processPubOptions:K}),z=n(163)({otError:X}),Q=n(75),q=n(293)(),$=n(294)({otError:X}),ee=n(295)({global:p,videoElementErrorMap:$}),te=n(164)({global:p}),ne=n(297)({PeerConnection:L,setCertificates:te}),re=n(300)({PeerConnection:L,setCertificates:te}),ie=n(302)(),oe=n(663)({otError:X}),se=n(110)({NativeVideoElementWrapper:ee}),ae=n(152)(),ce=n(165)({VideoElementFacade:se}),ue=n(305)({interpretPeerConnectionError:z,otError:X,SubscriberPeerConnection:re,WidgetView:ce}),le=n(169)({APIKEY:g,createChromeMixin:P,deviceHelpers:U,EnvironmentLoader:T,Errors:E,Events:H,ExceptionCodes:x,calculateCapableSimulcastStreams:y,global:p,interpretPeerConnectionError:z,IntervalRunner:Q,Microphone:q,otError:X,OTErrorClass:k,OTHelpers:m,parseIceServers:O,processPubOptions:K,PUBLISH_MAX_DELAY:V,PublisherPeerConnection:ne,PublishingState:ie,StreamChannel:A,systemRequirements:N,VideoOrientation:ae,WidgetView:ce}),de=n(317)({otError:X,Publisher:le}),he=n(318)({global:p,initPublisher:de,otError:X,Publisher:le,Subscriber:ue}),fe=n(752)({Session:he});o(f);const pe=n(753),me=n(756),ge=n(757);u(f,"$",{name:"OT.$",getMessage:"Please use an external library like jQuery to select elements from the page.",value:m}),f.APIKEY=g.value,f.AnalyserAudioLevelSampler=w,f.Archive=n(328),f.ArchiveEvent=H.ArchiveEvent,f.ArchiveUpdatedEvent=H.ArchiveUpdatedEvent,f.AudioLevelTransformer=b,f.AudioLevelUpdatedEvent=H.AudioLevelUpdatedEvent,f.Capabilities=n(170),f.Chrome=v,f.Connection=n(173),f.ConnectionCapabilities=f.Connection.Capabilities,f.ConnectionEvent=H.ConnectionEvent,Object.keys(R).forEach(e=>{f[e.toUpperCase()]=R[e].priority}),f.NONE=0,f.debug=I.debug,f.error=I.error,f.info=I.info,f.log=I.log,f.warn=I.warn,f.DestroyedEvent=H.DestroyedEvent,f.EnvLoadedEvent=H.EnvLoadedEvent,f.Error=k,f.Error.on(i.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=x,f.ExceptionEvent=H.ExceptionEvent,f.getDevices=n(758),f.getAudioOutputDevices=n(329),f.getActiveAudioOutputDevice=n(330),f.setAudioOutputDevice=n(759)(),f.GetAudioLevelSampler=S,f.HAS_REQUIREMENTS=1,f.IntervalRunner=Q,f.IssueReportedEvent=H.IssueReportedEvent,f.MediaStoppedEvent=H.MediaStoppedEvent,f.Microphone=q,f.NOT_HAS_REQUIREMENTS=0,f.PeerConnection=L,f.PeerConnection.QOS=n(279).default,f.Publisher=le,f.PublisherPeerConnection=ne,f.PublishingState=ie,f.MuteForcedEvent=H.MuteForcedEvent,f.Session=he,f.SessionConnectEvent=H.SessionConnectEvent,f.SessionDisconnectEvent=H.SessionDisconnectEvent,f.SessionDispatcher=n(327),f.Signal=n(325),f.SignalEvent=H.SignalEvent,f.Stream=n(171),f.StreamChannel=A,f.StreamEvent=H.StreamEvent,f.StreamPropertyChangedEvent=H.StreamPropertyChangedEvent,f.StreamUpdatedEvent=H.StreamUpdatedEvent,f.StylableComponent=W,f.Subscriber=ue,f.SubscriberPeerConnection=re,f.SubscribingState=n(308),f.VideoDimensionsChangedEvent=H.VideoDimensionsChangedEvent,f.VideoDisableWarningEvent=H.VideoDisableWarningEvent,f.VideoElement=se,f.VideoEnabledChangedEvent=H.VideoEnabledChangedEvent,f.VideoOrientation=ae,f.WidgetView=ce,f.getSupportedCodecs=pe,f.hasMediaProcessorSupport=me,f.hasEndToEndEncryptionSupport=ge,f._={AnalyticsHelper:c,getClientGuid:C.get,StaticConfig:a},Object.defineProperty(f,"version",{value:h.version});const be={};u(be,"version",{value:h.version,name:"OT.properties.version",getWarning:"Please use OT.version instead",warnOnSet:!0,setWarning:"Mutating version has no effect"}),l.forEach(e=>{let t,n;if(Array.isArray(e)){const r=e[0],i=e[1];n=r,t=h[i]||i}else t=h[e],n=e;const r=(i=n,d.includes(i));var i;u(be,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=be,f.audioContext=M,f.checkScreenSharingCapability=B.checkCapability,f.checkSystemRequirements=N.check,f.components={},f.generateSimpleStateMachine=Y,f.getErrorTitleByCode=k.getTitleByCode,f.getLogs=I.getLogs,f.getStatsAdpater=n(275),f.getStatsHelpers=n(76),f.getUserMedia=J,f.handleJsException=k.handleJsException,f.initPublisher=de,f.setProxyUrl=n(102).setProxyUrl,f.initSession=function(e,t,n){return null==t&&(t=e,e=null),0===g.value.length&&e&&(g.value=e,f.APIKEY=e),fe(e,t,n)};const ye=(e,t)=>()=>(console.warn(e+" is deprecated and will be removed in a future version of OpenTok"),t);Object.defineProperties(f,{isUnloaded:{get:ye("OT.isUnloaded",T.isUnloaded)},onLoad:{get:ye("OT.onLoad",T.onLoad)},onUnload:{get:ye("OT.onUnload",T.onUnload)},overrideGuidStorage:{get:ye("OT.overrideGuidStorage",C.override)}}),f.pickScreenSharingHelper=B.pickHelper,f.publishers=G.publishers,f.registerScreenSharingExtension=B.registerExtension,f.registerScreenSharingExtensionHelper=B.registerExtensionHelper,f.reportIssue=oe,f.sessions=G.sessions,f.setLogLevel=Z,f.shouldLog=I.shouldLog,f.subscribers=G.subscribers,f.unblockAudio=n(167),f.upgradeSystemRequirements=N.upgrade,T.onUnload(()=>{G.publishers.destroy(),G.subscribers.destroy(),G.sessions.destroy("unloaded")}),n(760)()},function(e,t,n){var r=n(334);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(348)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(335)(!1);var r=n(336),i=r(n(337)),o=r(n(338)),s=r(n(339)),a=r(n(340)),c=r(n(341)),u=r(n(342)),l=r(n(343)),d=r(n(344)),h=r(n(345)),f=r(n(346)),p=r(n(347));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("+l+") 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("+d+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-warning {\n background-image: url("+h+");\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("+p+");\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("+p+");\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+QkaWqrrC1uLzAwcXJycrL1NXj5Ofo6u3w9f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2RSs0wfLkll4pBGcgifg+NYxe1kJ2ycTaRq66uG/wBOl0vjcw70xwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAGMElEQVR4Ae2aA7D0yBaAc7oH12vbRmlLaxYWb23btm3btm2899a2bWuYtPZ01cmtU9lJrib315yqr9I3Oem/5/s7acwEnehEJzoxCcX2O+wEeIgRBDDaGjAZOgQ6ihRpLklHZDJIXK1WWymMIhGGkVBKCWMM+Iv/f/b5t7faYtM/sGgIS7j8RNLjceUVl41GvGN1BFiHy9sgtRWaYbhvuVQ6o1VOvV5/tLe3dyssKoZuh8xClkDEi2MMS6ZjR0cScxdK/+HgnJsmLccYOx0e/PUGUqfTJDEHkV5go9lcMQoj4R8RpSIRRUr4a9baTJFCCNfqESKJ7RYJibK0xoi05EhFRTxMi1Rit6xHAuLaKRLwEVi6q1x+EhlVpd3d3Wfh4VQkQhRhxthYLg7SRGqdLlIp7UVOHf+JhEhEMscUolVje3p63saeeOFoKsT7fjj++BNuw2I/0ouUENmGaQcQEilQvUU6xuWC0kqmVWCt8df6kG7WLoFA20VSCOyNh0RKPT+SyrTWtQsvuvTYCy84z3+oAdbgAiLGIvHjTz6bFuu/B3lKKfVkFKknwih6EnnipZdfXQZzepAupXSGSCfwUGZtkrx3t/0dSQGnnXbmdocdetArQoj+4VR23wMP3bj/vnv9Sv/rBmkish09ca655thHSrlWq4TFF1vkNDxsgjiUnPqZnHPABIq47jx7pPMcecShfz7x1DO7D6eit99576X1113nVd8rqLGAuDaNitJonTGIqHgQGQjDsJglMrUH5iDSEQbRa6y2yrNvv/PuWVmV/PTzLz8steTit1B9FtGJeZrJksmWdBzBMcami4xUkaY1A1Qe94WIaPGBApJhaERrLrXkElf8+NPPz6YMLs1DDjn0Wn9PnI/UiQadM4jNEkhzVsEGE8nIHESM1j5/KqRX+/IEiOQ/yifNBlEkpnb00cccesbpp13T3983H88/48xzrrvm6it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TguNDQ2VjM0LjM2MnoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48L2c+PHBhdGggZD0iTTgxLjUgMTYuNUwxOS45OTggNzguMDAyIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+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,l=0,d=[],h=n(349);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(v(r.parts[s],t))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(v(r.parts[s],t));o[r.id]={id:r.id,refs:1,parts:a}}}}function p(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=d[d.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),d.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=d.indexOf(e);t>=0&&d.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 y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function v(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=l++;n=u||(u=b(t)),r=T.bind(null,n,s,!1),i=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",y(t,e.attrs),m(e,t),t}(t),r=x.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),r=E.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=p(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(p(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 w,S=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function T(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 E(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 x(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=h(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(81),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(81);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(81);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(81);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(80);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(80),i=n(113),o=n(114);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(18),i=n(363),o=n(11),s=n(175),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,h=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:a).test(s(e))}},function(e,t,n){var r=n(41),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(364),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(15)["__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(367),i=n(80),o=n(113);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(368),i=n(369),o=n(370),s=n(371),a=n(372);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(82);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(82),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(82),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(82);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(83);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(83);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(83);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(83);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(30),i=n(19);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(30),i=n(116),o=n(19),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(179)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(42),i=n(55);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(385),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(42),i=n(119);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(42),i=n(182);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(40)(n(15),"DataView");e.exports=r},function(e,t,n){var r=n(40)(n(15),"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(122),i=n(393),o=n(394),s=n(395),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 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(122);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(41),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(397),i=n(68),o=n(117),s=o&&o.isMap,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(43),i=n(19);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(399),i=n(68),o=n(117),s=o&&o.isSet,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(43),i=n(19);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(401)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(44))},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(402),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(404),i=n(176),o=n(89),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(195),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(45),o=n(127),s=n(410),a=n(32),c=n(411),u=n(33),l=n(202),d=n(453),h=n(46).toStringTag,f=n(454),p=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)&&(p(t)||(t=l(t))),m(e,"__weakMapData__",u("c","$weakMap$"+c())),t?(d(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,h,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(196)()||(r=n(197)),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(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),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(413);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(128);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(416),i=n(32),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(417)()?Object.keys:n(418)},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(45),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(127),o=n(201),s=n(33),a=n(46),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?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(92),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(33),a=n(203),c=n(92).Symbol,u=n(427),l=n(428),d=n(429),h=Object.create,f=Object.defineProperties,p=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=h(i.prototype),t=void 0===t?"":String(t),f(n,{__description__:s("",t),__name__:s("",u(t))}))},l(r),d(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)}))}),p(r.prototype,r.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),p(r.prototype,r.toStringTag,s("c","Symbol")),p(i.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),p(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(33),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(33),i=n(92).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(33),i=n(203),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(32);e.exports=function(){return r(this).length=0,this}},function(e,t,n){"use strict";var r,i=n(57),o=n(432),s=n(436),a=n(437),c=n(200),u=n(447),l=Function.prototype.bind,d=Object.defineProperty,h=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&&h.call(this,e)?i:(t.value=l.call(i,n.resolveContext?n.resolveContext(this):this),d(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(205),i=n(57);e.exports=function(e){return i(e)?e:r(e,"Cannot use %v",arguments[1])}},function(e,t,n){"use strict";var r=n(57),i=n(128),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(435),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(205),i=n(199);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(438),i=n(129),o=n(32);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(439)()?Array.from:n(440)},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(46).iterator,i=n(90),o=n(441),s=n(442),a=n(70),c=n(32),u=n(45),l=n(91),d=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(e){var t,n,m,g,b,y,v,w,S,T,E=arguments[1],x=arguments[2];if(e=Object(c(e)),u(E)&&a(E),this&&this!==Array&&o(this))t=this;else{if(!E){if(i(e))return 1!==(b=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(d(e)){for(g=new Array(b=e.length),n=0;n<b;++n)g[n]=e[n];return g}}g=[]}if(!d(e))if(void 0!==(S=e[r])){for(v=a(S).call(e),t&&(g=new t),w=v.next(),n=0;!w.done;)T=E?h.call(E,x,w.value,n):w.value,t?(f.value=T,p(g,n,f)):g[n]=T,w=v.next(),++n;b=n}else if(l(e)){for(b=e.length,t&&(g=new t),n=0,m=0;n<b;++n)T=e[n],n+1<b&&(y=T.charCodeAt(0))>=55296&&y<=56319&&(T+=e[++n]),T=E?h.call(E,x,T,m):T,t?(f.value=T,p(g,m,f)):g[m]=T,++m;b=m}if(void 0===b)for(b=s(e.length),t&&(g=new t(b)),n=0;n<b;++n)T=E?h.call(E,x,e[n],n):e[n],t?(f.value=T,p(g,n,f)):g[n]=T;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(443),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){"use strict";var r=n(444),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(445)()?Math.sign:n(446)},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(448),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(449)("forEach")},function(e,t,n){"use strict";var r=n(70),i=n(32),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 l,d=arguments[2],h=arguments[3];return n=Object(i(n)),r(u),l=a(n),h&&l.sort("function"==typeof h?o.call(h,n):void 0),"function"!=typeof e&&(e=l[e]),s.call(e,l,(function(e,r){return c.call(n,e)?s.call(u,d,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r,i=n(127),o=n(33),s=n(46),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__",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(452);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(90),i=n(45),o=n(91),s=n(46).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(90),i=n(70),o=n(91),s=n(202),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,l,d,h,f,p,m,g,b=arguments[2];if(a(e)||r(e)?n="array":o(e)?n="string":e=s(e),i(t),d=function(){h=!0},"array"!==n)if("string"!==n)for(l=e.next();!l.done;){if(c.call(t,b,l.value,d),h)return;l=e.next()}else for(p=e.length,f=0;f<p&&(m=e[f],f+1<p&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++f]),c.call(t,b,m,d),!h);++f);else u.call(e,(function(e){return c.call(t,b,e,d),h}))}},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(93),i=n(94),o=n(132),s=n(34),a=n(68),c=n(95),u=Math.min;e.exports=function(e,t,n){for(var l=n?o:i,d=e[0].length,h=e.length,f=h,p=Array(h),m=1/0,g=[];f--;){var b=e[f];f&&t&&(b=s(b,a(t))),m=u(b.length,m),p[f]=!n&&(t||d>=120&&b.length>=120)?new r(f&&b):void 0}b=e[0];var y=-1,v=p[0];e:for(;++y<d&&g.length<m;){var w=b[y],S=t?t(w):w;if(w=n||0!==w?w:0,!(v?c(v,S):l(g,S,n))){for(f=h;--f;){var T=p[f];if(!(T?c(T,S):l(e[f],S,n)))continue e}v&&v.push(S),g.push(w)}}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(206),i=n(459),o=n(460);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(133);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){"use strict";(function(t){var r=n(20),i=n(208),o=n(463),s=n(214);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(211));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(215),c.CancelToken=n(476),c.isCancel=n(210),c.all=function(e){return t.all(e)},c.spread=n(477),c.isAxiosError=n(478),e.exports=c,e.exports.default=c}).call(this,n(1))},function(e,t,n){"use strict";(function(t){var r=n(20),i=n(209),o=n(464),s=n(465),a=n(214);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(1))},function(e,t,n){"use strict";var r=n(20);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(20),i=n(466),o=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=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(1))},function(e,t,n){"use strict";var r=n(20);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(20);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 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(20);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(472),i=n(473);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(20),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(20);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(215);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(1))},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(49));r.placeholder=n(134),e.exports=r},function(e,t,n){var r=n(481),i=n(134),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,l){var d="function"==typeof n,h=n===Object(n);if(h&&(l=u,u=n,n=void 0),null==u)throw new TypeError;l||(l={});var f=!("cap"in l)||l.cap,p=!("curry"in l)||l.curry,m=!("fixed"in l)||l.fixed,g=!("immutable"in l)||l.immutable,b=!("rearg"in l)||l.rearg,y=d?u:i,v="curry"in l&&l.curry,w="fixed"in l&&l.fixed,S="rearg"in l&&l.rearg,T=d?u.runInContext():void 0,E=d?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},x=E.ary,_=E.assign,C=E.clone,I=E.curry,R=E.forEach,Z=E.isArray,k=E.isError,O=E.isFunction,V=E.isWeakMap,G=E.keys,A=E.rearg,W=E.toInteger,N=E.toPath,L=G(r.aryMethod),X={castArray:function(e){return function(){var t=arguments[0];return Z(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(!O(n))return e(n,Object(t));var r=[];return R(G(t),(function(e){O(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),R(r,(function(e){var t=e[1];O(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:W(t)+1;return I(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return I(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),l)}}};function M(e,t){if(f){var n=r.iterateeRearg[e];if(n)return function(e,t){return H(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)}}(A(s(e,n),t),n)}))}(t,n);var i=!d&&r.iterateeAry[e];if(i)return function(e,t){return H(e,(function(e){return"function"==typeof e?s(e,t):e}))}(t,i)}return t}function F(e,t,n){if(m&&(w||!r.skipFixed[e])){var i=r.methodSpread[e],s=i&&i.start;return void 0===s?x(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 P(e,t,n){return b&&n>1&&(S||!r.skipRearg[e])?A(t,r.methodRearg[e]||r.aryRearg[n]):t}function j(e,t){for(var n=-1,r=(t=N(t)).length,i=r-1,o=C(Object(e)),s=o;null!=s&&++n<r;){var a=t[n],c=s[a];null==c||O(c)||k(c)||V(c)||(s[a]=C(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=l;return function(t){var r=d?T:E,a=d?T[o]:n,c=_(_({},s),t);return e(r,i,a,c)}}function H(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=X[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))),R(L,(function(e){return R(r.aryMethod[e],(function(t){if(o==t){var n=r.methodSpread[o],a=n&&n.afterRearg;return i=a?F(o,P(o,s,e),e):P(o,F(o,s,e),e),i=function(e,t,n){return v||p&&n>1?I(t,n):t}(0,i=M(o,i),e),!1}})),!i})),i||(i=s),i==t&&(i=v?I(i,1):function(){return t.apply(this,arguments)}),i.convert=U(o,t),i.placeholder=t.placeholder=n,i}if(!h)return Y(n,u,y);var D=u,B=[];return R(L,(function(e){R(r.aryMethod[e],(function(e){var t=D[r.remap[e]||e];t&&B.push([e,Y(e,t,D)])}))})),R(G(D),(function(e){var t=D[e];if("function"==typeof t){for(var n=B.length;n--;)if(B[n][0]==e)return;t.convert=U(e,t),B.push([e,t])}})),R(B,(function(e){D[e[0]]=e[1]})),D.convert=function(e){return D.runInContext.convert(e)(void 0)},D.placeholder=D,R(G(D),(function(e){R(r.realToAlias[e]||[],(function(t){D[t]=D[e]}))})),D}},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(483),assign:n(177),clone:n(39),curry:n(501),forEach:n(115),isArray:n(12),isError:n(502),isFunction:n(18),isWeakMap:n(503),iteratee:n(504),keys:n(118),rearg:n(519),toInteger:n(97),toPath:n(522)}},function(e,t,n){var r=n(135);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(96),i=n(15);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(124),i=n(96),o=n(219),s=n(222),a=n(228),c=n(138),u=n(15);e.exports=function(e,t,n){var l=i(e);return function i(){for(var d=arguments.length,h=Array(d),f=d,p=a(i);f--;)h[f]=arguments[f];var m=d<3&&h[0]!==p&&h[d-1]!==p?[]:c(h,p);if((d-=m.length)<n)return s(e,t,o,i.placeholder,void 0,h,m,void 0,void 0,n-d);var g=this&&this!==u&&this instanceof i?l:e;return r(g,this,h)}}},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(136),i=n(223),o=n(488),s=n(490);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(489),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(136),i=n(225),o=n(137),s=n(12),a=n(19),c=n(491),u=Object.prototype.hasOwnProperty;function l(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)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},function(e,t,n){var r=n(136),i=n(225),o=n(56);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(115),i=n(94),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(56),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(124),i=n(96),o=n(15);e.exports=function(e,t,n,s){var a=1&t,c=i(e);return function t(){for(var i=-1,u=arguments.length,l=-1,d=s.length,h=Array(d+u),f=this&&this!==o&&this instanceof t?c:e;++l<d;)h[l]=s[l];for(;u--;)h[l++]=arguments[++i];return r(f,a?n:this,h)}}},function(e,t,n){var r=n(220),i=n(221),o=n(138),s=Math.min;e.exports=function(e,t){var n=e[1],a=t[1],c=n|a,u=c<131,l=128==a&&8==n||128==a&&256==n&&e[7].length<=t[8]||384==a&&t[7].length<=t[8]&&8==n;if(!u&&!l)return e;1&a&&(e[2]=t[2],c|=1&n?0:4);var d=t[3];if(d){var h=e[3];e[3]=h?r(h,d,t[4]):d,e[4]=h?o(e[3],"__lodash_placeholder__"):t[4]}return(d=t[5])&&(h=e[5],e[5]=h?i(h,d,t[6]):d,e[6]=h?o(e[5],"__lodash_placeholder__"):t[6]),(d=t[7])&&(e[7]=d),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(500),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(135);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(30),i=n(19),o=n(139);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(43),i=n(19);e.exports=function(e){return i(e)&&"[object WeakMap]"==r(e)}},function(e,t,n){var r=n(78),i=n(36);e.exports=function(e){return i("function"==typeof e?e:r(e,1))}},function(e,t,n){var r=n(506),i=n(510),o=n(235);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(79),i=n(230);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 l=(u=n[s])[0],d=e[l],h=u[1];if(c&&u[2]){if(void 0===d&&!(l in e))return!1}else{var f=new r;if(o)var p=o(d,h,l,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},function(e,t,n){var r=n(79),i=n(231),o=n(508),s=n(509),a=n(43),c=n(12),u=n(66),l=n(86),d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,p,m){var g=c(e),b=c(t),y=g?"[object Array]":a(e),v=b?"[object Array]":a(t),w=(y="[object Arguments]"==y?d:y)==d,S=(v="[object Arguments]"==v?d:v)==d,T=y==v;if(T&&u(e)){if(!u(t))return!1;g=!0,w=!1}if(T&&!w)return m||(m=new r),g||l(e)?i(e,t,n,f,p,m):o(e,t,y,n,f,p,m);if(!(1&n)){var E=w&&h.call(e,"__wrapped__"),x=S&&h.call(t,"__wrapped__");if(E||x){var _=E?e.value():e,C=x?t.value():t;return m||(m=new r),p(_,C,n,f,m)}}return!!T&&(m||(m=new r),s(e,t,n,f,p,m))}},function(e,t,n){var r=n(41),i=n(188),o=n(54),s=n(231),a=n(233),c=n(98),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){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||!d(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 p=1&r;if(f||(f=c),e.size!=t.size&&!p)return!1;var m=h.get(e);if(m)return m==t;r|=2,h.set(e,t);var g=s(f(e),f(t),r,u,d,h);return h.delete(e),g;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t,n){var r=n(183),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var d=l;d--;){var h=u[d];if(!(c?h in t:i.call(t,h)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);for(var g=c;++d<l;){var b=e[h=u[d]],y=t[h];if(o)var v=c?o(y,b,h,t,e,a):o(b,y,h,e,t,a);if(!(void 0===v?b===y||s(b,y,n,o,a):v)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(m=!1)}return a.delete(e),a.delete(t),m}},function(e,t,n){var r=n(234),i=n(31);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(230),i=n(59),o=n(237),s=n(140),a=n(234),c=n(235),u=n(48);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(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(41),i=n(34),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(60),i=n(65),o=n(12),s=n(67),a=n(116),c=n(48);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,d=!1;++u<l;){var h=c(t[u]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++u!=l?d:!!(l=null==e?0:e.length)&&a(l)&&s(h,l)&&(o(e)||i(e))}},function(e,t,n){var r=n(517),i=n(518),o=n(140),s=n(48);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(99);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(135),i=n(141),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(238);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(41),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(34),i=n(56),o=n(12),s=n(71),a=n(236),c=n(48),u=n(61);e.exports=function(e){return o(e)?r(e,c):s(e)?[e]:i(a(u(e)))}},function(e,t,n){var r=n(524),i=n(237);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(99),i=n(525),o=n(60);e.exports=function(e,t,n){for(var s=-1,a=t.length,c={};++s<a;){var u=t[s],l=r(e,u);n(l,u)&&i(c,o(u,e),l)}return c}},function(e,t,n){var r=n(84),i=n(60),o=n(67),s=n(11),a=n(48);e.exports=function(e,t,n,c){if(!s(e))return e;for(var u=-1,l=(t=i(t,e)).length,d=l-1,h=e;null!=h&&++u<l;){var f=a(t[u]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(u!=d){var m=h[f];void 0===(p=c?c(m,f,h):void 0)&&(p=s(m)?m:o(t[u+1])?[]:{})}r(h,f,p),h=h[f]}return e}},function(e,t,n){var r=n(216)("mapKeys",n(527));r.placeholder=n(134),e.exports=r},function(e,t,n){var r=n(64),i=n(100),o=n(36);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]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,f=String.fromCharCode;function p(e){throw new RangeError(d[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(l,".")).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 y(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 v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=36)e=h(e/35);return h(r+36*e/(e+38))}function S(e){var t,n,r,i,o,s,c,u,l,d,f,m=[],g=e.length,b=0,v=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&p("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&&p("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>h((a-b)/s))&&p("overflow"),b+=u*s,!(u<(l=c<=S?1:c>=S+26?26:c-S));c+=36)s>h(a/(d=36-l))&&p("overflow"),s*=d;S=w(b-o,t=m.length+1,0==o),h(b/t)>a-v&&p("overflow"),v+=h(b/t),b%=t,m.splice(b++,0,v)}return y(m)}function T(e){var t,n,r,i,o,s,c,u,l,d,m,g,y,S,T,E=[];for(g=(e=b(e)).length,t=128,n=0,o=72,s=0;s<g;++s)(m=e[s])<128&&E.push(f(m));for(r=i=E.length,i&&E.push("-");r<g;){for(c=a,s=0;s<g;++s)(m=e[s])>=t&&m<c&&(c=m);for(c-t>h((a-n)/(y=r+1))&&p("overflow"),n+=(c-t)*y,t=c,s=0;s<g;++s)if((m=e[s])<t&&++n>a&&p("overflow"),m==t){for(u=n,l=36;!(u<(d=l<=o?1:l>=o+26?26:l-o));l+=36)T=u-d,S=36-d,E.push(f(v(d+T%S,0))),u=h(T/S);E.push(f(v(u,0))),o=w(n,y,r==i),n=0,++r}++n,++t}return E.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:y},decode:S,encode:T,toASCII:function(e){return g(e,(function(e){return u.test(e)?"xn--"+T(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(85)(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(532),t.encode=t.stringify=n(533)},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 l=0;l<u;++l){var d,h,f,p,m=e[l].replace(a,"%20"),g=m.indexOf(n);g>=0?(d=m.substr(0,g),h=m.substr(g+1)):(d=m,h=""),f=decodeURIComponent(d),p=decodeURIComponent(h),r(s,f)?i(s[f])?s[f].push(p):s[f]=[s[f],p]:s[f]=p}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(535),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,l=n.regeneratorRuntime;if(l)u&&(e.exports=l);else{(l=n.regeneratorRuntime=u?e.exports:{}).wrap=g;var d={},h={};h[s]=function(){return this};var f=Object.getPrototypeOf,p=f&&f(f(I([])));p&&p!==r&&i.call(p,s)&&(h=p);var m=w.prototype=y.prototype=Object.create(h);v.prototype=m.constructor=w,w.constructor=v,w[c]=v.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},l.awrap=function(e){return{__await:e}},S(T.prototype),T.prototype[a]=function(){return this},l.AsyncIterator=T,l.async=function(e,t,n,r){var i=new T(g(e,t,n,r));return l.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]"},l.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}},l.values=I,C.prototype={constructor:C,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(_),!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,d):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),d},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),_(n),d}},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;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}}}function g(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new C(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 R()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=E(s,n);if(a){if(a===d)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===d)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 y(){}function v(){}function w(){}function S(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,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,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).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 E(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,E(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=b(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;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,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function x(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function I(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:R}}function R(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}).call(this,n(1))},function(e,t,n){var r,i,o=n(242),s=n(243),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,l=t||[],d=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var f=o();null==d&&(d=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==h&&(h=i=16383&(f[6]<<8|f[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,g=p-a+(m-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,c=m,i=h;var b=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;l[u++]=b>>>24&255,l[u++]=b>>>16&255,l[u++]=b>>>8&255,l[u++]=255&b;var y=p/4294967296*1e4&268435455;l[u++]=y>>>8&255,l[u++]=255&y,l[u++]=y>>>24&15|16,l[u++]=y>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var v=0;v<6;++v)l[u+v]=d[v];return t||s(l)}},function(e,t,n){var r=n(242),i=n(243);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(0)(n(16));const i=n(9),o=n(2)("analytics"),s=n(539),a=n(17),c=n(244),u=n(101).prependProxyToUrlIfNeeded,l=n(102).getProxyUrl,d=a(),h=new s;e.exports=function(e){var t=this;let n=e.loggingUrl,s=e.queue,a=void 0===s?h:s,f=e.ajax,p=void 0===f?c:f;this.loggingUrl=n,this.updateEndPoints=()=>{if(!this.proxyUrl){this.proxyUrl=l();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:d});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),p.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(0)(n(14));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(543),i=r.isiPhone,o=r.isiPad,s=r.isiOS,a=n(544),c=n(545),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},l=()=>{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()};let d;e.exports={parse:e=>(d={version:-1,name:"unknown"},l()?(d.name="Node",d.isNode=!0,d.version=parseInt(t.versions.node,10),d.userAgent=`${d.name} ${d.version}`):(e=>{if(e=e||(void 0!==typeof window?window:global).navigator,d.userAgent=e.userAgent.toLowerCase(),d.name="unknown",d.userAgent.indexOf("opera")>-1||d.userAgent.indexOf("opr/")>-1)d.name="Opera",d.isOpera=!0,null!==/opr\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1));else if(d.userAgent.indexOf("firefox")>-1)d.name="Firefox",d.isFirefox=!0,null!==/firefox\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1));else if(d.userAgent.match(/edge?\/(\d+)(?:\.\d+)+$/)){d.name="Edge",d.isEdge=!0;const e=RegExp.$1;d.version=parseInt(e,10)}else d.userAgent.indexOf("chrome")>-1?(d.name="Chrome",d.isElectron=u(e),d.isElectron?d.electronVersion=c(e.userAgent):d.isChrome=!0,null!==/chrome\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)&&(d.version=parseFloat(RegExp.$1))):e.vendor&&e.vendor.toLowerCase().indexOf("apple")>-1?(d.name="Safari",d.isSafari=!0,d.isiPhone=i(e.userAgent),d.isiPad=o(e.userAgent),d.isiOS=s(e.userAgent),d.isiOS&&(d.iOSVersion=a(e.userAgent)),(null!==/version\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)||null!==/fxios\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent)||null!==/crios\/([0-9]{1,}[.0-9]{0,})/.exec(d.userAgent))&&(d.version=parseFloat(RegExp.$1))):d.userAgent.indexOf("applewebkit")>-1&&-1===d.userAgent.indexOf("version")&&(d.isIosWebView=!0);d.isChromiumEdge="Edge"===d.name&&d.version>=79,d.isLegacyEdge="Edge"===d.name&&d.version<79,d.isLegacyElectron=d.isElectron&&d.electronVersion<7,d.isLegacyChrome=d.isChrome&&d.version<87,d.isChromium=!!(d.isChrome||d.isChromiumEdge||d.isElectron||d.isOpera),d.isAndroid=d.userAgent.indexOf("android")>-1,d.userAgent=e.userAgent,d.protocol=location.protocol,d.hostName=location.hostName,(-1===d.version||"unknown"===d.name||d.isiOS&&!d.iOSVersion)&&(d.error=!0)})(e),d),isNode:l}}).call(this,n(44))},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(547);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(549);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(118),i=n(43),o=n(65),s=n(12),a=n(25),c=n(66),u=n(69),l=n(86),d=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)||l(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(d.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:"Publisher ICEWorkflow failed",1554:"Subscriber 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(18);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(247),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(554);e.exports=(e,t)=>{if("string"==typeof e&&"string"==typeof t){const n=r(e),i=t.match(/(\w+:\/\/)(.*)/);return`${i[1]}${n}/${i[2]}`}return t}},function(e,t,n){"use strict";e.exports=e=>e.replace(/\/+$/,"").replace(/^.*:\/+/,"")},function(e,t,n){"use strict";const r=n(556);e.exports=function(e){void 0===e&&(e={});(e.isSessionProxied||n(557))(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(0),i=r(n(4)),o=r(n(5));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";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(29);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(564)||null,l=n(566)||null,d=n(570)||null,h=n(572)||null,f=n(573)||null,p={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."),p;a("adapter.js shimming chrome."),p.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(!d||!d.shimPeerConnection||!o.shimFirefox)return a("Firefox shim is not included in this adapter release."),p;a("adapter.js shimming firefox."),p.browserShim=d,f.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimSourceObject(i),d.shimPeerConnection(i),d.shimOnTrack(i),d.shimRemoveStream(i),d.shimSenderGetStats(i),d.shimReceiverGetStats(i),d.shimRTCDataChannel(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"edge":if(!l||!l.shimPeerConnection||!o.shimEdge)return a("MS edge shim is not included in this adapter release."),p;a("adapter.js shimming edge."),p.browserShim=l,f.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimPeerConnection(i),l.shimReplaceTrack(i),l.shimGetDisplayMedia(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"safari":if(!h||!o.shimSafari)return a("Safari shim is not included in this adapter release."),p;a("adapter.js shimming safari."),p.browserShim=h,f.shimCreateObjectURL(i),h.shimRTCIceServerUrls(i),h.shimCreateOfferLegacy(i),h.shimCallbacksAPI(i),h.shimLocalStreamsAPI(i),h.shimRemoteStreamsAPI(i),h.shimTrackEventTransceiver(i),h.shimGetUserMedia(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;default:a("Unsupported browser!")}return p}},function(e,t,n){"use strict";(function(t){var r=n(29),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(565),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]=l(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 l(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(1))},function(e,t,n){"use strict";(function(t){var r=n(29),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 l=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return l(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(1))},function(e,t,n){"use strict";var r=n(29),i=n(567),o=n(568);e.exports={shimGetUserMedia:n(569),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(29);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(251);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 l(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 d=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(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.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},d.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},d.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)}))}},d.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()},d.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)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.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},d.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 l=r.getMediaSections(i._localDescription.sdp);l[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+l.join("");var d=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),d&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){s.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.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}},d.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)},d.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))},d.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,l=n.dtlsTransport,d=n.localCapabilities,h=n.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!n.rejected){var f=r.getIceParameters(e,i),p=r.getDtlsParameters(e,i);u&&(p.role="server"),a.usingBundle&&0!==t||(a._gather(n.mid,t),"new"===c.state&&c.start(s,f,u?"controlling":"controlled"),"new"===l.state&&l.start(p));var m=o(d,h);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()},d.prototype.setRemoteDescription=function(i){var d=this;if(-1===["offer","answer"].indexOf(i.type))return t.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!s("setRemoteDescription",i.type,d.signalingState)||d._isClosed)return t.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+d.signalingState));var h={};d.remoteStreams.forEach((function(e){h[e.id]=e}));var f=[],p=r.splitSections(i.sdp),m=p.shift(),g=r.matchPrefix(m,"a=ice-lite").length>0,b=r.matchPrefix(m,"a=group:BUNDLE ").length>0;d.usingBundle=b;var y=r.matchPrefix(m,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,p.forEach((function(t,s){var c=r.splitLines(t),l=r.getKind(t),p=r.isRejected(t)&&0===r.matchPrefix(t,"a=bundle-only").length,y=c[0].substr(2).split(" ")[2],v=r.getDirection(t,m),w=r.parseMsid(t),S=r.getMid(t)||r.generateIdentifier();if(p||"application"===l&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))d.transceivers[s]={mid:S,kind:l,protocol:y,rejected:!0};else{var T,E,x,_,C,I,R,Z,k;!p&&d.transceivers[s]&&d.transceivers[s].rejected&&(d.transceivers[s]=d._createTransceiver(l,!0));var O,V,G=r.parseRtpParameters(t);p||(O=r.getIceParameters(t,m),(V=r.getDtlsParameters(t,m)).role="client"),R=r.parseRtpEncodingParameters(t);var A=r.parseRtcpParameters(t),W=r.matchPrefix(t,"a=end-of-candidates",m).length>0,N=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)&&!p&&b&&s>0&&d.transceivers[s]&&(d._disposeIceAndDtlsTransports(s),d.transceivers[s].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[s].iceTransport=d.transceivers[0].iceTransport,d.transceivers[s].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[s].rtpSender&&d.transceivers[s].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[s].rtpReceiver&&d.transceivers[s].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==i.type||p){if("answer"===i.type&&!p){E=(T=d.transceivers[s]).iceGatherer,x=T.iceTransport,_=T.dtlsTransport,C=T.rtpReceiver,I=T.sendEncodingParameters,Z=T.localCapabilities,d.transceivers[s].recvEncodingParameters=R,d.transceivers[s].remoteCapabilities=G,d.transceivers[s].rtcpParameters=A,N.length&&"new"===x.state&&(!g&&!W||b&&0!==s?N.forEach((function(e){a(T.iceTransport,e)})):x.setRemoteCandidates(N)),b&&0!==s||("new"===x.state&&x.start(E,O,"controlling"),"new"===_.state&&_.start(V)),!o(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,d._transceive(T,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!C||"sendrecv"!==v&&"sendonly"!==v?delete T.rtpReceiver:(k=C.track,w?(h[w.stream]||(h[w.stream]=new e.MediaStream),u(k,h[w.stream]),f.push([k,C,h[w.stream]])):(h.default||(h.default=new e.MediaStream),u(k,h.default),f.push([k,C,h.default])))}}else{(T=d.transceivers[s]||d._createTransceiver(l)).mid=S,T.iceGatherer||(T.iceGatherer=d._createIceGatherer(s,b)),N.length&&"new"===T.iceTransport.state&&(!W||b&&0!==s?N.forEach((function(e){a(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(N)),Z=e.RTCRtpReceiver.getCapabilities(l),n<15019&&(Z.codecs=Z.codecs.filter((function(e){return"rtx"!==e.name}))),I=T.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var L,X=!1;if("sendrecv"===v||"sendonly"===v){if(X=!T.rtpReceiver,C=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,l),X)k=C.track,w&&"-"===w.stream||(w?(h[w.stream]||(h[w.stream]=new e.MediaStream,Object.defineProperty(h[w.stream],"id",{get:function(){return w.stream}})),Object.defineProperty(k,"id",{get:function(){return w.track}}),L=h[w.stream]):(h.default||(h.default=new e.MediaStream),L=h.default)),L&&(u(k,L),T.associatedRemoteMediaStreams.push(L)),f.push([k,C,L])}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=Z,T.remoteCapabilities=G,T.rtpReceiver=C,T.rtcpParameters=A,T.sendEncodingParameters=I,T.recvEncodingParameters=R,d._transceive(d.transceivers[s],!1,X)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===i.type?"active":"passive"),d._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(h).forEach((function(t){var n=h[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",r)}))}f.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&l(d,t,r,[n])}))}})),f.forEach((function(e){e[2]||l(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.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()},d.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")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.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))},d.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)}},d.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)}},d.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 l=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 l=t.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];s&&n>=15019&&"video"===a&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),t.wantReceive&&(t.rtpReceiver=new e.RTCRtpReceiver(t.dtlsTransport,a)),t.localCapabilities=u,t.sendEncodingParameters=l})),"max-compat"!==o._config.bundlePolicy&&(l+="a=group:BUNDLE "+o.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),l+="a=ice-options:trickle\r\n",o.transceivers.forEach((function(e,t){l+=i(e,e.localCapabilities,"offer",e.stream,o._dtlsRole),l+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===o.iceGatheringState||0!==t&&o.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,l+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(l+="a=end-of-candidates\r\n"))}));var d=new e.RTCSessionDescription({type:"offer",sdp:l});return t.resolve(d)},d.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 l=new e.RTCSessionDescription({type:"answer",sdp:a});return t.resolve(l)},d.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 l=i.transceivers[s];if(!l)return o(c("OperationError","Can not add ICE candidate"));if(l.rejected)return t();var d=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===d.protocol&&(0===d.port||9===d.port))return t();if(d.component&&1!==d.component)return t();if((0===s||s>0&&l.iceTransport!==i.transceivers[0].iceTransport)&&!a(l.iceTransport,d))return o(c("OperationError","Can not add ICE candidate"));var h=e.candidate.trim();0===h.indexOf("a=")&&(h=h.substr(2)),(n=r.getMediaSections(i._remoteDescription.sdp))[s]+="a="+(d.type?h:"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()}))},d.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 h=["createOffer","createAnswer"];return h.forEach((function(e){var t=d.prototype[e];d.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)}})),(h=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=d.prototype[e];d.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=d.prototype[e];d.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)}})),d}}).call(this,n(1))},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(1))},function(e,t,n){"use strict";(function(t){var r=n(29);e.exports={shimGetUserMedia:n(571),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(1))},function(e,t,n){"use strict";(function(t){var r=n(29),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 l=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return l(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 d=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},h=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)),d(e.audio,"autoGainControl","mozAutoGainControl"),d(e.audio,"noiseSuppression","mozNoiseSuppression")),h(e)},s&&s.prototype.getSettings){var f=s.prototype.getSettings;s.prototype.getSettings=function(){var e=f.apply(this,arguments);return d(e,"mozAutoGainControl","autoGainControl"),d(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var p=s.prototype.applyConstraints;s.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),d(e,"autoGainControl","mozAutoGainControl"),d(e,"noiseSuppression","mozNoiseSuppression")),p.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(1))},function(e,t,n){"use strict";(function(t){var r=n(29);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(1))},function(e,t,n){"use strict";var r=n(251),i=n(29);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 l={};Object.defineProperty(l,"maxMessageSize",{get:function(){return t}}),e._sctp=l}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(1))},function(e,t,n){var r=n(79),i=n(256),o=n(239),s=n(576),a=n(11),c=n(55),u=n(257);e.exports=function e(t,n,l,d,h){t!==n&&o(n,(function(o,c){if(h||(h=new r),a(o))s(t,n,c,l,e,d,h);else{var f=d?d(u(t,c),o,c+"",t,n,h):void 0;void 0===f&&(f=o),i(t,c,f)}}),c)}},function(e,t,n){var r=n(256),i=n(180),o=n(189),s=n(56),a=n(190),c=n(65),u=n(12),l=n(133),d=n(66),h=n(18),f=n(11),p=n(139),m=n(86),g=n(257),b=n(577);e.exports=function(e,t,n,y,v,w,S){var T=g(e,n),E=g(t,n),x=S.get(E);if(x)r(e,n,x);else{var _=w?w(T,E,n+"",e,t,S):void 0,C=void 0===_;if(C){var I=u(E),R=!I&&d(E),Z=!I&&!R&&m(E);_=E,I||R||Z?u(T)?_=T:l(T)?_=s(T):R?(C=!1,_=i(E,!0)):Z?(C=!1,_=o(E,!0)):_=[]:p(E)||c(E)?(_=T,c(T)?_=b(T):f(T)&&!h(T)||(_=a(E))):C=!1}C&&(S.set(E,_),v(_,E,y,w,S),S.delete(E)),r(e,n,_)}}},function(e,t,n){var r=n(42),i=n(55);e.exports=function(e){return r(e,i(e))}},function(e,t,n){"use strict";const r=n(149),i=n(258),o=n(259),s=n(264),a=n(2)("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 l(e){return e._inject&&e._inject.logging||a}function d(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 h(e,t){const n=l(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&&l(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 p=["user","environment","left","right"],m=(e,t)=>{if(void 0===e||p.indexOf(e)>=0)return e;l(t).warn("Invalid facingMode passed to Publisher. Expected one of: "+p.join(", "))};e.exports=function(e){const t=l(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:h("audio",e),video:h("video",e),usingOptionalMandatoryStyle:e.usingOptionalMandatoryStyle,enableRenegotiation:e.enableRenegotiation,enableStereo:e.enableStereo,noiseSuppression:e.noiseSuppression,autoGainControl:e.autoGainControl,echoCancellation:e.echoCancellation,disableAudioProcessing:e.disableAudioProcessing,videoDimensions:d("resolution",e.resolution,e=>c[e],`"${Object.keys(c).join('", "')}"`,t),frameRate:f(n,d("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";
27
27
  /*
28
28
  object-assign
29
29
  (c) Sindre Sorhus