@vonage/client-sdk-video 2.25.2

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.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license OpenTok.js 2.25.2 a57837c42
3
+ *
4
+ * Copyright (c) 2010-2023 TokBox, Inc.
5
+ * Subject to the applicable Software Development Kit (SDK) License Agreement:
6
+ * https://www.vonage.com/legal/communications-apis/terms-of-use/
7
+ *
8
+ * Date: Thu, 04 May 2023 23:26:29 GMT
9
+ */
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OT=t():e.OT=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var 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=334)}([function(e,t,n){(function(t){
11
+ /*!
12
+ * @overview es6-promise - a tiny implementation of Promises/A+.
13
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
14
+ * @license Licensed under MIT license
15
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
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){p[r]=e,p[r+1]=t,2===(r+=2)&&(o?o(f):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(f,1)}}var p=new Array(1e3);function f(){for(var e=0;e<r;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[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(T);void 0===r[E]&&V(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return Z(i,r,o,n._result)}))}else k(n,r,e,t);return r}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(T);return _(t,e),t}l?v=function(){return t.nextTick(f)}:u?(g=0,b=new u(f),y=document.createTextNode(""),b.observe(y,{characterData:!0}),v=function(){y.data=g=++g%2}):d?((m=new MessageChannel).port1.onmessage=f,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(f)}:h()}catch(e){return h()}}():h();var E=Math.random().toString(36).substring(2);function T(){}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):k(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),O(e)}function I(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(O,e))}function R(e,t){void 0===e._state&&(e._state=2,e._result=t,s(C,e))}function k(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(O,e)}function O(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?Z(n,r,i,o):i(o);e._subscribers.length=0}}function Z(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 A=0;function V(e){e[E]=A++,e._state=void 0,e._result=void 0,e._subscribers=[]}var G=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(T),this.promise[E]||V(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===N){var a=new n(T);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;k(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),N=function(){function t(e){this[E]=A++,this._result=this._state=void 0,this._subscribers=[],T!==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 N.prototype.then=w,N.all=function(e){return new G(this,e).promise},N.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."))}))},N.resolve=S,N.reject=function(e){var t=new this(T);return R(t,e),t},N._setScheduler=function(e){o=e},N._setAsap=function(e){s=e},N._asap=s,N.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=N},N.Promise=N,N},e.exports=n()}).call(this,n(42))},function(e,t,n){"use strict";const r=n(402),i=n(190),o=n(121),s=i(e=>{const t={};return Object.keys(o).forEach(n=>{const i=o[n].method,s=r(`OpenTok:${e}:${n.toLowerCase()}`);s.log=console[i].bind(console),t[n.toLowerCase()]=s}),t});s.setLogLevel=e=>{let t;try{t=(void 0!==typeof window?window:global).localStorage.debug}catch(e){t=""}const n=[...Object.keys(o).map(t=>`${e>=o[t].priority?"":"-"}(autogen)?OpenTok:*:${t.toLowerCase()}`),...(t||"").split(/[\s,]/).filter(e=>-1===e.indexOf("(autogen)?"))].filter(e=>e).join(",");r.enable(n)},e.exports=s},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";const r=n(545).parse();e.exports=r},function(e,t,n){e.exports=n(537)},function(e,t,n){(function(t){function n(e,n,r,i,o,s,a){try{var c=e[s](a),u=c.value}catch(e){return void r(e)}c.done?n(u):t.resolve(u).then(i,o)}e.exports=function(e){return function(){var r=this,i=arguments;return new t((function(t,o){var s=e.apply(r,i);function a(e){n(s,t,o,a,c,"next",e)}function c(e){n(s,t,o,a,c,"throw",e)}a(void 0)}))}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(18),i=n(16),o=n(1)("Events"),s=n(9),a=n(407);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={eventsDispatched:{},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},dispatchEventOnce(e,t){this.isEventDispatched(e.type,t)||(this.dispatchEvent(e),this.eventsDispatched[e.type]?this.eventsDispatched[e.type].push(t):this.eventsDispatched[e.type]=[t])},isEventDispatched(e,t){var n;return null==(n=this.eventsDispatched[e])?void 0:n.includes(t)},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(244),i=n(248),o=n(6),s=n(1);r.logging=s("OT.$"),r.ElementCollection=n(245),r.env=n(3),r.ajax=n(243),r.statable=n(554),r.Analytics=n(20),r.Collection=n(247),r.domExtras=n(555),r.Error=n(249),i(r,"useLogHelpers",{value(e){const t=s("useLogHelpersDeprecatedMixin");return Object.keys(t).forEach(n=>{e[n]=t[n]}),e},name:"OT.useLogHelpers",getWarning:"Please use an external library for your debugging needs"}),r.defaults=n(141),i(r,"eventing",{value:o,name:"OT.$.eventing",getWarning:"Please use an external library to create an event emitter."}),Object.keys(r).forEach(e=>{const t=r[e]._attachToOTHelpers||{};Object.keys(t).forEach(n=>{!Object.hasOwnProperty.call(r,n)||"util"===e&&"bind"===n||console.warn(`More than one module is trying to define ${n} on OTHelpers.`),r[n]=t[n]})}),e.exports=r},function(e,t,n){var r=n(83),i=n(40),o=n(191),s=n(25),a=n(67),c=n(30),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,n){var r=n(173),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r=n(539),i=n(540),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r=n(29),i=n(11);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";(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(t){e.removeListener(n,o),r(t)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),t([].slice.call(arguments))}g(e,n,o,{once:!0}),"error"!==n&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,i,{once:!0})}))},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 p(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 f(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}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}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 p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(207),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.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5)),s=r(n(45));const a=n(240),c=n(541),u=n(142),l=n(34)(),d=n(556),h=n(6),p=n(558),f=n(561);let m=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?l.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new u:i,s=t.ajax,a=t.queue,c=t.getUserAgentClientHintData,d=void 0===c?f:c,h=t.userAgentData,p=void 0===h?"undefined"!=typeof navigator&&navigator.userAgentData:h;this.getTurnServerName=e=>{let t,n;if(!e||"object"!=typeof e)return t;return(Array.isArray(e)?e:[e]).forEach(e=>{const r=e.urls||e.url;(Array.isArray(r)?r:[r]).forEach(e=>{const r=e.indexOf(":")+1,i=e.lastIndexOf(":");e.includes("turns")?n=e.substring(r,i):t=e.substring(r,i)})}),n||t},this.ajax=s,this.queue=a,this.sessionInfo=o,this.getUserAgentClientHintData=d,this.userAgentData=p,this.staticConfig=r}var t=e.prototype;return t._getCachedUserAgentData=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(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:d(e,t),version:this.staticConfig.version,partnerId:this.sessionInfo.partnerId}},t._getCommonDataFields=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,a.getAsync();case 2:return t=e.sent,e.next=5,this._getCachedUserAgentData();case 5:return n=e.sent,e.abrupt("return",Object.assign({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,i,o){void 0===o&&(o={}),this._getCommonDataFields().then(s=>{const a=[t,n,r,i,Object.assign({},s,o)];e.emit("logError",...a),this._analytics.logError(...a)})},t.logEvent=function(t,n,r){void 0===t&&(t={}),this._getCommonDataFields().then(i=>{const o=Object.assign({},i,t);e.emit("logEvent",o),this._analytics.logEvent(o,!1,n,r)})},t.logQOS=function(t){void 0===t&&(t={}),this._getCommonDataFields().then(n=>{const r=Object.assign({duration:0},n,t);p(r),e.emit("logQOS",r),this._analytics.logQOS(r)})},(0,s.default)(e,[{key:"staticConfig",get:function(){return this._staticConfig},set:function(e){this._staticConfig=e,this._analytics=new c({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();h(m),e.exports=m},function(e,t,n){"use strict";const r=n(247),i={publishers:new r("guid"),subscribers:new r("widgetId"),sessions:new r};e.exports=i},function(e,t,n){"use strict";const r=n(1)("GlobalExceptionHandler"),i=n(6),o=n(26),s=n(553),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(2),i=r(n(45)),o=r(n(48));const s=n(128),a=n(26);e.exports=function(e){void 0===e&&(e={});const t=e.logging||n(1)("Events"),r={ExceptionEvent:function(e,t,n,r,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.PublisherCaptionsEnabled=function(e){return new s("publisherCaptionsEnabled",!1,{captionsEnabled:e})},r.StreamUpdatedEvent=function(e,t,n,r){return new s("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},r.DestroyedEvent=function(e,t,n){return new s(e,!1,{target:t,reason:n})},r.ConnectionStateChangedEvent=function(e,t){return new s(e,!1,{target:t})},r.VideoEnabledChangedEvent=function(e,t){return new s(e,!1,{reason:t.reason})},r.VideoDisableWarningEvent=function(e){return new s(e,!1)},r.AudioLevelUpdatedEvent=function(e){return new s(a.AUDIO_LEVEL_UPDATED,!1,{audioLevel:e})},r.MediaStoppedEvent=function(e,t){return new s(a.MEDIA_STOPPED,!0,{target:e,track:t})},r.MuteForcedEvent=function(e){return new s(a.MUTE_FORCED,!1,e)},r.VideoElementCreatedEvent=function(e){return new s(a.VIDEO_ELEMENT_CREATED,!1,{element:e})},r}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(4)),o=r(n(5));e.exports=function(e){void 0===e&&(e={});const r=e.getNativeEnumerateDevices||n(287)(),s=e.getNativeMediaDevices||n(645)(),a=(e.currentAudioOutputDevice||n(106)).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(0))},function(e,t,n){var r=n(16),i=n(114);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";e.exports={ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown",PER_SESSION:"perSession",PER_STREAM:"perStream",EXCEPTION:"exception",ISSUE_REPORTED:"issueReported",SESSION_CONNECTED:"sessionConnected",SESSION_RECONNECTING:"sessionReconnecting",SESSION_RECONNECTED:"sessionReconnected",SESSION_DISCONNECTED:"sessionDisconnected",STREAM_CREATED:"streamCreated",STREAM_DESTROYED:"streamDestroyed",CONNECTION_CREATED:"connectionCreated",CONNECTION_DESTROYED:"connectionDestroyed",SIGNAL:"signal",STREAM_PROPERTY_CHANGED:"streamPropertyChanged",MICROPHONE_LEVEL_CHANGED:"microphoneLevelChanged",RESIZE:"resize",SETTINGS_BUTTON_CLICK:"settingsButtonClick",DEVICE_INACTIVE:"deviceInactive",INVALID_DEVICE_NAME:"invalidDeviceName",ACCESS_ALLOWED:"accessAllowed",ACCESS_DENIED:"accessDenied",ACCESS_DIALOG_OPENED:"accessDialogOpened",ACCESS_DIALOG_CLOSED:"accessDialogClosed",ECHO_CANCELLATION_MODE_CHANGED:"echoCancellationModeChanged",MEDIA_STOPPED:"mediaStopped",PUBLISHER_DESTROYED:"destroyed",MUTE_FORCED:"muteForced",SUBSCRIBER_DESTROYED:"destroyed",SUBSCRIBER_CONNECTED:"connected",SUBSCRIBER_DISCONNECTED:"disconnected",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";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){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);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.")}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(60),a=n(272),c=n(129),u=n(273),l=n(1)("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,getCodecsFromSection:e=>({codecs:e[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(" "),codecMap:o(...e.filter(e=>e.match(/^a=rtpmap:\d+/)).map(e=>e.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map(e=>({[e[0]]:e[1]})))}),getCodecsAndCodecMap(e,t){const n=d.getSections(e)[t];if(!n)throw new Error("no mediaType "+t);return d.getCodecsFromSection(n)},getCodecs(e,t){const n=d.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},mediaDirections:{INACTIVE:"inactive",RECVONLY:"recvonly",SENDONLY:"sendonly",SENDRECV:"sendrecv"}};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,p,f;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&&(p=h[1],f=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=p,w.midIndex=f,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 p=(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=p.bind(null,"send"),d.modifyReceiveStereo=p.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"),d.changeSetupRole=(e,t,n)=>e.map(e=>e.includes("a=setup:"+t)?"a=setup:"+n:e),d.patterns={bundle:"a=group:BUNDLE",address:"c=IN IP4",rtcp:"a=rtcp:",direction:["a=inactive","a=sendonly","a=recvonly","a=sendrecv"],rsize:"a=rtcp-rsize",ssrc:"a=ssrc:",msid:"a=msid:"},d.getIndexStartingWith=(e,t,n)=>{const r=e.slice(n),i=t.map(e=>r.findIndex(t=>t.includes(e))).filter(e=>e>-1);return i.length?n+Math.min(...i):e.length},d.getLastIndexPriorTo=(e,t,n)=>e.slice(0,n).map(e=>e.includes(t)).lastIndexOf(!0),d.includesAny=(e,t)=>{for(let n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1},d.isVersionLine=e=>/^o=/.test(e),d.getVersionLine=e=>e.find(d.isVersionLine),d.getVersion=e=>{const t=d.getVersionLine(e);if(void 0===t)return;const n=Number(t.match(/ (\d+) IN /)[1]);return Number.isInteger(n)?n:void 0},d.updateVersion=(e,t,n)=>{const r=[...e],i=r.findIndex(e=>d.isVersionLine(e));return r[i]=r[i].replace(` ${t} `,` ${n} `),r},d.isBundleLine=e=>e.includes(d.patterns.bundle),d.getBundleLine=e=>e.find(d.isBundleLine),d.createBundleLine=e=>`${d.patterns.bundle} ${e.join(" ")}`,d.updateBundleLine=(e,t)=>{const n=[...e],r=d.createBundleLine(t),i=n.findIndex(e=>d.isBundleLine(e));return n[i]=r,n},d.parseMLine=e=>{const t=e.match(/^(m=(?:audio|video)) (\d+) (.+)/),n=t[1];return{port:t[2],transport:t[3],mediaType:n}},d.disableTrack=e=>{const t=d.parseMLine(e);return`${t.mediaType} 0 ${t.transport}`},d.setMediaDirection=(e,t)=>{if(!Object.values(d.mediaDirections).includes(t))return e;const n=e.slice(),r=n.findIndex(e=>d.includesAny(e,d.patterns.direction));return-1===r||(n[r]="a="+t),n},d.disableTrackSection=e=>{const t=e.mid,n=e.sdp;let r=n.filter(e=>{const t=d.patterns,n=t.address,r=t.rtcp,i=t.rsize,o=t.ssrc,s=t.msid;return!d.includesAny(e,[n,r,i,o,s])});return r[0]=d.disableTrack(n[0]),r=d.setMediaDirection(r,d.mediaDirections.INACTIVE),{mid:t,sdp:r}},d.getEnabledTracks=e=>d.getBundleLine(e).match(new RegExp(`^${d.patterns.bundle} (.+)$`))[1].split(" "),d.getDisabledTracks=(e,t)=>e.filter(e=>!t.includes(e)),d.getTrackSection=(e,t)=>{const n=e.findIndex(e=>e.includes("a=mid:"+t)),r=t.includes("a")?"audio":"video",i=d.getLastIndexPriorTo(e,"m="+r,n),o=d.getIndexStartingWith(e,["m=audio","m=video"],n),s=e.slice(i,o);return{mid:t,sdp:s}},d.getHeaders=e=>{const t=e.findIndex(e=>e.includes("m=audio")||e.includes("m=video"));return e.slice(0,t)},d.disableTracks=(e,t)=>e.map(e=>t.includes(e.mid)?d.disableTrackSection(e):e),d.getSDPLines=e=>e.split("\r\n").filter(e=>e),d.getTrackMids=e=>e.filter(e=>e.match(new RegExp("^a=mid:\\d+"))).map(e=>e.substring("a=mid:".length)),d.getTrackSections=e=>d.getTrackMids(e).map(t=>d.getTrackSection(e,t)),d.parseMantisSDP=e=>{const t=d.getSDPLines(e),n=d.changeSetupRole(t,"actpass","passive");return d.parseSDP(n)},d.parseSDP=e=>{const t=Array.isArray(e)?e:d.getSDPLines(e);return{bundle:d.getBundleLine(t),headers:d.getHeaders(t),version:d.getVersion(t),tracks:d.getEnabledTracks(t),trackSections:d.getTrackSections(t)}},d.createSDP=(e,t)=>{const n=[...e];return t.forEach(e=>n.push(...e.sdp)),n.push(""),n.join("\r\n")},d.removePayloadTypeFromSection=(e,t)=>e.filter(e=>!e.includes(`a=rtpmap:${t} `)&&!e.includes(`a=fmtp:${t} `)&&!e.includes(`a=rtcp-fb:${t} `)),d.getRtxPayloadType=(e,t)=>{const n=e.filter(e=>e.includes("apt="+t))[0];return null==n?void 0:n.match(/^a=fmtp:(\d+) /)[1]},d.removeRtxPayloadTypeFromSection=(e,t)=>{let n=[...e];const r=d.getRtxPayloadType(n,t);return r&&(n=d.removePayloadTypeFromSection(n,r)),n},d.trimUnusedCodecs=(e,t)=>{const n=e[0].split(" "),r=n.slice(3),i=n.slice(0,3),o=d.getCodecsFromSection(e);let s=[...e],a=[];r.forEach(e=>{const n=o.codecMap[e];if(t.includes(n)){a.push(e);const t=d.getRtxPayloadType(s,e);t&&a.push(t)}else s=d.removePayloadTypeFromSection(s,e),s=d.removeRtxPayloadTypeFromSection(s,e)});const c=a.length?a:[0];return s[0]=[...i,...c].join(" "),s},d.removeUnusedCodecs=(e,t)=>{if(!t)return e;const n=d.parseSDP(e),r=n.headers,i=n.trackSections,o=d.parseSDP(t).trackSections,s=i.map(e=>{const t=e.mid,n=e.sdp,r=o.find(e=>e.mid===t);if(!r)return n;const i=Object.values(d.getCodecsFromSection(r.sdp).codecMap);return d.trimUnusedCodecs(n,i)}),a=[...r];return s.forEach(e=>a.push(...e)),a.push(""),a.join("\r\n")},d.updateSDPWithNewOffer=(e,t)=>{const n=e.headers,r=e.version,i=e.tracks,o=e.trackSections,s=d.getSDPLines(t),a={};a.version=d.getVersion(s),a.headers=d.updateVersion(n,r,a.version),a.tracks=d.getEnabledTracks(s);const c=d.getDisabledTracks(i,a.tracks);return a.headers=d.updateBundleLine(a.headers,a.tracks),a.trackSections=d.disableTracks(o,c),a}},function(e,t,n){var r=n(39),i=n(363),o=n(364),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(177),i=n(116),o=n(25);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(43);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(55),i=n(198),o=n(127),s=n(199),a=n(200);(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(2)(n(45));const i=n(206),o=n(56),s=n(482),a=n(529),c=n(1)("StaticConfig"),u=n(100).prependProxyToUrlIfNeeded,l=o({version:"v2.25.2",buildHash:"a57837c42",minimumVersion:{firefox:52,chrome:49},debug:!1,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"}),d=s(["apiURL","assetURL","cdnURL","sessionInfoOverrides","loggingURL"]),h={apiUrl:"apiURL",loggingUrl:"loggingURL"},p=a(e=>h[e]);e.exports=function(e){let n=(void 0===e?{}:e).axios,s=void 0===n?i:n;return function(){function e(e){Object.defineProperty(this,"config",{value:Object.freeze(o(e))})}return e.onlyLocal=function(){const t=o((void 0!==typeof window?window:global).OTProperties);return new e(Object.assign({},l,d(t)))},e.get=function(n){let r=n.partnerId,i=n.token,a=n.useIpWhitelistConfigUrl,h=n.proxyUrl;return(()=>{const e=this.onlyLocal();if(!e.configUrl)return t.resolve({});if(!0===a&&!e.ipWhitelistConfigUrl)return t.resolve({});let n=!0===a?e.ipWhitelistConfigUrl:e.configUrl;return n=u(n,h),s.get(`${n}/project/${r}/config.json`,{headers:{"X-TB-TOKEN-AUTH":i}}).then(e=>e.data)})().catch(e=>(c.error("could not reach live config service",e),{})).then(t=>{const n=o((void 0!==typeof window?window:global).OTProperties);return new e(Object.assign({},l,d(n),p(t)))})},(0,r.default)(e,[{key:"configUrl",get:function(){return this.config.configURL}},{key:"ipWhitelistConfigUrl",get:function(){return this.config.ipWhitelistConfigURL}},{key:"apiUrl",get:function(){return this.config.apiURL}},{key:"loggingUrl",get:function(){return this.config.loggingURL}},{key:"apiEnabled",get:function(){return void 0===this.config.apiEnabled||this.config.apiEnabled}},{key:"version",get:function(){return this.config.version}},{key:"clientVersion",get:function(){return"js-"+(this.version||"unknown").replace("v","")}},{key:"buildHash",get:function(){return this.config.buildHash}},{key:"minimumVersion",get:function(){return this.config.minimumVersion}},{key:"websiteUrl",get:function(){return this.config.websiteURL}},{key:"debug",get:function(){return"true"===this.config.debug||!0===this.config.debug}},{key:"sessionInfoOverrides",get:function(){return this.config.sessionInfoOverrides}},{key:"cdnUrl",get:function(){return this.config.cdnURL||`${(void 0!==typeof window?window:global).location.protocol}//${(void 0!==typeof window?window:global).location.host}`}},{key:"assetUrl",get:function(){return this.config.assetURL||`${this.cdnUrl}/webrtc/${this.version}`}}]),e}()}}).call(this,n(0))},function(e,t,n){var r=n(508),i=n(514),o=n(88),s=n(12),a=n(519);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},function(e,t,n){"use strict";const r=n(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(77);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(362),i=n(367);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(14).Symbol;e.exports=r},function(e,t,n){var r=n(83),i=n(62);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(391),i=n(111),o=n(392),s=n(185),a=n(186),c=n(29),u=n(174),l=u(r),d=u(i),h=u(o),p=u(s),f=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 p:return"[object Set]";case f: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&&p())}function p(){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 f(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 f(e,t)),1!==u.length||l||a(p)},f.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(410)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(424)()?n(91).Symbol:n(427)},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(69);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(526),i=n(140)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},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=(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(592);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";const r=n(50),i=n(34)();t.check=function(e){void 0===e&&(e={});const t=e.env||n(3),r=e.hasGetUserMediaCapability||n(600),o=e.hasPeerConnectionCapability||n(601),s=e.logging||n(1)("hasOpenTokSupport"),a=((e.staticConfig||i.onlyLocal()).minimumVersion||{})[t.name.toLowerCase()];return a&&a>t.version?(s.debug("Support for",t.name,"is disabled because we require",a,"but this is",t.version),!1):"Node"===t.name||r()&&o()},t.once=r(()=>t.check())},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(177),i=n(386),o=n(25);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){var r=n(77);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(98);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){var r=n(12),i=n(139),o=n(235),s=n(59);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(516);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(615)(n(272));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(175);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(381),i=n(17),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(14),i=n(382),o=t&&!t.nodeType&&t,s=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||i;e.exports=c}).call(this,n(84)(e))},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){var r=n(29),i=n(17);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(2),i=r(n(4)),o=r(n(5));const s=n(154),a=n(49),c=n(9),u=n(56),l=n(129),d=n(271),h=n(15),p=n(6),f=n(249),m=n(155),g=n(28),b=n(72),y=n(618);e.exports=function(e){void 0===e&&(e={});const r=e.hasValidPeerConnection||n(619),v=e.applySdpTransform||n(156),w=e.createPeerConnection||n(620),S=e.env||n(3),E=e.sdpTransformDefaults||n(622),T=e.getStatsAdapter||n(274),x=e.getRtcStatsReportAdapter||n(277),_=e.getSynchronizationSources||n(626),C=e.IceCandidateProcessor||n(627),I=e.logging||n(1),R=e.offerProcessor||n(629),k=e.PeerConnectionChannels||n(631),O=e.subscribeProcessor||n(633),Z=n(634),A=e.changeMediaDirection||n(636),V=A.changeMediaDirectionToInactive,G=A.changeMediaDirectionToRecvOnly,N=e.Qos||n(278).default,L=e.global||(void 0!==typeof window?window:global),W=e.debounce||n(640),X=e.needsToSwapH264Profiles||n(642).once,M=e.NativeRTCIceCandidate||L.RTCIceCandidate,F=e.NativeRTCSessionDescription||L.RTCSessionDescription,P=e.Errors||n(7),j=e.OTErrorClass||n(22),U=e.ExceptionCodes||n(10),D=e.hasPictureInPictureBug||n(643),H=()=>{};return function(e){void 0===e&&(e={});let n=!1;const A=e,Y=A.iceConfig,B=void 0===Y?{servers:[]}:Y,J=A.sendMessage,K=A.isPublisher,z=A.offerOverrides,Q=A.answerOverrides,q=A.p2p,$=A.codecFlags,ee=A.sourceStreamId,te=A.keyStore,ne=A.sFrameClientStore,re=A.isE2ee,ie=A.removeUnusedCodecs;let oe,se=e,ae=se.logAnalyticsEvent,ce=void 0===ae?H:ae,ue=se.remoteConnectionId,le=!1;const de=X();let he,pe,fe,me,ge=0,be=!1;const ye=new Z(ce),ve=m();function we(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")}}J(e,t)}const Se=a();ce("createPeerConnection","Attempt");const Ee={};Ee.id=h();const Te=I("PeerConnection:"+Ee.id);Te.debug("construct",{id:Ee.id,options:e});const xe=E,_e=e=>"relay"===B.transportPolicy&&null!=e&&-1===e.candidate.indexOf("typ relay"),Ce=d(e,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage"]);let Ie,Re,ke,Oe,Ze,Ae=[];const Ve=(()=>{let e=Ce.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&Ce.capableSimulcastStreams>1;n!==e&&void 0===Ce.overrideSimulcastEnabled&&(e=n,Ee.generateOfferAndSend())}}})(),Ge=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e&&(Ee.iceConnectionStateIsConnected()?Te.debug("iceRestart is going to wait until we disconnect or negotiationNeeded and then restart ice"):Ee.generateOfferAndSend()))}}})(),Ne={clean(){delete this.promise,delete this.resolve,delete this.reject}};Ne.promise=new t((e,t)=>{Ne.resolve=e,Ne.reject=t});let Le=new C,We="new";Object.defineProperty(Ee,"signalingState",{get:()=>Ie.signalingState,set:e=>(Ie.signalingState=e,e)}),p(Ee),Ee.addOptions=e=>{ue=e.remoteConnectionId,ce=e.logAnalyticsEvent},Ee.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 pe=e.sent,e.next=8,te.get();case 8:return n=e.sent,e.next=11,pe.setSenderEncryptionKey(n);case 11:me=e=>{pe.setSenderEncryptionKey(e)},te.on("keyChanged",me),Ie.getTransceivers().forEach(e=>pe.encrypt(e.mid,e.sender));case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ee.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()-Se,10),hasRelayCandidates:n,proxyInfo:""},Ie&&Ie.proxyInfo&&(t.proxyInfo=Ie.proxyInfo),ce("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),Ne.resolve();const Xe=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(ue),he=ne.getReceiver(fe),he){e.next=14;break}return e.next=8,ne.createReceiver(fe);case 8:he=e.sent,he.addReceiver(fe),he.setReceiverEncryptionKey(fe,t),te.on("keyChanged",e=>{he.setReceiverEncryptionKey(fe,e)}),he.addEventListener("decryptFailed",()=>{Ee.trigger("decryptFailed")}),he.addEventListener("decryptionRestored",()=>{Ee.trigger("decryptRestored")});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=e=>{if(Te.debug("internalCreatePeerConnection: called"),Ie)return Te.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,Ie);if(Ae.push(e),!(Ae.length>1)){if(Te.debug(`Creating peer connection config "${JSON.stringify(Ce)}".`),0===B.servers.length&&(Te.error("No ice servers present"),ce("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)}Ce.iceTransportPolicy=B.transportPolicy,Ce.iceServers=B.servers,re&&(Ce.forceEncodedVideoInsertableStreams=!0,Ce.forceEncodedAudioInsertableStreams=!0,Ce.encodedInsertableStreams=!0),r(L.RTCPeerConnection).then(e=>{if(!e)throw Te.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return w({window:L,config:Ce})}).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(K||!re){e.next=3;break}return e.next=3,Xe();case 3:Fe(null,t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>Fe(e))}},Fe=(e,t)=>{if(e)return Je({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(Ae=[]);Te.debug("OT attachEventsToPeerConnection"),Ie=t,Le&&Le.setPeerConnection(t),Re=new k(Ie),Ce.channels&&Re.addMany(Ce.channels);const n=(e=>{let t=e.sendMessage,n=e.logging;const r={};return e=>{e.candidate?(r[e.candidate.sdpMid]=e.candidate.sdpMLineIndex,t("candidate",{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid||"",sdpMLineIndex:e.candidate.sdpMLineIndex||0})):n.debug("IceCandidateForwarder: No more ICE candidates.")}})({sendMessage:we,logging:Te}),r=e=>{Ne.resolve(),_e(e.candidate)?Te.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:He(t),!K&&he&&he.decrypt(t.transceiver.mid,t.receiver);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let a=Ie.iceConnectionState;const c=e=>{Ie?(Te.debug("iceconnectionstatechange",Ie.iceConnectionState),"connected"===Ie.iceConnectionState?("disconnected"===a&&Ee.clearFailedTimeout(),Ee.emit("iceConnected"),Ge.set(!1)):"completed"===Ie.iceConnectionState&&S.isLegacyEdge&&setTimeout(()=>Qe.startCollecting(Ie),1e3)):Te.debug("iceconnectionstatechange on peerConnection that no longer exists",Ee);const t=e.target.iceConnectionState;Ee.trigger("iceConnectionStateChange",t),ce("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(Ge.get()?(Te.debug("Restarting ice!"),Ee.generateOfferAndSend()):b()||(Ze=setTimeout(()=>{ce("attachEventsToPeerConnection","iceconnectionstatechange","failed"),a="failed",Ee.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==a&&"failed"===t&&Je({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=()=>{ce("peerConnection:negotiationNeeded","Event"),K&&Ee.generateOfferAndSend(),Ee.trigger("negotiationNeeded")};Ie.addEventListener("track",s),Ie.addEventListener("icecandidate",r),Ie.addEventListener("signalingstatechange",Ue),Ie.addEventListener("negotiationneeded",u),Ie.addEventListener("iceconnectionstatechange",c),ve.add(()=>{Ie&&(Ie.removeEventListener("track",s),Ie.removeEventListener("icecandidate",r),Ie.removeEventListener("signalingstatechange",Ue),Ie.removeEventListener("negotiationneeded",u),Ie.removeEventListener("iceconnectionstatechange",c))}),Pe(null)},Pe=()=>{for(;Ae.length;)Ae.shift().call(null)},je=()=>{Le&&(Le.destroy(),Le=null),Ae=[],Qe.stopCollecting(),ve.releaseAll(),Ne.clean(),null!==Ie&&(Ie.destroy&&Ie.destroy(),Ie=null,Ee.trigger("close")),Ee.off()},Ue=e=>{const t=e.target.signalingState;if(Ee.emit("signalingStateChange",t),"stable"===t&&Ee.emit("signalingStateStable"),t&&t!==We)switch(We=t,Te.debug("stateChange: "+We),We){case"closed":je()}},De=()=>{let e;if(Ie.getRemoteStreams)e=Ie.getRemoteStreams();else{if(!Ie.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=Ie.remoteStreams}return Array.prototype.slice.call(e)},He=e=>{var t;const n=e.track,r=e.transceiver,i=e.stream||(null==(t=e.streams)?void 0:t[0]);ce("createPeerConnection","TrackAdded"),Ee.trigger("trackAdded",{stream:i,track:n,transceiver:r})},Ye=(e,t,n)=>{le=!1,Je({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Be=e=>{if(le)return void(oe=e);le=!0,ce("peerConnection:processOffer","Event");const t=new F({type:"offer",sdp:e.content.sdp}),n=e=>{le=!1,Le&&Le.process(),we("answer",e),S.isLegacyEdge||Qe.startCollecting(Ie,K),oe&&(Be(oe),oe=null)},r=e=>Ee.trigger("remoteVideoSupported",e);Me(()=>{R(Ie,L.RTCPeerConnection,L.RTCSessionDescription,F,xe,t,$,q,n,Ye,r,de,ee)})};Ee.generateOfferAndSend=()=>{Ee.generateOffer(e=>{Te.debug("processSubscribe: sending offer"),we("offer",e)})},Ee.generateOfferAndAnswer=e=>{Ee.generateOffer(t=>{e(t)})},Ee.generateOffer=W((function(e){void 0===e&&(e=()=>{}),ye.enqueueOfferAnswer(()=>(e=>{var t,n;if("closed"===(null==(t=Ie)||null==(n=t.signalingState)?void 0:n.toLowerCase()))return;ce("peerConnection:processSubscribe","Event"),Te.debug("processSubscribe: Sending offer to subscriber.");let r=Ve.get()?Ce.capableSimulcastStreams:1;"P2P"===ee&&!q&&(r=1),Me(()=>{O({peerConnection:Ie,NativeRTCSessionDescription:F,sdpTransforms:xe,numSimulcastStreams:r,removeVideoOrientation:D(),offerOverrides:z,offerConstraints:{iceRestart:Ge.get()},replaceBaselineProfile:de,removeUnusedCodecs:ie}).then(t=>{Te.debug("processSubscribe: got offer, waiting for _readyToCompleteOffer"),ke=t,Ne.promise.then(()=>e(ke))},e=>{Je({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),Ge.set(!1)})})(e))}),100);const Je=e=>{let t=e.reason,n=e.prefix;Te.error(t,"in state",Ie?{connectionState:Ie.connectionState,iceConnectionState:Ie.iceConnectionState,iceGatheringState:Ie.iceGatheringState,signalingState:Ie.signalingState}:"(none)"),Ee.trigger("error",{reason:t,prefix:n})};function Ke(e){this.track=e}Ee.addTrack=(e,n)=>{const r=new t((e,t)=>{Me(n=>{if(n)return t(n);e()})}).then(()=>{if(Ie.addTrack)return Ie.addTrack(e,n);const t=Ie.getLocalStreams()[0];if(void 0===t)throw new Error("PeerConnection has no existing streams, cannot addTrack");t.addTrack(e),Ee.generateOfferAndSend()}).then(()=>new t(e=>{Ee.once("signalingStateStable",()=>{e()})}));return s(r,15e3,"Renegotiation timed out")},Ee.setIceConfig=e=>{try{S.isFirefox&&(e.certificates=Ie.getConfiguration().certificates),Ie.setConfiguration(e)}catch(e){throw new f("A peer connection failed to set configuration with "+e.message,P.FAILED_SET_CONFIGURATION)}return Ge.set(!0),Ie},Ee.removeTrack=e=>{const n=t.resolve().then(()=>e instanceof Ke?(Ie.getLocalStreams()[0].removeTrack(e.track),void Ee.generateOfferAndSend()):Ie.removeTrack(e)).then(()=>new t(e=>{Ee.once("signalingStateStable",()=>{e()})}));return s(n,15e3,"Renegotiation timed out")},Ee.addLocalStream=e=>new t((t,n)=>{Me(r=>{if(r)n(r);else{try{e.getTracks&&e.getTracks().forEach(t=>Ie.addTrack(t,e))}catch(e){return void n(e)}t()}})}),Ee.getLocalStreams=()=>Ie.getLocalStreams(),Ee.getSenders=()=>Ie.getSenders?Ie.getSenders():Ie.getLocalStreams()[0].getTracks().map(e=>new Ke(e)),Ee.disconnect=()=>{var e;Le&&(Le.destroy(),Le=null),null!=(e=Ie)&&e.signalingState&&"closed"!==Ie.signalingState.toLowerCase()&&(Ie.close(),"function"==typeof me&&te.off("keyChanged",me),pe=null,fe=null,setTimeout(je))},Ee.iceRestart=()=>Ge.set(!0),Ee.clearFailedTimeout=()=>clearTimeout(Ze);const ze=e=>{const n=e?V:G;return new t(e=>{ye.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(Ie);case 2:ye.setResolved(),e();case 4:case"end":return t.stop()}}),t)}))))})};Ee.changeMediaDirectionToRecvOnly=()=>ze(!1),Ee.changeMediaDirectionToInactive=()=>ze(!0),Ee.processMessage=(e,t)=>{switch(Te.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),Te.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Ve.set(t.content.simulcastEnabled),Ee.generateOfferAndSend(),r();break;case"offer":Be(t),r();break;case"answer":case"pranswer":(e=>{ce("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."),Je({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Oe=new F({type:"answer",sdp:v(xe,"remote","answer",c({replaceBaselineProfile:de},Q),e.content.sdp).local}),Ie.setRemoteDescription(Oe).then(()=>{Te.debug("processAnswer: setRemoteDescription Success"),Le&&Le.process()}).catch(t),ye.setResolved(),S.isLegacyEdge||Qe.startCollecting(Ie,K)):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new M(t.content);if(_e(n))return Te.debug("Ignore candidate",n.candidate),Ee;Le&&Le.addIceCandidate(n).catch(e=>{Te.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:Te.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function r(){ge+=1,Qe.handleOfferMessageReceived(),ge>1&&(ce("Renegotiation","Attempt"),be=!0)}return Ee};Ee.stopTransceivers=e=>{(e=>e.sort((e,t)=>e.mid<t.mid?1:e.mid>t.mid?-1:0))(Ie.getTransceivers().filter(t=>e.includes(t.mid))).forEach(e=>e.stop())},Ee.remoteStreams=()=>Ie?De():[],Ee.remoteTracks=()=>Ie?Ie.getReceivers?Array.prototype.slice.apply(Ie.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],De().map(e=>e.getTracks())):[],Ee.remoteDescription=()=>Ie.remoteDescription,Ee.getStats=e=>{if(Ie)T(Ie,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new f(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},Ee.getRtcStatsReport=e=>{if(Ie)x(Ie,e);else{const t=U.PEER_CONNECTION_NOT_CONNECTED;e(new f(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},Ee.getSynchronizationSources=e=>{if(!K){if(!Ie){const t=U.PEER_CONNECTION_NOT_CONNECTED;return void e(new f(j.getTitleByCode(t),P.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}_(Ie,e)}};Ee.getDataChannel=(e,t,n)=>{Ie?function e(t,n,r,i){let o;const s=Re.get(n,r);if(!s){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new f(`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 f("Cannot create a DataChannel before there is a connection."))},Ee.getSourceStreamId=()=>ee,Ee.iceConnectionStateIsConnected=()=>Ie&&["connected","completed"].indexOf(Ie.iceConnectionState)>-1,Ee.findAndReplaceTrack=(e,n)=>t.resolve().then(()=>{const r=Ie.getSenders().filter(t=>t.track===e)[0];if(!r)return t.resolve();if("function"!=typeof r.replaceTrack)throw new Error("Sender does not support replaceTrack");return r.replaceTrack(n)}),Ee.hasRelayCandidates=()=>n,Ee.getNegotiatedCodecs=()=>{if(!Ie.localDescription||!Ie.remoteDescription)return null;const e=e=>l(g.getCodecs(Ie.localDescription.sdp,e),g.getCodecs(Ie.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},Ee.on("signalingStateStable",()=>{be&&(be=!1,ce("Renegotiation","Success",Ee.getNegotiatedCodecs()))}),Ee.on("error",e=>{let t=e.prefix;be&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(be=!1,ce("Renegotiation","Failure"))}),Ee.on("close",()=>{be&&(be=!1,ce("Renegotiation","Cancel"))});const Qe=new N;return Qe.on("stats",e=>{e.dataChannels=Re.sampleQos(),Ee.trigger("qos",{parsedStats:e,simulcastEnabled:Ve.get()})}),Ee}}}).call(this,n(0))},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";t.__esModule=!0,t.MEDIUM=t.LOW=t.CongestionLevels=t.CRITICAL=void 0;t.CRITICAL=2;t.MEDIUM=1;t.LOW=0;const r={CRITICAL:2,MEDIUM:1,LOW:0};t.CongestionLevels=r},function(e,t,n){"use strict";const r=n(47),i=n(670),o=n(11),s=n(157),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 p={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=>p.isVideoStat(t,e)).filter(e=>p.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=p.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=p},function(e,t,n){"use strict";t.__esModule=!0,t.messages=t.codes=void 0;t.messages={1e3:"The connection successfully completed the purpose for which it was created.",1001:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.",1002:"The endpoint is terminating the connection due to a protocol error. (CLOSE_PROTOCOL_ERROR)",1003:"The connection is being terminated because the endpoint has indicated that reconnections are not available. (CLOSE_UNSUPPORTED)",1005:"Indicates that no status code was provided even though one was expected. (CLOSE_NO_STATUS)",1006:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)",1007:"Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message)",1008:"Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy",1009:"Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process (CLOSE_TOO_LARGE)",1011:"Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request",4001:"Connectivity loss was detected as it was too long since the socket received the last PONG message",4010:"Timed out while waiting for the Rumor socket to connect.",4020:"Error code unavailable.",4030:"Exception was thrown during Rumor connection, possibly because of a blocked port."};t.codes={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,CLOSE_INCONSISTENT_DATA:1007,CLOSE_POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,CLOSE_UNEXPECTED_CONDITION:1011,CLOSE_CONNECTIVITY_LOSS:4001,CLOSE_TIMEOUT:4010,CLOSE_FALLBACK_CODE:4020,CLOSE_CONNECT_EXCEPTION:4030,ALREADY_CONNECTED_CONNECTING:null}},function(e,t,n){var r=n(78),i=n(113),o=n(83),s=n(176),a=n(385),c=n(179),u=n(54),l=n(388),d=n(390),h=n(182),p=n(184),f=n(41),m=n(393),g=n(394),b=n(189),y=n(12),v=n(64),w=n(398),S=n(11),E=n(400),T=n(30),x=n(53),_={};_["[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,k){var O,Z=1&n,A=2&n,V=4&n;if(C&&(O=R?C(t,I,R,k):C(t)),void 0!==O)return O;if(!S(t))return t;var G=y(t);if(G){if(O=m(t),!Z)return u(t,O)}else{var N=f(t),L="[object Function]"==N||"[object GeneratorFunction]"==N;if(v(t))return c(t,Z);if("[object Object]"==N||"[object Arguments]"==N||L&&!R){if(O=A||L?{}:b(t),!Z)return A?d(t,a(O,t)):l(t,s(O,t))}else{if(!_[N])return R?t:{};O=g(t,N,Z)}}k||(k=new r);var W=k.get(t);if(W)return W;k.set(t,O),E(t)?t.forEach((function(r){O.add(e(r,n,C,r,t,k))})):w(t)&&t.forEach((function(r,i){O.set(i,e(r,n,C,i,t,k))}));var X=G?void 0:(V?A?p:h:A?x:T)(t);return i(X||t,(function(r,i){X&&(r=t[i=r]),o(O,i,e(r,n,C,i,t,k))})),O}},function(e,t,n){var r=n(79),i=n(357),o=n(358),s=n(359),a=n(360),c=n(361);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(352),i=n(353),o=n(354),s=n(355),a=n(356);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(52);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(38)(Object,"create");e.exports=r},function(e,t,n){var r=n(376);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(62),i=n(52),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(383),i=n(66),o=n(115),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(11),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(88),i=n(192),o=n(123);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(425)()?globalThis:n(426)},function(e,t,n){var r=n(112),i=n(458),o=n(459);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(460);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(86),i=n(11);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),o=e.apply(n,t);return i(o)?o:n}}},function(e,t,n){var r=n(501);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(58),i=n(46);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(238),i=n(30);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";const r=n(239),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(20),l=n(70),d=new t,h=r.sessions.length()>0,p=r.publishers.length()>0;let f;if(h){const e=r.sessions.find(e=>"connected"===e.currentState);f=e?e.sessionId:r.sessions.find().sessionId}else f="";const m={sessionId:f,apiKey:l.value};if(p||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,n){"use strict";e.exports=function(e){let t=null,n=!1;const r=()=>{n&&(e(),t=window.requestAnimationFrame(r))};this.start=()=>{n||(n=!0,window.requestAnimationFrame(r))},this.stop=()=>{window.cancelAnimationFrame(t),n=!1}}},function(e,t,n){"use strict";const r=n(9);e.exports=(e,t)=>{const n={};Object.keys(t).forEach(r=>{n[r]=((e,t,n)=>t&&!n?()=>t.call(e):t&&n?r=>(void 0!==r&&n.call(e,r),t.call(e)):t=>{void 0!==t&&n.call(e,t)})(e,t[r].get,t[r].set)}),r(e,n)}},function(e,t,n){"use strict";let r="";e.exports={getCurrentAudioOutputDeviceId:()=>r,setCurrentAudioOutputDeviceId:e=>{r=e}}},function(e,t,n){"use strict";(function(t){e.exports=function(e){return new t(t=>setTimeout(t,e))}}).call(this,n(0))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={ACTIVE_VIDEO:0,ACTIVE_VIDEO_WITH_WARNING:1,SUSPENDED_VIDEO:2};t.default=r},function(e,t,n){"use strict";const r=n(294);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=!!window.RTCRtpSender.prototype.createEncodedStreams||!!window.RTCRtpSender.prototype.createdEncodedVideoStreams,o=!!window.Worker,s=()=>r&&i&&o;e.exports=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||n(51).once,r=e.isE2eeSupported||s;return t()&&r()}},function(e,t,n){var r=n(38)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(368),i=n(375),o=n(377),s=n(378),a=n(379);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(173),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a}).call(this,n(84)(e))},function(e,t,n){var r=n(67),i=n(384),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(389),i=n(180),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(178)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(187);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(405),i=n(193)(r);e.exports=i},function(e,t,n){var r=n(52),i=n(25),o=n(65),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(195)()?Object.setPrototypeOf:n(196)},function(e,t,n){"use strict";var r=n(55),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(416)()?Object.assign:n(417)},function(e,t,n){"use strict";const r=n(1)("Event"),i=n(9),o=n(129);e.exports=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={}),this.type=e,this.cancelable=t,this._defaultPrevented=!1;const r=o(Object.keys(this),Object.keys(n));if(r.length>0)throw new Error("Cannot used reserved property names: "+r.join(","));i(this,n)}var t=e.prototype;return t.preventDefault=function(){this.cancelable?this._defaultPrevented=!0:r.warn("Event.preventDefault :: Trying to preventDefault on an event that isn't cancelable")},t.isDefaultPrevented=function(){return this._defaultPrevented},e}()},function(e,t,n){var r=n(33),i=n(457),o=n(87),s=n(463),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(17);e.exports=function(e){return i(e)&&r(e)}},function(e,t,n){"use strict";(function(t){var r=n(19),i=n(469),o=n(209),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(210)),c),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)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(s)})),e.exports=u}).call(this,n(42))},function(e,t){e.exports={}},function(e,t,n){var r=n(216),i=n(487),o=n(488),s=n(218),a=n(499),c=n(222),u=n(500),l=n(225),d=n(226),h=n(96),p=Math.max;e.exports=function(e,t,n,f,m,g,b,y){var v=2&t;if(!v&&"function"!=typeof e)throw new TypeError("Expected a function");var w=f?f.length:0;if(w||(t&=-97,f=m=void 0),b=void 0===b?b:p(h(b),0),y=void 0===y?y:h(y),w-=m?m.length:0,64&t){var S=f,E=m;f=m=void 0}var T=v?void 0:c(e),x=[e,t,n,f,m,S,E,g,b,y];if(T&&u(x,T),e=x[0],t=x[1],n=x[2],f=x[3],m=x[4],!(y=x[9]=void 0===x[9]?v?0:e.length:p(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,f);else var _=i(e,t,n);return d((T?r:l)(_,x),e,t)}},function(e,t,n){var r=n(86),i=n(136);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&"__lodash_placeholder__"!==s||(e[n]="__lodash_placeholder__",o[i++]=n)}return o}},function(e,t,n){var r=n(29),i=n(119),o=n(17),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(69),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(523),i=n(192),o=n(123);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){var r=n(87),i=n(52),o=n(124),s=n(53),a=Object.prototype,c=a.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n<r;)for(var l=t[n],d=s(l),h=-1,p=d.length;++h<p;){var f=d[h],m=e[f];(void 0===m||i(m,a[f])&&!c.call(e,f))&&(e[f]=l[f])}return e}));e.exports=u},function(e,t,n){"use strict";var r=n(2)(n(45));const i=n(57),o=n(56);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__(565),webrtcAdapter=__webpack_require__(566),logging=__webpack_require__(1)("createWindowMock"),env=__webpack_require__(3),windowKeys=[{key:"location",type:"object"},{key:"setTimeout",type:"function"},{key:"requestAnimationFrame",type:"function"},{key:"URL",type:"function"},{key:"MediaStream",type:"class"},{key:"webkitMediaStream",type:"class"},{key:"RTCIceCandidate",type:"class"},{key:"mozRTCIceCandidate",type:"class"},{key:"RTCSessionDescription",type:"class"},{key:"mozRTCSessionDescription",type:"class"},{key:"RTCIceGatherer",type:"class"},{key:"RTCIceTransport",type:"class"},{key:"RTCDtlsTransport",type:"class"},{key:"RTCSctpTransport",type:"class"},{key:"RTCRtpReceiver",type:"class"},{key:"HTMLMediaElement",type:"class"},{key:"RTCPeerConnection",type:"class"},{key:"webkitRTCPeerConnection",type:"class"},{key:"mozRTCPeerConnection",type:"class"},{key:"MediaStreamTrack",type:"class"},{key:"RTCRtpSender",type:"class"},{key:"RTCTrackEvent",type:"class"},{key:"RTCTransceiver",type:"class"},{key:"RTCDtmfSender",type:"class"},{key:"RTCDTMFSender",type:"class"},{key:"MediaStreamTrackEvent",type:"class"}],navigatorKeys=[{key:"userAgent",type:"string"},{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"webkitGetUserMedia",type:"function"},{key:"mozGetUserMedia",type:"function"}],mediaDevicesKeys=[{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"enumerateDevices",type:"function"},{key:"getSupportedConstraints",type:"function"},{key:"addEventListener",type:"function"},{key:"removeEventListener",type:"function"}],bindWithStaticProperties=(e,t)=>{if("function"!=typeof t)return logging.warn("Non-function passed into bindWithStaticProperties()"),t;const n=t.bind(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n},extendParentClass=ParentClass=>{try{const ChildClass=eval('\n "use strict"; // Chrome<49 requires strict mode\n\n const getOwnProperties = (target) => {\n const properties = {};\n Object.getOwnPropertyNames(target).forEach((key) => {\n properties[key] = Object.getOwnPropertyDescriptor(target, key);\n });\n return properties;\n };\n\n class ChildClass extends ParentClass {\n constructor(...args) {\n super(...args);\n try {\n this.__proto__ = ChildClass.prototype;\n } catch (e) {}\n }\n };\n\n Object.defineProperties(ChildClass.prototype, getOwnProperties(ParentClass.prototype));\n Object.keys(ParentClass)\n .forEach((staticKey) => {\n ChildClass[staticKey] = ParentClass[staticKey];\n });\n\n ChildClass; // Ensure the final statement is returned in FF\n ');if(ChildClass&&ChildClass.prototype instanceof ParentClass)return ChildClass}catch(e){}return null},canUseES6Class=e=>{const t=e.RTCPeerConnection||e.webkitRTCPeerConnection||e.mozRTCPeerConnection,n=extendParentClass(t);if(n)try{n.prototype.foo="bar";const e=new n({iceServers:[]}),t="bar"===e.foo;try{e.close()}catch(e){}return t}catch(e){}return!1},extendClass=(e,t,n)=>{if("function"!=typeof e)return logging.warn("Non-function passed into extendClass()"),e;let r=n&&extendParentClass(e);return r||(r=extendES5Native(e)),r},getCopyProperties=e=>(t,n,r)=>{r.forEach(r=>{let i=r.key,o=r.type,s=n[i];if(void 0!==s){switch(o){case"function":s=bindWithStaticProperties(n,s);break;case"class":s=extendClass(s,i,e);break;case"string":case"object":break;default:throw new Error("Invalid type of window key: "+o)}t[i]=s}})},cloneWindow=e=>{const t={},n=getCopyProperties(canUseES6Class(e));return n(t,e,windowKeys),void 0!==e.navigator&&(t.navigator={},n(t.navigator,e.navigator,navigatorKeys),void 0!==e.navigator.mediaDevices&&(t.navigator.mediaDevices={},n(t.navigator.mediaDevices,e.navigator.mediaDevices,mediaDevicesKeys))),t};module.exports=function(e){if(void 0!==e.adapter||env.isLegacyEdge)return e;const t=cloneWindow(e);return webrtcAdapter({window:t}),t}},function(e,t,n){"use strict";e.exports=function(){let e=null;this.transform=t=>{e=null===e||t>=e?t:.3*t+.7*e;const n=Math.log(e)/Math.LN10/1.5+1;return Math.min(Math.max(n,0),1)}}},function(e,t,n){"use strict";const r=n(6),i=e=>Object.keys(e).map(t=>e[t]),o=n(9);e.exports=function(e){const t={},n=(n,r)=>{o(r,{parent:this}),r.appendTo(e.parent),t[n]=r,this[n]=r};e.parent&&(r(this),this.destroy=()=>{this.off(),this.hideWhileLoading(),i(t).forEach(e=>e.destroy())},this.showAfterLoading=()=>{i(t).forEach(e=>e.showAfterLoading())},this.hideWhileLoading=()=>{i(t).forEach(e=>e.hideWhileLoading())},this.set=(e,t)=>("string"==typeof e&&t?n(e,t):Object.keys(e).forEach(t=>{n(t,e[t])}),this))}},function(e,t,n){"use strict";e.exports=function(){function e(e){this._analyser=null,this._timeDomainData=null,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(577),i=n(26),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(582);
18
+ /*!
19
+ * The buffer module from node.js, for the browser.
20
+ *
21
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
22
+ * @license MIT
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(583),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,p=/\s*function\s+([^\(\s]*)\s*/;function f(e){if(s.isFunction(e)){if(u)return e.name;var t=e.toString().match(p);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=f(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=T(e),d=T(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 E(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=f(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){E(!0,e,t,n)},h.doesNotThrow=function(e,t,n){E(!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 T=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(590),i=n(264),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(267),i=n(6),o=n(1)("StreamChannel"),s=n(151)();e.exports=function(e){this.id=e.id,this.type=e.type,this.active=r(e.active),this.orientation=e.orientation||s.ROTATED_NORMAL,e.frameRate&&(this.frameRate=parseFloat(e.frameRate)),e.preferredFrameRate&&(this.preferredFrameRate=parseFloat(e.preferredFrameRate)),e.preferredWidth&&(this.preferredWidth=parseInt(e.preferredWidth,10)),e.preferredHeight&&(this.preferredHeight=parseInt(e.preferredHeight,10)),this.width=parseInt(e.width,10),this.height=parseInt(e.height,10),this.source=e.source||"camera",this.fitMode=e.fitMode||"cover",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(598),i=n(1)("StylableComponent"),o=n(599),s=n(268);e.exports=function(e,t,n,a){if(!e.trigger)throw new Error("OT.StylableComponent is dependent on the eventing mixin. Ensure that this is included in the object before StylableComponent.");a=a||function(){};let c=!1;!1===n&&(t={buttonDisplayMode:"off",nameDisplayMode:"off",audioLevelDisplayMode:"off",videoDisabledDisplayMode:"off",audioBlockedDisplayMode:"off"},c=!0,a({showControls:!1}));const u=new o(t,(function(t,n,r){r?e.trigger("styleValueChanged",t,n,r):e.trigger("styleValueChanged",t,n)}));e.getStyle=function(e){return u.get(e)},e.setStyle=function(e,t,n){if(c)return i.warn("Calling setStyle() has no effect because theshowControls option was set to false"),this;let o;return"string"!=typeof e?o=e:(o={},o[e]=t),o.backgroundImageURI&&(o.backgroundImageURI=r(o.backgroundImageURI)),u.setAll(o,n),a(s(o)),this}}},function(e,t,n){"use strict";const r=n(50),i=n(34)(),o=n(20),s=n(70),a=n(147),c=n(51).once,u=n(602),l=n(8),d=n(1)("systemRequirements"),h=n(603),p=n(604),f=i.onlyLocal(),m=new o,g=r(()=>{m.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:s.value,payload:{userAgent:l.env.userAgent}})}),b=r(()=>{n(605)()});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 f.minimumVersion:n,i=t.userAgent,o=void 0===i?navigator.userAgent:i;a.onLoad(()=>{if(y)return;const e=new p(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(2),i=r(n(48)),o=r(n(606));const s=n(610);let a=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="TimeoutError",n}return(0,i.default)(t,e),t}((0,o.default)(Error));e.exports=(e,n,r)=>new t((t,i)=>{if("number"!=typeof n||n<0)throw new TypeError("Expected `ms` to be a positive number");const o=setTimeout(()=>{if("function"==typeof r){try{t(r())}catch(o){i(o)}return}const o=r instanceof Error?r:new a("string"==typeof r?r:`Promise timed out after ${n} milliseconds`);"function"==typeof e.cancel&&e.cancel(),i(o)},n);s(e.then(t,i),()=>{clearTimeout(o)})}),e.exports.TimeoutError=a}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(){const e=[];return{add(t){e.push(t)},remove(t){const n=e.indexOf(t);n>=0&&e.splice(n,1)},releaseAll(){const t=[];for(;e.length>0;){const n=e.pop();try{n()}catch(e){t.push(e)}}const n=t.length;if(n>0)throw new Error(`Failed to complete ${n} cleanup job${1===n?"":"s"}: ${t.map(e=>`<${e}>`).join(", ")}`)}}}},function(e,t,n){"use strict";const r=n(1)("applySdpTransform");e.exports=(e,t,n,i,o)=>{const s=e[t][n],a=`${t} ${n}`,c=`sdpTransforms (${"local offer"===a||"remote answer"===a?"publisher":"subscriber"}): ${t} ${n}`,u="local"===t?"created":"received";r.debug(`${c}: ${u}:\n${o}`);const 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(2);t.__esModule=!0,t.default=void 0;var i=r(n(57));var o="function"==typeof(0,i.default)(void 0!==typeof window?window:global,"navigator.getDisplayMedia",(0,i.default)(void 0!==typeof window?window:global,"navigator.mediaDevices.getDisplayMedia"));t.default=o},function(e,t,n){"use strict";const r=n(37);e.exports=function(){return function(e,t,n){const i=t.slice(),o=r(n);return function(t){let n=e,r=null;function s(e,i){t({message:e,newState:i,currentState:n,previousState:r})}function a(e){return t=e,-1===i.indexOf(t)?(s(`'${e}' is not a valid state`,e),!1):(a=e,!(!o[r=n]||-1===o[r].indexOf(a))||(s(`'${n}' cannot transition to '${e}'`,e),!1));var t,r,a}this.current=n,this.set=function(e){a(e)&&(r=n,this.current=e,n=e)}}}}},function(e,t,n){"use strict";(function(t){const r=n(60);e.exports=function(e){void 0===e&&(e={});const i=e.chromeExtensionHelper||n(280)(),o=e.electronExtensionHelper||n(648)(),s=e.Errors||n(7),a=e.firefoxExtensionHelper||n(650),c=e.getDisplayMediaExtensionHelper||n(288),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 p=()=>{};return d.getConstraints=e=>{const n=e.onAccessDialogOpened,r=void 0===n?p:n,i=e.onAccessDialogClosed,o=void 0===i?p: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(0))},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 p="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),p)}}},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(2),i=r(n(4)),o=r(n(5)),s=r(n(45));const a=n(6),c=n(675),u=n(1)("WidgetView"),l=n(8),d=n(3),h=n(165),p=h.default,f=h.CancellationError,m=n(166),g=n(677),b=n(678),y=n(679),v=n(680),w=n(681),S=n(61),E=n(682),T=n(109);T();e.exports=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?u:n,h=t.OTHelpers,x=void 0===h?l:h,_=t.waitForVideoToBePlaying,C=void 0===_?b:_,I=t.VideoElementFacade,R=void 0===I?T():I,k=t.env,O=void 0===k?d:k;const Z=c({window:void 0!==typeof window?window:global}),A=e=>{if(e.isCanceled())throw r.debug("bindVideo bailing due to cancellation"),new f("CANCEL")};return function(){function e(e,t){let n=void 0===t?{}:t,i=n.insertDefaultUI,o=void 0===i||i,s=n.width,c=void 0===s?264:s,u=n.height,l=void 0===u?198:u,d=n.fitMode,h=void 0===d?"cover":d,p=n.mirror,f=void 0!==p&&p,m=n.insertMode,g=n.classNames,b=n.style,E=n.widgetType,T=n.initials;this._videoElementFacade=void 0,this._container=void 0,this._posterContainer=document.createElement("div"),this._widgetContainer=document.createElement("div"),this._loading=!0,this._audioOnly=!1,this._showPoster=void 0,this._poster=void 0,this._cancelBind=void 0,this.MAX_VIDEO_LOADED=5e3,a(this),!1===/^(contain|cover)$/.test(h)&&r.warn(`Invalid fit value "${h}" passed. Only "contain" and "cover" can be used.`),this._widgetType=E,this._fitMode=h,this._insertDefaultUI=o;const _=S(this._widgetContainer);if(_.on("click",this.userGesture.bind(this)),_.on("touchstart",this.userGesture.bind(this),!!Z&&{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=v(e,m),O.isSafari&&O.isiOS&&O.iOSVersion&&O.iOSVersion<11.2&&this._container.classList.add("OT_ForceContain"),this._container.style.width=w(c),this._container.style.height=w(l),this._container.style.overflow="hidden",y(this._container),f&&x.addClass(this._container,"OT_mirrored"),g&&g.trim().split(/\s+/).forEach(e=>this._container.classList.add(e)),this._container.classList.add("OT_loading"),this._container.classList.add("OT_fit-mode-"+h),this._container.appendChild(this._widgetContainer);const t=x(this._container).observeSize(()=>y(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);b&&b.backgroundImageURI?this.setBackgroundImageURI(b.backgroundImageURI):T&&this.setInitials(T)}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.setInitials=function(e){const t=E(e),n=(new XMLSerializer).serializeToString(t);x.css(this._posterContainer,"backgroundImage",`url('data:image/svg+xml,${n}')`),x.css(this._posterContainer,"backgroundSize","auto 55%"),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()&&m().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=S(this._videoElementFacade);if(this._videoFacadeEvents=s,s.on("error",()=>{this.trigger("error")}),s.on("videoDimensionsChanged",(e,t)=>{this.trigger("videoDimensionsChanged",e,t)}),s.on("mediaStopped",e=>{this.trigger("mediaStopped",e)}),s.on("audioBlocked",()=>this.trigger("audioBlocked")),s.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this._videoElementFacade.audioChannelType("telephony"),r.debug("Appending the video facade"),this._videoElementFacade.appendTo(this._widgetContainer),void 0!==n)try{this._videoElementFacade.setAudioVolume(n)}catch(e){r.warn("bindVideo "+e)}},t._bindToStream=function(){var e=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._videoElementFacade.bindToStream(t);case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e.catch(0),!n.isCanceled()){e.next=12;break}throw r.debug("Refusing to destroyVideo as bindVideo was cancelled"),new f("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,g(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,p;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(),A(h),p=C(this._videoElementFacade,5e3),e.next=29,this._waitForVideoResolution(t);case 29:return r.debug("Waiting for video to be playing"),e.next=32,p;case 32:r.debug("Video is playing"),A(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(676)),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(0))},function(e,t,n){"use strict";e.exports=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(4)),o=r(n(5)),s=r(n(695)),a=r(n(696)),c=r(n(108)),u=n(74),l=r(n(697));const d=n(57),h=n(148),p=n(9),f=n(56),m=n(60),g=n(275),b=n(47),y=n(50),v=n(700),w=n(15),S=n(258),E=n(194),T=n(165),x=T.CancellationError,_=T.default,C=n(3),I=n(313),R=n(75),k=n(26),O=n(6),Z=n(107),A=n(128),V=n(20),G=n(73),N=n(155),L=n(710),W=n(164)(),X=n(711),M=n(712),F=n(166),P=n(24)().getInputMediaDevices,j=n(713),U=n(269),D=n(311),H=n(714),Y=n(715),B=n(291),J=B.setVideoContentHint,K=B.getVideoContentHint,z=n(167),Q=n(312);e.exports=function(e){void 0===e&&(e={});let r=e,T=(0,a.default)({},((0,s.default)(r),r));["processPubOptions"].forEach(e=>{h(T[e],e+" dependency must be injected into Publisher")});const B=T.AnalyticsHelper||V,q=T.createAudioFallbackCoordinator||l.default,$=T.calculateCapableSimulcastStreams||n(251),ee=T.createChromeMixin||n(281)(),te=T.deviceHelpers||n(24)(),ne=T.EnvironmentLoader||n(147),re=T.Errors||n(7),ie=T.Events||n(23)(),oe=T.ExceptionCodes||n(10),se=T.interpretPeerConnectionError||n(162)(),ae=T.IntervalRunner||G,ce=T.logging||n(1)("Publisher"),ue=T.Microphone||n(292)(),le=T.otError||n(13)(),de=T.OTErrorClass||n(22),he=T.OTHelpers||n(8),pe=T.parseIceServers||n(102).parseIceServers,fe=T.PUBLISH_MAX_DELAY||n(266),me=T.PublisherPeerConnection||n(296)(),ge=T.PublishingState||n(302)(),be=T.StreamChannel||n(150),ye=T.systemRequirements||n(153),ve=T.VideoOrientation||n(151)(),we=T.WidgetView||W,Se=T.global||(void 0!==typeof window?window:global),Ee=T.createSendMethod||n(309),Te=T.MediaProcessor||n(716),xe=n(721),_e=T.shouldLogMediaProcessorEvents||n(722),Ce=n(314),Ie=T.processPubOptions,Re=T.KEEP_SENDING_MEDIA_AFTER_TRANSITIONED||5e3,ke=T.KEEP_SENDING_MEDIA_TO_KEEP_ALIVE||3e3,Oe=T.KEEP_SENDING_RTCP_DELAY||3e4;return function(e){var n=this;void 0===e&&(e={});let r=O({});const s=new E,a=new Q;let l=!1;const h=e=>s.get(e);O(this);const T=N();let V,G,W,Ze=new B;ye.check()||ye.upgrade();const Ae={};let Ve,Ge,Ne,Le,We,Xe,Me,Fe,Pe,je,Ue,De,He,Ye,Be,Je=!1;const Ke={},ze={};let Qe;let qe,$e,et=!1;const tt=()=>this.session||$e||{isConnected:()=>!1},nt=[],rt=new Te;function it(){return{connectionId:tt().isConnected()?tt().connection.connectionId:null,streamId:G,widgetType:"Publisher"}}this.once("publishComplete",e=>{var t;e||(Je=!0,Ue=null!=(t=this.session)&&t.sessionInfo.p2pEnabled?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{Ue=e,a.finishTransitionTo(Ue)}),this.on("audioAcquisitionProblem",e=>{let t=e.method;It("publisher:audioAcquisitionProblem","Event",{didPublishComplete:Je,method:t})});const ot=e=>{const t=Object.keys(re).map(e=>re[e]),n=le(t.indexOf(e.name)>-1?e.name:re.MEDIA_ERR_ABORTED,e,oe.UNABLE_TO_PUBLISH);ce.error(`onStreamAvailableError ${n.name}: ${n.message}`),Ne.set("Failed"),V&&(V.destroy(),V=null);const r={failureReason:"GetUserMedia",failureCode:oe.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};kt("Failure",{},r),de.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ze}),this.trigger("publishComplete",n)},st=e=>{const t=f(e);t.code=oe.UNABLE_TO_PUBLISH,ce.error("OT.Publisher.onScreenSharingError "+t.message),Ne.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),kt("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),V&&(V.destroy(),V=null)},at=e=>{const t=f(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==(void 0!==typeof window?window:global).location.protocol&&(yt?t.message+=" Note: https:// is required for screen sharing.":U()&&"localhost"!==he.env.hostName&&(t.message+=` Note: ${he.env.name} requires HTTPS for camera and microphone access.`)),n&&!yt&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),ce.error(t.message),Ne.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=oe.UNABLE_TO_PUBLISH,V&&(V.destroy(),V=null),kt("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent(new A(k.ACCESS_DENIED))},ct=e=>{e instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(e))||(e=new Error("Unknown error has occurred. Stream is not available."));throw e.name===re.USER_MEDIA_ACCESS_DENIED||e.name===re.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?at(e):Ie.isScreenSharing?st(e):ot(e),e},ut=()=>{It("accessDialog","Opened"),this.dispatchEvent(new A(k.ACCESS_DIALOG_OPENED,!0))},lt=()=>{It("accessDialog","Closed"),this.dispatchEvent(new A(k.ACCESS_DIALOG_CLOSED,!1))},dt=w(),ht={};let pt=!1,ft={},mt=!1,gt=Ie(e,"OT.Publisher",()=>Ne&&Ne.isDestroyed());gt.on({accessDialogOpened:ut,accessDialogClosed:lt});const bt=gt,yt=bt.isScreenSharing,vt=bt.isCustomAudioTrack,wt=bt.isCustomVideoTrack,St=bt.shouldAllowAudio,Et=bt.properties,Tt=bt.getUserMedia;function xt(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const _t=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>xt(e)),r.on("streamChange",()=>{xt(e);const t=W.getAudioTracks().map(e=>_t(e,"ended",()=>{mt=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>xt(e)),r.on("streamChange",()=>{xt(e),Ct()||W.getTracks().forEach(t=>{t.addEventListener&&(e.push(_t(t,"mute",()=>{ln()})),e.push(_t(t,"unmute",()=>{ln()})))})})}();const Ct=()=>{if(yt)return!0;const e=["text","detail"].includes(Et.videoContentHint);return wt&&e},It=e.logAnalyticsEvent||((e,t,n,r,i)=>{let o=p({action:e,variation:t,payload:n},it(),r);"Failure"===t&&(o=p(ft,o)),ft=b(o,"sessionId","connectionId","partnerId"),Ze.logEvent(o,i)}),Rt=()=>{if(!_e(this.session))return void rt.disableLogging();const e=this.session.apiKey;rt.enableLogging(e)},kt=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason&&("Attempt"===e&&(We=(new Date).getTime(),qe&&(qe.stop(),ce.error("_connectivityAttemptPinger should have been cleaned up")),qe=new ae(()=>{It("Publish","Attempting",t,Object.assign({},it(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e?(qe?(qe.stop(),qe=void 0):ce.warn(`Received connectivity event: "${e}" without "Attempt"`),It("Publish",e,Object.assign({videoInputDevices:Me,audioInputDevices:Xe,videoInputDeviceCount:Me?Me.length:void 0,audioInputDeviceCount:Xe?Xe.length:void 0,selectedVideoInputDeviceId:Fe,selectedAudioInputDeviceId:Pe},t),Object.assign({attemptDuration:(new Date).getTime()-We},n))):It("Publish",e,t,n))},Ot=(e,t)=>{It("ICERestart",e,t)},Zt=(e,t,n)=>{"Attempt"===t?(Ke[e]=(new Date).getTime(),It(e,t,n)):"Failure"!==t&&"Success"!==t||It(e,t,n,{attemptDuration:(new Date).getTime()-Ke[e]})},At=function(e,t){void 0===t&&(t={}),Zt("RoutedToRelayedTransition",e,t)},Vt=function(e,t){void 0===t&&(t={}),Zt("RelayedToRoutedTransition",e,t)},Gt=y(()=>{It("GetStats","Called")}),Nt=y(()=>{It("GetRtcStatsReport","Called")}),Lt=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:G,width:V.width,height:V.height,audioTrack:W&&W.getAudioTracks().length>0,hasAudio:un(),publishAudio:Et.publishAudio,videoTrack:W&&W.getVideoTracks().length>0,hasVideo:cn(),publishVideo:Et.publishVideo,audioSource:vt?"Custom":void 0,duration:Ve?Math.round(((new Date).getTime()-Ve.getTime())/1e3):0,remoteConnectionId:i,scalableVideo:r,sourceStreamId:z(s)};let c=(yt&&wt?"Screen":yt&&e.videoSource)||wt&&"Custom"||Et.constraints.video&&"Camera"||null;g(c)&&(c=v(c)),a.videoSource=c;const u={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},l=p({},a,n,u);Ze.logQOS(l),this.trigger("qos",l)},Wt=()=>{var e,t;let n=(null==(e=Et.videoDimensions)?void 0:e.width)||640,r=(null==(t=Et.videoDimensions)?void 0:t.height)||480;if(Et.publishVideo){var i;const e=null==(i=V)?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}},Xt=()=>{Ne.isDestroyed()?V&&V.destroyVideo():(ce.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),Ne.set("MediaBound"),F().catch(ce.error),V.loading(!!this.session&&!this.stream),pt=!0)},Mt=e=>{const t=le(re.CONNECT_FAILED,e,oe.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,kt("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),Ne.set("Failed"),this.trigger("publishComplete",t),de.handleJsException({error:t,target:this,analytics:Ze})},Ft=()=>{W&&(r.emit("streamDestroy"),Se.MediaStreamTrack&&Se.MediaStreamTrack.prototype.stop?W.getTracks().forEach(e=>e.stop()):W.stop())},Pt=()=>{const e=C.isiOS&&C.iOSVersion>=15&&C.iOSVersion<15.2,t=W.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&V&&V.rebindSrcObject()})},jt=()=>{const e=C.isiOS&&C.iOSVersion>=13.3,t=W.getAudioTracks()[0];e&&t&&(t.onmute=()=>Bn(t),t.onunmute=()=>Jn(t))},Ut=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},V){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",V.bindVideo(W,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Dt=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(ce.debug("OT.Publisher.onStreamAvailable"),Ne.set("BindingMedia"),void 0!==Et.videoContentHint&&J(t,Et.videoContentHint),Ft(),W=t,!Et.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(Et.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),ce.error("Error applying video filter: "+e.t0);case 14:r.emit("streamChange"),jt(),Pt(),Fe=(o=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=m(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(W.getVideoTracks(),Me),Pe=o(W.getAudioTracks(),Xe),Ge=new ue(W,!Et.publishAudio),In(),xn(),n.accessAllowed=!0,n.dispatchEvent(new A(k.ACCESS_ALLOWED,!1));case 25:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}(),Ht=e=>{let t,n;ce.error("OT.Publisher.onPublishingTimeout"),mt?(t=re.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=re.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:oe.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};kt("Failure",{},r),de.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ze}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),this.session=null,Ne.isDestroyed()||Ne.set("MediaBound"),this.trigger("publishComplete",le(t,new Error(n),oe.UNABLE_TO_PUBLISH))},Yt=e=>{const t=le(re.MEDIA_ERR_DECODE,e,oe.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,ce.error("OT.Publisher.onVideoError:",t),It("stream",null,{reason:t.message});const n=Ne.isAttemptingToPublish();Ne.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),de.handleJsException({error:t,target:this,analytics:Ze})};this._setWebRTCStream=e=>{W=e},this._setCurrentVideoFilter=e=>{An=e},this._getCurrentVideoFilter=()=>An,this._getMediaProcessor=()=>rt,this._removePeerConnection=e=>{var t;if(!e)return;const n=h(e).peerConnectionId;delete ht[n],e.destroy(),null==(t=Ln)||t.onPeerConnectionDisconnected()},this._removeSubscriber=e=>{this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===Ue&&this._.startRelayedToRoutedTransition(),en(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const Bt=e=>{const t=h(e),n=t.remoteSubscriberId,r=t.peerConnectionId;ce.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),It("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},Jt=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,s,a,c,u,l,d,p,f,m;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&&pt)){e.next=5;break}return ce.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 5:return c=h(t)||{},u=c.remoteConnectionId,l=void 0===u?"(not found)":u,d=c.peerConnectionId,p=se(void 0,o,s,l,"Publisher"),f={hasRelayCandidates:t&&t.hasRelayCandidates()},m={failureReason:s||"PeerConnectionError",failureCode:p.code,failureMessage:p.message},Ne.isPublishing()?m.reason="Non-fatal":n.trigger("publishComplete",p),kt("Failure",f,m),de.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+o,code:p.code,target:n,analytics:Ze}),e.next=14,ht[d];case 14:e.sent.destroy(),delete ht[d];case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Kt=e=>this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===e.getSourceStreamId(),zt=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(),ze[s]=t,"disconnected"===t&&setTimeout(()=>{const e=n.session._.isSocketReconnecting,t=n.session._.getSocket().is("connected")&&!e();if("disconnected"===ze[s]&&t){const e=h(r).remoteConnectionId;Ot("Attempt",{remoteConnectionId:e}),r.iceRestart()}},2e3),"connected"!==t){e.next=14;break}if(clearTimeout(Qe),!o){e.next=14;break}return e.next=9,rn();case 9:return a=e.sent.iceConnectionStateIsConnected(),e.next=12,on();case 12:c=e.sent.iceConnectionStateIsConnected(),a&&c&&mn();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===Ue&&"P2P"===s?n._.startRelayedToRoutedTransition():Qe=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)}}(),Qt=e=>{e.setP2PMaxBitrate(),e.startEncryption(this.session.connection.id),Kt(e)&&At("Success")},qt=n=>{let r=n.peerConnectionId,i=n.send,o=n.log,s=n.logQoS,a=n.sourceStreamId;if(tn(r))return t.reject(new Error("PeerConnection already exists"));const c=$({isChromiumEdge:he.env.isChromiumEdge,browserName:he.env.name,isScreenSharing:yt,isCustomVideoTrack:wt,sessionInfo:this.session.sessionInfo,constraints:Et.constraints,videoDimensions:Wt(),capableSimulcastScreenshare:Et.capableSimulcastScreenshare,scalableVideo:Et.scalableVideo});return ht[r]=t.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(W)]).then(n=>{let r=n[0],u=n[1],l=W;if(!u){l=W.clone();const e=l.getVideoTracks()[0];e&&(e.stop(),l.removeTrack(e))}const d=new me({iceConfig:r,sendMessage:(e,t)=>{"offer"===e&&this.trigger("connected"),i(e,t)},webRTCStream:l,channels:Et.channels,capableSimulcastStreams:c,overrideSimulcastEnabled:e._enableSimulcast,logAnalyticsEvent:o,offerOverrides:{enableDtx:Et.enableDtx,enableStereo:Et.enableStereo,audioBitrate:Et.audioBitrate,priorityVideoCodec:Et._priorityVideoCodec||this.session.sessionInfo.priorityVideoCodec,codecFlags:Et._codecFlags||this.session._.getCodecFlags()},answerOverrides:this.session.sessionInfo.p2pEnabled?void 0:{audioBitrate:Et.audioBitrate},sourceStreamId:a,isP2pEnabled:this.session.sessionInfo.p2pEnabled,sessionId:this.session.id,keyStore:this.session.keyStore,sFrameClientStore:this.session.sFrameClientStore,isE2ee:this.session._.isE2ee(),audioFallbackEnabled:Et.publisherAudioFallbackEnabled,resolution:{width:this.videoWidth(),height:this.videoHeight()}});return d.on({disconnected:()=>Bt(d),error:e=>{let t=e.reason,n=e.prefix;return Jt(d,{reason:t,prefix:n})},qos:s,iceRestartSuccess:()=>(e=>{const t=h(e).remoteConnectionId;Ot("Success",{remoteConnectionId:t})})(d),iceRestartFailure:()=>(e=>{const t=h(e).remoteConnectionId;Ot("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=>zt(e,d),audioAcquisitionProblem:()=>{mt=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})},audioFallbackStateChange:e=>Ln.onPeerConnectionStateChange(Object.assign({},e,{peerConnection:d,publishVideo:Et.publishVideo,stream:this.stream,peerId:h(d).peerId}))}),d.once("connected",()=>Qt(d)),new t((e,t)=>{const n=e=>{t(e)};d.once("error",n),d.init(Le,r=>{if(r)return t(r);d.off("error",n),e(d)})})}),tn(r)},$t=()=>t.all(Object.keys(ht).map(tn)),en=e=>$t().then(t=>t.filter(t=>h(t).remoteSubscriberId===e)),tn=e=>ht[e],nn=e=>{const t=Object.keys(ht).find(t=>t.endsWith("~"+e));return ht[t]},rn=()=>nn("MANTIS"),on=()=>nn("P2P");let sn=ee(this,{name:Et.name,publishAudio:Et.publishAudio,publishVideo:Et.publishVideo,audioSource:Et.audioSource,showControls:Et.showControls,shouldAllowAudio:St,logAnalyticsEvent:It});const an=()=>{this.off("publishComplete",ln),sn&&sn.reset(),T.releaseAll(),this.disconnect(),Ge=null,Ft(),W=null,V&&(V.destroy(),V=null),this.session&&this._.unpublishFromSession(this.session,"reset"),rt.getVideoFilter()&&Rn(),this.id=null,this.stream=null,pt=!1,this.session=null,Ne.isDestroyed()||Ne.set("NotPublishing")},cn=()=>{if(!W||0===W.getVideoTracks().length)return!1;const e=["text","detail"].includes(Et.videoContentHint),t=wt&&e,n=he.env.isChromium&&(yt||t);return W.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,Et.publishVideo)},un=()=>!(!W||0===W.getAudioTracks().length)&&(W.getAudioTracks().length>0&&W.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,Et.publishAudio)),ln=e=>{if(V&&(V.audioOnly(!cn()),V.showPoster(!cn())),sn&&sn.setAudioOnly(!cn()&&un()),this.stream){let t;et&&cn()&&(t=u.CongestionLevels.LOW,et=!1),this.stream.setChannelActiveState("audio",un(),e),this.stream.setChannelActiveState("video",cn(),e,t)}else this.off("publishComplete",ln),this.once("publishComplete",ln)},dn=(e,n)=>{let r=!1;if("function"==typeof e?n=e:r="rtcStatsReport"===e,r?Nt():Gt(),!r||D)$t().then(e=>{if(0===e.length){const e=oe.PEER_CONNECTION_NOT_CONNECTED;throw le(re.PEER_CONNECTION_NOT_CONNECTED,new Error(de.getTitleByCode(e)),e)}return e}).then(e=>this.session.sessionInfo.isAdaptiveEnabled?e.filter(e=>e.getSourceStreamId()===Ue):e).then(e=>t.all(e.map(e=>I(r?e.getRtcStatsReport.bind(e):e.getStats.bind(e))().then(t=>({pc:e,stats:t}))))).then(e=>{const t=Ve?Ve.getTime():Date.now(),i=e.map(e=>{let n=e.pc,i=e.stats;const o=h(n),s=o.remoteConnectionId,a=o.remoteSubscriberId;return p(s.match(/^symphony\./)?{}:{subscriberId:a,connectionId:s},r?{rtcStatsReport:i}:{stats:R.normalizeStats(i,!1,t)})});n(null,i)}).catch(n);else{const e=oe.GET_RTC_STATS_REPORT_NOT_SUPPORTED;n(le(re.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(de.getTitleByCode(e)),e))}},hn=(e,t)=>{const n={name:Et.name||"",streamId:this.streamId,subscriberAudioFallbackEnabled:Et.subscriberAudioFallbackEnabled,channels:nt,minBitrate:Et.minVideoBitrate,sourceStreamId:e,e2ee:this.session._.isE2ee(),publisherAudioFallbackEnabled:Et.publisherAudioFallbackEnabled,customProperties:{initials:Et.initials}};this.session._.streamCreate(n,t)},pn=e=>{l||(l=!0,W.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:Ae[n.id]=r;case 11:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}()))},fn=e=>{W.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(Ae[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 Ae[n.id];case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()),l=!1},mn=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 He=!1,e.next=3,rn();case 3:if(!(t=e.sent)){e.next=18;break}return n.trigger("sourceStreamIdChanged","P2P"),e.next=8,Z(Re);case 8:if(!He){e.next=11;break}return ce.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 11:return Et.publisherAudioFallbackEnabled&&t.disableCongestionLevelEstimation(),pn(t),e.next=15,t.changeMediaDirectionToInactive();case 15:if(!(he.env.isFirefox&&he.env.version<96)){e.next=18;break}return e.next=18,bn();case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),gn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return He=!0,e.next=3,rn();case 3:if(!(t=e.sent)){e.next=22;break}return fn(t),e.next=8,t.changeMediaDirectionToRecvOnly();case 8:if(De&&clearTimeout(De),n.trigger("sourceStreamIdChanged","MANTIS"),!Et.publisherAudioFallbackEnabled){e.next=22;break}return e.t0=t,e.next=14,on();case 14:if(e.t1=r=e.sent,null!=e.t1){e.next=19;break}e.t2=void 0,e.next=20;break;case 19:e.t2=r.getAudioFallbackState();case 20:e.t3=e.t2,e.t0.enableCongestionLevelEstimation.call(e.t0,e.t3);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bn=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,rn();case 2:(t=e.sent)&&(De=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"!==Ue){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,Z(ke);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,bn();case 9:case"end":return e.stop()}}),e)}))),Oe));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),yn=()=>{At("Attempt");const e=e=>{const t=Y(e);this.trigger("streamCreateForP2PComplete",t),At("Failure",{reason:t.message})};if(!this.session)return void At("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{At("Failure",{reason:"Timeout"})},fe);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),ce.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),hn("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},vn=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"===Ue){e.next=2;break}return e.abrupt("return");case 2:if(Vt("Attempt"),n.session){e.next=6;break}return Vt("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 6:if(n.streamId){e.next=9;break}return Vt("Failure",{reason:"No streamId available"}),e.abrupt("return");case 9:return e.next=11,gn();case 11:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=15,on();case 15:e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),Vt("Success"),n.trigger("streamDestroyForP2PComplete");case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();this.publish=e=>(ce.debug("OT.Publisher: publish"),(Ne.isAttemptingToPublish()||Ne.isPublishing())&&an(),Ne.set("GetUserMedia"),Et.style&&this.setStyle(Et.style,null,!0),Et.classNames="OT_root OT_publisher",ne.onLoad(()=>{ce.debug("OT.Publisher: publish: environment loaded"),V=new we(e,Object.assign({},Et,{widgetType:"publisher"})),St&&X({publisher:this,widgetView:V}),V.on("error",Yt),this.id=V.domId(),this.element=V.domElement,this.element&&sn&&sn.init(V),V.on("videoDimensionsChanged",(e,t)=>{Et.publishVideo&&(this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new ie.VideoDimensionsChangedEvent(this,e,t)))}),V.on("mediaStopped",e=>{const t=new ie.MediaStoppedEvent(this,e);if(this.dispatchEvent(t),!t.isDefaultPrevented())if(e){const t=String(e.kind).toLowerCase();"audio"===t?xn():"video"===t?In():ce.warn("Track with invalid kind has ended: "+e.kind)}else this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}),V.on("videoElementCreated",e=>{const t=new ie.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),Tt().catch(ct).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 Xe=gt.audioDevices,Me=gt.videoDevices,(r=!!Et.videoFilter)&&(Zn=H(t,Me)),e.next=6,Dt(t);case 6:return Et.publishVideo||n._toggleVideo(Et.publishVideo,Wt()),yt||wt||r||(Zn=H(t,Me),Et.publishVideo&&Un(Zn)),e.abrupt("return",Ut().catch(e=>{if(!(e instanceof x))throw e}).then(()=>{Xt(),Ne.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{ce.error("OT.Publisher.publish failed to bind video: "+e),Mt(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,$t().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=En(t))||!wn(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=En(t))||!Sn(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 wn=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},Sn=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},En=e=>{let t;if("string"!=typeof e)return t;const n=e.split(":");return 0===n.length||n.length>3?t:n.every(e=>!isNaN(e))?(t=n.map(e=>parseInt(e,10)).reverse(),t):t},Tn=e=>W&&W[`get${S(e)}Tracks`]().length>0&&W[`get${S(e)}Tracks`]().every(e=>"ended"!==e.readyState),xn=e=>{const t=Tn("audio")&&Et.publishAudio;sn&&sn.setMuted(!t),Ge&&Ge.muted(!t),Be&&Be.originalTrack&&(Be.originalTrack.enabled=t),ln(e)};let _n;this.publishAudio=e=>{It("publishAudio","Attempt",{publishAudio:e}),Et.publishAudio=e;try{xn(),It("publishAudio","Success",{publishAudio:e})}catch(e){It("publishAudio","Failure",{message:e.message})}return this},this.publishCaptions=e=>{It("publishCaptions","Attempt");try{r.dispatchEvent(new ie.PublisherCaptionsEnabled(e)),this.stream.setChannelActiveState("data",e),It("publishCaptions","Success")}catch(e){It("publishCaptions","Failure",{message:e.message})}};let Cn=!1;const In=()=>{const e=Tn("video")&&Et.publishVideo;if("Chrome"===C.name&&C.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 _n&&_n.cancel(),_n=new _,n=_n,t.next=5,$t();case 5:r=t.sent,n.isCanceled()||r.forEach(t=>{t.setVideoActiveState(e)});case 7:case"end":return t.stop()}}),t)})))(),wt&&rt){const t=rt.getOriginalVideoTrack();t&&(t.enabled=e)}if(wt&&Ye){const t=Ye.originalTrack;t&&(t.enabled=e)}W&&W.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),ln()},Rn=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=rt.getOriginalVideoTrack(),e.prev=1,e.next=4,rt.destroy();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),ce.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)}}(),kn=e=>!An&&!Ye&&e===jn(),On=(e,t)=>!(!An&&!Ye)||(e?Zn!==t:void 0!==t);let Zn,An;this._toggleVideo=M(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(!(yt||wt||Cn)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Dn();case 4:if(s=e.sent,a=Pn()){e.next=8;break}throw le(re.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,On(t,c)){e.next=11;break}return e.abrupt("return");case 11:if("ended"!==a.readyState){e.next=14;break}return Cn=!0,e.abrupt("return");case 14:if(t&&he.env.isAndroid&&he.env.isChrome&&a&&a.stop&&a.stop(),t){e.next=31;break}e.prev=16,u=j(n),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(16),e.abrupt("return");case 23:if(c&&(Zn=c),Un(u.label),!(l=rt.getVideoFilter())){e.next=30;break}return An=l,e.next=30,Rn();case 30:Ye&&(Ye.destroy(),Ye.stopOriginalTrack());case 31:if(!Zn||-1!==s.findIndex(e=>e.deviceId===Zn)){e.next=33;break}throw le(re.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(!kn(Zn)){e.next=37;break}return e.abrupt("return");case 37:return e.prev=37,e.next=40,Fn(Zn);case 40:u=e.sent,e.next=47;break;case 43:throw e.prev=43,e.t1=e.catch(37),ce.error(`Error getting new track for current device(${Zn}): ${e.t1}`),e.t1;case 47:if(u){e.next=50;break}return ce.error("Failed to enable video. It was not possible to get a new track from the camera"),e.abrupt("return");case 50:if(!An){e.next=59;break}return d=rt.getOriginalVideoTrack(),e.next=54,rt.setVideoFilter(An);case 54:return e.next=56,rt.setMediaStream(W);case 56:return e.next=58,rt.setVideoTrack(u);case 58:u=e.sent;case 59:if(!Ye){e.next=64;break}return d=Ye.originalTrack,e.next=63,Ye.setTrack(u);case 63:u=e.sent;case 64:return e.prev=64,e.next=67,Mn(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 Vn=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:null==(r=sn)||r.videoDisabledIndicator.disableVideo(!1),null==(o=sn)||o.videoDisabledIndicator.setWarning(!1),t===c.default.SUSPENDED_VIDEO?n.trigger("videoEnabled",{reason:"quality"}):n.trigger("videoDisableWarningLifted");case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Gn=()=>{var e;Et.publishVideo&&(null==(e=sn)||e.videoDisabledIndicator.setWarning(!0));this.trigger("videoDisableWarning")},Nn=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:Et.publishVideo&&(null==(t=sn)||t.videoDisabledIndicator.disableVideo(!0)),n.trigger("videoDisabled",{reason:"quality"});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let Ln;if(Et.publisherAudioFallbackEnabled){Ln=q({getAllPeerConnections:$t});const e={[c.default.ACTIVE_VIDEO]:Vn,[c.default.ACTIVE_VIDEO_WITH_WARNING]:Gn,[c.default.SUSPENDED_VIDEO]:Nn};Ln.on("stateChange",t=>{let n=t.previousState,r=t.state;try{e[r](n)}catch(e){throw ce.error("Audio fallback error: "+e),e}})}this.publishVideo=e=>{if(Et.publishVideo===e)return this;It("publishVideo","Attempt",{publishVideo:e});const t=Wt();var n,r;Et.publishVideo=e,!1===e&&Et.publisherAudioFallbackEnabled&&Ln.getState()!==c.default.ACTIVE_VIDEO&&(et=!0,Ln.reset(),null==(n=sn)||n.videoDisabledIndicator.disableVideo(!1),null==(r=sn)||r.videoDisabledIndicator.setWarning(!1));try{this._toggleVideo(Et.publishVideo,t),In(),It("publishVideo","Success",{publishVideo:e})}catch(e){It("publishVideo","Failure",{message:e.message})}return this},this.setVideoContentHint=e=>J(W,e),this.getVideoContentHint=()=>K(W),this.destroy=function(e,t){return Ne.isAttemptingToPublish()&&this.session&&kt("Cancel",{reason:"destroy"}),Ne.isDestroyed()||(Ne.set("Destroyed"),an(),gt&&(gt.off(),gt=null),sn&&(sn.destroy(),sn=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new ie.DestroyedEvent(k.PUBLISHER_DESTROYED,this,e)),this.off(),Ye&&(Ye.destroy(),Ye.stopOriginalTrack()),Be&&(Be.destroy(),Be.stopOriginalTrack())),this},this.disconnect=()=>{Object.keys(ht).forEach(e=>{const t=tn(e);delete ht[e],t.then(e=>this._removePeerConnection(e))}),nt.length=0},this.processMessage=(e,t,n)=>{const r=d(n,"params.subscriber",t).replace(/^INVALID-STREAM$/,t),i=d(n,"content.peerId"),o=d(n,"content.sourceStreamId","MANTIS"),a=`${r}~${i}~${o}`;ce.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${a}`),ce.debug(n);const c=tn(a),u=()=>{const c=Ee({socket:this.session._.getSocket(),uri:n.uri,content:{peerId:i,sourceStreamId:o}});qt({peerConnectionId:a,send:c,log:function(e,t,n,r,s){void 0===r&&(r={});const a=Object.assign({peerId:i,sourceStreamId:z(o)},r);return It(e,t,n,a,s)},logQoS:e=>{o===Ue&&Lt(Object.assign({},e,{peerId:i,remoteConnectionId:t,sourceStreamId:o}))},sourceStreamId:o}).then(c=>(((e,t)=>{s.set(e,t)})(c,{remoteConnectionId:t,remoteSubscriberId:r,peerId:i,sourceStreamId:o,peerConnectionId:a}),c.processMessage(e,n),null)).catch(e=>{ce.error("OT.Publisher failed to create a peerConnection",e)})},l=this.session.sessionInfo.isAdaptiveEnabled;switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(c)c.then(t=>t.processMessage(e,n));else{if(l&&on())return;u()}}},this.getImgData=function(){if(!pt)return ce.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=V&&V.video();return e?e.imgData():null};const Wn=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&W.getAudioTracks().length?e.replaceTrack(W.getAudioTracks()[0]):"video"===e.track.kind&&W.getVideoTracks().length?e.replaceTrack(W.getVideoTracks()[0]):void 0)},Xn=function(e){return void 0===e&&(e=Wn),$t().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(!he.env.isLegacyEdge&&Se.RTCRtpSender&&"function"==typeof Se.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw le(re.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),oe.UNABLE_TO_PUBLISH);case 2:if(!wt&&!yt){t.next=4;break}throw le(re.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(Pn()){t.next=7;break}throw le(re.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,Dn();case 10:if(n=t.sent,n.filter(e=>e.deviceId!==Zn).length>0){t.next=14;break}return t.abrupt("return",Zn);case 14:for(;n[e%n.length].deviceId===Zn;)e+=1;return r.emit("streamDestroy"),o=n[e%n.length],s=o.deviceId,t.next=20,er(s);case 20:return t.abrupt("return",Zn);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=M((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),ce.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 Mn=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,$t();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(W.removeTrack(s),W.addTrack(a),s&&s.stop){try{u=a instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(a).toString().includes("MediaStreamTrackGenerator")}catch(e){u=!1}u||s.stop()}"Firefox"!==he.env.name&&"Safari"!==he.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=W),(l=V&&V.video())&&l.refreshTracks(),r.emit("streamChange"),In();case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Fn=function(){var t=(0,o.default)(i.default.mark((function t(n){var r,o,s,a,c,u,l;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=jn(),Un(n),(s=f(e)).audioSource=null,s.videoSource=n,gt=Ie(s,"OT.Publisher.getTrackFromDeviceId",()=>Ne&&Ne.isDestroyed()),gt.on({accessDialogOpened:ut,accessDialogClosed:lt}),a=gt.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),ce.error(t.t0),t.t0;case 18:return u=null==(r=c)?void 0:r.getVideoTracks(),(l=u[0])||Un(o),t.abrupt("return",l);case 21:case"end":return t.stop()}}),t,null,[[8,14]])})));return function(e){return t.apply(this,arguments)}}(),Pn=()=>W.getVideoTracks()[0],jn=()=>je,Un=e=>{je=e},Dn=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,te.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw le(re.NO_DEVICES_FOUND,new Error("No video devices available"),oe.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)}}(),Hn=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,$t();case 2:return s=e.sent,e.next=5,t.all(s.map(e=>e.findAndReplaceTrack(n,o)));case 5:o&&W.addTrack(o),n&&W.removeTrack(n),(a=V&&V.video())&&a.refreshTracks(),sn&&(o&&!n&&sn.addAudioTrack(),n&&!o&&sn.removeAudioTrack());try{c=o instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(o).toString().includes("MediaStreamTrackGenerator")}catch(e){c=!1}n&&n.stop&&!c&&n.stop(),o&&(xn(),Ge=new ue(W,!Et.publishAudio)),r.emit("streamChange"),ln();case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Yn=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getSettings().deviceId,e.prev=1,e.next=4,n.setAudioSource(r);case 4:(o=W.getAudioTracks()[0])&&(o.onmute=()=>Bn(o),o.onunmute=()=>Jn(o)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),ce.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),Bn=e=>{let t=!1;Et.publishVideo&&document.hidden&&(t=!0,this.publishVideo(!1));const r=function(){var s=(0,o.default)(i.default.mark((function o(){return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(document.hidden){i.next=5;break}return i.next=3,Yn(e);case 3:t&&n.publishVideo(!0),document.removeEventListener("visibilitychange",r);case 5:case"end":return i.stop()}}),o)})));return function(){return s.apply(this,arguments)}}();document.addEventListener("visibilitychange",r)},Jn=e=>{var t;un()&&(cn()?this.videoElement().pause():Yn(e)),null==this||null==(t=this.session)||t.trigger("gsmCallEnded")},Kn=!(he.env.isLegacyEdge||!Se.RTCRtpSender||"function"!=typeof Se.RTCRtpSender.prototype.replaceTrack),zn=()=>le(re.CANCEL,new Error("Operation did not succeed due to a new request."));let Qn;const qn=function(){var t=(0,o.default)(i.default.mark((function t(r){var o,s,a,c,u,l,d,h,p,m,g;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Kn){t.next=2;break}throw le(re.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 2:if(Qn&&Qn.cancel(),Qn=new _,o=Qn,s=e=>{if(o.isCanceled())throw e.getTracks(e=>e.stop()),zn();return qn(e.getAudioTracks()[0])},a=n.getAudioSource()){t.next=7;break}throw le(re.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 zn();case 10:if(!Be){t.next=23;break}return t.prev=11,t.next=14,Be.setTrack(r);case 14:return c=t.sent,t.next=17,Hn(a,c);case 17:return t.abrupt("return",t.sent);case 20:t.prev=20,t.t0=t.catch(11),ce.error("Error setting track on audioMediaProcessorConnector: "+t.t0);case 23:return t.abrupt("return",Hn(a,r));case 26:if("string"!=typeof r){t.next=73;break}return(u=f(e)).audioSource=r,u.videoSource=null,gt=Ie(u,"OT.Publisher.setAudioSource",()=>o.isCanceled()||Ne&&Ne.isDestroyed()),gt.on({accessDialogOpened:ut,accessDialogClosed:lt}),l=a.label,d=a.getConstraints&&a.getSettings().deviceId||void 0,a&&a.stop(),h=gt.getUserMedia,t.prev=36,t.t1=s,t.next=40,h();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 zn();case 50:if((p=f(e)).videoSource=null,p.audioSource=d,p.audioSource||!l){t.next=60;break}return t.next=56,P();case 56:if(m=t.sent.find(e=>e.label===l),!o.isCanceled()){t.next=59;break}throw zn();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)",le(re.NOT_FOUND,t.t3);case 63:return gt=Ie(p,"OT.Publisher.setAudioSource",()=>o.isCanceled()||Ne&&Ne.isDestroyed()),t.next=66,gt.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 le(re.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=qn,this.getAudioSource=()=>W&&W.getAudioTracks().length>0?W.getAudioTracks()[0]:null;const $n=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=le(re.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=le(re.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!he.env.isLegacyEdge&&Se.RTCRtpSender&&"function"==typeof Se.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw le(re.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),oe.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(o=!W||0===W.getVideoTracks().length,!(wt||yt||o)){e.next=9;break}throw r;case 9:return e.next=11,P();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,er(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=$n;const er=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(o=Zn,Zn=t,Et.publishVideo){e.next=4;break}return e.abrupt("return");case 4:if(!kn(t)){e.next=6;break}return e.abrupt("return");case 6:if(s=Pn(),!Et.publishVideo||!he.env.isAndroid||!he.env.isChrome&&!he.env.isFirefox){e.next=14;break}if(!An){e.next=13;break}return a=An,e.next=12,Rn();case 12:An=null;case 13:s&&s.stop&&s.stop();case 14:return e.prev=14,e.next=17,Fn(t);case 17:c=e.sent,e.next=25;break;case 20:throw e.prev=20,e.t0=e.catch(14),Zn=o,ce.error(e.t0),e.t0;case 25:if(c){e.next=28;break}return ce.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 28:if(!An){e.next=33;break}return u=rt.getOriginalVideoTrack(),e.next=32,rt.setVideoTrack(c);case 32:c=e.sent;case 33:if(!Ye){e.next=38;break}return u=Ye.originalTrack,e.next=37,Ye.setTrack(c);case 37:c=e.sent;case 38:return e.next=40,Mn(s,c);case 40:if(!a){e.next=43;break}return e.next=43,n.applyVideoFilter(a);case 43:null==(r=u)||r.stop(),Et.publishVideo&&(Cn=!1);case 45:case"end":return e.stop()}}),e,null,[[14,20]])})));return function(t){return e.apply(this,arguments)}}();var tr;this.getVideoSource=()=>{const e={},t=!W||0===W.getVideoTracks().length;return e.track=W&&Et.publishVideo&&W.getVideoTracks()[0]||null,e.deviceId=yt||wt||!Zn?null:Zn,e.type=wt?"custom":yt?"screen":t?null:"camera",e},this._={privateEvents:r,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,$t();case 2:t.sent.forEach(t=>t.setIceConfig(e));case 4:case"end":return t.stop()}}),t)})))(),publishToSession:(e,n)=>{n&&(Ze=n),$e=e,this.session=e;const r=w();G=r,this.streamId=r,kt("Attempt",{dataChannels:Et.channels,properties:L(Et)});const i=new t((e,t)=>{pt?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))}))});ce.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(Et.scalableFramerates),this._setScalableVideoLayers(Et.scalableVideoLayers),this.stream&&(this.stream.setChannelActiveState("audio",un()),this.stream.setChannelActiveState("video",cn())),ce.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=Y(e);throw kt("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),Ne.isAttemptingToPublish()&&this.trigger("publishComplete",t),de.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:Ze}),t};ce.debug("publishToSession: waiting for loaded");const a=i.then(()=>e._.getVideoCodecsCompatible(W)).then(n=>{if(ce.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{Ht(e)},fe);this.once("publishComplete",()=>{clearTimeout(r)}),Ne.set("PublishingToSession");const i=n&&V&&V.video(),o=W.getVideoTracks().length>0,a=null!==Et.videoSource&&!1!==Et.videoSource;i&&o&&a&&nt.push(new be({id:"video1",type:"video",active:Et.publishVideo,orientation:ve.ROTATED_NORMAL,frameRate:Et.frameRate,width:this.videoWidth(),height:this.videoHeight(),e2ee:e._.isE2ee(),source:yt?"screen":wt?"custom":"camera",fitMode:Et.fitMode}));const c=W.getAudioTracks().length>0,u=null!==Et.audioSource&&!1!==Et.audioSource;return u&&c&&nt.push(new be({id:"audio1",type:"audio",active:Et.publishAudio})),u&&c&&nt.push(new be({id:"caption1",type:"data",active:Et.publishCaptions})),this._.streamChannels=nt,ce.debug("publishToSession: creating rumor stream id"),new t((e,t)=>{hn(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(ce.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,Le=pe(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";ce.warn(`The publisher ${dt} 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||Ne.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),T.releaseAll(),this.disconnect(),Ne.isAttemptingToPublish()){kt("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",le("mediaStopped"===t?re.MEDIA_ENDED:re.CANCEL,e))}return this.session=null,It("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>G&&e.id===G?this._.unpublishFromSession(t,n):(ce.warn(`The publisher ${dt} is trying to destroy a stream ${e.id} that is not attached to it (it has ${G||"no stream"} attached to it)`),this),streamDestroyed:e=>{["reset"].indexOf(e)<0&&(Ne.isDestroyed()||Ne.set("MediaBound"));const t=new ie.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEventOnce(t,this.streamId),t.isDefaultPrevented()||this.destroy()},archivingStatus:e=>(sn&&sn.setArchivingStatus(e),e),webRtcStream:()=>W,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,Tt().catch(ct);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),ce.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,Ft(),W=n,r.emit("streamChange"),Ge=new ue(W,!Et.publishAudio),e.prev=11,Ut(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof x)){e.next=19;break}return e.abrupt("return");case 19:throw ce.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,Xn(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),ce.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=tn(Object.keys(ht)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new he.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(e){void 0===e&&(e=!1),$t().then(t=>{t.forEach(t=>{const n=h(t).remoteConnectionId;Ot("Attempt",{remoteConnectionId:n}),ce.debug("Publisher: ice restart attempt"),t.iceRestart(),e&&t.generateOffer()})})},getState:()=>Ne,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,$t();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:Dt,startRoutedToRelayedTransition:()=>{a.startTransitionTo("P2P"),yn()},startRelayedToRoutedTransition:()=>{a.startTransitionTo("MANTIS",()=>vn())},forceMuteAudio:function(){It("publishAudio","Attempt",{publishAudio:!1}),Et.publishAudio=!1;try{xn("auto"),this.dispatchEvent(new ie.MuteForcedEvent),It("publishAudio","Success",{publishAudio:!1})}catch(e){It("publishAudio","Failure",{message:e.message})}}.bind(this),setCongestionLevel:(tr=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ln){e.next=15;break}if(!n){e.next=8;break}return e.next=4,tn(n);case 4:e.t1=e.sent,e.t0=[e.t1],e.next=11;break;case 8:return e.next=10,$t();case 10:e.t0=e.sent;case 11:e.t0.forEach(e=>{e.setCongestionLevel(t)}),e.next=16;break;case 15:ce.warn("Audio Fallback is not enabled");case 16:case"end":return e.stop()}}),e)}))),function(e,t){return tr.apply(this,arguments)})},this.detectDevices=function(){ce.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){ce.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return ce.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){ce.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return ce.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){ce.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){ce.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return dt},this.videoElement=function(){const e=V&&V.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==Ne.current)throw new Error("assignStream called when publisher is not successfully publishing");T.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),T.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),Ne.set("Publishing"),V.loading(!pt),Ve=new Date,this.dispatchEvent(new ie.StreamEvent("streamCreated",e,null,!1)),kt("Success"),this.trigger("publishComplete",null,this)},this.isWebRTC=!0,this.isLoading=function(){return V&&V.loading()},this.videoWidth=()=>Wt().width,this.videoHeight=()=>Wt().height,this.getStats=function(e){(e=>{dn(e)})((t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>new t((e,t)=>{dn("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),Ne=new ge(e=>{ce.error("OT.Publisher State Change Failed: ",e.message),ce.debug(e)}),this.accessAllowed=!1,this.applyVideoFilter=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(r=Ce(t),It("applyVideoFilter","Attempt",{videoFilter:r}),e.prev=2,!Ye){e.next=5;break}throw le(re.NOT_SUPPORTED,new Error("Cannot apply video filter when videoMediaProcessorConnector is set."));case 5:if(Te.isSupported()){e.next=8;break}throw le(re.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 8:if(rt.isValidVideoFilter(t)){e.next=10;break}throw le(re.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 10:if(W){e.next=15;break}return It("applyVideoFilter","Failure",{message:o="Ignoring. No mediaStream"}),ce.warn(o),e.abrupt("return");case 15:if(!yt){e.next=17;break}throw le(re.INVALID_PARAMETER,new Error("Video filters can not be applied to screen share"));case 17:if(Rt(),Et.publishVideo){e.next=22;break}return An=t,It("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 22:if(!rt.getVideoFilter()){e.next=37;break}if(!rt.canUpdateVideoFilter(t.type)){e.next=35;break}return e.prev=24,e.next=27,rt.updateVideoFilter(t);case 27:return An=t,It("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 32:e.prev=32,e.t0=e.catch(24),ce.warn("Error updating video filter: "+e.t0);case 35:return e.next=37,n.clearVideoFilter();case 37:if(s=W.getVideoTracks(),a=s[0]){e.next=43;break}return It("applyVideoFilter","Failure",{message:o="Ignoring. No video"}),ce.warn(o),e.abrupt("return");case 43:return e.next=45,rt.setVideoFilter(t);case 45:return e.next=47,rt.setMediaStream(W);case 47:if(!(c=e.sent)){e.next=51;break}return e.next=51,Mn(a,c);case 51:e.next=58;break;case 53:throw e.prev=53,e.t1=e.catch(2),ce.error("Error applying video filter: "+e.t1),It("applyVideoFilter","Failure",{message:e.t1.message}),e.t1;case 58:An=t,It("applyVideoFilter","Success",{videoFilter:r});case 60:case"end":return e.stop()}}),e,null,[[2,53],[24,32]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>(It("getVideoFilter","Attempt"),It("getVideoFilter","Success"),An||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(It("setVideoMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!n.getVideoFilter()){e.next=4;break}throw It("setVideoMediaProcessorConnector","Failure",{message:"Tried to set video MediaProcessorConnector when video filter applied."}),le(re.NOT_SUPPORTED,new Error("setVideoMediaProcessorConnector: Cannot use this method when videoFilter is set."));case 4:if(!Ye){e.next=14;break}return r=W.getVideoTracks(),o=r[0],e.next=8,Fn(Zn);case 8:return s=e.sent,e.next=11,Mn(o,s);case 11:Ye.destroy(),Ye.stopOriginalTrack(),Ye=null;case 14:if(t){e.next=17;break}return It("setVideoMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 17:if(xe.isValidConnector(t)){e.next=20;break}throw It("setVideoMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),le(re.INVALID_PARAMETER,new Error("setVideoMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 20:if(Ye=new xe(t),a=W.getVideoTracks(),c=a[0]){e.next=28;break}return It("setVideoMediaProcessorConnector","Failure",{message:u="Connector not set as no video track is present."}),ce.warn("setVideoMediaProcessorConnector: "+u),Ye=null,e.abrupt("return");case 28:return e.prev=28,e.next=31,Ye.setTrack(c);case 31:return o=e.sent,e.next=34,Mn(c,o);case 34:e.next=42;break;case 36:throw e.prev=36,e.t0=e.catch(28),Ye=null,ce.error("setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),It("setVideoMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 42:It("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(It("setAudioMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!Be){e.next=7;break}return r=W.getAudioTracks(),o=r[0],e.next=5,Hn(o,Be.originalTrack);case 5:Be.destroy(),Be=null;case 7:if(t){e.next=10;break}return It("setAudioMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 10:if(xe.isValidConnector(t)){e.next=13;break}throw It("setAudioMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),le(re.INVALID_PARAMETER,new Error("setAudioMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 13:if(s=W.getAudioTracks(),a=s[0]){e.next=20;break}return It("setAudioMediaProcessorConnector","Failure",{message:c="Connector not set as no audio track is present."}),ce.warn("setAudioMediaProcessorConnector: "+c),Be=null,e.abrupt("return");case 20:return Be=new xe(t),e.prev=21,e.next=24,Be.setTrack(a);case 24:return o=e.sent,e.next=27,Hn(n.getAudioSource(),o);case 27:e.next=35;break;case 29:throw e.prev=29,e.t0=e.catch(21),Be=null,ce.error("setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),It("setAudioMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 35:It("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(It("clearVideoFilter","Attempt"),Et.publishVideo||rt.getVideoFilter()){e.next=5;break}return An=null,It("clearVideoFilter","Success"),e.abrupt("return");case 5:if(rt.getVideoFilter()||An){e.next=10;break}return It("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),ce.debug(t),e.abrupt("return");case 10:if(Te.isSupported()){e.next=15;break}return It("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),ce.warn(t),e.abrupt("return");case 15:if(W){e.next=20;break}return It("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),ce.warn(t),e.abrupt("return");case 20:return n=An,An=null,r=W.getVideoTracks(),o=r[0],e.prev=23,e.next=26,Fn(Zn);case 26:s=e.sent,e.next=33;break;case 29:return e.prev=29,e.t0=e.catch(23),ce.error(e.t0),e.abrupt("return");case 33:if(s){e.next=36;break}return ce.warn("Failed to clear filter because there is no video track."),e.abrupt("return");case 36:return e.prev=36,e.next=39,Mn(o,s);case 39:return e.next=41,Rn();case 41:e.next=46;break;case 43:e.prev=43,e.t1=e.catch(36),An=n;case 46:It("clearVideoFilter","Success");case 47:case"end":return e.stop()}}),e,null,[[23,29],[36,43]])})))}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(51).once;e.exports=function(e,t){void 0===t&&(t={});const i=t.hasE2eeCapability||n(110),o=t.hasOpenTokSupport||r;this.publish=-1!==e.indexOf("publish")?1:0,this.subscribe=-1!==e.indexOf("subscribe")?1:0,this.forceUnpublish=-1!==e.indexOf("forceunpublish")?1:0,this.forceDisconnect=-1!==e.indexOf("forcedisconnect")?1:0,this.forceMute=-1!==e.indexOf("forcemute")?1:0,this.supportsE2ee=i()?1:0,this.supportsWebRTC=o()?1:0,this.permittedTo=e=>Object.prototype.hasOwnProperty.call(this,e)&&1===this[e]}},function(e,t,n){"use strict";const r=n(1)("Stream"),i=n(8),o=n(21),s=n(6),a=n(23)(),c=["name","archiving"];e.exports=function(e,t,n,u,l,d,h){const p=this;let f;this.id=e,this.streamId=e,this.name=t,this.creationTime=Number(n),this.initials=h||"",this.connection=u,this.channel=d,this.publisher=o.publishers.find({streamId:this.id}),s(this);const m=function(e,t,n,r){let i=t;switch(i){case"active":i="audio"===e.type?"hasAudio":"hasVideo",p[i]=r;break;case"disableWarning":if(i="audio"===e.type?"audioDisableWarning":"videoDisableWarning",p[i]=r,!p["audio"===e.type?"hasAudio":"hasVideo"])return;break;case"fitMode":i="defaultFitMode",p[i]=r;break;case"source":i="audio"===e.type?"audioType":"videoType",p[i]=r;break;case"videoDimensions":p.videoDimensions=r;break;case"orientation":case"width":case"height":return}p.dispatchEvent(new a.StreamUpdatedEvent(p,i,n,r))},g=function(){return p.publisher?p.publisher:o.subscribers.find(e=>e.stream&&e.stream.id===p.id&&e.session.id===l.id)},b=function(){return!p.publisher};this.getChannelsOfType=function(e){return p.channel.filter(t=>t.type===e)},this.getChannel=function(e){for(let t=0;t<p.channel.length;++t)if(p.channel[t].id===e)return p.channel[t];return null};const y=this.getChannelsOfType("audio")[0],v=this.getChannelsOfType("video")[0];this.hasAudio=null!=y&&y.active,this.hasVideo=null!=v&&v.active,this.videoType=v&&v.source,this.defaultFitMode=v&&v.fitMode,this.videoDimensions={},v&&(this.videoDimensions.width=v.width,this.videoDimensions.height=v.height,this.videoDimensions.orientation=v.orientation,v.on("update",m),this.frameRate=v.frameRate),y&&y.on("update",m),this.setChannelActiveState=function(e,t,n,r,i){const o={active:t};n&&(o.activeReason=n),void 0!==r&&(o.congestionLevel=r),i&&(o.subscriberId=i),w(e,o)},this.setVideoDimensions=function(e,t){w("video",{width:e,height:t,orientation:0})},this.setRestrictFrameRate=function(e){w("video",{restrictFrameRate:e})},this.setPreferredResolution=function(e){if(!b())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=p.getChannelsOfType("video")[0];if(t){if(e&&e.width){if(isNaN(parseInt(e.width,10)))throw new i.Error("stream preferred width must be an integer","Subscriber");t.preferredWidth=parseInt(e.width,10)}else t.preferredWidth=void 0;if(e&&e.height){if(isNaN(parseInt(e.height,10)))throw new i.Error("stream preferred height must be an integer","Subscriber");t.preferredHeight=parseInt(e.height,10)}else t.preferredHeight=void 0;l._.subscriberChannelUpdate(p,g(),t,{preferredWidth:t.preferredWidth||0,preferredHeight:t.preferredHeight||0})}},this.getPreferredResolution=function(){const e=p.getChannelsOfType("video")[0];if(e&&(e.preferredWidth||e.preferredHeight))return{width:e.preferredWidth,height:e.preferredHeight}},this.setPreferredFrameRate=function(e){if(!b())return void r.warn("setPreferredFrameRate has no affect when called by a publisher");if(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=p.getChannelsOfType("video")[0];t&&(t.preferredFrameRate=e?parseFloat(e):null,l._.subscriberChannelUpdate(p,g(),t,{preferredFrameRate:t.preferredFrameRate||0}))},this.getPreferredFrameRate=function(){const e=p.getChannelsOfType("video")[0];return e?e.preferredFrameRate:null};let w=function(e,t){let n;if(p.publisher)n=e=>l._.streamChannelUpdate(p,e,t);else{const e=g();n=n=>l._.subscriberChannelUpdate(p,e,n,t)}p.getChannelsOfType(e).forEach(n)};this.destroyed=!1,this.destroyedReason=void 0,this.destroy=function(e,t){void 0===e&&(e="clientDisconnected"),f=e,p.destroyed=!0,p.destroyedReason=f,!0!==t&&p.dispatchEvent(new a.DestroyedEvent("destroyed",p,f))},this._={},this._.updateProperty=function(e,t){if(-1===c.indexOf(e))return void r.warn(`Unknown stream property "${e}" was modified to "${t}".`);const n=p[e],i=t;switch(e){case"name":p[e]=i;break;case"archiving":var o=g();p.publisher&&o&&o._.archivingStatus(i),p[e]=i}const s=new a.StreamUpdatedEvent(p,e,n,i);p.dispatchEvent(s)},this._.update=function(e){for(const t in e)e.hasOwnProperty(t)&&p._.updateProperty(t,e[t])},this._.forceMute=function(e){e.hasOwnProperty("channels")&&e.channels.includes("audio")&&p.publisher&&p.publisher._.forceMuteAudio()},this._.updateChannel=function(e,t){const n=p.getChannel(e);n&&n.update(t)}}},function(e,t,n){"use strict";t.__esModule=!0,t.UNSUBSCRIBE=t.SUBSCRIBE=t.STATUS=t.PONG=t.PING=t.MESSAGE=t.DISCONNECT=t.CONNECT=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(169),o=n(6),s=n(23)(),a=n(756);function c(e,t,n,r,c){let u;this.id=e,this.connectionId=e,this.creationTime=t?Number(t):null,this.data=n,this.capabilities=a(r),this.permissions=new i(c),this.quality=null,o(this),this.destroy=(e,t)=>{u=e||"clientDisconnected",!0!==t&&this.dispatchEvent(new s.DestroyedEvent("destroyed",this,u))},this.destroyed=()=>void 0!==u,this.destroyedReason=()=>u}c.fromHash=e=>{let t=e.id,n=e.creationTime,i=e.data,o=e.capablities,s=e.permissions;return new c(t,n,i,r(o||{},{supportsWebRTC:!0}),s||[])},e.exports=c},function(e,t){var n="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global).Object===Object&&(void 0!==typeof window?window:global);e.exports=n},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(38),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){var r=n(40),i=n(30);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(380),i=n(63),o=n(12),s=n(64),a=n(65),c=n(85),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),p=n||l||d||h,f=p?r(e.length,String):[],m=f.length;for(var g in e)!t&&!u.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||f.push(g);return f}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){(function(e){var r=n(14),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(84)(e))},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(118),i=n(119),o=n(117),s=n(180),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(183),i=n(117),o=n(30);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(118),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(183),i=n(181),o=n(53);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(38)(n(14),"Set");e.exports=r},function(e,t,n){var r=n(38)(n(14),"WeakMap");e.exports=r},function(e,t,n){var r=n(14).Uint8Array;e.exports=r},function(e,t,n){var r=n(120);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(86),i=n(119),o=n(67);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},function(e,t,n){var r=n(112);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(87),i=n(124);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(122),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(408)()?WeakMap:n(409)},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(197),o=n(31),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,c={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(e,t){if(o(e),null===t||i(t))return e;throw new TypeError("Prototype must be null or an object")},e.exports=function(e){var t,n;return e?(2===e.level?e.set?(n=e.set,t=function(e,t){return n.call(r(e,t),t),e}):t=function(e,t){return r(e,t).__proto__=t,e}:t=function e(t,n){var i;return r(t,n),(i=s.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,i&&a(e.nullPolyfill,"__proto__",c),t},Object.defineProperty(t,"level",{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e,t=Object.create(null),n={},r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(r){try{(e=r.set).call(t,n)}catch(e){}if(Object.getPrototypeOf(t)===n)return{set:e,level:2}}return t.__proto__=n,Object.getPrototypeOf(t)===n?{level:2}:((t={}).__proto__=n,Object.getPrototypeOf(t)===n&&{level:1})}()),n(411)},function(e,t,n){"use strict";var r=n(43),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(414),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(43),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(421)()?String.prototype.contains:n(422)},function(e,t,n){"use strict";var r=n(89),i=n(90),o=n(423),s=n(452),a=n(453),c=n(44).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(428);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(432),o=n(127),s=n(68),a=n(31),c=n(32),u=n(433),l=n(44),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(55),i=n(126),o=n(435),s=n(436),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(464)},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(19);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,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";(function(t){var r=n(19),i=n(470),o=n(471),s=n(208),a=n(472),c=n(475),u=n(476),l=n(211);e.exports=function(e){return new t((function(t,n){var d=e.data,h=e.headers,p=e.responseType;r.isFormData(d)&&delete h["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(m+":"+g)}var b=a(e.baseURL,e.url);function y(){if(f){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,o={data:p&&"text"!==p&&"json"!==p?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};i(t,n,o),f=null}}if(f.open(e.method.toUpperCase(),s(b,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=y:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(y)},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,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var v=(e.withCredentials||u(b))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(h[e.xsrfHeaderName]=v)}"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),p&&"json"!==p&&(f.responseType=e.responseType),"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(0))},function(e,t,n){"use strict";var r=n(209);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";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";var r=n(19);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(483),i=n(485);e.exports=function(e,t,n){return r(i,e,t,n)}},function(e,t,n){var r=n(88),i=n(217),o=i?function(e,t){return i.set(e,t),e}:r;e.exports=o},function(e,t,n){var r=n(186),i=r&&new r;e.exports=i},function(e,t,n){var r=n(219),i=n(220),o=n(489),s=n(95),a=n(221),c=n(227),u=n(498),l=n(137),d=n(14);e.exports=function e(t,n,h,p,f,m,g,b,y,v){var w=128&n,S=1&n,E=2&n,T=24&n,x=512&n,_=E?void 0:s(t);return function C(){for(var I=arguments.length,R=Array(I),k=I;k--;)R[k]=arguments[k];if(T)var O=c(C),Z=o(R,O);if(p&&(R=r(R,p,f,T)),m&&(R=i(R,m,g,T)),I-=Z,T&&I<v){var A=l(R,O);return a(t,n,e,C.placeholder,h,R,A,b,y,v-I)}var V=S?h:this,G=E?V[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&&(G=_||s(G)),G.apply(V,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),p=!i;++o<d;)h[o]=e[o];for(var f=o;++u<l;)h[f+u]=t[u];for(;++a<c;)(p||o<s)&&(h[f+r[a]]=e[o++]);return h}},function(e,t,n){var r=n(490),i=n(225),o=n(226);e.exports=function(e,t,n,s,a,c,u,l,d,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var f=[e,t,a,p?c:void 0,p?u:void 0,p?void 0:c,p?void 0:u,l,d,h],m=n.apply(void 0,f);return r(e)&&i(m,f),m.placeholder=s,o(m,e,t)}},function(e,t,n){var r=n(217),i=n(223),o=r?function(e){return r.get(e)}:i;e.exports=o},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(86),i=n(136);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(216),i=n(193)(r);e.exports=i},function(e,t,n){var r=n(495),i=n(496),o=n(123),s=n(497);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(502),i=n(11),o=n(69),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(510),i=n(17);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,s,e,a))}},function(e,t,n){var r=n(92),i=n(231),o=n(94);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),p=c.get(t);if(h&&p)return h==t&&p==e;var f=-1,m=!0,g=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++f<l;){var b=e[f],y=t[f];if(s)var v=u?s(y,b,f,t,e,c):s(b,y,f,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(515),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(517),i=n(518);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t,n){var r=n(118),i=n(524);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(531)();e.exports=r},function(e,t,n){"use strict";var r=n(532),i=n(533);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=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+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(534);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 E=(S=S[0]).toLowerCase();this.protocol=E,v=v.substr(S.length)}if(n||S||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===v.substr(0,2);!T||S&&g[S]||(v=v.substr(2),this.slashes=!0)}if(!g[S]&&(T||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 k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var O=this.hostname.split(/\./),Z=(I=0,O.length);I<Z;I++){var A=O[I];if(A&&!A.match(p)){for(var V="",G=0,N=A.length;G<N;G++)A.charCodeAt(G)>127?V+="x":V+=A[G];if(!V.match(p)){var L=O.slice(0,I),W=O.slice(I+1),X=A.match(f);X&&(L.push(X[1]),W.unshift(X[2])),W.length&&(v="/"+W.join(".")+v),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+M,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[E])for(I=0,Z=l.length;I<Z;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 D=v.indexOf("?");if(-1!==D?(this.search=v.substr(D),this.query=v.substr(D+1),t&&(this.query=y.parse(this.query)),v=v.slice(0,D)):t&&(this.search="",this.query={}),v&&(this.pathname=v),b[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var H=this.search||"";this.path=M+H}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 p=d[h];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),n.pathname=f.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,E=S,T=n.pathname&&n.pathname.split("/")||[],x=(f=e.pathname&&e.pathname.split("/")||[],n.protocol&&!b[n.protocol]);if(x&&(n.hostname="",n.port=null,n.host&&(""===T[0]?T[0]=n.host:T.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),S=S&&(""===f[0]||""===T[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,T=f;else if(f.length)T||(T=[]),T.pop(),T=T.concat(f),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(x)n.hostname=n.host=T.shift(),(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.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(!T.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var _=T.slice(-1)[0],C=(n.host||e.host||T.length>1)&&("."===_||".."===_)||""===_,I=0,R=T.length;R>=0;R--)"."===(_=T[R])?T.splice(R,1):".."===_?(T.splice(R,1),I++):I&&(T.splice(R,1),I--);if(!S&&!E)for(;I--;I)T.unshift("..");!S||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),C&&"/"!==T.join("/").substr(-1)&&T.push("");var k,O=""===T[0]||T[0]&&"/"===T[0].charAt(0);x&&(n.hostname=n.host=O?"":T.length?T.shift():"",(k=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=k.shift(),n.host=n.hostname=k.shift()));return(S=S||n.host&&T.length)&&!O&&T.unshift(""),T.length?n.pathname=T.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(16),i=n(15),o=n(1)("guidStorage"),s={};let a,c;e.exports=s;s.override=e=>{if(function(e){return!(r(e.get)&&r(e.set))}(e))throw new Error("The storageInterface argument does not seem to be valid, it must implement get and set methods");a!==e&&(a=e,c&&a.set(c,e=>{e&&o.error(`Failed to send initial Guid value (${c}) to the newly assigned Guid Storage. The error was: ${e}`)}))},s.get=e=>{!function(e){c?e(null,c):a.get(e)}((t,n)=>{t?e(t):(n?c||(c=n):(n=i(),a.set(n,t=>{t?e(t):c=n})),e(null,c))})},s.getAsync=()=>new t((e,t)=>{s.get((n,r)=>n?t(n):e(r))}),s.override({get(e){let t;try{t=(void 0!==typeof window?window:global).localStorage.getItem("opentok_client_id")}catch(e){t||(t=i())}e(null,t)},set(e,t){try{(void 0!==typeof window?window:global).localStorage.setItem("opentok_client_id",e)}catch(e){}t(null)}}),s.set=e=>{c=e}}).call(this,n(0))},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},function(e,t,n){"use strict";const r=n(244),i=n(3),o=n(246),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(245);e.exports=function(e,t){return new r(e,t)}},function(e,t,n){"use strict";const r=n(16),i={attributes:n(543),css:n(544),classNames:n(549),observers:n(551)},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(16),i=n(6),o=n(1)("Collection");e.exports=function(e){let t=[],n={};const s=e||"id";i(this);const a=function(e,t){return r(e[t])?e[t]():e[t]},c=function(e){this.trigger("update",e),this.trigger("update:"+e.target.id,e)}.bind(this),u=function(e){this.remove(e.target,e.reason)}.bind(this);this.reset=function(){t.forEach((function(e){e.off("updated",c,this),e.off("destroyed",u,this)}),this),t=[],n={}},this.destroy=function(e){t.forEach(t=>{t&&"function"==typeof t.destroy&&t.destroy(e,!0)}),this.reset(),this.off()},this.get=function(e){return e&&void 0!==n[e]?t[n[e]]:void 0},this.has=function(e){return e&&void 0!==n[e]},this.toString=function(){return t.toString()},this.where=function(e,n){return r(e)?t.filter(e,n):t.filter(t=>{for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0})},this.find=function(e,n){let i;i=r(e)?e:function(t){for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0},i=i.bind(n);for(let e=0;e<t.length;++e)if(!0===i(t[e]))return t[e];return null},this.forEach=function(e,n){return t.forEach(e,n),this},this.map=function(e){return t.map(e)},this.add=function(e){const r=a(e,s);return this.has(r)?(o.warn(`Model ${r} is already in the collection`,t),this):(n[r]=t.push(e)-1,e.on("updated",c,this),e.on("destroyed",u,this),this.trigger("add",e),this.trigger("add:"+r,e),this)},this.remove=function(e,r){const i=a(e,s);t.splice(n[i],1);for(let e=n[i];e<t.length;++e)n[a(t[e],s)]=e;return delete n[i],e.off("updated",c,this),e.off("destroyed",u,this),this.trigger("remove",e,r),this.trigger("remove:"+i,e,r),this},this._triggerAddEvents=function(){this.where.apply(this,arguments).forEach((function(e){this.trigger("add",e),this.trigger("add:"+a(e,s),e)}),this)},this.length=function(){return t.length}}},function(e,t,n){"use strict";const r=n(1)("deprecation");e.exports=function(e,t,n){let i=void 0===n?{}:n,o=i.value,s=i.name,a=void 0===s?""+t:s,c=i.getWarning,u=void 0===c?"":c,l=i.setWarning,d=void 0===l?"":l,h=i.canSet,p=void 0!==h&&h,f=i.warnOnSet,m=o,g=!1,b=!(void 0!==f&&f);const y={get:()=>(g||(g=!0,r.warn(`${a} is deprecated, and will be removed in the future. ${u}`.trim())),m),set(e){p&&(m=e),b||(b=!0,p?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.scalableVideo?1:e.videoDimensions.width>640&&e.videoDimensions.height>480?3:2}},function(e,t,n){"use strict";const r=n(49);e.exports=function(){function e(e,t){var n;let i=(void 0===t?{}:t).requestAnimationFrame,o=void 0===i?(n=window).requestAnimationFrame.bind(n):i;this._lastCalled=r(),this._audioLevel=void 0,this._running=!1,this._requestAnimationFrame=o,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&&r()-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=r(),this._audioLevel},e}()},function(e,t,n){"use strict";const r=n(254),i=n(581),o=n(149);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(578),i=n(191)((function(e,t,n){r(e,t,n)}));e.exports=i},function(e,t,n){var r=n(62),i=n(52);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(59),i=n(259);e.exports=function(e){return i(r(e).toLowerCase())}},function(e,t,n){var r=n(586)("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(588),i=n(261),o=n(589);e.exports=function(e){return i(e)?o(e):r(e)}},function(e,t,n){"use strict";const r=n(3);e.exports=Boolean(r.isChrome&&r.version>=74||r.isEdge&&r.version>=79)},function(e,t,n){"use strict";const r=n(3);e.exports=e=>!!r.isElectron&&(e instanceof MediaStreamTrack&&"Screen"===e.label)},function(e,t,n){var r=n(99),i=n(595)(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(56);e.exports=function(e){const t=r(e);if(t.backgroundImageURI){const e=t.backgroundImageURI.split(":")[0];t.backgroundImageURI=-1!==["http","https","data"].indexOf(e)?e:"other"}return t}},function(e,t,n){"use strict";const r=n(3);e.exports=()=>{if(!(!r.isNode&&!r.isElectron))return!1;return(r.isChrome||r.isOpera||r.isChromiumEdge)&&r.version>=74||r.isFirefox&&r.version>=68||r.isSafari&&r.version>=11}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(33),i=n(77),o=n(611),s=n(58),a=n(40),c=n(614),u=n(140),l=n(184),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(205),i=n(35),o=n(96),s=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var c=null==n?0:o(n);return c<0&&(c=s(a+c,0)),r(e,i(t,3),c)}},function(e,t,n){var r=n(616);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){"use strict";const r=n(623),i=n(277),o=n(103)();e.exports=(e,t)=>{i(e,(e,n)=>{let i=[];o?"function"==typeof n.values?i=r(n.values()):"function"!=typeof n.forEach?i=Object.keys(n).map(e=>n[e]):n.forEach(e=>{i.push(e)}):n.result().forEach(e=>{const t={};e.names().forEach(n=>{t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,i.push(t)}),t(null,i)})}},function(e,t,n){var r=n(29),i=n(12),o=n(17);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},function(e,t,n){var r=n(625),i=n(30);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){"use strict";const r=n(103)(),i=(e,t)=>{e.getStats(null).then(e=>t(null,e)).catch(t)},o=(e,t)=>{e.getStats(e=>{t(null,e)},t)};e.exports=(e,t)=>{(r?i:o)(e,t)}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(48)),o=n(18),s=r(n(37)),a=r(n(637)),c=r(n(639)),u=r(n(49));const l=(0,r(n(1)).default)("QoS");let d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call(this,...r)||this)._peerConnection=void 0,t._isPublisher=void 0,t.timeoutId=void 0,t._creationTime=(0,u.default)(),t.offerMessagesReceived=0,t.prevStats={timeStamp:(0,u.default)()},t.changeCounters={videoCodec:new c.default,audioCodec:new c.default},t}(0,i.default)(t,e);var n=t.prototype;return n.startCollecting=function(e,n){if(!e||!e.getStats)return;this._isPublisher=n;const r=Boolean(this._peerConnection);if(this._peerConnection=e,r)return;const i=e=>{const n=(0,u.default)(),r={timeStamp:n,duration:Math.round((n-this._creationTime)/1e3),period:Math.round((n-this.prevStats.timeStamp)/1e3)};(0,a.default)(this._peerConnection,this.prevStats,r,this._isPublisher,(n,r)=>{n?l.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,s.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}(o.EventEmitter);d.INITIAL_INTERVAL=1e3,d.INTERVAL=3e4;var h=d;t.default=h},function(e,t,n){"use strict";e.exports=e=>{switch(e>>24){case 0:return"TURN/TLS";case 1:return"TURN/TCP";case 2:return"TURN/UDP";default:return""}}},function(e,t,n){"use strict";const r=n(15),i=n(159).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,p=void 0===h?s():h;const f=!a&&!!u.navigator.webkitGetUserMedia&&!u.navigator.userAgent.match(/android/i)&&void 0!==u.chrome;return{isSupportedInThisBrowser:f,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=f,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(p(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(p(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(p(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=f&&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(p(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(p(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(155),i=n(104);e.exports=function(e){void 0===e&&(e={});const o=e.Archiving||n(644),s=e.AudioLevelMeter||n(282),a=e.AudioLevelTransformer||n(144),c=e.BackingBar||n(283),u=e.Chrome||n(145),l=e.MuteButton||n(284)(),d=e.NamePanel||n(285),h=e.VideoDisabledIndicator||n(286),p=e.StylableComponent||n(152),f=e.logging||n(1)("createChromeMixin");return function(e,n){let m,g,b,y=void 0===n?{}:n,v=y.name,w=y.publishAudio,S=y.publishVideo,E=y.audioSource,T=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 k=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 p=new a,f=new i(()=>{const t=w?p.transform(e.loudness):0;m.setValue(t)});m.watchVisibilityChanged(e=>{e?f.start():f.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!==E&&!1!==E||C.removeAudioTrack(),t())},C.reset=()=>{n(new Error("Chrome still being created")),g&&(g.destroy(),g=null)},C.destroy=()=>{C.reset(),I.releaseAll(),k=null}});k.catch(e=>{e&&"Chrome still being created"===e.message||f.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)}},p(e,{showArchiveStatus:!0,nameDisplayMode:"auto",buttonDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioLevelDisplayMode:x?"auto":"off",archiveStatusDisplayMode:"auto",backgroundImageURI:null},T,e=>{_("SetStyle","Publisher",e,null,.1)});const O=(e,t)=>{k.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",O),I.add(()=>e.off("styleValueChanged",O)),C}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(105),i=n(36),o=n(8),s=n(18);e.exports=function(e){const n=this,a=new s;let c,u,l,d,h=!0,p=!1,f="auto";const m=e.maxValue||1,g=e.minValue||0;function b(){const e=(p&&"auto"===f||"on"===f)&&h;d!==e&&(d=e,a.emit("visibilityChanged",e))}r(n,{audioOnly:{get:()=>p,set(e){p=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){f=e,b()},n.getDisplayMode=function(){return f},n.showAfterLoading=function(){h=!0,b()},n.hideWhileLoading=function(){h=!1,b()},b()}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(36);e.exports=function(e){let t=e.nameMode,n=e.muteMode;function i(){return"on"===t||"on"===n?"on":"mini"===t||"mini"===n?"mini":"mini-auto"===t||"mini-auto"===n?"mini-auto":"auto"===t||"auto"===n?"auto":"off"}r(this,{mode:i(),nodeName:"div",htmlContent:"",htmlAttributes:{className:"OT_bar OT_edge-bar-item"}}),this.setNameMode=function(e){t=e,this.setDisplayMode(i())},this.setMuteMode=function(e){n=e,this.setDisplayMode(i())}}},function(e,t,n){"use strict";const r=n(8),i=n(36),o=n(105);e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||r,n=e.Widget||i;return function(e){let r=e.muted||!1;const i=()=>{r?t.addClass(this.domElement,"OT_active"):t.removeClass(this.domElement,"OT_active ")},s=()=>(r=!r,i(),r?this.parent.trigger("muted",this):this.parent.trigger("unmuted",this),!1);o(this,{muted:{get:()=>r,set(e){r=e,i()}}});const a=r?"OT_edge-bar-item OT_mute OT_active":"OT_edge-bar-item OT_mute";let c;n(this,{mode:e.mode,nodeName:"button",htmlContent:"Mute",htmlAttributes:{className:a,type:"button"},onCreate:e=>{t.on(e,"click",s)},onDestroy:e=>{t.off(e,"click",s)}}),this.remove=()=>{this.domElement&&this.domElement.parentNode&&(c=this.domElement.parentNode,this.domElement.parentNode.removeChild(this.domElement))},this.add=()=>{c&&this.domElement&&!this.domElement.parentNode&&c.appendChild(this.domElement)}}}},function(e,t,n){"use strict";const r=n(36),i=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML};e.exports=function(e){let t=e.name;t&&""!==t.trim().length||(t=null,e.mode="off"),this.setName=function(e){t||this.setDisplayMode("auto"),t=i(e),this.domElement.innerHTML=t}.bind(this),t=i(t),r(this,{mode:e.mode,nodeName:"h1",htmlContent:t,htmlAttributes:{className:"OT_name OT_edge-bar-item"}})}},function(e,t,n){"use strict";const r=n(36),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(159).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(0))},function(e,t,n){"use strict";const r=n(1)("videoContentHint"),i=["","text","motion","detail"],o=e=>i.includes(e),s=e=>{var t;return null==e||null==(t=e.getVideoTracks())?void 0:t[0]};e.exports={isValidVideoContentHint:o,setVideoContentHint:(e,t)=>{if(!o(t))return void r.warn('Invalid content hint. Valid content hints are "text", "detail", "motion", or ""');const n=s(e);n?void 0!==n.contentHint?n.contentHint=t:r.warn("contentHint not supported by this browser"):r.warn("Tried to set contentHint but no video track is present")},getVideoContentHint:e=>{const t=s(e);return(null==t?void 0:t.contentHint)||""}}},function(e,t,n){"use strict";const r=n(105);e.exports=function(){return function(e,t){let n;r(this,{muted:{get:()=>n,set(t){if(n===t)return;n=t;const r=e.getAudioTracks();for(let e=0,t=r.length;e<t;++e)r[e].enabled=!n}}}),void 0!==t?this.muted(!0===t):e.getAudioTracks().length?this.muted(!e.getAudioTracks()[0].enabled):this.muted(!1)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(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(2),i=r(n(4)),o=r(n(5));const s=n(6),a=n(61),c=n(655),u=n(656),l=n(657),d=n(107),h=n(3),p=n(24)().hasAudioOutputApiSupport,f=n(295),m=n(106).getCurrentAudioOutputDeviceId;function g(e,t){const n=document.createElement("video");return u(n),n.autoplay=!0,n.playsinline=!0,n.innerHTML=e,n.setAttribute("autoplay",""),n.setAttribute("playsinline",""),!0===t&&(n.muted="true"),n}function b(){const e=g("");return e.setAttribute("style","display:none"),e}e.exports=function(e){void 0===e&&(e={});const r=e.audioContext||n(158)(),u=e.canBeOrientatedMixin||n(658),y=e.document||(void 0!==typeof window?window:global).document,v=e.listenForTracksEnded||n(659)(),w=e.logging||n(1),S=e.OTHelpers||n(8),E=e.videoElementErrorMap||n(293)(),T=e.WebaudioAudioLevelSampler||n(146),x=e.global||(void 0!==typeof window?window:global);let _=1;return function(){function e(e,t){var n=this;let r=e._inject,c=void 0===r?{}:r,l=c.createVideoElement,d=void 0===l?g:l,p=c.createAudioOnlyVideoElement,m=void 0===p?b:p,y=e.muted,v=e.fallbackText,S=e.widgetType;this._domElement=void 0,this._domAudioOnlyVideoElement=void 0,this._blockedVolume=void 0,this._mediaStoppedListener=void 0,this._audioLevelSampler=void 0,this._playInterrupts=0,this._isVideoLoadedMetaData=!1,this._audioOnlyVideoElementWatcher=void 0,this._blinkStartTime=null,this.logging=w("NativeVideoElementWrapper:"+_),_+=1,s(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 T=!1;this._domElement=d(v,y),this.trigger("videoElementCreated",this._domElement),this._domElementEvents=a(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,o.default)(i.default.mark((function e(){var t,r,o,s,a=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n._isVideoLoadedMetaData=!0,t=a.length,r=new Array(t),o=0;o<t;o++)r[o]=a[o];if(n.trigger("loadedmetadata",...r),!n._domAudioOnlyVideoElement){e.next=10;break}if(s=n._domAudioOnlyVideoElement.srcObject,n._removeAudioOnlyVideoElement(),!s){e.next=10;break}return e.next=9,f();case 9:n.play();case 10:case"end":return e.stop()}}),e)}))));this._domElementEvents.on("error",e=>{this.trigger("error",E(e.target.error))},!1),this._domElementEvents.on("pause",()=>{T||(this.logging.warn("Video element paused, auto-resuming. If you intended to do this, use publishVideo(false) or subscribeToVideo(false) instead."),T=!0),this.play()}),this.on("destroyed",()=>{this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll()}),u(this,()=>this._domElement),h.isSafari&&"subscriber"===this._widgetType&&(this._domAudioOnlyVideoElement=m(),this._bindAudioOnlyVideoElementEvents())}var n=e.prototype;return n._onDomElementLoadStart=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("subscriber"!==this._widgetType||!p()){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,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=m())&&"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,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 1e3,t=h.isiOS,this._audioOnlyVideoElementWatcher=setInterval(()=>{this._domAudioOnlyVideoElement&&this._domAudioOnlyVideoElement.paused&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject,t&&this._domAudioOnlyVideoElement.play())},100),e.next=5,d(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,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._domAudioOnlyVideoElement.srcObject=null,this._domAudioOnlyVideoElement.parentNode.removeChild(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll(),this._domAudioOnlyVideoElement=null;case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.bindAudioTrackOnly=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n,r,o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._stream.getVideoTracks(),n=this._stream.getAudioTracks(),r=t[0],o=void 0===r?{}:r,s=n[0],a=void 0===s?{}:s,e.next=6,f();case 6:c=!o.enabled&&a.enabled,!this._isVideoLoadedMetaData&&c&&this._domAudioOnlyVideoElement&&(this._domAudioOnlyVideoElement.srcObject=new x.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=a(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=S.createElement("canvas",{width:this.videoWidth(),height:this.videoHeight(),style:{display:"none"}});y.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 S.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,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAudioBlocked()){e.next=3;break}return this.logging.warn("Unexpected call to unblockAudio() without blocked audio"),e.abrupt("return");case 3:return t=this._blockedVolume,this._blockedVolume=void 0,this.setAudioVolume(t),e.prev=6,e.next=9,this.play();case 9:e.next=16;break;case 11:throw e.prev=11,e.t0=e.catch(6),this._blockedVolume=t,this._domElement.muted=!0,e.t0;case 16:this.trigger("audioUnblocked");case 17:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(){return e.apply(this,arguments)}}(),n.rebind=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't rebind because _domElement no longer exists");case 2:this._playInterrupts++,this._domElement.srcObject=this._domElement.srcObject,this._hasAudioOnlyVideoElement()&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._createAudioLevelSampler=function(){if(this._removeAudioLevelSampler(),this._stream.getAudioTracks().length>0){try{this._audioContext=r()}catch(e){this.logging.warn("Failed to get AudioContext(), audio level visualisation will not work",e)}this._audioContext&&(this._audioLevelSampler=new T(this._audioContext),this._audioLevelSampler.webRTCStream(this._stream))}},n._removeAudioLevelSampler=function(){this._audioContext&&(delete this._audioContext,delete this._audioLevelSampler)},n._toggleVideoTracks=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: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,f();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,o.default)(i.default.mark((function e(){var t,n,r,o,s,a,c,u,d,p,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._playInterrupts,n=this._hasAudioOnlyVideoElement()?this._domAudioOnlyVideoElement:this._domElement,!h.isSafari){e.next=5;break}return e.next=5,f();case 5:if(!h.isiOS||!h.isSafari){e.next=15;break}if("publisher"!==this._widgetType){e.next=14;break}if(r=h.iOSVersion>=14&&h.iOSVersion<=14.2,o=this._stream.getVideoTracks(),s=o[0],a=void 0===s?{}:s,c=this._stream.getAudioTracks(),u=c[0],d=void 0===u?{}:u,!r||l(n)||!a.enabled){e.next=12;break}return e.abrupt("return");case 12:if(!d.muted){e.next=14;break}return e.abrupt("return");case 14:this._toggleVideoTracks();case 15:return e.prev=15,this._emitVideoPlayAttempt(),e.next=19,n.play();case 19:return this._emitVideoPlaySuccess(),e.abrupt("return");case 23:if(e.prev=23,e.t0=e.catch(15),this._emitVideoPlayFailure(),p=e.t0||{},m=p.name,"AbortError"===m&&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,o.default)(i.default.mark((function e(t){var n,r,s,a=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't bind because _domElement no longer exists");case 2:return this._bindToStream(t),(0,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,a.play();case 3:e.next=26;break;case 5:if(e.prev=5,e.t0=e.catch(0),n=!!t.getAudioTracks().length,!a._hasAudioOnlyVideoElement()||"NotAllowedError"!==e.t0.name){e.next=15;break}return a._domAudioOnlyVideoElement.muted=!0,e.next=12,a.play();case 12:a._domAudioOnlyVideoElement.muted=!1,e.next=26;break;case 15:if(!n){e.next=23;break}return a._blockedVolume=a.getAudioVolume(),a._domElement.muted=!0,e.next=20,a.play();case 20:a.trigger("audioBlocked"),e.next=26;break;case 23:return a._domElement.muted=!0,e.next=26,a.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",Object.assign({},n),Object.assign({},n)),this._domElementEvents.on("resize",()=>{const e=this._domElement,t=e.videoWidth,r=e.videoHeight,i=t!==n.width,o=r!==n.height;(i||o)&&(this.trigger("videoDimensionsChanged",Object.assign({},n),{width:t,height:r}),n.width=t,n.height=r)}),r=()=>{this._mediaStoppedListener.stop(),this._domElement&&(this._domElement.onended=null),this.trigger("mediaStopped")},s=e=>{this.trigger("mediaStopped",e)},this._domElement.onended=()=>r(),this._mediaStoppedListener=v(t,r,s),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&&(S.removeElement(this._domElement),this._domElement=null),this._domAudioOnlyVideoElement&&(S.removeElement(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElement=null),this.trigger("destroyed"),c("NativeVideoElementWrapper",this)},n.setSinkId=function(e){const n=[this._domElement,this._domAudioOnlyVideoElement].map(t=>{if(t)return t.setSinkId(e)});return t.all(n)},e}()}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=()=>new t(e=>setTimeout(e))}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(4)),o=r(n(5)),s=r(n(660)),a=r(n(661)),c=r(n(1));const u=n(9),l=n(47),d=n(60),h=n(6),p=n(298),f=n(299),m=n(669),g=(0,c.default)("PublisherPeerConnection");e.exports=function(e){void 0===e&&(e={});const r=e.getStatsHelpers||n(75),c=e.OTHelpers||n(8),b=e.PeerConnection||n(71)(),y=e.setCertificates||n(163)(),v=e.watchAudioAcquisition||n(671),w=e.createAudioFallbackStateMachine||s.default,S=e.createCongestionLevelEstimator||a.default;return function(e){var n=this;let s,a,E,T,x=e.iceConfig,_=e.webRTCStream,C=e.channels,I=e.sendMessage,R=e.capableSimulcastStreams,k=e.overrideSimulcastEnabled,O=e.logAnalyticsEvent,Z=e.offerOverrides,A=e.answerOverrides,V=e.sourceStreamId,G=e.isP2pEnabled,N=e.sessionId,L=e.keyStore,W=e.sFrameClientStore,X=e.isE2ee,M=e.audioFallbackEnabled,F=e.resolution,P=!1;const j=function(){this.destroy(),P&&(P=!1,this.trigger("iceRestartFailure")),this.trigger("disconnected")},U=function(e){let t=e.reason,n=e.prefix;this.trigger("error",{reason:t,prefix:n})},D=function(e){P&&s.iceConnectionStateIsConnected()&&(P=!1,this.trigger("iceRestartSuccess")),"connected"===e&&("Chrome"===c.env.name&&(a&&a(),a=v(s.getStats.bind(s),()=>this.trigger("audioAcquisitionProblem"))),this.trigger("connected")),this.trigger("iceConnectionStateChange",e)};this._setVideoTrackEncodingActiveState=e=>{const t=this.getSenders().find(e=>"video"===e.track.kind),n=t.getParameters();n.encodings.forEach(t=>{t.active=e}),t.setParameters(n)},h(this),this.setCongestionLevel=e=>{var t;null==(t=E)||t.setCongestionLevel(e)},this.getAudioFallbackState=()=>{var e;return null==(e=E)?void 0:e.getState()},this.startEncryption=e=>{s&&s.startEncryption(e)},this.changeMediaDirectionToInactive=()=>{s&&s.changeMediaDirectionToInactive()},this.changeMediaDirectionToRecvOnly=()=>{s&&s.changeMediaDirectionToRecvOnly()},this.getDataChannel=function(e,t,n){s.getDataChannel(e,t,n)},this.getSourceStreamId=()=>s.getSourceStreamId(),this.destroy=function(){var e;null==(e=T)||e.stop(),a&&(a(),a=null),s&&(s.disconnect(),s=null),this.off()},this.processMessage=function(e,t){s.processMessage(e,t)},this.addTrack=function(e,t,n){return s.addTrack(e,t,n)},this.removeTrack=function(e){return s.removeTrack(e)},this.getLocalStreams=function(){return s.getLocalStreams()},this.init=function(e,t){p(V)&&f(x);const n={iceConfig:x.needRumorIceServersFallback?u(x,{servers:[...e,...x.servers]}):x,channels:C,capableSimulcastStreams:R,overrideSimulcastEnabled:k};y(n,(e,n)=>{if(e)return void t(e);const r=u({logAnalyticsEvent:O,isPublisher:!0,offerOverrides:Z,answerOverrides:A,sourceStreamId:V,p2p:G,sessionId:N,keyStore:L,sFrameClientStore:W,isE2ee:X},n);s=new b(u({sendMessage:I},r)),s.on({close:j,error:U,qos:e=>this.trigger("qos",e),iceConnectionStateChange:D},this),s.addLocalStream(_).then(()=>{t(void 0)}).catch(t)})},this.setIceConfig=e=>{s.setIceConfig(e)},this.generateOffer=()=>{s.generateOfferAndSend()},this.getSenders=function(){return s.getSenders()},this.iceRestart=function(){s&&(P=!0,s.iceRestart())},this.hasRelayCandidates=()=>s.hasRelayCandidates(),this.iceConnectionStateIsConnected=function(){return s.iceConnectionStateIsConnected()},this.findAndReplaceTrack=(e,t)=>s.findAndReplaceTrack(e,t),this._testOnlyGetFramesEncoded=()=>new t((e,t)=>{s.getStats((n,i)=>{if(n)return void t(n);const o=d(i,e=>r.isVideoStat(e,i)&&r.isOutboundStat(e));o?e(l(o,["timestamp","framesEncoded"])):t(new Error("Could not find framesEncoded in getStats report"))})}),this.getStats=e=>s.getStats(e),this.getRtcStatsReport=e=>s.getRtcStatsReport(e),this.setVideoActiveState=e=>{this._setVideoTrackEncodingActiveState(e),M&&(e?this.enableCongestionLevelEstimation():this.disableCongestionLevelEstimation())},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=m(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]])}))),this.disableCongestionLevelEstimation=()=>{var e,t;M&&(null==(e=T)||e.stop(),null==(t=E)||t.reset())},this.enableCongestionLevelEstimation=e=>{var t;M&&(e&&E.setState(e),null==(t=T)||t.start())};const H=()=>{T=S({resolution:F,getStats:this.getStats}),this.on("connected",()=>{T.start()})};if(M){(()=>{E=w(),E.on("stateChange",e=>{let t=e.previousState,n=e.state;this.trigger("audioFallbackStateChange",{previousState:t,state:n})})})(),H();(()=>{let e;T.on("congestionLevel",t=>{t!==e&&(e=t,g.info(`Congestion level changed to: ${t} for pc: ${this.getSourceStreamId()}`))})})()}}}}).call(this,n(0))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={bandwidthCriticalThreshold:7e4,bandwidthFairThreshold:0,packetLossCriticalThreshold:.15,packetLossCriticalThresholdMediumBw:.2,criticalCongestionPeriod:4e3};t.default=r},function(e,t,n){"use strict";const r=n(668);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(71)(),c=e.SinglePeerConnectionAdapter||n(672)(),u=e.setCertificates||n(163)(),l=e.Errors||n(7),d=e.ExceptionCodes||n(10),h=e.OTErrorClass||n(22),p=e.watchSubscriberAudio||n(673);return function(e){let n=e.clientCandidates,f=e.iceConfig,m=e.send,g=e.logAnalyticsEvent,b=e.p2p,y=e.codecFlags,v=e.sourceStreamId,w=e.remoteConnectionId,S=e._singlePeerConnectionController,E=e.keyStore,T=e.sFrameClientStore,x=e.isE2ee;const _=this;let C,I=!1,R=!1,k=null;const O=!!S;let Z=!1;const A=[],V=[],G=function(){this.destroy(),R&&this.trigger("iceRestartFailure",this),this.trigger("disconnected",this)},N=e=>{this.trigger("remoteStreamRemoved",e,this)},L=e=>{Z||(e.onremovetrack=t=>{(e=>{const t="video"===e.kind?A:V,n=t.indexOf(e);n>-1&&t.splice(n,1)})(t),O&&C&&C.removeTrack(t),setTimeout(()=>{A.length||V.length||N(e)},100)},Z=!0)},W=e=>{const t=e.stream;(e=>{const t="video"===e.kind?A:V;t.includes(e)||t.push(e)})(e.track),L(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)},D=function(e){this.trigger("signalingStateStable",e)},H=(e,t)=>{"answer"!==e&&"pranswer"!==e||this.trigger("connected"),m(e,t)};i(this),this._hasAudioTracks=()=>V.length>0,this._hasVideoTracks=()=>A.length>0,this._getVideoTracks=()=>A,this._getAudioTracks=()=>V,this._getTracks=()=>[...V,...A],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.generateOfferAndSend()},this.startAudioStatsWatcher=function(e){k||(k=p(C.getStats.bind(C),e=>{this.stopAudioStatsWatcher(),this.trigger("audioLevelStuckWarning",e)},e))},this.stopAudioStatsWatcher=function(){k&&k.stop(),k=null};const Y=function(e){return function(t){const n="video"===e?A:V;C&&C.remoteTracks().forEach(r=>{r.kind===e&&r.enabled!==t&&n.includes(r)&&(r.enabled=t)})}};this.subscribeToAudio=Y("audio"),this.subscribeToVideo=Y("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(f);u({iceConfig:f},(t,i)=>{if(t)return void e(t);const o=r({logAnalyticsEvent:g,clientCandidates:n,codecFlags:y,sourceStreamId:v,keyStore:E,sFrameClientStore:T,isE2ee:x},i),s=r({sendMessage:H,p2p:b},o,{remoteConnectionId:w});C=O?new c(s,S):new a(s),C.on({iceConnected:()=>_.emit("iceConnected"),close:G,trackAdded:W,signalingStateChange:U,signalingStateStable:D,error:P,qos:e=>this.trigger("qos",e),iceConnectionStateChange:j,remoteVideoSupported:X,decryptFailed:M,decryptRestored:F},_),!O&&C.remoteTracks().length>0?C.remoteStreams().forEach(e=>{e.getTracks().forEach(t=>W({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(160)())("NotPublishing",["NotPublishing","GetUserMedia","BindingMedia","MediaBound","PublishingToSession","Publishing","Failed","Destroyed"],{NotPublishing:["NotPublishing","GetUserMedia","Destroyed"],GetUserMedia:["BindingMedia","Failed","NotPublishing","Destroyed"],BindingMedia:["MediaBound","Failed","NotPublishing","Destroyed"],MediaBound:["NotPublishing","PublishingToSession","Failed","Destroyed"],PublishingToSession:["NotPublishing","Publishing","Failed","Destroyed","MediaBound"],Publishing:["NotPublishing","MediaBound","Failed","Destroyed"],Failed:["Destroyed"],Destroyed:[]});return t.prototype.isDestroyed=function(){return"Destroyed"===this.current},t.prototype.isAttemptingToPublish=function(){return-1!==["GetUserMedia","BindingMedia","MediaBound","PublishingToSession"].indexOf(this.current)},t.prototype.isPublishing=function(){return"Publishing"===this.current},t}},function(e,t,n){"use strict";function r(e){this.message=e||"Operation has been canceled.",this.name="CancellationError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.prototype=Object.create(Error.prototype),r.prototype.constructor=r},function(e,t,n){var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r.resolve(e).then(e=>r.resolve(t()).then(()=>e),e=>r.resolve(t()).then(()=>r.reject(e)))}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(4)),o=r(n(5));const s=n(141),a=n(254),c=n(9),u=n(276),l=n(57),d=n(50),h=n(165).CancellationError,p=n(15),f=n(18),m=n(49),g=n(267),b=n(26),y=n(6),v=n(683),w=n(104),S=n(61),E=n(684),T=n(7),x=n(164)(),_=n(685),C=n(282),I=n(144),R=n(283),k=n(145),O=n(3),Z=n(7),A=n(23)(),V=n(10),G=n(75),N=n(306),L=n(307),W=n(686),X=n(162)(),M=n(1)("Subscriber"),F=n(284)(),P=n(285),j=n(13)(),U=n(22),D=n(8),H=n(152),Y=n(143)(void 0!==typeof window?window:global),B=n(71)({global:Y}),J=n(300)({PeerConnection:B}),K=n(308),z=n(286),Q=n(689),q=n(690),$=n(691),ee=n(309),te=n(102).parseIceServers,ne=n(692),re=n(693),ie=n(694),oe=n(311),se=n(167),ae=n(312),ce=(e,t)=>e.connection.id===t.connection.id;e.exports=function(e){let n=void 0===e?{}:e,r=n.AudioLevelMeter,Y=void 0===r?C:r,B=n.AudioLevelTransformer,ue=void 0===B?I:B,le=n.BackingBar,de=void 0===le?R:le,he=n.Chrome,pe=void 0===he?k:he,fe=n.env,me=void 0===fe?O:fe,ge=n.Errors,be=void 0===ge?Z:ge,ye=n.Events,ve=void 0===ye?A:ye,we=n.ExceptionCodes,Se=void 0===we?V:we,Ee=n.audioLevelSampler,Te=void 0===Ee?W:Ee,xe=n.getStatsHelpers,_e=void 0===xe?G:xe,Ce=n.hasAudioOutputLevelStatCapability,Ie=void 0===Ce?N:Ce,Re=n.hasRemoteStreamsWithWebAudio,ke=void 0===Re?L:Re,Oe=n.interpretPeerConnectionError,Ze=void 0===Oe?X:Oe,Ae=n.logging,Ve=void 0===Ae?M:Ae,Ge=n.MuteButton,Ne=void 0===Ge?F:Ge,Le=n.NamePanel,We=void 0===Le?P:Le,Xe=n.otError,Me=void 0===Xe?j:Xe,Fe=n.OTErrorClass,Pe=void 0===Fe?U:Fe,je=n.OTHelpers,Ue=void 0===je?D:je,De=n.StylableComponent,He=void 0===De?H:De,Ye=n.SubscriberPeerConnection,Be=void 0===Ye?J:Ye,Je=n.SubscribingState,Ke=void 0===Je?K:Je,ze=n.VideoDisabledIndicator,Qe=void 0===ze?z:ze,qe=n.AudioBlockedIndicator,$e=void 0===qe?Q:qe,et=n.VideoUnsupportedIndicator,tt=void 0===et?q:et,nt=n.watchFrameRate,rt=void 0===nt?$:nt,it=n.createSendMethod,ot=void 0===it?ee:it,st=n.parseIceServers,at=void 0===st?te:st,ct=n.document,ut=void 0===ct?(void 0!==typeof window?window:global).document:ct,lt=n.WidgetView,dt=void 0===lt?x:lt;const ht=function e(n,r,x){var C,I=this;if(void 0===r&&(r={}),void 0===x&&(x=()=>{}),void 0===r.analytics)throw new Error("Subscriber requires an instance of analytics");const R=r.analytics,k=p(),O=e.hasAudioOutputLevelStatCapability()||ke(),Z=this,A={},V={},G={},N={},L={},W=new ae;let X,M,F,P,j,U,D,H,B,J,K,z,Q,q,$=!1,ee=n||k,te=r.session,le=r.stream;const he=r._singlePeerConnectionController,fe=void 0!==he;let ge,ye,we,Ee,xe,Ce=!1,Ie={},Re=null,Oe=!1,Ae=!0,Ge=[],Le=s({},r,{showControls:!0,testNetwork:!1,fitMode:le.defaultFitMode||"cover",insertDefaultUI:!0,initials:le.initials});const Xe=te.sessionInfo.isAdaptiveEnabled,Fe={P2P:b.SUBSCRIBER_DISCONNECTED,MANTIS:b.SUBSCRIBER_DISCONNECTED},je="Chrome"===me.name&&me.version>=58||me.isChromiumEdge||me.isOpera,De=te._.getSocket(),Ye=()=>u(V),Be=e=>V[e],Je=()=>V[xe],ze=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V[t];case 2:null==(n=e.sent)||n.close(),delete V[t];case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qe=e=>{delete G[e]},et=()=>{Ye().forEach(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;case 2:e.sent.destroy();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object.keys(V).forEach(e=>{delete V[e]})},nt=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(t){e.next=2;break}return e.abrupt("return");case 2:return n={error:Et,audioVolume:ye},r=Xe&&"P2P"===xe,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 h||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 Et(e.t0),e.t0;case 18:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t){return e.apply(this,arguments)}}(),it=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:if(r=!1,"function"==typeof t?n=t:r="rtcStatsReport"===t,r?Mt():Xt(),!r||oe){e.next=7;break}return o=Se.GET_RTC_STATS_REPORT_NOT_SUPPORTED,n(Me(T.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(Pe.getTitleByCode(o)),o)),e.abrupt("return");case 7:if(Je()){e.next=11;break}return o=Se.PEER_CONNECTION_NOT_CONNECTED,n(Me(be.PEER_CONNECTION_NOT_CONNECTED,new Error(Pe.getTitleByCode(o)),o)),e.abrupt("return");case 11:return e.next=13,Je();case 13:s=e.sent,(r?s.getRtcStatsReport:s.getStats)((e,t)=>{e?(e.code===Se.PEER_CONNECTION_NOT_CONNECTED&&(e=Me(be.PEER_CONNECTION_NOT_CONNECTED,e,Se.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)}}(),st=e=>!(!B||!ge)&&("video"===e?B.getVideoTracks().length>0&&ge.getVideoTracks().length>0:B.getAudioTracks().length>0&&ge.getAudioTracks().length>0),ct=(e,t,n,r,i)=>{let o=c({action:e,variation:t,payload:n,streamId:le?le.id:null,sessionId:te?te.sessionId:null,connectionId:te&&te.isConnected()?te.connection.connectionId:null,partnerId:te&&te.sessionInfo?te.sessionInfo.partnerId:null,subscriberId:k,widgetType:"Subscriber"},r);("Failure"===t||"iceconnectionstatechange"===t&&"closed"===n)&&(o=c(o,Ie));const s=[o];i&&s.push(i),R.logEvent(...s)},lt=(e,t,n)=>{"Attempt"===t?(N[e]=(new Date).getTime(),ct(e,t,n)):"Failure"!==t&&"Success"!==t||ct(e,t,n,{attemptDuration:(new Date).getTime()-N[e]})},dt=function(e,t){void 0===t&&(t={}),lt("RoutedToRelayedTransition",e,t)},ht=function(e,t){void 0===t&&(t={}),lt("RelayedToRoutedTransition",e,t)},pt=re({onInvalidTransition(e,t){const n=`Invalid state transition: Event '${e}' not possible in state '${t}'`;Ve.error(n),ct("Subscriber:InvalidStateTransition","Event",{details:n})}});{const e="Unable to subscribe to stream in a reasonable amount of time";ne({connectivityState:pt,onWarning(){ft("Warning",{})},onTimeout:()=>{if(X&&X.addError(e),U.isAttemptingToSubscribe()){U.set("Failed"),this._disconnect({noStateTransition:!0});const t=Me(T.TIMEOUT,new Error(e),Se.UNABLE_TO_SUBSCRIBE);pt.fail({options:{failureReason:"Subscribe",failureMessage:e,failureCode:Se.UNABLE_TO_SUBSCRIBE},error:t})}},warningMs:15e3,timeoutMs:3e4})}if(A.promise=new t((e,t)=>{A.resolve=e,A.reject=t}),Le.testNetwork&&te.sessionInfo.p2pEnabled&&Ve.warn("You cannot test your network with a relayed session. Use a routed session."),this.id=ee,this.widgetId=k,this.session=te,this.stream=Le.stream,le=Le.stream,this.streamId=le.id,!te)return Pe.handleJsException({errorMsg:"OT.Subscriber must be passed a session option",code:2e3,target:this,analytics:R}),null;y(this),Z.once("subscribeComplete",(function(){try{x(...arguments)}catch(e){Ve.error("Completion handler threw an exception",e)}})),te.on("captionReceived",e=>{e.streamId===Z.streamId&&(this.dispatchEvent(e),this.trigger(b.SUBSCRIBER_CAPTION_RECEIVED,e))});pt.observe({onEnterConnecting(){ft("Attempt",null,{})},onEnterConnected(){ft("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;ft((e=>{let t=e.transition,n=e.from;return"fail"===t?"connected"===n?"Disconnect":"Failure":"disconnect"===t&&"connected"===n?"Disconnect":"Cancel"})(e),s,i)}}),pt.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)}}),ie({connectivityState:pt,logAttempt(){ct("Subscribe","Attempting",null,{connectionId:te&&te.isConnected()?te.connection.connectionId:null})}});const ft=function(e,t,n){void 0===t&&(t={}),"Failure"===e||"Success"===e||"Cancel"===e?ct("Subscribe",e,t,Object.assign({},n,{attemptDuration:(new Date).getTime()-z})):"Attempt"===e?(z=(new Date).getTime(),ct("Subscribe",e,Object.assign({},t,{testNetwork:Le.testNetwork}),n)):ct("Subscribe",e,t,n)},mt=(e,t)=>{ct("ICERestart",e,t)},gt=e=>{var t,n;let r=e.parsedStats,i=e.remoteConnectionId,o=e.peerId,s=e.sourceStreamId;const a={widgetType:"Subscriber",width:X.width,height:X.height,audioTrack:st("audio"),hasAudio:le&&le.hasAudio,subscribeToAudio:q,audioVolume:this.getAudioVolume(),videoTrack:st("video"),connectionId:te?te.connection.connectionId:null,hasVideo:le&&le.hasVideo,subscribeToVideo:Le.subscribeToVideo,congestionLevel:Re,streamId:le.id,subscriberId:k,duration:Math.round((m()-j)/1e3),remoteConnectionId:i,peerId:o,sourceStreamId:se(s),preferredResolutionHeight:null==(t=Le.preferredResolution)?void 0:t.height,preferredResolutionWidth:null==(n=Le.preferredResolution)?void 0:n.width,preferredFrameRate:Le.preferredFrameRate,audioFallback:!J&&"auto"===K,initials:le.initials},u=c(a,r);R.logQOS(u),this.trigger("qos",Object.assign({},R.commonQoSFields(),u))},bt=()=>{!U.isSubscribing()&&X&&X.video()&&($=!0,Oe||(pt.connect(),Oe=!0),Ve.debug("OT.Subscriber.onLoaded"),U.set("Subscribing"),j=m(),X.loading(!1),M&&M.showAfterLoading(),Ce&&le.setRestrictFrameRate(!0),P&&P.audioOnly(X.audioOnly()),this.setAudioVolume(ye),this.trigger("loaded",this))},yt=()=>le&&le.hasAudio&&q&&this.getAudioVolume()>0&&!this.isAudioBlocked(),vt=e=>{let t=!1;if(!("audioLevelStuckAt0"===e&&(!yt()||le&&le.hasVideo))&&(ct("subscriber:onAudioWarning","Event",{reason:e}),X)){if(X.rebindSrcObject(),ct("subscriber:rebindSrcObject","Called"),"audioLevelStuck"===e)return;t=!0}wt(t)},wt=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(void 0===t&&(t=!1),!je){e.next=6;break}return e.next=4,Je();case 4:e.sent.startAudioStatsWatcher(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),St=()=>{Ve.debug("OT.Subscriber has been disconnected from the Publisher's PeerConnection"),pt.fail({options:{failureReason:"PeerConnectionError",failureCode:Se.UNABLE_TO_PUBLISH,failureMessage:"PeerConnection disconnected"},error:Me(be.DISCONNECTED,new Error("ClientDisconnected"))}),this._disconnect({noStateTransition:!0}),(U.isAttemptingToSubscribe()||U.isSubscribing())&&U.set("Failed")},Et=e=>{const t=Me(be.MEDIA_ERR_DECODE,e,e.code||Se.P2P_CONNECTION_FAILED);t.message="OT.Subscriber while playing stream: "+t.message,Ve.error("OT.Subscriber.onVideoError"),pt.fail({options:{failureReason:"VideoElement",failureMessage:t.message,failureCode:t.code||Se.P2P_CONNECTION_FAILED},error:t});const n=U.isAttemptingToSubscribe();U.set("Failed"),n||Z.trigger("error",t.message),Pe.handleJsException({error:t,code:Se.UNABLE_TO_SUBSCRIBE,target:Z,analytics:R})},Tt=e=>{const t=E(e);Pe.handleJsException({error:t,code:t.code,target:Z,analytics:R}),this._disconnect({noStateTransition:!0});const n={failureReason:"Subscribe",failureMessage:"OT.Subscriber PeerConnection Error: "+t.message,failureCode:Se.P2P_CONNECTION_FAILED};Lt(t.code,t.message),pt.fail({options:n,error:Me(t.name,new Error("Subscribe: Subscriber PeerConnection with connection (not found) failed: "+t.message),t.code)}),t.name===T.STREAM_NOT_FOUND&&this._destroy({reason:"streamNotFound",noStateTransition:!0})},xt=(e,t,n,r)=>{if("SetRemoteDescription"===r&&!Ae&&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"===Ue.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=Se.UNSUPPORTED_VIDEO_CODEC,void Et(e)}if("ICEWorkflow"===r&&te.sessionInfo.reconnection&&$)return void Ve.debug("Ignoring peer connection failure due to possibility of reconnection.");let i;i="ICEWorkflow"===r?Se.SUBSCRIBER_ICE_WORKFLOW_FAILED:e===Se.STREAM_LIMIT_EXCEEDED?e:Se.P2P_CONNECTION_FAILED;const o={failureReason:r||"PeerConnectionError",failureMessage:"OT.Subscriber PeerConnection Error: "+t,failureCode:i},s=Ze(e,t,r,"(not found)","Subscriber");if(pt.fail({options:o,error:s}),U.isAttemptingToSubscribe()){const e={hasRelayCandidates:n&&n.hasRelayCandidates()};ct("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}),Pe.handleJsException({error:s,errorMsg:"OT.Subscriber PeerConnection Error: "+t,code:i,target:this,analytics:R}),Lt(e)},_t=e=>{const t=e._hasVideoTracks(),n=e._hasAudioTracks(),r=le&&le.hasVideo&&!t,i=le&&le.hasAudio&&!n;return!(r||i)},Ct=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v(()=>_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}Ve.error("The expected tracks never arrived"),e.next=12;break;case 11:throw e.t0;case 12:return r=n.getSourceStreamId(),fe&&"MANTIS"===r&&he.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,o.default)(i.default.mark((function e(n,r){var o,s,a,c,u,l,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ge=n,fe&&(ge=new MediaStream(r._getTracks())),o=1===Object.keys(G).length,s=null==r?void 0:r.getSourceStreamId(),a=te.sessionInfo,B=n,s&&(G[s]=n),Ve.debug("OT.Subscriber.onRemoteStreamAdded with sourceStreamId",s),U.set("BindingRemoteStream"),I.subscribeToAudio(q),K="loading",I.subscribeToVideo(Le.subscribeToVideo,"loading"),a.p2pEnabled||"P2P"===s||(I.setPreferredResolution(Le.preferredResolution),I.setPreferredFrameRate(Le.preferredFrameRate)),r&&r._getVideoTracks().forEach(e=>{(void 0!==typeof window?window:global).webkitMediaStream?e.enabled=!1:e.enabled=le.hasVideo&&Le.subscribeToVideo}),e.next=16,nt(ge);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=le.hasVideo&&Le.subscribeToVideo}),(c=X&&X.video())&&c.orientation({width:le.videoDimensions.width,height:le.videoDimensions.height,videoOrientation:le.videoDimensions.orientation}),(u=M&&M.videoUnsupportedIndicator)&&u.setVideoUnsupported(!Ae),l=new t((e,t)=>{const n=X&&X.video();n&&n.domElement()?e():(X.once("videoElementCreated",e),Z.once("destroyed",t))}),e.next=27,l;case 27:return e.next=29,A.promise;case 29:o?U.set("Subscribing"):bt(),D&&"webRTCStream"in D&&r._hasAudioTracks()&&D.webRTCStream(n),((d=Ue.env).isSafari||d.isChromiumEdge||d.isOpera||"Chrome"===d.name&&d.version>=58||d.isFirefox&&d.version>=96)&&(Ee&&(Ee.destroy(),Ee=null),r&&(Ee=rt(r.getStats.bind(r)))),o||I.trigger("streamAdded",I),W.finishTransitionTo(xe);case 35:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Rt=e=>{Ve.debug("OT.Subscriber.onStreamRemoved");const t=X&&X.video();t&&t.stream===e&&X.destroyVideo(),qe(xe),ge=null,this.trigger("streamRemoved",this)},kt=e=>{Ae!==e&&this.dispatchEvent(new ve.VideoEnabledChangedEvent(e?"videoEnabled":"videoDisabled",{reason:e?"codecChanged":"codecNotSupported"})),Ae=e},Ot=e=>{X.setAudioBlockedUi(e);const t=M&&M.audioBlockedIndicator;t&&t.setAudioBlocked(e);const n=M&&M.videoUnsupportedIndicator;n&&n.setVideoUnsupported(!e&&!Ae)};this.on("audioBlocked",()=>{Ot(!0)}),this.on("audioUnblocked",()=>{Ot(!1)});const Zt={new:b.SUBSCRIBER_DISCONNECTED,checking:b.SUBSCRIBER_DISCONNECTED,connected:b.SUBSCRIBER_CONNECTED,completed:b.SUBSCRIBER_CONNECTED,disconnected:b.SUBSCRIBER_DISCONNECTED},At=(e,t)=>{const n=Zt[e],r=t.getSourceStreamId(),s=Fe[r];n&&n!==s&&(Fe[r]=n,"disconnected"===e&&"P2P"!==r&&setTimeout((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=te._.isSocketReconnecting,"disconnected"!==Fe[r]||!De.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!==b.SUBSCRIBER_CONNECTED),Ve.debug("OT.Subscriber.connectionStateChanged to "+e),this.dispatchEvent(new ve.ConnectionStateChangedEvent(n,this)))},Vt=()=>{mt("Success")},Gt=()=>{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:()=>le.getChannelsOfType("audio").length>0?Z.getStyle("buttonDisplayMode"):"off",update(){const e=F.get();M&&(M.muteButton.setDisplayMode(e),M.backingBar.setMuteMode(e))}};const Nt=()=>{const e={backingBar:new de({nameMode:Le.name?this.getStyle("nameDisplayMode"):"off",muteMode:F.get()}),name:new We({name:Le.name,mode:this.getStyle("nameDisplayMode")}),muteButton:new Ne({muted:0===ye,mode:F.get()})};if(O){const t=new ue;P=new Y({mode:Z.getStyle("audioLevelDisplayMode")});const n=new w(()=>{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 $e({mode:this.getStyle("audioBlockedDisplayMode")}),e.videoUnsupportedIndicator=new tt({mode:this.getStyle("videoUnsupportedDisplayMode")}),X&&X.domElement&&(M=new pe({parent:X.domElement}).set(e).on({muted(){Z.setAudioVolume(0)},unmuted(){Z.setAudioVolume(we)}},this),M.hideWhileLoading())},Lt=(e,t)=>{let n,r;X&&(e===Se.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=Oe?"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 Wt(e){Ye().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.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||!ge||!ge.getVideoTracks().length;X&&(X.audioOnly(t),X.showPoster(t)),P&&P.audioOnly(t)}He(this,{nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioBlockedDisplayMode:"auto",backgroundImageURI:null,showArchiveStatus:!0,showMicButton:!0},Le.showControls,e=>{ct("SetStyle","Subscriber",e,null,.1)});const Xt=d(()=>{ct("GetStats","Called")}),Mt=d(()=>{ct("GetRtcStatsReport","Called")}),Ft=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 H&&(H.destroy(),H=void 0),e.prev=1,e.next=4,v(()=>t._hasAudioTracks());case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return");case 9:D=Te(t),D?H=_({subscriber:I,audioLevelSampler:D}):Object.prototype.hasOwnProperty.call(I,"loudness")||(Object.defineProperty(I,"loudness",{value:void 0,configurable:!0,writable:!1}),Ve.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(L[t]){L[t].removeAll();const n=()=>{e.off("error",n),e.off("disconnected",n)};e.on("error",n),e.on("disconnected",n)}const n=S(e);n.once("connected",()=>(e=>{Xe&&"P2P"===e.getSourceStreamId()&&dt("Success")})(e)),n.on("disconnected",St),n.on("error",xt),n.once("remoteTrackAdded",(0,o.default)(i.default.mark((function t(){var n=arguments;return i.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),Ve.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[2,7]])})))),n.on("audioLevelStuckWarning",vt),n.on("signalingStateStable",(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Z.trigger("signalingStateStable"),X&&X.video()&&B&&D&&"webRTCStream"in D&&e._hasAudioTracks()&&D.webRTCStream(B);case 3:case"end":return t.stop()}}),t)})))),n.on("iceConnectionStateChange",t=>At(t,e)),n.on("iceRestartSuccess",Vt),n.on("iceRestartFailure",Gt),n.on("remoteVideoSupported",kt),n.on("remoteStreamRemoved",Rt),n.on("decryptFailed",()=>{this.trigger("encryptionSecretMismatch"),ct("encryptionSecretMismatch","Event"),Ve.warn("Media cannot be decrypted due to an encryption secret mismatch.")}),n.on("decryptRestored",()=>{this.trigger("encryptionSecretMatch"),ct("encryptionSecretMatch","Event")}),L[t]=L},jt=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 dt("Attempt"),e.next=3,Be("MANTIS");case 3:if(null!=(t=e.sent)&&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:De.subscriberCreate(le.id,k,$t,"P2P",te._.isE2ee(),(e,t)=>{e&&!pt.is("disconnected")&&dt("Failure",e),Ve.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,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Le.testNetwork&&!ce(le,te)&&"P2P"===xe){e.next=2;break}return e.abrupt("return");case 2:if(ht("Attempt"),B=G.MANTIS,ge=B,!fe){e.next=10;break}return e.next=8,Be("MANTIS");case 8:t=e.sent,ge=new MediaStream(t._getTracks());case 10:return e.next=12,nt(ge);case 12:return X.loading(!1),ze("P2P"),xe="MANTIS",qe("P2P"),e.next=18,Je();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"),Ee&&(Ee.destroy(),Ee=null),Ie={sessionId:te.sessionId,connectionId:te&&te.isConnected()?te.connection.connectionId:null,partnerId:te&&te.sessionInfo?te.sessionInfo.partnerId:null,streamId:le&&!le.destroyed?le.id:null},this._disconnect({reason:n,noStateTransition:o}),M&&(M.destroy(),M=null),X&&(X.destroy(),X.off(),X=null,this.element=null),le&&!le.destroyed&&ct("unsubscribe",null,{streamId:le.id}),le.off(Q,this),this.id=null,ee=null,this.stream=null,le=null,this.streamId=null,this.session=null,te=null,Le=null,!0!==r&&(this.dispatchEvent(new ve.DestroyedEvent(b.SUBSCRIBER_DESTROYED,this,n)),this.off())),this},this.destroy=function(e,t){void 0===e&&(e="Unsubscribe"),Ve.warn("Subscriber#destroy is deprecated and will be removed. Please use Session#unsubscribe instead"),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&&!pt.is("disconnected")){const e="Unsubscribe"===r?void 0:Me(be.STREAM_DESTROYED,new Error("Stream was destroyed before it could be subscribed to"));pt.disconnect({payload:{reason:r},error:e})}U.isDestroyed()||U.isFailed()||U.set("NotSubscribing"),X&&X.destroyVideo(),De.is("connected")&&le&&!le.destroyed&&De.subscriberDestroy(le.id,I.widgetId),et()},this.disconnect=()=>{Ve.warn("Subscriber#disconnect is deprecated and will be removed. Please use Session#unsubscribe instead"),this._disconnect({reason:"Unsubscribe"})};const Dt=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,s,a,c,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,r=t.fromConnectionId,o=t.sourceStreamId,i={apiKey:te.apiKey,sessionId:te.sessionId,streamId:le.id,subscriberId:I.widgetId},s=["/v2/partner",i.apiKey,"session",i.sessionId,"stream",i.streamId,"subscriber",i.subscriberId].join("/"),a=ot({socket:I.session._.getSocket(),uri:s,content:{peerId:n,sourceStreamId:o}}),c=function(e,t,r,i,s){void 0===i&&(i={});const a=Object.assign({peerId:n,sourceStreamId:se(o)},i);return ct(e,t,r,a,s)},u=e=>{xe===o&&gt(Object.assign({},e,{peerId:n,remoteConnectionId:r,sourceStreamId:o}))},e.abrupt("return",I._setupPeerConnection({send:a,log:c,logQoS:u,sourceStreamId:o}));case 6:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}();function Ht(e){const t=X&&X.video();if(t)try{t.setAudioVolume(e)}catch(e){Ve.warn("setAudioVolume: "+e),0===ye&&(Ve.info("Using subscribeToAudio to mute Audio because setAudioVolume(0) failed"),Z.subscribeToAudio(!1))}M&&M.muteButton.muted(0===e)}this.processMessage=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r){var o,s,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ve.debug(`OT.Subscriber.processMessage: Received ${t} message from ${n}`),Ve.debug(r),o=l(r,"content.peerId"),s=l(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,Dt({peerId:o,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"!==K)return void Ve.info("Video was not re-enabled because it was manually disabled");Ve.info("Video has been re-enabled")}else Ve.warn("Due to high packet loss and low bandwidth, video has been disabled");this.subscribeToVideo(e,"auto");ct("updateQuality","video",e?{videoEnabled:!0}:{videoDisabled:!0})},this.getImgData=()=>{if(!this.isSubscribing())return Ve.error("OT.Subscriber.getImgData: Cannot getImgData before the Subscriber is subscribing."),null;const e=X&&X.video();return e?e.imgData():null},this.getStats=e=>{(e=>{it(e)})((t,n)=>{if(t)return void e(t);const r={timestamp:0};n.forEach(e=>{if(_e.isInboundStat(e)){const t=_e.isVideoStat(e,n),i=_e.isAudioStat(e,n);(i||t)&&(r.timestamp=_e.normalizeTimestamp(e.timestamp)),t?(a(r,{video:_e.parseStatCategory(e)}),Ee&&a(r,{video:{frameRate:Ee.getFrameRateFromStat(e)}})):i&&a(r,{audio:_e.parseStatCategory(e)})}}),e(null,r)})},this.getRtcStatsReport=()=>new t((e,t)=>{it("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 ct("setAudioVolume","Attempt",{audioVolume:t}),isNaN(t)?(Ve.error("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),ct("setAudioVolume","Failure",{message:"value should be an integer between 0 and 100"}),this):(t!==e&&Ve.warn("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),t===ye?(Ht(ye),ct("setAudioVolume","Success",{audioVolume:ye,message:"Requested volume is same as already set audioVolume"}),this):(ye>0&&(we=ye),ye=t,Ht(ye),ye>0&&!q&&(we=ye,this.subscribeToAudio(!0)),ct("setAudioVolume","Success",{audioVolume:ye}),this))},this.getAudioVolume=()=>{const e=X&&X.video();if(e)try{return e.getAudioVolume()}catch(e){Ve.warn("getAudioVolume "+e)}return ye},this.subscribeToAudio=e=>{const t=g(e,!0);Ye().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.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)}}()),le&&0!==Ye().length&&le.setChannelActiveState("audio",t);const n=q!==t;return q=t,n&&this.setAudioVolume(t?we:0),ct("subscribeToAudio","Event",{subscribeToAudio:t}),this};const Yt={auto:"quality",publishVideo:"publishVideo",subscribeToVideo:"subscribeToVideo"};if("Safari"===me.name){const e=()=>{!ut.hidden&&Le.subscribeToVideo&&(Ve.debug("document visibility restored in Safari - resubscribing to video"),this.subscribeToVideo(!1),this.subscribeToVideo(!0))};ut.addEventListener("visibilitychange",e),this.once("destroyed",()=>{ut.removeEventListener("visibilitychange",e)})}var Bt,Jt;if(this.subscribeToVideo=(e,t)=>{const n=g(e,!0),r=!n&&"auto"===t;return r&&(Re=2),ct("subscribeToVideo","Attempt",{subscribeToVideo:n,reason:t}),Wt(!n||!le.hasVideo||!B),le.hasVideo&&!st("video")?(n&&Ve.info("Subscriber is audio-only due to incompatibility, can't subscribeToVideo."),Le.subscribeToVideo=!1,ct("subscribeToVideo","Failure",{message:"No video tracks available"}),this):(M&&M.videoDisabledIndicator&&M.videoDisabledIndicator.disableVideo(r),Ye().length>0&&te&&le&&(n!==Le.subscribeToVideo||t!==K)&&le.setChannelActiveState("video",n,t),Le.subscribeToVideo=n,K=t,J=n,ct("subscribeToVideo","Success",{subscribeToVideo:n,reason:t}),"loading"!==t&&this.dispatchEvent(new ve.VideoEnabledChangedEvent(n?"videoEnabled":"videoDisabled",{reason:Yt[t]||"subscribeToVideo"})),this)},this.setPreferredResolution=e=>{if(U.isDestroyed()||0===Ye().length&&"Connecting"===!U.current)return void Ve.warn("Cannot set the max Resolution when not subscribing to a publisher");if(Le.preferredResolution=e,te.sessionInfo.p2pEnabled)return void Ve.warn("OT.Subscriber.setPreferredResolution will not work in a P2P Session");if(!U.isStreamAdded())return;const t=le.getPreferredResolution();t&&e&&t.width===e.width&&t.height===e.height||!t&&!e||le.setPreferredResolution(e)},this.setPreferredFrameRate=e=>{if(U.isDestroyed()||0===Ye().length&&"Connecting"===!U.current)return void Ve.warn("Cannot set the max frameRate when not subscribing to a publisher");if(Le.preferredFrameRate=e,te.sessionInfo.p2pEnabled)return void Ve.warn("OT.Subscriber.setPreferredFrameRate will not work in a P2P Session");const t=le.getPreferredFrameRate();e&&t&&t===e||!t&&!e||le.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,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=te.getPublisherForStream(le))&&t._.webRtcStream()){e.next=5;break}pt.fail({payload:{reason:"streamNotFound"},error:Me(be.STREAM_DESTROYED,new Error("Tried to subscribe to a local publisher, but its stream no longer exists"))}),e.next=14;break;case 5:return A.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),Ve.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])}))),this._setupPeerConnection=function(){var n=(0,o.default)(i.default.mark((function n(r){var o,s,a,c;return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=r.send,s=r.log,a=r.logQoS,c=r.sourceStreamId,Le.testNetwork&&I.setAudioVolume(0),0===Ye().length&&U.set("Connecting"),xe=c,V[c]=new t((t,n)=>{te._.getIceConfig().then(r=>{r.needRumorIceServersFallback&&(r.servers=[...Ge||[],...r.servers||[]]);const i={iceConfig:r,subscriberId:I.widgetId,send:o,logAnalyticsEvent:s,p2p:te.sessionInfo.p2pEnabled,sourceStreamId:c,remoteConnectionId:le.connection.id,_singlePeerConnectionController:"MANTIS"===c&&he,keyStore:te.keyStore,sFrameClientStore:te.sFrameClientStore,isE2ee:te._.isE2ee()};Object.prototype.hasOwnProperty.call(Le,"codecFlags")&&(i.codecFlags=Le.codecFlags);const u=new e.SubscriberPeerConnection(i);u.once("iceConnected",A.resolve),u.once("error",A.reject),u.on("qos",a),Pt(u,c),u.init(e=>{e?n(e):t(u)})})}),n.abrupt("return",V[c]);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),this.restrictFrameRate=e=>(Ve.debug(`OT.Subscriber.restrictFrameRate(${e})`),ct("restrictFrameRate",e.toString(),{streamId:le.id}),te.sessionInfo.p2pEnabled&&Ve.warn("OT.Subscriber.restrictFrameRate: Cannot restrictFrameRate on a P2P session"),"boolean"!=typeof e?Ve.error("OT.Subscriber.restrictFrameRate: expected a boolean value got a "+typeof e):(Ce=e,le.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,o.default)(i.default.mark((function r(){return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(Je()){r.next=3;break}return n(new Ue.Error("Cannot create a DataChannel before there is a publisher connection.")),r.abrupt("return");case 3:return r.next=5,Je();case 5:r.sent.getDataChannel(e,t,n);case 6:case"end":return r.stop()}}),r)})))(),iceRestart:(e,t)=>(0,o.default)(i.default.mark((function n(){var r;return i.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}),Ve.debug("Subscriber: iceRestart attempt"),r.iceRestart(),t&&r.generateOffer()):Ve.debug("Subscriber: Skipping ice restart, we have no peer connection");case 5:case"end":return n.stop()}}),n)})))(),unblockAudio:()=>X&&X.unblockAudio(),webRtcStream:()=>B,setIceConfig:(Bt=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ye().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.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 f,startRoutedToRelayedTransition(){Le.testNetwork||ce(le,te)||(W.startTransitionTo("P2P"),jt())},startRelayedToRoutedTransition(){W.startTransitionTo("MANTIS",()=>Ut())},setSinkId(e){if(X&&X.video())return X.setSinkId(e);Ve.debug("Called setAudioOutputDevice on a subscriber without a video element")},pauseAndPlayVideoElement(){X&&X.pauseAndPlayVideoElement()}},U=new Ke(e=>{Ve.error("OT.Subscriber State Change Failed: ",e.message),Ve.debug(e)}),Ve.debug("OT.Subscriber: subscribe to "+le.id),U.set("Init"),!le)return Ve.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 ve.VideoDimensionsChangedEvent(this,e.oldValue,e.newValue));break;case"videoDisableWarning":M&&M.videoDisabledIndicator.setWarning(e.newValue),this.dispatchEvent(new ve.VideoDisableWarningEvent(e.newValue?"videoDisableWarning":"videoDisableWarningLifted")),Re=e.newValue?1:null;break;case"hasVideo":Wt(!le.hasVideo||!Le.subscribeToVideo),me.isSafari&&!le.hasVideo&&X&&X.bindAudioTrackOnly(),this.dispatchEvent(new ve.VideoEnabledChangedEvent(le.hasVideo?"videoEnabled":"videoDisabled",{reason:"publishVideo"}));break;case"hasAudio":F.update()}}},le.on(Q,this),Le.name=Le.name||le.name,Le.classNames="OT_root OT_subscriber",Le.style&&this.setStyle(Le.style,null,!0),we=100,Le.subscribeToVideo=g(Le.subscribeToVideo,!0),Le.subscribeToAudio=g(Le.subscribeToAudio,!0),this.subscribeToAudio(Le.subscribeToAudio),this.setAudioVolume(void 0!==(Jt=Le).audioVolume?Jt.audioVolume:!1===Jt.subscribeToAudio?0:100),X=new e.WidgetView(n,Object.assign({},Le,{widgetType:"subscriber"})),X.on("error",Et),X.on("audioBlocked",()=>this.trigger("audioBlocked")),X.on("audioUnblocked",()=>this.trigger("audioUnblocked")),X.on("amrLogEvent",(e,t,n)=>{ct(e,t,{},n)}),this.id=X.domId(),ee=X.domId(),this.element=X.domElement,X.on("videoElementCreated",e=>{const t=new ve.VideoElementCreatedEvent(e),n=this;$?this.dispatchEvent(t):this.once("loaded",()=>{n.dispatchEvent(t)})}),this.element&&Nt.call(this);const Kt=le.getChannelsOfType("audio"),zt=le.getChannelsOfType("video"),Qt=le.getChannelsOfType("data");let qt=Qt.some(e=>"caption1"===e.id&&e.active);this.subscribeToCaptions=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:n=g(t,!0),r={active:n},qt=n,ct("subscribeToCaptions","Attempt",{subscribeToCaptions:n}),De.subscriberChannelUpdate(le.id,I.widgetId,"caption1",r),ct("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=Kt.map(e=>({id:e.id,type:e.type,active:Le.subscribeToAudio})).concat(zt.map(e=>{const t={id:e.id,type:e.type,active:Le.subscribeToVideo,restrictFrameRate:void 0!==Le.restrictFrameRate&&Le.restrictFrameRate};return void 0!==Le.preferredFrameRate&&(t.preferredFrameRate=parseFloat(Le.preferredFrameRate)),void 0!==Le.preferredHeight&&(t.preferredHeight=parseInt(Le.preferredHeight,10)),void 0!==Le.preferredWidth&&(t.preferredWidth=parseInt(Le.preferredWidth,10)),t})).concat(Qt.map(e=>({id:e.id,type:e.type,active:e.active}))),en=null==(C=le.getChannelsOfType("data")[0])?void 0:C.active,tn=!Le.testNetwork&&ce(le,te)&&!en;(()=>{var e;const t=te.getPublisherForStream(le);if(null!=t&&null!=(e=t._)&&e.privateEvents&&tn){let e=!1;t._.privateEvents.on("publisherCaptionsEnabled",t=>{!e&&t.captionsEnabled&&($t.find(e=>"caption1"===e.id).active=!0,nn(),e=!0)})}})(),pt.beginConnect();const nn=()=>{De.subscriberCreate(le.id,k,$t,null,te._.isE2ee(),(e,t)=>{e&&!pt.is("disconnected")&&Tt(e),Ge=at(t)})};return tn?(this._subscribeToSelf(),this):(fe?he.addSubscriber(nn):nn(),this)};return ht.hasAudioOutputLevelStatCapability=Ie,ht.WidgetView=dt,ht.SubscriberPeerConnection=Be,ht}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(3);e.exports=()=>["Chrome","Opera","Safari"].indexOf(r.name)>-1},function(e,t,n){"use strict";const r=n(3).name;e.exports=()=>["Firefox","Safari","Edge","Chrome","Opera"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(160)()("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";e.exports=e=>{let t=e.socket,n=e.uri,r=e.content;return(e,i)=>t.send({uri:n,method:e,content:Object.assign({},r,i)})}},function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var 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(103)();e.exports=r},function(e,t,n){"use strict";let r=function(){function e(){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=r},function(e,t,n){"use strict";(function(t){e.exports=function(e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new t((t,n)=>{e(...r,(function(e){if(e)n(e);else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];1!==i.length?t(i):t(i[0])}}))})}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>{var t;const n=Object.assign({},e);return(null==e||null==(t=e.backgroundImgUrl)?void 0:t.includes("base64"))&&delete n.backgroundImgUrl,n}},function(e,t,n){"use strict";const r={isSupported:()=>"undefined"!=typeof MediaStreamTrackProcessor&&"undefined"!=typeof MediaStreamTrackGenerator,setMetadata:n(717).setVonageMetadata,createProcessor:n(316).createVonageMediaProcessor};e.exports=r},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"BackgroundTransformer",(function(){return Ri})),n.d(t,"BackgroundTransformerType",(function(){return le})),n.d(t,"BlurRadius",(function(){return ue})),n.d(t,"ErrorFunction",(function(){return ne})),n.d(t,"MediapipeHelper",(function(){return ke})),n.d(t,"PipelineInfoData",(function(){return re})),n.d(t,"RenderingType",(function(){return he})),n.d(t,"VonageMediaProcessor",(function(){return Wi})),n.d(t,"WarningType",(function(){return te})),n.d(t,"WebglSelfieSegmentationType",(function(){return de})),n.d(t,"createVonageMediaProcessor",(function(){return Hi})),n.d(t,"getSupportedBrowserFeatures",(function(){return ve})),n.d(t,"getVonageFaceDetection",(function(){return Pi})),n.d(t,"getVonageFaceMash",(function(){return ji})),n.d(t,"getVonageHands",(function(){return Mi})),n.d(t,"getVonageHolistic",(function(){return Fi})),n.d(t,"getVonageObjectron",(function(){return Ui})),n.d(t,"getVonagePose",(function(){return Di})),n.d(t,"getVonageSelfieSegmentation",(function(){return Xi})),n.d(t,"isSupported",(function(){return ye}));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),s=Object.defineProperty,a=(e,t,n)=>(((e,t,n)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class c{}a(c,"updates",{transformer_new:"New transformer",transformer_null:"Null transformer"}),a(c,"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"});const u=new WeakMap,l=new WeakMap,d=new WeakMap,h=Symbol("anyProducer"),p=e.resolve(),f=Symbol("listenerAdded"),m=Symbol("listenerRemoved");let g=!1;function b(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function y(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function v(e,t){const n=l.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function w(e,t){const n="string"==typeof t||"symbol"==typeof t?t:h,r=d.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function S(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)w(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)w(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function E(e){if(void 0===e)return _;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!_.includes(t))throw"string"!=typeof t?new TypeError("`methodNames` element must be a string"):new Error(t+" is not Emittery method");return e}const T=e=>e===f||e===m;class x{static mixin(e,t){return t=E(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 x}),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 g;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||g}static set isDebugEnabled(e){g=e}constructor(e={}){u.set(this,new Set),l.set(this,new Map),d.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){(x.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){y(t),e=Array.isArray(e)?e:[e];for(const n of e)b(n),v(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),T(n)||this.emit(f,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){y(t),e=Array.isArray(e)?e:[e];for(const n of e)b(n),v(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),T(n)||this.emit(m,{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)b(t);return S(this,e)}async emit(t,n){b(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=d.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(h)){const t=e.all([n,r]);for(const e of i.get(h))e.enqueue(t)}}(this,t,n);const r=v(this,t),i=u.get(this),o=[...r],s=T(t)?[]:[...i];await p,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){b(e),this.logIfDebugEnabled("emitSerial",e,t);const n=v(this,e),r=u.get(this),i=[...n],o=[...r];await p;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 y(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),u.get(this).add(e),this.emit(f,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return S(this)}offAny(e){y(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(m,{listener:e}),u.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){v(this,t).clear();const e=w(this,t);for(const t of e)t.finish();e.clear()}else{u.get(this).clear();for(const e of l.get(this).values())e.clear();for(const e of d.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"&&b(n),t+=u.get(this).size;for(const e of l.get(this).values())t+=e.size;for(const e of d.get(this).values())t+=e.size}else t+=u.get(this).size+v(this,n).size+w(this,n).size+w(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=E(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 _=Object.getOwnPropertyNames(x.prototype).filter(e=>"constructor"!==e);Object.defineProperty(x,"listenerAdded",{value:f,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(x,"listenerRemoved",{value:m,writable:!1,enumerable:!0,configurable:!1});var C=x;function I(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 R=Object.defineProperty,k=(e,t,n)=>(((e,t,n)=>{t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let O;const Z=new Uint8Array(16);function A(){if(!O&&(O=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!O))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(Z)}const V=[];for(let e=0;e<256;++e)V.push((e+256).toString(16).slice(1));const G={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function N(e,t,n){if(G.randomUUID&&!t&&!e)return G.randomUUID();const r=(e=e||{}).random||(e.rng||A)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase()}(r)}function L(e,t){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let n=globalThis.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const W=L("globals",{});var X=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(X||{});function M(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let F=0;function P(t,n,r,i,o){const s=F++;return t.postMessage({id:s,type:n,functionName:r,args:i},i.filter(e=>M(e))),new e(e=>{null==o||o.set(s,e)})}function j(e,t){const{id:n,type:r}=e,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>M(e)))}const U=L("workerized",{});function D(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function H(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],H(e[n],t[n])):"object"==typeof e[n]?(t[n]={},H(e[n],t[n])):t[n]=e[n]}const Y=L("registeredWorkers",{});function B(t,n){return W[t]||(W[t]=n),[()=>W[t],async n=>{W[t]=n,await async function(){if(D())j({type:X.GLOBALS_SYNC},W);else{const t=[];for(const e in U){const{worker:n,resolvers:r}=U[e].workerContext;n&&t.push(P(n,X.GLOBALS_SYNC,"",[W],r))}await e.all(t)}}()}]}D()&&function(){const e={};onmessage=async t=>{const n=t.data;switch(n.type){case X.INIT:!function(e,t){if(!e.args)throw"Missing className while initializing worker";const[n,r]=e.args,i=Y[n];if(!i)throw"unknown worker class "+n;t.instance=new i(e.args.slice(1)),H(r,W),j(e,void 0!==typeof t.instance)}(n,e);break;case X.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}`;j(e,await t.instance[n](...null!=r?r:[]))}(n,e);break;case X.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:[])),j(e,r)}(n,e);break;case X.GLOBALS_SYNC:!function(e){if(!e.args)throw"Missing globals while syncing";H(e.args[0],W),j(e,{})}(n)}}}();const[J,K]=B("metadata",z);var z;function Q(){return J()}class q{constructor(e){k(this,"uuid",N()),this.config=e}async send(e){var t,n,r;const{appId:i,sourceType:o}=null!=(t=Q())?t:{};if(!i||!o)return"metadata missing";const s=new AbortController,a=setTimeout(()=>s.abort(),1e4);return await(null!=(r=null==(n=this.config)?void 0:n.fetch)?r:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(e)),signal:s.signal}),clearTimeout(a),"success"}getUrl(){var e;let t=null!=(e=Q().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t}getHeaders(){return{"Content-Type":"application/json"}}buildReport(e){const t=Q();return{guid:this.uuid,...e,applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType}}}const $="2.0.3";class ee{constructor(e){a(this,"frameTransformedCount",0),a(this,"frameFromSourceCount",0),a(this,"startAt",0),a(this,"reporter"),this.config=e,this.reporter=new q(e)}async onFrameFromSource(){this.frameFromSourceCount++}get fps(){const{startAt:e,frameFromSourceCount:t}=this;return t/((Date.now()-e)/1e3)}async onFrameTransformed(e={},t=!1){0===this.startAt&&(this.startAt=Date.now()),this.frameTransformedCount++;const{startAt:n,frameTransformedCount:r,frameFromSourceCount:i}=this,o=Date.now(),s=(o-n)/1e3,a=r/s,c=i/s;return t||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=o,this.reporter.config=this.config,this.reporter.send({...this.config.report,variation:"QoS",fps:c,transformedFps:a,framesTransformed:r,...e})):"success"}}var te=(e=>(e.FPS_DROP="fps_drop",e))(te||{}),ne=(e=>(e.start="start",e.transform="transform",e.flush="flush",e))(ne||{}),re=(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))(re||{});class ie extends C{constructor(e,t){super(),a(this,"reporter_",new q),a(this,"reporterQos_",new ee({loggingIntervalFrameCount:500,report:{version:$}})),a(this,"transformerType_"),a(this,"transformer_"),a(this,"shouldStop_"),a(this,"isFlashed_"),a(this,"mediaTransformerQosReportStartTimestamp_"),a(this,"videoHeight_"),a(this,"videoWidth_"),a(this,"trackExpectedRate_"),a(this,"index_"),a(this,"controller_"),this.index_=t,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType()),this.report({variation:"Create"})}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){this.report({message:c.errors.transformer_start,variation:"Error",error:I(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"start"};this.emit("error",t)}}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.reporterQos_.onFrameFromSource(),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.reportQos()}catch(e){this.report({message:c.errors.transformer_transform,variation:"Error",error:I(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"transform"};this.emit("error",t)}if(-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>this.reporterQos_.fps){const e={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}};this.emit("warn",e)}}}async flush(e){if(this.transformer_&&"function"==typeof this.transformer_.flush&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch(e){this.report({message:c.errors.transformer_flush,variation:"Error",error:I(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"flush"};this.emit("error",t)}}this.reportQos(!0),this.report({variation:"Delete"})}stop(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0}report(e){this.reporter_.send({version:$,action:"MediaTransformer",transformerType:this.transformerType_,...e})}reportQos(e=!1){this.reporterQos_.config={...this.reporterQos_.config},this.reporterQos_.onFrameTransformed({version:$,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},e)}}class oe extends C{constructor(e){super(),a(this,"transformers_"),a(this,"trackExpectedRate_"),this.transformers_=[],this.trackExpectedRate_=-1;for(let t=0;t<e.length;t++){let n=new ie(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 se extends C{constructor(){super(),a(this,"reporter_"),a(this,"pipeline_"),a(this,"transformers_"),a(this,"readable_"),a(this,"writable_"),a(this,"trackExpectedRate_"),this.reporter_=new q,this.trackExpectedRate_=-1,this.report({variation:"Create"})}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(async(e,t)=>{if(!this.transformers_||0===this.transformers_.length)return this.report({message:c.errors.transformer_none,variation:"Error"}),void t("[MediaProcessor] Need to set transformers.");if(!this.readable_)return this.report({variation:"Error",message:c.errors.readable_null}),void t("[MediaProcessor] Readable is null.");if(!this.writable_)return this.report({variation:"Error",message:c.errors.writable_null}),void t("[MediaProcessor] Writable is null.");let n=!1;this.pipeline_&&(n=!0,this.pipeline_.clearListeners(),this.pipeline_.destroy()),this.pipeline_=new oe(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=re.pipeline_restarted:"pipeline_started_with_error"===e&&(e=re.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){return this.report({variation:"Update",message:c.updates.transformer_new}),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()}destroy(){return new e(async e=>{this.pipeline_&&this.pipeline_.destroy(),this.report({variation:"Delete"}),e()})}report(e){this.reporter_.send({version:$,action:"MediaProcessor",...e})}}class ae{constructor(){a(this,"processor_"),a(this,"generator_"),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 ce{constructor(e){a(this,"insertableStreamHelper_"),a(this,"mediaProcessor_"),this.insertableStreamHelper_=new ae,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 ue=(e=>(e.Low="Low",e.High="High",e))(ue||{}),le=(e=>(e.BackgroundBlur="BackgroundBlur",e.VirtualBackground="VirtualBackground",e.VideoBackground="VideoBackground",e.SilhouetteBlur="SilhouetteBlur",e))(le||{}),de=(e=>(e.FAST="FAST",e.PRECISE="PRECISE",e))(de||{}),he=(e=>(e.CANVAS="CANVAS",e.WEBGL="WEBGL",e))(he||{});const pe=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 fe=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),p=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 f=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&A("no native wasm support detected");var m,g,b,y,v,w=!1,S=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function E(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 T(e,t){return e?E(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=[],k=[];var O=0,Z=null;function A(e){o.onAbort&&o.onAbort(e),p(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 V,G,N;function L(e){return e.startsWith("data:application/octet-stream;base64,")}function W(e){try{if(e==V&&d)return new Uint8Array(d);throw"both async and sync fetching of the wasm failed"}catch(e){A(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)}}L(V="tflite-simd.wasm")||(G=V,V=o.locateFile?o.locateFile(G,l):l+G),N=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:p)(E(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 T(e)},get64:function(e,t){return e}};var U={a:function(e,t,n,r){A("Assertion failed: "+T(e)+", at: "+[t?T(t):"unknown filename",n,r?T(r):"unknown function"])},e:function(e,t){A("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")},d:function(e,t){A("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")},b:function(){A("")},n:function(e,t){var n;if(0===e)n=Date.now();else{if(1!==e&&4!==e)return function(e){v[H()>>2]=e}(28),-1;n=N()}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=N();N()-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){f||(o.onExit&&o.onExit(e),w=!0),u(e,new Y(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(){A("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(O--,o.monitorRunDependencies&&o.monitorRunDependencies(O),0==O&&Z){var t=Z;Z=null,t()}}()}function r(e){n(e.instance)}function s(n){return(d||"function"!=typeof fetch?e.resolve().then((function(){return W(V)})):fetch(V,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()})).catch((function(){return W(V)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){p("failed to asynchronously prepare wasm: "+e),A(e)}))}if(O++,o.monitorRunDependencies&&o.monitorRunDependencies(O),o.instantiateWasm)try{return o.instantiateWasm(t,n)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}(d||"function"!=typeof WebAssembly.instantiateStreaming||L(V)||"function"!=typeof fetch?s(r):fetch(V,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(e){return p("wasm streaming compile failed: "+e),p("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 D,H=o.___errno_location=function(){return(H=o.___errno_location=o.asm.F).apply(null,arguments)};function Y(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function B(e){function t(){D||(D=!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(),k.unshift(e);var e;X(k)}()))}O>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)}(),O>0)||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t())}if(Z=function e(){D||B(),D||(Z=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 me{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 ge(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 me;return new e((function(i,o){(async function(){return fe({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 be{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 ge(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 ye(e,t){const{wasm:n,insertableStreams:r,simd:i,webgl:o}=await ve(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 ve(t,n){const r=new be;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 pe(),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"},performance:we()};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}function we(){return new OffscreenCanvas(0,0).getContext("webgl2",{failIfMajorPerformanceCaveat:!0})?{supported:!0}:{supported:!1,message:"Your hardware does not perform good enough to run the library efficiently"}}const Se={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(e,t){return t=new E(new v(t)),p&&e.prototype&&p(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,k,O=typeof TextDecoder<"u",Z=typeof TextEncoder<"u";function A(e){if(Z)e=(k||(k=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 V={},G=null;function N(e,t){void 0===t&&(t=0),W(),t=V[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 L(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=G[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}W();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 W(){if(!G){G={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));V[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===G[o]&&(G[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?L(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 D(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 H(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 Y=[];function B(){this.g=new Uint8Array(64),this.h=0}function J(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 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=D(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=D(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=D(e.g),r=(e=e.g).g;if(e.g+=n,e=e.h,O)(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){J(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)},K.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 pe(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 fe(e){var t=void 0!==t&&t,n=pe(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=pe(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=fe(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=fe(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=pe(e,t))?0:e}function Se(e,t){return null==(e=pe(e,t))?"":e}function Ee(e,t){if(e=e.m){ee(t,t.g.end());for(var n=0;n<e.length;n++)ee(t,e[n])}}function Te(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=D(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=D(t.g);ge(e,1,n);break;case 21:ge(e,2,n=H(t.g));break;case 26:ge(e,3,n=q(t));break;case 34:ge(e,4,n=q(t));break;default:if(!Te(e,t))return e}return e}function Ie(e){le.call(this,e,-1,Re)}le.prototype.toJSON=function(){return oe(ve(this),se,N)},le.prototype.toString=function(){return ve(this).toString()},f(_e,le),f(Ie,le),Ie.prototype.addClassification=function(e,t){ye(this,e,_e,t)};var Re=[1];function ke(e){le.call(this,e)}function Oe(e,t){for(;z(t);)switch(t.i){case 13:var n=H(t.g);ge(e,1,n);break;case 21:ge(e,2,n=H(t.g));break;case 29:ge(e,3,n=H(t.g));break;case 37:ge(e,4,n=H(t.g));break;case 45:ge(e,5,n=H(t.g));break;default:if(!Te(e,t))return e}return e}function Ze(e){le.call(this,e,-1,Ae)}f(ke,le),f(Ze,le);var Ae=[1];function Ve(e){le.call(this,e)}function Ge(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 Ne(e){return be(e,_e).map((function(e){return{index:we(e,1),Y:me(e,2),label:null!=pe(e,3)?Se(e,3):void 0,displayName:null!=pe(e,4)?Se(e,4):void 0}}))}function Le(e){return{x:me(e,1),y:me(e,2),z:me(e,3),visibility:null!=pe(e,4)?me(e,4):void 0}}function We(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=Ge(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=Ge(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}f(Ve,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 De(t){return xe(t,(function t(){var n,r,i,o,s,a,u,l,d,h,p,f=this;return T(t,(function(t){switch(t.g){case 1:return n=f,f.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(f,f.j),y(t,function(){return xe(this,(function e(){return T(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:f.locateFile}),je("createMediapipeSolutionsPackedAssets",{locateFile:f.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=He(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 T(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 T(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,He(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:f.h=t.h,f.l=new OffscreenCanvas(1,1),f.h.canvas=f.l,s=f.h.GL.createContext(f.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),f.h.GL.makeContextCurrent(s),t.g=4;break;case 7:if(f.l=document.createElement("canvas"),!(p=f.l.getContext("webgl2",{}))&&!(p=f.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();f.D=p,f.h.canvas=f.l,f.h.createContext(f.l,!0,!0,{});case 4:f.i=new f.h.SolutionWasm,f.R=!1,t.g=0}}))}))}function He(e,t){return xe(e,(function e(){var n,r,i=this;return T(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 Ye(e,t,n){return xe(e,(function e(){var r,i,o,s,c,u,l,d,h,p,f,m,g,b,v=this;return T(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 T(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 We(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(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=w.get(_);e:{var I=new Ve;for(C=new K(C);z(C);)switch(C.i){case 13:var R=H(C.g);ge(I,1,R);break;case 21:ge(I,2,R=H(C.g));break;case 29:ge(I,3,R=H(C.g));break;case 37:ge(I,4,R=H(C.g));break;case 45:ge(I,5,R=H(C.g));break;case 48:for(var k=C.g,O=128,Z=0,A=R=0;4>A&&128<=O;A++)Z|=(127&(O=k.h[k.g++]))<<7*A;if(128<=O&&(Z|=(127&(O=k.h[k.g++]))<<28,R|=(127&O)>>4),128<=O)for(A=0;5>A&&128<=O;A++)R|=(127&(O=k.h[k.g++]))<<7*A+3;128>O?(k=Z>>>0,(R=2147483648&(O=R>>>0))&&(O=~O>>>0,0==(k=1+~k>>>0)&&(O=O+1>>>0)),k=4294967296*O+(k>>>0),R=R?-k:k):(k.l=!0,R=void 0),ge(I,6,R);break;default:if(!Te(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 Ze,R=new K(R);z(R);)switch(R.i){case 10:ye(C,k=Q(R,new ke,Oe),ke,void 0);break;default:if(!Te(C,R))break e}C=be(C,ke).map(Le),k=E.get(_);e:for(R=new Ie,k=new K(k);z(k);)switch(k.i){case 10:R.addClassification(Q(k,new _e,Ce));break;default:if(!Te(R,k))break e}I={T:I,O:C,M:Ne(R)},x.push(I)}w=x}else w=[];r[d]=w,e.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,e.g=7;break}if(void 0===p){e.g=3;break}if("float_list"===h.type){r[d]=p,e.g=7;break}if("proto"===h.type){r[d]=p,e.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=v.s[d])||(f=new We(v.h,v.D),v.s[d]=f),y(e,Xe(f,p,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=Ye(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 Je(e){switch(void 0===e&&(e=0),e){case 1:return"selfie_segmentation_landscape.tflite";default:return"selfie_segmentation.tflite"}}function Ke(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:Je(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 T(t,(function(t){return 1==t.g?(n=Je(e),r="third_party/mediapipe/modules/selfie_segmentation/"+n,y(t,He(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 T(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 T(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 T(e,(function(e){return 1==e.g?y(e,De(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 T(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,He(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 T(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,p=this;return T(n,(function(n){switch(n.g){case 1:return p.g.inputs?(r=1e3*(null==t?performance.now():t),y(n,p.C,2)):n.return();case 2:return y(n,p.initialize(),3);case 3:for(i=new p.h.PacketDataList,o=a(Object.keys(e)),s=o.next();!s.done;s=o.next())if(c=s.value,u=p.g.inputs[c]){e:{var f=p,m=e[c];switch(u.type){case"video":var g=f.m[u.stream];if(g||(g=new We(f.h,f.D),f.m[u.stream]=g),0===(f=g).l&&(f.l=f.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:f.l,width:b,height:g},(b=f.g).canvas.width=g.width,b.canvas.height=g.height,b.activeTexture(b.TEXTURE0),f.h.bindTexture2d(f.l),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[u.stream])||(g=new Me(f.h),f.m[u.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){b=m[g];var v=f.data,w=v.setBoundingBox,S=g,E=b.T,T=new Ve;ge(T,1,E.Z),ge(T,2,E.$),ge(T,3,E.height),ge(T,4,E.width),ge(T,5,E.rotation),ge(T,6,E.X);var x=E=new $;ne(x,1,pe(T,1)),ne(x,2,pe(T,2)),ne(x,3,pe(T,3)),ne(x,4,pe(T,4)),ne(x,5,pe(T,5));var _=pe(T,6);if(null!=_&&null!=_){J(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(Ee(T,x),E=te(E),w.call(v,S,E),b.O)for(v=0;v<b.O.length;++v)x=!!(T=b.O[v]).visibility,S=(w=f.data).addNormalizedLandmark,E=g,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),ge(x=new ke,1,T.x),ge(x,2,T.y),ge(x,3,T.z),T.visibility&&ge(x,4,T.visibility),ne(C=T=new $,1,pe(x,1)),ne(C,2,pe(x,2)),ne(C,3,pe(x,3)),ne(C,4,pe(x,4)),ne(C,5,pe(x,5)),Ee(x,C),T=te(T),S.call(w,E,T);if(b.M)for(v=0;v<b.M.length;++v){if(S=(w=f.data).addClassification,E=g,T=b.M[v],ge(x=new _e,2,T.Y),T.index&&ge(x,1,T.index),T.label&&ge(x,3,T.label),T.displayName&&ge(x,4,T.displayName),C=T=new $,null!=(R=pe(x,1))&&null!=R)if(J(C.g,8),_=C.g,0<=R)J(_,R);else{for(I=0;9>I;I++)_.push(127&R|128),R>>=7;_.push(1)}ne(C,2,pe(x,2)),null!=(_=pe(x,3))&&(_=A(_),J(C.g,26),J(C.g,_.length),ee(C,C.g.end()),ee(C,_)),null!=(_=pe(x,4))&&(_=A(_),J(C.g,34),J(C.g,_.length),ee(C,C.g.end()),ee(C,_)),Ee(x,C),T=te(T),S.call(w,E,T)}}f=f.data;break e;default:f={}}}switch(l=f,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 p.i.send(i),y(n,p.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=Ke.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 T(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 T(t,(function(t){return y(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},C("SelfieSegmentation",Ke),C("VERSION","0.1.1632777926")}).call(Se);const Ee={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(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 E(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 k,O,Z=typeof TextDecoder<"u",A=typeof TextEncoder<"u",V={},G=null;function N(e){var t;void 0===t&&(t=0),W(),t=V[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 L(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=G[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}W();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 W(){if(!G){G={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));V[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===G[o]&&(G[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 D(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function H(){return Error("Failed to read varint, encoding is invalid.")}function Y(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 L(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?L(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 J(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,J(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,J(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,J(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,J(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return J(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw H();return J(e),r}Y.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 Y(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=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw D(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,J(e);break e}throw H()}break;case 1:(e=e.g).g+=8,J(e);break;case 2:2!=e.h?te(e):(t=K(e.g)>>>0,(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(!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 D(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 pe(e){if(ue(e.m))throw Error("Cannot mutate an immutable Message")}var fe,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,pe(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 Ee(e,t,n,r,i){var o=void 0!==o&&o;return pe(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 Te(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?ke: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 N(e);if(e instanceof P){var t=e.L;return t=null==t||"string"==typeof t?t:M&&t instanceof Uint8Array?N(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?_e(e):e)}function ke(e){return F(e)?new Uint8Array(e):e}function Oe(e,t,n){e||(e=fe),fe=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 Ze(){Oe.apply(this,arguments)}if(Oe.prototype.toJSON=function(){return _e(this.m)},Oe.prototype.toString=function(){return this.m.toString()},f(Ze,Oe),me){var Ae={};Object.defineProperties(Ze,(Ae[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Ae))}function Ve(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 Ge=Symbol();function Ne(e,t,n){return e[Ge]||(e[Ge]=function(e,r){return t(e,r,n)})}function Le(e){var t=e[Ge];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ge]=t}return t}function We(e){var t=function(e){var t=e.ba;return t?Le(t):(t=e.oa)?Ne(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 Ve(e,n,t)},e[Me]=n),n}var je=Symbol();function Ue(e,t){e.push(t)}function De(e,t,n){e.push(t,n.P)}function He(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 Ye(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,De,He,Ye)}var Je=Symbol();function Ke(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=Le(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=Ne(r,i,o);e[t]=function(e,t,n){return a(e,t,n,r,c,s)}}function $e(e){return e[Je]||Xe(e,e[Je]={},Ke,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]=We(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]);Ve(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,J(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++],J(r),o|=(127&i)<<7*s;if(128<=i&&(i=r.h[r.g++],J(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)i=r.h[r.g++],J(r),e|=(127&i)<<7*s+3;if(!(128>i))throw H();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,K(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=K(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,J(e),e=e.h,Z)(r=k)||(r=k=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,A){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(O||(O=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=Ee(t,n,r),n=e.g.i,r=K(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(){Ze.apply(this,arguments)}if(f(lt,Ze),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ht(e){lt.call(this,e)}function pt(){return[1,at,2,ot,3,ct,4,ct]}function ft(e){lt.call(this,e,-1,gt)}function mt(){return[1,ut,ht,pt]}f(ht,lt),f(ft,lt),ft.prototype.addClassification=function(e,t){return Ee(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]}f(bt,lt),f(vt,lt);var St=[1];function Et(e){lt.call(this,e)}function Tt(){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:Te(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 kt(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 Ot(e){this.g=e}f(Et,lt);var Zt=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 At(e,t){return t+e}function Vt(e,t){window[e]=t}function Gt(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||At,"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 Nt(t){var n,r,i,o,s,a,u,l,d,h,p;return T((function(f){switch(f.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(f,T((function(e){switch(e.g){case 1:return e.o=2,y(e,WebAssembly.instantiate(Zt),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)):f.return();case 2:if(r=f.h,"object"==typeof window)return Vt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Vt("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=Lt(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 T((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=T((function(e){return t.g.graph&&t.g.graph.url?e=y(e,Lt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(f,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(f,createMediapipeSolutionsWasm(Module),6);case 6:o.h=f.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),f.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(p=t.l.getContext("webgl2",{}))&&!(p=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),f.return();t.G=p,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.$=!1,f.g=0}}))}function Lt(e,t){var n,r;return T((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 Wt(e,t,n){var r,i,o,s,c,u,l,d,h,p,f,m,g,b;return T((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 T((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(kt(r,n,e.I))):i.return(void 0)}))}(e,d,t[h]),14);if(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=tt(w.get(_),Et,Tt);C={ea:{ka:we(C,1),la:we(C,2),height:we(C,3),width:we(C,4),rotation:we(C,5,0),ia:Te(C,6)},Y:Se(tt(S.get(_),vt,wt),bt,1).map(Ct),V:_t(tt(E.get(_),ft,mt))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===p){v.g=3;break}if("float_list"===h.type){r[d]=p,v.g=7;break}if("proto"===h.type){r[d]=p,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=e.u[d])||(f=new Rt(e.h,e.G),e.u[d]=f),y(v,kt(f,p,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=Wt(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 Gt({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,ft,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 T((function(o){return 1==o.g?(n=Mt(e),r="third_party/mediapipe/modules/hand_landmark/"+n,y(o,Lt(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=Gt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return T((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 T((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 T((function(t){return 1==t.g?y(t,Nt(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return T((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,Lt(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 T((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 T((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.D,2)):p.return();case 2:return y(p,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 f=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"&&f instanceof HTMLVideoElement)var g=f.videoWidth,b=f.videoHeight;else typeof HTMLImageElement<"u"&&f instanceof HTMLImageElement?(g=f.naturalWidth,b=f.naturalHeight):(g=f.width,b=f.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,f),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.o[c.stream])||(m=new Ot(h.h),h.o[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(f.length),b=0;b<f.length;++b){g=f[b];var v=m.data,w=v.setBoundingBox,S=b,E=g.ea,T=new Et;if(ye(T,1,E.ka),ye(T,2,E.la),ye(T,3,E.height),ye(T,4,E.width),ye(T,5,E.rotation),ye(T,6,E.ia),E=rt(T,Tt),w.call(v,S,E),g.Y)for(v=0;v<g.Y.length;++v){var x=!!(T=g.Y[v]).visibility;S=(w=m.data).addNormalizedLandmark,E=b,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),ye(x=new bt,1,T.x),ye(x,2,T.y),ye(x,3,T.z),T.visibility&&ye(x,4,T.visibility),T=rt(x,yt),S.call(w,E,T)}if(g.V)for(v=0;v<g.V.length;++v)S=(w=m.data).addClassification,E=b,T=g.V[v],ye(x=new ht,2,T.score),T.index&&ye(x,1,T.index),T.label&&ye(x,3,T.label),T.displayName&&ye(x,4,T.displayName),T=rt(x,pt),S.call(w,E,T)}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(p,h.D,4);case 4:r.delete(),p.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",Gt),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 T((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return T((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(Ee);var Te={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(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 E(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 k(){I(Error("Failed to read varint, encoding is invalid."))}function O(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Z,A,V=typeof TextDecoder<"u",G=typeof TextEncoder<"u";function N(e){if(G)e=(A||(A=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 L={},W=null;function X(e){var t;void 0===t&&(t=0),F(),t=L[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=W[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(!W){W={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));L[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===W[o]&&(W[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 D="function"==typeof Uint8Array.prototype.slice;function H(e,t,n){return t===n?P||(P=new Uint8Array(0)):D?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var Y=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&&J(this,e)}function J(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 K(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,k()}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,k(),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&&J(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,k()}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=H(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,H(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 pe(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 fe(e){return e?null==(t=he?e[he]:e.g)?0:t:0;var t}function me(e){return Array.isArray(e)&&pe(e,1),e}function ge(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");pe(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&fe(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]=Te):(xe(this),(r=this.i[e])?me(r):this.i[e]=Te)}var Ee,Te=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=Te),i===Te?Oe(e,t,i=me([]),r):n&&Array.isArray(i)&&2&fe(i)&&Oe(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 ke(e,t,n){return null==(e=null==(e=_e(e,t))?e:+e)?void 0===n?0:n:e}function Oe(e,t,n,r){void 0!==r&&r||t>=e.l?(xe(e),e.i[t]=n):e.h[t+e.j]=n}function Ze(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 Ae(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&fe(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 Ve(e,t,n,r,i){var o=Ae(e,r,t);n=n||new r,e=Ce(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ge(n))):(o.push(n),e.push(Ge(n)))}function Ge(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]&&Ge(n[r]);else n&&Ge(n)}return e.h}function Ne(e,t){if(e=e.o){ue(t,t.g.end());for(var n=0;n<e.length;n++)ue(t,e[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=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]=Le(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&&(J(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?Y=0:(0,Y=2147483648):isNaN(r)?(0,Y=2147483647):34028234663852886e22<r?(0,Y=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,Y=(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,Y=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=Y)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function Pe(e,t,n){return 5===e.h&&(Oe(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&&(Oe(t,n,K(e.g)),!0)}function De(e,t,n){return 0===e.h&&(Oe(t,n,e.g.j()),!0)}function He(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,V)(r=Z)||(r=Z=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=O(l,u),u.length=0);r=O(l,u)}return Oe(t,n,r),!0}function Ye(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&&Ge(e),t.g[n]=e,Oe(t,n,r,o),!0}function Be(e,t,n,r,i){return 2===e.h&&(Ve(t,n,e=oe(e,new r,i),r,void 0),!0)}function Je(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 Ke(e,t,n){return 0===e.h&&(Oe(t,n,K(e.g)),!0)}function ze(e){Se.call(this,e,-1,et)}function Qe(e,t){return We(e,t,Ee||(Ee={1:De,2:De,3:je,4:Ke}))}Se.prototype.toJSON=function(){return we(Ge(this),ye)},Se.prototype.toString=function(){return Ge(this).toString()},f(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,N(r)),null!=(r=_e(e,4))&&le(t,4,N(r)),Ne(e,t)}function rt(e,t){return We(e,t,qe||(qe={1:De,2:Pe,3:He,4:He}))}function it(e){Se.call(this,e,-1,ct)}function ot(e,t){return We(e,t,$e||($e={1:[Be,tt,rt]}))}f(tt,Se),f(it,Se),it.prototype.addClassification=function(e,t){return Ve(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),Ne(e,t)}function dt(e,t){return We(e,t,st||(st={1:Pe,2:Pe,3:Pe,4:Pe,5:Pe}))}function ht(e){Se.call(this,e,-1,gt)}function pt(e,t){return We(e,t,at||(at={1:[Be,ut,dt]}))}f(ut,Se),f(ht,Se);var ft,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=Y=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Ne(e,t)}function vt(e,t){return We(e,t,ft||(ft={1:Pe,2:Pe,3:Pe,4:Pe,5:Pe,6:Ue}))}function wt(e){Se.call(this,e,-1,Tt)}function St(e,t){return We(e,t,mt||(mt={1:Ke,2:Ke,3:je,4:Je}))}f(bt,Se),f(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 Et,Tt=[3,4];function xt(e){Se.call(this,e)}function _t(e,t){return We(e,t,Et||(Et={1:[Ye,wt,St],2:[Ye,ze,Qe]}))}f(xt,Se),xt.prototype.getMesh=function(){return Ze(this,wt,1)},xt.prototype.getPoseTransformMatrix=function(){return Ze(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]],kt=[[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]],Ot=[[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]],At=[].concat(c(Ct),c(It),c(Rt),c(kt),c(Ot),c(Zt));function Vt(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 Gt(e){return Ae(e,tt,1).map((function(e){return{index:Re(e,1,0),score:ke(e,2),label:null!=_e(e,3)?Re(e,3,""):void 0,displayName:null!=_e(e,4)?Re(e,4,""):void 0}}))}function Nt(e){return{x:ke(e,1),y:ke(e,2),z:ke(e,3),visibility:null!=_e(e,4)?ke(e,4):void 0}}function Lt(e){return Ae(Me(e,ht,pt),ut,1).map(Nt)}function Wt(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=Vt(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=Vt(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 Dt(t){var n,r,i,o,s,a,u,l,d,h,p;return T((function(f){switch(f.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(f,T((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)):f.return();case 2:if(r=f.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=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.S)):e.resolve()}))).then((function(){var e,n,r;return T((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=T((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(f,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(f,createMediapipeSolutionsWasm(Module),6);case 6:o.h=f.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),f.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(p=t.l.getContext("webgl2",{}))&&!(p=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),f.return();t.D=p,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,f.g=0}}))}function Ht(e,t){var n,r;return T((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 Yt(e,t,n){var r,i,o,s,c,u,l,d,h,p,f,m,g,b;return T((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 T((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 Wt(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(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=Me(w.get(_),bt,vt);C={T:{X:ke(C,1),Y:ke(C,2),height:ke(C,3),width:ke(C,4),rotation:ke(C,5,0),W:Re(C,6,0)},O:Lt(S.get(_)),M:Gt(Me(E.get(_),it,ot))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===p){v.g=3;break}if("float_list"===h.type){r[d]=p,v.g=7;break}if("proto"===h.type){r[d]=p,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=e.s[d])||(f=new Wt(e.h,e.D),e.s[d]=f),y(v,Xt(f,p,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=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.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Jt(e){return e.map(Kt)}function Kt(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:Lt},rightHandLandmarks:{type:"proto",stream:"right_hand_landmarks",transform:Lt},faceLandmarks:{type:"proto",stream:"face_landmarks",transform:Lt},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:Lt},ea:{type:"proto",stream:"world_landmarks",transform:Lt},segmentationMask:{type:"texture",stream:"segmentation_mask"},multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:Jt}}}],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 T((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 T((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 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.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return T((function(t){return 1==t.g?y(t,Dt(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,s,c,u;return T((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,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.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 T((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 T((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.C,2)):p.return();case 2:return y(p,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 f=e[s];switch(c.type){case"video":var m=h.m[c.stream];if(m||(m=new Wt(h.h,h.D),h.m[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&f instanceof HTMLVideoElement)var g=f.videoWidth,b=f.videoHeight;else typeof HTMLImageElement<"u"&&f instanceof HTMLImageElement?(g=f.naturalWidth,b=f.naturalHeight):(g=f.width,b=f.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,f),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(f.length),b=0;b<f.length;++b){g=f[b];var v=m.data,w=v.setBoundingBox,S=b,E=g.T,T=new bt;if(Oe(T,1,E.X),Oe(T,2,E.Y),Oe(T,3,E.height),Oe(T,4,E.width),Oe(T,5,E.rotation),Oe(T,6,E.W),E=Xe(T,yt),w.call(v,S,E),g.O)for(v=0;v<g.O.length;++v){var x=!!(T=g.O[v]).visibility;S=(w=m.data).addNormalizedLandmark,E=b,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),Oe(x=new ut,1,T.x),Oe(x,2,T.y),Oe(x,3,T.z),T.visibility&&Oe(x,4,T.visibility),T=Xe(x,lt),S.call(w,E,T)}if(g.M)for(v=0;v<g.M.length;++v)S=(w=m.data).addClassification,E=b,T=g.M[v],Oe(x=new tt,2,T.score),T.index&&Oe(x,1,T.index),T.label&&Oe(x,3,T.label),T.displayName&&Oe(x,4,T.displayName),T=Xe(x,nt),S.call(w,E,T)}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(p,h.C,4);case 4:r.delete(),p.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 T((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return T((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",kt),C("FACEMESH_RIGHT_EYEBROW",Ot),C("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),C("FACEMESH_FACE_OVAL",Zt),C("FACEMESH_CONTOURS",At),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(Te);const xe={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(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 E(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 k,O,Z=typeof TextDecoder<"u",A=typeof TextEncoder<"u",V={},G=null;function N(e){var t;void 0===t&&(t=0),W(),t=V[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 L(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=G[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}W();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 W(){if(!G){G={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));V[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===G[o]&&(G[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 D(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function H(){return Error("Failed to read varint, encoding is invalid.")}function Y(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 L(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?L(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 J(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function K(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,J(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,J(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,J(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,J(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return J(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw H();return J(e),r}Y.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 Y(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=K(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw D(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,J(e);break e}throw H()}break;case 1:(e=e.g).g+=8,J(e);break;case 2:2!=e.h?te(e):(t=K(e.g)>>>0,(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(!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 D(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 pe(e){if(ue(e.m))throw Error("Cannot mutate an immutable Message")}var fe,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,pe(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 Ee(e,t,n,r,i){var o=void 0!==o&&o;return pe(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 Te(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?ke: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 N(e);if(e instanceof P){var t=e.L;return t=null==t||"string"==typeof t?t:M&&t instanceof Uint8Array?N(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?_e(e):e)}function ke(e){return F(e)?new Uint8Array(e):e}function Oe(e,t,n){e||(e=fe),fe=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 Ze(){Oe.apply(this,arguments)}if(Oe.prototype.toJSON=function(){return _e(this.m)},Oe.prototype.toString=function(){return this.m.toString()},f(Ze,Oe),me){var Ae={};Object.defineProperties(Ze,(Ae[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Ae))}function Ve(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 Ge=Symbol();function Ne(e,t,n){return e[Ge]||(e[Ge]=function(e,r){return t(e,r,n)})}function Le(e){var t=e[Ge];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ge]=t}return t}function We(e){var t=function(e){var t=e.aa;return t?Le(t):(t=e.ka)?Ne(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 Ve(e,n,t)},e[Me]=n),n}var je=Symbol();function Ue(e,t){e.push(t)}function De(e,t,n){e.push(t,n.P)}function He(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 Ye(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,De,He,Ye)}var Je=Symbol();function Ke(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=Le(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=Ne(r,i,o);e[t]=function(e,t,n){return a(e,t,n,r,c,s)}}function $e(e){return e[Je]||Xe(e,e[Je]={},Ke,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]=We(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]);Ve(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,J(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++],J(r),o|=(127&i)<<7*s;if(128<=i&&(i=r.h[r.g++],J(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)i=r.h[r.g++],J(r),e|=(127&i)<<7*s+3;if(!(128>i))throw H();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,K(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=K(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,J(e),e=e.h,Z)(r=k)||(r=k=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,A){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(O||(O=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=Ee(t,n,r),n=e.g.i,r=K(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(){Ze.apply(this,arguments)}if(f(lt,Ze),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ht(e){lt.call(this,e)}function pt(){return[1,at,2,ot,3,ct,4,ct]}function ft(e){lt.call(this,e,-1,gt)}function mt(){return[1,ut,ht,pt]}f(ht,lt),f(ft,lt),ft.prototype.addClassification=function(e,t){return Ee(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]}f(bt,lt),f(vt,lt);var St=[1];function Et(e){lt.call(this,e)}function Tt(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,st]}f(Et,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]],kt=[[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]],Ot=[].concat(c(xt),c(_t),c(Ct),c(It),c(Rt),c(kt));function Zt(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 Se(e,ht,1).map((function(e){return{index:Te(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 Vt(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 Gt(e,t){this.h=e,this.g=t,this.l=0}function Nt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=Zt(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=Zt(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 Lt(e){this.g=e}var Wt=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,p;return T((function(f){switch(f.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(f,T((function(e){switch(e.g){case 1:return e.o=2,y(e,WebAssembly.instantiate(Wt),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)):f.return();case 2:if(r=f.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 T((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=T((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(f,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(f,createMediapipeSolutionsWasm(Module),6);case 6:o.h=f.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),f.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(p=t.l.getContext("webgl2",{}))&&!(p=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),f.return();t.G=p,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.Z=!1,f.g=0}}))}function jt(e,t){var n,r;return T((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,p,f,m,g,b;return T((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 T((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 Gt(e.h,e.G),e.u[t]=r),i.return(Nt(r,n,e.I))):i.return(void 0)}))}(e,d,t[h]),14);if(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=tt(w.get(_),Et,Tt);C={boundingBox:{xCenter:we(C,1),yCenter:we(C,2),height:we(C,3),width:we(C,4),rotation:we(C,5,0),rectId:Te(C,6)},landmarks:Se(tt(S.get(_),vt,wt),bt,1).map(Vt),V:At(tt(E.get(_),ft,mt))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===p){v.g=3;break}if("float_list"===h.type){r[d]=p,v.g=7;break}if("proto"===h.type){r[d]=p,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=e.u[d])||(f=new Gt(e.h,e.G),e.u[d]=f),y(v,Nt(f,p,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 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=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 Ht(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 T((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 T((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 T((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 T((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 T((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,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 T((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 T((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.D,2)):p.return();case 2:return y(p,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 f=e[s];switch(c.type){case"video":var m=h.o[c.stream];if(m||(m=new Gt(h.h,h.G),h.o[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&f instanceof HTMLVideoElement)var g=f.videoWidth,b=f.videoHeight;else typeof HTMLImageElement<"u"&&f instanceof HTMLImageElement?(g=f.naturalWidth,b=f.naturalHeight):(g=f.width,b=f.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,f),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.o[c.stream])||(m=new Lt(h.h),h.o[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(f.length),b=0;b<f.length;++b){g=f[b];var v=m.data,w=v.setBoundingBox,S=b,E=g.boundingBox,T=new Et;if(ye(T,1,E.xCenter),ye(T,2,E.yCenter),ye(T,3,E.height),ye(T,4,E.width),ye(T,5,E.rotation),ye(T,6,E.rectId),E=rt(T,Tt),w.call(v,S,E),g.landmarks)for(v=0;v<g.landmarks.length;++v){var x=!!(T=g.landmarks[v]).visibility;S=(w=m.data).addNormalizedLandmark,E=b,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),ye(x=new bt,1,T.x),ye(x,2,T.y),ye(x,3,T.z),T.visibility&&ye(x,4,T.visibility),T=rt(x,yt),S.call(w,E,T)}if(g.V)for(v=0;v<g.V.length;++v)S=(w=m.data).addClassification,E=b,T=g.V[v],ye(x=new ht,2,T.ga),T.index&&ye(x,1,T.index),T.label&&ye(x,3,T.label),T.displayName&&ye(x,4,T.displayName),T=rt(x,pt),S.call(w,E,T)}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(p,h.D,4);case 4:r.delete(),p.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=Ht.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return T((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return T((function(n){return y(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},C("FaceDetection",Ht),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",kt),C("FACEDETECTION_CONTOURS",Ot),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(xe);const _e={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(e,t){return t=new E(new v(t)),p&&e.prototype&&p(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,k,O=typeof TextDecoder<"u",Z=typeof TextEncoder<"u";function A(e){if(Z)e=(k||(k=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 V={},G=null;function N(e,t){void 0===t&&(t=0),W(),t=V[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 L(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=G[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}W();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 W(){if(!G){G={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));V[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===G[o]&&(G[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?L(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 D(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 H=[];function Y(){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 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,H.length?(n=H.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 K(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,O)(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 Y}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)}}Y.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},Y.prototype.length=function(){return this.h},Y.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 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]=pe):(fe(this),(r=this.i[e])?de(r):this.i[e]=pe)}var pe=Object.freeze(de([]));function fe(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=pe),r===pe&&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?(fe(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 Ee(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 Te(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=Ee(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(!K(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,Oe)}function ke(e,t){for(;K(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=D(t.g));break;default:if(!Ie(e,t))return e}return e}he.prototype.toJSON=function(){return ae(_e(this),ce,N)},he.prototype.toString=function(){return _e(this).toString()},f(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 Oe=[3];function Ze(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 Ae(e){he.call(this,e)}function Ve(e,t){for(;K(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 Ge(e){he.call(this,e,-1,Ne)}f(Ae,he),f(Ge,he),Ge.prototype.addClassification=function(e,t){return xe(this,e,Ae,t),this};var Ne=[1];function Le(e){he.call(this,e)}function We(e,t){for(;K(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 J(e);K(e);)switch(e.i){case 10:xe(t,z(e,new Le,We),Le,void 0);break;default:if(!Ie(t,e))break e}}return t}f(Le,he),f(Xe,he);var Fe=[1];function Pe(e){he.call(this,e)}function je(e){he.call(this,e,-1,De)}function Ue(e,t){for(;K(t);)switch(t.i){case 8:var n=D(t.g);we(e,1,n);break;case 16:we(e,2,n=D(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}f(Pe,he),f(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 De=[3,4];function He(e){he.call(this,e)}function Ye(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 Ee(e,Ae).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 Je(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 Ke(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=Ye(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=Ye(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}f(He,he),He.prototype.getMesh=function(){return Se(this,je,1)},He.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 Ze(t,(function t(){var n,r,i,o,s,a,u,l,d,h,p,f=this;return T(t,(function(t){switch(t.g){case 1:return n=f,f.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(f,f.j),y(t,function(){return Ze(this,(function e(){return T(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:f.locateFile}),et("createMediapipeSolutionsPackedAssets",{locateFile:f.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 Ze(n,(function e(){var t,n,r=this;return T(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=Ze(n,(function e(){var t=this;return T(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:f.h=t.h,f.l=new OffscreenCanvas(1,1),f.h.canvas=f.l,s=f.h.GL.createContext(f.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),f.h.GL.makeContextCurrent(s),t.g=4;break;case 7:if(f.l=document.createElement("canvas"),!(p=f.l.getContext("webgl2",{}))&&!(p=f.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();f.D=p,f.h.canvas=f.l,f.h.createContext(f.l,!0,!0,{});case 4:f.i=new f.h.SolutionWasm,f.R=!1,t.g=0}}))}))}function rt(e,t){return Ze(e,(function e(){var n,r,i=this;return T(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 Ze(e,(function e(){var r,i,o,s,c,u,l,d,h,p,f,m,g,b,v=this;return T(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 Ze(e,(function e(){var r,i=this;return T(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 Ke(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(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=w.get(_);e:{var I=new Pe;for(C=new J(C);K(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=D(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=Ee(Me(S.get(_)),Le).map(Je);var k=E.get(_);e:for(R=new Ge,k=new J(k);K(k);)switch(k.i){case 10:R.addClassification(z(k,new Ae,Ve));break;default:if(!Ie(R,k))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(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,e.g=7;break}if(void 0===p){e.g=3;break}if("float_list"===h.type){r[d]=p,e.g=7;break}if("proto"===h.type){r[d]=p,e.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=v.s[d])||(f=new Ke(v.h,v.D),v.s[d]=f),y(e,ze(f,p,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 He;for(e=new J(e);K(e);)switch(e.i){case 10:var n=z(e,new je,Ue);Te(t,1,n);break;case 18:Te(t,2,n=z(e,new Re,ke));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 Ze(this,(function e(){var t=this;return T(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 Ze(n,(function t(){var n=this;return T(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 Ze(this,(function e(){var t=this;return T(e,(function(e){return 1==e.g?y(e,nt(t),2):3!=e.g?y(e,function(e){return Ze(e,(function e(){var t,n,r,i,o,s,c,u,l=this;return T(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 Ze(e,(function e(){var t,n,r,i,o,s,c=this;return T(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 Ze(this,(function n(){var r,i,o,s,c,u,l,d,h,p=this;return T(n,(function(n){switch(n.g){case 1:return p.g.inputs?(r=1e3*(null==t?performance.now():t),y(n,p.C,2)):n.return();case 2:return y(n,p.initialize(),3);case 3:for(i=new p.h.PacketDataList,o=a(Object.keys(e)),s=o.next();!s.done;s=o.next())if(c=s.value,u=p.g.inputs[c]){e:{var f=p,m=e[c];switch(u.type){case"video":var g=f.m[u.stream];if(g||(g=new Ke(f.h,f.D),f.m[u.stream]=g),0===(f=g).l&&(f.l=f.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:f.l,width:b,height:g},(b=f.g).canvas.width=g.width,b.canvas.height=g.height,b.activeTexture(b.TEXTURE0),f.h.bindTexture2d(f.l),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[u.stream])||(g=new Qe(f.h),f.m[u.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){b=m[g];var v=f.data,w=v.setBoundingBox,S=g,E=b.T,T=new Pe;we(T,1,E.Z),we(T,2,E.$),we(T,3,E.height),we(T,4,E.width),we(T,5,E.rotation),we(T,6,E.X);var x=E=new te;ie(x,1,me(T,1)),ie(x,2,me(T,2)),ie(x,3,me(T,3)),ie(x,4,me(T,4)),ie(x,5,me(T,5));var _=me(T,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(T,x),E=re(E),w.call(v,S,E),b.O)for(v=0;v<b.O.length;++v)x=!!(T=b.O[v]).visibility,S=(w=f.data).addNormalizedLandmark,E=g,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),we(x=new Le,1,T.x),we(x,2,T.y),we(x,3,T.z),T.visibility&&we(x,4,T.visibility),ie(C=T=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),T=re(T),S.call(w,E,T);if(b.M)for(v=0;v<b.M.length;++v){if(S=(w=f.data).addClassification,E=g,T=b.M[v],we(x=new Ae,2,T.Y),T.index&&we(x,1,T.index),T.label&&we(x,3,T.label),T.displayName&&we(x,4,T.displayName),C=T=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))&&(_=A(_),B(C.g,26),B(C.g,_.length),ne(C,C.g.end()),ne(C,_)),null!=(_=me(x,4))&&(_=A(_),B(C.g,34),B(C.g,_.length),ne(C,C.g.end()),ne(C,_)),Ce(x,C),T=re(T),S.call(w,E,T)}}f=f.data;break e;default:f={}}}switch(l=f,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 p.i.send(i),y(n,p.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 Ee(Me(e),Le).map(Je)}))}}}}],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]],pt=[[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]],ft=[].concat(c(ct),c(ut),c(lt),c(dt),c(ht),c(pt));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 Ze(this,(function e(){var t=this;return T(e,(function(e){return y(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Ze(this,(function t(){var n=this;return T(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",pt),C("FACEMESH_CONTOURS",ft),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(_e);const Ce={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(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 E(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 k(){I(Error("Failed to read varint, encoding is invalid."))}function O(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Z,A,V=typeof TextDecoder<"u",G=typeof TextEncoder<"u";function N(e){if(G)e=(A||(A=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 L={},W=null;function X(e){var t;void 0===t&&(t=0),F(),t=L[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=W[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(!W){W={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));L[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===W[o]&&(W[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 D="function"==typeof Uint8Array.prototype.slice;function H(e,t,n){return t===n?P||(P=new Uint8Array(0)):D?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var Y=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&&J(this,e)}function J(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 K(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,k()}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,k(),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&&J(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,k()}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,H(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 pe(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 fe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function me(e,t){if(null!=e)return Array.isArray(e)||fe(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&&pe(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&&fe(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)&&pe(r):this.u[e]=ve):(we(this),(r=this.h[e])?Array.isArray(r)&&pe(r):this.h[e]=ve)}var ve=Object.freeze(pe([]));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 Ee(e,t,n){var r=Se(e,t,n=void 0!==n&&n);return null==r&&(r=ve),r===ve&&_e(e,t,r=pe(r.slice()),n),r}function Te(e,t){var n=Ee(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=Ee(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 ke(e,t,n,r,i){var o=Re(e,r,t);n=n||new r,e=Ee(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.u)):(o.push(n),e.push(n.u))}function Oe(e,t){return null==(e=Se(e,t))?0:e}function Ze(e,t){return null==(e=Se(e,t))?"":e}function Ae(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 Ve=Symbol();function Ge(e,t,n){return e[Ve]||(e[Ve]=function(e,r){return t(e,r,n)})}function Ne(e){var t=e[Ve];if(!t){var n=e[Xe]||(e[Xe]=e());t=function(e,t){return Me(e,t,n)},e[Ve]=t}return t}function Le(e){var t=function(e){var t=e.da;if(t)return Ne(t);if(t=e.ia){var n=e.Y;return delete e.Y,Ge(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 We(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=Ne(e[2]);return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],s=e[3],a=Ne(e[2]);return function(e,n,r){return t(e,n,r,o,a,s)};case 5:var c=e[1],u=Ge(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=Ge(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]=We(i));else{var o=n[0];o&&(o=o[r])&&(i=n[r]=Le(o))}i&&i(t,e,r)||(r=e,o=(i=t).l,oe(i),i.O||(i=H(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&&(J(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?Y=0:(0,Y=2147483648):isNaN(r)?(0,Y=2147483647):34028234663852886e22<r?(0,Y=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,Y=(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,Y=(n<<31|t+127<<23|8388607&r)>>>0),te(e,(n=Y)>>>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 De(e,t,n){return 5===e.h&&(_e(t,n,e.g.m()),!0)}function He(e,t,n){if(5!==e.h&&2!==e.h)return!1;if(t=Ee(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 Ye(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,K(e.g)),!0)}function Je(e,t,n){return 0===e.h&&(_e(t,n,Q(e.g)),!0)}function Ke(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,V)(r=Z)||(r=Z=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=O(l,u),u.length=0);r=O(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&&(ke(t,n,e=se(e,new r,i),r,void 0),!0)}function et(e,t,n){return 0===e.h&&(_e(t,n,K(e.g)),!0)}function tt(e){ye.call(this,e)}function nt(){return{1:Je,2:De,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,N(r)),null!=(r=Se(e,4))&&le(t,4,N(r)),Ae(e,t)}function it(e){ye.call(this,e,-1,st)}function ot(){return{1:[$e,tt,nt]}}f(tt,ye),f(it,ye),it.prototype.addClassification=function(e,t){return ke(this,1,e,tt,t),this};var st=[1];function at(e){ye.call(this,e)}function ct(){return{1:De,2:De,3:De,4:De,5:De}}function ut(e,t){je(t,e,1),je(t,e,2),je(t,e,3),je(t,e,4),je(t,e,5),Ae(e,t)}function lt(e){ye.call(this,e,-1,ht)}function dt(){return{1:[$e,at,ct]}}f(at,ye),f(lt,ye);var ht=[1];function pt(e){ye.call(this,e)}function ft(){return{1:De,2:De,3:De,4:De,5:De,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=Y=o,o=i;0<o||127<n;)te(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;te(r,n)}Ae(e,t)}function gt(e){ye.call(this,e,-1,wt)}function bt(){return{1:et,2:et,3:He,4:[qe,yt,vt],5:Je,6:Je,7:He,8:He,9:He}}function yt(e){ye.call(this,e)}function vt(){return{1:De,2:De,3:De}}f(pt,ye),f(gt,ye),f(yt,ye);var wt=[3,7,8,9];function St(e){ye.call(this,e)}function Et(){return{1:Ye,2:Ye,3:Ye}}function Tt(e){ye.call(this,e)}function xt(){return{1:Ye,2:Ye,3:Ye}}function _t(e){ye.call(this,e)}function Ct(){return{1:Ke,2:[qe,Tt,xt],3:[qe,St,Et],4:ze}}function It(e){ye.call(this,e,-1,kt)}function Rt(){return{1:Ke,2:[$e,_t,Ct],3:Ye,4:He,5:He,6:He}}f(St,ye),f(Tt,ye),f(_t,ye),f(It,ye);var kt=[2,4,5,6];function Ot(e){ye.call(this,e,-1,At)}function Zt(){return{1:Ke,2:[$e,It,Rt],3:[qe,gt,bt],4:Ue,5:He,6:He}}f(Ot,ye);var At=[2,5,6];function Vt(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 Gt(e){return Re(e,tt,1).map((function(e){return{index:Oe(e,1),$:xe(e,2),label:null!=Se(e,3)?Ze(e,3):void 0,displayName:null!=Se(e,4)?Ze(e,4):void 0}}))}function Nt(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 Lt(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.m){var r=Vt(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=Vt(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,p;return T((function(f){switch(f.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(f,T((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)):f.return();case 2:if(r=f.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=Dt(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 T((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=T((function(e){return t.g.graph&&t.g.graph.url?e=y(e,Dt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),y(f,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(f,createMediapipeSolutionsWasm(Module),6);case 6:o.h=f.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),f.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(p=t.l.getContext("webgl2",{}))&&!(p=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),f.return();t.F=p,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.S=!1,f.g=0}}))}function Dt(e,t){var n,r;return T((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 Ht(e,t,n){var r,i,o,s,c,u,l,d,h,p,f,m,g,b;return T((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 T((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.F),e.s[t]=r),i.return(Wt(r,n,e.H))):i.return(void 0)}))}(e,d,t[h]),14);if(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=Pe(w.get(_),pt,ft);C={U:{aa:xe(C,1),ba:xe(C,2),height:xe(C,3),width:xe(C,4),rotation:xe(C,5,0),Z:Oe(C,6)},P:Re(Pe(S.get(_),lt,dt),at,1).map(Nt),N:Gt(Pe(E.get(_),it,ot))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===p){v.g=3;break}if("float_list"===h.type){r[d]=p,v.g=7;break}if("proto"===h.type){r[d]=p,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=e.s[d])||(f=new Lt(e.h,e.F),e.s[d]=f),y(v,Wt(f,p,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 Yt(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=Ht(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=Oe(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,Tt,2),1),y:xe(e,2),z:xe(e,3)}}}function Jt(e){var t=Pe(e,Ot,Zt);e=[],t=Re(t,It,2);for(var n=0;n<t.length;n++)e.push({id:Oe(t[n],1),keypoints:Re(t[n],_t,2).map(Bt),visibility:xe(t[n],3),scale:Te(t[n],6),translation:Te(t[n],5),rotation:Te(t[n],4)});return e}function Kt(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 T((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 T((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 T((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 T((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,Dt(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,Yt(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 T((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 T((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.D,2)):p.return();case 2:return y(p,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 f=e[s];switch(c.type){case"video":var m=h.m[c.stream];if(m||(m=new Lt(h.h,h.F),h.m[c.stream]=m),0===m.l&&(m.l=m.h.createTexture()),typeof HTMLVideoElement<"u"&&f instanceof HTMLVideoElement)var g=f.videoWidth,b=f.videoHeight;else typeof HTMLImageElement<"u"&&f instanceof HTMLImageElement?(g=f.naturalWidth,b=f.naturalHeight):(g=f.width,b=f.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,f),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(f.length),b=0;b<f.length;++b){g=f[b];var v=m.data,w=v.setBoundingBox,S=b,E=g.U,T=new pt;if(_e(T,1,E.aa),_e(T,2,E.ba),_e(T,3,E.height),_e(T,4,E.width),_e(T,5,E.rotation),_e(T,6,E.Z),E=Fe(T,mt),w.call(v,S,E),g.P)for(v=0;v<g.P.length;++v){var x=!!(T=g.P[v]).visibility;S=(w=m.data).addNormalizedLandmark,E=b,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),_e(x=new at,1,T.x),_e(x,2,T.y),_e(x,3,T.z),T.visibility&&_e(x,4,T.visibility),T=Fe(x,ut),S.call(w,E,T)}if(g.N)for(v=0;v<g.N.length;++v)S=(w=m.data).addClassification,E=b,T=g.N[v],_e(x=new tt,2,T.$),T.index&&_e(x,1,T.index),T.label&&_e(x,3,T.label),T.displayName&&_e(x,4,T.displayName),T=Fe(x,rt),S.call(w,E,T)}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(p,h.D,4);case 4:r.delete(),p.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:Jt}}}],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 T((function(s){return 1==s.g?(n=e,t.g.setOptions({allowedLabels:Kt(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,Dt(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 T((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 T((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 T((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 T((function(t){return y(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return T((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(Ce);const Ie={};(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 p=u;function f(e,t){if(e.prototype=l(t.prototype),e.prototype.constructor=e,p)p(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 E(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 T(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 E(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 k(){I(Error("Failed to read varint, encoding is invalid."))}function O(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Z,A,V=typeof TextDecoder<"u",G=typeof TextEncoder<"u";function N(e){if(G)e=(A||(A=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 L={},W=null;function X(e){var t;void 0===t&&(t=0),F(),t=L[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=W[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(!W){W={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));L[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===W[o]&&(W[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 D="function"==typeof Uint8Array.prototype.slice;function H(e,t,n){return t===n?P||(P=new Uint8Array(0)):D?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var Y=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&&J(this,e)}function J(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 K(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,K(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,K(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,K(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,K(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,K(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,k(),r):(K(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&&J(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,K(e);break e}t++}e.j=!0,k()}break;case 1:(e=e.g).g+=8,K(e);break;case 2:2!=e.h?re(e):(t=z(e.g),(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(!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=H(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,H(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 pe(e){return Array.isArray(e)&&de(e,1),e}function fe(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)&&pe(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])?pe(r):this.g[e]=Ee):(Te(this),(r=this.h[e])?pe(r):this.h[e]=Ee)}var we,Se,Ee=Object.freeze(pe([]));function Te(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=Ee),i===Ee?Ie(e,t,i=pe([]),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?(Te(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&&fe(r[s].g);o&&(fe(r),Object.freeze(r)),e.i[n]=r}return r}function ke(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,Oe(n))):(o.push(n),e.push(Oe(n)))}function Oe(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]&&Oe(n[r]);else n&&Oe(n)}return e.g}function Ze(e,t){return null==(e=xe(e,t))?0:e}function Ae(e,t){return null==(e=xe(e,t))?"":e}function Ve(e,t){if(e=e.m){ae(t,t.g.end());for(var n=0;n<e.length;n++)ae(t,e[n])}}function Ge(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 Ne(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]=Ge(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 Le(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 We(e,t,n){if(oe.length){var r=oe.pop();e&&(J(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?Y=0:(0,Y=2147483648):isNaN(r)?(0,Y=2147483647):34028234663852886e22<r?(0,Y=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,Y=(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,Y=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=Y)>>>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,K(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,k(),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,K(e),e=e.h,V)(r=Z)||(r=Z=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=O(l,u),u.length=0);r=O(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,ke(t,n,o,r,void 0),!0}function De(e){ve.call(this,e)}function He(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,N(r)),null!=(r=xe(e,4))&&ce(t,4,N(r)),Ve(e,t)}function Ye(e,t){return Ne(e,t,we||(we={1:Pe,2:Me,3:je,4:je}))}function Be(e){ve.call(this,e,-1,Qe)}function Je(e,t){return Ne(e,t,Se||(Se={1:[Ue,De,Ye]}))}ve.prototype.toJSON=function(){return ye(Oe(this),ge)},ve.prototype.toString=function(){return Oe(this).toString()},f(De,ve),f(Be,ve),Be.prototype.addClassification=function(e,t){return ke(this,1,e,De,t),this};var Ke,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),Ve(e,t)}function et(e,t){return Ne(e,t,Ke||(Ke={1:Me,2:Me,3:Me,4:Me,5:Me}))}function tt(e){ve.call(this,e,-1,it)}function nt(e,t){return Ne(e,t,ze||(ze={1:[Ue,qe,et]}))}f(qe,ve),f(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=Y=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Ve(e,t)}function at(e,t){return Ne(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,De,1).map((function(e){return{index:Ze(e,1),X:Ce(e,2),label:null!=xe(e,3)?Ae(e,3):void 0,displayName:null!=xe(e,4)?Ae(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(We(e,tt,nt),qe,1).map(lt)}function ht(e,t){this.h=e,this.g=t,this.l=0}function pt(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 ft(e){this.g=e}f(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,p;return T((function(f){switch(f.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(f,T((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)):f.return();case 2:if(r=f.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 T((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=T((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(f,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(f,createMediapipeSolutionsWasm(Module),6);case 6:o.h=f.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),f.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(p=t.l.getContext("webgl2",{}))&&!(p=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),f.return();t.D=p,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,f.g=0}}))}function wt(e,t){var n,r;return T((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,p,f,m,g,b;return T((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 T((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(pt(r,n,e.G))):i.return(void 0)}))}(e,d,t[h]),14);if(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),S=p.getLandmarksList(),E=p.getClassificationsList(),x=[],_=0;_<w.size();++_){var C=We(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:Ze(C,6)},O:dt(S.get(_)),M:ut(We(E.get(_),Be,Je))},x.push(C)}w=x}else w=[];r[d]=w,v.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),S=0;S<p.size();S++)w[S]=p.get(S);p.delete()}else w=[];r[d]=w,v.g=7;break}if(void 0===p){v.g=3;break}if("float_list"===h.type){r[d]=p,v.g=7;break}if("proto"===h.type){r[d]=p,v.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(f=e.s[d])||(f=new ht(e.h,e.D),e.s[d]=f),y(v,pt(f,p,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 Et(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 Tt(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:Tt(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 T((function(o){return 1==o.g?(n=Tt(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 T((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 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.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return T((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 T((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,Et(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 T((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 T((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.C,2)):p.return();case 2:return y(p,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 f=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"&&f instanceof HTMLVideoElement)var g=f.videoWidth,b=f.videoHeight;else typeof HTMLImageElement<"u"&&f instanceof HTMLImageElement?(g=f.naturalWidth,b=f.naturalHeight):(g=f.width,b=f.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,f),m.h.bindTexture2d(0),m=b;break e;case"detections":for((m=h.m[c.stream])||(m=new ft(h.h),h.m[c.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(f.length),b=0;b<f.length;++b){g=f[b];var v=m.data,w=v.setBoundingBox,S=b,E=g.T,T=new ot;if(Ie(T,1,E.Y),Ie(T,2,E.Z),Ie(T,3,E.height),Ie(T,4,E.width),Ie(T,5,E.rotation),Ie(T,6,E.W),E=Le(T,st),w.call(v,S,E),g.O)for(v=0;v<g.O.length;++v){var x=!!(T=g.O[v]).visibility;S=(w=m.data).addNormalizedLandmark,E=b,T=Object.assign(Object.assign({},T),{visibility:x?T.visibility:0}),Ie(x=new qe,1,T.x),Ie(x,2,T.y),Ie(x,3,T.z),T.visibility&&Ie(x,4,T.visibility),T=Le(x,$e),S.call(w,E,T)}if(g.M)for(v=0;v<g.M.length;++v)S=(w=m.data).addClassification,E=b,T=g.M[v],Ie(x=new De,2,T.X),T.index&&Ie(x,1,T.index),T.label&&Ie(x,3,T.label),T.displayName&&Ie(x,4,T.displayName),T=Le(x,He),S.call(w,E,T)}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(p,h.C,4);case 4:r.delete(),p.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 T((function(t){return y(t,e.g.initialize(),0)}))},t.send=function(e,t){var n=this;return T((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(Ie);const Re=class{constructor(){o(this,"mediapipeMap_",new Map)}getVersion(e){switch(e){case"face_detection":return xe.VERSION;case"face_mesh":return _e.VERSION;case"hands":return Ee.VERSION;case"holistic":return Te.VERSION;case"objectron":return Ce.VERSION;case"selfie_segmentation":return Se.VERSION;case"pose":return Ie.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 _e.FaceMesh({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"face_mesh/"+this.getVersion("face_mesh"))+"/"+e});break;case"face_detection":i=new xe.FaceDetection({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"face_detection/"+this.getVersion("face_detection"))+"/"+e});break;case"hands":i=new Ee.Hands({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"hands/"+this.getVersion("hands"))+"/"+e});break;case"holistic":i=new Te.Holistic({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"holistic/"+this.getVersion("holistic"))+"/"+e});break;case"objectron":i=new Ce.Objectron({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"objectron/"+this.getVersion("objectron"))+"/"+e});break;case"selfie_segmentation":i=new Se.SelfieSegmentation({locateFile:(e,t)=>(r.assetsUri||Re.defaultAssetsBaseUrl+"selfie_segmentation/"+this.getVersion("selfie_segmentation"))+"/"+e});break;case"pose":i=new Ie.Pose({locateFile:(e,t)=>(r.assetsUri||Re.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 ke=Re;o(ke,"defaultAssetsBaseUrl","https://d3opqjmqzxf057.cloudfront.net/ml/mediapipe/");const Oe=new WeakMap,Ze=new WeakMap,Ae=new WeakMap,Ve=Symbol("anyProducer"),Ge=e.resolve(),Ne=Symbol("listenerAdded"),Le=Symbol("listenerRemoved");let We=!1;function Xe(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function Me(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function Fe(e,t){const n=Ze.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function Pe(e,t){const n="string"==typeof t||"symbol"==typeof t?t:Ve,r=Ae.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function je(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},o=[];const s={enqueue(e){o.push(e),i()},finish(){r=!0,i()}};for(const e of n)Pe(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)Pe(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function Ue(e){if(void 0===e)return Ye;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!Ye.includes(t))throw"string"!=typeof t?new TypeError("`methodNames` element must be a string"):new Error(t+" is not Emittery method");return e}const De=e=>e===Ne||e===Le;class He{static mixin(e,t){return t=Ue(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 He}),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 We;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||We}static set isDebugEnabled(e){We=e}constructor(e={}){Oe.set(this,new Set),Ze.set(this,new Map),Ae.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){(He.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){Me(t),e=Array.isArray(e)?e:[e];for(const n of e)Xe(n),Fe(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),De(n)||this.emit(Ne,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){Me(t),e=Array.isArray(e)?e:[e];for(const n of e)Xe(n),Fe(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),De(n)||this.emit(Le,{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)Xe(t);return je(this,e)}async emit(t,n){Xe(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=Ae.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(Ve)){const t=e.all([n,r]);for(const e of i.get(Ve))e.enqueue(t)}}(this,t,n);const r=Fe(this,t),i=Oe.get(this),o=[...r],s=De(t)?[]:[...i];await Ge,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){Xe(e),this.logIfDebugEnabled("emitSerial",e,t);const n=Fe(this,e),r=Oe.get(this),i=[...n],o=[...r];await Ge;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 Me(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),Oe.get(this).add(e),this.emit(Ne,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return je(this)}offAny(e){Me(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(Le,{listener:e}),Oe.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){Fe(this,t).clear();const e=Pe(this,t);for(const t of e)t.finish();e.clear()}else{Oe.get(this).clear();for(const e of Ze.get(this).values())e.clear();for(const e of Ae.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"&&Xe(n),t+=Oe.get(this).size;for(const e of Ze.get(this).values())t+=e.size;for(const e of Ae.get(this).values())t+=e.size}else t+=Oe.get(this).size+Fe(this,n).size+Pe(this,n).size+Pe(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=Ue(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 Ye=Object.getOwnPropertyNames(He.prototype).filter(e=>"constructor"!==e);Object.defineProperty(He,"listenerAdded",{value:Ne,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(He,"listenerRemoved",{value:Le,writable:!1,enumerable:!0,configurable:!1});var Be=He;function Je(e,t){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let n=globalThis.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const Ke=Je("globals",{});var ze=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(ze||{});function Qe(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let qe=0;function $e(t,n,r,i,o){const s=qe++;return t.postMessage({id:s,type:n,functionName:r,args:i},i.filter(e=>Qe(e))),new e(e=>{null==o||o.set(s,e)})}function et(e,t){const{id:n,type:r}=e,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>Qe(e)))}const tt=Je("workerized",{});function nt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function rt(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],rt(e[n],t[n])):"object"==typeof e[n]?(t[n]={},rt(e[n],t[n])):t[n]=e[n]}async function it(t,n,r){const i=new n;if(i.addEventListener("message",async({data:t})=>{var n,i,o,s,a,c,u;switch(t.type){case ze.GLOBALS_SYNC:t.id?(null==(i=r.get(null!=(n=t.id)?n:-1))||i(t.result),r.delete(null!=(o=t.id)?o:-1)):(rt(null!=(s=t.result)?s:{},Ke),await async function(){if(nt())et({type:ze.GLOBALS_SYNC},Ke);else{const t=[];for(const e in tt){const{worker:n,resolvers:r}=tt[e].workerContext;n&&t.push($e(n,ze.GLOBALS_SYNC,"",[Ke],r))}await e.all(t)}}());break;default:null==(c=r.get(null!=(a=t.id)?a:-1))||c(t.result),r.delete(null!=(u=t.id)?u:-1)}}),!await $e(i,ze.INIT,"",[t.workerId,Ke],r))throw"Failed to instantiate workerized class";return i}let ot=0;async function st(e,t){const n=new Map;return async function(e,t,n){const r={},i=ot++;return Object.getOwnPropertyNames(e.prototype).forEach(e=>{r[e]=(...r)=>$e(t,ze.FORWARD,e,r,n)}),r.terminate=async(...e)=>{const o=await $e(t,ze.TERMINATE,"",e,n);return delete tt[i],t.terminate(),r.workerContext.worker=void 0,o},r.workerContext={id:i,worker:t,resolvers:n},tt[i]=r,r}(e,await it(e,t,n),n)}const at=Je("registeredWorkers",{});nt()&&function(){const e={};onmessage=async t=>{const n=t.data;switch(n.type){case ze.INIT:!function(e,t){if(!e.args)throw"Missing className while initializing worker";const[n,r]=e.args,i=at[n];if(!i)throw"unknown worker class "+n;t.instance=new i(e.args.slice(1)),rt(r,Ke),et(e,void 0!==typeof t.instance)}(n,e);break;case ze.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}`;et(e,await t.instance[n](...null!=r?r:[]))}(n,e);break;case ze.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:[])),et(e,r)}(n,e);break;case ze.GLOBALS_SYNC:!function(e){if(!e.args)throw"Missing globals while syncing";rt(e.args[0],Ke),et(e,{})}(n)}}}();class ct{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)}}var ut=Object.defineProperty,lt=(e,t,n)=>(((e,t,n)=>{t in e?ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let dt;const ht=new Uint8Array(16);function pt(){if(!dt&&(dt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!dt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return dt(ht)}const ft=[];for(let e=0;e<256;++e)ft.push((e+256).toString(16).slice(1));const mt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gt(e,t,n){if(mt.randomUUID&&!t&&!e)return mt.randomUUID();const r=(e=e||{}).random||(e.rng||pt)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(ft[e[t+0]]+ft[e[t+1]]+ft[e[t+2]]+ft[e[t+3]]+"-"+ft[e[t+4]]+ft[e[t+5]]+"-"+ft[e[t+6]]+ft[e[t+7]]+"-"+ft[e[t+8]]+ft[e[t+9]]+"-"+ft[e[t+10]]+ft[e[t+11]]+ft[e[t+12]]+ft[e[t+13]]+ft[e[t+14]]+ft[e[t+15]]).toLowerCase()}(r)}function bt(e,t){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let n=globalThis.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const yt=bt("globals",{});var vt=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(vt||{});function wt(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let St=0;function Et(t,n,r,i,o){const s=St++;return t.postMessage({id:s,type:n,functionName:r,args:i},i.filter(e=>wt(e))),new e(e=>{null==o||o.set(s,e)})}function Tt(e,t){const{id:n,type:r}=e,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>wt(e)))}const xt=bt("workerized",{});function _t(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Ct(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],Ct(e[n],t[n])):"object"==typeof e[n]?(t[n]={},Ct(e[n],t[n])):t[n]=e[n]}const It=bt("registeredWorkers",{});function Rt(t,n){return yt[t]||(yt[t]=n),[()=>yt[t],async n=>{yt[t]=n,await async function(){if(_t())Tt({type:vt.GLOBALS_SYNC},yt);else{const t=[];for(const e in xt){const{worker:n,resolvers:r}=xt[e].workerContext;n&&t.push(Et(n,vt.GLOBALS_SYNC,"",[yt],r))}await e.all(t)}}()}]}_t()&&function(){const e={};onmessage=async t=>{const n=t.data;switch(n.type){case vt.INIT:!function(e,t){if(!e.args)throw"Missing className while initializing worker";const[n,r]=e.args,i=It[n];if(!i)throw"unknown worker class "+n;t.instance=new i(e.args.slice(1)),Ct(r,yt),Tt(e,void 0!==typeof t.instance)}(n,e);break;case vt.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}`;Tt(e,await t.instance[n](...null!=r?r:[]))}(n,e);break;case vt.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:[])),Tt(e,r)}(n,e);break;case vt.GLOBALS_SYNC:!function(e){if(!e.args)throw"Missing globals while syncing";Ct(e.args[0],yt),Tt(e,{})}(n)}}}();const[kt,Ot]=function(e,t){return Rt(e,t)}("metadata");function Zt(){return kt()}class At{constructor(e){lt(this,"uuid",gt()),this.config=e}async send(e){var t,n,r;const{appId:i,sourceType:o}=null!=(t=Zt())?t:{};if(!i||!o)return"metadata missing";const s=new AbortController,a=setTimeout(()=>s.abort(),1e4);return await(null!=(r=null==(n=this.config)?void 0:n.fetch)?r:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(e)),signal:s.signal}),clearTimeout(a),"success"}getUrl(){var e;let t=null!=(e=Zt().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t}getHeaders(){return{"Content-Type":"application/json"}}buildReport(e){const t=Zt();return{guid:this.uuid,...e,applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType}}}class Vt{constructor(){o(this,"canvas"),o(this,"context");const e=new OffscreenCanvas(0,0),t=e.getContext("2d");if(!t)throw"Fail to retrieve webgl2 context";this.canvas=e,this.context=t}setFlickeringOptions(e){}enablePostProcessing(){}disablePostProcessing(){}async profileWebgl(e){return[]}async render(e,t){return this.canvas}resizeCanvas(e){const{width:t,height:n}=e;this.canvas.width=t,this.canvas.height=n}renderSilhouette(e,t,n="none"){const{width:r,height:i}=e;this.context.save(),this.context.drawImage(t,0,0,t.width,t.height,0,0,r,i),this.context.globalCompositeOperation="source-in",this.context.filter=n,this.context.drawImage(e,0,0,r,i,0,0,this.canvas.width,this.canvas.height),this.context.restore()}}class Gt extends Vt{constructor(e){super(),this.radius=e}async render(e,t){return super.resizeCanvas(e),this.renderSilhouette(e,t),this.context.save(),this.context.filter=`blur(${this.radius}px)`,this.context.globalCompositeOperation="destination-over",this.context.drawImage(e,0,0,e.width,e.height),this.context.restore(),super.render(e,t)}}class Nt extends Vt{constructor(e){super(),this.radius=e}async render(e,t){return super.resizeCanvas(e),this.renderSilhouette(e,t,`blur(${this.radius}px)`),this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(e,0,0,e.width,e.height),this.context.restore(),super.render(e,t)}}class Lt extends Vt{constructor(){super(...arguments),o(this,"backgroundImage")}setBackgroundImage(e){this.backgroundImage=e}async render(e,t){return super.resizeCanvas(e),this.renderSilhouette(e,t),this.backgroundImage&&(this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(this.backgroundImage,0,0,this.backgroundImage.width,this.backgroundImage.height,0,0,e.width,e.height),this.context.restore()),super.render(e,t)}}
24
+ /* @license twgl.js 5.2.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
25
+ Available via the MIT license.
26
+ see: http://github.com/greggman/twgl.js for details */const Wt={};{const e=Wt;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 Xt(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 Mt(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 Ft(e){const t=Wt[e];if(!t)throw new Error("unknown gl type");return t}const Pt=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 jt(...e){console.error(...e)}const Ut=new Map;function Dt(e,t){if(!e||"object"!=typeof e)return!1;let n=Ut.get(t);n||(n=new WeakMap,Ut.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 Ht(e,t){return typeof WebGLTexture<"u"&&Dt(t,"WebGLTexture")}const Yt=34962,Bt="";function Jt(e,t,n,r){if(function(e,t){return typeof WebGLBuffer<"u"&&Dt(t,"WebGLBuffer")}(0,t))return t;n=n||Yt;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 Kt(e){return"indices"===e}const zt=/coord|texture/i,Qt=/color|colour/i;function qt(e,t,n){return e.numComponents||e.size||function(e,t){let n;if(n=zt.test(e)?2:Qt.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 $t(e,t){if(Pt(e))return e;if(Pt(e.data))return e.data;Array.isArray(e)&&(e={data:e});let n=e.type?tn(e.type):void 0;return n||(n=Kt(t)?Uint16Array:Float32Array),new n(e.data)}function en(e){return"number"==typeof e?e:e?Mt(e):5126}function tn(e){return"number"==typeof e?Ft(e):e||Float32Array}function nn(e,t){return{buffer:t.buffer,numValues:24,type:en(t.type),arrayType:tn(t.type)}}function rn(e,t){const n=t.data||t,r=tn(t.type),i=n*r.BYTES_PER_ELEMENT,o=e.createBuffer();return e.bindBuffer(Yt,o),e.bufferData(Yt,i,t.drawType||35044),{buffer:o,numValues:n,type:Mt(r),arrayType:r}}function on(e,t,n){const r=$t(t,n);return{arrayType:r.constructor,buffer:Jt(e,r,void 0,t.drawType),type:Xt(r),numValues:0}}function sn(e,t){const n={};return Object.keys(t).forEach((function(r){if(!Kt(r)){const i=t[r],o=i.attrib||i.name||i.attribName||Bt+r;if(i.value){if(!Array.isArray(i.value)&&!Pt(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?nn:"number"==typeof i||"number"==typeof i.data?rn:on;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=qt(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(Yt,null),n}const an=["position","positions","a_position"];function cn(e,t,n){const r=sn(e,t),i=Object.assign({},n||{});i.attribs=Object.assign({},n?n.attribs:{},r);const o=t.indices;if(o){const t=$t(o,"indices");i.indices=Jt(e,t,34963),i.numElements=t.length,i.elementType=Xt(t)}else i.numElements||(i.numElements=function(e,t){let n,r;for(r=0;r<an.length&&(n=an[r],!(n in t)&&(n=Bt+n,!(n in t)));++r);r===an.length&&(n=Object.keys(t)[0]);const i=t[n];if(!i.buffer)return 1;e.bindBuffer(Yt,i.buffer);const o=e.getBufferParameter(Yt,34660);e.bindBuffer(Yt,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 un(e){return!!e.texStorage2D}const ln=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)}}(),dn={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},hn=Pt,pn=function(){let e;return function(){return e=e||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),fn=6407,mn=6408,gn=6402,bn=33071,yn=3553,vn=34067,wn=32879,Sn=35866,En=10242,Tn=10243,xn=5120,_n=5121,Cn=5123,In=5125,Rn=5126,kn=5131,On=36193,Zn=33319,An=33320,Vn=36244,Gn=36248,Nn=36249;let Ln;function Wn(e){if(!Ln){const e={};e[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[_n,kn,On,Rn]},e[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[_n,kn,On,Rn]},e[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[_n,kn,On,Rn]},e[fn]={textureFormat:fn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[_n,kn,On,Rn,33635]},e[mn]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[_n,kn,On,Rn,32819,32820]},e[gn]={textureFormat:gn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[In,Cn]},e[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[_n]},e[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[xn]},e[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[Rn,kn]},e[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[Rn]},e[33330]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[_n]},e[33329]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[xn]},e[33332]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Cn]},e[33331]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5122]},e[33334]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[In]},e[33333]={textureFormat:Vn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5124]},e[33323]={textureFormat:Zn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[_n]},e[36757]={textureFormat:Zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[xn]},e[33327]={textureFormat:Zn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[Rn,kn]},e[33328]={textureFormat:Zn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[Rn]},e[33336]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[_n]},e[33335]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[xn]},e[33338]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Cn]},e[33337]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5122]},e[33340]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[In]},e[33339]={textureFormat:An,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5124]},e[32849]={textureFormat:fn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[_n]},e[35905]={textureFormat:fn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[_n]},e[36194]={textureFormat:fn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[_n,33635]},e[36758]={textureFormat:fn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[xn]},e[35898]={textureFormat:fn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Rn,kn,35899]},e[35901]={textureFormat:fn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Rn,kn,35902]},e[34843]={textureFormat:fn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[Rn,kn]},e[34837]={textureFormat:fn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Rn]},e[36221]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[_n]},e[36239]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[xn]},e[36215]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Cn]},e[36233]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[5122]},e[36209]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[In]},e[36227]={textureFormat:Gn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5124]},e[32856]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[_n]},e[35907]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[_n]},e[36759]={textureFormat:mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[xn]},e[32855]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[_n,32820,33640]},e[32854]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[_n,32819]},e[32857]={textureFormat:mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[33640]},e[34842]={textureFormat:mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[Rn,kn]},e[34836]={textureFormat:mn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[Rn]},e[36220]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[_n]},e[36238]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[xn]},e[36975]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[33640]},e[36214]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Cn]},e[36232]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5122]},e[36226]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[5124]},e[36208]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[In]},e[33189]={textureFormat:gn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Cn,In]},e[33190]={textureFormat:gn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[In]},e[36012]={textureFormat:gn,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Rn]},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}))})),Ln=e}return Ln[e]}function Xn(e){const t=Wn(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function Mn(e){return 0==(e&e-1)}function Fn(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===vn?6:1));e%1==0?(n=e,r=e):(n=i,r=1)}return{width:n,height:r}}function Pn(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 jn(e){e.pixelStorei(3317,4),un(e)&&(e.pixelStorei(3314,0),e.pixelStorei(32878,0),e.pixelStorei(3316,0),e.pixelStorei(3315,0),e.pixelStorei(32877,0))}function Un(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,En,r.wrap),n.call(e,t,Tn,r.wrap),(t===wn||function(e,t){return typeof WebGLSampler<"u"&&Dt(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,En,r.wrapS),r.wrapT&&n.call(e,t,Tn,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 Dn(e,t,n){const r=n.target||yn;e.bindTexture(r,t),Un(e,r,e.texParameteri,n)}function Hn(e,t,n,r,i,o){o=o||mn;const s=(n=n||dn.textureOptions).target||yn;if(r=r||n.width,i=i||n.height,e.bindTexture(s,t),function(e,t,n,r){if(!un(e))return Mn(t)&&Mn(n);const i=Wn(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=Wn(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,En,bn),e.texParameteri(s,Tn,bn)}}function Yn(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function Bn(e,t){return(t=t||{}).cubeFaceOrder||[34069,34070,34071,34072,34073,34074]}function Jn(e,t){const n=Bn(0,t).map((function(e,t){return{face:e,ndx:t}}));return n.sort((function(e,t){return e.face-t.face})),n}function Kn(e,t,n,r){const i=(r=r||dn.textureOptions).target||yn,o=r.level||0;let s=n.width,a=n.height;const c=r.internalFormat||r.format||mn,u=Xn(c),l=r.format||u.format,d=r.type||u.type;if(Pn(e,r),e.bindTexture(i,t),i===vn){const u=n.width,h=n.height;let p,f;if(u/6===h)p=h,f=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===u)p=u,f=[0,0,0,1,0,2,0,3,0,4,0,5];else if(u/3==h/2)p=u/3,f=[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);p=u/2,f=[0,0,1,0,0,1,1,1,0,2,1,2]}const m=pn();m?(m.canvas.width=p,m.canvas.height=p,s=p,a=p,Jn(0,r).forEach((function(t){const r=f[2*t.ndx+0]*p,i=f[2*t.ndx+1]*p;m.drawImage(n,r,i,p,p,0,0,p,p),e.texImage2D(t.face,o,c,l,d,m.canvas)})),m.canvas.width=1,m.canvas.height=1):typeof createImageBitmap<"u"&&(s=p,a=p,Jn(0,r).forEach((function(u){const h=f[2*u.ndx+0]*p,m=f[2*u.ndx+1]*p;e.texImage2D(u.face,o,c,p,p,0,l,d,null),createImageBitmap(n,h,m,p,p,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(n){Pn(e,r),e.bindTexture(i,t),e.texImage2D(u.face,o,c,l,d,n),Yn(r)&&Hn(e,t,r,s,a,c)}))})))}else if(i===wn||i===Sn){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)}jn(e)}else e.texImage2D(i,o,c,l,d,n);Yn(r)&&Hn(e,t,r,s,a,c),Dn(e,t,r)}function zn(){}function Qn(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 qn(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof ImageData<"u"&&e instanceof ImageData||typeof HTMLElement<"u"&&e instanceof HTMLElement}function $n(e,t,n){return qn(e)?(setTimeout((function(){n(null,e)})),e):function(e,t,n){let r;if(n=n||zn,t=Qn(e,t=void 0!==t?t:dn.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;jt(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 er(e,t,n){const r=(n=n||dn.textureOptions).target||yn;if(e.bindTexture(r,t),!1===n.color)return;const i=function(e){return hn(e=e||dn.textureColor)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(n.color);if(r===vn)for(let t=0;t<6;++t)e.texImage2D(34069+t,0,mn,1,1,0,mn,_n,i);else r===wn||r===Sn?e.texImage3D(r,0,mn,1,1,1,0,mn,_n,i):e.texImage2D(r,0,mn,1,1,0,mn,_n,i)}function tr(e,t,n,r){r=r||zn;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||mn,a=Xn(s),c=n.format||a.format,u=n.type||_n,l=n.target||yn;if(l!==vn)throw"target must be TEXTURE_CUBE_MAP";er(e,t,n),n=Object.assign({},n);let d=6;const h=[],p=Bn(0,n);let f;f=i.map((function(i,a){return $n(i,n.crossOrigin,function(i){return function(a,p){--d,a?h.push(a):p.width!==p.height?h.push("cubemap face img is not a square: "+p.src):(Pn(e,n),e.bindTexture(l,t),5===d?Bn().forEach((function(t){e.texImage2D(t,o,s,c,u,p)})):e.texImage2D(i,o,s,c,u,p),Yn(n)&&e.generateMipmap(l)),0===d&&r(h.length?h:void 0,t,f)}}(p[a]))}))}function nr(e,t,n,r){r=r||zn;const i=n.src,o=n.internalFormat||n.format||mn,s=Xn(o),a=n.format||s.format,c=n.type||_n,u=n.target||Sn;if(u!==wn&&u!==Sn)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";er(e,t,n),n=Object.assign({},n);let l=i.length;const d=[];let h;const p=n.level||0;let f=n.width,m=n.height;const g=i.length;let b=!0;h=i.map((function(i,s){return $n(i,n.crossOrigin,function(i){return function(s,y){if(--l,s)d.push(s);else{if(Pn(e,n),e.bindTexture(u,t),b){b=!1,f=n.width||y.width,m=n.height||y.height,e.texImage3D(u,p,o,f,m,g,0,a,c,null);for(let t=0;t<g;++t)e.texSubImage3D(u,p,0,0,t,f,m,1,a,c,y)}else{let t,n=y;(y.width!==f||y.height!==m)&&(t=pn(),n=t.canvas,t.canvas.width=f,t.canvas.height=m,t.drawImage(y,0,0,f,m)),e.texSubImage3D(u,p,0,0,i,f,m,1,a,c,n),t&&n===t.canvas&&(t.canvas.width=0,t.canvas.height=0)}Yn(n)&&e.generateMipmap(u)}0===l&&r(d.length?d:void 0,t,h)}}(s))}))}function rr(e,t,n,r){const i=(r=r||dn.textureOptions).target||yn;e.bindTexture(i,t);let o=r.width,s=r.height,a=r.depth;const c=r.level||0,u=r.internalFormat||r.format||mn,l=Xn(u),d=r.format||l.format,h=r.type||function(e,t,n){return hn(t)?Xt(t):n||_n}(0,n,l.type);if(hn(n))n instanceof Uint8ClampedArray&&(n=new Uint8Array(n.buffer));else{const e=Ft(h);n=new e(n)}const p=function(e,t){const n=Wn(e);if(!n)throw"unknown internal format";const r=n.bytesPerElementMap[t];if(void 0===r)throw"unknown internal format";return r}(u,h),f=n.byteLength/p;if(f%1)throw"length wrong size for format: "+ln(e,d);let m;if(i===wn||i===Sn)if(o||s||a)!o||s&&a?!s||o&&a?(m=Fn(0,i,o,s,f/a),o=m.width,s=m.height):(m=Fn(0,i,o,a,f/s),o=m.width,a=m.height):(m=Fn(0,i,s,a,f/o),s=m.width,a=m.height);else{const e=Math.cbrt(f);if(e%1!=0)throw"can't guess cube size of array of numElements: "+f;o=e,s=e,a=e}else m=Fn(0,i,o,s,f),o=m.width,s=m.height;if(jn(e),e.pixelStorei(3317,r.unpackAlignment||1),Pn(e,r),i===vn){const t=f/6*(p/n.BYTES_PER_ELEMENT);Jn(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===wn||i===Sn?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 ir(e,t,n){n=n||zn,t=t||dn.textureOptions;const r=e.createTexture(),i=t.target||yn;let o=t.width||1,s=t.height||1;const a=t.internalFormat||mn;e.bindTexture(i,r),i===vn&&(e.texParameteri(i,En,bn),e.texParameteri(i,Tn,bn));let c=t.src;if(c)if("function"==typeof c&&(c=c(e,t)),"string"==typeof c)!function(e,t,n,r){r=r||zn,er(e,t,n=n||dn.textureOptions),$n((n=Object.assign({},n)).src,n.crossOrigin,(function(i,o){i?r(i,t,o):(Kn(e,t,o,n),r(null,t,o))}))}(e,r,t,n);else if(hn(c)||Array.isArray(c)&&("number"==typeof c[0]||Array.isArray(c[0])||hn(c[0]))){const n=rr(e,r,c,t);o=n.width,s=n.height}else Array.isArray(c)&&("string"==typeof c[0]||qn(c[0]))?i===vn?tr(e,r,t,n):nr(e,r,t,n):(Kn(e,r,c,t),o=c.width,s=c.height);else!function(e,t,n){const r=n.target||yn;e.bindTexture(r,t);const i=n.level||0,o=n.internalFormat||n.format||mn,s=Xn(o),a=n.format||s.format,c=n.type||s.type;if(Pn(e,n),r===vn)for(let t=0;t<6;++t)e.texImage2D(34069+t,i,o,n.width,n.height,0,a,c,null);else r===wn||r===Sn?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 Yn(t)&&Hn(e,r,t,o,s,a),Dn(e,r,t),r}const or=jt;function sr(e){return typeof document<"u"&&document.getElementById?document.getElementById(e):null}const ar=33984,cr=34962,ur=34067,lr=35866,dr={};function hr(e,t){return dr[t].bindPoint}function pr(e,t){return function(n){e.uniform1i(t,n)}}function fr(e,t){return function(n){e.uniform1iv(t,n)}}function mr(e,t){return function(n){e.uniform2iv(t,n)}}function gr(e,t){return function(n){e.uniform3iv(t,n)}}function br(e,t){return function(n){e.uniform4iv(t,n)}}function yr(e,t,n,r){const i=hr(0,t);return un(e)?function(t){let o,s;Ht(0,t)?(o=t,s=null):(o=t.texture,s=t.sampler),e.uniform1i(r,n),e.activeTexture(ar+n),e.bindTexture(i,o),e.bindSampler(n,s)}:function(t){e.uniform1i(r,n),e.activeTexture(ar+n),e.bindTexture(i,t)}}function vr(e,t,n,r,i){const o=hr(0,t),s=new Int32Array(i);for(let e=0;e<i;++e)s[e]=n+e;return un(e)?function(t){e.uniform1iv(r,s),t.forEach((function(t,r){let i,a;e.activeTexture(ar+s[r]),Ht(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(ar+s[n]),e.bindTexture(o,t)}))}}function wr(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(cr,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 Sr(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(cr,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 Er(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(cr,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 Tr(e,t,n){const r=n.size,i=n.count;return function(n){e.bindBuffer(cr,n.buffer);const o=n.size||n.numComponents||r,s=o/i,a=n.type||5126,c=dr[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)}}dr[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)}}},dr[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(n){e.uniform2fv(t,n)}},cols:2},dr[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(n){e.uniform3fv(t,n)}},cols:3},dr[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(n){e.uniform4fv(t,n)}},cols:4},dr[5124]={Type:Int32Array,size:4,setter:pr,arraySetter:fr},dr[35667]={Type:Int32Array,size:8,setter:mr,cols:2},dr[35668]={Type:Int32Array,size:12,setter:gr,cols:3},dr[35669]={Type:Int32Array,size:16,setter:br,cols:4},dr[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)}}},dr[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(n){e.uniform2uiv(t,n)}},cols:2},dr[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(n){e.uniform3uiv(t,n)}},cols:3},dr[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(n){e.uniform4uiv(t,n)}},cols:4},dr[35670]={Type:Uint32Array,size:4,setter:pr,arraySetter:fr},dr[35671]={Type:Uint32Array,size:8,setter:mr,cols:2},dr[35672]={Type:Uint32Array,size:12,setter:gr,cols:3},dr[35673]={Type:Uint32Array,size:16,setter:br,cols:4},dr[35674]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2fv(t,!1,n)}},rows:2,cols:2},dr[35675]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3fv(t,!1,n)}},rows:3,cols:3},dr[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4fv(t,!1,n)}},rows:4,cols:4},dr[35685]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x3fv(t,!1,n)}},rows:2,cols:3},dr[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(n){e.uniformMatrix2x4fv(t,!1,n)}},rows:2,cols:4},dr[35687]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x2fv(t,!1,n)}},rows:3,cols:2},dr[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(n){e.uniformMatrix3x4fv(t,!1,n)}},rows:3,cols:4},dr[35689]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x2fv(t,!1,n)}},rows:4,cols:2},dr[35690]={Type:Float32Array,size:64,setter:function(e,t){return function(n){e.uniformMatrix4x3fv(t,!1,n)}},rows:4,cols:3},dr[35678]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:3553},dr[35680]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:ur},dr[35679]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:32879},dr[35682]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:3553},dr[36289]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:lr},dr[36292]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:lr},dr[36293]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:ur},dr[36298]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:3553},dr[36299]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:32879},dr[36300]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:ur},dr[36303]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:lr},dr[36306]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:3553},dr[36307]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:32879},dr[36308]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:ur},dr[36311]={Type:null,size:0,setter:yr,arraySetter:vr,bindPoint:lr};const xr={};xr[5126]={size:4,setter:wr},xr[35664]={size:8,setter:wr},xr[35665]={size:12,setter:wr},xr[35666]={size:16,setter:wr},xr[5124]={size:4,setter:Sr},xr[35667]={size:8,setter:Sr},xr[35668]={size:12,setter:Sr},xr[35669]={size:16,setter:Sr},xr[5125]={size:4,setter:Er},xr[36294]={size:8,setter:Er},xr[36295]={size:12,setter:Er},xr[36296]={size:16,setter:Er},xr[35670]={size:4,setter:Sr},xr[35671]={size:8,setter:Sr},xr[35672]={size:12,setter:Sr},xr[35673]={size:16,setter:Sr},xr[35674]={size:4,setter:Tr,count:2},xr[35675]={size:9,setter:Tr,count:3},xr[35676]={size:16,setter:Tr,count:4};const _r=/ERROR:\s*\d+:(\d+)/gi;const Cr=/^[ \t]*\n/;function Ir(e){let t=0;return Cr.test(e)&&(t=1,e=e.replace(Cr,"")),{lineOffset:t,shaderSource:e}}function Rr(e,t,n,r){if(r=r||or,!e.getShaderParameter(n,35713)){const i=e.getShaderInfoLog(n),{lineOffset:o,shaderSource:s}=Ir(e.getShaderSource(n)),a=`${function(e,t="",n=0){const r=[...t.matchAll(_r)],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 ${ln(e,t)}: ${i}`;return r(a),a}return""}function kr(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||or,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 Or=["VERTEX_SHADER","FRAGMENT_SHADER"];function Zr(e,t){return t.indexOf("frag")>=0?35632:t.indexOf("vert")>=0?35633:void 0}const Ar=(t=0)=>new e(e=>setTimeout(e,t));function Vr(e,t,n,r,i){const o=kr(n,r,i),s=new Set(t),a=function(e,t,n){const r=e.createProgram(),{attribLocations:i,transformFeedbackVaryings:o,transformFeedbackMode:s}=kr(n);for(let n=0;n<t.length;++n){let i=t[n];if("string"==typeof i){const t=sr(i),o=t?t.text:i;let s=e[Or[n]];t&&t.type&&(s=Zr(0,t.type)||s),i=e.createShader(s),e.shaderSource(i,Ir(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||or,!e.getProgramParameter(t,35714)){const r=e.getProgramInfoLog(t);n("Error in program linking: "+r);const i=e.getAttachedShaders(t).map(t=>Rr(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 Ar(i),i=1e3/60}while(!r(e,t))})(e,a).then(()=>{const t=c(e,a);o.callback(t,t?void 0:a)})}function Gr(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const Nr=/(\.|\[|]|\w+)/g,Lr=e=>e>="0"&&e<="9";function Wr(e,t,n,r){const i=e.split(Nr).filter(e=>""!==e);let o=0,s="";for(;;){const e=i[o++];s+=e;const a=Lr(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){Xr(e,t)}}(a),s+=e}}}function Xr(e,t){for(const n in t){const r=e[n];"function"==typeof r?r(t[n]):Xr(e[n],t[n])}}function Mr(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=dr[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(Gr(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,Wr(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(Gr(r))continue;const o=e.getAttribLocation(t,r.name),s=xr[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 un(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 Fr=/\s|{|}|;/;function Pr(e,t,n,r,i){const o=kr(n,r,i),s=[];if(t=t.map((function(e){if(!Fr.test(e)){const t=sr(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:Mr(e,n))});const c=function(e,t,n,r,i){return Vr(e,t,n,r,i)}(e,t,o);return c?Mr(e,c):null}const jr=36161,Ur=36096,Dr=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],Hr={};Hr[34041]=33306,Hr[6401]=36128,Hr[36168]=36128,Hr[6402]=Ur,Hr[33189]=Ur,Hr[33190]=Ur,Hr[36012]=Ur,Hr[35056]=33306,Hr[36013]=33306;const Yr={};Yr[32854]=!0,Yr[32855]=!0,Yr[36194]=!0,Yr[34041]=!0,Yr[33189]=!0,Yr[6401]=!0,Yr[36168]=!0;function Br(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||Dr).forEach((function(t,o){let c=t.attachment;const u=t.samples,l=t.format;let d=t.attachmentPoint||function(e,t){return Hr[e]||Hr[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 Yr[e]}(l))c=e.createRenderbuffer(),e.bindRenderbuffer(jr,c),u>1?e.renderbufferStorageMultisample(jr,u,l,n,r):e.renderbufferStorage(jr,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=ir(e,i)}if(function(e,t){return typeof WebGLRenderbuffer<"u"&&Dt(t,"WebGLRenderbuffer")}(0,c))e.framebufferRenderbuffer(i,d,jr,c);else{if(!Ht(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 Jr(e,t){return()=>t instanceof WebGLTexture?t:ir(e,{src:t,wrap:e.CLAMP_TO_EDGE})}class Kr{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=Pr(this.context,[i+this.getVertexShader(),i+this.getFragmentShader()]),this.bufferInfo=cn(this.context,this.getBuffers()),this.fbi=Br(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=Br(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 zr extends Kr{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 Qr{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 qr extends Qr{constructor(){super(...arguments),o(this,"preciseMaskEnabled",!1)}}class $r extends qr{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 zr({...t,disableFramebuffer:!0});this.addStep({program:n,getUniforms:()=>({background:Jr(e,this.inputBackgroundImage),foreground:Jr(e,this.inputImage),threshold:Jr(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class ei extends Kr{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 ti extends Qr{constructor(e,t,n){super(),o(this,"inputImage"),this.context=e;const r={context:e,height:n,width:t};this.addStep({program:new ei({...r,disableFramebuffer:!0}),getUniforms:()=>({texture:Jr(e,this.inputImage),invert_y:!0})})}setData(e){this.inputImage=e}}async function ni(t){return new e(e=>{setTimeout(()=>{e()},t)})}var ri=(e=>(e[e.LINEAR=0]="LINEAR",e[e.GAUSSIAN=1]="GAUSSIAN",e))(ri||{});class ii extends Kr{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 oi extends Kr{constructor(e){super(e),o(this,"fbi2"),this.fbi2=Br(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=Br(this.context,[{format:this.context.RGBA,type:this.context.UNSIGNED_BYTE,min:this.context.LINEAR,wrap:this.context.CLAMP_TO_EDGE}],e,t)}}class si extends oi{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 ai extends Kr{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 ci extends Kr{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 ui extends oi{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 li extends oi{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 di extends Qr{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}),o(this,"jointBilateral"),this.context=e;const r={context:e,height:n,width:t},i=new si(r),s=new ii({...r,radius:1,type:ri.GAUSSIAN}),a=new li(r),c=new ui(r),u=new ci(r);this.jointBilateral=new ai(r),this.addStep({program:i,getUniforms:()=>({image_now:Jr(e,this.inputImage),image_before:Jr(e,this.previousInputImage),mask_now:Jr(e,this.inputMask),mask_before:Jr(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:Jr(e,this.inputMask),threshold:Jr(e,i.output)})}),this.addStep({program:u,getUniforms:()=>({texture:Jr(e,a.output)})}),this.addStep({program:c,getUniforms:()=>({texture:Jr(e,u.output)})}),this.addStep({program:s,getUniforms:()=>({texture:Jr(e,c.output)})}),this.addStep({program:this.jointBilateral,getUniforms:()=>{var t,n,r,i,o,a,c,u;const l=null!=(n=null==(t=this.inputImage)?void 0:t.width)?n:1,d=null!=(i=null==(r=this.inputImage)?void 0:r.height)?i:1,h=null!=(a=null==(o=this.inputMask)?void 0:o.width)?a:1,p=null!=(u=null==(c=this.inputMask)?void 0:c.height)?u:1,f=Math.max(l/h,d/p),m=Math.max(1,.66*Math.sqrt(f)),g=1/l,b=1/d;return{input_frame:Jr(e,this.inputImage),segmentation_mask:Jr(e,this.inputMask),threshold:Jr(e,s.output),texel_size:[g,b],step:m,radius:f,offset:m>1?.5*m:0,sigma_texel:Math.max(g,b)*f,sigma_color:.1}}}),this.output=this.jointBilateral.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}resizeOutput(e,t){super.resizeOutput(e,t),this.output=this.jointBilateral.output}}var hi=(e=>(e.PUSH="PUSH",e.POP="POP",e))(hi||{});class pi{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 ni(200)}}}class fi{constructor(){o(this,"canvas"),o(this,"context"),o(this,"pipeline"),o(this,"previousImageWidth",0),o(this,"previousImageHeight",0),o(this,"previousMaskWidth",2),o(this,"previousMaskHeight",2),o(this,"profiler"),o(this,"postProcessingEnabled",!0),o(this,"improveMask");const e=new OffscreenCanvas(0,0),t=e.getContext("webgl2");if(!t)throw"Fail to retrieve webgl2 context";this.canvas=e,this.context=t,this.improveMask=new di(this.context,2,2)}setFlickeringOptions(e){this.improveMask.setOptions(e)}enablePostProcessing(){this.postProcessingEnabled=!0}disablePostProcessing(){this.postProcessingEnabled=!1}async profileWebgl(e){const t=new pi(this.context);return this.profiler=t,t.start(),await ni(e),this.profiler=void 0,t.stop(),t.getResolvedQueries()}async render(e,t){var n,r;if(!this.pipeline)throw"missing pipeline";(this.previousImageHeight!==e.height||this.previousImageWidth!==e.width)&&this.resizeOutput(e.width,e.height),(this.previousMaskHeight!==t.height||this.previousMaskWidth!==t.width)&&(this.improveMask.resizeOutput(t.width,t.height),this.previousMaskWidth=t.width,this.previousMaskHeight=t.height);const i="renderer";null==(n=this.profiler)||n.pushContext(i),this.improveMask.setProfiler(this.profiler),this.pipeline.setProfiler(this.profiler);let o=t;return this.postProcessingEnabled&&(this.improveMask.setData(e,t),this.improveMask.run(),o=this.improveMask.output),this.pipeline.setData(e,o),await this.pipeline.run(),null==(r=this.profiler)||r.popContext(i),this.canvas}resizeOutput(e,t){var n;this.canvas.width=e,this.canvas.height=t,null==(n=this.pipeline)||n.resizeOutput(e,t),this.previousImageWidth=e,this.previousImageHeight=t}}class mi extends fi{constructor(){super(),o(this,"pipeline"),o(this,"backgroundImage"),o(this,"backgroundImageResizerCanvas"),o(this,"backgroundImageResizerContext"),o(this,"backgroundImageResizer"),this.pipeline=new $r(this.context);const e=new OffscreenCanvas(0,0),t=e.getContext("webgl2");if(!t)throw"Fail to retrieve webgl context";this.backgroundImageResizerCanvas=e,this.backgroundImageResizerContext=t,this.backgroundImageResizer=new ti(this.backgroundImageResizerContext,0,0)}setBackgroundImage(e){this.backgroundImage=e,this.updateBackgroundImage()}updateBackgroundImage(){const{width:e,height:t}=this.canvas;this.backgroundImageResizer.resizeOutput(e,t),this.backgroundImageResizer.setData(this.backgroundImage),this.backgroundImageResizer.run(),this.pipeline.inputBackgroundImage=this.backgroundImageResizerCanvas}resizeOutput(e,t){super.resizeOutput(e,t),this.backgroundImageResizerCanvas.width=e,this.backgroundImageResizerCanvas.height=t,this.backgroundImageResizer.resizeOutput(e,t),this.updateBackgroundImage()}}class gi extends mi{constructor(){super(...arguments),o(this,"frameReader")}setBackgroundVideo(e){this.frameReader=e.getReader(),this.readNextVideoFrame()}async render(e,t){return await this.readNextVideoFrame(),super.render(e,t)}async readNextVideoFrame(){var e;const t=await(null==(e=this.frameReader)?void 0:e.read());if(null!=t&&t.value){const e=await createImageBitmap(t.value);this.setBackgroundImage(e),t.value.close()}}}class bi{blurBackground(e){return new Gt(e)}blurSilhouette(e){return new Nt(e)}imageBackground(){return new Lt}videoBackground(){return new gi}}class yi extends Kr{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 vi extends qr{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 yi({...n,radius:t,...this.getBlurTextureSize(e.canvas.width,e.canvas.height)});const r=new zr({...n,disableFramebuffer:!0});this.addStep({program:this.blur,preventResize:!0,getUniforms:()=>({texture:Jr(e,this.inputImage),mask:Jr(e,this.inputMask)})}),this.addStep({program:r,getUniforms:()=>({background:Jr(e,this.blur.output),foreground:Jr(e,this.inputImage),threshold:Jr(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 wi extends fi{constructor(e){super(),o(this,"pipeline"),this.pipeline=new vi(this.context,e),this.disablePostProcessing()}}class Si extends qr{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 ii({...n,radius:t,type:ri.GAUSSIAN}),i=new zr({...n,disableFramebuffer:!0});this.addStep({program:r,getUniforms:()=>({texture:Jr(e,this.inputImage)})}),this.addStep({program:i,getUniforms:()=>({background:Jr(e,this.inputImage),foreground:Jr(e,r.output),threshold:Jr(e,this.inputMask)})})}setData(e,t){this.inputImage=e,this.inputMask=t}}class Ei extends fi{constructor(e){super(),o(this,"pipeline"),this.pipeline=new Si(this.context,e),this.disablePostProcessing()}}class Ti extends $r{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())}}class xi extends fi{constructor(){super(),o(this,"pipeline"),this.pipeline=new Ti(this.context)}setBackgroundVideo(e){this.pipeline.inputVideo=e}}class _i{blurBackground(e){return new wi(e)}blurSilhouette(e){return new Ei(e)}imageBackground(){return new mi}videoBackground(){return new xi}}class Ci{constructor(e){switch(o(this,"factory"),e){case he.CANVAS:this.factory=new bi;break;case he.WEBGL:this.factory=new _i;break;default:const e=we();this.factory=e.supported?new _i:new bi}}blurBackground(e){return this.getFactory().blurBackground(e)}blurSilhouette(e){return this.getFactory().blurSilhouette(e)}imageBackground(){return this.getFactory().imageBackground()}videoBackground(){return this.getFactory().videoBackground()}getFactory(){if(!this.factory)throw"Factory is not initialized";return this.factory}}class Ii{constructor(){o(this,"renderer")}setBackgroundOptions(e){var t,n;const r=new Ci(null==(t=e.renderingOptions)?void 0:t.type);switch(e.transformerType){case"BackgroundBlur":this.renderer=r.blurBackground(this.getBlurSize(e.radius));break;case"SilhouetteBlur":this.renderer=r.blurSilhouette(this.getBlurSize(e.radius));break;case"VideoBackground":this.renderer=r.videoBackground();break;case"VirtualBackground":this.renderer=r.imageBackground();break;default:throw`Unknown rendering type [${e.transformerType}]`}(null==(n=e.renderingOptions)?void 0:n.type)===he.WEBGL&&(e.renderingOptions.selfieSegmentationType===de.PRECISE?this.renderer.enablePostProcessing():e.renderingOptions.selfieSegmentationType===de.FAST&&this.renderer.disablePostProcessing())}setFlickeringOptions(e){var t;null==(t=this.renderer)||t.setFlickeringOptions(e)}setVideoBGReadable(e){const t=this.renderer;t.setBackgroundVideo&&t.setBackgroundVideo(e)}async setVirtualBGImage(e){const t=this.renderer;t.setBackgroundImage&&t.setBackgroundImage(e)}async process(e,t){if(this.renderer)return this.renderer.render(e,t)}async resizeForeground(e,t){}getBlurSize(e=ue.Low){switch(e){case ue.Low:return 5;case ue.High:return 12}return e}async profile(e){var t,n;return null!=(n=null==(t=this.renderer)?void 0:t.profileWebgl(e))?n:[]}}class Ri{constructor(){o(this,"selfieSegmentation",new be),o(this,"backgroundFilter"),o(this,"reporter",new At),o(this,"backgroundOptions")}async init(e,t){await this.selfieSegmentation.init(t.wasmAssetUriPath,t.tfliteAssetUriPath),this.backgroundFilter=new Ii,this.report({variation:"Create"})}async transform(e,t){var n,r;let i;const o=null!=(n=e.timestamp)?n:0,s=await createImageBitmap(e),a=await this.selfieSegmentation.process(s);a&&(i=await(null==(r=this.backgroundFilter)?void 0:r.process(s,a))),i?(e.close(),t.enqueue(new VideoFrame(i,{timestamp:o,alpha:"discard"}))):t.enqueue(e)}async setBackgroundOptions(e){var t;this.backgroundOptions=e,await(null==(t=this.backgroundFilter)?void 0:t.setBackgroundOptions(e)),this.report({variation:"Update"})}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),this.report({variation:"Update"})}async profile(e){var t,n;return null!=(n=null==(t=this.backgroundFilter)?void 0:t.profile(e))?n:[]}getTransformerType(){var e,t;return null!=(t=null==(e=this.backgroundOptions)?void 0:e.transformerType)?t:"Undefined"}report(e){var t;this.reporter.send({version:"5.0.1",action:"MlTransformers",transformerType:null==(t=this.backgroundOptions)?void 0:t.transformerType,config:JSON.stringify(this.backgroundOptions),...e})}}const ki=class{constructor(){o(this,"backgroundTransformer",new Ri),o(this,"mediaProcessor",new se),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){K(e)}(e)}async profile(e){return JSON.stringify(await this.backgroundTransformer.profile(e))}};let Oi=ki;!function(e,t){t.workerId=e,nt()&&(at[t.workerId]=t)}("ProcessorWorker",ki);const Zi="dmFyIF9sPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgYmw9KEosUSxIKT0+USBpbiBKP19sKEosUSx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6SH0pOkpbUV09SDt2YXIgbD0oSixRLEgpPT4oYmwoSix0eXBlb2YgUSE9InN5bWJvbCI/USsiIjpRLEgpLEgpOyhmdW5jdGlvbigpeyJ1c2Ugc3RyaWN0IjtmdW5jdGlvbiBKKHIsdCl7Z2xvYmFsVGhpcy52b25hZ2V8fChnbG9iYWxUaGlzLnZvbmFnZT17fSksZ2xvYmFsVGhpcy52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OSxYaT0zMjgyMCxRaT0zMzYzNSxLaT01MTMxLHFpPTMzNjQwLEppPTM1ODk5LFppPTM1OTAyLGVzPTM2MjY5LHRzPTM0MDQyLGpyPXt9O3tjb25zdCByPWpyO3JbVnRdPUludDhBcnJheSxyW0JlXT1VaW50OEFycmF5LHJbSHRdPUludDE2QXJyYXkscltqdF09VWludDE2QXJyYXkscltZdF09SW50MzJBcnJheSxyW1h0XT1VaW50MzJBcnJheSxyW1F0XT1GbG9hdDMyQXJyYXkscltZaV09VWludDE2QXJyYXkscltYaV09VWludDE2QXJyYXkscltRaV09VWludDE2QXJyYXkscltLaV09VWludDE2QXJyYXkscltxaV09VWludDMyQXJyYXkscltKaV09VWludDMyQXJyYXkscltaaV09VWludDMyQXJyYXkscltlc109VWludDMyQXJyYXksclt0c109VWludDMyQXJyYXl9ZnVuY3Rpb24gS3Qocil7aWYociBpbnN0YW5jZW9mIEludDhBcnJheSlyZXR1cm4gVnQ7aWYociBpbnN0YW5jZW9mIFVpbnQ4QXJyYXl8fHIgaW5zdGFuY2VvZiBVaW50OENsYW1wZWRBcnJheSlyZXR1cm4gQmU7aWYociBpbnN0YW5jZW9mIEludDE2QXJyYXkpcmV0dXJuIEh0O2lmKHIgaW5zdGFuY2VvZiBVaW50MTZBcnJheSlyZXR1cm4ganQ7aWYociBpbnN0YW5jZW9mIEludDMyQXJyYXkpcmV0dXJuIFl0O2lmKHIgaW5zdGFuY2VvZiBVaW50MzJBcnJheSlyZXR1cm4gWHQ7aWYociBpbnN0YW5jZW9mIEZsb2F0MzJBcnJheSlyZXR1cm4gUXQ7dGhyb3cgbmV3IEVycm9yKCJ1bnN1cHBvcnRlZCB0eXBlZCBhcnJheSB0eXBlIil9ZnVuY3Rpb24gWXIocil7aWYocj09PUludDhBcnJheSlyZXR1cm4gVnQ7aWYocj09PVVpbnQ4QXJyYXl8fHI9PT1VaW50OENsYW1wZWRBcnJheSlyZXR1cm4gQmU7aWYocj09PUludDE2QXJyYXkpcmV0dXJ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IHZlYzQoMCwwLDAsMCk7CiAgICAgICAgICAgIGZsb2F0IGZhY3RvclN1bSA9IDAuOwoKICAgICAgICAgICAgdmVjMiBub3JtYWxpemVkUmFkaXVzID0gdmVjMigtJHt0fS4pIC8gY2FudmFzOwogICAgICAgICAgICB2ZWMyIG5vcm1hbGl6ZWRJbmNyZW1lbnQgPSB2ZWMyKDEuKSAvIGNhbnZhczsKICAgICAgICAgICAgdmVjMiBkaWZmID0gbm9ybWFsaXplZFJhZGl1czsKICAgICAgICAgICAgZmxvYXQgbWF4TGVuZ3RoID0gbGVuZ3RoKG5vcm1hbGl6ZWRSYWRpdXMpOwoKICAgICAgICAgICAgZm9yKGludCB5PS0ke3R9OyB5PCR7dCsxfTsgKyt5KSB7CiAgICAgICAgICAgICAgICBmb3IoaW50IHg9LSR7dH07IHg8JHt0KzF9OyArK3gpIHsKICAgICAgICAgICAgICAgICAgICBmbG9hdCBmYWN0b3IgPSAoMS4tIHRleHR1cmUyRChtYXNrLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpLmEpICogKG1heExlbmd0aCAtIGxlbmd0aChkaWZmKSkgLyBtYXhMZW5ndGg7CiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZhY3RvciAqIHRleHR1cmUyRCh0ZXh0dXJlLCBfdGV4dHVyZV9jb29yZCArIGRpZmYpOwogICAgICAgICAgICAgICAgICAgIGZhY3RvclN1bSArPSBmYWN0b3I7CiAgICAgICAgICAgICAgICAgICAgZGlmZi54ICs9IG5vcm1hbGl6ZWRJbmNyZW1lbnQueDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGRpZmYueSArPSBub3JtYWxpemVkSW5jcmVtZW50Lnk7CiAgICAgICAgICAgICAgICBkaWZmLnggPSBub3JtYWxpemVkUmFkaXVzLng7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCAvIGZhY3RvclN1bTsKICAgICAgICB9YH19Y29uc3QgQWY9MTAsd2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pYVByb2Nlc3Nvcj10fSl9YXN5bmMgc2V0VHJhY2tFeHBlY3RlZFJhdGUodCl7dGhpcy5yYXRlPXQsdGhpcy5tZWRpYVByb2Nlc3Nvci5zZXRUcmFja0V4cGVjdGVkUmF0ZSh0KX1hc3luYyB0cmFuc2Zvcm0odCxlKXt0aGlzLm1lZGlhUHJvY2Vzc29yLnRyYW5zZm9ybSh0LGUpfWFzeW5jIHNldEJhY2tncm91bmRPcHRpb25zKHQpe3ZhciBlO2F3YWl0KChlPXRoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyKT09bnVsbD92b2lkIDA6ZS5zZXRCYWNrZ3JvdW5kT3B0aW9ucyh0KSl9c2V0VmlkZW9CR1JlYWRhYmxlKHQpe3RoaXMuYmFja2dyb3VuZFRyYW5zZm9ybWVyLnNldFZpZGVvQkdSZWFkYWJsZSh0KX1hc3luYyBzZXRWaXJ0dWFsQkdJbWFnZSh0KXthd2FpdCB0aGlzLmJhY2tncm91bmRUcmFuc2Zvcm1lci5zZXRWaXJ0dWFsQkdJbWFnZSh0KX1hc3luYyB0ZXJtaW5hdGUoKXthd2FpdCB0aGlzLm1lZGlhUHJvY2Vzc29yLmRlc3Ryb3koKX1zZXRGbGlja2VyaW5nT3B0aW9ucyh0KXt0aGlzLmJhY2tncm91bmRUcmFuc2Zvcm1lci5zZXRGbGlja2VyaW5nT3B0aW9ucyh0KX1zZXRWb25hZ2VNZXRhZGF0YSh0KXtpaSh0KX1hc3luYyBwcm9maWxlKHQpe3JldHVybiBKU09OLnN0cmluZ2lmeShhd2FpdCB0aGlzLmJhY2tncm91bmRUcmFuc2Zvcm1lci5wcm9maWxlKHQpKX19O2xldCBobz1TcjsoKCk9Pnt3bygiUHJvY2Vzc29yV29ya2VyIixTcil9KSgpfSkoKTsK",Ai=typeof window<"u"&&window.Blob&&new Blob([atob(Zi)],{type:"text/javascript;charset=utf-8"});function Vi(){const e=Ai&&(window.URL||window.webkitURL).createObjectURL(Ai);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+Zi)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const Gi=class extends Be{constructor(){super(...arguments),o(this,"rate",30),o(this,"worker")}async init(e){this.worker=await st(Oi,Vi),await this.worker.init("worker_"+Gi.initCount++,e),await this.worker.setVonageMetadata(Q()),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;await(null==(t=this.worker)?void 0:t.setBackgroundOptions(e));const{transformerType:i}=e;switch(i){case"VideoBackground":await(null==(n=this.worker)?void 0:n.setVideoBGReadable(await ct.createVideoReadable(e.backgroundAssetUri)));break;case"VirtualBackground":await(null==(r=this.worker)?void 0:r.setVirtualBGImage(await ct.createImageCanvas(e.backgroundAssetUri)))}}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.workerContext.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 Ni=Gi;o(Ni,"initCount",0);class Li{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==hi.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 Wi extends Be{constructor(){super(),o(this,"worker",new Ni),o(this,"connector",new ce(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 Li(n)}static async create(e){const t=new this;return await t.init(e),this.instances.push(t),t}}function Xi(){return Se}function Mi(){return Ee}function Fi(){return Te}function Pi(){return xe}function ji(){return _e}function Ui(){return Ce}function Di(){return Ie}async function Hi(e){return await Wi.create(e)}o(Wi,"instances",[])}.call(this,n(0),n(42))},function(e,t,n){"use strict";const r=n(34)().onlyLocal(),i=n(100).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(16),i=n(11),o=n(723),s=n(724),a=n(725);e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(7),c=e.ExceptionCodes||n(10),u=e.logging||n(1)("publisherInit"),l=e.otError||n(13)(),d=e.OTHelpers||n(8),h=e.Publisher||n(168)(),p=e.sessionObjects||n(21);return function(e,n,f){let m;u.debug(`OT.initPublisher(${e})`),"string"!=typeof e||document.getElementById(e)||(e=n,n=f,f=arguments[3]),"function"==typeof e?(f=e,n=void 0,e=void 0):i(e)&&!d.isElementNode(e)&&(f=n,n=e,e=void 0),"function"==typeof n&&(f=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||{});p.publishers.add(g);const b=function(){f&&r(f)&&(f(...arguments),f=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(2),i=r(n(4)),o=r(n(5));const s=n(18),a=n(726),c=n(11),u=n(16),l=n(9),d=n(26),h=n(6),p=n(20),f=n(34)(),m=n(73),g=n(313),b=n(728),y=n(729),v=n(730),w=n(100).prependProxyToUrlIfNeeded,S=n(101).getProxyUrl,E=n(732);e.exports=function(e){void 0===e&&(e={});const r=e.adaptIceServers||n(102).adaptIceServers,T=e.AnalyticsHelper||p,x=e.APIKEY||n(70),_=e.Capabilities||n(169),C=e.convertAnvilErrorCode||n(733),I=e.convertRumorError||n(320),R=e.Errors||n(7),k=e.Events||n(23)(),O=e.Stream||n(170),Z=e.ExceptionCodes||n(10),A=e.hasIceRestartsCapability||n(321),V=e.hasE2eeCapability||n(110),G=e.logging||n(1)("Session"),N=e.otError||n(13)(),L=e.OTErrorClass||n(22),W=e.OTHelpers||n(8),X=n(734),M=e.StaticConfig||f,F=e.staticConfig||M.onlyLocal(),P=e.Publisher||n(168)(),j=e.RaptorSocket||n(735).default(),U=e.SessionDispatcher||n(329),D=e.sessionObjects||n(21),H=e.sessionTag||n(328),Y=e.socketCloseCodes||n(76),B=e.Subscriber||n(305)(),J=e.systemRequirements||n(153),K=e.uuid||n(15),z=y({otError:N}),Q=e.global||(void 0!==typeof window?window:global),q=e.getSessionInfo||n(759)(),$=n(142),ee=e.KeyStore||n(762),te=e.SFrameClientStore||n(764),ne=e.SinglePeerConnectionController||n(766),re=e.initPublisher||n(318)({Publisher:P});return function(e,n,p){var f=this;let y=void 0===p?{}:p,ie=y.iceConfig,oe=y.connectionEventsSuppressed,se=y.ipWhitelist,ae=void 0!==se&&se,ce=y.encryptionSecret,ue=y._enableSinglePeerConnection;const le=S(),de=new T,he=e=>"string"==typeof e?this.streams.get(e)||{id:e}:e;let pe,fe,me,ge,be,ye,ve,we;h(this),this._tag=H,J.check()||J.upgrade(),null==n&&(n=e,e=null),z(ie),this.id=n,this.sessionId=n,this.keyStore=new ee,this.sFrameClientStore=new te;let Se=!1,Ee=e;const Te=this;let xe=n,_e=K(),Ce=G,Ie=!1;const Re=[];let ke,Oe,Ze,Ae,Ve=null,Ge=!1,Ne=!1;const Le=W.statable(this,["disconnected","connecting","connected","disconnecting"],"disconnected");let We;this.connection=null,this.connections=new W.Collection,this.streams=new W.Collection,this.archives=new W.Collection;const Xe=function(e){Le("disconnected"),e.code||(e.code=Z.CONNECT_FAILED),Ce.error(`${e.name||"Unknown Error"}: ${e.message}`),L.handleJsException({error:e,target:this,analytics:de}),this.trigger("sessionConnectFailed",e)},Me=function(e){Se=!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(),Oe(),ke.call(this,t),setTimeout(()=>{this.dispatchEvent(n),Ze.call(this,n.reason),n.isDefaultPrevented()||Ae.call(this,n.reason)})},Fe=function(e){oe||e.id.match(/^symphony\./)||this.dispatchEvent(new k.ConnectionEvent(d.CONNECTION_CREATED,e))},Pe=function(e,t){e.id.match(/^symphony\./)||pe&&e.id===pe.id()||this.dispatchEvent(new k.ConnectionEvent(d.CONNECTION_DESTROYED,e,t))},je=function(e){!e||!e.connection||this.connection&&e.connection.id===this.connection.id||this.dispatchEvent(new k.StreamEvent(d.STREAM_CREATED,e,null,!1))},Ue=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(d.STREAM_PROPERTY_CHANGED,t,n,e.oldValue,r)))},De=function(e,t){void 0===t&&(t="clientDisconnected");const n=new k.StreamEvent("streamDestroyed",e,t,!0);e.connection.id===this.connection.id?D.publishers.where({streamId:e.id}).forEach((function(n){n._.unpublishStreamFromSession(e,this,t)}),this):this.dispatchEvent(n),(()=>{D.subscribers.where({streamId:e.id}).filter(e=>e.session.id===this.id&&e.stream).forEach(e=>{e._disconnect({reason:t}),n.isDefaultPrevented()||e._destroy({reason:t,noStateTransition:!0})})})()},He=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveStarted",e))},Ye=function(e){this.dispatchEvent(new k.ArchiveEvent("archiveDestroyed",e))},Be=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))},Je=()=>D.subscribers.forEach(e=>e._.pauseAndPlayVideoElement()),Ke=function(){Te.token=null,me=null,Le("disconnected"),pe=null,fe&&(fe.stop(),fe=null),Te.connection=null,Te.capabilities=new _([],{hasE2eeCapability:V}),Te.connections.destroy(),Te.streams.destroy(),Te.archives.destroy()};Oe=function(){_e=K(),Ke()},ke=function(e){D.publishers.where({session:this}).forEach(t=>{t.disconnect(e)}),D.subscribers.where({session:this}).forEach(e=>{e._disconnect()})},Ze=function(e){D.publishers.where({session:this}).forEach(t=>{t._.streamDestroyed(e)})},Ae=function(e){D.subscribers.where({session:this}).forEach(t=>{t._destroy({reason:e})})};const ze=function(){Ce.debug("OT.Session: connecting to Raptor");const e=w(this.sessionInfo.messagingURL,le),t=["forceMute"];this.sessionInfo.isAdaptiveEnabled&&t.push("amr"),Ne&&t.push("spc"),pe=new j({connectionId:_e,sessionId:n,messagingSocketUrl:e,symphonyUrl:this.sessionInfo.symphonyAddress,dispatcher:U(this,{connectionEventsSuppressed:oe}),analytics:de,requestedCapabilities:t}),pe.connect(me,this.sessionInfo,{connectionEventsSuppressed:oe},(e,t)=>{if(e){const t={};let n;if("ConnectToSession"===e.reason||"GetSessionState"===e.reason){const n=I(e);l(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=a(Y.codes,e=>e===t),n)return R["SOCKET_"+n];break;case"ConnectToSession":case"GetSessionState":switch(t){case Z.CONNECT_FAILED:return R.CONNECT_FAILED;case Z.UNEXPECTED_SERVER_RESPONSE:return R.UNEXPECTED_SERVER_RESPONSE;case Z.CONNECTION_LIMIT_EXCEEDED:return R.CONNECTION_LIMIT_EXCEEDED}}}(e.reason,e.code);return r&&(e=N(r,new Error(e.message),e.code)),void Xe.call(this,e)}Ce.debug("OT.Session: Received session state from Raptor",t),this.connection=this.connections.get(pe.id()),this.connection&&(this.capabilities=this.connection.permissions),Le("connected"),this.logConnectivityEvent("Success",{connectionId:this.connection.id}),this.connection.on("destroyed",Me,this),this.dispatchEvent(new k.SessionConnectEvent(d.SESSION_CONNECTED)),this.connections.on({add:Fe,remove:Pe},this),this.streams.on({add:je,remove:De,update:Ue},this),this.archives.on({add:He,remove:Ye,update:Be},this),this.connections._triggerAddEvents(),this.streams._triggerAddEvents(),this.archives._triggerAddEvents();W.env.isiOS&&W.env.iOSVersion>=13.3&&this.on("gsmCallEnded",Je)})},Qe=e=>this.capabilities.permittedTo(e),qe=(e,t)=>{G.error(`${e.name}: ${e.message}`),"function"==typeof t&&t(e),L.handleJsException({error:e,target:this,analytics:de})},$e=e=>{const t=N(e.code,new Error(e.message),e.exceptionCode);return qe(t),t},et=()=>this.isNot("connected")?$e(X.NOT_CONNECTED):Qe("forceMute")?null:$e(X.PERMISSION_DENIED),tt=e=>"404"===e.code?$e(X.NOT_FOUND):"403"===e.code?$e(X.PERMISSION_DENIED):$e(X.UNEXPECTED_SERVER_RESPONSE);this.reportIssue=e=>{let t=e.id;return g(de.logEvent.bind(de))({action:"ReportIssue",variation:"Event",connectionId:_e,payload:{reportIssueId:t}},null)},this.logEvent=function(e,t,n,r){let i={action:e,variation:t,payload:n,sessionId:xe,messagingServer:be,p2p:ge,partnerId:Ee,connectionId:_e};r&&(i=l(r,i)),de.logEvent(i)},this.logConfigurationFileEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),"Attempt"===e)ve=(new Date).getTime();else if("Failure"===e||"Success"===e){const e=(new Date).getTime()-ve;l(n,{attemptDuration:e})}le&&(n.proxyUrl=le),this.logEvent("ConfigurationFile",e,t,Object.assign({},n))},this.logConnectivityEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),le&&(n.proxyUrl=le),"Attempt"===e&&(fe&&(fe.stop(),G.error("_connectivityAttemptPinger should have been cleaned up")),ye=(new Date).getTime(),fe=new m(()=>{this.logEvent("Connect","Attempting",t,Object.assign({},n))},.2,6),fe.start()),"Failure"===e||"Success"===e||"Cancel"===e){const r=r=>{fe&&(fe.stop(),fe=void 0),this.logEvent("Connect",e,t,Object.assign({},n,{attemptDuration:(new Date).getTime()-ye,iceConfig:r,ipWhitelist:ae}))};"Success"===e?this._.getIceConfig().then(e=>{const t={includeServers:ie&&ie.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&&(Ee=o[0].toString()),r=o[1]):r=o[0];const a=o[o.length-1];if(f.is("connecting","connected"))return Ce.warn("OT.Session: Cannot connect, the session is already "+f.currentState),f;de.sessionInfo=new $,Ke(),Le("connecting");const l=_e;function d(){const e=_e!==l;return e&&G.debug("Connection was interrupted"),e}if(f.token=!u(r)&&r,me=!u(r)&&r,a&&u(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=()=>{f.off("sessionConnected",t),f.off("sessionConnectFailed",n)},f.once("sessionConnected",t),f.once("sessionConnectFailed",n)}if(null==Ee||u(Ee))return setTimeout(Xe.bind(f,N(R.AUTHENTICATION_ERROR,new Error("API Key is undefined. You must pass an API Key to initSession."),Z.AUTHENTICATION_ERROR))),f;if(!xe||c(xe)||Array.isArray(xe)){let e;return xe?(e="SessionID is not a string. You must use string as the session ID passed into OT.initSession().",xe=xe.toString()):e="SessionID is undefined. You must pass a sessionID to initSession.",setTimeout(Xe.bind(f,N(R.INVALID_SESSION_ID,new Error(e),Z.INVALID_SESSION_ID))),f.logConnectivityEvent("Attempt"),f.logConnectivityEvent("Failure",null,{failureReason:"ConnectToSession",failureCode:Z.INVALID_SESSION_ID,failureMessage:e}),f}if(f.apiKey=Ee.toString(),Ee=Ee.toString(),ce){if(!V())return setTimeout(Xe.bind(f,N(R.UNSUPPORTED_BROWSER,new Error("E2E Encryption is not supported in your browser.")))),f;try{E(ce),f.keyStore.set(n,ce),Ge=!0}catch(e){return setTimeout(Xe.bind(f,N(R.INVALID_ENCRYPTION_SECRET,new Error("Invalid encryptionSecret: "+e.message)))),f}}0===x.value.length&&(x.value=Ee);const h=Boolean(M.onlyLocal().configUrl),p=!0===ae&&Boolean(M.onlyLocal().ipWhitelistConfigUrl);h||p?f.logConfigurationFileEvent("Attempt"):f.logConfigurationFileEvent("Event",{message:"No configUrl, using local config only"});const m=h||p?M.get({partnerId:Ee,token:r,useIpWhitelistConfigUrl:p,proxyUrl:le}):t.resolve(M.onlyLocal());return m.then(e=>((h||p)&&f.logConfigurationFileEvent("Success"),e),e=>((h||p)&&f.logConfigurationFileEvent("Failure",{failureMessage:e.message,failureStack:e.stack}),M.onlyLocal())).then(e=>{if(f.staticConfig=e,de.staticConfig=e,!1===e.apiEnabled)throw N(R.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;f.logConnectivityEvent("Attempt"),le?f.logEvent("SessionInfo","Attempt",null,{proxyUrl:le}):f.logEvent("SessionInfo","Attempt");const t=e=>{e.code=C(e.code),f.logConnectivityEvent("Failure",null,{failureReason:"GetSessionInfo",failureCode:e.code||"No code",failureMessage:e.message,failureName:e.name}),e.name&&(e=N(e.name,new Error(`${e.message}${e.code?` (${e.code})`:""}`),e.code)),Xe.call(f,e)},r=w(e.apiUrl,le);return q({anvilUrl:r,sessionId:n,token:me,connectionId:_e,clientVersion:e.clientVersion}).then(n=>{if(d())return;if(n.partnerId&&n.partnerId!==Ee){const e="Authentication Error: The API key does not match the token or session.";return void t(N(R.AUTHENTICATION_ERROR,new Error(e),Z.AUTHENTICATION_ERROR))}Ne=v(n,ue),Ne&&(We=new ne(f)),de.sessionInfo=n;const r={features:{reconnection:n.reconnection,renegotiation:A()&&n.renegotiation,simulcast:void 0!==n.simulcast&&(n.simulcast&&"Chrome"===W.env.name)}};if(le&&(r.proxyUrl=le),f.is("connecting")){f.sessionInfo=n,f._.setIceServers(f.sessionInfo.iceServers),ge=n.p2pEnabled,be=n.messagingServer,f.logEvent("SessionInfo","Success",null,r,{messagingServer:n.messagingServer});const t=e.sessionInfoOverrides;null!=t&&"object"==typeof t&&Object.keys(t).forEach(e=>{Object.defineProperty(f.sessionInfo,e,{value:t[e]})}),ze.call(f)}},t)}).catch(e=>{Xe.call(f,e)}),f},this.disconnect=function(){We&&(We.destroy(),We=null),pe&&pe.isNot("disconnected")?pe.isNot("disconnecting")&&(pe.isNot("connecting")||this.logConnectivityEvent("Cancel"),Le("disconnecting"),pe.disconnect(),this.off("gsmCallEnded",Je)):Oe()},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 de.logError(1010,"OT.exception","We need to be connected before you can publish",null,{action:"Publish",variation:"Failure",failureReason:"unconnected",failureCode:Z.NOT_CONNECTED,failureMessage:"We need to be connected before you can publish",sessionId:xe,streamId:e&&e.stream?e.stream.id:null,p2p:this.sessionInfo?this.sessionInfo.p2pEnabled:void 0,messagingServer:this.sessionInfo?this.sessionInfo.messagingServer:null,partnerId:Ee}),qe(N(R.NOT_CONNECTED,new Error("We need to be connected before you can publish"),Z.NOT_CONNECTED),n),null;if(!Qe("publish")){const e="This token does not allow publishing. The role must be at least `publisher` to enable this functionality",t={failureReason:"Permission",failureCode:Z.UNABLE_TO_PUBLISH,failureMessage:e};return this.logEvent("Publish","Failure",null,t),qe(N(R.PERMISSION_DENIED,new Error(e),Z.UNABLE_TO_PUBLISH),n),null}if(!e||"string"==typeof e||W.isElementNode(e))e=re(e,t);else{if(!(e instanceof P))return void qe(N(R.INVALID_PARAMETER,new Error("Session.publish :: First parameter passed in is neither a string nor an instance of the Publisher"),Z.UNABLE_TO_PUBLISH),n);"session"in e&&e.session&&"sessionId"in e.session&&(e.session.sessionId===this.sessionId?Ce.warn(`Cannot publish ${e.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`):Ce.warn(`Cannot publish ${e.guid()} publisher already attached to ${e.session.sessionId}. Please call session.unpublish(publisher) first.`))}return Ie&&e._.forceMuteAudio(),e._.publishToSession(this,de).catch(e=>{throw e.message="Session.publish :: "+e.message,Ce.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"):Ce.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(z(n),de.logEvent({action:"setIceConfig",variation:"Attempt",payload:{newIceConfig:n}}),ie=Object.assign({},n),"all"!==n.includeServers){e.next=8;break}return e.next=6,Te._.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(D.publishers.map(e=>e._.setIceConfig(o)).concat(D.subscribers.map(e=>e._.setIceConfig(o))));case 13:e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(10),de.logEvent({action:"setIceConfig",variation:"Failure",payload:{newIceConfig:n}}),e.t0;case 19:de.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 qe(N(R.NOT_CONNECTED,new Error("Session.subscribe :: Connection required to subscribe"),Z.UNABLE_TO_SUBSCRIBE),r);if(!e)return void qe(N(R.INVALID_PARAMETER,new Error("Session.subscribe :: stream cannot be null"),Z.UNABLE_TO_SUBSCRIBE),r);if(!Object.prototype.hasOwnProperty.call(e,"streamId"))return void qe(N(R.INVALID_PARAMETER,new Error("Session.subscribe :: invalid stream object"),Z.UNABLE_TO_SUBSCRIBE),r);if(n&&!1===n.insertDefaultUI&&t)return void qe(N(R.INVALID_PARAMETER,new Error("You cannot specify a target element if insertDefaultUI is false"),Z.INVALID_PARAMETER),r);t&&!1===t.insertDefaultUI&&(n=t,t=void 0);const i=new B(t,l(n||{},{stream:e,session:this,analytics:de,_singlePeerConnectionController:We}),e=>{e?qe(e,r):r(null,i)});return D.subscribers.add(i),i},this.unsubscribe=function(e){if(!e){const e="OT.Session.unsubscribe: subscriber cannot be null";throw Ce.error(e),new Error(e)}return e.stream?(Ce.debug("OT.Session.unsubscribe: subscriber "+e.id),e._destroy({reason:"Unsubscribe"}),!0):(Ce.warn("OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream"),!1)},this.getSubscribersForStream=function(e){return D.subscribers.where({streamId:e.id})},this.getPublisherForStream=function(e){let t,n;if("string"==typeof e)t=e;else{if("object"!=typeof e||!e||!Object.hasOwnProperty.call(e,"id"))throw n="Session.getPublisherForStream :: Invalid stream type",Ce.error(n),new Error(n);t=e.id}return D.publishers.where({streamId:t})[0]},this._={getProxyUrl:()=>le,isE2ee:()=>Te.sessionInfo.e2ee&&Ge&&!!Te.capabilities.supportsE2ee,isSocketReconnecting:()=>Se,getSocket:()=>pe,reconnecting:function(){Se=!0,this.dispatchEvent(new k.SessionReconnectingEvent)}.bind(this),reconnected:function(){Se=!1,this.dispatchEvent(new k.SessionReconnectedEvent),this.sessionInfo.reconnection&&(D.publishers.where({session:this}).forEach(e=>{e._.iceRestart()}),this.sessionInfo.p2pEnabled||D.subscribers.where({session:this}).forEach(e=>{e._.iceRestart("socket reconnected")}))}.bind(this),dispatchSignal:function(e,t,n){const r=new k.SignalEvent(t,n,e);r.target=this,this.trigger(d.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 Ce.error("Caption parsing failed: "+e.message)}const o=new k.CaptionReceivedEvent(n,r,i);o.target=this,this.trigger(d.SUBSCRIBER_CAPTION_RECEIVED,o),this.dispatchEvent(o)}.bind(this),subscriberChannelUpdate:(e,t,n,r)=>pe?pe.subscriberChannelUpdate(e.id,t.widgetId,n.id,r):(Ce.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,d=n.customProperties;pe?pe.streamCreate({name:r,streamId:i,subscriberAudioFallbackEnabled:o,channels:s,minBitrate:a,maxBitrate:void 0,sourceStreamId:c,e2ee:u,publisherAudioFallbackEnabled:l,customProperties:d},t):Ce.warn("You are disconnected, cannot create stream ",i)},streamDestroy(e,t){pe?pe.streamDestroy(e,t):Ce.warn("You are disconnected, cannot destroy stream ",e)},streamChannelUpdate(e,t,n){pe?pe.streamChannelUpdate(e.id,t.id,n):Ce.warn("You are disconnected, cannot update stream properties ",n)},setSocket(e){pe=e},setLogging(e){Ce=e},setState:Le,setIceServers(e){e&&(we={iceServers:r(e),timestamp:Date.now()})},getOtIceServerInfo(){if(864e5-(we?Date.now()-we.timestamp:1/0)>3e5)return t.resolve({transportPolicy:Te&&Te.sessionInfo&&Te.sessionInfo.clientCandidates,servers:we&&we.iceServers});if(!me)return t.resolve({transportPolicy:Te&&Te.sessionInfo&&Te.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0});const e=F.clientVersion;return q({anvilUrl:(this.staticConfig||F).apiUrl,sessionId:n,token:me,connectionId:_e,clientVersion:e}).then(e=>(Te._.setIceServers(e.iceServers),we?{transportPolicy:Te&&Te.sessionInfo&&Te.sessionInfo.clientCandidates,servers:we&&we.iceServers}:{transportPolicy:Te.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0}))},getCodecFlags:()=>({h264:Te.sessionInfo.h264,vp9:Te.sessionInfo.vp9,vp8:Te.sessionInfo.vp8}),getVideoCodecsCompatible:e=>b({RTCPeerConnection:Q.RTCPeerConnection,env:W.env,stream:e,codecFlags:Te._.getCodecFlags()}),getIceConfig:()=>{if(!ie)return Te._.getOtIceServerInfo();const e=ie&&"relay"===ie.transportPolicy?"relay":Te.sessionInfo.clientCandidates;return("custom"===ie.includeServers?t.resolve({servers:[]}):Te._.getOtIceServerInfo()).then(t=>l(t,{transportPolicy:e,servers:[...t.servers,...ie.customServers]}))},forceMute:function(e){this.dispatchEvent(new k.MuteForcedEvent(e))}.bind(this),enableMuteOnEntry:()=>{Ie=!0},addSubscriberToPeerConnectionsQueue:(e,t)=>{Re.push({pc:e,message:t}),Ve||(Ve=setInterval(()=>{const e=Re.shift();e?e.pc.processMessage("offer",e.message):(clearInterval(Ve),Ve=null)},100))},disableMuteOnEntry:()=>{Ie=!1},privateEvents:new s},this.signal=function(e,t){let n=e,r=t||function(){};if(u(n)&&(r=n,n=null),this.isNot("connected")){const e="Unable to send signal - you are not connected to the session.";qe(N(R.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&&Ce.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 R.INVALID_PARAMETER;case 429:return R.RATE_LIMIT_EXCEEDED;case 404:return R.NOT_FOUND;case 500:return R.NOT_CONNECTED;case 403:return R.PERMISSION_DENIED;case 2001:return R.UNEXPECTED_SERVER_RESPONSE;default:return}}},this.forceDisconnect=function(e,t){if(this.isNot("connected")){const e="Cannot call forceDisconnect(). You are not connected to the session.";return void qe(N(R.NOT_CONNECTED,new Error(e),Z.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 qe(N(R.INVALID_PARAMETER,new Error(r),Z.INVALID_PARAMETER),t);Qe("forceDisconnect")?pe.forceDisconnect(n,(function(e){if(e)qe(N(R.INVALID_PARAMETER,new Error(r),Z.INVALID_PARAMETER),t);else if(t&&u(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)}})):qe(N(R.PERMISSION_DENIED,new Error("This token does not allow forceDisconnect. The role must be at least `moderator` to enable this functionality"),Z.UNABLE_TO_FORCE_DISCONNECT),t)},this.forceUnpublish=function(e,t){void 0===t&&(t=()=>{});const n=e=>qe(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:Z.INVALID_PARAMETER,name:R.INVALID_PARAMETER},i={msg:"Cannot call forceUnpublish(). You are not connected to the session.",code:Z.NOT_CONNECTED,name:R.NOT_CONNECTED},o={msg:"This token does not allow forceUnpublish. The role must be at least `moderator` to enable this functionality",code:Z.UNABLE_TO_FORCE_UNPUBLISH,name:R.PERMISSION_DENIED},s={msg:"The stream does not exist.",name:R.NOT_FOUND},a={msg:"An unexpected error occurred.",name:R.UNEXPECTED_SERVER_RESPONSE,code:Z.UNEXPECTED_SERVER_RESPONSE};if(!e)return void n(r);if(f.isNot("connected"))return void n(i);const c=he(e);Qe("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=et();r?n(r):e&&e.id?pe.forceMuteStream(e.id,e=>{e?n(tt(e)):t()}):n($e(X.INVALID_PARAMETER))}),this.forceMuteAll=e=>new t((t,n)=>{const r=et();if(r)return void n(r);if(Array.isArray(e)&&!e.every(e=>e instanceof O)||e&&!Array.isArray(e))return void n($e(X.INVALID_PARAMETER));const i=(e||[]).map(e=>e.id);pe.forceMuteAll(i,!0,e=>{e?n(tt(e)):t()})}),this.disableForceMute=()=>new t((e,t)=>{const n=et();n?t(n):pe.forceMuteAll([],!1,n=>{n?t(tt(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(ce){e.next=3;break}return G.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(R.INVALID_ENCRYPTION_SECRET,new Error("setEncryptionSecret: "+e.t0.message));case 10:return e.prev=10,e.next=13,f.keyStore.set(n,t);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),Ce.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 _([],{hasE2eeCapability:V})}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(10),i=n(22),o=[400,403,409,r.CONNECTION_LIMIT_EXCEEDED],s="ConnectToSession",a="GetSessionState";e.exports=function(e){let t,n;if(e.reason===s&&e.code===r.CONNECT_FAILED)t=e.code,n=i.getTitleByCode(e.code);else if(e.code&&o.indexOf(Number(e.code))>-1)switch(t=r.CONNECT_FAILED,e.reason){case s:switch(e.code){case r.CONNECTION_LIMIT_EXCEEDED:t=e.code,n="Cannot connect -- the limit for concurrent connections to the session has been reached";break;default:n="Received error response to connection create message."}break;case a:n="Received error response to session read";break;default:n=""}else t=r.UNEXPECTED_SERVER_RESPONSE,n="Unexpected server response. Try this operation again later.";return{code:t,message:n}}},function(e,t,n){"use strict";const r=n(3),i=n(51).once;e.exports=()=>i()&&(r.isChromiumEdge||["Chrome","Safari","Firefox","Opera"].includes(r.name))},function(e,t,n){"use strict";e.exports=function(e){return JSON.stringify(e)}},function(e,t){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";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(16),i=n(22),o=n(6),s=n(1)("Dispatcher"),a=n(171),c=n(750),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)&&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(15),i=n(8),o=n(753),s=n(754),a=n(322),c=n(755),u=n(34)().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,p=t.maxBitrate,f=t.sourceStreamId,m=t.e2ee,g=t.customProperties,b={id:i,name:o,audioFallbackEnabled:s,publisherAudioFallbackEnabled:c,subscriberAudioFallbackEnabled:u,channel:d.map(e=>l.streams.channelFromOTChannel(e)),e2ee:m,customProperties:g};return h&&(b.minBitrate=Math.round(h)),p&&(b.maxBitrate=Math.round(p)),f&&(b.sourceStreamId=f),"boolean"==typeof m&&(b.e2ee=m),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}`,content:b})},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,p=t.e2ee,f={id:u,connection:l,keyManagementMethod:c,bundleSupport:o(),rtcpMuxSupport:s(),e2ee:p};return d&&(f.channel=d),h&&(f.sourceStreamId=h),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}/subscriber/${u}`,content:f})},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(37),i=n(70),o=n(172),s=n(326),a=n(328);e.exports=function(e,t,n){var c;this.toRaptorMessage=function(){let t=this.to;return t&&"string"!=typeof t&&(t=t.id),s.signals.create(i.value,e,t,this.type,this.data)},this.toHash=function(){return n},this.error=null,this.retryAfterReconnect=!0,n&&(n.hasOwnProperty("data")&&(this.data=r(n.data),this.error=function(e){let t=null;if(null==e)t={code:400,reason:"The signal data was null or undefined. Either set it to a String value or omit it"};else try{JSON.stringify(e).length>8192&&(t={code:413,reason:"The data field was too long, the maximum size of it is 8192 characters"})}catch(e){t={code:400,reason:"The data field was not valid JSON"}}return t}(this.data)),n.hasOwnProperty("to")&&(this.to=n.to,this.error||(this.error=(c=this.to)?c instanceof o||c._tag===a?null:{code:400,reason:"The To field was invalid"}:{code:400,reason:"The signal to field was invalid. Either set it to a OT.Connection, OT.Session, or omit it entirely"})),n.hasOwnProperty("type")&&(this.error||(this.error=function(e){let t=null;return null==e?t={code:400,reason:"The signal type was null or undefined. Either set it to a String value or omit it"}:e.length>128?t={code:413,reason:"The signal type was too long, the maximum length of it is 128 characters"}:function(e){return!/^[a-zA-Z0-9\-\._~]+$/.exec(e)}(e)&&(t={code:400,reason:"The signal type was invalid, it can only contain letters, numbers, '-', '_', and '~'."}),t}(n.type)),this.type=n.type),n.hasOwnProperty("retryAfterReconnect")&&(this.error||(this.error=function(e){let t=null;return!0!==e&&!1!==e&&(t={code:400,reason:"The signal retryAfterReconnect was not true or false. Either set it to a Boolean value or omit it"}),t}(n.retryAfterReconnect)),this.retryAfterReconnect=n.retryAfterReconnect)),this.valid=null===this.error}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(330),a=n(49),c=n(172),u=n(758),l=n(325),d=n(1)("SessionDispatcher"),h=n(21),p=n(170),f=n(150),m=n(167);function g(e,t){if(t.streams.has(e.id))return;const n=function(e,t){const n=e.channel.map(e=>new f(e)),r=e.connectionId?e.connectionId:e.connection.id;return new p(e.id,e.name,e.creationTime,t.connections.get(r),t,n,e.customProperties&&e.customProperties.initials)}(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 p=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=p(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=>{p(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"});p(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 f=(t,n,r,s)=>{let u,l;const p={streamId:n},f=h.subscribers,m=h.publishers;switch(u=s.params.subscriber?{widgetId:s.params.subscriber}:p,t){case"offer":l=[].concat(f.where(u),m.where(p)).slice(0,1);break;case"answer":case"pranswer":l=[].concat(m.where(p),f.where(u)).slice(0,1);break;case"generateoffer":case"unsubscribe":l=m.where(p);break;case"candidate":l=[].concat(f.where(u),m.where(p));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",f.bind(null,"offer")),r.on("jsep#answer",f.bind(null,"answer")),r.on("jsep#pranswer",f.bind(null,"pranswer")),r.on("jsep#generateoffer",f.bind(null,"generateoffer")),r.on("jsep#unsubscribe",f.bind(null,"unsubscribe")),r.on("jsep#candidate",f.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})),p(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(2),i=r(n(4)),o=r(n(5));const s=n(21),a=n(106).setCurrentAudioOutputDeviceId,c=n(332),u=n(24)(),l=u.getDefaultAudioOutputDeviceId,d=u.getAudioOutputMediaDevices,h=n(295),p=new(n(20)),f=(e,t)=>{p.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,f("Attempt",{deviceId:t}),e.next=6,m(t);case 6:f("Success",{deviceId:t}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(2),f("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,f("Attempt",{deviceId:t}),e.next=4,m(t);case 4:f("Success",{deviceId:t}),a(t),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),f("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(0))},function(e,t,n){"use strict";n(335);const r=n(37),i=n(26),o=n(6),s=n(128),a=n(34)(),c=n(20),u=n(248),l=n(562),d=n(563),h=a.onlyLocal(),p={};p.noConflict=n(564)(),(void 0!==typeof window?window:global).OT=p,e.exports=p,(()=>{let e=p;Object.defineProperty(void 0!==typeof window?window:global,"TB",{get:()=>(e===p&&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 f=n(143)(void 0!==typeof window?window:global),m=n(8),g=n(70),b=n(144),y=n(251),v=n(145),w=n(146),S=n(252),E=n(147),T=n(7),x=n(10),_=n(253),C=n(240),I=n(1)("OT"),R=n(121),k=n(591),O=n(22),Z=n(102).parseIceServers,A=n(266),V=n(21),G=n(150),N=n(152),L=n(153),W=n(71)({global:f}),X=n(13)({}),M=n(158)(),F=n(280)({otError:X}),P=n(281)(),j=n(287)({global:f}),U=n(24)({getNativeEnumerateDevices:j}),D=n(23)(),H=n(160)(),Y=n(646)({otError:X,global:f}),B=n(161)({chromeExtensionHelper:F,otError:X}),J=n(651)({deviceHelpers:U,generateConstraintInfo:_,getUserMediaHelper:Y,global:f,OTHelpers:m,screenSharing:B}),K=n(654)({otError:X,processPubOptions:J}),z=n(162)({otError:X}),Q=n(73),q=n(292)(),$=n(293)({otError:X}),ee=n(294)({global:f,videoElementErrorMap:$}),te=n(163)({global:f}),ne=n(296)({PeerConnection:W,setCertificates:te}),re=n(300)({PeerConnection:W,setCertificates:te}),ie=n(302)(),oe=n(674)({otError:X}),se=n(109)({NativeVideoElementWrapper:ee}),ae=n(151)(),ce=n(164)({VideoElementFacade:se}),ue=n(305)({interpretPeerConnectionError:z,otError:X,SubscriberPeerConnection:re,WidgetView:ce}),le=n(168)({APIKEY:g,createChromeMixin:P,deviceHelpers:U,EnvironmentLoader:E,Errors:T,Events:D,ExceptionCodes:x,calculateCapableSimulcastStreams:y,global:f,interpretPeerConnectionError:z,IntervalRunner:Q,Microphone:q,otError:X,OTErrorClass:O,OTHelpers:m,parseIceServers:Z,processPubOptions:J,PUBLISH_MAX_DELAY:A,PublisherPeerConnection:ne,PublishingState:ie,StreamChannel:G,systemRequirements:L,VideoOrientation:ae,WidgetView:ce}),de=n(318)({otError:X,Publisher:le}),he=n(319)({global:f,initPublisher:de,otError:X,Publisher:le,Subscriber:ue}),pe=n(768)({Session:he});o(p);const fe=n(769),me=n(772),ge=n(773);u(p,"$",{name:"OT.$",getMessage:"Please use an external library like jQuery to select elements from the page.",value:m}),p.APIKEY=g.value,p.AnalyserAudioLevelSampler=w,p.Archive=n(330),p.ArchiveEvent=D.ArchiveEvent,p.ArchiveUpdatedEvent=D.ArchiveUpdatedEvent,p.AudioLevelTransformer=b,p.AudioLevelUpdatedEvent=D.AudioLevelUpdatedEvent,p.Capabilities=n(169),p.Chrome=v,p.Connection=n(172),p.ConnectionCapabilities=p.Connection.Capabilities,p.ConnectionEvent=D.ConnectionEvent,Object.keys(R).forEach(e=>{p[e.toUpperCase()]=R[e].priority}),p.NONE=0,p.debug=I.debug,p.error=I.error,p.info=I.info,p.log=I.log,p.warn=I.warn,p.DestroyedEvent=D.DestroyedEvent,p.EnvLoadedEvent=D.EnvLoadedEvent,p.Error=O,p.Error.on(i.EXCEPTION,e=>{if(e.target===p.Error){const t=r(e);t.target=p,p.dispatchEvent(t)}else p.dispatchEvent(e)}),p.Event=s,p.ExceptionCodes=x,p.ExceptionEvent=D.ExceptionEvent,p.getDevices=n(774),p.getAudioOutputDevices=n(331),p.getActiveAudioOutputDevice=n(332),p.setAudioOutputDevice=n(775)(),p.GetAudioLevelSampler=S,p.HAS_REQUIREMENTS=1,p.IntervalRunner=Q,p.IssueReportedEvent=D.IssueReportedEvent,p.MediaStoppedEvent=D.MediaStoppedEvent,p.Microphone=q,p.NOT_HAS_REQUIREMENTS=0,p.PeerConnection=W,p.PeerConnection.QOS=n(278).default,p.Publisher=le,p.PublisherPeerConnection=ne,p.PublishingState=ie,p.MuteForcedEvent=D.MuteForcedEvent,p.Session=he,p.SessionConnectEvent=D.SessionConnectEvent,p.SessionDisconnectEvent=D.SessionDisconnectEvent,p.SessionDispatcher=n(329),p.Signal=n(327),p.SignalEvent=D.SignalEvent,p.Stream=n(170),p.StreamChannel=G,p.StreamEvent=D.StreamEvent,p.StreamPropertyChangedEvent=D.StreamPropertyChangedEvent,p.StreamUpdatedEvent=D.StreamUpdatedEvent,p.StylableComponent=N,p.Subscriber=ue,p.SubscriberPeerConnection=re,p.SubscribingState=n(308),p.VideoDimensionsChangedEvent=D.VideoDimensionsChangedEvent,p.VideoDisableWarningEvent=D.VideoDisableWarningEvent,p.VideoElement=se,p.VideoEnabledChangedEvent=D.VideoEnabledChangedEvent,p.VideoOrientation=ae,p.WidgetView=ce,p.getSupportedCodecs=fe,p.hasMediaProcessorSupport=me,p.hasEndToEndEncryptionSupport=ge,p._={AnalyticsHelper:c,getClientGuid:C.get,StaticConfig:a},Object.defineProperty(p,"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`})}),p.properties=be,p.audioContext=M,p.checkScreenSharingCapability=B.checkCapability,p.checkSystemRequirements=L.check,p.components={},p.generateSimpleStateMachine=H,p.getErrorTitleByCode=O.getTitleByCode,p.getLogs=I.getLogs,p.getStatsAdpater=n(274),p.getStatsHelpers=n(75),p.getUserMedia=K,p.handleJsException=O.handleJsException,p.initPublisher=de,p.setProxyUrl=n(101).setProxyUrl,p.initSession=function(e,t,n){return null==t&&(t=e,e=null),0===g.value.length&&e&&(g.value=e,p.APIKEY=e),pe(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(p,{isUnloaded:{get:ye("OT.isUnloaded",E.isUnloaded)},onLoad:{get:ye("OT.onLoad",E.onLoad)},onUnload:{get:ye("OT.onUnload",E.onUnload)},overrideGuidStorage:{get:ye("OT.overrideGuidStorage",C.override)}}),p.pickScreenSharingHelper=B.pickHelper,p.publishers=V.publishers,p.registerScreenSharingExtension=B.registerExtension,p.registerScreenSharingExtensionHelper=B.registerExtensionHelper,p.reportIssue=oe,p.sessions=V.sessions,p.setLogLevel=k,p.shouldLog=I.shouldLog,p.subscribers=V.subscribers,p.unblockAudio=n(166),p.upgradeSystemRequirements=L.upgrade,E.onUnload(()=>{V.publishers.destroy(),V.subscribers.destroy(),V.sessions.destroy("unloaded")}),n(776)()},function(e,t,n){var r=n(336);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(350)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(337)(!1);var r=n(338),i=r(n(339)),o=r(n(340)),s=r(n(341)),a=r(n(342)),c=r(n(343)),u=r(n(344)),l=r(n(345)),d=r(n(346)),h=r(n(347)),p=r(n(348)),f=r(n(349));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: linear-gradient(60.08deg, #333333 0%, #1A1A1A 100%);\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: 1.0;\n\n background-repeat: no-repeat;\n background-image: url("+u+");\n background-size: auto 55%;\n}\n\n.OT_fit-mode-cover .OT_video-element {\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 object-fit: contain !important;\n }\n}\n\n.OT_fit-mode-contain .OT_video-element {\n object-fit: contain;\n}\n\n.OT_fit-mode-cover .OT_video-poster {\n background-position: center;\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("+p+");\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("+f+");\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("+f+");\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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/bk4dTPSunL2EyDjcbb7MQ+lQfZmkKiN7SjpFAM5CWAyGcwyY84YsZ1lUcbRNNtQMAdtQWGvQ0DyVjzYAKQfQFodeAeC1C8vzymXIZqD+ZEh/2OyLSalS/3VbnJZ+VqDXGjMrTCFuK4s66vVZUNfqaDolcbjOcb899sLpEE+I20GifywXe2QR3KElu99PzqjGufhREqB1pjCnG3IL3fY1v733r2FMsiGhutn0LAoJWWIGbPxjKwgjUbF0m52mPhigrpdXOecEq9pR6MkHbu2LOtrcZ9y3d0ODTb15y9MePz48aF79+8fvXnr9sljx2u2I7KNxDuaMPGVECoRs7mC4eT7SIruFNfNHK15MKuM2evwNq+4qjxvGnd5CHwNNynawW4cOlUZdG8b55IIJHmkItwrZHH6QxB3OSL9kTtAGpIvZiQB3Z4SKBfXQtEE9sashWAW87Bt3sYZNR6zn4uzJwWDKUKXfaKCdqUoBpLxSjYe9nqGiwWRBGipuGZ3Qm76itYLbbJI/PEhUApfw73uOIy9xfse3M9F9BuFJHcYrseSouGkHtCVtkuGTTikI8XgZzhg9SeF4VqcvSWiaSvNHQ8JwkNjIfEHemCmNLD1RaEfLs18mlgNuN6PFALHo7CyU5W2g00gFAQF4ozvibH04muwDbWraSFAyt/AAMzewgGR8uCeWn77xzBxPxgzPRCDDMZ14bQ/3jqGKGoHf2Hjgx3kw5LbaJDYWb52t9FMgw4AuWNWukNeuOYqOsmQi2jgws4PA/DD/z0B2x0/veCs4naw0cgybezid7X9jV3rX2RSs0wfLkll4pBGcgifg+NYxe1kJ2ycTaRq66uG/wBOl0vjcw70xwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAGMElEQVR4Ae2aA7D0yBaAc7oH12vbRmlLaxYWb23btm3btm2899a2bWuYtPZ01cmtU9lJrib315yqr9I3Oem/5/s7acwEnehEJzoxCcX2O+wEeIgRBDDaGjAZOgQ6ihRpLklHZDJIXK1WWymMIhGGk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nPg=="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTciIGhlaWdodD0iOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGQ9Ik03MCAxMkw5LjQ0OCA3Mi41NTIgMCA2MmwzLTQ0TDI5IDBsNDEgMTJ6bTggMmwxIDUyLTI5IDE4LTM1LjUwMi02LjQ5OEw3OCAxNHoiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCAzKSI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZD0iTTkuMTEgMjAuOTY4SDQ4LjFhNSA1IDAgMDE1IDVWNTguMThhNSA1IDAgMDEtNSA1SDkuMTFhNSA1IDAgMDEtNS01VjI1Ljk3YTUgNSAwIDAxNS01em00Ny4wOCAxMy4zOTRjMC0uMzQ1IDUuNDcyLTMuMTU5IDE2LjQxNS04LjQ0M2EzIDMgMCAwMTQuMzA0IDIuNzAydjI2LjgzNWEzIDMgMCAwMS00LjMwNSAyLjcwMWMtMTAuOTQyLTUuMjg2LTE2LjQxMy04LjEtMTYuNDEzLTguNDQ2VjM0LjM2MnoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48L2c+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(351);function p(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 f(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=E.bind(null,n,s,!1),i=E.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=T.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=f(e,t);return p(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&&p(f(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 E(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 T(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(80),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(80);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(80);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(80);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(79),i=n(111),o=n(112);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(16),i=n(365),o=n(11),s=n(174),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(39),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,i=n(366),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(14)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(369),i=n(79),o=n(111);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(370),i=n(371),o=n(372),s=n(373),a=n(374);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t,n){var r=n(81);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(81),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(81),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},function(e,t,n){var r=n(81);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(82);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(82);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(29),i=n(17);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(29),i=n(114),o=n(17),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(178)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(40),i=n(53);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(11),i=n(67),o=n(387),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&n.push(a);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(40),i=n(117);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},function(e,t,n){var r=n(40),i=n(181);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(38)(n(14),"DataView");e.exports=r},function(e,t,n){var r=n(38)(n(14),"Promise");e.exports=r},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(120),i=n(395),o=n(396),s=n(397),a=n(188);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(120);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(39),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},function(e,t,n){var r=n(399),i=n(66),o=n(115),s=o&&o.isMap,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(41),i=n(17);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(401),i=n(66),o=n(115),s=o&&o.isSet,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(41),i=n(17);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(403)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(42))},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(404),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(406),i=n(175),o=n(88),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=s},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t,n){"use strict";const r=n(194),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(43),o=n(125),s=n(412),a=n(31),c=n(413),u=n(32),l=n(201),d=n(455),h=n(44).toStringTag,p=n(456),f=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=p&&o&&WeakMap!==r?o(new WeakMap,b(this)):this,i(t)&&(f(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},p&&(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(195)()||(r=n(196)),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(197);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(415);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(126);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(418),i=n(31),o=Math.max;e.exports=function(e,t){var n,s,a,c=o(arguments.length,2);for(e=Object(i(e)),a=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},s=1;s<c;++s)r(t=arguments[s]).forEach(a);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(419)()?Object.keys:n(420)},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(43),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(125),o=n(200),s=n(32),a=n(44),c=n(203),u=Object.defineProperty;r=e.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");c.call(this,e),t=t?o.call(t,"key+value")?"key+value":o.call(t,"key")?"key":"value":"value",u(this,"__kind__",s("",t))},i&&i(r,c),delete r.prototype.constructor,r.prototype=Object.create(c.prototype,{_resolve:s((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(r.prototype,a.toStringTag,s("c","Array Iterator"))},function(e,t,n){"use strict";var r=n(91),i={object:!0,symbol:!0};e.exports=function(){var e,t=r.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!i[typeof t.iterator]&&(!!i[typeof t.toPrimitive]&&!!i[typeof t.toStringTag])}},function(e,t,n){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},function(e,t){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},function(e,t,n){"use strict";var r,i,o,s=n(32),a=n(202),c=n(91).Symbol,u=n(429),l=n(430),d=n(431),h=Object.create,p=Object.defineProperties,f=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),p(n,{__description__:s("",t),__name__:s("",u(t))}))},l(r),d(r),p(i.prototype,{constructor:s(r),toString:s("",(function(){return this.__name__}))}),p(r.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),f(r.prototype,r.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),f(r.prototype,r.toStringTag,s("c","Symbol")),f(i.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),f(i.prototype,r.toPrimitive,s("c",r.prototype[r.toPrimitive]))},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=n(32),i=Object.create,o=Object.defineProperty,s=Object.prototype,a=i(null);e.exports=function(e){for(var t,n,i=0;a[e+(i||"")];)++i;return a[e+=i||""]=!0,o(s,t="@@"+e,r.gs(null,(function(e){n||(n=!0,o(this,t,r(e)),n=!1)}))),t}},function(e,t,n){"use strict";var r=n(32),i=n(91).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",i&&i.hasInstance||e("hasInstance")),isConcatSpreadable:r("",i&&i.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",i&&i.iterator||e("iterator")),match:r("",i&&i.match||e("match")),replace:r("",i&&i.replace||e("replace")),search:r("",i&&i.search||e("search")),species:r("",i&&i.species||e("species")),split:r("",i&&i.split||e("split")),toPrimitive:r("",i&&i.toPrimitive||e("toPrimitive")),toStringTag:r("",i&&i.toStringTag||e("toStringTag")),unscopables:r("",i&&i.unscopables||e("unscopables"))})}},function(e,t,n){"use strict";var r=n(32),i=n(202),o=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return o[t]?o[t]:o[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in i(e),o)if(o[t]===e)return t}))})}},function(e,t,n){"use strict";var r=n(31);e.exports=function(){return r(this).length=0,this}},function(e,t,n){"use strict";var r,i=n(55),o=n(434),s=n(438),a=n(439),c=n(199),u=n(449),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(204),i=n(55);e.exports=function(e){return i(e)?e:r(e,"Cannot use %v",arguments[1])}},function(e,t,n){"use strict";var r=n(55),i=n(126),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(437),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(204),i=n(198);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(440),i=n(127),o=n(31);e.exports=function(e){var t=Object(o(e)),n=arguments[1],s=Object(arguments[2]);if(t!==e&&!n)return t;var a={};return n?r(n,(function(t){(s.ensure||t in e)&&(a[t]=e[t])})):i(a,e),a}},function(e,t,n){"use strict";e.exports=n(441)()?Array.from:n(442)},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(44).iterator,i=n(89),o=n(443),s=n(444),a=n(68),c=n(31),u=n(43),l=n(90),d=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;e.exports=function(e){var t,n,m,g,b,y,v,w,S,E,T=arguments[1],x=arguments[2];if(e=Object(c(e)),u(T)&&a(T),this&&this!==Array&&o(this))t=this;else{if(!T){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;)E=T?h.call(T,x,w.value,n):w.value,t?(p.value=E,f(g,n,p)):g[n]=E,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)E=e[n],n+1<b&&(y=E.charCodeAt(0))>=55296&&y<=56319&&(E+=e[++n]),E=T?h.call(T,x,E,m):E,t?(p.value=E,f(g,m,p)):g[m]=E,++m;b=m}if(void 0===b)for(b=s(e.length),t&&(g=new t(b)),n=0;n<b;++n)E=T?h.call(T,x,e[n],n):e[n],t?(p.value=E,f(g,n,p)):g[n]=E;return t&&(p.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(445),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){"use strict";var r=n(446),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(447)()?Math.sign:n(448)},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(68),i=n(450),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(451)("forEach")},function(e,t,n){"use strict";var r=n(68),i=n(31),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,c=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,u){var 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(125),o=n(32),s=n(44),a=n(203),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(454);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}},function(e,t,n){"use strict";var r=n(89),i=n(43),o=n(90),s=n(44).iterator,a=Array.isArray;e.exports=function(e){return!!i(e)&&(!!a(e)||(!!o(e)||(!!r(e)||"function"==typeof e[s])))}},function(e,t,n){"use strict";var r=n(89),i=n(68),o=n(90),s=n(201),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,l,d,h,p,f,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(f=e.length,p=0;p<f&&(m=e[p],p+1<f&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++p]),c.call(t,b,m,d),!h);++p);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(92),i=n(93),o=n(130),s=n(33),a=n(66),c=n(94),u=Math.min;e.exports=function(e,t,n){for(var l=n?o:i,d=e[0].length,h=e.length,p=h,f=Array(h),m=1/0,g=[];p--;){var b=e[p];p&&t&&(b=s(b,a(t))),m=u(b.length,m),f[p]=!n&&(t||d>=120&&b.length>=120)?new r(p&&b):void 0}b=e[0];var y=-1,v=f[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(p=h;--p;){var E=f[p];if(!(E?c(E,S):l(e[p],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(205),i=n(461),o=n(462);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(131);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){"use strict";(function(t){var r=n(19),i=n(207),o=n(465),s=n(213);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(132));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(214),c.CancelToken=n(479),c.isCancel=n(212),c.all=function(e){return t.all(e)},c.spread=n(480),c.isAxiosError=n(481),e.exports=c,e.exports.default=c}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(19),i=n(208),o=n(466),s=n(467),a=n(213),c=n(477),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.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=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var d=[s,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(l),o=t.resolve(e);d.length;)o=o.then(d.shift(),d.shift());return o}for(var h=e;r.length;){var p=r.shift(),f=r.shift();try{h=p(h)}catch(e){f(e);break}}try{o=s(h)}catch(e){return t.reject(e)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},l.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){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l}).call(this,n(0))},function(e,t,n){"use strict";var r=n(19);function i(){this.handlers=[]}i.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},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(19),i=n(468),o=n(212),s=n(132);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i.call(e,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.call(e,t.data,t.headers,e.transformResponse),t}),(function(n){return o(n)||(a(e),n&&n.response&&(n.response.data=i.call(e,n.response.data,n.response.headers,e.transformResponse))),t.reject(n)}))}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(19),i=n(132);e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},function(e,t,n){"use strict";var r=n(19);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(211);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";var r=n(19);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(473),i=n(474);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(19),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(19);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";var r=n(478),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=r.version.split(".");function a(e,t){for(var n=t?t.split("."):s,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]<r[i])return!1}return!1}i.transitional=function(e,t,n){var i=t&&a(t);function s(e,t){return"[Axios v"+r.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(s(r," has been removed in "+t));return i&&!o[r]&&(o[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={isOlderVersion:a,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:i}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,n){"use strict";(function(t){var r=n(214);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new t((function(e){n=e}));var i=this;e((function(e){i.reason||(i.reason=new r(e),n(i.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){var r=n(215)("pick",n(47));r.placeholder=n(133),e.exports=r},function(e,t,n){var r=n(484),i=n(133),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 p=!("cap"in l)||l.cap,f=!("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,E=d?u.runInContext():void 0,T=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=T.ary,_=T.assign,C=T.clone,I=T.curry,R=T.forEach,k=T.isArray,O=T.isError,Z=T.isFunction,A=T.isWeakMap,V=T.keys,G=T.rearg,N=T.toInteger,L=T.toPath,W=V(r.aryMethod),X={castArray:function(e){return function(){var t=arguments[0];return k(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 p&&"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(!Z(n))return e(n,Object(t));var r=[];return R(V(t),(function(e){Z(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),R(r,(function(e){var t=e[1];Z(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:N(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(p){var n=r.iterateeRearg[e];if(n)return function(e,t){return D(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)}}(G(s(e,n),t),n)}))}(t,n);var i=!d&&r.iterateeAry[e];if(i)return function(e,t){return D(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])?G(t,r.methodRearg[e]||r.aryRearg[n]):t}function j(e,t){for(var n=-1,r=(t=L(t)).length,i=r-1,o=C(Object(e)),s=o;null!=s&&++n<r;){var a=t[n],c=s[a];null==c||Z(c)||O(c)||A(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?E:T,a=d?E[o]:n,c=_(_({},s),t);return e(r,i,a,c)}}function D(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 H(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(W,(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||f&&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 H(n,u,y);var Y=u,B=[];return R(W,(function(e){R(r.aryMethod[e],(function(e){var t=Y[r.remap[e]||e];t&&B.push([e,H(e,t,Y)])}))})),R(V(Y),(function(e){var t=Y[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){Y[e[0]]=e[1]})),Y.convert=function(e){return Y.runInContext.convert(e)(void 0)},Y.placeholder=Y,R(V(Y),(function(e){R(r.realToAlias[e]||[],(function(t){Y[t]=Y[e]}))})),Y}},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(486),assign:n(176),clone:n(37),curry:n(504),forEach:n(113),isArray:n(12),isError:n(505),isFunction:n(16),isWeakMap:n(506),iteratee:n(507),keys:n(116),rearg:n(522),toInteger:n(96),toPath:n(525)}},function(e,t,n){var r=n(134);e.exports=function(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,r(e,128,void 0,void 0,void 0,void 0,t)}},function(e,t,n){var r=n(95),i=n(14);e.exports=function(e,t,n){var o=1&t,s=r(e);return function t(){var r=this&&this!==i&&this instanceof t?s:e;return r.apply(o?n:this,arguments)}}},function(e,t,n){var r=n(122),i=n(95),o=n(218),s=n(221),a=n(227),c=n(137),u=n(14);e.exports=function(e,t,n){var l=i(e);return function i(){for(var d=arguments.length,h=Array(d),p=d,f=a(i);p--;)h[p]=arguments[p];var m=d<3&&h[0]!==f&&h[d-1]!==f?[]:c(h,f);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(135),i=n(222),o=n(491),s=n(493);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(492),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(135),i=n(224),o=n(136),s=n(12),a=n(17),c=n(494),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(135),i=n(224),o=n(54);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(113),i=n(93),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return r(o,(function(n){var r="_."+n[0];t&n[1]&&!i(e,r)&&e.push(r)})),e.sort()}},function(e,t,n){var r=n(54),i=n(65),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(122),i=n(95),o=n(14);e.exports=function(e,t,n,s){var a=1&t,c=i(e);return function t(){for(var i=-1,u=arguments.length,l=-1,d=s.length,h=Array(d+u),p=this&&this!==o&&this instanceof t?c:e;++l<d;)h[l]=s[l];for(;u--;)h[l++]=arguments[++i];return r(p,a?n:this,h)}}},function(e,t,n){var r=n(219),i=n(220),o=n(137),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(228);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(503),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(134);function i(e,t,n){var o=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return o.placeholder=i.placeholder,o}i.placeholder={},e.exports=i},function(e,t,n){var r=n(29),i=n(17),o=n(138);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!o(e)}},function(e,t,n){var r=n(41),i=n(17);e.exports=function(e){return i(e)&&"[object WeakMap]"==r(e)}},function(e,t,n){var r=n(77),i=n(35);e.exports=function(e){return i("function"==typeof e?e:r(e,1))}},function(e,t,n){var r=n(509),i=n(513),o=n(234);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(78),i=n(229);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 p=new r;if(o)var f=o(d,h,l,e,t,p);if(!(void 0===f?i(h,d,3,o,p):f))return!1}}return!0}},function(e,t,n){var r=n(78),i=n(230),o=n(511),s=n(512),a=n(41),c=n(12),u=n(64),l=n(85),d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,p,f,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,E=y==v;if(E&&u(e)){if(!u(t))return!1;g=!0,w=!1}if(E&&!w)return m||(m=new r),g||l(e)?i(e,t,n,p,f,m):o(e,t,y,n,p,f,m);if(!(1&n)){var T=w&&h.call(e,"__wrapped__"),x=S&&h.call(t,"__wrapped__");if(T||x){var _=T?e.value():e,C=x?t.value():t;return m||(m=new r),f(_,C,n,p,m)}}return!!E&&(m||(m=new r),s(e,t,n,p,f,m))}},function(e,t,n){var r=n(39),i=n(187),o=n(52),s=n(230),a=n(232),c=n(97),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 p=a;case"[object Set]":var f=1&r;if(p||(p=c),e.size!=t.size&&!f)return!1;var m=h.get(e);if(m)return m==t;r|=2,h.set(e,t);var g=s(p(e),p(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(182),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 p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==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(233),i=n(30);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},function(e,t,n){var r=n(229),i=n(57),o=n(236),s=n(139),a=n(233),c=n(234),u=n(46);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(190);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(39),i=n(33),o=n(12),s=n(69),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(58),i=n(63),o=n(12),s=n(65),a=n(114),c=n(46);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(520),i=n(521),o=n(139),s=n(46);e.exports=function(e){return o(e)?r(s(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(98);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(134),i=n(140),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(237);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(39),i=n(63),o=n(12),s=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},function(e,t,n){var r=n(33),i=n(54),o=n(12),s=n(69),a=n(235),c=n(46),u=n(59);e.exports=function(e){return o(e)?r(e,c):s(e)?[e]:i(a(u(e)))}},function(e,t,n){var r=n(527),i=n(236);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(98),i=n(528),o=n(58);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(83),i=n(58),o=n(65),s=n(11),a=n(46);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 p=a(t[u]),f=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=d){var m=h[p];void 0===(f=c?c(m,p,h):void 0)&&(f=s(m)?m:o(t[u+1])?[]:{})}r(h,p,f),h=h[p]}return e}},function(e,t,n){var r=n(215)("mapKeys",n(530));r.placeholder=n(133),e.exports=r},function(e,t,n){var r=n(62),i=n(99),o=n(35);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,t(e,i,o),e)})),n}},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}},function(e,t,n){(function(e){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global);o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,c=/^xn--/,u=/[^\x20-\x7E]/,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,p=String.fromCharCode;function f(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+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(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,p,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&&f("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&&f("invalid-input"),((u=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||u>h((a-b)/s))&&f("overflow"),b+=u*s,!(u<(l=c<=S?1:c>=S+26?26:c-S));c+=36)s>h(a/(d=36-l))&&f("overflow"),s*=d;S=w(b-o,t=m.length+1,0==o),h(b/t)>a-v&&f("overflow"),v+=h(b/t),b%=t,m.splice(b++,0,v)}return y(m)}function E(e){var t,n,r,i,o,s,c,u,l,d,m,g,y,S,E,T=[];for(g=(e=b(e)).length,t=128,n=0,o=72,s=0;s<g;++s)(m=e[s])<128&&T.push(p(m));for(r=i=T.length,i&&T.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))&&f("overflow"),n+=(c-t)*y,t=c,s=0;s<g;++s)if((m=e[s])<t&&++n>a&&f("overflow"),m==t){for(u=n,l=36;!(u<(d=l<=o?1:l>=o+26?26:l-o));l+=36)E=u-d,S=36-d,T.push(p(v(d+E%S,0))),u=h(E/S);T.push(p(v(u,0))),o=w(n,y,r==i),n=0,++r}++n,++t}return T.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:y},decode:S,encode:E,toASCII:function(e){return g(e,(function(e){return u.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return g(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()}).call(this,n(84)(e))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(535),t.encode=t.stringify=n(536)},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,p,f,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=""),p=decodeURIComponent(d),f=decodeURIComponent(h),r(s,p)?i(s[p])?s[p].push(f):s[p]=[s[p],f]:s[p]=f}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(538),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 p=Object.getPrototypeOf,f=p&&p(p(I([])));f&&f!==r&&i.call(f,s)&&(h=f);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(E.prototype),E.prototype[a]=function(){return this},l.AsyncIterator=E,l.async=function(e,t,n,r){var i=new E(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=T(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 E(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 T(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,T(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(0))},function(e,t,n){var r,i,o=n(241),s=n(242),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 p=o();null==d&&(d=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,g=f-a+(m-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||f>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,c=m,i=h;var b=(1e4*(268435455&(f+=122192928e5))+m)%4294967296;l[u++]=b>>>24&255,l[u++]=b>>>16&255,l[u++]=b>>>8&255,l[u++]=255&b;var y=f/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(241),i=n(242);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";const r=n(9),i=n(1)("analytics"),o=n(542),s=n(15),a=n(243),c=n(100).prependProxyToUrlIfNeeded,u=n(101).getProxyUrl,l=s(),d=new o;e.exports=function(e){var t=this;let n=e.loggingUrl,o=e.queue,s=void 0===o?d:o,h=e.ajax,p=void 0===h?a:h;this.loggingUrl=n,this.updateEndPoints=()=>{if(!this.proxyUrl){this.proxyUrl=u();const e=c(this.loggingUrl,this.proxyUrl);this.loggingUrl=e}this.endPoint=this.loggingUrl+"/logging/ClientEvent",this.endPointQos=this.loggingUrl+"/logging/ClientQos"},this.updateEndPoints();const f={};this.logError=function(e,n,i,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(f[r]||0)>=100})(e,n,a))return;const c=[a,n,e].join("_"),u=o;f[c]=void 0!==f[c]?f[c]+1:1,t.logEvent(r(s,{action:`${n}.${e}`,payload:u}),!1)},this.logEvent=function(e,n,r,o){void 0===n&&(n=!1),void 0===o&&(o=()=>{}),t.updateEndPoints();const a=Object.assign({},e,{clientInstanceId:l});if(r&&!isNaN(r)&&Math.random()>r)return void i.debug("skipping sending analytics due to throttle:",a);let c;i.debug("queueing analytics:",t.loggingUrl,a);try{c=JSON.stringify(a)}catch(e){return void o(e)}!function(e,n,r){void 0===n&&(n=()=>{}),s.add(o=>{i.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&&i.debug("Failed to send ClientEvent, moving on to the next item."),n(e||void 0),o()})})}(c,o,n)},this.logQOS=e=>this.logEvent(e,!0)}},function(e,t,n){"use strict";let r=function(){function e(e){let t=(void 0===e?{}:e).waitTime,n=void 0===t?50:t;this.queue=[],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=r},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(546),i=r.isiPhone,o=r.isiPad,s=r.isiOS,a=n(547),c=n(548),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<16,d.isLegacyChrome=d.isChrome&&d.version<87,d.isLegacyFirefox=d.isFirefox&&d.version<=98,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(42))},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(550);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(552);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(116),i=n(41),o=n(63),s=n(12),a=n(25),c=n(64),u=n(67),l=n(85),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(16);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(246),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(557);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(559);e.exports=function(e){void 0===e&&(e={});(e.isSessionProxied||n(560))(e.sessionId)&&r.forEach(t=>{t in e&&(e[t]="")})}},function(e,t,n){"use strict";e.exports=["audioLocalAddress","audioRemoteAddress","videoLocalAddress","videoRemoteAddress"]},function(e,t,n){"use strict";const r=n(21).sessions;e.exports=e=>{const t=r.get(e);return!!t&&!!t._.getProxyUrl()}},function(e,t,n){"use strict";var r=n(2),i=r(n(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||!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(27);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(567)||null,l=n(569)||null,d=n(573)||null,h=n(575)||null,p=n(576)||null,f={browserDetails:c,commonShim:p,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."),f;a("adapter.js shimming chrome."),f.browserShim=u,p.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),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"firefox":if(!d||!d.shimPeerConnection||!o.shimFirefox)return a("Firefox shim is not included in this adapter release."),f;a("adapter.js shimming firefox."),f.browserShim=d,p.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),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"edge":if(!l||!l.shimPeerConnection||!o.shimEdge)return a("MS edge shim is not included in this adapter release."),f;a("adapter.js shimming edge."),f.browserShim=l,p.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimPeerConnection(i),l.shimReplaceTrack(i),l.shimGetDisplayMedia(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;case"safari":if(!h||!o.shimSafari)return a("Safari shim is not included in this adapter release."),f;a("adapter.js shimming safari."),f.browserShim=h,p.shimCreateObjectURL(i),h.shimRTCIceServerUrls(i),h.shimCreateOfferLegacy(i),h.shimCallbacksAPI(i),h.shimLocalStreamsAPI(i),h.shimRemoteStreamsAPI(i),h.shimTrackEventTransceiver(i),h.shimGetUserMedia(i),p.shimRTCIceCandidate(i),p.shimMaxMessageSize(i),p.shimSendThrowTypeError(i);break;default:a("Unsupported browser!")}return f}},function(e,t,n){"use strict";(function(t){var r=n(27),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(568),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(0))},function(e,t,n){"use strict";(function(t){var r=n(27),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(0))},function(e,t,n){"use strict";var r=n(27),i=n(570),o=n(571);e.exports={shimGetUserMedia:n(572),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(27);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(250);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 p=r.getIceParameters(e,i),f=r.getDtlsParameters(e,i);u&&(f.role="server"),a.usingBundle&&0!==t||(a._gather(n.mid,t),"new"===c.state&&c.start(s,p,u?"controlling":"controlled"),"new"===l.state&&l.start(f));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 p=[],f=r.splitSections(i.sdp),m=f.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,f.forEach((function(t,s){var c=r.splitLines(t),l=r.getKind(t),f=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(f||"application"===l&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))d.transceivers[s]={mid:S,kind:l,protocol:y,rejected:!0};else{var E,T,x,_,C,I,R,k,O;!f&&d.transceivers[s]&&d.transceivers[s].rejected&&(d.transceivers[s]=d._createTransceiver(l,!0));var Z,A,V=r.parseRtpParameters(t);f||(Z=r.getIceParameters(t,m),(A=r.getDtlsParameters(t,m)).role="client"),R=r.parseRtpEncodingParameters(t);var G=r.parseRtcpParameters(t),N=r.matchPrefix(t,"a=end-of-candidates",m).length>0,L=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)&&!f&&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||f){if("answer"===i.type&&!f){T=(E=d.transceivers[s]).iceGatherer,x=E.iceTransport,_=E.dtlsTransport,C=E.rtpReceiver,I=E.sendEncodingParameters,k=E.localCapabilities,d.transceivers[s].recvEncodingParameters=R,d.transceivers[s].remoteCapabilities=V,d.transceivers[s].rtcpParameters=G,L.length&&"new"===x.state&&(!g&&!N||b&&0!==s?L.forEach((function(e){a(E.iceTransport,e)})):x.setRemoteCandidates(L)),b&&0!==s||("new"===x.state&&x.start(T,Z,"controlling"),"new"===_.state&&_.start(A)),!o(E.localCapabilities,E.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&E.sendEncodingParameters[0].rtx&&delete E.sendEncodingParameters[0].rtx,d._transceive(E,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!C||"sendrecv"!==v&&"sendonly"!==v?delete E.rtpReceiver:(O=C.track,w?(h[w.stream]||(h[w.stream]=new e.MediaStream),u(O,h[w.stream]),p.push([O,C,h[w.stream]])):(h.default||(h.default=new e.MediaStream),u(O,h.default),p.push([O,C,h.default])))}}else{(E=d.transceivers[s]||d._createTransceiver(l)).mid=S,E.iceGatherer||(E.iceGatherer=d._createIceGatherer(s,b)),L.length&&"new"===E.iceTransport.state&&(!N||b&&0!==s?L.forEach((function(e){a(E.iceTransport,e)})):E.iceTransport.setRemoteCandidates(L)),k=e.RTCRtpReceiver.getCapabilities(l),n<15019&&(k.codecs=k.codecs.filter((function(e){return"rtx"!==e.name}))),I=E.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var W,X=!1;if("sendrecv"===v||"sendonly"===v){if(X=!E.rtpReceiver,C=E.rtpReceiver||new e.RTCRtpReceiver(E.dtlsTransport,l),X)O=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(O,"id",{get:function(){return w.track}}),W=h[w.stream]):(h.default||(h.default=new e.MediaStream),W=h.default)),W&&(u(O,W),E.associatedRemoteMediaStreams.push(W)),p.push([O,C,W])}else E.rtpReceiver&&E.rtpReceiver.track&&(E.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===E.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),E.associatedRemoteMediaStreams=[]);E.localCapabilities=k,E.remoteCapabilities=V,E.rtpReceiver=C,E.rtcpParameters=G,E.sendEncodingParameters=I,E.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)}))}p.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&l(d,t,r,[n])}))}})),p.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 p=0;p<i.transceivers.length&&(i.transceivers[p].rejected||(i.transceivers[p].iceTransport.addRemoteCandidate({}),(n=r.getMediaSections(i._remoteDescription.sdp))[p]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=r.getDescription(i._remoteDescription.sdp)+n.join(""),!i.usingBundle));p++);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(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e){var n=e&&e.navigator,r=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return t.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(27);e.exports={shimGetUserMedia:n(574),shimOnTrack:function(e){"object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)&&Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.transceiver={receiver:n.receiver},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))},enumerable:!0,configurable:!0}),"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"==typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}})},shimPeerConnection:function(e){var n=r.detectBrowser(e);if("object"==typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(t,r){if(n.version<38&&t&&t.iceServers){for(var i=[],o=0;o<t.iceServers.length;o++){var s=t.iceServers[o];if(s.hasOwnProperty("urls"))for(var a=0;a<s.urls.length;a++){var c={url:s.urls[a]};0===s.urls[a].indexOf("turn")&&(c.username=s.username,c.credential=s.credential),i.push(c)}else i.push(t.iceServers[o])}t.iceServers=i}return new e.mozRTCPeerConnection(t,r)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}}));var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),t.resolve())};var o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,r){return s.apply(this,[e||null]).then((function(e){if(n.version<48&&(e=function(e){var t=new Map;return Object.keys(e).forEach((function(n){t.set(n,e[n]),t[n]=e[n]})),t}(e)),n.version<53&&!t)try{e.forEach((function(e){e.type=o[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:o[t.type]||t.type}))}))}return e})).then(t,r)}}},shimSenderGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=n.apply(e,[]);return t.forEach((function(t){t._pc=e})),t});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):t.resolve(new Map)}}},shimReceiverGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(e,[]);return n.forEach((function(t){t._pc=e})),n}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},shimRemoveStream:function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&-1!==e.getTracks().indexOf(n.track)&&t.removeTrack(n)}))})},shimRTCDataChannel:function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},shimGetDisplayMedia:function(e,n){e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,t.reject(i)}return!0===r.video?r.video={mediaSource:n}:r.video.mediaSource=n,e.navigator.mediaDevices.getUserMedia(r)},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)})}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(27),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 p=s.prototype.getSettings;s.prototype.getSettings=function(){var e=p.apply(this,arguments);return d(e,"mozAutoGainControl","autoGainControl"),d(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var f=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")),f.apply(this,[e])}}}o.getUserMedia=function(e,t,i){if(n.version<44)return c(e,t,i);r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),o.mediaDevices.getUserMedia(e).then(t,i)}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(27);e.exports={shimLocalStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach((function(n){n.id===e&&(t=n)})),this._remoteStreams&&this._remoteStreams.forEach((function(n){n.id===e&&(t=n)})),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach((function(r){t.call(n,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e,n){return n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach((function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)}))}})}},shimRemoteStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){this._onaddstream&&this.removeEventListener("addstream",this._onaddstream),this.addEventListener("addstream",this._onaddstream=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}},shimCallbacksAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,r=n.createOffer,i=n.createAnswer,o=n.setLocalDescription,s=n.setRemoteDescription,a=n.addIceCandidate;n.createOffer=function(e,n){var i=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[i]);return n?(o.then(e,n),t.resolve()):o},n.createAnswer=function(e,n){var r=arguments.length>=2?arguments[2]:arguments[0],o=i.apply(this,[r]);return n?(o.then(e,n),t.resolve()):o};var c=function(e,n,r){var i=o.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i};n.setLocalDescription=c,c=function(e,n,r){var i=s.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i},n.setRemoteDescription=c,c=function(e,n,r){var i=a.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i},n.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],o=0;o<e.iceServers.length;o++){var s=e.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,i.push(s)):i.push(e.iceServers[o])}e.iceServers=i}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"==typeof e&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var n=this;if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=n.getTransceivers().find((function(e){return e.sender.track&&"audio"===e.sender.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||n.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var i=n.getTransceivers().find((function(e){return e.sender.track&&"video"===e.sender.track.kind}));!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection("sendonly"):"recvonly"===i.direction&&i.setDirection("inactive"):!0!==e.offerToReceiveVideo||i||n.addTransceiver("video")}return t.apply(n,arguments)}}}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(250),i=n(27);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(0))},function(e,t,n){var r=n(78),i=n(255),o=n(238),s=n(579),a=n(11),c=n(53),u=n(256);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 p=d?d(u(t,c),o,c+"",t,n,h):void 0;void 0===p&&(p=o),i(t,c,p)}}),c)}},function(e,t,n){var r=n(255),i=n(179),o=n(188),s=n(54),a=n(189),c=n(63),u=n(12),l=n(131),d=n(64),h=n(16),p=n(11),f=n(138),m=n(85),g=n(256),b=n(580);e.exports=function(e,t,n,y,v,w,S){var E=g(e,n),T=g(t,n),x=S.get(T);if(x)r(e,n,x);else{var _=w?w(E,T,n+"",e,t,S):void 0,C=void 0===_;if(C){var I=u(T),R=!I&&d(T),k=!I&&!R&&m(T);_=T,I||R||k?u(E)?_=E:l(E)?_=s(E):R?(C=!1,_=i(T,!0)):k?(C=!1,_=o(T,!0)):_=[]:f(T)||c(T)?(_=E,c(E)?_=b(E):p(E)&&!h(E)||(_=a(T))):C=!1}C&&(S.set(T,_),v(_,T,y,w,S),S.delete(T)),r(e,n,_)}}},function(e,t,n){var r=n(40),i=n(53);e.exports=function(e){return r(e,i(e))}},function(e,t,n){"use strict";const r=n(148),i=n(257),o=n(258),s=n(263),a=n(1)("normalizeConstraintInput"),c={"320x240":{width:320,height:240},"320x180":{width:320,height:180},"640x480":{width:640,height:480},"640x360":{width:640,height:360},"1280x720":{width:1280,height:720},"1280x960":{width:1280,height:960},"1920x1080":{width:1920,height:1080}},u=[1,7,15,30];function 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 p(e,t){return"Chrome"===e.name&&-1!==e.userAgent.indexOf("Mac OS X")&&1===t?2:t}const f=["user","environment","left","right"],m=(e,t)=>{if(void 0===e||f.indexOf(e)>=0)return e;l(t).warn("Invalid facingMode passed to Publisher. Expected one of: "+f.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:p(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
+ /*
28
+ object-assign
29
+ (c) Sindre Sorhus
30
+ @license MIT
31
+ */var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=s(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))i.call(n,l)&&(c[l]=n[l]);if(r){a=r(n);for(var d=0;d<a.length;d++)o.call(n,a[d])&&(c[a[d]]=n[a[d]])}}return c}},function(e,t,n){(function(e,r){var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,s=String(e).replace(o,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n<i;a=r[++n])g(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),i=!0}return n.apply(this,arguments)}};var s,a={};function c(e,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),d(r,e,r.depth)}function u(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function l(e,t){return e}function d(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=d(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(b(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),T(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(x(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(T(n))return h(n)}var u,l="",S=!1,_=["{","}"];(f(n)&&(S=!0,_=["[","]"]),x(n))&&(l=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(l=" "+RegExp.prototype.toString.call(n)),E(n)&&(l=" "+Date.prototype.toUTCString.call(n)),T(n)&&(l=" "+h(n)),0!==s.length||S&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=S?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)k(t,String(s))?o.push(p(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(e,t,n,r,i,!0))})),o}(e,n,r,a,s):s.map((function(t){return p(e,n,r,a,t,S)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,_)):_[0]+l+_[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),k(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=g(n)?d(e,c.value,null):d(e,c.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function f(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return S(e)&&"[object RegExp]"===_(e)}function S(e){return"object"==typeof e&&null!==e}function E(e){return S(e)&&"[object Date]"===_(e)}function T(e){return S(e)&&("[object Error]"===_(e)||e instanceof Error)}function x(e){return"function"==typeof e}function _(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(v(s)&&(s=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(s)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=f,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=w,t.isObject=S,t.isDate=E,t.isError=T,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(584);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=n(585),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function Z(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(O&&e[O]){var t;if("function"!=typeof(t=e[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,i=new r((function(e,r){t=e,n=r})),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),O&&Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=O,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,n).then((function(t){e.nextTick(s,null,t)}),(function(t){e.nextTick(Z,t,s)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,i(t)),n}}).call(this,n(42),n(0))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(587),i=n(261),o=n(262),s=n(59);e.exports=function(e){return function(t){t=s(t);var n=i(t)?o(t):void 0,a=n?n[0]:t.charAt(0),c=n?r(n,1).join(""):t.slice(1);return a[e]()+c}}},function(e,t,n){var r=n(260);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+r+"|"+i+")"+"?",u="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[o,s,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),l="(?:"+[o+r+"?",r,s,a,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+l+u,"g");e.exports=function(e){return e.match(d)||[]}},function(e,t,n){"use strict";e.exports=["screen","window","tab","browser","application"]},function(e,t,n){"use strict";const r=n(1),i=n(34)(),o=n(50),s=n(121),a=n(593),c=n(596),u=i.onlyLocal(),l=r("setLogLevel"),d=o(()=>{l.info("%c\n ██████╗ ██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ██╗ ██╗\n██╔═══██╗██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗██║ ██╔╝\n██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║█████╔╝\n██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██╔═██╗\n╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ╚██████╔╝██║ ██╗\n ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝",'font-family: "Fire Code", Courier, "Courier New", Consolas, "DejaVu Sans Mono"'),l.info("OpenTok JS SDK "+u.version),l.info(`Release notes: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.html`),l.info(`Known issues: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.htmll#knownIssues`)});function h(e){if(void 0===e||!a(s,{priority:e})&&0!==e){const t=c(s,(e,t)=>`OT.${t.toUpperCase()} = ${e.priority}`).join(", ");l.error("level must be one of: OT.NONE = 0, "+t),l.warn("Using OT.WARN instead"),e=s.warn.priority}r.setLogLevel(e),e>=s.debug.priority&&d();return l.info("OpenTok JS SDK now uses the debug library. More info at https://www.npmjs.com/package/debug#browser-support"),l.info("Changed log level to: "+e),e}h(u.debug?s.debug.priority:s.warn.priority),e.exports=h},function(e,t,n){var r=n(96);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},function(e,t,n){var r=n(231),i=n(35),o=n(594),s=n(12),a=n(124);e.exports=function(e,t,n){var c=s(e)?r:o;return n&&a(e,t,n)&&(t=void 0),c(e,i(t,3))}},function(e,t,n){var r=n(265);e.exports=function(e,t){var n;return r(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}},function(e,t,n){var r=n(25);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s<o)&&!1!==i(a[s],s,a););return n}}},function(e,t,n){var r=n(33),i=n(35),o=n(597),s=n(12);e.exports=function(e,t){return(s(e)?r:o)(e,i(t,3))}},function(e,t,n){var r=n(265),i=n(25);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},function(e,t,n){"use strict";e.exports=function(e){return"http:"!==e.substr(0,5)&&"https:"!==e.substr(0,6)&&"data:image/png;base64,"!==e.substr(0,22)?"data:image/png;base64,"+e:e}},function(e,t,n){"use strict";const r=n(56),i=n(1)("Style");e.exports=function(e,t){const n=this,o={},s={buttonDisplayMode:["auto","mini","mini-auto","off","on"],nameDisplayMode:["auto","off","on"],audioLevelDisplayMode:["auto","off","on"],showSettingsButton:[!0,!1],showSpeakerButton:null,showMicButton:[!0,!1],backgroundImageURI:null,showControlBar:[!0,!1],showArchiveStatus:[!0,!1],archiveStatusDisplayMode:["auto","off","on"],videoDisabledDisplayMode:["auto","off","on"],audioBlockedDisplayMode:["auto","off","on"]};n.getAll=function(){return r(o)},n.get=function(e){return e?o[e]:n.getAll()},n.setAll=function(e,t){return Object.keys(e).forEach(r=>{n.set(r,e[r],t)}),n},n.set=function(e,r,a){let c;i.debug("setStyle: "+e.toString());const u=function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(r);return function(e,t){const n=s[e];return void 0!==n&&(null===n||-1!==n.indexOf(t))}(e,u)?(c=o[e],u!==c&&(o[e]=u,a||t(e,r,c)),n):(i.warn(`Style.set::Invalid style property passed ${e} : ${u}`),n)},e&&n.setAll(e,!0)}},function(e,t,n){"use strict";const r=n(3),i=n(269);e.exports=()=>Boolean("Node"!==r.name&&!r.isIosWebView&&(!!i()||(void 0!==typeof window?window:global).navigator.mediaDevices&&(void 0!==typeof window?window:global).navigator.mediaDevices.getUserMedia||(void 0!==typeof window?window:global).navigator.webkitGetUserMedia||(void 0!==typeof window?window:global).navigator.mozGetUserMedia))},function(e,t,n){"use strict";const r=n(3);e.exports=()=>"Node"!==r.name&&(!("function"!=typeof(void 0!==typeof window?window:global).webkitRTCPeerConnection||!(void 0!==typeof window?window:global).webkitRTCPeerConnection.prototype.addTrack)||("function"==typeof(void 0!==typeof window?window:global).RTCPeerConnection||"function"==typeof(void 0!==typeof window?window:global).mozRTCPeerConnection&&r.version>20))},function(e,t,n){"use strict";e.exports=void 0!==(void 0!==typeof window?window:global).WebSocket},function(e,t){e.exports='<div id="tb_alert"><div id="section-normal-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">&#x00D7;</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div></div><div id="section-upgrade-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">&#x00D7;</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-supported-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">&#x00D7;</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com.au/chrome/browser/mobile/">Google Chrome</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">&#x00D7;</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application is not supported on your mobile device\'s browser at this time.</div></div></div>'},function(e,t,n){"use strict";var r=n(2)(n(48));const i=n(18);e.exports=function(e){function t(t,n){var r;let i=(void 0===n?{}:n).destroyOnClose,o=void 0===i||i;(r=e.call(this)||this).modalDiv=document.createElement("div"),r.modalDiv.classList.add("OT_ModalDialog"),r.modalDiv.innerHTML=t;const s=r.modalDiv.querySelectorAll("[role=OT_close]");return[].forEach.call(s,e=>e.addEventListener("click",e=>{e.preventDefault(),r.close()})),r.close(),document.body.appendChild(r.modalDiv),o&&r.on("closed",()=>r.destroy()),r}(0,r.default)(t,e);var n=t.prototype;return n.open=function(){this.modalDiv.style.display="block",this.emit("opened")},n.close=function(){this.modalDiv.style.display="none",this.emit("closed")},n.destroy=function(){this.modalDiv.innerHTML="",this.modalDiv.parentNode.removeChild(this.modalDiv),this.emit("destroyed")},n.el=function(e){return this.modalDiv.querySelector(e)},t}(i)},function(e,t,n){"use strict";const r=n(20);e.exports=function(e){void 0===e&&(e={});const t=e.env||n(3),i=e.analytics||new r;i.logEvent({action:"UserAgentParsing",variation:"Attempt",payload:{userAgent:t.userAgent}}),i.logEvent({action:"UserAgentParsing",variation:t.error?"Failure":"Success",payload:{userAgent:t.userAgent}})}},function(e,t,n){var r=n(607),i=n(270),o=n(608),s=n(609);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},a(t)}e.exports=a},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(270);function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function o(t,n,s){return i()?e.exports=o=Reflect.construct:e.exports=o=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}e.exports=o},function(e,t,n){"use strict";(function(t){e.exports=(e,n)=>(n=n||(()=>{}),e.then(e=>new t(e=>{e(n())}).then(()=>e),e=>new t(e=>{e(n())}).then(()=>{throw e})))}).call(this,n(0))},function(e,t,n){var r=n(58),i=n(612),o=n(613),s=n(46);e.exports=function(e,t){return t=r(t,e),null==(e=o(e,t))||delete e[s(i(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(98),i=n(260);e.exports=function(e,t){return t.length<2?e:r(e,i(t,0,-1))}},function(e,t,n){var r=n(138);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(35),i=n(25),o=n(30);e.exports=function(e){return function(t,n,s){var a=Object(t);if(!i(t)){var c=r(n,3);t=o(t),n=function(e){return c(a[e],e,a)}}var u=e(t,n,s);return u>-1?a[c?t[u]:u]:void 0}}},function(e,t,n){var r=n(92),i=n(93),o=n(130),s=n(94),a=n(617),c=n(97);e.exports=function(e,t,n){var u=-1,l=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,l=o;else if(d>=200){var m=t?null:a(e);if(m)return c(m);h=!1,l=s,f=new r}else f=t?[]:p;e:for(;++u<d;){var g=e[u],b=t?t(g):g;if(g=n||0!==g?g:0,h&&b==b){for(var y=f.length;y--;)if(f[y]===b)continue e;t&&f.push(b),p.push(g)}else l(f,b,n)||(f!==p&&f.push(b),p.push(g))}return p}},function(e,t,n){var r=n(185),i=n(223),o=n(97),s=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=s},function(e,t,n){"use strict";e.exports=e=>(e=>parseInt(e,10))((e=>e.substring(0,9))((e=>e&&e.replace(/\D+/g,"")||"0")(e)))},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(4)),o=r(n(5));const s=n(1)("hasValidPeerConnection");function a(e){return new t(t=>{e.addEventListener("signalingstatechange",()=>t(!0)),e.createOffer({offerToReceiveAudio:1}).then(t=>e.setLocalDescription(t)).then(()=>setTimeout(()=>{t(!1)},1e3))})}function c(){return(c=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=new t({iceServers:[]}),e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),s.error("Error occurred creating PeerConnection",e.t0),e.abrupt("return",!1);case 8:return e.prev=8,e.next=11,a(n);case 11:e.next=18;break;case 13:e.prev=13,e.t1=e.catch(8),s.error("Error occurred checking the validity of the PeerConnection",e.t1);try{n.close()}catch(e){}return e.abrupt("return",!1);case 18:e.prev=18,n.close(),e.next=26;break;case 22:return e.prev=22,e.t2=e.catch(18),s.error("Error occurred closing PeerConnection",e.t2),e.abrupt("return",!1);case 26:return e.abrupt("return",!0);case 27:case"end":return e.stop()}}),e,null,[[0,4],[8,13],[18,22]])})))).apply(this,arguments)}e.exports=function(e){return c.apply(this,arguments)}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(37),i=n(3),o=n(621),s=n(72),a=n(1)("createPeerConnection");e.exports=function(e){let n=e.window,c=e.config,u=e.constraints;a.debug("called");const l=r(c);l.iceServers=o(i,l.iceServers),s()&&(l.sdpSemantics="plan-b");const d=new n.RTCPeerConnection(l,u);return t.resolve(d)}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(9),i=n(271),o={Edge(e){let t=!1;return e.map(e=>{if(!e)return;const n=e.urls||e.url&&[e.url];if(!n)return;const o=n.filter(e=>0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!t?(t=!0,!0):0===e.indexOf("stun:"));return 0!==o.length?r(i(e,["url","urls"]),{urls:o}):void 0}).filter(e=>void 0!==e)},Safari:e=>e.map(e=>{if(void 0!==e.urls&&void 0===e.url)return e;const t=e.urls||e.url&&[e.url];return r(i(e,["url","urls"]),{urls:t})})};e.exports=function(e,t){let n=e.name;e.isEdge&&(n=e.isLegacyEdge?"Edge":"ChromiumEdge");const r=o[n];return r?r(t):t}},function(e,t,n){"use strict";const r=n(28),i=n(3),o={baseline:"42001f",constBaseline:"42e01f"},s=e=>{let t=e.sdp,n=e.from,r=e.to;return t.replace(new RegExp("^(a=fmtp:\\d+ .*profile-level-id=)"+n,"gmi"),"$1"+r)};e.exports={local:{offer:function(e,t){let n=void 0===e?{}:e,a=n.numSimulcastStreams,c=n.audioBitrate,u=n.priorityVideoCodec,l=void 0===u?"":u,d=n.codecFlags,h=void 0===d?{}:d,p=n.enableStereo,f=void 0!==p&&p,m=n.enableDtx,g=void 0!==m&&m,b=n.replaceBaselineProfile,y=void 0!==b&&b,v=n.removeVideoOrientation,w=void 0!==v&&v,S=r.filterExcessSSRCs(t);a>1&&(S=r.enableSimulcast(S,a)),c>0&&(S=r.setAudioBitrate(S,c)),w&&(S=r.removeVideoOrientation(S)),S=r.modifyReceiveStereo(S,!1),S=r.modifySendStereo(S,Boolean(f)),S=r.modifyDtx(S,Boolean(g)),i.isLegacyEdge||Object.keys(h).filter(e=>!1===h[e]).forEach(e=>{S=r.removeVideoCodec(S,e)}),l&&!i.isLegacyEdge?S=r.reprioritizeVideoCodec(S,l,"top"):"h264"!==l&&(S=r.reprioritizeVideoCodec(S,"h264","bottom"));let E=S;return y&&(E=s({sdp:E,from:o.baseline,to:o.constBaseline})),{local:S,remote:E}},answer:function(e,t){let n=void 0===e?{}:e,i=n.audioBitrate,a=n.codecFlags,c=n.enableStereo,u=void 0!==c&&c,l=n.enableDtx,d=void 0!==l&&l,h=n.replaceBaselineProfile,p=void 0!==h&&h,f=n.sourceStreamId,m=t;i>0&&(m=r.setAudioBitrate(m,i)),m=r.modifyReceiveStereo(m,Boolean(u)),m=r.modifySendStereo(m,!1),m=r.modifyDtx(m,Boolean(d)),"MANTIS"===f&&"passive"===r.getSetupRole(m)&&(m=r.setSetupRole(m,"active")),a&&Object.keys(a).filter(e=>!1===a[e]).forEach(e=>{m=r.removeVideoCodec(m,e)});let g=m;return p&&(g=s({sdp:g,from:o.baseline,to:o.constBaseline})),{local:m,remote:g}}},remote:{offer:(e,t)=>{let n=e.replaceBaselineProfile,r=void 0!==n&&n,i=t;if(-1===i.indexOf("a=rtcp-fb")){const e="a=rtcp-fb:* ccm fir\r\na=rtcp-fb:* nack ";i=i.replace(/^m=video(.*)$/gim,"m=video$1\r\n"+e)}return r&&(i=s({sdp:i,from:o.constBaseline,to:o.baseline})),{local:i}},answer:function(e,t){let n=void 0===e?{}:e,i=n.audioBitrate,a=n.replaceBaselineProfile,c=void 0!==a&&a,u=t;return i>0&&(u=r.setAudioBitrate(u,i)),c&&(u=s({sdp:u,from:o.constBaseline,to:o.baseline})),{local:u}}}}},function(e,t,n){var r=n(39),i=n(54),o=n(41),s=n(25),a=n(275),c=n(624),u=n(232),l=n(97),d=n(262),h=n(276),p=r?r.iterator:void 0;e.exports=function(e){if(!e)return[];if(s(e))return a(e)?d(e):i(e);if(p&&e[p])return c(e[p]());var t=o(e);return("[object Map]"==t?u:"[object Set]"==t?l:h)(e)}},function(e,t){e.exports=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}},function(e,t,n){var r=n(33);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},function(e,t,n){"use strict";e.exports=(e,t)=>{let n=[],r=null;if("function"==typeof e.getReceivers){const t=e.getReceivers().find(e=>"audio"===e.track.kind);t&&(n=t.getSynchronizationSources())}else r=new Error("peerConnection does not support getReceivers function");t&&t(r,n)}},function(e,t,n){"use strict";(function(t){const r=n(628),i=function(e){this.pending=[],this._processBinding=this.maybeProcessPending.bind(this),e&&this.setPeerConnection(e)};i.prototype.setPeerConnection=function(e){if(this.pc)throw new Error("Peer connection already set");this.pc=e,this._forwardIceCandidate=r(this.pc,"addIceCandidate"),this.pc.addEventListener("signalingstatechange",this._processBinding),this.maybeProcessPending()},i.prototype.canAddCandidates=function(){return!!(this.pc&&"closed"!==this.pc.iceConnectionState&&this.pc.remoteDescription&&this.pc.remoteDescription.type&&this.pc.localDescription&&this.pc.localDescription.type)},i.prototype.addIceCandidate=function(e){if(this.canAddCandidates())return this._forwardIceCandidate(e);const n=this.pending;return new t((t,r)=>{n.push({iceCandidate:e,resolve:t,reject:r})})},i.prototype.maybeProcessPending=function(){this.canAddCandidates()&&this.process()},i.prototype.process=function(){for(;this.pending.length;){const e=this.pending.shift();this._forwardIceCandidate(e.iceCandidate).then(e.resolve).catch(e.reject)}},i.prototype.destroy=function(){this.pc&&this.pc.removeEventListener("signalingstatechange",this._processBinding),this._processBinding=null,this.pc=null},e.exports=i}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e,n){const r=e[n];return function(n){return new t((t,i)=>{const o=r.apply(e,[n,t,i]);o&&"function"==typeof o.then&&t(o)})}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(156),i=n(3),o=n(1)("offerProcessor"),s=n(28),a=n(630);e.exports=function(e,t,n,c,u,l,d,h,p,f,m,g,b){const y=(e,t)=>n=>{o.error(e),o.error(n),f&&f(e,n,t)},v=t=>{const n=s.hasSendStereo(l.sdp),i=s.hasSendDtx(l.sdp),o=s.getAudioBitrate(l.sdp),a=r(u,"local","answer",{enableStereo:n,enableDtx:i,audioBitrate:o,replaceBaselineProfile:g,codecFlags:d,sourceStreamId:b},t.sdp),h=new c({type:t.type,sdp:a.local}),f={type:t.type,sdp:a.remote};return e.setLocalDescription(h).then(()=>p(f)).catch(y("Error while setting LocalDescription","SetLocalDescription"))},w=new c({type:l.type,sdp:r(u,"remote","offer",{replaceBaselineProfile:g},l.sdp).local}),S=y("Error while setting RemoteDescription","SetRemoteDescription");return a(w,h,i,t,n).then(()=>(m(!0),w)).catch(e=>{if(m(!1),!s.hasMediaType(w.sdp,"audio"))throw new Error("Unsupported video without audio for fallback");o.debug("Couldn't set remote description",w,e,", trying without video");const t=new c({type:l.type,sdp:s.disableMediaType(w.sdp,"video")});return o.debug("offer without video",t.sdp),t}).then(t=>e.setRemoteDescription(t)).then(()=>e.createAnswer().then(v).catch(y("Error while setting createAnswer","CreateAnswer"))).catch(S)}},function(e,t,n){"use strict";(function(t){const r=n(72);e.exports=(e,n,i,o,s)=>{if(!o)return t.resolve(!0);const a={iceServers:[]};r()&&(a.sdpSemantics="plan-b");const c=new o(a),u=()=>{try{c.close()}catch(e){}};return c.setRemoteDescription(new s(e)).then(()=>{u()}).catch(e=>{throw u(),e})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(60),i=n(632);e.exports=function(e){let t=[];const n={};let o={sentMessages:0,recvMessages:0};const s=function(e){const n=new i(e);return t.push(n),n.on("close",()=>{!function(e){t.filter(t=>e!==t)}(n)}),n};return n.add=function(t,n){return s(e.createDataChannel(t,n))},n.addMany=function(e){for(const t in e)e.hasOwnProperty(t)&&n.add(t,e[t])},n.get=function(e,n){return r(t,t=>t.equals(e,n))},n.getOrAdd=function(e,t){let r=n.get(e,t);return r||(r=n.add(e,t)),r},n.getQosData=function(){const e={sentMessages:0,recvMessages:0};return t.forEach(t=>{e.sentMessages+=t.getQosData().sentMessages,e.recvMessages+=t.getQosData().recvMessages}),e},n.sampleQos=function(){const e=n.getQosData(),t={sentMessages:e.sentMessages-o.sentMessages,recvMessages:e.recvMessages-o.recvMessages};return o=e,t},n.destroy=function(){t.forEach(e=>{e.close()}),t=[]},e.addEventListener("datachannel",e=>{s(e.channel)}),n}},function(e,t,n){"use strict";const r=n(6),i=n(1)("DataChannel"),o=function(e){this.data=e.data,this.source=e.source,this.lastEventId=e.lastEventId,this.origin=e.origin,this.timeStamp=e.timeStamp,this.type=e.type,this.ports=e.ports,this.path=e.path};e.exports=function(e){const t={},n=[],s={sentMessages:0,recvMessages:0},a=function(e){return n.push(e),t},c=function(n){return e.send(n),s.sentMessages++,t};return r(t,!0),t.label=e.label,t.id=e.id,t.reliable=e.reliable,t.negotiated=e.negotiated,t.ordered=e.ordered,t.protocol=e.protocol,t._channel=e,t.close=function(){e.close()},t.equals=function(e,n){if(t.label!==e)return!1;for(const e in n)if(n.hasOwnProperty(e)&&t[e]!==n[e])return!1;return!0},t.getQosData=function(){return s},t.send=a,e.addEventListener("open",(function(){t.send=c,function(){let e;for(;e=n.shift();)t.send(e)}()}),!1),e.addEventListener("close",(function(e){t.send=a,t.trigger("close",e)}),!1),e.addEventListener("error",(function(e){i.error(e)}),!1),e.addEventListener("message",(function(e){const n=new o(e);s.recvMessages++,t.trigger("message",n)}),!1),t}},function(e,t,n){"use strict";const r=n(9),i=n(156),o=n(1)("subscribeProcessor"),s=n(28);e.exports=function(e){let t=e.peerConnection,n=e.NativeRTCSessionDescription,a=e.sdpTransforms,c=e.numSimulcastStreams,u=e.offerOverrides,l=e.offerConstraints,d=e.replaceBaselineProfile,h=e.removeVideoOrientation,p=e.removeUnusedCodecs;const f=(e,t)=>n=>{o.error(e,n);const r=new Error(e);throw r.reason=n,r.prefix=t,r};return o.debug("subscribeProcessor: creating offer"),t.createOffer(l).then(e=>{o.debug("subscribeProcessor: offer created",e);let l=e.sdp;var m;p&&(l=s.removeUnusedCodecs(l,null==(m=t.currentLocalDescription)?void 0:m.sdp));const g=i(a,"local","offer",r({numSimulcastStreams:c,replaceBaselineProfile:d,removeVideoOrientation:h},u),l),b=new n({type:e.type,sdp:g.local}),y=new n({type:e.type,sdp:g.remote});return o.debug("subscribeProcessor: setting local description"),t.setLocalDescription(b).then(()=>y,f("Error while setting LocalDescription","SetLocalDescription"))},f("Error while creating Offer","CreateOffer")).then(e=>({sdp:e.sdp,type:e.type}))}},function(e,t,n){"use strict";const r=n(635);let i=function(){function e(e){this.state=r.RESOLVED,this.offerAnswerQueue=[],this.logAnalyticsEvent=e}var t=e.prototype;return t.setPending=function(){this.state=r.PENDING},t.setResolved=function(){this.state=r.RESOLVED;const e=this.offerAnswerQueue.shift();e&&(this.logAnalyticsEvent("dequeueOfferAnswer","Event"),this.setPending(),e())},t.isPending=function(){return this.state===r.PENDING},t.enqueueOfferAnswer=function(e){this.isPending()?(this.offerAnswerQueue.push(e),this.logAnalyticsEvent("enqueueOfferAnswer","Event")):(this.setPending(),e())},e}();e.exports=i},function(e,t,n){"use strict";e.exports={PENDING:"pending",RESOLVED:"resolved"}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(28),a=s.mediaDirections,c=a.RECVONLY,u=a.INACTIVE,l=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.createOffer();case 4:return r=e.sent,e.next=7,t.setLocalDescription(r);case 7:o=t.remoteDescription.sdp,a=s.changeMediaDirection(o,n),t.setRemoteDescription({type:t.remoteDescription.type,sdp:a});case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();e.exports={changeMediaDirectionToInactive:e=>l(e,u),changeMediaDirectionToRecvOnly:e=>l(e,c)}},function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);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.")}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.__esModule=!0,t.default=function(e,t,n,r,i){if(d)return y(e,t,n,r,i);return b(e,t,n,r,i)},t.parseStatsNewAPI=y,t.parseStatsOldAPI=b;const o=n(3),s=n(8),a=n(1)("QoS"),c=n(28),u=n(279),l=n(638),d=n(103)(),h=n(157),p=["audioCodec","audioSentBytes","audioSentPackets","audioSentPacketsLost","audioRtt","videoCodec","videoHeight","videoHeightInput","videoSentBytes","videoFrameRateSent","videoSentPackets","videoRtt","videoSentPacketsLost","videoWidthInput","videoWidth","srtpCipher"],f=["audioCodec","audioRecvBytes","audioRecvPackets","audioRecvPacketsLost","videoCodec","videoHeight","videoRecvBytes","videoRecvPackets","videoRecvPacketsLost","videoFrameRateReceived","videoWidth","srtpCipher"],m=(e,t)=>a.debug(`Raw stats for peer conn ${e.id}:`,t),g=e=>{const t=e.portNumber||e.port;return`${e.ipAddress||e.address||e.ip}:${t}`};function b(e,t,n,r,i){const o=e=>(Number(e.stat("googFrameRateSent"))>0?(n.videoSentBytes=Number(e.stat("bytesSent")),n.videoSentPackets=Number(e.stat("packetsSent")),n.videoSentPacketsLost=Number(e.stat("packetsLost")),n.videoRtt=Number(e.stat("googRtt"))/1e3,n.videoFrameRate=Number(e.stat("googFrameRateInput")),n.videoWidth=Number(e.stat("googFrameWidthSent")),n.videoHeight=Number(e.stat("googFrameHeightSent")),n.videoFrameRateSent=Number(e.stat("googFrameRateSent")),n.videoWidthInput=Number(e.stat("googFrameWidthInput")),n.videoHeightInput=Number(e.stat("googFrameHeightInput")),n.videoCodec=e.stat("googCodecName"),n.videoBandwidthLimitedResolution="true"===e.stat("googBandwidthLimitedResolution"),n.cpuLimitedResolution="true"===e.stat("googCpuLimitedResolution")):Number(e.stat("googFrameRateReceived"))>0&&(n.videoRecvBytes=Number(e.stat("bytesReceived")),n.videoRecvPackets=Number(e.stat("packetsReceived")),n.videoRecvPacketsLost=Number(e.stat("packetsLost")),n.videoFrameRate=Number(e.stat("googFrameRateOutput")),n.videoFrameRateReceived=Number(e.stat("googFrameRateReceived")),n.videoFrameRateDecoded=Number(e.stat("googFrameRateDecoded")),n.videoWidth=Number(e.stat("googFrameWidthReceived")),n.videoHeight=Number(e.stat("googFrameHeightReceived")),n.videoCodec=e.stat("googCodecName")),null),s=e=>{Number(e.stat("audioInputLevel"))>0?(n.audioSentPackets=Number(e.stat("packetsSent")),n.audioSentPacketsLost=Number(e.stat("packetsLost")),n.audioSentBytes=Number(e.stat("bytesSent")),n.audioCodec=e.stat("googCodecName"),n.audioRtt=Number(e.stat("googRtt"))/1e3):Number(e.stat("audioOutputLevel"))>0&&(n.audioRecvPackets=Number(e.stat("packetsReceived")),n.audioRecvPacketsLost=Number(e.stat("packetsLost")),n.audioRecvBytes=Number(e.stat("bytesReceived")),n.audioCodec=e.stat("googCodecName"))};e.getStats(t=>{if(t.result){const r=t.result();m(e,r);const i=(e,t)=>r.filter(n=>n.id===t.stat(e))[0],a=e=>i("localCandidateId",e),c=e=>i("remoteCandidateId",e);for(let e=0;e<r.length;e++){const t=r[e];t.stat&&("true"===t.stat("googActiveConnection")&&(t.stat("googChannelId").indexOf("audio")>-1?(n.audioLocalAddress=t.stat("googLocalAddress"),n.audioRemoteAddress=t.stat("googRemoteAddress"),n.audioLocalCandidateType=t.stat("googLocalCandidateType"),n.audioRemoteCandidateType=t.stat("googRemoteCandidateType"),n.audioTransportType=t.stat("googTransportType"),n.audioLocalRelayProtocol=u(a(t).stat("priority")),n.audioRemoteRelayProtocol=u(c(t).stat("priority"))):t.stat("googChannelId").indexOf("video")>-1&&(n.videoLocalAddress=t.stat("googLocalAddress"),n.videoRemoteAddress=t.stat("googRemoteAddress"),n.videoLocalCandidateType=t.stat("googLocalCandidateType"),n.videoRemoteCandidateType=t.stat("googRemoteCandidateType"),n.videoTransportType=t.stat("googTransportType"),n.videoLocalRelayProtocol=u(a(t).stat("priority")),n.videoRemoteRelayProtocol=u(c(t).stat("priority")))),Number(t.stat("googAvailableSendBandwidth"))>0&&(n.videoSentEstimatedBandwidth=Number(t.stat("googAvailableSendBandwidth"))),Number(t.stat("googAvailableReceiveBandwidth"))>0&&(n.videoRecvEstimatedBandwidth=Number(t.stat("googAvailableReceiveBandwidth"))),s(t),o(t))}"videoCodec"in n&&!n.videoLocalAddress&&["LocalAddress","RemoteAddress","LocalCandidateType","RemoteCandidateType","TransportType","LocalRelayProtocol","RemoteRelayProtocol"].forEach(e=>{n["video"+e]=n["audio"+e]})}i(null,n)})}function y(e,t,n,i,a){const u=e=>{const t={packetsSent:"videoSentPackets",packetsLost:"videoSentPacketsLost",bytesSent:"videoSentBytes",framesPerSecond:"videoFrameRate",framesSent:"videoFrameRateSent",framesReceived:"videoFramesReceived",frameWidth:"videoWidth",frameHeight:"videoHeight"},r=["videoSentPackets","videoSentBytes"];for(const i in t)if(i in e){const o=t[i];r.includes(o)&&Number.isSafeInteger(n[o])?n[o]+=e[i]:n[o]=e[i]}},d=(r,a)=>{if("outboundrtp"===a?(r.hasOwnProperty("qualityLimitationReason")&&(n.videoBandwidthLimitedResolution="bandwidth"===r.qualityLimitationReason,n.cpuLimitedResolution="cpu"===r.qualityLimitationReason),u(r)):"inboundrtp"===a&&(n.videoRecvPackets=r.packetsReceived,n.videoRecvPacketsLost=r.packetsLost,n.videoRecvBytes=r.bytesReceived),(o.isFirefox&&["outboundrtp","inboundrtp"].includes(a)||!i&&"inboundrtp"===a)&&(n.videoFrameRate=(()=>{if(!("videoSentBytes"in n?n.videoSentBytes>0:n.videoRecvBytes>0))return 0;let e=0;if(o.isFirefox&&o.version<96)e=Number(r.framerateMean);else{const i="outboundrtp"===a?"framesEncoded":"framesDecoded";n[i]=r[i],e=h({currentStatFrames:r[i],currentTimestamp:r.timestamp,prevStatFrames:t[i],prevTimestamp:t.timeStamp||Date.now()})}return e})()),void 0===n.videoCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==r.codecId){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,i=r.codecId.lastIndexOf("_"),o=c.getCodecsAndCodecMap(t,"video");-1!==i&&void 0!==o&&(n.videoCodec=o.codecMap[r.codecId.substring(i+1)])}};e.getStats(null).then(t=>{let o,h,b,y,v,w,S,E;const T=[],x=r=>{const a=r.type.toLowerCase().replace(/[^a-z]/g,"");const p=r.id.toLowerCase();if(/(in|out)boundrtp$/.test(a)){const t=/rtp/.test(p),i=t&&/audio/.test(p),o=t&&/video/.test(p),u=i||"audio"===r.kind,l=o||"video"===r.kind;if(u?((t,r)=>{if("outboundrtp"===r?(n.audioSentPackets=t.packetsSent,n.audioSentPacketsLost=t.packetsLost,n.audioSentBytes=t.bytesSent):"inboundrtp"===r&&(n.audioRecvPackets=t.packetsReceived,n.audioRecvPacketsLost=t.packetsLost,n.audioRecvBytes=t.bytesReceived),void 0===n.audioCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==t.codecId){const r=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,i=t.codecId.lastIndexOf("_"),o=c.getCodecsAndCodecMap(r,"audio");-1!==i&&void 0!==o&&(n.audioCodec=o.codecMap[t.codecId.substring(i+1)])}})(r,a):l&&d(r,a),r.hasOwnProperty("roundTripTime")){const e=r.mediaType||r.kind;"video"===e?T.push(r.roundTripTime):"audio"===e&&(n.audioRtt=r.roundTripTime)}if("remoteinboundrtp"===a&&r.hasOwnProperty("packetsLost")){const e=r.kind+"SentPacketsLost";n[e]||(n[e]=0),n[e]+=r.packetsLost}}else if("transport"===a){const e=r.selectedCandidatePairId,i=r.srtpCipher;n.srtpCipher=i,e&&(y=l(e,t))}else if("localcandidate"===a)o=r.candidateType,b=g(r),w=r.protocol||r.transport;else if("remotecandidate"===a)h=r.candidateType,v=g(r);else if("track"===a&&0!==p.indexOf("video"))S=r.frameWidth,E=r.frameHeight,u(r);else if("mediasource"===a)r.hasOwnProperty("framesPerSecond")&&(n.videoFrameRate=r.framesPerSecond),r.hasOwnProperty("width")&&(n.videoWidthInput=r.width),r.hasOwnProperty("height")&&(n.videoHeightInput=r.height);else if("candidatepair"===a&&r.hasOwnProperty("availableOutgoingBitrate")){n[`video${i?"Sent":"Recv"}EstimatedBandwidth`]=parseInt(r.availableOutgoingBitrate,10)}};if("function"==typeof t[Symbol.iterator]){m(e,Array.from(t));for(var _,C=r(t);!(_=C()).done;){const e=_.value;x(Array.isArray(e)?e[1]:e)}}else{m(e,t);for(const e in t)t.hasOwnProperty(e)&&x(t[e])}if(e.currentRemoteDescription&&(n.useDtx=c.hasSendDtx(e.currentRemoteDescription.sdp)),i&&(n.videoRtt=(()=>{if(0===T.length)return null;const e=T.filter(e=>e>0),t=e.reduce((e,t)=>e+t,0);return e.length?t/e.length:0})()),(n.audioRecvBytes||n.audioSentBytes)&&(n.audioLocalCandidateType=o,n.audioLocalAddress=b,n.audioRemoteCandidateType=h,n.audioRemoteAddress=v,n.audioTransportType=w,n.audioLocalRelayProtocol=y,void 0===n.audioCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"audio");n.audioCodec=r[0]}if((n.videoRecvBytes||n.videoSentBytes)&&(n.videoLocalCandidateType=o,n.videoLocalAddress=b,n.videoRemoteCandidateType=h,n.videoRemoteAddress=v,n.videoTransportType=w,n.videoLocalRelayProtocol=y,void 0===n.videoCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"video");n.videoCodec=r[0]}!function(e,t){(t?p:f).forEach(t=>{e.hasOwnProperty(t)||(e[t]=null)})}(n,i),n.videoWidth=n.videoWidth||S,n.videoHeight=n.videoHeight||E,a(null,n)}).catch((function(e){a(e)}))}},function(e,t,n){"use strict";const r=n(279);e.exports=(e,t)=>{let n="";if(!e||!t)return n;const i=t.get(e);if(i){const e=i.localCandidateId;if(e){const i=t.get(e);if(i){const e=i.relayProtocol,t=i.priority;if(e){n="TURN/"+e.toUpperCase()}else n=r(t)}}}return n}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r=function(){function e(){this.value=null,this.changeCount=0}return e.prototype.onValue=function(e){e&&e!==this.value&&(this.value&&(this.changeCount+=1),this.value=e)},e}();t.default=r},function(e,t,n){var r=n(11),i=n(641),o=n(228),s=Math.max,a=Math.min;e.exports=function(e,t,n){var c,u,l,d,h,p,f=0,m=!1,g=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=c,r=u;return c=u=void 0,f=t,d=e.apply(r,n)}function v(e){return f=e,h=setTimeout(S,t),m?y(e):d}function w(e){var n=e-p;return void 0===p||n>=t||n<0||g&&e-f>=l}function S(){var e=i();if(w(e))return E(e);h=setTimeout(S,function(e){var n=t-(e-p);return g?a(n,l-(e-f)):n}(e))}function E(e){return h=void 0,b&&c?y(e):(c=u=void 0,d)}function T(){var e=i(),n=w(e);if(c=arguments,u=this,p=e,n){if(void 0===h)return v(p);if(g)return clearTimeout(h),h=setTimeout(S,t),y(p)}return void 0===h&&(h=setTimeout(S,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?s(o(n.maxWait)||0,t):l,b="trailing"in n?!!n.trailing:b),T.cancel=function(){void 0!==h&&clearTimeout(h),f=0,c=p=u=h=void 0},T.flush=function(){return void 0===h?d:E(i())},T}},function(e,t,n){var r=n(14);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";const r=n(50);t.check=function(e){void 0===e&&(e={});const t=e.env||n(3);return"Chrome"===t.name&&t.userAgent.toLowerCase().indexOf("android")>-1&&t.version<65},t.once=r(()=>t.check())},function(e,t,n){"use strict";const r=n(3);e.exports=function(e){void 0===e&&(e={});const t=e.env,n=void 0===t?r:t;return!!(n.isiOS&&n.iOSVersion>10)}},function(e,t,n){"use strict";const r=n(36),i=n(8);e.exports=function(e){let t,n,o,s,a;const c=this;let u=e.archiving;const l=e.archivingStarted||"Archiving on",d=e.archivingEnded||"Archiving off";let h=!0;const p=function(e){s.nodeValue=e,t.setAttribute("title",e)},f=function(){a&&(clearTimeout(a),a=null),u?i.addClass(n,"OT_active"):i.removeClass(n,"OT_active"),i.removeClass(c.domElement,"OT_archiving-"+(u?"off":"on")),i.addClass(c.domElement,"OT_archiving-"+(u?"on":"off")),e.show&&u?(p(l),i.addClass(o,"OT_mode-on"),i.removeClass(o,"OT_mode-auto"),c.setDisplayMode("on"),a=setTimeout(()=>{i.addClass(o,"OT_mode-auto"),i.removeClass(o,"OT_mode-on")},5e3)):e.show&&!h?(i.addClass(o,"OT_mode-on"),i.removeClass(o,"OT_mode-auto"),c.setDisplayMode("on"),p(d),a=setTimeout(()=>{c.setDisplayMode("off")},5e3)):c.setDisplayMode("off")};r(this,{mode:u&&e.show?"on":"off",nodeName:"h1",htmlAttributes:{className:"OT_archiving OT_edge-bar-item OT_edge-bottom"},onCreate(){t=i.createElement("div",{className:"OT_archiving-light-box"},""),n=i.createElement("div",{className:"OT_archiving-light"},""),t.appendChild(n),o=i.createElement("div",{className:"OT_archiving-status OT_mode-on OT_edge-bar-item OT_edge-bottom"},""),s=document.createTextNode(""),o.appendChild(s),c.domElement.appendChild(t),c.domElement.appendChild(o),f()}}),this.setShowArchiveStatus=function(t){e.show=t,c.domElement&&f.call(c)},this.setArchiving=function(e){u=e,h=!1,c.domElement&&f.call(c)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.global||(void 0!==typeof window?window:global);return()=>t.navigator&&t.navigator.mediaDevices}},function(e,t,n){"use strict";(function(t){const r=n(9),i=n(11),o=n(107),s=n(647),a=n(20),c=n(22),u=n(6);e.exports=function(e){void 0===e&&(e={});const l=e.env||n(3),d=e.Errors||n(7),h=e.otError||n(13)(),p=e.logging||n(1)("getUserMedia"),f=e.screenSharing||n(161)(),m=e.getDisplayMediaExtensionHelper||n(288),g=e.customGetUserMedia,b=e.global||(void 0!==typeof window?window:global),y=e.analytics||new a,v=b.navigator,w=b.location,S=()=>{return g||(v.mediaDevices?(e=v.mediaDevices).getUserMedia.bind(e):void 0);var e},E=function(){const e=S();return e?e(...arguments):t.reject(new Error("Cannot find getUserMedia"))},T=()=>{return g||(v.mediaDevices&&v.getDisplayMedia?v.getDisplayMedia.bind(v):v.mediaDevices&&v.mediaDevices.getDisplayMedia?(e=v.mediaDevices).getDisplayMedia.bind(e):void 0);var e},x=function(){const e=T();return e?e(...arguments):t.reject(new Error("Cannot find getDisplayMedia"))},_=(()=>{const e={name:d.USER_MEDIA_ACCESS_DENIED,message:"End-user denied permission to hardware devices"},t={name:d.NOT_SUPPORTED,message:"A constraint specified is not supported by the browser."},n={name:d.CONSTRAINTS_NOT_SATISFIED,message:"It's not possible to satisfy one or more constraints passed into the getUserMedia function"},i={name:d.NO_DEVICES_FOUND,message:"No voice or video input devices are available on this machine."},o={name:d.HARDWARE_UNAVAILABLE,message:"The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application."},a={name:d.UNABLE_TO_CAPTURE_SCREEN,message:"Unable to capture screen. Unknown error occurred"},c={AbortError:{name:d.UNABLE_TO_CAPTURE_MEDIA,message:"Unable to capture media. Unknown error occurred"},NotAllowedError:e,NotFoundError:i,NotReadableError:o,OverconstrainedError:n,SecurityError:r({},e,{message:"End-user denied permission to hardware devices or user media support may be disabled on this page"}),TypeError:n,PermissionDeniedError:e,PermissionDismissedError:e,NotSupportedError:t,ConstraintNotSatisfiedError:n,MandatoryUnsatisfiedError:n,OverConstrainedError:n,DevicesNotFoundError:i,NoDevicesFoundError:i,HardwareUnavailableError:o,SourceUnavailableError:o,TrackStartError:o,ScreenCaptureError:a,TabCaptureError:a};return s({objectToTrack:c,keys:["PermissionDeniedError","PermissionDismissedError","NotSupportedError","ConstraintNotSatisfiedError","MandatoryUnsatisfiedError","OverConstrainedError","DevicesNotFoundError","NoDevicesFoundError","HardwareUnavailableError","SourceUnavailableError","TrackStartError","ScreenCaptureError","TabCaptureError"],onUsage(e){y.logEvent({action:"DeprecatedPropertyUsage:getUserMedia:errorMap",variation:"Event",payload:{key:e}})}}),c})(),C=(e,t)=>{let n=e;"AbortError"===n&&"string"==typeof t&&t.match(/(screen|tab).?capture/i)&&(n="ScreenCaptureError");const r=_[n];let i;return i=r?h(r.name,new Error(`${r.message} (getUserMedia error: ${e})`)):new Error("Unknown error while getting user media: "+e),i.originalMessage=t,i.originalName=e,i};return function(e,n){if(void 0===n&&(n=!1),p.debug("getUserMedia wrapper called with",e),function(e){if(!e||!i(e))return!0;for(const t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}(e))return p.error("Couldn't get UserMedia: All constraints were false"),u(t.reject(h(d.NO_VALID_CONSTRAINTS,new Error("Video and Audio was disabled, you need to enable at least one"))));const r=n&&m.isSupportedInThisBrowser?x:E,s=u(r(e).catch(e=>{const n=(e=>{if(i(e)&&e.name){let t=e.name,n=e.message;if("Cannot find getUserMedia"!==n&&"Cannot find getDisplayMedia"!==n||(t="Chrome"===l.name&&l.version>73&&"https:"!==b.location.protocol?"NotAllowedError":"NotSupportedError"),"Safari"===l.name&&"Error"===t){const n=Object.prototype.toString.call(e).match(/^\[object (\w+Error)\]$/);n&&(t=n[1])}const r=C(t,n);return r.constraintName=e.constraint||e.constraintName,r instanceof c||y.logEvent({action:"UnexpectedError:getUserMedia:parseErrorEvent",variation:"Event",payload:{name:r.name,message:r.message,originalMessage:r.originalMessage}}),r}if("string"==typeof e){const t=C(e);return y.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error is string",error:e}}),t}return y.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error was not string or object with name property",error:e}}),new Error("Unknown error type while getting media")})(e);if(n.name===d.UNABLE_TO_CAPTURE_SCREEN)return new t((e,t)=>{f.checkCapability(e=>{if("chrome"===e.extensionRequired){if(e.extensionRegistered&&!e.extensionInstalled){const e=h(d.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,n);e.message="Screen sharing extension not installed see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}else if(!e.extensionRegistered){const e=h(d.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,n);e.message="Screen sharing extension not registered see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}}else t(n)})});throw n}).then(e=>(p.debug("got stream:",{stream:e,tracks:e.getTracks(),trackLabels:e.getTracks().map(e=>e.label)}),e))),a=-1!==w.protocol.indexOf("https")?500:100;let g=!0;const v=()=>{g=!1};return s.then(v,v),o(a).then(()=>{if(!g)return;const e=()=>{s.emit("accessDialogClosed")};s.emit("accessDialogOpened"),s.then(e,e)}),s}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){let t=void 0===e?{}:e,n=t.objectToTrack,r=t.keys,i=t.onUsage;if(!Array.isArray(r)&&void 0!==r)throw new Error("keys must be an array, or undefined");if("function"!=typeof i)throw new Error("onUsage must be a function");if(null==n)throw new Error("Expected objectToTrack to be a trackable object");Object.keys(n).forEach(e=>{if(void 0!==r&&-1===r.indexOf(e))return;let t=n[e];Object.defineProperty(n,e,{get:()=>(i(e),t),set(n){t=n,i(e,t)},enumerable:!0})})}},function(e,t,n){"use strict";const r=n(3),i=n(649).isCallbackBasedAPI;let o=n(264),s=null;const a=(e,t)=>{s.getSources(e,t)},c=(e,t)=>{s.getSources(e).then(e=>{t(void 0,e)},t)},u=(e,t)=>{(i?a:c)({types:[e]},(n,r)=>{if(n)return void t(n);const i=r[0];if(!i)return void t(new Error("Could not find Electron source for screensharing"));const o={audio:!1,video:{mandatory:{chromeMediaSource:e,chromeMediaSourceId:i.id}}};t(void 0,o)})};e.exports=function(e){void 0===e&&(e={});try{const t=()=>{let e=void 0!==typeof window?window:global;for(;"function"!=typeof e.require&&e.parent&&e.parent!==e;)e=e.parent;return e},n=()=>{const e=t();return(e.require?e.require("electron"):e.electron).desktopCapturer};s=e.desktopCapturer||(r.isElectron?n():null),o=e.isElectronScreenSharingSource||o}catch(e){}return{isSupportedInThisBrowser:null!==s,autoRegisters:!0,extensionRequired:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!0,window:!0,browser:!0},register:()=>({isInstalled:e=>e(!0),getConstraints(e,t,n){o(e)?n(void 0,{audio:!0,video:!1}):u(e,n)}})}}},function(e,t,n){"use strict";const r=n(3).version<78,i=!r;e.exports={isCallbackBasedAPI:r,isPromiseBasedAPI:i}},function(e,t,n){"use strict";const r=n(3),i=n(159).default;e.exports={isSupportedInThisBrowser:!!r.isFirefox&&!i,autoRegisters:!0,extensionRequired:!1,extensionInstalled:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!1,window:!0,browser:!1},register:()=>({isInstalled(e){e("object"==typeof OTScreenSharing)},getConstraints(e,t,n){t.video={mediaSource:e},t.browserWindow&&(t.video.browserWindow=t.browserWindow,delete t.browserWindow),void 0!==t.scrollWithPage&&(t.video.scrollWithPage=t.scrollWithPage,delete t.scrollWithPage),n(void 0,t)}})}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(652).normaliseOptions,a=n(289).isMediaStreamTrack,c=n(148),u=n(9),l=n(141),d=n(290).default,h=n(7),p=n(47),f=n(13)(),m=n(291).isValidVideoContentHint,g=n(6),b=n(149),y=n(3),v=n(263);e.exports=function(e){void 0===e&&(e={}),["deviceHelpers","getUserMediaHelper"].forEach(t=>{c(e[t],t+" dependency must be injected into processPubOptions")});const t=e.generateConstraintInfo||n(253),r=e.global||(void 0!==typeof window?window:global),w=e.logging||n(1)("processPubOptions"),S=e.navigator||r.navigator,E=e.screenSharing||n(161)(),T=e.env||y,x=n(653)({navigator:S||{}}),_=e,C=_.deviceHelpers,I=_.getUserMediaHelper;return(e,n,c)=>{var y,S,_;const R=s(e,n,w),k=b(R.videoSource),O=a(R.audioSource),Z=a(R.videoSource),A=!O&&null!==R.audioSource,V=!Z&&null!==R.videoSource,G=A||V,N=e=>"boolean"==typeof e,L=!k||O||v,W=l(R,{mirror:!k&&!Z,publishAudio:!0,publishVideo:!0,showControls:!0,fitMode:k?"contain":"cover",insertDefaultUI:!0,enableRenegotiation:!1,enableStereo:!1,enableDtx:!1,disableAudioProcessing:!1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),X=R.audioFallback,M=void 0===X?{}:X,F=R.audioFallbackEnabled;if(W.publisherAudioFallbackEnabled=null!=(y=M.publisher)&&y,W.subscriberAudioFallbackEnabled=null!=(S=null!=(_=M.subscriber)?_:F)?S:!k,void 0===W.videoContentHint||m(W.videoContentHint)||(w.warn(n+': Invalid content hint. Valid content hints are "text", "detail", "motion", or ""'),W.videoContentHint=""),W.name&&(W.name=String(W.name)),N(W.enableDtx)||(W.enableDtx=!1),N(W.enableStereo)||(W.enableStereo=!1),W.initials&&("string"!=typeof W.initials&&(W.initials=""),W.initials.length>2&&(W.initials="",w.warn("Publisher initials cleared. Only one or two characters allowed for publisher initials.")),W.initials=W.initials.toUpperCase()),W.constraints)w.warn(n+": You have passed your own constraints not using ours");else{const e=t(Object.assign({isScreenSharing:k,isCustomAudioTrack:O,isCustomVideoTrack:Z},p(W,["audioSource","publishAudio","videoSource","publishVideo","resolution","maxResolution","frameRate","facingMode","enableRenegotiation","enableStereo","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl"]),{env:T,usingOptionalMandatoryStyle:x(k)}));u(W,e)}const P={isScreenSharing:k,isCustomAudioTrack:O,isCustomVideoTrack:Z,shouldAllowAudio:L,properties:W};return g(P),P.getUserMedia=(0,o.default)(i.default.mark((function e(){var t,s,a,u,l,p,m,g,b;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogOpened",...t)},s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogClosed",...t)},G){e.next=7;break}return a=new r.MediaStream,O&&a.addTrack(R.audioSource),Z&&a.addTrack(R.videoSource),e.abrupt("return",a);case 7:if(!k){e.next=15;break}return e.next=10,E.getConstraints({onAccessDialogOpened:t,onAccessDialogClosed:s,videoSource:R.videoSource,constraints:W.constraints});case 10:if(W.constraints=e.sent,!c()){e.next=13;break}throw f(h.CANCEL,new Error("getUserMedia request was aborted"));case 13:e.next=25;break;case 15:return e.next=17,C.shouldAskForDevices();case 17:if(u=e.sent,!c()){e.next=20;break}throw f(h.CANCEL,new Error("getUserMedia request was aborted"));case 20:w.debug(n+": shouldAskForDevices:",u),u.video||(w.warn(n+": Setting video constraint to false, there are no video sources"),W.constraints.video=!1),u.audio||(w.warn(n+": Setting audio constraint to false, there are no audio sources"),W.constraints.audio=!1),P.videoDevices=u.videoDevices,P.audioDevices=u.audioDevices;case 25:if(l=W.constraints,w.debug(n+": onConstraintsFound",l),!c()){e.next=29;break}throw f(h.CANCEL,new Error("getUserMedia request was aborted"));case 29:return p="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=188088",m="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=204106",g=e=>"NotReadableError"===e.originalName&&"Failed starting capture of a video track"===e.originalMessage,b=function(){var e=(0,o.default)(i.default.mark((function e(){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=I(l,k)).on("accessDialogOpened",t),r.on("accessDialogClosed",s),e.prev=3,e.next=6,r;case 6:if(o=e.sent,!(T.isiOS&&W.publishVideo&&o.getVideoTracks().length&&"ended"===o.getVideoTracks()[0].readyState)){e.next=11;break}throw o.getTracks().forEach(e=>e.stop()),new Error(p);case 11:return e.abrupt("return",o);case 14:if(e.prev=14,e.t0=e.catch(3),!T.isiOS){e.next=34;break}if(!(g(e.t0)&&T.iOSVersion>=13&&T.iOSVersion<13.4)){e.next=32;break}return e.prev=18,a=I({audio:!0,video:!1},!1),e.next=22,a;case 22:e.sent.getTracks().forEach(e=>e.stop()),e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),w.debug(n+": error disposing audio track",e.t1);case 29:throw new Error(m);case 32:if(e.t0.name!==h.HARDWARE_UNAVAILABLE){e.next=34;break}throw new Error(p);case 34:throw e.t0;case 35:return e.prev=35,setTimeout(()=>{r.off("accessDialogOpened",t),r.off("accessDialogClosed",s)}),e.finish(35);case 38:case"end":return e.stop()}}),e,null,[[3,14,35,38],[18,26]])})));return function(){return e.apply(this,arguments)}}(),e.next=35,d(b,(e,t)=>!(![p,m].includes(e.message)||1!==t||c())&&1e3)();case 35:if(a=e.sent,!c()){e.next=39;break}throw a.getTracks().forEach(e=>{e.stop()}),f(h.CANCEL,new Error("getUserMedia request was aborted"));case 39:return O&&a.addTrack(R.audioSource),Z&&a.addTrack(R.videoSource),e.abrupt("return",a);case 42:case"end":return e.stop()}}),e)}))),P}}},function(e,t,n){"use strict";const r=n(289).isMediaStreamTrack,i=n(37),o=n(3);t.normaliseOptions=(e,t,n)=>{const s=e&&"object"==typeof e?i(e):{};if(!1===s.audioSource&&(s.audioSource=null),!1===s.videoSource&&(s.videoSource=null),void 0===s.minVideoBitrate||"number"==typeof s.minVideoBitrate&&s.minVideoBitrate>0||(n.warn(t+": Invalid minVideoBitrate in publisher properties. minVideoBitrate must be a positive number"),delete s.minVideoBitrate),void 0===s.audioBitrate||s.audioBitrate>=6e3&&s.audioBitrate<=51e4||(n.warn(t+": Invalid audioBitrate in publisher properties. audioBitrate must be a number between 6000 and 510000 bits per second"),delete s.audioBitrate),"Firefox"===o.name&&o.version<49){const e="Firefox 48 and below";r(s.audioSource)&&(s.audioSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting audioSource to null`)),r(s.videoSource)&&(s.videoSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting videoSource to null`))}return s}},function(e,t,n){"use strict";const r=n(3),i=r.name,o=r.version,s=n(257);e.exports=function(e){let t=(void 0===e?{}:e).navigator,n=void 0===t?window.navigator:t;return function(e){return e&&!s||!(n.mediaDevices&&n.mediaDevices.getUserMedia)||"Chrome"===i&&o<61}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={}),["processPubOptions"].forEach(t=>{if(!e[t])throw new Error(t+" dependency must be injected into OT.getUserMedia")});const t=e.logging||n(1)("getUserMedia"),r=e.processPubOptions;return function(e){void 0===e&&(e={});return r(e,"OT.getUserMedia",()=>!1).getUserMedia().catch(e=>{throw t.error("OT.getUserMedia failed to getUserMedia: "+e),e})}}},function(e,t,n){"use strict";e.exports=function(e,t){const n=(t,n)=>()=>{throw new Error(`Cannot ${t} ${n}, ${e} is destroyed`)};Object.keys(t).forEach(e=>{"function"==typeof t[e]?t[e]=n("call",e):Object.defineProperty(t,e,{get:n("get",e),set:n("set",e)})})}},function(e,t,n){"use strict";e.exports=e=>{if("srcObject"in e)return;const t=window&&window.URL;"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(e,"srcObject",{get(){return this._srcObject},set(e){const n=this;if(this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e)return this.src=t.createObjectURL(e),e.addEventListener("addtrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),this._srcObject;this.src=""}})}},function(e,t,n){"use strict";e.exports=e=>{return!(!(t=e)||"function"!=typeof t.getBoundingClientRect)&&(e=>{const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,i=t.top<=n&&t.top+t.height>=0,o=t.left<=r&&t.left+t.width>=0;return i&&o})(e)&&(e=>{const t=e=>!(!e.style||"hidden"!==e.style.visibility)||!!e.parentNode&&t(e.parentNode);return null!==e.offsetParent&&!t(e)})(e);var t}},function(e,t,n){"use strict";const r=n(105),i=n(8),o={0:"rotate(0deg)",270:"rotate(90deg)",90:"rotate(-90deg)",180:"rotate(180deg)"};e.exports=function(e,t,n){let s=n;r(e,{isRotated:{get(){return this.orientation()&&(270===this.orientation().videoOrientation||90===this.orientation().videoOrientation)}},orientation:{get:()=>s,set(n){s=n;const r=o[n.videoOrientation]||o.ROTATED_NORMAL;switch(i.env.name){case"Chrome":case"Safari":t().style.webkitTransform=r;break;default:t().style.transform=r}e.trigger("orientationChanged",s)}},audioChannelType:{get(){return"mozAudioChannelType"in this.domElement?this.domElement.mozAudioChannelType:"unknown"},set(e){"mozAudioChannelType"in this.domElement&&(this.domElement.mozAudioChannelType=e)}}})}},function(e,t,n){"use strict";e.exports=function(){return function(e,t,n){const r=[];function i(i){setTimeout(()=>{if(r.length)if(function(e){return e.getTracks().every(e=>"ended"===e.readyState)}(e))s(),"function"==typeof t&&t();else{const e=i.target;o(e),"function"==typeof n&&n(e)}},100)}function o(e){e.onended===i&&(e.onended=null);const t=r.indexOf(e);t>=0&&r.splice(t,1)}function s(){r.slice().forEach(o)}function a(){e.getTracks().forEach(e=>{r.push(e),e.onended=i})}return a(),{stop:s,refresh:()=>{s(),a()}}}}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(18)),o=r(n(1)),s=r(n(108)),a=n(74);const c=(0,o.default)("AudioFallbackState");var u=()=>{const e=new i.default;let t=a.CongestionLevels.LOW,n=s.default.ACTIVE_VIDEO;const r=t=>{n=t,e.emit("stateChange",{state:t})},o={[a.CongestionLevels.LOW]:()=>{t=a.CongestionLevels.LOW,r(s.default.ACTIVE_VIDEO)},[a.CongestionLevels.MEDIUM]:()=>{t===a.CongestionLevels.LOW&&r(s.default.ACTIVE_VIDEO_WITH_WARNING),t=a.CongestionLevels.MEDIUM},[a.CongestionLevels.CRITICAL]:()=>{t=a.CongestionLevels.CRITICAL,r(s.default.SUSPENDED_VIDEO)}};return Object.assign(e,{setCongestionLevel(e){if(this.congestionLevel===e)return void c.warn("Congestion level already set: "+e);const t=o[e];t?t():c.warn("Invalid congestion level: "+e)},getState:()=>({videoState:n,congestionLevel:t}),setState(e){n=e.videoState,t=e.congestionLevel},reset(){t=a.CongestionLevels.LOW,n=s.default.ACTIVE_VIDEO}})};t.default=u},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(662)),o=r(n(663)),s=r(n(664)),a=r(n(666)),c=r(n(667));const u=n(18);var l=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});const n=new u,r=e,l=r.videoResolution,d=r.getStats,h=t,p=h.createMovingAverageTracker,f=void 0===p?a.default:p,m=h.createTimeBasedCongestionLevel,g=void 0===m?i.default:m,b=h.createBasicCongestionLevel,y=void 0===b?o.default:b,v=h.getFairQualityBandwidthForResolution,w=void 0===v?c.default:v,S=h.CongestionLevelStats,E=void 0===S?s.default:S,T={bandwidthFairThreshold:w(l)},x=g(T),_=y(T),C=f(),I=f(),R=f(),k=()=>{const e=x.getLevel({bandwidth:R.getMovingAverageValue(),audioPacketLoss:C.getMovingAverageValue()}),t=_.getLevel({bandwidth:R.getMovingAverageValue(),audioPacketLoss:C.getMovingAverageValue()}),r=Math.max(e,t);n.emit("congestionLevel",r)},O=new E(d);return O.on("statsAvailable",e=>{(e=>{let t=e.audioPacketLoss,n=e.videoPacketLoss,r=e.bandwidth;C.addValue(t),I.addValue(n),R.addValue(r),k()})(e)}),Object.assign(n,{start(){O.start()},stop(){O.stop()}})};t.default=l},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(297)),o=n(74);var s=function(e){void 0===e&&(e={});const t=Object.assign({},i.default,e);let n,r=!1;return{getLevel(e){if(e.audioPacketLoss<t.packetLossCriticalThreshold)return r=!1,o.LOW;const i=Date.now();return r||(n=i,r=!0),i>n+t.criticalCongestionPeriod?o.CRITICAL:i>n+t.criticalCongestionPeriod/2?o.MEDIUM:o.LOW}}};t.default=s},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(297)),o=n(74);var s=function(e){void 0===e&&(e={});const t=Object.assign({},i.default,e);return{getLevel(e){let n,r=e.bandwidth,i=e.audioPacketLoss;if(r<=0)return n=i>t.packetLossCriticalThresholdMediumBw?o.CRITICAL:o.LOW,n;if(n=r>=t.bandwidthFairThreshold?o.LOW:r>=t.bandwidthCriticalThreshold?r>=(t.bandwidthCriticalThreshold+t.bandwidthFairThreshold)/2?i>2*t.packetLossCriticalThresholdMediumBw?o.CRITICAL:o.MEDIUM:i>t.packetLossCriticalThresholdMediumBw?o.CRITICAL:o.MEDIUM:i>t.packetLossCriticalThreshold?o.CRITICAL:o.MEDIUM,void 0===n)throw new Error("undefined congestion level");return n}}};t.default=s},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n(665));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}const o=n(18);var s=function(e,t){void 0===t&&(t={});const n=t.StatsUtils||r,i=new o;let s;const a=()=>{e((e,t)=>{e||(e=>{const t=n.parseStats(e);if(!s)return void(s=t);const r=n.getAudioPacketLoss(t,s),o=n.getVideoPacketLoss(t,s),a=t.bandwidth;s=t,i.emit("statsAvailable",{audioPacketLoss:r,videoPacketLoss:o,bandwidth:a})})(t)})};let c;return Object.assign(i,{start(){c=setTimeout(()=>{a(),c=setInterval(()=>{a()},500)},1e3)},stop(){clearInterval(c)}})};t.default=s},function(e,t,n){"use strict";t.__esModule=!0,t.parseStats=t.getVideoResolution=t.getVideoPacketStats=t.getVideoPacketLoss=t.getBandwidth=t.getAudioPacketStats=t.getAudioPacketLoss=void 0;const r=(e,t)=>{const n=e.filter(e=>{let n=e.type,r=e.kind;return"outbound-rtp"===n&&r===t}),r=e.filter(e=>{let n=e.type,r=e.kind;return"remote-inbound-rtp"===n&&r===t});return{packetsSent:n.reduce((e,t)=>e+t.packetsSent,0),packetsLost:r.reduce((e,t)=>e+t.packetsLost,0)}};t.getVideoResolution=e=>e.filter(e=>{let t=e.type,n=e.kind;return"outbound-rtp"===t&&"video"===n}).reduce((e,t)=>({width:Math.max(e.width,t.frameWidth),height:Math.max(e.height,t.frameHeight)}),{width:0,height:0});const i=e=>{const t=r(e,"audio"),n=t.packetsSent;return{audioPacketsLost:t.packetsLost,audioPacketsSent:n}};t.getAudioPacketStats=i;const o=e=>{const t=r(e,"video"),n=t.packetsSent;return{videoPacketsLost:t.packetsLost,videoPacketsSent:n}};t.getVideoPacketStats=o;const s=e=>e.find(e=>"candidate-pair"===e.type).availableOutgoingBitrate;t.getBandwidth=s;t.parseStats=e=>{const t=i(e),n=t.audioPacketsSent,r=t.audioPacketsLost,a=o(e),c=a.videoPacketsSent,u=a.videoPacketsLost;return{bandwidth:s(e),audioPacketsSent:n,audioPacketsLost:r,videoPacketsSent:c,videoPacketsLost:u}};const a=(e,t,n)=>{const r=t[e+"PacketsSent"]-n[e+"PacketsSent"],i=t[e+"PacketsLost"]-n[e+"PacketsLost"];return o=i,0===(s=r)?0:o/s;var o,s};t.getAudioPacketLoss=(e,t)=>a("audio",e,t);t.getVideoPacketLoss=(e,t)=>a("video",e,t)},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(e){void 0===e&&(e=0);let t,n=e,r=1e4;return{setPeriod(e){r=e},getMovingAverageValue:()=>n,addValue(e){const i=(()=>{const e=Date.now();if(!t)return t=e,1;const n=e-t,i=1-Math.exp(-n/r);return t=e,i})();n=e*i+n*(1-i)}}};t.default=r},function(e,t,n){"use strict";const r=[{width:"320",height:"180",fairQualityBitrate:12e4},{width:"320",height:"240",fairQualityBitrate:12e4},{width:"352",height:"288",fairQualityBitrate:125e3},{width:"480",height:"270",fairQualityBitrate:125e3},{width:"640",height:"360",fairQualityBitrate:15e4},{width:"640",height:"480",fairQualityBitrate:15e4},{width:"960",height:"540",fairQualityBitrate:15e4},{width:"1280",height:"720",fairQualityBitrate:4e5},{width:"1920",height:"1080",fairQualityBitrate:5e5}].sort((e,t)=>e.fairQualityBitrate-t.fairQualityBitrate),i=r.reduce((e,t)=>{let n=t.fairQualityBitrate;return Math.max(e,n)},25e4);e.exports=(e,t)=>{var n;if(!e||!t)return 25e4;return(null==(n=r.find(n=>{let r=n.height,i=n.width;return t*e<=r*i}))?void 0:n.fairQualityBitrate)||i}},function(e,t,n){"use strict";const r=e=>e>=15&&e<15.4;e.exports=e=>!!(e=e||n(3)).isiPad||(e.isiPhone?r(e.iOSVersion):!!e.isSafari&&r(e.version))},function(e,t,n){"use strict";const r=[{width:320,height:180,maxBitrate:3e5},{width:320,height:240,maxBitrate:4e5},{width:352,height:288,maxBitrate:5e5},{width:480,height:270,maxBitrate:55e4},{width:640,height:360,maxBitrate:8e5},{width:640,height:480,maxBitrate:8e5},{width:960,height:540,maxBitrate:11e5},{width:1280,height:720,maxBitrate:25e5},{width:1920,height:1080,maxBitrate:45e5}].sort((e,t)=>e.maxBitrate-t.maxBitrate);e.exports=(e,t)=>{var n;if(!e||!t)return 45e5;return(null==(n=r.find(n=>{let r=n.height,i=n.width;return t*e<=r*i}))?void 0:n.maxBitrate)||45e5}},function(e,t,n){var r=n(62),i=n(99),o=n(35);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},function(e,t,n){"use strict";e.exports=function(e,t){const n=setTimeout(()=>{e((e,n)=>{if(!e)for(let e=0;e<n.length;e+=1){const r=n[e];-1===r.id.indexOf("_send")||"ssrc"!==r.type||"audio"!==r.kind&&"audio"!==r.mediaType||0!==parseInt(r.bytesSent,10)||t()}})},3e3);return function(){clearTimeout(n)}}},function(e,t,n){"use strict";const r=n(6),i=n(301),o=n(15);e.exports=function(){return function(e,t){const n={},s=[];let a=!1,c=!1;this._id=o();const u=()=>{this.trigger("iceConnected"),a=!0};r(this);const l=t.getPeerConnection(e,this);l.on({iceConnected:u,close:()=>this.trigger("close"),signalingStateChange:e=>this.trigger("signalingStateChange",e),signalingStateStable:e=>this.trigger("signalingStateStable",e),error:e=>{let t=e.reason,n=e.prefix;return this.trigger("error",t,n)},qos:e=>this.trigger("qos",e),iceConnectionStateChange:e=>this.trigger("iceConnectionStateChange",e),remoteVideoSupported:e=>this.trigger("remoteVideoSupported",e),negotiationNeeded:()=>{c&&(c=!1,t.removeFromSinglePeerConnection(this._id))}},this);this._onTrackAdded=e=>{const t=e.track,r=e.transceiver;n[t.id]=r.mid,s.push(t),l.iceConnectionStateIsConnected()&&!a&&u(),this.trigger("trackAdded",e)},this.disconnect=()=>{c=!0,t.removeSubscriber(this._id,Object.values(n))},this.removeTrack=e=>{n[e.id]&&t.removeSubscriber(this._id,[n[e.id]]),i(s,e),t.removeTrack(e,this._id)},this.remoteTracks=()=>s,this.generateOfferAndSend=()=>l.generateOfferAndSend(),this.getDataChannel=(e,t,n)=>{l.getDataChannel(e,t,n)},this.getSourceStreamId=()=>l.getSourceStreamId(),this.processMessage=(e,n)=>{"offer"!==e&&"answer"!==e||t.cacheOfferAnswer(n.content),l.processMessage(e,n)},this.remoteDescription=()=>l.remoteDescription(),this.getStats=e=>{l.getStats(e)},this.getSynchronizationSources=e=>{l.getSynchronizationSources(e)},this.getRtcStatsReport=e=>{l.getRtcStatsReport(e)},this.remoteStreams=()=>l.remoteStreams(),this.hasRelayCandidates=()=>l.hasRelayCandidates(),this.iceRestart=()=>l.iceRestart(),this.iceConnectionStateIsConnected=()=>l.iceConnectionStateIsConnected()}}},function(e,t,n){"use strict";e.exports=function(e,t,n){void 0===n&&(n=!1);let r=null,i=0,o=null,s=n;const a=e=>"inbound-rtp"===e.type&&"audio"===(e.kind||e.mediaType),c=e=>e.id===o&&"track"===e.type&&"audio"===(e.kind||e.mediaType),u=setInterval(()=>{e((e,n)=>{if(e)return;const l=n.find(a)||{};o=l.trackId;const d=n.find(c);if(d){const e=d.audioLevel,n=d.totalSamplesReceived;if(void 0===e)return;((e,t)=>e===r&&t===i)(e,n)?(clearInterval(u),t("audioLevelStuck")):((e,t)=>!s&&0===e&&0===r&&t>i)(e,n)&&(clearInterval(u),t("audioLevelStuckAt0")),r=e,i=n}})},500);return n||setTimeout(()=>{s=!0},3e3),{stop:()=>{clearInterval(u)}}}},function(e,t,n){"use strict";(function(t){const r=new(n(20));e.exports=function(e){void 0===e&&(e={});const i=e.analytics||r,o=e.errors||n(7),s=e.ExceptionCodes||n(10),a=e.otError||n(13)(),c=e.sessionObjects||n(21),u=e.uuid||n(15);return function(e){void 0===e&&(e=()=>{});const n=u();function r(t){t?e(a(o.REPORT_ISSUE_FAILED,new Error("Error calling OT.reportIssue(). Check the client's network connection."),s.REPORT_ISSUE_ERROR)):e(null,n)}0===c.sessions.length()?i.logEvent({action:"ReportIssue",variation:"Event",payload:{reportIssueId:n}},null,r):t.all(c.sessions.map(e=>e.reportIssue({id:n}))).then(()=>r(),e=>r(e))}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>{let t=e.window,n=!1;try{const e=Object.defineProperty({},"passive",{get(){n=!0}});t.addEventListener("testPassive",null,e),t.removeEventListener("testPassive",null,e)}catch(e){}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(303),s=(r=o)&&r.__esModule?r:{default:r};var a=function(){},c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.internalIsCanceled=!1,this.listeners=[]}return i(e,[{key:"isCanceled",value:function(){return this.internalIsCanceled}},{key:"cancel",value:function(){this.internalIsCanceled||(this.internalIsCanceled=!0,this.listeners.forEach((function(e){return e()})),this.listeners=null)}},{key:"throwIfCanceled",value:function(){if(this.internalIsCanceled)throw new s.default("Operation has been canceled.")}},{key:"onCancel",value:function(e){var t=this;return this.internalIsCanceled?a:(this.listeners.push(e),function(){if(t.listeners){var n=t.listeners.indexOf(e);-1!==n&&t.listeners.splice(n,1)}})}},{key:"fork",value:function(){if(this.internalIsCanceled)return e.CANCELED;var t=new e;return this.onCancel((function(){return t.cancel()})),t}}]),e}();t.default=c,c.CANCELED=new c,c.CANCELED.internalIsCanceled=!0},function(e,t,n){"use strict";(function(t){const r=n(61),i=n(304).default,o=n(154);n(109)();e.exports=function(e,n){const s=r(e),a=new t(t=>{const n=()=>{(e.videoWidth()>2||e.videoHeight()>2)&&t(!0)};s.on("videoDimensionsChanged",n),n()});return i(o(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(61),i=n(304).default,o=n(154);n(109)();e.exports=function(e,n){void 0===n&&(n=5e3);const s=r(e),a=new t(e=>{s.on("timeupdate",e),s.on("loadedmetadata",e)});return i(o(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(1)("WidgetView:fixMini");e.exports=function(e){const t=e.clientWidth,n=e.clientHeight;e.classList.remove("OT_micro"),e.classList.remove("OT_mini"),(t<64||n<64)&&(e.classList.add("OT_micro"),r.debug("OT_micro class added",{clientWidth:t,clientHeight:n,microWidth:64,microHeight:64})),(t<128||n<128)&&(e.classList.add("OT_mini"),r.debug("OT_mini class added",{clientWidth:t,clientHeight:n,miniWidth:128,miniHeight:128}))}},function(e,t,n){"use strict";const r=n(15);e.exports=function(e,t){let n,i;if(e&&e.nodeName?(n=e,n.getAttribute("id")&&0!==n.getAttribute("id").length||n.setAttribute("id","OT_"+r()),i=n.getAttribute("id")):e&&(n=document.getElementById(e),n&&(i=e)),i||(i="OT_"+r().replace(/-/g,"_")),!n)return n=document.createElement("div"),n.id=i,n.setAttribute("id",i),n.style.backgroundColor="#000000",document.body.appendChild(n),n;const o=document.createElement("div");switch(o.id="OT_"+r(),t){case"append":return n.appendChild(o),o;case"before":return n.parentNode.insertBefore(o,n),o;case"after":return n.parentNode.insertBefore(o,n.nextSibling),o;case"replace":default:for(;n.firstChild;)n.removeChild(n.firstChild);return n}}},function(e,t,n){"use strict";e.exports=function(e,t){return void 0===t&&(t="px"),String(parseFloat(e,10))===String(e).trim()?`${String(e).trim()}${t}`:e}},function(e,t,n){"use strict";e.exports=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("viewBox","0 0 300 300"),t.setAttribute("style","width: 50%; dominant-baseline: middle; text-anchor: middle;");const n=(()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","circle");return e.setAttribute("cx","50%"),e.setAttribute("cy","50%"),e.setAttribute("r","50%"),e.setAttribute("fill","%23000000"),e})(),r=(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("x","50%"),t.setAttribute("y","50%"),t.setAttribute("dy","5%"),t.setAttribute("line-height","133%"),t.setAttribute("font-size","108"),t.setAttribute("font-weight","500"),t.setAttribute("font-style","normal"),t.setAttribute("fill","%23FFFFFF"),t.setAttribute("font-family","spezia,sans-serif"),t.setAttribute("dominant-baseline","middle"),t.setAttribute("text-anchor","middle");const n=document.createTextNode(e);return t.appendChild(n),t})(e);return t.appendChild(n),t.appendChild(r),t}},function(e,t,n){"use strict";(function(t){const r=n(73);e.exports=function(e,n){let i=void 0===n?{}:n,o=i.frequency,s=void 0===o?60:o,a=i.timeout,c=void 0===a?2e3:a;return new t((t,n)=>{let i;const o=new r(()=>{(function(){try{return e()}catch(e){return!1}})()&&(clearTimeout(i),o.stop(),t())},s);i=setTimeout(()=>{o.stop(),n(new Error("TIMEOUT"))},c),o.start()})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(13)(),i=n(7),o=n(10);e.exports=e=>"404"===String(e.code)?r(i.STREAM_NOT_FOUND,new Error("stream not found"),o.UNABLE_TO_SUBSCRIBE):"409"===String(e.code)&&"streamLimitExceeded"===e.message?r(i.STREAM_LIMIT_EXCEEDED,new Error("The limit for concurrent streams in the session has been reached"),o.STREAM_LIMIT_EXCEEDED):"405"===String(e.code)&&"IncompatibleEncryptionSettings"===e.message?r(i.UNABLE_TO_SUBSCRIBE,new Error("Tried to subscribe to an encrypted stream without enabling encryption"),o.UNABLE_TO_SUBSCRIBE):"500"===String(e.code)&&"Not connected."===e.message?r(i.UNABLE_TO_SUBSCRIBE,new Error("Tried to subscribe to a stream while disconnected."),o.UNABLE_TO_SUBSCRIBE):r(i.UNABLE_TO_SUBSCRIBE,new Error(`subscriberCreate failed with unexpected code ${e.code}: ${e.message}`),o.UNEXPECTED_SERVER_RESPONSE)},function(e,t,n){"use strict";const r=n(26),i=n(49),o=n(104),s=n(23)();e.exports=e=>{let t=e.subscriber,n=e.audioLevelSampler,a=0,c=0;const u=new o(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);i()-c>1e4&&0===e?u.stop():(a=n.sample(),e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(a)))});return Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=i(),a),set(){throw new TypeError("Cannot set readonly property loudness")},configurable:!0}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.SUBSCRIBER_DESTROYED,()=>{u.stop()}),{destroy(){n.destroy(),u.stop()}}}},function(e,t,n){"use strict";const r=n(252),i=n(146),o=n(687),s=n(306),a=n(307),c=n(158)(),u=n(688),l=n(1)("Subscriber");e.exports=function(e,t){void 0===t&&(t={});const n=t.hasGetSynchronizationSupport;if(e){if(o({hasGetSynchronizationSupport:n}))return new r(e.getSynchronizationSources);if(s())return new r(e.getStats);if(a()){let e;try{e=t.audioContext||c()}catch(e){l.warn("Failed to get AudioContext()",e)}if(u(e))return new i(e)}}}},function(e,t,n){"use strict";const r=n(3),i=()=>window.RTCRtpReceiver&&"getSynchronizationSources"in window.RTCRtpReceiver.prototype;e.exports=function(e){void 0===e&&(e={});const t=e.hasGetSynchronizationSupport||i;return"boolean"==typeof e.isEnabled&&e.isEnabled&&t()&&!r.isFirefox}},function(e,t,n){"use strict";e.exports=e=>(void 0!==typeof window?window:global).AudioContext&&e instanceof(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext&&e instanceof(void 0!==typeof window?window:global).webkitAudioContext},function(e,t,n){"use strict";const r=n(36),i=n(8);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;i.removeClass(e,["OT_audio-blocked","OT_active"].join(" ")),n&&(t&&i.addClass(e,"OT_audio-blocked"),i.addClass(e,"OT_active"))};this.setAudioBlocked=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_audio-blocked-indicator"}});const o=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{o(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(36),i=n(8);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;i.removeClass(e,["OT_active"].join(" ")),n&&t&&i.addClass(e,"OT_active")};this.setVideoUnsupported=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_video-unsupported"},htmlContent:'<div class="OT_video-unsupported-bar"></div><div class="OT_video-unsupported-img"></div><span class="OT_video-unsupported-text">Video format not supported</span>'});const o=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{o(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(47),i=n(9),o=n(60),s=n(75),a=n(157);e.exports=function(e,t){let n;void 0===t&&(t=5e3);let c=!1;const u={},l=()=>{c||e((e,a)=>{if(!c){if(!e){const e=function(e){return void 0===e&&(e=[]),o(e,e=>s.isVideoInboundRtpStat(e))}(a);e?i(u,r(e,["timestamp","framesDecoded"])):u.timestamp||i(u,{timestamp:Date.now(),framesDecoded:0})}n=setTimeout(l,t)}})};return l(),{getFrameRateFromStat:e=>a({currentStatFrames:e.framesDecoded,currentTimestamp:e.timestamp,prevStatFrames:u.framesDecoded,prevTimestamp:u.timestamp}),destroy(){c=!0,n&&(clearTimeout(n),n=null)}}}},function(e,t,n){"use strict";e.exports=e=>{let t=e.connectivityState,n=e.onWarning,r=e.onTimeout,i=e.warningMs,o=e.timeoutMs;const s=[],a=()=>{s.forEach(e=>clearTimeout(e))};t.observe({onEnterConnecting(){s.push(setTimeout(n,i),setTimeout(r,o))},onEnterConnected:a,onEnterDisconnected:a})}},function(e,t,n){"use strict";const r=n(310);e.exports=e=>{let t=e.onInvalidTransition;return new r({init:"disconnected",transitions:[{name:"beginConnect",from:"disconnected",to:"connecting"},{name:"connect",from:"connecting",to:"connected"},{name:"fail",from:["connecting","connected"],to:"disconnected"},{name:"cancel",from:["connecting","connected"],to:"disconnected"},{name:"disconnect",from:["connecting","connected"],to:"disconnected"}],methods:{onInvalidTransition:t}})}},function(e,t,n){"use strict";const r=n(73);e.exports=e=>{let t=e.connectivityState,n=e.logAttempt;const i=new r(n,.2,6);t.observe({onEnterConnecting(){i.start()},onEnterDisconnected(){i.stop()},onEnterConnected(){i.stop()}})}},function(e,t){e.exports=function(e){if(null==e)throw new TypeError("Cannot destructure undefined")}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),s=r(n(18)),a=r(n(698)),c=r(n(108)),u=r(n(699)),l=n(74);const d=c.default.ACTIVE_VIDEO,h=c.default.ACTIVE_VIDEO_WITH_WARNING,p=c.default.SUSPENDED_VIDEO;var f=e=>{let t=e.getAllPeerConnections,n=e.setEncodersActiveState,r=void 0===n?u.default:n;const c=new s.default,f=(0,a.default)();f.on("stateChange",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.emit("stateChange",...t)}));const m=function(){var e=(0,o.default)(i.default.mark((function e(){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:n=e.sent,r=n.reduce((e,t)=>{var n;return Math.max(e,null==(n=t.getAudioFallbackState())?void 0:n.videoState)},d),f.setState(r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object.assign(c,{onPeerConnectionStateChange:e=>{let t=e.state,n=e.peerConnection,i=e.publishVideo,o=e.stream,s=e.peerId;if(i){const e="MANTIS"===n.getSourceStreamId()?void 0:s;switch(t){case d:r(n,!0),o.setChannelActiveState("video",!0,"auto",l.LOW,e);break;case h:o.setChannelActiveState("video",!0,"auto",l.MEDIUM,e);break;case p:r(n,!1),o.setChannelActiveState("video",!1,"auto",l.CRITICAL,e)}}m()},onPeerConnectionDisconnected:()=>{m()},reset:()=>f.reset(),getState:()=>f.getState()})};t.default=f},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(18)),o=r(n(108));var s=()=>{const e=new i.default;let t=o.default.ACTIVE_VIDEO;return Object.assign(e,{getState:()=>t,setState(n){if(!Object.values(o.default).includes(n))throw new Error("Invalid video state: ",n);if(n===t)return;const r=t;t=n,e.emit("stateChange",{state:t,previousState:r})},reset(){t=o.default.ACTIVE_VIDEO}})};t.default=s},function(e,t,n){"use strict";e.exports=(e,t)=>{const n=e.getSenders().find(e=>"video"===e.track.kind),r=n.getParameters();r.encodings.forEach(e=>{e.active=t}),n.setParameters(r)}},function(e,t,n){var r=n(701),i=n(259),o=r((function(e,t,n){return e+(n?" ":"")+i(t)}));e.exports=o},function(e,t,n){var r=n(702),i=n(703),o=n(706),s=RegExp("['’]","g");e.exports=function(e){return function(t){return r(o(i(t).replace(s,"")),e,"")}}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t,n){var r=n(704),i=n(59),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(s,"")}},function(e,t,n){var r=n(705)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(707),i=n(708),o=n(59),s=n(709);e.exports=function(e,t,n){return e=o(e),void 0===(t=n?void 0:t)?i(e)?s(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",i="\\d+",o="[\\u2700-\\u27bf]",s="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",d="(?:"+s+"|"+a+")",h="(?:"+l+"|"+a+")",p="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",f="[\\ufe0e\\ufe0f]?"+p+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,u].join("|")+")[\\ufe0e\\ufe0f]?"+p+")*"),m="(?:"+[o,c,u].join("|")+")"+f,g=RegExp([l+"?"+s+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,l,"$"].join("|")+")",h+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,l+d,"$"].join("|")+")",l+"?"+d+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,m].join("|"),"g");e.exports=function(e){return e.match(g)||[]}},function(e,t,n){"use strict";const r=n(47),i=n(268),o=n(314);e.exports=e=>{const t=r(e,["audioDeviceId","audioFallback","audioFallbackEnabled","audioSource","channels","classNames","constraints","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl","enableRenegotiation","enableStereo","facingMode","fitMode","frameRate","height","insertDefaultUI","insertMode","audioBitrate","maxResolution","minVideoBitrate","mirror","name","publishAudio","publishVideo","publishCaptions","resolution","scalableScreenshare","scalableVideo","showControls","style","videoContentHint","videoDeviceId","videoDimensions","videoFilter","videoSource","width"]);return t.style&&(t.style=i(t.style)),t.videoFilter&&(t.videoFilter=o(t.videoFilter)),t}},function(e,t,n){"use strict";const r=n(26),i=n(49),o=n(104),s=n(23)();e.exports=e=>{let t=e.publisher,n=e.widgetView,a=0,c=0;const u=new o(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);if(i()-c>1e4&&0===e)return void u.stop();const o=n&&n.video();if(o){const n=o.getAudioInputLevel();a=n,e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(n))}});Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=i(),a),set(){throw new TypeError("Cannot set readonly property loudness")}}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.PUBLISHER_DESTROYED,()=>{u.stop()})}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));e.exports=function(e){let t=!1;return function(){var n=(0,o.default)(i.default.mark((function n(){var r,o,s,a=arguments;return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=2;break}throw new Error("The previous call to this function has not yet completed.");case 2:for(t=!0,n.prev=3,r=a.length,o=new Array(r),s=0;s<r;s++)o[s]=a[s];return n.next=7,e.call(this,...o);case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,t=!1,n.finish(8);case 11:case"end":return n.stop()}}),n,this,[[3,,8,11]])})));return function(){return n.apply(this,arguments)}}()}},function(e,t,n){"use strict";const r=n(13)(),i=n(7);e.exports=function(e){const t=document.createElement("canvas");if(!t.captureStream)throw r(i.NOT_SUPPORTED,new Error("Your browser does not support HTMLCanvasElement.captureStream()"));t.width=e.width,t.height=e.height,t.getContext("2d").fillRect(0,0,1,1);const n=t.captureStream().getVideoTracks()[0];return n.isCreatedCanvas=!0,n.enabled=!1,n}},function(e,t,n){"use strict";e.exports=(e,t)=>{if(!e)return null;const n=e.getVideoTracks()[0];return n?((e,t)=>(e=>e.getSettings&&e.getSettings().deviceId)(e)||(e=>{let t;return e.getConstraints&&e.getConstraints().deviceId&&(t=e.getConstraints().deviceId.exact),t})(e)||((e,t)=>{let n;if(t&&t.length){const r=t.find(t=>t.label===e.label);r&&(n=r.deviceId)}return n})(e,t))(n,t):null}},function(e,t,n){"use strict";const r=n(7),i=n(10),o=n(13)();e.exports=e=>{const t=String(e.code);return"405"===t&&"IncompatibleEncryptionSettings"===e.message?o(r.STREAM_CREATE_FAILED,new Error("IncompatibleEncryptionSettings: Tried to publish a stream to an encrypted session without enabling encryption"),i.UNABLE_TO_PUBLISH):["403","404","409"].includes(t)?o(r.STREAM_CREATE_FAILED,new Error("Failed to create stream in server model: "+e.message),i.UNABLE_TO_PUBLISH):o(r.UNEXPECTED_SERVER_RESPONSE,new Error("Unexpected server response: "+e.message),i.UNEXPECTED_SERVER_RESPONSE)}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(3),a=n(315),c=n(718),u=n(1)("MediaProcessor"),l=n(101).getProxyUrl;function d(e){var t=this;void 0===e&&(e={});const n=e,r=n.ML,s=void 0===r?a:r,d=n.MediaTransform,h=void 0===d?c:d,p=n.getProxyUrl,f=void 0===p?l:p;let m,g,b,y;this.isValidVideoFilter=e=>{const t=e.type;return h.isSupported(t)&&h.isValidConfig(e)},this.canUpdateVideoFilter=e=>["backgroundBlur","backgroundReplacement"].includes(e),this.updateVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.type,t.canUpdateVideoFilter(r)){e.next=4;break}return u.warn(`Ignoring: filter "${r}" doesn't support real-time updates`),e.abrupt("return");case 4:return o=h.getConfigurator(r),s=o.getConfig(Object.assign({proxyUrl:f()},n)),e.next=8,g.setBackgroundOptions(s);case 8:b=n;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.type,o=h.getConfigurator(r)){e.next=5;break}return u.warn(`Ignoring: filter "${r}" isn't supported`),e.abrupt("return");case 5:if(a=o.getConfig(Object.assign({proxyUrl:f()},n))){e.next=9;break}return u.warn("Ignoring: couldn't configure filter "+r),e.abrupt("return");case 9:if(!!!t.getVideoFilter()){e.next=20;break}return e.prev=11,e.next=14,t.destroy();case 14:e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(11),u.warn("Ignoring, couldn't remove previous filter: "+e.t0),e.abrupt("return");case 20:return e.next=22,s.createProcessor(a);case 22:return g=e.sent,e.next=25,g.getConnector();case 25:m=e.sent,b=n;case 27:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>b,this.getOriginalVideoTrack=()=>y,this.setMediaStream=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getVideoTracks(),r=n[0]){e.next=4;break}return u.warn("Ignoring. No video track found"),e.abrupt("return",null);case 4:return o=null,e.prev=5,e.next=8,m.setTrack(r);case 8:o=e.sent,y=r,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),u.error("Error setting media stream: "+e.t0);case 15:return e.abrupt("return",o);case 16:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t){return e.apply(this,arguments)}}(),this.setVideoTrack=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,m.setTrack(t);case 4:n=e.sent,y=t,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),u.error("Error setting video track: "+e.t0);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this._setConnector=e=>{m=e},this.destroy=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.destroy();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),u.warn("Error destroying connector: "+e.t0);case 8:m=null,b=null,y=null;case 11:case"end":return e.stop()}}),e,null,[[0,5]])}))),this.enableLogging=e=>{if(!e)return void u.warn("Error enabling logging: invalid API key");const t={appId:e,sourceType:"video"},n=f();n&&(t.proxyUrl=n),s.setMetadata(t)},this.disableLogging=()=>{s.setMetadata()}}d.isSupported=function(e){void 0===e&&(e={});const t=e,n=t.env,r=void 0===n?s:n,i=t.ML,o=void 0===i?a:i;return!!r.isChromium&&o.isSupported()},e.exports=d},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"ErrorFunction",(function(){return re})),n.d(t,"MediaProcessor",(function(){return ae})),n.d(t,"MediaProcessorConnector",(function(){return ue})),n.d(t,"PipelineInfoData",(function(){return ie})),n.d(t,"VonageSourceType",(function(){return k})),n.d(t,"WarningType",(function(){return ne})),n.d(t,"getVonageMetadata",(function(){return q})),n.d(t,"isSupported",(function(){return s})),n.d(t,"setVonageMetadata",(function(){return Q}));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);function s(){return 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()})}class a{}o(a,"updates",{transformer_new:"New transformer",transformer_null:"Null transformer"}),o(a,"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"});const c=new WeakMap,u=new WeakMap,l=new WeakMap,d=Symbol("anyProducer"),h=e.resolve(),p=Symbol("listenerAdded"),f=Symbol("listenerRemoved");let m=!1;function g(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function b(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function y(e,t){const n=u.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function v(e,t){const n="string"==typeof t||"symbol"==typeof t?t:d,r=l.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function w(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)v(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)v(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function S(e){if(void 0===e)return x;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!x.includes(t))throw"string"!=typeof t?new TypeError("`methodNames` element must be a string"):new Error(t+" is not Emittery method");return e}const E=e=>e===p||e===f;class T{static mixin(e,t){return t=S(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 T}),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 m;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||m}static set isDebugEnabled(e){m=e}constructor(e={}){c.set(this,new Set),u.set(this,new Map),l.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){(T.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){b(t),e=Array.isArray(e)?e:[e];for(const n of e)g(n),y(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),E(n)||this.emit(p,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){b(t),e=Array.isArray(e)?e:[e];for(const n of e)g(n),y(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),E(n)||this.emit(f,{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)g(t);return w(this,e)}async emit(t,n){g(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=l.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(d)){const t=e.all([n,r]);for(const e of i.get(d))e.enqueue(t)}}(this,t,n);const r=y(this,t),i=c.get(this),o=[...r],s=E(t)?[]:[...i];await h,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){g(e),this.logIfDebugEnabled("emitSerial",e,t);const n=y(this,e),r=c.get(this),i=[...n],o=[...r];await h;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 b(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),c.get(this).add(e),this.emit(p,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return w(this)}offAny(e){b(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(f,{listener:e}),c.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){y(this,t).clear();const e=v(this,t);for(const t of e)t.finish();e.clear()}else{c.get(this).clear();for(const e of u.get(this).values())e.clear();for(const e of l.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"&&g(n),t+=c.get(this).size;for(const e of u.get(this).values())t+=e.size;for(const e of l.get(this).values())t+=e.size}else t+=c.get(this).size+y(this,n).size+v(this,n).size+v(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=S(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 x=Object.getOwnPropertyNames(T.prototype).filter(e=>"constructor"!==e);Object.defineProperty(T,"listenerAdded",{value:p,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(T,"listenerRemoved",{value:f,writable:!1,enumerable:!0,configurable:!1});var _=T;function C(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 I=Object.defineProperty,R=(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),k=(e=>(e.automation="automation",e.test="test",e.vbc="vbc",e.video="video",e.voice="voice",e))(k||{});let O;const Z=new Uint8Array(16);function A(){if(!O&&(O=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!O))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(Z)}const V=[];for(let e=0;e<256;++e)V.push((e+256).toString(16).slice(1));const G={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function N(e,t,n){if(G.randomUUID&&!t&&!e)return G.randomUUID();const r=(e=e||{}).random||(e.rng||A)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase()}(r)}function L(e,t){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let n=globalThis.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const W=L("globals",{});var X=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(X||{});function M(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let F=0;function P(t,n,r,i,o){const s=F++;return t.postMessage({id:s,type:n,functionName:r,args:i},i.filter(e=>M(e))),new e(e=>{null==o||o.set(s,e)})}function j(e,t){const{id:n,type:r}=e,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>M(e)))}const U=L("workerized",{});function D(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function H(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],H(e[n],t[n])):"object"==typeof e[n]?(t[n]={},H(e[n],t[n])):t[n]=e[n]}const Y=L("registeredWorkers",{});function B(t,n){return W[t]||(W[t]=n),[()=>W[t],async n=>{W[t]=n,await async function(){if(D())j({type:X.GLOBALS_SYNC},W);else{const t=[];for(const e in U){const{worker:n,resolvers:r}=U[e].workerContext;n&&t.push(P(n,X.GLOBALS_SYNC,"",[W],r))}await e.all(t)}}()}]}D()&&function(){const e={};onmessage=async t=>{const n=t.data;switch(n.type){case X.INIT:!function(e,t){if(!e.args)throw"Missing className while initializing worker";const[n,r]=e.args,i=Y[n];if(!i)throw"unknown worker class "+n;t.instance=new i(e.args.slice(1)),H(r,W),j(e,void 0!==typeof t.instance)}(n,e);break;case X.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}`;j(e,await t.instance[n](...null!=r?r:[]))}(n,e);break;case X.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:[])),j(e,r)}(n,e);break;case X.GLOBALS_SYNC:!function(e){if(!e.args)throw"Missing globals while syncing";H(e.args[0],W),j(e,{})}(n)}}}();const[J,K]=B("metadata",z);var z;function Q(e){K(e)}function q(){return J()}class ${constructor(e){R(this,"uuid",N()),this.config=e}async send(e){var t,n,r;const{appId:i,sourceType:o}=null!=(t=q())?t:{};if(!i||!o)return"metadata missing";const s=new AbortController,a=setTimeout(()=>s.abort(),1e4);return await(null!=(r=null==(n=this.config)?void 0:n.fetch)?r:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(e)),signal:s.signal}),clearTimeout(a),"success"}getUrl(){var e;let t=null!=(e=q().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t}getHeaders(){return{"Content-Type":"application/json"}}buildReport(e){const t=q();return{guid:this.uuid,...e,applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType}}}const ee="2.0.3";class te{constructor(e){o(this,"frameTransformedCount",0),o(this,"frameFromSourceCount",0),o(this,"startAt",0),o(this,"reporter"),this.config=e,this.reporter=new $(e)}async onFrameFromSource(){this.frameFromSourceCount++}get fps(){const{startAt:e,frameFromSourceCount:t}=this;return t/((Date.now()-e)/1e3)}async onFrameTransformed(e={},t=!1){0===this.startAt&&(this.startAt=Date.now()),this.frameTransformedCount++;const{startAt:n,frameTransformedCount:r,frameFromSourceCount:i}=this,o=Date.now(),s=(o-n)/1e3,a=r/s,c=i/s;return t||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=o,this.reporter.config=this.config,this.reporter.send({...this.config.report,variation:"QoS",fps:c,transformedFps:a,framesTransformed:r,...e})):"success"}}var ne=(e=>(e.FPS_DROP="fps_drop",e))(ne||{}),re=(e=>(e.start="start",e.transform="transform",e.flush="flush",e))(re||{}),ie=(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))(ie||{});class oe extends _{constructor(e,t){super(),o(this,"reporter_",new $),o(this,"reporterQos_",new te({loggingIntervalFrameCount:500,report:{version:ee}})),o(this,"transformerType_"),o(this,"transformer_"),o(this,"shouldStop_"),o(this,"isFlashed_"),o(this,"mediaTransformerQosReportStartTimestamp_"),o(this,"videoHeight_"),o(this,"videoWidth_"),o(this,"trackExpectedRate_"),o(this,"index_"),o(this,"controller_"),this.index_=t,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType()),this.report({variation:"Create"})}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){this.report({message:a.errors.transformer_start,variation:"Error",error:C(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"start"};this.emit("error",t)}}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.reporterQos_.onFrameFromSource(),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.reportQos()}catch(e){this.report({message:a.errors.transformer_transform,variation:"Error",error:C(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"transform"};this.emit("error",t)}if(-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>this.reporterQos_.fps){const e={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}};this.emit("warn",e)}}}async flush(e){if(this.transformer_&&"function"==typeof this.transformer_.flush&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch(e){this.report({message:a.errors.transformer_flush,variation:"Error",error:C(e)});const t={eventMetaData:{transformerIndex:this.index_},error:e,function:"flush"};this.emit("error",t)}}this.reportQos(!0),this.report({variation:"Delete"})}stop(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0}report(e){this.reporter_.send({version:ee,action:"MediaTransformer",transformerType:this.transformerType_,...e})}reportQos(e=!1){this.reporterQos_.config={...this.reporterQos_.config},this.reporterQos_.onFrameTransformed({version:ee,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},e)}}class se extends _{constructor(e){super(),o(this,"transformers_"),o(this,"trackExpectedRate_"),this.transformers_=[],this.trackExpectedRate_=-1;for(let t=0;t<e.length;t++){let n=new oe(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 ae extends _{constructor(){super(),o(this,"reporter_"),o(this,"pipeline_"),o(this,"transformers_"),o(this,"readable_"),o(this,"writable_"),o(this,"trackExpectedRate_"),this.reporter_=new $,this.trackExpectedRate_=-1,this.report({variation:"Create"})}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(async(e,t)=>{if(!this.transformers_||0===this.transformers_.length)return this.report({message:a.errors.transformer_none,variation:"Error"}),void t("[MediaProcessor] Need to set transformers.");if(!this.readable_)return this.report({variation:"Error",message:a.errors.readable_null}),void t("[MediaProcessor] Readable is null.");if(!this.writable_)return this.report({variation:"Error",message:a.errors.writable_null}),void t("[MediaProcessor] Writable is null.");let n=!1;this.pipeline_&&(n=!0,this.pipeline_.clearListeners(),this.pipeline_.destroy()),this.pipeline_=new se(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=ie.pipeline_restarted:"pipeline_started_with_error"===e&&(e=ie.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){return this.report({variation:"Update",message:a.updates.transformer_new}),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()}destroy(){return new e(async e=>{this.pipeline_&&this.pipeline_.destroy(),this.report({variation:"Delete"}),e()})}report(e){this.reporter_.send({version:ee,action:"MediaProcessor",...e})}}class ce{constructor(){o(this,"processor_"),o(this,"generator_"),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 ue{constructor(e){o(this,"insertableStreamHelper_"),o(this,"mediaProcessor_"),this.insertableStreamHelper_=new ce,this.mediaProcessor_=e}setTrack(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})}destroy(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})}}}.call(this,n(0),n(42))},function(e,t,n){"use strict";const r={backgroundBlur:n(719),backgroundReplacement:n(720)},i=e=>!!r[e],o=e=>i(e)?r[e]:null,s={isSupported:i,getConfigurator:o,isValidConfig:e=>{const t=e.type;return!!i(t)&&o(t).isValidConfig(e)}};e.exports=s},function(e,t,n){"use strict";const r=n(316).BlurRadius,i=n(317),o=r.High,s=e=>"low"===e||"high"===e,a={isValidConfig:e=>{if("backgroundBlur"!==(null==e?void 0:e.type))return!1;const t=e.blurStrength;return!t||s(t)},getConfig:function(e){void 0===e&&(e={});const t=(e=>Object.assign({},i.getConfig(e),{transformerType:"BackgroundBlur",radius:o}))(e),n=e.blurStrength;return s(n)&&(t.radius=(e=>"low"===e?r.Low:r.High)(n)),t}};e.exports=a},function(e,t,n){"use strict";const r=n(317),i=e=>/^data:image\/(?:png|jpeg|bmp|gif);base64/.test(e)||/\.(?:png|jpe?g|bmp|gif)$/i.test(e),o={isValidConfig:e=>{if("backgroundReplacement"!==(null==e?void 0:e.type))return!1;const t=e.backgroundImgUrl;return i(t)},getConfig:function(e){void 0===e&&(e={});const t=(e=>Object.assign({},r.getConfig(e),{transformerType:"VirtualBackground"}))(e),n=e.backgroundImgUrl;return i(n)&&(t.backgroundAssetUri=n),t}};e.exports=o},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(1)("MediaProcessorConnector");let a=function(e){var t=this;this.setTrack=function(){var e=(0,o.default)(i.default.mark((function e(n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,t.connector.setTrack(n);case 4:r=e.sent,t.originalTrack=n,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),s.error("Error setting track: "+e.t0);case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this.destroy=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.connector.destroy();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),s.warn("Error destroying connector: "+e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),this.stopOriginalTrack=()=>{this.originalTrack&&(this.originalTrack.stop(),this.originalTrack=null)},this.connector=e};a.isValidConnector=e=>"function"==typeof(null==e?void 0:e.setTrack)&&"function"==typeof(null==e?void 0:e.destroy),e.exports=a},function(e,t,n){"use strict";e.exports=e=>!!e&&!!e.apiKey},function(e,t,n){"use strict";e.exports=e=>null===e||!1===e},function(e,t,n){"use strict";e.exports=e=>{var t;!(!e||null==(t=e.videoSource)||!t.canvas)&&!!(!e||!("videoContentHint"in e))&&(e.videoContentHint="detail")}},function(e,t,n){"use strict";const r=n(149);e.exports=e=>{var t;e||(e={});const n=!!r(null==(t=e)?void 0:t.videoSource);e.capableSimulcastScreenshare=n&&(e=>!(null==e||!e.scalableScreenshare))(e)}},function(e,t,n){var r=n(727),i=n(99),o=n(35);e.exports=function(e,t){return r(e,o(t,3),i)}},function(e,t){e.exports=function(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}},function(e,t,n){"use strict";(function(t){const r=n(28),i=n(72);e.exports=e=>{let n,o,s=e.RTCPeerConnection,a=e.env,c=e.stream,u=e.codecFlags;if(a.isLegacyEdge)return!0;const l=()=>{try{n.close()}catch(e){}try{o.close()}catch(e){}n=null,o=null};try{const e={iceServers:[]};i()&&(e.sdpSemantics="plan-b"),n=new s(e),o=new s(e),c.getTracks().forEach(e=>n.addTrack(e,c))}catch(e){return l(),t.resolve(!1)}return n.createOffer().then(e=>{const t={type:e.type,sdp:e.sdp};return Object.keys(u).forEach(e=>{u[e]||(t.sdp=r.removeVideoCodec(t.sdp,e))}),o.setRemoteDescription(t)}).then(()=>!0).catch(()=>!1).then(e=>(l(),e))}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(7).INVALID_PARAMETER;e.exports=e=>{let t=e.otError;return e=>{if(!e)return;const n=(e,n)=>{if(!e)throw t(r,new Error("iceConfig invalid: "+n))};"includeServers"in e&&n(-1!==["all","custom"].indexOf(e.includeServers),".includeServers must be all or custom"),"transportPolicy"in e&&n(-1!==["all","relay"].indexOf(e.transportPolicy),".transportPolicy must be all or relay"),n(Array.isArray(e.customServers),".customServers must be an array"),e.customServers.forEach(e=>{n(e.urls||!("url"in e),"ice servers need .urls, not .url"),n("string"==typeof e.urls||Array.isArray(e.urls),"ice server .urls must be a string or an array"),n(!e.username||"string"==typeof e.username,"ice server .username must be a string if present"),n(!e.credential||"string"==typeof e.credential,"ice server .credential must be a string if present")})}}},function(e,t,n){"use strict";var r=n(2)(n(731));e.exports=(e,t)=>{if(e.p2pEnabled)return!1;return!0===t&&(0,r.default)()}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;const r=n(3);t.default=()=>r.isChromium||r.isFirefox||r.isSafari},function(e,t,n){"use strict";e.exports=e=>{if("string"!=typeof e)throw new Error("secret must be a string");if(e.length<8)throw new Error("secret must have at least 8 characters");if(e.length>256)throw new Error("secret must not exceed 256 characters")}},function(e,t,n){"use strict";const r=n(10);e.exports=function(e){switch(e){case r.AUTHENTICATION_ERROR:case r.INVALID_SESSION_ID:case r.TERMS_OF_SERVICE_FAILURE:case r.UNEXPECTED_SERVER_RESPONSE:return e;case r.ANVIL_EMPTY_RESPONSE_BODY:case r.ANVIL_CONNECT_FAILED:return r.CONNECT_FAILED;case r.ANVIL_BADLY_FORMED_RESPONSE:case r.ANVIL_INVALID_HTTP_STATUS:case r.ANVIL_XDOMAIN_OR_PARSING_ERROR:case r.ANVIL_UNKNOWN_HTTP_ERROR:case r.ANVIL_UNEXPECTED_ERROR_CODE:default:return r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";const r=n(10),i=n(7);e.exports={NOT_CONNECTED:{code:i.NOT_CONNECTED,message:"Cannot use forceMute functionality. You are not connected to the session.",exceptionCode:r.NOT_CONNECTED},PERMISSION_DENIED:{code:i.PERMISSION_DENIED,message:"This token does not allow forceMute usage. The role must be at least `moderator` to enable this functionality",exceptionCode:r.UNABLE_TO_FORCE_MUTE},INVALID_PARAMETER:{code:i.INVALID_PARAMETER,message:"Invalid Parameter. Check that you have passed valid parameter values into the method call.",exceptionCode:r.INVALID_PARAMETER},NOT_FOUND:{code:i.NOT_FOUND,message:"The stream does not exist."},UNEXPECTED_SERVER_RESPONSE:{code:i.UNEXPECTED_SERVER_RESPONSE,message:"An unexpected error occurred.",exceptionCode:r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";(function(e){var r=n(2);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const r=t.convertRumorError||n(320),l=t.Dispatcher||n(325),d=t.ExceptionCodes||n(10),h=t.hasIceRestartsCapability||n(321),p=t.hasRenegotiationCapability||n(752),f=t.hasE2eeCapability||n(110),m=t.logging||n(1)("RaptorSocket"),g=t.Message||n(326),b=t.OTHelpers||n(8),y=t.RumorSocket||(0,u.default)(),v=t.Signal||n(327),w=t.SignalError||n(757),S=function t(n){var u=this;let h,p,f,S,E,T,x,_,C=n.connectionId,I=n.sessionId,R=n.messagingSocketUrl,k=n.symphonyUrl,O=n.dispatcher,Z=n.analytics,A=n.requestedCapabilities,V=void 0===A?[]:A;const G=O||new l,N=b.statable(this,["disconnected","connecting","connected","error","disconnecting"],"disconnected"),L=function(e){e.action&&e.variation||m.debug("Expected action and variation"),Z.logEvent((0,o.default)({sessionId:p,partnerId:h,p2p:T,messagingServer:x,connectionId:C},e))},W=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];N(r?"error":"connected"),E(...t)},X=e=>{let t="clientDisconnected";!this.is("disconnecting")&&_&&(t="networkDisconnected"),e&&4001===e.code&&(t="networkTimedout"),N("disconnected"),G.onClose(t)},M=e=>{_=!0,m.error(e)},F=()=>{G.onReconnecting()},P=()=>{L({action:"Reconnect",variation:"Success",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId}),G.onReconnected()},j=()=>{L({action:"Reconnect",variation:"Attempt",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})},U=e=>{"connectionLimitExceeded"===e.message&&(e.code=d.CONNECTION_LIMIT_EXCEEDED),e.reason="ConnectToSession";const t=r(e);L({action:"Reconnect",variation:"Failure",failureReason:e.reason,failureCode:t.code,failureMessage:t.message,messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})};Object.defineProperty(this,"socketId",{get(){return this._rumor.socketID}}),this.connect=function(n,r,i,o){if(!this.is("disconnected","error"))return void m.warn("Cannot connect the Raptor Socket as it is currently connected. You should disconnect first.");N("connecting"),h=r.partnerId,p=r.sessionId,T=r.p2pEnabled,x=r.messagingServer,f=n,E=o,S={apiKey:h,sessionId:p};const s=`/v2/partner/${h}/session/${p}`;this._rumor=new t.RumorSocket({messagingURL:R,notifyDisconnectAddress:k,connectionId:C,sessionId:I,enableReconnection:r.reconnection}),this._rumor.on("close",X),this._rumor.on("error",M),this._rumor.on("reconnecting",F),this._rumor.on("reconnectAttempt",j),this._rumor.on("reconnectFailure",U),this._rumor.on("reconnected",P),this._rumor.on("message",G.dispatch.bind(G));const c=e=>{W({reason:"WebSocketConnection",code:e.code,message:e.message})};this._rumor.once("error",c),this._rumor.once("open",()=>{this._rumor.removeListener("error",c),m.debug(`connected. Subscribing to ${s} on ${R}`),this._rumor.subscribe([s]);const n=V;(t.hasIceRestartsCapability()||t.hasRenegotiationCapability())&&r.renegotiation&&n.push("renegotiation");t.hasE2eeCapability()&&r.e2ee&&n.push("e2ee");const o=g.connections.create({apiKey:h,sessionId:p,connectionId:this._rumor.id,connectionEventsSuppressed:i.connectionEventsSuppressed,capabilities:n}),u=new e(e=>{const t=n=>{n.id===this._rumor.id&&(e(n),O.off("connection#created",t))};O.on("connection#created",t)});this.publish(o,{"X-TB-TOKEN-AUTH":f},!0,(e,t)=>{if(e)return"connectionLimitExceeded"===e.message&&(e.code=d.CONNECTION_LIMIT_EXCEEDED),void W({reason:"ConnectToSession",code:e.code,message:e.message,socketId:this.socketId});const n=t&&t.data?JSON.parse(t.data):null;n&&(n.connection&&0!==n.connection.length||(n.connection=[],Array.isArray(n.stream)&&n.stream.forEach(e=>{let t=e.connection;return n.connection.push(t)})));const r=(e,t)=>{e?W({reason:"GetSessionState",code:e.code,message:e.message,socketId:this.socketId}):W(void 0,t)};u.then(e=>{n.connection.some(t=>t.id===e.id)||n.connection.unshift(e);const t=(0,a.default)();G.registerCallback(t,r),G.emit("session#read",n,t)})})})},this.disconnect=function(){this.is("disconnected")||(N("disconnecting"),this._rumor.disconnect())},this.publish=function(e,t,n,r){r=r||function(){};const i=(0,s.default)(r),c=(0,a.default)();if(m.debug(`Publish (ID:${c}) ${e}`),this._rumor.readyState!==y.OPEN||this._rumor.reconnecting&&!n){const e=new Error("Not connected.");return e.code=500,i(e),void m.error("cannot publish until the socket is connected.")}return G.registerCallback(c,i),this._rumor.publish([k],e,(0,o.default)({},t,{"Content-Type":"application/x-raptor+v2","TRANSACTION-ID":c,"X-TB-FROM-ADDRESS":this._rumor.id}),n,(function(e){e&&i(...arguments)})),c},this.send=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=()=>{}),u.publish((0,c.default)(e),t,n,r)},this.streamCreate=function(e,t){void 0===e&&(e={}),void 0===t&&(t=()=>{});const n=e,r=n.name,i=n.streamId,o=n.subscriberAudioFallbackEnabled,s=n.channels,a=n.minBitrate,c=n.maxBitrate,u=n.sourceStreamId,l=n.e2ee,d=n.publisherAudioFallbackEnabled,f=n.customProperties,m={apiKey:h,sessionId:p,streamId:i,name:r,audioFallbackEnabled:o,subscriberAudioFallbackEnabled:o,channels:s,minBitrate:a,maxBitrate:c,sourceStreamId:u,e2ee:l,publisherAudioFallbackEnabled:d,customProperties:f},b=g.streams.create(m);this.publish(b,{},!0,(e,n)=>{t(e,i,n)})},this.streamDestroy=function(e,t){this.publish(g.streams.destroy(h,p,e,t),{},!0)},this.streamChannelUpdate=function(e,t,n){this.publish(g.streamChannels.update(h,p,e,t,n),{},!0)},this.subscriberCreate=function(e,t,n,r,i,o){const s={apiKey:h,sessionId:p,streamId:e,subscriberId:t,connectionId:this._rumor.id,channelsToSubscribeTo:n,sourceStreamId:r,e2ee:i};this.publish(g.subscribers.create(s),{},!0,o)},this.subscriberDestroy=function(e,t){this.publish(g.subscribers.destroy(h,p,e,t),{},!0)},this.subscriberUpdate=function(e,t,n){this.publish(g.subscribers.update(h,p,e,t,n),{},!0)},this.subscriberChannelUpdate=function(e,t,n,r){this.publish(g.subscriberChannels.update(h,p,e,t,n,r),{},!0)},this.forceDisconnect=function(e,t){this.publish(g.connections.destroy({apiKey:h,sessionId:p,connectionId:e}),{},!0,t)},this.forceUnpublish=function(e,t){this.publish(g.streams.destroy(h,p,e),{},!0,t)},this.forceMuteStream=function(e,t){const n={streamId:e,active:!0};this.publish(g.forceMute.update(Object.assign({},S,n)),{},!0,t)},this.forceMuteAll=function(e,t,n){const r={excludedStreamIds:e,active:t};this.publish(g.forceMute.update(Object.assign({},S,r)),{},!0,n)},this.signal=function(e,t,n){const r=new v(p,this._rumor.id,e||{});r.valid?this.publish(r.toRaptorMessage(),{},r.retryAfterReconnect,e=>{let o,s,a;const c=[400,403,404,413,500];if(e){const t=parseInt(e.code,10);c.includes(t)?(s=t,a=e.message):(s=d.UNEXPECTED_SERVER_RESPONSE,a="Unexpected server response. Try this operation again later."),o=new w(s,a)}else{const e=r.data?typeof r.data:null;n("signal","send",{type:e})}t&&(0,i.default)(t)&&t(o,r.toHash())}):t&&(0,i.default)(t)&&t(new w(r.error.code,r.error.reason),r.toHash())},this.id=function(){return this._rumor&&this._rumor.id}};return S.hasIceRestartsCapability=h,S.hasRenegotiationCapability=p,S.hasE2eeCapability=f,S.RumorSocket=y,S};var i=r(n(16)),o=r(n(9)),s=r(n(50)),a=r(n(15)),c=r(n(322)),u=r(n(736))}).call(this,n(0))},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=function(e){let t=(void 0===e?{}:e).WebSocket,n=void 0===t?u.default:t;const r=(0,o.default)(),d=(0,a.default)({AnalyticsHelper:l.default,EventEmitter:i.default,WebSocket:n,logging:s.default,allocateId:r});return(0,c.default)({EventEmitter:i.default,ReconnectableSocket:d,logging:s.default,allocateId:r})};var i=r(n(18)),o=r(n(737)),s=r(n(1)),a=r(n(738)),c=r(n(743)),u=r(n(748)),l=r(n(20))},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){let e=0;return()=>(e+=1,e)}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),s=r(n(45)),a=r(n(323)),c=r(n(48)),u=r(n(324)),l=n(76),d=r(n(739)),h=r(n(61)),p=r(n(740)),f=r(n(742));const m=e=>function(){e(...arguments)},g=e=>1e3===e||e>=3e3&&e<=4999,b=l.codes.CLOSE_TIMEOUT;t.default=e=>{var t;let n=e.AnalyticsHelper,r=e.EventEmitter,l=e.WebSocket,y=e.logging,v=e.allocateId,w=e.BUFFER_DRAIN_INTERVAL,S=void 0===w?100:w,E=e.BUFFER_DRAIN_MAX_RETRIES,T=void 0===E?10:E;return(t=function(e){function t(r){var s;(s=e.call(this)||this)._url=void 0,s._id=v(),s._logger=y("ReconnectableSocket:"+s._id),s._webSocket=void 0,s._connectTimer=void 0,s._pingTimer=void 0,s._pingWarningTimer=void 0,s._disconnectTimer=void 0,s._queuedMessages=[],s._draining=!1,s._analytics=new n,s._logAnalyticsEvent=e=>{let t=e.action,n=e.variation,r=e.payload;s._analytics.logEvent({action:t,variation:n,payload:r,sessionId:s.sessionId,connectionId:s.connectionId})};const c=r.url,l=r.connectionId,h=r.sessionId,f=r.connectTimeout,g=void 0===f?15e3:f,b=r.pingThreshold,w=void 0===b?3e3:b,S=r.pingWarningDelay,E=void 0===S?100:S,T=r.disconnectThreshold,x=void 0===T?5900:T,_=r.reconnectMaxDuration,C=void 0===_?6e4:_;if(!c)throw new Error("Must provide url");s.connectionId=l,s.sessionId=h,s.readyStateMachine=(0,p.default)({reconnectMaxDuration:C,CLOSED:t.CLOSED,CLOSING:t.CLOSING}),s._url=c,(0,u.default)({logger:s._logger,obj:(0,a.default)(s),eventNames:["error","open","message","needsPing","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),s.readyStateMachine.observe("onEnterOpen",e=>{let t=e.from;s._resetPingTimers(),s._resetDisconnectTimer(),s._connectTimer.clear(),"reconnecting"===t?(s._queuedMessages.forEach(e=>s.send(e,!0)),s._queuedMessages=[],s.emit("reconnected"),s._logAnalyticsEvent({action:"WebSocket:reconnect",variation:"Success"})):(s.emit("open"),s._logAnalyticsEvent({action:"WebSocket:open"}))}),s.readyStateMachine.observe("onEnterClosed",(e,t)=>{let n=e.from,r=e.code,i=e.reason;s.emit("close",t),"reconnecting"===n&&s._logAnalyticsEvent({action:"WebSocket:reconnect",variation:"Failure",payload:{code:r,reason:i}})}),s.readyStateMachine.observe("onEnterClosing",m(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.from,o=n.code,a=n.reason,s._clearTimers(),e.next=5,s._clearSocket({drain:"open"===r,code:o,reason:a});case 5:"reconnecting"===r&&(s.emit("reconnectFailure",{code:o,reason:a}),s._logAnalyticsEvent({action:"WebSocket:reconnect",variation:"Failure"})),setTimeout(()=>{s.readyStateMachine.closed({code:o,reason:a})});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())),s.readyStateMachine.observe("onEnterReconnecting",()=>{s.emit("reconnecting"),s._logAnalyticsEvent({action:"WebSocket:reconnect",variation:"Attempt"})}),s.readyStateMachine.observe("onDisconnect",m(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.from,o=t.to,a=n.code,c=n.reason,"reconnecting"!==o){e.next=12;break}if(!s._draining){e.next=5;break}return e.abrupt("return");case 5:return s._clearTimers(),s.emit("reconnectAttempt"),e.next=9,s._clearSocket({drain:"open"===r,code:a,reason:c});case 9:s._createSocket(),e.next=13;break;case 12:s._logAnalyticsEvent({action:"WebSocket:disconnect",payload:{code:a,reason:c}});case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));const I=(e,t)=>new d.default({name:e,duration:t,logger:s._logger});return s._connectTimer=I("connect",g),s._pingTimer=I("ping",w),s._pingWarningTimer=I("pingWarning",E),s._disconnectTimer=I("disconnect",x),s._createSocket(),s}(0,c.default)(t,e);var r=t.prototype;return r._createSocket=function(){const e=new l(this.url);e.binaryType="arraybuffer";const n=(0,h.default)(e);n.on("open",()=>{this.readyStateMachine.open()}),n.on("close",e=>{let t=e.code,n=e.reason;this.readyStateMachine.disconnect({code:t,reason:n})}),n.on("error",e=>{this.emit("error",e)}),n.on("message",e=>{this.readyState!==t.CLOSING&&this._resetDisconnectTimer(),this.emit("message",e)}),this._webSocket=e,this._webSocketEvents=n,this._connectTimer.reset(()=>{const e={code:b,reason:"Timeout while opening connection"},t=new Error(e.reason);t.code=b,this.emit("error",t),this.readyStateMachine.disconnect(e)})},r._clearSocket=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=void 0===n?{}:n).drain,s=void 0!==o&&o,a=r.code,c=r.reason,this._draining=!0,this._webSocketEvents&&this._webSocketEvents.removeAll(),this._webSocket.readyState===t.CLOSED){e.next=9;break}if(!s){e.next=7;break}return e.next=7,(0,f.default)(this._webSocket,{BUFFER_DRAIN_INTERVAL:S,BUFFER_DRAIN_MAX_RETRIES:T});case 7:this._logAnalyticsEvent({action:"WebSocket:close",payload:{code:a,reason:c},variation:"Attempt"});try{!g(a)||void 0===a&&void 0===c?this._webSocket.close():this._webSocket.close(a,c),this._logAnalyticsEvent({action:"WebSocket:close",payload:{code:a,reason:c},variation:"Success"})}catch(e){y.error("Could not close websocket",e),this._logAnalyticsEvent({action:"WebSocket:close",payload:{err:e},variation:"Failure"})}case 9:this._draining=!1;case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.send=function(e,n){void 0===n&&(n=!0),this.readyState===t.OPEN&&this._resetPingTimers();const r=()=>{try{return this._webSocket.send(e),"sent"}catch(e){if(this._webSocket.readyState===l.OPEN)return this._logger.debug("webSocket.send threw exception even though it was open:",e),"dropped";throw e}};if("reconnecting"===this.readyStateMachine.state){if(this._webSocket.readyState===l.OPEN)try{r()}catch(e){}return n?(this._queuedMessages.push(e),"queued"):(this._logger.debug("Dropping message during reconnection since retryAfterReconnect is false:",e),"dropped")}return r()},r.close=function(e,n){if(this.readyState===t.CLOSING)throw new Error("Can not call close on a closing ReconnectableSocket");if(this.readyState===t.CLOSED)throw new Error("Can not call close on an already closed ReconnectableSocket");this.readyStateMachine.close({code:e,reason:n})},r._resetPingTimers=function(){this._pingWarningTimer.clear(),this._pingTimer.reset(()=>{this._pingWarningTimer.reset(()=>{this._logger.warn("Did not send message after needsPing event. Other side may disconnect.")}),this.emit("needsPing")})},r._resetDisconnectTimer=function(){this._disconnectTimer.reset(()=>this.readyStateMachine.disconnect({code:b,reason:"No activity"}))},r._clearTimers=function(){[this._disconnectTimer,this._connectTimer,this._pingTimer,this._pingWarningTimer].forEach(e=>e.clear())},(0,s.default)(t,[{key:"url",get:function(){return"function"==typeof this._url?this._url():this._url}},{key:"reconnecting",get:function(){return"reconnecting"===this.readyStateMachine.state}},{key:"binaryType",get:function(){return this._webSocket.binaryType}},{key:"bufferedAmount",get:function(){return this._webSocket.bufferedAmount}},{key:"protocol",get:function(){return this._webSocket.protocol}},{key:"extensions",get:function(){return this._webSocket.extensions}},{key:"readyState",get:function(){return{reconnecting:t.OPEN,open:t.OPEN,closing:t.CLOSING,closed:t.CLOSED,connecting:t.CONNECTING}[this.readyStateMachine.state]}}]),t}(r)).CONNECTING=l.CONNECTING,t.OPEN=l.OPEN,t.CLOSING=l.CLOSING,t.CLOSED=l.CLOSED,t}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r=function(){function e(e){let t=e.name,n=e.logger,r=e.duration;this.name=void 0,this.logger=void 0,this.duration=void 0,this.currId=void 0,this.name=t,this.logger=n,this.duration=r}var t=e.prototype;return t.reset=function(e){this.clear();const t=setTimeout(()=>{void 0!==this.currId&&(this.logger.spam(`${this.name} timer with id ${this.currId} expired, entering callback`),this.currId=void 0,e())},this.duration);this.currId=t,this.logger.spam(`Started ${this.name} timer with id ${this.currId}, expires in `+this.duration+"ms")},t.clear=function(){void 0!==this.currId&&(clearTimeout(this.currId),this.logger.spam(`Cleared ${this.name} timer with id ${this.currId}`),this.currId=void 0)},t.isRunning=function(){return void 0!==this.currId},e}();t.default=r},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(310)),o=r(n(741)),s=n(76);const a=(0,r(n(1)).default)("ReconnectableSocketStateMachine"),c=s.codes.CLOSE_UNSUPPORTED,u=s.codes.CLOSE_UNEXPECTED_CONDITION;t.default=e=>{let t,n=e.reconnectMaxDuration,r=e.CLOSED,s=e.CLOSING;return new i.default({init:"connecting",methods:{onInvalidTransition(e,t,n){a.error("Invalid state transition",{transition:e,from:t,to:n})}},transitions:[{name:"open",from:["connecting","reconnecting"],to:"open"},{name:"close",from:["connecting","reconnecting","open"],to:"closing"},{name:"closed",from:"closing",to:"closed"},{name:"disconnect",from:["reconnecting","open","connecting"],to:function(e){let i=e.code;return"open"!==this.state&&t||(t=(0,o.default)(n)),n>0&&!t()&&-1===[c,u].indexOf(i)&&-1===[r,s].indexOf(this.readyState)?"reconnecting":"closing"}}]})}},function(e,t,n){"use strict";e.exports=e=>{let t=!1;return setTimeout(()=>{t=!0},e),()=>t}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),s=r(n(107)),a=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a,c,u,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=(r=void 0===n?{}:n).BUFFER_DRAIN_INTERVAL,a=void 0===o?100:o,c=r.BUFFER_DRAIN_MAX_RETRIES,u=void 0===c?10:c,l=0;case 2:if(!(l<u)){e.next=10;break}if(0!==t.bufferedAmount){e.next=5;break}return e.abrupt("break",10);case 5:return e.next=7,(0,s.default)(a);case 7:l+=1,e.next=2;break;case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.default=a},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(45)),o=r(n(323)),s=r(n(48)),a=r(n(15)),c=r(n(324)),u=r(n(744)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(171)),d=r(n(747)),h=n(76);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}t.default=e=>{var t;let n=e.EventEmitter,r=e.ReconnectableSocket,p=e.logging,f=e.allocateId;return(t=function(e){function t(t){var n;let i=t.messagingURL,s=t.notifyDisconnectAddress,l=t.connectionId,m=t.sessionId,g=t.enableReconnection,b=t.pingThreshold,y=void 0===b?2e3:b,v=t.disconnectThreshold,w=void 0===v?(g?3:25)*y-100:v,S=t.reconnectMaxDuration,E=void 0===S?g?6e4:0:S;(n=e.call(this)||this).url=void 0,n.id=void 0,n._opened=!1,n._socket=void 0,n._reconnectAttempts=0,n._socketID=(0,a.default)(),n._receivedTransactionIDs=[],n._notifyDisconnectAddress=void 0,n._enableReconnection=void 0,n._pendingMessages=[],n._logger=p("RumorSocket:"+f()),(0,c.default)({logger:n._logger,obj:(0,o.default)(n),eventNames:["open","message","error","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),n.url=i,n.id=l,n._notifyDisconnectAddress=s,n._enableReconnection=g,n.on("error",e=>{n._logger.error(e.message)});try{n._socket=new r({url:()=>n._enableReconnection?[n.url,n.url.indexOf("?")>=0?"&":"?","socketId="+n._socketID,n._socket&&n._socket.reconnecting?"&reconnect=true":"","&attempt="+(0,a.default)()].join(""):n.url,pingThreshold:y,disconnectThreshold:w,reconnectMaxDuration:E,connectionId:l,sessionId:m})}catch(e){n._logger.error(e),n.emit("error",new d.default(h.codes.CLOSE_CONNECT_EXCEPTION))}const T=()=>{n._opened=!0,n._socket.send(u.default.Connect(n.id,s).serialize()),n.emit("open",n.id)};return n._socket.once("open",T),n._socket.on("message",e=>n._receiveMessage(e)),n._socket.once("close",e=>{n._logger.debug(`ReconnectableSocket closed (code: ${e.code})`),n._clearPendingMessages();-1===[h.codes.CLOSE_NORMAL,h.codes.CLOSE_GOING_AWAY,h.codes.CLOSE_TIMEOUT].indexOf(e.code)&&n.emit("error",new d.default(e.code)),n.emit("close",e)}),n._socket.on("error",e=>{let t=e.code;return n.emit("error",new d.default(t))}),n._socket.on("needsPing",()=>{n._socket.send(u.default.Ping().serialize())}),n._socket.on("reconnecting",()=>{n._opened&&(n._clearPendingMessagesWhichShouldntRetry(),n.emit("reconnecting"),n._reconnectAttempts=0)}),n._socket.on("reconnectAttempt",()=>{n._opened&&(n._reconnectAttempts+=1,n._socket.send(u.default.Disconnect("1").serialize(),!1),n.emit("reconnectAttempt"))}),n._socket.on("reconnected",()=>{n._opened?(n._pendingMessages.forEach(e=>{n._socket.send(e.rumorMessage.serialize())}),n.emit("reconnected")):T()}),n._socket.on("reconnectFailure",()=>{n._opened&&(n._logger.debug("Reconnecting failed as connectivity was not restored within "+E+"ms"),n.emit("reconnectFailure",new d.default))}),n}(0,s.default)(t,e);var n=t.prototype;return n._clearPendingMessagesWhichShouldntRetry=function(){const e=this._pendingMessages.filter(e=>!e.retryAfterReconnect);this._pendingMessages=this._pendingMessages.filter(e=>e.retryAfterReconnect),e.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)})},n._clearPendingMessages=function(){this._pendingMessages.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)}),this._pendingMessages=[]},n._sendAck=function(e){this._socket.send(u.default.Status([e.fromAddress],{"TRANSACTION-ID":e.headers["TRANSACTION-ID"],"X-TB-FROM-ADDRESS":this.id}).serialize())},n._receiveMessage=function(e){const t=u.default.deserialize(e.data);if(t.type!==l.PONG){if(this._logger.debug("Received:",t),t.transactionId&&(this._pendingMessages=this._pendingMessages.filter(e=>(e.rumorMessage.transactionId===t.transactionId&&(this._logger.debug("Marking",t.transactionId," as received"),e.completion(void 0,t)),e.rumorMessage.transactionId!==t.transactionId))),t.transactionId&&t.type!==l.STATUS){if(this._sendAck(t),this._receivedTransactionIDs.indexOf(t.transactionId)>=0)return;this._receivedTransactionIDs.push(t.transactionId)}this.emit("message",t)}},n.publish=function(e,t,n,r,i){void 0===i&&(i=()=>{});const o=u.default.Publish(e,t,n);if("dropped"===this._socket.send(o.serialize(),!1)&&!r){const e=new Error("Not connected.");return e.code=500,void i(e)}this._pendingMessages.push({rumorMessage:o,retryAfterReconnect:r,completion:i})},n.subscribe=function(e){this._socket.send(u.default.Subscribe(e).serialize())},n.unsubscribe=function(e){this._socket.send(u.default.Unsubscribe(e).serialize())},n.disconnect=function(){if(this.readyState===t.OPEN&&this._socket.send(u.default.Disconnect().serialize()),this._socket.readyState!==r.CLOSED&&this._socket.readyState!==r.CLOSING){const e=h.codes.CLOSE_NORMAL;this._socket.close(e,h.messages[e])}},n.status=function(e,t){this._socket.send(u.default.Status(e,{"TRANSACTION-ID":t,"X-TB-FROM-ADDRESS":this.id}).serialize())},n.reconnectRetriesCount=function(){return this._reconnectAttempts},n.messageQueueSize=function(){return this._pendingMessages.length},(0,i.default)(t,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:r.CONNECTING}},{key:"reconnecting",get:function(){return this._opened&&this._socket&&this._socket.reconnecting}},{key:"socketID",get:function(){return this._socketID}}]),t}(n)).CONNECTING=r.CONNECTING,t.OPEN=r.OPEN,t.CLOSING=r.CLOSING,t.CLOSED=r.CLOSED,t}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(15)),o=n(745),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(171));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}let c=function(){function e(e,t,n,r){this.type=void 0,this.toAddress=void 0,this.headers=void 0,this.data=void 0,this.type=e,this.toAddress=t,this.headers=n,this.data=r,this.fromAddress=this.headers["X-TB-FROM-ADDRESS"],this.transactionId=this.headers["TRANSACTION-ID"],this.status=this.headers.STATUS,this.isError=this.status&&"2"!==this.status[0]}return e.prototype.serialize=function(){let e,t,n,r,i=8,s=7;const a=[],c=[],u=[];for(s++,n=0;n<this.toAddress.length;n++)a.push(new o.TextEncoder("utf-8").encode(this.toAddress[n])),s+=2,s+=a[n].length;s++,n=0;for(const e in this.headers)this.headers.hasOwnProperty(e)&&(c.push(new o.TextEncoder("utf-8").encode(e)),u.push(new o.TextEncoder("utf-8").encode(this.headers[e])),s+=4,s+=c[n].length,s+=u[n].length,n++);t=new o.TextEncoder("utf-8").encode(this.data),s+=t.length;const l=new ArrayBuffer(s),d=new Uint8Array(l,0,s);for(s-=4,d[0]=(4278190080&s)>>>24,d[1]=(16711680&s)>>>16,d[2]=(65280&s)>>>8,d[3]=(255&s)>>>0,d[4]=0,d[5]=0,d[6]=this.type,d[7]=this.toAddress.length,n=0;n<a.length;n++)for(e=a[n],d[i++]=e.length>>8&255,d[i++]=e.length>>0&255,r=0;r<e.length;r++)d[i++]=e[r];for(d[i++]=c.length,n=0;n<c.length;n++){for(e=c[n],d[i++]=e.length>>8&255,d[i++]=e.length>>0&255,r=0;r<e.length;r++)d[i++]=e[r];for(e=u[n],d[i++]=e.length>>8&255,d[i++]=e.length>>0&255,r=0;r<e.length;r++)d[i++]=e[r]}for(n=0;n<t.length;n++)d[i++]=t[n];return l},e.deserialize=function(t){let n,r,i,s,a,c,u,l;(void 0!==typeof window?window:global).Buffer&&(void 0!==typeof window?window:global).Buffer.isBuffer(t)&&(t=(e=>{const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;++t)n[t]=e[t];return t})(t));let d=8;const h=new Uint8Array(t);n=h[6];const p=[];for(l=0;l<h[7];l++)u=h[d++]<<8,u+=h[d++],r=new Uint8Array(t,d,u),p[l]=new o.TextDecoder("utf-8").decode(r),d+=u;for(i=h[d++],s={},l=0;l<i;l++)u=h[d++]<<8,u+=h[d++],r=new Uint8Array(t,d,u),a=new o.TextDecoder("utf-8").decode(r),d+=u,u=h[d++]<<8,u+=h[d++],r=new Uint8Array(t,d,u),c=new o.TextDecoder("utf-8").decode(r),s[a]=c,d+=u;const f=new Uint8Array(t,d);return new e(n,p,s,new o.TextDecoder("utf-8").decode(f))},e.Connect=function(t,n){const r={uniqueId:t,"TRANSACTION-ID":(0,i.default)(),notifyDisconnectAddress:n};return new e(s.CONNECT,[],r,"")},e.Disconnect=function(t){return new e(s.DISCONNECT,[],{reconnect:t},"")},e.Subscribe=function(t){return new e(s.SUBSCRIBE,t,{},"")},e.Unsubscribe=function(t){return new e(s.UNSUBSCRIBE,t,{},"")},e.Publish=function(t,n,r){return new e(s.MESSAGE,t,r||{},n||"")},e.Status=function(t,n){return new e(s.STATUS,t,n||{},"")},e.Ping=function(){return new e(s.PING,[],{},"")},e}();t.default=c},function(e,t,n){"use strict";t.__esModule=!0,t.TextEncoder=t.TextDecoder=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n(746));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}const o=(void 0!==typeof window?window:global).TextEncoder||r.TextEncoder;t.TextEncoder=o;const s=(void 0!==typeof window?window:global).TextDecoder||r.TextDecoder;t.TextDecoder=s},function(e,t,n){"use strict";function r(e,t,n){return t<=e&&e<=n}function i(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}n.r(t),n.d(t,"TextEncoder",(function(){return c})),n.d(t,"TextDecoder",(function(){return a}));function o(e){this.tokens=[].slice.call(e)}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}function a(e,t){if(!(this instanceof a))return new a(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function u(e){var t=e.fatal,n=0,i=0,o=0,a=128,c=191;this.handler=function(e,u){if(-1===u&&0!==o)return o=0,s(t);if(-1===u)return-1;if(0===o){if(r(u,0,127))return u;if(r(u,194,223))o=1,n=u-192;else if(r(u,224,239))224===u&&(a=160),237===u&&(c=159),o=2,n=u-224;else{if(!r(u,240,244))return s(t);240===u&&(a=144),244===u&&(c=143),o=3,n=u-240}return n<<=6*o,null}if(!r(u,a,c))return n=o=i=0,a=128,c=191,e.prepend(u),s(t);if(a=128,c=191,n+=u-128<<6*(o-(i+=1)),i!==o)return null;var l=n;return n=o=i=0,l}}function l(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(r(t,0,127))return t;var n,i;r(t,128,2047)?(n=1,i=192):r(t,2048,65535)?(n=2,i=224):r(t,65536,1114111)&&(n=3,i=240);for(var o=[(t>>6*n)+i];n>0;){var s=t>>6*(n-1);o.push(128|63&s),n-=1}return o}}a.prototype={decode:function(e,t){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=i(t),this._streaming||(this._decoder=new u({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,s=new o(n),a=[];!s.endOfStream()&&-1!==(r=this._decoder.handler(s,s.read()));)null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r));if(!this._streaming){do{if(-1===(r=this._decoder.handler(s,s.read())))break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}while(!s.endOfStream());this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296+(r>>10),56320+(1023&r)))}return t}(a)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=i(t),this._streaming||(this._encoder=new l(this._options)),this._streaming=Boolean(t.stream);for(var n,r=[],s=new o(function(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var o=t.charCodeAt(r);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var s=e.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}(e));!s.endOfStream()&&-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,n&&n.set(e,r);return r}(n(76));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}const o=n(7);t.default=function(e){if(this.code=void 0,this.message=void 0,this.name=void 0,this.code=r.codes.CLOSE_FALLBACK_CODE,Object.values(r.codes).includes(e))switch(this.code=e,this.code){case r.codes.CLOSE_GOING_AWAY:case r.codes.CLOSE_PROTOCOL_ERROR:case r.codes.CLOSE_UNSUPPORTED:case r.codes.CLOSE_NO_STATUS:case r.codes.CLOSE_ABNORMAL:case r.codes.CLOSE_INCONSISTENT_DATA:case r.codes.CLOSE_POLICY_VIOLATION:case r.codes.CLOSE_TOO_LARGE:case r.codes.CLOSE_UNEXPECTED_CONDITION:case r.codes.CLOSE_CONNECTIVITY_LOSS:case r.codes.CLOSE_CONNECT_EXCEPTION:case r.codes.CLOSE_TIMEOUT:return this.name=o.DISCONNECTED,void(this.message="Action failed due to session disconnection.")}this.message=r.messages[this.code]||"No message available from code."}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(749)),o=(void 0!==typeof window?window:global).WebSocket?(void 0!==typeof window?window:global).WebSocket:i.default;t.default=o},function(e,t,n){"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(e,t,n){"use strict";const r=n(751);e.exports=function(e){const t=r(e.data);return t.transactionId=e.transactionId,t.fromAddress=e.headers["X-TB-FROM-ADDRESS"],t}},function(e,t,n){"use strict";e.exports=function(e){if(0===e.length)return{};const t=JSON.parse(e),n=t.uri.substr(1).split("/");n.shift(),""===n[n.length-1]&&n.pop(),t.params={};for(let e=0,r=n.length;e<r-1;e+=2)t.params[n[e]]=n[e+1];return n.length%2==0?"channel"===n[n.length-2]&&n.length>6?t.resource=`${n[n.length-4]}_${n[n.length-2]}`:t.resource=n[n.length-2]:"channel"===n[n.length-1]&&n.length>5?t.resource=`${n[n.length-3]}_${n[n.length-1]}`:t.resource=n[n.length-1],t.signature=`${t.resource}#${t.method}`,t}},function(e,t,n){"use strict";const r=n(3).name,i=n(51).once;e.exports=()=>i()&&["Chrome","Firefox","Safari"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(3),i=n(51).once;e.exports=()=>i()&&("Chrome"===r.name||"Firefox"===r.name||"Node"===r.name||"Safari"===r.name||"Edge"===r.name)},function(e,t,n){"use strict";const r=n(51).once;e.exports=()=>r()},function(e,t,n){"use strict";e.exports="DTLS_SRTP"},function(e,t,n){"use strict";e.exports=function(e){let t=e.supportsWebRTC;return{supportsWebRTC:"true"===t||!0===t}}},function(e,t,n){"use strict";e.exports=function(e,t){this.code=e,this.message=t,this.reason=t}},function(e,t,n){"use strict";e.exports=function(e){const t=[];this.enqueue=function(){t.push(Array.prototype.slice.call(arguments))},this.triggerAll=function(){let n;for(;n=t.shift();)e.trigger(...n)}}},function(e,t,n){"use strict";const r=n(206),i=n(239),o=n(57),s=n(9),a=n(142),c=n(10),u=n(760),l=n(761),d=n(290).default,h={EMPTY_RESPONSE:"Response body was empty, probably due to connectivity loss",BADLY_FORMED:"Unknown error: JSON response was badly formed",NO_ERROR:"No error message",UNEXPECTED_SERVER_RESPONSE:e=>`Unexpected server response (${e}). Try this operation again later.`},p=[0,600,1200];e.exports=function(e){let t=void 0===e?{}:e,n=t.axios,f=void 0===n?r:n,m=t.retryDelays,g=void 0===m?p:m;return d((function(e){let t=e.anvilUrl,n=e.sessionId,r=e.token,d=e.clientVersion,p=e.connectionId;const m=i.parse(t,!0),g=i.format({protocol:m.protocol,auth:m.auth,host:m.host,pathname:i.resolve((m.pathname||"").replace(/\/?$/,"/"),"session/"+n),query:Object.assign({},m.query,{extended:!0})});return f.get(g,{validateStatus:e=>e>=200&&e<300,headers:{"X-OPENTOK-AUTH":r,"X-TB-VERSION":1,"X-TB-CLIENT-VERSION":d,"X-TB-CONNECTIONID":p,Accept:"application/json"}}).catch(e=>{if(e.response){const t=new Error(h.UNEXPECTED_SERVER_RESPONSE(`${e.response.statusCode}${e.response.status?" "+e.response.status:""}`));throw t.code=c.ANVIL_INVALID_HTTP_STATUS,t.name=u(t.code),t}if(e.request){const e=new Error(h.CONNECT_FAILED);throw e.code=c.ANVIL_CONNECT_FAILED,e.name=u(e.code),e}{const t=c.ANVIL_UNKNOWN_HTTP_ERROR,n=u(e.code);throw s(e,{code:t,name:n}),e}}).then(e=>{let t=e.data;if("string"==typeof t){if(t.length>0)try{JSON.parse(t)}catch(e){throw e.message=h.UNEXPECTED_SERVER_RESPONSE(e.toString()),e.code=c.ANVIL_XDOMAIN_OR_PARSING_ERROR,e.name=u(e.code),e}const e=new Error(0===t.length?h.EMPTY_RESPONSE:h.BADLY_FORMED);throw e.code=0===t.length?c.ANVIL_EMPTY_RESPONSE_BODY:c.ANVIL_BADLY_FORMED_RESPONSE,e.name=u(e.code),e}if(null===t||0===t.length){const e=new Error(h.EMPTY_RESPONSE);throw e.code=c.ANVIL_EMPTY_RESPONSE_BODY,e.name=u(e.code),e}const n=t.filter(e=>null!=e.error)[0];if(n){const e=l(o(n,"error.code","500"));"Invalid token format"===o(n,"error.errorMessage.message")&&(n.error.errorMessage.message+=" Token: "+r);const t=new Error(o(n,"error.errorMessage.message",void 0===e?"Unknown error: "+n.error.code:h.NO_ERROR));throw t.code=e||c.ANVIL_UNEXPECTED_ERROR_CODE,t.name=u(t.code),t}return new a(t[0])})}),(e,t)=>e.code&&e.code>=3e3&&e.code<=3007&&g[t])}},function(e,t,n){"use strict";const r=n(10),i=n(7),o={[r.ANVIL_BADLY_FORMED_RESPONSE]:i.BADLY_FORMED_RESPONSE,[r.ANVIL_INVALID_HTTP_STATUS]:i.INVALID_HTTP_STATUS,[r.ANVIL_XDOMAIN_OR_PARSING_ERROR]:i.XDOMAIN_OR_PARSING_ERROR,[r.ANVIL_UNKNOWN_HTTP_ERROR]:i.UNKNOWN_HTTP_ERROR,[r.ANVIL_UNEXPECTED_ERROR_CODE]:i.UNEXPECTED_ERROR_CODE,[r.ANVIL_EMPTY_RESPONSE_BODY]:i.EMPTY_RESPONSE_BODY,[r.ANVIL_CONNECT_FAILED]:i.CONNECT_FAILED,[r.AUTHENTICATION_ERROR]:i.AUTHENTICATION_ERROR,[r.INVALID_SESSION_ID]:i.INVALID_SESSION_ID,[r.TERMS_OF_SERVICE_FAILURE]:i.TERMS_OF_SERVICE_FAILURE,[r.UNEXPECTED_SERVER_RESPONSE]:i.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return o[e]}},function(e,t,n){"use strict";const r=n(10),i={400:r.INVALID_SESSION_ID,403:r.AUTHENTICATION_ERROR,404:r.INVALID_SESSION_ID,409:r.TERMS_OF_SERVICE_FAILURE,500:r.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return i[e]}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5)),s=r(n(48));const a=n(18),c=n(763);let u=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this)||this)._generateKey=t.generateKey||c,n}(0,s.default)(t,e);var n=t.prototype;return n.set=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.keyPromise=this._generateKey(t,n),e.next=3,this.keyPromise;case 3:r=e.sent,this.emit("keyChanged",r);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.get=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,this.keyPromise;case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.clear=function(){this.keyPromise=void 0},t}(a);e.exports=u},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!1,r=!0,o=new TextEncoder,e.next=5,window.crypto.subtle.importKey("raw",o.encode(n),{name:"PBKDF2"},!1,["deriveBits","deriveKey"]);case 5:return s=e.sent,e.abrupt("return",window.crypto.subtle.deriveKey({name:"PBKDF2",salt:o.encode(t),iterations:1e5,hash:"SHA-256"},s,{name:"AES-CTR",length:256},r,["encrypt","decrypt"]));case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();e.exports=s},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));let s={SFrame:{}};n(3).isNode||(s=n(765));const a=s.SFrame,c=e=>a.createClient(e,{skipVp8PayloadHeader:!0});let u=function(){function e(){this._clientStore={}}var t=e.prototype;return t.createSender=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(void 0===t&&(t=0),!this.getSender(t)){e.next=3;break}return e.abrupt("return",this.getSender(t));case 3:return this._clientStore[t]||(this._clientStore[t]={}),e.next=6,c(t);case 6:return this._clientStore[t].sender=e.sent,e.abrupt("return",this.getSender(t));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.createReceiver=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.getReceiver(t)){e.next=2;break}return e.abrupt("return",this.getReceiver(t));case 2:return this._clientStore[t]||(this._clientStore[t]={}),e.next=5,c(t);case 5:return this._clientStore[t].receiver=e.sent,e.abrupt("return",this.getReceiver(t));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getSender=function(e){var t;return null==(t=this._clientStore[e])?void 0:t.sender},t.getReceiver=function(e){var t;return null==(t=this._clientStore[e])?void 0:t.receiver},t.deleteReceiver=function(e){this.getReceiver(e)&&(this._clientStore[e].receiver.deleteReceiver(e),delete this._clientStore[e].receiver)},t.deleteSender=function(e){var t;null==(t=this._clientStore[e])||delete t.sender},e}();e.exports=u},function(e,t,n){(function(t){var n;n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./index.js")}({"./Client.js":
32
+ /*!*******************!*\
33
+ !*** ./Client.js ***!
34
+ \*******************/
35
+ /*! exports provided: SFrame */function(e,n,r){"use strict";r.r(n),r.d(n,"SFrame",(function(){return o}));var i=r(/*! ./Worker.js */"./Worker.js");const o={createClient:async function(e,t){const n=new a;return await n.init(e,t),n}};async function s(e){return e instanceof CryptoKey&&"private"==e.type?await crypto.subtle.exportKey("pkcs8",e):e instanceof CryptoKey?await crypto.subtle.exportKey("raw",e):e instanceof Uint8Array?e.buffer.slice(0):e.slice(0)}class a extends EventTarget{constructor(){super(),this.worker=new i.default,this.transId=1,this.transactions=new Map,this.worker.addEventListener("message",async e=>{const t=e.data;if(t.transId){const e=this.transactions.get(t.transId);this.transactions.delete(t.transId),t.error?e.reject(new Error(t.error)):e.resolve(t.result)}else if(t.event){const e=new Event(t.event.name);e.id=t.event.data.id,e.senderId=t.event.data.senderId,this.dispatchEvent(e)}}),this.postMessage=(e,n,r)=>new t((t,i)=>{const o=this.transId++;this.worker.postMessage({transId:o,cmd:e,args:n},r),this.transactions.set(o,{resolve:t,reject:i})})}async init(e,t){return this.postMessage("init",{senderId:e,config:t})}async setSenderEncryptionKey(e){const t=await s(e);return this.postMessage("setSenderEncryptionKey",[t],[t])}async ratchetSenderEncryptionKey(){return this.postMessage("ratchetSenderEncryptionKey")}async setSenderSigningKey(e){const t=await s(e);return this.postMessage("setSenderSigningKey",[t])}async addReceiver(e){return this.postMessage("addReceiver",[e])}async setReceiverEncryptionKey(e,t){const n=await s(t);return this.postMessage("setReceiverEncryptionKey",[e,n],[n])}async setReceiverVerifyKey(e,t){const n=await s(t);return this.postMessage("setReceiverVerifyKey",[e,n],[n])}deleteReceiver(e){return this.postMessage("deleteReceiver",[e])}async encrypt(e,t){const n=t.track.kind,{readable:r,writable:i}=t.createEncodedStreams?t.createEncodedStreams():t.createEncodedVideoStreams?t.createEncodedVideoStreams():t.createEncodedAudioStreams();return this.postMessage("encrypt",{id:e,kind:n,readableStream:r,writableStream:i},[r,i])}async decrypt(e,t){const n=t.track.kind,{readable:r,writable:i}=t.createEncodedStreams?t.createEncodedStreams():t.createEncodedVideoStreams?t.createEncodedVideoStreams():t.createEncodedAudioStreams();return this.postMessage("decrypt",{id:e,kind:n,readableStream:r,writableStream:i},[r,i])}close(){this.worker.terminate();for(let e of this.transactions.values())e.reject(new Error("Client closed"));this.transactions.clear()}}},"./Worker.js":
36
+ /*!*******************!*\
37
+ !*** ./Worker.js ***!
38
+ \*******************/
39
+ /*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return o}));var r=n(/*! !./node_modules/worker-loader/dist/runtime/inline.js */"./node_modules/worker-loader/dist/runtime/inline.js"),i=n.n(r);function o(){return i()('/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== \'undefined\' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: \'Module\' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, \'__esModule\', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === \'object\' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, \'default\', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != \'string\') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module[\'default\']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, \'a\', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = "";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = "./Worker.js");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ "./Worker.js":\n/*!*******************!*\\\n !*** ./Worker.js ***!\n \\*******************/\n/*! no exports provided */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");\n/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lib_Context_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/Context.js */ "./lib/Context.js");\n/* harmony import */ var _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/VP8PayloadHeader.js */ "./lib/VP8PayloadHeader.js");\n/* harmony import */ var _lib_Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/Utils.js */ "./lib/Utils.js");\n/* harmony import */ var _lib_TaskQueue_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/TaskQueue.js */ "./lib/TaskQueue.js");\n\n\n\n\n\n\nconst postDecryptStatusMessage = lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()((message) => {\n\tpostMessage(message)\n}, 1000, { leading: false, trailing: true });\n\nlet context; \n\nonmessage = async (event) => {\n\t//Get data\n\tconst {transId,cmd,args} = event.data;\n\t\n\ttry {\n\t\tlet result = true;\n\t\t\n\t\t//Depending on the cmd\n\t\tswitch(event.data.cmd)\n\t\t{\n\t\t\tcase "init":\n\t\t\t{\n\t\t\t\t//Get info\n\t\t\t\tconst {senderId, config} = args;\n\t\t\t\t//Crate context\n\t\t\t\tcontext = new _lib_Context_js__WEBPACK_IMPORTED_MODULE_1__["Context"](senderId, config);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase "encrypt":\n\t\t\t{\n\t\t\t\t//The recrypt queue\n\t\t\t\tconst tasks = new _lib_TaskQueue_js__WEBPACK_IMPORTED_MODULE_4__["TaskQueue"]();\n\t\t\t\t//Get event data\n\t\t\t\tconst{id, kind, readableStream, writableStream} = args;\n\t\t\t\t//Create transform stream foo encrypting\n\t\t\t\tconst transformStream = new TransformStream({\n\t\t\t\t\ttransform: async (chunk, controller)=>{\n\t\t\t\t\t\t//Nothing in clear\n\t\t\t\t\t\tlet skip = 0;\n\t\t\t\t\t\t//Check if it is video and we are skipping vp8 payload header\n\t\t\t\t\t\tif (kind=="video" && context.isSkippingVp8PayloadHeader())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Get VP8 header\n\t\t\t\t\t\t\tconst vp8 = _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_2__["VP8PayloadHeader"].parse(chunk.data);\n\t\t\t\t\t\t\t//Skip it\n\t\t\t\t\t\t\tskip = vp8.byteLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Enqueue task\n\t\t\t\t\t\ttasks.enqueue (\n\t\t\t\t\t\t\tcontext.encrypt(kind, id, chunk.data, skip),\n\t\t\t\t\t\t\t(encrypted) => {\n\t\t\t\t\t\t\t\t//Set back encrypted payload\n\t\t\t\t\t\t\t\tchunk.data = encrypted.buffer;\n\t\t\t\t\t\t\t\t//write back\n\t\t\t\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(error)=>{\n\t\t\t\t\t\t\t\t//TODO: handle errors\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//Encrypt\n\t\t\t\treadableStream\n\t\t\t\t\t.pipeThrough(transformStream)\n\t\t\t\t\t.pipeTo(writableStream);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase "decrypt":\n\t\t\t{\n\t\t\t\t//The recrypt queue\n\t\t\t\tconst tasks = new _lib_TaskQueue_js__WEBPACK_IMPORTED_MODULE_4__["TaskQueue"]();\n\t\t\t\t//Last reveiced senderId\n\t\t\t\tlet senderId = -1;\n\t\t\t\t//Get event data\n\t\t\t\tconst{id, kind, readableStream, writableStream} = args;\n\t\t\t\t//Create transform stream for encrypting\n\t\t\t\tconst transformStream = new TransformStream({\n\t\t\t\t\ttransform: async (chunk, controller)=>{\n\t\t\t\t\t\t//Nothing in clear\n\t\t\t\t\t\tlet skip = 0;\n\t\t\t\t\t\t//Check if it is video and we are skipping vp8 payload header\n\t\t\t\t\t\tif (kind=="video" && context.isSkippingVp8PayloadHeader())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Get VP8 header\n\t\t\t\t\t\t\tconst vp8 = _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_2__["VP8PayloadHeader"].parse(chunk.data);\n\t\t\t\t\t\t\t//Skip it\n\t\t\t\t\t\t\tskip = vp8.byteLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Enqueue task\n\t\t\t\t\t\ttasks.enqueue(\n\t\t\t\t\t\t\tcontext.decrypt(kind, id, chunk.data, skip),\n\t\t\t\t\t\t\t(decrypted) => {\n\t\t\t\t\t\t\t\t//Set back decrypted payload\n\t\t\t\t\t\t\t\tchunk.data = decrypted.buffer;\n\t\t\t\t\t\t\t\t//write back\n\t\t\t\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t\t\t\t\t//If it is a sender\n\t\t\t\t\t\t\t\tif (decrypted.senderId!=senderId)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//Store it\n\t\t\t\t\t\t\t\t\tsenderId = decrypted.senderId;\n\t\t\t\t\t\t\t\t\t//Launch event\n\t\t\t\t\t\t\t\t\tpostMessage ({event: {\n\t\t\t\t\t\t\t\t\t\tname\t: "authenticated",\n\t\t\t\t\t\t\t\t\t\tdata\t: {\n\t\t\t\t\t\t\t\t\t\t\tid\t : id,\n\t\t\t\t\t\t\t\t\t\t\tsenderId : senderId\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (decrypted.decryptionRestored) {\n\t\t\t\t\t\t\t\t\tpostDecryptStatusMessage({\n\t\t\t\t\t\t\t\t\t\tevent: {\n\t\t\t\t\t\t\t\t\t\t\tname: "decryptionRestored",\n\t\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\t\tsenderId,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(error) => {\n\t\t\t\t\t\t\t\tif (error.message === \'decryptFailed\') {\n\t\t\t\t\t\t\t\t\tpostDecryptStatusMessage({\n\t\t\t\t\t\t\t\t\t\tevent: {\n\t\t\t\t\t\t\t\t\t\t\tname: "decryptFailed",\n\t\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\t\tsenderId,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//Decrypt\n\t\t\t\treadableStream\n\t\t\t\t\t.pipeThrough(transformStream)\n\t\t\t\t\t.pipeTo(writableStream);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\t//Excute "cmd" method on context\n\t\t\t\tresult = await context[cmd](...args || []);\n\t\t}\n\t\t//Send result back\n\t\tpostMessage ({transId,result});\n\t} catch (error) {\n\t\tconsole.error(error);\n\t\t//Send error back\n\t\tpostMessage({transId,error});\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/AesCm128HmacSha256EncryptionKey.js":\n/*!************************************************!*\\\n !*** ./lib/AesCm128HmacSha256EncryptionKey.js ***!\n \\************************************************/\n/*! exports provided: AesCm128HmacSha256EncryptionKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AesCm128HmacSha256EncryptionKey", function() { return AesCm128HmacSha256EncryptionKey; });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ "./lib/Utils.js");\n/* harmony import */ var _Salts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Salts.js */ "./lib/Salts.js");\n/* harmony import */ var _IV_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IV.js */ "./lib/IV.js");\n\n\n\n\nconst ratchetKey = (key) => \n\tcrypto.subtle.deriveBits(\n\t\t{\n\t\t\tname : "HKDF",\n\t\t\thash : "SHA-256",\n\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].RatchetKey,\n\t\t\tinfo : new ArrayBuffer()\n\t\t},\n\t\tkey,\n\t\t256\n\t);\n\nclass AesCm128HmacSha256EncryptionKey \n{\n\tconstructor(){\n\t\tthis.ratchets = [];\n\t}\n\n\tasync setKey(key)\n\t{\n\t\tif (key instanceof CryptoKey)\n\t\t{\n\t\t\t//Check private key algorithm\n\t\t\tif (key.algorithm.name!="HKDF")\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t} else {\n\t\t\t//Import key\n\t\t\tkey = await crypto.subtle.importKey(\n\t\t\t\t"raw",\n\t\t\t\tkey,\n\t\t\t\t"HKDF",\n\t\t\t\tfalse,\n\t\t\t\t["deriveBits", "deriveKey"]\n\t\t\t);\n\t\t}\n\t\tthis.key = key;\n\t\t\n\t\t//Get salt key\n\t\tthis.saltKey = new Uint8Array(await crypto.subtle.deriveBits(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].SaltKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t128\n\t\t));\n\t\n\t\t//Get encryption key\n\t\tthis.encryptionKey = await crypto.subtle.deriveKey(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].EncryptionKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t{\n\t\t\t\tname : "AES-CTR",\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tfalse,\n\t\t\t["encrypt","decrypt"]\n\t\t);\n\t\n\t\t//Get authentication key\n\t\tthis.authKey = await crypto.subtle.deriveKey(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].AuthenticationKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t{\n\t\t\t\tname : "HMAC",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tlength : 256\n\t\t\t},\n\t\t\tfalse,\n\t\t\t["sign","verify"]\n\t\t);\n\t}\n\n\t\n\tasync encrypt(type,header,payload,extraBytes,skip)\n\t{\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Create IV\n\t\tconst iv = _IV_js__WEBPACK_IMPORTED_MODULE_2__["IV"].generate(header.keyId, header.counter, this.saltKey);\n\t\t\n\t\t//Encrypt\n\t\tconst encrypted = await crypto.subtle.encrypt(\n\t\t\t{\n\t\t\t\tname\t: "AES-CTR",\n\t\t\t\tcounter : iv,\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tthis.encryptionKey,\n\t\t\tpayload\n\t\t);\n\t\n\t\t//Get auth tag length from media type\n\t\tconst authTagLength = AesCm128HmacSha256EncryptionKey.getAuthTagLen(type);\n\t\t\n\t\t//Create encrypted frame\n\t\tconst encryptedFrame = new Uint8Array(header.byteLength + payload.byteLength + authTagLength + extraBytes + skip);\n\t\t\n\t\t//Set header and encrypted payolad\n\t\tencryptedFrame.set(header, skip);\n\t\tencryptedFrame.set(new Uint8Array(encrypted), skip + header.length);\n\t\t\n\t\t//Authenticate\n\t\tconst signature = new Uint8Array(await crypto.subtle.sign(\n\t\t\t"HMAC",\n\t\t\tthis.authKey, \n\t\t\tencryptedFrame.subarray(skip, skip + header.byteLength + encrypted.byteLength)\n\t\t));\n\t\n\t\t//Truncate\n\t\tconst authTag = signature.subarray(0, authTagLength);\n\t\n\t\t//Append authentication tag\n\t\tencryptedFrame.set(authTag, skip + encrypted.byteLength + header.byteLength );\n\t\t\n\t\t//Done\n\t\treturn [encryptedFrame,authTag];\n\t\t\n\t}\n\t\n\tasync decrypt(type, header, encryptedFrame, extrabytes, skip)\n\t{\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Create IV\n\t\tconst iv = _IV_js__WEBPACK_IMPORTED_MODULE_2__["IV"].generate(header.keyId, header.counter, this.saltKey);\n\t\t\n\t\t//Get auth tag length from media type\n\t\tconst authTagLength = AesCm128HmacSha256EncryptionKey.getAuthTagLen(type);\n\t\t\n\t\t//Get encrypted frame length (without extra bytes from signature)\n\t\tconst frameLength = encryptedFrame.byteLength - extrabytes - skip;\n\t\t\n\t\t//Get authentication tag\n\t\tconst authTag = encryptedFrame.subarray(skip + frameLength - authTagLength, skip + frameLength);\n\t\t\n\t\t//Get encrypted payload\n\t\tconst encrypted = encryptedFrame.subarray(skip + header.byteLength, skip + frameLength - authTagLength);\n\t\t\n\t\t//Calculate signature\n\t\tconst signature = new Uint8Array(await crypto.subtle.sign(\n\t\t\t"HMAC",\n\t\t\tthis.authKey, \n\t\t\tencryptedFrame.subarray(skip, skip + header.byteLength + encrypted.byteLength)\n\t\t));\n\t\n\t\t//Authenticate authTag\n\t\tlet authenticated = true;\n\t\t//Avoid timimg attacks by iterating over all bytes\n\t\tfor (let i=0;i<authTagLength;++i)\n\t\t\t//check signature\n\t\t\tauthenticated &= authTag[i]===signature[i];\n\t\t\n\t\t//If not all where equal\n\t\tif (!authenticated)\n\t\t\t//Authentication error\n\t\t\tthrow new Error("Authentication error");\n\t\t\n\t\t//Decrypt\n\t\tconst payload = new Uint8Array (await crypto.subtle.decrypt(\n\t\t\t{\n\t\t\t\tname\t: "AES-CTR",\n\t\t\t\tcounter : iv,\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tthis.encryptionKey,\n\t\t\tencrypted\n\t\t));\n\t\t\n\t\t//Done\n\t\treturn [payload, authTag];\n\t}\n\t\n\tasync ratchet(index)\n\t{\n\t\t// return stored key if exists\n\t\tif (this.ratchets[index]) {\n\t\t\treturn this.ratchets[index];\n\t\t}\n\t\t\n\t\t//Create new key\n\t\tconst key = new AesCm128HmacSha256EncryptionKey();\n\n\t\t// Get previous ratchet\n\t\tconst previousRatchetKey = index === 0 ? this.key : this.ratchets[index - 1].key;\n\t\t\n\t\t//Set ratchet key\n\t\tawait key.setKey(await ratchetKey(previousRatchetKey));\n\t\t\n\t\tthis.ratchets[index] = key;\n\t\t//Done\n\t\treturn key;\n\t}\n\t\n\tstatic getAuthTagLen(type)\n\t{\n\t\treturn type.toLowerCase()==="video" ? 10 : 4;\n\t};\n\t\n\tstatic async create(raw) \n\t{\n\t\t//Create new key\n\t\tconst key = new AesCm128HmacSha256EncryptionKey();\n\t\t//Set raw key\n\t\tawait key.setKey(raw);\n\t\t//Done\n\t\treturn key;\n\t}\n};\n\n\n\n/***/ }),\n\n/***/ "./lib/Context.js":\n/*!************************!*\\\n !*** ./lib/Context.js ***!\n \\************************/\n/*! exports provided: Context */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _Sender_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sender.js */ "./lib/Sender.js");\n/* harmony import */ var _Receiver_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Receiver.js */ "./lib/Receiver.js");\n\n\n\n\nclass Context\n{\n\t\n\tconstructor(senderId, config)\n\t{\n\t\t//Store config\n\t\tthis.config = Object.assign({}, config);\n\t\t//Only one sender per context\n\t\tthis.sender = new _Sender_js__WEBPACK_IMPORTED_MODULE_1__["Sender"](senderId);\n\t\t\n\t\t//The map of known remote senders\n\t\tthis.receivers = new Map();\n\t}\n\t\n\tisSkippingVp8PayloadHeader()\n\t{\n\t\treturn !!this.config.skipVp8PayloadHeader;\n\t}\n\t\t\n\tasync setSenderEncryptionKey(key)\n\t{\n\t\t//Set it\n\t\treturn this.sender.setEncryptionKey(key);\n\t}\n\t\n\tasync ratchetSenderEncryptionKey()\n\t{\n\t\t//Set it\n\t\treturn this.sender.ratchetEncryptionKey();\n\t}\n\t\n\tasync setSenderSigningKey(key)\n\t{\n\t\t//Set it\n\t\treturn this.sender.setSigningKey(key);\n\t}\n\t\n\taddReceiver(receiverkKeyId)\n\t{\n\t\t//Check we don\'t have a receiver already for that id\n\t\tif(this.receivers.has(receiverkKeyId))\n\t\t\t//Error\n\t\t\tthrow new Error("There was already a receiver for keyId "+receiverkKeyId);\n\t\t//Add new\n\t\tthis.receivers.set(receiverkKeyId, new _Receiver_js__WEBPACK_IMPORTED_MODULE_2__["Receiver"](receiverkKeyId));\n\t}\n\t\n\tasync setReceiverEncryptionKey(receiverkKeyId, key)\n\t{\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(receiverkKeyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId "+receiverkKeyId);\n\t\t\n\t\t//Rachet\n\t\treturn receiver.setEncryptionKey(key);\n\t}\n\t\n\tasync setReceiverVerifyKey(receiverkKeyId,key)\n\t{\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(receiverkKeyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId "+receiverkKeyId);\n\t\t\n\t\t//Rachet\n\t\treturn receiver.setVerifyKey(key);\n\t}\n\t\n\tdeleteReceiver(receiverkKeyId)\n\t{\n\t\t//Delete receiver\n\t\treturn this.receivers.delete(receiverkKeyId);\n\t}\n\t\n\tasync encrypt(type, ssrcId, frame, skip)\n\t{\n\t\t//Encrypt it\n\t\treturn this.sender.encrypt(type, ssrcId, frame, skip);\n\t}\n\t\n\tasync decrypt(type, ssrcId, encryptedFrame, skip)\n\t{\n\t\t//convert if needed\n\t\tif (!(encryptedFrame instanceof Uint8Array))\n\t\t\tencryptedFrame = new Uint8Array (encryptedFrame);\n\t\t\n\t\t//Parse encrypted payload\n\t\tconst header = _Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].parse(encryptedFrame.subarray(skip));\n\t\t\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(header.keyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId " + header.keyId);\n\t\t\n\t\t//Decrypt it\n\t\treturn receiver.decrypt(type, ssrcId, header, encryptedFrame, skip);\n\t}\n\t\n};\n\n\n/***/ }),\n\n/***/ "./lib/EcdsaSignKey.js":\n/*!*****************************!*\\\n !*** ./lib/EcdsaSignKey.js ***!\n \\*****************************/\n/*! exports provided: EcdsaSignKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EcdsaSignKey", function() { return EcdsaSignKey; });\n//TODO: Update to Ed25519 when available\n// https://chromestatus.com/features/4913922408710144\n// https://chromium.googlesource.com/chromium/src/+log/master/components/webcrypto/algorithms/ed25519.cc\n\nclass EcdsaSignKey\n{\n\t\n\tasync setKey(privKey)\n\t{\n\t\t//If it is a crypto key already\n\t\tif (privKey instanceof CryptoKey)\n\t\t{\n\t\t\t//Check private key algorithm\n\t\t\tif (privKey.algorithm.name!="ECDSA" || !privKey.usages.includes("sign"))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t\t//Set it\n\t\t\tthis.privKey = privKey;\n\t\t} else {\n\t\t\t//Import it\n\t\t\tthis.privKey = await crypto.subtle.importKey(\n\t\t\t\t"pkcs8",\n\t\t\t\tprivKey,\n\t\t\t\t{\n\t\t\t\t\tname\t\t: "ECDSA",\n\t\t\t\t\tnamedCurve\t: "P-521"\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t["sign"]\n\t\t\t);\n\t\t}\n\t}\n\t\n\tasync sign(authTags)\n\t{\n\t\t//Verify\n\t\treturn new Uint8Array(await crypto.subtle.sign(\n\t\t\t{\n\t\t\t name: "ECDSA",\n\t\t\t hash: "SHA-512"\n\t\t\t},\n\t\t\tthis.privKey,\n\t\t\tauthTags\n\t\t));\n\t}\n\t\n\tstatic getSignatureLen()\n\t{\n\t\treturn 64;\n\t}\n\t\n\tstatic async create(privKey)\n\t{\n\t\t//Craete key\n\t\tconst key = new EcdsaSignKey();\n\t\t//Set key\n\t\tawait key.setKey(privKey);\n\t\t//Done\n\t\treturn key;\n\t\t\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/EcdsaVerifyKey.js":\n/*!*******************************!*\\\n !*** ./lib/EcdsaVerifyKey.js ***!\n \\*******************************/\n/*! exports provided: EcdsaVerifyKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EcdsaVerifyKey", function() { return EcdsaVerifyKey; });\n\nclass EcdsaVerifyKey\n{\n\tasync setKey(pubKey)\n\t{\n\t\t//If it is a crypto key already\n\t\tif (pubKey instanceof CryptoKey)\n\t\t{\n\t\t\t//Check \n\t\t\tif (pubKey.algorithm.name!="ECDSA" || !pubKey.usages.includes("verify"))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t\t//Set it\n\t\t\tthis.pubKey = pubKey;\n\t\t} else {\n\t\t\t//Import it\n\t\t\tthis.pubKey = await crypto.subtle.importKey(\n\t\t\t\t"raw",\n\t\t\t\tpubKey,\n\t\t\t\t{\n\t\t\t\t\tname\t\t: "ECDSA",\n\t\t\t\t\tnamedCurve\t: "P-521"\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t["verify"]\n\t\t\t);\n\t\t}\n\t}\n\t\n\tasync verify(signed,signature)\n\t{\n\t\t//Verify\n\t\treturn await window.crypto.subtle.verify(\n\t\t\t{\n\t\t\t\tname: "ECDSA",\n\t\t\t\thash: "SHA-512"\n\t\t\t},\n\t\t\tthis.pubKey,\n\t\t\tsignature,\n\t\t\tsigned\n\t\t);\n\t}\n\t\n\tstatic getSignatureLen()\n\t{\n\t\treturn 64;\n\t}\n\t\n\tstatic async create(pubKey)\n\t{\n\t\t//Craete key\n\t\tconst key = new EcdsaVerifyKey();\n\t\t//Set key\n\t\tawait key.setKey(pubKey);\n\t\t//Done\n\t\treturn key;\n\t\t\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Header.js":\n/*!***********************!*\\\n !*** ./lib/Header.js ***!\n \\***********************/\n/*! exports provided: Header */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return Header; });\n/*\n\t0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+\n\t|S|LEN |X| K |\n\t+-+-+-+-+-+-+-+-+\n\tSFrame header metadata\n\n\tSignature flag (S): 1 bit This field indicates the payload contains a signature of set. Counter Length (LEN): 3 bits This field indicates the length of the CTR fields in bytes. Extended Key Id Flag (X): 1 bit\n\tIndicates if the key field contains the key id or the key length. Key or Key Length: 3 bits This field contains the key id (KID) if the X flag is set to 0, or the key length (KLEN) if set to 1.\n\n\tIf X flag is 0 then the KID is in the range of 0-7 and the frame counter (CTR) is found in the next LEN bytes:\n\n\t 0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+---------------------------------+\n\t|S|LEN |0| KID | CTR... (length=LEN) |\n\t+-+-+-+-+-+-+-+-+---------------------------------+\n\tKey id (KID): 3 bits The key id (0-7). Frame counter (CTR): (Variable length) Frame counter value up to 8 bytes long.\n\n\tif X flag is 1 then KLEN is the length of the key (KID), that is found after the SFrame header metadata byte. After the key id (KID), the frame counter (CTR) will be found in the next LEN bytes:\n\n\t 0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+---------------------------+---------------------------+\n\t|S|LEN |1|KLEN | KID... (length=KLEN) | CTR... (length=LEN) |\n\t+-+-+-+-+-+-+-+-+---------------------------+---------------------------+\n*/\nconst Header = {\n\t\n\tparse : function(buffer) \n\t{\n\t\t//Create uint view\n\t\tconst view = new Uint8Array(buffer);\n\t\t\n\t\t//Get metadata\n\t\tconst metadata = view[0];\n\t\t\n\t\t//Get values\n\t\tconst s\t\t= !!(metadata & 0x80);\n\t\tconst len\t= (metadata >> 4) & 0x07;\n\t\tconst x\t\t= !!(metadata & 0x08);\n\t\tconst k\t\t= metadata & 0x07;\n\t\t\n\t\t//Get key id\n\t\tlet keyId = 0;\n\t\t//Check if it is the extented key format\n\t\tif (x)\n\t\t{\n\t\t\t//Read length\n\t\t\tfor (let i=0;i<k;i++)\n\t\t\t\tkeyId = (keyId * 256) + view[i+1];\n\t\t} else {\n\t\t\t//Short version\n\t\t\tkeyId = k;\n\t\t}\n\t\t\n\t\t//Get ctr\n\t\tconst ini = x ? k + 1 : 1;\n\t\tlet counter = 0;\n\t\t//Read length\n\t\tfor (let i=0;i<len;i++)\n\t\t\tcounter = (counter * 256) + view[ini+i];\n\t\t\n\t\t//Get header buffer view\n\t\tconst header = view.subarray(0, x ? k + len + 1 : len + 1);\n\t\t\n\t\t//Add parsed atributes\n\t\theader.signature = s;\n\t\theader.keyId\t = keyId;\n\t\theader.counter\t = counter;\n\t\t\n\t\t//Done\n\t\treturn header; \n\t},\n\tgenerate: function(signature,keyId,counter)\n\t{\n\t\t//Check keyId\n\t\tHeader.checkKeyId(keyId);\n\t\t\n\t\t//Calcultate variavle length\n\t\tconst varlen = (x) => x ? parseInt(Math.log(x) / Math.log(256))+1 : 1;\n\t\t\n\t\t//Get key extension and length\n\t\tconst x = keyId > 7;\n\t\tconst k = x ? varlen(keyId) : keyId;\n\t\t\n\t\t//Get counter length\n\t\tconst len = varlen(counter);\n\t\t\n\t\t//Ensure counter is not huge\n\t\tif (len>7)\n\t\t\t//Error\n\t\t\tthrow new Error("Counter is too big");\n\t\t\n\t\t//Generate header\n\t\tconst header = new Uint8Array( x ? 1 + k + len : 1 + len);\n\t\t\n\t\t//Set metadata header\n\t\theader[0] = !!signature;\n\t\theader[0] = header[0] << 3 | ( len & 0x07);\n\t\theader[0] = header[0] << 1 | x;\n\t\theader[0] = header[0] << 3 | ( k & 0x07);\n\t\t\n\t\t//Add parsed atributes\n\t\theader.signature = !!signature;\n\t\theader.keyId\t = keyId;\n\t\theader.counter\t = counter;\n\t\t\n\t\t//If extended key\n\t\tif (x)\n\t\t\t//Add key id\n\t\t\tfor (let i=0; i<k; ++i)\n\t\t\t\theader[i+1] = (keyId >> (k-1-i)*8) & 0xff;\n\t\t//The coutner init\n\t\tconst ini = x ? k + 1 : 1;\n\t\t//Add counter\n\t\tfor (let i=0; i<len; ++i)\n\t\t\theader[ini+i] = (counter >> (len-1-i)*8) & 0xff;\n\t\t\t\n\t\t\n\t\t//Done\n\t\treturn header;\n\t}\n};\n\nHeader.MaxKeyId = 0xFFFFFFFFFF;\n\nHeader.checkKeyId = function(keyId)\n{\n\t//Check it is possitive\n\tif (keyId<0)\n\t\t//Error\n\t\tthrow new Error("keyId must be possitive");\n\t//Check it is possitive\n\tif (keyId>Header.MaxKeyId)\n\t\t//Error\n\t\tthrow new Error("keyId must be 5 bytes long at most");\n};\n\n\n/***/ }),\n\n/***/ "./lib/IV.js":\n/*!*******************!*\\\n !*** ./lib/IV.js ***!\n \\*******************/\n/*! exports provided: IV */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IV", function() { return IV; });\nconst IV = \n{\n\tgenerate : function(keyId,counter,salt)\n\t{\n\t\t//128 bits\n\t\tconst iv = new Uint8Array (16);\n\t\t//Get view\n\t\tconst view = new DataView(iv.buffer);\n\t\t//Set keyId\n\t\tview.setBigUint64(0, BigInt(counter));\n\t\t//Set coutner\n\t\tview.setBigUint64(8, BigInt(keyId));\n\t\t//Xor with salt key\n\t\tfor (let i=0; i<iv.byteLength; ++i)\n\t\t\t//xor\n\t\t\tview.setUint8(i,iv[i]^salt[i]); \n\t\t//return buffer\n\t\treturn iv;\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Receiver.js":\n/*!*************************!*\\\n !*** ./lib/Receiver.js ***!\n \\*************************/\n/*! exports provided: Receiver */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Receiver", function() { return Receiver; });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ "./lib/Utils.js");\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _EcdsaVerifyKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EcdsaVerifyKey.js */ "./lib/EcdsaVerifyKey.js");\n/* harmony import */ var _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AesCm128HmacSha256EncryptionKey.js */ "./lib/AesCm128HmacSha256EncryptionKey.js");\n\n\n\n\n\nconst MaxRatchetAttempts = 5;\nconst ReplayWindow = 128;\nconst KeyTimeout = 1000;\n\nclass Receiver\n{\n\tconstructor(senderId)\n\t{\n\t\t//Check keyId\n\t\t_Header_js__WEBPACK_IMPORTED_MODULE_1__["Header"].checkKeyId(senderId);\n\t\t\n\t\t//Store sender id\n\t\tthis.senderId = senderId;\n\t\t//Last received counter\n\t\tthis.maxReceivedCounter = -1;\n\t\t//Number or ratchets of current key\n\t\tthis.numKeyRatchets = 0;\n\t\t//Create keyring\n\t\tthis.keyring = [];\n\t\t//Pending verified tags\n\t\tthis.pending = new Map();\n\t\t// has failed decryption\n\t\tthis.keyFailing = false;\n\n\t\t//Scheduled keys\n\t\tthis.scheduledKeys = new WeakSet ();\n\n\t\t//Function to clear up keys up to given one\n\t\tthis.schedulePreviousKeysTimeout = (key) =>{\n\t\t\t//If this is the only key\n\t\t\tif (this.keyring.length==1 && this.keyring[0]===key)\n\t\t\t\t//Do nothing\n\t\t\t\treturn;\n\t\t\t//If has been already scheduled\n\t\t\tif (this.scheduledKeys.has(key))\n\t\t\t\t//Not do it twice\n\t\t\t\treturn;\n\t\t\t//Add it\n\t\t\tthis.scheduledKeys.add(key);\n\t\t\t//Schedule key timeout of previous keys\n\t\t\tsetTimeout(()=>{\n\t\t\t\t//Find key index\n\t\t\t\tconst i = this.keyring.findIndex(k=>k===key);\n\t\t\t\t//Remove previous keys\n\t\t\t\tthis.keyring = this.keyring.splice(i);\n\t\t\t}, KeyTimeout);\n\t\t};\n\t}\n\t\n\tasync decrypt(type, ssrcId, header, encryptedFrame, skip)\n\t{\n\t\tlet authTag, payload, extrabytes = 0, signature, signed;\n\t\tconst prevAuthTags = [];\n\t\t\n\t\t//convert if needed\n\t\tif (!(encryptedFrame instanceof Uint8Array))\n\t\t\tencryptedFrame = new Uint8Array (encryptedFrame);\n\n\t\t// Replay attack protection\n\t\tif (header.counter < this.maxReceivedCounter && (this.maxReceivedCounter - header.counter) > ReplayWindow) {\n\t\t\t//Error\n\t\t\tthrow new Error("Replay check failed, frame counter too old");\n\t\t}\n\t\t\n\t\t//Check if frame contains signature\n\t\tif (header.signature)\n\t\t{\n\t\t\t//Start from the end\n\t\t\tlet end = encryptedFrame.byteLength;\n\t\t\t\n\t\t\t//Get lengths\n\t\t\tconst singatureLength = ECDSAVerifyKey.getSignatureLen();\n\t\t\tconst authTagLength = _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type);\n\t\t\t\n\t\t\t//Get signature\n\t\t\tsignature = encryptedFrame.subarray(end - singatureLength, end);\n\t\t\t//Move backward\n\t\t\tend -= singatureLength;\n\t\t\t\n\t\t\t//Get number of tags\n\t\t\tconst num = encryptedFrame[end--];\n\t\t\t\n\t\t\t//Read all tags\n\t\t\tfor (let i=0; i<num; ++i)\n\t\t\t{\n\t\t\t\t//Get previous tag\n\t\t\t\tconst prevTag = encryptedFrame.subarray(end - authTagLength, end);\n\t\t\t\t//Move backward\n\t\t\t\tend -= authTagLength;\n\t\t\t\t//Add tag to previous tags in hex\n\t\t\t\tprevAuthTags.push(_Utils_js__WEBPACK_IMPORTED_MODULE_0__["Utils"].toHex(prevTag))\n\t\t\t}\n\t\t\t//Get the extra bytes\n\t\t\textrabytes = encryptedFrame.byteLength - end;\n\t\t\t\n\t\t\t//Move backward to start oth current frame auth tag\n\t\t\tend -= authTagLength;\n\t\t\t\n\t\t\t//Get singed part\n\t\t\tsigned = encryptedFrame.subarray(end, encryptedFrame.byteLength - singatureLength)\n\t\t}\n\n\t\t//For each key in key ring\n\t\tfor (let i=0;i<this.keyring.length;++i)\n\t\t{\n\t\t\t//Get key from ring\n\t\t\tconst key = this.keyring[i];\n\t\t\ttry {\n\t\t\t\t//Try to decrypt payload\n\t\t\t\t[payload, authTag] = await key.decrypt(type, header, encryptedFrame, extrabytes, skip);\n\t\t\t\t//Done\n\t\t\t\tbreak;\n\t\t\t} catch(e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t//If not found yet\n\t\tif (!payload)\n\t\t{\n\t\t\t//Get last key\n\t\t\tconst key = this.keyring[this.keyring.length-1];\n\t\t\t//Try ratchet last key\n\t\t\tfor (let i = 0; i < MaxRatchetAttempts; ++i)\n\t\t\t{\n\t\t\t\t//Ratchet key\n\t\t\t\tconst ratchetKey = await key.ratchet(i);\n\t\t\t\ttry {\n\t\t\t\t\t//Try to decrypt payload\n\t\t\t\t\t[payload, authTag] = await ratchetKey.decrypt(type, header, encryptedFrame, extrabytes, skip);\n\t\t\t\t\t// Set working ratchet as new key\n\t\t\t\t\tthis.keyring.push(ratchetKey);\n\t\t\t\t\tthis.schedulePreviousKeysTimeout(ratchetKey);\n\t\t\t\t\t//Done\n\t\t\t\t\tbreak;\n\t\t\t\t} catch(e) {\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Last check\n\t\tif (!payload) {\n\t\t\t//Decryption failed\n\t\t\tif (this.keyFailing) {\n\t\t\t\tthrow new Error(\'decryptStillFailing\')\n\t\t\t} else {\n\t\t\t\tthis.keyFailing = true;\n\t\t\t\tthrow new Error("decryptFailed");\n\t\t\t}\n\t\t}\n\n\t\t//If we are sending part of the frame in clear\n\t\tif (skip)\n\t\t\t//Copy skiped payload\n\t\t\tpayload.set(encryptedFrame.subarray(0,skip),0);\n\n\t\t//Check if have received anything from this ssrc before\n\t\tif (!this.pending.has(ssrcId))\n\t\t\t//Add it\n\t\t\tthis.pending.set(ssrcId,new Set());\n\n\t\t//Get pending list\n\t\tconst pending = this.pending.get(ssrcId);\n\n\t\t//Check if it constains signatures\n\t\tif (header.signed)\n\t\t{\n\t\t\t//try to verify list\n\t\t\tif (!await this.verifyKey.verify(signed,signature))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Could not verify signature");\n\t\t\t//For each signed tag\n\t\t\tfor (const tag in prevAuthTags)\n\t\t\t\t//Delete from pending to be verified tags\n\t\t\t\tpending.delete(tag);\n\t\t} else {\n\t\t\t//Push this tag to\n\t\t\tpending.add(_Utils_js__WEBPACK_IMPORTED_MODULE_0__["Utils"].toHex(authTag));\n\t\t}\n\n\t\t//Set authenticated sender id and frame Id\n\t\tpayload.senderId = header.keyId;\n\t\tpayload.frameId = header.counter;\n\n\t\t// inform that decryption is working after previously failing\n\t\tif (this.keyFailing) {\n\t\t\tpayload.decryptionRestored = true;\n\t\t\tthis.keyFailing = false;\n\t\t}\n\n\t\t//Store last received counter\n\t\tthis.maxReceivedCounter = Math.max(header.counter, this.maxReceivedCounter);\n\n\t\t//Return decrypted payload\n\t\treturn payload;\n\t}\n\n\tasync setVerifyKey(key)\n\t{\n\t\t//Create new singing key\n\t\tthis.verifyKey = _EcdsaVerifyKey_js__WEBPACK_IMPORTED_MODULE_2__["EcdsaVerifyKey"].create(key);\n\t}\n\n\tasync setEncryptionKey(raw)\n\t{\n\t\t//Create new encryption key\n\t\tconst key = await _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__["AesCm128HmacSha256EncryptionKey"].create(raw);\n\t\t//Append to the keyring\n\t\tthis.keyring.push(key);\n\t\t//Restart ratchet count number\n\t\tthis.numKeyRatchets = 0;\n\t\t//Activate\n\t\tthis.schedulePreviousKeysTimeout(key);\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Salts.js":\n/*!**********************!*\\\n !*** ./lib/Salts.js ***!\n \\**********************/\n/*! exports provided: Salts */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Salts", function() { return Salts; });\nconst textEncoder = new TextEncoder()\n\nconst Salts = {\n\t"SaltKey"\t\t: textEncoder.encode("SFrameSaltKey"),\n\t"EncryptionKey"\t\t: textEncoder.encode("SFrameEncryptionKey"),\n\t"AuthenticationKey"\t: textEncoder.encode("SFrameAuthenticationKey"),\n\t"RatchetKey"\t\t: textEncoder.encode("SFrameRatchetKey")\n};\n\n\n/***/ }),\n\n/***/ "./lib/Sender.js":\n/*!***********************!*\\\n !*** ./lib/Sender.js ***!\n \\***********************/\n/*! exports provided: Sender */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sender", function() { return Sender; });\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EcdsaSignKey.js */ "./lib/EcdsaSignKey.js");\n/* harmony import */ var _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AesCm128HmacSha256EncryptionKey.js */ "./lib/AesCm128HmacSha256EncryptionKey.js");\n\n\n\n\n\nconst SigningFrameInterval = 10;\n\nclass Sender\n{\n\tconstructor(senderId)\n\t{\n\t\t//Check keyId\n\t\t_Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].checkKeyId(senderId);\n\t\t\n\t\t//The global frame counter\n\t\tthis.counter = 0;\n\t\t\n\t\t//Store senderId/keyId\n\t\tthis.senderId = senderId;\n\t\t\n\t\t//Pending frames for signing\n\t\tthis.pending = new Map();\n\t}\n\t\n\tasync encrypt(type, ssrcId, payload, skip)\n\t{\n\t\t//Check we have a valid key\n\t\tif (!this.key)\n\t\t\tthrow Error("Encryption key not set");\n\t\t\n\t\t//convert if needed\n\t\tif (!(payload instanceof Uint8Array))\n\t\t\tpayload = new Uint8Array (payload);\n\t\t\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Get counter for frame\n\t\tconst counter = this.counter++;\n\t\t\n\t\t//If we don\'t have the ssrc\n\t\t// TODO FIX https://github.com/medooze/sframe/issues/15 and uncomment line below\n\t\t// if (!this.pending.has(ssrcId))\n\t\t//Create new pending frames array\n\t\t\tthis.pending.set(ssrcId,[]);\n\t\t\n\t\t//Get pending frames for signature\n\t\tconst pending = this.pending.get(ssrcId);\t\t\n\t\t\n\t\t//Do we need to sign the frames?\n\t\tconst signing = this.signingKey && pending.length > SigningFrameInterval;\n\t\t\n\t\t//Get auth tag len for type\n\t\tconst authTagLen = _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type);\n\t\t\n\t\t//Calculae extra bytes\n\t\tconst extraBytes = signing ? pending.length * _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type) + 1 + _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__["EcdsaSignKey"].getSignatureLen() : 0;\n\t\t\n\t\t//Generate header\n\t\tconst header = _Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].generate(signing,this.senderId,counter);\n\t\t\n\t\t//Encrypt frame\n\t\tconst [encryptedFrame,authTag] = await this.key.encrypt(type, header, payload, extraBytes, skip);\n\t\t\n\t\t//If we are sending part of the frame in clear\n\t\tif (skip)\n\t\t\t//Copy skiped payload\n\t\t\tencryptedFrame.set(payload.subarray(0,skip),0);\n\t\t\n\t\t//If we need to sign the frame\n\t\tif (signing)\n\t\t{\n\t\t\t//Append after auth tag\n\t\t\tlet ini = skip + encryptedFrame.byteLength - extraBytes;\n\t\t\t\n\t\t\t//Get tag list view\n\t\t\tconst authTags = encryptedFrame.subarray(ini - authTagLen, (pending.length + 1) * authTagLen);\n\t\t\t\n\t\t\t//Add all previous tags \n\t\t\tfor (const previousTag of pending)\n\t\t\t{\n\t\t\t\t//Append to frame\n\t\t\t\tencryptedFrame.set(previousTag, ini);\n\t\t\t\t//Move\n\t\t\t\tini += authTagLen;\n\t\t\t}\n\t\t\t\n\t\t\t//Add number of bytes\n\t\t\tencryptedFrame[ini++] = pending.length;\n\t\t\t\n\t\t\t//Create signature with all auth tags (including this frame\'s one)\n\t\t\tconst signature = await this.signingKey.sign(authTags);\n\t\t\t\n\t\t\t//Add signature\n\t\t\tencryptedFrame.set(signature, ini);\n\t\t\t\n\t\t\t//Empty pending list \n\t\t\tthis.pending.set(ssrcId,[]);\n\t\t\t\n\t\t//If we can sign\n\t\t} else if (this.signingKey) {\n\t\t\t//Append a copy of current tag at the begining\n\t\t\tpending.unshift(authTag.slice());\n\t\t}\n\t\t\n\t\t//Set authenticated sender id and frame Id\n\t\tencryptedFrame.senderId = header.keyId;\n\t\tencryptedFrame.frameId = header.counter;\n\t\t\n\t\t//Done\n\t\treturn encryptedFrame;\n\t}\n\t\n\tasync setSigningKey(key)\n\t{\n\t\t//Create new singing key\n\t\tthis.signingKey = await _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__["EcdsaSignKey"].create(key);\n\t}\n\t\n\tasync setEncryptionKey(key)\n\t{\n\t\t//Create new encryption key\n\t\tthis.key = await _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].create(key);\n\t}\n\t\n\tasync ratchetEncryptionKey()\n\t{\n\t\t//Check we have a valid key\n\t\tif (!this.key)\n\t\t\tthrow Error("Encryption key not set");\n\t\t\n\t\t//Rachet the key and store it\n\t\tthis.key = await this.key.ratchet();\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/TaskQueue.js":\n/*!**************************!*\\\n !*** ./lib/TaskQueue.js ***!\n \\**************************/\n/*! exports provided: TaskQueue */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TaskQueue", function() { return TaskQueue; });\nclass TaskQueue\n{\n\tconstructor()\n\t{\n\t\tthis.tasks = [];\n\t\tthis.running = false;\n\t}\n\t\n\tenqueue(promise,callback,error)\n\t{\n\t\t//enqueue task\n\t\tthis.tasks.push({promise,callback,error});\n\t\t//Try run \n\t\tthis.run();\n\t}\n\t\n\tasync run()\n\t{\n\t\t//If already running \n\t\tif (this.running)\n\t\t\t//Nothing\n\t\t\treturn;\n\t\t//Running\n\t\tthis.running = true;\n\t\t//Run all pending tasks\n\t\twhile(this.tasks.length)\n\t\t{\n\t\t\ttry {\n\t\t\t\t//Wait for first promise to finish\n\t\t\t\tconst result = await this.tasks[0].promise;\n\t\t\t\t//Run callback\n\t\t\t\tthis.tasks[0].callback(result); \n\t\t\t} catch(e) {\n\t\t\t\t//Run error callback\n\t\t\t\tthis.tasks[0].error(e); \n\t\t\t}\n\t\t\t//Remove task from queue\n\t\t\tthis.tasks.shift();\n\t\t}\n\t\t//Ended\n\t\tthis.running = false;\n\t}\n}\n\n\n/***/ }),\n\n/***/ "./lib/Utils.js":\n/*!**********************!*\\\n !*** ./lib/Utils.js ***!\n \\**********************/\n/*! exports provided: Utils */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Utils", function() { return Utils; });\nconst Utils = \n{\n\ttoHex : function(buffer)\n\t{\n\t\treturn Array.prototype.map.call(buffer instanceof Uint8Array ? buffer : new Uint8Array (buffer), x =>x.toString(16).padStart(2,"0")).join("");\n\t},\n\tfromHex: function(str)\n\t{\n\t\tconst bytes = [];\n\t\tfor (let i=0;i<str.length/2;++i)\n\t\t\tbytes.push(parseInt(str.substring(i*2, (i+1)*2), 16));\n\n\t\treturn new Uint8Array(bytes);\n\t},\n\tequals : function(a,b)\n\t{\n\t\tif (a.byteLength != b.byteLength) return false;\n\t\tfor (let i = 0 ; i != a.byteLength ; i++)\n\t\t\tif (a[i] != b[i]) return false;\n\t\treturn true;\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/VP8PayloadHeader.js":\n/*!*********************************!*\\\n !*** ./lib/VP8PayloadHeader.js ***!\n \\*********************************/\n/*! exports provided: VP8PayloadHeader */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VP8PayloadHeader", function() { return VP8PayloadHeader; });\n\nconst VP8PayloadHeader = {\n\t\n\tparse : function(buffer) \n\t{\n\t\t//Check size\n\t\tif (buffer.byteLength<3)\n\t\t\t//Invalid\n\t\t\treturn null;\n\t\t\n\t\t//Create uint view\n\t\tconst view = new Uint8Array(buffer);\n\t\t\n\t\t//Read comon 3 bytes\n\t\t// 0 1 2 3 4 5 6 7\n // +-+-+-+-+-+-+-+-+\n // |Size0|H| VER |P|\n // +-+-+-+-+-+-+-+-+\n // | Size1 |\n // +-+-+-+-+-+-+-+-+\n // | Size2 |\n // +-+-+-+-+-+-+-+-+\n\t\tconst firstPartitionSize\t= view[0] >> 5;\n\t\tconst showFrame\t\t\t= view[0] >> 4 & 0x01;\n\t\tconst version\t\t\t= view[0] >> 1 & 0x07;\n\t\tconst isKeyFrame\t\t= (view[0] & 0x01) == 0;\n\n\t\t//check if more\n\t\tif (isKeyFrame)\n\t\t{\n\t\t\t//Check size\n\t\t\tif (buffer.byteLength<10)\n\t\t\t\t//Invalid\n\t\t\t\treturn null;\n\t\t\t//Get size in le\n\t\t\tconst hor = view[7]<<8 | view[6];\n\t\t\tconst ver = view[9]<<8 | view[8];\n\t\t\t//Get dimensions and scale\n\t\t\tconst width\t\t= hor & 0x3fff;\n\t\t\tconst horizontalScale = hor >> 14;\n\t\t\tconst height\t\t= ver & 0x3fff;\n\t\t\tconst verticalScale\t= ver >> 14;\n\t\t\t//Key frame\n\t\t\treturn view.subarray (0,10);\n\t\t}\n\t\t\n\t\t//No key frame\n\t\treturn view.subarray (0,3);\n\t}\n};\n\n\t\t\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_Symbol.js":\n/*!****************************************!*\\\n !*** ./node_modules/lodash/_Symbol.js ***!\n \\****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_baseGetTag.js":\n/*!********************************************!*\\\n !*** ./node_modules/lodash/_baseGetTag.js ***!\n \\********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_baseTrim.js":\n/*!******************************************!*\\\n !*** ./node_modules/lodash/_baseTrim.js ***!\n \\******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, \'\')\n : string;\n}\n\nmodule.exports = baseTrim;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_freeGlobal.js":\n/*!********************************************!*\\\n !*** ./node_modules/lodash/_freeGlobal.js ***!\n \\********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == \'object\' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_getRawTag.js":\n/*!*******************************************!*\\\n !*** ./node_modules/lodash/_getRawTag.js ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_objectToString.js":\n/*!************************************************!*\\\n !*** ./node_modules/lodash/_objectToString.js ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_root.js":\n/*!**************************************!*\\\n !*** ./node_modules/lodash/_root.js ***!\n \\**************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == \'object\' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function(\'return this\')();\n\nmodule.exports = root;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/_trimmedEndIndex.js":\n/*!*************************************************!*\\\n !*** ./node_modules/lodash/_trimmedEndIndex.js ***!\n \\*************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\n/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/debounce.js":\n/*!*****************************************!*\\\n !*** ./node_modules/lodash/debounce.js ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),\n now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),\n toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = \'Expected a function\';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho\'s article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it\'s invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on(\'resize\', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on(\'click\', _.debounce(sendMail, 300, {\n * \'leading\': true,\n * \'trailing\': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { \'maxWait\': 1000 });\n * var source = new EventSource(\'/stream\');\n * jQuery(source).on(\'message\', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on(\'popstate\', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != \'function\') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = \'maxWait\' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = \'trailing\' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we\'re at the\n // trailing edge, the system time has gone backwards and we\'re treating\n // it as the trailing edge, or we\'ve hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/isObject.js":\n/*!*****************************************!*\\\n !*** ./node_modules/lodash/isObject.js ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String(\'\')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == \'object\' || type == \'function\');\n}\n\nmodule.exports = isObject;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/isObjectLike.js":\n/*!*********************************************!*\\\n !*** ./node_modules/lodash/isObjectLike.js ***!\n \\*********************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\n/**\n * Checks if `value` is object-like. A value is object-like if it\'s not `null`\n * and has a `typeof` result of "object".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == \'object\';\n}\n\nmodule.exports = isObjectLike;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/isSymbol.js":\n/*!*****************************************!*\\\n !*** ./node_modules/lodash/isSymbol.js ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar symbolTag = \'[object Symbol]\';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol(\'abc\');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == \'symbol\' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/now.js":\n/*!************************************!*\\\n !*** ./node_modules/lodash/now.js ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n\n\n/***/ }),\n\n/***/ "./node_modules/lodash/toNumber.js":\n/*!*****************************************!*\\\n !*** ./node_modules/lodash/toNumber.js ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),\n isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),\n isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber(\'3.2\');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == \'number\') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == \'function\' ? value.valueOf() : value;\n value = isObject(other) ? (other + \'\') : other;\n }\n if (typeof value != \'string\') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n\n\n/***/ }),\n\n/***/ "./node_modules/webpack/buildin/global.js":\n/*!***********************************!*\\\n !*** (webpack)/buildin/global.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nvar g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function("return this")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n/***/ })\n\n/******/ });\n',"Worker",void 0,void 0)}},"./index.js":
40
+ /*!******************!*\
41
+ !*** ./index.js ***!
42
+ \******************/
43
+ /*! exports provided: SFrame, Utils */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../sframe/lib/Utils */"./lib/Utils.js");n.d(t,"Utils",(function(){return r.Utils}));var i=n(/*! ./Client */"./Client.js");n.d(t,"SFrame",(function(){return i.SFrame}))},"./lib/Utils.js":
44
+ /*!**********************!*\
45
+ !*** ./lib/Utils.js ***!
46
+ \**********************/
47
+ /*! exports provided: Utils */function(e,t,n){"use strict";n.r(t),n.d(t,"Utils",(function(){return r}));const r={toHex:function(e){return Array.prototype.map.call(e instanceof Uint8Array?e:new Uint8Array(e),e=>e.toString(16).padStart(2,"0")).join("")},fromHex:function(e){const t=[];for(let n=0;n<e.length/2;++n)t.push(parseInt(e.substring(2*n,2*(n+1)),16));return new Uint8Array(t)},equals:function(e,t){if(e.byteLength!=t.byteLength)return!1;for(let n=0;n!=e.byteLength;n++)if(e[n]!=t[n])return!1;return!0}}},"./node_modules/worker-loader/dist/runtime/inline.js":
48
+ /*!***********************************************************!*\
49
+ !*** ./node_modules/worker-loader/dist/runtime/inline.js ***!
50
+ \***********************************************************/
51
+ /*! no static exports found */function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),c=new i[t](a,n);return s.revokeObjectURL(a),c}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}}})},e.exports=n()}).call(this,n(0))},function(e,t,n){"use strict";const r=n(6),i=n(301),o=n(71)(),s=n(767),a=n(28);let c=function(){function e(e,t){void 0===t&&(t={}),this._session=e,this.PeerConnection=t.PeerConnection||o,this._subscriberCreateQueue=new s,this._originalSendMessages={},this._tracks=[],this._subscriberPcs={},this._sendMessage=()=>{},r(this)}var t=e.prototype;return t.parseOptions=function(e){return Object.assign({},e,{removeUnusedCodecs:!0,sendMessage:(e,t)=>this.trigger("sendMessage",e,t)})},t.addTrackAddedListener=function(){this._peerConnection&&this._peerConnection.on("trackAdded",e=>{const t=e.track;this._tracks.includes(t.id)||(this._subscriberPcs[this._subscriberPcToAdd._id].push(t.id),this._tracks.push(t.id),this._subscriberPcToAdd._onTrackAdded(e))})},t.getPeerConnection=function(e,t){if(this._subscriberPcToAdd=t,this._sendMessage=e.sendMessage,this._originalSendMessages[t._id]=this._sendMessage,this._peerConnection)this._peerConnection.addOptions(e);else{this._firstSubscriberPc=t._id,this.on("sendMessage",(e,t)=>{this._sendMessage(e,t)});const n=this.parseOptions(e);this._peerConnection=new this.PeerConnection(n),this.addTrackAddedListener()}return this._subscriberPcs[t._id]=[],this._peerConnection},t.removeMessageSender=function(e){delete this._originalSendMessages[e];const t=Object.values(this._originalSendMessages);this._sendMessage=t[t.length-1]||function(){}},t.removeSubscriber=function(e,t){this.removeMessageSender(e),this._peerConnection.stopTransceivers(t)},t.removeFromSinglePeerConnection=function(e){if(this._firstSubscriberPc===e)this._peerConnection.iceRestart(),this._peerConnection.generateOfferAndSend();else{const e=e=>{this.cachedSdp=a.updateSDPWithNewOffer(this.cachedSdp,e.sdp);const t=a.createSDP(this.cachedSdp.headers,this.cachedSdp.trackSections);this._peerConnection.processMessage("answer",{content:{sdp:t,mocked:!0}})};this._peerConnection.generateOfferAndAnswer(e)}delete this._subscriberPcs[e],Object.keys(this._subscriberPcs).length||(this._peerConnection.disconnect(),this._peerConnection=null)},t.removeTrack=function(e,t){i(this._tracks,e.id),i(this._subscriberPcs[t]||[],e.id)},t.destroy=function(){this._subscriberPcToAdd=null,this._subscriberPcs=null,this._session=null,this._tracks=null,this._peerConnection&&(this._peerConnection.disconnect(),this._peerConnection=null)},t.addSubscriber=function(e){this._subscriberCreateQueue.add(e)},t.subscriberComplete=function(){this._subscriberCreateQueue.next()},t.cacheOfferAnswer=function(e){e.mocked||(this.cachedSdp=a.parseMantisSDP(e.sdp))},e}();e.exports=c},function(e,t,n){"use strict";let r=function(){function e(){this.queue=[],this.isAddingSubscriber=!1}var t=e.prototype;return t.add=function(e){this.isAddingSubscriber?this.queue.push(e):(this.isAddingSubscriber=!0,e())},t.next=function(){const e=this.queue.shift();e?e():this.isAddingSubscriber=!1},e}();e.exports=r},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Session||n(319)(),r=e.sessionObjects||n(21);return function(e,n,i){null==n&&(n=e,e=null),Array.isArray(n)&&1===n.length&&(n=n[0]);let o=r.sessions.get(n);return o||(o=new t(e,n,i),r.sessions.add(o)),o}}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(770),a=n(273),c=n(3),u=n(7),l=n(10),d=n(13)(),h=n(28),p=n(72),f=n(143)(void 0!==typeof window?window:global);function m(e){return a(s(e,["AV1X","AV1","VP9","rtx","red","ulpfec","H265","X-H264UC","x-ulpfecuc"]))}const g=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n,r,o,s,a,g;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof window){e.next=2;break}return e.abrupt("return",{videoEncoders:[],videoDecoders:[]});case 2:if(t=f.RTCPeerConnection,!window.RTCRtpSender||!("getCapabilities"in window.RTCRtpSender)){e.next=7;break}return n=m(n=window.RTCRtpSender.getCapabilities("video").codecs.map(e=>e.mimeType||e.name).map(e=>e.replace("video/",""))),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 7:if("Chrome"!==c.name||"captureStream"in window.HTMLCanvasElement.prototype){e.next=9;break}return e.abrupt("return",{videoEncoders:["VP8"],videoDecoders:["VP8"]});case 9:if(!c.isLegacyEdge){e.next=11;break}return e.abrupt("return",{videoEncoders:["H264","VP8"],videoDecoders:["H264","VP8"]});case 11:return(r=window.document.createElement("canvas")).getContext("2d"),o=r.captureStream(),e.prev=14,a={iceServers:[]},p()&&(a.sdpSemantics="plan-b"),(s=new t(a)).addTrack?s.addTrack(o.getVideoTracks()[0],o):s.addStream&&s.addStream(o),e.next=21,s.createOffer();case 21:return g=e.sent,n=m(n=h.getCodecs(g.sdp,"video")||[]),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 27:throw e.prev=27,e.t0=e.catch(14),d(u.UNABLE_TO_ACCESS_MEDIA_ENGINE,new Error("OT.getSupportedCodecs was not able to get the list of supported codecs"),l.UNABLE_TO_ACCESS_MEDIA_ENGINE);case 30:return e.prev=30,s.close(),e.finish(30);case 33:case"end":return e.stop()}}),e,null,[[14,27,30,33]])})));return function(){return e.apply(this,arguments)}}();e.exports=g},function(e,t,n){var r=n(771),i=n(237),o=n(87),s=n(131),a=o((function(e,t){return s(e)?r(e,i(t,1,s,!0)):[]}));e.exports=a},function(e,t,n){var r=n(92),i=n(93),o=n(130),s=n(33),a=n(66),c=n(94);e.exports=function(e,t,n,u){var l=-1,d=i,h=!0,p=e.length,f=[],m=t.length;if(!p)return f;n&&(t=s(t,a(n))),u?(d=o,h=!1):t.length>=200&&(d=c,h=!1,t=new r(t));e:for(;++l<p;){var g=e[l],b=null==n?g:n(g);if(g=u||0!==g?g:0,h&&b==b){for(var y=m;y--;)if(t[y]===b)continue e;f.push(g)}else d(t,b,u)||f.push(g)}return f}},function(e,t,n){"use strict";const r=n(315).isSupported;e.exports=r},function(e,t,n){"use strict";const r=n(110);e.exports=r},function(e,t,n){"use strict";const r=n(24)().getInputMediaDevices;e.exports=function(e){r().then(t=>e(void 0,t),e)}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.hasAudioOutputApiSupport,s=t.hasDevice,a=e.getAudioOutputDevices||n(331),c=e.updateSubscribersSinkId||n(333),u=n(13)(),l=n(7);return function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r()){e.next=2;break}throw u(l.UNSUPPORTED_BROWSER,new Error("setAudioOutputDevice is not supported in your browser."));case 2:return e.next=4,a();case 4:if(n=e.sent,s(n,t)){e.next=8;break}throw u(l.INVALID_AUDIO_OUTPUT_SOURCE,new Error("The requested device is not valid."));case 8:return e.prev=8,e.next=11,c(t);case 11:e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(8),u(l.REQUESTED_DEVICE_PERMISSION_DENIED,new Error("No permission to use the requested device."));case 16:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(t){return e.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));const s=n(777)(),a=n(24)(),c=a.hasAudioOutputApiSupport,u=a.getNativeMediaDevices;e.exports=()=>{if(c()){const e=u();let t=!1;e.addEventListener("devicechange",(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:return t=!0,e.next=5,s();case 5:t=!1;case 6:case"end":return e.stop()}}),e)}))))}}},function(e,t,n){"use strict";var r=n(2),i=r(n(4)),o=r(n(5));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.getAudioOutputMediaDevices,s=t.getDefaultAudioOutputDeviceId,a=t.hasDevice,c=e.currentAudioOutputDevice||n(106),u=c.getCurrentAudioOutputDeviceId,l=c.setCurrentAudioOutputDeviceId,d=e.updateSubscribersSinkId||n(333),h=e.logging||n(1)("currentAudioOutputDevice");return function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:if(0!==(t=e.sent).length){e.next=6;break}return l(""),e.abrupt("return");case 6:if(!a(t,u())){e.next=9;break}return e.abrupt("return");case 9:return n=s(t),l(n),e.prev=11,e.next=14,d(n);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(11),h.debug("Failed to set the default audio output device.",e.t0);case 19:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(){return e.apply(this,arguments)}}()}}])}));
52
+ //# sourceMappingURL=opentok.min.js.map