trtc-spatial.js 678 KB

1
  1. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TRTC=t()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){u(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(A){u=function(e,t,n){return e[t]=n}}function d(e,t,n,i){var a=t&&t.prototype instanceof p?t:p,o=Object.create(a.prototype),s=new w(i||[]);return r(o,"_invoke",{value:k(e,n,s)}),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=d;var h={};function p(){}function f(){}function m(){}var v={};u(v,o,(function(){return this}));var _=Object.getPrototypeOf,g=_&&_(_(R([])));g&&g!==t&&i.call(g,o)&&(v=g);var y=m.prototype=p.prototype=Object.create(v);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(r,a,o,s){var c=l(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var a;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return a=a?a.then(r,r):r()}})}function k(e,t,n){var i="suspendedStart";return function(r,a){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw a;return C()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=T(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var c=l(e,t,n);if("normal"===c.type){if(i=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i="completed",n.method="throw",n.arg=c.arg)}}}function T(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var r=l(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,h;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function I(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(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function R(e){if(e){var t=e[o];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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=m,r(y,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:f,configurable:!0}),f.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},S(b.prototype),u(b.prototype,s,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,i,r,a){void 0===a&&(a=Promise);var o=new b(d(t,n,i,r),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(y),u(y,c,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=R,w.prototype={constructor:w,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),!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,i){return o.type="throw",o.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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 a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},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),h},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),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t,n,i,r,a,o){try{var s=e[a](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(i,r)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,c,"next",e)}function c(e){r(o,i,a,s,c,"throw",e)}s(void 0)}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,R(i.key),i)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,n){return f=p()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&h(r,n.prototype),r},f.apply(null,arguments)}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return f(e,arguments,l(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),h(i,e)},m(e)}function v(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){var t=p();return function(){var n,i=l(e);if(t){var r=l(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _(this,n)}}function y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=y(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},S.apply(this,arguments)}function b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=a.call(n)).done)&&(s.push(i.value),s.length!==t);c=!0);}catch(d){u=!0,r=d}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw r}}return s}}(e,t)||I(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=I(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f: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.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function R(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function C(e,t,n,i,r){var a={};return Object.keys(i).forEach((function(e){a[e]=i[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce((function(n,i){return i(e,t,n)||n}),a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x=function(e){return e&&e.Math==Math&&e},P=x("object"==typeof globalThis&&globalThis)||x("object"==typeof window&&window)||x("object"==typeof self&&self)||x("object"==typeof A&&A)||function(){return this}()||Function("return this")(),D={},M=function(e){try{return!!e()}catch(t){return!0}},O=!M((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=!M((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),L=N,U=Function.prototype.call,V=L?U.bind(U):function(){return U.apply(U,arguments)},F={},j={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,H=B&&!j.call({1:2},1);F.f=H?function(e){var t=B(this,e);return!!t&&t.enumerable}:j;var G,z,W=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},J=N,q=Function.prototype,K=q.call,Q=J&&q.bind.bind(K,K),X=function(e){return J?Q(e):function(){return K.apply(e,arguments)}},$=X,Y=$({}.toString),Z=$("".slice),ee=function(e){return Z(Y(e),8,-1)},te=ee,ne=X,ie=function(e){if("Function"===te(e))return ne(e)},re=M,ae=ee,oe=Object,se=ie("".split),ce=re((function(){return!oe("z").propertyIsEnumerable(0)}))?function(e){return"String"==ae(e)?se(e,""):oe(e)}:oe,ue=function(e){return null==e},de=ue,le=TypeError,he=function(e){if(de(e))throw le("Can't call method on "+e);return e},pe=ce,fe=he,me=function(e){return pe(fe(e))},ve="object"==typeof document&&document.all,_e={all:ve,IS_HTMLDDA:void 0===ve&&void 0!==ve},ge=_e.all,ye=_e.IS_HTMLDDA?function(e){return"function"==typeof e||e===ge}:function(e){return"function"==typeof e},Se=ye,be=_e.all,ke=_e.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:Se(e)||e===be}:function(e){return"object"==typeof e?null!==e:Se(e)},Te=P,Ie=ye,Ee=function(e){return Ie(e)?e:void 0},we=function(e,t){return arguments.length<2?Ee(Te[e]):Te[e]&&Te[e][t]},Re=ie({}.isPrototypeOf),Ce=we("navigator","userAgent")||"",Ae=P,xe=Ce,Pe=Ae.process,De=Ae.Deno,Me=Pe&&Pe.versions||De&&De.version,Oe=Me&&Me.v8;Oe&&(z=(G=Oe.split("."))[0]>0&&G[0]<4?1:+(G[0]+G[1])),!z&&xe&&(!(G=xe.match(/Edge\/(\d+)/))||G[1]>=74)&&(G=xe.match(/Chrome\/(\d+)/))&&(z=+G[1]);var Ne=z,Le=Ne,Ue=M,Ve=!!Object.getOwnPropertySymbols&&!Ue((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41})),Fe=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=we,Be=ye,He=Re,Ge=Object,ze=Fe?function(e){return"symbol"==typeof e}:function(e){var t=je("Symbol");return Be(t)&&He(t.prototype,Ge(e))},We=String,Je=function(e){try{return We(e)}catch(t){return"Object"}},qe=ye,Ke=Je,Qe=TypeError,Xe=function(e){if(qe(e))return e;throw Qe(Ke(e)+" is not a function")},$e=Xe,Ye=ue,Ze=function(e,t){var n=e[t];return Ye(n)?void 0:$e(n)},et=V,tt=ye,nt=ke,it=TypeError,rt={exports:{}},at=P,ot=Object.defineProperty,st=function(e,t){try{ot(at,e,{value:t,configurable:!0,writable:!0})}catch(n){at[e]=t}return t},ct=st,ut="__core-js_shared__",dt=P[ut]||ct(ut,{}),lt=dt;(rt.exports=function(e,t){return lt[e]||(lt[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.5",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"});var ht=he,pt=Object,ft=function(e){return pt(ht(e))},mt=ft,vt=ie({}.hasOwnProperty),_t=Object.hasOwn||function(e,t){return vt(mt(e),t)},gt=ie,yt=0,St=Math.random(),bt=gt(1..toString),kt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+bt(++yt+St,36)},Tt=P,It=rt.exports,Et=_t,wt=kt,Rt=Ve,Ct=Fe,At=It("wks"),xt=Tt.Symbol,Pt=xt&&xt.for,Dt=Ct?xt:xt&&xt.withoutSetter||wt,Mt=function(e){if(!Et(At,e)||!Rt&&"string"!=typeof At[e]){var t="Symbol."+e;Rt&&Et(xt,e)?At[e]=xt[e]:At[e]=Ct&&Pt?Pt(t):Dt(t)}return At[e]},Ot=V,Nt=ke,Lt=ze,Ut=Ze,Vt=function(e,t){var n,i;if("string"===t&&tt(n=e.toString)&&!nt(i=et(n,e)))return i;if(tt(n=e.valueOf)&&!nt(i=et(n,e)))return i;if("string"!==t&&tt(n=e.toString)&&!nt(i=et(n,e)))return i;throw it("Can't convert object to primitive value")},Ft=TypeError,jt=Mt("toPrimitive"),Bt=function(e,t){if(!Nt(e)||Lt(e))return e;var n,i=Ut(e,jt);if(i){if(void 0===t&&(t="default"),n=Ot(i,e,t),!Nt(n)||Lt(n))return n;throw Ft("Can't convert object to primitive value")}return void 0===t&&(t="number"),Vt(e,t)},Ht=Bt,Gt=ze,zt=function(e){var t=Ht(e,"string");return Gt(t)?t:t+""},Wt=ke,Jt=P.document,qt=Wt(Jt)&&Wt(Jt.createElement),Kt=function(e){return qt?Jt.createElement(e):{}},Qt=Kt,Xt=!O&&!M((function(){return 7!=Object.defineProperty(Qt("div"),"a",{get:function(){return 7}}).a})),$t=O,Yt=V,Zt=F,en=W,tn=me,nn=zt,rn=_t,an=Xt,on=Object.getOwnPropertyDescriptor;D.f=$t?on:function(e,t){if(e=tn(e),t=nn(t),an)try{return on(e,t)}catch(n){}if(rn(e,t))return en(!Yt(Zt.f,e,t),e[t])};var sn={},cn=O&&M((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),un=ke,dn=String,ln=TypeError,hn=function(e){if(un(e))return e;throw ln(dn(e)+" is not an object")},pn=O,fn=Xt,mn=cn,vn=hn,_n=zt,gn=TypeError,yn=Object.defineProperty,Sn=Object.getOwnPropertyDescriptor,bn="enumerable",kn="configurable",Tn="writable";sn.f=pn?mn?function(e,t,n){if(vn(e),t=_n(t),vn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Tn in n&&!n.writable){var i=Sn(e,t);i&&i.writable&&(e[t]=n.value,n={configurable:kn in n?n.configurable:i.configurable,enumerable:bn in n?n.enumerable:i.enumerable,writable:!1})}return yn(e,t,n)}:yn:function(e,t,n){if(vn(e),t=_n(t),vn(n),fn)try{return yn(e,t,n)}catch(i){}if("get"in n||"set"in n)throw gn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var In=sn,En=W,wn=O?function(e,t,n){return In.f(e,t,En(1,n))}:function(e,t,n){return e[t]=n,e},Rn={exports:{}},Cn=O,An=_t,xn=Function.prototype,Pn=Cn&&Object.getOwnPropertyDescriptor,Dn=An(xn,"name"),Mn={EXISTS:Dn,PROPER:Dn&&"something"===function(){}.name,CONFIGURABLE:Dn&&(!Cn||Cn&&Pn(xn,"name").configurable)},On=ye,Nn=dt,Ln=ie(Function.toString);On(Nn.inspectSource)||(Nn.inspectSource=function(e){return Ln(e)});var Un,Vn,Fn,jn=Nn.inspectSource,Bn=ye,Hn=P.WeakMap,Gn=Bn(Hn)&&/native code/.test(String(Hn)),zn=rt.exports,Wn=kt,Jn=zn("keys"),qn=function(e){return Jn[e]||(Jn[e]=Wn(e))},Kn={},Qn=Gn,Xn=P,$n=ke,Yn=wn,Zn=_t,ei=dt,ti=qn,ni=Kn,ii="Object already initialized",ri=Xn.TypeError,ai=Xn.WeakMap;if(Qn||ei.state){var oi=ei.state||(ei.state=new ai);oi.get=oi.get,oi.has=oi.has,oi.set=oi.set,Un=function(e,t){if(oi.has(e))throw ri(ii);return t.facade=e,oi.set(e,t),t},Vn=function(e){return oi.get(e)||{}},Fn=function(e){return oi.has(e)}}else{var si=ti("state");ni[si]=!0,Un=function(e,t){if(Zn(e,si))throw ri(ii);return t.facade=e,Yn(e,si,t),t},Vn=function(e){return Zn(e,si)?e[si]:{}},Fn=function(e){return Zn(e,si)}}var ci={set:Un,get:Vn,has:Fn,enforce:function(e){return Fn(e)?Vn(e):Un(e,{})},getterFor:function(e){return function(t){var n;if(!$n(t)||(n=Vn(t)).type!==e)throw ri("Incompatible receiver, "+e+" required");return n}}},ui=M,di=ye,li=_t,hi=O,pi=Mn.CONFIGURABLE,fi=jn,mi=ci.enforce,vi=ci.get,_i=Object.defineProperty,gi=hi&&!ui((function(){return 8!==_i((function(){}),"length",{value:8}).length})),yi=String(String).split("String"),Si=Rn.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!li(e,"name")||pi&&e.name!==t)&&(hi?_i(e,"name",{value:t,configurable:!0}):e.name=t),gi&&n&&li(n,"arity")&&e.length!==n.arity&&_i(e,"length",{value:n.arity});try{n&&li(n,"constructor")&&n.constructor?hi&&_i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var i=mi(e);return li(i,"source")||(i.source=yi.join("string"==typeof t?t:"")),e};Function.prototype.toString=Si((function(){return di(this)&&vi(this).source||fi(this)}),"toString");var bi=ye,ki=sn,Ti=Rn.exports,Ii=st,Ei=function(e,t,n,i){i||(i={});var r=i.enumerable,a=void 0!==i.name?i.name:t;if(bi(n)&&Ti(n,a,i),i.global)r?e[t]=n:Ii(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(o){}r?e[t]=n:ki.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},wi={},Ri=Math.ceil,Ci=Math.floor,Ai=Math.trunc||function(e){var t=+e;return(t>0?Ci:Ri)(t)},xi=function(e){var t=+e;return t!=t||0===t?0:Ai(t)},Pi=xi,Di=Math.max,Mi=Math.min,Oi=function(e,t){var n=Pi(e);return n<0?Di(n+t,0):Mi(n,t)},Ni=xi,Li=Math.min,Ui=function(e){return e>0?Li(Ni(e),9007199254740991):0},Vi=Ui,Fi=function(e){return Vi(e.length)},ji=me,Bi=Oi,Hi=Fi,Gi=function(e){return function(t,n,i){var r,a=ji(t),o=Hi(a),s=Bi(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},zi={includes:Gi(!0),indexOf:Gi(!1)},Wi=_t,Ji=me,qi=zi.indexOf,Ki=Kn,Qi=ie([].push),Xi=function(e,t){var n,i=Ji(e),r=0,a=[];for(n in i)!Wi(Ki,n)&&Wi(i,n)&&Qi(a,n);for(;t.length>r;)Wi(i,n=t[r++])&&(~qi(a,n)||Qi(a,n));return a},$i=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yi=Xi,Zi=$i.concat("length","prototype");wi.f=Object.getOwnPropertyNames||function(e){return Yi(e,Zi)};var er={};er.f=Object.getOwnPropertySymbols;var tr=we,nr=wi,ir=er,rr=hn,ar=ie([].concat),or=tr("Reflect","ownKeys")||function(e){var t=nr.f(rr(e)),n=ir.f;return n?ar(t,n(e)):t},sr=_t,cr=or,ur=D,dr=sn,lr=M,hr=ye,pr=/#|\.prototype\./,fr=function(e,t){var n=vr[mr(e)];return n==gr||n!=_r&&(hr(t)?lr(t):!!t)},mr=fr.normalize=function(e){return String(e).replace(pr,".").toLowerCase()},vr=fr.data={},_r=fr.NATIVE="N",gr=fr.POLYFILL="P",yr=fr,Sr=P,br=D.f,kr=wn,Tr=Ei,Ir=st,Er=function(e,t,n){for(var i=cr(t),r=dr.f,a=ur.f,o=0;o<i.length;o++){var s=i[o];sr(e,s)||n&&sr(n,s)||r(e,s,a(t,s))}},wr=yr,Rr=function(e,t){var n,i,r,a,o,s=e.target,c=e.global,u=e.stat;if(n=c?Sr:u?Sr[s]||Ir(s,{}):(Sr[s]||{}).prototype)for(i in t){if(a=t[i],r=e.dontCallGetSet?(o=br(n,i))&&o.value:n[i],!wr(c?i:s+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof a==typeof r)continue;Er(a,r)}(e.sham||r&&r.sham)&&kr(a,"sham",!0),Tr(n,i,a,e)}},Cr=Rr,Ar=M,xr=me,Pr=D.f,Dr=O,Mr=Ar((function(){Pr(1)}));Cr({target:"Object",stat:!0,forced:!Dr||Mr,sham:!Dr},{getOwnPropertyDescriptor:function(e,t){return Pr(xr(e),t)}});let Or=!0,Nr=!0;function Lr(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function Ur(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,r=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return r.apply(this,arguments);const a=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,a),r.apply(this,[e,a])};const a=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return a.apply(this,arguments);if(!this._eventMap[t].has(n))return a.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,a.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(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})}function Vr(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Or=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Fr(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Nr=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function jr(){if("object"==typeof window){if(Or)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Br(e,t){Nr&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Hr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Gr(e){return Hr(e)?Object.keys(e).reduce((function(t,n){const i=Hr(e[n]),r=i?Gr(e[n]):e[n],a=i&&!Object.keys(r).length;return void 0===r||a?t:Object.assign(t,{[n]:r})}),{}):e}function zr(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?zr(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((t=>{zr(e,e.get(t),n)}))})))}function Wr(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",r=new Map;if(null===t)return r;const a=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&a.push(e)})),a.forEach((t=>{e.forEach((n=>{n.type===i&&n.trackId===t.id&&zr(e,n,r)}))})),r}const Jr=jr;function qr(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const r=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[r("min",n)]=i.ideal,t.optional.push(e),e={},e[r("max",n)]=i.ideal,t.optional.push(e)):(e[r("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[r("",n)]=i.exact):["min","max"].forEach((e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[r(e,n)]=i[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},r=function(e,r){if(t.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let a=e.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});const o=t.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let t;if(delete e.video.facingMode,"environment"===a.exact||"environment"===a.ideal?t=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{let o=(n=n.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!o&&n.length&&t.includes("back")&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=i(e.video),Jr("chrome: "+JSON.stringify(e)),r(e)}))}e.video=i(e.video)}return Jr("chrome: "+JSON.stringify(e)),r(e)},a=function(e){return t.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(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){r(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{i&&i(a(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return r(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(a(e))))))}}}function Kr(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Qr(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const r=new Event("track");r.track=n.track,r.receiver=i,r.transceiver={receiver:i},r.streams=[t.stream],this.dispatchEvent(r)})),t.stream.getTracks().forEach((n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const r=new Event("track");r.track=n,r.receiver=i,r.transceiver={receiver:i},r.streams=[t.stream],this.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Ur(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Xr(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const 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()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let r=n.apply(this,arguments);return r||(r=t(this,e),this._senders.push(r)),r};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),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)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function $r(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const r=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},a=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const i=function(e){n(a(r(e)))};return t.apply(this,[i,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(a(r(t)))},n])})).then(n,i)}}function Yr(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wr(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Ur(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Wr(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach((n=>{n.track===e&&(t?i=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?i=!0:n=t),t.track===e))),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Zr(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),r.apply(this,arguments)}}function ea(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Zr(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const r=e.RTCPeerConnection.prototype.removeStream;function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const r=this.getSenders().find((e=>e.track===t));if(r)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const a=this._streams[n.id];if(a)a.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>a(this,e)))}};e.RTCPeerConnection.prototype[t]=i[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.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===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ta(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function na(e,t){Ur(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var ia=Object.freeze({__proto__:null,shimMediaStream:Kr,shimOnTrack:Qr,shimGetSendersWithDtmf:Xr,shimGetStats:$r,shimSenderReceiverGetStats:Yr,shimAddTrackRemoveTrackWithNative:Zr,shimAddTrackRemoveTrack:ea,shimPeerConnection:ta,fixNegotiationNeeded:na,shimGetUserMedia:qr,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const i=n.video&&n.video.width,r=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:a||3}},i&&(n.video.mandatory.maxWidth=i),r&&(n.video.mandatory.maxHeight=r),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});var ra={exports:{}};!function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},t.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},t.getDescription=function(e){var n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){var n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((function(e){return 0===e.indexOf(n)}))},t.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]},i=8;i<t.length;i+=2)switch(t[i]){case"raddr":n.relatedAddress=t[i+1];break;case"rport":n.relatedPort=parseInt(t[i+1],10);break;case"tcptype":n.tcpType=t[i+1];break;case"ufrag":n.ufrag=t[i+1],n.usernameFragment=t[i+1];break;default:n[t[i]]=t[i+1]}return n},t.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(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.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},t.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"},t.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]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){for(var t,n={},i=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<i.length;r++)n[(t=i[r].trim().split("="))[0].trim()]=t[1];return n},t.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var i=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.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},t.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substr(t+1,i-t-1),n.value=e.substr(i+1)):n.attribute=e.substr(t+1),n},t.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},t.getMid=function(e){var n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substr(6)},t.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.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},t.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)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.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}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){var i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],r=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&r?{usernameFragment:i.substr(12),password:r.substr(10)}:null},t.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},t.parseRtpParameters=function(e){for(var n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" "),r=3;r<i.length;r++){var a=i[r],o=t.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(o){var s=t.parseRtpMap(o),c=t.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=c.length?t.parseFmtp(c[0]):{},s.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(t.parseRtcpFb),n.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(s.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((function(e){n.headerExtensions.push(t.parseExtmap(e))})),n},t.writeRtpDescription=function(e,n){var i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=n.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((function(e){i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)}));var r=0;return n.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(i+="a=maxptime:"+r+"\r\n"),i+="a=rtcp-mux\r\n",n.headerExtensions&&n.headerExtensions.forEach((function(e){i+=t.writeExtmap(e)})),i},t.parseRtpEncodingParameters=function(e){var n,i=[],r=t.parseRtpParameters(e),a=-1!==r.fecMechanisms.indexOf("RED"),o=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,u=t.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&&(n=u[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var t={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&n&&(t.rtx={ssrc:n}),i.push(t),a&&((t=JSON.parse(JSON.stringify(t))).fec={ssrc:c,mechanism:o?"red+ulpfec":"red"},i.push(t))}})),0===i.length&&c&&i.push({ssrc:c});var d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,i.forEach((function(e){e.maxBitrate=d}))),i},t.parseRtcpParameters=function(e){var n={},i=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);var r=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=r.length>0,n.compound=0===r.length;var a=t.matchPrefix(e,"a=rtcp-mux");return n.mux=a.length>0,n},t.parseMsid=function(e){var n,i=t.matchPrefix(e,"a=msid:");if(1===i.length)return{stream:(n=i[0].substr(7).split(" "))[0],track:n[1]};var r=t.matchPrefix(e,"a=ssrc:").map((function(e){return t.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(n=r[0].value.split(" "))[0],track:n[1]}:void 0},t.parseSctpDescription=function(e){var n,i=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");r.length>0&&(n=parseInt(r[0].substr(19),10)),isNaN(n)&&(n=65536);var a=t.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:i.fmt,maxMessageSize:n};if(t.matchPrefix(e,"a=sctpmap:").length>0){var o=t.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(o[0],10),protocol:o[1],maxMessageSize:n}}},t.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("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,n,i){var r=void 0!==n?n:2;return"v=0\r\no="+(i||"thisisadapterortc")+" "+(e||t.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.writeMediaSection=function(e,n,i,r){var a=t.writeRtpDescription(e.kind,n);if(a+=t.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=t.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":"active"),a+="a=mid:"+e.mid+"\r\n",e.direction?a+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var o="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";a+="a="+o,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+"\r\n"),a},t.getDirection=function(e,n){for(var i=t.splitLines(e),r=0;r<i.length;r++)switch(i[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[r].substr(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){var n=t.splitLines(e)[0].substr(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){var n=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var n=t.splitLines(e),i=0;i<n.length;i++)if(n[i].length<2||"="!==n[i].charAt(1))return!1;return!0},e.exports=t}(ra);var aa=ra.exports,oa=ra.exports;function sa(e,t,n,i,r){var a=oa.writeRtpDescription(e.kind,t);if(a+=oa.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=oa.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":r||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var o=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=o;var s="msid:"+(i?i.id:"-")+" "+o+"\r\n";a+="a="+s,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+oa.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+oa.localCName+"\r\n"),a}function ca(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},i=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]},r=function(e,t,n,r){var a=i(e.parameters.apt,n),o=i(t.parameters.apt,r);return a&&o&&a.name.toLowerCase()===o.name.toLowerCase()};return e.codecs.forEach((function(i){for(var a=0;a<t.codecs.length;a++){var o=t.codecs[a];if(i.name.toLowerCase()===o.name.toLowerCase()&&i.clockRate===o.clockRate){if("rtx"===i.name.toLowerCase()&&i.parameters&&o.parameters.apt&&!r(i,o,e.codecs,t.codecs))continue;(o=JSON.parse(JSON.stringify(o))).numChannels=Math.min(i.numChannels,o.numChannels),n.codecs.push(o),o.rtcpFeedback=o.rtcpFeedback.filter((function(e){for(var t=0;t<i.rtcpFeedback.length;t++)if(i.rtcpFeedback[t].type===e.type&&i.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var i=0;i<t.headerExtensions.length;i++){var r=t.headerExtensions[i];if(e.uri===r.uri){n.headerExtensions.push(r);break}}})),n}function ua(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 da(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 la(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}var ha=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function i(t,n,i,r){var a=new Event("track");a.track=n,a.receiver=i,a.transceiver={receiver:i},a.streams=r,e.setTimeout((function(){t._dispatchEvent("track",a)}))}var r=function(n){var i=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){i[e]=r[e].bind(r)})),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",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw la("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=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&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var r="string"==typeof i;return r&&(i=[i]),i=i.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)})),delete e.url,e.urls=r?i[0]:i,!!i.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=oa.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(r.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(r.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),r.prototype.onicecandidate=null,r.prototype.onaddstream=null,r.prototype.ontrack=null,r.prototype.onremovestream=null,r.prototype.onsignalingstatechange=null,r.prototype.oniceconnectionstatechange=null,r.prototype.onconnectionstatechange=null,r.prototype.onicegatheringstatechange=null,r.prototype.onnegotiationneeded=null,r.prototype.ondatachannel=null,r.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},r.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},r.prototype.getConfiguration=function(){return this._config},r.prototype.getLocalStreams=function(){return this.localStreams},r.prototype.getRemoteStreams=function(){return this.remoteStreams},r.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,i={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)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();i.iceTransport=r.iceTransport,i.dtlsTransport=r.dtlsTransport}return t||this.transceivers.push(i),i},r.prototype.addTrack=function(t,n){if(this._isClosed)throw la("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i;if(this.transceivers.find((function(e){return e.track===t})))throw la("InvalidAccessError","Track already exists.");for(var r=0;r<this.transceivers.length;r++)this.transceivers[r].track||this.transceivers[r].kind!==t.kind||(i=this.transceivers[r]);return i||(i=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),i.track=t,i.stream=n,i.rtpSender=new e.RTCRtpSender(t,i.dtlsTransport),i.rtpSender},r.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var i=e.clone();e.getTracks().forEach((function(e,t){var n=i.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),i.getTracks().forEach((function(e){n.addTrack(e,i)}))}},r.prototype.removeTrack=function(t){if(this._isClosed)throw la("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 la("InvalidAccessError","Sender was not created by this connection.");var i=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(i)&&this.localStreams.indexOf(i)>-1&&this.localStreams.splice(this.localStreams.indexOf(i),1),this._maybeFireNegotiationNeeded()},r.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)}))},r.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},r.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},r.prototype._createIceGatherer=function(t,n){var i=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var r=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(r,"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;r.state=n?"completed":"gathering",null!==i.transceivers[t].bufferedCandidateEvents&&i.transceivers[t].bufferedCandidateEvents.push(e)},r.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),r},r.prototype._gather=function(t,n){var i=this,r=this.transceivers[n].iceGatherer;if(!r.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),r.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var o=e.candidate,s=!o||0===Object.keys(o).length;if(s)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),o.component=1,o.ufrag=r.getLocalParameters().usernameFragment;var c=oa.writeCandidate(o);a.candidate=Object.assign(a.candidate,oa.parseCandidate(c)),a.candidate.candidate=c,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var u=oa.getMediaSections(i._localDescription.sdp);u[a.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i._localDescription.sdp=oa.getDescription(i._localDescription.sdp)+u.join("");var d=i.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),s||i._dispatchEvent("icecandidate",a),d&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){r.onlocalcandidate(e)}))}),0)}},r.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var i=new e.RTCDtlsTransport(n);return i.ondtlsstatechange=function(){t._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:i}},r.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 i=this.transceivers[e].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[e].dtlsTransport)},r.prototype._transceive=function(e,n,i){var r=ca(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(r.encodings=e.sendEncodingParameters,r.rtcp={cname:oa.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(r.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(r)),i&&e.rtpReceiver&&r.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?r.encodings=e.recvEncodingParameters:r.encodings=[{}],r.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(r.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(r.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(r))},r.prototype.setLocalDescription=function(e){var t,n,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(la("TypeError",'Unsupported type "'+e.type+'"'));if(!ua("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(la("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=oa.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=oa.parseRtpParameters(e);i.transceivers[t].localCapabilities=n})),i.transceivers.forEach((function(e,t){i._gather(e.mid,t)}));else if("answer"===e.type){t=oa.splitSections(i._remoteDescription.sdp),n=t.shift();var r=oa.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=i.transceivers[t],o=a.iceGatherer,s=a.iceTransport,c=a.dtlsTransport,u=a.localCapabilities,d=a.remoteCapabilities;if(!(oa.isRejected(e)&&0===oa.matchPrefix(e,"a=bundle-only").length)&&!a.rejected){var l=oa.getIceParameters(e,n),h=oa.getDtlsParameters(e,n);r&&(h.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===s.state&&s.start(o,l,r?"controlling":"controlled"),"new"===c.state&&c.start(h));var p=ca(u,d);i._transceive(a,p.codecs.length>0,!1)}}))}return i._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},r.prototype.setRemoteDescription=function(r){var a=this;if(-1===["offer","answer"].indexOf(r.type))return Promise.reject(la("TypeError",'Unsupported type "'+r.type+'"'));if(!ua("setRemoteDescription",r.type,a.signalingState)||a._isClosed)return Promise.reject(la("InvalidStateError","Can not set remote "+r.type+" in state "+a.signalingState));var o={};a.remoteStreams.forEach((function(e){o[e.id]=e}));var s=[],c=oa.splitSections(r.sdp),u=c.shift(),d=oa.matchPrefix(u,"a=ice-lite").length>0,l=oa.matchPrefix(u,"a=group:BUNDLE ").length>0;a.usingBundle=l;var h=oa.matchPrefix(u,"a=ice-options:")[0];return a.canTrickleIceCandidates=!!h&&h.substr(14).split(" ").indexOf("trickle")>=0,c.forEach((function(i,c){var h=oa.splitLines(i),p=oa.getKind(i),f=oa.isRejected(i)&&0===oa.matchPrefix(i,"a=bundle-only").length,m=h[0].substr(2).split(" ")[2],v=oa.getDirection(i,u),_=oa.parseMsid(i),g=oa.getMid(i)||oa.generateIdentifier();if(f||"application"===p&&("DTLS/SCTP"===m||"UDP/DTLS/SCTP"===m))a.transceivers[c]={mid:g,kind:p,protocol:m,rejected:!0};else{var y,S,b,k,T,I,E,w,R;!f&&a.transceivers[c]&&a.transceivers[c].rejected&&(a.transceivers[c]=a._createTransceiver(p,!0));var C,A,x=oa.parseRtpParameters(i);f||(C=oa.getIceParameters(i,u),(A=oa.getDtlsParameters(i,u)).role="client"),E=oa.parseRtpEncodingParameters(i);var P=oa.parseRtcpParameters(i),D=oa.matchPrefix(i,"a=end-of-candidates",u).length>0,M=oa.matchPrefix(i,"a=candidate:").map((function(e){return oa.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===r.type||"answer"===r.type)&&!f&&l&&c>0&&a.transceivers[c]&&(a._disposeIceAndDtlsTransports(c),a.transceivers[c].iceGatherer=a.transceivers[0].iceGatherer,a.transceivers[c].iceTransport=a.transceivers[0].iceTransport,a.transceivers[c].dtlsTransport=a.transceivers[0].dtlsTransport,a.transceivers[c].rtpSender&&a.transceivers[c].rtpSender.setTransport(a.transceivers[0].dtlsTransport),a.transceivers[c].rtpReceiver&&a.transceivers[c].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)),"offer"!==r.type||f){if("answer"===r.type&&!f){S=(y=a.transceivers[c]).iceGatherer,b=y.iceTransport,k=y.dtlsTransport,T=y.rtpReceiver,I=y.sendEncodingParameters,w=y.localCapabilities,a.transceivers[c].recvEncodingParameters=E,a.transceivers[c].remoteCapabilities=x,a.transceivers[c].rtcpParameters=P,M.length&&"new"===b.state&&(!d&&!D||l&&0!==c?M.forEach((function(e){da(y.iceTransport,e)})):b.setRemoteCandidates(M)),l&&0!==c||("new"===b.state&&b.start(S,C,"controlling"),"new"===k.state&&k.start(A)),!ca(y.localCapabilities,y.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&y.sendEncodingParameters[0].rtx&&delete y.sendEncodingParameters[0].rtx,a._transceive(y,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!T||"sendrecv"!==v&&"sendonly"!==v?delete y.rtpReceiver:(R=T.track,_?(o[_.stream]||(o[_.stream]=new e.MediaStream),n(R,o[_.stream]),s.push([R,T,o[_.stream]])):(o.default||(o.default=new e.MediaStream),n(R,o.default),s.push([R,T,o.default])))}}else{(y=a.transceivers[c]||a._createTransceiver(p)).mid=g,y.iceGatherer||(y.iceGatherer=a._createIceGatherer(c,l)),M.length&&"new"===y.iceTransport.state&&(!D||l&&0!==c?M.forEach((function(e){da(y.iceTransport,e)})):y.iceTransport.setRemoteCandidates(M)),w=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(w.codecs=w.codecs.filter((function(e){return"rtx"!==e.name}))),I=y.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var O,N=!1;if("sendrecv"===v||"sendonly"===v){if(N=!y.rtpReceiver,T=y.rtpReceiver||new e.RTCRtpReceiver(y.dtlsTransport,p),N)R=T.track,_&&"-"===_.stream||(_?(o[_.stream]||(o[_.stream]=new e.MediaStream,Object.defineProperty(o[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(R,"id",{get:function(){return _.track}}),O=o[_.stream]):(o.default||(o.default=new e.MediaStream),O=o.default)),O&&(n(R,O),y.associatedRemoteMediaStreams.push(O)),s.push([R,T,O])}else y.rtpReceiver&&y.rtpReceiver.track&&(y.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===y.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),y.associatedRemoteMediaStreams=[]);y.localCapabilities=w,y.remoteCapabilities=x,y.rtpReceiver=T,y.rtcpParameters=P,y.sendEncodingParameters=I,y.recvEncodingParameters=E,a._transceive(a.transceivers[c],!1,N)}}})),void 0===a._dtlsRole&&(a._dtlsRole="offer"===r.type?"active":"passive"),a._remoteDescription={type:r.type,sdp:r.sdp},"offer"===r.type?a._updateSignalingState("have-remote-offer"):a._updateSignalingState("stable"),Object.keys(o).forEach((function(t){var n=o[t];if(n.getTracks().length){if(-1===a.remoteStreams.indexOf(n)){a.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){a._dispatchEvent("addstream",r)}))}s.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&i(a,t,r,[n])}))}})),s.forEach((function(e){e[2]||i(a,e[0],e[1],[])})),e.setTimeout((function(){a&&a.transceivers&&a.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),Promise.resolve()},r.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")},r.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},r.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))},r.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)}},r.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)}},r.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(la("InvalidStateError","Can not call createOffer after close"));var i=n.transceivers.filter((function(e){return"audio"===e.kind})).length,r=n.transceivers.filter((function(e){return"video"===e.kind})).length,a=arguments[0];if(a){if(a.mandatory||a.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==a.offerToReceiveAudio&&(i=!0===a.offerToReceiveAudio?1:!1===a.offerToReceiveAudio?0:a.offerToReceiveAudio),void 0!==a.offerToReceiveVideo&&(r=!0===a.offerToReceiveVideo?1:!1===a.offerToReceiveVideo?0:a.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--r<0&&(e.wantReceive=!1)}));i>0||r>0;)i>0&&(n._createTransceiver("audio"),i--),r>0&&(n._createTransceiver("video"),r--);var o=oa.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(i,r){var a=i.track,o=i.kind,s=i.mid||oa.generateIdentifier();i.mid=s,i.iceGatherer||(i.iceGatherer=n._createIceGatherer(r,n.usingBundle));var c=e.RTCRtpSender.getCapabilities(o);t<15019&&(c.codecs=c.codecs.filter((function(e){return"rtx"!==e.name}))),c.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),c.headerExtensions.forEach((function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var u=i.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];a&&t>=15019&&"video"===o&&!u[0].rtx&&(u[0].rtx={ssrc:u[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,o)),i.localCapabilities=c,i.sendEncodingParameters=u})),"max-compat"!==n._config.bundlePolicy&&(o+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),o+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){o+=sa(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),o+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,o+="a="+oa.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(o+="a=end-of-candidates\r\n"))}));var s=new e.RTCSessionDescription({type:"offer",sdp:o});return Promise.resolve(s)},r.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(la("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(la("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var i=oa.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(i+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),i+="a=ice-options:trickle\r\n";var r=oa.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,a){if(!(a+1>r)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?i+="m=application 0 DTLS/SCTP 5000\r\n":i+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?i+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(i+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(i+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var o;if(e.stream)"audio"===e.kind?o=e.stream.getAudioTracks()[0]:"video"===e.kind&&(o=e.stream.getVideoTracks()[0]),o&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var s=ca(e.localCapabilities,e.remoteCapabilities);!s.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,i+=sa(e,s,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(i+="a=rtcp-rsize\r\n")}}));var a=new e.RTCSessionDescription({type:"answer",sdp:i});return Promise.resolve(a)},r.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(i,r){if(!n._remoteDescription)return r(la("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var o=0;o<n.transceivers.length;o++)if(n.transceivers[o].mid===e.sdpMid){a=o;break}var s=n.transceivers[a];if(!s)return r(la("OperationError","Can not add ICE candidate"));if(s.rejected)return i();var c=Object.keys(e.candidate).length>0?oa.parseCandidate(e.candidate):{};if("tcp"===c.protocol&&(0===c.port||9===c.port))return i();if(c.component&&1!==c.component)return i();if((0===a||a>0&&s.iceTransport!==n.transceivers[0].iceTransport)&&!da(s.iceTransport,c))return r(la("OperationError","Can not add ICE candidate"));var u=e.candidate.trim();0===u.indexOf("a=")&&(u=u.substr(2)),(t=oa.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(c.type?u:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=oa.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var d=0;d<n.transceivers.length&&(n.transceivers[d].rejected||(n.transceivers[d].iceTransport.addRemoteCandidate({}),(t=oa.getMediaSections(n._remoteDescription.sdp))[d]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=oa.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));d++);i()}))},r.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw la("InvalidAccessError","Invalid selector.");return n.getStats()}var i=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&i.push(e[t].getStats())}))})),Promise.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 i=n.prototype.getStats;n.prototype.getStats=function(){return i.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var i;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(i=e[n]).type]||i.type,t.set(n,e[n])})),t}))}}}));var a=["createOffer","createAnswer"];return a.forEach((function(e){var t=r.prototype[e];r.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)}})),(a=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=r.prototype[e];r.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=r.prototype[e];r.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)}})),r};function pa(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch((e=>Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString(){return this.name}}}(e))))}}function fa(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function ma(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){const t=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(e){t.set.call(this,e);const n=new Event("enabled");n.enabled=e,this.dispatchEvent(n)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){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);const n=ha(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=function(e,t){let n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((e=>{if(e&&(e.urls||e.url)){let t=e.urls||e.url;e.url&&!e.urls&&Br("RTCIceServer.url","RTCIceServer.urls");const i="string"==typeof t;return i&&(t=[t]),t=t.filter((e=>{if(0===e.indexOf("stun:"))return!1;const t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=i?t[0]:t,!!t.length}}))}(e.iceServers,t.version),jr("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype}function va(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}var _a=Object.freeze({__proto__:null,shimPeerConnection:ma,shimReplaceTrack:va,shimGetUserMedia:pa,shimGetDisplayMedia:fa});function ga(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){Br("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ya(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Sa(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,a]=arguments;return i.apply(this,[e||null]).then((e=>{if(t.version<53&&!r)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(i){if("TypeError"!==i.name)throw i;e.forEach(((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(r,a)}}function ba(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ka(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Ur(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Ta(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){Br("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function Ia(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Ea(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function wa(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function Ra(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function Ca(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var Aa=Object.freeze({__proto__:null,shimOnTrack:ya,shimPeerConnection:Sa,shimSenderGetStats:ba,shimReceiverGetStats:ka,shimRemoveStream:Ta,shimRTCDataChannel:Ia,shimAddTransceiver:Ea,shimGetParameters:wa,shimCreateOffer:Ra,shimCreateAnswer:Ca,shimGetUserMedia:ga,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function shimLocalStreamsAPI(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}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function shimRemoteStreamsAPI(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(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function xa(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,r=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],r=n.apply(this,[i]);return t?(r.then(e,t),Promise.resolve()):r},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Promise.resolve()):r};let s=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=s,s=function(e,t,n){const i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=s,s=function(e,t,n){const i=o.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=s}function Pa(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Da(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function Da(e){return e&&void 0!==e.video?Object.assign({},e,{video:Gr(e.video)}):e}function Ma(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(Br("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function Oa(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Na(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}}function La(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ua=Object.freeze({__proto__:null,shimLocalStreamsAPI:shimLocalStreamsAPI,shimRemoteStreamsAPI:shimRemoteStreamsAPI,shimCallbacksAPI:xa,shimGetUserMedia:Pa,shimConstraints:Da,shimRTCIceServerUrls:Ma,shimTrackEventTransceiver:Oa,shimCreateOfferLegacy:Na,shimAudioContext:La});function Va(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const 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){const n=new t(e),i=aa.parseCandidate(e.candidate),r=Object.assign(n,i);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Ur(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Fa(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=aa.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=aa.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},r=function(e){let 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){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const r=aa.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?i=parseInt(r[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=r(e),n=a(arguments[0],e);let o;o=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>o}),this._sctp=s}return o.apply(this,arguments)}}function ja(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],r=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&r>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Ur(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ba(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function Ha(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Ga(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}var za=Object.freeze({__proto__:null,shimRTCIceCandidate:Va,shimMaxMessageSize:Fa,shimSendThrowTypeError:ja,shimConnectionState:Ba,removeExtmapAllowMixed:Ha,shimAddIceCandidateNullOrEmpty:Ga});!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=jr,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=Lr(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=Lr(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.mediaDevices&&n.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=Lr(n.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=Lr(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),r={browserDetails:i,commonShim:za,extractVersion:Lr,disableLog:Vr,disableWarnings:Fr};switch(i.browser){case"chrome":if(!ia||!ta||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),r;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),r;n("adapter.js shimming chrome."),r.browserShim=ia,Ga(e,i),qr(e,i),Kr(e),ta(e,i),Qr(e),ea(e,i),Xr(e),$r(e),Yr(e),na(e,i),Va(e),Ba(e),Fa(e,i),ja(e),Ha(e,i);break;case"firefox":if(!Aa||!Sa||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),r;n("adapter.js shimming firefox."),r.browserShim=Aa,Ga(e,i),ga(e,i),Sa(e,i),ya(e),Ta(e),ba(e),ka(e),Ia(e),Ea(e),wa(e),Ra(e),Ca(e),Va(e),Ba(e),Fa(e,i),ja(e);break;case"edge":if(!_a||!ma||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),r;n("adapter.js shimming edge."),r.browserShim=_a,pa(e),fa(e),ma(e,i),va(e),Fa(e,i),ja(e);break;case"safari":if(!Ua||!t.shimSafari)return n("Safari shim is not included in this adapter release."),r;n("adapter.js shimming safari."),r.browserShim=Ua,Ga(e,i),Ma(e),Na(e),xa(e),shimLocalStreamsAPI(e),shimRemoteStreamsAPI(e),Oa(e),Pa(e),La(e),Va(e),Fa(e,i),ja(e),Ha(e,i);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var Wa="4.15.9",Ja={},qa=Xi,Ka=$i,Qa=Object.keys||function(e){return qa(e,Ka)},Xa=O,$a=cn,Ya=sn,Za=hn,eo=me,to=Qa;Ja.f=Xa&&!$a?Object.defineProperties:function(e,t){Za(e);for(var n,i=eo(t),r=to(t),a=r.length,o=0;a>o;)Ya.f(e,n=r[o++],i[n]);return e};var no,io=we("document","documentElement"),ro=hn,ao=Ja,oo=$i,so=Kn,co=io,uo=Kt,lo=qn("IE_PROTO"),ho=function(){},po=function(e){return"<script>"+e+"</"+"script>"},fo=function(e){e.write(po("")),e.close();var t=e.parentWindow.Object;return e=null,t},mo=function(){try{no=new ActiveXObject("htmlfile")}catch(i){}var e,t;mo="undefined"!=typeof document?document.domain&&no?fo(no):((t=uo("iframe")).style.display="none",co.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(po("document.F=Object")),e.close(),e.F):fo(no);for(var n=oo.length;n--;)delete mo.prototype[oo[n]];return mo()};so[lo]=!0;var vo=Object.create||function(e,t){var n;return null!==e?(ho.prototype=ro(e),n=new ho,ho.prototype=null,n[lo]=e):n=mo(),void 0===t?n:ao.f(n,t)},_o=Mt,go=vo,yo=sn.f,So=_o("unscopables"),bo=Array.prototype;null==bo[So]&&yo(bo,So,{configurable:!0,value:go(null)});var ko,To,Io,Eo=function(e){bo[So][e]=!0},wo={},Ro=!M((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Co=_t,Ao=ye,xo=ft,Po=Ro,Do=qn("IE_PROTO"),Mo=Object,Oo=Mo.prototype,No=Po?Mo.getPrototypeOf:function(e){var t=xo(e);if(Co(t,Do))return t[Do];var n=t.constructor;return Ao(n)&&t instanceof n?n.prototype:t instanceof Mo?Oo:null},Lo=M,Uo=ye,Vo=ke,Fo=No,jo=Ei,Bo=Mt("iterator"),Ho=!1;[].keys&&("next"in(Io=[].keys())?(To=Fo(Fo(Io)))!==Object.prototype&&(ko=To):Ho=!0);var Go=!Vo(ko)||Lo((function(){var e={};return ko[Bo].call(e)!==e}));Go&&(ko={}),Uo(ko[Bo])||jo(ko,Bo,(function(){return this}));var zo={IteratorPrototype:ko,BUGGY_SAFARI_ITERATORS:Ho},Wo=sn.f,Jo=_t,qo=Mt("toStringTag"),Ko=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Jo(e,qo)&&Wo(e,qo,{configurable:!0,value:t})},Qo=zo.IteratorPrototype,Xo=vo,$o=W,Yo=Ko,Zo=wo,es=function(){return this},ts=function(e,t,n,i){var r=t+" Iterator";return e.prototype=Xo(Qo,{next:$o(+!i,n)}),Yo(e,r,!1),Zo[r]=es,e},ns=ye,is=String,rs=TypeError,as=ie,os=hn,ss=function(e){if("object"==typeof e||ns(e))return e;throw rs("Can't set "+is(e)+" as a prototype")},cs=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=as(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(i){}return function(n,i){return os(n),ss(i),t?e(n,i):n.__proto__=i,n}}():void 0),us=Rr,ds=V,ls=ye,hs=ts,ps=No,fs=cs,ms=Ko,vs=wn,_s=Ei,gs=wo,ys=Mn.PROPER,Ss=Mn.CONFIGURABLE,bs=zo.IteratorPrototype,ks=zo.BUGGY_SAFARI_ITERATORS,Ts=Mt("iterator"),Is="keys",Es="values",ws="entries",Rs=function(){return this},Cs=function(e,t,n,i,r,a,o){hs(n,t,i);var s,c,u,d=function(e){if(e===r&&m)return m;if(!ks&&e in p)return p[e];switch(e){case Is:case Es:case ws:return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Ts]||p["@@iterator"]||r&&p[r],m=!ks&&f||d(r),v="Array"==t&&p.entries||f;if(v&&(s=ps(v.call(new e)))!==Object.prototype&&s.next&&(ps(s)!==bs&&(fs?fs(s,bs):ls(s[Ts])||_s(s,Ts,Rs)),ms(s,l,!0)),ys&&r==Es&&f&&f.name!==Es&&(Ss?vs(p,"name",Es):(h=!0,m=function(){return ds(f,this)})),r)if(c={values:d(Es),keys:a?m:d(Is),entries:d(ws)},o)for(u in c)(ks||h||!(u in p))&&_s(p,u,c[u]);else us({target:t,proto:!0,forced:ks||h},c);return p[Ts]!==m&&_s(p,Ts,m,{name:r}),gs[t]=m,c},As=function(e,t){return{value:e,done:t}},xs=me,Ps=Eo,Ds=wo,Ms=ci,Os=sn.f,Ns=Cs,Ls=As,Us=O,Vs="Array Iterator",Fs=Ms.set,js=Ms.getterFor(Vs),Bs=Ns(Array,"Array",(function(e,t){Fs(this,{type:Vs,target:xs(e),index:0,kind:t})}),(function(){var e=js(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Ls(void 0,!0)):Ls("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Hs=Ds.Arguments=Ds.Array;if(Ps("keys"),Ps("values"),Ps("entries"),Us&&"values"!==Hs.name)try{Os(Hs,"name",{value:"values"})}catch(IQ){}var Gs={};Gs[Mt("toStringTag")]="z";var zs="[object z]"===String(Gs),Ws=zs,Js=ye,qs=ee,Ks=Mt("toStringTag"),Qs=Object,Xs="Arguments"==qs(function(){return arguments}()),$s=Ws?qs:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(IQ){}}(t=Qs(e),Ks))?n:Xs?qs(t):"Object"==(i=qs(t))&&Js(t.callee)?"Arguments":i},Ys=$s,Zs=zs?{}.toString:function(){return"[object "+Ys(this)+"]"};zs||Ei(Object.prototype,"toString",Zs,{unsafe:!0});var ec={exports:{}},tc={},nc=zt,ic=sn,rc=W,ac=function(e,t,n){var i=nc(t);i in e?ic.f(e,i,rc(0,n)):e[i]=n},oc=Oi,sc=Fi,cc=ac,uc=Array,dc=Math.max,lc=function(e,t,n){for(var i=sc(e),r=oc(t,i),a=oc(void 0===n?i:n,i),o=uc(dc(a-r,0)),s=0;r<a;r++,s++)cc(o,s,e[r]);return o.length=s,o},hc=ee,pc=me,fc=wi.f,mc=lc,vc="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];tc.f=function(e){return vc&&"Window"==hc(e)?function(e){try{return fc(e)}catch(IQ){return mc(vc)}}(e):fc(pc(e))};var _c=M((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),gc=M,yc=ke,Sc=ee,bc=_c,kc=Object.isExtensible,Tc=gc((function(){kc(1)}))||bc?function(e){return!!yc(e)&&((!bc||"ArrayBuffer"!=Sc(e))&&(!kc||kc(e)))}:kc,Ic=!M((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ec=Rr,wc=ie,Rc=Kn,Cc=ke,Ac=_t,xc=sn.f,Pc=wi,Dc=tc,Mc=Tc,Oc=Ic,Nc=!1,Lc=kt("meta"),Uc=0,Vc=function(e){xc(e,Lc,{value:{objectID:"O"+Uc++,weakData:{}}})},Fc=ec.exports={enable:function(){Fc.enable=function(){},Nc=!0;var e=Pc.f,t=wc([].splice),n={};n[Lc]=1,e(n).length&&(Pc.f=function(n){for(var i=e(n),r=0,a=i.length;r<a;r++)if(i[r]===Lc){t(i,r,1);break}return i},Ec({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Dc.f}))},fastKey:function(e,t){if(!Cc(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Ac(e,Lc)){if(!Mc(e))return"F";if(!t)return"E";Vc(e)}return e[Lc].objectID},getWeakData:function(e,t){if(!Ac(e,Lc)){if(!Mc(e))return!0;if(!t)return!1;Vc(e)}return e[Lc].weakData},onFreeze:function(e){return Oc&&Nc&&Mc(e)&&!Ac(e,Lc)&&Vc(e),e}};Rc[Lc]=!0;var jc=Xe,Bc=N,Hc=ie(ie.bind),Gc=function(e,t){return jc(e),void 0===t?e:Bc?Hc(e,t):function(){return e.apply(t,arguments)}},zc=wo,Wc=Mt("iterator"),Jc=Array.prototype,qc=function(e){return void 0!==e&&(zc.Array===e||Jc[Wc]===e)},Kc=$s,Qc=Ze,Xc=ue,$c=wo,Yc=Mt("iterator"),Zc=function(e){if(!Xc(e))return Qc(e,Yc)||Qc(e,"@@iterator")||$c[Kc(e)]},eu=V,tu=Xe,nu=hn,iu=Je,ru=Zc,au=TypeError,ou=function(e,t){var n=arguments.length<2?ru(e):t;if(tu(n))return nu(eu(n,e));throw au(iu(e)+" is not iterable")},su=V,cu=hn,uu=Ze,du=function(e,t,n){var i,r;cu(e);try{if(!(i=uu(e,"return"))){if("throw"===t)throw n;return n}i=su(i,e)}catch(IQ){r=!0,i=IQ}if("throw"===t)throw n;if(r)throw i;return cu(i),n},lu=Gc,hu=V,pu=hn,fu=Je,mu=qc,vu=Fi,_u=Re,gu=ou,yu=Zc,Su=du,bu=TypeError,ku=function(e,t){this.stopped=e,this.result=t},Tu=ku.prototype,Iu=function(e,t,n){var i,r,a,o,s,c,u,d=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),f=!(!n||!n.INTERRUPTED),m=lu(t,d),v=function(e){return i&&Su(i,"normal",e),new ku(!0,e)},_=function(e){return l?(pu(e),f?m(e[0],e[1],v):m(e[0],e[1])):f?m(e,v):m(e)};if(h)i=e.iterator;else if(p)i=e;else{if(!(r=yu(e)))throw bu(fu(e)+" is not iterable");if(mu(r)){for(a=0,o=vu(e);o>a;a++)if((s=_(e[a]))&&_u(Tu,s))return s;return new ku(!1)}i=gu(e,r)}for(c=h?e.next:i.next;!(u=hu(c,i)).done;){try{s=_(u.value)}catch(IQ){Su(i,"throw",IQ)}if("object"==typeof s&&s&&_u(Tu,s))return s}return new ku(!1)},Eu=Re,wu=TypeError,Ru=function(e,t){if(Eu(t,e))return e;throw wu("Incorrect invocation")},Cu=Mt("iterator"),Au=!1;try{var xu=0,Pu={next:function(){return{done:!!xu++}},return:function(){Au=!0}};Pu[Cu]=function(){return this},Array.from(Pu,(function(){throw 2}))}catch(IQ){}var Du=function(e,t){if(!t&&!Au)return!1;var n=!1;try{var i={};i[Cu]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(IQ){}return n},Mu=ye,Ou=ke,Nu=cs,Lu=function(e,t,n){var i,r;return Nu&&Mu(i=t.constructor)&&i!==n&&Ou(r=i.prototype)&&r!==n.prototype&&Nu(e,r),e},Uu=Rr,Vu=P,Fu=ie,ju=yr,Bu=Ei,Hu=ec.exports,Gu=Iu,zu=Ru,Wu=ye,Ju=ue,qu=ke,Ku=M,Qu=Du,Xu=Ko,$u=Lu,Yu=function(e,t,n){var i=-1!==e.indexOf("Map"),r=-1!==e.indexOf("Weak"),a=i?"set":"add",o=Vu[e],s=o&&o.prototype,c=o,u={},d=function(e){var t=Fu(s[e]);Bu(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(r&&!qu(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return r&&!qu(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(r&&!qu(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(ju(e,!Wu(o)||!(r||s.forEach&&!Ku((function(){(new o).entries().next()})))))c=n.getConstructor(t,e,i,a),Hu.enable();else if(ju(e,!0)){var l=new c,h=l[a](r?{}:-0,1)!=l,p=Ku((function(){l.has(1)})),f=Qu((function(e){new o(e)})),m=!r&&Ku((function(){for(var e=new o,t=5;t--;)e[a](t,t);return!e.has(-0)}));f||((c=t((function(e,t){zu(e,s);var n=$u(new o,e,c);return Ju(t)||Gu(t,n[a],{that:n,AS_ENTRIES:i}),n}))).prototype=s,s.constructor=c),(p||m)&&(d("delete"),d("has"),i&&d("get")),(m||h)&&d(a),r&&s.clear&&delete s.clear}return u[e]=c,Uu({global:!0,constructor:!0,forced:c!=o},u),Xu(c,e),r||n.setStrong(c,e,i),c},Zu=Ei,ed=function(e,t,n){for(var i in t)Zu(e,i,t[i],n);return e},td=we,nd=sn,id=O,rd=Mt("species"),ad=function(e){var t=td(e),n=nd.f;id&&t&&!t[rd]&&n(t,rd,{configurable:!0,get:function(){return this}})},od=sn.f,sd=vo,cd=ed,ud=Gc,dd=Ru,ld=ue,hd=Iu,pd=Cs,fd=As,md=ad,vd=O,_d=ec.exports.fastKey,gd=ci.set,yd=ci.getterFor,Sd={getConstructor:function(e,t,n,i){var r=e((function(e,r){dd(e,a),gd(e,{type:t,index:sd(null),first:void 0,last:void 0,size:0}),vd||(e.size=0),ld(r)||hd(r,e[i],{that:e,AS_ENTRIES:n})})),a=r.prototype,o=yd(t),s=function(e,t,n){var i,r,a=o(e),s=c(e,t);return s?s.value=n:(a.last=s={index:r=_d(t,!0),key:t,value:n,previous:i=a.last,next:void 0,removed:!1},a.first||(a.first=s),i&&(i.next=s),vd?a.size++:e.size++,"F"!==r&&(a.index[r]=s)),e},c=function(e,t){var n,i=o(e),r=_d(t);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==t)return n};return cd(a,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,vd?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),i=c(t,e);if(i){var r=i.next,a=i.previous;delete n.index[i.index],i.removed=!0,a&&(a.next=r),r&&(r.previous=a),n.first==i&&(n.first=r),n.last==i&&(n.last=a),vd?n.size--:t.size--}return!!i},forEach:function(e){for(var t,n=o(this),i=ud(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),cd(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),vd&&od(a,"size",{get:function(){return o(this).size}}),r},setStrong:function(e,t,n){var i=t+" Iterator",r=yd(t),a=yd(i);pd(e,t,(function(e,t){gd(this,{type:i,target:e,state:r(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?fd("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,fd(void 0,!0))}),n?"entries":"values",!n,!0),md(t)}};Yu("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sd);var bd=$s,kd=String,Td=function(e){if("Symbol"===bd(e))throw TypeError("Cannot convert a Symbol value to a string");return kd(e)},Id=ie,Ed=xi,wd=Td,Rd=he,Cd=Id("".charAt),Ad=Id("".charCodeAt),xd=Id("".slice),Pd=function(e){return function(t,n){var i,r,a=wd(Rd(t)),o=Ed(n),s=a.length;return o<0||o>=s?e?"":void 0:(i=Ad(a,o))<55296||i>56319||o+1===s||(r=Ad(a,o+1))<56320||r>57343?e?Cd(a,o):i:e?xd(a,o,o+2):r-56320+(i-55296<<10)+65536}},Dd={codeAt:Pd(!1),charAt:Pd(!0)},Md=Dd.charAt,Od=Td,Nd=ci,Ld=Cs,Ud=As,Vd="String Iterator",Fd=Nd.set,jd=Nd.getterFor(Vd);Ld(String,"String",(function(e){Fd(this,{type:Vd,string:Od(e),index:0})}),(function(){var e,t=jd(this),n=t.string,i=t.index;return i>=n.length?Ud(void 0,!0):(e=Md(n,i),t.index+=e.length,Ud(e,!1))}));var Bd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Hd=Kt("span").classList,Gd=Hd&&Hd.constructor&&Hd.constructor.prototype,zd=Gd===Object.prototype?void 0:Gd,Wd=P,Jd=Bd,qd=zd,Kd=Bs,Qd=wn,Xd=Mt,$d=Xd("iterator"),Yd=Xd("toStringTag"),Zd=Kd.values,el=function(e,t){if(e){if(e[$d]!==Zd)try{Qd(e,$d,Zd)}catch(IQ){e[$d]=Zd}if(e[Yd]||Qd(e,Yd,t),Jd[t])for(var n in Kd)if(e[n]!==Kd[n])try{Qd(e,n,Kd[n])}catch(IQ){e[n]=Kd[n]}}};for(var tl in Jd)el(Wd[tl]&&Wd[tl].prototype,tl);el(qd,"DOMTokenList");var nl=N,il=Function.prototype,rl=il.apply,al=il.call,ol="object"==typeof Reflect&&Reflect.apply||(nl?al.bind(rl):function(){return al.apply(rl,arguments)}),sl=ie([].slice),cl=TypeError,ul=function(e,t){if(e<t)throw cl("Not enough arguments");return e},dl=P,ll=ol,hl=ye,pl=sl,fl=ul,ml=/MSIE .\./.test(Ce),vl=dl.Function,_l=function(e){return ml?function(t,n){var i=fl(arguments.length,1)>2,r=hl(t)?t:vl(t),a=i?pl(arguments,2):void 0;return e(i?function(){ll(r,this,a)}:r,n)}:e},gl={setTimeout:_l(dl.setTimeout),setInterval:_l(dl.setInterval)},yl=gl.setInterval;Rr({global:!0,bind:!0,forced:P.setInterval!==yl},{setInterval:yl});var Sl=gl.setTimeout;Rr({global:!0,bind:!0,forced:P.setTimeout!==Sl},{setTimeout:Sl}),Yu("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sd);var bl=ee,kl=Array.isArray||function(e){return"Array"==bl(e)},Tl=ie,Il=M,El=ye,wl=$s,Rl=jn,Cl=function(){},Al=[],xl=we("Reflect","construct"),Pl=/^\s*(?:class|function)\b/,Dl=Tl(Pl.exec),Ml=!Pl.exec(Cl),Ol=function(e){if(!El(e))return!1;try{return xl(Cl,Al,e),!0}catch(IQ){return!1}},Nl=function(e){if(!El(e))return!1;switch(wl(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ml||!!Dl(Pl,Rl(e))}catch(IQ){return!0}};Nl.sham=!0;var Ll=!xl||Il((function(){var e;return Ol(Ol.call)||!Ol(Object)||!Ol((function(){e=!0}))||e}))?Nl:Ol,Ul=kl,Vl=Ll,Fl=ke,jl=Mt("species"),Bl=Array,Hl=function(e){var t;return Ul(e)&&(t=e.constructor,(Vl(t)&&(t===Bl||Ul(t.prototype))||Fl(t)&&null===(t=t[jl]))&&(t=void 0)),void 0===t?Bl:t},Gl=function(e,t){return new(Hl(e))(0===t?0:t)},zl=Gc,Wl=ce,Jl=ft,ql=Fi,Kl=Gl,Ql=ie([].push),Xl=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,a=6==e,o=7==e,s=5==e||a;return function(c,u,d,l){for(var h,p,f=Jl(c),m=Wl(f),v=zl(u,d),_=ql(m),g=0,y=l||Kl,S=t?y(c,_):n||o?y(c,0):void 0;_>g;g++)if((s||g in m)&&(p=v(h=m[g],g,f),e))if(t)S[g]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return g;case 2:Ql(S,h)}else switch(e){case 4:return!1;case 7:Ql(S,h)}return a?-1:i||r?r:S}},$l={forEach:Xl(0),map:Xl(1),filter:Xl(2),some:Xl(3),every:Xl(4),find:Xl(5),findIndex:Xl(6),filterReject:Xl(7)},Yl=M,Zl=Ne,eh=Mt("species"),th=function(e){return Zl>=51||!Yl((function(){var t=[];return(t.constructor={})[eh]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},nh=$l.map;Rr({target:"Array",proto:!0,forced:!th("map")},{map:function(e){return nh(this,e,arguments.length>1?arguments[1]:void 0)}});var ih=O,rh=kl,ah=TypeError,oh=Object.getOwnPropertyDescriptor,sh=ih&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(IQ){return IQ instanceof TypeError}}(),ch=TypeError,uh=function(e){if(e>9007199254740991)throw ch("Maximum allowed index exceeded");return e},dh=Je,lh=TypeError,hh=function(e,t){if(!delete e[t])throw lh("Cannot delete property "+dh(t)+" of "+dh(e))},ph=Rr,fh=ft,mh=Oi,vh=xi,_h=Fi,gh=sh?function(e,t){if(rh(e)&&!oh(e,"length").writable)throw ah("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},yh=uh,Sh=Gl,bh=ac,kh=hh,Th=th("splice"),Ih=Math.max,Eh=Math.min;ph({target:"Array",proto:!0,forced:!Th},{splice:function(e,t){var n,i,r,a,o,s,c=fh(this),u=_h(c),d=mh(e,u),l=arguments.length;for(0===l?n=i=0:1===l?(n=0,i=u-d):(n=l-2,i=Eh(Ih(vh(t),0),u-d)),yh(u+n-i),r=Sh(c,i),a=0;a<i;a++)(o=d+a)in c&&bh(r,a,c[o]);if(r.length=i,n<i){for(a=d;a<u-i;a++)s=a+n,(o=a+i)in c?c[s]=c[o]:kh(c,s);for(a=u;a>u-i+n;a--)kh(c,a-1)}else if(n>i)for(a=u-i;a>d;a--)s=a+n-1,(o=a+i-1)in c?c[s]=c[o]:kh(c,s);for(a=0;a<n;a++)c[a+d]=arguments[a+2];return gh(c,u-i+n),r}});var wh=M,Rh=function(e,t){var n=[][e];return!!n&&wh((function(){n.call(null,t||function(){return 1},1)}))},Ch=$l.forEach,Ah=Rh("forEach")?[].forEach:function(e){return Ch(this,e,arguments.length>1?arguments[1]:void 0)};Rr({target:"Array",proto:!0,forced:[].forEach!=Ah},{forEach:Ah});var xh=P,Ph=Bd,Dh=zd,Mh=Ah,Oh=wn,Nh=function(e){if(e&&e.forEach!==Mh)try{Oh(e,"forEach",Mh)}catch(IQ){e.forEach=Mh}};for(var Lh in Ph)Ph[Lh]&&Nh(xh[Lh]&&xh[Lh].prototype);Nh(Dh);var Uh=Rr,Vh=ce,Fh=me,jh=Rh,Bh=ie([].join),Hh=Vh!=Object,Gh=jh("join",",");Uh({target:"Array",proto:!0,forced:Hh||!Gh},{join:function(e){return Bh(Fh(this),void 0===e?",":e)}});var zh=$l.filter;Rr({target:"Array",proto:!0,forced:!th("filter")},{filter:function(e){return zh(this,e,arguments.length>1?arguments[1]:void 0)}});var Wh=Rr,Jh=M,qh=kl,Kh=ke,Qh=ft,Xh=Fi,$h=uh,Yh=ac,Zh=Gl,ep=th,tp=Ne,np=Mt("isConcatSpreadable"),ip=tp>=51||!Jh((function(){var e=[];return e[np]=!1,e.concat()[0]!==e})),rp=ep("concat"),ap=function(e){if(!Kh(e))return!1;var t=e[np];return void 0!==t?!!t:qh(e)};Wh({target:"Array",proto:!0,arity:1,forced:!ip||!rp},{concat:function(e){var t,n,i,r,a,o=Qh(this),s=Zh(o,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(ap(a=-1===t?o:arguments[t]))for(r=Xh(a),$h(c+r),n=0;n<r;n++,c++)n in a&&Yh(s,c,a[n]);else $h(c+1),Yh(s,c++,a);return s.length=c,s}});var op=ie,sp=Ei,cp=Date.prototype,up="Invalid Date",dp="toString",lp=op(cp.toString),hp=op(cp.getTime);String(new Date(NaN))!=up&&sp(cp,dp,(function(){var e=hp(this);return e==e?lp(this):up}));var pp=xi,fp=Td,mp=he,vp=RangeError,_p=function(e){var t=fp(mp(this)),n="",i=pp(e);if(i<0||Infinity==i)throw vp("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},gp=ie,yp=Ui,Sp=Td,bp=he,kp=gp(_p),Tp=gp("".slice),Ip=Math.ceil,Ep=function(e){return function(t,n,i){var r,a,o=Sp(bp(t)),s=yp(n),c=o.length,u=void 0===i?" ":Sp(i);return s<=c||""==u?o:((a=kp(u,Ip((r=s-c)/u.length))).length>r&&(a=Tp(a,0,r)),e?o+a:a+o)}},wp={start:Ep(!1),end:Ep(!0)},Rp=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Ce),Cp=wp.start;Rr({target:"String",proto:!0,forced:Rp},{padStart:function(e){return Cp(this,e,arguments.length>1?arguments[1]:void 0)}});var Ap=hn,xp=function(){var e=Ap(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Pp=M,Dp=P.RegExp,Mp=Pp((function(){var e=Dp("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Op=Mp||Pp((function(){return!Dp("a","y").sticky})),Np={BROKEN_CARET:Mp||Pp((function(){var e=Dp("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Op,UNSUPPORTED_Y:Mp},Lp=M,Up=P.RegExp,Vp=Lp((function(){var e=Up(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Fp=M,jp=P.RegExp,Bp=Fp((function(){var e=jp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Hp=V,Gp=ie,zp=Td,Wp=xp,Jp=Np,qp=rt.exports,Kp=vo,Qp=ci.get,Xp=Vp,$p=Bp,Yp=qp("native-string-replace",String.prototype.replace),Zp=RegExp.prototype.exec,ef=Zp,tf=Gp("".charAt),nf=Gp("".indexOf),rf=Gp("".replace),af=Gp("".slice),of=function(){var e=/a/,t=/b*/g;return Hp(Zp,e,"a"),Hp(Zp,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),sf=Jp.BROKEN_CARET,cf=void 0!==/()??/.exec("")[1];(of||cf||sf||Xp||$p)&&(ef=function(e){var t,n,i,r,a,o,s,c=this,u=Qp(c),d=zp(e),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=Hp(ef,l,d),c.lastIndex=l.lastIndex,t;var h=u.groups,p=sf&&c.sticky,f=Hp(Wp,c),m=c.source,v=0,_=d;if(p&&(f=rf(f,"y",""),-1===nf(f,"g")&&(f+="g"),_=af(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==tf(d,c.lastIndex-1))&&(m="(?: "+m+")",_=" "+_,v++),n=new RegExp("^(?:"+m+")",f)),cf&&(n=new RegExp("^"+m+"$(?!\\s)",f)),of&&(i=c.lastIndex),r=Hp(Zp,p?n:c,_),p?r?(r.input=af(r.input,v),r[0]=af(r[0],v),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:of&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),cf&&r&&r.length>1&&Hp(Yp,r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&h)for(r.groups=o=Kp(null),a=0;a<h.length;a++)o[(s=h[a])[0]]=r[s[1]];return r});var uf=ef;Rr({target:"RegExp",proto:!0,forced:/./.exec!==uf},{exec:uf});var df=ie,lf=Ei,hf=uf,pf=M,ff=Mt,mf=wn,vf=ff("species"),_f=RegExp.prototype,gf=function(e,t,n,i){var r=ff(e),a=!pf((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),o=a&&!pf((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[vf]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!a||!o||n){var s=df(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var o=df(e),c=t.exec;return c===hf||c===_f.exec?a&&!r?{done:!0,value:s(t,n,i)}:{done:!0,value:o(n,t,i)}:{done:!1}}));lf(String.prototype,e,c[0]),lf(_f,r,c[1])}i&&mf(_f[r],"sham",!0)},yf=Dd.charAt,Sf=function(e,t,n){return t+(n?yf(e,t).length:1)},bf=ie,kf=ft,Tf=Math.floor,If=bf("".charAt),Ef=bf("".replace),wf=bf("".slice),Rf=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Cf=/\$([$&'`]|\d{1,2})/g,Af=V,xf=hn,Pf=ye,Df=ee,Mf=uf,Of=TypeError,Nf=function(e,t){var n=e.exec;if(Pf(n)){var i=Af(n,e,t);return null!==i&&xf(i),i}if("RegExp"===Df(e))return Af(Mf,e,t);throw Of("RegExp#exec called on incompatible receiver")},Lf=ol,Uf=V,Vf=ie,Ff=gf,jf=M,Bf=hn,Hf=ye,Gf=ue,zf=xi,Wf=Ui,Jf=Td,qf=he,Kf=Sf,Qf=Ze,Xf=function(e,t,n,i,r,a){var o=n+e.length,s=i.length,c=Cf;return void 0!==r&&(r=kf(r),c=Rf),Ef(a,c,(function(a,c){var u;switch(If(c,0)){case"$":return"$";case"&":return e;case"`":return wf(t,0,n);case"'":return wf(t,o);case"<":u=r[wf(c,1,-1)];break;default:var d=+c;if(0===d)return a;if(d>s){var l=Tf(d/10);return 0===l?a:l<=s?void 0===i[l-1]?If(c,1):i[l-1]+If(c,1):a}u=i[d-1]}return void 0===u?"":u}))},$f=Nf,Yf=Mt("replace"),Zf=Math.max,em=Math.min,tm=Vf([].concat),nm=Vf([].push),im=Vf("".indexOf),rm=Vf("".slice),am="$0"==="a".replace(/./,"$0"),om=!!/./[Yf]&&""===/./[Yf]("a","$0"),sm=!jf((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));Ff("replace",(function(e,t,n){var i=om?"$":"$0";return[function(e,n){var i=qf(this),r=Gf(e)?void 0:Qf(e,Yf);return r?Uf(r,e,i,n):Uf(t,Jf(i),e,n)},function(e,r){var a=Bf(this),o=Jf(e);if("string"==typeof r&&-1===im(r,i)&&-1===im(r,"$<")){var s=n(t,a,o,r);if(s.done)return s.value}var c=Hf(r);c||(r=Jf(r));var u=a.global;if(u){var d=a.unicode;a.lastIndex=0}for(var l=[];;){var h=$f(a,o);if(null===h)break;if(nm(l,h),!u)break;""===Jf(h[0])&&(a.lastIndex=Kf(o,Wf(a.lastIndex),d))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var _=Jf((h=l[v])[0]),g=Zf(em(zf(h.index),o.length),0),y=[],S=1;S<h.length;S++)nm(y,void 0===(p=h[S])?p:String(p));var b=h.groups;if(c){var k=tm([_],y,g,o);void 0!==b&&nm(k,b);var T=Jf(Lf(r,void 0,k))}else T=Xf(_,o,g,y,b,r);g>=m&&(f+=rm(o,m,g)+T,m=g+_.length)}return f+rm(o,m)}]}),!sm||!am||om);var cm=V,um=_t,dm=Re,lm=xp,hm=RegExp.prototype,pm=function(e){var t=e.flags;return void 0!==t||"flags"in hm||um(e,"flags")||!dm(hm,e)?t:cm(lm,e)},fm=Mn.PROPER,mm=Ei,vm=hn,_m=Td,gm=M,ym=pm,Sm="toString",bm=RegExp.prototype.toString,km=gm((function(){return"/a/b"!=bm.call({source:"a",flags:"b"})})),Tm=fm&&bm.name!=Sm;(km||Tm)&&mm(RegExp.prototype,Sm,(function(){var e=vm(this);return"/"+_m(e.source)+"/"+_m(ym(e))}),{unsafe:!0});var Im=M,Em=Mt("iterator"),wm=!Im((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Em]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Rm=lc,Cm=Math.floor,Am=function(e,t){var n=e.length,i=Cm(n/2);return n<8?xm(e,t):Pm(e,Am(Rm(e,0,i),t),Am(Rm(e,i),t),t)},xm=function(e,t){for(var n,i,r=e.length,a=1;a<r;){for(i=a,n=e[a];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==a++&&(e[i]=n)}return e},Pm=function(e,t,n,i){for(var r=t.length,a=n.length,o=0,s=0;o<r||s<a;)e[o+s]=o<r&&s<a?i(t[o],n[s])<=0?t[o++]:n[s++]:o<r?t[o++]:n[s++];return e},Dm=Am,Mm=Rr,Om=P,Nm=V,Lm=ie,Um=O,Vm=wm,Fm=Ei,jm=ed,Bm=Ko,Hm=ts,Gm=ci,zm=Ru,Wm=ye,Jm=_t,qm=Gc,Km=$s,Qm=hn,Xm=ke,$m=Td,Ym=vo,Zm=W,ev=ou,tv=Zc,nv=ul,iv=Dm,rv=Mt("iterator"),av="URLSearchParams",ov="URLSearchParamsIterator",sv=Gm.set,cv=Gm.getterFor(av),uv=Gm.getterFor(ov),dv=Object.getOwnPropertyDescriptor,lv=function(e){if(!Um)return Om[e];var t=dv(Om,e);return t&&t.value},hv=lv("fetch"),pv=lv("Request"),fv=lv("Headers"),mv=pv&&pv.prototype,vv=fv&&fv.prototype,_v=Om.RegExp,gv=Om.TypeError,yv=Om.decodeURIComponent,Sv=Om.encodeURIComponent,bv=Lm("".charAt),kv=Lm([].join),Tv=Lm([].push),Iv=Lm("".replace),Ev=Lm([].shift),wv=Lm([].splice),Rv=Lm("".split),Cv=Lm("".slice),Av=/\+/g,xv=Array(4),Pv=function(e){return xv[e-1]||(xv[e-1]=_v("((?:%[\\da-f]{2}){"+e+"})","gi"))},Dv=function(e){try{return yv(e)}catch(IQ){return e}},Mv=function(e){var t=Iv(e,Av," "),n=4;try{return yv(t)}catch(IQ){for(;n;)t=Iv(t,Pv(n--),Dv);return t}},Ov=/[!'()~]|%20/g,Nv={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Lv=function(e){return Nv[e]},Uv=function(e){return Iv(Sv(e),Ov,Lv)},Vv=Hm((function(e,t){sv(this,{type:ov,iterator:ev(cv(e).entries),kind:t})}),"Iterator",(function(){var e=uv(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),Fv=function(e){this.entries=[],this.url=null,void 0!==e&&(Xm(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===bv(e,0)?Cv(e,1):e:$m(e)))};Fv.prototype={type:av,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,a,o,s,c=tv(e);if(c)for(n=(t=ev(e,c)).next;!(i=Nm(n,t)).done;){if(a=(r=ev(Qm(i.value))).next,(o=Nm(a,r)).done||(s=Nm(a,r)).done||!Nm(a,r).done)throw gv("Expected sequence with length 2");Tv(this.entries,{key:$m(o.value),value:$m(s.value)})}else for(var u in e)Jm(e,u)&&Tv(this.entries,{key:u,value:$m(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=Rv(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=Rv(t,"="),Tv(this.entries,{key:Mv(Ev(n)),value:Mv(kv(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],Tv(n,Uv(e.key)+"="+Uv(e.value));return kv(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var jv=function(){zm(this,Bv);var e=arguments.length>0?arguments[0]:void 0;sv(this,new Fv(e))},Bv=jv.prototype;if(jm(Bv,{append:function(e,t){nv(arguments.length,2);var n=cv(this);Tv(n.entries,{key:$m(e),value:$m(t)}),n.updateURL()},delete:function(e){nv(arguments.length,1);for(var t=cv(this),n=t.entries,i=$m(e),r=0;r<n.length;)n[r].key===i?wv(n,r,1):r++;t.updateURL()},get:function(e){nv(arguments.length,1);for(var t=cv(this).entries,n=$m(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){nv(arguments.length,1);for(var t=cv(this).entries,n=$m(e),i=[],r=0;r<t.length;r++)t[r].key===n&&Tv(i,t[r].value);return i},has:function(e){nv(arguments.length,1);for(var t=cv(this).entries,n=$m(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){nv(arguments.length,1);for(var n,i=cv(this),r=i.entries,a=!1,o=$m(e),s=$m(t),c=0;c<r.length;c++)(n=r[c]).key===o&&(a?wv(r,c--,1):(a=!0,n.value=s));a||Tv(r,{key:o,value:s}),i.updateURL()},sort:function(){var e=cv(this);iv(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=cv(this).entries,i=qm(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new Vv(this,"keys")},values:function(){return new Vv(this,"values")},entries:function(){return new Vv(this,"entries")}},{enumerable:!0}),Fm(Bv,rv,Bv.entries,{name:"entries"}),Fm(Bv,"toString",(function(){return cv(this).serialize()}),{enumerable:!0}),Bm(jv,av),Mm({global:!0,constructor:!0,forced:!Vm},{URLSearchParams:jv}),!Vm&&Wm(fv)){var Hv=Lm(vv.has),Gv=Lm(vv.set),zv=function(e){if(Xm(e)){var t,n=e.body;if(Km(n)===av)return t=e.headers?new fv(e.headers):new fv,Hv(t,"content-type")||Gv(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Ym(e,{body:Zm(0,$m(n)),headers:Zm(0,t)})}return e};if(Wm(hv)&&Mm({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return hv(e,arguments.length>1?zv(arguments[1]):{})}}),Wm(pv)){var Wv=function(e){return zm(this,mv),new pv(e,arguments.length>1?zv(arguments[1]):{})};mv.constructor=Wv,Wv.prototype=mv,Mm({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Wv})}}var Jv={URLSearchParams:jv,getState:cv},qv=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Kv=V,Qv=hn,Xv=ue,$v=he,Yv=qv,Zv=Td,e_=Ze,t_=Nf;gf("search",(function(e,t,n){return[function(t){var n=$v(this),i=Xv(t)?void 0:e_(t,e);return i?Kv(i,t,n):new RegExp(t)[e](Zv(n))},function(e){var i=Qv(this),r=Zv(e),a=n(t,i,r);if(a.done)return a.value;var o=i.lastIndex;Yv(o,0)||(i.lastIndex=0);var s=t_(i,r);return Yv(i.lastIndex,o)||(i.lastIndex=o),null===s?-1:s.index}]}));(new Date).getTime();var n_=0,i_=function(){return(new Date).getTime()+n_},r_=function(){var e=new Date;return e.setTime(i_()),e.toLocaleString()},a_=V,o_=hn,s_=ue,c_=Ui,u_=Td,d_=he,l_=Ze,h_=Sf,p_=Nf;gf("match",(function(e,t,n){return[function(t){var n=d_(this),i=s_(t)?void 0:l_(t,e);return i?a_(i,t,n):new RegExp(t)[e](u_(n))},function(e){var i=o_(this),r=u_(e),a=n(t,i,r);if(a.done)return a.value;if(!i.global)return p_(i,r);var o=i.unicode;i.lastIndex=0;for(var s,c=[],u=0;null!==(s=p_(i,r));){var d=u_(s[0]);c[u]=d,""===d&&(i.lastIndex=h_(r,c_(i.lastIndex),o)),u++}return 0===u?null:c}]}));var f_=ke,m_=ee,v_=Mt("match"),__=function(e){var t;return f_(e)&&(void 0!==(t=e[v_])?!!t:"RegExp"==m_(e))},g_=sn.f,y_=O,S_=P,b_=ie,k_=yr,T_=Lu,I_=wn,E_=wi.f,w_=Re,R_=__,C_=Td,A_=pm,x_=Np,P_=function(e,t,n){n in e||g_(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},D_=Ei,M_=M,O_=_t,N_=ci.enforce,L_=ad,U_=Vp,V_=Bp,F_=Mt("match"),j_=S_.RegExp,B_=j_.prototype,H_=S_.SyntaxError,G_=b_(B_.exec),z_=b_("".charAt),W_=b_("".replace),J_=b_("".indexOf),q_=b_("".slice),K_=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Q_=/a/g,X_=/a/g,$_=new j_(Q_)!==Q_,Y_=x_.MISSED_STICKY,Z_=x_.UNSUPPORTED_Y,eg=y_&&(!$_||Y_||U_||V_||M_((function(){return X_[F_]=!1,j_(Q_)!=Q_||j_(X_)==X_||"/a/i"!=j_(Q_,"i")})));if(k_("RegExp",eg)){for(var tg=function(e,t){var n,i,r,a,o,s,c=w_(B_,this),u=R_(e),d=void 0===t,l=[],h=e;if(!c&&u&&d&&e.constructor===tg)return e;if((u||w_(B_,e))&&(e=e.source,d&&(t=A_(h))),e=void 0===e?"":C_(e),t=void 0===t?"":C_(t),h=e,U_&&"dotAll"in Q_&&(i=!!t&&J_(t,"s")>-1)&&(t=W_(t,/s/g,"")),n=t,Y_&&"sticky"in Q_&&(r=!!t&&J_(t,"y")>-1)&&Z_&&(t=W_(t,/y/g,"")),V_&&(a=function(e){for(var t,n=e.length,i=0,r="",a=[],o={},s=!1,c=!1,u=0,d="";i<=n;i++){if("\\"===(t=z_(e,i)))t+=z_(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:G_(K_,q_(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===d||O_(o,d))throw new H_("Invalid capture group name");o[d]=!0,a[a.length]=[d,u],c=!1,d="";continue}c?d+=t:r+=t}return[r,a]}(e),e=a[0],l=a[1]),o=T_(j_(e,t),c?this:B_,tg),(i||r||l.length)&&(s=N_(o),i&&(s.dotAll=!0,s.raw=tg(function(e){for(var t,n=e.length,i=0,r="",a=!1;i<=n;i++)"\\"!==(t=z_(e,i))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),r+=t):r+="[\\s\\S]":r+=t+z_(e,++i);return r}(e),n)),r&&(s.sticky=!0),l.length&&(s.groups=l)),e!==h)try{I_(o,"source",""===h?"(?:)":h)}catch(IQ){}return o},ng=E_(j_),ig=0;ng.length>ig;)P_(tg,j_,ng[ig++]);B_.constructor=tg,tg.prototype=B_,D_(S_,"RegExp",tg,{constructor:!0})}L_("RegExp");var rg=ie(1..valueOf),ag="\t\n\v\f\r                 \u2028\u2029\ufeff",og=he,sg=Td,cg=ie("".replace),ug="[\t\n\v\f\r                 \u2028\u2029\ufeff]",dg=RegExp("^"+ug+ug+"*"),lg=RegExp(ug+ug+"*$"),hg=function(e){return function(t){var n=sg(og(t));return 1&e&&(n=cg(n,dg,"")),2&e&&(n=cg(n,lg,"")),n}},pg={start:hg(1),end:hg(2),trim:hg(3)},fg=O,mg=P,vg=ie,_g=yr,gg=Ei,yg=_t,Sg=Lu,bg=Re,kg=ze,Tg=Bt,Ig=M,Eg=wi.f,wg=D.f,Rg=sn.f,Cg=rg,Ag=pg.trim,xg="Number",Pg=mg.Number,Dg=Pg.prototype,Mg=mg.TypeError,Og=vg("".slice),Ng=vg("".charCodeAt),Lg=function(e){var t=Tg(e,"number");return"bigint"==typeof t?t:Ug(t)},Ug=function(e){var t,n,i,r,a,o,s,c,u=Tg(e,"number");if(kg(u))throw Mg("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=Ag(u),43===(t=Ng(u,0))||45===t){if(88===(n=Ng(u,2))||120===n)return NaN}else if(48===t){switch(Ng(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(o=(a=Og(u,2)).length,s=0;s<o;s++)if((c=Ng(a,s))<48||c>r)return NaN;return parseInt(a,i)}return+u};if(_g(xg,!Pg(" 0o1")||!Pg("0b1")||Pg("+0x1"))){for(var Vg,Fg=function(e){var t=arguments.length<1?0:Pg(Lg(e)),n=this;return bg(Dg,n)&&Ig((function(){Cg(n)}))?Sg(Object(t),n,Fg):t},jg=fg?Eg(Pg):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),Bg=0;jg.length>Bg;Bg++)yg(Pg,Vg=jg[Bg])&&!yg(Fg,Vg)&&Rg(Fg,Vg,wg(Pg,Vg));Fg.prototype=Dg,Dg.constructor=Fg,gg(mg,xg,Fg,{constructor:!0})}var Hg=zi.includes,Gg=Eo;Rr({target:"Array",proto:!0,forced:M((function(){return!Array(1).includes()}))},{includes:function(e){return Hg(this,e,arguments.length>1?arguments[1]:void 0)}}),Gg("includes");var zg=__,Wg=TypeError,Jg=function(e){if(zg(e))throw Wg("The method doesn't accept regular expressions");return e},qg=Mt("match"),Kg=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[qg]=!1,"/./"[e](t)}catch(i){}}return!1},Qg=Rr,Xg=Jg,$g=he,Yg=Td,Zg=Kg,ey=ie("".indexOf);Qg({target:"String",proto:!0,forced:!Zg("includes")},{includes:function(e){return!!~ey(Yg($g(this)),Yg(Xg(e)),arguments.length>1?arguments[1]:void 0)}});var ty=Rr,ny=zi.indexOf,iy=Rh,ry=ie([].indexOf),ay=!!ry&&1/ry([1],1,-0)<0,oy=iy("indexOf");ty({target:"Array",proto:!0,forced:ay||!oy},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return ay?ry(this,e,t)||0:ny(this,e,t)}});var sy=ft,cy=No,uy=Ro;Rr({target:"Object",stat:!0,forced:M((function(){cy(1)})),sham:!uy},{getPrototypeOf:function(e){return cy(sy(e))}});var dy=ol,ly=Xe,hy=hn;Rr({target:"Reflect",stat:!0,forced:!M((function(){Reflect.apply((function(){}))}))},{apply:function(e,t,n){return dy(ly(e),t,hy(n))}});var py=O,fy=Mn.EXISTS,my=ie,vy=sn.f,_y=Function.prototype,gy=my(_y.toString),yy=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Sy=my(yy.exec);py&&!fy&&vy(_y,"name",{configurable:!0,get:function(){try{return Sy(yy,gy(this))[1]}catch(IQ){return""}}});var by=Rr,ky=Date,Ty=ie(ky.prototype.getTime);by({target:"Date",stat:!0},{now:function(){return Ty(new ky)}});var Iy,Ey,wy,Ry,Cy="process"==ee(P.process),Ay=Ll,xy=Je,Py=TypeError,Dy=function(e){if(Ay(e))return e;throw Py(xy(e)+" is not a constructor")},My=hn,Oy=Dy,Ny=ue,Ly=Mt("species"),Uy=function(e,t){var n,i=My(e).constructor;return void 0===i||Ny(n=My(i)[Ly])?t:Oy(n)},Vy=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ce),Fy=P,jy=ol,By=Gc,Hy=ye,Gy=_t,zy=M,Wy=io,Jy=sl,qy=Kt,Ky=ul,Qy=Vy,Xy=Cy,$y=Fy.setImmediate,Yy=Fy.clearImmediate,Zy=Fy.process,eS=Fy.Dispatch,tS=Fy.Function,nS=Fy.MessageChannel,iS=Fy.String,rS=0,aS={},oS="onreadystatechange";try{Iy=Fy.location}catch(IQ){}var sS=function(e){if(Gy(aS,e)){var t=aS[e];delete aS[e],t()}},cS=function(e){return function(){sS(e)}},uS=function(e){sS(e.data)},dS=function(e){Fy.postMessage(iS(e),Iy.protocol+"//"+Iy.host)};$y&&Yy||($y=function(e){Ky(arguments.length,1);var t=Hy(e)?e:tS(e),n=Jy(arguments,1);return aS[++rS]=function(){jy(t,void 0,n)},Ey(rS),rS},Yy=function(e){delete aS[e]},Xy?Ey=function(e){Zy.nextTick(cS(e))}:eS&&eS.now?Ey=function(e){eS.now(cS(e))}:nS&&!Qy?(Ry=(wy=new nS).port2,wy.port1.onmessage=uS,Ey=By(Ry.postMessage,Ry)):Fy.addEventListener&&Hy(Fy.postMessage)&&!Fy.importScripts&&Iy&&"file:"!==Iy.protocol&&!zy(dS)?(Ey=dS,Fy.addEventListener("message",uS,!1)):Ey=oS in qy("script")?function(e){Wy.appendChild(qy("script")).onreadystatechange=function(){Wy.removeChild(this),sS(e)}}:function(e){setTimeout(cS(e),0)});var lS,hS,pS,fS,mS,vS,_S,gS,yS={set:$y,clear:Yy},SS=P,bS=/ipad|iphone|ipod/i.test(Ce)&&void 0!==SS.Pebble,kS=/web0s(?!.*chrome)/i.test(Ce),TS=P,IS=Gc,ES=D.f,wS=yS.set,RS=Vy,CS=bS,AS=kS,xS=Cy,PS=TS.MutationObserver||TS.WebKitMutationObserver,DS=TS.document,MS=TS.process,OS=TS.Promise,NS=ES(TS,"queueMicrotask"),LS=NS&&NS.value;LS||(lS=function(){var e,t;for(xS&&(e=MS.domain)&&e.exit();hS;){t=hS.fn,hS=hS.next;try{t()}catch(IQ){throw hS?fS():pS=void 0,IQ}}pS=void 0,e&&e.enter()},RS||xS||AS||!PS||!DS?!CS&&OS&&OS.resolve?((_S=OS.resolve(void 0)).constructor=OS,gS=IS(_S.then,_S),fS=function(){gS(lS)}):xS?fS=function(){MS.nextTick(lS)}:(wS=IS(wS,TS),fS=function(){wS(lS)}):(mS=!0,vS=DS.createTextNode(""),new PS(lS).observe(vS,{characterData:!0}),fS=function(){vS.data=mS=!mS}));var US=LS||function(e){var t={fn:e,next:void 0};pS&&(pS.next=t),hS||(hS=t,fS()),pS=t},VS=P,FS=function(e){try{return{error:!1,value:e()}}catch(IQ){return{error:!0,value:IQ}}},jS=function(){this.head=null,this.tail=null};jS.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var BS=jS,HS=P.Promise,GS="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,zS=!GS&&!Cy&&"object"==typeof window&&"object"==typeof document,WS=P,JS=HS,qS=ye,KS=yr,QS=jn,XS=Mt,$S=zS,YS=GS,ZS=Ne;JS&&JS.prototype;var eb=XS("species"),tb=!1,nb=qS(WS.PromiseRejectionEvent),ib=KS("Promise",(function(){var e=QS(JS),t=e!==String(JS);if(!t&&66===ZS)return!0;if(!ZS||ZS<51||!/native code/.test(e)){var n=new JS((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[eb]=i,!(tb=n.then((function(){}))instanceof i))return!0}return!t&&($S||YS)&&!nb})),rb={CONSTRUCTOR:ib,REJECTION_EVENT:nb,SUBCLASSING:tb},ab={},ob=Xe,sb=TypeError,cb=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw sb("Bad Promise constructor");t=e,n=i})),this.resolve=ob(t),this.reject=ob(n)};ab.f=function(e){return new cb(e)};var ub,db,lb,hb=Rr,pb=Cy,fb=P,mb=V,vb=Ei,_b=cs,gb=Ko,yb=ad,Sb=Xe,bb=ye,kb=ke,Tb=Ru,Ib=Uy,Eb=yS.set,wb=US,Rb=function(e,t){var n=VS.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},Cb=FS,Ab=BS,xb=ci,Pb=HS,Db=ab,Mb="Promise",Ob=rb.CONSTRUCTOR,Nb=rb.REJECTION_EVENT,Lb=rb.SUBCLASSING,Ub=xb.getterFor(Mb),Vb=xb.set,Fb=Pb&&Pb.prototype,jb=Pb,Bb=Fb,Hb=fb.TypeError,Gb=fb.document,zb=fb.process,Wb=Db.f,Jb=Wb,qb=!!(Gb&&Gb.createEvent&&fb.dispatchEvent),Kb="unhandledrejection",Qb=function(e){var t;return!(!kb(e)||!bb(t=e.then))&&t},Xb=function(e,t){var n,i,r,a=t.value,o=1==t.state,s=o?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(o||(2===t.rejection&&tk(t),t.rejection=1),!0===s?n=a:(d&&d.enter(),n=s(a),d&&(d.exit(),r=!0)),n===e.promise?u(Hb("Promise-chain cycle")):(i=Qb(n))?mb(i,n,c,u):c(n)):u(a)}catch(IQ){d&&!r&&d.exit(),u(IQ)}},$b=function(e,t){e.notified||(e.notified=!0,wb((function(){for(var n,i=e.reactions;n=i.get();)Xb(n,e);e.notified=!1,t&&!e.rejection&&Zb(e)})))},Yb=function(e,t,n){var i,r;qb?((i=Gb.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),fb.dispatchEvent(i)):i={promise:t,reason:n},!Nb&&(r=fb["on"+e])?r(i):e===Kb&&Rb("Unhandled promise rejection",n)},Zb=function(e){mb(Eb,fb,(function(){var t,n=e.facade,i=e.value;if(ek(e)&&(t=Cb((function(){pb?zb.emit("unhandledRejection",i,n):Yb(Kb,n,i)})),e.rejection=pb||ek(e)?2:1,t.error))throw t.value}))},ek=function(e){return 1!==e.rejection&&!e.parent},tk=function(e){mb(Eb,fb,(function(){var t=e.facade;pb?zb.emit("rejectionHandled",t):Yb("rejectionhandled",t,e.value)}))},nk=function(e,t,n){return function(i){e(t,i,n)}},ik=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,$b(e,!0))},rk=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Hb("Promise can't be resolved itself");var i=Qb(t);i?wb((function(){var n={done:!1};try{mb(i,t,nk(rk,n,e),nk(ik,n,e))}catch(IQ){ik(n,IQ,e)}})):(e.value=t,e.state=1,$b(e,!1))}catch(IQ){ik({done:!1},IQ,e)}}};if(Ob&&(Bb=(jb=function(e){Tb(this,Bb),Sb(e),mb(ub,this);var t=Ub(this);try{e(nk(rk,t),nk(ik,t))}catch(IQ){ik(t,IQ)}}).prototype,(ub=function(e){Vb(this,{type:Mb,done:!1,notified:!1,parent:!1,reactions:new Ab,rejection:!1,state:0,value:void 0})}).prototype=vb(Bb,"then",(function(e,t){var n=Ub(this),i=Wb(Ib(this,jb));return n.parent=!0,i.ok=!bb(e)||e,i.fail=bb(t)&&t,i.domain=pb?zb.domain:void 0,0==n.state?n.reactions.add(i):wb((function(){Xb(i,n)})),i.promise})),db=function(){var e=new ub,t=Ub(e);this.promise=e,this.resolve=nk(rk,t),this.reject=nk(ik,t)},Db.f=Wb=function(e){return e===jb||undefined===e?new db(e):Jb(e)},bb(Pb)&&Fb!==Object.prototype)){lb=Fb.then,Lb||vb(Fb,"then",(function(e,t){var n=this;return new jb((function(e,t){mb(lb,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete Fb.constructor}catch(IQ){}_b&&_b(Fb,Bb)}hb({global:!0,constructor:!0,wrap:!0,forced:Ob},{Promise:jb}),gb(jb,Mb,!1),yb(Mb);var ak=HS,ok=rb.CONSTRUCTOR||!Du((function(e){ak.all(e).then(void 0,(function(){}))})),sk=V,ck=Xe,uk=ab,dk=FS,lk=Iu;Rr({target:"Promise",stat:!0,forced:ok},{all:function(e){var t=this,n=uk.f(t),i=n.resolve,r=n.reject,a=dk((function(){var n=ck(t.resolve),a=[],o=0,s=1;lk(e,(function(e){var c=o++,u=!1;s++,sk(n,t,e).then((function(e){u||(u=!0,a[c]=e,--s||i(a))}),r)})),--s||i(a)}));return a.error&&r(a.value),n.promise}});var hk=Rr,pk=rb.CONSTRUCTOR,fk=HS,mk=we,vk=ye,_k=Ei,gk=fk&&fk.prototype;if(hk({target:"Promise",proto:!0,forced:pk,real:!0},{catch:function(e){return this.then(void 0,e)}}),vk(fk)){var yk=mk("Promise").prototype.catch;gk.catch!==yk&&_k(gk,"catch",yk,{unsafe:!0})}var Sk=V,bk=Xe,kk=ab,Tk=FS,Ik=Iu;Rr({target:"Promise",stat:!0,forced:ok},{race:function(e){var t=this,n=kk.f(t),i=n.reject,r=Tk((function(){var r=bk(t.resolve);Ik(e,(function(e){Sk(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Ek=V,wk=ab;Rr({target:"Promise",stat:!0,forced:rb.CONSTRUCTOR},{reject:function(e){var t=wk.f(this);return Ek(t.reject,void 0,e),t.promise}});var Rk=hn,Ck=ke,Ak=ab,xk=function(e,t){if(Rk(e),Ck(t)&&t.constructor===e)return t;var n=Ak.f(e);return(0,n.resolve)(t),n.promise},Pk=Rr,Dk=rb.CONSTRUCTOR,Mk=xk;we("Promise"),Pk({target:"Promise",stat:!0,forced:Dk},{resolve:function(e){return Mk(this,e)}});var Ok=ft,Nk=Qa;Rr({target:"Object",stat:!0,forced:M((function(){Nk(1)}))},{keys:function(e){return Nk(Ok(e))}});var Lk="canvas",Uk="audio",Vk="video",Fk="screen",jk="small",Bk="big",Hk="auxiliary",Gk="aux",zk="smallVideo",Wk="user",Jk="environment",qk="mute",Kk="unmute",Qk="ended",Xk="playing",$k="pause",Yk="error",Zk="loadeddata",eT="audioinput",tT="videoinput",nT="detail",iT="text",rT="main",aT="backup",oT="banned",sT="kick",cT="user_time_out",uT="room_disband",dT="sei-message",lT="PLAYING",hT="PAUSED",pT="STOPPED",fT="inactive",mT="sendonly",vT="recvonly",_T="add",gT="remove",yT="replace",ST="track",bT="wss://trtc.rtc.qq.com",kT="wss://webrtc.qq.com",TT="qcloud",IT="trtc",ET="webrtc",wT="",RT="jssdk_log",CT="jssdk_event",AT="jssdk_new_endreport",xT=function(e){return wT=e},PT=1,DT=2,MT="live",OT=20,NT=21,LT="anchor",UT="audience",VT="5Y2wZK8nANNAoVw6dSAHVjNxrD1ObBM2kBPV",FT="224d130c-7b5c-415b-aaa2-79c2eb5a6df2",jT=2,BT=rT,HT=Hk,GT="unknown",zT="DISCONNECTED",WT="CONNECTING",JT="RECONNECTING",qT="CONNECTED",KT="new",QT="connecting",XT="failed",$T="closed",YT="disconnected",ZT="connected",eI="completed",tI=30,nI="join",iI="delta-join",rI="rejoin",aI="leave",oI="delta-leave",sI="publish",cI="delta-publish",uI="unpublish",dI="subscribe",lI="unsubscribe",hI="uplink-connection",pI="uplink-reconnection",fI="downlink-connection",mI="downlink-reconnection",vI="setLocalDescription",_I="setRemoteDescription",gI="iceConnectionState",yI="stream-initialize",SI="websocketConnectionState",bI="websocketReconnectionState",kI="update-stream",TI="recover-subscription",II="start-mix-transcode",EI="stop-mix-transcode",wI="player-error",RI="schedule",CI="unsubscribe",AI="subscribe_change",xI="unified-plan",PI="plan-b",DI={MANUAL:"manual",PRESET_LAYOUT:"preset-layout"},MI={REMOTE:"$PLACE_HOLDER_REMOTE$"},OI={IT_AUDIO_VIDEO:0,IT_PICTURE:2,IT_CANVAS:3,IT_PURE_AUDIO:4,IT_PURE_VIDEO:5},NI="string",LI="number",UI="boolean",VI="array",FI="object",jI={ADD:_T,REMOVE:gT},BI={unknown:0,wifi:1,"4g":2,"3g":3,"2g":4,wired:5},HI=-1,GI=0,zI=1,WI=Bk,JI=jk,qI=6048e5,KI="schedule.rtc.qq.com",QI="schedule.rtc.qcloud.com",XI="schedule.rtc.tencentcloud.com",$I="schedule-ecdn.rtc.tencentcloud.com",YI="",ZI=function(e){return YI=e},eE="TRTC",tE="Client",nE="LocalStream",iE="RemoteStream",rE="Stream",aE="web.sdk.qcloud.com",oE="web.sdk.tencent.cn",sE="web.sdk.cloud.tencent.cn",cE="https://console.cloud.tencent.com/trtc",uE="https://".concat(aE,"/trtc/webrtc/doc"),dE="".concat(uE,"/zh-cn/"),lE="trtc_error_assistance",hE="default",pE="communications",fE={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,NONE:5},mE=Object.keys(fE),vE=["normal leave","timeout leave","kick","role change"],_E=2e3,gE="ric",yE="raf",SE="interval",bE="timeout",kE="Resolution reset to 1080p, need to upgrade ability here https://cloud.tencent.com/document/product/647/85386",TE={"TRTC.checkSystemRequirements":40001,"TRTC.isScreenShareSupported":40002,"TRTC.isSmallStreamSupported":40003,"TRTC.createClient.rtc":40004,"TRTC.createClient.live":40005,"TRTC.createClient.intRoomId":40006,"TRTC.createClient.stringRoomId":40007,"TRTC.createClient.autoSubscribe":40008,"TRTC.createClient.manualSubscribe":40009,"TRTC.enableUploadLog":40010,"TRTC.disableUploadLog":40011,"Client.publish":40012,"Client.publish.isAuxiliary":40013,"Client.switchRole":40014,"Client.startPublishCDNStream":40015,"Client.stopPublishCDNStream":40016,"Client.startMixTranscode":40017,"Client.stopMixTranscode":40018,"Client.enableAudioVolumeEvaluation":40019,"Client.enableSmallStream":40020,"Client.disableSmallStream":40021,"Client.setSmallStreamProfile":40022,"Client.setRemoteVideoStreamType":40023,"Client.sendSEIMessage":40024,"Client.setProxyServer":40025,"Client.setTurnServer":40026,"LocalStream.setAudioProfile.standard":40027,"LocalStream.setAudioProfile.high":40028,"LocalStream.setAudioProfile.standard-stereo":40029,"LocalStream.setAudioProfile.high-stereo":40030,"LocalStream.setVideoProfile.120p":40031,"LocalStream.setVideoProfile.120p_2":40032,"LocalStream.setVideoProfile.180p":40033,"LocalStream.setVideoProfile.180p_2":40034,"LocalStream.setVideoProfile.240p":40035,"LocalStream.setVideoProfile.240p_2":40036,"LocalStream.setVideoProfile.360p":40037,"LocalStream.setVideoProfile.360p_2":40038,"LocalStream.setVideoProfile.480p":40039,"LocalStream.setVideoProfile.480p_2":40040,"LocalStream.setVideoProfile.720p":40041,"LocalStream.setVideoProfile.1080p":40042,"LocalStream.setVideoProfile.1440p":40043,"LocalStream.setVideoProfile.4K":40044,"LocalStream.setScreenProfile.480p":40045,"LocalStream.setScreenProfile.480p_2":40046,"LocalStream.setScreenProfile.720p":40047,"LocalStream.setScreenProfile.720p_2":40048,"LocalStream.setScreenProfile.1080p":40049,"LocalStream.setScreenProfile.1080p_2":40050,"LocalStream.setVideoContentHint.motion":40051,"LocalStream.setVideoContentHint.detail":40052,"LocalStream.setVideoContentHint.text":40053,"LocalStream.setAudioCaptureVolume":40054,"LocalStream.getVideoFrame":40055,"RemoteStream.setAudioOutput":40056,"RemoteStream.getVideoFrame":40057,AI_DENOISER:1700,SPATIAL_AUDIO:1701,"2K_4K":1704},IE=he,EE=Td,wE=/"/g,RE=ie("".replace),CE=function(e,t,n,i){var r=EE(IE(e)),a="<"+t;return""!==n&&(a+=" "+n+'="'+RE(EE(i),wE,"&quot;")+'"'),a+">"+r+"</"+t+">"},AE=M,xE=function(e){return AE((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))},PE=CE;Rr({target:"String",proto:!0,forced:xE("link")},{link:function(e){return PE(this,"a","href",e)}}),Rr({target:"Array",stat:!0},{isArray:kl});var DE="AVOID_REPEATED_CALL",ME="INVALID_PARAMETER_REQUIRED",OE="INVALID_PARAMETER_TYPE",NE="INVALID_PARAMETER_EMPTY",LE="INVALID_PARAMETER_INSTANCE",UE="INVALID_PARAMETER_RANGE",VE="API_CALL_TIMEOUT",FE="SIGNAL_CHANNEL_RECONNECTION_FAILED",jE="SIGNAL_CHANNEL_SETUP_FAILED",BE="ERROR_MESSAGE",HE="EXCHANGE_SDP_TIMEOUT",GE="DOWNLINK_RECONNECTION_FAILED",zE="EXCHANGE_SDP_FAILED",WE="UPLINK_RECONNECTION_FAILED",JE="INVALID_PURE_AUDIO",qE="INVALID_STREAMID",KE="INVALID_USER_DEFINE_RECORDID",QE="INVALID_USER_DEFINE_PUSH_ARGS",XE="INVALID_PROXY",$E="INVALID_JOIN",YE="INVALID_ROOMID_STRING",ZE="INVALID_ROOMID_INTEGER",ew="JOIN_ROOM_TIMEOUT",tw="JOIN_ROOM_FAILED",nw="REJOIN_ROOM_FAILED",iw="INVALID_DESTROY",rw="INVALID_PUBLISH",aw="INVALID_UNPUBLISH",ow="INVALID_AUDIENCE",sw="INVALID_INITIALIZE",cw="INVALID_DUPLICATE_PUBLISHING",uw="INVALID_REMOTE_STREAM",dw="SUBSCRIBE_FAILED",lw="INVALID_ROLE",hw="INVALID_OPERATION_SWITCH_ROLE",pw="SWITCH_ROLE_TIMEOUT",fw="SWITCH_ROLE_FAILED",mw="CLIENT_BANNED",vw="INVALID_OPERATION_START_PUBLISH_CDN",_w="INVALID_OPERATION_STOP_PUBLISH_CDN",gw="INVALID_STREAM_ID",yw="START_PUBLISH_CDN_FAILED",Sw="STOP_PUBLISH_CDN_FAILED",bw="START_MIX_TRANSCODE",kw="STOP_MIX_TRANSCODE",Tw="INVALID_AUDIO_VOLUME",Iw="ENABLE_SMALL_STREAM_PUBLISHED",Ew="DISABLE_SMALL_STREAM_PUBLISHED",ww="NOT_SUPPORTED_SMALL_STREAM",Rw="INVALID_SMALL_STREAM_PROFILE",Cw="INVALID_PARAMETER_REMOTE_STREAM",Aw="INVALID_SWITCH_DEVICE",xw="INVALID_SWITCH_DEVICE_PUBLISHING",Pw="INVALID_REPLACE_TRACK",Dw="INVALID_INITIALIZE_LOCAL_STREAM",Mw="INVALID_ADD_TRACK_REPETITIVE",Ow="INVALID_ADD_TRACK_REMOVING",Nw="INVALID_ADD_TRACK_PUBLISHING",Lw="INVALID_STREAM_INITIALIZED",Uw="INVALID_ADD_TRACK_NUMBER",Vw="INVALID_REMOVE_AUDIO_TRACK",Fw="INVALID_REMOVE_AUDIO_ADDING",jw="INVALID_REMOVE_AUDIO_ON",Bw="INVALID_REMOVE_TRACK_PUBLISHING",Hw="INVALID_REMOVE_TRACK_NOT_PUBLISHING",Gw="INVALID_REMOVE_TRACK_NUMBER",zw="INVALID_REPLACE_TRACK_NO_TRACK",Ww="REPEAT_JOIN",Jw="CLIENT_DESTROYED",qw="START_MIX_TRANSCODE_FAILED",Kw="STOP_MIX_TRANSCODE_FAILED",Qw="MIX_TRANSCODE_NOT_STARTED",Xw="CANNOT_LESS_THAN_ZERO",$w="MIX_PARAMS_VIDEO_FRAMERATE",Yw="MIX_PARAMS_VIDEO_GOP",Zw="MIX_PARAMS_AUDIO_BITRATE",eR="MIX_PARAMS_USER_Z_ORDER",tR="MIX_PARAMS_NOT_SELF",nR="MIX_PARAMS_USER_STREAM",iR="INVALID_ELEMENT_ID",rR="INVALID_ELEMENT_ID_TYPE",aR="PLAY_FAILED",oR="INVALID_CREATE_STREAM_SOURCE",sR="INVALID_CREATE_STREAM_SCREEN",cR="INVALID_CREATE_STREAM_AUDIO",uR="INVALID_CREATE_STREAM_SCREEN_AUDIO",dR="NOT_SUPPORTED_HTTP",lR="NOT_SUPPORTED_WEBRTC",hR="NOT_SUPPORTED_PROFILE",pR="NOT_SUPPORTED_H264ENCODE",fR="NOT_SUPPORTED_H264DECODE",mR="NOT_SUPPORTED_TRACK",vR="NOT_SUPPORTED_SWITCH_DEVICE",_R="NOT_SUPPORTED_CAPTURE",gR="NOT_SUPPORTED_AUX",yR="MICROPHONE_NOT_FOUND",SR="CAMERA_NOT_FOUND",bR="SIGNAL_RESPONSE_FAILED",kR="CATCH_HANDLER_ERROR",TR="API_NOT_EXIST",IR="CONNECTION_CLOSED",ER="SUBSCRIBE_ALL_FALSE",wR="SEI_NOT_SUPPORT",RR="SEI_DISABLED",CR="SEI_EMPTY",AR="SEI_OVERSIZE",xR="SEI_BEFORE_PUBLISH",PR="SEI_NOT_VIDEO",DR="CALL_FREQUENCY_LIMIT",MR="CONNECTION_ABORTED",OR="API_CALL_ABORTED",NR="DUPLICATE_AUX",LR="NOT_SUPPORTED_SPATIAL",UR={AVOID_REPEATED_CALL:function(e){return"previous ".concat(e.name,"() is ongoing, please avoid repeated calls.")},INVALID_PARAMETER_REQUIRED:function(e){var t=e.key,n=e.rule,i=e.fnName,r=e.value;return"'".concat(t||n.name,"' is a required param when calling ").concat(i,"(), received: ").concat(r,".")},INVALID_PARAMETER_TYPE:function(e){var t=e.key,n=e.rule,i=e.fnName,r=e.value,a="".concat(t||n.name),o="";return o=Array.isArray(n.type)?n.type.join("|"):n.type,"'".concat(a,"' must be type of ").concat(o," when calling ").concat(i,"(), received type: ").concat(TA(r),".")},INVALID_PARAMETER_EMPTY:function(e){var t=e.key,n=e.rule,i=e.fnName,r=e.value;return"'".concat(t||n.name,"' cannot be '").concat(r,"' when calling ").concat(i,"().")},INVALID_PARAMETER_INSTANCE:function(e){var t=e.key,n=e.rule,i=e.fnName,r=e.value,a="".concat(t||n.name),o="".concat(n.instanceOf.name||n.instanceOf);return"'".concat(a,"' must be instanceof ").concat(o," when calling ").concat(i,"(), received type: ").concat(TA(r),".")},INVALID_PARAMETER_RANGE:function(e){var t=e.key,n=e.rule,i=e.fnName,r=e.value;return"'".concat(t||n.name,"' must be one of ").concat(n.values.join("|")," when calling ").concat(i,"(), received: ").concat(r,".")},API_CALL_TIMEOUT:function(e){return"".concat(e.commandDesc||e.command," timeout observed.")},SIGNAL_CHANNEL_RECONNECTION_FAILED:"signal channel reconnection failed, please check your network.",SIGNAL_CHANNEL_SETUP_FAILED:function(e){return"SignalChannel setup failure: (errorCode: ".concat(e.errorCode,", errorMsg: ").concat(e.errorMsg," }).")},ERROR_MESSAGE:function(e){var t="".concat(e.type," failed");return e.message&&(t="".concat(t,": ").concat(e.message,".")),t},EXCHANGE_SDP_TIMEOUT:"exchange sdp timeout.",DOWNLINK_RECONNECTION_FAILED:"downlink reconnection failed, please check your network and re-join room.",EXCHANGE_SDP_FAILED:function(e){return"exchange sdp failed ".concat(e.errMsg,".")},UPDATE_OFFER_TIMEOUT:"update offer timeout observed.",UPLINK_RECONNECTION_FAILED:"uplink reconnection failed, please check your network and publish again.",INVALID_RECORDID:"recordId must be an integer number.",INVALID_PURE_AUDIO:"pureAudioPushMode must be 1 or 2.",INVALID_STREAMID:"streamId must be a sting literal within 64 bytes, and not be empty.",INVALID_USER_DEFINE_RECORDID:"userDefineRecordId must be a sting literal contains (a-zA-Z),(0-9), underline and hyphen, within 64 bytes, and not be empty.",INVALID_USER_DEFINE_PUSH_ARGS:"userDefinePushArgs must be a sting literal within 256 bytes, and not be empty.",INVALID_PROXY:'proxy server url must start with "wss://".',INVALID_JOIN:"duplicate join() called.",INVALID_ROOMID_STRING:function(e){return"'".concat(e,"' must be validate string when useStringRoomId is true.")},INVALID_ROOMID_INTEGER:function(e){return"'".concat(e,"' must be an integer between [1, 4294967294] when useStringRoomId is false.")},INVALID_SIGNAL_CHANNEL:"SignalChannel is not ready yet.",JOIN_ROOM_TIMEOUT:"join room timeout.",JOIN_ROOM_FAILED:function(e){var t=e.error,n=e.code;return"Failed to join room - ".concat(t," code: ").concat(n)},REJOIN_ROOM_FAILED:function(e){return"reJoin room: ".concat(e.roomId," failed, please check your network.")},INVALID_DESTROY:"please call leave() before destroy().",INVALID_PUBLISH:"please call join() before publish().",INVALID_UNPUBLISH:"stream has not been published yet.",INVALID_AUDIENCE:"no permission to publish() under live/".concat(UT,', please call switchRole("').concat(LT,'") firstly before publish().'),INVALID_INITIALIZE:"cannot publish stream because stream is not initialized, is switching device, or has been closed.",INVALID_DUPLICATE_PUBLISHING:function(e){return"duplicate ".concat(e," stream publishing, please unpublish your prev ").concat(e," stream and then re-publish.")},INVALID_SUBSCRIBE_UNDEFINED:"stream is undefined or null.",INVALID_SUBSCRIBE_LOCAL:"stream cannot be LocalStream.",INVALID_REMOTE_STREAM:"remoteStream does not exist because it has been unpublished by remote peer.",SUBSCRIBE_FAILED:function(e){var t=e.message,n=e.stream;return"failed to subscribe ".concat(n.getUserId()," ").concat(n.getType()," stream, reason: ").concat(t,".")},INVALID_ROLE:"switchRole can only be called in live mode.",INVALID_PARAMETER_SWITCH_ROLE:"role could only be set to a value as ".concat(LT," or ").concat(UT,"."),INVALID_OPERATION_SWITCH_ROLE:"please call join() before switchRole().",SWITCH_ROLE_TIMEOUT:"switchRole timeout.",SWITCH_ROLE_FAILED:function(e){return"switchRole failed, errCode: ".concat(e.code," errMsg: ").concat(e.message,".")},CLIENT_BANNED:function(e){return"client was banned because of "+e.message+"."},INVALID_OPERATION_START_PUBLISH_CDN:"please call startPublishCDNStream() before client join the room or after client join the room and successfully publish the local stream.",INVALID_OPERATION_STOP_PUBLISH_CDN:"please call startPublishCDNStream() before stopPublishCDNStream().",START_PUBLISH_CDN_FAILED:function(e){return"startPublishCDNStream failed, errMsg: ".concat(e.message,".")},STOP_PUBLISH_CDN_FAILED:function(e){return"stopPublishCDNStream failed, errMsg: ".concat(e.message,".")},INVALID_STREAM_ID:function(e){return"'".concat(e,"' can only consist of uppercase and lowercase english letters (a-zA-Z), numbers (0-9), hyphens and underscores.")},START_MIX_TRANSCODE:"please call startMixTranscode() after join().",STOP_MIX_TRANSCODE:"please call stopMixTranscode() after startMixTranscode().",INVALID_AUDIO_VOLUME:"interval must be a number.",ENABLE_SMALL_STREAM_PUBLISHED:"Cannot enable small stream after localStream published.",DISABLE_SMALL_STREAM_PUBLISHED:"Cannot disable small stream after localStream published.",NOT_SUPPORTED_SMALL_STREAM:"your browser does not support opening small stream.",INVALID_SMALL_STREAM_PROFILE:"small stream profile is invalid.",INVALID_PARAMETER_REMOTE_STREAM:"remoteStream is invalid.",INVALID_OPERATION_CHANGE_SMALL:"cannot switch to the small stream without subscribing to the video of remoteStream.",REMOTE_NOT_PUBLISH_SMALL_STREAM:"remote peer does not publish small stream.",INVALID_SWITCH_DEVICE:"cannot switch device on current stream.",INVALID_SWITCH_DEVICE_PUBLISHING:"cannot switch device when publishing localStream.",INVALID_REPLACE_TRACK:"cannot replace track when publishing localStream.",INVALID_INITIALIZE_LOCAL_STREAM:"local stream has not initialized yet.",INVALID_ADD_TRACK_REPETITIVE:"previous addTrack is ongoing, please avoid repetitive execution.",INVALID_ADD_TRACK_REMOVING:"cannot add track when a track is removing.",INVALID_ADD_TRACK_PUBLISHING:"cannot add track when publishing localStream.",INVALID_STREAM_INITIALIZED:"your local stream haven't been initialized yet.",INVALID_ADD_TRACK_NUMBER:"a Stream has at most one audio track and one video track.",INVALID_REMOVE_AUDIO_TRACK:"remove audio track is not supported on your browser.",INVALID_REMOVE_AUDIO_ADDING:"cannot remove track when a track is adding.",INVALID_REMOVE_AUDIO_ON:"previous removeTrack is ongoing, please avoid repetitive execution.",INVALID_REMOVE_TRACK_PUBLISHING:"cannot remove track when publishing localStream.",INVALID_REMOVE_TRACK_NOT_PUBLISHING:"the track to be removed is not being publishing.",INVALID_REMOVE_TRACK_NUMBER:"remove the only video track is not supported, please use replaceTrack or muteVideo.",INVALID_REPLACE_TRACK_NO_TRACK:function(e){return"cannot replace ".concat(e.kind," track because stream has not ").concat(e.kind," track")},START_MIX_TRANSCODE_FAILED:function(e){return"startMixTranscode failed, errMsg: ".concat(e.message,".")},STOP_MIX_TRANSCODE_FAILED:function(e){return"stopMixTranscode failed, errMsg: ".concat(e.message,".")},MIX_TRANSCODE_NOT_STARTED:"mixTranscode has not been started.",CANNOT_LESS_THAN_ZERO:function(e){var t=e.key,n=e.rule,i=e.fnName;return e.value,"'".concat(t||n.name,"' cannot be less than 0 when calling ").concat(i,"().")},MIX_PARAMS_VIDEO_FRAMERATE:"'config.videoFramerate' should be an integer between 0 and 30, excluding 0.",MIX_PARAMS_VIDEO_GOP:"'config.videoGOP' should be an integer between 1 and 8.",MIX_PARAMS_AUDIO_BITRATE:"'config.audioBitrate' should be an integer between 32 and 192.",MIX_PARAMS_USER_Z_ORDER:function(e){return"'".concat(e,"' is required and must be between 1 and 15.")},MIX_PARAMS_NOT_SELF:"'config.mixUsers' must contain self.",MIX_PARAMS_USER_STREAM:"'config.videoWidth' and 'config.videoHeight' of output stream should be contain all mix stream.",INVALID_PLAY:"duplicate play() call observed, please stop() firstly.",INVALID_ELEMENT_ID:function(e){var t=e.key,n=e.fnName;return"'".concat(t,"' is not found in the document object when calling ").concat(n,"().")},INVALID_ELEMENT_ID_TYPE:function(e){var t=e.key,n=e.fnName,i=e.type;return"the element corresponding to '".concat(t,"' must be instanceof HTMLDivElement when calling ").concat(n,"(), received: ").concat(i,".")},PLAY_FAILED:function(e){return"".concat(e.media," play failed,browser exception: ").concat(e.error.toString())},INVALID_USERID:"userId cannot be all spaces.",INVALID_CREATE_STREAM_SOURCE:"LocalStream must be created by createStream() with either audio/video or audioSource/videoSource, but can not be mixed with audio/video and audioSource/videoSource.",INVALID_CREATE_STREAM_SCREEN:"screen/video cannot be both true.",INVALID_CREATE_STREAM_AUDIO:"audio/screenAudio cannot be both true.",INVALID_CREATE_STREAM_SCREEN_AUDIO:"when screen is true, screenAudio can be configured.",NOT_SUPPORTED_HTTP:"http protocol does not support the ability to capture and publish streams, please use the https protocol.",NOT_SUPPORTED_WEBRTC:"your browser or environment does not support full WebRTC capabilities.",NOT_SUPPORTED_PROFILE:"your browser does not support setVideoProfile.",NOT_SUPPORTED_MEDIA:"your browser or environment does not support navigator.mediaDevices.",NOT_SUPPORTED_H264ENCODE:"your device does not support H.264 encoding.",NOT_SUPPORTED_H264DECODE:"your device does not support H.264 decoding.",NOT_SUPPORTED_TRACK:function(e){return"".concat(e,"Track is not supported on your browser.")},NOT_SUPPORTED_SWITCH_DEVICE:"switchDevice is not supported on your browser.",NOT_SUPPORTED_CAPTURE:"Your browser or environment does not support screen sharing, please check whether the browser version.",MICROPHONE_NOT_FOUND:"no microphone detected, please check your microphone and the configuration on TRTC.createStream.",CAMERA_NOT_FOUND:"no camera detected, please check your camera and the configuration on TRTC.createStream.",SIGNAL_RESPONSE_FAILED:function(e){return"".concat(e.signalResponse," failed, response code is ").concat(e.code," , errMsg: ").concat(e.message,".")},CATCH_HANDLER_ERROR:function(e){var t=e.name,n=e.event;return"an error was caught on ".concat(t,".on('").concat(n,"', handler), please check your code on 'handler'.")},API_NOT_EXIST:function(e){var t=e.name;return"experimental api ".concat(t," does not exist.")},REPEAT_JOIN:function(e){return"[".concat(e,"] is calling client.join api or has already joined room, please avoid repeated join.")},CONNECTION_CLOSED:"remoteStream has been unsubscribed or unpublished by remote user.",SUBSCRIBE_ALL_FALSE:"cannot subscribe when both audio & video are false, use client.unsubscribe() instead",CLIENT_DESTROYED:function(e){var t=e.funName;return"failed to call ".concat(t,"() because client was destroyed.")},SEI_NOT_SUPPORT:function(e){return"not support to sendSEIMessage".concat(!1===e?" without using h264 codec":"")},SEI_DISABLED:"SEI is disabled, to enable SEI: TRTC.createClient({ enableSEI: true })",SEI_EMPTY:"buffer cannot be empty",SEI_OVERSIZE:function(e){return"buffer size(".concat(e,") is over 1000 Bytes")},SEI_BEFORE_PUBLISH:"please call sendSEIMessage() after publish() success",SEI_NOT_VIDEO:"cannot send sei when localStream has not video.",CALL_FREQUENCY_LIMIT:function(e){var t=e.isSize,n=e.name,i=e.timesInSecond,r=e.maxSizeInSecond;return"api ".concat(n," call ").concat(t?"size":"times"," is over ").concat(t?r+" bytes":i," in a second.")},CONNECTION_ABORTED:function(e){return"connection aborted due to: "+e},API_CALL_ABORTED:function(e){return e.message.includes("REMOTE_STREAM_NOT_EXIST")?"Subscribe ".concat(e.stream.getUserId()," ").concat(e.stream.getType()," stream aborted, reason: remote user ").concat(e.stream.getUserId()," unpublished stream."):"API aborted, reason: ".concat(e.message)},DUPLICATE_AUX:"only one auxiliary stream can be published in a room.",NOT_SUPPORTED_AUX:"publish auxiliary stream is not supported on your browser.",NOT_SUPPORTED_SPATIAL:"Your browser does not support 3D spatial audio."},VR=P,FR=M,jR=Td,BR=pg.trim,HR=ie("".charAt),GR=VR.parseFloat,zR=VR.Symbol,WR=zR&&zR.iterator,JR=1/GR("\t\n\v\f\r                 \u2028\u2029\ufeff-0")!=-Infinity||WR&&!FR((function(){GR(Object(WR))}))?function(e){var t=BR(jR(e)),n=GR(t);return 0===n&&"-"==HR(t,0)?-0:n}:GR;Rr({global:!0,forced:parseFloat!=JR},{parseFloat:JR});var qR=window.navigator&&window.navigator.userAgent||"",KR=/AppleWebKit\/([\d.]+)/i.exec(qR);KR&&parseFloat(KR.pop());var QR=/iPad/i.test(qR),XR=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Macintosh/.test(qR),$R=/iPhone/i.test(qR)&&!QR,YR=/iPod/i.test(qR),ZR=$R||QR||YR||XR,eC=/Android/i.test(qR);eC&&function(){var e=qR.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);t&&n&&parseFloat(e[1]+"."+e[2])}();eC&&/webkit/i.test(qR);var tC=/Firefox/i.test(qR),nC=tC&&function(){var e=qR.match(/Firefox\/(\d+)/);return e&&e[1]?parseFloat(e[1]):null}(),iC=/Edge\//i.test(qR),rC=iC&&function(){var e=qR.match(/Edge\/(\d+)/i);if(e&&e[1])return e[1]}(),aC=/Edg\//i.test(qR),oC=aC&&function(){var e=qR.match(/Edg\/(\d+)/);return e&&e[1]?parseFloat(e[1]):null}(),sC=/SogouMobileBrowser\//i.test(qR),cC=sC&&function(){var e=qR.match(/SogouMobileBrowser\/(\d+)/);return e&&e[1]?parseFloat(e[1]):null}(),uC=/MetaSr\s/i.test(qR),dC=uC&&function(){var e=qR.match(/MetaSr(\s\d+(\.\d+)+)/);return e&&e[1]?parseFloat(e[1]):null}(),lC=/TBS\/\d+/i.test(qR),hC=lC&&function(){var e=qR.match(/TBS\/(\d+)/i);if(e&&e[1])return e[1]}(),pC=/XWEB\/\d+/i.test(qR),fC=pC&&function(){var e=qR.match(/XWEB\/(\d+)/i);if(e&&e[1])return e[1]}();/MSIE\s8\.0/.test(qR),/MSIE\/\d+/i.test(qR)&&function(){var e=/MSIE\s(\d+)\.\d/.exec(qR),t=e&&parseFloat(e[1]);!t&&/Trident\/7.0/i.test(qR)&&/rv:11.0/.test(qR)&&(t=11)}();var mC=/(micromessenger|webbrowser)/i.test(qR),vC=mC&&function(){var e=qR.match(/MicroMessenger\/(\d+)/i);if(e&&e[1])return e[1]}(),_C=!lC&&/MQQBrowser\/\d+/i.test(qR)&&/COVC\/\d+/i.test(qR),gC=!lC&&/MQQBrowser\/\d+/i.test(qR)&&!/COVC\/\d+/i.test(qR),yC=(gC||_C)&&function(){var e=qR.match(/ MQQBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),SC=!lC&&/ QQBrowser\/\d+/i.test(qR),bC=SC&&function(){var e=qR.match(/ QQBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),kC=!lC&&/QQBrowserLite\/\d+/i.test(qR),TC=kC&&function(){var e=qR.match(/QQBrowserLite\/([\d.]+)/);return e&&e[1]?e[1]:null}(),IC=!lC&&/MQBHD\/\d+/i.test(qR),EC=IC&&function(){var e=qR.match(/MQBHD\/([\d.]+)/);return e&&e[1]?e[1]:null}(),wC=/Windows/i.test(qR),RC=!ZR&&/MAC OS X/i.test(qR),CC=!eC&&/Linux/i.test(qR);/MicroMessenger/i.test(qR);var AC=/UCBrowser/i.test(qR);/Electron/i.test(qR);var xC,PC,DC=/MiuiBrowser/i.test(qR),MC=DC&&function(){var e=qR.match(/MiuiBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),OC=/HuaweiBrowser/i.test(qR),NC=/Huawei/i.test(qR),LC=OC&&function(){var e=qR.match(/HuaweiBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),UC=/SamsungBrowser/i.test(qR),VC=UC&&function(){var e=qR.match(/SamsungBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),FC=/HeyTapBrowser/i.test(qR),jC=FC&&function(){var e=qR.match(/HeyTapBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),BC=/VivoBrowser/i.test(qR),HC=BC&&function(){var e=qR.match(/VivoBrowser\/([\d.]+)/);return e&&e[1]?e[1]:null}(),GC=function(){var e=qR.match(/Chrome\/(\d+)/);return e&&e[1]?Number(e[1]):null},zC=/Chrome/i.test(qR),WC=!iC&&!uC&&!sC&&!lC&&!pC&&!aC&&!SC&&!DC&&!OC&&!UC&&!FC&&!BC&&/Chrome/i.test(qR),JC=WC&&GC(),qC=WC&&function(){var e=qR.match(/Chrome\/([\d.]+)/);return e&&e[1]?e[1]:null}(),KC=!zC&&!gC&&!_C&&!kC&&!IC&&/Safari/i.test(qR),QC=function(){if(KC){var e=qR.match(/Version\/([\d.]+)/);if(e&&e[1])return e[1]}return""}(),XC=/Android.*(wv|.0.0.0)/.test(qR),$C=function(){if(XR)return QC;if(ZR){var e=qR.match(/OS (\d+)_(\d+)/i);if(e&&e[1]){var t=e[1];return e[2]&&(t+=".".concat(e[2])),t}}return""}(),YC="15.1"===QC,ZC="15.1"===$C,eA=14===(xC=Number($C.split(".")[0]))||13===xC,tA="file:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname,nA=function(){if(vA(PC))try{PC=window.localStorage}catch(IQ){Vx.warn(IQ),PC=!1}return PC},iA=new Map([[tC,["Firefox",nC]],[aC,["Edg",oC]],[WC,["Chrome",qC]],[KC,["Safari",QC]],[lC,["TBS",hC]],[pC,["XWEB",fC]],[mC&&$R,["WeChat",vC]],[SC,["QQ(Win)",bC]],[gC,["QQ(Mobile)",yC]],[_C,["QQ(Mobile X5)",yC]],[kC,["QQ(Mac)",TC]],[IC,["QQ(iPad)",EC]],[DC,["MI",MC]],[OC,["HW",LC]],[UC,["Samsung",VC]],[FC,["OPPO",jC]],[BC,["VIVO",HC]],[iC,["EDGE",rC]],[sC,["SogouMobile",cC]],[uC,["Sogou",dC]]]);function rA(){var e="unknown",t="unknown";return iA.get(!0)&&(e=iA.get(!0)[0],t=iA.get(!0)[1]),{name:e,version:t}}var aA=function(e,t){return t?uE+"/"+e+"/"+t:uE+"/"+e+"/index.html"},oA=function(){if(!nA())return!1;var e=localStorage.getItem(lE);e&&!function(e){var t=e.saveTime&&(new Date).getTime()-e.saveTime>=qI,n=!e.saveVersion||e.saveVersion!==Wa;return t||n}(JSON.parse(e))||(Vx.info("init debug info"),function(){var e=new XMLHttpRequest;if(e.open("GET","https://web.sdk.qcloud.com/trtc/webrtc/download/error-message/0.0.3/script.js",!1),e.send(null),4===e.readyState&&200===e.status){var t=document.createElement("script");t.type="text/javascript",t.text=e.responseText,document.body.appendChild(t),localStorage.setItem(lE,JSON.stringify({message:e.responseText,saveTime:(new Date).getTime(),saveVersion:Wa})),document.body.removeChild(t)}}())};function sA(e){var t=e.key,n=e.data,i=e.link,r=e.addDocLink,a=void 0===r||r,o="",s="",c="";mA(UR[t])?o=UR[t](n):_A(UR[t])&&(o=UR[t]);var u=function(){if(window.TRTC_ERROR_INFO&&window.TRTC_ERROR_LINK)return{TRTC_ERROR_INFO:window.TRTC_ERROR_INFO,TRTC_ERROR_LINK:window.TRTC_ERROR_LINK};var e=localStorage.getItem(lE);if(e){e=JSON.parse(e);var t=document.createElement("script");t.type="text/javascript",t.text=e.message,document.body.appendChild(t);var n=window.TRTC_ERROR_INFO,i=window.TRTC_ERROR_LINK;return document.body.removeChild(t),{TRTC_ERROR_INFO:n,TRTC_ERROR_LINK:i}}return{}}(),d=u.TRTC_ERROR_INFO,l=u.TRTC_ERROR_LINK;i?c="".concat(i.className,".html#").concat(i.fnName):l&&l[t]&&(mA(l[t])?c=l[t](n):_A(l[t])&&(c=l[t]));var h=o;return AA()&&(d&&d[t]&&(mA(d[t])?s=d[t](n):_A(d[t])&&(s=d[t])),s&&(h=a?s+"\n请查看文档: "+aA("zh-cn",c)+"\n\n":s+"\n\n",h+=o)),a&&(h+=" \nRefer to: "+aA("en",c)+"\n"),h}var cA=function(){return function(e){var t=window.location.search.match(new RegExp("(\\?|&)"+e+"=([^&]*)(&|$)"));return t?decodeURIComponent(t[2]):""}("trtc_env")},uA=function(e){return(e=Number(e))>0&&e<14e8},dA=function(e,t){var n;n=wT?wT.includes("http")?wT:"https://"+wT:uA(e)?"https://apisgp.my-imcloud.com":"https://yun.tim.qq.com";var i=Math.floor(Math.random()*Math.pow(2,31));return"".concat(n,"/v5/AVQualityReportSvc/C2S?random=").concat(i,"&sdkappid=").concat(e,"&cmdtype=").concat(t)};function lA(){var e=navigator.userAgent,t=navigator.connection,n=e.match(/NetType\/\w+/)?e.match(/NetType\/\w+/)[0]:"";"3gnet"===(n=n.toLowerCase().replace("nettype/",""))&&(n="3g");var i=t&&t.type&&t.type.toLowerCase(),r=t&&t.effectiveType&&t.effectiveType.toLowerCase();"slow-2"===r&&(r="2g");var a=n||"unknown";if(i)switch(i){case"cellular":case"wimax":a=r||"unknown";break;case"wifi":a="wifi";break;case"ethernet":a="wired";break;case"none":case"other":case"unknown":a="unknown"}return a}var hA=function(e){if(!e||"object"!==i(e)||"[object Object]"!=Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Function.prototype.toString.call(n)===Function.prototype.toString.call(Object)};function pA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e<=1?n:pA(e-1,n,t+n)}function fA(e){var t=Math.round(e/2)+1;return t>6?13e3:1e3*pA(t)}var mA=function(e){return"function"==typeof e},vA=function(e){return void 0===e},_A=function(e){return"string"==typeof e},gA=function(e){return"number"==typeof e},yA=function(e){return"boolean"==typeof e},SA=function(e){return"object"===TA(e)},bA=function(e){return"array"===TA(e)},kA=function(e){return TA(e)==="MediaStreamTrack".toLowerCase()};function TA(e){return Reflect.apply(Object.prototype.toString,e,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}function IA(e){var t={};return t.urls="turn:".concat(e.url),vA(e.username)||vA(e.credential)||(t.username=e.username,t.credential=e.credential,t.credentialType="password",vA(e.credentialType)||(t.credentialType=e.credentialType)),t}function EA(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function wA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"big";if(!_A(e))return 0;var n=e.split(".");return"big"===t?(Number(n[0])<<24|Number(n[1])<<16|Number(n[2])<<8|Number(n[3]))>>>0:(Number(n[3])<<24|Number(n[2])<<16|Number(n[1])<<8|Number(n[0]))>>>0}var RA,CA,AA=function(){var e=navigator.language||navigator.userLanguage;return"zh"===(e=e.substr(0,2))},xA=(RA=!1,CA=document.visibilityState,function(){document.visibilityState!==CA&&Vx.info("visibility change: ".concat(document.visibilityState)),RA||(document.addEventListener("visibilitychange",(function(){Vx.info("visibility change: "+document.visibilityState),CA=document.visibilityState})),RA=!0)});window.AudioContext=window.AudioContext||window.webkitAudioContext||window.mozAudioContext;var PA=function(){var e=new window.AudioContext,t=function t(){"suspended"===e.state||"interrupted"===e.state?e.resume():document.removeEventListener("click",t)};return"suspended"!==e.state&&"interrupted"!==e.state||document.addEventListener("click",t),e.onstatechange=function(){t()},e},DA=function(){var e;return function(){if(e)return e;e=new window.AudioContext;return e.onstatechange=function(){Vx.info("gain context state: ".concat(e.state)),"suspended"===e.state?(e.resume(),document.addEventListener("click",e.resume)):"interrupted"===e.state?e.resume():document.removeEventListener("click",e.resume)},e}}(),MA=!!window.AudioWorkletNode,OA=function(e,t){var n=e.emit;return e.emit=function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];try{n.apply(e,r)}catch(IQ){var o=sA({key:kR,data:{name:t,event:r[0]},addDocLink:!1});Vx.warn(o+"\n\n"+IQ.stack)}},e},NA=function(e){return+e<10?"0".concat(e):e},LA=function(e){var t=e.match(/^\d+\.\d+\.\d+/)[0];if(!t)return e;var n=t.split("."),i=NA(n[1])+NA(n[2]);return n[1]-15>0&&(n[1]="15"),n[2]-15>0&&(n[2]="15"),n.join(".")+"."+i};function UA(e){var t=e.url,n=e.body,i=e.method,r=e.timeout,a=new XMLHttpRequest;return new Promise((function(e,o){a.onload=function(t){if(a.status>=200&&a.status<300&&a.responseText.length>0)try{var n=JSON.parse(a.response);e({data:n})}catch(IQ){e({data:a.response})}else a.status>0&&o({code:a.status,message:"request failed, readyState:".concat(a.readyState," status:").concat(a.status," loaded size:").concat(t.loaded)})};var s=function(e){o({code:a.readyState,message:"request ".concat(e.type,", readyState:").concat(a.readyState," status:").concat(a.status," loaded size:").concat(e.loaded)})};a.onerror=s,a.onabort=s,a.ontimeout=s,a.timeout=r||5e3,a.open(i||"POST",t,!0),a.send(n)}))}var VA={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,a||e,o),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,o=new Array(a);r<a;r++)o[r]=i[r].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,d=this._events[s],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,i),!0;case 4:return d.fn.call(d.context,t,i,r),!0;case 5:return d.fn.call(d.context,t,i,r,a),!0;case 6:return d.fn.call(d.context,t,i,r,a,o),!0}for(u=1,c=new Array(l-1);u<l;u++)c[u-1]=arguments[u];d.fn.apply(d.context,c)}else{var h,p=d.length;for(u=0;u<p;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),l){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,i);break;case 4:d[u].fn.call(d[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];d[u].fn.apply(d[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||o(this,a);else{for(var c=0,u=[],d=s.length;c<d;c++)(s[c].fn!==t||r&&!s[c].once||i&&s[c].context!==i)&&u.push(s[c]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(VA);var FA=VA.exports,jA=new FA,BA=1,HA=2,GA=3,zA=4,WA=5,JA=20,qA=21,KA=22,QA=23,XA=24,$A=27,YA=28,ZA=29,ex=30,tx=33,nx=31,ix=32,rx=100,ax=101,ox=102,sx=103,cx=110,ux=111,dx=112,lx=113,hx=114,px=115,fx=116,mx=120,vx=121,_x=122,gx=123,yx=130,Sx=131,bx=132,kx=133,Tx=134,Ix=135,Ex=136,wx=137,Rx=200,Cx=201,Ax=300,xx=301,Px=302,Dx=303;function Mx(e){var t=e.retryFunction,i=e.settings,r=e.onError,o=e.onRetrying,s=e.onRetryFailed,c=e.context;return function(){for(var e=this,u=arguments.length,d=new Array(u),l=0;l<u;l++)d[l]=arguments[l];var h=i.retries||5,p=0,f=-1,m=0,v=function(){var u=a(n().mark((function a(u,l){var _,g,y,S;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return _=c||e,n.prev=1,n.next=4,t.apply(_,d);case 4:g=n.sent,p=0,u(g),n.next=14;break;case 9:n.prev=9,n.t0=n.catch(1),y=function(){clearTimeout(f),p=0,m=2,l(n.t0)},S=function(){2!==m&&p<h?(p++,m=1,mA(o)&&o.call(_,p,y),f=setTimeout((function(){f=-1,v(u,l)}),vA(i.timeout)?1e3:i.timeout)):(y(),mA(s)&&s.call(_,n.t0))},mA(r)?r.call(_,n.t0,S,l,d):S();case 14:case"end":return n.stop()}}),a,null,[[1,9]])})));return function(e,t){return u.apply(this,arguments)}}();return new Promise(v)}}var Ox=c((function e(t){o(this,e),this.log=t.log,this.level=t.level,this.userId=t.userId,this.sdkAppId=t.sdkAppId,this.forAllJoinedClients=t.forAllJoinedClients,this.uploaded=!1})),Nx=function(){function e(t){o(this,e),this.id_=t.id,this.userId_=t.userId,this.sdkAppId_=t.sdkAppId,this.type_=t.type,this.isLocal_=!yA(t.isLocal)||t.isLocal}return c(e,[{key:"setUserId",value:function(e){this.userId_=e}},{key:"setSdkAppId",value:function(e){this.sdkAppId_=e}},{key:"log",value:function(e,t){Vx.log({log:"[".concat(this.isLocal_?"↑":"↓").concat(this.id_,"] ").concat(this.type_?this.type_+" ":"").concat(t),level:e,forAllJoinedClients:vA(this.userId_),userId:this.userId_,sdkAppId:this.sdkAppId_})}},{key:"info",value:function(e){this.log(fE.INFO,e)}},{key:"debug",value:function(e){this.log(fE.DEBUG,e)}},{key:"warn",value:function(e){this.log(fE.WARN,e)}},{key:"error",value:function(e){this.log(fE.ERROR,e)}}]),e}(),Lx=!(ZR||eC),Ux=function(){function e(){var t=this;o(this,e),this.clients_=new Set,this.queue_=[],this.timeoutId_=-1,this.logLevel_=fE.DEBUG,this.logLevelToUpload_=fE.INFO,this.enableUploadLog_=!0,this.isAbleToUpload_=!1,this.checkURLParam(),jA.on(ex,(function(e){var n=e.client;-1===t.timeoutId_&&t.startUpload(),t.clients_.add(n)})),jA.on(tx,(function(e){var n=e.client;return t.clients_.delete(n)})),jA.on(nx,(function(e){e&&hA(e.config)&&mE[e.config.logLevelToUpload]&&(t.logLevelToUpload_=e.config.logLevelToUpload)})),jA.on(zA,this.setIsAbleToUpload,this),jA.on(WA,this.setIsAbleToUpload,this)}var t,i;return c(e,[{key:"getIsAbleToUpload",value:function(){return this.isAbleToUpload_}},{key:"setIsAbleToUpload",value:function(){this.isAbleToUpload_=!0,jA.off(zA,this.setIsAbleToUpload,this),jA.off(WA,this.setIsAbleToUpload,this)}},{key:"startUpload",value:(i=a(n().mark((function e(){var t=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.upload();case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:this.timeoutId_=setTimeout((function(){return t.startUpload()}),2e3);case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return i.apply(this,arguments)})},{key:"getLogsToUpload",value:function(){var e=this,t={map:new Map,splicedQueue:[]};if(this.queue_[0].forAllJoinedClients&&0===this.clients_.size)return t;for(var n=0,i=function(){if(50===n)return"break";var i=e.queue_[n];i.forAllJoinedClients?e.clients_.forEach((function(e){if(e.getIsJoined()){var n=e.getUserId(),r=e.getSDKAppId();if(t.map.has(n))t.map.get(n).logs.push(i);else t.map.set(n,{userId:n,sdkAppId:r,logs:[i]})}})):t.map.has(i.userId)?t.map.get(i.userId).logs.push(i):t.map.set(i.userId,{userId:i.userId,sdkAppId:i.sdkAppId,logs:[i]})};n<this.queue_.length;n++){if("break"===i())break}return t.map.size>0&&(t.splicedQueue=this.queue_.splice(0,n)),t}},{key:"upload",value:(t=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.queue_.length&&this.isAbleToUpload_){e.next=2;break}return e.abrupt("return");case 2:if(t=this.getLogsToUpload(),i=t.map,r=t.splicedQueue,0!==i.size){e.next=5;break}return e.abrupt("return");case 5:e.prev=5,a=T(i.values()),o=0;case 8:if(!(o<a.length)){e.next=16;break}return s=a[o],c=s.userId,u=s.sdkAppId,d=s.logs,e.next=12,this.uploadLogWithRetry(JSON.stringify({timestamp:r_(),sdkAppId:String(u),userId:c,version:Wa,log:d.map((function(e){return e.log})).join("\n")}),u);case 12:d.forEach((function(e){return e.uploaded=!0}));case 13:o++,e.next=8;break;case 16:e.next=20;break;case 18:e.prev=18,e.t0=e.catch(5);case 20:l=r.filter((function(e){return!e.uploaded})),l.length>0&&(this.queue_=l.concat(this.queue_));case 22:case"end":return e.stop()}}),e,this,[[5,18]])}))),function(){return t.apply(this,arguments)})},{key:"uploadLogWithRetry",value:function(e,t){return Mx({retryFunction:function(){return UA({url:dA(t,RT),body:e,timeout:5e3})},settings:{retries:3,timeout:1e3},onError:function(e,t){t()}})()}},{key:"getPrefix",value:function(e){var t=new Date;return t.setTime(i_()),String.prototype.padStart?"[".concat(t.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1"),":").concat(t.getMilliseconds().toString().padStart(3,"0"),"] <").concat(mE[e],">"):"[".concat(t.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1"),":").concat(t.getMilliseconds(),"] <").concat(mE[e],">")}},{key:"getLogLevel",value:function(){return this.logLevel_}},{key:"setLogLevel",value:function(e){vA(mE[e])||(this.logLevel_!==e&&this.info("setLogLevel ".concat(e)),this.logLevel_=e)}},{key:"enableUploadLog",value:function(){this.enableUploadLog_=!0}},{key:"disableUploadLog",value:function(){this.enableUploadLog_=!1}},{key:"log",value:function(e){var t=e.log,n=e.level,i=e.forAllJoinedClients,r=void 0===i||i,a=e.userId,o=e.sdkAppId;if(t="".concat(this.getPrefix(n)," ").concat(t),this.enableUploadLog_&&n>=this.logLevelToUpload_&&this.queue_.push(new Ox({log:t,level:n,userId:a,sdkAppId:o,forAllJoinedClients:r})),!(n<this.logLevel_)){var s=mE[n]?mE[n].toLowerCase():"info";Lx?console[s]("%cTRTC%c%s","padding: 1px 4px;border-radius: 3px;color: #fff;background: #1E88E5;","display: inline",t):console[s](t)}}},{key:"debug",value:function(e){this.log({log:e,level:fE.DEBUG})}},{key:"info",value:function(e){this.log({log:e,level:fE.INFO})}},{key:"warn",value:function(e){this.log({log:e,level:fE.WARN})}},{key:"error",value:function(e){this.log({log:e,level:fE.ERROR})}},{key:"createLogger",value:function(e){return new Nx(e)}},{key:"checkURLParam",value:function(){var e=new URLSearchParams(location.search).get("logLevelToUpload");mE[e]&&(this.logLevelToUpload_=e)}}]),e}(),Vx=new Ux,Fx=!0,jx=ke,Bx=Math.floor,Hx=Number.isInteger||function(e){return!jx(e)&&isFinite(e)&&Bx(e)===e};Rr({target:"Number",stat:!0},{isInteger:Hx});var Gx,zx=Rr,Wx=ie,Jx=D.f,qx=Ui,Kx=Td,Qx=Jg,Xx=he,$x=Kg,Yx=Wx("".startsWith),Zx=Wx("".slice),eP=Math.min,tP=$x("startsWith");zx({target:"String",proto:!0,forced:!!(tP||(Gx=Jx(String.prototype,"startsWith"),!Gx||Gx.writable))&&!tP},{startsWith:function(e){var t=Kx(Xx(this));Qx(e);var n=qx(eP(arguments.length>1?arguments[1]:void 0,t.length)),i=Kx(e);return Yx?Yx(t,i,n):Zx(t,n,n+i.length)===i}});var nP=O,iP=ie,rP=V,aP=M,oP=Qa,sP=er,cP=F,uP=ft,dP=ce,lP=Object.assign,hP=Object.defineProperty,pP=iP([].concat),fP=!lP||aP((function(){if(nP&&1!==lP({b:1},lP(hP({},"a",{enumerable:!0,get:function(){hP(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=lP({},e)[n]||oP(lP({},t)).join("")!=i}))?function(e,t){for(var n=uP(e),i=arguments.length,r=1,a=sP.f,o=cP.f;i>r;)for(var s,c=dP(arguments[r++]),u=a?pP(oP(c),a(c)):oP(c),d=u.length,l=0;d>l;)s=u[l++],nP&&!rP(o,c,s)||(n[s]=c[s]);return n}:lP,mP=fP;Rr({target:"Object",stat:!0,arity:2,forced:Object.assign!==mP},{assign:mP});var vP=ie,_P=Xe,gP=ke,yP=_t,SP=sl,bP=N,kP=Function,TP=vP([].concat),IP=vP([].join),EP={},wP=function(e,t,n){if(!yP(EP,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";EP[t]=kP("C,a","return new C("+IP(i,",")+")")}return EP[t](e,n)},RP=bP?kP.bind:function(e){var t=_P(this),n=t.prototype,i=SP(arguments,1),r=function(){var n=TP(i,SP(arguments));return this instanceof r?wP(t,n.length,n):t.apply(e,n)};return gP(n)&&(r.prototype=n),r},CP=RP;Rr({target:"Function",proto:!0,forced:Function.bind!==CP},{bind:CP});var AP=Rr,xP=$l.findIndex,PP=Eo,DP="findIndex",MP=!0;DP in[]&&Array(1).findIndex((function(){MP=!1})),AP({target:"Array",proto:!0,forced:MP},{findIndex:function(e){return xP(this,e,arguments.length>1?arguments[1]:void 0)}}),PP(DP);var OP=O,NP=ie,LP=Qa,UP=me,VP=NP(F.f),FP=NP([].push),jP=function(e){return function(t){for(var n,i=UP(t),r=LP(i),a=r.length,o=0,s=[];a>o;)n=r[o++],OP&&!VP(i,n)||FP(s,e?[n,i[n]]:i[n]);return s}},BP={entries:jP(!0),values:jP(!1)},HP=BP.values;Rr({target:"Object",stat:!0},{values:function(e){return HP(e)}});var GP=1,zP=5,WP=2,JP=3,qP=4,KP="DISCONNECTED",QP="CONNECTING",XP="RECONNECTING",$P="CONNECTED",YP={CLIENT_BANNED:9,CHANNEL_SETUP_RESULT:19,CHANNEL_RECONNECT_RESULT:514,JOIN_ROOM_RESULT:20,PEER_JOIN:4134,PEER_LEAVE:4135,STREAM_ADDED:16,STREAM_REMOVED:18,UPLINK_NETWORK_STATS:22,UPDATE_REMOTE_MUTE_STAT:23,PUBLISH_RESULT:4098,PUBLISH_STATE_CHANGE_RESULT:4112,UNPUBLISH_RESULT:4100,SUBSCRIBE_RESULT:4102,UNSUBSCRIBE_RESULT:4104,SUBSCRIBE_CHANGE_RESULT:4106,MUTE_RESULT:4108,UPDATE_OFFER_RESULT:4128,START_PUBLISH_TENCENT_CDN_RES:1286,STOP_PUBLISH_TENCENT_CDN_RES:1288,START_PUBLISH_GIVEN_CDN_RES:777,STOP_PUBLISH_GIVEN_CDN_RES:779,START_MIX_TRANSCODE_RES:781,STOP_MIX_TRANSCODE_RES:783,USER_LIST_RES:4137,SWITCH_ROLE_RES:4110,UPDATE_CONSTRAINT_CONFIG_RES:772},ZP=[YP.UPDATE_REMOTE_MUTE_STAT,YP.UPLINK_NETWORK_STATS,YP.USER_LIST_RES,YP.MUTE_RESULT],eD={CLIENT_BANNED:"client-banned",CHANNEL_SETUP_RESULT:"channel-setup-result",CHANNEL_RECONNECT_RESULT:"channel-reconnect-result",JOIN_ROOM_RESULT:"join-room-result",PEER_JOIN:"peer-join",PEER_LEAVE:"peer-leave",STREAM_ADDED:"stream-added",STREAM_REMOVED:"stream-removed",UPLINK_NETWORK_STATS:"uplink-network-stats",UPDATE_REMOTE_MUTE_STAT:"update-remote-mute-stat",PUBLISH_RESULT:"publish-result",PUBLISH_STATE_CHANGE_RESULT:"publish-state-change-result",UNPUBLISH_RESULT:"unpublish-result",SUBSCRIBE_RESULT:"subscribe-result",SUBSCRIBE_CHANGE_RESULT:"subscribe-change-result",UNSUBSCRIBE_RESULT:"unsubscribe-result",UPDATE_OFFER_RESULT:"update-offer-result",START_PUBLISH_TENCENT_CDN_RES:"start-publish-tencent-cdn-res",STOP_PUBLISH_TENCENT_CDN_RES:"stop-publish-tencent-cdn-res",START_PUBLISH_GIVEN_CDN_RES:"start-publish-given-cdn-res",STOP_PUBLISH_GIVEN_CDN_RES:"stop-publish-given-cdn-res",START_MIX_TRANSCODE_RES:"start-mix-transcode-res",STOP_MIX_TRANSCODE_RES:"stop-mix-transcode-res",USER_LIST_RES:"user-list-res",SWITCH_ROLE_RES:"switch_role_res",MUTE_RESULT:"mute-result",UPDATE_CONSTRAINT_CONFIG_RES:"update-contraint-config-res"},tD="publish_change",nD="publish_state_change",iD="join",rD="leave",aD="quality_report",oD="mute_uplink",sD="publish",cD="unpublish",uD="subscribe",dD="unsubscribe",lD="subscribe_change",hD="start_publishing",pD="stop_publishing",fD="start_push_user_cdn",mD="stop_push_user_cdn",vD="start_mcu_mix",_D="stop_mcu_mix",gD="get_user_list",yD="change_role",SD="update_constraint_config",bD={INVALID_PARAMETER:4096,INVALID_OPERATION:4097,NOT_SUPPORTED:4098,DEVICE_NOT_FOUND:4099,INITIALIZE_FAILED:4100,SIGNAL_CHANNEL_SETUP_FAILED:16385,SIGNAL_CHANNEL_ERROR:16386,ICE_TRANSPORT_ERROR:16387,JOIN_ROOM_FAILED:16388,CREATE_OFFER_FAILED:16389,SIGNAL_CHANNEL_RECONNECTION_FAILED:16390,UPLINK_RECONNECTION_FAILED:16391,DOWNLINK_RECONNECTION_FAILED:16392,REMOTE_STREAM_NOT_EXIST:16400,CLIENT_BANNED:16448,SERVER_TIMEOUT:16449,SUBSCRIPTION_TIMEOUT:16450,PLAY_NOT_ALLOWED:16451,DEVICE_AUTO_RECOVER_FAILED:16452,START_PUBLISH_CDN_FAILED:16453,STOP_PUBLISH_CDN_FAILED:16454,START_MIX_TRANSCODE_FAILED:16455,STOP_MIX_TRANSCODE_FAILED:16456,NOT_SUPPORTED_H264:16457,SWITCH_ROLE_FAILED:16458,API_CALL_TIMEOUT:16459,SCHEDULE_FAILED:16460,API_CALL_ABORTED:16461,UNKNOWN:65535},kD=function(e){d(n,e);var t=g(n);function n(e){var i,r=e.name,a=void 0===r?"RtcError":r,s=e.message,c=e.code,u=void 0===c?bD.UNKNOWN:c,d=e.extraCode,l=void 0===d?0:d,h=e.constraint;o(this,n);var p="<".concat(function(e){for(var t in bD)if(bD[t]===e)return t;return"UNKNOWN"}(u)," 0x").concat(u.toString(16),">");return(i=t.call(this,s+"".concat(h?" constraint: ".concat(h):"")+"".concat(null!=s&&s.includes(p)?"":" "+p))).code_=u,i.extraCode_=l,i.name=a,i.message_=s,h&&(i.constraint=h),i}return c(n,[{key:"getCode",value:function(){return this.code_}},{key:"getExtraCode",value:function(){return this.extraCode_}}]),n}(m(Error)),TD=32768,ID=32769,ED=32770,wD=32771,RD=32772,CD=32773,AD=32774,xD=32775,PD=32777,DD=32778,MD=32779,OD=32780,ND=32781,LD=32782,UD=32783,VD=32784,FD=32785,jD=32786,BD=32787,HD=32788,GD=32789,zD=32790,WD=32791,JD=32792,qD=32793,KD=32794,QD=32795,XD=32796,$D=32797,YD=32798,ZD=32799,eM=32800,tM=32801,nM=32802,iM=32803,rM=32804,aM=new Map,oM=function(e,t){var n=aM.get(e);n||(aM.set(e,[]),n=aM.get(e)),n.push(t)},sM=function(e){var t=aM.get(e),n=[];return t?(aM.delete(e),n=t.map((function(e){return{uint32_event_id:e.eventId,uint64_date:e.timestamp,str_userid:e.remoteUserId,str_event_json:e.eventDesc}}))):n=[],n},cM=Object.prototype.hasOwnProperty;function uM(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(hA(e))switch(Object.prototype.toString.call(e)){case"[object File]":case"[object Map]":case"[object Set]":return 0===e.size;case"[object Object]":for(var t in e)if(cM.call(e,t))return!1;return!0}return!1}var dM=function(){function e(){o(this,e);var t=rA(),n=t.name,i=t.version;this.roomIdMap_=new Map,this.configs_={sdkAppId:"",userId:"",version:Wa,env:TT,browserVersion:n+i,ua:navigator.userAgent}}return c(e,[{key:"setConfig",value:function(e){var t=e.sdkAppId,n=e.env,i=e.userId,r=e.roomId;t!==this.configs_.sdkAppId&&(this.configs_.sdkAppId=String(t)),this.configs_.env=n,this.configs_.userId=i,this.roomIdMap_.set(i,String(r))}},{key:"logEvent",value:function(e){if(!tA){var n=t(t(t({},e),this.configs_),{},{userId:e.userId||this.configs_.userId});vA(n.code)&&(n.code="failed"===n.result?bD.UNKNOWN:0),this.sendRequest(dA(this.configs_.sdkAppId,CT),n)}}},{key:"logSuccessEvent",value:function(e){tA||(this.logEvent(t(t({},e),{},{result:"success",roomId:this.roomIdMap_.get(e.userId)})),this.configs_.env===TT&&this.uploadEventToKibana(t(t({},e),{},{result:"success"})))}},{key:"logFailedEvent",value:function(e){if(!tA){var n=e.eventType,i=e.code,r=e.error,a=e.userId,o={roomId:this.roomIdMap_.get(a),userId:a,eventType:n,result:"failed",code:i||(r instanceof kD?r.getExtraCode()||r.getCode():bD.UNKNOWN)};this.logEvent(o),this.configs_.env===TT&&this.uploadEventToKibana(t(t({},o),{},{error:r}))}}},{key:"uploadEventToKibana",value:function(e){var t="stat-".concat(e.eventType,"-").concat(e.result);"delta-join"!==e.eventType&&"delta-leave"!==e.eventType&&"delta-publish"!==e.eventType||(t="".concat(e.eventType,":").concat(e.delta)),this.uploadEvent({log:t,userId:e.userId}),"failed"===e.result&&(t="stat-".concat(e.eventType,"-").concat(e.result,"-").concat(e.code),this.uploadEvent({log:t,userId:e.userId,error:e.error}))}},{key:"uploadEvent",value:function(e){var t=e.log,n=e.userId,i=e.error,r={timestamp:r_(),sdkAppId:this.configs_.sdkAppId,userId:n||this.configs_.userId,version:this.configs_.version,log:t};i&&(r.errorInfo=i.message),this.sendRequest(dA(this.configs_.sdkAppId,RT),r)}},{key:"sendRequest",value:function(e,t){var n=this;Vx.getIsAbleToUpload()?UA({url:e,body:JSON.stringify(t)}).catch((function(){})):setTimeout((function(){n.sendRequest(e,t)}),1e3)}}]),e}(),lM=new dM,hM=function(){function e(t){o(this,e),this.client_=t.client,this.sdkAppId_=t.sdkAppId,this.userId_=t.userId,this.userSig_=t.userSig,this.url_=t.url,this.backupUrl_=t.backupUrl;var n="?sdkAppId=".concat(encodeURIComponent(this.sdkAppId_),"&userId=").concat(encodeURIComponent(this.userId_),"&userSig=").concat(encodeURIComponent(this.userSig_),"&roomId=").concat(encodeURIComponent(t.roomId)),i=this.client_.getSystemResult();if(i&&i.detail){var r=i.detail,a=r.isH264EncodeSupported,s=r.isVp8EncodeSupported,c=r.isH264DecodeSupported,u=r.isVp8DecodeSupported;n+="&enc264=".concat(Number(a),"&dec264=").concat(Number(c),"&encVp8=").concat(Number(s),"&decVp8=").concat(Number(u))}t.signalDomainWhenUnifiedProxy&&(n+="&signalDomain=".concat(encodeURIComponent(t.signalDomainWhenUnifiedProxy))),this.urlWithParam_="".concat(this.url_).concat(n),this.backupUrlWithParam_="".concat(this.backupUrl_).concat(n),this.isConnected_=!1,this.isConnecting_=!1,this.socketInUse_=null,this.socket_=null,this.backupSocket_=null,this.backupTimer_=-1,this.signalInfo_={},this.currentState_=KP,this.reconnectionCount_=0,this.reconnectionTimer_=-1,this.lastMessageTime_=-1,this.seq_=0,this.log_=Vx.createLogger({id:"ws|"+this.userId_,userId:this.userId_,sdkAppId:this.sdkAppId_}),this.emitter_=new FA}return c(e,[{key:"isOnline",get:function(){return this.currentState_===$P&&Date.now()-this.lastMessageTime_<12e3}},{key:"connect",value:function(){var e=this;return new Promise((function(t,n){e.log_.info("connect to url: ".concat(e.urlWithParam_)),e.emitConnectionStateChanged(QP),e.socket_=new WebSocket(e.urlWithParam_),e.bindSocket(e.socket_),e.backupTimer_=setTimeout((function(){e.isConnected_||(e.log_.info("trying to connect to backupUrl"),e.tryConnectBackup())}),5e3),e.once(JP,t),e.once(qP,n)}))}},{key:"tryConnectBackup",value:function(){this.backupSocket_||(this.unbindAndCloseSocket(rT),this.log_.debug("try to connect to url: ".concat(this.backupUrlWithParam_)),this.backupSocket_=new WebSocket(this.backupUrlWithParam_),this.bindSocket(this.backupSocket_))}},{key:"bindSocket",value:function(e){e.onopen=this.onopen.bind(this),e.onclose=this.onclose.bind(this),e.onerror=this.onerror.bind(this),e.onmessage=this.onmessage.bind(this)}},{key:"unbindSocket",value:function(e){e.onopen=function(){},e.onclose=function(){},e.onerror=function(){},e.onmessage=function(){}}},{key:"unbindAndCloseSocket",value:function(e){if(e===rT){if(this.socket_){this.unbindSocket(this.socket_);try{this.socket_.close(1e3)}catch(IQ){}this.socket_=null}}else if(this.backupSocket_){this.unbindSocket(this.backupSocket_);try{this.backupSocket_.close(1e3)}catch(IQ){}this.backupSocket_=null}}},{key:"clearBackupTimer",value:function(){-1!==this.backupTimer_&&(clearTimeout(this.backupTimer_),this.backupTimer_=-1)}},{key:"clearReconnectionTimer",value:function(){-1!==this.reconnectionTimer_&&(clearTimeout(this.reconnectionTimer_),this.reconnectionTimer_=-1)}},{key:"onopen",value:function(e){if(!this.isConnected_){this.isConnected_=!0,this.isConnecting_=!1,this.isReconnecting_&&uM(this.signalInfo_)&&this.stopReconnection(),this.clearBackupTimer(),e.target===this.socket_?(this.unbindAndCloseSocket(aT),this.socketInUse_=this.socket_):(this.unbindAndCloseSocket(rT),this.socketInUse_=this.backupSocket_);var t=e.target.url;this.log_.info("websocket[".concat(t,"] is connected")),this.currentState_===QP?this.addSignalEvent(WD,"signal channel is connected"):this.currentState_===XP&&this.addSignalEvent(QD,"signal channel reconnect success"),this.emitConnectionStateChanged($P),this.emitter_.emit(JP)}}},{key:"onclose",value:function(e){var t=e.target.url,n=e.target===this.socketInUse_;this.log_.info("websocket[".concat(t," InUse: ").concat(n,"] is closed with code: ").concat(e.code)),e.target===this.socketInUse_&&(this.isConnected_=!1,this.emitConnectionStateChanged(KP),this.addSignalEvent(zD,"signal channel is disconnected"),e.wasClean&&1e3===e.code||(this.log_.warn("onclose code:".concat(e.code," reason:").concat(e.reason)),this.log_.warn("close current websocket and schedule a reconnect timeout"),this.socketInUse_.onclose=function(){},this.socketInUse_.close(4011),this.socket_=this.backupSocket_=this.socketInUse_=null,this.reconnect(rT)))}},{key:"onerror",value:function(e){var t=e.target.url;this.log_.error("websocket[".concat(t,"] error observed")),this.isConnected_?e.target===this.socketInUse_&&(this.isConnected_=!1,this.unbindAndCloseSocket(rT),this.unbindAndCloseSocket(aT),this.socketInUse_=null,this.reconnect(rT)):(this.isReconnecting_||lM.logFailedEvent({userId:this.client_.getUserId(),eventType:SI,code:bD.UNKNOWN}),e.target==this.socket_?(this.unbindAndCloseSocket(rT),this.reconnect(aT)):(this.unbindAndCloseSocket(aT),this.reconnect(rT))),this.isConnecting_=!1,this.isConnected_=!1}},{key:"onmessage",value:function(e){if(this.isConnected_){this.lastMessageTime_=Date.now();var t=JSON.parse(e.data),n=t.cmd,i=t.data,r=Object.values(YP),a=Object.keys(YP)[r.indexOf(n)],o=eD[a];switch(ZP.includes(n)||(this.log_.debug("received msg: ".concat(e.data)),this.log_.info("Received event: [ ".concat(o||"unknown cmd: "+n," ]"))),n){case YP.CHANNEL_SETUP_RESULT:if(0===t.code)this.signalInfo_.clientIp=i.clientIp,this.signalInfo_.signalIp=i.signalInnerIp,this.signalInfo_.tinyId=t.tinyId,i.svrTime&&function(e){n_=e-(new Date).getTime();var t=new Date;t.setTime(e),Vx.info("baseTime from server: "+t+" offset: "+n_)}(i.svrTime),this.log_.info("ChannelSetup Success"),lM.logSuccessEvent({userId:this.userId_,eventType:SI}),this.emitter_.emit(GP,{signalInfo:this.signalInfo_});else{var s=new kD({code:bD.SIGNAL_CHANNEL_SETUP_FAILED,extraCode:t.code,message:sA({key:jE,data:{errorCode:t.code,errorMsg:t.message}})});this.log_.error("".concat(t.code,", ").concat(t.message)),this.close(),lM.logFailedEvent({userId:this.userId_,eventType:SI,error:s}),this.emitter_.emit(zP,s)}break;case YP.JOIN_ROOM_RESULT:0===t.code&&(this.signalInfo_.relayIp=i.relayOuterIp,this.signalInfo_.relayInnerIp=i.relayInnerIp,this.signalInfo_.relayPort=i.relayPort,this.log_.info("signalIp:".concat(this.signalInfo_.signalIp," clientIp:").concat(this.signalInfo_.clientIp," relayIp: ").concat(this.signalInfo_.relayIp))),this.emitter_.emit(o,{data:t});break;case YP.CHANNEL_RECONNECT_RESULT:0===t.code?(this.log_.warn("reconnect success"),this.stopReconnection(),lM.logSuccessEvent({userId:this.userId_,eventType:bI}),this.client_.syncUserList(),this.client_.checkConnectionsToReconnect()):(this.log_.warn("reconnect failed, ".concat(t.code," ").concat(t.message)),this.client_.reJoin());break;default:this.emitter_.emit(o,{data:t})}}}},{key:"addSignalEvent",value:function(e,t){oM(this.userId_,{eventId:e,eventDesc:t,timestamp:i_(),userId:this.userId_,tinyId:this.signalInfo_.tinyId})}},{key:"reconnect",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rT;if(this.isConnecting_||-1!==this.reconnectionTimer_)this.log_.info("signal channel is reconnecting, ignoring current reconnection");else{if(this.reconnectionCount_>=tI){this.log_.warn("SDK has tried reconnect signal channel for ".concat(tI," times, but all failed. please check your network"));var n=new kD({code:bD.SIGNAL_CHANNEL_RECONNECTION_FAILED,message:sA({key:FE})});return lM.logFailedEvent({userId:this.client_.getUserId(),eventType:bI,error:n}),this.addSignalEvent(XD,"signal channel reconnect fail"),void this.emitter_.emit(qP,n)}this.isConnecting_=!0,this.reconnectionCount_++,this.currentState_!==XP&&(this.emitConnectionStateChanged(XP),this.addSignalEvent(KD,"signal channel is reconnecting")),this.log_.warn("reconnecting to ".concat(t," signal channel [").concat(this.reconnectionCount_,"/").concat(tI,"]"));var i=this.getReconnectionUrl(t);t===rT?(this.socket_=new WebSocket(i),this.bindSocket(this.socket_)):(this.backupSocket_=new WebSocket(i),this.bindSocket(this.backupSocket_));var r=fA(this.reconnectionCount_);this.reconnectionTimer_=setTimeout((function(){e.log_.warn("reconnect ".concat(t," signal channel timeout(").concat(r/1e3,"s), close and try again")),e.isConnecting_=!1,e.clearReconnectionTimer(),e.unbindAndCloseSocket(t),e.reconnect(t===rT?aT:rT)}),r)}}},{key:"isConnected",value:function(){return this.isConnected_}},{key:"isReconnecting_",get:function(){return-1!==this.reconnectionTimer_}},{key:"getReconnectionUrl",value:function(e){var t=e===rT?this.urlWithParam_:this.backupUrlWithParam_;if(!uM(this.signalInfo_)&&-1===t.indexOf("&rc=1")){var n=this.client_.getRoomId(),i=this.client_.getUseStringRoomId();t+="&rc=1&relayInnerIp=".concat(this.signalInfo_.relayInnerIp,"&relayOuterIp=").concat(this.signalInfo_.relayIp,"&relayPort=").concat(this.signalInfo_.relayPort,"&roomId=").concat(n,"&useStringRoomId=").concat(i)}return t}},{key:"send",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isConnected_){var n={cmd:e,data:t,userId:this.userId_,tinyId:this.signalInfo_.tinyId,seq:++this.seq_};return this.socketInUse_.send(JSON.stringify(n)),n.seq}}},{key:"sendWaitForResponse",value:function(e){var t=this,n=e.command,i=e.data,r=e.timeout,a=void 0===r?5e3:r,o=e.responseCommand,s=e.commandDesc,c=e.enableLog,u=void 0===c||c;return new Promise((function(e,r){var c=setTimeout((function(){t.off(o,d);var e=new kD({code:bD.API_CALL_TIMEOUT,message:sA({key:VE,data:{commandDesc:s,command:n}})});u&&t.log_.warn(e),r(e)}),a),d=function n(i){i.data.seq===l&&(clearTimeout(c),t.off(o,n),e(i))};t.on(o,d);var l=t.send(n,i)}))}},{key:"sendWaitForResponseWithRetry",value:function(){var e=this,t=arguments.length<=0?void 0:arguments[0],n=t.commandDesc,i=t.command,r=t.retries,a=void 0===r?0:r,o=t.retryTimeout,s=void 0===o?0:o;return Mx({retryFunction:this.sendWaitForResponse,onRetrying:function(t){e.log_.warn("".concat(n||i," timeout observed, retrying [").concat(t,"/").concat(a,"]"))},settings:{retries:a,timeout:s},context:this}).apply(void 0,arguments)}},{key:"getCurrentState",value:function(){return this.currentState_}},{key:"getSignalInfo",value:function(){return this.signalInfo_}},{key:"stopReconnection",value:function(){this.isReconnecting_&&(this.reconnectionCount_=0,this.clearReconnectionTimer())}},{key:"close",value:function(){this.log_.info("close SignalChannel"),this.clearBackupTimer(),this.stopReconnection(),this.signalInfo_={},this.isConnecting_=!1,this.isConnected_=!1,this.socketInUse_=null,this.unbindAndCloseSocket(rT),this.unbindAndCloseSocket(aT),this.emitConnectionStateChanged(KP)}},{key:"on",value:function(e,t,n){this.emitter_.on(e,t,n)}},{key:"removeListener",value:function(e,t,n){this.emitter_.removeListener(e,t,n)}},{key:"once",value:function(e,t,n){this.emitter_.once(e,t,n)}},{key:"off",value:function(e,t,n){this.emitter_.off(e,t,n)}},{key:"emitConnectionStateChanged",value:function(e){e!==this.currentState_&&(this.emitter_.emit(WP,{prevState:this.currentState_,state:e}),this.currentState_=e)}}]),e}(),pM=Rr,fM=$l.find,mM=Eo,vM="find",_M=!0;vM in[]&&Array(1).find((function(){_M=!1})),pM({target:"Array",proto:!0,forced:_M},{find:function(e){return fM(this,e,arguments.length>1?arguments[1]:void 0)}}),mM(vM);var gM={},yM={},SM={exports:{}},bM=SM.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(bM).forEach((function(e){bM[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var r=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:r&&!n[e.name]&&(n[e.name]={});var a=e.push?{}:r?n[e.name]:n;!function(e,n,i,r){if(r&&!i)n[r]=t(e[1]);else for(var a=0;a<i.length;a+=1)null!=e[a+1]&&(n[i[a]]=t(e[a+1]))}(i.match(e.reg),a,e.names,e.name),e.push&&n[e.push].push(a)},i=SM.exports,r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},a=[],o=t;return e.split(/(\r\n|\r|\n)/).filter(r).forEach((function(e){var t=e[0],r=e.slice(2);"m"===t&&(a.push({rtp:[],fmtp:[]}),o=a[a.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var c=i[t][s];if(c.reg.test(r))return n(c,o,r)}})),t.media=a,t};var a=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(a,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),r=0;r<i.length;r+=3)n.push({component:i[r],ip:i[r+1],port:i[r+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(a,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}}))}))}}(yM);var kM=SM.exports,TM=/%[sdv%]/g,IM=function(e){var t=1,n=arguments,i=n.length;return e.replace(TM,(function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},EM=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var a=t.names[r];t.name?i.push(n[t.name][a]):i.push(n[t.names[r]])}else i.push(n[t.name]);return IM.apply(null,i)},wM=["v","o","s","i","u","e","p","c","b","t","r","z","a"],RM=["i","c","b","a"],CM=yM,AM=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||wM,i=t.innerOrder||RM,r=[];return n.forEach((function(t){kM[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(EM(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(EM(t,n,e))}))}))})),e.media.forEach((function(e){r.push(EM("m",kM.m[0],e)),i.forEach((function(t){kM[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(EM(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(EM(t,n,e))}))}))}))})),r.join("\r\n")+"\r\n"};gM.write=AM,gM.parse=CM.parse,gM.parseParams=CM.parseParams,gM.parseFmtpConfig=CM.parseFmtpConfig,gM.parsePayloads=CM.parsePayloads,gM.parseRemoteCandidates=CM.parseRemoteCandidates,gM.parseImageAttributes=CM.parseImageAttributes,gM.parseSimulcastStreamList=CM.parseSimulcastStreamList;var xM=function(e){return gM.parse(e)},PM=function(e){return gM.write(e)},DM=function(e){var t=xM(e);return t.media.forEach((function(e){e.type===Uk&&e.fmtp.forEach((function(e){e.config+=";sprop-stereo=1;stereo=1"}))})),PM(t)};function MM(e){var t=xM(e);return t.media.forEach((function(e){if(e.type===Vk){var t=new Set;e.rtp.forEach((function(e){var n=e.payload;return"H264"===e.codec&&t.add(n)})),e.fmtp.forEach((function(e){var n=e.payload,i=e.config.match(/apt=(\d+)/);i&&i[1]&&t.has(Number(i[1]))&&t.add(n)}));var n=function(e){var n=e.payload;return!t.has(n)};e.rtp=e.rtp.filter(n),e.rtcpFb=e.rtcpFb.filter(n),e.fmtp=e.fmtp.filter(n),e.payloads=e.payloads.split(" ").filter((function(e){return!t.has(Number(e))})).join(" ")}})),PM(t)}var OM,NM,LM,UM,VM=Rr,FM=ie,jM=xi,BM=rg,HM=_p,GM=M,zM=RangeError,WM=String,JM=Math.floor,qM=FM(HM),KM=FM("".slice),QM=FM(1..toFixed),XM=function(e,t,n){return 0===t?n:t%2==1?XM(e,t-1,n*e):XM(e*e,t/2,n)},$M=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=JM(r/1e7)},YM=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=JM(i/t),i=i%t*1e7},ZM=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=WM(e[t]);n=""===n?i:n+qM("0",7-i.length)+i}return n};VM({target:"Number",proto:!0,forced:GM((function(){return"0.000"!==QM(8e-5,3)||"1"!==QM(.9,0)||"1.25"!==QM(1.255,2)||"1000000000000000128"!==QM(0xde0b6b3a7640080,0)}))||!GM((function(){QM({})}))},{toFixed:function(e){var t,n,i,r,a=BM(this),o=jM(e),s=[0,0,0,0,0,0],c="",u="0";if(o<0||o>20)throw zM("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return WM(a);if(a<0&&(c="-",a=-a),a>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(a*XM(2,69,1))-69)<0?a*XM(2,-t,1):a/XM(2,t,1),n*=4503599627370496,(t=52-t)>0){for($M(s,0,n),i=o;i>=7;)$M(s,1e7,0),i-=7;for($M(s,XM(10,i,1),0),i=t-1;i>=23;)YM(s,1<<23),i-=23;YM(s,1<<i),$M(s,1,1),YM(s,2),u=ZM(s)}else $M(s,0,n),$M(s,1<<-t,0),u=ZM(s)+qM("0",o);return u=o>0?c+((r=u.length)<=o?"0."+qM("0",o-r)+u:KM(u,0,r-o)+"."+KM(u,r-o)):c+u}});var eO=(null===(OM=window)||void 0===OM?void 0:OM.requestIdleCallback)||function(e){var t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1e3)},tO=(null===(NM=window)||void 0===NM?void 0:NM.cancelIdleCallback)||function(e){clearTimeout(e)},nO=(null===(LM=window)||void 0===LM?void 0:LM.cancelAnimationFrame)||(null===(UM=window)||void 0===UM?void 0:UM.mozCancelAnimationFrame),iO=function(){function e(){o(this,e)}return c(e,null,[{key:"generateTaskID",value:function(){return this.currentTaskID++}},{key:"run",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bE,n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i=t(t({},e===SE?{delay:2e3,count:0,backgroundTask:!0}:e===gE?{delay:1e4,count:0}:e===yE?{fps:60,delay:16.6,count:0,backgroundTask:!0}:{delay:2e3,count:0,backgroundTask:!0}),i),SA(n)&&(i=t(t({},i),n)),mA(e)&&(n=e,e=bE);var r=t({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,ricID:null,taskName:e,callback:n},i);return this.taskMap.set(r.taskID,r),this[e](r),r.taskID}},{key:"interval",value:function(e){var t=this;return e.intervalID=setInterval((function(){e.callback(),e.loopCount+=1,t.isBreakLoop(e)}),e.delay)}},{key:"timeout",value:function(e){var t=this;return e.timeoutID=setTimeout((function n(){if(e.callback(),e.loopCount+=1,!t.isBreakLoop(e))return e.timeoutID=setTimeout(n,e.delay)}),e.delay)}},{key:"ric",value:function(e){var t,n=this,i=EA();return e.ricID=eO((function r(){if((t=EA()-i)>=e.delay&&(i=EA()-Math.floor(t%e.delay),e.callback(),e.loopCount+=1),!n.isBreakLoop(e))return e.ricID=eO(r,{timeout:e.delay})}),{timeout:e.delay})}},{key:"raf",value:function(e){var t=this;e.delay=(1e3/e.fps).toFixed(2);var n,i=EA(),r=function r(){if(document.hidden&&e.backgroundTask){if(n=EA()-i,i=EA(),e.callback(),e.loopCount+=1,t.isBreakLoop(e))return;return e.timeoutID=setTimeout(r,e.delay-Math.floor(n%e.delay))}if((n=EA()-i)>=e.delay&&(i=EA()-Math.floor(n%e.delay),e.callback(),e.loopCount+=1),!t.isBreakLoop(e))return e.rafID=requestAnimationFrame(r)};if(e.rafID=requestAnimationFrame(r),e.backgroundTask){var a=function(){if(document.hidden){var t=EA()-i;t>=e.delay?r():e.timeoutID=setTimeout(r,e.delay-t)}};document.addEventListener("visibilitychange",a),e.onVisibilitychange=a,document.hidden&&a()}return e.taskID}},{key:"hasTask",value:function(e){return this.taskMap.has(e)}},{key:"clearTask",value:function(e){if(!this.taskMap.has(e))return!0;var t=this.taskMap.get(e),n=t.intervalID,i=t.timeoutID,r=t.rafID,a=t.ricID,o=t.onVisibilitychange;return n&&clearInterval(n),i&&clearTimeout(i),r&&nO(r),a&&tO(a),o&&document.removeEventListener("visibilitychange",o),this.taskMap.delete(e),!0}},{key:"isBreakLoop",value:function(e){return!this.taskMap.has(e.taskID)||0!==e.count&&e.loopCount>=e.count&&(this.clearTask(e.taskID),!0)}}]),e}();u(iO,"taskMap",new Map),u(iO,"currentTaskID",1);var rO=function(){function e(){o(this,e),this.prefix_="TRTC",this.queue_=new Map,this.checkStorage()}return c(e,[{key:"getRealKey",value:function(e){return"".concat(this.prefix_,"_").concat(e)}},{key:"checkStorage",value:function(){var e=this;if(nA()){var t=Object.keys(localStorage).filter((function(t){if(t.startsWith(e.prefix_)){var n=JSON.parse(localStorage.getItem(t));if(n&&n.expiresIn<Date.now())return!0}return!1}));t.forEach((function(e){return localStorage.removeItem(e)}))}}},{key:"doFlush",value:function(){if(nA())try{var e,t=w(this.queue_);try{for(t.s();!(e=t.n()).done;){var n=k(e.value,2),i=n[0],r=n[1];localStorage.setItem(i,JSON.stringify(r))}}catch(a){t.e(a)}finally{t.f()}}catch(IQ){Vx.warn(IQ)}}},{key:"getItem",value:function(e){if(!nA())return null;try{var t=JSON.parse(localStorage.getItem(this.getRealKey(e)));return t&&t.expiresIn>=Date.now()?t.value:null}catch(IQ){Vx.warn(IQ)}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(nA())try{var i={expiresIn:Date.now()+qI,value:t};n?localStorage.setItem(this.getRealKey(e),JSON.stringify(i)):(this.queue_.set(this.getRealKey(e),i),iO.hasTask(this.intervalId_)||(this.intervalId_=iO.run(gE,this.doFlush.bind(this),{count:1})))}catch(IQ){Vx.warn(IQ)}}},{key:"deleteItem",value:function(e){if(!nA())return!1;try{return e=this.getRealKey(e),this.queue_.delete(e),localStorage.removeItem(e),!0}catch(IQ){return Vx.warn(IQ),!1}}},{key:"clear",value:function(){if(nA())try{localStorage.clear()}catch(IQ){Vx.warn(IQ)}}}]),e}(),aO=new rO,oO={result:!1,detail:{isBrowserSupported:!1,isWebRTCSupported:!1,isMediaDevicesSupported:!1,isH264EncodeSupported:!1,isVp8EncodeSupported:!1,isH264DecodeSupported:!1,isVp8DecodeSupported:!1,isSpatialAudioSupported:!1}},sO="checkResult";var cO=function(){return!AC&&!iC&&(!(aC&&oC<80)&&!(tC&&nC<56))},uO=function(){return["RTCPeerConnection","webkitRTCPeerConnection","RTCIceGatherer"].filter((function(e){return e in window})).length>0},dO=function(){if(!navigator.mediaDevices)return!1;var e=["getUserMedia","enumerateDevices"];return e.filter((function(e){return e in navigator.mediaDevices})).length===e.length},lO=function(){var e=a(n().mark((function e(){var t,i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oO.detail.isH264EncodeSupported||!oO.detail.isVp8EncodeSupported){e.next=2;break}return e.abrupt("return",{isH264EncodeSupported:oO.detail.isH264EncodeSupported,isVp8EncodeSupported:oO.detail.isVp8EncodeSupported});case 2:return t="",i=!1,r=!1,e.prev=5,a=new RTCPeerConnection,(o=document.createElement(Lk)).getContext("2d"),s=o.captureStream(0),a.addTrack(s.getVideoTracks()[0],s),e.next=13,a.createOffer();case 13:return-1!==(t=e.sent).sdp.toLowerCase().indexOf("h264")&&(i=!0),-1!==t.sdp.toLowerCase().indexOf("vp8")&&(r=!0),a.close(),oO.detail.isH264EncodeSupported=i,oO.detail.isVp8EncodeSupported=r,e.abrupt("return",{isH264EncodeSupported:oO.detail.isH264EncodeSupported,isVp8EncodeSupported:oO.detail.isVp8EncodeSupported});case 22:return e.prev=22,e.t0=e.catch(5),e.abrupt("return",{isH264EncodeSupported:!1,isVp8EncodeSupported:!1});case 25:case"end":return e.stop()}}),e,null,[[5,22]])})));return function(){return e.apply(this,arguments)}}();function hO(){return pO.apply(this,arguments)}function pO(){return pO=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(n().mark((function e(t){var i,r,o,s,c,u,d,l,h,p,f,m,v,_;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={encode:!1,decode:!1},r=null,e.prev=2,o=document.createElement("canvas"),s=o.getContext("2d"),o.width=640,o.height=480,c=setInterval((function(){s.fillText("test",Math.floor(640*Math.random()),Math.floor(480*Math.random()))}),33),u=-1,d=-1,r=function(){clearInterval(u),clearInterval(c),clearTimeout(d),h.close(),p.close(),l.getTracks().forEach((function(e){return e.stop()}))},d=setTimeout((function(){r(),t(i)}),3e3),l=o.captureStream(),h=new RTCPeerConnection({}),p=new RTCPeerConnection({offerToReceiveAudio:!0,offerToReceiveVideo:!0}),h.addEventListener("icecandidate",(function(e){return p.addIceCandidate(e.candidate)})),p.addEventListener("icecandidate",(function(e){return h.addIceCandidate(e.candidate)})),h.addTrack(l.getVideoTracks()[0],l),e.next=20,h.createOffer();case 20:return f=e.sent,e.next=23,h.setLocalDescription(f);case 23:return e.next=25,p.setRemoteDescription(f);case 25:return e.next=27,p.createAnswer();case 27:return m=e.sent,v=xM(m.sdp),_=v.media[0].rtp.findIndex((function(e){return"H264"===e.codec})),v.media[0].rtp=[v.media[0].rtp[_]],v.media[0].fmtp=v.media[0].fmtp.filter((function(e){return e.payload===v.media[0].rtp[0].payload})),v.media[0].rtcpFb=v.media[0].rtcpFb.filter((function(e){return e.payload===v.media[0].rtp[0].payload})),m.sdp=PM(v),e.next=36,p.setLocalDescription(m);case 36:return e.next=38,h.setRemoteDescription(m);case 38:u=setInterval(a(n().mark((function e(){var a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.encode&&i.decode&&(r(),t(i)),e.next=3,h.getStats();case 3:return a=e.sent,e.next=6,p.getStats();case 6:o=e.sent,i.encode||a.forEach((function(e){"outbound-rtp"===e.type&&e.mediaType===Vk&&e.framesEncoded>0&&(i.encode=!0)})),i.decode||o.forEach((function(e){"inbound-rtp"===e.type&&e.mediaType===Vk&&e.framesDecoded>0&&(i.decode=!0)}));case 9:case"end":return e.stop()}}),e)}))),500),e.next=46;break;case 41:e.prev=41,e.t0=e.catch(2),r(),Vx.warn(e.t0),t(i);case 46:case"end":return e.stop()}}),e,null,[[2,41]])})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),pO.apply(this,arguments)}var fO=function(){var e=a(n().mark((function e(){var t,i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oO.detail.isH264DecodeSupported||!oO.detail.isVp8DecodeSupported){e.next=2;break}return e.abrupt("return",{isH264DecodeSupported:oO.detail.isH264DecodeSupported,isVp8DecodeSupported:oO.detail.isVp8DecodeSupported});case 2:return t="",i=!1,r=!1,e.prev=5,a=new RTCPeerConnection,e.next=9,a.createOffer({offerToReceiveAudio:1,offerToReceiveVideo:1});case 9:return-1!==(t=e.sent).sdp.toLowerCase().indexOf("h264")&&(i=!0),-1!==t.sdp.toLowerCase().indexOf("vp8")&&(r=!0),a.close(),e.abrupt("return",{isH264DecodeSupported:i,isVp8DecodeSupported:r});case 16:return e.prev=16,e.t0=e.catch(5),e.abrupt("return",{isH264DecodeSupported:!1,isVp8DecodeSupported:!1});case 19:case"end":return e.stop()}}),e,null,[[5,16]])})));return function(){return e.apply(this,arguments)}}(),mO=function(){var e=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l,h,p,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_O()){e.next=2;break}return e.abrupt("return",oO);case 2:return t=cO(),i=uO(),r=dO(),e.next=7,lO();case 7:return a=e.sent,o=a.isH264EncodeSupported,s=a.isVp8EncodeSupported,e.next=12,fO();case 12:if(c=e.sent,u=c.isH264DecodeSupported,d=c.isVp8DecodeSupported,o&&s){e.next=21;break}return e.next=18,lO();case 18:l=e.sent,o=l.isH264EncodeSupported,s=l.isVp8EncodeSupported;case 21:if(!(o&&u&&(FC||BC||XC)&&!lC&&GC()<79)){e.next=29;break}return e.next=24,hO();case 24:h=e.sent,p=h.encode,f=h.decode,o=p,u=f;case 29:return oO.result=t&&i&&r&&(o||s)&&(u||d),oO.detail.isBrowserSupported=t,oO.detail.isWebRTCSupported=i,oO.detail.isMediaDevicesSupported=r,oO.detail.isH264EncodeSupported=o,oO.detail.isVp8EncodeSupported=s,oO.detail.isH264DecodeSupported=u,oO.detail.isVp8DecodeSupported=d,oO.detail.isSpatialAudioSupported=AO(),gO(),aO.setItem(sO,{ua:navigator.userAgent,checkResult:oO},!0),e.abrupt("return",oO);case 41:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),vO=function(e,t){var n=null;return function(){if(n)return n;for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return(n=e.apply(t||this,r)).then((function(e){return n=null,e})).catch((function(e){throw n=null,e})),n}}(mO);function _O(){var e;return null===(e=oO.detail)||void 0===e||!e.isSpatialAudioSupported||Object.keys(oO.detail).findIndex((function(e){return!oO.detail[e]}))>=0}function gO(){_O()&&(Vx.warn(sA({key:lR})),Vx.info("".concat(navigator.userAgent," ").concat(JSON.stringify(oO.detail))))}function yO(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)}function SO(){return"RTCPeerConnection"in window&&"getReceivers"in window.RTCPeerConnection.prototype}function bO(){return"RTCPeerConnection"in window&&"getSenders"in window.RTCPeerConnection.prototype}function kO(){return"RTCPeerConnection"in window&&"getTransceivers"in window.RTCPeerConnection.prototype}function TO(){return"RTCPeerConnection"in window&&"addTransceiver"in window.RTCPeerConnection.prototype}function IO(){return"RTCRtpSender"in window&&"replaceTrack"in window.RTCRtpSender.prototype}function EO(){return"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype&&bO()}function wO(){return!!vA(navigator.mediaDevices)&&(Vx.error(UR.NOT_SUPPORTED_MEDIA),!0)}function RO(){return"http:"===location.protocol&&!tA&&(Vx.warn(sA({key:dR})),!0)}var CO="RTCRtpSender"in window&&"createEncodedStreams"in window.RTCRtpSender.prototype&&GC()>=86,AO=function(){return CO};function xO(e){return!("candidate-pair"!==e.type||!e.nominated||"in-progress"!==e.state&&"succeeded"!==e.state)&&!(yA(e.selected)&&!e.selected)}var PO=new Map([[eC,"Android"],[ZR,"iOS"],[wC,"Windows"],[RC,"MacOS"],[CC,"Linux"]]);function DO(){var e="unknown";return PO.get(!0)&&(e=PO.get(!0)),e}function MO(){var e="";screen.width&&(e+=(screen.width?screen.width*window.devicePixelRatio:"")+" * "+(screen.height?screen.height*window.devicePixelRatio:""));return e}function OO(){var e=!1;return(navigator.getUserMedia||navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)&&(e=!0),e}function NO(){for(var e={isSupported:!1},t=["AudioContext","webkitAudioContext","mozAudioContext","msAudioContext"],n=0;n<t.length;n++)if(t[n]in window){e.isSupported=!0;break}return e.isSupported}function LO(){return!(mC&&GC()<86)&&(!(ZR&&gA($C)&&$C<15)&&(!(JC&&JC<63)&&!(!cO()||!("captureStream"in HTMLCanvasElement.prototype))))}var UO=window.MediaStreamTrack&&"getSettings"in MediaStreamTrack.prototype,VO=window.MediaStreamTrack&&"getCapabilities"in MediaStreamTrack.prototype;var FO=function(){var e,t,n;return(null===(e=window)||void 0===e?void 0:e.OffscreenCanvas)&&(null===(t=window)||void 0===t?void 0:t.MediaStreamTrackProcessor)&&(null===(n=window)||void 0===n?void 0:n.MediaStreamTrackGenerator)};!function(){RO();var e=aO.getItem(sO);e&&e.ua===navigator.userAgent&&(oO=e.checkResult),vO()}();var jO={STREAM_ADDED:"stream-added",STREAM_REMOVED:"stream-removed",STREAM_UPDATED:"stream-updated",STREAM_PUBLISHED:"stream-published",STREAM_SUBSCRIBED:"stream-subscribed",STREAM_UNSUBSCRIBED:"stream-unsubscribed",STATE_CHANGED:"state-changed",ERROR:"error",CONNECTION_STATE_CHANGED:"connection-state-changed",SEI_MESSAGE:dT},BO={STREAM_ADDED:"stream-added",STREAM_REMOVED:"stream-removed",STREAM_UPDATED:"stream-updated",STREAM_SUBSCRIBED:"stream-subscribed",CONNECTION_STATE_CHANGED:"connection-state-changed",PEER_JOIN:"peer-join",PEER_LEAVE:"peer-leave",MUTE_AUDIO:"mute-audio",MUTE_VIDEO:"mute-video",UNMUTE_AUDIO:"unmute-audio",UNMUTE_VIDEO:"unmute-video",CLIENT_BANNED:"client-banned",NETWORK_QUALITY:"network-quality",AUDIO_VOLUME:"audio-volume",SEI_MESSAGE:dT,ERROR:"error"},HO="player-state-changed",GO="screen-sharing-stopped",zO="connection-state-changed",WO="device-auto-recovered",JO="error",qO="player-state-changed",KO=CE;Rr({target:"String",proto:!0,forced:xE("small")},{small:function(){return KO(this,"small","","")}});var QO=function(){function e(t){o(this,e);var n=t.getUserId();this.log_=Vx.createLogger({id:n,userId:n,sdkAppId:t.getSDKAppId()}),this.prevReportTime_=0,this.prevReport_={},this.prevEncoderImplementation_="",this.prevQualityLimitationReason_="",this.prevDecoderImplementationMap_=new Map}var t,i,r,s;return c(e,[{key:"statInterval",get:function(){return 0===this.prevReportTime_?2:(Date.now()-this.prevReportTime_)/1e3}},{key:"getSenderStats",value:(s=a(n().mark((function e(t){var i,r,a,o,s=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i={audio:{bytesSent:0,packetsSent:0,audioLevel:0,totalAudioEnergy:0},video:{bytesSent:0,packetsSent:0,framesEncoded:0,frameWidth:0,frameHeight:0,framesSent:0,fpsCapture:0},small:{bytesSent:0,packetsSent:0,framesEncoded:0,frameWidth:0,frameHeight:0,framesSent:0,fpsCapture:0},auxiliary:{bytesSent:0,packetsSent:0,framesEncoded:0,frameWidth:0,frameHeight:0,framesSent:0,fpsCapture:0},rtt:0},r=t.getPeerConnection(),a=t.getSSRC(),!r){e.next=15;break}return e.prev=4,e.next=7,r.getStats();case 7:e.sent.forEach((function(e){if("outbound-rtp"===e.type)if(e.mediaType===Vk){if(!tC&&0===e.bytesSent)return;e.ssrc!==a.video||vA(e.encoderImplementation)||s.prevEncoderImplementation_===e.encoderImplementation||(s.log_.info("encoderImplementation change to ".concat(e.encoderImplementation)),s.prevEncoderImplementation_=e.encoderImplementation),e.ssrc!==a.video||vA(e.qualityLimitationReason)||s.prevQualityLimitationReason_===e.qualityLimitationReason||(s.log_.info("qualityLimitationReason change to ".concat(e.qualityLimitationReason)),s.prevQualityLimitationReason_=e.qualityLimitationReason);var n=Vk;e.ssrc===a.small?n=jk:e.ssrc===a.auxiliary&&(n=Hk),i[n].bytesSent=e.bytesSent,i[n].packetsSent=e.packetsSent,i[n].framesEncoded=e.framesEncoded}else e.mediaType===Uk&&(i.audio.bytesSent=e.bytesSent,i.audio.packetsSent=e.packetsSent);else"candidate-pair"===e.type?xO(e)&&gA(e.currentRoundTripTime)&&(i.rtt=Math.floor(1e3*e.currentRoundTripTime)):"media-source"===e.type&&(e.kind===Uk?(i.audio.audioLevel=e.audioLevel||0,i.audio.totalAudioEnergy=e.totalAudioEnergy||0):e.kind===Vk&&(e.trackIdentifier===t.getVideoTrackId(Vk)?i.video.fpsCapture=e.framesPerSecond:e.trackIdentifier===t.getVideoTrackId(Hk)?i.auxiliary.fpsCapture=e.framesPerSecond:i.small.fpsCapture=e.framesPerSecond));var r;vA(e.audioLevel)||(i.audio.audioLevel=e.audioLevel||0,i.audio.totalAudioEnergy=e.totalAudioEnergy||0),vA(e.frameWidth)||(e.trackIdentifier===t.getVideoTrackId(Vk)||e.ssrc===a.video?r=Vk:e.trackIdentifier===t.getVideoTrackId(Hk)||e.ssrc===a.auxiliary?r=Hk:e.trackIdentifier!==t.getVideoTrackId(jk)&&e.ssrc!==a.small||(r=jk),r&&(i[r].frameWidth=e.frameWidth,i[r].frameHeight=e.frameHeight,i[r].framesSent=e.framesSent))})),0===i.audio.audioLevel&&(i.audio.audioLevel=(null===(o=t.getLocalStream())||void 0===o?void 0:o.getInternalAudioLevel())||0),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),this.log_.warn("failed to getStats on sender connection "+e.t0);case 15:return e.abrupt("return",i);case 16:case"end":return e.stop()}}),e,this,[[4,12]])}))),function(e){return s.apply(this,arguments)})},{key:"getReceiverStats",value:(r=a(n().mark((function e(t){var i,r,a,o,s,c=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i={tinyId:t.getTinyId(),userId:t.getUserId(),rtt:0,hasAudio:!1,hasVideo:!1,hasAuxiliary:!1,audio:{bytesReceived:0,packetsReceived:0,packetsLost:0,jitter:0,audioLevel:0,totalAudioEnergy:0},video:{bytesReceived:0,packetsReceived:0,packetsLost:0,framesReceived:0,framesDecoded:0,frameWidth:0,frameHeight:0},auxiliary:{bytesReceived:0,packetsReceived:0,packetsLost:0,framesReceived:0,framesDecoded:0,frameWidth:0,frameHeight:0}},!(r=t.getPeerConnection())){e.next=16;break}return e.prev=3,a=t.getSSRC(),o=t.getTrackState(),e.next=8,r.getStats();case 8:e.sent.forEach((function(e){if("inbound-rtp"===e.type){if(e.mediaType===Uk&&e.ssrc===a.audio&&o.audio)i.audio.packetsReceived=e.packetsReceived,i.audio.bytesReceived=e.bytesReceived,i.audio.packetsLost=e.packetsLost,i.audio.jitter=e.jitter,i.hasAudio=!0;else if(e.mediaType===Vk){if(tC&&0===e.bytesReceived)return;e.ssrc===a.video&&o.video&&(i.video.packetsReceived=e.packetsReceived,i.video.bytesReceived=e.bytesReceived,i.video.packetsLost=e.packetsLost,i.video.framesReceived=e.framesReceived,i.video.framesDecoded=e.framesDecoded,i.video.fpsDecoded=e.framesPerSecond,i.hasVideo=!0,!e.decoderImplementation||c.prevDecoderImplementationMap_.has(i.userId)&&c.prevDecoderImplementationMap_.get(i.userId)===e.decoderImplementation||(c.log_.info("".concat(i.userId," decoderImplementation change to ").concat(e.decoderImplementation)),c.prevDecoderImplementationMap_.set(i.userId,e.decoderImplementation))),e.ssrc===a.auxiliary&&o.auxiliary&&(i.auxiliary.packetsReceived=e.packetsReceived,i.auxiliary.bytesReceived=e.bytesReceived,i.auxiliary.packetsLost=e.packetsLost,i.auxiliary.framesReceived=e.framesReceived,i.auxiliary.framesDecoded=e.framesDecoded,i.auxiliary.fpsDecoded=e.framesPerSecond,i.hasAuxiliary=!0)}}else"candidate-pair"===e.type&&xO(e)&&gA(e.currentRoundTripTime)&&(i.rtt=Math.floor(1e3*e.currentRoundTripTime));vA(e.frameWidth)||(e.trackIdentifier!==t.getMainStreamVideoTrackId()&&e.ssrc!==a.video||(i.video.frameWidth=e.frameWidth,i.video.frameHeight=e.frameHeight),e.trackIdentifier!==t.getAuxStreamVideoTrackId()&&e.ssrc!==a.auxiliary||(i.auxiliary.frameWidth=e.frameWidth,i.auxiliary.frameHeight=e.frameHeight)),vA(e.audioLevel)||(i.audio.audioLevel=e.audioLevel||0,i.audio.totalAudioEnergy=e.totalAudioEnergy||0)})),0===i.audio.audioLevel&&(i.audio.audioLevel=(null===(s=t.getMainStream())||void 0===s?void 0:s.getInternalAudioLevel())||0),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),this.log_.warn("failed to getStats on receiver connection "+e.t0);case 16:return e.abrupt("return",i);case 17:case"end":return e.stop()}}),e,this,[[3,13]])}))),function(e){return r.apply(this,arguments)})},{key:"getStats",value:(i=a(n().mark((function e(t,i){var r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={},!t){e.next=5;break}return e.next=4,this.getSenderStats(t);case 4:r=e.sent;case 5:a=[],o=w(i),e.prev=7,o.s();case 9:if((s=o.n()).done){e.next=17;break}return(c=k(s.value,2))[0],u=c[1],e.next=13,this.getReceiverStats(u);case 13:d=e.sent,a.push(d);case 15:e.next=9;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),o.e(e.t0);case 22:return e.prev=22,o.f(),e.finish(22);case 25:return e.abrupt("return",{senderStats:r,receiverStats:a});case 26:case"end":return e.stop()}}),e,this,[[7,19,22,25]])}))),function(e,t){return i.apply(this,arguments)})},{key:"getDifferenceValue",value:function(e,t){if(uM(e))return t;var n=t-e;return n<0?0:n}},{key:"prepareReport",value:function(e){var t=this,n=e.stats,i=e.report,r=e.freezeMap;if(!uM(n.senderStats)){var a;a={uint32_audio_level:1e8*n.senderStats.audio.audioLevel,uint32_audio_energy:1e6*n.senderStats.audio.totalAudioEnergy,uint32_audio_codec_bitrate:n.senderStats.audio.bytesSent,audioLevel:n.senderStats.audio.audioLevel};var o=[],s={uint32_video_stream_type:2,uint32_video_codec_fps:n.senderStats.video.framesSent,uint32_video_capture_fps:n.senderStats.video.fpsCapture,uint32_video_width:n.senderStats.video.frameWidth,uint32_video_height:n.senderStats.video.frameHeight,uint32_video_codec_bitrate:n.senderStats.video.bytesSent,uint32_video_enc_fps:n.senderStats.video.framesEncoded};if(o.push(s),n.senderStats.small.bytesSent){var c={uint32_video_stream_type:3,uint32_video_codec_fps:n.senderStats.small.framesSent||0,uint32_video_capture_fps:n.senderStats.small.fpsCapture||0,uint32_video_width:n.senderStats.small.frameWidth||0,uint32_video_height:n.senderStats.small.frameHeight||0,uint32_video_codec_bitrate:n.senderStats.small.bytesSent,uint32_video_enc_fps:n.senderStats.small.framesEncoded||0};o.push(c)}if(n.senderStats.auxiliary.bytesSent){var u={uint32_video_stream_type:7,uint32_video_codec_fps:n.senderStats.auxiliary.framesSent||0,uint32_video_capture_fps:n.senderStats.auxiliary.fpsCapture||0,uint32_video_width:n.senderStats.auxiliary.frameWidth||0,uint32_video_height:n.senderStats.auxiliary.frameHeight||0,uint32_video_codec_bitrate:n.senderStats.auxiliary.bytesSent,uint32_video_enc_fps:n.senderStats.auxiliary.framesEncoded||0};o.push(u)}var d={uint32_bitrate:0,uint32_rtt:n.senderStats.rtt};i.msg_up_stream_info={msg_audio_status:a,msg_video_status:o,msg_network_status:d}}var l=this.statInterval;i.msg_down_stream_info=[],n.receiverStats.forEach((function(e){var t={};if(t.msg_user_info={str_identifier:e.userId,uint64_tinyid:e.tinyId},t.msg_network_status={uint32_rtt:e.rtt},t.msg_video_status={},e.hasAudio){var n={uint32_audio_codec_bitrate:e.audio.bytesReceived,uint32_audio_total_bitrate:e.audio.bytesReceived,uint32_audio_level:1e8*e.audio.audioLevel,uint32_audio_energy:1e6*e.audio.totalAudioEnergy,uint32_audio_receive:e.audio.packetsReceived,uint32_audio_origin_lost:e.audio.packetsLost,audioLevel:e.audio.audioLevel};t.msg_audio_status=n}if(t.msg_video_status=[],e.hasVideo){var a=r.get(e.userId+"_"+BT),o=a?a.duration:0,s={uint32_video_stream_type:2,uint32_video_receive_fps:e.video.framesReceived,uint32_video_width:e.video.frameWidth,uint32_video_height:e.video.frameHeight,uint32_video_codec_bitrate:e.video.bytesReceived,uint32_video_receive:e.video.packetsReceived,uint32_video_origin_lost:e.video.packetsLost,uint32_video_block_time:o,uint32_video_dec_fps:e.video.framesDecoded};t.msg_video_status.push(s)}if(e.hasAuxiliary){var c=r.get(e.userId+"_"+HT),u=c?c.duration:0,d={uint32_video_stream_type:7,uint32_video_receive_fps:e.auxiliary.framesReceived,uint32_video_width:e.auxiliary.frameWidth,uint32_video_height:e.auxiliary.frameHeight,uint32_video_codec_bitrate:e.auxiliary.bytesReceived,uint32_video_receive:e.auxiliary.packetsReceived+e.auxiliary.packetsLost,uint32_video_origin_lost:e.auxiliary.packetsLost,uint32_video_block_time:u,uint32_video_dec_fps:e.auxiliary.framesDecoded};t.msg_video_status.push(d)}i.msg_down_stream_info.push(t)}));var h=this.prevReport_;if(this.prevReport_=JSON.parse(JSON.stringify(i)),i.msg_up_stream_info.msg_audio_status&&h.msg_up_stream_info.msg_audio_status){var p=h.msg_up_stream_info.msg_audio_status,f=i.msg_up_stream_info.msg_audio_status,m=this.getDifferenceValue(p.uint32_audio_codec_bitrate,f.uint32_audio_codec_bitrate);f.uint32_audio_codec_bitrate=Math.round(8*m/l),i.msg_up_stream_info.msg_network_status.uint32_bitrate+=f.uint32_audio_codec_bitrate}var v=h.msg_up_stream_info.msg_video_status;i.msg_up_stream_info.msg_video_status.forEach((function(e){var n=v.find((function(t){return t.uint32_video_stream_type===e.uint32_video_stream_type}));if(!n||0===n.uint32_video_codec_bitrate)return e.uint32_video_codec_bitrate=0,e.uint32_video_enc_fps=0,void(e.uint32_video_codec_fps=0);var r=n.uint32_video_codec_bitrate,a=n.uint32_video_enc_fps,o=n.uint32_video_codec_fps,s=t.getDifferenceValue(r,e.uint32_video_codec_bitrate);e.uint32_video_codec_bitrate=Math.round(8*s/l),i.msg_up_stream_info.msg_network_status.uint32_bitrate+=e.uint32_video_codec_bitrate,e.uint32_video_enc_fps=Math.round(t.getDifferenceValue(a,e.uint32_video_enc_fps)/l),e.uint32_video_codec_fps=Math.round(t.getDifferenceValue(o,e.uint32_video_codec_fps)/l)}));var _=i.msg_down_stream_info,g=h.msg_down_stream_info;return _.forEach((function(e){var n=g.find((function(t){return t.msg_user_info.uint64_tinyid===e.msg_user_info.uint64_tinyid}));if(n){if(e.msg_audio_status&&n.msg_audio_status){var i=e.msg_audio_status,r=n.msg_audio_status;i.uint32_audio_origin_lost=t.getDifferenceValue(r.uint32_audio_origin_lost,i.uint32_audio_origin_lost),i.uint32_audio_receive=t.getDifferenceValue(r.uint32_audio_receive,i.uint32_audio_receive),i.uint32_audio_receive+=i.uint32_audio_origin_lost;var a=t.getDifferenceValue(r.uint32_audio_codec_bitrate,i.uint32_audio_codec_bitrate);i.uint32_audio_codec_bitrate=Math.round(8*a/l),i.uint32_audio_total_bitrate=Math.round(8*a/l)}if(e.msg_video_status&&n.msg_video_status){var o=e.msg_video_status,s=n.msg_video_status;o.forEach((function(e){var n=s.find((function(t){return t.uint32_video_stream_type===e.uint32_video_stream_type}));if(!n)return e.uint32_video_receive=0,e.uint32_video_origin_lost=0,e.uint32_video_codec_bitrate=0,e.uint32_video_receive_fps=0,void(e.uint32_video_dec_fps=0);var i=n.uint32_video_receive,r=n.uint32_video_origin_lost,a=n.uint32_video_codec_bitrate,o=n.uint32_video_receive_fps,c=n.uint32_video_dec_fps;e.uint32_video_origin_lost=t.getDifferenceValue(r,e.uint32_video_origin_lost),e.uint32_video_receive=t.getDifferenceValue(i,e.uint32_video_receive)+e.uint32_video_origin_lost;var u=t.getDifferenceValue(a,e.uint32_video_codec_bitrate);e.uint32_video_codec_bitrate=Math.round(8*u/l);var d=t.getDifferenceValue(o,e.uint32_video_receive_fps);e.uint32_video_receive_fps=Math.round(d/l),e.uint32_video_dec_fps=Math.round(t.getDifferenceValue(c,e.uint32_video_dec_fps)/l)}))}}})),i}},{key:"getStatsReport",value:(t=a(n().mark((function e(t){var i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.uplinkConnection,r=t.downlinkConnections,a=t.freezeMap,o={msg_up_stream_info:{msg_audio_status:{uint32_audio_format:0,uint32_audio_sample_rate:0,uint32_audio_codec_bitrate:0,uint32_audio_receive:0,uint32_audio_origin_lost:0,uint32_audio_level:0,uint32_audio_energy:0,audioLevel:0},msg_video_status:[{uint32_video_stream_type:0,uint32_video_codec_fps:0,uint32_video_capture_fps:0,uint32_video_width:0,uint32_video_height:0,uint32_video_codec_bitrate:0,uint32_video_receive:0,uint32_video_origin_lost:0,uint32_video_final_lost:0,uint32_video_enc_fps:0}],msg_network_status:{uint32_bitrate:0,uint32_rtt:0,uint32_lost:0}},msg_down_stream_info:[{msg_user_info:{str_identifier:"",uint64_tinyid:""},msg_audio_status:{uint32_audio_format:0,uint32_audio_sample_rate:0,uint32_audio_codec_bitrate:0,uint32_audio_total_bitrate:0,uint32_audio_level:0,uint32_audio_energy:0,uint32_audio_receive:0,uint32_audio_origin_lost:0,uint32_audio_final_lost:0,audioLevel:0},msg_video_status:[{uint32_video_stream_type:0,uint32_video_receive_fps:0,uint32_video_width:0,uint32_video_height:0,uint32_video_codec_bitrate:0,uint32_video_receive:0,uint32_video_origin_lost:0,uint32_video_block_time:0,uint32_video_dec_fps:0}],msg_network_status:{uint32_bitrate:0,uint32_rtt:0,uint32_lost:0,uint32_jitter:0}}]},e.next=4,this.getStats(i,r);case 4:return s=e.sent,"{}"===JSON.stringify(this.prevReport_)&&(this.prevReport_=JSON.parse(JSON.stringify(o))),this.prepareReport({stats:s,report:o,freezeMap:a,uplinkConnection:i,downlinkConnections:r}),this.prevReportTime_=Date.now(),e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"reset",value:function(){this.prevReportTime_=0,this.prevReport_={},this.prevEncoderImplementation_="",this.prevQualityLimitationReason_="",this.prevDecoderImplementationMap_=new Map}}]),e}(),XO=function(){function e(t){var n=t.signalChannel,i=t.connections,r=t.client;o(this,e),this.client_=r,this.signalChannel_=n,this.connections_=i,this.client_=r,this.log_=Vx.createLogger({id:"q|"+this.client_.getUserId(),userId:this.client_.getUserId(),sdkAppId:this.client_.getSDKAppId()}),this.uplinkConnection_=null,this.uplinkNetworkQuality_=0,this.uplinkRTT_=0,this.uplinkLoss_=0,this.downlinkNetworkQuality_=0,this.downlinkRTT_=0,this.downlinkLoss_=0,this.downlinkPrevStatMap_=new Map,this.downlinkLossAndRTTMap_=new Map,this.interval_=-1,this.emitter_=new FA,this.initialize()}var t,i;return c(e,[{key:"uplinkNetworkQuality",get:function(){return this.uplinkNetworkQuality_},set:function(e){e!==this.uplinkNetworkQuality_&&this.log_.info("uplink network quality change ".concat(this.uplinkNetworkQuality," -> ").concat(e,", rtt: ").concat(this.uplinkRTT_,", loss: ").concat(this.uplinkLoss_)),this.uplinkNetworkQuality_=e}},{key:"downlinkNetworkQuality",get:function(){return this.downlinkNetworkQuality_},set:function(e){if(e!==this.downlinkNetworkQuality_){var t=this.getAverageLossAndRTT(T(this.downlinkLossAndRTTMap_.values())),n=t.rtt,i=t.loss;this.log_.info("downlink network quality change ".concat(this.downlinkNetworkQuality," -> ").concat(e,", rtt: ").concat(n,", loss: ").concat(i))}this.downlinkNetworkQuality_=e}},{key:"initialize",value:function(){var e=this;this.signalChannel_.on(eD.UPLINK_NETWORK_STATS,(function(t){e.handleUplinkNetworkQuality(t)})),this.signalChannel_.on(WP,this.handleSignalConnectionStateChange.bind(this)),this.start()}},{key:"handleUplinkNetworkQuality",value:function(e){if(!this.uplinkConnection_)return this.uplinkNetworkQuality=0,this.uplinkLoss_=0,void(this.uplinkRTT_=0);var t=this.uplinkConnection_.getPeerConnection();if(t&&this.isPeerConnectionDisconnected(t))return this.uplinkNetworkQuality=6,this.uplinkLoss_=0,void(this.uplinkRTT_=0);if(0===e.data.code){var n=e.data.data,i=n.expectAudPkg+n.expectVidPkg,r=n.recvAudPkg+n.recvVidPkg,a=i-r,o=n.delay;if(o&&this.updateDelay(o),0===i&&0===r)return;this.uplinkLoss_=a<=0?0:Math.round(a/i*100),this.uplinkRTT_=n.rtt,this.uplinkNetworkQuality=this.getNetworkQuality(this.uplinkLoss_,this.uplinkRTT_)}}},{key:"handleDownlinkNetworkQuality",value:(i=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l,h,p,f,m,v,_=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connections_&&0!==this.connections_.size){e.next=3;break}return this.downlinkNetworkQuality=0,e.abrupt("return");case 3:if(t=T(this.connections_.values()),i=t.filter((function(e){return e.getPeerConnection()&&e.getPeerConnection().connectionState===ZT})),t.filter((function(e){return e.getPeerConnection()&&_.isPeerConnectionDisconnected(e.getPeerConnection())})).length!==t.length){e.next=9;break}return this.downlinkNetworkQuality=6,e.abrupt("return");case 9:r=0;case 10:if(!(r<i.length)){e.next=31;break}return a=i[r].getPeerConnection(),e.next=14,this.getStat(a);case 14:if(o=e.sent,s=o.rtt,c=o.totalPacketsLost,u=o.totalPacketsReceived,this.downlinkPrevStatMap_.has(a)){e.next=21;break}return this.downlinkPrevStatMap_.set(a,{totalPacketsLost:c,totalPacketsReceived:u}),e.abrupt("continue",28);case 21:d=0,l=this.downlinkPrevStatMap_.get(a),h=c-l.totalPacketsLost,p=u-l.totalPacketsReceived,d=h<=0||p<0?0:Math.round(h/(h+p)*100),this.downlinkPrevStatMap_.set(a,{totalPacketsLost:c,totalPacketsReceived:u}),this.downlinkLossAndRTTMap_.set(a,{rtt:s,loss:d,userId:i[r].getUserId()});case 28:r++,e.next=10;break;case 31:if(T(this.downlinkPrevStatMap_.keys()).forEach((function(e){_.isPeerConnectionDisconnected(e)&&(_.downlinkPrevStatMap_.delete(e),_.downlinkLossAndRTTMap_.delete(e))})),0!==this.downlinkLossAndRTTMap_.size){e.next=34;break}return e.abrupt("return");case 34:f=this.getAverageLossAndRTT(T(this.downlinkLossAndRTTMap_.values())),m=f.rtt,v=f.loss,this.downlinkRTT_=m,this.downlinkLoss_=v,this.downlinkNetworkQuality=this.getNetworkQuality(v,m);case 38:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getStat",value:(t=a(n().mark((function e(t){var i,r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i={rtt:0,totalPacketsLost:0,totalPacketsReceived:0},t&&SO()){e.next=3;break}return e.abrupt("return",i);case 3:r=t.getReceivers(),e.prev=4,a=0;case 6:if(!(a<r.length)){e.next=15;break}return o=r[a],e.next=10,o.getStats();case 10:e.sent.forEach((function(e){"candidate-pair"===e.type&&gA(e.currentRoundTripTime)&&(i.rtt=Math.round(1e3*e.currentRoundTripTime)),"inbound-rtp"!==e.type||e.mediaType!==Uk&&e.mediaType!==Vk||(i.totalPacketsLost+=e.packetsLost,i.totalPacketsReceived+=e.packetsReceived)}));case 12:a++,e.next=6;break;case 15:return e.abrupt("return",i);case 18:return e.prev=18,e.t0=e.catch(4),e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,null,[[4,18]])}))),function(e){return t.apply(this,arguments)})},{key:"getAverageLossAndRTT",value:function(e){var t={rtt:0,loss:0};return Array.isArray(e)&&e.length>0&&(e.forEach((function(e){t.rtt+=e.rtt,t.loss+=e.loss})),Object.keys(t).forEach((function(n){t[n]=Math.round(t[n]/e.length)}))),t}},{key:"getNetworkQuality",value:function(e,t){return e>50||t>500?5:e>30||t>350?4:e>20||t>200?3:e>10||t>100?2:e>=0||t>=0?1:0}},{key:"handleSignalConnectionStateChange",value:function(e){e.state===KP?(this.uplinkRTT_=0,this.uplinkLoss_=0,this.uplinkNetworkQuality=6):e.state===$P&&6===this.uplinkNetworkQuality&&(this.uplinkNetworkQuality=5)}},{key:"handleUplinkConnectionStateChange",value:function(e){var t=e.state;t===zT?(this.uplinkLoss_=0,this.uplinkRTT_=0,this.uplinkNetworkQuality=6):t===qT&&6===this.uplinkNetworkQuality&&(this.uplinkNetworkQuality=5)}},{key:"isPeerConnectionDisconnected",value:function(e){return!(!e||e.connectionState!==YT&&e.connectionState!==XT&&e.connectionState!==$T)}},{key:"setUplinkConnection",value:function(e){this.uplinkConnection_=e,this.uplinkConnection_?this.uplinkConnection_.on(jO.CONNECTION_STATE_CHANGED,this.handleUplinkConnectionStateChange.bind(this)):(this.uplinkNetworkQuality=0,this.uplinkRTT_=0,this.uplinkLoss_=0)}},{key:"start",value:function(){var e=this;-1===this.interval_?(this.log_.info("start network quality calculating"),this.interval_=iO.run(gE,(function(){e.handleDownlinkNetworkQuality(),jA.emit(Ax,{client:e.client_,uplinkNetworkQuality:e.uplinkNetworkQuality,downlinkNetworkQuality:e.downlinkNetworkQuality,uplinkRTT:e.uplinkRTT_,uplinkLoss:e.uplinkLoss_,downlinkRTT:e.downlinkRTT_,downlinkLoss:e.downlinkLoss_,downlinkLossAndRTTMap:e.downlinkLossAndRTTMap_}),e.emitter_.emit(BO.NETWORK_QUALITY,{uplinkNetworkQuality:e.uplinkNetworkQuality,downlinkNetworkQuality:e.downlinkNetworkQuality,uplinkRTT:e.uplinkRTT_,uplinkLoss:e.uplinkLoss_,downlinkRTT:e.downlinkRTT_,downlinkLoss:e.downlinkLoss_})}),{delay:2e3})):this.log_.info("network quality calculating is already started")}},{key:"stop",value:function(){this.log_.info("stop network quality calculating"),-1!==this.interval_&&(iO.clearTask(this.interval_),this.interval_=-1),this.downlinkLossAndRTTMap_.clear(),this.downlinkPrevStatMap_.clear()}},{key:"on",value:function(e,t){this.emitter_.on(e,t)}},{key:"updateDelay",value:function(e){var t=this;e.forEach((function(e){var n=e.srcTinyId,i=e.videoDelay,r=e.audioDelay,a=t.connections_.get(n);a&&a.setDelay({videoDelay:i,audioDelay:r})}))}}]),e}(),$O=function(){function e(t){o(this,e),this.log_=Vx.createLogger({id:t.client.getUserId(),userId:t.client.getUserId(),sdkAppId:t.client.getSDKAppId()}),this.localStream_=null,this.prevDevices_=[],this.initialize()}var t,i;return c(e,[{key:"initialize",value:function(){navigator.mediaDevices&&(this.onDeviceChange=this.onDeviceChange.bind(this),navigator.mediaDevices.addEventListener("devicechange",this.onDeviceChange))}},{key:"destroy",value:function(){navigator.mediaDevices&&navigator.mediaDevices.removeEventListener("devicechange",this.onDeviceChange)}},{key:"onDeviceChange",value:(i=a(n().mark((function e(){var t,i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.localStream_&&this.localStream_.getMediaStream()&&!this.localStream_.getScreen()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,nN();case 4:t=e.sent,i=t.filter((function(e){return a.prevDevices_.findIndex((function(t){var n=t.deviceId;return e.deviceId===n}))<0})),r=this.prevDevices_.filter((function(e){return t.findIndex((function(t){var n=t.deviceId;return e.deviceId===n}))<0})),i.length>0&&this.handleDeviceAdded(this.prevDevices_,i),r.length>0&&this.handleDeviceRemoved(t,r),this.prevDevices_=t;case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"setLocalStream",value:(t=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return e.next=3,nN();case 3:this.prevDevices_=e.sent;case 4:this.localStream_=t;case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"handleDeviceAdded",value:function(e,t){var n,i;if(this.localStream_){this.log_.warn("devicesAdded: ".concat(JSON.stringify(t))),this.localStream_.updateDeviceIdInUse();var r=t.filter((function(e){return e.kind===tT})),a=t.filter((function(e){return e.kind===eT})),o=e.filter((function(e){return e.kind===tT})),s=e.filter((function(e){return e.kind===eT})),c=r.length>0&&0===o.length&&"live"!==(null===(n=this.localStream_.getVideoTrack())||void 0===n?void 0:n.readyState),u=a.length>0&&0===s.length&&"live"!==(null===(i=this.localStream_.getAudioTrack())||void 0===i?void 0:i.readyState);if(u&&c)return this.log_.info("new microphone and camera detected, but there was no device before."),void this.localStream_.recoverCapture({audio:!0,video:!0,cameraId:r[0].deviceId,microphoneId:a[0].deviceId});c&&(this.log_.info("new camera detected, but there was no camera before."),this.localStream_.recoverCapture({audio:!1,video:!0,cameraId:r[0].deviceId})),u&&(this.log_.info("new microphone detected, but there was no microphone before."),this.localStream_.recoverCapture({audio:!0,video:!1,microphoneId:a[0].deviceId}))}}},{key:"handleDeviceRemoved",value:function(e,t){if(this.localStream_){this.log_.warn("devicesRemoved: ".concat(JSON.stringify(t))),this.localStream_.updateDeviceIdInUse();var n=!1,i=!1,r=this.localStream_.getCameraId(),a=this.localStream_.getMicrophoneId();if(a===hE){var o=this.localStream_.getMicrophoneGroupId(),s=e.filter((function(e){return e.deviceId===hE&&e.kind===eT}))[0];s&&s.groupId!==o&&(i=!0)}if(t.forEach((function(e){var t=e.deviceId;r.length>0&&t===r?n=!0:a.length>0&&t===a&&(i=!0)})),n&&i)return this.log_.warn("current camera and microphone in use is lost, cameraId: ".concat(r,", microphoneId: ").concat(a)),void((this.localStream_.getAudio()||this.localStream_.getVideo())&&this.localStream_.recoverCapture({video:!0,audio:!0}));n&&(this.log_.warn("current camera in use is lost, deviceId: ".concat(r)),this.localStream_.getVideo()&&this.localStream_.recoverCapture({video:!0,audio:!1})),i&&(this.log_.warn("current microphone in use is lost, deviceId: ".concat(a)),this.localStream_.getAudio()&&this.localStream_.recoverCapture({video:!1,audio:!0}))}}}]),e}();function YO(){return YO=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!RO()&&!wO()){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,eN();case 4:return t=e.sent,e.abrupt("return",t.filter((function(e){return e.kind===tT})).map((function(e,t){var n=e.label;e.label||(n="camera_"+t);var i={label:n,deviceId:e.deviceId,kind:e.kind};return e.groupId&&(i.groupId=e.groupId),e.getCapabilities&&(i.getCapabilities=function(){return e.getCapabilities()}),i})));case 6:case"end":return e.stop()}}),e)}))),YO.apply(this,arguments)}var ZO=new Set;function eN(){return tN.apply(this,arguments)}function tN(){return(tN=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!RO()&&!wO()){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,navigator.mediaDevices.enumerateDevices();case 4:return(t=e.sent).forEach((function(e){ZO.add("".concat(e.deviceId,"_").concat(e.kind))})),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nN(){return iN.apply(this,arguments)}function iN(){return iN=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eN();case 2:return t=e.sent,e.abrupt("return",t.filter((function(e){return e.kind!==eT||e.deviceId!=pE})).map((function(e,t){var n=e.label;e.label||(n=e.kind+"_"+t);var i={label:n,deviceId:e.deviceId,kind:e.kind};return e.groupId&&(i.groupId=e.groupId),e.getCapabilities&&(i.getCapabilities=function(){return e.getCapabilities()}),i})));case 4:case"end":return e.stop()}}),e)}))),iN.apply(this,arguments)}function rN(){return aN.apply(this,arguments)}function aN(){return aN=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eN();case 2:return t=e.sent,e.abrupt("return",t.filter((function(e){return e.kind===eT&&e.deviceId!==pE})).map((function(e,t){var n=e.label;e.label||(n="microphone_"+t);var i={label:n,deviceId:e.deviceId,kind:e.kind};return e.groupId&&(i.groupId=e.groupId),e.getCapabilities&&(i.getCapabilities=function(){return e.getCapabilities()}),i})));case 4:case"end":return e.stop()}}),e)}))),aN.apply(this,arguments)}function oN(){return oN=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eN();case 2:return t=e.sent,e.abrupt("return",t.filter((function(e){return"audiooutput"===e.kind})).map((function(e,t){var n=e.label;e.label||(n="speaker_"+t);var i={label:n,deviceId:e.deviceId,kind:e.kind};return e.groupId&&(i.groupId=e.groupId),i})));case 4:case"end":return e.stop()}}),e)}))),oN.apply(this,arguments)}function sN(e){var t;if(e instanceof CanvasCaptureMediaStreamTrack)return!1;if(!(e instanceof MediaStreamTrack))return!1;var n=e.label.toLocaleLowerCase();if(n.includes("camera")||n.includes("webcam"))return!0;var i="".concat(null===(t=e.getSettings())||void 0===t?void 0:t.deviceId,"_").concat(tT);return!!ZO.has(i)}function cN(e,t){return uN.apply(this,arguments)}function uN(){return(uN=a(n().mark((function e(t,i){var r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rN();case 2:if(r=e.sent,(null==(a=r.find((function(e){return e.deviceId===hE})))?void 0:a.groupId)!==t||a.label!==i){e.next=6;break}return e.abrupt("return",!0);case 6:return e.abrupt("return",!1);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var dN,lN=Rn.exports,hN=sn,pN=hn,fN=du,mN=Gc,vN=V,_N=ft,gN=function(e,t,n,i){try{return i?t(pN(n)[0],n[1]):t(n)}catch(IQ){fN(e,"throw",IQ)}},yN=qc,SN=Ll,bN=Fi,kN=ac,TN=ou,IN=Zc,EN=Array,wN=function(e){var t=_N(e),n=SN(this),i=arguments.length,r=i>1?arguments[1]:void 0,a=void 0!==r;a&&(r=mN(r,i>2?arguments[2]:void 0));var o,s,c,u,d,l,h=IN(t),p=0;if(!h||this===EN&&yN(h))for(o=bN(t),s=n?new this(o):EN(o);o>p;p++)l=a?r(t[p],p):t[p],kN(s,p,l);else for(d=(u=TN(t,h)).next,s=n?new this:[];!(c=vN(d,u)).done;p++)l=a?gN(u,r,[c.value,p],!0):c.value,kN(s,p,l);return s.length=p,s},RN=ie,CN=2147483647,AN=/[^\0-\u007E]/,xN=/[.\u3002\uFF0E\uFF61]/g,PN="Overflow: input needs wider integers to process",DN=RangeError,MN=RN(xN.exec),ON=Math.floor,NN=String.fromCharCode,LN=RN("".charCodeAt),UN=RN([].join),VN=RN([].push),FN=RN("".replace),jN=RN("".split),BN=RN("".toLowerCase),HN=function(e){return e+22+75*(e<26)},GN=function(e,t,n){var i=0;for(e=n?ON(e/700):e>>1,e+=ON(e/t);e>455;)e=ON(e/35),i+=36;return ON(i+36*e/(e+38))},zN=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=LN(e,n++);if(r>=55296&&r<=56319&&n<i){var a=LN(e,n++);56320==(64512&a)?VN(t,((1023&r)<<10)+(1023&a)+65536):(VN(t,r),n--)}else VN(t,r)}return t}(e);var n,i,r=e.length,a=128,o=0,s=72;for(n=0;n<e.length;n++)(i=e[n])<128&&VN(t,NN(i));var c=t.length,u=c;for(c&&VN(t,"-");u<r;){var d=CN;for(n=0;n<e.length;n++)(i=e[n])>=a&&i<d&&(d=i);var l=u+1;if(d-a>ON((CN-o)/l))throw DN(PN);for(o+=(d-a)*l,a=d,n=0;n<e.length;n++){if((i=e[n])<a&&++o>CN)throw DN(PN);if(i==a){for(var h=o,p=36;;){var f=p<=s?1:p>=s+26?26:p-s;if(h<f)break;var m=h-f,v=36-f;VN(t,NN(HN(f+m%v))),h=ON(m/v),p+=36}VN(t,NN(HN(h))),s=GN(o,l,u==c),o=0,u++}}o++,a++}return UN(t,"")},WN=Rr,JN=O,qN=wm,KN=P,QN=Gc,XN=ie,$N=Ei,YN=function(e,t,n){return n.get&&lN(n.get,t,{getter:!0}),n.set&&lN(n.set,t,{setter:!0}),hN.f(e,t,n)},ZN=Ru,eL=_t,tL=fP,nL=wN,iL=lc,rL=Dd.codeAt,aL=function(e){var t,n,i=[],r=jN(FN(BN(e),xN,"."),".");for(t=0;t<r.length;t++)n=r[t],VN(i,MN(AN,n)?"xn--"+zN(n):n);return UN(i,".")},oL=Td,sL=Ko,cL=ul,uL=Jv,dL=ci,lL=dL.set,hL=dL.getterFor("URL"),pL=uL.URLSearchParams,fL=uL.getState,mL=KN.URL,vL=KN.TypeError,_L=KN.parseInt,gL=Math.floor,yL=Math.pow,SL=XN("".charAt),bL=XN(/./.exec),kL=XN([].join),TL=XN(1..toString),IL=XN([].pop),EL=XN([].push),wL=XN("".replace),RL=XN([].shift),CL=XN("".split),AL=XN("".slice),xL=XN("".toLowerCase),PL=XN([].unshift),DL="Invalid scheme",ML="Invalid host",OL="Invalid port",NL=/[a-z]/i,LL=/[\d+-.a-z]/i,UL=/\d/,VL=/^0x/i,FL=/^[0-7]+$/,jL=/^\d+$/,BL=/^[\da-f]+$/i,HL=/[\0\t\n\r #%/:<>?@[\\\]^|]/,GL=/[\0\t\n\r #/:<>?@[\\\]^|]/,zL=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,WL=/[\t\n\r]/g,JL=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)PL(t,e%256),e=gL(e/256);return kL(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=a),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=TL(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},qL={},KL=tL({},qL,{" ":1,'"':1,"<":1,">":1,"`":1}),QL=tL({},KL,{"#":1,"?":1,"{":1,"}":1}),XL=tL({},QL,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$L=function(e,t){var n=rL(e,0);return n>32&&n<127&&!eL(t,e)?e:encodeURIComponent(e)},YL={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ZL=function(e,t){var n;return 2==e.length&&bL(NL,SL(e,0))&&(":"==(n=SL(e,1))||!t&&"|"==n)},eU=function(e){var t;return e.length>1&&ZL(AL(e,0,2))&&(2==e.length||"/"===(t=SL(e,2))||"\\"===t||"?"===t||"#"===t)},tU=function(e){return"."===e||"%2e"===xL(e)},nU={},iU={},rU={},aU={},oU={},sU={},cU={},uU={},dU={},lU={},hU={},pU={},fU={},mU={},vU={},_U={},gU={},yU={},SU={},bU={},kU={},TU=function(e,t,n){var i,r,a,o=oL(e);if(t){if(r=this.parse(o))throw vL(r);this.searchParams=null}else{if(void 0!==n&&(i=new TU(n,!0)),r=this.parse(o,null,i))throw vL(r);(a=fL(new pL)).bindURL(this),this.searchParams=a}};TU.prototype={type:"URL",parse:function(e,t,n){var i,r,a,o,s,c=this,u=t||nU,d=0,l="",h=!1,p=!1,f=!1;for(e=oL(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=wL(e,zL,"")),e=wL(e,WL,""),i=nL(e);d<=i.length;){switch(r=i[d],u){case nU:if(!r||!bL(NL,r)){if(t)return DL;u=rU;continue}l+=xL(r),u=iU;break;case iU:if(r&&(bL(LL,r)||"+"==r||"-"==r||"."==r))l+=xL(r);else{if(":"!=r){if(t)return DL;l="",u=rU,d=0;continue}if(t&&(c.isSpecial()!=eL(YL,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,t)return void(c.isSpecial()&&YL[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=mU:c.isSpecial()&&n&&n.scheme==c.scheme?u=aU:c.isSpecial()?u=uU:"/"==i[d+1]?(u=oU,d++):(c.cannotBeABaseURL=!0,EL(c.path,""),u=SU)}break;case rU:if(!n||n.cannotBeABaseURL&&"#"!=r)return DL;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=iL(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=kU;break}u="file"==n.scheme?mU:sU;continue;case aU:if("/"!=r||"/"!=i[d+1]){u=sU;continue}u=dU,d++;break;case oU:if("/"==r){u=lU;break}u=yU;continue;case sU:if(c.scheme=n.scheme,r==dN)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=iL(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=cU;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=iL(n.path),c.query="",u=bU;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=iL(n.path),c.path.length--,u=yU;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=iL(n.path),c.query=n.query,c.fragment="",u=kU}break;case cU:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=yU;continue}u=lU}else u=dU;break;case uU:if(u=dU,"/"!=r||"/"!=SL(l,d+1))continue;d++;break;case dU:if("/"!=r&&"\\"!=r){u=lU;continue}break;case lU:if("@"==r){h&&(l="%40"+l),h=!0,a=nL(l);for(var m=0;m<a.length;m++){var v=a[m];if(":"!=v||f){var _=$L(v,XL);f?c.password+=_:c.username+=_}else f=!0}l=""}else if(r==dN||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==l)return"Invalid authority";d-=nL(l).length+1,l="",u=hU}else l+=r;break;case hU:case pU:if(t&&"file"==c.scheme){u=_U;continue}if(":"!=r||p){if(r==dN||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==l)return ML;if(t&&""==l&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(l))return o;if(l="",u=gU,t)return;continue}"["==r?p=!0:"]"==r&&(p=!1),l+=r}else{if(""==l)return ML;if(o=c.parseHost(l))return o;if(l="",u=fU,t==pU)return}break;case fU:if(!bL(UL,r)){if(r==dN||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=l){var g=_L(l,10);if(g>65535)return OL;c.port=c.isSpecial()&&g===YL[c.scheme]?null:g,l=""}if(t)return;u=gU;continue}return OL}l+=r;break;case mU:if(c.scheme="file","/"==r||"\\"==r)u=vU;else{if(!n||"file"!=n.scheme){u=yU;continue}if(r==dN)c.host=n.host,c.path=iL(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=iL(n.path),c.query="",u=bU;else{if("#"!=r){eU(kL(iL(i,d),""))||(c.host=n.host,c.path=iL(n.path),c.shortenPath()),u=yU;continue}c.host=n.host,c.path=iL(n.path),c.query=n.query,c.fragment="",u=kU}}break;case vU:if("/"==r||"\\"==r){u=_U;break}n&&"file"==n.scheme&&!eU(kL(iL(i,d),""))&&(ZL(n.path[0],!0)?EL(c.path,n.path[0]):c.host=n.host),u=yU;continue;case _U:if(r==dN||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&ZL(l))u=yU;else if(""==l){if(c.host="",t)return;u=gU}else{if(o=c.parseHost(l))return o;if("localhost"==c.host&&(c.host=""),t)return;l="",u=gU}continue}l+=r;break;case gU:if(c.isSpecial()){if(u=yU,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=dN&&(u=yU,"/"!=r))continue}else c.fragment="",u=kU;else c.query="",u=bU;break;case yU:if(r==dN||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(s=xL(s=l))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||EL(c.path,"")):tU(l)?"/"==r||"\\"==r&&c.isSpecial()||EL(c.path,""):("file"==c.scheme&&!c.path.length&&ZL(l)&&(c.host&&(c.host=""),l=SL(l,0)+":"),EL(c.path,l)),l="","file"==c.scheme&&(r==dN||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)RL(c.path);"?"==r?(c.query="",u=bU):"#"==r&&(c.fragment="",u=kU)}else l+=$L(r,QL);break;case SU:"?"==r?(c.query="",u=bU):"#"==r?(c.fragment="",u=kU):r!=dN&&(c.path[0]+=$L(r,qL));break;case bU:t||"#"!=r?r!=dN&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":$L(r,qL)):(c.fragment="",u=kU);break;case kU:r!=dN&&(c.fragment+=$L(r,KL))}d++}},parseHost:function(e){var t,n,i;if("["==SL(e,0)){if("]"!=SL(e,e.length-1))return ML;if(t=function(e){var t,n,i,r,a,o,s,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,h=function(){return SL(e,l)};if(":"==h()){if(":"!=SL(e,1))return;l+=2,d=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&bL(BL,h());)t=16*t+_L(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;l++}if(!bL(UL,h()))return;for(;bL(UL,h());){if(a=_L(h(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;l++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(o=u-d,u=7;0!=u&&o>0;)s=c[u],c[u--]=c[d+o-1],c[d+--o]=s;else if(8!=u)return;return c}(AL(e,1,-1)),!t)return ML;this.host=t}else if(this.isSpecial()){if(e=aL(e),bL(HL,e))return ML;if(t=function(e){var t,n,i,r,a,o,s,c=CL(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(a=10,r.length>1&&"0"==SL(r,0)&&(a=bL(VL,r)?16:8,r=AL(r,8==a?1:2)),""===r)o=0;else{if(!bL(10==a?jL:8==a?FL:BL,r))return e;o=_L(r,a)}EL(n,o)}for(i=0;i<t;i++)if(o=n[i],i==t-1){if(o>=yL(256,5-t))return null}else if(o>255)return null;for(s=IL(n),i=0;i<n.length;i++)s+=n[i]*yL(256,3-i);return s}(e),null===t)return ML;this.host=t}else{if(bL(GL,e))return ML;for(t="",n=nL(e),i=0;i<n.length;i++)t+=$L(n[i],qL);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return eL(YL,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&ZL(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=JL(r),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?o[0]:o.length?"/"+kL(o,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw vL(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new IU(e.path[0]).origin}catch(IQ){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+JL(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(oL(e)+":",nU)},getUsername:function(){return this.username},setUsername:function(e){var t=nL(oL(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=$L(t[n],XL)}},getPassword:function(){return this.password},setPassword:function(e){var t=nL(oL(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=$L(t[n],XL)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?JL(e):JL(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,hU)},getHostname:function(){var e=this.host;return null===e?"":JL(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,pU)},getPort:function(){var e=this.port;return null===e?"":oL(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=oL(e))?this.port=null:this.parse(e,fU))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+kL(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,gU))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=oL(e))?this.query=null:("?"==SL(e,0)&&(e=AL(e,1)),this.query="",this.parse(e,bU)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=oL(e))?("#"==SL(e,0)&&(e=AL(e,1)),this.fragment="",this.parse(e,kU)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var IU=function(e){var t=ZN(this,EU),n=cL(arguments.length,1)>1?arguments[1]:void 0,i=lL(t,new TU(e,!1,n));JN||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},EU=IU.prototype,wU=function(e,t){return{get:function(){return hL(this)[e]()},set:t&&function(e){return hL(this)[t](e)},configurable:!0,enumerable:!0}};if(JN&&(YN(EU,"href",wU("serialize","setHref")),YN(EU,"origin",wU("getOrigin")),YN(EU,"protocol",wU("getProtocol","setProtocol")),YN(EU,"username",wU("getUsername","setUsername")),YN(EU,"password",wU("getPassword","setPassword")),YN(EU,"host",wU("getHost","setHost")),YN(EU,"hostname",wU("getHostname","setHostname")),YN(EU,"port",wU("getPort","setPort")),YN(EU,"pathname",wU("getPathname","setPathname")),YN(EU,"search",wU("getSearch","setSearch")),YN(EU,"searchParams",wU("getSearchParams")),YN(EU,"hash",wU("getHash","setHash"))),$N(EU,"toJSON",(function(){return hL(this).serialize()}),{enumerable:!0}),$N(EU,"toString",(function(){return hL(this).serialize()}),{enumerable:!0}),mL){var RU=mL.createObjectURL,CU=mL.revokeObjectURL;RU&&$N(IU,"createObjectURL",QN(RU,mL)),CU&&$N(IU,"revokeObjectURL",QN(CU,mL))}sL(IU,"URL"),WN({global:!0,constructor:!0,forced:!qN,sham:!JN},{URL:IU});var AU,xU,PU=new Blob(["class VolumeMeter extends AudioWorkletProcessor{constructor(){super();this.volume=0;this.intervalTime=200;this.tick=this.intervalTime;this.isStop=false;this.port.onmessage=event=>{const{data}=event;switch(data.name){case'setIntervalTime':this.intervalTime=data.intervalTime;break;case'stop':this.isStop=true;break}}}process(inputs){const input=inputs[0];if(this.isStop){return false}if(input.length>0){const firstChannel=input[0];let sum=0;let rms;for(let i=0;i<firstChannel.length;++i){sum+=firstChannel[i]*firstChannel[i]}rms=Math.sqrt(sum/firstChannel.length);this.volume=Math.max(rms,this.volume*0.95);this.tick-=firstChannel.length;if(this.tick<0){this.tick+=(this.intervalTime/1000)*sampleRate;this.port.postMessage({volume:this.volume})}}return true}}registerProcessor('volume-meter',VolumeMeter);"],{type:"application/javascript"}),DU=!1,MU=function(){function e(t){o(this,e),this.context_=t.context,this.addModuleToContext()}var t;return c(e,[{key:"addModuleToContext",value:(t=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.context_.audioWorklet.addModule(URL.createObjectURL(PU));case 3:Vx.info("worklet addModule success"),jA.emit(Px),DU=!0,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),Vx.info("worklet addModule catch error. ".concat(e.t0.message)),jA.emit(Dx);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return t.apply(this,arguments)})},{key:"initWorkletSuccess",get:function(){return DU}}]),e}(),OU=0,NU=function(){function e(t){o(this,e);var n=t.track,i=t.log,r=t.stream;this.volume_=0,this.log_=i,this.track_=n,this.stream_=r,AU||(AU=PA()),this.audioCtx_=AU,this.destination_=this.audioCtx_.destination;var a=new MediaStream;a.addTrack(this.track_),this.streamSource_=this.audioCtx_.createMediaStreamSource(a),this.audioWorkletNode_=null,this.scriptProcessorNode_=null,this.interval_=200,jA.on(xx,this.resume,this),jA.on(ix,this.handleAudioLevelInterval,this),MA?(jA.on(Px,this.initAudioWorklet,this),jA.on(Dx,this.initScriptProcessor,this),this.preload()):this.initScriptProcessor(),OU+=1}return c(e,[{key:"preload",value:function(){xU?xU.initWorkletSuccess&&this.initAudioWorklet():xU=new MU({context:AU})}},{key:"initAudioWorklet",value:function(){var e=this;if(!this.audioWorkletNode_)try{this.audioWorkletNode_=new AudioWorkletNode(this.audioCtx_,"volume-meter"),this.audioWorkletNode_.port.onmessage=function(t){e.volume_=t.data.volume||0},this.streamSource_.connect(this.audioWorkletNode_).connect(this.destination_),this.handleAudioLevelInterval({interval:this.interval_})}catch(IQ){this.log_.warn("load volume meter failed, load again."),this.initScriptProcessor()}}},{key:"initScriptProcessor",value:function(){var e=this;if(!this.scriptProcessorNode_)try{this.scriptProcessorNode_=this.audioCtx_.createScriptProcessor(2048,1,1),this.scriptProcessorNode_.onaudioprocess=function(t){for(var n=t.inputBuffer.getChannelData(0),i=0,r=0;r<n.length;++r)i+=n[r]*n[r];e.volume_=Math.sqrt(i/n.length)||0},this.streamSource_.connect(this.scriptProcessorNode_),this.scriptProcessorNode_.connect(this.destination_)}catch(IQ){this.log_.error("volumeMeter init script processor error: "+IQ)}}},{key:"destroy",value:function(){var e;(this.streamSource_&&this.streamSource_.disconnect(),this.scriptProcessorNode_&&(this.scriptProcessorNode_.onaudioprocess=null,this.scriptProcessorNode_.disconnect()),this.audioWorkletNode_&&(this.audioWorkletNode_.port.postMessage({name:"stop"}),this.audioWorkletNode_.port.onmessage=null,this.audioWorkletNode_.disconnect()),this.audioWorkletNode_=null,this.scriptProcessorNode_=null,this.audioCtx_=null,jA.off(xx,this.resume,this),jA.off(ix,this.handleAudioLevelInterval,this),jA.off(Px,this.initAudioWorklet,this),jA.off(Dx,this.initScriptProcessor,this),OU>0&&(OU-=1),0===OU)&&(null===(e=AU)||void 0===e||e.close(),AU=null,xU=null)}},{key:"resume",value:function(){var e;null===(e=AU)||void 0===e||e.resume()}},{key:"getInternalAudioLevel",value:function(){return this.volume_}},{key:"getCalculatedVolume",value:function(){return this.volume_.toFixed(2)}},{key:"handleAudioLevelInterval",value:function(e){var t,n=e.interval;this.interval_=n,null===(t=this.audioWorkletNode_)||void 0===t||t.port.postMessage({name:"setIntervalTime",intervalTime:n})}}]),e}(),LU=function(){function e(t){o(this,e),this.stream_=t.stream,this.userId_=t.stream.getUserId(),this.log_=this.stream_.getLogger(),this.track_=t.track,t.gainedTrack&&(this.gainedTrack_=t.gainedTrack),this.div_=t.div,this.muted_=t.muted,this.outputDeviceId_=t.outputDeviceId,this.volume_=t.volume,this.pausedRetryCount_=5,this.emitter_=new FA,this.initializeElement(),this.state_="NONE",this.volumeMeter_=new NU({stream:this.stream_,track:this.gainedTrack_||this.track_,log:this.log_})}var t,i,r,s;return c(e,[{key:"isPlaying",get:function(){return this.state_===lT}},{key:"initializeElement",value:function(){if(this.isAudioElementInit()){var e=new MediaStream;e.addTrack(this.gainedTrack_||this.track_);var t=document.createElement(Uk);t.srcObject=e,t.muted=this.muted_,t.setAttribute("id","audio_".concat(this.stream_.getId())),t.setAttribute("autoplay","autoplay"),t.setAttribute("playsinline","playsinline"),this.div_.appendChild(t),this.element_=t}this.handleEvents()}},{key:"setMuted",value:function(e){this.element_&&(this.element_.muted=e,this.muted_=e)}},{key:"play",value:(s=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.outputDeviceId_||!this.element_){e.next=3;break}return e.next=3,this.element_.setSinkId(this.outputDeviceId_);case 3:if(this.setVolume(this.volume_),e.prev=4,!this.element_){e.next=8;break}return e.next=8,this.element_.play();case 8:e.next=16;break;case 10:if(e.prev=10,e.t0=e.catch(4),t=sA({key:aR,data:{media:"Audio",error:e.t0}}),this.log_.warn(t),!t.includes("NotAllowedError")){e.next=16;break}throw new kD({code:bD.PLAY_NOT_ALLOWED,message:t});case 16:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return s.apply(this,arguments)})},{key:"handleEvents",value:function(){this.handleElementEvent=this.handleElementEvent.bind(this),this.handleTrackEvent=this.handleTrackEvent.bind(this),this.element_&&(this.element_.addEventListener(Xk,this.handleElementEvent),this.element_.addEventListener(Qk,this.handleElementEvent),this.element_.addEventListener($k,this.handleElementEvent),this.element_.addEventListener(Yk,this.handleElementEvent)),this.track_.addEventListener(Qk,this.handleTrackEvent),this.track_.addEventListener(qk,this.handleTrackEvent),this.track_.addEventListener(Kk,this.handleTrackEvent),this.track_.readyState===Qk&&this.handleTrackEvent({type:Qk}),this.track_.muted&&this.handleTrackEvent({type:qk})}},{key:"handleElementEvent",value:(r=a(n().mark((function e(t){var i,r,a,o,s,c,u,d=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.type,e.t0=i,e.next=e.t0===Xk?4:e.t0===Qk?9:e.t0===$k?12:e.t0===Yk?21:32;break;case 4:return this.log_.info("audio player is playing"),this.state_=lT,jA.emit(sx,{stream:this.stream_}),this.emitter_.emit(qO,{state:this.state_,reason:Xk}),e.abrupt("break",32);case 9:return this.log_.info("audio player is ended"),this.state_!==pT&&(this.state_=pT,this.emitter_.emit(qO,{state:this.state_,reason:Qk})),e.abrupt("break",32);case 12:return this.log_.info("audio player is paused"),this.state_=hT,this.emitter_.emit(qO,{state:this.state_,reason:$k}),(r=this.div_&&document.getElementById(this.div_.id))||this.log_.warn("audio player has been remove, element ID: ".concat(this.div_.id)),a=GC(),this.pausedRetryCount_>0&&(gA(a)&&a<=70||!r)&&(this.resume(),this.pausedRetryCount_--),ZR&&(this.interval_=iO.run((function(){d.element_&&d.state_===hT&&d.resume()}),{delay:3e3})),e.abrupt("break",32);case 21:if(!this.element_||!this.element_.error){e.next=31;break}return o="".concat(DO(),"/").concat(rA().name,"/").concat(rA().version),e.next=25,TQ.getSpeakers();case 25:s=e.sent,c=s[0].label,(u=s.find((function(e){return e.deviceId===d.outputDeviceId_})))&&(c=u.label),this.log_.error("audio player error observed. code: ".concat(this.element_.error.code," message: ").concat(this.element_.error.message," deviceInfo: ").concat(o," speaker: ").concat(c)),lM.uploadEvent("stat-".concat(this.stream_.getType(),"-audio-").concat(wI,"-").concat(this.element_.error.code,"-").concat(o,"-").concat(c),this.element_.error);case 31:return e.abrupt("break",32);case 32:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"handleTrackEvent",value:function(e){var t=e.type;switch(t){case Qk:this.log_.info("audio track is ended"),this.state_!==pT&&(this.state_=pT,this.emitter_.emit(qO,{state:this.state_,reason:Qk})),jA.emit(wx,{stream:this.stream_,type:t});break;case qk:this.log_.info("audio track is unable to provide media output"),this.stream_.isRemote()||xA(),this.state_!==hT&&(this.state_=hT,this.emitter_.emit(qO,{state:this.state_,reason:qk})),jA.emit(Ex,{stream:this.stream_,type:t});break;case Kk:this.log_.info("audio track is able to provide media output"),this.state_===hT&&(this.state_=lT,this.emitter_.emit(qO,{state:this.state_,reason:Kk}))}}},{key:"unbindEvents",value:function(){this.element_&&(this.element_.removeEventListener(Xk,this.handleElementEvent),this.element_.removeEventListener(Qk,this.handleElementEvent),this.element_.removeEventListener($k,this.handleElementEvent),this.element_.removeEventListener(Yk,this.handleElementEvent)),this.track_&&(this.track_.removeEventListener(Qk,this.handleTrackEvent),this.track_.removeEventListener(qk,this.handleTrackEvent),this.track_.removeEventListener(Kk,this.handleTrackEvent))}},{key:"setSinkId",value:(i=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.outputDeviceId_===t){e.next=5;break}if(!this.element_){e.next=4;break}return e.next=4,this.element_.setSinkId(t);case 4:this.outputDeviceId_=t;case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"setVolume",value:function(e){this.element_&&(this.log_.info("audioElement setVolume to : ".concat(e)),this.element_.volume=e)}},{key:"getAudioLevel",value:function(){return this.volumeMeter_.getCalculatedVolume()}},{key:"getInternalAudioLevel",value:function(){return this.volumeMeter_.getInternalAudioLevel()}},{key:"stop",value:function(){this.unbindEvents(),this.element_&&(this.div_.removeChild(this.element_),this.element_.srcObject=null,this.element_=null),this.volumeMeter_&&(this.volumeMeter_.destroy(),this.volumeMeter_=null),this.interval_>0&&iO.clearTask(this.interval_)}},{key:"resume",value:(t=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.volumeMeter_&&this.volumeMeter_.resume(),!this.element_){e.next=5;break}return e.next=5,this.element_.play();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),t=sA({key:aR,data:{media:"Audio",error:e.t0}}),this.log_.warn(t),!t.includes("NotAllowedError")){e.next=13;break}throw new kD({code:bD.PLAY_NOT_ALLOWED,message:t});case 13:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return t.apply(this,arguments)})},{key:"on",value:function(e,t){this.emitter_.on(e,t)}},{key:"isAudioElementInit",value:function(){return!("15.2"===$C||"15.3"===$C||"15.4"===$C)||"local"!==this.stream_.getType()||!this.muted_||(this.log_.info("audioElement is muted."),!1)}}]),e}(),UU=Mn.PROPER,VU=M,FU=ag,jU=pg.trim;Rr({target:"String",proto:!0,forced:function(e){return VU((function(){return!!FU[e]()||"​…᠎"!=="​…᠎"[e]()||UU&&FU[e].name!==e}))}("trim")},{trim:function(){return jU(this)}});var BU="trtc_autoplay",HU="".concat(BU,"_mask"),GU="".concat(BU,"_wrapper"),zU="".concat(BU,"_header"),WU="".concat(BU,"_content"),JU="".concat(BU,"_action_wrapper"),qU="".concat(BU,"_question"),KU="".concat(BU,"_collapse"),QU="".concat(BU,"_action_confirm"),XU="".concat(BU,"_detail"),$U="#2473E8",YU="dialog",ZU="".concat(YU,"-show"),eV="".concat(YU,"-1"),tV="".concat(YU,"-2"),nV=!1,iV=function(){return!!document.querySelector(".".concat(GU))},rV="".concat(uE,"/").concat(AA()?"zh-cn":"en","/tutorial-21-advanced-auto-play-policy.html"),aV="<br><a href='".concat(rV,"' target='_blank'>").concat(AA()?"其他方案?":"Any other solution?","</a>"),oV="".concat(AA()?"浏览器自动播放策略:在用户与页面产生交互(点击、触摸)之前,浏览器禁止播放有声媒体。该弹窗用于帮助用户恢复音视频播放。".concat(aV):"Autoplay Policy: Before user interacts with the web page (clicking, touching), page will not be allowed to play media with sound. This Dialog is used to help users resume playback. ".concat(aV)),sV=function(){function e(){if(o(this,e),this.dialogNode_=null,this.bodyPosition_="",this.content="音视频播放被浏览器拦截,请点击“恢复播放”。",AA()||(this.content='Media playback failed. Click the "Resume" to resume playback.'),!nV){var t=document.createElement("style");t.innerHTML=".".concat(HU,"{position:fixed;top:0;left:0;right:0;bottom:0;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,0.5);z-index:1500;}.").concat(HU," div:not(.").concat(JU,"){display:block !important;}.").concat(GU,"{padding:14px;background:#fff;border-radius:3px;box-shadow:0px 3px 15px #434343;border:1px solid #d1cfcf;max-width:500px;}.").concat(GU," a{color:").concat($U,";}.").concat(zU,"{overflow:hidden;text-overflow:ellipsis;font-size:16px;font-weight:600;}.").concat(WU,"{margin:8px 0;}.").concat(JU,"{width:100%;display:flex !important;align-items:center;justify-content:right;float:right;}.").concat(KU,"{margin-right:auto;cursor:pointer}.").concat(qU,"{height:100%;line-height:16px;cursor:pointer;}.").concat(QU,"{margin-left:8px;color:#fff;background:").concat($U,";padding:4px 12px;outline:none;border:1px solid;border-radius:3px;font-weight:bold;}.").concat(QU,":hover{opacity:0.9;}.").concat(KU,",.").concat(QU,",.").concat(WU,",.").concat(qU,"{font-size:14px;}@media screen and (max-width:750px){.").concat(GU,"{width:80vw;}}"),document.head.appendChild(t),nV=!0}this.showDetail_=!1,this.isCollapseClicked_=!1,this.isQuestionClicked_=!1,this.addDiaLog()}return c(e,[{key:"createDiaLog",value:function(){var e=document.createElement("template");e.innerHTML='<div class="'.concat(HU,"\"><div class='").concat(GU,"'><div class='").concat(zU,"'>").concat(location.host,"</div><div class='").concat(WU,"'>").concat(this.content,"</div><div class='").concat(XU,'\' style="visibility:hidden;width:100%;height:0;font-size:12px;color:gray;">').concat(oV,"</div><div class='").concat(JU,"'></div></div></div>").trim();var t=document.createElement("button");t.className=QU,t.innerText=AA()?"恢复播放":"Resume",t.onclick=this.onConfirm.bind(this);var n=document.createElement("div");n.className=qU,n.innerHTML='<?xml version="1.0" encoding="UTF-8"?>\n <svg class="icon" width="18" height="18" p-id="2030" t="1639646523624" version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">\n <path d="m464 784.35c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z" p-id="2031"/>\n <path d="m512 960c-247.04 0-448-200.96-448-448s200.96-448 448-448 448 200.96 448 448-200.96 448-448 448zm0-831.71c-211.58 0-383.71 172.13-383.71 383.71 0 211.55 172.13 383.71 383.71 383.71 211.55 0 383.71-172.16 383.71-383.71 0-211.58-172.16-383.71-383.71-383.71z" p-id="2032"/>\n <path d="m512 673.7c-17.665 0-32.001-14.336-32.001-31.999v-54.112c0-52.353 40-92.352 75.328-127.65 25.887-25.92 52.672-52.672 52.672-74.017 0-53.343-43.072-96.735-95.999-96.735-53.823 0-95.999 41.536-95.999 94.559 0 17.665-14.336 31.999-32.001 31.999s-32.001-14.336-32.001-31.999c0-87.424 71.775-158.56 160-158.56s160 72.095 160 160.74c0 47.904-36.32 84.192-71.424 119.3-27.84 27.776-56.576 56.512-56.576 82.336v54.112c0 17.665-14.336 32.032-32.001 32.032z" p-id="2033"/>\n </svg>\n ',n.onclick=this.onQuestionClick.bind(this);var i=document.createElement("div");i.className=KU,i.innerText="".concat(AA()?"详情 >":"Detail >"),i.onclick=this.onCollapseClick.bind(this);var r=e.content.firstChild,a=r.querySelector(".".concat(JU));return a.appendChild(i),a.appendChild(n),a.appendChild(t),r}},{key:"addDiaLog",value:function(){iV()||(this.dialogNode_=this.createDiaLog(),document.body.appendChild(this.dialogNode_),this.dialogNode_.onclick=this.onConfirm.bind(this),this.dialogNode_.querySelector(".".concat(GU)).onclick=function(e){return e.stopPropagation()},this.bodyPosition_=document.body.style.position,document.body.style.position="fixed",Vx.info("show autoplay dialog"),lM.uploadEvent({log:ZU}))}},{key:"deleteDiaLog",value:function(){this.dialogNode_&&(document.body.removeChild(this.dialogNode_),document.body.style.position=this.bodyPosition_,this.dialogNode_=null)}},{key:"onConfirm",value:function(){Vx.warn("confirm clicked, try resume stream"),jA.emit(xx),this.deleteDiaLog()}},{key:"onCollapseClick",value:function(){var e=this.dialogNode_.querySelector(".".concat(XU));e.style.visibility="".concat(this.showDetail_?"hidden":"visible"),e.style.height="".concat(this.showDetail_?0:"fit-content"),this.showDetail_=!this.showDetail_,this.isCollapseClicked_||lM.uploadEvent({log:eV}),this.isCollapseClicked_=!0}},{key:"onQuestionClick",value:function(){window.open(rV,"_blank"),this.isQuestionClicked_||lM.uploadEvent({log:tV}),this.isQuestionClicked_=!0}}]),e}(),cV=function(){function e(t){o(this,e),this.stream_=t.stream,this.userId_=t.stream.getUserId(),this.log_=this.stream_.getLogger(),this.track_=t.track,this.div_=t.div,this.muted_=t.muted,this.objectFit_=t.objectFit,this.mirror_=t.mirror,this.emitter_=new FA,this.initializeElement(),this.state_="NONE",this.pausedRetryCount_=5}var t;return c(e,[{key:"isPlaying",get:function(){return this.state_===lT}},{key:"initializeElement",value:function(){var e=new MediaStream;e.addTrack(this.track_);var t=document.createElement(Vk);t.srcObject=e,t.muted=!0;var n="width: 100%; height: 100%; object-fit: ".concat(this.objectFit_,";");this.mirror_&&(n+="transform: scaleX(-1);"),t.setAttribute("id","video_".concat(this.stream_.getId())),t.setAttribute("style",n),t.setAttribute("autoplay","autoplay"),t.setAttribute("playsinline","playsinline"),this.div_&&this.div_.appendChild(t),this.element_=t,this.handleEvents()}},{key:"setRect",value:function(e){var t=e.width,n=e.height;this.element_&&(this.element_.style.width=t+"px",this.element_.style.height=n+"px")}},{key:"setMirror",value:function(e){this.element_&&(this.element_.style.transform=e?"scaleX(-1)":"",this.mirror_=e)}},{key:"setObjectFit",value:function(e){this.element_&&(this.element_.style.objectFit="".concat(e),this.objectFit_=e)}},{key:"play",value:(t=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.element_.play();case 3:e.next=11;break;case 5:if(e.prev=5,e.t0=e.catch(0),t=sA({key:aR,data:{media:"Video",error:e.t0}}),this.log_.warn(t),!t.includes("NotAllowedError")){e.next=11;break}throw new kD({code:bD.PLAY_NOT_ALLOWED,message:t});case 11:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return t.apply(this,arguments)})},{key:"handleEvents",value:function(){this.handleElementEvent=this.handleElementEvent.bind(this),this.handleTrackEvent=this.handleTrackEvent.bind(this),this.element_.addEventListener(Xk,this.handleElementEvent),this.element_.addEventListener(Qk,this.handleElementEvent),this.element_.addEventListener($k,this.handleElementEvent),this.element_.addEventListener(Yk,this.handleElementEvent),this.element_.addEventListener(Zk,this.handleElementEvent),this.track_.addEventListener(Qk,this.handleTrackEvent),this.track_.addEventListener(qk,this.handleTrackEvent),this.track_.addEventListener(Kk,this.handleTrackEvent),this.track_.readyState===Qk&&this.handleTrackEvent({type:Qk}),this.track_.muted&&this.handleTrackEvent({type:qk})}},{key:"handleElementEvent",value:function(e){var t=this;switch(e.type){case Xk:this.log_.info("video player is playing"),this.state_=lT,jA.emit(ox,{stream:this.stream_}),this.emitter_.emit(qO,{state:this.state_,reason:Xk}),this.interval_&&(iO.clearTask(this.interval_),this.interval_=null);break;case Qk:this.log_.info("video player is ended"),this.state_!==pT&&(this.state_=pT,this.emitter_.emit(qO,{state:this.state_,reason:Qk}));break;case $k:this.log_.info("video player is paused"),this.div_&&!document.getElementById(this.div_.id)&&this.log_.warn("video player has been remove, element ID: ".concat(this.div_.id)),this.state_=hT,this.emitter_.emit(qO,{state:this.state_,reason:$k}),this.pausedRetryCount_>0&&!iV()&&(this.log_.info("video player auto resume when video paused"),this.resume(),this.pausedRetryCount_--),ZR&&(this.interval_=iO.run((function(){t.element_&&t.state_===hT&&t.resume()}),{delay:3e3}));break;case Yk:if(this.element_&&this.element_.error){var n="".concat(DO(),"/").concat(rA().name,"/").concat(rA().version);this.log_.error("video player error observed. code: ".concat(this.element_.error.code," message: ").concat(this.element_.error.message," deviceInfo: ").concat(n)),lM.uploadEvent("stat-".concat(this.stream_.getType(),"-video-").concat(wI,"-").concat(this.element_.error.code,"-").concat(n),this.element_.error)}break;case Zk:jA.emit(kx,{stream:this.stream_})}}},{key:"handleTrackEvent",value:function(e){var t=e.type;switch(t){case Qk:this.log_.info("video track is ended"),jA.emit(Ix,{stream:this.stream_,type:t}),this.state_!==pT&&(this.state_=pT,this.emitter_.emit(qO,{state:this.state_,reason:Qk}));break;case qk:this.log_.info("video track is unable to provide media output"),this.stream_.isRemote()||xA(),jA.emit(yx,{stream:this.stream_,type:t}),this.state_!==hT&&(this.state_=hT,this.emitter_.emit(qO,{state:this.state_,reason:qk}));break;case Kk:this.log_.info("video track is able to provide media output"),jA.emit(Sx,{stream:this.stream_}),this.state_===hT&&(this.state_=lT,this.emitter_.emit(qO,{state:this.state_,reason:Kk}))}}},{key:"unbindEvents",value:function(){this.element_&&(this.element_.removeEventListener(Xk,this.handleElementEvent),this.element_.removeEventListener(Qk,this.handleElementEvent),this.element_.removeEventListener($k,this.handleElementEvent),this.element_.removeEventListener(Yk,this.handleElementEvent),this.element_.removeEventListener(Zk,this.handleElementEvent)),this.track_&&(this.track_.removeEventListener(Qk,this.handleTrackEvent),this.track_.removeEventListener(qk,this.handleTrackEvent),this.track_.removeEventListener(Kk,this.handleTrackEvent))}},{key:"stop",value:function(){this.unbindEvents(),this.div_&&this.div_.removeChild(this.element_),this.element_.srcObject=null,this.element_=null,this.interval_&&iO.clearTask(this.interval_)}},{key:"resume",value:function(){return this.play()}},{key:"getVideoFrame",value:function(){var e=document.createElement("canvas");return e.width=this.element_.videoWidth,e.height=this.element_.videoHeight,e.getContext("2d").drawImage(this.element_,0,0),e.toDataURL("image/png")}},{key:"on",value:function(e,t){this.emitter_.on(e,t)}},{key:"getElement",value:function(){return this.element_?this.element_:null}}]),e}(),uV="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,dV=xi,lV=Ui,hV=RangeError,pV=function(e){if(void 0===e)return 0;var t=dV(e),n=lV(t);if(t!==n)throw hV("Wrong length or index");return n},fV=Array,mV=Math.abs,vV=Math.pow,_V=Math.floor,gV=Math.log,yV=Math.LN2,SV={pack:function(e,t,n){var i,r,a,o=fV(n),s=8*n-t-1,c=(1<<s)-1,u=c>>1,d=23===t?vV(2,-24)-vV(2,-77):0,l=e<0||0===e&&1/e<0?1:0,h=0;for((e=mV(e))!=e||Infinity===e?(r=e!=e?1:0,i=c):(i=_V(gV(e)/yV),e*(a=vV(2,-i))<1&&(i--,a*=2),(e+=i+u>=1?d/a:d*vV(2,1-u))*a>=2&&(i++,a/=2),i+u>=c?(r=0,i=c):i+u>=1?(r=(e*a-1)*vV(2,t),i+=u):(r=e*vV(2,u-1)*vV(2,t),i=0));t>=8;)o[h++]=255&r,r/=256,t-=8;for(i=i<<t|r,s+=t;s>0;)o[h++]=255&i,i/=256,s-=8;return o[--h]|=128*l,o},unpack:function(e,t){var n,i=e.length,r=8*i-t-1,a=(1<<r)-1,o=a>>1,s=r-7,c=i-1,u=e[c--],d=127&u;for(u>>=7;s>0;)d=256*d+e[c--],s-=8;for(n=d&(1<<-s)-1,d>>=-s,s+=t;s>0;)n=256*n+e[c--],s-=8;if(0===d)d=1-o;else{if(d===a)return n?NaN:u?-Infinity:Infinity;n+=vV(2,t),d-=o}return(u?-1:1)*n*vV(2,d-t)}},bV=ft,kV=Oi,TV=Fi,IV=function(e){for(var t=bV(this),n=TV(t),i=arguments.length,r=kV(i>1?arguments[1]:void 0,n),a=i>2?arguments[2]:void 0,o=void 0===a?n:kV(a,n);o>r;)t[r++]=e;return t},EV=P,wV=ie,RV=O,CV=uV,AV=Mn,xV=wn,PV=ed,DV=M,MV=Ru,OV=xi,NV=Ui,LV=pV,UV=SV,VV=No,FV=cs,jV=wi.f,BV=sn.f,HV=IV,GV=lc,zV=Ko,WV=AV.PROPER,JV=AV.CONFIGURABLE,qV=ci.get,KV=ci.set,QV="ArrayBuffer",XV="DataView",$V="Wrong index",YV=EV.ArrayBuffer,ZV=YV,eF=ZV&&ZV.prototype,tF=EV.DataView,nF=tF&&tF.prototype,iF=Object.prototype,rF=EV.Array,aF=EV.RangeError,oF=wV(HV),sF=wV([].reverse),cF=UV.pack,uF=UV.unpack,dF=function(e){return[255&e]},lF=function(e){return[255&e,e>>8&255]},hF=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},pF=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},fF=function(e){return cF(e,23,4)},mF=function(e){return cF(e,52,8)},vF=function(e,t){BV(e.prototype,t,{get:function(){return qV(this)[t]}})},_F=function(e,t,n,i){var r=LV(n),a=qV(e);if(r+t>a.byteLength)throw aF($V);var o=qV(a.buffer).bytes,s=r+a.byteOffset,c=GV(o,s,s+t);return i?c:sF(c)},gF=function(e,t,n,i,r,a){var o=LV(n),s=qV(e);if(o+t>s.byteLength)throw aF($V);for(var c=qV(s.buffer).bytes,u=o+s.byteOffset,d=i(+r),l=0;l<t;l++)c[u+l]=d[a?l:t-l-1]};if(CV){var yF=WV&&YV.name!==QV;if(DV((function(){YV(1)}))&&DV((function(){new YV(-1)}))&&!DV((function(){return new YV,new YV(1.5),new YV(NaN),1!=YV.length||yF&&!JV})))yF&&JV&&xV(YV,"name",QV);else{(ZV=function(e){return MV(this,eF),new YV(LV(e))}).prototype=eF;for(var SF,bF=jV(YV),kF=0;bF.length>kF;)(SF=bF[kF++])in ZV||xV(ZV,SF,YV[SF]);eF.constructor=ZV}FV&&VV(nF)!==iF&&FV(nF,iF);var TF=new tF(new ZV(2)),IF=wV(nF.setInt8);TF.setInt8(0,2147483648),TF.setInt8(1,2147483649),!TF.getInt8(0)&&TF.getInt8(1)||PV(nF,{setInt8:function(e,t){IF(this,e,t<<24>>24)},setUint8:function(e,t){IF(this,e,t<<24>>24)}},{unsafe:!0})}else eF=(ZV=function(e){MV(this,eF);var t=LV(e);KV(this,{bytes:oF(rF(t),0),byteLength:t}),RV||(this.byteLength=t)}).prototype,tF=function(e,t,n){MV(this,nF),MV(e,eF);var i=qV(e).byteLength,r=OV(t);if(r<0||r>i)throw aF("Wrong offset");if(r+(n=void 0===n?i-r:NV(n))>i)throw aF("Wrong length");KV(this,{buffer:e,byteLength:n,byteOffset:r}),RV||(this.buffer=e,this.byteLength=n,this.byteOffset=r)},nF=tF.prototype,RV&&(vF(ZV,"byteLength"),vF(tF,"buffer"),vF(tF,"byteLength"),vF(tF,"byteOffset")),PV(nF,{getInt8:function(e){return _F(this,1,e)[0]<<24>>24},getUint8:function(e){return _F(this,1,e)[0]},getInt16:function(e){var t=_F(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=_F(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return pF(_F(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return pF(_F(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return uF(_F(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return uF(_F(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){gF(this,1,e,dF,t)},setUint8:function(e,t){gF(this,1,e,dF,t)},setInt16:function(e,t){gF(this,2,e,lF,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){gF(this,2,e,lF,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){gF(this,4,e,hF,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){gF(this,4,e,hF,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){gF(this,4,e,fF,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){gF(this,8,e,mF,t,arguments.length>2?arguments[2]:void 0)}});zV(ZV,QV),zV(tF,XV);var EF={ArrayBuffer:ZV,DataView:tF},wF=Rr,RF=ie,CF=M,AF=hn,xF=Oi,PF=Ui,DF=Uy,MF=EF.ArrayBuffer,OF=EF.DataView,NF=OF.prototype,LF=RF(MF.prototype.slice),UF=RF(NF.getUint8),VF=RF(NF.setUint8);wF({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:CF((function(){return!new MF(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(LF&&void 0===t)return LF(AF(this),e);for(var n=AF(this).byteLength,i=xF(e,n),r=xF(void 0===t?n:t,n),a=new(DF(this,MF))(PF(r-i)),o=new OF(this),s=new OF(a),c=0;i<r;)VF(s,c++,UF(o,i++));return a}});var FF,jF,BF,HF={exports:{}},GF=uV,zF=O,WF=P,JF=ye,qF=ke,KF=_t,QF=$s,XF=Je,$F=wn,YF=Ei,ZF=sn.f,ej=Re,tj=No,nj=cs,ij=Mt,rj=kt,aj=ci.enforce,oj=ci.get,sj=WF.Int8Array,cj=sj&&sj.prototype,uj=WF.Uint8ClampedArray,dj=uj&&uj.prototype,lj=sj&&tj(sj),hj=cj&&tj(cj),pj=Object.prototype,fj=WF.TypeError,mj=ij("toStringTag"),vj=rj("TYPED_ARRAY_TAG"),_j="TypedArrayConstructor",gj=GF&&!!nj&&"Opera"!==QF(WF.opera),yj=!1,Sj={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},bj={BigInt64Array:8,BigUint64Array:8},kj=function(e){var t=tj(e);if(qF(t)){var n=oj(t);return n&&KF(n,_j)?n.TypedArrayConstructor:kj(t)}},Tj=function(e){if(!qF(e))return!1;var t=QF(e);return KF(Sj,t)||KF(bj,t)};for(FF in Sj)(BF=(jF=WF[FF])&&jF.prototype)?aj(BF).TypedArrayConstructor=jF:gj=!1;for(FF in bj)(BF=(jF=WF[FF])&&jF.prototype)&&(aj(BF).TypedArrayConstructor=jF);if((!gj||!JF(lj)||lj===Function.prototype)&&(lj=function(){throw fj("Incorrect invocation")},gj))for(FF in Sj)WF[FF]&&nj(WF[FF],lj);if((!gj||!hj||hj===pj)&&(hj=lj.prototype,gj))for(FF in Sj)WF[FF]&&nj(WF[FF].prototype,hj);if(gj&&tj(dj)!==hj&&nj(dj,hj),zF&&!KF(hj,mj))for(FF in yj=!0,ZF(hj,mj,{get:function(){return qF(this)?this[vj]:void 0}}),Sj)WF[FF]&&$F(WF[FF],vj,FF);var Ij={NATIVE_ARRAY_BUFFER_VIEWS:gj,TYPED_ARRAY_TAG:yj&&vj,aTypedArray:function(e){if(Tj(e))return e;throw fj("Target is not a typed array")},aTypedArrayConstructor:function(e){if(JF(e)&&(!nj||ej(lj,e)))return e;throw fj(XF(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,i){if(zF){if(n)for(var r in Sj){var a=WF[r];if(a&&KF(a.prototype,e))try{delete a.prototype[e]}catch(IQ){try{a.prototype[e]=t}catch(o){}}}hj[e]&&!n||YF(hj,e,n?t:gj&&cj[e]||t,i)}},exportTypedArrayStaticMethod:function(e,t,n){var i,r;if(zF){if(nj){if(n)for(i in Sj)if((r=WF[i])&&KF(r,e))try{delete r[e]}catch(IQ){}if(lj[e]&&!n)return;try{return YF(lj,e,n?t:gj&&lj[e]||t)}catch(IQ){}}for(i in Sj)!(r=WF[i])||r[e]&&!n||YF(r,e,t)}},getTypedArrayConstructor:kj,isView:function(e){if(!qF(e))return!1;var t=QF(e);return"DataView"===t||KF(Sj,t)||KF(bj,t)},isTypedArray:Tj,TypedArray:lj,TypedArrayPrototype:hj},Ej=P,wj=M,Rj=Du,Cj=Ij.NATIVE_ARRAY_BUFFER_VIEWS,Aj=Ej.ArrayBuffer,xj=Ej.Int8Array,Pj=!Cj||!wj((function(){xj(1)}))||!wj((function(){new xj(-1)}))||!Rj((function(e){new xj,new xj(null),new xj(1.5),new xj(e)}),!0)||wj((function(){return 1!==new xj(new Aj(2),1,void 0).length})),Dj=xi,Mj=RangeError,Oj=function(e){var t=Dj(e);if(t<0)throw Mj("The argument can't be less than 0");return t},Nj=RangeError,Lj=function(e,t){var n=Oj(e);if(n%t)throw Nj("Wrong offset");return n},Uj=$s,Vj=ie("".slice),Fj=Bt,jj=TypeError,Bj=function(e){var t=Fj(e,"number");if("number"==typeof t)throw jj("Can't convert number to bigint");return BigInt(t)},Hj=Gc,Gj=V,zj=Dy,Wj=ft,Jj=Fi,qj=ou,Kj=Zc,Qj=qc,Xj=function(e){return"Big"===Vj(Uj(e),0,3)},$j=Ij.aTypedArrayConstructor,Yj=Bj,Zj=Rr,eB=P,tB=V,nB=O,iB=Pj,rB=Ij,aB=EF,oB=Ru,sB=W,cB=wn,uB=Hx,dB=Ui,lB=pV,hB=Lj,pB=zt,fB=_t,mB=$s,vB=ke,_B=ze,gB=vo,yB=Re,SB=cs,bB=wi.f,kB=function(e){var t,n,i,r,a,o,s,c,u=zj(this),d=Wj(e),l=arguments.length,h=l>1?arguments[1]:void 0,p=void 0!==h,f=Kj(d);if(f&&!Qj(f))for(c=(s=qj(d,f)).next,d=[];!(o=Gj(c,s)).done;)d.push(o.value);for(p&&l>2&&(h=Hj(h,arguments[2])),n=Jj(d),i=new($j(u))(n),r=Xj(i),t=0;n>t;t++)a=p?h(d[t],t):d[t],i[t]=r?Yj(a):+a;return i},TB=$l.forEach,IB=ad,EB=sn,wB=D,RB=Lu,CB=ci.get,AB=ci.set,xB=ci.enforce,PB=EB.f,DB=wB.f,MB=Math.round,OB=eB.RangeError,NB=aB.ArrayBuffer,LB=NB.prototype,UB=aB.DataView,VB=rB.NATIVE_ARRAY_BUFFER_VIEWS,FB=rB.TYPED_ARRAY_TAG,jB=rB.TypedArray,BB=rB.TypedArrayPrototype,HB=rB.aTypedArrayConstructor,GB=rB.isTypedArray,zB="BYTES_PER_ELEMENT",WB="Wrong length",JB=function(e,t){HB(e);for(var n=0,i=t.length,r=new e(i);i>n;)r[n]=t[n++];return r},qB=function(e,t){PB(e,t,{get:function(){return CB(this)[t]}})},KB=function(e){var t;return yB(LB,e)||"ArrayBuffer"==(t=mB(e))||"SharedArrayBuffer"==t},QB=function(e,t){return GB(e)&&!_B(t)&&t in e&&uB(+t)&&t>=0},XB=function(e,t){return t=pB(t),QB(e,t)?sB(2,e[t]):DB(e,t)},$B=function(e,t,n){return t=pB(t),!(QB(e,t)&&vB(n)&&fB(n,"value"))||fB(n,"get")||fB(n,"set")||n.configurable||fB(n,"writable")&&!n.writable||fB(n,"enumerable")&&!n.enumerable?PB(e,t,n):(e[t]=n.value,e)};nB?(VB||(wB.f=XB,EB.f=$B,qB(BB,"buffer"),qB(BB,"byteOffset"),qB(BB,"byteLength"),qB(BB,"length")),Zj({target:"Object",stat:!0,forced:!VB},{getOwnPropertyDescriptor:XB,defineProperty:$B}),HF.exports=function(e,t,n){var i=e.match(/\d+$/)[0]/8,r=e+(n?"Clamped":"")+"Array",a="get"+e,o="set"+e,s=eB[r],c=s,u=c&&c.prototype,d={},l=function(e,t){PB(e,t,{get:function(){return function(e,t){var n=CB(e);return n.view[a](t*i+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var a=CB(e);n&&(r=(r=MB(r))<0?0:r>255?255:255&r),a.view[o](t*i+a.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};VB?iB&&(c=t((function(e,t,n,r){return oB(e,u),RB(vB(t)?KB(t)?void 0!==r?new s(t,hB(n,i),r):void 0!==n?new s(t,hB(n,i)):new s(t):GB(t)?JB(c,t):tB(kB,c,t):new s(lB(t)),e,c)})),SB&&SB(c,jB),TB(bB(s),(function(e){e in c||cB(c,e,s[e])})),c.prototype=u):(c=t((function(e,t,n,r){oB(e,u);var a,o,s,d=0,h=0;if(vB(t)){if(!KB(t))return GB(t)?JB(c,t):tB(kB,c,t);a=t,h=hB(n,i);var p=t.byteLength;if(void 0===r){if(p%i)throw OB(WB);if((o=p-h)<0)throw OB(WB)}else if((o=dB(r)*i)+h>p)throw OB(WB);s=o/i}else s=lB(t),a=new NB(o=s*i);for(AB(e,{buffer:a,byteOffset:h,byteLength:o,length:s,view:new UB(a)});d<s;)l(e,d++)})),SB&&SB(c,jB),u=c.prototype=gB(BB)),u.constructor!==c&&cB(u,"constructor",c),xB(u).TypedArrayConstructor=c,FB&&cB(u,FB,r);var h=c!=s;d[r]=c,Zj({global:!0,constructor:!0,forced:h,sham:!VB},d),zB in c||cB(c,zB,i),zB in u||cB(u,zB,i),IB(r)}):HF.exports=function(){},(0,HF.exports)("Uint8",(function(e){return function(t,n,i){return e(this,t,n,i)}}));var YB=ft,ZB=Oi,eH=Fi,tH=hh,nH=Math.min,iH=[].copyWithin||function(e,t){var n=YB(this),i=eH(n),r=ZB(e,i),a=ZB(t,i),o=arguments.length>2?arguments[2]:void 0,s=nH((void 0===o?i:ZB(o,i))-a,i-r),c=1;for(a<r&&r<a+s&&(c=-1,a+=s-1,r+=s-1);s-- >0;)a in n?n[r]=n[a]:tH(n,r),r+=c,a+=c;return n},rH=Ij,aH=ie(iH),oH=rH.aTypedArray;(0,rH.exportTypedArrayMethod)("copyWithin",(function(e,t){return aH(oH(this),e,t,arguments.length>2?arguments[2]:void 0)}));var sH=$l.every,cH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("every",(function(e){return sH(cH(this),e,arguments.length>1?arguments[1]:void 0)}));var uH=IV,dH=Bj,lH=$s,hH=V,pH=M,fH=Ij.aTypedArray,mH=Ij.exportTypedArrayMethod,vH=ie("".slice);mH("fill",(function(e){var t=arguments.length;fH(this);var n="Big"===vH(lH(this),0,3)?dH(e):+e;return hH(uH,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),pH((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var _H=Fi,gH=Uy,yH=Ij.aTypedArrayConstructor,SH=Ij.getTypedArrayConstructor,bH=function(e){return yH(gH(e,SH(e)))},kH=function(e,t){for(var n=0,i=_H(t),r=new e(i);i>n;)r[n]=t[n++];return r},TH=bH,IH=$l.filter,EH=function(e,t){return kH(TH(e),t)},wH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("filter",(function(e){var t=IH(wH(this),e,arguments.length>1?arguments[1]:void 0);return EH(this,t)}));var RH=$l.find,CH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("find",(function(e){return RH(CH(this),e,arguments.length>1?arguments[1]:void 0)}));var AH=$l.findIndex,xH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("findIndex",(function(e){return AH(xH(this),e,arguments.length>1?arguments[1]:void 0)}));var PH=$l.forEach,DH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("forEach",(function(e){PH(DH(this),e,arguments.length>1?arguments[1]:void 0)}));var MH=zi.includes,OH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("includes",(function(e){return MH(OH(this),e,arguments.length>1?arguments[1]:void 0)}));var NH=zi.indexOf,LH=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("indexOf",(function(e){return NH(LH(this),e,arguments.length>1?arguments[1]:void 0)}));var UH=P,VH=M,FH=ie,jH=Ij,BH=Bs,HH=Mt("iterator"),GH=UH.Uint8Array,zH=FH(BH.values),WH=FH(BH.keys),JH=FH(BH.entries),qH=jH.aTypedArray,KH=jH.exportTypedArrayMethod,QH=GH&&GH.prototype,XH=!VH((function(){QH[HH].call([1])})),$H=!!QH&&QH.values&&QH[HH]===QH.values&&"values"===QH.values.name,YH=function(){return zH(qH(this))};KH("entries",(function(){return JH(qH(this))}),XH),KH("keys",(function(){return WH(qH(this))}),XH),KH("values",YH,XH||!$H,{name:"values"}),KH(HH,YH,XH||!$H,{name:"values"});var ZH=Ij.aTypedArray,eG=Ij.exportTypedArrayMethod,tG=ie([].join);eG("join",(function(e){return tG(ZH(this),e)}));var nG=ol,iG=me,rG=xi,aG=Fi,oG=Rh,sG=Math.min,cG=[].lastIndexOf,uG=!!cG&&1/[1].lastIndexOf(1,-0)<0,dG=oG("lastIndexOf"),lG=uG||!dG?function(e){if(uG)return nG(cG,this,arguments)||0;var t=iG(this),n=aG(t),i=n-1;for(arguments.length>1&&(i=sG(i,rG(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:cG,hG=ol,pG=lG,fG=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return hG(pG,fG(this),t>1?[e,arguments[1]]:[e])}));var mG=$l.map,vG=bH,_G=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("map",(function(e){return mG(_G(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(vG(e))(t)}))}));var gG=Xe,yG=ft,SG=ce,bG=Fi,kG=TypeError,TG=function(e){return function(t,n,i,r){gG(n);var a=yG(t),o=SG(a),s=bG(a),c=e?s-1:0,u=e?-1:1;if(i<2)for(;;){if(c in o){r=o[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw kG("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in o&&(r=n(r,o[c],c,a));return r}},IG={left:TG(!1),right:TG(!0)},EG=IG.left,wG=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return EG(wG(this),e,t,t>1?arguments[1]:void 0)}));var RG=IG.right,CG=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return RG(CG(this),e,t,t>1?arguments[1]:void 0)}));var AG=Ij.aTypedArray,xG=Ij.exportTypedArrayMethod,PG=Math.floor;xG("reverse",(function(){for(var e,t=this,n=AG(t).length,i=PG(n/2),r=0;r<i;)e=t[r],t[r++]=t[--n],t[n]=e;return t}));var DG=P,MG=V,OG=Ij,NG=Fi,LG=Lj,UG=ft,VG=M,FG=DG.RangeError,jG=DG.Int8Array,BG=jG&&jG.prototype,HG=BG&&BG.set,GG=OG.aTypedArray,zG=OG.exportTypedArrayMethod,WG=!VG((function(){var e=new Uint8ClampedArray(2);return MG(HG,e,{length:1,0:3},1),3!==e[1]})),JG=WG&&OG.NATIVE_ARRAY_BUFFER_VIEWS&&VG((function(){var e=new jG(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));zG("set",(function(e){GG(this);var t=LG(arguments.length>1?arguments[1]:void 0,1),n=UG(e);if(WG)return MG(HG,this,n,t);var i=this.length,r=NG(n),a=0;if(r+t>i)throw FG("Wrong length");for(;a<r;)this[t+a]=n[a++]}),!WG||JG);var qG=bH,KG=sl,QG=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("slice",(function(e,t){for(var n=KG(QG(this),e,t),i=qG(this),r=0,a=n.length,o=new i(a);a>r;)o[r]=n[r++];return o}),M((function(){new Int8Array(1).slice()})));var XG=$l.some,$G=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("some",(function(e){return XG($G(this),e,arguments.length>1?arguments[1]:void 0)}));var YG=Ce.match(/firefox\/(\d+)/i),ZG=!!YG&&+YG[1],ez=/MSIE|Trident/.test(Ce),tz=Ce.match(/AppleWebKit\/(\d+)\./),nz=!!tz&&+tz[1],iz=ie,rz=M,az=Xe,oz=Dm,sz=ZG,cz=ez,uz=Ne,dz=nz,lz=Ij.aTypedArray,hz=Ij.exportTypedArrayMethod,pz=P.Uint16Array,fz=pz&&iz(pz.prototype.sort),mz=!(!fz||rz((function(){fz(new pz(2),null)}))&&rz((function(){fz(new pz(2),{})}))),vz=!!fz&&!rz((function(){if(uz)return uz<74;if(sz)return sz<67;if(cz)return!0;if(dz)return dz<602;var e,t,n=new pz(516),i=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,i[e]=e-2*t+3;for(fz(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==i[e])return!0}));hz("sort",(function(e){return void 0!==e&&az(e),vz?fz(this,e):oz(lz(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!vz||mz);var _z=Ui,gz=Oi,yz=bH,Sz=Ij.aTypedArray;(0,Ij.exportTypedArrayMethod)("subarray",(function(e,t){var n=Sz(this),i=n.length,r=gz(e,i);return new(yz(n))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,_z((void 0===t?i:gz(t,i))-r))}));var bz=ol,kz=Ij,Tz=M,Iz=sl,Ez=P.Int8Array,wz=kz.aTypedArray,Rz=kz.exportTypedArrayMethod,Cz=[].toLocaleString,Az=!!Ez&&Tz((function(){Cz.call(new Ez(1))}));Rz("toLocaleString",(function(){return bz(Cz,Az?Iz(wz(this)):wz(this),Iz(arguments))}),Tz((function(){return[1,2].toLocaleString()!=new Ez([1,2]).toLocaleString()}))||!Tz((function(){Ez.prototype.toLocaleString.call([1,2])})));var xz=Ij.exportTypedArrayMethod,Pz=M,Dz=ie,Mz=P.Uint8Array,Oz=Mz&&Mz.prototype||{},Nz=[].toString,Lz=Dz([].join);Pz((function(){Nz.call({})}))&&(Nz=function(){return Lz(this)});var Uz=Oz.toString!=Nz;xz("toString",Nz,Uz),Rr({global:!0,constructor:!0,forced:!uV},{DataView:EF.DataView});var Vz=Rr,Fz=kl,jz=ie([].reverse),Bz=[1,2];Vz({target:"Array",proto:!0,forced:String(Bz)===String(Bz.reverse())},{reverse:function(){return Fz(this)&&(this.length=this.length),jz(this)}});var Hz=IG.left,Gz=Ne,zz=Cy;Rr({target:"Array",proto:!0,forced:!Rh("reduce")||!zz&&Gz>79&&Gz<83},{reduce:function(e){var t=arguments.length;return Hz(this,e,t,t>1?arguments[1]:void 0)}});var Wz=ad,Jz="ArrayBuffer",qz=EF.ArrayBuffer;Rr({global:!0,constructor:!0,forced:P.ArrayBuffer!==qz},{ArrayBuffer:qz}),Wz(Jz);var Kz=Rr,Qz=kl,Xz=Ll,$z=ke,Yz=Oi,Zz=Fi,eW=me,tW=ac,nW=Mt,iW=sl,rW=th("slice"),aW=nW("species"),oW=Array,sW=Math.max;Kz({target:"Array",proto:!0,forced:!rW},{slice:function(e,t){var n,i,r,a=eW(this),o=Zz(a),s=Yz(e,o),c=Yz(void 0===t?o:t,o);if(Qz(a)&&(n=a.constructor,(Xz(n)&&(n===oW||Qz(n.prototype))||$z(n)&&null===(n=n[aW]))&&(n=void 0),n===oW||void 0===n))return iW(a,s,c);for(i=new(void 0===n?oW:n)(sW(c-s,0)),r=0;s<c;s++,r++)s in a&&tW(i,r,a[s]);return i.length=r,i}});var cW=P,uW=M,dW=ie,lW=Td,hW=pg.trim,pW=ag,fW=cW.parseInt,mW=cW.Symbol,vW=mW&&mW.iterator,_W=/^[+-]?0x/i,gW=dW(_W.exec),yW=8!==fW(pW+"08")||22!==fW(pW+"0x16")||vW&&!uW((function(){fW(Object(vW))}))?function(e,t){var n=hW(lW(e));return fW(n,t>>>0||(gW(_W,n)?16:10))}:fW;Rr({global:!0,forced:parseInt!=yW},{parseInt:yW});var SW=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o(this,e),this.dataView=t,this.isSEI&&(n?this.addPreventionByte():this.removePreventionByte())}return c(e,[{key:"addPreventionByte",value:function(){for(var e=this.seiPayloadStartIndex,t=this.dataView.byteLength-2,n=[],i=0,r=e;r<=t;r++){var a=this.dataView.getInt8(r);switch(a){case 0:case 1:case 2:case 3:2===i&&(n.push(3),i=0),0==a?i++:i=0,n.push(a);break;default:i=0,n.push(a)}}n.push(this.dataView.getInt8(this.dataView.byteLength-1));var o=new DataView(new Uint8Array([].concat(T(new Uint8Array(this.dataView.buffer).slice(0,e)),n)).buffer);this.dataView=o}},{key:"removePreventionByte",value:function(){for(var e=this.seiPayloadStartIndex,t=this.dataView.byteLength-1,n=[],i=0,r=e;r<=t;r++)switch(this.dataView.getInt8(r)){case 0:i++,n.push(this.dataView.getInt8(r));break;case 3:2!==i&&n.push(this.dataView.getInt8(r)),i=0;break;default:n.push(this.dataView.getInt8(r)),i=0}var a=new DataView(new Uint8Array([].concat(T(new Uint8Array(this.dataView.buffer).slice(0,e)),n)).buffer);this.dataView=a}},{key:"isSEI",get:function(){return 6===this.dataView.getUint8(4)}},{key:"seiPayloadStartIndex",get:function(){for(var e=6,t=6;t<this.dataView.buffer.byteLength&&(e++,255===this.dataView.getUint8(t));t++);return e}},{key:"seiPayloadType",get:function(){return this.isSEI?this.dataView.getUint8(5):null}},{key:"seiPayload",get:function(){if(!this.isSEI)return null;for(var e=0,t=6,n=6;n<this.dataView.buffer.byteLength;n++){var i=this.dataView.getUint8(n);if(t++,255!==i){e+=i;break}e+=255}for(var r=new ArrayBuffer(e),a=new DataView(r),o=0;o<r.byteLength;o++,t++)a.setInt8(o,this.dataView.getInt8(t));return a}}]),e}(),bW=function(){function e(t){var n=t.connection,i=t.log,r=t.isUplink,a=t.audioDecoder;o(this,e),this.isUplink_=r,this.connection_=n,this.log_=i,this.seiMessageList_=[],this.seiPayloadType_=243,this.mainVideoSenderOrReceiver_=null,this.mainVideoAbortController_=null,this.abortMap_=new Map,this.audioReceiver_=null,this.audioAbortController_=null,this.onSEIMessage=null,this.spatialManager_=null,this.spatialPlayer_=null,this.audioDecoder_=null,this.decodeFailedLogTimestamp_=Date.now(),this.connection_.isSpatialEnabled()&&!this.isUplink_&&(this.audioDecoder_=a,this.initDecodeAudioFrame())}return c(e,[{key:"isVideoProcessRunning",get:function(){return!!this.mainVideoAbortController_}},{key:"isAudioProcessRunning",get:function(){return!!this.audioAbortController_}},{key:"startProcessVideo",value:function(e){this.mainVideoSenderOrReceiver_=e;var t=e.createEncodedStreams(),n=t.readable,i=t.writable,r=new TransformStream({transform:this.isUplink_?this.encodeVideoFrame.bind(this):this.decodeVideoFrame.bind(this)});this.mainVideoAbortController_=new AbortController,n.pipeThrough(r).pipeTo(i,{signal:this.mainVideoAbortController_.signal}).catch((function(){}))}},{key:"startProcessAudioReceiver",value:function(e){this.audioReceiver_=e;var t=e.createEncodedStreams(),n=t.readable,i=t.writable,r=new TransformStream({transform:this.decodeAudioFrame.bind(this)});this.audioAbortController_=new AbortController,n.pipeThrough(r).pipeTo(i,{signal:this.audioAbortController_.signal}).catch((function(){}))}},{key:"initDecodeAudioFrame",value:function(){this.spatialManager_=this.connection_.getSpatialManager(),this.spatialPlayer_=this.spatialManager_.createSpatialPlayer({userId:this.connection_.getUserId(),connection:this.connection_}),this.log_.debug(this.connection_.getUserId()+"init decode audio frame")}},{key:"decodeAudioFrame",value:function(e,t){var n=this,i=new Uint8Array(e.data);this.audioDecoder_.decodeFrame(i).then((function(e){var t=e.channelData;n.spatialPlayer_.feed(t)})).catch((function(){var e=Date.now();e-n.decodeFailedLogTimestamp_>3e4&&(n.log_.debug(n.connection_.getUserId()+" decode audio frame failed."),n.decodeFailedLogTimestamp_=e)})),t.enqueue(e)}},{key:"restartVideo",value:function(e){this.stopVideo(),this.startProcessVideo(e)}},{key:"restartAudio",value:function(e){this.stopAudio(),this.startProcessAudioReceiver(e)}},{key:"stopVideo",value:function(){var e;null===(e=this.mainVideoAbortController_)||void 0===e||e.abort(),this.mainVideoAbortController_=null}},{key:"stopAudio",value:function(){var e;null===(e=this.audioAbortController_)||void 0===e||e.abort(),this.audioAbortController_=null}},{key:"destroy",value:function(){var e,t;this.stopAudio(),this.stopVideo(),this.abortMap_.forEach((function(e){return e.abort()})),this.abortMap_.clear(),this.log_=null,this.onSEIMessage=null,this.mainVideoSenderOrReceiver_=null,null===(e=this.spatialManager_)||void 0===e||e.delete(this.connection_.getUserId()),this.connection_=null,null===(t=this.audioDecoder_)||void 0===t||t.free()}},{key:"handleEncodedStreams",value:function(){var e=this;try{var t=this.connection_.getPeerConnection();this.clearUnusedSenderOrReceiver(t),this.isUplink_?t.getSenders().forEach((function(t,n){if(1===n){if(t===e.mainVideoSenderOrReceiver_)return;e.isVideoProcessRunning?e.restartVideo(t):e.startProcessVideo(t)}else{if(e.abortMap_.has(t))return;e.pipeSenderOrReceiver(t)}})):t.getReceivers().forEach((function(t,n){var i,r;e.abortMap_.has(t)||t===e.mainVideoSenderOrReceiver_||(1===n&&(null===(i=t.track)||void 0===i?void 0:i.kind)===Vk?e.isVideoProcessRunning?e.restartVideo(t):e.startProcessVideo(t):e.connection_.isSpatialEnabled()&&(null===(r=t.track)||void 0===r?void 0:r.kind)===Uk?e.isAudioProcessRunning?e.restartAudio(t):e.startProcessAudioReceiver(t):e.pipeSenderOrReceiver(t))}))}catch(IQ){this.log_.warn(IQ)}}},{key:"pipeSenderOrReceiver",value:function(e){var t=e.createEncodedStreams(),n=t.readable,i=t.writable,r=new AbortController;this.abortMap_.set(e,r),n.pipeTo(i,{signal:r.signal}).catch((function(){}))}},{key:"clearUnusedSenderOrReceiver",value:function(e){var t=this;this.abortMap_.forEach((function(n,i){(t.isUplink_?e.getSenders():e.getReceivers()).find((function(e){return e===i}))||(n.abort(),t.abortMap_.delete(i))}))}},{key:"addSEIMessage",value:function(e,t){t&&t.seiPayloadType&&(this.seiPayloadType_=t.seiPayloadType),this.seiMessageList_.push(e)}},{key:"hasSEI",value:function(e){var t=new DataView(e);return 1===t.getInt32(0)&&6===t.getInt8(4)}},{key:"isEmptyFrame",value:function(e){return"empty"===e.type||0===e.data.byteLength}},{key:"getNaluCount",value:function(e){for(var t=0,n=0,i=new DataView(e),r=0;r<e.byteLength;r++)switch(i.getUint8(r)){case 0:t++;break;case 1:2!==t&&3!==t||n++,t=0;break;default:t=0}return n}},{key:"encodeVideoFrame",value:function(e,t){try{if(this.connection_.isH264&&this.seiMessageList_.length>0&&!this.isEmptyFrame(e)){var n=9-this.getNaluCount(e.data);if(n<=0)return;for(var i=this.seiMessageList_.splice(0,n).reverse().map(this.encodeSEINalu.bind(this)),r=i.reduce((function(e,t){return e+t.dataView.byteLength}),0),a=new ArrayBuffer(r+e.data.byteLength),o=new DataView(a),s=new DataView(e.data),c=0,u=0;u<i.length;u++)for(var d=0;d<i[u].dataView.byteLength;d++)o.setInt8(c++,i[u].dataView.getInt8(d));for(var l=0;l<e.data.byteLength;l++)o.setInt8(c++,s.getInt8(l));e.data=a,this.log_.debug("".concat(i.length," sei sent"))}}catch(IQ){this.log_.warn(IQ)}t.enqueue(e)}},{key:"decodeVideoFrame",value:function(e,t){var n=this;try{if(this.connection_.isH264&&!this.isEmptyFrame(e)&&this.hasSEI(e.data)){for(var i=[],r=new DataView(e.data),a=0,o=-1,s=-1,c=0;c<e.data.byteLength;c++){var u=r.getUint8(c);if(0===u)a++;else if(1===u){if(2===a||3===a){var d=c-a;if(-1===o?o=d:-1===s&&(s=d,i.push(new SW(new DataView(r.buffer.slice(o,s)))),o=d,s=-1),!(6===r.getUint8(c+1))){e.data=new DataView(r.buffer.slice(d)).buffer;break}}a=0}else a=0}this.log_.debug("".concat(i.length," sei received")),mA(this.onSEIMessage)&&i.reverse().forEach((function(e){n.onSEIMessage({seiPayloadType:e.seiPayloadType,data:e.seiPayload.buffer})}))}}catch(IQ){this.log_.warn(IQ)}t.enqueue(e)}},{key:"encodeSEINalu",value:function(e){var t=e.byteLength,n=parseInt(t/255),i=t%255,r=[];r.push(0,0,0,1,6,this.seiPayloadType_);for(var a=0;a<n;a++)r.push(255);r.push(i);var o=new DataView(e);return r.push.apply(r,T(new Uint8Array(o.buffer))),r.push(128),new SW(new DataView(new Uint8Array(r).buffer),!0)}}]),e}(),kW=Rr,TW=O,IW=Ja.f;kW({target:"Object",stat:!0,forced:Object.defineProperties!==IW,sham:!TW},{defineProperties:IW}),Rr({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991});var EW=Rr,wW=HS,RW=M,CW=we,AW=ye,xW=Uy,PW=xk,DW=Ei,MW=wW&&wW.prototype;if(EW({target:"Promise",proto:!0,real:!0,forced:!!wW&&RW((function(){MW.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=xW(this,CW("Promise")),n=AW(e);return this.then(n?function(n){return PW(t,e()).then((function(){return n}))}:e,n?function(n){return PW(t,e()).then((function(){throw n}))}:e)}}),AW(wW)){var OW=CW("Promise").prototype.finally;MW.finally!==OW&&DW(MW,"finally",OW,{unsafe:!0})}(0,HF.exports)("Float32",(function(e){return function(t,n,i){return e(this,t,n,i)}}));var NW=ie,LW=ed,UW=ec.exports.getWeakData,VW=Ru,FW=hn,jW=ue,BW=ke,HW=Iu,GW=_t,zW=ci.set,WW=ci.getterFor,JW=$l.find,qW=$l.findIndex,KW=NW([].splice),QW=0,XW=function(e){return e.frozen||(e.frozen=new $W)},$W=function(){this.entries=[]},YW=function(e,t){return JW(e.entries,(function(e){return e[0]===t}))};$W.prototype={get:function(e){var t=YW(this,e);if(t)return t[1]},has:function(e){return!!YW(this,e)},set:function(e,t){var n=YW(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=qW(this.entries,(function(t){return t[0]===e}));return~t&&KW(this.entries,t,1),!!~t}};var ZW,eJ={getConstructor:function(e,t,n,i){var r=e((function(e,r){VW(e,a),zW(e,{type:t,id:QW++,frozen:void 0}),jW(r)||HW(r,e[i],{that:e,AS_ENTRIES:n})})),a=r.prototype,o=WW(t),s=function(e,t,n){var i=o(e),r=UW(FW(t),!0);return!0===r?XW(i).set(t,n):r[i.id]=n,e};return LW(a,{delete:function(e){var t=o(this);if(!BW(e))return!1;var n=UW(e);return!0===n?XW(t).delete(e):n&&GW(n,t.id)&&delete n[t.id]},has:function(e){var t=o(this);if(!BW(e))return!1;var n=UW(e);return!0===n?XW(t).has(e):n&&GW(n,t.id)}}),LW(a,n?{get:function(e){var t=o(this);if(BW(e)){var n=UW(e);return!0===n?XW(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),r}},tJ=P,nJ=ie,iJ=ed,rJ=ec.exports,aJ=Yu,oJ=eJ,sJ=ke,cJ=Tc,uJ=ci.enforce,dJ=Gn,lJ=!tJ.ActiveXObject&&"ActiveXObject"in tJ,hJ=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},pJ=aJ("WeakMap",hJ,oJ);if(dJ&&lJ){ZW=oJ.getConstructor(hJ,"WeakMap",!0),rJ.enable();var fJ=pJ.prototype,mJ=nJ(fJ.delete),vJ=nJ(fJ.has),_J=nJ(fJ.get),gJ=nJ(fJ.set);iJ(fJ,{delete:function(e){if(sJ(e)&&!cJ(e)){var t=uJ(this);return t.frozen||(t.frozen=new ZW),mJ(this,e)||t.frozen.delete(e)}return mJ(this,e)},has:function(e){if(sJ(e)&&!cJ(e)){var t=uJ(this);return t.frozen||(t.frozen=new ZW),vJ(this,e)||t.frozen.has(e)}return vJ(this,e)},get:function(e){if(sJ(e)&&!cJ(e)){var t=uJ(this);return t.frozen||(t.frozen=new ZW),vJ(this,e)?_J(this,e):t.frozen.get(e)}return _J(this,e)},set:function(e,t){if(sJ(e)&&!cJ(e)){var n=uJ(this);n.frozen||(n.frozen=new ZW),vJ(this,e)?gJ(this,e,t):n.frozen.set(e,t)}else gJ(this,e,t);return this}})}var yJ=Rr,SJ=ie,bJ=me,kJ=ft,TJ=Td,IJ=Fi,EJ=SJ([].push),wJ=SJ([].join);yJ({target:"String",stat:!0},{raw:function(e){for(var t=bJ(kJ(e).raw),n=IJ(t),i=arguments.length,r=[],a=0;n>a;){if(EJ(r,TJ(t[a++])),a===n)return wJ(r,"");a<i&&EJ(r,TJ(arguments[a]))}}});var RJ=BP.entries;Rr({target:"Object",stat:!0},{entries:function(e){return RJ(e)}});var CJ,AJ=Rr,xJ=O,PJ=sn.f;function DJ(e){var t=this,n=Uint8Array,i=Float32Array;DJ.modules||Object.defineProperties(DJ,{modules:{value:new WeakMap},setModule:{value:function(e,t){DJ.modules.set(e,Promise.resolve(t))}},getModule:{value:function(e,t){var n=DJ.modules.get(e);return n||(t?n=WebAssembly.compile(DJ.decodeDynString(t)):(t=e.wasm,n=DJ.inflateDynEncodeString(t).then((function(e){return WebAssembly.compile(e)}))),DJ.modules.set(e,n)),n}},concatFloat32:{value:function(e,t){for(var n=new i(t),r=0,a=0;r<e.length;)n.set(e[r],a),a+=e[r++].length;return n}},getDecodedAudio:{value:function(e,t,n,i){return{channelData:e,samplesDecoded:t,sampleRate:n,bitDepth:i}}},getDecodedAudioMultiChannel:{value:function(e,t,n,i,r){var a,o,s=[];for(a=0;a<t;a++){var c=[];for(o=0;o<e.length;)c.push(e[o++][a]||[]);s.push(DJ.concatFloat32(c,n))}return DJ.getDecodedAudio(s,n,i,r)}},decodeDynString:{value:function(e){for(var t,i=new n(e.length),r=parseInt(e.substring(11,13),16),a=256-r,o=!1,s=0,c=13;c<e.length;)61!==(t=e.charCodeAt(c++))||o?(o&&(o=!1,t-=64),i[s++]=t<r&&t>0?t+a:t-r):o=!0;return i.subarray(0,s)}},inflateDynEncodeString:{value:function(e){return e=DJ.decodeDynString(e),new Promise((function(t){var i=String.raw(CJ||(CJ=b(['dynEncode0014u‡*t“““t“““““t““““$#“U¤¤“U¤¤3yƒ†„‰zzss|yu„svu‡yÚ&ˆ“4<054<,5T44^T44<(6U~J(44< ~A544U~6J0444ˆ†545 444J0444‰J,4U“4ˆU“‡…Ò“7U45“4U4Z“4U4U^/6545T4T44BUˆ~64CU~O4U54U~5 U5T4B4Z!4U~5U5U5T4U~6U4ZTU5U5T44~4O4U2ZTU5T44Z!4B6T44Uˆ~64B6U~O44Uˆ~4O4U~54U~5 44~C4~54U~5 44~5454Uˆ4B6Ub!444~UO4U~5 “U5“4U4ZTUŠ#44U$4†64<4~B6^“4<444~Uˆ~B4U~54Uˆ544~544~Uˆ5 µ“Uä#UJUè#5TT4U0ZTTUX5U5T4T4Uà#~4OU4U $~Cˆ4~54U~5 T44$6U!TTT4UaT4<6T4<64<Z!44~4N4<U~5 4U”Z!4U±_TUŠ#44U•Uˆ6UÔ~B$544$6U!4Uˆ6U¤#~B44Uä#~B$~64<6_TU‰#444U”~B~6~54<Y!44<_!T4Y!4<64~444~AN44<U~6J4U5 44J4U”[!U#44UŠO4U~54U~5 U54 “7U6844J44J 4UJ4UJ04VK(44<J44<J$4U´~54U~5 4U¤~5!TTT4U$5"U“5TTTTTTT4U$"4VK,U54<(6U~64<$6_!4< 64~6A54A544U~6#J(U’54A4U‡[!44J(44#~A4Uˆ6U“‡UŠU…[!44†64~64_!4<64~54<6T4<4]TU5 T4Y!44~44~AN4U~54U~54U5 44J(44J UÄA!U5U”#UôJU"UÔJUœ#UÔ"JU˜#U´"JT4U´ZTU5T4UôZTU5T4UDZTU5T4U$[T44~UO4U~5 UÔUô4U~U´$.U5T4UP[T4U~4~UO4U~5 U˜#<Uœ#<4U~U2$.UÄUN 44 ~UO4U~5 44!~UO4U~5 4U~4~UO4U~5 44J44J(U5 44U¤~J@44Uä~J<44UD~J844U~J44U$54U$5U‘54U$54U1^4U1^†!4U•~54U~5U”54U~6U4U^/65T4T4U$54U~4BUˆ~4O4U54U~5 UU\'464U\'_/54UˆU”~5T4T4U~4BUˆ~UO4U54U~5 U54Uä~4U¤~4U~U\'$!44~5U5T44T44U<~$6U!4U#aT4U~4Uˆ~4O4U~5 U5U5U5TTT4U$"4YTU5 4Uˆ4~C5U5 U5U5444$4~64~TUŽ5 4U~4Uˆ~5T4Y!44O4U~54U~54U5 4CYTU‹5 4Uä~4U¤~4U~4$6TU54U!44Bæ4Bä~[!4U~4UD~4U~4Uˆ~4$6TUŒ54U!44B†4B„~[!44U<~4U4~$5 4U"U˜#$544"†Y!454U^!44<J44<(J454U~84­U”N!#%\'+/37?GOWgw‡—·×÷Uä;U”9$%& !"#'],['dynEncode0014u‡*t“““t“““““t““““$#“U¤¤“U¤¤3yƒ†„‰zzss|yu„svu‡yÚ&ˆ“4<054<,5T44^T44<(6U~J(44< ~A544U~6J0444ˆ†545 444J0444‰J,4U“4ˆU“‡…Ò“7U45“4U4Z“4U4U^/6545T4T44BUˆ~64CU~O4U54U~5 U5T4B4Z!4U~5U5U5T4U~6U4ZTU5U5T44~4O4U2ZTU5T44Z!4B6T44Uˆ~64B6U~O44Uˆ~4O4U~54U~5 44~C4~54U~5 44~5454Uˆ4B6Ub!444~UO4U~5 “U5“4U4ZTUŠ#44U$4†64<4~B6^“4<444~Uˆ~B4U~54Uˆ544~544~Uˆ5 µ“Uä#UJUè#5TT4U0ZTTUX5U5T4T4Uà#~4OU4U $~Cˆ4~54U~5 T44$6U\\!TTT4UaT4<6T4<64<Z!44~4N4<U~5 4U”Z!4U±_TUŠ#44U•Uˆ6UÔ~B$544$6U\\!4Uˆ6U¤#~B44Uä#~B$~64<6_TU‰#444U”~B~6~54<Y!44<_!T4Y!4<64~444~AN44<U~6J4U5 44J4U”[!U#44UŠO4U~54U~5 U54 “7U6844J44J 4UJ4UJ04VK(44<J44<J$4U´~54U~5 4U¤~5!TTT4U$5"U“5TTTTTTT4U$"4VK,U54<(6U~64<$6_!4< 64~6A54A544U~6#J(U’54A4U‡[!44J(44#~A4Uˆ6U“‡UŠU…[!44†64~64_!4<64~54<6T4<4]TU5 T4Y!44~44~AN4U~54U~54U5 44J(44J UÄA!U5U”#UôJU"UÔJUœ#UÔ"JU˜#U´"JT4U´ZTU5T4UôZTU5T4UDZTU5T4U$[T44~UO4U~5 UÔUô4U~U´$.U5T4UP[T4U~4~UO4U~5 U˜#<Uœ#<4U~U2$.UÄUN 44 ~UO4U~5 44!~UO4U~5 4U~4~UO4U~5 44J44J(U5 44U¤~J@44Uä~J<44UD~J844U~J44U$54U$5U‘54U$54U1^4U1^†!4U•~54U~5U”54U~6U4U^/65T4T4U$54U~4BUˆ~4O4U54U~5 UU\'464U\'_/54UˆU”~5T4T4U~4BUˆ~UO4U54U~5 U54Uä~4U¤~4U~U\'$!44~5U5T44\\T44U<~$6U\\!4U#aT4U~4Uˆ~4O4U~5 U5U5U5TTT4U$"4YTU5 4Uˆ4~C5U5 U5U5444$4~64~\\TUŽ5 4U~4Uˆ~5T4Y!44O4U~54U~54U5 4CYTU‹5 4Uä~4U¤~4U~4$6TU54U\\!44Bæ4Bä~[!4U~4UD~4U~4Uˆ~4$6TUŒ54U\\!44B†4B„~[!44U<~4U4~$5 4U"U˜#$544"†Y!454U^!44<J44<(J454U~84­U”N!#%\'+/37?GOWgw‡—·×÷Uä;U”9$%& !"#'])));DJ.getModule(DJ,i).then((function(e){return WebAssembly.instantiate(e,{})})).then((function(i){var r=i.exports,a=new Map(Object.entries(r)),o=a.get("puff"),s=a.get("memory").buffer,c=new n(s),u=new DataView(s),d=a.get("__heap_base"),l=e.length,h=d;d+=4,u.setInt32(h,l,!0);var p=d;d+=l,c.set(e,p);var f=d;d+=4,u.setInt32(f,c.byteLength-d,!0),o(d,f,p,h),t(c.slice(d,d+u.getInt32(f,!0)))}))}))}}}),Object.defineProperty(this,"wasm",{enumerable:!0,get:function(){return t._wasm}}),this.getOutputChannels=function(e,t,n){for(var i=[],r=0;r<t;)i.push(e.slice(r*n,r++*n+n));return i},this.allocateTypedArray=function(e,n){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t._wasm._malloc(n.BYTES_PER_ELEMENT*e);return i&&t._pointers.add(r),{ptr:r,len:e,buf:new n(t._wasm.HEAP,r,e)}},this.free=function(e){t._pointers.forEach((function(e){t._wasm._free(e)})),t._pointers.clear()},this.instantiate=function(){var r=e._module,a=e._EmscriptenWASM,o=e._inputSize,s=e._outputChannels,c=e._outputChannelSize;return r&&DJ.setModule(a,r),t._wasm=new a(DJ).instantiate(),t._pointers=new Set,t._wasm.ready.then((function(){return o&&(e._input=t.allocateTypedArray(o,n)),c&&(e._output=t.allocateTypedArray(s*c,i)),t}))}}AJ({target:"Object",stat:!0,forced:Object.defineProperty!==PJ,sham:!xJ},{defineProperty:PJ});var MJ=["id"],OJ=function(e){d(u,e);var t,i,r,s=g(u);function u(e,t,n,i){var r;o(this,u),DJ.modules||new DJ;var a=DJ.modules.get(n);if(!a){var c="'use strict';"+"(".concat(function(e,t,n){var i,r,a=new Promise((function(e){r=e}));self.onmessage=function(o){var s,c=o.data,u=c.id,d=c.command,l=c.data,h=a,p={id:u};"init"===d?(Object.defineProperties(e,{WASMAudioDecoderCommon:{value:t},EmscriptenWASM:{value:n},module:{value:l.module},isWebWorker:{value:!0}}),i=new e(l.options),r()):"free"===d?i.free():"ready"===d?h=h.then((function(){return i.ready})):"reset"===d?h=h.then((function(){return i.reset()})):(Object.assign(p,i[d](Array.isArray(l)?l.map((function(e){return new Uint8Array(e)})):new Uint8Array(l))),s=p.channelData.map((function(e){return e.buffer}))),h.then((function(){return self.postMessage(p,s)}))}}.toString(),")(").concat(n,", ").concat(DJ,", ").concat(i,")"),d="text/javascript";try{a=URL.createObjectURL(new Blob([c],{type:d}))}catch(l){a="data:".concat(d,";base64,").concat(Buffer.from(c).toString("base64"))}DJ.modules.set(n,a)}return(r=s.call(this,a,{name:t}))._id=Number.MIN_SAFE_INTEGER,r._enqueuedOperations=new Map,r.onmessage=function(e){var t=e.data,n=t.id,i=v(t,MJ);r._enqueuedOperations.get(n)(i),r._enqueuedOperations.delete(n)},new i(DJ).getModule().then((function(t){r._postToDecoder("init",{module:t,options:e})})),r}return c(u,[{key:"_postToDecoder",value:(r=a(n().mark((function e(t,i){var r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){r.postMessage({command:t,id:r._id,data:i}),r._enqueuedOperations.set(r._id++,e)})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"ready",get:function(){return this._postToDecoder("ready")}},{key:"free",value:(i=a(n().mark((function e(){var t=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._postToDecoder("free").finally((function(){t.terminate()}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:(t=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._postToDecoder("reset");case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),u}(m(Worker));(0,HF.exports)("Int8",(function(e){return function(t,n,i){return e(this,t,n,i)}})),(0,HF.exports)("Int16",(function(e){return function(t,n,i){return e(this,t,n,i)}})),(0,HF.exports)("Int32",(function(e){return function(t,n,i){return e(this,t,n,i)}})),(0,HF.exports)("Uint16",(function(e){return function(t,n,i){return e(this,t,n,i)}})),(0,HF.exports)("Uint32",(function(e){return function(t,n,i){return e(this,t,n,i)}})),(0,HF.exports)("Float64",(function(e){return function(t,n,i){return e(this,t,n,i)}}));var NJ,LJ=Eo;function UJ(e){var t,n,i,r=this;function a(){}for(var o=new Uint8Array(123),s=25;s>=0;--s)o[48+s]=52+s,o[65+s]=s,o[97+s]=26+s;o[43]=62,o[47]=63,UJ.wasm||Object.defineProperty(UJ,"wasm",{get:function(){return String.raw(NJ||(NJ=b([void 0],["dynEncode0095\t%j©Ö¥Õ= [ücò¬\fqrØÍ\fTÑ®]µ+¡]™ÚÿKM&ƒìÃÅFJ•´õ1_§= ¾ŠA-T¸½Ê\"ÖþkÝä8…Äå¼?ÙqV2;ƒCÚxC:ëañjk©(4'êÅ<i)+ñ¸“+ÉFÞA+yDƒÉà‰X—Õ’¨Í–.3(b\bŸÝdþ=M\v»•×\nŸïž5Âõ5\vUÅÜ%Í™=}8}y+-ε¥}£çÙ5-š'ѝN¦šŠž­­Ù¾âX¥83sS%6Ôþ¦ž²¦˜ŠX™àQvh_7ï!ș͠È͜HͤrM•\bMˆM™8M!%SWÈšN\t\tŒ\"Q+У±Ïÿx–œB.ŸIíøÿÿLƒ‡[ØNèžÛ£ÿ)ø{}Ìk „Í=MŸu¯ýiòñAþ×Réª=}ëïÕ+þ»SPHæ,P¢åzƒ2Z…Q•= )U¨­¼ÆÒZÛN<q=}bè0æ,<Ã8ÓäÛØ3!1¼ü\tehÖ883#¯2‰\tg}A<HÛ¬ÒòÉOw~f¢äÌ\tGÐàjùj^šÄ@iÁD ‘RЍpÁ?4é(|-~y‡‰LJê‡çò3„PÞ¸Q›ýÙl!¯…tê\tXïx°vó²´\\F:prhÉhr8‹ý¹X½k>CB%‚²œ2\vCÚ£Ñû{lȬyÝï#‘=M®QaQa!“ø....®CŒiI\\£’±âêì2Ïé?Oˆ;~À£Ã½“­´Ý•ân3ِ»öôáq±Í»»*Ù{@ï5/–Ã[Ó&ˆéè½­RmŠÙ„$W}•±ó?—áϘ<\"ø¸ýÑÌI™u\"«\\Þ=}LÍ¥–ÅèU=M1÷ŒÆ#¼‘âöóKÜ¿\b@–ÐEÄ#í=}XÒòv÷5^\n¯RG˜Ño–³fûAâBâžuOð˃ÜOso±ª®tþ#ñHR¾í¦Ê‹ó@ÐÆ=MQ\fÙ0ï0ñ°§¬•ž+rêTðdeôNØK<0›ž‹êä™R%åÍô#†µfÐ9‡©Û8˜]¬¨/Ë ´1oË2mu>%Ý>HX›$¾…𩼔 aŠtè¡eËR«/ÃS̞(˜=}Z‹Ë1qåèˆ6»3@¥…t\0Ų£wsűÛXö+œ°“‡Š~ÅâX“Å¢ŸÑÀ38“5¿P•õþŒ9õixÅ¥êm¯¿›”zÄx–÷ˆ_VðC¦ÝPêp=M@#)’LDë˜Â= ‘óíœy°¦›?Y‘·m•ÎÜø(}µø%̕ËðÖÔkN\"€èb{Iã$ÞÍtN9Nó˜ýkÙPý/´¤ûÂòÿl»ˆXÖ\0÷g/óTànn3-©i­9×ÁI.•Š€´”öu¢ G¼X\f¹Šö7ž¦—t×]é¯à= yâ6§Dû×ZD—æÌLë‹s©ØäƧ؉+p\bªE9¡t©ò=}}™}Û8Ä&ÅÛlÂaÍ¿SÈ cx#-º\\P>~ˊU¡®©Ä\0oÙ¥_\\0¥\bžðùßüpT™Ô}\b­äX»qNYÀÐ=M0ý@—\fÞ­ž\f€­.âátv&÷¿Lg‡¯I-—ÒüFðÄø¶\f¤¢/:2{Hdh:f$Œ´mD.©qk׿rkí?Ò(Íóç‚oGžV«¾Sa[±=}+'\t‰{¤¸»)&õf³)&Ue¡]àGÀ˜%W=MIèÚ=}ÎmÇ= ý•ݟ-ye)G\bö^*;½]˜- ó›­ÿš§³Ú¾U1)ŠŽ—V@Dcj§íV¹)= 5ÓÙ’PVÐÅc=ME—1f„Ãêf’¢á´Õñù¨La[ȝOÿ+o{Ðè0ˆßeX¥Á×Þe-G<¨‰[.>ÆtXç·qçkû<o\n´!ˆaœi䧄ë—ëÓÚ$üDžŠ|ðè'=}ç@Nª9›Ô¶Óí·^ÃT¾nzL¼@ä¶«´çx(“Û•ÓsÝ2oÅÒoÝ­ôI@Òði= —¨pl’äݺ&&8׍c'²‹»0Þ\b= .ýLû3q¥Ø’ü\t9Ý*¨f”×(˜ôfX©¡ùÒ¼Ç*‘»z\"Q6À3֘¤s£órƘѪdÒ4?W¢,Œp= ª*\nö7{˜ÉR{Œûšþˆ)¶›˜{lK“\b}à;gYáêkKŒ§Ë<\\¥—[ÉÜ÷0QÕô×F‰õ­6\\ä¾Ê\v¬vûìw\0^e+Þey•ÊmŇdJÃBl}Æt\0E™+FÂ\0(­—ãUwž»=MÅ!é8~S‚ÊzS= ¾µ¦v<úՐOŠ(–\"}©=}0t¤<Z„BÛz֋vå!á‚&¸ 7~¶»@ÙªÈéôúĚä\\¡m‘˜èMÙøym!Éé³ï݊œ'˜¡,*)õLäàRóV£œÊßøý\båjá_«Kj3ŸkkçHÙV´Ë\x000F<Ÿßç$Ò$?µÌyÕ9-ïÄÁ¥þ.Çÿu¤;eG\vtÛ\t©h$ñyN—£¾}wEî\0Îoψ+-=MÅ=M9BÌ^ÄÉ^4r\0éjr °ù6š•2-–0‘\bbŸp\bb¿pF¾n)»¼¬aŸ¡sLœÍÊFŒdš!!Îݺ'ãŒ;»¼’qþ(=}JþHS¼~#Ö+ó³ü†ˆÌÖùê¹X’Þ|¾<K9÷ɆIuÇöGÞrÔ)YfPcskY;-YtË5= V,P¥1ߖ©Òî*»¾±F¶÷ÚîÿVè'©v[ª\\Ç-uœ’‚y²±\0ìMËÙ£@¤ælP'ñÈ«ºô诜¿ú7¸(t¶×»Qgf—˜ ‹Ö=}çç¹iøõ6tg›ðJ®‹jW›E®pD´I2ÎÆØÛ±Tÿÿ~øè\0´Wœ;„hù˜Ê²5^\v/‘¯osÓE»gÜ\t&ØzôzGe¶Í¸îsáɆ™°o¼\"ãۊا¯­Mޕ´/¯\bN{½0Å»})r¿‘öXŸ[Ši¡j,ÿrœÒЦÀö²Î1á\"º0AG‡f!48ÅÏeÚçWê™bÞGÁ5ýìmü0°-ôñ¸^|ӔÂt‘w°ûj¦O†7’…ÓvYt¬ž¾àcԃ©OàÂ͌3ÅÛZÁN}î¾ùjŠùztsÉÖN„nPkìN¥ú£hÕ^Òˆxܨ*Tžß@4!’¶J€´ém¥™.m%ÍÓlC_¢ßÙ#_b°{$QèíÆqœ˜©>ä&¿§ªò€éµ˜%$¦DÕÿP·À̝9»—ìkþ—€¹É= '†Wå\"ãS°‹-XÚõýqV¦E×UzXMƒx­\vâÝí£tI­k_m¢×‘Tš‹£L8q¨šTÆ= )ÿ·'Eê–×½X{sÁi»3P6Ku«Fù[œ·À_r?ß*8ó·囨õY^Ùø¨^fÅeáô„ÊÂ>ÌÕÞD¼õ‘íÁ6C×åÈÕW&T³›‹bUr™âu.¡!gTÏ‚ÞC¨Ô‹—\\͕~a•×»“n«ÙñßÖ¤½ôšu›qgñ ù7}r\"Iut‹òÝ ‡F\"A-­Õå+º×9ʬjÜøƒõW\"ÎQ5\\Tš×ríÜ=}B4+_jX>Ù¡Š\bÊœˆ}Uù[øÞ˜Ó£…ÍæàIå_{!¢qÚõ@ü2®>(Úg{ôÜ/^Tš5TXµ10– ¢ù³ˆõç—RÝSâg±ÉéõßPí‡=M¶\"°A'?ì»;!‰=MærŸ!³·%søšsÃÏ«+±SéìÀ°©•ß•v±Œ%¥Ie¿å׃\nÅZ\v̊è„þ©=}Hg;þ*‰’6A+s'0D\vùŽü—\\ûwÎ.0LP\"'“àý›¯Ð–ØÙý˜ÝDH¨pt./Ÿ¯öO>™ „*á†Â–4Çrœ0º’Lxþï-SëÍù·\nw>LâŽR“´el‡â¼7ââ^7¹ew'ꦛÎÒ¼¢åÆ–X\0Ð5ÕRQÅփ.OUïa!‚aɅ¡\v1ÏX«¢ì‡c\0ÒÅÂ@„\0Á×HOJ†#‚Hc¯R= Íˀ¦ÇFN×ÙÑ0›oš ٛq[Mj•AoÿQÔô»R²Ky¥‚áñe\bNRJŽ^!ÍɚäæÌe6Ò†s|sP3@Eú‰;þë4õ\"…éfÄóà~À,ÀŠA=}JƊ¯öL;Ä\n숆çÆT#|jQCvò$µ;çûvSÜëfÅëó?=}„lôšä\"¤éÒÁèî¸5x¶©˜‰ÑCúÙµE\"•Ýãï$]D7ÅըŻ5˜hP³c?¤—ì9Õ¦ìهf—?sR¬~ÒËÒºEg˜\fÑù¹¶”X½ÎÓ±Ñςªn³yœ“ƒ!= 8Â(Šñˆ<[µ{$.‰q^o[Å:|À|0»¬oÅ\fÃs•]‹þí£E”ށrXËt›Œé) ¶K9-ñT[rCÕ}vŠN{€Ð5¬m)&ëÄö0±R‘™fy\vuAÛ ãR= Rä¡rwìòá0ËT¯I—e\n=}­Ï\\H¦üØaòUÝօŒW9Efüb“!¿·(Ø¦» óx®u”L«G ²’Ä\0k;Ã6¨1<½Ý[[ê[¢\"qR_öÀRØZ€S/€|2bg•M#ҙ ÀÑ}÷¦¥ ߅MëÓx¸”šƒcΎDŸ0ò¡“±)~<â㋶æV”4&&ø¨×R~Úë†ô=}{<—¥~9}VÄj¨Wã-\tƒÓ©—Ð섮<€È/UmE,?žÈP†3#­Ä‰²Þ½ùÜÚ#íÜ<¸¥&ØçˆAŒg–s\"‡Q »#9Ä-\vӗ†n!=M!\t\\\tFŽ\fpÈâdÓIZ¡ÚöD}n¸,ÈâIü³ÕÀQ™ÀÃËÜtr‰û\v“\0×ѝ✴ÊÃV$†ÎàŠ!KF#»¬ë¯b4KŒNYb³bU…ñ *56PÃE‘aËF-m:‘XÁüLÊ>ìrrÓž-ÜeG· rŠL¶¹É¥P°kW8Nª0\fÝ·¸ÃáavÇÀyS{|H= Ödq¼¸!ø¨³U'18²^˜p¨¡<#ŽH[³E)e±+Ô¶ò͓= 5ëº!¾éAϖ*ôaEî§8RAϬAyΕ²Õïs®¿é7œû{²Õ–µ#ȉ=}·¥B<‹öˆMÑQ¦åÃǃ9= –zÒQzón\"¹CŸcˆ§“e±|צ-VáéT®[NWk@\\ƒÛÆ%&³­‡Ína†»\b2b/EX„,an8±ñ®«Of\tÃò,=M¿Îud×Ía\ny£ˆ„¢^ªƒUÿÿL¬é½\vQC”—¤ø4üc¨s\"⯝“K¼ÑW4:Þ÷Ä\\bŠÔô€•cBCŽ+1Æ·O9Ž´€H{kHÂòÄõUïØpiBΗ‘]¶ð…÷\b³Á$yö/EoNô÷ˆã랍\0u<4%á‚åc‹­ÒŠø§Î[,l¨Î×\fáÖ™~‘Ç7+ֈ^ûk§PÜ'Ãi©QžDÌ8´T½¾bP›ñðÔ†©¢&˜²š\0·ÓSyU\\!=}+= ›= &„›úGoæ\\S:b¬Qû-\\G¯_í<Ì&^ã¦\0®ÆÁÃe¯ö³b;ËxÀªW.^EE™;Cr³M€yGù|70É8‰ñ‰’8{ ²ÎºíËÒ0ÊZ\t-±myAVs‰Ÿc{ƒŸM)™6¿8ë+’îÊ^ñ‰ôÛÇѪ—\b/ÑXYa±ŠsNÁØ¿Ëc¼!¹­Á\\Cx_‘h8Ïqœ“¢ãÚÊn™äÔãý»oކ´žCõªÕ‡{‹´PoÅ\få¶ïá7Øpb’Ÿ\vÄgcBÄ NéçÃRrp–Œ1 “Ü9°E®uåk¡ûŪ2Œ¶2yýªˆj>wPOtË̛‚X–¡z”ÙÁº¶{«+'PÌÈ)«»‰¥æ¦¯†¦Ð؅@£5\\¦^’= Öù—òŒn\bf¼Ü]$Ì%´dѳr%ya«Z—ôô™*Úå¥~5“Üv6“˜5P6ŸšNʜŽÔDœ^ÑB̚^0\t»ž× þ*ª«Åd1~E+PûÁNo&¶#:\fˆP+Íp¡D‚ß“}[¹ƒAÞPÈõ›uça¹(:î ¼¶3Æo_=MàïE04u]Oˆ¡³Û=M]i¥²˜û×Ñ´z]­‘^Èb´1VÑ9ÄpùgqÏh‘_®Þ»Gqy,¦ZSyßèuA/†¡ÛÉWGäSDނܕ†6=}œFŸõ4SvÖèøºøi‘þ(b¨Í•àMí¥ö©·‰÷?ŽžI9ZFדT£*Šj×䛴Ö÷Ô\"^£á€€n“= –ó·|݀ñ\v‰±9ÖP¡ [‡ç/kÉÃÝnÅhHþù›Š–øC ·û5ü›Ã›=}´S}Ã|®áÝèÌ?^hŒôi‹pn‡n«Ts0xøÓ½GÖX—™°ÁÜ èšë›²ãg<bBÄû]\f/Τj\vV¦ØÓÉ÷|ƒñŕ6¤ù0ô=}Ý/„´J»€c1ˆh8ëƒW¯ß¡Qi'®o›‚cd’ýC.¶öi¡BùÆ´ù3±gۉp¸ex&shg|ÌZ9ø[—^ú\\c˜¹™jT¡î¡‹þkQ‘uX¡*öÿÓ\f\t±\n,œ Ç•ž‹•mî%·\f>]HBÍ\b°¿Jxö5­€{T1â>(銙ÇèSº\v±nzké©«ˆ=  'ÅxÛa¶Xt’AN3IŠô*ŸHuøÅ…l1×±žÝ\bî©EvÆýJ=}”Ï,ՋîömÙ|ð£í”\"»*ÚFé¿oeõö$Q&ÛSŸ¬­@j±~$Îàg‰i#ä³jªuÆB®Áj<WT=MÃO3ý”Ðf”,ž»Ë–^\fŠ?‚·>—£Þ’ɲW¾h´‡Ã=}ӆ= ¢ï€üÔ+“~ÅM\\é_– –zaˆn= \v0±Th¡–“´Û>æÔâi_õF£°/œšD¡ªE58z¡ý´gñeMut‡°JÜC £Q6)e¨=}¡q³^Ÿ\b\nó›Ycïi¯ÆÇM¹ìDÎ= ƒ?hœLZ5 —݉œ£Êh•‹î{WЙ/=}Å®å3ùâ(XÇDö½,¦îkÈ)GÜø©_€Ltc\v=MÁKUm\\ӆH#\v;ù9äèGÄg\bø@Æa\bB2õvÇ [Ÿ•4R—Ր¦¸â¶fúØüd:d\\ˆÌzžK»,w¯¾2wœZÒkŒº~…Ó¹\bÈËz0xºAêXrZ*µÌ#äö¶ÉÛ$Ë܋Õõ| áív£$Ëz‚ÞzG€é-Ÿ½„06°|&gåüÿrïᱬ“}pV«/L>·¡S”êÑËmÆõ–Rt3mJ\0±ð¾Ó•^€6ùhîˆ2DÆâÊÎFpù^°bAöŽAý m&óa|ÇkEÈþ9J°é|»ç1À\\ðOTÒ-o¨eŒÛ0tþÞ\tp†Ÿ-3= 'ÇaBÞ¿!â^»GhODWñÁï8§<Øif¡\v‚†{ü>…Œ/…ª—çRèúÖ\vvÔÁNä[ïÜa/Dš]¦h­þbíãMžz–ÓA¸@;%™ƒçåÃz:éóß¶PÈ'L;õðß= çY8H®t*ÌXò^ùaƒPîá&.»p„QZʾ•?+PÐit¬»ùY6yÊÎm›éìÏ\\:÷ŸéñXØIúë¸oþš«GH®äjVò¶@,i#6£HÃÎåùy\nHŠ YŠù2/.ob•—÷×m¾+çŒÒ|ÒB±¼\nîØnËr (žôbg྅ù¨Oãzérò§˜¨›NrêÝ@ö™ó˜klùŸÍÑ'¿Ù„÷[u((êƒ4|¼æÅ@°ÅBz«%dÍËâ6‰…Òª´´w9ñ@¾RíUa¾/°üÊFé—)€âÉÊ$_Ïj‰½®EµKØIº5dú(¿fLž c%ËUÔ\fהd\t±Ã†ñ\\ é§CáM€}phÕ$×ë½vßxÑ\"‘GÐâyqþ^ÒTÅ91®βXørdn—0UÖÓàvb\x000§/YnÎL}µç×=}€Ë\bÛzá?³ð7›|Ë)pØói-íL9™cv ŠÓõ\bۃ¦@L\\ƒ\fw&søñ\0c7Ï 0k\\ª¿>±Ž~ñœëò£©«}Þ{}ÜíÚä‚y[¿Þ±¨âBà™d4Ì¥På&l¤øÕ¤Ø½:Ê\\Š0^upqpx“X}mWRbfêË4|[IœåÞ^ænË4ÑP˜ü*ÞÀ* (çá?¾ä»fÓÌ.…é1Äw§.ÝóÔA\\Vᾕ¶Ÿýe»ãZx¾€¡4žòžß’cô„j$\tÀrè¶= fûÛ6Ýڏ[ª\\ô#ƒÌPÑ^¥c(%^ÀêE´d0d΍Xd¼‰0ð‰^=MCÞ¼eõ[˺\\ÆY½4öÄEÐàm²eþÛHƒ(F¨Ç;lb¥—ÞPªÄà6Î$¦™~Â};…8øÕ-\fÅÃv÷—˜á=M™õïr/Åʎ„bQª>­/但LÐÆî”¤ìÇËŒÍd覐šWÕzL\t.ðœ¾X¡{ä\\ó(=}‡–Ï…Y0„åé=}dS”É\nâk,*¾\f|„ð”Í-6åé«r|Š=}\"î”]™›ŸÐÒÿãeæŠ8E¡ö½XµLžüâ6—qY;±l'\\€=}0ï\\iϼ“ >pÓÓ[Íø~Lšñw®K7»&6oÂÙ¢rÎÐó\b\tŠ*@½TrÞp\bìì<Ã΃±·†ôË®‰í_&´6K€>…Œ/9ÙSʹ»çÖ<-Ö”$k´žûbÄ‚d\v¤Örß»×â*¿ÁÈ:¿Y±|®LdÈE>NªiFÆdåÉä׉ükÚ¨.,6ñoU8m/(uTŽÐÐB@ý«dÁ§0\t ˆùÔ÷Ã|q´Å¹CƒW\vÞ×üäó’\\‰b~C@܁_P‚¿RVw–5–ëûç}ªÚw?&;/«þ¯“74NbYKWj•õ|Œ„U—š±¡uƒú=}ëQ».otä\0¹œîÞÝþ áªeÿS@æ:m\0}½lÞu˜Æ6I䙖NÃñËæîë2ÁÎ\fwt—\n•<•…–-E›h0Êúoc‡~hôP=Mtܑ”{õþN¼À¶¬š)êF1T$n>(GêßVã_ê\\‚?(:('I@+CÉüµ=}ê—ûêÝiíôG®ÊãWÔ;AhèG·«^?xܳ€Kڇî= Í8+lisjúÖÖ8V'ûD«Òµÿ\n„³ä7cÙHP˜Y$ʓT²”ê$Ѫ“˜ÞN}ô#{ğ‘ρÏCÖÓ\v|é¬Ríi÷Pã[9çÞR¡gÿO›3vØ3S¿Q •/͝L7åÁ¹-\to¾ÞyI!= ê™³£Ke=Mš÷×\nyCrËQ³lc=M…?Sò:ËBlûRáþ„~‘ËcSó0Gšsy:›oH3c\b.òþ<šçTjç:D]Þ­ïpL¶ÕÈ**ºÎ~£#<W$wўýÐ ™@;½éQUäž×ï\fC-ãaâu<-\v*©ñ\\2uÁʽüã‘óE*= •†z,ýÂ_LÂÉ-³,JGsËÎõ틑¨(FŽÜ»üˆ¤á_{„.¢Ë\\A†z4ª@45èx@\t<J.AÏæe¸¬5²äPn\"î€<fŠhŽ2~I0Ûlä,\f;ˆ¯òÔòt.cOþ\t΂D¯u\tøF-8Ûõ¾õ°¤-yÈ',ۇ-gdÀóôf¬ûâQ3»bU.h›ÀsaÀÁà$˜Ô/Êøn±È<m±Æ$FîÊäE®0¼n!aþËJbeÑb;ÉdE®-üny{±0iÑd»Ë„÷¨.à—\bnðw4¶†ÔÀÛÔzÚHöˤ0ºËüâ[{þ(Rß=}3= ÈŽHBÔjwV~d}»óì,|‚,5[×òç=}!X„Jf\nXí[ON|PÎ\trq§dbefv\br'â€{3‚{e\n\bÎ4.\nF.ý9O0Ølb:±ÿ[£f2ÄÎ÷rq~£òc.i^ñLSgÈâ‚ó·bílÑnBÖ\f#DkN¼OÎ\t|\b:cÒkb6Ð4= \nƒé̃ÃkÎüc\v\bÝ1ð2\nÐKŽÄ‰ðn|М,‘ÄËð¨e•Ô+ Âf9BReMD[č1•L¦«GÓ\fôumÊ#ªË6è)G×tV\t}#ߏÃUó¶Ø £¡®Ç”±rS’6ð¨0#\f2%ØzàÑZX˼»P\\Z¡“ª\"=}@)#^Þc3iÿ\\Ù?k²÷ŸGYpGÜîÆî®©Ö¶Ä†€³Štæ^G±‰\fàI’¦û=MÀ\\¬¬%qXŠª´|Z/âÖ fq{—SÞë'ÅÄܪa´+â¶÷+„é[øPÙ«=M–Ĭƒ= 2Šô)S#4 SñŸáÌ“«‡\nAò\fdNãàíå9?TRJÑ£Ø$*9“ãào\vň;y­ôK ,Ïã€ùm¬957ê±å׉iV\t>Zž\"ôKEšFÿWѾ®Ðnrí|®fOê©¥0+€Œp'afÆÑŒFiØb±íq'ŸjNU$?uˆZ¹r>+ûdq3²ùíðF­‘äI^뿪®ä)­»!:×Õ૖ŒzT¯–Rz‡fnƒëáa.09M|½ >%ìÐ= µs2å?\"5>rVŠÔ­\nÇô\t#îŠ0‹\t}q,ü1\n,Š\\ˆjª³¡0HkGƾŒ7Žï l’ÈiÒð'f̬\fqzͼAéè{Zù\f?Lμ0Нcû¹jCkÕt(sü/¹ŸV?š9x¢\tíw|»œúÈ&ŸÕ¸Q̪sËs£„QŽqÌÉúŒïù¡“!3ôÜ¥Ýi=MŽOHi¦…Gxā„iIG(D9±ñ'ÓBSPµ>…‘p…<‰õº31E…Käg¨u'‰h/9äý'óh¹R7ޏM»þ8ޏ9»~\nâg0/9´j¹RVû5>Ólé4ÿ?$ÊjÜ/˜9\ntüݑî¦âgW¹òGmùc/1bh;‡??Ɏ]HÉ}Z‰Ø¢U†.7\\ˆÉÉSÀ¢z/mîaÕªèI0Ðjb6¼@pÐ.p\vàËÊ@D\v\b}ON爕Ð/—Oº÷rq8r±O\fç‰û,wejºòó„{ej©Ü\bbþ9|üÉÒìác|Å^ÿÐz1W4މƒuÇrñ>\b\\PÎ\t\nCàdÀr±OÏl:|J£rŽñ5\b¼OÎ\ttÁÒ</3h‰¡\b%hÃ12¸C?J<ÊÜ4k±bÕä#ÓbÆbf;'\bçfÎ#OYjEPGëÐ/u÷= ªáÿß=M3¼€N,TÃîøkB\fTƒ’U~Z,˜ðÃ0,­c7™ÛÑˎÒӐ) )Ó,ŠëŠÔú‚Ôuy?CÑQóAìŠ?OôLOðròŸ|Òù¡G™—ùU-饯ü™c(ØêÈÐ'ú˖÷”x^‘üf3±‘n±»|\"‹c{òp= y1\bm1\fÒ{Œ’dPòê\"n}O„sƒR|3Ó|ñÙݵõîÈJ\0óûçA¢|M@–ÑK{éPDÏ„äosRʵz|º?YŸ¥ïíYÿÆkê›*»ù_(ö…ùÓd\"tDüËá;.3ÆÚ¾è½2~ÿӗ=MŒ /ñœ¢˜1\"j/ÀÆë\0+pGÏ[–Ê›x™Ô™\v´DóDK3oS\\Ö>/lɶQü= ì«Ó2ˆ×è͋ÊÔ®\v͂–B¢Qçqè\bÈ8Zb¼â\bÄW†3*¨‚Qñǘ ªu1îÞɞmÄs+w÷®fxÝÂÉÄ.*~¨ŸÔWTC3È·Uä³}ï´?÷¿0¯¼SàOR„ëuôV\b1\nRÃqÅ«óŽÖ ÔµŽ´€…áÀß.}Mv@uì#]–'Ì.Ççù\vqÒï5À(œ9LJë„8á#gŠn6Èº¤è!w;1 Nłj\0Ëù±oP\"H÷Ãë\fБØdEë¿wM¨9µluW.7¦ÿhÓûšXäü5\0\tw=}—>Ü*Qf¾ð9ÛÝ*ös÷ÄÃÃãuÂÄ#4ŽŒr댞â-p%©~÷†•<œEä—AÄÅ)¦\fH:CAtÈ]Ò#¡Á1ФM™ÿú{M;‰Äò%®å:x¬ü²à½'å1üg•jéã¡âBŸ>:‰ê¸)1Ø’å<BKãö£ã'W‘j½óÊP엠#lÛÆ16[<ŽZ\\g±ƒš‡Š\bô¬\\fÿ,ÞHÅ]£·-¶¢ãRšj6Og„·ÓH³EWc\v½Tv'+$\bùÜ-= Î†cT¾Û\bÜ}®¼Õ\tú¬_ÅÞôyÖy]Úȝ…©MmkB¤¿‘ÿ°é¾ËÇ&Ç1ËÂÁØÙÆg?tžeÔҟçá}ôw{_\náNIaY#ì„×'}B}ŸÏi©BѧGcZŒ\"\0ÿ(©ñ—¿ —×örŠ–9ژÑ6D6N\0ô×ê35ˆ¥=}Åì\v[G¸*rŒ\nêù±a_# úKik<b6°?t4z—½\nhZ1O×óïzü?<gàB‘֘ØxTó¥™öAr^\tGÛn¦É2iû6jÚ|CYkºßþxž‘™vû^ºøt,ʼnãÂ\nŽ9?ó\n÷E’\\³@ΘõO2sfuSTƒ,…´êZÅú@(—nQ!\"8BÑuÞ¼=M\fQç4Ù¶v(z”zTt®êRÆÙ¤¹«Ô“’ƒ¾ýÁDá9ë׃Чgö¢\f%&þÀ¡Ò³ér;$Q¦9‰u»:…°\n¤[dYj“¡a« ?ì&Ù\nthI¾wÚMû\nq2Õbö¡£+Š'BÅû̗7¾õòú}·I–/\ti¡;L¿¦8/'.œv~XȾ³ÛD™kÇŸþ¬šÏgqBë?;N®ü@bSˆb%€'8‘~\tæOÓBP)±¥€Yš‚ž.Ä:2½(ÑÙðWî˜Á‹VÖJl€êPì0fªðñíY»ÜLŽkäåvx.ýç¢ÑgÚnT9\"“Ûڔ£8֕ÉòwvVûàN•š‹Gï£9ì?žÅgÇü0šzOºQ\v‘ûú‘\0_­<ÉM•ñ$úåRâG$T'= ̗¸vsöò\"5ù¯á@r°‡W³(ÍÛ®ú‹½4OÚ¯lAÍZÍ\nï¾çU^ö±Ÿ¢½ Ã™ÁF¨·Œžá«w&?«gñ˜TËyêqThMÍ®uh\væí¡=Má‡\tè¶6[¼‹EÑVßYG*‡…µ= *ÿÁ~è\fÕ­ΜX½(»6Éá3KÚ¨º=œuŠØ‘„\fx¡C­[––A€¸{–ª¢¥Å·¤¡Ê¦L$œ4ráVE®Ò·ÜOoØOIBiþðÞ$³±ÛóÊr¦c¾gً¿ÁJìV¸â-Öj)·,<¥îÖ¥ÿ:Yˆ08式ÕOó*Iÿ@Uêiý?{½ä÷Æö–Nì™ÈÊã$)S8«NĞýõÎ혛>ÁÆÛ©nì¼)ºÂ‹ÔC)ER!ôý&û*ÀAj,ÃÒFCEƒ*þ¼–EyŸ©ÏqÞÜ=M9åR”fÐ\v”ƒ˜”ƒÊ”ˆèŒr…ÐŒ‘Z?èTnçGßyQ’{´CtG2«vy,LcE iíV÷¸?pVDÛPæe‡ãÍÌTcŸ‰Ý~Óµp=MýiŒçÞ+llJS‚<ÇÊP-žÉ\\M\fíÂTÅßùD$·ÑžÛ÷î)þWâàSõoÙä=}‰ݨà˜dgÿh%JFVž6I®N2Eø+åäꆶ–ÓÌà öTÃO©á%u|ÿ)íÑrþïˆÛhϾÈ2ƒùǾø^IÂm*”Â\",‡<q±ì$£\fånMIuoæ—!coÂèåEáò•Wnkž¼1šÃ'ºÍŸz=}Oj|Q¡öÆ©4\\=}(­ý&|ãžÍ= j´å\v4\\ÏBS¢LC,qŦ¬UžïÎÝ·5ÂÆtÛ\t‹‚ïÖLZ€Þón*ÿ}GêKO “RWF¶zÖNٔú7Ô@‰ýVñ'ø²ôÕd0˜Ç˜ä¥AËæõ)zl@;’¥„˜ñŒý1Ÿ>¦—vCRh\n´JŸõOS\0\0{-è’äOAÁ‹5Àë;¼jî[_5 ™À!B-–\f\tZù\vU_F£$l²ÏcF\fsዛMZmþq*Ùà}³ÒÒ<\vÇÜy³åÜÉ ¬»ÖP-ã±¥}‡\"²Ç‚£o('ö¨~Yiô|\fu$»q“‰ÜШCd¦…j”Ã/—žÑ‹ž€ý\0>ȳÛ*4¦ZBjba'?äzå™õÖ¬ÏÜ¿°+ÑQ{¹¥Odl°h‹ P_$PóÈÜiн̪ \b_ù«S‰nM9—Çošd¹ós»‰<ã±T«¢ Œe[ÇÇú¡ˆø@#H÷ðÛAæ@xZ\tóãÆN°]\nî!‡Ï7‹Ì[æ^§[‰[ƕÊòU]ûïëK秗£ºÎ8Ì#ÄýØ/B%<eëÈ×XÍ+i#£Å§-Æ=}È\"ˆ·láÛ]¤q4E©þÍ«yx[gÄ5=M׊›EûwýÕÕÏ\bS 9#,Þâm…ͪ,ùí‘ò×n9󯜬„™=M/ %oÝ\\Œ\bÎ\b±zäZ曻÷È%Z¨.%9/Q!Ꮒ[ïǦšùmHNœ˜<M£Kñ(j£\0áOWÉK—s§ÔâWœ\b}ÅÆÕÒFq5U2½q¿èãÀûçÛ¬­©\\,í­Æ;5#!ƒÖ©i¨³O\n9Øâ՘¾\f@»Wj÷6Ö)†*c€#˜„‡ŒØ\fQÁ\fÅØZ涁rو±â?V ‰cOó}¼öÄ<\t2¬<x_¦KÁ”v¬ºMéÓªÒn_Aô\b9òÈqøl¥u£ÁõåcoB¯<bç猄©oq[¹D÷\tš@\x004µD\fððC‚•6ASk·^µzK”·ðªXèÊ«¸UAsɇÌjt”ì$·Ø0†R\\³9jf;| Vý\nékÛ0øíŠºIC––ióÐþ³ÅTª6é#²Ü½;¨§Ùx)\t+×1Àº&nl×¥Êr1á!PŪuÎ<5®÷¿\töCUß±çqÐ2hÕÏ@>Är€ù…?ÊFÚH5}Dj-{/ìç!æ{îAû*ô$­#è=M†É@[(ŧþã6¨#«M1“N¯m+k2öÜëÜiˆŠ,!&\"©x­›À ̨ع!|§k\0ÁB#°Ýd^{;ßfsý½\tl+DäG'‹))!Ú±Kố³‘‰³Pþé4ø'bûîl³ßE!ÿóÄx¿Š‘[ƒu&ãí™mG©x?é,BÎ/–§+‚OQ~ç½áèŠøï—mN|/܁¦ò8püjð«¸~gÀ°nŠ‘˜›š†O£ù\"X0¢#Í«ò—Êãv×üøË“'ÀæGi;ÐÕs¶k‡¾70ÑAŽ£'øQô\vö:À˜ÁȉQ4–?Ä%ñ»K?(«ƒCqSÂ#KlÁW®)\">b¡^¸»-î«w5ëK®ƒM¬p·2ƛ«>®Õ–päém«äÝ3G0]DF=MŠ˜»–í´œ9;Dg/xÛúJäƒj•ðx¯Ã\fù£ÃÑ~úFZ€£Ö㍮ꬮù‡íbdÂùˆöðž‚ßIí¹ŸuóÇ9Üh#qZ'~Qéf$íÉÀџ í†òF=MÇã@d‹J}´á3öÒãÍ˗FKa=M©B”=}zt”4ïâƒqªÓO@:ZÉgnÙ&Œ|MÖNÜñWU8ײ´N”ˆÔ”ˆÞ£j\v3>‡¦ëkÑw»‚­B%øb8ŸÖŸ¶³Bˆ&{¦: l¾EÕu8¶­“pHY2ܞíj„5È=}tÞ<=}tÚ¼BtB“íT\\\"B&Xû©н‡£pCRh³nJ\f±‹lsø|\v‚‚,†4e90Òï8È85\bŠø‹‹ñ\0%»IìLjé­Õî°¦ƒHË>ÐÁ(»ÜC.˰r5–´R²=M‘akYÆFÓq¹á$¶t$>$ÆR5B¬5œÄš’Pž6ÒìÖ¸eË%^ð7Ó!Ÿ&S®‹8lá?l6\f֏ˆ„òX*ÖòO„Ür,Çð@l±áqA¥¢è[¥j%†dmÇF*ˆ°î®7יÖ|Û -a?œ]ß´Ž›‡Uø\\p›•Äu¬ôŸÍ^u¬‡“-xà\nîõ‹#{±QÆR¯=M4ˆ‚·o~NNz+\vt\"¹‹­÷N¥ë#«*JC#\tËeÓÿÐ1®ð¢¬X ’ðx|ÈÖȱ>¬õ­w%\t7cYºÍ×àn£MU°$ì$8Ž\"…ÀÁ20棲¦…@<ŠG§âƂQgóâßÔÉzítwL!c;Š›â=}Ê~Ó©HCjM_5üj£nØ3BIŒÍÛ¨àуOè(Ü­= \v¥‹Þ·ah¦÷yÎ&ÆØ­‚Ñz؈°ZnÆÙƒÎ!Ì\fÿl!•S\f—\\bH†Šß9žX£gŽUDjײ\t+Â…m’”uKĔfò/ÍØ„áí½üàÁE;·¯:™ó0j|ÅaÈϮϧe*í&yÿj²•F4»x¬ŒbKyµ^$£ËÝß zBödC§;W(®d{\bp%wר]¬K¶ â\\ؽÏeZ·øÿز…s$;S\v÷X8†ü§$MŠC%ÿÒô=}L3²´Å胮䢯là‚\bï\\–è*í4\0{Nå™—*B¤[‚cÂ¥U= ÏLÌǸ”ëò!Â^DJ?Iʰ½nXÔ´0²©ÒÿMٟ5h2ØÖ$oøŸTıb!…\\WiStàðT2Œì@jO–Ô²[T¾g}!áà ÷%zP܋}Óm1pB´8çЎÉÑMè•Ò\\VÏH‘á¨\"¯5ݎ\n~Ù¸îó ©·øO²A±ÙSåF› ä¾A¤\0AÎãK›?M½P3ł÷Ìþ~q~h‰âpkp–üïÌÍ/Ï÷6tC ,ìo_ޅÓÀ·I.¬¶è;6uw¿UÒšÃf=M <¢€yß©~¼Œ–´™=}ÐUæ\fu’@Èn†\f›±üü}c5¥\vÍ\t›¤®\n$²AˆK=MýÀU¬O׈Kü.|ËwÕêV]‡\v'\"ˆñˆ}HÁ–·£ýi¥$—³x²ÅšuNüîáU\b–¥z3 ß&©<•Õ©çñfl£@DÜs^iVq·»˜Ý\t= Z\t¿›²&mKCqÔ\bë£Þ²O0Hh±Àz Ø6X(@gŒa\vò8¢äf¯iìôé¼M7Äc\bЧ¼=}PƔ†FV7+X÷Y½p\f\0Ls$#Wõݬþy}¯ýÏ{,ԟYyîÔKe–0Ý\bB÷æ³cgŒ½9£LýÉÔÚ\v\nm{ÄùãnaºÖ8£žCdŽ‹ã«û¾D³=M+’*ü®]Š\nàg~îHºø‚¿ÂKЦHÞډ^óÀøÖ‚Îy˜|±›œ¬‹ÏÌRcⅈ\"8ì÷<!›‡\v÷Jr8®’ðx4—ˆTpÿÒó\tÈÈÊ·‰’Q‡¹C±Ûç»°¬i÷= qׯAd5V¤“@—^#îË83È'¢Ö‹?U›ï_4ˆ2;K \vD¹FôeÎ劥¦\b(qbæ4®L'˜f˺ð@C!í½·wï–ÁH-Sƒ¸—ÒèÀùà”ÍU·®[G¶›\\NÆd=M„17=MzjRºçÖ:VEÆzæzüµÑÖÕɎƒ= „oZ¥ñJÚv}„ŠáÔ”²xM_=MJaTc•yýlÔfRYîì†_Qð\f|öšÛމKê,™Ñ ‘š=}!¸= úñDO]2¸Øæi’2qOÐÈ>ù;x¤”¤«$ŠSlTN­Á<S!²¶ñ¤n#‘XÏbëV®­![ܶËÑ×0#Uõ\0‘Ðâ>«ã Ô“H-9M3´˜L\bbÐÏ{M´k÷w,ÎQ¤q閪L*ô)cº 1= —[ÞÏä#}‡í$¡ËàT­.í_HíTq¼ðë\no?¸É7ڐô˜\tÓr@ã½ÈÝõq}ë•:(µÕœFâô\vG´³[ë–OC]Cu%2;„~€é‹mºˆy\v݌f›ö´\\Bí[u6×ß.Ë.ïš)\"w6;Ô?¸ìø=Mr‹9é–D[ظ“ë0ÕA²¡%¢a»”×Ùkv‚cŽ>¡,SL#‘f/]çŠÆVè<Ê'³Hу‚F£\\„ºŸä‹yÞÊs˜‚˜ôФTVŠSb9f¾t\v®’…o朰}Gž¥['€Áî'¥wͧhÊ}yöÎe¡þ¯ûùàÏ\n߆LTV€l0ÛXÞZM+­<k=}*ãå_°cˆM!úÊRlÌ'ø/#wÙï+ïáŠ\"¾Màþê6o›©{Ãi~÷Ukì¼C¬«jrÅJŠQÇ̸'›G\"r*,Ó´S‘•Q»ÇƒÖE:‡2¯K©œteU,Åy£Fƒ¿F¾+\\w.]C‚ùWñ:-§I\\˜—\\|¦[½kܞô\\Í@Gk§²=}¬\fÙÿu;„\fӜåõЯ¢­†\nã\\¯_ÝjÚw‡%µ([ßßêUôHÐy­ïLÚûäøoçñí⊷Y5ú(÷IFëO’C±zZFòy˜y#÷l›à?Üè?»âêê\nÁ= nðüÞ¶ÆÃ›CÓÔ:-t碊fÞpd¾_››â㫾eó¼Ü®\0‹¸!ÛÌ6ñrŸ£M¯6˜\"³°¯Ë՜s©šúW€‹ñï ©˜#;>ݨ\\?úÀÅa#ýw߁É!ù.w}Y*©›xü•ÔJÖ\0ôúõ’e'QșŒ¯:7nÇyrËÍÿ¼o‹’/Ð[rŸæ¿DCéBìåËìíQ,i)PâþôpÛæDIÌ\"Ё˜mëbŒÐ¡ÚL‘L®Óƒ…kRçz„o¨W|Š@\n°\bHä\"&¹‘ˆVØÑø2†@^€0´ú˜Â„­†Æ@DƒXù‚¸ÐÇBD¨Ð\bÄ\vUzŒkZ‹´èžÍ¡ÙQ#\bm\nëÇ,ƒ®;ò<9ŠGJò.j•¬.øµÒKíø°‡x£±õoP£)Ɨ!Ÿ¢ÿ×þ&HEj~͸\\i1ÜÃbÓÅEC3s°E´yaZŒb\v¬êA¶ÅÓ/(!¤ð2ž$iÝt¼P W©OS«#nËR^#„­áÀzeú™2K.¹ÏÊ/§ÇwU¦Õ}Ù\bÂýš³p)õu;™\"LÊÉ?»À]\0ĵÌØãDL3\fÀM0Ϗ5Ce¬Åä2ŒŽ*or¹Ýp÷Wø€µZ˜ 6”)*¸»ã¶xY^p]…aÿlö˜‚­oâ¬sC%Ø\\wd!iAÉŸg³»^g—ž\0âYoË}˜EÛ¨$ÿÎä[8›¹Rcµ€É¥™ÊEyÜ*,ÿl_ÞHª\0UBmUÚýiÑÉÿº®g7¾%\0µ¥žè̆ºµ\nÂ>½åڜ٣NRœž—+¿M=}\bš¶<ý͍ØQ²Š[\\·Yõ³÷EÜX·õ-âCF%&iQ\\¨o!ù´ÛÚØJ~ñ[Y›×fX2øËå¿:³ì\"òÖ¢Z‚%B‚^Ë\0ºìÌs:#×\nÀµîã?Y&0•ï\\ôVãkySL±ððåïÌK$ê]Ú¨ŽÆ‘âÉ CîÏø¨ŽÚùýú±⁽·$3ûYÂFˆ;£ƒA—Ë2'#ÿì$߁sÀ³£ À}¦Î&¦#€Â#ƒ£±\\©ŽrËFéÚ<Áïç蝪O+3R•nûbÕH!\n´d*ž_\0f\bÛô¦+lvï‹?í÷í¥“¦ÜE½ü؉ûC÷]ܾ–¶óQ$3„bŠJ1„û2±ºoŸÃ#!vrUy€h?typ-]ö\0kí&ÿßóàž»Ò’˜%ÎhõÁعՏX´M2sYªcÅV¥òEƒa *ð\\úÓ4{¾.= ÆaےÏÜ0 W€9EhˆnùŸ+FñÙAàØ$JMº$¢Ü¡›IÕáÇA\tJlvøƒP§õøÆ<\v•^µÂšó þ²hozâ#åŒÞA vÂù&7~-šñѪ6Á\t|’w÷/-åÆ®Î—•#Uº~Á/i€Áý²,‰ÿ Ã†àKX«o\\»H{®5‰}ä߁ÝʨÌN-o= ÇG(é<ˆEûÀf%ïJ'ªÖ£M ¸ð¶˜§áÔfuì44Ë0*@ú¹+ô¶= äQrg¾EÿHZgÐþŒµ›%þRkÄ£×ÖòÇs\"Eýhãµ8-ÈÜ\f6I,[>eÓܘh¦®®/)_uá\0û²Ì˜/ÎR,HjÛvËãCVǙã,´h%bJ§x\vH׏\\©ÚÜ$m[Mҋ¹8GF4.\fX‘gåe$¬ul7Â&»R]âì·¨>à°Ì\fÅÞ¾ÍöÅ.æn&ëÆÝß ¸EØk:fÍÓÇç™î̄ØçÀé°À†ÂØ•óQ)Rfƒ2±nFÇÐü®Yk™Ü¢ã91ÿÜ<|F:¬wmM¨G(ëòþ€~º\taØäɸ)½i öykÚÜ93L…â××<è±±Je5ô¼¢¾®XºÂ»¾C&é¥|¢4Ê£ÏÈ)qûÊ»\"-äŠlm*Á¹lÀæ_tzÌX‹¸=}žË/3´àa£¸›§Æ{cÝÐðjù»¸(zjÇÿ\b!âÂè¾RÞ}˜Üî!yE„NÑ#[à{Þ<¬T,ÜLˆLˆ¦ñ/óþx ÓõwSœZʨ®5\nϞIí”ßþÃ9š«zìão–½TΩƒØâ„Øm}[€IÔ½³D„«lFºi¯P«‰â9QCA̹ïð|‚èsÇÔ?h´TNt9Fje5õ’ÅjøÕ[lÎ= }«b€Üb°ó•iƒœJ;ÛèÑá~ Aó8·Èß·_ω¦sצ\tŽ­üB5m\n\n¡ô˜ÜÍÎYvY)K¥yžL¶2·…ë±Xf'/pvqÇÿ+f_â_¨Û#:ð“à‹¯õærm°M1S˜_V^ۈ«ëòdŠ¡T ÌA= ©ðAЋ¯€÷5†* Ò!d{½Ñh{©ü>>´IùD.iIióÞ]K\tF^ˆØyhû\"îŒp/]=M˜^½„‘ƒÖ\nòF0Exd?ÿ[è.{‡ü}œè±*‰å­2µKžE¥Èq6tªpoîL@_fƒËð \0\\°®ZÓ3­“…Ï[|ß põ™—‘¡'ns¥å—*6R³ÀÞ)I^T&ŠÜßÖt^èâ\f7j£4і¬érIÃm\0YÇ\våʂÖl2R搆p\f/–žk4•ý=M8XÀ;Àï‹=M-Åeü,û³ƒ+Š>ŠXµ®ˆé¸Cp%iÓùLº£¨’?\bB*AÈbçþš\"¸H¢=MƒÏê´VnìÚòÊ^ÊÊß´\v »† Ï¬Ø K\"׳3ES\b˜úÒÒçG|—IÐa')~?dzÇvwãK@ÚÔeˆ‰sW‚¨ˆÆÏŸf©#\\’Óá‰|¯ÆaAO¯³Üï Œ\nËߏqeÌõŸwŸY\n„h/a’݆<ÃÉÉ‹@šå„]Q\"¶gAðX$ìasFP/JûV×éûZ^M‹E]½±= T[þä¹5˜Éªqµåɰ(¤ŽEŒl¾LPpãÑû´@É_ê=M‚*€t¸')JÌ?Ñ|…žkÌz™Û$¨ßóýKnY¼Í·õÝl†pӁ4rMÒ\nD?pÝäÒ÷À²Ã‹+%&™´ÿZ¶Æ¤Uuv@\v—Xì@öèÔ×ô¯<BÓ×<?5˜0¿ÇÛ&‰´%Ç_F†4ÖBÕ\\#hXÙGæÅ4Žý|¡¥‡š×…Š\t‹\\›ºØ%€]ˆëP™ÒW°Ò;yz'ÔSnâ?€îXð†FñŒåêy³ðl*–A… >€P¯7†#½ ÆZÇÇàr0Ô0ܦ‰:Y4g1U‚ËD:¼º™EYóV-Û¬‡M6gÉ)É.Z®)Gý±NN1çÙàÑðفf®•ö<ºýl‰ÞÑg_.“\nŠqAO[Ee¼ÆÝÇKzË=MÆÊkÖ\"³·^˜òÄ7Ôz‹O€¤VsÅç=M˜«6xÂ]Óv¤ûÕsì¢V\fïc¡C™æƒ¿Ïyr2z²³.Š—å*m¦úp¥²Çmïx£\t¼8Ü® ‚Îq¾oðçÎOKAïØ¼QZš+*ÛkÚ»†&Ø~{I÷¤Bþ,e˜ÍýtWÄô$W”\vÞ= ò1Vp†bEw˜”Nt‘eVÐsZV©G\t%’­HYvûdiPö‹ÏŠ´—g™4|¹*w¨À³5¥1Š=M:““Ÿš7ŸLoزs›}ž[ᘏO%=}<§=}™ËSk€ðԝ¢'Á¹Ò¶\b¨é:¡8çȅ>¾EMjxd}Š,É$EæÉo®w?Kb¤†³¡¦¯Idc<xg@ØÄ£\n ¾‚j 8õô!<)÷1ƒêØwBê\\K‘wFª…ÄÎKÑÍ?Gånh|ÁGˆ\n¬ûóv‚\bçF³Òlo+k†p\"ûÜ[©È{ž®Ëäüÿ?:CíŽOawçàÌî:{­ÚÊ\naMÕX÷ùŒÃóãÂH˜jAX¶¾ÜË]@þõŒ«‰Bû@¦¹h(芿1X<zYD…ʰði}+Пèa±Ã˜~ûPÌxԙ‹P„Ç‚@5£Œ{E=}/ŒXÓrÞ-§aÖA‰ªû'¹Œ,‹X'|¹‰C€hÞuAþ€±U!UwŽÀŠmm¨MY¿W³Â&\\ƛޥµ„³Ži…¢-yÄ+ê<“áå®v}M4ŽXs´V¨Ô\tdÇﲾ= LT–’îá圉YY,· ýW%â\0 VY<À>O= 1\f,<Ì>«É>ԏfYˆrD)≧n™n€\b±µrˆÌÉüPº„!Ò¤ÚÑ[ðÑï,%×\0=M\x008ªjÃî…æ%¬±Ou<úÉê]sa€Z‰+ú¥Ð5·klÒN<ە­ÄpÕÞֱØcD9¾ÒPn‹(êÀÐèë\0ɵüU2uOúX´{>?,ŸR\fé²~ózËp˜[ùã 9Vàlh‘žt]4HÕã¤×•ùÔÍå'BGí‡l¿+„Á/W\\Ñj2~_Z:øŸÑ™£Um‚Áeµ„ï\0ù\0•Πœ­˜¤¡éܝÅ×¶$¦ï¦Œ+T>ˆ¶ÖÓ\nM+<ËQ\t\n•\fATÈCòT´ùB‚üë=M1‡þ'óЫ–\f]Ì—] Ëb˜Ý¾Š§+Äc= ~m0½’:\f%%詚Kº%ª5ILÃ5UN¨ï¢ Í1P§œÇyîåÄ\\ˆHÂ4*Þm‹ä1«S|‚m˜Zy…b+½DI&x~”ˆóª¥q©ž>ç€=}‚j¬ÅÝd Šy÷ÒÀk(HA(ůEÆt½Þ·@ß\\WPö\\ßù%P™åî·ä,£t½T¿8<gàta‡\\ftÒo˜ىßì’#:ÎúZ9r³ûQ£/éñ•ƒw¼B(KÚPdî\\˜ïÂb’¾àpVÖS‡d„¾êÛ9鿢ȲÑIä'¬¬:Æ^UJFY}>³\0·gÞv›5†È4w\bÄQ2„—+žI–Ô„zoÊ?xåŸâ‹Ò9G$šZû©¥vÒ[æ]m\bI ðBÞþ„ÒÑ¿ì…Æ“”L6µ@Tˆ\fÈ.)t¦\\~:¯1ò1\0—Á±%gÄbøݪ8vxâö–(\0ª'ð$Œ¢òhh…ÉÉØáŒCš/Ý·ZpZßëa\b;#-O´¡—Z¡„Þ>Ç 7ú9pD’áIL Q„€¬<_žú¤ùÀÓ.ÜÕ9œaüþÌÁk6h $u[©&0.gÞ]I§ ƒëoˆ£®ªØDàAx¬“.xý.ˆÊ=MðòŽËD‡Ã\\’à~è½KŸÜ0ÐþÔb<:þ<±v@ %6°öò\vP›Ï¯kÈ?À6ҟ¾\n¬èô,9§Ó“'†(¡3ù›µÂxLñ®¦òWÙåuûb\b/t¾ùUuh\0×x|ôxKÅl¼;É™–·%D™õyËÒ¿sâF*_Ô~²k5±í^!礦eAxèœÔR¶®VLƒÀ= 9ŠÞŸÌKIñçÔq؈Db|‹³­tUmLNnE¢=MÌo\\¢\tá?ìDé3|‹{|ª^œ&„“r›ÎEnIbrûx‡’”ƒ‡\bŠPg<Ic^¡æ„|¬,”Z܍\b$‚ŒR†]Ë&'fŒü”’,ƒsRtŠŒ²s!ÓÔDŒR\f¶ØdúÄ*Ôàp$¯A‰‹‰¡~ÄTه|_‡“D´b>òÔ¸“oû’\0Š\f济D8ƒCjò†›±ÕœÏ‚ØD½Ž¡Û¹ž.üþÏÇG情!=MQ‰ÓIQâZû¢Ö];¸‚Tq¥3VœÕó¤ü¢ºòϺÛ,#ôìp)¨&ðü¯A?óxtý‹’çÏä<…‚>?Ì]I@¬\vºÁËZÝç¡O:¹ß\\4Õ­Wœ\\L<Âf®\\]_\\Æ–ØU&(JU0¯1h¸³}E´2š+º‹‡à5ÁÔ¶â)Bº¨¡Â“ï¹w\th°Þ².Vò¯‘²ê¸x°¢Aú2•@,»?CäN¸é6é2ìFFc;흠#&òèU™[Ò5‰Mã›\njÈÂ\0u§Þá![–L!x«8ÈqŸ^w\"*Á—‰µ,*Oï\tÊ'–Eå4Âê„Õ\n9»ÒPНL´žDƒ•ŽÅJýŒç¬¹_£Qa>éõþF Ž©Ü\vF½\\ Ϟbä-ŒIù9»9›¦Ó8öT¹>qXÝ“Ä%>ñÿ\fGnˆp6@.ðmë<SF£Çâç5›q¿Äš@lÿUA,Í õî1î\tRÑófpõ¿bqø­7i3=}ö‘Ù² g\n§Ù›'ϫƞ÷+…9\"S-¨Œ5O= ŸZ#x?ð?ŸyrAÙG7éh¡ø¬sÇ\fc†§¦à–Í!D=}–†«râ?~ÿPW$Πå†ÙÒ)Å©‰Œ•r'LÚý˜ÒÖZDç蒥\"F]d)Ó«R{no+;âaÏÙdyiJó÷k“_eFRüV܍å#;Ï1z‹qªw÷>±«]8nLÙ¶&H䀻uÔ= 35­¨ÿ')αFÛ r˜bÝˆ+^Rà‘]õà/nmÚh4û‰wÕ°&´ku]m¦GUŽnžŽ3¦Ýù;‘&¹…¡Ç Úån!úŒ?´o¨¨+jØÁ†i¢±\t‹ä}ã³ã&ØÐxŽò+½2á¼+Z±­Ð¾.)Æ\\˜jLJÀý·Î\\ëEãuHþ7°ç8:&'.§Cóç}ˆ·r5ò1ïaZþ§¥'fð«HÃÓèM¨\f¡©žlkžÄ¥íä19í¿ZäŒ#ý ùédaTk\nxtƒy.XŒ×PB·CnŒ„ëæÒýŒédbùG­GŒæäžZ5_‹aÚÍ\nïyħÈíyŸ¿&2ulŒ´‡üþ—Š0ƒHÑ\0ÕÖè7~‰±š9±Éò\v_ñËD£)H5Ùv,Uµo wËMì²Å²Q[gÞ(\v22x\0ˆ=}MÙ2kíërCÈZ˜9\b\0!C%ߋY΅?40±Žs¶˜ùTƒl7žœË…¿[tDÝ= ;“'w£.—¤Þ\0ygZÉ1D20¤¸¨úš{ ú\\<¸˜mUåõÇøÌÈH…èíŸS=}ÈÏ´‹bÿ×€Ã?1RC,(\0xzz}Ù·w\vTÂ6<5Ã¥[?/Ø'8à\\(õºæ6òÇ\v(a!_Üc«C|KkÆH\v®[oäÙv¡9œ:ï\v™î¬E‘Râ„\t\"ä›!iJP‘}ƒ‚¡íº=Mˆ³ëÏڞ”uYý´´ý·ÑCmȒÓÉ›Û4¾ˆ—¡º+´4ë»3ögeâñIö’èVñœð=M£pRçõh–¸¢¯¶–{Ï)¬'ÊN°óŽ\fÄqX0íܖy§<Ô;ø[ûKο(öøOíå\bû+Œ«ì¯§ý®Ÿœ·Yh»\bØ~Ù*à9¸AY=}ÿQÀ@F]¿è'muӉ•3JÔ¢øõ¡4GÎ1l÷«ÈjÚ=MÉ@\f(¶H¡ÁƒßªH—g.’ñ…ã²/.–V52¬¼ÄLÏ/Š[T›ß-þ&Ë\b@®z»æôYNß»ÅÈh5øÐ!5Ì1´\vƒvm§£…ÞªˆÕ&>Á·ô×\0HŸé…Cý„AwUÀœÜnýa$“ü*eÞÊ\b©)Æ2ÚÇ2ÚÓâ %“òüï;­žŒbg©f.•Õ‡5E‚èàIýÐ\\¢„ǺÚ×#…êsÓl:Ù\"þåTçà<Ýüh¯fŸÄr‡ãüV‡£l\\YÝ;Sï= ÐæEQX©œÂ»\v= Ð†3z2=}JQ$Ø[m-FV‡ã™= Ðf1z2½ís¶»éqXRxªƒñb‡cÍ7aïרr\\Oŧ.'\v/)*wF·ùGÝ]ºüÝ*'Júm¹Öpǂñ(Z-i÷ð÷)bA©^$e7Þèçȋ6àïº÷.®ËºÆr5¥ÈÞ)Þq§Ñv³Qº=Mo§Ñ2¦ÑšVh,µ=M¯3S©Vø¥Ñ\vü¹=M±Cò!³ÐVnZ\bšVȼM4N¦0šCt<gé¦×úܽ}}‘,€¿œä€\"ª –×¹ô„é$u„ñÎfN-«ìÆ67ˆÜÆ>&1T˜&$Ä,Ç\b³<Ék©®ta-äëX¢žMHÑ:mÐ\fõ¾é¥kNÝ5‡´ùåÿ­ÑzäQÿŒ“㿁\ná€ðÍ’\b\n°> †õ<¾\\TŒ¯²¸zPÊ´‘BÒt¯T«©\vÀg<Û(†Ç”½HüÆSø±»]\f!/\vº¦ð^FI= 7O6=}LsÕ%'Ô¿ßSⳋ&ÈuD>²¤å%C,­΍,¦”‰Áó\bÔñ(ŠA„0Ìì‚ËÀdj@»W!¸;tv=M‰ú®²qJºðS\0Åq])šqSª¿ß¤—lÃcæ‹X&§îtxþ6£ìÑEÕõvV—^ÇOv¥-Ä6\vmn M*¶±)= RX3Lñ|x1—<6²¦Ç…MO@íÃUfk™FªÈ/ûëÁeÞ&È/{ëÁemcñ.Í§ÝÆ?5ÝC±)8·”Ã̊!ÿ@18%¡®¤æÒñ1ª= ‡¢Íwùü¶“jÀʎc‰*¨ÔߐuÁsdHxõ9[ù\"ùˆ¼4z0Å$ØÍ¿6¦qÏ*äL7à\"1‘^ˆøë¸Þ2Ñ¥Ôyf7¶ÙZ\n7’Ÿ|Š9‘8*=M”:˜äNcßEêkHª)·4ºÜAÞq~\"¦Z¨ìVv@ŠºÃ­e¤+ïJÌ7¿Ö͑^OVA\bôNÂj®ˆ2Ô|I9vcP̜½¶­£äSלÀe?±º¾?: 0™ý‰W¯I©öü«¸L~íH2H¶= KjóÒwFþHEiø–\fYø {µ2€/˜\t#–=}r$$•\b2X¡%X+²=McøéŸÄ£oÝëטW3=}¤=M7?®fÎnEE¨è–\0Ww9g±ÕY¯SK*äz^˲4в4pæm±ÓLÐa–u\bU±h$ÍÓ\fƒöõ¤Hâ >®­+ ë@=M\b°Âç\b{r˒‡mÇT²qeÂõ\0zW$'/Ø\t?;N!‡¨'ƒ¯ÍU…úv喣§z*·šž§kø‘¯ÉÊ2˜µ×\båJäkÕúDFXdʸv4m¶\x003Ø®JÒ<1̦\vUÝVó®šSa£?â¨SR±Ã+¸1þ@£yI°Šhø¥žbkªSçß¿K–\0×•dh,\n%ú%ƒõ¡ÐIÊ¿0M[¥è<Cøò,ø´Ùòå轇¢q·ÆzC¢\n%–þ\bõŒ\bqsNÎ÷¾x½á[Q0¶¸óö\\¾1ÝgÍüô˜UŸûs®=Mlu\v‹®å\vN>ºQÚ¢'\v,LsEÈ…Çý]q=M_ånCnJXKšdKL¬\fÃJ²¦š\b‡øÀ¬\v²ü =}öÛ_]an·\"®ïÙ@¦:òÚsøóàî\0¨\"j€Ó~w@€öSå\0~jc®Üß}˜zÂÜ[¡$چµî\"×7TWp¥/K6z7î8:ýE™zü¯h+qÇQšr¥Ê²‡Ë\0w˜Fj÷¹möàæ ;÷IΐlP›¿{¬Ž2aƒ7Àli¯%¯îHªÜ5…‹C.6FٌÒ}©š±¥«BC‹+§ 7ªï\"ytÚîr•æžÜY±Ûð=MDœÞª¤åÄ ód¸úð5\0E¦§S@Ã7©B'¶ý³¯õô¥\\-úËÕ:›%‰a¿g@–›ýŸ\\wµÍ[©ËW\n7ãÒ7÷+v6Ü҉ês‚‹ŸR²ô.ð$q|ŸvàKO8yFLéÒ\tÓßvAÐì*UTªv.ÎÜêŠ0å\v4ý\n˜ï2{9\f:\0\fRXRg'e®$^ér{ã ­{Ãñ=M$͵°„[= bbâ×;¥5øy6KP³\vm\nì—û–eYÞù.W¹‰m\0ÃÌLñü7¨}B¼\f‚ï\nn˜\vY#ØGiÀÜX‹Ÿ‡fËPÁÏL‚ïB“ fˆezKHó<&ØXæ\nX[åÛÌÖC{{ò*rŠï3Bó—6Ü­6¸¹ÓûÌ .­á ÷\vXeåµô´îŸj]©ž!Eƒâ]úñ„úí%·«nòl·—µÜ7—u]9>dœ2Ä\"aï†8úr¶±–2ZlÖßð:¤áÞ´QÒ²\výžw›\0!|µÆO,[F ¾ªCá&Š,ãÜ[Àè²\túÁ±¼º‚ú4$¤Bý«ÙP§%= _ÒÞþ(€˜S©>ç.(ˆŠóÛΩì\"Àïy’¹áèàq®ôµ›#å~ãÊç—h2;Ì<2vDŽ®ÇP= {Ù‘>܊²/!‚Kü.#ÅJçhÞf#:ˆ\v7H8Ž \vkän·‘dŒĊgOñÎHÉÉäåù\v“ñF’”÷v(eؐ%ùë÷že)Ñó.óŠ8.œcÍ'Nµù_¢ÙÚy¬<ÈØs4Q Ý¼«ò¦°‚<zйª\"¤8U>c\0ďq$sø•ØÙv6ï\fBA»Éҍªx \n\t‡…ÕW=}F´PÚâ%+ô¯Ú^è+bsA'R‹˜ÃœÆ.¬6N‘Ö$'o†¶/L5(Ð>Úà‚ô/)\"¶pÖO‹1^mÍFjìM¶ÖxZ,–7‹ò­‹íi¯9ºd…?¦¿ŸL¨#X*c\téB€E‡L澬h.¬gÆ'Â{ƒ”¨ýN¬¹„§ˆ§º‡Œ©'õñÅ>ƒk „ïi#µ#YhÞØ)I\b內áŠ5/çgäa©¥”¶˜œ%ž•}¨'šcKó×ýæëÜÖûˆ—ÖLÛ&4é~§>~©‚òçA·ËÊÜWʧø·;= ;#>I8¸ÔïG\fjh¹\\Ð{³LËIG‹¹EJ’4ã•;c./~\t÷YVÅ,Y<-Yåt÷·\"Å-﹤„Â5Ò\t[ðÔíãcor½‹6~2¥œ‡éE©µ\v)V•þ¸ç|9ŒV?Ќ/6éièÛsΈ£ø%ùY·ñÀIûI Þ­ËG \n«KcòûAü=M+ñ=Mž~4$y%“~ÔJŒµ7(>K+.p×'‹é޹ßdºZnHß׍6úIXOá<=}ì~9ŠÓÏ)ed~AXÖu¯±=}îO¢8/ªÓS»f/ò1@É= qùKV¤ëÄÌ@m\"UPۄS= bÓa…Chðò¿LÅSAqFEháãHwNÕ¿o+\fØÃG¯]:×K…ñë1HË4= ÷Ь\b†áÌ|®É*Š~µ÷ÎyGûjÀ‰ñË&þzM]C+;ÏÉÎ(çë=M}û†=}ôw½ªéäAym,FYŸ\tXŽÔ:·_ñè.\tOºŸ\"Ä}»ÿ}Ú\tp;7HÓôY“Z·Ë« í0Ä7ÕÚ92*?Y‡NQl)Ì\bÛS×\"ŽCvÖC3|›ÒªÑO³áYý…f\0ՎhuÄqô™”U’˜¹d+Ùmivm8|Üï'ÀšÒÇìRx̓æ‰Ã¯P’£‹)ãV¦Á4hv«Ì7èeÞNË·Ýt$boX¿_ze¾FASq9ωe€¥+òÇÔ¢~f0ôôy«‰\vÄÌòDó_çz˜<m¢NIäàz'ÀpRñO_\vÆ,×NU~b|çÁ{çÃ{gT·,h4d:L-àF-àÎ= úU£ÅE£²c@À¤~õ¥¨n%bH™´ôSY¸QÄ$x±·N+sÜfIËKÁ\b‰ ô޶®ë¢.ú]›Bm_È°ÂÚ݉dW¶*?®Oõ¦¨Œ$’RüôJ= a…H= ß„ÇŸ1h̎P…HÈE қÃ|xœ)·jû°¹Ûñ㞗‰åY¼S_^ÑO¯ƒ3PAψAŸztl߸;oÿÀ)±ø¿Kiô[â\vµÇËf2ûÇ\0<8f¨©f‚QˇŠ›(C¾ÄßR¶“Ñ<ùc(-P҆šLÿ]R)0Ç4à0ÓVy¶FoCkúÂ;\vÞï7‘€ð†vàfhkfH‡2†LkvîñA­ŸŠüzTJ‹òÖé$ÁC¤MK\f#üYì’_†°ì¼H°jºîŠ™xòªÇcŽ·Ã˜Wà|ð7#{•.vÜ”f»-Ð8£Ó”õ‹Ž°Hdô…äKv¹iâuq¾XÃÅê„\bP#€^0•f»£.Ì?“-‚-žQ°tðáÆéâlˆ[‚\b5‚5”©È* =}ò‚„Hý‹;\0i³˜¹“xs _½¡[Ÿ,½=Me:NŒg¸±¥â¥èÑõ\tD¼ä$©tSä¯Ë/Rµ.$¦XÂÍF4?ym·L¤Rc–LÏýNô\tµŽH¸¹sÚ=MS¦¶J›“q“Ó“3%ë\\ãLÀóB“ !ÓʈZïwöH§†z¯IñÛB*|ÜbZ2“Fj&Lª¬>DŽÔ‘d9ÏCNnoµ¸ šû*Qu“û͓‹÷‘¬  ýÈÕÅ= Uë¤Ð3L©ÿº÷«dû— ً|\"máŒy˜ïø’=M¡6\vâÃÐÙ= \b›dwÃÒæKçLÆÓ?béŠ;åJ»˜ÝÈÓU”\f‹‡úJ¯š\0,R»\n·¹¸Ž!h~5BKòºHô´HnàIý·_Š‡‹0<†ÔƒäÙ²ãÏ詓®†ºŠFoâ[ÜO0ë9j’T5¾‰\t_o¹)èB±æÞa™K±P5ý­4OW1+ê=}[b¨‘z?{•ÊÇÊòèYPÉQ%õ˜Ìç“A=M—·µÒÈw–3âÏøç¿Ì¯°ƒ*€emBÙ\bIÉ~ÞÈÕ®¼V‘ÁÁ€éý>°CI›a¨%Èýx–\n+¼áü·ÃVõFHtPDtu†–ðÒݑb­?Iz…ËF\n‰1ƒÈÜñ¸Äþ\\¶¿C؊âœ9MP{®Ð¹XmÀ¨£Á¦è”1jOÔøŠ¿r4G´r4Eƒˆ»¸Ë€?á;_ݧÙ)ôØâQúké²^í£Ÿ¶¾Ù¬H}H}¶Å ó2ÚD}ÿ«r4ڌÒO 0¡Ô‰*4ú±é‘vԒ‚„mWÖ1\\=MáG,ÿø+ÿØ>å¶ôòâ8cWÏø2\"Gs¿uÄ2„8©=Mú\fÁ¾<X¶FL¦Ð$Tè<Û¿ªÓÒú¥Ke•×Ù}ìÊcckÇO\bÍý‚@ŒQjÅ\"Y˜ÊR¿ôìÓ$Ê{‘-NL‚Kj\0p¯DaP+t¥Ê\nØ\\ªÏ¢ÏåÞ<HòŒ~k@\tË\tkºÏ@Š«²Ó(î†EÄ;\b9c}±@èϼ€c2\n™É_hOùí›jݙo–q´ý•$o\0.\n?¹§\bȵi«ïüuÅð£(™Óß«Ž˜XUÙXš»ß˜ˆ9 aX˜(ÉãOUޝcÑML,Y/¹EâÇdËӅAaMþúÄ^;¤Lbcó°ZjÆP‚™Rw3C’:¦\bËōsÉÿBí \0 âL­Æ dÀ J8[võ–¯¾’î>á8qRB˜¦¡\"TŒ-Ð<ܧ+ÖÔÕo¶ÆKwÑ×ù<eœbö¬­»h^“%n–ðóí·=}SŠ£PHßl×)+ÂðÎËu—¦YÔ$öË3OÑfºH6a(»a.dØ/?ZRG®@ºý\"w~o¯ƒÖѐðL’i£Gû8þËâÃò\0“zž¨1úrÈ‘†\nï0úܑ\\{ì~/L·G,øBd,[iÏ¡bqMéÈ·Bœá0§ÂÓ>ª׎Ù\v¤í¤§‚£I<ë4Î>eB$°ñéPêBÍQÓԛHËf\"f¬SË¿¥³ò´;+&«V0[¦·è¤Õeýãœez“\fc1ü‹=}(«4§#Î™Áï•4ÔúýÊ´YӋˆ2H I.ÃL\\4´2-*™\"“†”–}ÄÛZ7‹É¿p°®æž ¹VM9&S]ÿíaûÇkû&{\nÏ= }Cg,‘s\\Ç= Smދþ%ôé~ÀÒò‚ù„€ÏÂOIêŽßæ<€x7S[¬)o!Ž›VC–×S×\n~E'StFc×B^c+t0Ùóäù#ê°+íÑÊÓQ\fÔV…€øPÂÑ\0(ü±Ñá…M\vÞpÓHI)Tπ¾\\ÀÍ@ w±¦PþÐ!œ1U,žâ3“YUÚFú“èW<¾‹îÐ}ÉdáßÞÂ\vd4_”È“±Dr*Ë1#H…wÚ~‡@َœ‡d_v“¶²ÄšûCÚTüÛ¯AXV“^ŽNuAEÄ/U.ÖA^dzÂN¾H€øGž‘¿ÝbmojFhò£ý“R©&ç}®ô:ŀvI|D +’×þZç¹ïANƒ‘«§U~*„AOÑò爛lxûµzãÓb ØÖáIք‡¤âMÙX®?›–б¨f¹\nÛ\\¢)\vÎþÍK6ËW­µèJBÝ>Sùýù‘ÞÂÝêZÓìoA:§N郠\"B7©?áñÖ:“6ÊÛ¡Ù,eXš‰Û—²[@¤ß'\bh2¸I\0¯«xқN^\\6\næL£}¬^u··ûNŐ{W¾÷9Ýn’0Kõ(ÀvçTu@Xz£Œ!u›ìÀ±ƒÞ“é윀Ðm4vdojV›£\v&Ô0ìœðEÄvd@ê£KX´PÏm?¶#ñ²bVÓ,Ôlò²XVÓ(Ô\\C£K~õ„yd@Ðmø‘Î\nE˜£‹ë“q\nEØ£‹Û“q\nÅ\bEH‘NŒõâ(¦wɳ•(ÏíÏT×õ«›?Aêú˜jDWkqWÍjJú\v¹\"è-Yûò¸(P[Ðôëd=Mz\n!LSQ†[,lÂcSQz\n œóóLMŒz\n ÐôóLM’z\n (4Kðù÷\n\n ”laW(õ¬³]pâÊø.àZ×ÅaDƒµ¶Ž+HÎӟÐWv= \v@᣿ZѳÔN§µ\nw?•N˜¡CŸåÍÕ\nêS˜Aòªõu•0ìší˜ìš=}/CíwڕrK¢BĊa^!Æz UÈGÎURìšÝ²uc@—y£ê–ŸœÍêS˜1M¿UU–#òªõ^–CP¯Õµp&¬†\tŒŸ3ƒ<Pì|~!Ñ2b«ÿàñ=}~CÝ0ŸyhE)ýºë÷·âÀ<eÃkOïABÃ;ÿhu…S‘޹ïw¨~öŽI{·Þ*\vO5\bfô¶z\tqê»îíàŠÄ'>;?4SϱÓwèÜÌQ›´ß´%†xôÙö=MkLµ+Õ·€çï¶ÿt\tïJv){Tt:%Ût9¾\n‰=}>/KÙ–h”ŠWÇlû:ªÂÔÆ¡]†èÚ¬É\b,L†ô’ôϖÕtífHÃsX&_âE€3£E\v9‡®çÒ¶j\0&_Œ%g·R_±Àñ®_uV%B@¬£ç÷ÂNFÂAÇò¹\b\"ti\n“ÅsÃäJ,ÅÚO%ÏÒ8ÚûŒÉ„Wi\vG˜¸¸_®DÛOÀghŽqQe±ŽÎv̰µì!QÎQZaðUp4…£y:mëc\0M‹e[ìs©ƒå‹K,º]§ôý˜P­î]çPQb‡,³‰=}I‰™\\ ÝÔÃô'$â9thóÇr\\Ú?ù {€·:MÕÜA@'cî̬€š'˳‡‚¨?'¶¯4¬\n7þ(¼Ã…xdíÙ¸«}ÁºiHcè$lžô“FZ±z>HÌG£›™¾“<É®‡d5!í¸ñ¬y{sF“µÆˆÌxM\0й݀\tóÆ?8XùRS/ßgŒ§^qµêò\n73ÿ€ÿkÏk”ãÓއ2ätL‘*ŒÚäs¬zô0¿ôl‡AP\tt5¨*=M‘ô$;<¢ó1»&ª_åyIîE4MóÚÑ27zóÇy¡„Ù¼ïúmÏV菛áŠišÓê\f] »8ìi^5è·^Œ\nx‡çÉtÿœöþÞÎE0dRû#9´¯;uµ«Ä¢=MÖÃÁæCXEx¤èùÖê¬u¾BvÅÝØ†ÁøÔ½”‹ô–oTŒ¤óïáø:æ\vr h„õN‰~¡Š÷¥”eì“Ê<‰[”‹4{<ÆN\x007X4».íP3™×¤¥‚2ìòZ,‹C'n¢å›ø<í{ý×?ø+ùî­$Á3òE¬= ¶ïbÇ;›•Ô“¡«îqÒS°šçÆz)ÈPž—yrOžßüÌց¼½&(­ùWâ¥Åi¢)Sè¿ú%Ý):5ÕGE_všùÍO›¡!S(\tÏ©M9^ù“Š'ׁÏó“\":¬¸9º£g¶\fo‡hý:<¢)xy…S}àŽˆªäËØJö†yAd‡N¶œ,vrC­7·>Td·Î\\:\bÚ'æÇª®Feî&bA±'õýjìµÄ=MD½Êíó¾zªZ9Ë寠ÏÌkþZ(T(œÁ¢d¿¦_Vd±ÈdHGAC½ˆü\tÜßÕaÍï”3Z\vS‰>ÀM\\p­èYr¸o9yå,8íŒ$8½P=M«ƒ#{ªvPÄ©Fz÷#5üÌÈ»¼ŒcÓR›Îàí×Ǽxp†§ycßÝóñ׎ìx½\0<%‰ ÃêÎ_VÈ>I2°é:Ù\0·¯<,èµh4€éúhf]Û(\f%w¡´˜œ?uÝ$Íf}¡@LWQ³móїàN„2†ÏßR6_0#¡|*p¾_&\vƒ% ƒwÈObýZuý\t%/½õŽb#ää¥ìß&“OõLD7ýþŸÝî£ÞŒvä\tÁšIZc·= Læ˜!F\\•#¦ÑŠ.ÂÀ$·„»y”l€q4F҈Ñ,“Ó¨‹T\nôŽÝ)O²™TØûÒS<Y}Ï7“>Xý¥2uþzq_X~´Ix‰|Þ 4Îȅ’wy‹}®¶”ԏøŽ’ûqj‚ÕŽ­‘_¹%åŽ#×OµÃ74ƒ=M«•‘UƱzi»jÊB&ÔòfÞ´'ÉÉÄb°N±Â¿ˆbÃ/ÔKEߎU\"x7_M6µò÷nüˆù\\ʇm åTwågÜ<”LpéY\f«Ä\v0Z\vp³ÜñÞ½ûÕ°‡+;s¦ÈÉoU©Z¢1ànɕ ºE‰´ªÙJŒ£l\\t %¤Ô\n0w52æfš_ÒÆLQÊ­]bœ´ø#úÿ\\O‚\b9ʤg>ÿy?ªêÜ”¢öd“lôg2e¿•æ4íî¢~ÃaAT!\0*x1¡YÛx7Yíû£y’¬‡+â!:0ÙG=MvºF»´î:‚¬Ô˜„}„ϨЬóy’†-½py·øš‘„*ȉ÷¦ÅöýèxdjÙÖÇۉñsö¥\fuh”½ö­‰2€élDjsÎkŽÏüªÃ’OÉ\få܈j>˾çNNddF9>^Gߪkàx×W‰QH8í!?È\nÐðVÀº.g—c¨v®øü6aª¯†D¦„éÝä:1¤“*‡Vû9©Š0Í?i\tÝ\b5¼‡H(h£jÄB¨Óùcc$G†Tù[›jvôY卵8™ÆêáXÙd½&ú©؈ße£v¡m?Ìj\"=}Pç·2V’Jê9”­«iˆ—/ó‹’= ¡ž!'>óY\\>àÖ(†¤§ÇəÄד’ÇNFF҂€&6“dDlFkN½|\\&ÏjÚZ’-ˆ?Åõ= lWHxîtŸµVäFô¬9HXž‹1rj\"¯¡}ŸÛò˜©†ÔH/ðKçídW¢C_»BGÈñ¹­sMÁ9Eizëc:Þ0S¤}Òo\tJáw=}덽ÉóÎ:VÐq'UécÄ?µ$)·µŒKœÇ7¦iýàô)L;(IŸ½FëbÖôÄ=}ÐP‹¼¯¾’×ÕërfJ]ÜBŸ™C~柤a÷ӓ…@®#-œVÕwޙz+„ÖöøÈ¶4Q¢\"Ò©a–Ô08âÓÝpöh%X6àýƒ6šˆÂ‹‡ÒiwÉÃ-Tb\fÈyðÆj«KŽCÆ\t8¢‚œa›aö>böÐyEÞm‚«\v¥ÍUeØ}ç]–˜BÏãæá\fËr>q¾_KêØø‡ƅâ<ÈäùýUö\0¡ýƒæ,½åm¢/¯x$öp@\\ŒGùò‹jW\fN*W1¬›™'OÓ)µÄ%2«=}ˆI\bžlƙý,Â*2+¬±ò-5 =Mþ^mžÙº·ÛWcd\0—MФýy÷NàÈj«êȖĚÒÁ«Q9Ó½‰»5–¶ûzûI£±½¥¶ŠUqlëÒ\töMzLZBÏiLO‰òqyèùð<ñ\t¾29úôÊróIŒ*ÆßôßÏæ1)әÛj؇æÄ£ÆÀ=MyIý…·…È·.ÖQ“…4“Å-›Á†@V¿ðøÉXécé2˃ðhÍ?\\°~gt,ŠüCJ–58â:â€éÿ§5e*O\tUD \viø=M4j%¾¦ñs”.Œ’Z¶iâP“í¡ú‹às±…·€‚nò)æe¾^ZMû€O'ÿ–ÝL­î·Î(êçv†µk0r=}¤Î‹žò.m,ëHxßnêµ|Çé<nÜMCèx¯=}Mÿð{z˔PëzôG÷Q¥„G—†1ÒÑŸR1zmÖ#¶0;1= žà°7!îãáN%ðþ©¤áམ½lòY\b}̊#}¡Ôd½-ó7¤s‡~­‘Ž;ù=}:¥úœÕõ­+ØqNƒFžEÿæýÄù8r…®6ٛ(O靛õ@=}p¼HÁÓ­ìA”’“¿qͯ¤\"Îb3 Pw6Í©Ô-kÎ^w_Êý¸7‰ëÓnwm6Š­‡(Î{\fžE#ÄÂÈS¼S—ÇÇpçDîr¡}ÝÄéjZª\v5À/ÞïïßÍÁ5éù©l½îG¡gGuè.ä7ñi‡Q#èOñ¹¬­T™ž½Õ]cæïRO#™ Fªâi<®WîGª“òá€ܔÕÄ9—q5áßY¸q\bS– 9y®¡b\\dśˆÉèˆÉÐ÷ß5ԍpÏ OÄÀK›©ø’ekÑêˆëyþß$uÒ=d{ÙZ·òÞñÛ\\ƒ]\f½Îȶ\"[pèùN‰\\”¸g¤0Á®(9â6z?˜‰!¹…\0€³\b_؊‘‹ð¶8йÔóx7I󩯥\tX%*šKðÖ{®¦= ‡¸­ìYü­oç6Ì!²À©¿1ç4ç¢bIÃ7ßÕóýÿ!Èú—%ªm\\ÿ šN­ÐC\tí²¦»+VZ­ªÏ„m@Èe!tpƙ»Æ4š=}»§­¼85ÕLZ±dvËYÉ]Ú?¼.ã©¥­8­”D³£ÿ::YèŠáâu\f­àËܽ•í˜RZo|/X,•¢q&µý]ì\f\t…r@,àðù\bÆIöRäUý6sZoÜUÜrqâX<Õ$JÍÁà­\bË5<J­^°µ¤D\fՀ)\b§M¶ˆÎº±m=MŒÿú\nBZ½GU$\0eˆ?)›ËñEgtw¼xM;K YÈêÐvÅã!2Àëéðv\tÜG,Íà,S!\tBèñ2çt¤ç_\n1kÍ@®ý³Ûƒ™3ê«ï¬\bÛj€Â\v\0mBTQï‚B™PuËÊô҅òêAà@èð¦á5.)yÃºN÷9øÀ)ËV¿ž¤O†ª>š4[ƒ'eê³ÿdãp3 ‡\0R¤ˆplZ¾7‡‡ÈÓ™ö¾›¯¯­iò¤ø?I~KŸ=M\\Óì|ïx)ýJø‡ïN€ÿ6Äea@Øî®÷ª,Áát2³¤Ú¸;Od,[ç“h\tô•¯®3êv™¢À£O&KëêFˆÛÊÑl±læLºVéâ!:G0Ùu^—ÕóO€u}Ý%‰¾ Žk懿\fˆû)¬|¬5o¶·‰Ü«úù¨åÙy²Š³Þ=}¢äÿU­\"PÄ}Eœ¨R‚:éÄñÓ\nïm= dï”Øâä©y[ÎJj0­8hÁ)iy6þß«´e„ÚʘƫwœÄzžÍzŸœ¬TmÀ˜?L 0¾æV4Yd€í\v\nχ=MŽ«Èmü[Ï\nA“$†VhåLo®S >íx_[‚†Ô”Xý‘l”Ýs“†´Ùx8±Êvò\n+óíñB\bžUÐjï_êÔ­‚µçoòÂ\\•ªìàÑÀYÓËCe{ ¾´ ¬Åh²®.Ak0™¥,ÍM‹ø‘>Û’6%† )âþ= rÏÿƒé\b®¯Šð~ó\vˆ’qUMÑ\0©ô÷MûòV4©¦],‡u\0v\0þ¢ô]õe‰ý'Hwî£%6ÂOI¸1)‰ïÌ\0\"= ¶ê²>OòêLl+:@Î+âüžR:¾]\"ÙÕO%Ш}Qâ­ï±18«S\fº¿=MfàÀù“‹Eô©®ý¿ Mœåðä„PЉaB<,ÈÈHçَÔþ†dtãÎ5LÃG0…–{[–êc¼9è \b+ÇmP:¼ÂKޟ_Q…W¥žeŸ7ê¤ Õ–‡YéIµWë­1pÑþU6G¯KAPvkÒ,¸8Çٖ¥xB\\ŽØ!Z:†Üßÿ^Qc@@liÃ0ÿ,¯®\\×= ‚ÏxÙm\\|(}íÒ_ *‚›TdjßYÜ\tC_?ŒJ¼¦dÙñ¶ýxØSë€üwùñÉÃnis~õ_™Oþ[êhüË®œa¥NË= G\vÝCô«<E •>\vú4(FMŒÒÔìŒxí€ì©êí»€\"Eiې,ï\fGËßý?0BmþÇÕÖ>ª97~?oŸ<±îw'è®\"î;¹Üf9ˆ2ìÍ ®7k9RøCPù‰k<–,øš·h74@ò W¤÷~jȯóuišƒ\0ÖFþð1^~8?‰Œ“doÓAi^ãéO°ö²ÂÚz´9=}ͤAÌՔ¤NºfÔ<»5ÚâÓg{Þˆò¥*»û”)$oo\n•JW­y~(ÅÓ;j«Yâ?úEa¿8¨!å)‰!â²fO¬<\nì±-»÷ñ§0mŒ­uSá[ÿ6àH<$8ðÞb}\\ †ˆG½ÉH=M £¤…1!Ì\v= ø4Ögˆ8p‚',[Ýp8”ƒ›­½ª¿+ŸªÉ˜…;—bÂÌ<ÐÃ^ìuOy¼ÖÔ}#´+ýPÈÉÛ»yܓx˃щBýÜ\0ݚç¯ô.¼e…hF¢Áb˜æ8ÕiÙ²N§®¹o}õQ××»Õëöy‡8ÆBÕól=MΠcـ'd7ۜ¦¯ÌŸ/ušt‡¾>„1›keu­˜ê¢ˆÃthMuÞ觚³k^ƒ —Î9p§l(Ó¼I1b¡à9†Sùêþ—Tº¿xëð×_§ç*%žæ½ûà•ûþðÝי¤]½©—C›‡ž9K{öþ߆ãó¾fA©ò×¾9‹YBØ^m™\f‡ppúo.\vÇþ dÉWbzóñ×TéL×k‰Àùö(Ž™«¸òîøËˆ¶N+à4áw…êcA¼Çx‘&NÞ\trµ\0-&Ê:ñê\\'¿„ËÝX&½&ŒLg?lŽ67Ió@K›°u©;xàØn–¯|¬V6d‘·‚š@ó\faì¸GN³ý\\?&= \t®7ÍÝ»l†ö$ä»ô{ݽ8€bõ¤ÿC˜V¡™èX2Ô\v¥ž›‘Íe˜ÖÉ<GcFû-?Ù2âbßY™:q7†ÊWoÁ¸j׎ÇÐKƒœI˜×y;¶’zUEʜ*·@Ý%éYÂÑø¹ z|¼o3µ3=}e€Áˆé–F&ã€Q!Sh5Ê-^¯ÁÕ\nš\nÚàþªƒz3ô&C\to@‡!à'#ȀvÄKyÐâ\\.il\"ây§»«~>V¾‹òÂÎ|‡t= ­æ\"vÚméze:•¿m\v@£,z¤·úü‘¬‡fz70+¹³‹HQL©\n'ûÚ©\f‰~“Ht‘üԔˆ‰~ðsp~yu2©ž.½ÿ”χQ¥R¥¿“é‡\\X¼Ñ^<'cl ‡4ÛÆù•Ë֍¢ôÄYV¼VÑ̓”סԪ”1‘†¼(ä;~”_“|”_”Ü3ª”DõUIeÁ4½µÞ!™–ÕºÛª¦ ôÝӊ¾uÅ6_^<¥+;”´ ˆ•º\\¯Ù–MO”k½\0pÑÄãkFpKpKpKÊï\0A‚.Vꌳô¼€©Î&ø= ™Ü.òW•’ÖW…¡¥ÎdØ2hçnïŒYè´3QWou–’E¤zƒoœÞÌÏÖ£OÖÜQŸÅðQ‚”NÚÆ\\ˆEÆjÙ©9Æî…l7Ü.äÿXífå—üøOÿ\t›-¢3Å«X>úMà¡4+—z›h\\«!É=M \\ÇñœÃ\"(ö®4oæ…ðãkXÛ™…ÕõÖ´åYÏeª=M}—S\\Ë\tÚC/‰&±_þÐF¤­EŠÝؕY‘#£Du›Ñêµ/¯Ú¹—.€¢O„–¥— «5¯*T0ÕljXõáÿ›\nÙÖN°mγÉþ—‰VLúWÿ…˜£ð[$©fÃÅù¤\"«NƒÕ$hMá½zo‚U|ù~UÛ°…¦î; àtHÞ´X^”£µàó.ÛóV‰³€ûtL=MoxÍÄì-ºAµ\bmrEXö X:ÞXÓƒ£‚°¯®Òù\nÝr%'u\"VþV4[›ÞKœ»›3¤Ý Mƒ4vf„ÔTrSƒSȇQð4‹Œ¯~Žm¸iøQØÌôL“ªã¿‡o‡ŽG\\ç>I>ù>…%<ŽÁÇ+¾µ&9ÀR+Ÿ•Ê9€5ˆ<}ÀKÁðM\0\fng¨B¬Â«\bO~KæÅKÊl¬}g\t= àjº¾º\0 \nÚB c«¬cÂezŒc0lɄ’qÎb\bÓûŒdKýìÿxJ¤ÊØÊ3/0fýŠäjãêêQ_7=}q>1AAaç[À*çºB™zNe½º¾iÜcV$£A3Ó7\fÛ.ê¨X’q™e@sÒO\vÿ”+*ˆ<\"²gP\b€[Jè@¹\\ۍP= ºÁ¢¬=MpTˆ/T­c4ü–ý•×IOº›é5ñîžëàá²&Í-OQbR×Aȗ_¾x‘y­òÐ]ö,ká‡5½7Í\bhëèb{»VÞ™~YÛØ .Y{0uxºÙ÷Œ³õüÂÆ¥‰¦ŠþÔìb”ñ™q¨±Ö.AÎFÈØNÇ·+ÊÞ6AóÒØAµ„\\Æ×†U”!ë¥ïçmSŽTVšüºÔeÊì½øb¨£Tž»×R® ð ¡ÒÇhþ&YKŒd:ªÅ´ÆzÔY=}ëÛÄ2cëÌh;G[°/&çk/qrÛΰκ-mMƒ·š#^ÊT°(<Çí®vþ%ÝЕ…Ô0떬\n‡Zœ+‚Ä\v¬+Û×í0&ǽÞ:¦F\bÖE˜E~G(Éã>˜Pl™£¨æ‰Y('Muå÷„Äg”Ì= “Ô„ÈÐûót0n.¶A5[×ZË2®Qˆi\"ìT\"‚Tp2Ž G€Wbþ|ƒQŽ2kªB!Î\vvî(3.7b¾üéJÅï˖¦†NÌ?z/ÎÄoE=}w¸ô\\ÆÝ©\b9}v¸6íáÛzÄ/›{æPã+éɰã2PV‘Px€ãˆíOŠåÖþR3xq*æÜŸ= \0\n\\oÁs\t½T7ÞhYo\0zK¸ºª´Ê¡H¬Ðñ‰Mæ= ]_\nŽK8uØüAJ„kyhÌ3Ê\0#†\"m\n7MQëA\"\b…Ka Äð‰âñ+D\"= N‰KÚØd\0Š;Àdâ;a‡ðOÎ|ÿjo›KÀ\f:4T“{ÌX†‹ 8wãôk;þÅj¾ùXVˆú´ŠBX'ãôDŽ¤˜= Î@\fúñgeÎ\v‡Á4:p\bÃRÆEžr-/òT¬²Xþˆ§ã«qB‘1*ˆQ…=}q@d¤9ÝË;70µnËó)›N‚™8BY½²ºHšÕ8GUVA%-Ú÷³= ò¹c¥Êµ,= ÃNÚ8™ñ­aûÅç_´{ÜöÔÊYðo2[ó3_É$—N§<aRÝa¹ü'í \0€¦¦‰šo&}ø\\= ÑÚÑ^1úŸ]8Ù¢=M¨i®W¥GLGJFüýÆz—”¸\\1¨d—£²™ÔMÚüfî9¶\n9œöA*…¼³fTgúùĝj¥äöY5‡¾§…8ŋ©…úfPþçº'U¢I©…\nf̕DÑË‰ÈÏ,bÕD—t›yÞY\n{ÂâGŒ(69ÁÔ¥ ÔF1b99iµïŠ7ÑÐÓa=Mû—F,\t5µ·Eïaƒõôv1úã@]Õ?Þ+*ñUŽ#›R=}°ù™v¤3ƒ—7¢±ãPê%q¤½ÀùŽÝ6Ø­¶yf ‡7™z¾¦â%uX%ÿµJn¦­Èµû]›Ùª¢j‚⃜mx¶ˆÊGݚ[§ÛÔç¬}ó…ð¡Ëv¯¡[8¼pöŠÉµàÍ1Pÿ§æÛ«%0]ÌE߂y—O•¯çµ¸ ÕÄ=M\f‚=Mqoª¶Ö“SHûÍmðäJÇ4Ñþw=M¦±=}¹à–\"‚~ý>B=Mz‡Œ¼ç\f«Ä£‰1Î~­¢SÏâ¾8€~$ü1]_ÍT\n\ve!ºó7à%àJ³j;UØåëPŸ™»—¨½Vƒþ»ðZ³ìY»Ã¶ˆ™ð¤ùƒÀãQ\f|Øï÷ô&ùôMíy{\vBã·¾ƒŽ„ódRŠ~öÎ\f¹þð|ù;»ksNè1ìð'HD|Ð'wQ¤â\n~„¤rDÀÎ%/èñ)såTÄD“ZI7PR'ðºŠ'\t&½î¹Ë\b¨NªêËkªªû<yŠ+9‚à= >@tÌÇÑiZö¾×X\n;8ኡº®hðƒÞ÷ûEx\v¥¶øÓtí9.bºÀ¢*Eá\\Zzxéªuì=}ø=}Û3\tž¿ÜÛ~í_ò¶ø_\nÒ°Æ\bcpYбIŒ=MäMaˆr3ëhx¾í„‚u­“\vùùõ< 20=}ù™^àÔ÷¶ª=}-)y*—×[Ù¯«·šÀË×°Þ9É×ë¡×–å:å2Ν²??ÒskÒÙIÊvmN\0újâr!ƒ¹ÐŒu갌³ÑêDG6 üzÁTº¦çÈ ºêÂççèµ\t‡ôSd謴éÊ\v?þ!H3vLÅü‡^QÐêbç'\0ÒÐZ[M<ÄÓ=MneÖý#H\v†ôJþäãfŠgÌ\nÉlYc^Ä\téW†×Þúœ$ÁEŒôQË¿ÊPyƒ= ãÿa)~\b«CÞÎ.8w<kÔê=MøÂûcò§NÈŒœ^hŒÂ©tea–™K<ù“ŒÚr¼/õvuNÕ©(=Mєkh¤‚ÿo;«‹Sà·\v»˜s,´ÐÎÿ{Ëã\b¬ÛÞa½N”?æ_{®áIŒñ¥«2+ò‡5ø¼$ÄE…žò¨*=MGå‡7CëÈEŠ¡ñ«S¼ŠÙsB|\"2qÆ+#“ÀLY²a¾OæóriÚ¡b²’+m}azglârÿ貒,ÙÛ¼³Î~v= d±SU+dwJphHÄ’Ãïr];dw]2~nºŒóË\vÅÿÛèÑX˼1°ÏjIá¼äŒðOŒS1wD/:™lÙÍÐ=MŠ+8E³/P®s¹ì„Ž= ÌY;2ѐê= 4ÿOx;Îbò·#ãÑ‹‡8\f8>ÃV7Þ\\ST\t„îbÄèÌ/{Kµp3‰¨|D÷ј= îÓ ·7ÖuŸm(ÊâHQ|Dñ´²\fu‡(OãcÏ”fÆ5\n)¶\n-û}ñߟé#ž$Xüñç՚ù•Œ§Ì4ß6è}½%Æ9¢õR.É%€=}aO1Ç7ÀÖØ°M宎%”%´Úú±uöý…Á•u~õ,V†z8ûXpä+&Nuªpb<¿”úœ‘ Í*i½Óœ?,)—sË%><€~? SáÚÿ1y\fEÞ{žx•ÝIýÀ»4Wó͕¢>âùÂtëØêrÜÂ,²ÝJÖ±À~Ry¢§Üœˆµ¾9RµwdŸeT†¦Q©…ù™Æ×ÑÅ/ ÍÙ¦xrâÐåìÍìͬý¸%†WöџÁøpíóÙµ¾Éc祉\\«®¯³º¢ç.Àz¯ÅŒ®ÂMÙ_ÖìÝXÑ5 ­¡¶÷¢Ø«BarYA9˜>¥û¼D)⥘a×s­óª<³Oã#D²ûÛÀµ•ï]°ê= ñ5“ø¶'ÕM?Åö©È^¯ó¢d¡CH©]1ªX7îeßF…ç•‹:¥ÄSsµ85‚œ\t­G½ZšyIj»\bVÌM_7+Œ…½óä¦åÓ%©÷СoíÈìۀUÿ§dlڈ®]Ì]øÎ! 8˜—㟎Xn,„n<£åÊ%?âÿÀ~â¡ó:Õ¸UÝÆv±¼=M¬¶Øs1—GY]E–àõ fQë;!‘¬‡®Úù@vUD¶W.¿ã›Xü¡ödúÅ%XñMW= õ”„ùSxvÎ÷Uuræu©ý£MKˆVøÔ뙄yf±—ÖéŬàιÛìãÈJ!–\bÖ3pf‘êÙµ‰Æƒße²’;W!±þ•\fÄL1W“¤hŠÕ®á¡ü¨Ñ_'uÞ;Öï'ÂÄ4tNŽ\t\vë߉+â€lBóJqt/e_F&SÏ^׸˜4ŒQwëöVŽ!‰ò€X¬ŽŽ=MMÐ-0}ýç¿_ßÁ\tŽnÀlÃó_P>wk(gð#CÈRKÁßbÍ=M‹õ£NÒ.¿êé¥vì-A] ÑÂN¶n¼\v\vP³¾­ì„Ð…½è'¨S7¹QÕÁ«¼¿µ½Ñ³Ÿí|¬¾n¬‹òŠP˜Ãû‚¡¨µîæE¯\"rç\vÛÜND  §CßãÒ\n|ëkSy7\b´±o³þÑj™@¾S’Q<¹â‡?)…ð7pº^·¤Ì¤ìì(™|—F0•~ùýâáñ¨tŠ3s¬®®¿«j„s&«ª+MκâÞe¹„’Ø'!‚ö:»8“@lbN,q\f»âQÓп‰P}„%·§ñráìyڗ9ÍKŒ'íÉäææ©®¨Â=MAu‚eØ= t£bxÜ.Ì£ßÇ;|Ü\f®È…\\2?G¦~rޱ®hF6ÇÅtN¿wX‘¢ OB•„ñ:¦ñ¦\b,]-/õ²D£a1‰®€‰³op<mÞŽ/{Îú[ÓÑ*u¿\t\"ÁÜYë´Ð0r¸¸ÝóÙ»×Z9!ÍÕ¹7¼¥°>×Pí‹#u¶†§ÿ£×jÑ=}¯EÕ/îv?åÁiÿ=}MÉÉxw­Ðà¨ÒI*uÆi/È ç,$šj8e”Šè:<‡=MhFۛø‰Š\t\nIJÉv=}[x­/·n¿så5ÃÄàóё@¾PʌŒ-#²ÒĜ<F'>éSÝìÅ\\m\n×3âtôRôÓR†‘nxàÖȁ‚ÂIE®êy!¿ä74ÁmRӝ־fÛ}§i­©€!“Íâ7tf,[g0¥R©®Xüjáù!à×å¾aìú BæâÞ]©iñË\vÈÝáy>G•jåäPð¼¨÷kDŸ†/Î\n7FÃ4= å”’KêzhGpڜX|á°<DV¶ê)}ëi¬;|L Èh\fíJUtXfóýËViÝôÜè2\\6Þ×Ú;”ßã‰_nè‰Ý)´²Å= g©¡E*e»¼= \0Ò\nƒy}^¯\bB”±>ÎLÊ=M[©ø²¥ùX­à¦\ntpÏø¡„túP4Çto%d%9„\b\"¹ÌËÁmjû‡íÒâÊÙX4ôzڎï}ˆÝjæ.&6SƒÜNf¶£xINÍ¿­®}‚?Q3N\0jñP›/ñQf”ÿͬƇ­\n/\"Ø])o4¤Dºc.YÖâú<‹ÜÍáå\\”äú½Y7Œ(f|íâi\b\\ ×ts\\ãëÚtï˜\t*fÕ\\(ÒKÁitŠh.µèCÇ@Áòõ8@›PÓÝ#DŠ1=}CSIÑÂòyõYEePp\\k0þ(•Bôo‰™û;$z>u„ëäpp0ÜldJe:*¹tO¯À‡÷,aÉê¼íG]“‹ðŠ\"8€A‰Î=M&vT€–ò±ÂÙ²¯}@Y ÙÊ(ê値6ßý5RÑsæØžŠ\fQÓPoç¢cÜþ‚BUÞ©“kKÔÔ¨Îà˜üAD’ê6K¿…’òJ\f$DŠ-5#†¡þ›}¢®ºqo‹›Li:5 }π= d\\Ã\n±\\,6°ƒ”HJ&¢“kñªŸ1J&6@IÚ4wIflÐs¹”Î'ǯ‘xw²«¯'Ó H|¿763oQúxލÂ~lkœ3?UŠKê3îøD\"֐ñ\bÒ¾Y'D!þÁÔHbø±BÐtÓêXsLg·ùRþX¨&HšÑ*f€= Äd–P2–8Ñ7Š?V47Ú¿ö\t:KóÒ0#owŠõúýiŒÓŸÛ¬f’î.õdæŠÿÁñûß½Uë8ÁsÚ°X­}“~qÿ\bC§ûTÉrâ-È+÷^§‰ h\0±\tù=M“‘“wÑÈS?±òèZ.\"ƒ—ƒ½O¶]z*i:\v©\0IÔmrí0dù\nn»\vþJ8M_#S>.B „7…}©íFW…inSÖàìÔ6i\n!™{¸«C6= W@Î/[(BòÜ+DpMº0\"Uz÷Éï©©©©îÁkÔ¿÷fñÀ€.ã:ÔS’ÇÍ7µ¬ø^ðÚ=}=Máêsì'd>]\\*zÇñŽÑ¶,:z)ñ¸,ü= \n®N³¾Hv‡[\bvC„ȧ©T}?\b&ÀK¶\t_¦ÎÄ\bÙ:ß#½K¨ÉÜà>$¨×êHÅ NfjëÙ\vÚD 2YüxȀ~i¦‰¤¯[T‚ÜXýÝæsG5\"Ê՝cÛɍ\f\vÖðeÀ›˜}®pËDpKòpKpKpKPr$æCJD1yàχ°x\n¦“JÒ϶q,¥×睴f„\f€ =M %wÏ\0ž“È%ƒŸèóñ86…T”’è\"ö±¨-Y©;Æîaö³ íY§+FêA¶½÷¸¹çݸÁ]8·ß½8¿ÿ=}8»ïý8Ã}ø¶Ûí,Šn%\"n)bn'Bn+‚n&2n*rn(Rn,’Î%Î)XÎ'8Î+xÎ&(Î*hÎ(HÎ,ˆN% N)= N'@N+€N&0N*pN(PN,%)\\'<+|&,*l(L,ŒŽ%$Ž)dŽ'DŽ+„Ž&4Ž*tŽ(æ8a4áõ§è-[¡ûÆÁõ¦àí[ŸëF7¶#™'ݶ\"¡G]¶$—½6!Ÿ?=}6#›/ý6\"£O}6$–-«iÙ¡š\tEÊÜ\bÒg(\bn1ˆ0ê8‚¡,ˆÈÊøa)„þ®\0a°üä-3†û×Z™È8ù7.fÅ^ám=MGáÎ3</°pä(h\tÈú|®Ç.þã1Ò= sc+n±\bw{N‹33{= þa¬/°d\0‹Z\vÿRðÿ¼,nhz\v\všÀR_dëPK[Ò\0r°v.ÝdÛÕÇ÷RÈcPx2&uAÙü»ÐÐÚ¢>ÿÞèèoÇj-:k±Ê|?Òä¤WÑSåäÚÀfø>ó= Šñ6Œ¿®é= 7ë»\nGþ%æ8A/úk¿PË®\v]Gè;rG‚*4AœùÓ¹¦Èí\\ÁkÈ(¢aû¸ÈoYAËÊHbbàÈÉY#b\tHrf!\fˀò‚~ƒ\v\v䋋ŠSKT\0œO|õŒ³.XÒ9\fí€$ŠcxR¹ü1wAh1HdçXNÿÎôâ¬?‚÷Êó;kÀi*oDjXŠNÞäL}‚ËÒs>lPŠ4s´%VXG=Mé»ä]{¾®ÒÀ@|ú‹'ó*v€Gà;„_‹®¹€äú“NTGV¡Ž%2܎s£+mR˜\\\\3’ÎVŒ(ò4?ÓPH|±Œp\"žàò̌Ðbé€ûM\b3„’·\fœ_fݝ{2׍åÓÔ= vd\b×­:Dž” Ú\0$¸mdÐH\føä'\"ÊêyT.ïF2ñÌâJ.ïlñÿ›Š«o~iK‚BސCìƒLZˆaQKZò›\t䖆ÀõI¸=}É\fï2Õµ©¥á³ßU’Öõïk4µÅÓ¸=}ö5VÕaõ5±V@øe=M–=œU=}úænÚxÝ«gÏ«(Huúe\f%Ö§úŃ'vxœ®á&%v½L= V&Ølç–/—[ ŸéÀ6°=}µ¾Æn֚CLŸ»ÞšV2WÍwxªŸA¯wçÊ)Ç¢M¯ÉójIH0š¿0ï7FV§'@ª»dH—üsa~|î0ŠËÅËmuøèð-Kp\tE‡;²MV‹eþ±µC\vFB¸¿4Ï×삙¶[®(´Ï0x—èð£Wì£[BCÍY¢\f”NØNä Oœ¯ˆÒÖ/VÝQæX°\"pµ.ÐwyFuØ4®•>êµ!f֍­aXiInè½Ø/ þ£ò€«¥Hö®߯©Ooŝ\"v{¸UîÚV©´¢6¡!À÷††ã±‰3ž¥P¹×N“uÓemæ•þýžx|ë=}Á[[K%o0ˆt–±‚™êüÝô'ö±($ÏáÈÈÕÑH5q1¢Ãº¬O,¥\0Ÿõ!ÀÇ|T­O::¥_bztšqjCÅj\fÅ5¼!Âx8ðô}ԊՕ˜˜åε>•VŸ5ãV %ï•Ù•Ñ£˜Yš{”•Õԕ™–®âµ2¶ÅÅ5Š¡™ä«gôÁý;¡›J±WêÎYҟ…P*5,êµ+ÿ%ïe€«uïÖ¡LuÿœØ¨œe³ã%cNÕ}|›/u–Ø'Ì9Ƶ”›ôt©\tÅYðv¥à÷ՎمÞÂÖëLé+¡XUá\b-Ž¥= µ²ƒ–/ӕ+ª¥‰¥ä–T;›IýÆ]I*µæ\vršszY1 ¥„WŃºýzüÝÿʦ§Íׂ=M÷¸+ÝPЧGM…¶˜ª\\¦kÑ·‹ïÜ=}Û·‘}ÀÚ9Ÿ[l(6œø®6» &'œÇiÉÆAò= Î\\­æŽ)v¤ç+cÿ_'©+é£ûþ‚+FªÒ÷š\fÀ.Ö²¸8†òùg;ÿ.Åÿ$!Ã=M¶Èmýzgˆ©Îž®¼|´*è€,04×íA5ଽ¼¬ªy)2ç_]å¯?ûÀþ^ú:…cêºJÃìf÷_e‡RߍÔ¿c.Ö00)#ýC»¬@i9núÊ2gñXT.9¦sl‡¹ X“Ï Oíß¼PîŸâãïgh¦ë\në'og/®b´úâ(Pm2DpüÇ~2ÈK‘©Ð‰!2I¾hs%\vr3C~wµ±=M‚µB°€ÝmÍ®iÀ2Ξc7‚ªü[å¬ÿz]&‚±ÞÂ\n:Ói\"Œp»+\v\f¬\bïXoHïû/)rsè}ÕR}{èóNs§ìƒØ/‡Ì®Ô¯bäátyԐšíP˜KvÕöÃõΨ=}MšY»¨\táÅ\f¨˜äLë#\nì©MZå½Ìþ0ªWâ\v=M\t[®Vjï+v\bîÈm°Ž¢Þ]$㛐䶷ðŠÃÕ¤ös±\tOE³øQ$·…møÑ\n7y×öÅ.Ç49›áº~r‹%Zë´Ý‡‰½ûðfáz38a‡ç\f‹g4ªþ…¢KQäÐnˆ\fPúo7™PëzIè6÷¬¤URÃ?ւ0fÇ뒇’èŠ*à\fÊ „ÑFýŠ#F¯‹EJ“{Õ°^öp~æö‹Ë\v}v2YÄûñHq6²j‹ÿ\0)ŒÒùŽ‘“t¹T¤ÉÐ+y´‰±paf\nõòˆ>ö¢‘];JfFZ“ü¨»\f.,iÖÎ8Š;ø°p\f€&‘lÚ~”ÁÀb®ŠO=}EŽWÎúc érDmnü‘¢K¤¿¯\\ÿÖ^Õb§u\0•ÖÌ ›äÀíÁñ»Üyúª/¤IYR‹…Óu#,pÅ롇p¼”i˜“”âÚw&bݤ=M0&ð|Ü(„(ø®na#;¤­Ü®G¿à»¢g^«.èˆ|½|c5ÉK÷PO؃¯ Ž†PëZ‹Rؘ(²c1‚Q¼5Rp_XÑ¢\b‘CÂ~\\”t#!uÜ´ÜËAâÁ¬o=}Ààn‡¿Ô$0îi:,m–$[ô¯o˜%ʙjíQBêÕ|\0–¾f¦jð†‹àÁá~µ4;XmΡÿ¡¸OÚp\tH´ø;)²ÉHëû¯*=}µðÈêjàS=}t+|î~ëdE(‘¤Îì\f …=MÀϙ-ÓD£»àwwBˆ~ÅýgSrI’9Qœ¨*¡Ês©Kb¶Q‡%o£ÊB?õv«Ýp¶a¿õ^\vK»Lñ=}óB§©<ÂÌÃK@Fóyßñ(c_/oq\vKàl,ž@ÿÙt\t¼±?¢ˆ#Ó퍄ê‰.ïäÁ¤øÑÞ/q/+Œ¢FSI= ³?Փ€-æð!oŸ‚iT0´pÅ\b©;Ó{݁Q§»f~?à,ŸÄ}EB̰vÊA’M-ÆNNú\"ÆwjÕZžº+äTh䳺ih.ò·Þ«»@ms¨MìÊ2Y¦â\0X„fANh}šþºµp—‰Í™IN—ÝdӎAoš!•u€\\7²5ߌ’¨ŸE•é~ã˜UÀ¡Ežœ'a*‡<Rì¹%i ­m°˜)ڗèå*£)ú•dž ™¡í]µ—ß=}5šAõ˜œMU²Ó×§%C¥KÑ{Ѿ݀iÛ¬¨¯y8\nEèx¬\fÂ]ßþ¼Y̤‰\nEU¤¡„t8ͼBèð¶ÓÇÍ]hnøÀ›‹ÁbdáþtǶ¿Íe HJµU¹’VÒ_ H/‡Sïü°ÊŽøMf\tÀb= }q˾k±GL@ÊîåÈW=}ö˜’ë)(kFê÷\týèԜG†1.¨Š*؏\vÄÀ]ßü#DœîTG\v֊i†ø¤rJ¹Ì’70б’Xgƒ°ÌAîóP#m¨×’øýù¿‘9b¤Ï/~—Âu4}‚“á[Ã$ÍêD0xó{[ä‚GÆ3’•?•ꔿšÑÅqÎÑIÓ\fѱ83Ñf‡Zѓ†Ñ0@¥ÒšB¿ÒWÛÒè{ùÒ¦Ò4(Ò= G:ÒfSMÒÏTaÒéDvÒ©ŒÒ£ºœÓn‰§ÓôÆ´ÓýlÀÓxÍÓÅçÛÓ)´éÓTÜ÷Ó#[ÓE,ÓçðÓõ¤$Ó-z+Óp3Óƒ;Óm°DӐõLÓ¦PTÓÛ¼]ÓL7eÓ=M¿nÓ)PvÓ¡èÓs‚‡Ó›ÓS¥—¡.˜õñà©ÕèJÀ\"÷pKNÆ«è[ûpKÈAQFÒ,¡ž‚]]ï=Mt‚asÒE}X=}i–yc±WnO¦Ék!¶äƖ×<eIÓâ\f\"ü;®ÒAÍçØv .ÈøÇqÍðÞØ>¤Dg’>ʞ·:º™œ¦c|ä&yYE㱜#»ƒ§r#<¯.æ®=MLdw2![K΁]ú]ы2^¼}–€°ŸŽ€÷¦$ëª(0èW-Æ/ã_.¨>U…&”Ø)Î=}9\tPǪ@K>͌ëZ}g•Vs§V4”ã©‰Ñ»­=MâÅx&ucèVkÌ_$xô™ìTži+ÝSî‡t¹Ä¢ƒàÄFAñX‘ùÏ=}Úàt÷=}‰ÆÉ9¤góG§˜OêâPx~ šà菉\bWyiLë‡>tšTª=}+{=MÄb†ï5ñ0:‘Ø>‘Kéî%\vïå\fÝ5KèEü2um÷Vµþb@š€uþK5µãu{Ä]I¬qj¬‘ÐñE=}@uˆÌª\bïêiñêUj¿»”>Wä=}Í/97iàZ„Û¿ó¡é†\fðª\nâßÃ2ç'MãxD߇‡)QŸåGpÝ^*sßÁsÀ=MîV\"ŸñªÑÞì= îV&Ÿë,è\vòc{¢\tÀz\"&h\\éc!ÃÁ°ßsîWWo§Ñ÷:IöžT@,58-ÖÀ žÂ¾;Z:-x Žií\b¦3h ]н7J¦°´ªûâ¶û7¥Â\"×ÇdªÅd—;¬åÒA• [Aì{ˆìÛÓKOŽmQcxŒâ-|zö%Ün0ñ»aúIÁ,ÞN‰b6|g±wøe¯-Ø@n™jú8{1b$´Ç—K^ý0¾8xÝ®FÌG}ê0ZåpÁûR= z.ûGôÐ(gr®ÁÞdõeU¡ó1áüÕÏ Û<Ȃç¯PÙ¯s¨gES/ߊIé‰[<÷=M¾ty¾=M!ݶ“ùÇlú^Á„2a*òÞÙܼvqÓOú}P»÷‰ÉTÿ§/1Õvn=MsúY\bî¼3ƒ@wmu±¼R”íOczW5ís$6eÄ…üfÁÃ\"[\bÝÉöp7Íz®ZqÝC]¸&\n ¹\bþ™¬b·ŒÍÜøWž°äþ­\0&HÑ)λ6áÓ³W-5¥_¯†_¢Û=}šh<»S’-FÍ%U¾‘K¸•ÈP•qã\bat4JL’ý¨„\\SëôïùSŒÓa%…Ì|ûhôr0 ªók‹7S[(tÐ7î|VHc³miOh6(Ð{êÑexhìûK\nÚ=}ñ=M“^.\bc!vYHù¼[Ò\tyû=}¸ÿ,±djjœfÈFü_ïЫ#E8{ðó}m/¢’tïh%ýbm°euŸ˜\vð7ª´“Lù##ºz«L/(´#kæÈ›~0Fû3¾PIâ¿ÉV|6ÆÌr\"IjI6Ûyꭇ‚*–6›‘\vÕ4ŽøŠfBhX‹réCãzjÓòÿÜGCŸ–ä¼Èr\0ǰ¼&g\b§øŸ»'\v—[»¨=}ÑÞ´\\Ïý±ÐL#ÚDlí‰\b\\E„‘ýCã¯âz½+Ê#¹[\v¹À{!Վ͌\bŠÅÑÏ£¸Áÿ½´L¢öél¶Ñá¯!ƒSÖ\t‚Ò~~˜.\n•’£UÃ8ÔÿœvhP´Û>nE<¤œO‹¶¾CÌ K‰7ÕR¬¤‡=MÚ¤Y|ƒ‚cIPfig*û(Ca¿€WCÀ2>²f.„Gãý‚jö(+£4˜JNLå M|/)/ÿwÇàjüjîl첔m#‘L?˜ÈtK< úÁüL8= .K)‹= EËYÁéx¼Ö…•­Û¥Ú–EKp1qJpKr[KpN\"pK‚®*)¶mq±YI/S„ØyÕ¤«= \t¸ù¬‘\nÏÅÐBïöQNšŠCâå¨ÿ?ôÒ?NÏ}œjUÊ{ê7ýš»,Ö¾«¸ä¦S™«Õæ·´x\bæ¾%Ãî½o-³ \t‘ñ/ìo¾4+¡²~Ù9£Yx|Í}j[õ’2ý]^f]HÅi„Ú9ÚÅ«c ×:¡Xk3•Iъ\\CñôI±ŠV\vÔÄÉCŒY\v\fI#\vmð¬!¾\tW:ø#mƒ¤j*\v;ý;ãÀÉrFY$í\b}-ö$6žS\"Æ[¬Åàh/M³{.~õ\\=M)QeY[é\ná«æ!Ÿ!)‹S·a¸z6Kæ£À©ú;æŸ@cÝ×\\‚´ñü’ÚözÄmnÜmxÄmS“¸¯Às÷!zÀQT±qG¼M,•jï\f&\t{««âS#…= =}‘–ddwûxޙ\"X]2\n•Ïf%(…ü,Í1Àèô•ß¼\fõtB~S¦³Aoqj=MªN±4+µ\fr×Qa1 ò>îMÃͲ“:(v8ϖ¬Å«/\n¸fQø[^\fgpg»§¥D6hÿ:)é*Üó)Ö8ʧ¾M¿ïº×]åZ4WßÒ}%¨®]íhZ±¨Çn9ÜTS@èü1—âó·ÚÇîÔ}e<l\t\bcÒ_\tPÕ<£h!ÏÆ?%s×ëÂ<»Nô³Øóú¢q2Žþq<øSqy4ÛqÃ,ñ]þb·h‰­žÒ°žÔȒç¤R¢½Á Eëñd”r=M(ÄN¼\\0ƒEy€œ—$m±SíP2t~Ë3þa0= ©TD÷H LHúœîn±øÛ(CEV¬¤îõwÐëД¤ð±Âb¯ÓÀF°€Ên’á˵þ[kžmG1÷üËèn ZˆEÇ)n@\\Eýßû¬?ÈnƊ—û¾æc+lG\fÂAÕ50~¤¨™¤••å©UGlnKpKùpKlnKpo?{wļÅöÛ¢¼3÷\b¹¤÷͙åà­ëÓ÷}/'ÙVþî1EæUŽcºýqF—¡¯@væQ£ZŸ05ÀW8\fu®€³-óq$rKPн›k4Yy$ȍ/³ŒÍø‰WÊFMžP/ÐíR–9ôÑ[Ðtü%„J0tW€œñ\"!lxtåQx¬‰‘Ú·S’ë[ÆÞêÙÜ?6u/›IÊfý9\"?\nO-:œL|›_ùøIÉF®·sîÕ.rŸâãk½tú œÚ\vŠo–à-1to®= ÌOwô/°³sŠÕs5¼gÉQ×o¬¬˜’e͕8:Å®¡”>¥1h Xn™Ù÷x“ýy|[5€±éOxö‹ µd3ºûÞéÝFô¿»\v98;˜ dú6>Á°W¤\b¦s&i$šÍÑæ\nZåúÂZ¦rÇQ¨=}UQº?= C›G‡\n̓ñ$wZ\"Ý\tUg«UJªÎ pFhN˜¡‡òíÿl¢¬ó‘Ë€Ĕ•K}¡×ú­\\”\"µ\t©Ó„[ænÇ0\f;EG¯¼#d·Ñû£ÐZ®½KïI®¾yŨÂ0û7Ò6aɋ/CÁû:À*AÉÿ]ÛÐ$H(¡ÐN™\bå\bãg({7ïëz»h²ÑémZØ‹QI‰·´‚ùw<#åo‘á¹Y™^Çâ%S f(zW©å¿á[ÿ·YPÚ)y°Ú¾XÕ!͋èÍ2É,5(¹>;Ü'íA9½vEɆŒßh¡ÒνàÄÐúþcí#+‚+</[šu–Õ£}•5õxpKpKFFpK£ÄÛrmKbý8Ôî„kOùôkºã;\\Úò³1kÜ)°EE¶®¢î3ùÙ^̸íÿa¿ä¨tÆv$ÅÚCø[m8û¡bÆ\\$μ,ð…ir'ÎlÁÎfùڀ\0‹‚I;Óq$¥8Ž<O² Œp†Ñ_3#¼‹¡°zUèúÜQ\fÏ7©yÙj⼗€1îkpoúÃ1GúVÞì³¼PF|N°Ôúƒ±´y֌곱H†yæäK\\=Mx#¬ø@Qî”h°4¾ÓYÀ\fBĤB’]þˆ¸Ó]4c”ŽH·Âd¤—Íó¦ÝdäI= =MoÒ-^èîÓ¹™Xš¶}=}Çøú½jö±p¥[™hoL(®ùܙrA¸ŽS¸'Ñ@½ñLÜ6Å$[\bÉÛÆÑó¨XØBí÷+Y÷ÇÇ#_.ýŠ\"\\áѼS\\\bEÖ:|žq^Þùm*Ù\vÚ¹…í§[ã^\tn'!4ûŸÄü;…P\0¿ÂŠ>9ÓáúâׯF¼h½Gä|“\tã¡c54ÑdÇÍ0-lFáéÁGÝó%ZLÔ^;y”nmP{%L¿¤Ré& pŽñsÏzfüþ³8|&/0d1¨Ží­«õÍ6•Zx—1Ÿïô]>ƒÚÁ^Âwt2Úù>¬¨nña'ˆZ™í+¥ÓF²\fà=}\vÂúçÑÀz/\f®¬)Ƅڮç4o|*(I1ýŒŸëâDµ‘ãšfË*´êÞv”¿þiCwãúª@p?ý€è\"ê÷Êôìê8“G/ŽãÊ©$?ökN¯›¤@zÿÂXìlG…ÞÂJ+\nA?@X}õ²òiö|êd6æŠaÐód^ƒ¢›É5ÌC-¨¢1„o]»„Ûc= ¯Îqƒ<ۗ/}½\0÷gO»Ëqÿ×Þ>.\0&bQ®láðÈØtÊ8þi¹BšH®Â-´\0֓6šòXë)'ï^-e_’Bñm_Ev§+Ý=}D)EF™:觃Q&…êêßCT©JŸ¾ˆ9Ýo9}q,7qÜÛ:!LFÇÃÉ_}Ní[Ë®Lùi”+Üàc§ÄÎ\0Èz,_îNíc1˜Ã1,(Œï#\fôš:Ÿƒ½m-=}uÝ:—ІŸcÂêLü©AN6õ‘°šPžÛŸ¯žP/י[¾—÷Öê85|íVh.—júްšn™¢‚À<™x”¸­î‹+µˆ6UˆN5\"uVœV{ÄK„—jôT¡a˜ò–©ÕV9KpäpKŠ\"ìpKpKpËÐoØ“DGŒ\\ôS©+셑5e}.׈0Ÿv¼ª‹èñ=}eû9׀Ñ•RòªW¿¾Iû;jóÈæ¨b±àÇ(sr!’ô¨S\\áá®ø7Û(jáÏüy~ݸsãÛsÌ*|曱= ®MRÞd+½Ò|Š\tï9x!8#¢ŒIqg\0†?;:Y確ÿ“4ÿ³š>ÎÜZ,ùª?¬ÚÍúª&‘G%°>ÁQôUE—3c<Áމí(\\ca°)= 8,Î!…= öwÁ@ú\bμ ?\\Èno¹(x?¡q$:hLãÏÈ(h]ò,_#¾­º’(^Ò%Y· ¹·§®DßU\0êÑøƒZ¦óÂ#ʋF!d6‰ý_$÷s(Ýc+\"ùïPOˆÐ¾!N{å³ä£vqõ§\fœÆ”\tµ8›e>Ô?\f}Sgx,¤À”=M\bŒ$¬,Ç0œzÓM¨…q\"yÐCM3\fv|ü›B\bw†ÁÜ/¡\nU¿l3³V\v鄠lžXme/Ê0Ëïf\0\tôk»Š6.ê»ëÚ^PÒÅC~c\fØÌ›M\v:jñMkžúãÜ×§Ïuk7Ò¦$oÇÖ°ó[I»TÀïóýÖnvbþÃbåR×\"N¥eÜ«¢Fòò46ŠMýæ,O= ÿH^P«ÀsluŒY}æ\"è¬@u,ô®*íII—ÛP‡1Sï+®nú=Mî/r(ßçLêž¾n^'› ”ßc#ô‡xa\f΄ ѐæ‘R(:s\0Z,DÈò’Fý?Ô%6êƒß ‡L¹A\nþŒ’GÁ\nÖãtÓÀ\0ä2'‚\\ú„W¸‡üyÖ>èEäÿ« ÓÐyó‚BGˆÛ.2áóNï«¡ñ¶üX,߀ã ùZf24Â|b%PnèútÞÇD=M>\fÿI)1Í×ÇXßÝ֏ãÔnÖ?Â'2kÎ\b?=M\f!,…š¦‡LÛ%¤‹+Y$Ãw§\0¼ª”¢\0É<ÌK€ý‹°pKnm“;>pK0ù‹?oûÿ¼\nC´rzÔF¯Bí(ZýKõ.ž= hú(7in\"OVA=Míô»+\vørçõ¸7Ï‘³ô™XO|×ßoÂV<R5ç\bçͦPÜ-·TóíI\n65ÇÚ}p)º)À›Ÿ .:E:ýeF@ e¹òJ¢fóú°thr‹‘‹ï°6Ñ9Ûj::K„xYÏTîp€\n³lÊÜ@ßo›ÏgGDáÿÒ«ÃRÄÄ)C0ÃÎ\tÃ&¯·ËÞh#‚,×àgUI»þJ\tìÏp*)³t¿º„”yæ:YhÉ…KH’<96qáÖ(„n=}d˜šÈsƒ­¸päèuØëM†ÇØôSyÙŤ#wC»….6~‘c8±ÓÆK-,ÓBy֐?оqç›d$4b\nëbxcl¬‡= ßàŽö€ª‘\b{ÿóM\v²¬Ãy\vK…—2²‘?ŒƒóI$Ôí\n%,‡¸mHxQ{´Êq\b™|Š+<NUγ.ódxúâq÷vúóL†¯,Ð(Lisvhdt|”ÏA†€äŽb0čc0D=MpJLñOTԐ.,3vSˆê\0†vHohWã3ú»œŽ\"VIDÑóìÀUy@·o7)vj5—Jæò&N?°Û’j˜.¾ÒÆ=}>¬áâõd1Sí…6´P¢Õ†+]¥ã¡ÖWs6…„DZHÜÕ\nP¯Ã“é\\º¼â=}Ãi×zØ}}}7\b³O±eZÌ˜á®øK—øaÔý—ùŸú\bÉ\\íuo'&ýÿ­À8†UýÁs\"XD¾xfúTº)„ïÖSh¯Â¯KMµõê—„ÙWPj\vÝÐÿ$ ,±…l Ü¡v™º¬1€„¥â̱È\v\\ˆf³MúzN¬é^°ãaœ\"ÄS#ŠØ.Ô_\t—uÆÍ¥â?֍ŠÐìóšXïä÷‘OÅA>£\\ÅÝ©\"’D½O§\"º0øeTÍ«ïÃ=}~¬$äw¶äUcAٙ\"áAʞœ(v3*ì>’ͪ¨¬:6W¾²T:xž}ƒ.èB®=MGѨÞkî…%¢ºn0)òÎMäNm¸¬L¨‡¥ŽÊ¤kªŽ](ÄÕ|!—Ñ~ëÓ\bŸFáJ®èÅT8ŽZ%ó«x×垛4¾V¶(çÁóçoÔ:Å¿X’oÇñ³ñ#Úz½\0¿Nš\t‡¿¥\v?—\"rÀæ±çmJ*-‰Q§dI?å§ôšlJê…RèrúåE(vÕC¡ k^EHæ´ÂÇ©¢§öýÂ7\fx§¦: Ú‘s¶÷,¹÷“ê¦ð4‰óÙ_\f¦o”J”«†“´·RÂgKl·.ËéNÖ9:.·*.ùgÁ8\búibéÛ\tO—Ñ?]B6'¡¿~l;Ÿ'“æã¨’= ^Ú®>r¿ºêZçüñ×ÃÃZI¼97Ÿ^ÇIòˆ>4þ³¢ì^:\nŒGþ€OÁG ]¹îL¡_Í)ãØhýnˆ©ÿâ介Ë&ûܺe ):´àGýÇM­ÞèÛå5ð­â6n€ÝØŸ5w€IŽ&¤ÞäQ}vò¤luÛ*ò]3¨n¼Îe*&\v‰†<ÕÜ£p%Ø/ª‚‚Ô34±ØhÜ&v\b¯å÷ß^²ÛÉKqËj: Fo\t?ó‹­=}fcÞX}k‚Vy6Ê%!gfw‚Rþ= H³éfD°în>åü·R.sáò“V·ˆ“Ez TÆ2‚4-ˆ6Ìa‹…\b{J€¶@î0ÊëñúÑ9&ÒÊÍ= ð€m†X\\í{–ëBK ÂÿmaŸÇkGázz‘/šAs=M«ÐùÇ@d¾ü/®îAäé±È\t¡ù2¯Ãáx<ºhÐ\0aKaåø;Cí}Ôyî\vw¼v!\tØ=Meˆ…¹\tBeS'åL\\ìݳÓéínJfkýP\"‚~gÐÊ;ã\n6\f0€Q?Š:ºR7:–³È::ÂçëÂ,IgƒàÓrSàb“_qÚ“€C»top1HLzÞ¨qNŒA¥Ø·Œp0= 2Œì†³èŽOnQz·s\fxŸ3·T3¸ûÀT\fýÌä”\\ց\tt0]Nff\b‘vH»Sê“Ï\f³,¬.Ó{Â80FZÐ߀ 4pŠœô’;\"t!':2ѳ#åW´¿=}„ô ·½A¤‘›Š\\z@˜F<C.¡\\e€ÿ]_kYš²±ôAWö=}ô!Z’båÐj—ôÛvMt홄¯=d{\vÀ=MÍp·¯X=Mmö‹¬œ™£ÛfÍìхÜÛ¼\\xÄ-LÔë\" YvV]”©ˆÊöí¿ UÊ= ½¹Q zím.[¸Šé—kM¼vߨÇӝ>ýs&‚?¨5´,5Ò.å”1r±šy÷\fö³ç|yØñîÌ@ F\t¦ù¨ FÁ6™LAßöCé\nŠú­¹À\\§XŸ‰ý?ÕºT@Yu‰¿E\\êE\b&ö«®Ã’)V0íèÃwm¦ÀD ‘½wÝP”¥þÞHÝ\0ë\tÞܹ= ÞÇÑéÚ\tQ'!{ìèOêèß*ed†Ú\t–>=}{æ= Vø&Þ ;:(Žv©ŸÑ3Ýè«\\&$ðÉÎtž¼«×[¨˜½B¤ZÁˆ5à®ÃÉÖb“¨]ãbù\"6æ\0aþ³¸Eã,=}åGáæ‘Z–iXLÌ:2ß®r©^ct†Bëkg/´E\\DE®žü-d8a½ý¼ˆôT\nó.dGóâ÷ì¯ÈíWûvÌ3rË1J™\föžþìßNêãP0ÅàB‚L'%o¹6:C‹é7)¯RòÄÒ'ypê=M=}b\\Q¦«hÅC|(dÿâxȪ¬ˆÆìlˆp*}ƒ¼ŽeˆÑG“ÏT‘ŽÆŒ‡#lôV¬1)ó.§\tÉPøƒÓÝf°/ví礼ó~VxÆ×ïµbíá\vKÛ|ú#Æ#=}À\bÚjÿäáî~ ŠÕi¤ÚwFñå ÚñÑ*¼vóÛ¿)\\㏂၉aVªÝ=}¾ÕxV·¡)*u<ï®É,)¸šWp¿f‹SŸÒŒ= å}·7lÖ¦ìÓ \\”Öƒő¤˜“ZŸNÿžXž¡#P«Èdõißêv§µ‘UUZ½b=}£,Öêæ¢)”•ëXZý]ý\\}V­U*Ö=}×ØÛ¥I˜W[=M[É[±Û-¡×š™öÑ¥«ÆëÅkÆËÃðîW]RÚ2Ý5VÄøD97;C>:B8@<Dýù÷ÿûþúø\0ü„}yw{ƒC¶7=}þõÿþ€uyƒ~‚x¬¥©¯³®²¨,%)/3.2(ìåéïóîòèl5¶Cx~´±³²,-'+.2ôñëîèlmqsrÌ_I.H|ÄóKbO\"0*ú¡²’·(H ¿ïϼã2Î~¢ð\vƒÒ‘z°\f³Ó†“€æÚÀ”Yoc¾\b,BpKŒ…^ˆÌ´T“‘ðånÓÁ@O[g\"P$3P\v„npô'‡{sf.:¢ò(ûÂñF= c¼ÃñTŒ‰ŠD”šé±¸ˆ¯»aôPˆ]Ž0$óZB~*sÅb“ ¤Ô“|i‹d€ïQ€‘xу^j¨+Ð\v‚^\\T1ÏÀ£ñ’4rÅ?V“Ðtn!xpë2ZC´óÒ\\*L»2€ÃõJa/uÎ@\n“Qè4îbh¼„UÿèM…q¤«\\?Фí1€LRº9œåE•\vƒqNþhËðê-uœµÍ“‘Føp¼ÍþéÕê‚Ñ=M…u‹‚\0O±iÕ¿5?c4Î\b{uV’㯵ªåêœ6¿²jÖ¿5?c1Ñd3¢•»‚Ö֝š•uKp\vrúpKpKpÓÀpdKc\fawU—l”¼½½}qNX ˜‡\\‘‡\fööö¬Ä³ò©í²âSõÌC&Xþ{õ¯DæXkõ°mb\0»5´¦©3š-\\i\b4Šmܗ®öŸ0§ÃH™= !û³H®\\ÝvÅ0Ñ;€AUÏS82|\\ÎÇÍc\\[6¬¶y+-Zði,JmÚ±®÷§›¦Ø¦¬îÚÙ¸¤nع%Æ;ö©Œ¾x¿= EDýz¾ðÉ#‡Sî-Y\b?M^¿w¼Ï^ãñ· (C\t|ÏÎ2ã;ˆÏ–Ì‚ý\fD0%“ÙçeŽ«ùӄèt’küԞ‚9¾®c²ßOq'Á|\b/q{±¼:XRøÛ[ˆCL·€Ž3‹3LÒ|^}=M4­,s'ln{úËèprkûÌ‚=}Þ®a¢Om7Á{ø¯m[±»>RöïۈGCKÁ@Ž/k3KÊ<ހý´-*^Q5?0B_û;H,‚aúGÏn¬[7œÖyN-V°™OXÕ\v¥= ³›.–Ùæ]š«÷–´eU˜Ëu•±õ)>­VòßNWçAu ï=MW«1µ*¸Q\0»»…)ßE§°£óE˜¬]y™4¯$Ó&dÎ{ø£„å\\Òkö¤†ø-^­WâNY÷Áv¨/=MY»±¶.ØQþÏ[…%CF±\0Ë3F¢üÝ|­´/\"¾Q9/ðA[«6 ìWªGÎZ,[;¼Vy\v;N.^0i\t<ÊnÞ¯÷›§âö¬ï-ÝØ¤o%¹\v5f;û¹Œ½‚ßàH'Äþ~Þð'i#‰3..]È¿Pf_yÜÏf#ñ¹H¨û§ã|/4NQàòŒï,RYLDv»ü½L½ƒç H)äþæ0)y£Š+~®= ¸_Pk‡AzðokK1ºRøù\v;‡JÏðŽ*CóJÀì^ƒéôŽlØøïdt0= ©eØ5ñ楚Um^Lp-ÎFp³€¶Kp‹‚#pK‚BââŒ!;7)ƒ‡³p¾ªä㜠9ú¿p˪€¢¿qs¤ªtÇéYCôµñô¾Ý€Gð‘/65púF¼Üöðfy!!ªÀg«Ç\vT:\0§ï¼œèLϧӊÝ5®p±ÅÐ,]r’?f’\v1q-ßEöe„£)”_Ïúf%µÀ{ÍމQ?šDœ¤¶à¼ÈItÜæ;^™èd)Á®æw\tgî¢Eüb8WҊmÓžADX3<@=}ó×é]qݶ75I2aõ= ãÖœŒ\\0˜‰¹8¬²<UpÒ¡ü^ê#ÞÂÄhÚ<e€»®ü\vV¿X¿}h®Ïrè¯ÐC¸\fâftp¸?ƒÜq?²»Y<À0p‘”ø<×BvŒE¥Ä=}o§+’ÚsU{Ñ@™œŸà4g18ÆC|)xÌt¯“ˆÃqp>–#H° T…K‡lUÏͪ|X~ÓJ‘´$½ê˜„9ÕÊ6¿W’׍qŽ_=}O¾!TAAq&Ñnﳤ#ÜHeÿ¦æÐ#\\”aX؞±O¾œšH(×PÁ\tî)_´ù‘úӝ•›÷­›Ç 6 ïCPÔÑÉ\fSüÁ\bH»\0üä‹#ÛIÛÈox¦D†!ŒùÝ+^)(Æî¼\bGä\t.ã~˲h\nÏ<Å ö§ËX½Aîm¢XEÑáX‹Å£€Xс4öϵ••™¥ëaTé\b®­hµÂ;Þoá8I/ûþÌ¢h/;‚Éã€þ3‹øµ«[Ù!&í®ÈFÈ÷þáZk­ JƬøÅ«\\ù#fí²HFÐøá\\‹­$ŠÆ´ˆÕó-¼‡[Ñ'ìcÈ|Ñ),cè€Ñ+lc\b„Ñ-¬d(ˆÉDÓd‹¾;¤WŸ5¥›֕ÛfÊr’x¢'@n£tøl”3òDülnJ³Pkülo4ò|ölŽm\nó\v24òŒöl’m\nô\vr4òˆõlmÊÄ\vb$òˆùlnÊ\vb4òEÀ´\vzZC‘m*¼P‡úìs_4òõìÔmj¬\vŠò÷ìTmjÌ\vŠ$òùìÔnjì\vŠ,òûìTnj\f\vŠ4ò³mzòómzò3mz òsmz$ò³nz(òónŠ‚$c\0QkQl¯kG;J‚öÄop®1Z.1b®2j.2r²qZ2qb²rj2rr¡aWáa[!a_aac¡bgábk!boabó›G%ù¹À.^ãG)>úÁ\0.= óœ\tÖ¼\tØÜ\tÚü\tÜ\tÞ<\tà\\\tâ|\täœ\næ¼\nèÜ\nêü\nì\nî<\nð\\\nò|\n4–«-õ¦ë-ö¶+-÷ Æk-ø$Ö«.ù(æë.úŒîMøÀ•ö­›7¡ûr“ø&w,ѵK\tì|¬óӄdŒˆ”1Ì|dQ.Ԑan̐¼ä‡º‡<$‰(SgôáT~В܍ìü\f\\¦ôwäô†Â“’Ák–¢•µ¡YÕ1꙯†Aú^mô,a{ó\bTN|q\fƒÒŒ4Òù´nà‹(Òúônð‹,Òû4n\0‹0Òütn‹´¤wØQ´†¹SY0¨$wèQô†ÁSZP¬¤xøQ!4†ÉS[p°$x\bQ#t†ÑS\\4³9¤~ڏ&39Ä~â(³:ä~ê*3:~ò,³;$~ú.3;D~|tLÔI³<d~\n23<„~ÔÁl֖•µ¥™6÷sã”ëý–†Õ¥ÄY¤†Ù¦Y´†Ý§DYĆᨄYԆå©ÄZä†éªZô†í«DZ†ñ¬„Z†õ­Ä[$†ù®[4†ý¯D[D†°„[T†±Ä\\d†\t²\\t†=M³D\\„†´„\\”ŽÕ%Äy¤ŽÙ&y´Ž]‘ùSÇ.da{Ј4Že‘ýSÉ/äbD{ðˆDŽm‘SË0db„{ˆTŽu‘SÍ1äcÄ|0|4|8|<|@|D|H|Ld\ftüo3–Yŕ½¡ü¸üpKøpK+F(oâL>ÈA\fôÿ\"/a#<Y€ú*@Rºd½ðq‚¨V/a\b|¹~ü2€²ìù1²ƒˆ«NYàg¡G^bsæû'Ò³‡\"ýò+ÎyÊîÎr‚Óåú/˜³ˆ•ŠûÐlhO~J\0±&IBƒ†>¥b{Peˆ'ŠLs¢ã½Ës㌐ç\v òú~›ÐZÂsêGR³‹B­rÂ\flú°ƒ¡\fåJ~£q$—Ê-xÑdÝe\\¯lÏ?U­p±‹.å«M] ç¡EV\"ã¿ÆVäß9£àñ{ª®ÍjBsèö³†2íÒA:Ìy­vá\fÝ\"®c‡4™þÉlŽ3*=}DJC\bá6FKPl|WIï}÷ÄßÊeÛÌð>\vel7\tïD_ÉiþˆSß肌=}„Z~þ:@Q¾lÝ0rzøJûÏp(‹ ‹ƒnh®¥\nY “œ”ŽvýÕé}AvÔp#šÙ‚¢áèü%îWzþÈ_·†_‰Ç^¿VGÉ®û3ýÚO!Há'¿’áHã\tŠ›0Â×S\v8ÂkâNs»ðÂÙKûXb¬8í\fxÂ,AïhB¬½Ø¶{é5X­à¹=}e\\©\0_f÷š÷*}öªçi­õ¢ùÿÉiñæŸ\n¯\0>Ù*/ÿBÅNï\"Iå1çÒâIç?ï˜bIf»n¨sª¥þ“¤Ü²Ï†Ïð«”JcvtZVýþiž«Äà.»v'y>g»Õ!\tZ}»ðNû¦'z@kÃåA¡º¯ß%8× Ý¾Ÿi}¥¹ã;ç\"W¹_ê>ê)éÿ\n€XCµ«‰äWx¼Àx³õyŸW••dnKpˆ«ŠƒnK°PJpÛåpëíP\"?ŽôrㇺT›FÜã8\0š’W´€Ñ˜6(Yó÷ÒF1-äáºùY×÷ËÆ2-‘¸4Þá‘Æ˜Žq´’O”ÆÄs%h=MÀd~ú‹H-!ÓáŏGÙîwÁæM^BfJV\n]]/sÇbBpÉá\fã™$›¤š\"£¡¡ÚÊY{†gþ>Q\të»P½7_TbJX¾tØy4½ßäx<…çxÇMnQóJ\0øHH’©Rþh¢+\0CçtCݎEËÊ(‚V\"éž@µ;%,³,^b©:<ÝGín!'g]G]{Uãdžö0ü6ìéÛ\vùN:ð\"ì(\bR\b2\b,Ž%Z-a‹§rZ€JK>´åÒ?QÚOf‹/M©ç÷»À\"0_^w¬_XÀ°˜°×א˜ñüp^AŸ±ƒƒ‚A¿$ïlûdãpË\\ëPóP¦>f¡(N b{0DËo9Pì\0DÂ>#†\v?,%)-*åˆÍ÷º<Ó9ºEÐEºEÎùiqú&‚É@Ð6À׺©×—W.Õ©¯>9%6Ì£ö\tævMàLzÉêJ\t¢!áábÂÁBA‚‚²±²21\tHk\fÜãX‰ˆÜ¸Íœ¾€ôZ•÷O[ÑßoK¿NÌ~§ÁÈ£õq3ۈèr^¾\fzÉñôD;äF®–YåÈv}çì|D[Y¿®Œ*ë>exÿ¨ÜÅ­ÿˆ3÷þj½¢w´Mz31Û41&j¨k|sß¡µoKÜ<ED΢w¼h“1ʈxÏ3RòVdoŠ)\"=M{\\핆ŽDût΢šÞy°"])))}});var c,u,d,l,h,p={a:{b:function(e){return Math.cos(e)},a:function(e){return Math.exp(e)},d:function(e,n,i){t.copyWithin(e,n,n+i)},c:function(e){t.length,function(e){throw"OOM"}()}}};this.setModule=function(t){e.setModule(UJ,t)},this.getModule=function(){return e.getModule(UJ)},this.instantiate=function(){return r.getModule().then((function(e){return WebAssembly.instantiate(e,p)})).then((function(e){var r,o=e.exports;c=o.g,u=o.h,d=o.i,l=o.j,h=o.k,o.l,n=o.e,r=n.buffer,i=r,t=new Uint8Array(r),function(e){e.f()}(o),a()})),r.ready=new Promise((function(e){a=e})).then((function(){r.HEAP=i,r._malloc=u,r._free=h,r._opus_frame_decoder_create=c,r._opus_frame_decode_float_deinterleaved=d,r._opus_frame_decoder_destroy=l})),r}}function VJ(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};VJ.errors||Object.defineProperties(VJ,{errors:{value:new Map([[-1,"OPUS_BAD_ARG: One or more invalid/out of range arguments"],[-2,"OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer"],[-3,"OPUS_INTERNAL_ERROR: An internal error was detected"],[-4,"OPUS_INVALID_PACKET: The compressed data passed is corrupted"],[-5,"OPUS_UNIMPLEMENTED: Invalid/unsupported request number"],[-6,"OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed"],[-7,"OPUS_ALLOC_FAIL: Memory allocation has failed"]])}}),this._init=function(){return new e._WASMAudioDecoderCommon(e).instantiate().then((function(t){e._common=t;var n=e._common.allocateTypedArray(e._channels,Uint8Array);n.buf.set(e._channelMappingTable),e._decoder=e._common.wasm._opus_frame_decoder_create(e._channels,e._streamCount,e._coupledStreamCount,n.ptr,e._preSkip,e._forceStereo)}))},Object.defineProperty(this,"ready",{enumerable:!0,get:function(){return e._ready}}),this.reset=function(){return e.free(),e._init()},this.free=function(){e._common.wasm._opus_frame_decoder_destroy(e._decoder),e._common.free()},this._decode=function(t){if(!(t instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+i(t));e._input.buf.set(t);var n=e._common.wasm._opus_frame_decode_float_deinterleaved(e._decoder,e._input.ptr,t.length,e._output.ptr);return n<0?(console.error("libopus "+n+" "+(VJ.errors.get(n)||"Unknown Error")),0):{outputBuffer:e._common.getOutputChannels(e._output.buf,e._outputChannels,n),samplesDecoded:n}},this.decodeFrame=function(t){var n=e._decode(t);return e._WASMAudioDecoderCommon.getDecodedAudioMultiChannel([n.outputBuffer],e._outputChannels,n.samplesDecoded,48e3)},this.decodeFrames=function(t){for(var n=[],i=0,r=0;r<t.length;){var a=e._decode(t[r++]);n.push(a.outputBuffer),i+=a.samplesDecoded}return e._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(n,e._outputChannels,i,48e3)},this._isWebWorker=VJ.isWebWorker,this._WASMAudioDecoderCommon=VJ.WASMAudioDecoderCommon||DJ,this._EmscriptenWASM=VJ.EmscriptenWASM||UJ,this._module=VJ.module;var n=8,r=function(e){return"number"==typeof e},a=t.channels,o=t.streamCount,s=t.coupledStreamCount,c=t.channelMappingTable,u=t.preSkip,d=t.forceStereo?1:0;if(a>2&&(!r(o)||!r(s)||!Array.isArray(c)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._channels=r(a)?a:2,this._streamCount=r(o)?o:1,this._coupledStreamCount=r(s)?s:this._channels-1,this._channelMappingTable=c||(2===this._channels?[0,1]:[0]),this._preSkip=u||0,this._forceStereo=a<=n&&2!=a?d:0,this._inputSize=3840*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}Rr({target:"Array",proto:!0},{copyWithin:iH}),LJ("copyWithin");var FJ=function(e){d(s,e);var t,i,r=g(s);function s(e){return o(this,s),r.call(this,e,"decoder",VJ,UJ)}return c(s,[{key:"decodeFrame",value:(i=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postToDecoder("decodeFrame",t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"decodeFrames",value:(t=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._postToDecoder("decodeFrames",t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),s}(OJ),jJ=function(){function e(t){o(this,e),this.userId_=t.userId,this.tinyId_=t.tinyId,this.client_=t.client,this.sdpSemantics_=t.client.getSdpSemantics(),this.isUplink_=t.isUplink,this.log_=Vx.createLogger({id:"n|"+this.userId_,userId:this.client_.getUserId(),sdkAppId:this.client_.getSDKAppId(),isLocal:this.isUplink_}),this.signalChannel_=t.signalChannel,this.peerConnection_=null,this.isErrorObserved_=!1,this.emitter_=new FA,this.currentState_=zT,this.waitForPeerConnectionConnectedPromise_=null,this.isReconnecting_=!1,this.reconnectionCount_=0,this.reconnectionTimer_=-1,this.isFirstConnection_=!0,this.delay_={audioDelay:0,videoDelay:0},this.enableSEI_=t.enableSEI,this.enableSpatial_=t.enableSpatial,this.canOpenEncodedStream()&&this.initEncodeStream()}var t;return c(e,[{key:"initialize",value:function(){var e={encodedInsertableStreams:this.canOpenEncodedStream(),iceServers:this.client_.getIceServers(),iceTransportPolicy:this.client_.getIceTransportPolicy(),sdpSemantics:this.sdpSemantics_,bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",tcpCandidatePolicy:"disable",IceTransportsType:"nohost"};this.peerConnection_=new RTCPeerConnection(e),this.peerConnection_.onconnectionstatechange=this.onConnectionStateChange.bind(this)}},{key:"close",value:function(){this.log_.info("closing connection"),this.closePeerConnection(),this.frameCodec_&&(this.frameCodec_.destroy(),this.frameCodec_=null)}},{key:"closePeerConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.peerConnection_&&(this.peerConnection_.onconnectionstatechange=function(){},this.peerConnection_.close(),this.peerConnection_=null,e&&this.emitConnectionStateChangedEvent(zT))}},{key:"getDTLSTransportState",value:function(){if(!this.peerConnection_)return GT;var e=null;if(this.isUplink_){if(!bO()||0===this.peerConnection_.getSenders().length)return GT;e=this.peerConnection_.getSenders()[0].transport}else{if(!SO()||0===this.peerConnection_.getReceivers().length)return GT;e=this.peerConnection_.getReceivers()[0].transport}return e?e.state:GT}},{key:"onConnectionStateChange",value:function(e){var t=this.peerConnection_.iceConnectionState,n=this.getDTLSTransportState();if(this.log_.info("onConnectionStateChange() connectionState: "+e.target.connectionState),this.log_.info("ICE Transport state: ".concat(t,", DTLS Transport state: ").concat(n)),e.target.connectionState===QT&&this.emitConnectionStateChangedEvent(WT),e.target.connectionState===XT||e.target.connectionState===$T){var i="".concat(this.isUplink_?"uplink":"downlink"," ICE/DTLS Transport connection ").concat(e.target.connectionState,". ICE Transport state: ").concat(t,", DTLS Transport state: ").concat(n),r=new kD({message:i,code:bD.ICE_TRANSPORT_ERROR});lM.logFailedEvent({userId:this.client_.getUserId(),eventType:gI,error:r}),this.emitConnectionStateChangedEvent(zT),this.isErrorObserved_||this.emitter_.emit(jO.ERROR,r)}e.target.connectionState!==ZT&&e.target.connectionState!==eI||(this.logSelectedCandidate(),lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:gI}),this.emitConnectionStateChangedEvent(qT))}},{key:"emitConnectionStateChangedEvent",value:function(e){e!==this.currentState_&&(this.currentState_===JT&&e===WT||(jA.emit(Rx,{client:this.client_,connection:this,prevState:this.currentState_,state:e}),this.emitter_.emit(jO.CONNECTION_STATE_CHANGED,{prevState:this.currentState_,state:e}),this.currentState_=e))}},{key:"hitTest",value:function(e){return(0===e||"0"===e)&&this.isUplink_||e===this.tinyId_}},{key:"addEventInternal",value:function(e,t){var n=this.client_.getUserId(),i={eventId:e,eventDesc:t,timestamp:i_(),userId:n,tinyId:this.client_.getTinyId()};this.isUplink_||(i.remoteUserId=this.userId_,i.remoteTinyId=this.tinyId_),oM(n,i)}},{key:"getPeerConnection",value:function(){return this.peerConnection_}},{key:"getClient",value:function(){return this.client_}},{key:"getUserId",value:function(){return this.userId_}},{key:"getTinyId",value:function(){return this.tinyId_}},{key:"logSelectedCandidate",value:(t=a(n().mark((function e(){var t,i,r,a,o,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.peerConnection_){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.peerConnection_.getStats();case 4:t=e.sent,i=w(t),e.prev=6,i.s();case 8:if((r=i.n()).done){e.next=18;break}if((a=k(r.value,2))[0],!xO(o=a[1])){e.next=16;break}return s=t.get(o.localCandidateId),c=t.get(o.remoteCandidateId),s&&this.log_.info("local candidate: ".concat(s.candidateType," ").concat(s.protocol,":").concat(s.ip||s.address,":").concat(s.port," ").concat(s.networkType||""," ").concat("relay"===s.candidateType?"relayProtocol:"+s.relayProtocol:"")),c&&this.log_.info("remote candidate: ".concat(c.candidateType," ").concat(c.protocol,":").concat(c.ip||c.address,":").concat(c.port)),e.abrupt("break",18);case 16:e.next=8;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(6),i.e(e.t0);case 23:return e.prev=23,i.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,this,[[6,20,23,26]])}))),function(){return t.apply(this,arguments)})},{key:"getCurrentState",value:function(){return this.currentState_}},{key:"waitForPeerConnectionConnected",value:function(){var e=this;return this.waitForPeerConnectionConnectedPromise_||(this.waitForPeerConnectionConnectedPromise_=new Promise((function(t,n){if(e.currentState_===qT)return t();var i=-1,r=function(e){e.state===qT&&(clearTimeout(i),o(),t())},a=function(t){t.client===e.client_&&(clearTimeout(i),o(),n(new kD({code:bD.API_CALL_ABORTED,message:sA({key:MR,data:"leave room"})})))},o=function(){jA.off(KA,a,e),e.emitter_.off(jO.CONNECTION_STATE_CHANGED,r,e)};i=setTimeout((function(){o();var e=new kD({code:bD.API_CALL_TIMEOUT,message:"connection timeout"});n(e)}),1e4),jA.on(KA,a,e),e.emitter_.on(jO.CONNECTION_STATE_CHANGED,r,e)})),this.waitForPeerConnectionConnectedPromise_=this.waitForPeerConnectionConnectedPromise_.then((function(t){return e.waitForPeerConnectionConnectedPromise_=null,t})).catch((function(t){throw e.waitForPeerConnectionConnectedPromise_=null,t}))),this.waitForPeerConnectionConnectedPromise_}},{key:"getReconnectionCount",value:function(){return this.reconnectionCount_}},{key:"startReconnection",value:function(){this.isReconnecting_=!0,this.emitConnectionStateChangedEvent(JT),this.reconnect(),this.addEventInternal(this.isUplink_?$D:eM,"".concat(this.isUplink_?"uplink":"downlink","-connection is reconnecting"))}},{key:"stopReconnection",value:function(){this.log_.info("stop reconnection"),this.isReconnecting_=!1,this.reconnectionCount_=0,this.clearReconnectionTimer(),this.signalChannel_.off(JP,this.reconnect,this)}},{key:"on",value:function(e,t,n){this.emitter_.on(e,t,n)}},{key:"off",value:function(e,t,n){this.emitter_.off(e,t,n)}},{key:"setDelay",value:function(e){var t=e.audioDelay,n=e.videoDelay;this.delay_={audioDelay:t,videoDelay:n}}},{key:"getDelay",value:function(){return this.delay_}},{key:"isH264",get:function(){var e,t;return!(null===(e=this.peerConnection_)||void 0===e||null===(t=e.remoteDescription)||void 0===t||!t.sdp.includes("H264"))}},{key:"initEncodeStream",value:function(){this.enableSpatial_&&!this.isUplink_&&(this.audioDecoder_=new FJ({forceStereo:!1,preSkip:0,channels:2,streamCount:1,coupledStreamCount:1,channelMappingTable:[0,1]}),this.audioDecoder_.ready),KC||(this.frameCodec_=new bW({connection:this,log:this.log_,isUplink:this.isUplink_,audioDecoder:this.audioDecoder_||null}))}},{key:"isSpatialEnabled",value:function(){return this.enableSpatial_}},{key:"getSpatialManager",value:function(){return this.client_.getSpatialManager()}},{key:"canOpenEncodedStream",value:function(){return this.enableSEI_&&CO||this.enableSpatial_&&AO()}}]),e}(),BJ=function(){function ClientManager(){o(this,ClientManager),this.set_=new Set,jA.on(BA,this.add,this),jA.on(zA,this.add,this),jA.on(WA,this.delete,this),jA.on(KA,this.delete,this)}return c(ClientManager,[{key:"add",value:function(e){var t=e.client,n=e.roomId;if("rtc"!==t.getMode()){var i=this.getKey(t.getUserId(),n||t.getRoomId(),t.getSDKAppId(),t.getUseStringRoomId());this.set_.add(i)}}},{key:"delete",value:function(e){var t=e.client;if("rtc"!==t.getMode()){var n=this.getKey(t.getUserId(),t.getRoomId(),t.getSDKAppId(),t.getUseStringRoomId());this.set_.delete(n)}}},{key:"getKey",value:function(e,t,n,i){return"".concat(n,"_").concat(t,"_").concat(e,"_").concat(i)}},{key:"isJoined",value:function(e){var t=e.userId,n=e.roomId,i=e.sdkAppId,r=e.client;return"rtc"!==r.getMode()&&this.set_.has(this.getKey(t,n,i,r.getUseStringRoomId()))}}]),ClientManager}(),HJ=new BJ;function GJ(e,t,n,i){if(this.useStringRoomId_){if(!(_A(e)&&/^[A-Za-z\d\s!#$%&()+\-:;<=.>?@[\]^_{}|~,]{1,64}$/.test(e)))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:YE,data:t,link:{className:i,fnName:n}})})}else if(!(gA(e)&&/^[1-9]\d*$/.test(String(e))&&e<4294967295))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:ZE,data:t,link:{className:i,fnName:n}})})}function zJ(e,t,n,i){if(!/^[A-Za-z\d_-]*$/.test(e))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:gw,data:t,link:{className:i,fnName:n}})})}var WJ={createClient:{name:"clientConfig",required:!0,type:FI,properties:{sdkAppId:{required:!0,type:LI,allowEmpty:!1},userId:{required:!0,type:NI,allowEmpty:!1},userSig:{required:!0,type:NI,allowEmpty:!1},mode:{required:!0,type:NI,values:["rtc",MT]},useStringRoomId:{type:UI},autoSubscribe:{type:UI},enableAutoPlayDialog:{type:UI},streamId:{type:NI},userDefineRecordId:{type:NI},pureAudioPushMode:{type:LI,values:[1,2]},enableSEI:{type:UI}}},createStream:{name:"streamConfig",required:!0,type:FI,properties:{userId:{type:NI},audio:{type:UI},video:{type:UI},screen:{type:UI},screenAudio:{type:UI},microphoneId:{type:NI},cameraId:{type:NI},facingMode:{type:[NI,FI]},audioSource:{instanceOf:window.MediaStreamTrack},videoSource:{instanceOf:window.MediaStreamTrack}},validate:function(e){if(!vA(e.screen)&&e.screen&&vA(e.audio)&&(e.audio=!1),!(vA(e.audio)&&vA(e.video)||vA(e.audioSource)&&vA(e.videoSource)))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:oR})});if(!vA(e.screen)&&!0===e.screen&&!0===e.video)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:sR})});if(e.audio&&e.screenAudio)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:cR})});if(!0!==e.screen&&!0===e.screenAudio)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:uR})});if(!vA(e.screen)&&!0===e.screen&&!this.isScreenShareSupported())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:_R})})}}},JJ={join:{name:"options",required:!0,type:FI,properties:{roomId:{required:!0,type:[LI,NI],allowEmpty:!1,validate:GJ},role:{type:[NI],values:[LT,UT]},privateMapKey:{type:[NI]}},validate:function(e){if(this.isJoined_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:$E})});if(this.checkDestroy(),HJ.isJoined({userId:this.userId_,roomId:e.roomId,sdkAppId:this.sdkAppId_,client:this}))throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Ww,data:this.userId_})})}},publish:[{name:"stream",required:!0,instanceOf:nE,validate:function(e){if(!this.isJoined_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:rw})});if(this.mode_===MT&&this.role_===UT)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:ow})});if(!e.getIsReadyToPublish())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:sw})});if(this.notPublishWithoutH264Supported_)throw new kD({code:bD.NOT_SUPPORTED_H264,message:sA({key:pR})})}},{name:"options",type:FI,defaultValue:{isAuxiliary:!1},properties:{isAuxiliary:{type:UI,defaultValue:!1,validate:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&!TO())throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:gR})});if(this.uplinkConnection_&&(e&&this.uplinkConnection_.isAuxStreamPublished||!e&&this.uplinkConnection_.isMainStreamPublished))throw new kD({code:bD.INVALID_OPERATION,message:sA({key:cw,data:e?Hk:"local"})});var t=this.localScreenStream_||T(this.connections_.values()).findIndex((function(e){return e.getTrackState().auxiliary}))>=0;if(!this.enableMultiAuxStream_&&e&&t)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:NR})})}}}}],unpublish:{name:"stream",required:!0,instanceOf:nE,validate:function(e){if(e!==this.localStream_&&e!==this.localAuxStream_){if(this.localStream_||this.localAuxStream_)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:aw})});this.log_.warn("Client currently has no published stream, please call publish() first.")}}},subscribe:[{name:"stream",required:!0,instanceOf:iE,validate:function(e){if(!e.getConnection())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:uw})});if(this.notSubscribeWithoutH264Supported_)throw new kD({code:bD.NOT_SUPPORTED_H264,message:sA({key:fR})})}},{name:"options",type:FI,properties:{audio:{type:UI},video:{type:UI},smallVideo:{type:UI}},validate:function(e){var t=e.audio,n=e.video,i=e.smallVideo;if(!1===t&&!1===n&&(vA(i)||!1===i))throw new kD({code:bD.INVALID_OPERATION,message:sA({key:ER})})}}],unsubscribe:{name:"stream",required:!0,instanceOf:iE,validate:function(e){if(!e.getConnection())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:uw})})}},switchRole:{name:"role",required:!0,values:[LT,UT],validate:function(){if(this.mode_!==MT)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:lw})});if(!this.isJoined_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:hw})})}},startPublishCDNStream:{name:"options",required:!1,properties:{streamId:{type:NI,validate:zJ},streamType:{type:NI,values:["main","auxiliary"]},appId:{type:LI,allowEmpty:!1},bizId:{type:LI,allowEmpty:!1},url:{type:NI,allowEmpty:!1}},validate:function(){if(this.isDestroyed_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Jw,data:{funName:"startPublishCDNStream"}})})}},startMixTranscode:{name:"config",required:!0,type:FI,properties:{mode:{type:NI,values:["preset-layout","manual"]},streamId:{type:NI,validate:zJ},videoWidth:{type:LI,notLessThanZero:!0},videoHeight:{type:LI,notLessThanZero:!0},videoBitrate:{type:LI,notLessThanZero:!0,allowEmpty:!1},videoFramerate:{type:LI,validate:function(e,t,n,i){if(e<=0||e>30)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:$w,link:{className:i,fnName:n}})})}},videoGop:{type:LI,validate:function(e,t,n,i){if(e<1||e>8)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Yw,link:{className:i,fnName:n}})})}},audioSampleRate:{type:LI,notLessThanZero:!0},audioBitrate:{type:LI,validate:function(e,t,n,i){if(e<32||e>192)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Zw,link:{className:i,fnName:n}})})}},audioChannels:{type:LI,values:[1,2]},backgroundColor:{type:LI},backgroundImage:{type:NI},mixUsers:{required:!0,type:VI,arrayItem:{require:!0,type:FI,properties:{userId:{required:!0,type:NI},roomId:{type:[NI,LI],validate:GJ},pureAudio:{type:UI},width:{type:LI,notLessThanZero:!0},height:{type:LI,notLessThanZero:!0},locationX:{type:LI,notLessThanZero:!0},locationY:{type:LI,notLessThanZero:!0},zOrder:{type:LI},streamType:{type:NI,values:["main","auxiliary"]},renderMode:{type:LI,values:[0,1,2,4]}}}}},validate:function(e,t,n,i,r){var a=0,o=0,s=e.mixUsers,c=[];if(s.forEach((function(e,t){if(c.push(e.userId),!e.pureAudio){if(!e.zOrder||e.zOrder<1||e>15)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:eR,data:"config.mixUsers[".concat(t,"].zOrder"),link:{className:i,fnName:n}})});e.width+e.locationX>a&&(a=e.width+e.locationX),e.height+e.locationY>o&&(o=e.height+e.locationY)}})),c.indexOf(this.getUserId())<0)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:tR,link:{className:i,fnName:n}})});if(e.videoWidth<a||e.videoHeight<o)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:nR,link:{className:i,fnName:n}})})}},sendSEIMessage:[{name:"buffer",required:!0,instanceOf:ArrayBuffer,validate:function(e){if(!CO)throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:wR})});if(!this.enableSEI_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:RR})});if(e.byteLength>1e3)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:AR,data:e.byteLength})});if(0===e.byteLength)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:CR})});if(!this.uplinkConnection_||!this.localStream_)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:xR})});if(!this.localStream_.hasVideo())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:PR})});var t=this.uplinkConnection_.isH264;if(!t)throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:wR,data:t})})}},{name:"options",type:FI,properties:{seiPayloadType:{type:LI,values:[5,243]}}}],enable3DSpatialAudioEffect:{name:"enabled",required:!0,type:UI},updateSelf3DSpatialPosition:[{name:"position",type:VI},{name:"axisRight",type:VI},{name:"axisForward",type:VI},{name:"axisUp",type:VI}],updateRemote3DSpatialPosition:[{name:"userId",required:!0,type:NI},{name:"position",required:!0,type:VI}],set3DSpatialReceivingRange:{name:"range",required:!0,type:LI}},qJ={play:[{name:"elementId",required:!0,type:[NI,"HTMLDivElement"],validate:function(e,t,n){if(_A(e)){var i=document.getElementById(e);if(!i)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:iR,data:{key:t,fnName:n}})});if(!(i instanceof HTMLDivElement))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:rR,data:{key:t,fnName:n,type:TA(i)}})})}}},{name:"options",type:FI,properties:{objectFit:{type:NI,values:["contain","cover","fill"]},muted:{type:UI},mirror:{type:UI}}}],addTrack:{name:ST,instanceOf:MediaStreamTrack,validate:function(e){if(this.isAddingTrack_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Mw})});if(this.isRemovingTrack_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Ow})});if(this.publishState_===GI)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Nw})});var t=this.getMediaStream();if(!t)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Lw})});if(e.kind===Uk&&t.getAudioTracks().length>0||e.kind===Vk&&t.getVideoTracks().length>0)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Uw})});if(!kO()&&!bO())throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:mR,data:_T})})}},removeTrack:{name:ST,instanceOf:MediaStreamTrack,validate:function(e){if(this.isAddingTrack_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Fw})});if(this.isRemovingTrack_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:jw})});if(this.publishState_===GI)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Bw})});var t=this.getMediaStream();if(!t)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Lw})});if(-1===t.getTracks().indexOf(e))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Hw})});if(!kO()){if(1===t.getTracks().length)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Gw})});if(e.kind===Uk)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Vw})});if(!bO())throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:mR,data:gT})})}}},replaceTrack:{name:ST,instanceOf:MediaStreamTrack,validate:function(e){var t=this.getMediaStream();if(!t)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Dw})});if(this.publishState_===GI)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Pw})});if(e.kind===Uk&&t.getAudioTracks().length<=0||e.kind===Vk&&t.getVideoTracks().length<=0)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:zw,data:e})});if(!IO())throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:mR,data:yT})})}}},KJ={TRTC:WJ,CLIENT:JJ,LOCAL_STREAM:{switchDevice:[{name:"type",required:!0,type:NI,values:[Uk,Vk]},{name:"deviceId",required:!0,type:NI,validate:function(){if(this.screen_&&!this.audio_||this.audioSource_||this.videoSource_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Aw})});if(this.publishState_===GI)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:xw})});if(!IO())throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:vR})})}}],setAudioCaptureVolume:{name:"volume",type:LI}},STREAM:qJ};function QJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,i){var r=i.value;return i.value=function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return $J.call(this,t,i,n,this.name_),r.apply(this,i)},i}}function XJ(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e,i,r){var o=r.value;return r.value=a(n().mark((function e(){var r,a,s,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=c.length,a=new Array(r),s=0;s<r;s++)a[s]=c[s];return $J.call(this,t,a,i,this.name_),e.abrupt("return",o.apply(this,a));case 3:case"end":return e.stop()}}),e,this)}))),r}}function $J(e,t,n,i){try{for(var r=0;r<e.length;r++)YJ.call(this,{rule:e[r],value:t[r],key:e[r].name,fnName:n,className:i})}catch(IQ){throw Vx.error(IQ),IQ}}function YJ(e){var t=this,n=e.rule,i=e.value,r=e.key,a=e.fnName,o=e.className;if(vA(i)){if(n.required)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:ME,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})});if(vA(n.defaultValue))return;i=n.defaultValue}if(Array.isArray(n.type)){if(!n.type.map((function(e){return e.toLowerCase()})).includes(TA(i)))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:OE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})})}else if(!vA(n.type)&&TA(i)!==n.type)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:OE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})});if(!1===n.allowEmpty){var s=gA(i)&&(0===i||Number.isNaN(i)),c=_A(i)&&""===i.trim();if(s||c)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:NE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})})}if(n.notLessThanZero&&gA(i)&&i<0)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Xw,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})});if(_A(n.instanceOf)){if(!i||i.name_!==n.instanceOf)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:LE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})})}else if(mA(n.instanceOf)&&!(i instanceof n.instanceOf))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:LE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})});if(n.values&&!n.values.includes(i))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:UE,data:{key:r,rule:n,fnName:a,value:i},link:{className:o,fnName:a}})});var u=n.properties;hA(u)&&SA(i)&&Object.keys(u).forEach((function(e){YJ.call(t,{rule:u[e],value:i&&i[e],key:"".concat(r,".").concat(e),fnName:a,className:o})}));var d=n.arrayItem;hA(d)&&bA(i)&&i.forEach((function(e,n){YJ.call(t,{rule:d,value:e,key:"".concat(r,"[").concat(n,"]"),fnName:a,className:o})})),mA(n.validate)&&n.validate.call(this,i,r,a,o,this)}Rr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var ZJ=Rr,eq=M,tq=tc.f;ZJ({target:"Object",stat:!0,forced:eq((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:tq});var nq,iq,rq=wN;function aq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{retries:5,timeout:2e3};return function(t,n,i){var r=Mx({retryFunction:i.value,settings:e,onError:e.onError,onRetrying:e.onRetrying,onRetryFailed:e.onRetryFailed});return i.value=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.apply(this,t)},i}}Rr({target:"Array",stat:!0,forced:!Du((function(e){Array.from(e)}))},{from:rq});var oq,sq,cq,uq,dq=5e3,lq={msg_user_info:0,uint32_video_avg_fps:0,uint32_video_width:0,uint32_video_height:0,uint32_video_avg_bitrate:0,uint32_video_block_time:0,uint32_video_play_time:0,uint32_audio_block_time:0,uint32_audio_play_time:0,uint32_audio_play_db:0,uint32_avg_down_loss:0,uint32_stream_type:0,uint32_video_render_first:0,uint32_video_block_count:0,uint32_audio_block_count:0,uint32_audio_bitrate:0,uint32_video_black_screen_subjective:0,uint32_audio_recv_bitrate:0,uint32_video_external_block_time:0},hq=c((function e(t){o(this,e),this.str_identifier=String(t.userId),this.uint64_tinyid=Number(t.tinyId),this.uint32_role=t.role})),pq=(nq=aq({timeout:500,retries:3}),iq=function(){function e(t){var i=this;o(this,e),this.frameWorkType_=t.frameWorkType||30,this.component_=t.component||0,this.client_=t.client,this.keyPrefix_="key_point",this.storageKey_="".concat(this.keyPrefix_,"_").concat(this.client_.getUserId()),this.log_=Vx.createLogger({id:"kpm|"+this.client_.getUserId(),userId:this.client_.getUserId(),sdkAppId:this.client_.getSDKAppId()}),Object.getOwnPropertyNames(this.__proto__).forEach((function(e){e.startsWith("handle")&&mA(i[e])&&(i[e]=function(e){var t=e.fn,i=e.context;return a(n().mark((function e(){var r,a,o,s=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(e.prev=0,r=s.length,a=new Array(r),o=0;o<r;o++)a[o]=s[o];return e.next=4,t.apply(i||this,a);case 4:return e.abrupt("return",e.sent);case 7:e.prev=7,e.t0=e.catch(0),Vx.error("".concat(t.name,"() error observed ")+e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}({fn:i[e],context:i}))})),this.initData(),this.installEvents(),this.intervalId_=iO.run(gE,this.setStorage.bind(this),{delay:2e4})}var i,r,s;return c(e,[{key:"initData",value:function(){this.firstPublishedUserList_=[],this.networkQuality_={totalUplinkRTT:0,totalUplinkLoss:0,count:0,totalDownlinkRTTAndLossMap:new Map},this.basicInfo={string_sdk_version:Wa,uint32_os_type:15,string_device_name:"",string_http_user_agent:navigator.userAgent,string_os_version:"",string_domain:location.host,uint32_avg_rtt:0,uint32_avg_up_loss:0,uint32_scene:"live"===this.client_.getMode()?1:0,uint32_joining_duration:0,uint32_networkType:BI[lA()],uint32_framework:this.frameWorkType_,uint32_component:this.component_},this.pathJoinRoom_={uint64_start_time:0,uint64_init_audio_start_time:0,uint64_init_audio_end_time:0,uint64_init_camera_start_time:0,uint64_init_camera_end_time:0,uint64_send_request_acc_ip_cmd_start_time:0,uint64_send_request_acc_ip_cmd_end_time:0,uint64_send_request_enter_room_cmd_start_time:0,uint64_send_request_enter_room_cmd_end_time:0,uint64_send_first_video_frame_time:0,uint64_recv_userlist_time:0,uint64_end_time:0,int32_init_audio_ret:0,int32_init_camera_ret:0,int32_send_request_acc_ip_cmd_ret:0,int32_send_request_enter_room_cmd_ret:0,int32_end_ret:0},this.pathLeaveRoom_={uint64_start_time:0,uint64_send_request_exit_room_cmd_start_time:0,uint64_send_request_exit_room_cmd_end_time:0,uint64_end_time:0,int32_send_request_exit_room_cmd_ret:0,int32_end_ret:0},this.pathMainVideoMap_=new Map,this.pathMainAudioMap_=new Map,this.pathAuxiliaryMap_=new Map,this.localStreamStats_={totalVideoBitrate:0,totalVideoFPS:0,totalVideoHeight:0,totalVideoWidth:0,totalAudioLevel:0,videoCount:0,audioLevelCount:0,publishStartTime:0,statsToReport:{uint32_audio_capture_db:0,uint32_video_big_capture_fps:0,uint32_video_big_bitrate:0,uint32_video_big_resolution:0}},this.remoteStreamStatsMap_=new Map}},{key:"installEvents",value:function(){jA.on(BA,this.handleJoinStart,this),jA.on(YA,this.handleWSStart,this),jA.on(ZA,this.handleWSEnd,this),jA.on(HA,this.handleJoinSendCMD,this),jA.on(GA,this.handleJoinReceivedCMDResponce,this),jA.on(zA,this.handleJoinSuccess,this),jA.on(WA,this.handleJoinFailed,this),jA.on(XA,this.handleReceivedPublishUserList,this),jA.on(Rx,this.handleConnectionStateChanged,this),jA.on(JA,this.handleLeaveStart,this),jA.on(KA,this.handleLeaveSuccess,this),jA.on(qA,this.handleLeaveSendCMD,this),jA.on(Cx,this.handleSendSubscribeCMD,this),jA.on(ox,this.handleVideoPlaying,this),jA.on(sx,this.handleAudioPlaying,this),jA.on(Ax,this.handleNetworkQuality,this),jA.on(QA,this.handleHeartbeatStats,this),jA.on(ux,this.handleRemoteStreamAdded,this),jA.on(dx,this.handleRemoteStreamSubscribeStart,this),jA.on(lx,this.handleRemoteStreamSubscribed,this),jA.on(fx,this.handleRemoteStreamRemoved,this),jA.on(kx,this.handleVideoLoadedData,this),jA.on(bx,this.handlePlayStream,this),jA.on($A,this.handlePublishStart,this),jA.on(vx,this.handleLocalStreamInitStart,this),jA.on(_x,this.handleLocalStreamInitEnd,this),jA.on(gx,this.handleLocalStreamInitFailed,this)}},{key:"uninstallEvents",value:function(){jA.off(BA,this.handleJoinStart,this),jA.off(YA,this.handleWSStart,this),jA.off(ZA,this.handleWSEnd,this),jA.off(HA,this.handleJoinSendCMD,this),jA.off(GA,this.handleJoinReceivedCMDResponce,this),jA.off(XA,this.handleReceivedPublishUserList,this),jA.off(Rx,this.handleConnectionStateChanged,this),jA.off(JA,this.handleLeaveStart,this),jA.off(KA,this.handleLeaveSuccess,this),jA.off(zA,this.handleJoinSuccess,this),jA.off(WA,this.handleJoinFailed,this),jA.off(qA,this.handleLeaveSendCMD,this),jA.off(Cx,this.handleSendSubscribeCMD,this),jA.off(ox,this.handleVideoPlaying,this),jA.off(sx,this.handleAudioPlaying,this),jA.off(Ax,this.handleNetworkQuality,this),jA.off(QA,this.handleHeartbeatStats,this),jA.off(ux,this.handleRemoteStreamAdded,this),jA.off(dx,this.handleRemoteStreamSubscribeStart,this),jA.off(lx,this.handleRemoteStreamSubscribed,this),jA.off(fx,this.handleRemoteStreamRemoved,this),jA.off(kx,this.handleVideoLoadedData,this),jA.off(bx,this.handlePlayStream,this),jA.off($A,this.handlePublishStart,this),jA.off(vx,this.handleLocalStreamInitStart,this),jA.off(_x,this.handleLocalStreamInitEnd,this),jA.off(gx,this.handleLocalStreamInitFailed,this)}},{key:"destroy",value:function(){this.uninstallEvents(),iO.clearTask(this.intervalId_),this.client_=null}},{key:"handleJoinStart",value:function(e){this.hitTest(e.client)&&0===this.pathJoinRoom_.uint64_start_time&&(this.pathJoinRoom_.uint64_start_time=Date.now(),this.checkStorage())}},{key:"handleWSStart",value:function(e){var t=e.client;this.hitTest(t)&&0===this.pathJoinRoom_.uint64_send_request_acc_ip_cmd_start_time&&(this.pathJoinRoom_.uint64_send_request_acc_ip_cmd_start_time=Date.now())}},{key:"handleWSEnd",value:function(e){var t=e.client,n=e.error;this.hitTest(t)&&0===this.pathJoinRoom_.uint64_send_request_acc_ip_cmd_end_time&&(this.pathJoinRoom_.uint64_send_request_acc_ip_cmd_end_time=Date.now(),n&&(this.pathJoinRoom_.int32_send_request_acc_ip_cmd_ret=n instanceof kD?Number(n.getExtraCode()||n.getCode()):bD.UNKNOWN,this.pathJoinRoom_.int32_end_ret=2))}},{key:"handleJoinSendCMD",value:function(e){this.hitTest(e.client)&&0===this.pathJoinRoom_.uint64_send_request_enter_room_cmd_start_time&&(this.pathJoinRoom_.uint64_send_request_enter_room_cmd_start_time=Date.now())}},{key:"handleJoinReceivedCMDResponce",value:function(e){this.hitTest(e.client)&&0===this.pathJoinRoom_.uint64_send_request_enter_room_cmd_end_time&&(this.pathJoinRoom_.uint64_send_request_enter_room_cmd_end_time=Date.now(),this.pathJoinRoom_.int32_send_request_enter_room_cmd_ret=e.code,0!==e.code&&(this.pathJoinRoom_.int32_end_ret=3))}},{key:"handleJoinSuccess",value:function(e){this.hitTest(e.client)&&0===this.pathJoinRoom_.uint64_end_time&&(this.pathJoinRoom_.uint64_end_time=Date.now(),this.pathJoinRoom_.int32_end_ret=0)}},{key:"handleJoinFailed",value:function(e){var t=e.client;this.hitTest(t)&&(this.pathJoinRoom_.uint64_end_time=Date.now(),0===this.pathJoinRoom_.int32_end_ret&&(this.pathJoinRoom_.int32_end_ret=3),this.prepareReport(),this.report())}},{key:"handleReceivedPublishUserList",value:function(e){this.hitTest(e.client)&&0===this.pathJoinRoom_.uint64_recv_userlist_time&&(this.pathJoinRoom_.uint64_recv_userlist_time=Date.now(),this.firstPublishedUserList_=e.data.data&&e.data.data.userList||[])}},{key:"handleConnectionStateChanged",value:function(e){var t=e.client,n=e.state,i=e.connection;if(this.hitTest(t)&&n===qT){this.client_.getUplinkConnection()===i&&0===this.pathJoinRoom_.uint64_send_first_video_frame_time&&this.localStreamStats_.publishStartTime>this.pathJoinRoom_.uint64_end_time&&this.localStreamStats_.publishStartTime-this.pathJoinRoom_.uint64_end_time<=100&&(this.pathJoinRoom_.uint64_send_first_video_frame_time=Date.now());var r=this.pathMainVideoMap_.get("".concat(i.getUserId(),"_").concat(BT));r&&0===r.statsToReport.uint64_pc_connected_time&&(r.statsToReport.uint64_pc_connected_time=Date.now())}}},{key:"handleLeaveStart",value:function(e){this.hitTest(e.client)&&(this.pathLeaveRoom_.uint64_start_time=Date.now())}},{key:"handleLeaveSuccess",value:function(e){this.hitTest(e.client)&&0===this.pathLeaveRoom_.uint64_end_time&&(this.pathLeaveRoom_.uint64_end_time=Date.now(),0!==this.pathJoinRoom_.uint64_end_time?this.basicInfo.uint32_joining_duration=this.pathLeaveRoom_.uint64_end_time-this.pathJoinRoom_.uint64_end_time:this.log_.warn("pathJoinRoom endTime is 0"),this.report())}},{key:"handleLeaveSendCMD",value:function(e){this.hitTest(e.client)&&(this.pathLeaveRoom_.uint64_send_request_exit_room_cmd_start_time=Date.now(),this.pathLeaveRoom_.uint64_send_request_exit_room_cmd_end_time=Date.now())}},{key:"handleRemoteStreamAdded",value:function(e){var n=e.client,i=e.stream;if(this.hitTest(n)){var r=i.getUserId(),a=i.getType(),o="".concat(r,"_").concat(a),s=this.remoteStreamStatsMap_.get(o);if(s)s.stream=i;else{var c={userId:r,totalVideoFPS:0,totalVideoBitrate:0,totalAudioLevel:0,totalAudioBitrate:0,totalLoss:0,audioCount:0,audioLevelCount:0,videoCount:0,networkQualityCount:0,streamAddedTime:Date.now(),subscribeStartTime:0,subscribedTime:0,playStreamTime:0,statsToReport:t({},lq),stream:i};c.statsToReport.msg_user_info=new hq({userId:r,tinyId:i.getTinyId(),role:OT}),c.statsToReport.uint32_stream_type=a===BT?2:7,this.remoteStreamStatsMap_.set(o,c)}}}},{key:"handleRemoteStreamSubscribeStart",value:function(e){var t=e.client,n=e.stream;if(this.hitTest(t)){var i=n.getUserId(),r=n.getType(),a="".concat(i,"_").concat(r),o=this.remoteStreamStatsMap_.get(a);o&&0===o.subscribeStartTime&&(o.subscribeStartTime=Date.now())}}},{key:"handleSendSubscribeCMD",value:function(e){if(this.hitTest(e.client)){var t=new hq(e),n=Date.now(),i="".concat(e.userId,"_").concat(BT);e.trackState.video&&e.subscribeState.video&&!this.pathMainVideoMap_.has(i)&&this.pathMainVideoMap_.set(i,{statsToReport:{msg_user_info:t,uint64_start_enter_time:this.pathJoinRoom_.uint64_start_time,uint64_render_first_frame_time:0,uint64_combine_first_frame_time:0,uint64_pc_connected_time:0},userId:e.userId,sendSubscribeCMDTime:n}),e.trackState.audio&&e.subscribeState.audio&&!this.pathMainAudioMap_.has(i)&&this.pathMainAudioMap_.set(i,{statsToReport:{msg_user_info:t,uint64_start_enter_time:this.pathJoinRoom_.uint64_start_time,uint64_play_first_frame_time:0},userId:e.userId,sendSubscribeCMDTime:n});var r="".concat(e.userId,"_").concat(HT);e.trackState.auxiliary&&e.subscribeState.auxiliary&&!this.pathAuxiliaryMap_.has(r)&&this.pathAuxiliaryMap_.set(r,{sendSubscribeCMDTime:n})}}},{key:"handleRemoteStreamSubscribed",value:function(e){var t=e.client,n=e.stream;if(this.hitTest(t)){var i=n.getUserId(),r=n.getType(),a="".concat(i,"_").concat(r),o=this.remoteStreamStatsMap_.get(a);o&&0===o.subscribedTime&&(o.subscribedTime=Date.now(),o.stream=n)}}},{key:"handleRemoteStreamRemoved",value:function(e){var t=e.client,n=e.stream;if(this.hitTest(t)){var i=n.getUserId(),r=n.getType(),a=this.remoteStreamStatsMap_.get("".concat(i,"_").concat(r));a&&(a.stream=null)}}},{key:"handlePlayStream",value:function(e){var t=e.stream;if(t.isRemote()&&t.getConnection()&&this.hitTest(t.getConnection().getClient())){var n=t.getConnection().getUserId(),i="".concat(n,"_").concat(t.getType());if(this.remoteStreamStatsMap_.has(i)){var r=this.remoteStreamStatsMap_.get(i);0===r.playStreamTime&&(r.playStreamTime=Date.now())}}}},{key:"handleVideoLoadedData",value:function(e){var t=e.stream;if(t.isRemote()&&t.getConnection()&&this.hitTest(t.getConnection().getClient())){var n=t.getConnection().getUserId(),i="".concat(n,"_").concat(t.getType());if(this.pathMainVideoMap_.has(i)){var r=this.pathMainVideoMap_.get(i);0===r.statsToReport.uint64_combine_first_frame_time&&(r.statsToReport.uint64_combine_first_frame_time=Date.now())}}}},{key:"handleVideoPlaying",value:function(e){var t=e.stream;if(t.isRemote()&&t.getConnection()&&this.hitTest(t.getConnection().getClient())){var n=t.getConnection().getUserId(),i="".concat(n,"_").concat(t.getType()),r=Date.now();if(this.pathMainVideoMap_.has(i)){var a=this.pathMainVideoMap_.get(i);if(0===a.statsToReport.uint64_render_first_frame_time&&(a.statsToReport.uint64_render_first_frame_time=r),this.remoteStreamStatsMap_.has(i)){var o=this.remoteStreamStatsMap_.get(i),s=o.statsToReport,c=o.playStreamTime,u=o.subscribedTime;0===s.uint32_video_render_first&&c-u<=100&&(s.uint32_video_render_first=r-a.sendSubscribeCMDTime)}}if(t.getType()===HT&&this.pathAuxiliaryMap_.has(i)&&this.remoteStreamStatsMap_.has(i)){var d=this.remoteStreamStatsMap_.get(i),l=d.statsToReport,h=d.playStreamTime,p=d.subscribedTime;0===l.uint32_video_render_first&&h-p<=100&&(l.uint32_video_render_first=r-this.pathAuxiliaryMap_.get(i).sendSubscribeCMDTime)}}}},{key:"handleAudioPlaying",value:function(e){if(e.stream.isRemote()&&e.stream.getConnection()&&this.hitTest(e.stream.getConnection().getClient())){var t=e.stream.getConnection().getUserId(),n="".concat(t,"_").concat(e.stream.getType());if(this.pathMainAudioMap_.has(n)){var i=this.pathMainAudioMap_.get(n);0===i.statsToReport.uint64_play_first_frame_time&&(i.statsToReport.uint64_play_first_frame_time=Date.now())}}}},{key:"handleNetworkQuality",value:function(e){var t=this;this.hitTest(e.client)&&(this.networkQuality_.totalUplinkLoss+=e.uplinkLoss,this.networkQuality_.totalUplinkRTT+=e.uplinkRTT,this.networkQuality_.count++,e.downlinkLossAndRTTMap.forEach((function(e){var n=e.rtt,i=e.loss,r=e.userId,a=t.networkQuality_.totalDownlinkRTTAndLossMap.get(r);a?(a.totalRTT+=n,a.totalLoss+=i,a.count++):t.networkQuality_.totalDownlinkRTTAndLossMap.set(r,{totalRTT:n,totalLoss:i,count:1})})))}},{key:"handleHeartbeatStats",value:function(e){var t=this;if(this.hitTest(e.client)){var n=e.stats,i=n.msg_up_stream_info,r=n.msg_down_stream_info;if(i.msg_video_status[0]){var a=i.msg_video_status[0],o=a.uint32_video_codec_bitrate,s=a.uint32_video_enc_fps,c=a.uint32_video_width,u=a.uint32_video_height;this.localStreamStats_.totalVideoBitrate+=o,this.localStreamStats_.totalVideoFPS+=s,this.localStreamStats_.totalVideoWidth+=c,this.localStreamStats_.totalVideoHeight+=u,this.localStreamStats_.videoCount++}if(i.msg_audio_status){var d=i.msg_audio_status.audioLevel;Math.floor(100*d)>0&&(this.localStreamStats_.totalAudioLevel+=d,this.localStreamStats_.audioLevelCount++)}r.forEach((function(e){var n=e.msg_user_info,i=e.msg_audio_status,r=e.msg_video_status,a=n.str_identifier;if(r.forEach((function(e){var n=2===e.uint32_video_stream_type,i=7===e.uint32_video_stream_type,r="".concat(a,"_").concat(n?BT:HT);if(t.remoteStreamStatsMap_.has(r)){var o,s,c=t.remoteStreamStatsMap_.get(r);(n&&null!==(o=c.stream)&&void 0!==o&&o.isMainVideoSubscribed||i&&null!==(s=c.stream)&&void 0!==s&&s.isAuxVideoSubscribed)&&(c.totalVideoFPS+=e.uint32_video_receive_fps,c.totalVideoBitrate+=e.uint32_video_codec_bitrate,c.videoCount++,0===c.statsToReport.uint32_video_width&&(c.statsToReport.uint32_video_width=e.uint32_video_width),0===c.statsToReport.uint32_video_height&&(c.statsToReport.uint32_video_height=e.uint32_video_height))}})),i){var o="".concat(a,"_").concat(BT);if(t.remoteStreamStatsMap_.has(o)){var s,c=t.remoteStreamStatsMap_.get(o);null!==(s=c.stream)&&void 0!==s&&s.isMainAudioSubscribed&&(c.totalAudioBitrate+=i.uint32_audio_codec_bitrate,c.audioCount++,Math.floor(100*i.audioLevel)>0&&(c.totalAudioLevel+=i.audioLevel,c.audioLevelCount++))}}}))}}},{key:"handlePublishStart",value:function(e){var t=e.client;this.hitTest(t)&&0===this.localStreamStats_.publishStartTime&&(this.localStreamStats_.publishStartTime=Date.now())}},{key:"handleLocalStreamInitStart",value:function(e){var t=e.audio,n=e.video;t&&0===this.pathJoinRoom_.uint64_init_audio_start_time&&(this.pathJoinRoom_.uint64_init_audio_start_time=Date.now()),n&&0===this.pathJoinRoom_.uint64_init_camera_start_time&&(this.pathJoinRoom_.uint64_init_camera_start_time=Date.now())}},{key:"handleLocalStreamInitEnd",value:function(e){var t=e.audio,n=e.video;t&&0===this.pathJoinRoom_.uint64_init_audio_end_time&&(this.pathJoinRoom_.uint64_init_audio_end_time=Date.now()),n&&0===this.pathJoinRoom_.uint64_init_camera_end_time&&(this.pathJoinRoom_.uint64_init_camera_end_time=Date.now())}},{key:"handleLocalStreamInitFailed",value:function(e){var t=e.audio,n=e.video,i=e.error,r=i instanceof kD?i.getExtraCode()||i.getCode():{NotFoundError:1,NotAllowedError:2,NotReadableError:3,OverConstrainedError:4,AbortError:5}[i.name]||bD.UNKNOWN;t&&0===this.pathJoinRoom_.uint64_init_audio_end_time&&(this.pathJoinRoom_.int32_init_audio_ret=r,this.pathJoinRoom_.uint64_init_audio_end_time=Date.now()),n&&0===this.pathJoinRoom_.uint64_init_camera_end_time&&(this.pathJoinRoom_.int32_init_camera_ret=r,this.pathJoinRoom_.uint64_init_camera_end_time=Date.now())}},{key:"hasVideoFlag",value:function(e){return this.firstPublishedUserList_.findIndex((function(t){return t.userId===e&&1&t.flag}))>=0}},{key:"hasAudioFlag",value:function(e){return this.firstPublishedUserList_.findIndex((function(t){return t.userId===e&&8&t.flag}))>=0}},{key:"hasAuxFlag",value:function(e){return this.firstPublishedUserList_.findIndex((function(t){return t.userId===e&&4&t.flag}))>=0}},{key:"hitTest",value:function(e){return e===this.client_}},{key:"checkStorage",value:(s=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(t=aO.getItem(this.storageKey_))){e.next=6;break}return e.next=5,this.upload(t);case 5:aO.deleteItem(this.storageKey_);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),this.log_.warn(e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return s.apply(this,arguments)})},{key:"setStorage",value:function(){this.prepareReport();var e=this.getReportData();0!==e.msg_path_enter_room.uint64_start_time&&aO.setItem(this.storageKey_,e)}},{key:"prepareReport",value:function(){var e=this;if(this.networkQuality_.count>0&&(this.basicInfo.uint32_avg_rtt=Math.floor(this.networkQuality_.totalUplinkRTT/this.networkQuality_.count),this.basicInfo.uint32_avg_up_loss=Math.floor(this.networkQuality_.totalUplinkLoss/this.networkQuality_.count)),this.localStreamStats_.videoCount>0){this.localStreamStats_.statsToReport.uint32_video_big_capture_fps=Math.floor(this.localStreamStats_.totalVideoFPS/this.localStreamStats_.videoCount),this.localStreamStats_.statsToReport.uint32_video_big_bitrate=Math.floor(this.localStreamStats_.totalVideoBitrate/this.localStreamStats_.videoCount);var t=Math.floor(this.localStreamStats_.totalVideoWidth/this.localStreamStats_.videoCount),n=Math.floor(this.localStreamStats_.totalVideoHeight/this.localStreamStats_.videoCount);this.localStreamStats_.statsToReport.uint32_video_big_resolution=t<<16|n}this.localStreamStats_.audioLevelCount>0&&(this.localStreamStats_.statsToReport.uint32_audio_capture_db=Math.floor(this.localStreamStats_.totalAudioLevel/this.localStreamStats_.audioLevelCount*100)),this.remoteStreamStatsMap_.forEach((function(t,n){var i=t.userId;if(e.networkQuality_.totalDownlinkRTTAndLossMap.has(i)){var r=e.networkQuality_.totalDownlinkRTTAndLossMap.get(i),a=r.totalLoss,o=r.count;t.statsToReport.uint32_avg_down_loss=Math.floor(a/o)}t.videoCount>0&&(t.statsToReport.uint32_video_avg_fps=Math.floor(t.totalVideoFPS/t.videoCount),t.statsToReport.uint32_video_avg_bitrate=Math.floor(t.totalVideoBitrate/t.videoCount)),t.audioCount>0&&(t.statsToReport.uint32_audio_recv_bitrate=t.statsToReport.uint32_audio_bitrate=Math.floor(t.totalAudioBitrate/t.audioCount)),t.audioLevelCount>0&&(t.statsToReport.uint32_audio_play_db=Math.floor(t.totalAudioLevel/t.audioLevelCount*100));var s=e.client_.getCallDurationCalculator();s&&(t.statsToReport.uint32_audio_play_time=s.getDuration(n,Uk),t.statsToReport.uint32_video_play_time=s.getDuration(n,Vk)),t.statsToReport.uint32_video_render_first=Math.min(t.statsToReport.uint32_video_render_first,dq);var c=e.client_.getBadCaseDetector();if(c){var u=c.getDataFreezeDuration(n),d=u.dataFreeze,l=u.count,h=c.getRenderFreezeDuration(n).renderFreeze;t.statsToReport.uint32_video_block_count=l,t.statsToReport.uint32_video_block_time=Math.min(d,t.statsToReport.uint32_video_play_time),t.statsToReport.uint32_video_external_block_time=Math.min(h,t.statsToReport.uint32_video_play_time),c.isBlackStream(n)&&0===t.statsToReport.uint32_video_avg_fps?t.statsToReport.uint32_video_black_screen_subjective=1:t.statsToReport.uint32_video_black_screen_subjective=0}(0===t.subscribeStartTime||t.subscribeStartTime-t.streamAddedTime>100||0===t.playStreamTime)&&(e.pathMainAudioMap_.delete(n),e.pathMainVideoMap_.delete(n),t.statsToReport.uint32_video_render_first=0)})),this.pathMainAudioMap_.forEach((function(t,n){e.hasAudioFlag(t.userId)?t.statsToReport.uint64_play_first_frame_time-t.statsToReport.uint64_start_enter_time>dq&&(t.statsToReport.uint64_play_first_frame_time=t.statsToReport.uint64_start_enter_time+dq):e.pathMainAudioMap_.delete(n)})),this.pathMainVideoMap_.forEach((function(t,n){e.hasVideoFlag(t.userId)?t.statsToReport.uint64_render_first_frame_time-t.statsToReport.uint64_start_enter_time>dq&&(t.statsToReport.uint64_render_first_frame_time=t.statsToReport.uint64_start_enter_time+dq):e.pathMainVideoMap_.delete(n)})),this.pathJoinRoom_.uint64_end_time-this.pathJoinRoom_.uint64_start_time>dq&&(this.pathJoinRoom_.uint64_end_time=this.pathJoinRoom_.uint64_start_time+dq)}},{key:"getReportData",value:function(){var e=this.client_.getSignalInfo();return{uint32_sdk_app_id:Number(this.client_.getSDKAppId()),msg_user_info:new hq({userId:this.client_.getUserId(),tinyId:this.client_.getTinyId(),role:this.client_.getRole()===LT?OT:NT}),msg_basic_info:this.basicInfo,uint32_acc_ip:wA(e.relayIp),uint32_client_ip:wA(e.clientIp,"small"),uint32_acc_port:0,uint64_timestamp:Date.now(),uint32_seq:Math.floor(Math.random()*Math.pow(2,31)),msg_path_enter_room:this.pathJoinRoom_,msg_path_exit_room:this.pathLeaveRoom_,msg_path_recv_video:T(this.pathMainVideoMap_.values()).map((function(e){return e.statsToReport})),msg_quality_statistics:T(this.remoteStreamStatsMap_.values()).map((function(e){return e.statsToReport})),str_room_name:String(this.client_.getRoomId()),msg_path_recv_audio:T(this.pathMainAudioMap_.values()).map((function(e){return e.statsToReport})),uint32_info_client_ip:wA(e.clientIp,"small"),error_code:[],msg_local_statistics:this.localStreamStats_.statsToReport,msg_function_state:fq.getStateArray()}}},{key:"report",value:(r=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.getReportData(),e.next=4,this.upload(t);case 4:aO.deleteItem(this.storageKey_),fq.clearStateArray(),this.initData(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.log_.warn(e.t0);case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(){return r.apply(this,arguments)})},{key:"upload",value:(i=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(tA||0===t.msg_path_enter_room.uint64_start_time||[aE,oE,sE].findIndex((function(e){return e===location.host}))>=0)){e.next=2;break}return e.abrupt("return");case 2:return i=Number(this.client_.getSDKAppId()),r=dA(i,AT),e.next=6,UA({url:r,body:JSON.stringify(t)});case 6:if("ok"===(a=e.sent).data){e.next=9;break}throw"key point upload failed: ".concat(a.data);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]),e}(),C(iq.prototype,"upload",[nq],Object.getOwnPropertyDescriptor(iq.prototype,"upload"),iq.prototype),iq),fq=function(){function e(){o(this,e)}return c(e,null,[{key:"handleFunctionState",value:function(e){var t,n,i,r,a=e.className,o=e.fnName,s=e.params;if(!(tA||[aE,oE,sE].findIndex((function(e){return e===location.host}))>=0)){var c,u=[];if(a)switch(o){case"createClient":null!==(t=s[0])&&void 0!==t&&t.mode&&u.push("".concat(a,".").concat(o,".").concat(s[0].mode)),null!==(n=s[0])&&void 0!==n&&n.useStringRoomId?u.push("".concat(a,".").concat(o,".stringRoomId")):u.push("".concat(a,".").concat(o,".intRoomId")),null!==(i=s[0])&&void 0!==i&&i.autoSubscribe?u.push("".concat(a,".").concat(o,".autoSubscribe")):u.push("".concat(a,".").concat(o,".manualSubscribe"));break;case"publish":null!==(r=s[1])&&void 0!==r&&r.isAuxiliary?u.push("".concat(a,".").concat(o,".isAuxiliary")):u.push("".concat(a,".").concat(o));break;case"setAudioProfile":case"setVideoProfile":case"setScreenProfile":case"setVideoContentHint":_A(s[0])&&u.push("".concat(a,".").concat(o,".").concat(s[0]));break;default:u.push("".concat(a,".").concat(o))}else u.push(o);for(var d=0;d<u.length;d++){if(!(c=TE[u[d]]))return;if(this.stateMap.has(c))this.stateMap.get(c).int32_call_times+=1;else this.stateMap.set(c,{int32_id:c,int32_call_times:1})}}}},{key:"getStateArray",value:function(){return Array.from(this.stateMap.values())}},{key:"clearStateArray",value:function(){this.stateMap.clear()}}]),e}();function mq(e){return function(t,n,i){var r=i.value;return i.value=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];try{e||(e=this.name_),fq.handleFunctionState({className:e,fnName:n,params:i}),e=void 0}catch(IQ){this.log_.info(IQ)}return r.apply(this,i)},i}}u(fq,"stateMap",new Map);var vq=(oq=XJ.apply(void 0,T(KJ.STREAM.play)),sq=mq(),cq=mq(),uq=function(){function e(t){o(this,e),this.name_=rE,this.userId_=t.userId,this.isRemote_=t.isRemote,this.type_=t.type,this.log_=Vx.createLogger({id:"s".concat(t.seq?t.seq:"","|").concat(this.userId_),userId:vA(t.client)?void 0:t.client.getUserId(),sdkAppId:vA(t.client)?void 0:t.client.getSDKAppId(),isLocal:!this.isRemote_,type:this.isRemote_?this.type_:""}),this.client_=null,vA(t.client)||(this.client_=t.client),this.mediaStream_=null,this.div_=null,this.isPlaying_=!1,this.connection_=null,this.audioPlayer_=null,this.videoPlayer_=null,this.muted_=!1,this.objectFit_="cover",this.mirror_=!1,this.id_="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),this.audioOutputDeviceId_=0,this.audioVolume_=1,this.emitter_=OA(new FA,this.name_),this.connectionState_=zT,this.installEvents(),vA(t.mirror)||this.log_.warn('TRTC.createStream "mirror" option was deprecated since v4.12.1,please use localStream.play to set up preview mirror. refer to '.concat(uE,"/en/LocalStream.html#play. TRTC.createStream 接口的 mirror 选项从 v4.12.1 开始被废弃,请使用 localStream.play 设置本地流预览镜像,参考文档:").concat(uE,"/zh-cn/LocalStream.html#play。"))}var i,r,s,u,d;return c(e,[{key:"installEvents",value:function(){jA.on(xx,this.restartPlayback,this)}},{key:"uninstallEvents",value:function(){jA.off(xx,this.restartPlayback,this)}},{key:"getType",value:function(){return this.type_}},{key:"getLogger",value:function(){return this.log_}},{key:"isSubscribed",get:function(){return this.type_===BT&&this.connection_.isMainStreamSubscribed||this.type_===HT&&this.connection_.isAuxStreamSubscribed}},{key:"isMainVideoSubscribed",get:function(){var e=this.getSubscribedState();return this.type_===BT&&e&&e.video}},{key:"isMainAudioSubscribed",get:function(){var e=this.getSubscribedState();return this.type_===BT&&e&&e.audio}},{key:"isAuxVideoSubscribed",get:function(){var e=this.getSubscribedState();return this.type_===HT&&e&&e.auxiliary}},{key:"isSmallVideoSubscribed",get:function(){var e=this.getSubscribedState();return this.type_===BT&&e&&e.smallVideo}},{key:"emitConnectionStateChanged",value:function(e){e.state!==this.connectionState_&&(e.state!==zT&&this.isRemote_&&!this.isSubscribed||(this.emitter_.emit(zO,e),this.connectionState_=e.state))}},{key:"setConnection",value:function(e){this.connection_!==e&&(e instanceof jJ?(null!==this.connection_&&this.connection_.off(jO.CONNECTION_STATE_CHANGED,this.emitConnectionStateChanged,this),e.on(jO.CONNECTION_STATE_CHANGED,this.emitConnectionStateChanged,this)):null===e&&this.connection_.off(jO.CONNECTION_STATE_CHANGED,this.emitConnectionStateChanged,this),this.connection_=e)}},{key:"getConnection",value:function(){return this.connection_}},{key:"play",value:(d=a(n().mark((function e(t,i){var r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.log_.info("stream ".concat(this.isPlaying_?"update":"start to"," play with elementId: ").concat(t," and options: ").concat(JSON.stringify(i),".")),!this.isPlaying_){e.next=9;break}return i&&!vA(i.muted)&&(this.muted_=i.muted),i&&!vA(i.objectFit)&&(this.objectFit_=i.objectFit),this.isScreenShare()?this.mirror_=!1:i&&!vA(i.mirror)&&(this.mirror_=i.mirror),this.audioPlayer_&&this.audioPlayer_.setMuted(this.muted_),this.videoPlayer_&&(this.videoPlayer_.setObjectFit(this.objectFit_),this.videoPlayer_.setMirror(this.mirror_)),this.elementId_!==t&&(r=t,_A(t)&&(r=document.getElementById(t)),r.appendChild(this.div_),this.elementId_=t),e.abrupt("return");case 9:return this.isPlaying_=!0,(a=document.createElement("div")).setAttribute("id","player_".concat(this.id_)),a.setAttribute("style","width: 100%; height: 100%; position: relative; background-color: black; overflow: hidden;"),o=t,_A(t)&&(o=document.getElementById(t)),o.appendChild(a),this.elementId_=t,this.div_=a,this.isRemote_||(this.muted_=!0),i&&!vA(i.muted)&&(this.muted_=i.muted),this.isScreenShare()&&(this.objectFit_="contain"),i&&!vA(i.objectFit)&&(this.objectFit_=i.objectFit),this.isScreenShare()?this.mirror_=!1:(this.isRemote_||(this.mirror_=!0),i&&!vA(i.mirror)&&(this.mirror_=i.mirror)),jA.emit(bx,{stream:this}),e.next=26,Promise.all([this.playAudio(),this.playVideo()]);case 26:jA.emit(rx,{stream:this});case 27:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"playAudio",value:(u=a(n().mark((function e(){var i,r,a,o,s,c=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasAudio()&&(!this.isRemote_||this.isMainAudioSubscribed)){e.next=2;break}return e.abrupt("return");case 2:if(this.isRemote_&&this.client_.isSpatialEnabled&&(null===(i=this.client_)||void 0===i||null===(r=i.getSpatialManager())||void 0===r||r.play(this.userId_)),a=this.getAudioTrack(),this.audioPlayer_||!a){e.next=18;break}return this.log_.info("create AudioPlayer and play"),this.audioPlayer_=new LU({stream:this,track:a,gainedTrack:null===(o=this.gain_)||void 0===o?void 0:o.audioTrack,div:this.div_,muted:this.muted_||(null===(s=this.client_)||void 0===s?void 0:s.isSpatialEnabled),outputDeviceId:this.audioOutputDeviceId_,volume:this.audioVolume_}),this.audioPlayer_.on(qO,(function(e){var n={type:Uk,state:e.state,reason:e.reason};jA.emit(ax,t({stream:c},n)),c.emitter_.emit(HO,n)})),e.prev=8,e.next=11,this.audioPlayer_.play();case 11:e.next=18;break;case 13:throw e.prev=13,e.t0=e.catch(8),this.client_&&this.client_.getEnableAutoPlayDialog()&&new sV,this.emitter_.emit(JO,e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[8,13]])}))),function(){return u.apply(this,arguments)})},{key:"playVideo",value:(s=a(n().mark((function e(){var i,r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasVideo()&&(!this.isRemote_||this.isMainVideoSubscribed||this.isAuxVideoSubscribed||this.isSmallVideoSubscribed)){e.next=2;break}return e.abrupt("return");case 2:if(i=this.getVideoTrack(),this.videoPlayer_||!i){e.next=18;break}return jA.emit(Tx,{stream:this}),this.log_.info("create VideoPlayer and play"),this.videoPlayer_=new cV({stream:this,track:i,div:this.div_,muted:this.muted_,objectFit:this.objectFit_,mirror:this.mirror_}),this.videoPlayer_.on(qO,(function(e){var n={type:Vk,state:e.state,reason:e.reason};jA.emit(ax,t({stream:r},n)),r.emitter_.emit(HO,n)})),e.prev=8,e.next=11,this.videoPlayer_.play();case 11:e.next=18;break;case 13:throw e.prev=13,e.t0=e.catch(8),this.client_&&this.client_.getEnableAutoPlayDialog()&&new sV,this.emitter_.emit(JO,e.t0),e.t0;case 18:case"end":return e.stop()}}),e,this,[[8,13]])}))),function(){return s.apply(this,arguments)})},{key:"stopAudio",value:function(){var e,t;this.audioPlayer_&&(this.log_.info("stop AudioPlayer"),this.audioPlayer_.stop(),this.audioPlayer_=null,this.isRemote_&&this.client_.isSpatialEnabled&&(null===(e=this.client_)||void 0===e||null===(t=e.getSpatialManager())||void 0===t||t.stop(this.userId_)))}},{key:"stopVideo",value:function(){this.videoPlayer_&&(this.log_.info("stop VideoPlayer"),this.videoPlayer_.stop(),this.videoPlayer_=null)}},{key:"restartPlayback",value:function(){this.audioPlayer_&&!this.audioPlayer_.isPlaying&&this.restartAudio(),this.videoPlayer_&&!this.videoPlayer_.isPlaying&&this.restartVideo()}},{key:"restartAudio",value:function(){this.isPlaying_&&(this.stopAudio(),this.playAudio().catch((function(e){})))}},{key:"restartVideo",value:function(){this.isPlaying_&&(this.stopVideo(),this.playVideo().catch((function(e){})))}},{key:"stop",value:function(){var e,t;this.isPlaying_&&(this.isPlaying_=!1,this.stopAudio(),this.stopVideo(),this.div_.parentNode.removeChild(this.div_),this.isRemote_&&this.client_.isSpatialEnabled&&(null===(e=this.client_)||void 0===e||null===(t=e.getSpatialManager())||void 0===t||t.stop(this.userId_)))}},{key:"resume",value:(r=a(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isPlaying_){e.next=2;break}return e.abrupt("return");case 2:if(this.log_.info("resume"),!this.audioPlayer_){e.next=7;break}return e.next=6,this.audioPlayer_.resume();case 6:this.isRemote_&&this.client_.isSpatialEnabled&&(null===(t=this.client_)||void 0===t||null===(i=t.getSpatialManager())||void 0===i||i.resume());case 7:if(!this.videoPlayer_){e.next=10;break}return e.next=10,this.videoPlayer_.resume();case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){this.log_.info("close stream"),this.isPlaying_&&this.stop(),this.isRemote_||(this.mediaStream_&&(this.mediaStream_.preventEvent=1,this.mediaStream_.getTracks().forEach((function(e){e.stop()})),this.mediaStream_=null),this.uninstallEvents())}},{key:"muteAudio",value:function(){return this.addRemoteEvent(!0,Uk),this.doEnableTrack(Uk,!1)}},{key:"muteVideo",value:function(){return this.addRemoteEvent(!0,Vk),this.doEnableTrack(Vk,!1)}},{key:"unmuteAudio",value:function(){return this.addRemoteEvent(!1,Uk),this.doEnableTrack(Uk,!0)}},{key:"unmuteVideo",value:function(){return this.addRemoteEvent(!1,Vk),this.doEnableTrack(Vk,!0)}},{key:"addRemoteEvent",value:function(e,t){if(this.isRemote_&&this.client_){var n=this.client_.getUserId(),i="".concat(e?qk:Kk," remote ").concat(t);oM(n,{eventId:t===Uk?e?FD:BD:e?VD:jD,eventDesc:i,timestamp:(new Date).getTime(),userId:n,tinyId:this.client_.getTinyId(),remoteUserId:this.userId_,remoteTinyId:this.connection_.getTinyId()})}}},{key:"doEnableTrack",value:function(e,t){var n,i,r=!1;e===Uk?(this.mediaStream_.getAudioTracks().forEach((function(e){r=!0,e.enabled=t})),this.isRemote_&&this.client_.isSpatialEnabled&&(t?null===(n=this.client_.getSpatialManager())||void 0===n||n.play(this.userId_):null===(i=this.client_.getSpatialManager())||void 0===i||i.stop(this.userId_))):this.mediaStream_.getVideoTracks().forEach((function(e){r=!0,e.enabled=t}));return r}},{key:"getId",value:function(){return this.id_}},{key:"getUserId",value:function(){return this.userId_}},{key:"getTinyId",value:function(){return this.connection_?this.connection_.getTinyId():""}},{key:"isPlaying",value:function(){return this.isPlaying_}},{key:"setAudioOutput",value:(i=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.audioOutputDeviceId_=t,!this.audioPlayer_){e.next=4;break}return e.next=4,this.audioPlayer_.setSinkId(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"setAudioVolume",value:function(e){var t,n;(this.audioVolume_=e,this.log_.info("setAudioVolume to ".concat(e)),this.audioPlayer_)&&(this.audioPlayer_.setVolume(e),this.isRemote_&&this.client_.isSpatialEnabled&&(null===(t=this.client_)||void 0===t||null===(n=t.getSpatialManager())||void 0===n||n.setAudioVolume(this.userId_,e)))}},{key:"getAudioLevel",value:function(){var e=0;return this.audioPlayer_&&(e=this.audioPlayer_.getAudioLevel()),e}},{key:"getInternalAudioLevel",value:function(){var e=0;return this.audioPlayer_&&(e=this.audioPlayer_.getInternalAudioLevel()),e}},{key:"hasAudio",value:function(){if(this.isRemote_){if(!this.connection_)return!1;var e=this.connection_.getTrackState();return this.type_===BT&&e.audio}return!!this.getAudioTrack()}},{key:"hasVideo",value:function(){if(this.isRemote_){if(!this.connection_)return!1;var e=this.connection_.getTrackState();return this.type_===HT?e.auxiliary:e.video}return!!this.getVideoTrack()}},{key:"getSubscribedState",value:function(){return this.isRemote_&&this.connection_?this.connection_.getSubscribeState():null}},{key:"getAudioTrack",value:function(){var e=null;if(this.mediaStream_){var t=this.mediaStream_.getAudioTracks();t.length>0&&(e=t[0])}return e}},{key:"getVideoTrack",value:function(){var e=null;if(this.mediaStream_){var t=this.mediaStream_.getVideoTracks();t.length>0&&(e=t[0])}return e}},{key:"getVideoFrame",value:function(){return this.videoPlayer_?this.videoPlayer_.getVideoFrame():null}},{key:"getMediaStream",value:function(){return this.mediaStream_}},{key:"setMediaStream",value:function(e){e!==this.mediaStream_&&(this.mediaStream_&&this.mediaStream_.getTracks().forEach((function(e){return e.stop()})),this.mediaStream_=e)}},{key:"updateVideoPlayingState",value:function(e){this.isPlaying_&&(e?(this.log_.info("playing state updated, play video"),this.playVideo().catch((function(e){}))):(this.log_.info("playing state updated, stop video"),this.stopVideo()))}},{key:"updateAudioPlayingState",value:function(e){this.isPlaying_&&(e?(this.log_.info("playing state updated, play audio"),this.playAudio().catch((function(e){}))):(this.log_.info("playing state updated, stop audio"),this.stopAudio()))}},{key:"on",value:function(e,t,n){this.emitter_.on(e,t,n)}},{key:"off",value:function(e,t,n){"*"===e?this.emitter_.removeAllListeners():this.emitter_.off(e,t,n)}},{key:"isRemote",value:function(){return this.isRemote_}},{key:"isScreenShare",value:function(){return!this.isRemote_&&this.screen_||this.isRemote_&&this.getType()===Hk}},{key:"getDiv",value:function(){return this.div_}},{key:"getObjectFit",value:function(){return this.objectFit_}},{key:"getMuted",value:function(){return this.muted_}},{key:"getClient",value:function(){return this.client_}}]),e}(),C(uq.prototype,"play",[oq],Object.getOwnPropertyDescriptor(uq.prototype,"play"),uq.prototype),C(uq.prototype,"setAudioOutput",[sq],Object.getOwnPropertyDescriptor(uq.prototype,"setAudioOutput"),uq.prototype),C(uq.prototype,"getVideoFrame",[cq],Object.getOwnPropertyDescriptor(uq.prototype,"getVideoFrame"),uq.prototype),uq),_q=function(e){d(RemoteStream,e);var n=g(RemoteStream);function RemoteStream(e){var i;o(this,RemoteStream);var r={isRemote:!0,type:e.type},a=t(t({},e),r);return(i=n.call(this,a)).name_=iE,i.isStreamAddedEventEmitted_=!1,i.isAbleToCallSubscription_=!0,i}return c(RemoteStream,[{key:"installEvents",value:function(){S(l(RemoteStream.prototype),"installEvents",this).call(this),jA.on(lx,this.handleStreamSubscribed,this),jA.on(hx,this.handleStreamUnsubscribed,this)}},{key:"uninstallEvents",value:function(){S(l(RemoteStream.prototype),"uninstallEvents",this).call(this),jA.off(lx,this.handleStreamSubscribed,this),jA.off(hx,this.handleStreamUnsubscribed,this)}},{key:"handleStreamSubscribed",value:function(e){e.client===this.client_&&e.stream===this&&this.connection_.getCurrentState()===qT&&this.emitConnectionStateChanged({prevState:zT,state:qT})}},{key:"handleStreamUnsubscribed",value:function(e){e.client===this.client_&&e.stream===this&&this.emitConnectionStateChanged({prevState:qT,state:zT})}},{key:"getType",value:function(){return S(l(RemoteStream.prototype),"getType",this).call(this)}},{key:"getIsAbleToCallSubscription",value:function(){return this.isAbleToCallSubscription_}},{key:"setIsAbleToCallSubscription",value:function(e){this.isAbleToCallSubscription_=e}},{key:"setIsStreamAddedEventEmitted",value:function(e){this.isStreamAddedEventEmitted_=e}},{key:"getIsStreamAddedEventEmitted",value:function(){return this.isStreamAddedEventEmitted_}},{key:"getAudioTrack",value:function(){return this.connection_&&this.connection_.getTrackState().audio?S(l(RemoteStream.prototype),"getAudioTrack",this).call(this):null}},{key:"getVideoTrack",value:function(){if(!this.connection_)return null;var e=this.connection_.getTrackState();return(this.type_!==BT||e.video)&&(this.type_!==HT||e.auxiliary)?S(l(RemoteStream.prototype),"getVideoTrack",this).call(this):null}},{key:"close",value:function(){S(l(RemoteStream.prototype),"close",this).call(this)}}]),RemoteStream}(vq),gq=function(){function e(t){o(this,e),this.client_=t.client,this.subscribedStreams_=new Map,this.unsubscribedStreams_=new Map,this.subscriptedOptions_=new Map,this.autoRecoveryFlags_=new Map}var t,i,r;return c(e,[{key:"isEnabled",get:function(){return"webrtc"!==this.client_.getEnv()}},{key:"recover",value:(r=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.getUserId(),r=t.getType(),this.hasAutoRecoveryFlag(i,r)){e.next=5;break}return e.abrupt("return");case 5:if(a=this.getUnsubscribedStream(i,r)?"unsubscribe":"subscribe",e.prev=6,Vx.warn("recover() try to recover subscription [".concat(a,"][").concat(i,"][").concat(r,"]")),"subscribe"!==a){e.next=13;break}return e.next=11,this.recoverSubscription(i,t);case 11:e.next=15;break;case 13:return e.next=15,this.recoverUnsubscription(i,t);case 15:lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:TI}),Vx.warn("recover() recover successfully [".concat(a,"][").concat(i,"][").concat(r,"]")),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(6),Vx.error("recover() recover failed [".concat(a,"][").concat(i,"][").concat(r,"]"),e.t0),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:TI,error:e.t0});case 23:this.deleteAutoRecoveryFlag(i,r);case 24:case"end":return e.stop()}}),e,this,[[6,19]])}))),function(e){return r.apply(this,arguments)})},{key:"recoverSubscription",value:(i=a(n().mark((function e(t,i){var r,a,o,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.getOptions(t,i.getType()),a=this.getSubscribedStream(t,i.getType()),r&&a){e.next=4;break}return e.abrupt("return");case 4:o=this.getStreamMuteState(a),s=o.isAudioMuted,c=o.isVideoMuted,this.mergeStream(a,i),this.recoverPlayingState(a),s&&a.doEnableTrack(Uk,!1),c&&a.doEnableTrack(Vk,!1);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"recoverUnsubscription",value:(t=a(n().mark((function e(t,i){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.getUnsubscribedStream(t,i.getType())){e.next=3;break}return e.abrupt("return");case 3:this.mergeStream(r,i);case 4:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"getStreamMuteState",value:function(e){var t={isAudioMuted:!1,isVideoMuted:!1},n=e.getMediaStream();return n&&(t.isAudioMuted=n.getAudioTracks().map((function(e){return e.enabled})).includes(!1),t.isVideoMuted=n.getVideoTracks().map((function(e){return e.enabled})).includes(!1)),t}},{key:"recoverPlayingState",value:function(e){var t=e.isPlaying(),n=e.getDiv();if(t&&n){var i=n.parentNode;e.stop(),e.play(i,{objectFit:e.getObjectFit(),muted:e.getMuted()})}}},{key:"mergeStream",value:function(e,t){var n=t.getConnection(),i=t.getMediaStream();e.setConnection(n),n.setRemoteStream(i.id,e),e.setMediaStream(i),e.updateAudioPlayingState(t.hasAudio()),e.updateVideoPlayingState(t.hasVideo())}},{key:"addSubscriptionRecord",value:function(e,t,n){var i=t.getType();if(this.subscribedStreams_.has(e))this.subscribedStreams_.get(e).set(i,t);else{var r=new Map;r.set(t.getType(),t),this.subscribedStreams_.set(e,r)}if(this.subscriptedOptions_.has(e))this.subscriptedOptions_.get(e).set(i,n);else{var a=new Map;a.set(t.getType(),n),this.subscriptedOptions_.set(e,a)}this.deleteUnsubscriptionRecord(e,i)}},{key:"addUnsubscriptionRecord",value:function(e,t){if(this.unsubscribedStreams_.has(e))this.unsubscribedStreams_.get(e).set(t.getType(),t);else{var n=new Map;n.set(t.getType(),t),this.unsubscribedStreams_.set(e,n)}this.deleteSubscriptionRecord(e,t.getType())}},{key:"getSubscribedStream",value:function(e,t){return this.subscribedStreams_.has(e)&&this.subscribedStreams_.get(e).has(t)?this.subscribedStreams_.get(e).get(t):null}},{key:"getOptions",value:function(e,t){return this.subscriptedOptions_.has(e)&&this.subscriptedOptions_.get(e).has(t)?this.subscriptedOptions_.get(e).get(t):null}},{key:"getUnsubscribedStream",value:function(e,t){return this.unsubscribedStreams_.has(e)&&this.unsubscribedStreams_.get(e).has(t)?this.unsubscribedStreams_.get(e).get(t):null}},{key:"deleteSubscriptionRecord",value:function(e,t){this.subscribedStreams_.has(e)&&this.subscribedStreams_.get(e).delete(t),this.subscriptedOptions_.has(e)&&this.subscriptedOptions_.get(e).delete(t)}},{key:"deleteUnsubscriptionRecord",value:function(e,t){this.unsubscribedStreams_.has(e)&&this.unsubscribedStreams_.get(e).delete(t)}},{key:"markAllStream",value:function(){for(var e=0,t=T(this.subscribedStreams_.entries());e<t.length;e++)for(var n=k(t[e],2),i=n[0],r=0,a=T(n[1].entries());r<a.length;r++){var o=k(a[r],1)[0];this.setAutoRecoveryFlag(i,o)}for(var s=0,c=T(this.unsubscribedStreams_.entries());s<c.length;s++)for(var u=k(c[s],2),d=u[0],l=0,h=T(u[1].entries());l<h.length;l++){var p=k(h[l],1)[0];this.setAutoRecoveryFlag(d,p)}}},{key:"setAutoRecoveryFlag",value:function(e,t){if(Vx.info("setAutoRecoveryFlag() mark [".concat(e,"][").concat(t,"]")),this.autoRecoveryFlags_.has(e))this.autoRecoveryFlags_.get(e).set(t);else{var n=new Map;n.set(t),this.autoRecoveryFlags_.set(e,n)}}},{key:"hasAutoRecoveryFlag",value:function(e,t){return!!this.isEnabled&&(this.autoRecoveryFlags_.has(e)&&this.autoRecoveryFlags_.get(e).has(t))}},{key:"deleteAutoRecoveryFlag",value:function(e,t){this.autoRecoveryFlags_.has(e)&&this.autoRecoveryFlags_.get(e).delete(t)}},{key:"delete",value:function(e){this.unsubscribedStreams_.delete(e),this.subscribedStreams_.delete(e),this.subscriptedOptions_.delete(e),this.autoRecoveryFlags_.delete(e)}}]),e}(),yq=function(){function e(t){o(this,e),this.player_=t,this.canvas_=document.createElement(Lk),this.canvasCtx_=this.canvas_.getContext("2d")}return c(e,[{key:"setCanvasRect",value:function(e,t){this.canvas_.width=e,this.canvas_.height=t}},{key:"drawVideoToCanvas",value:function(){var e=this.player_.getElement(),t=e.videoHeight,n=e.videoWidth,i=n*this.canvas_.height/(t*this.canvas_.width);if(i>1.05||i<.95){var r=n*t/(this.canvas_.width*this.canvas_.height);this.setCanvasRect(n/Math.sqrt(r),t/Math.sqrt(r))}this.canvasCtx_.drawImage(e,0,0,this.canvas_.width,this.canvas_.height)}},{key:"generateVideoTrackFromCanvasCapture",value:function(e){return this.canvas_.captureStream(e).getVideoTracks()[0]}},{key:"generateStreamFromTrack",value:function(e){var t=new MediaStream;return t.addTrack(e),t}},{key:"destroy",value:function(){this.player_.stop(),this.canvas_.width=0,this.canvas_.height=0,this.canvas_=null,this.canvasCtx_=null}},{key:"canvas",get:function(){return this.canvas_}},{key:"canvasCtx",get:function(){return this.canvasCtx_}},{key:"canDrawVideoToCanvas",get:function(){if(this.player_){var e=this.player_.getElement();if(e)return e.readyState===e.HAVE_ENOUGH_DATA}return!1}}]),e}(),Sq=new Blob(['let t,e,a,i;onmessage=function(n){const{action:h,data:s}=n.data;switch(h){case"render":a=s.canvas,t=a.width,e=a.height,i=a.getContext("2d"),function(t,e){const n=new TransformStream({async transform(t,e){const n=t.displayWidth,h=t.displayHeight,s=n*a.height/(h*a.width);if(s>1.05||s<.95){const t=n*h/(a.width*a.height);a.width=n/Math.sqrt(t),a.height=h/Math.sqrt(t)}i.drawImage(t,0,0,a.width,a.height);const o=new VideoFrame(a,{timestamp:t.timestamp});t.close(),e.enqueue(o)}});t.pipeThrough(n).pipeTo(e)}(s.readable,s.writable)}}'],{type:"application/javascript"}),bq=function(){function e(t){o(this,e);var n=t.videoTrack;this.width=void 0,this.height=void 0,this.canvas=document.createElement("canvas"),this.offscreen=null,this.smallGenerator=new MediaStreamTrackGenerator({kind:"video"}),this.smallWritable=this.smallGenerator.writable,this.bigProcessor=new MediaStreamTrackProcessor({track:n}),this.bigReadable=this.bigProcessor.readable,this.initWorker()}return c(e,[{key:"initWorker",value:function(){try{this.worker=new Worker(URL.createObjectURL(Sq)),Vx.info("init worker processor success")}catch(e){Vx.warn("init worker processor failed. ".concat(e.error))}}},{key:"setCanvasRect",value:function(e,t){this.width=e,this.height=t,this.canvas.width=e,this.canvas.height=t,this.offscreen=this.canvas.transferControlToOffscreen(),this.worker.postMessage({action:"render",data:{canvas:this.offscreen,readable:this.bigReadable,writable:this.smallWritable}},[this.offscreen,this.bigReadable,this.smallWritable])}},{key:"generatorVideoTrack",value:function(){var e=new MediaStream([this.smallGenerator]);return null==e?void 0:e.getTracks()[0]}},{key:"destroy",value:function(){this.worker.terminate()}}]),e}(),kq=function(){function e(t){o(this,e),this.localStream_=t,this.player_=null,this.processor_=null,this.initOffscreenSuccess_=!1}var t;return c(e,[{key:"initialize",value:(t=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(FO()&&(null===(t=navigator)||void 0===t?void 0:t.hardwareConcurrency)>=6)){e.next=13;break}return e.prev=1,e.next=4,this.initOffscreen();case 4:this.initOffscreenSuccess_=!0,Vx.info("Initialize VideoGenerator successfully!"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),this.initCanvas();case 11:e.next=14;break;case 13:this.initCanvas();case 14:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return t.apply(this,arguments)})},{key:"generateSmallVideoTrack",value:function(e){var t,n=e.height,i=e.width,r=e.frameRate,a=this.getSmallVideoProfile(i,n);return this.initOffscreenSuccess_?(this.processor_.setCanvasRect(a.width,a.height),t=this.processor_.generatorVideoTrack()):(this.processor_.setCanvasRect(a.width,a.height),this.player_.setRect({width:a.width,height:a.height}),t=this.processor_.generateVideoTrackFromCanvasCapture(r),this.interval_=iO.run(yE,this.render.bind(this),{fps:r})),t}},{key:"render",value:function(){this.processor_.canDrawVideoToCanvas&&this.processor_.drawVideoToCanvas()}},{key:"destroy",value:function(){iO.clearTask(this.interval_),this.processor_&&this.processor_.destroy()}},{key:"initOffscreen",value:function(){this.processor_=new bq({videoTrack:this.localStream_.getVideoTrack()})}},{key:"initCanvas",value:function(){this.player_=new cV({stream:this.localStream_,track:this.localStream_.getVideoTrack(),muted:!0,objectFit:"cover",mirror:!1}),this.player_.play().then((function(){Vx.info("VideoGenerator: play local video success")})).catch((function(){Vx.error("VideoGenerator: Failed to play local video")})),this.processor_=new yq(this.player_)}},{key:"getSmallVideoProfile",value:function(e,t){var n,i=this.localStream_.getVideoTrack(),r=this.localStream_.getVideoProfile();if(UO){var a=i.getSettings();a&&a.width&&a.height&&(r.width=a.width,r.height=a.height)}var o=r.width*r.height,s=e*t;return Vx.info("big stream resolution: ".concat(r.width,"*").concat(r.height," small stream resolution: ").concat(e,"*").concat(t," ")),n=o>s?o/s:o/19200,{width:parseInt(r.width/Math.sqrt(n)),height:parseInt(r.height/Math.sqrt(n))}}}]),e}(),Tq=new Map;var Iq=function(){var e=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!wO()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,wq(t);case 4:if(i=e.sent,Vx.info("getUserMedia with constraints: "+JSON.stringify(i)),!i.audio){e.next=11;break}return e.next=9,TQ.getMicrophones();case 9:r=e.sent,Vx.info("microphones: ".concat(JSON.stringify(r)));case 11:if(!i.video){e.next=16;break}return e.next=14,TQ.getCameras();case 14:a=e.sent,Vx.info("cameras: ".concat(JSON.stringify(a)));case 16:return e.prev=16,e.next=19,navigator.mediaDevices.getUserMedia(i);case 19:return e.abrupt("return",e.sent);case 22:if(e.prev=22,e.t0=e.catch(16),"NotFoundError"!==e.t0.name){e.next=29;break}if(!a||0!==a.length){e.next=27;break}throw new kD({code:bD.DEVICE_NOT_FOUND,message:sA({key:SR})});case 27:if(!r||0!==r.length){e.next=29;break}throw new kD({code:bD.DEVICE_NOT_FOUND,message:sA({key:yR})});case 29:throw new kD({code:bD.INITIALIZE_FAILED,name:e.t0.name,message:e.t0.message,constraint:e.t0.constraint});case 30:case"end":return e.stop()}}),e,null,[[16,22]])})));return function(t){return e.apply(this,arguments)}}(),Eq=Mx({retryFunction:Iq,settings:{retries:3,timeout:500},onError:function(e,t,n,i){Vx.warn("getUserMedia error: ".concat(e)),"NotReadableError"===e.name?t():e.message.includes("deviceId")&&i[0].retryWhenExactFailed?(i[0].useExact=!1,t()):n(e)},onRetrying:function(e){Vx.warn("getUserMedia retrying [".concat(e,"/3]"))}});function wq(e){return Rq.apply(this,arguments)}function Rq(){return(Rq=a(n().mark((function e(i){var r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={echoCancellation:i.echoCancellation,autoGainControl:i.autoGainControl,noiseSuppression:i.noiseSuppression},i.audio){e.next=5;break}r=!1,e.next=15;break;case 5:if(uM(i.microphoneId)){e.next=9;break}r=t({deviceId:i.useExact?{exact:i.microphoneId}:i.microphoneId,sampleRate:i.sampleRate,channelCount:i.channelCount},r),e.next=15;break;case 9:return r=t({sampleRate:i.sampleRate,channelCount:i.channelCount},r),e.next=12,TQ.getMicrophones();case 12:a=e.sent,(o=a.filter((function(e){return e.deviceId.length>0}))).length>0&&(r.deviceId={exact:o[0].deviceId});case 15:return s={},c={ideal:i.width,max:i.width},u={ideal:i.height,max:i.height},tC&&RC&&i.width*i.height<101376&&(c=i.width,u=i.height),s=!vA(i.facingMode)&&i.video?{facingMode:i.facingMode,width:c,height:u,frameRate:i.frameRate}:!uM(i.cameraId)&&i.video?{deviceId:i.useExact?{exact:i.cameraId}:i.cameraId,width:c,height:u,frameRate:i.frameRate}:!!i.video&&(!!vA(i.width)||{width:c,height:u,frameRate:i.frameRate}),e.abrupt("return",{audio:r,video:s});case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Cq=function(){var e=a(n().mark((function e(t){var i,r,a,o,s,c,u,d,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!wO()){e.next=2;break}return e.abrupt("return");case 2:if(i=null,!(WC&&JC<74||KC)){e.next=27;break}return r=xq(t),Vx.info("getDisplayMedia with constraints: "+JSON.stringify(r)),e.next=8,navigator.mediaDevices.getDisplayMedia(r);case 8:if(a=e.sent,!t.screenAudio){e.next=14;break}return Vx.warn("Your browser not support capture system audio"),e.abrupt("return",a);case 14:if(!t.audio){e.next=24;break}return o=Aq(t),Vx.info("getUserMedia with constraints: "+JSON.stringify(o)),e.next=19,navigator.mediaDevices.getUserMedia(o);case 19:return i=e.sent,a.addTrack(i.getAudioTracks()[0]),e.abrupt("return",a);case 24:return e.abrupt("return",a);case 25:e.next=53;break;case 27:if(!t.screenAudio){e.next=37;break}return t.audioConstraints={echoCancellation:t.echoCancellation,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,sampleRate:44100},s=xq(t),Vx.info("getDisplayMedia with constraints: "+JSON.stringify(s)),e.next=33,navigator.mediaDevices.getDisplayMedia(s);case 33:return c=e.sent,e.abrupt("return",c);case 37:return u=xq(t),Vx.info("getDisplayMedia with constraints: "+JSON.stringify(u)),e.next=41,navigator.mediaDevices.getDisplayMedia(u);case 41:if(d=e.sent,!t.audio){e.next=52;break}return l=Aq(t),Vx.info("getUserMedia with constraints: "+JSON.stringify(l)),e.next=47,navigator.mediaDevices.getUserMedia(l);case 47:return i=e.sent,d.addTrack(i.getAudioTracks()[0]),e.abrupt("return",d);case 52:return e.abrupt("return",d);case 53:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Aq(e){var t={echoCancellation:e.echoCancellation,autoGainControl:e.autoGainControl,noiseSuppression:e.noiseSuppression,sampleRate:e.sampleRate,channelCount:e.channelCount};return vA(e.microphoneId)||(t.deviceId=e.microphoneId),{audio:t,video:!1}}function xq(e){var t={systemAudio:"include",selfBrowserSurface:"include",surfaceSwitching:"include"},n={width:KC?{max:e.width}:{ideal:e.width,max:e.width},height:KC?{max:e.height}:{ideal:e.height,max:e.height},frameRate:e.frameRate,displaySurface:"monitor"};return t.video=n,vA(e.audioConstraints)||(t.audio=e.audioConstraints),t}var Pq,Dq,Mq,Oq,Nq,Lq,Uq,Vq,Fq,jq,Bq,Hq,Gq,zq,Wq,Jq,qq,Kq,Qq,Xq=new Map([["120p",{width:160,height:120,frameRate:15,bitrate:200}],["120p_2",{width:160,height:120,frameRate:15,bitrate:100}],["180p",{width:320,height:180,frameRate:15,bitrate:350}],["180p_2",{width:320,height:180,frameRate:15,bitrate:150}],["240p",{width:320,height:240,frameRate:15,bitrate:400}],["240p_2",{width:320,height:240,frameRate:15,bitrate:200}],["360p",{width:640,height:360,frameRate:15,bitrate:800}],["360p_2",{width:640,height:360,frameRate:15,bitrate:400}],["480p",{width:640,height:480,frameRate:15,bitrate:900}],["480p_2",{width:640,height:480,frameRate:15,bitrate:500}],["720p",{width:1280,height:720,frameRate:15,bitrate:1500}],["1080p",{width:1920,height:1080,frameRate:15,bitrate:2e3}],["1440p",{width:2560,height:1440,frameRate:30,bitrate:4860}],["4K",{width:3840,height:2160,frameRate:30,bitrate:9e3}]]),$q=new Map([["480p",{width:640,height:480,frameRate:5,bitrate:900}],["480p_2",{width:640,height:480,frameRate:30,bitrate:1e3}],["720p",{width:1280,height:720,frameRate:5,bitrate:1200}],["720p_2",{width:1280,height:720,frameRate:30,bitrate:3e3}],["1080p",{width:1920,height:1080,frameRate:5,bitrate:1600}],["1080p_2",{width:1920,height:1080,frameRate:30,bitrate:4e3}]]),Yq=new Map([["standard",{sampleRate:48e3,channelCount:1,bitrate:40}],["standard-stereo",{sampleRate:48e3,channelCount:2,bitrate:64}],["high",{sampleRate:48e3,channelCount:1,bitrate:128}],["high-stereo",{sampleRate:48e3,channelCount:2,bitrate:192}]]),Zq=new Map,eK=(Pq=mq(nE),Dq=mq(nE),Mq=mq(nE),Oq=mq(nE),Nq=XJ.apply(void 0,T(KJ.LOCAL_STREAM.switchDevice)),Lq=XJ(KJ.STREAM.addTrack),Uq=XJ(KJ.STREAM.removeTrack),Vq=XJ(KJ.STREAM.replaceTrack),Fq=aq({retries:10,timeout:3e3,onRetryFailed:function(e){lM.logFailedEvent({userId:this.client_?this.client_.getUserId():this.userId_,eventType:kI,error:e}),this.emitter_.emit(JO,new kD({code:bD.DEVICE_AUTO_RECOVER_FAILED,message:e.message}))}}),jq=QJ(KJ.LOCAL_STREAM.setAudioCaptureVolume),Bq=mq(nE),Hq=function(e){d(LocalStream,e);var r,s,u,h,p,f,m,v,_,y,b,k,T=g(LocalStream);function LocalStream(e){var n;o(this,LocalStream);var i=t(t({},e),{isRemote:!1,type:"local"});return(n=T.call(this,i)).name_=nE,n.client_=null,n.video_=e.video,n.audio_=e.audio,n.cameraId_=e.cameraId,n.cameraGroupId_="",n.facingMode_=e.facingMode,n.microphoneId_=e.microphoneId,n.microphoneGroupId_="",n.microphoneLabel_="",n.videoSource_=e.videoSource,n.audioSource_=e.audioSource,n.screen_=e.screen,n.screenAudio_=e.screenAudio,n.audioProfile_={echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,sampleRate:48e3,channelCount:1,bitrate:40},n.screenAudio_&&(n.audioProfile_.echoCancellation=!0,n.audioProfile_.autoGainControl=!1,n.audioProfile_.noiseSuppression=!1),yA(e.echoCancellation)&&(n.audioProfile_.echoCancellation=e.echoCancellation),yA(e.autoGainControl)&&(n.audioProfile_.autoGainControl=e.autoGainControl),yA(e.noiseSuppression)&&(n.audioProfile_.noiseSuppression=e.noiseSuppression),n.videoProfile_=Xq.get("480p_2"),n.screenProfile_=$q.get("1080p"),n.videoSetting_=null,n.muteState_={video:!1,audio:!1,auxVideo:!1},n.beautyStatus_=!1,n.prevAudioRecoverTime_=0,n.prevVideoRecoverTime_=0,n.isAudioRecovering_=!1,n.isVideoRecovering_=!1,n.initState(),n.canvas_=null,n.canvasInterval_=null,n.canvasTrack_=null,n.gain_={audioTrack:null,source:null,gainNode:null},n.captureVolume_=100,n.enableAutoRecoverCapture_=!!vA(e.enableAutoRecoverCapture)||e.enableAutoRecoverCapture,n.enableAutoRecoverOther_=!yA(e.enableAutoRecoverOther)||e.enableAutoRecoverOther,n.log_.info("stream created: ".concat(n.id_," autoRecover: ").concat(n.enableAutoRecoverCapture_)),n.isAIDenoiser=!1,n}return c(LocalStream,[{key:"initState",value:function(){this.isAddingTrack_=!1,this.isRemovingTrack_=!1,this.setIsReadyToPublish(!1),this.setPublishState(HI)}},{key:"installEvents",value:function(){S(l(LocalStream.prototype),"installEvents",this).call(this),jA.on(Ix,this.onVideoTrackStopped,this),jA.on(yx,this.onVideoTrackStopped,this),jA.on(wx,this.onAudioTrackStopped,this),jA.on(Ex,this.onAudioTrackStopped,this)}},{key:"uninstallEvents",value:function(){S(l(LocalStream.prototype),"uninstallEvents",this).call(this),jA.off(Ix,this.onVideoTrackStopped,this),jA.off(yx,this.onVideoTrackStopped,this),jA.off(wx,this.onAudioTrackStopped,this),jA.off(Ex,this.onAudioTrackStopped,this)}},{key:"initialize",value:function(){var e=this;return new Promise((function(t,n){if(RO())n(new kD({code:bD.INVALID_OPERATION,message:sA({key:dR})}));else{if(vA(e.audio_)){var i=new MediaStream;return vA(e.audioSource_)||(i.addTrack(e.audioSource_),e.updateAudioPlayingState(!0)),vA(e.videoSource_)||(i.addTrack(e.videoSource_),e.updateVideoPlayingState(!0)),e.setMediaStream(i),lM.logSuccessEvent({userId:e.client_?e.client_.getUserId():e.userId_,eventType:yI,kind:"custom"}),e.setIsReadyToPublish(!0),t()}e.screen_?(e.log_.info("initialize stream audio: "+e.audio_+" screenAudio: "+e.screenAudio_+" screen: "+e.screen_),Cq({audio:e.audio_,screenAudio:e.screenAudio_,microphoneId:e.microphoneId_,width:e.screenProfile_.width,height:e.screenProfile_.height,frameRate:e.screenProfile_.frameRate,sampleRate:e.audioProfile_.sampleRate,channelCount:e.audioProfile_.channelCount,autoGainControl:e.audioProfile_.autoGainControl,noiseSuppression:e.audioProfile_.noiseSuppression,echoCancellation:e.audioProfile_.echoCancellation}).then((function(n){e.setMediaStream(n),e.updateAudioPlayingState(e.audio_||e.screenAudio_),e.updateVideoPlayingState(!0);var i=e.getVideoTrack();return e.listenForScreenSharingStopped(i),e.setVideoContentHint(nT),e.updateDeviceIdInUse(),e.setIsReadyToPublish(!0),e.log_.info(JSON.stringify(i.getSettings())),lM.logSuccessEvent({userId:e.client_?e.client_.getUserId():e.userId_,eventType:yI,kind:"getDisplayMedia"}),t()})).catch((function(t){lM.logFailedEvent({userId:e.client_?e.client_.getUserId():e.userId_,eventType:yI,kind:"getDisplayMedia",error:t}),e.log_.error("getDisplayMedia error observed "+t),n(t instanceof kD?t:new kD({code:bD.INITIALIZE_FAILED,name:t.name,message:t.message}))}))):(jA.emit(vx,{stream:e,audio:e.audio_,video:e.video_}),e.log_.info("initialize stream audio: "+e.audio_+" video: "+e.video_),Eq({audio:e.audio_,video:e.video_,facingMode:e.facingMode_,cameraId:e.cameraId_,microphoneId:e.microphoneId_,width:e.videoProfile_.width,height:e.videoProfile_.height,frameRate:e.videoProfile_.frameRate,sampleRate:e.audioProfile_.sampleRate,channelCount:e.audioProfile_.channelCount,autoGainControl:e.audioProfile_.autoGainControl,noiseSuppression:e.audioProfile_.noiseSuppression,echoCancellation:e.audioProfile_.echoCancellation,useExact:!0,retryWhenExactFailed:!0}).then((function(n){return jA.emit(_x,{stream:e,audio:e.audio_,video:e.video_}),e.setMediaStream(n),n.getTracks().forEach((function(t){t.kind===Vk&&UO&&(e.videoSetting_=t.getSettings()),VO&&e.log_.info("".concat(t.kind," capabilities: ").concat(JSON.stringify(t.getCapabilities())))})),e.updateAudioPlayingState(e.audio_),e.updateVideoPlayingState(e.video_),e.updateDeviceIdInUse(),e.log_.info("gotStream hasAudio: "+e.hasAudio()+" hasVideo: "+e.hasVideo()),e.setIsReadyToPublish(!0),lM.logSuccessEvent({userId:e.client_?e.client_.getUserId():e.userId_,eventType:yI,kind:"getUserMedia"}),t()})).catch((function(t){jA.emit(gx,{stream:e,audio:e.audio_,video:e.video_,error:t}),lM.logFailedEvent({userId:e.client_?e.client_.getUserId():e.userId_,eventType:yI,kind:"getUserMedia",error:t}),e.log_.error("getUserMedia error observed "+t),n(t)})))}}))}},{key:"listenForScreenSharingStopped",value:function(e){var t=this;e.addEventListener("ended",(function(e){t.log_.info("screen sharing was stopped because the video track is ended"),t.emitter_.emit(GO)}))}},{key:"muteAudio",value:function(){var e=S(l(LocalStream.prototype),"muteAudio",this).call(this);return e&&(this.log_.info("localStream mute audio"),this.sendMutedFlag(Uk,!0)),e}},{key:"muteVideo",value:function(){var e=S(l(LocalStream.prototype),"muteVideo",this).call(this);return e&&(this.log_.info("localStream mute video"),this.sendMutedFlag(Vk,!0)),e}},{key:"unmuteAudio",value:function(){var e=S(l(LocalStream.prototype),"unmuteAudio",this).call(this);return e&&(this.log_.info("localStream unmute audio"),this.sendMutedFlag(Uk,!1)),e}},{key:"unmuteVideo",value:function(){var e=S(l(LocalStream.prototype),"unmuteVideo",this).call(this);return e&&(this.log_.info("localStream unmute video"),this.sendMutedFlag(Vk,!1)),e}},{key:"sendMutedFlag",value:function(e,t){this.setMuteState(e,t);var n=this.getConnection();if(n){n.sendMutedFlag(this.muteState_,this);var i=n.getUserId(),r=n.getTinyId(),a="".concat(t?qk:Kk," local ").concat(e," track");oM(i,{eventId:e===Uk?t?RD:AD:t?CD:xD,eventDesc:a,timestamp:i_(),userId:i,tinyId:r})}}},{key:"setMuteState",value:function(e,t){this.muteState_[e]=t,this.log_.info("set ".concat(e," muted state: [").concat(t?"mute":"unmute","]"))}},{key:"setAudioProfile",value:function(e){var n;"object"===i(e)?n=e:void 0===(n=Yq.get(e))&&(n=Yq.get("standard")),this.log_.info("setAudioProfile: "+JSON.stringify(n)),this.audioProfile_=t(t({},this.audioProfile_),n)}},{key:"setVideoProfile",value:(k=a(n().mark((function e(i){var r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.connection_||EO()){e.next=2;break}throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:hR})});case 2:if(hA(i)?a=t(t({},this.videoProfile_),i):_A(i)&&(a=Xq.get(i),vA(a)&&(a=Xq.get("480p_2"))),null!==(r=this.client_)&&void 0!==r&&r.get2k4kFlag()&&(1!==this.client_.get2k4kFlag()&&!this.screen_&&a.height*a.width>=3686400?(a.width=1920,a.height=1080,this.log_.warn(kE)):fq.handleFunctionState({fnName:"2K_4K"})),a&&a.width*a.height>921600&&eA&&(a.width=1280,a.height=720,this.log_.warn("reset to 1280 * 720 on iOS 13~14")),this.log_.info("setVideoProfile "+JSON.stringify(a)),!(o=this.getVideoTrack())){e.next=10;break}return e.next=10,o.applyConstraints(a);case 10:if(s=this.videoProfile_.bitrate!==a.bitrate,this.videoProfile_=a,!s||!this.connection_){e.next=16;break}return e.next=15,this.connection_.setBandwidth({bandwidth:a.bitrate,type:Vk,videoType:Bk});case 15:this.connection_.sendMediaSettings(this);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"getVideoBitrate",value:function(){return this.screen_?this.screenProfile_.bitrate:this.videoProfile_.bitrate}},{key:"getAudioBitrate",value:function(){return this.audioProfile_.bitrate}},{key:"setScreenProfile",value:function(e){var t=e;_A(e)&&(t=$q.get(e)||$q.get("1080p")),this.log_.info("setScreenProfile "+JSON.stringify(e)),this.screenProfile_=t}},{key:"getVideoProfile",value:function(){return this.screen_?this.screenProfile_:this.videoProfile_}},{key:"getAudioProfile",value:function(){return this.audioProfile_}},{key:"setVideoContentHint",value:function(e){var t=this.getVideoTrack();t&&"contentHint"in t&&(this.log_.info("set video track contentHint to: "+e),t.contentHint=e,t.contentHint!==e&&this.log_.warn("Invalid video track contentHint: "+e))}},{key:"switchDevice",value:(b=a(n().mark((function e(t,i){var r,a,o,s,c,u,d,l,h,p,f,m,v,_,g,y,S,b;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaStream_&&this.cameraId_!==i&&this.facingMode_!==i){e.next=2;break}return e.abrupt("return");case 2:if(a=t===Vk,!(r=t===Uk)||i!==this.microphoneId_){e.next=11;break}if(i===hE){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,cN(this.microphoneGroupId_,this.microphoneLabel_);case 9:if(!e.sent){e.next=11;break}return e.abrupt("return");case 11:return this.setIsReadyToPublish(!1),this.log_.info("switchDevice "+t+" to: "+i),r&&(o=this.getAudioTrack(),s=this.getMicrophoneTrackMixed(),o&&o.stop(),s&&s.stop()),a&&((c=this.getVideoTrack())&&c.stop(),NC&&(u=this.getAudioTrack())&&(this.log_.info("stop audio track first in huawei env"),u.stop())),e.prev=15,e.next=18,Eq({audio:r||NC,video:a,facingMode:i===Wk||i===Jk?i:void 0,cameraId:a?i:this.cameraId_,microphoneId:r?i:this.microphoneId_,width:this.videoProfile_.width,height:this.videoProfile_.height,frameRate:this.videoProfile_.frameRate,sampleRate:this.audioProfile_.sampleRate,channelCount:this.audioProfile_.channelCount,useExact:!0,retryWhenExactFailed:!1});case 18:if(d=e.sent,l=null,!r){e.next=25;break}(h=d.getAudioTracks()[0])&&this.isAudioTrackMixed()?(p=this.getAudioTrack(),f=TQ.AudioMixerPlugin.getAudioTrackMap(),m=TQ.AudioMixerPlugin.mix({targetTrack:h,sourceList:f.get(p.id).sourceList,trackList:f.get(p.id).trackList}),l=m):l=h,e.next=34;break;case 25:if(!(l=d.getVideoTracks()[0])||!this.isVideoTrackBeautified()){e.next=30;break}return e.next=29,this.generateBeautyTrack(l);case 29:l=e.sent;case 30:if(!(v=d.getAudioTracks()[0])||!NC){e.next=34;break}return e.next=34,this.replaceTrack(v);case 34:return e.next=36,this.replaceTrack(l);case 36:this.updateDeviceIdInUse(),(_=this.getConnection())&&(g=_.getUserId(),y=_.getTinyId(),S=OD,b="switch camera",r&&(S=ND,b="switch microphone"),oM(g,{eventId:S,eventDesc:b,timestamp:i_(),userId:g,tinyId:y})),this.log_.info("switch ".concat(r?"microphone":"camera"," success ")),r&&(this.audio_=!0),a&&(this.video_=!0,i!==Jk&&i!==Wk||(this.facingMode_=i)),this.setIsReadyToPublish(!0),e.next=50;break;case 45:throw e.prev=45,e.t0=e.catch(15),this.log_.error(e.t0),r?this.recoverCapture({audio:!0,video:!1,microphoneId:this.microphoneId_}):this.recoverCapture({audio:!1,video:!0,cameraId:this.cameraId_,facingMode:this.facingMode_}),e.t0;case 50:case"end":return e.stop()}}),e,this,[[15,45]])}))),function(e,t){return b.apply(this,arguments)})},{key:"addTrack",value:(y=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t.kind===Vk&&UO&&(i=t.getSettings(),!this.videoSetting_||i.width===this.videoSetting_.width&&i.height===this.videoSetting_.height||this.log_.warn("video resolution of the track (".concat(i.width," x ").concat(i.height,") shall be kept the same as the previous: ").concat(this.videoSetting_.width," x ").concat(this.videoSetting_.height,". It may cause abnormal Cloud Recording."))),this.isAddingTrack_=!0,this.keepMuteState(t),this.mediaStream_.addTrack(t),!(r=this.getConnection())){e.next=11;break}return a=null,t.kind===Vk&&(ZC||YC)&&kA(t)&&(a=this.getCanvasTrack()),e.next=11,r.addTrack(a||t,this);case 11:t.kind===Uk?(this.audio_=!0,this.updateAudioPlayingState(!0),100!==this.captureVolume_&&this.setAudioCaptureVolume(this.captureVolume_)):(this.video_=!0,this.updateVideoPlayingState(!0)),this.isAddingTrack_=!1,e.next=20;break;case 15:throw e.prev=15,e.t0=e.catch(0),this.mediaStream_.removeTrack(t),this.isAddingTrack_=!1,e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return y.apply(this,arguments)})},{key:"removeTrack",value:(_=a(n().mark((function e(t){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.isRemovingTrack_=!0,!(i=this.getConnection())){e.next=17;break}if(t.kind!==Vk||!ZC&&!YC||!this.canvasTrack_){e.next=10;break}return e.next=7,i.removeTrack(this.canvasTrack_,this);case 7:this.clearCanvas(),e.next=17;break;case 10:if(t.kind!==Uk||!this.gain_.audioTrack){e.next=15;break}return e.next=13,i.removeTrack(this.gain_.audioTrack,this);case 13:e.next=17;break;case 15:return e.next=17,i.removeTrack(t,this);case 17:this.mediaStream_.removeTrack(t),t.kind===Uk?(this.audio_=!1,this.updateAudioPlayingState(!1),this.stopGainNode()):(this.video_=!1,this.updateVideoPlayingState(!1)),this.isRemovingTrack_=!1,e.next=26;break;case 22:throw e.prev=22,e.t0=e.catch(0),this.isRemovingTrack_=!1,e.t0;case 26:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e){return _.apply(this,arguments)})},{key:"replaceTrack",value:(v=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.kind===Vk&&UO&&(i=t.getSettings(),!this.videoSetting_||i.width===this.videoSetting_.width&&i.height===this.videoSetting_.height||this.log_.warn("video resolution of the track (".concat(i.width," x ").concat(i.height,") shall be kept the same as the previous: ").concat(this.videoSetting_.width," x ").concat(this.videoSetting_.height,". It may cause abnormal Cloud Recording."))),this.keepMuteState(t),r=this.mediaStream_,t.kind!==Uk){e.next=12;break}if(r.removeTrack(r.getAudioTracks()[0]),r.addTrack(t),S(l(LocalStream.prototype),"restartAudio",this).call(this),!this.gain_.gainNode){e.next=10;break}return this.reconnectGainNode(t),e.abrupt("return");case 10:e.next=15;break;case 12:r.removeTrack(r.getVideoTracks()[0]),r.addTrack(t),S(l(LocalStream.prototype),"restartVideo",this).call(this);case 15:if(!(a=this.getConnection())){e.next=21;break}if(t.kind!==Vk||!ZC&&!YC||!this.canvasTrack_){e.next=19;break}return e.abrupt("return");case 19:return e.next=21,a.replaceTrack(t,this);case 21:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"recoverCapture",value:(m=a(n().mark((function e(t){var i,r,a,o,s,c,u,d,l,h,p,f,m,v,_,g,y;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!this.mediaStream_||!this.enableAutoRecoverCapture_||t.audio&&!t.video&&this.isAudioRecovering_||t.video&&!t.audio&&this.isVideoRecovering_)){e.next=2;break}return e.abrupt("return");case 2:return t.audio&&(this.isAudioRecovering_=!0),t.video&&(this.isVideoRecovering_=!0),this.log_.warn("recoverCapture() trying "+JSON.stringify(t)),i=this.audio_&&t.audio,r=this.video_&&t.video,e.prev=7,e.next=10,TQ.getCameras();case 10:return a=e.sent,e.next=13,TQ.getMicrophones();case 13:if(o=e.sent,r&&0===a.length&&(r=!1,this.log_.warn("recoverCapture() video flag is true, but no camera detected, set video to false")),i&&0===o.length&&(i=!1,this.log_.warn("recoverCapture() audio flag is true, but no microphone detected, set audio to false")),i||r){e.next=21;break}return t.audio&&(this.isAudioRecovering_=!1),t.video&&(this.isVideoRecovering_=!1),this.log_.warn("recoverCapture() both audio and video are false, aborted"),e.abrupt("return");case 21:return s=t&&a.findIndex((function(e){return e.deviceId===t.cameraId}))>=0,c=t&&o.findIndex((function(e){return e.deviceId===t.microphoneId}))>=0,i&&(null===(u=this.getAudioTrack())||void 0===u||u.stop()),r&&(null===(d=this.getVideoTrack())||void 0===d||d.stop()),e.next=27,Eq({audio:i,video:r,cameraId:s?t.cameraId:void 0,microphoneId:c?t.microphoneId:void 0,facingMode:this.facingMode_,width:this.videoProfile_.width,height:this.videoProfile_.height,frameRate:this.videoProfile_.frameRate,sampleRate:this.audioProfile_.sampleRate,channelCount:this.audioProfile_.channelCount});case 27:l=e.sent,h=l.getTracks(),p=0;case 30:if(!(p<h.length)){e.next=57;break}if((f=h[p]).kind!==Uk||!this.isAudioTrackMixed()){e.next=43;break}if(m=this.getAudioTrack(),v=TQ.AudioMixerPlugin.getAudioTrackMap(),(_=v.get(m.id)).hasMicrophone){e.next=39;break}return f.stop(),e.abrupt("continue",54);case 39:return g=TQ.AudioMixerPlugin.mix({targetTrack:f,sourceList:_.sourceList,trackList:_.trackList}),e.next=42,this.replaceTrack(g);case 42:return e.abrupt("continue",54);case 43:if(f.kind!==Vk||!this.isVideoTrackBeautified()){e.next=50;break}return e.next=46,this.generateBeautyTrack(f);case 46:return y=e.sent,e.next=49,this.replaceTrack(y);case 49:return e.abrupt("continue",54);case 50:return e.next=52,this.replaceTrack(f);case 52:if("ended"!==f.readyState){e.next=54;break}throw new Error("new track is failed, muted ".concat(f.muted," readyState ").concat(f.readyState));case 54:p++,e.next=30;break;case 57:this.updateDeviceIdInUse(),lM.logSuccessEvent({userId:this.client_?this.client_.getUserId():this.userId_,eventType:kI}),t.audio&&(this.isAudioRecovering_=!1),t.video&&(this.isVideoRecovering_=!1),this.log_.warn("recoverCapture() successfully"),this.emitter_.emit(WO,{isCamera:t.video,isMicrophone:t.audio,cameraId:this.cameraId_,microphoneId:this.microphoneId_}),e.next=71;break;case 65:throw e.prev=65,e.t0=e.catch(7),t.audio&&(this.isAudioRecovering_=!1),t.video&&(this.isVideoRecovering_=!1),this.log_.warn("recoverCapture() failed, "+e.t0),e.t0;case 71:case"end":return e.stop()}}),e,this,[[7,65]])}))),function(e){return m.apply(this,arguments)})},{key:"updateDeviceIdInUse",value:function(){var e=this;if(!this.mediaStream_)return this.cameraId_="",this.cameraGroupId_="",this.microphoneId_="",void(this.microphoneGroupId_="");UO&&this.mediaStream_.getTracks().forEach((function(t){if(t.kind===Uk&&e.isAudioTrackMixed()){var n=e.getMicrophoneTrackMixed();if(n){var i=n.getSettings(),r=i.deviceId,a=i.groupId;r&&(e.microphoneId_=r,e.microphoneGroupId_=a,e.microphoneLabel_=n.label)}}else if(t.kind===Vk&&e.isVideoTrackBeautified()){var o=e.getBeautyOriginTrack();if(o){var s=o.getSettings(),c=s.deviceId,u=s.groupId;c&&(e.cameraId_=c,e.cameraGroupId_=u)}}else{var d=t.getSettings(),l=d.deviceId,h=d.groupId;l&&(t.kind===Uk?(e.microphoneId_=l,e.microphoneGroupId_=h,e.microphoneLabel_=t.label):t.kind!==Vk||e.screen_||(e.cameraId_=l,e.cameraGroupId_=h))}}));var t=this.mediaStream_.getAudioTracks(),n=this.mediaStream_.getVideoTracks();t&&0===t.length&&(this.microphoneId_="",this.microphoneGroupId_=""),n&&0===n.length&&(this.cameraId_="",this.cameraGroupId_="")}},{key:"isAudioTrackMixed",value:function(){if(TQ.AudioMixerPlugin){var e=TQ.AudioMixerPlugin.getAudioTrackMap(),t=this.getAudioTrack();if(e&&t&&e.has(t.id))return!0}return!1}},{key:"getMicrophoneTrackMixed",value:function(){if(TQ.AudioMixerPlugin){var e=TQ.AudioMixerPlugin.getAudioTrackMap(),t=this.getAudioTrack();if(e&&t&&e.has(t.id)){var n=e.get(t.id);return n.hasMicrophone?n.microphoneTrack:null}}return null}},{key:"isVideoTrackBeautified",value:function(){if(TQ.beautyTrackMap){var e=TQ.beautyTrackMap,t=this.getVideoTrack();if(t&&e.has(t.id))return!0}return!1}},{key:"getBeautyOriginTrack",value:function(){if(TQ.beautyTrackMap){var e=TQ.beautyTrackMap,t=this.getVideoTrack();if(t&&e.has(t.id)){var n=e.get(t.id);if(n.originTrack)return n.originTrack}}return null}},{key:"generateBeautyTrack",value:(f=a(n().mark((function e(t){var i,r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=null,r=this.getVideoTrack(),a=TQ.beautyTrackMap.get(r.id),o=a.param,a.type){e.next=8;break}i=a.pluginInstance.generateBeautyTrack(t),e.next=22;break;case 8:e.t0=a.type,e.next="beauty"===e.t0?11:"virtual"===e.t0?13:"mixed"===e.t0?17:21;break;case 11:return i=a.pluginInstance.generateBeautyTrack(t),e.abrupt("break",22);case 13:return e.next=15,a.pluginInstance.generateVirtualTrack({videoTrack:t,type:o.type,img:o.img});case 15:case 19:return i=e.sent,e.abrupt("break",22);case 17:return e.next=19,a.pluginInstance.generateMixedTrack({videoTrack:t,type:o.type,img:o.img});case 21:return e.abrupt("break",22);case 22:return a.pluginInstance.deleteSource(r.id),this.log_.info("regenerate beauty track, track id = ".concat(t.id)),e.abrupt("return",i);case 25:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"getScreen",value:function(){return this.screen_}},{key:"hasScreenTrack",value:function(){if(this.screen_)return!0;var e=this.getVideoTrack();return!!e&&(e.contentHint===nT||e.contentHint===iT)}},{key:"getVideo",value:function(){return this.video_}},{key:"getAudio",value:function(){return this.audio_}},{key:"getCameraId",value:function(){return this.cameraId_}},{key:"getMicrophoneId",value:function(){return this.microphoneId_}},{key:"getMicrophoneGroupId",value:function(){return this.microphoneGroupId_}},{key:"getIsReadyToPublish",value:function(){return this.isReadyToPublish_}},{key:"setIsReadyToPublish",value:function(e){this.isReadyToPublish_=e}},{key:"setPublishState",value:function(e){this.publishState_=e}},{key:"setBeautyStatus",value:function(e){this.beautyStatus_=!!e}},{key:"getBeautyStatus",value:function(){return this.beautyStatus_}},{key:"syncMuteState",value:function(){var e=this.getAudioTrack(),t=this.getVideoTrack();if(e){var n=!e.enabled;this.setMuteState(Uk,n)}if(t){var i=!t.enabled;this.setMuteState(Vk,i)}this.connection_&&this.connection_.sendMutedFlag(this.muteState_,this)}},{key:"keepMuteState",value:function(e){e instanceof MediaStreamTrack&&this.muteState_[e.kind]&&(e.enabled=!1,this.log_.warn("prev ".concat(e.kind," track is muted, keep mute state")))}},{key:"onVideoTrackStopped",value:(p=a(n().mark((function e(t){var i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.stream,r=t.type,i===this&&this.video_&&this.cameraId_&&sN(this.getVideoTrack())&&!this.isVideoRecovering_&&(r!==qk||!RC||!KC)){e.next=3;break}return e.abrupt("return");case 3:if(!(Date.now()-this.prevVideoRecoverTime_<_E)){e.next=6;break}return setTimeout((function(){return a.onVideoTrackStopped({stream:i,type:r})}),_E),e.abrupt("return");case 6:r===qk?setTimeout((function(){var e=a.getVideoTrack();null!=e&&e.muted&&"visible"===document.visibilityState&&a.recoverVideoCapture(r)}),5e3):this.recoverVideoCapture(r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"onAudioTrackStopped",value:(h=a(n().mark((function e(t){var i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.stream,r=t.type,!(i!==this||!this.audio_||!this.microphoneId_||this.isAudioRecovering_||r===qk&&RC&&KC)){e.next=3;break}return e.abrupt("return");case 3:if(!(Date.now()-this.prevAudioRecoverTime_<_E)){e.next=6;break}return setTimeout((function(){return a.onAudioTrackStopped({stream:i,type:r})}),_E),e.abrupt("return");case 6:r===qk?setTimeout((function(){var e=a.getAudioTrack();null!=e&&e.muted&&"visible"===document.visibilityState&&a.recoverAudioCapture(r)}),5e3):this.recoverAudioCapture(r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"recoverAudioCapture",value:(u=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.prevAudioRecoverTime_=Date.now(),lM.uploadEvent({log:"stat-local-audio-".concat(t),userId:this.userId_}),e.t0=this,e.next=5,this.getRecoverCaptureDeviceId(!1);case 5:e.t1=e.sent,e.t2={audio:!0,video:!1,microphoneId:e.t1},e.t0.recoverCapture.call(e.t0,e.t2);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"recoverVideoCapture",value:(s=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.prevVideoRecoverTime_=Date.now(),lM.uploadEvent({log:"stat-local-video-".concat(t),userId:this.userId_}),e.t0=this,e.next=5,this.getRecoverCaptureDeviceId(!0);case 5:e.t1=e.sent,e.t2={audio:!1,video:!0,cameraId:e.t1},e.t0.recoverCapture.call(e.t0,e.t2);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getRecoverCaptureDeviceId",value:(r=a(n().mark((function e(){var t,i,r,a,o=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(o.length>0&&void 0!==o[0])||o[0],!(i=t?this.cameraId_:this.microphoneId_)||!this.enableAutoRecoverOther_){e.next=17;break}if(Zq.has(i)?Zq.set(i,Zq.get(i)+1):Zq.set(i,1),!((r=Zq.get(i))>=3)){e.next=17;break}if(!t){e.next=12;break}return e.next=9,TQ.getCameras();case 9:e.t0=e.sent.find((function(e){return!Zq.has(e.deviceId)})),e.next=15;break;case 12:return e.next=14,TQ.getMicrophones();case 14:e.t0=e.sent.find((function(e){return!Zq.has(e.deviceId)}));case 15:(a=e.t0)&&(this.log_.warn("".concat(t?"camera":"mic"," ").concat(i," capture fail ").concat(r," times, change new ").concat(a.deviceId)),i=a.deviceId);case 17:return e.abrupt("return",i);case 18:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"setAudioVolume",value:function(e){S(l(LocalStream.prototype),"setAudioVolume",this).call(this,e)}},{key:"clearCanvas",value:function(){this.canvasInterval_&&(iO.clearTask(this.canvasInterval_),this.canvasInterval_=null,this.canvas_=null,this.canvasTrack_=null)}},{key:"getCanvasTrack",value:function(){var e=this;if(this.canvasTrack_)return this.canvasTrack_;this.log_.info("gen canvas track");var t=this.getVideoTrack().getSettings(),n=t.width,i=t.height,r=t.frameRate;this.canvas_=document.createElement("canvas");var a=this.canvas_.getContext("2d");this.canvas_.width=n,this.canvas_.height=i,this.canvasInterval_=iO.run(yE,(function(){if(e.hasVideo()){var t=e.getVideoTrack().getSettings();t.width===e.canvas_.width&&t.height===e.canvas_.height||(e.canvas_.width=t.width,e.canvas_.height=t.height)}e.videoPlayer_&&e.videoPlayer_.element_&&a.drawImage(e.videoPlayer_.element_,0,0,e.canvas_.width,e.canvas_.height)}),{fps:Math.max(15,r)});var o=this.canvas_.captureStream();return this.canvasTrack_=o.getVideoTracks()[0],this.canvasTrack_}},{key:"setClient",value:function(e,t){e&&(this.log_.setUserId(e.getUserId()),this.log_.setSdkAppId(e.getSDKAppId()),t||this.syncMuteState()),this.client_=e}},{key:"setAudioCaptureVolume",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;if(!this.hasAudio()||t<0||!IO())return!1;if(this.captureVolume_===t)return!0;this.captureVolume_=t,this.log_.info("setCaptureVolume "+t),t/=100;var n=DA();if(this.gain_.gainNode)this.gain_.gainNode.gain.value=t;else{var i,r=new MediaStream;r.addTrack(this.getAudioTrack());var a=n.createMediaStreamDestination(),o=n.createMediaStreamSource(r),s=n.createGain();s.gain.value=t,o.connect(s),s.connect(a);var c=a.stream.getAudioTracks()[0],u=function(t){return e.log_.info("gained audio track ".concat(t))};c.onmute=function(){return u("muted")},c.onunmute=function(){return u("unmuted")},c.onended=function(){return u("ended")},this.gain_={source:o,audioTrack:c,gainNode:s},null===(i=this.connection_)||void 0===i||i.replaceTrack(c),S(l(LocalStream.prototype),"restartAudio",this).call(this)}return!0}},{key:"getGainedTrack",value:function(){return this.gain_.audioTrack}},{key:"reconnectGainNode",value:function(e){this.log_.warn("reconnect gain node");var t=new MediaStream;t.addTrack(e);var n=DA().createMediaStreamSource(t);n.connect(this.gain_.gainNode),this.gain_.source.disconnect(),this.gain_.source=n}},{key:"stopGainNode",value:function(){var e=this.gain_,t=e.audioTrack,n=e.source,i=e.gainNode;i&&(n.disconnect(),i.disconnect(),t.onmute=null,t.onunmute=null,t.onended=null,t.stop(),this.gain_={source:null,gainNode:null,audioTrack:null}),this.captureVolume_=100}},{key:"close",value:function(){this.setIsReadyToPublish(!1),this.stopGainNode(),S(l(LocalStream.prototype),"close",this).call(this)}},{key:"setIsAIDenoiser",value:function(e){this.isAIDenoiser=e}}]),LocalStream}(vq),C(Hq.prototype,"setAudioProfile",[Pq],Object.getOwnPropertyDescriptor(Hq.prototype,"setAudioProfile"),Hq.prototype),C(Hq.prototype,"setVideoProfile",[Dq],Object.getOwnPropertyDescriptor(Hq.prototype,"setVideoProfile"),Hq.prototype),C(Hq.prototype,"setScreenProfile",[Mq],Object.getOwnPropertyDescriptor(Hq.prototype,"setScreenProfile"),Hq.prototype),C(Hq.prototype,"setVideoContentHint",[Oq],Object.getOwnPropertyDescriptor(Hq.prototype,"setVideoContentHint"),Hq.prototype),C(Hq.prototype,"switchDevice",[Nq],Object.getOwnPropertyDescriptor(Hq.prototype,"switchDevice"),Hq.prototype),C(Hq.prototype,"addTrack",[Lq],Object.getOwnPropertyDescriptor(Hq.prototype,"addTrack"),Hq.prototype),C(Hq.prototype,"removeTrack",[Uq],Object.getOwnPropertyDescriptor(Hq.prototype,"removeTrack"),Hq.prototype),C(Hq.prototype,"replaceTrack",[Vq],Object.getOwnPropertyDescriptor(Hq.prototype,"replaceTrack"),Hq.prototype),C(Hq.prototype,"recoverCapture",[Fq],Object.getOwnPropertyDescriptor(Hq.prototype,"recoverCapture"),Hq.prototype),C(Hq.prototype,"setAudioCaptureVolume",[jq,Bq],Object.getOwnPropertyDescriptor(Hq.prototype,"setAudioCaptureVolume"),Hq.prototype),Hq),tK={voiceActivityDetection:!1},nK=(Gq=aq({retries:1,timeout:0,onRetrying:function(e){this.log_.warn("connection timeout, retrying [".concat(e,"]"))},onError:function(e,t,n){e.message.includes("timeout")?(this.reset(),this.initialize(),t()):n(e)}}),zq=function(e){d(P,e);var i,r,s,u,h,p,f,m,v,_,y,b,k,T,I,E,w,R,C,A,x=g(P);function P(e){var t;return o(this,P),(t=x.call(this,e)).localStream_=null,t.exchangeSDPTimeout_=-1,t.localAuxStream_=null,t.publishingStream_=null,t.isPublishingAuxStream_=!1,t.smallGenerator_=null,t.isSDPExchanging_=!1,t.ssrc_={audio:0,video:0,small:0,auxiliary:0},t.mediaSettings_={videoCodec:"",videoWidth:0,videoHeight:0,videoBps:0,videoFps:0,audioCodec:"opus",audioFs:0,audioChannel:0,audioBps:0,smallVideoWidth:0,smallVideoHeight:0,smallVideoFps:0,smallVideoBps:0,auxVideoWidth:0,auxVideoHeight:0,auxVideoFps:0,auxVideoBps:0},t.mixedAudioTrack_=null,t}return c(P,[{key:"isMainStreamPublished",get:function(){return!!this.localStream_}},{key:"isAuxStreamPublished",get:function(){return!!this.localAuxStream_}},{key:"publishState",get:function(){var e=this,t={audio:!1,bigVideo:!1,smallVideo:!1,auxVideo:!1};if(this.peerConnection_){var n,i,r,a,o=this.peerConnection_.getSenders();if(o)if(kO())t.audio=!(null===(n=o[0])||void 0===n||!n.track),t.bigVideo=!(null===(i=o[1])||void 0===i||!i.track),t.smallVideo=!(null===(r=o[2])||void 0===r||!r.track),t.auxVideo=!(null===(a=o[3])||void 0===a||!a.track);else o.forEach((function(n){n.track&&(n.track.kind===Uk?t.audio=!0:(t.bigVideo=!0,e.smallGenerator_&&(t.smallVideo=!0)))}))}return t}},{key:"initialize",value:function(){S(l(P.prototype),"initialize",this).call(this),this.installEvents()}},{key:"reset",value:function(){this.isReconnecting_&&this.stopReconnection(),this.closePeerConnection(),this.uninstallEvents(),this.clearExchangeSDPTimeout(),this.localStream_&&this.localStream_.clearCanvas()}},{key:"close",value:function(){S(l(P.prototype),"close",this).call(this),this.reset(),this.emitConnectionStateChangedEvent(zT),this.smallGenerator_&&(this.smallGenerator_.destroy(),this.smallGenerator_=null)}},{key:"installEvents",value:function(){this.emitter_.on(jO.ERROR,this.handleError,this),this.emitter_.on(jO.CONNECTION_STATE_CHANGED,this.handleConnectionStateChange,this)}},{key:"uninstallEvents",value:function(){this.emitter_.off(jO.ERROR,this.handleError,this),this.emitter_.off(jO.CONNECTION_STATE_CHANGED,this.handleConnectionStateChange,this)}},{key:"publish",value:(A=a(n().mark((function e(t,i){var r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.publishingStream_=t,this.isPublishingAuxStream_=i,o=t.getVideoTrack(),s=null,!o||i||!this.client_.getIsEnableSmallStream()){e.next=9;break}return this.smallGenerator_=new kq(t),e.next=8,this.smallGenerator_.initialize();case 8:s=this.smallGenerator_.generateSmallVideoTrack(this.client_.smallStreamConfig_);case 9:if(null===(r=this.client_)||void 0===r||!r.get2k4kFlag()){e.next=18;break}if(c=1===this.client_.get2k4kFlag(),u=t.getVideoProfile(),c||t.getScreen()||!(u.height*u.width>=3686400)){e.next=18;break}return u.width=1920,u.height=1080,this.log_.warn(kE),e.next=18,t.setVideoProfile(u);case 18:if(this.updateMediaSettings(t,i),!TO()){e.next=24;break}return e.next=22,this.publishByTransceiver(t,s,i);case 22:e.next=26;break;case 24:return e.next=26,this.publishByAddTrack(t,s);case 26:return this.publishingStream_=null,this.isPublishingAuxStream_=!1,i?this.localAuxStream_=t:this.localStream_=t,null===(a=this.sei_)||void 0===a||a.handleEncodedStreams(),e.abrupt("return",t);case 31:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"publishByTransceiver",value:(C=a(n().mark((function e(t,i,r){var a,o,s,c,u,d,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.log_.info("publish by transceiver"),a=t.getMediaStream(),o=t.getAudioTrack(),s=t.getVideoTrack(),c=null,(ZC||YC)&&kA(s)&&(c=t.getCanvasTrack()),0!==(u=this.peerConnection_.getTransceivers()).length){e.next=16;break}return this.peerConnection_.addTransceiver(o||Uk,{direction:mT,streams:[a]}),this.peerConnection_.addTransceiver(r?Vk:c||s||Vk,{direction:mT,streams:[a]}),this.peerConnection_.addTransceiver(i||Vk,{direction:mT,streams:[a]}),this.peerConnection_.addTransceiver(r?c||s:Vk,{direction:mT,streams:[a]}),e.next=14,this.connect();case 14:e.next=46;break;case 16:if(d=[],!o){e.next=29;break}if(!u[0].sender.track){e.next=24;break}return this.mixAudioTrack(u[0].sender.track,o),e.next=22,u[0].sender.replaceTrack(this.mixedAudioTrack_);case 22:e.next=27;break;case 24:return e.next=26,u[0].sender.replaceTrack(o);case 26:d.push(0);case 27:return e.next=29,this.setBandwidth({bandwidth:t.getAudioBitrate(),type:Uk});case 29:if(!s){e.next=42;break}return l=r?3:1,e.next=33,u[l].sender.replaceTrack(c||s);case 33:return e.next=35,this.setBandwidth({bandwidth:t.getVideoBitrate(),type:Vk,videoType:r?Hk:Bk});case 35:if(d.push(l),!i){e.next=42;break}return e.next=39,u[2].sender.replaceTrack(i);case 39:return e.next=41,this.setBandwidth({bandwidth:this.client_.smallStreamConfig.bitrate,type:Vk,videoType:jk});case 41:d.push(2);case 42:return e.next=44,this.setTransceiverDirection(mT,d);case 44:return e.next=46,this.doPublishChange();case 46:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return C.apply(this,arguments)})},{key:"publishByAddTrack",value:(R=a(n().mark((function e(t,i){var r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.log_.info("publish by addtrack"),r=t.getMediaStream(),a=t.getAudioTrack(),o=t.getVideoTrack(),a&&this.peerConnection_.addTrack(a,r),o&&(this.peerConnection_.addTrack(o,r),i&&((s=new MediaStream).addTrack(i),this.peerConnection_.addTrack(i,s))),e.next=8,this.connect();case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"unpublish",value:(w=a(n().mark((function e(i){var r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(kO()){e.next=2;break}return e.abrupt("return",this.doUnpublish());case 2:if(r=i.getAudioTrack(),a=i===this.localAuxStream_,o=this.peerConnection_.getSenders(),s=[],!r){e.next=17;break}if(!this.mixedAudioTrack_){e.next=14;break}return this.log_.info("has mixed audioTrack, use another audioTrack"),e.next=11,o[0].replaceTrack(a?this.localStream_.getAudioTrack():this.localAuxStream_.getAudioTrack());case 11:this.destroyMixedAudioTrack(),e.next=17;break;case 14:return e.next=16,o[0].replaceTrack(null);case 16:s.push(0);case 17:if(!a){e.next=25;break}return e.next=20,o[3].replaceTrack(null);case 20:this.localAuxStream_=null,this.mediaSettings_=t(t({},this.mediaSettings_),{},{auxVideoBps:0,auxVideoFps:0,auxVideoWidth:0,auxVideoHeight:0}),s.push(3),e.next=32;break;case 25:return e.next=27,o[1].replaceTrack(null);case 27:return e.next=29,o[2].replaceTrack(null);case 29:this.localStream_=null,this.mediaSettings_=t(t({},this.mediaSettings_),{},{videoWidth:0,videoHeight:0,videoBps:0,videoFps:0,audioFs:0,audioChannel:0,audioBps:0,smallVideoWidth:0,smallVideoHeight:0,smallVideoFps:0,smallVideoBps:0}),s.push(1,2);case 32:if(!this.localStream_&&!this.localAuxStream_){e.next=39;break}return e.next=35,this.setTransceiverDirection(fT,s);case 35:return e.next=37,this.doPublishChange();case 37:e.next=41;break;case 39:return e.next=41,this.doUnpublish();case 41:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"doPublishChange",value:(E=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={state:this.publishState,constraintConfig:this.mediaSettings_},e.next=3,this.signalChannel_.sendWaitForResponse({command:nD,data:t,responseCommand:eD.PUBLISH_STATE_CHANGE_RESULT});case 3:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"doUnpublish",value:function(){var e=this;return this.signalChannel_.sendWaitForResponse({command:cD,commandDesc:"unpublish",responseCommand:eD.UNPUBLISH_RESULT}).then((function(){e.close()})).catch((function(){e.close()}))}},{key:"updateMediaSettings",value:function(e,t){var n=this;this.localAuxStream_&&e===this.localAuxStream_&&(t=!0);var i=this.client_.getSystemResult().detail,r=i.isH264EncodeSupported,a=i.isVp8EncodeSupported;(r?this.mediaSettings_.videoCodec="H264":a&&(this.mediaSettings_.videoCodec="VP8"),UO)?e.getMediaStream().getTracks().forEach((function(i){var r=i.getSettings();if(i.kind===Uk){var a=1;r.channelCount&&(a=r.channelCount),n.mediaSettings_.audioChannel=a,n.mediaSettings_.audioBps=1e3*e.getAudioBitrate(),n.mediaSettings_.audioFs=r.sampleRate}else if(i.kind===Vk){if(t)return n.mediaSettings_.auxVideoWidth=r.width,n.mediaSettings_.auxVideoHeight=r.height,n.mediaSettings_.auxVideoFps=r.frameRate,void(n.mediaSettings_.auxVideoBps=1e3*e.getVideoBitrate());n.client_.getIsEnableSmallStream()&&(n.mediaSettings_.smallVideoWidth=n.client_.smallStreamConfig.width,n.mediaSettings_.smallVideoHeight=n.client_.smallStreamConfig.height,n.mediaSettings_.smallVideoFps=n.client_.smallStreamConfig.frameRate,n.mediaSettings_.smallVideoBps=1e3*n.client_.smallStreamConfig.bitrate),n.mediaSettings_.videoWidth=r.width,n.mediaSettings_.videoHeight=r.height,n.mediaSettings_.videoFps=r.frameRate,n.mediaSettings_.videoBps=1e3*e.getVideoBitrate()}})):this.updateMediaSettingsFromProfile(e);this.log_.info("updateMediaSettings: "+JSON.stringify(this.mediaSettings_))}},{key:"updateMediaSettingsFromProfile",value:function(e){if(e){if(e.hasAudio()){var t=e.getAudioProfile();this.mediaSettings_.audioChannel=t.channelCount,this.mediaSettings_.audioBps=1e3*t.bitrate,this.mediaSettings_.audioFs=t.sampleRate}if(e.hasVideo()){var n=e.getVideoProfile();this.mediaSettings_.videoWidth=n.width,this.mediaSettings_.videoHeight=n.height,this.mediaSettings_.videoFps=n.frameRate,this.mediaSettings_.videoBps=1e3*n.bitrate}}}},{key:"sendMediaSettings",value:function(e){var t=this;this.updateMediaSettings(e),this.signalChannel_.sendWaitForResponse({command:SD,data:this.mediaSettings_,responseCommand:eD.UPDATE_CONSTRAINT_CONFIG_RES}).then((function(e){0!==e.data.code&&t.log_.warn(e.data.message)})).catch(this.log_.warn)}},{key:"addTrack",value:(I=a(n().mark((function e(t,i){var r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.peerConnection_){e.next=2;break}return e.abrupt("return");case 2:if(a=i===this.localAuxStream_,this.log_.info("is adding ".concat(t.kind," track to current published local ").concat(a?Hk:rT," stream")),null===(r=this.sei_)||void 0===r||r.handleEncodedStreams(),!kO()){e.next=10;break}return e.next=8,this.addTrackByTransceiver(t,i);case 8:e.next=12;break;case 10:return e.next=12,this.addTrackBySender(t);case 12:oM(this.userId_,{eventId:t.kind===Uk?ID:TD,eventDesc:"add ".concat(t.kind," track to current published stream"),timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_});case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"addTrackByTransceiver",value:(T=a(n().mark((function e(t,i){var r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i===this.localAuxStream_,a=this.peerConnection_.getTransceivers(),t.kind!==Uk){e.next=13;break}if(!a[0].sender.track){e.next=9;break}return this.mixAudioTrack(a[0].sender.track,t),e.next=7,a[0].sender.replaceTrack(this.mixedAudioTrack_);case 7:e.next=11;break;case 9:return e.next=11,a[0].sender.replaceTrack(t);case 11:e.next=26;break;case 13:return o=r?3:1,e.next=16,a[o].sender.replaceTrack(t);case 16:if(1!==o||!this.client_.getIsEnableSmallStream()){e.next=23;break}return this.smallGenerator_=new kq(this.localStream_),e.next=20,this.smallGenerator_.initialize();case 20:return s=this.smallGenerator_.generateSmallVideoTrack(this.client_.smallStreamConfig_),e.next=23,a[2].sender.replaceTrack(s);case 23:if(a[o].direction!==fT){e.next=26;break}return e.next=26,this.setTransceiverDirection(mT,[o]);case 26:return this.updateMediaSettings(i,r),e.next=29,this.doPublishChange();case 29:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"addTrackBySender",value:(k=a(n().mark((function e(t){var i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(kO()&&this.peerConnection_.getTransceivers().findIndex((function(e){return"stopped"===e.direction}))>=0)){e.next=4;break}return this.log_.warn("transceiver is stopping, negotiate sdp first"),e.next=4,this.updateOffer(jI.REMOVE,t);case 4:if(!(i=this.peerConnection_.getSenders().find((function(e){return e.track&&e.track.kind===t.kind})))){e.next=11;break}return this.log_.warn("sender already exists, remove sender first"),r=i.track,this.removeSender(i),e.next=11,this.updateOffer(jI.REMOVE,r);case 11:if(a=this.localStream_.getMediaStream(),this.peerConnection_.addTrack(t,a),t.kind!==Vk||!this.client_.getIsEnableSmallStream()){e.next=21;break}return this.smallGenerator_=new kq(this.localStream_),e.next=17,this.smallGenerator_.initialize();case 17:o=this.smallGenerator_.generateSmallVideoTrack(this.client_.smallStreamConfig_),(s=new MediaStream).addTrack(o),this.peerConnection_.addTrack(o,s);case 21:return e.next=23,this.updateOffer(jI.ADD,t);case 23:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"isNeedToResetOfferOrder",value:function(){if(this.sdpSemantics_===PI||!this.peerConnection_||!this.peerConnection_.localDescription)return!1;for(var e=this.peerConnection_.localDescription.sdp,t=xM(e),n=0;n<t.media.length;n++)if(0===t.media[n].mid&&t.media[n].type===Vk)return!0;return!1}},{key:"removeSender",value:function(e){var t=null;kO()&&(t=this.peerConnection_.getTransceivers().find((function(t){return t.sender&&t.sender.track===e.track}))),this.peerConnection_.removeTrack(e),t&&mA(t.stop)&&(this.log_.info("stop transceiver"),t.stop())}},{key:"removeTrack",value:(b=a(n().mark((function e(t,i){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.peerConnection_){e.next=2;break}return e.abrupt("return");case 2:if(this.log_.info("is removing ".concat(t.kind," track from current published local ").concat(i===this.localAuxStream_?Hk:rT," stream")),!kO()){e.next=8;break}return e.next=6,this.removeTrackByTransceiver(t,i);case 6:e.next=10;break;case 8:return e.next=10,this.removeTrackBySender(t);case 10:oM(this.userId_,{eventId:t.kind===Uk?wD:ED,eventDesc:"remove ".concat(t.kind," track from current published stream"),timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_});case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"removeTrackByTransceiver",value:(y=a(n().mark((function e(t,i){var r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i===this.localAuxStream_,a=this.peerConnection_.getTransceivers(),t.kind!==Uk){e.next=13;break}if(!this.mixedAudioTrack_){e.next=9;break}return e.next=6,a[0].sender.replaceTrack(r?this.localStream_.getAudioTrack():this.localAuxStream_.getAudioTrack());case 6:this.destroyMixedAudioTrack(),e.next=11;break;case 9:return e.next=11,a[0].sender.replaceTrack(null);case 11:e.next=23;break;case 13:return o=r?3:1,e.next=16,a[o].sender.replaceTrack(null);case 16:if(1!==o||!this.smallGenerator_){e.next=21;break}return this.smallGenerator_.destroy(),this.smallGenerator_=null,e.next=21,a[2].sender.replaceTrack(null);case 21:return e.next=23,this.setTransceiverDirection(fT,[o]);case 23:return this.updateMediaSettings(i,r),e.next=26,this.doPublishChange();case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"setTransceiverDirection",value:(_=a(n().mark((function e(t,i){var r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tC){e.next=2;break}return e.abrupt("return");case 2:if(r=!1,a=!1,this.log_.info("setting transceiver ".concat(i.join(",")," direction to ").concat(t)),o=this.peerConnection_.getTransceivers(),i.forEach((function(e){o[e].direction!==t&&(o[e].direction=t,r=!0)})),!r){e.next=14;break}return this.log_.info("updating offer"),e.next=11,this.peerConnection_.createOffer();case 11:return s=e.sent,e.next=14,this.peerConnection_.setLocalDescription(s);case 14:if(c=-1,u=this.peerConnection_.remoteDescription.sdp.split("\r\n").map((function(e){if(e.match(new RegExp("a=(".concat(fT,"|").concat(vT,"|").concat(mT,")")))&&c++,i.includes(c)){if(t===fT&&e.includes("a=".concat(vT)))return a=!0,"a=".concat(t);if(t===mT&&e.includes("a=".concat(fT)))return a=!0,"a=".concat(vT)}return e})).join("\r\n"),!a){e.next=20;break}return this.log_.info("updating answer"),e.next=20,this.peerConnection_.setRemoteDescription({type:"answer",sdp:u});case 20:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"removeTrackBySender",value:(v=a(n().mark((function e(t){var i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.kind!==Vk||!this.isNeedToResetOfferOrder()){e.next=7;break}return this.reset(),this.initialize(),null===(i=this.localStream_.getMediaStream())||void 0===i||i.removeTrack(t),e.next=6,this.publish(this.localStream_);case 6:return e.abrupt("return");case 7:return(r=this.peerConnection_.getSenders().find((function(e){return e.track===t})))&&(this.removeSender(r),t.kind===Vk&&this.smallGenerator_&&(this.smallGenerator_.destroy(),this.smallGenerator_=null,this.peerConnection_.getSenders().forEach((function(e){e.track&&e.track.kind===Vk&&a.removeSender(e)})))),e.next=11,this.updateOffer(jI.REMOVE,t);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"replaceTrack",value:(m=a(n().mark((function e(t,i){var r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=null===(r=this.peerConnection_)||void 0===r?void 0:r.getSenders())&&0!==a.length){e.next=3;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Pw})});case 3:if(o=i===this.localAuxStream_,this.log_.info("is replacing ".concat(t.kind," track to current published local ").concat(o?Hk:rT," stream")),t.kind!==Uk||!a[0]){e.next=16;break}if(!(this.mixedAudioTrack_&&null!==(s=this.localStream_)&&void 0!==s&&s.hasAudio()&&null!==(c=this.localAuxStream_)&&void 0!==c&&c.hasAudio())){e.next=14;break}return this.destroyMixedAudioTrack(),u=o?this.localStream_.getAudioTrack():this.localAuxStream_.getAudioTrack(),this.mixAudioTrack(t,u),e.next=12,a[0].replaceTrack(this.mixedAudioTrack_);case 12:e.next=16;break;case 14:return e.next=16,a[0].replaceTrack(t);case 16:if(t.kind!==Vk){e.next=32;break}if(i!==this.localStream_||!a[1]){e.next=29;break}return e.next=20,a[1].replaceTrack(t);case 20:if(!this.smallGenerator_||!a[2]){e.next=29;break}return this.log_.info("replacing smallVideo"),this.smallGenerator_.destroy(),this.smallGenerator_=new kq(this.localStream_),e.next=26,this.smallGenerator_.initialize();case 26:return d=this.smallGenerator_.generateSmallVideoTrack(this.client_.smallStreamConfig_),e.next=29,a[2].replaceTrack(d);case 29:if(i!==this.localAuxStream_||!a[3]){e.next=32;break}return e.next=32,a[3].replaceTrack(t);case 32:oM(this.userId_,{eventId:t.kind===Uk?UD:LD,eventDesc:"replace ".concat(t.kind," track from current published stream"),timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_});case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"updateOffer",value:(f=a(n().mark((function e(t,i){var r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.peerConnection_.createOffer(tK);case 3:return r=e.sent,tC&&(r.sdp=this.setSDPDirection(r.sdp,"sendrecv")),e.next=7,this.peerConnection_.setLocalDescription(r);case 7:return a=this.updateMediaSettings(this.localStream_||this.localAuxStream_),o={action:t,trackId:i.id,kind:i.kind===Vk?"bigVideo":i.kind,type:"offer",sdp:this.peerConnection_.localDescription.sdp,constraintConfig:a,state:this.publishState},this.log_.info("createOffer success, sending updated offer to remote server"),this.log_.debug("updatedOffer: "+o.sdp),e.next=13,this.signalChannel_.sendWaitForResponse({command:tD,data:o,responseCommand:eD.UPDATE_OFFER_RESULT,timeout:1e4,commandDesc:"update offer"});case 13:return s=e.sent,c=s.data,u=c.code,d=c.message,0!==u&&this.checkPublishResultCode(u,d),e.next=18,this.acceptAnswer(s.data.data);case 18:this.updateSSRC(r.sdp),lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:vI,kind:"offer"}),e.next=27;break;case 22:throw e.prev=22,e.t0=e.catch(0),this.log_.error(e.t0),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:vI,kind:"offer",error:e.t0}),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return f.apply(this,arguments)})},{key:"setBandwidth",value:(p=a(n().mark((function e(t){var i,r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.bandwidth,r=t.type,a=t.videoType,o=void 0===a?"":a,s=t.sdp,EO()||!s){e.next=3;break}return e.abrupt("return",r===Vk?this.updateVideoBandwidthRestriction(s,i,o):this.updateAudioBandwidthRestriction(s,i));case 3:if(c=0,r===Vk&&(c=o===jk?2:o===Hk?3:1),!(u=this.peerConnection_.getSenders()[c])){e.next=22;break}return(d=u.getParameters()).encodings&&0!==d.encodings.length||(d.encodings=[{}]),"unlimited"===i?delete d.encodings[0].maxBitrate:d.encodings[0].maxBitrate=1e3*i,e.prev=10,e.next=13,u.setParameters(d);case 13:return this.log_.info(o+r+" bandwidth was set to "+i+" kbps"),e.abrupt("return",s);case 17:if(e.prev=17,e.t0=e.catch(10),this.log_.info("failed to set bandwidth by setting maxBitrate: "+e.t0),!s){e.next=22;break}return e.abrupt("return",r===Vk?this.updateVideoBandwidthRestriction(s,i,o):this.updateAudioBandwidthRestriction(s,i));case 22:return e.abrupt("return",s);case 23:case"end":return e.stop()}}),e,this,[[10,17]])}))),function(e){return p.apply(this,arguments)})},{key:"updateVideoBandwidthRestriction",value:function(e,t,n){var i="AS";tC&&(i="TIAS",t*=1e3);var r=0,a=-1;return n===jk?r=1:n===Hk&&(r=2),e=e.replace(/m=video (.*)\r\nc=IN (.*)\r\n/g,(function(e){return++a===r?"".concat(e,"b=").concat(i,":").concat(t,"\r\n"):e})),e}},{key:"updateAudioBandwidthRestriction",value:function(e,t){var n="AS";return tC&&(n="TIAS",t*=1e3),e=e.replace(/m=audio (.*)\r\nc=IN (.*)\r\n/,"m=audio $1\r\nc=IN $2\r\nb="+n+":"+t+"\r\n")}},{key:"removeBandwidthRestriction",value:function(e){return e.replace(/b=AS:.*\r\n/,"").replace(/b=TIAS:.*\r\n/,"")}},{key:"removeVideoOrientation",value:function(e){return e.replace(/urn:3gpp:video-orientation/,"")}},{key:"connect",value:(h=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.exchangeSDP();case 3:return e.next=5,this.waitForPeerConnectionConnected();case 5:e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),this.closePeerConnection(!0),e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return h.apply(this,arguments)})},{key:"exchangeSDP",value:(u=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.isSDPExchanging_=!0,e.next=4,this.createOffer();case 4:return this.log_.info("createOffer success, sending offer to remote server"),e.next=7,this.doExchangeSDP();case 7:this.isSDPExchanging_=!1,e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(0),this.isSDPExchanging_=!1,e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return u.apply(this,arguments)})},{key:"createOffer",value:(s=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.peerConnection_.createOffer(tK);case 3:return t=e.sent,e.next=6,this.peerConnection_.setLocalDescription(t);case 6:this.updateSSRC(t.sdp),lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:vI,kind:"offer"}),e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(0),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:vI,kind:"offer",error:e.t0}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return s.apply(this,arguments)})},{key:"doExchangeSDP",value:function(){var e=this;return new Promise((function(t,i){e.exchangeSDPTimeout_=setTimeout((function(){e.signalChannel_.off(eD.PUBLISH_RESULT,r),e.clearExchangeSDPTimeout();var t=new kD({code:bD.API_CALL_TIMEOUT,message:sA({key:HE})});i(t)}),1e4);var r=function(){var r=a(n().mark((function r(a){var o,s,c;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,e.clearExchangeSDPTimeout(),o=a.data,s=o.code,c=o.message,0!==s){n.next=9;break}return n.next=6,e.acceptAnswer(a.data.data);case 6:t(),n.next=10;break;case 9:e.checkPublishResultCode(s,c);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(0),i(n.t0);case 15:case"end":return n.stop()}}),r,null,[[0,12]])})));return function(e){return r.apply(this,arguments)}}(),o={type:e.peerConnection_.localDescription.type,sdp:e.removeVideoOrientation(e.peerConnection_.localDescription.sdp),screen:(e.publishingStream_||e.localStream_).hasScreenTrack(),state:e.publishState,constraintConfig:e.mediaSettings_};e.signalChannel_.once(eD.PUBLISH_RESULT,r),e.log_.debug("sending sdp offer: "+o.sdp),e.signalChannel_.send(sD,o)}))}},{key:"setSDPDirection",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",i=xM(e);return i.media.forEach((function(e){"all"!==n&&e.type!==n||(e.direction=t)})),PM(i)}},{key:"acceptAnswer",value:(r=a(n().mark((function e(t){var i,r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=this.removeVideoOrientation(t.sdp),!(r=this.publishingStream_||this.localStream_)){e.next=15;break}if(a=r.getVideoBitrate(),o=r.getAudioBitrate(),!a){e.next=11;break}return s=this.isPublishingAuxStream_?Hk:Bk,e.next=10,this.setBandwidth({bandwidth:a,type:Vk,sdp:i,videoType:s});case 10:i=e.sent;case 11:if(!o){e.next=15;break}return e.next=14,this.setBandwidth({bandwidth:o,type:Uk,sdp:i});case 14:i=e.sent;case 15:if(!this.client_.getIsEnableSmallStream()){e.next=20;break}return c=this.client_.smallStreamConfig,e.next=19,this.setBandwidth({bandwidth:c.bitrate,type:Vk,videoType:jk,sdp:i});case 19:i=e.sent;case 20:return u={type:t.type,sdp:i},e.next=23,this.peerConnection_.setRemoteDescription(u);case 23:this.frameCodec_&&this.frameCodec_.handleEncodedStreams(),this.log_.debug("accepted answer: "+i),lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:_I,kind:"answer"}),e.next=33;break;case 28:throw e.prev=28,e.t0=e.catch(0),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:_I,kind:"answer",error:e.t0}),this.log_.error("failed to accept remote answer "+e.t0),e.t0;case 33:case"end":return e.stop()}}),e,this,[[0,28]])}))),function(e){return r.apply(this,arguments)})},{key:"sendMutedFlag",value:function(e,t){if(t!==this.localAuxStream_){var n={audio:e.audio,bigVideo:e.video,auxVideo:e.auxVideo};this.log_.info("send muted state: ".concat(JSON.stringify(n))),this.signalChannel_.send(oD,n)}}},{key:"getIsReconnecting",value:function(){return this.isReconnecting_}},{key:"reconnect",value:(i=a(n().mark((function e(){var t,i,r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(-1===this.reconnectionTimer_){e.next=3;break}return this.log_.warn("reconnect() uplink is reconnecting, ignore current reconnection"),e.abrupt("return");case 3:if(!(this.reconnectionCount_>=30)){e.next=12;break}return this.log_.warn("SDK has tried reconnect uplink for ".concat(30," times, but all failed, please check your network")),this.stopReconnection(),t=new kD({code:bD.UPLINK_RECONNECTION_FAILED,message:sA({key:WE})}),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:pI,error:t}),this.addEventInternal(ZD,"uplink-connection reconnect fail"),this.emitConnectionStateChangedEvent(zT),this.emitter_.emit(jO.ERROR,t),e.abrupt("return");case 12:if(this.signalChannel_.getCurrentState()===$P){e.next=16;break}return this.log_.warn("reconnect() signal channel is not connected, suspend reconnection until signal is connected"),this.signalChannel_.once(JP,this.reconnect,this),e.abrupt("return");case 16:if(this.reconnectionCount_++,e.prev=17,this.log_.warn("reconnect() try to reconnect uplink [".concat(this.reconnectionCount_,"/").concat(30,"]")),i=fA(this.reconnectionCount_),this.reconnectionTimer_=setTimeout((function(){r.log_.warn("reconnect() uplink reconnect timeout(".concat(i/1e3,"s), try again")),r.clearReconnectionTimer(),r.reconnect()}),i),!(this.isSDPExchanging_||this.peerConnection_&&this.peerConnection_.connectionState===QT)){e.next=23;break}return e.abrupt("return");case 23:return e.next=25,this.signalChannel_.sendWaitForResponse({command:cD,responseCommand:eD.UNPUBLISH_RESULT,enableLog:!1});case 25:if(this.reset(),this.initialize(),!this.localStream_){e.next=30;break}return e.next=30,this.publish(this.localStream_);case 30:if(!this.localAuxStream_){e.next=33;break}return e.next=33,this.publish(this.localAuxStream_,!0);case 33:lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:pI}),this.log_.warn("reconnect() uplink reconnect successfully"),this.addEventInternal(YD,"uplink-connection reconnect success"),this.stopReconnection(),this.localStream_.syncMuteState(),e.next=42;break;case 40:e.prev=40,e.t0=e.catch(17);case 42:case"end":return e.stop()}}),e,this,[[17,40]])}))),function(){return i.apply(this,arguments)})},{key:"clearExchangeSDPTimeout",value:function(){-1!==this.exchangeSDPTimeout_&&(clearTimeout(this.exchangeSDPTimeout_),this.exchangeSDPTimeout_=-1)}},{key:"clearReconnectionTimer",value:function(){-1!==this.reconnectionTimer_&&(clearTimeout(this.reconnectionTimer_),this.reconnectionTimer_=-1)}},{key:"handleError",value:function(e){e.getCode()===bD.ICE_TRANSPORT_ERROR&&(this.isFirstConnection_&&(this.isFirstConnection_=!1,lM.logFailedEvent({userId:this.client_.getUserId(),eventType:hI,error:e})),this.isReconnecting_||this.startReconnection())}},{key:"handleConnectionStateChange",value:function(e){e.state===qT&&this.isFirstConnection_&&(this.isFirstConnection_=!1,lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:hI}),this.addEventInternal(JD,"uplink-connection is connected"))}},{key:"updateSSRC",value:function(e){var t=this;try{xM(e).media.forEach((function(e,n){if(e.type===Uk){var i=e.ssrcs[0];i&&(t.ssrc_.audio=i.id)}else{if(t.sdpSemantics_===PI)return void e.ssrcGroups.forEach((function(e,n){var i=Number(e.ssrcs.split(" ")[0]);0===n?t.ssrc_.video=i:1===n&&(t.ssrc_.small=i)}));var r=e.ssrcs[0];if(!r)return;switch(n){case 1:t.ssrc_.video=r.id;break;case 2:t.ssrc_.small=r.id;break;case 3:t.ssrc_.auxiliary=r.id}}}))}catch(IQ){}}},{key:"getVideoTrackId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vk;if(this.peerConnection_){var t=this.peerConnection_.getSenders();if(e===Vk&&t[1]&&t[1].track)return t[1].track.id;if(e===jk&&t[2]&&t[2].track)return t[2].track.id;if(e===Hk&&t[3]&&t[3].track)return t[3].track.id}if(this.localStream_&&e===Vk){var n=this.localStream_.getVideoTrack();if(n)return n.id}if(this.localAuxStream_&&e===Hk){var i=this.localAuxStream_.getVideoTrack();if(i)return i.id}return""}},{key:"getSSRC",value:function(){return this.ssrc_}},{key:"checkPublishResultCode",value:function(e,t){if(0!==e)throw 1028===e?(this.log_.error(UR.NOT_SUPPORTED_H264ENCODE),new kD({code:bD.NOT_SUPPORTED_H264,message:sA({key:pR})})):new kD({code:bD.UNKNOWN,message:sA({key:bR,data:{signalResponse:eD.PUBLISH_RESULT,code:e,message:t}})})}},{key:"getLocalStream",value:function(){return this.localStream_}},{key:"sendSEI",value:function(e,t){this.frameCodec_.addSEIMessage(e,t)}},{key:"mixAudioTrack",value:function(e,t){this.log_.info("mix audio track"),this.mixedAudioTrack_=function(e){var t=PA(),n=t.createMediaStreamDestination(),i=[];e.forEach((function(e){var r=new MediaStream;r.addTrack(e);var a=t.createMediaStreamSource(r);a.connect(n),i.push(a)}));var r=n.stream.getAudioTracks()[0];return Tq.set(r,{destination:n,track:r,mediaStreamSourceList:i}),r}([e,t])}},{key:"destroyMixedAudioTrack",value:function(){this.mixedAudioTrack_&&(this.log_.info("destroy audio track"),function(e){if(Tq.has(e)){var t=Tq.get(e),n=t.destination,i=t.track,r=t.mediaStreamSourceList;i.stop(),n.disconnect(),r.forEach((function(e){e.disconnect()})),Tq.delete(e)}}(this.mixedAudioTrack_),this.mixedAudioTrack_=null)}}]),P}(jJ),C(zq.prototype,"publish",[Gq],Object.getOwnPropertyDescriptor(zq.prototype,"publish"),zq.prototype),zq),iK=new WeakMap;function rK(){return function(e,n,i){var r=i.value,a=function e(n){var i=n.fn,r=n.args,a=n.context,o=n.resolve,s=n.reject;i.apply(a,r).then(o,s).finally((function(){var n=iK.get(a);n&&(n.shift(),n[0]&&e(t({},n[0])))}))};return i.value=function(){for(var e=this,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return new Promise((function(t,o){if(iK.has(e)){var s=iK.get(e),c=s.length;s.push({fn:r,args:i,context:e,resolve:t,reject:o,name:n}),0===c&&a({fn:r,args:i,context:e,resolve:t,reject:o})}else iK.set(e,[{fn:r,args:i,context:e,resolve:t,reject:o,name:n}]),a({fn:r,args:i,context:e,resolve:t,reject:o})}))},i}}var aK=(Wq=rK(),Jq=aq({retries:1,timeout:0,onRetrying:function(e){this.log_.warn("connection timeout, retrying [".concat(e,"]"))},onError:function(e,t,n){e.message.includes("timeout")?t():n(e)}}),qq=rK(),Kq=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return function(t,n,i){var r=i.value;return i.value=function(){for(var t=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return new Promise((function(i,o){var s=setTimeout((function(){return o(new Error("".concat(n," timeout")))}),e);r.apply(t,a).then(i,o).finally((function(){clearTimeout(s)}))}))},i}}(),Qq=function(e){d(_,e);var r,s,u,h,p,f,m,v=g(_);function _(e){var t;return o(this,_),(t=v.call(this,e)).remoteStreams_=new Map,t.autoSubscribe=e.autoSubscribe,t.trackState_={audio:e.trackState.audio,video:e.trackState.video,auxiliary:e.trackState.auxiliary,smallVideo:e.trackState.smallVideo},t.ssrc_={audio:0,video:0,auxiliary:0},t.subscribeState_={audio:e.autoSubscribe,video:e.autoSubscribe,auxiliary:e.autoSubscribe,smallVideo:!1},t.isSDPExchanging_=!1,t.installEvents(),t}return c(_,[{key:"getMixUserList",value:function(){return this.mixUserList_?this.mixUserList_.map((function(e){var t=e.userId,n=e.flag;return{userId:t,hasAudio:!!(8&n),hasVideo:!!(1&n),hasAuxiliary:!!(4&n)}})):void 0}},{key:"setMixUserList",value:function(e){(!this.mixUserList_||bA(this.mixUserList_)&&!function(e,t){if(t.length===e.length){var n,r=w(t);try{var a=function(){var t=n.value,i=e.find((function(e){return e.userId===t.userId}));if(!i||i.flag!==t.flag)return{v:!1}};for(r.s();!(n=r.n()).done;){var o=a();if("object"===i(o))return o.v}}catch(s){r.e(s)}finally{r.f()}return!0}return!1}(this.mixUserList_,e))&&(this.mixUserList_=e,this.emitter_.emit(jO.STREAM_UPDATED,{stream:this.getMainStream()}))}},{key:"isMainStreamSubscribed",get:function(){return(this.subscribeState_.audio||this.subscribeState_.video||this.subscribeState_.smallVideo)&&(this.trackState_.audio||this.trackState_.video||this.trackState_.smallVideo)}},{key:"isAuxStreamSubscribed",get:function(){return this.subscribeState_.auxiliary&&this.trackState_.auxiliary}},{key:"isSmallStreamSubscribed",get:function(){return this.subscribeState_.smallVideo&&this.trackState_.smallVideo}},{key:"isBigStreamSubscribed",get:function(){return this.subscribeState_.video&&this.trackState_.video}},{key:"isStreamUnpublished",value:function(e){return e.getType()===rT?!this.trackState_.audio&&!this.trackState_.video:!this.trackState_.auxiliary}},{key:"initialize",value:function(){S(l(_.prototype),"initialize",this).call(this),this.peerConnection_.ontrack=this.onTrack.bind(this)}},{key:"close",value:function(){var e,t,n,i=this;S(l(_.prototype),"close",this).call(this),this.trackState_.audio=!1,this.trackState_.video=!1,this.trackState_.smallVideo=!1,this.trackState_.auxiliary=!1,this.emitConnectionStateChangedEvent(zT),e=this,t=function(e){e.fn;var t=e.args,n=e.resolve,r=e.reject,a=e.name;if("subscribe"===a){if(!i.client_.getIsJoined())return r(new kD({code:bD.API_CALL_ABORTED,message:sA({key:OR,data:{message:"leave room",stream:t[0]}})}));if(i.isStreamUnpublished(t[0]))return r(new kD({code:bD.API_CALL_ABORTED,message:sA({key:OR,data:{message:"remote user ".concat(i.userId_," unpublished stream"),stream:t[0]}})}))}else if("unsubscribe"===a)return n();n()},null===(n=iK.get(e))||void 0===n||n.forEach(t),iK.delete(e),this.remoteStreams_.forEach((function(e){var t=e;t.setConnection(null),t.uninstallEvents(),t.getIsStreamAddedEventEmitted()&&i.emitter_.emit(jO.STREAM_REMOVED,{stream:t})})),this.remoteStreams_.clear(),this.uninstallEvents()}},{key:"installEvents",value:function(){var e=this;jA.on(cx,this.onRemoteStreamUpdate,this),this.emitter_.on(jO.ERROR,(function(t){t.getCode()===bD.ICE_TRANSPORT_ERROR&&(e.isFirstConnection_&&(e.isFirstConnection_=!1,lM.logFailedEvent({userId:e.client_.getUserId(),eventType:fI,error:t})),e.isReconnecting_||e.startReconnection())})),this.emitter_.on(jO.CONNECTION_STATE_CHANGED,(function(t){t.state===qT&&e.isFirstConnection_&&(e.isFirstConnection_=!1,lM.logSuccessEvent({userId:e.client_.getUserId(),eventType:fI}),e.addEventInternal(qD,"downlink-connection is connected"))}))}},{key:"uninstallEvents",value:function(){jA.removeListener(cx,this.onRemoteStreamUpdate,this)}},{key:"onRemoteStreamUpdate",value:function(e){if(this.hitTest(e.tinyId)&&e.client===this.client_){this.updateTrackState(e.action,e.kind);var t=e.kind===Hk?FT:VT,n=this.remoteStreams_.get(t);if(!n)return;e.action===jI.ADD?this.handleRemoteAddTrack(e.kind,n):this.handleRemoteRemoveTrack(e.kind,n)}}},{key:"handleRemoteAddTrack",value:function(e,t){this.log_.info("remote add ".concat(e," track")),e===Uk?t.updateAudioPlayingState(this.subscribeState_.audio):t.updateVideoPlayingState(e===Hk?this.subscribeState_.auxiliary:this.subscribeState_.video||this.subscribeState_.smallVideo),t.getIsStreamAddedEventEmitted()?this.emitter_.emit(jO.STREAM_UPDATED,{stream:t}):(this.emitter_.emit(jO.STREAM_ADDED,{stream:t}),this.currentState_===qT&&t.emitConnectionStateChanged({prevState:zT,state:qT}))}},{key:"handleRemoteRemoveTrack",value:function(e,t){t.getIsStreamAddedEventEmitted()&&(this.log_.info("remote remove ".concat(e," track")),e===Hk||!this.trackState_.audio&&!this.trackState_.video?(this.log_.info("remote stream ".concat(t.getType()," removed")),this.currentState_===qT&&t.emitConnectionStateChanged({prevState:qT,state:zT}),this.emitter_.emit(jO.STREAM_REMOVED,{stream:t})):(e===Uk?t.updateAudioPlayingState(!1):(e!==zk||this.isSmallStreamSubscribed)&&t.updateVideoPlayingState(!1),this.emitter_.emit(jO.STREAM_UPDATED,{stream:t})))}},{key:"updateTrackState",value:function(e,t){var n=e===jI.ADD;switch(t){case Uk:this.trackState_.audio=n;break;case Vk:this.trackState_.video=n;break;case Hk:this.trackState_.auxiliary=n;break;case zk:this.trackState_.smallVideo=n}this.log_.info("trackState updated: ".concat(JSON.stringify(this.trackState_)))}},{key:"onTrack",value:function(e){var t=e.streams[0],n=e.track;if(this.log_.info("ontrack() kind: ".concat(n.kind," id: ").concat(n.id," streamId: ").concat(t.id)),this.sdpSemantics_===xI){var i=function(e){var t=gM.parse(e),n={audio:[],video:[]};return t.media.forEach((function(e){if(e.ssrcs){var t=e.ssrcs[0].id>>16&255;if(e.type===Uk)n.audio.push(VT);else if(e.type==Vk){var i=t===jT?VT:FT;n.video.push(i)}}})),n}(this.peerConnection_.remoteDescription.sdp);if(n.kind===Uk){if(0===i.audio.length||t.id!==VT)return void this.log_.debug("skip this invalid audio track")}else if(-1===i.video.indexOf(t.id))return void this.log_.debug("skip this invalid video track: ".concat(n.id," msid: ").concat(t.id))}lM.logEvent({eventType:"ontrack",kind:n.kind});var r=!1,a=this.remoteStreams_.get(t.id),o=t.id===VT?BT:HT;if(vA(a)&&((a=new _q({type:o,userId:this.userId_,client:this.client_})).setConnection(this),this.remoteStreams_.set(t.id,a),r=!0),a.setMediaStream(t),n.kind===Uk?a.updateAudioPlayingState(this.subscribeState_.audio):o===BT?a.updateVideoPlayingState(this.subscribeState_.video||this.subscribeState_.smallVideo):a.updateVideoPlayingState(this.subscribeState_.auxiliary),(o!==HT||this.trackState_.auxiliary)&&(o!==BT||this.trackState_.audio||this.trackState_.video)){var s=this.client_.getSubscriptionManager();s&&s.hasAutoRecoveryFlag(this.userId_,o)||(r?this.emitter_.emit(jO.STREAM_ADDED,{stream:a}):this.emitter_.emit(jO.STREAM_UPDATED,{stream:a}))}}},{key:"addRRTRLine",value:function(e){var t=e.split("\r\n"),n=new Map;t.forEach((function(e,i){/^a=rtcp-fb:/.test(e)&&t[i+1]&&!/^a=rtcp-fb:/.test(t[i+1])&&e.match(/^a=rtcp-fb:\d+/)&&n.set(i+1,e.match(/^a=rtcp-fb:\d+/)[0]+" rrtr")}));for(var i=T(n),r=0;r<i.length;r++){var a=k(i[r],2),o=a[0],s=a[1];t.splice(o+r,0,s)}return t.join("\r\n")}},{key:"addSPSDescription",value:function(e){var t=xM(e);return t.media.forEach((function(e){e.type===Vk&&e.fmtp.forEach((function(e){e.config+=";sps-pps-idr-in-keyframe=1"}))})),PM(t)}},{key:"removeSDESDescription",value:function(e){var t=["urn:ietf:params:rtp-hdrext:sdes:mid","urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id","urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"],n=xM(e);return n.media.forEach((function(e){e.ext=e.ext.filter((function(e){return!t.includes(e.uri)}))})),PM(n)}},{key:"isSubscriptionStateNotChanged",value:function(e,t){return e.getType()===BT?(null==t?void 0:t.audio)===this.subscribeState_.audio&&(null==t?void 0:t.video)===this.subscribeState_.video&&this.isSubscribeSmall(t):e.getType()===HT?!vA(t.video)&&this.subscribeState_.auxiliary===t.video:void 0}},{key:"isSubscribeSmall",value:function(e){return vA(e.smallVideo)&&!this.subscribeState_.smallVideo}},{key:"subscribe",value:(m=a(n().mark((function e(t,i){var r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=i.emitEvent,s=void 0===o||o,c=t.getType(),(null===(r=this.peerConnection_)||void 0===r?void 0:r.connectionState)!==KT&&(null===(a=this.peerConnection_)||void 0===a?void 0:a.connectionState)!==QT){e.next=6;break}return e.next=6,this.waitForPeerConnectionConnected();case 6:if(!this.isSubscriptionStateNotChanged(t,i)){e.next=13;break}if(this.peerConnection_){e.next=11;break}return this.initialize(),e.next=11,this.connect();case 11:return s&&vA(i.smallVideo)&&this.emitter_.emit(jO.STREAM_SUBSCRIBED,{stream:t,result:!0}),e.abrupt("return",t);case 13:if(c===rT?(vA(i.audio)||(this.subscribeState_.audio=i.audio),vA(i.video)||(this.subscribeState_.video=i.video),this.subscribeState_.smallVideo=(null==i?void 0:i.smallVideo)||!1,this.addEventInternal(this.subscribeState_.audio?PD:MD,this.subscribeState_.audio?"subscribe audio":"unsubscribe audio"),this.addEventInternal(this.subscribeState_.video?PD:MD,this.subscribeState_.video?"subscribe video":"unsubscribe video"),this.addEventInternal(this.subscribeState_.smallVideo?iM:rM,this.subscribeState_.smallVideo?"subscribe smallVideo":"unsubscribe smallVideo")):vA(i.video)||(this.subscribeState_.auxiliary=i.video),this.log_.info("subscribe ".concat(c," stream with options ").concat(JSON.stringify(i)," current state: ").concat(JSON.stringify(this.subscribeState_))),!this.peerConnection_&&!this.isSDPExchanging_){e.next=23;break}return u=AI,this.isMainStreamSubscribed||this.isAuxStreamSubscribed||(u=CI),e.next=20,this.sendSubscription(u);case 20:c===rT?(t.updateAudioPlayingState(this.subscribeState_.audio),t.updateVideoPlayingState(this.subscribeState_.video||this.subscribeState_.smallVideo)):t.updateVideoPlayingState(this.subscribeState_.auxiliary),e.next=26;break;case 23:return this.initialize(),e.next=26,this.connect();case 26:return s&&this.emitter_.emit(jO.STREAM_SUBSCRIBED,{stream:t,result:!0}),e.abrupt("return",t);case 30:if(e.prev=30,e.t0=e.catch(0),!this.client_.getIsJoined()||!this.isStreamUnpublished(t)){e.next=35;break}throw this.log_.warn("".concat(e.t0.message," ").concat(JSON.stringify(this.trackState_))),new kD({code:bD.REMOTE_STREAM_NOT_EXIST,message:"remote user ".concat(this.userId_," unpublished stream")});case 35:throw e.t0;case 36:case"end":return e.stop()}}),e,this,[[0,30]])}))),function(e,t){return m.apply(this,arguments)})},{key:"unsubscribe",value:(f=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((i=t.getType())!==rT){e.next=10;break}if(this.isMainStreamSubscribed){e.next=5;break}return this.log_.info("main stream already unsubscribed"),e.abrupt("return",t);case 5:this.subscribeState_.audio=!1,this.subscribeState_.video=!1,this.subscribeState_.smallVideo=!1,e.next=14;break;case 10:if(this.isAuxStreamSubscribed){e.next=13;break}return this.log_.info("auxiliary stream already unsubscribed"),e.abrupt("return",t);case 13:this.subscribeState_.auxiliary=!1;case 14:return r=CI,(i===BT&&this.isAuxStreamSubscribed||i===HT&&this.isMainStreamSubscribed)&&(r=AI),this.log_.info("unsubscribe ".concat(i," stream with ").concat(JSON.stringify(this.subscribeState_))),e.next=19,this.sendSubscription(r);case 19:return t.updateVideoPlayingState(!1),t.updateAudioPlayingState(!1),r===CI&&((a=t.getMediaStream())&&a.getTracks().forEach((function(e){return a.removeTrack(e)})),this.closePeerConnection(),this.emitConnectionStateChangedEvent(zT)),this.addEventInternal(MD,"unsubscribe audio"),this.addEventInternal(DD,"unsubscribe video"),e.abrupt("return",t);case 25:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"sendSubscription",value:function(e){var t=this,n={srcTinyId:this.tinyId_,srcUserId:this.userId_},i=dD,r=eD.UNSUBSCRIBE_RESULT;return e===AI&&(n={audio:this.subscribeState_.audio,bigVideo:this.subscribeState_.video,auxVideo:this.subscribeState_.auxiliary,smallVideo:this.subscribeState_.smallVideo,srcTinyId:this.tinyId_},i=lD,r=eD.SUBSCRIBE_CHANGE_RESULT),this.signalChannel_.sendWaitForResponse({command:i,data:n,responseCommand:r,timeout:1e4}).then((function(n){var i=n.data;if(0!==i.code){var r=new kD({code:i.code,message:sA({key:BE,data:{type:e,message:i.message}})});throw t.log_.error(r),r}}))}},{key:"connect",value:(p=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.exchangeSDP();case 3:return e.next=5,this.waitForPeerConnectionConnected();case 5:e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),this.closePeerConnection(!0),e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return p.apply(this,arguments)})},{key:"exchangeSDP",value:(h=a(n().mark((function e(){var t,i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.isSDPExchanging_=!0,e.next=4,this.createOffer();case 4:return this.log_.info("createOffer success, sending offer to remote server"),t=this.peerConnection_.localDescription,i=t.type,r=t.sdp,a={type:i,sdp:r,srcUserId:this.userId_,srcTinyId:this.tinyId_,audio:this.subscribeState_.audio,bigVideo:this.subscribeState_.video,auxVideo:this.subscribeState_.auxiliary,smallVideo:this.subscribeState_.smallVideo},jA.emit(Cx,{client:this.client_,connection:this,userId:this.userId_,tinyId:this.tinyId_,role:OT,subscribeState:this.subscribeState_,trackState:this.trackState_}),e.next=10,this.signalChannel_.sendWaitForResponse({command:uD,commandDesc:"exchange sdp",data:a,responseCommand:eD.SUBSCRIBE_RESULT,timeout:1e4});case 10:if(o=e.sent,this.peerConnection_){e.next=15;break}throw s=new kD({code:bD.INVALID_OPERATION,message:sA({key:IR})}),this.log_.warn(s),s;case 15:return e.next=17,this.onSubscribeResult(o);case 17:this.isSDPExchanging_=!1,e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(0),this.isSDPExchanging_=!1,e.t0;case 24:case"end":return e.stop()}}),e,this,[[0,20]])}))),function(){return h.apply(this,arguments)})},{key:"createOffer",value:(u=a(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={voiceActivityDetection:!1},TO()&&this.sdpSemantics_===xI?(this.peerConnection_.addTransceiver(Uk,{direction:"recvonly"}),this.peerConnection_.addTransceiver(Vk,{direction:"recvonly"}),this.peerConnection_.addTransceiver(Vk,{direction:"recvonly"})):(t.offerToReceiveAudio=!0,t.offerToReceiveVideo=!0),e.next=4,this.peerConnection_.createOffer(t);case 4:return i=e.sent,e.next=7,fO();case 7:return e.sent.isH264DecodeSupported||(this.log_.warn("remove h264 desc from sdp"),i.sdp=MM(i.sdp)),i.sdp=this.addRRTRLine(i.sdp),i.sdp=this.addSPSDescription(i.sdp),i.sdp=DM(i.sdp),this.sdpSemantics_===xI&&(i.sdp=this.removeSDESDescription(i.sdp)),e.next=16,this.peerConnection_.setLocalDescription(i);case 16:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"onSubscribeResult",value:(s=a(n().mark((function e(i){var r,a,o,s,c,u,d,l=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i&&i.data||{},a=r.code,o=r.message,s=void 0===o?"":o,c=i&&i.data&&i.data.data||{},u=c.type,d=c.sdp,77393!==a){e.next=5;break}throw this.log_.error(UR.NOT_SUPPORTED_H264DECODE),new kD({code:bD.NOT_SUPPORTED_H264,message:sA({key:fR})});case 5:if(e.prev=5,0===a){e.next=8;break}throw new kD({code:a,message:sA({key:zE,data:{errMsg:s}})});case 8:return this.log_.debug("accept remote answer: "+d),e.next=11,this.peerConnection_.setRemoteDescription({type:u,sdp:d});case 11:this.frameCodec_&&(this.frameCodec_.handleEncodedStreams(),this.frameCodec_.onSEIMessage=function(e){l.emitter_.emit(jO.SEI_MESSAGE,t(t({},e),{},{userId:l.userId_}))}),this.updateSSRC(d),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(5),this.log_.error(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[5,15]])}))),function(e){return s.apply(this,arguments)})},{key:"updateSSRC",value:function(e){var t=this;try{xM(e).media.forEach((function(e){if(e.type===Uk){var n=e.ssrcs.find((function(e){return e.value.includes(VT)}));n&&(t.ssrc_.audio=n.id)}else{var i=e.ssrcs.find((function(e){return e.value.includes(VT)})),r=e.ssrcs.find((function(e){return e.value.includes(FT)}));i&&(t.ssrc_.video=i.id),r&&(t.ssrc_.auxiliary=r.id)}}))}catch(IQ){}}},{key:"setRemoteStream",value:function(e,t){this.remoteStreams_.set(e,t)}},{key:"getSubscribeState",value:function(){return this.subscribeState_}},{key:"getTrackState",value:function(){return this.trackState_}},{key:"getSSRC",value:function(){return this.ssrc_}},{key:"getMainStream",value:function(){return this.remoteStreams_.get(VT)}},{key:"getAuxStream",value:function(){return this.remoteStreams_.get(FT)}},{key:"getMainStreamVideoTrackId",value:function(){var e=this.getMainStream();if(e){var t=e.getVideoTrack();if(t)return t.id}return""}},{key:"getAuxStreamVideoTrackId",value:function(){var e=this.getAuxStream();if(e){var t=e.getVideoTrack();if(t)return t.id}return""}},{key:"reconnect",value:(r=a(n().mark((function e(){var t,i,r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(-1===this.reconnectionTimer_){e.next=3;break}return this.log_.warn("reconnect() downlink is reconnecting, ignore current reconnection"),e.abrupt("return");case 3:if(!(this.reconnectionCount_>=30)){e.next=12;break}return this.log_.warn("SDK has tried reconnect downlink [".concat(this.userId_,"] for ").concat(30," times, but all failed, please check your network")),this.stopReconnection(),t=new kD({code:bD.DOWNLINK_RECONNECTION_FAILED,message:sA({key:GE})}),lM.logFailedEvent({userId:this.client_.getUserId(),eventType:mI,error:t}),this.addEventInternal(nM,"downlink-connection reconnect fail"),this.emitConnectionStateChangedEvent(zT),this.emitter_.emit(jO.ERROR,t),e.abrupt("return");case 12:if(this.signalChannel_.getCurrentState()===$P){e.next=16;break}return this.log_.warn("reconnect() signal channel is not connected, suspend reconnection until signal is connected"),this.signalChannel_.once(JP,this.reconnect,this),e.abrupt("return");case 16:if(this.reconnectionCount_++,this.log_.warn("reconnect() try to reconnect downlink [".concat(this.reconnectionCount_,"/").concat(30,"]")),i=fA(this.reconnectionCount_),this.reconnectionTimer_=setTimeout((function(){r.log_.warn("reconnect() downlink [".concat(r.userId_,"] reconnect timeout(").concat(i/1e3,"s), try again")),r.clearReconnectionTimer(),r.reconnect()}),i),!(this.isSDPExchanging_||this.peerConnection_&&this.peerConnection_.connectionState===QT)){e.next=22;break}return e.abrupt("return");case 22:return e.prev=22,this.closePeerConnection(),this.initialize(),e.next=27,this.connect();case 27:this.stopReconnection(),this.log_.warn("reconnect() downlink reconnect successfully"),lM.logSuccessEvent({userId:this.client_.getUserId(),eventType:mI}),this.addEventInternal(tM,"downlink-connection reconnect success"),this.recoverSubscription(),e.next=36;break;case 34:e.prev=34,e.t0=e.catch(22);case 36:case"end":return e.stop()}}),e,this,[[22,34]])}))),function(){return r.apply(this,arguments)})},{key:"recoverSubscription",value:function(){var e=this,t=this.client_.getSubscriptionManager();t&&T(this.remoteStreams_.values()).forEach((function(n){t.hasAutoRecoveryFlag(e.userId_,n.getType())&&t.recover(n)}))}},{key:"getIsReconnecting",value:function(){return this.isReconnecting_}},{key:"getSubscribedMainStream",value:function(){var e=null;return this.isMainStreamSubscribed&&(e=this.remoteStreams_.get(VT)),e}},{key:"clearReconnectionTimer",value:function(){-1!==this.reconnectionTimer_&&(clearTimeout(this.reconnectionTimer_),this.reconnectionTimer_=-1)}},{key:"startReconnection",value:function(){var e=this.client_.getSubscriptionManager();if(e){var t,n=w(this.remoteStreams_.values());try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.getType();(r===BT&&(this.trackState_.audio||this.trackState_.video)||r===HT&&this.trackState_.auxiliary)&&e.setAutoRecoveryFlag(this.userId_,i.getType())}}catch(a){n.e(a)}finally{n.f()}}S(l(_.prototype),"startReconnection",this).call(this)}},{key:"getCurrentState",value:function(){return this.currentState_}},{key:"hasMainStream",value:function(){return this.trackState_.video||this.trackState_.audio||this.trackState_.smallVideo}},{key:"hasAuxStream",value:function(){return this.trackState_.auxiliary}}]),_}(jJ),C(Qq.prototype,"subscribe",[Wq,Jq],Object.getOwnPropertyDescriptor(Qq.prototype,"subscribe"),Qq.prototype),C(Qq.prototype,"unsubscribe",[qq],Object.getOwnPropertyDescriptor(Qq.prototype,"unsubscribe"),Qq.prototype),C(Qq.prototype,"exchangeSDP",[Kq],Object.getOwnPropertyDescriptor(Qq.prototype,"exchangeSDP"),Qq.prototype),Qq);var oK=function(){function e(){o(this,e),this.startTime=0,this.endTime=0,this.start()}return c(e,[{key:"start",value:function(){0===this.startTime&&(this.startTime=EA())}},{key:"stop",value:function(){0===this.endTime&&(this.endTime=EA())}},{key:"getDuration",value:function(){return 0===this.endTime?EA()-this.startTime:this.endTime-this.startTime}}]),e}(),sK=function(){function e(t){o(this,e),this.client_=t.client,this.intervalId_=-1,this.statsCalculator_=t.stats,this.prevStats_=null,this.renderFreezeMap_=new Map,this.remoteStreamMap_=new Map,this.dataFreezeMap_=new Map,this.monitorFreezeData_=new Map}var t,i,r;return c(e,[{key:"installEvents",value:function(){jA.on(Tx,this.handlePlayVideoStart,this),jA.on(yx,this.onVideoTrackMuted,this),jA.on(Sx,this.onVideoTrackUnmuted,this),jA.on(fx,this.handleStreamStopped,this),jA.on(hx,this.handleStreamStopped,this),jA.on(ox,this.handleVideoPlaying,this)}},{key:"uninstallEvents",value:function(){jA.off(Tx,this.handlePlayVideoStart,this),jA.off(yx,this.onVideoTrackMuted,this),jA.off(Sx,this.onVideoTrackUnmuted,this),jA.off(fx,this.handleStreamStopped,this),jA.off(hx,this.handleStreamStopped,this),jA.off(ox,this.handleVideoPlaying,this)}},{key:"start",value:function(){var e=this;-1===this.intervalId_&&(this.installEvents(),this.intervalId_=iO.run(a(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.detectFPS();case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])}))),{delay:1e3}))}},{key:"stop",value:function(){-1!==this.intervalId_&&(this.uninstallEvents(),iO.clearTask(this.intervalId_),this.intervalId_=-1,this.renderFreezeMap_.clear(),this.dataFreezeMap_.clear(),this.remoteStreamMap_.clear())}},{key:"onVideoTrackMuted",value:function(e){var t=e.stream;if(t.getClient()===this.client_&&t.isRemote()){var n=t.userId_,i=t.type_,r="".concat(n,"_").concat(i),a=this.dataFreezeMap_.get(r),o=new oK;a?a.durationItemList.push(o):this.dataFreezeMap_.set(r,{userId:n,type:i,durationItemList:[o],isFreezing:function(){var e=this.durationItemList[this.durationItemList.length-1];return e&&0===e.endTime}})}}},{key:"onVideoTrackUnmuted",value:function(e){var t=e.stream;if(t.getClient()===this.client_&&t.isRemote()){var n=t.userId_,i=t.type_,r="".concat(n,"_").concat(i);this.stopDataFreeze({key:r,userId:n,type:i})}}},{key:"handleStreamStopped",value:function(e){var t=e.client,n=e.stream;if(t===this.client_){var i=n.getUserId(),r=n.getType(),a="".concat(i,"_").concat(r);this.stopDataFreeze({key:a,userId:i,type:r})}}},{key:"stopDataFreeze",value:function(e){var t=e.key,n=e.userId,i=e.type,r=this.dataFreezeMap_.get(t);if(r&&r.isFreezing()){var a=r.durationItemList[r.durationItemList.length-1];a.stop();var o=a.getDuration();o>500?(lM.logEvent({eventType:"videoFrozenCount",delta:o}),this.monitorFreezeData_.set(t,{userId:n,type:i,duration:o})):r.durationItemList.pop()}}},{key:"getTotalDuration",value:function(e){return e.reduce((function(e,t){var n=t.getDuration();return e+Math.min(n,5e3)}),0)}},{key:"getStats",value:(r=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l,h;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.client_.getConnections(),i={},r=w(t),e.prev=3,r.s();case 5:if((a=r.n()).done){e.next=20;break}if(o=k(a.value,2),s=o[0],(c=o[1]).getPeerConnection()){e.next=9;break}return e.abrupt("continue",18);case 9:return u=c.getSubscribeState(),d=c.getTrackState(),e.next=13,this.statsCalculator_.getReceiverStats(c);case 13:l=e.sent,(h={userId:l.userId,tinyId:s,hasVideo:d.video&&u.video,hasAuxiliary:d.auxiliary&&u.auxiliary,video:{framesDecoded:0},auxiliary:{framesDecoded:0}}).hasVideo&&(h.video.framesDecoded=l.video.framesDecoded),h.hasAuxiliary&&(h.auxiliary.framesDecoded=l.auxiliary.framesDecoded),i[l.userId]=h;case 18:e.next=5;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(3),r.e(e.t0);case 25:return e.prev=25,r.f(),e.finish(25);case 28:return e.abrupt("return",i);case 29:case"end":return e.stop()}}),e,this,[[3,22,25,28]])}))),function(){return r.apply(this,arguments)})},{key:"detectFPS",value:(i=a(n().mark((function e(){var t,i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getStats();case 2:if(t=e.sent,this.prevStats_){e.next=6;break}return this.prevStats_=t,e.abrupt("return");case 6:e.t0=n().keys(t);case 7:if((e.t1=e.t0()).done){e.next=17;break}if(i=e.t1.value,this.prevStats_[i]){e.next=11;break}return e.abrupt("continue",7);case 11:r=t[i].tinyId,a=this.client_.getMutedStates(),t[i].hasVideo&&this.prevStats_[i].hasVideo&&a.has(r)&&!a.get(r).videoMuted&&(o=t[i].video.framesDecoded-this.prevStats_[i].video.framesDecoded,this.handleRenderFreeze({userId:i,type:BT,fps:o})),t[i].hasAuxiliary&&this.prevStats_[i].hasAuxiliary&&(s=t[i].auxiliary.framesDecoded-this.prevStats_[i].auxiliary.framesDecoded,this.handleRenderFreeze({userId:i,type:HT,fps:s})),e.next=7;break;case 17:this.prevStats_=t;case 18:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"handleRenderFreeze",value:(t=a(n().mark((function e(t){var i,r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.userId,r=t.fps,a=t.type,o="".concat(i,"_").concat(a),s=this.renderFreezeMap_.get(o),r<=2?(c=EA(),s&&!s.isFreeze&&(s.freezeTimeline.push({startTime:c,endTime:void 0}),s.isFreeze=!0),s||this.renderFreezeMap_.set(o,{userId:i,type:a,isFreeze:!0,freezeTimeline:[{startTime:c,endTime:void 0}],renderFreezeTotal:0})):s&&s.isFreeze&&(s.isFreeze=!1,(u=s.freezeTimeline.pop()).endTime=EA(),d=u.endTime-u.startTime,s.freezeTimeline.push(u),s.renderFreezeTotal+=Math.min(5e3,d));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"handlePlayVideoStart",value:function(e){var t=e.stream;if(t.getClient()===this.client_&&t.isRemote()&&t.hasVideo()){var n="".concat(t.getUserId(),"_").concat(t.getType());this.remoteStreamMap_.has(n)||this.remoteStreamMap_.set(n,{isPlayingFired:!1})}}},{key:"handleVideoPlaying",value:function(e){var t=e.stream;if(t.isRemote()&&t.getClient()===this.client_){var n="".concat(t.getUserId(),"_").concat(t.getType());if(this.remoteStreamMap_.has(n))this.remoteStreamMap_.get(n).isPlayingFired=!0}}},{key:"getDataFreezeDuration",value:function(e){var t={dataFreeze:0,count:0},n=this.dataFreezeMap_.get(e);if(n){if(n.isFreezing()){var i=n.durationItemList[n.durationItemList.length-1];i.stop(),i.getDuration()<500&&n.durationItemList.pop()}t.dataFreeze=this.getTotalDuration(n.durationItemList),t.count=n.durationItemList.length}return t}},{key:"getRenderFreezeDuration",value:function(e){var t=this.renderFreezeMap_.get(e),n=0,i=0;if(t)if(t.isFreeze){var r=EA()-t.freezeTimeline[t.freezeTimeline.length-1].startTime;n=t.renderFreezeTotal+Math.min(r,5e3),i=t.freezeTimeline.length}else n=t.renderFreezeTotal;return{renderFreeze:n,count:i}}},{key:"getMonitorFreeze",value:function(){return this.monitorFreezeData_}},{key:"isBlackStream",value:function(e){return!!this.remoteStreamMap_.has(e)&&!this.remoteStreamMap_.get(e).isPlayingFired}},{key:"resetMonitor",value:function(){this.monitorFreezeData_.clear()}}]),e}(),cK=c((function e(t){o(this,e),this.userId=t.userId,this.tinyId=t.tinyId,this.role=t.role===OT?LT:UT})),uK={exports:{}};!function(e){!function(t){function n(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,i,r,a,o){return n((s=n(n(t,e),n(r,o)))<<(c=a)|s>>>32-c,i);var s,c}function r(e,t,n,r,a,o,s){return i(t&n|~t&r,e,t,a,o,s)}function a(e,t,n,r,a,o,s){return i(t&r|n&~r,e,t,a,o,s)}function o(e,t,n,r,a,o,s){return i(t^n^r,e,t,a,o,s)}function s(e,t,n,r,a,o,s){return i(n^(t|~r),e,t,a,o,s)}function c(e,t){var i,c,u,d,l;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var h=1732584193,p=-271733879,f=-1732584194,m=271733878;for(i=0;i<e.length;i+=16)c=h,u=p,d=f,l=m,h=r(h,p,f,m,e[i],7,-680876936),m=r(m,h,p,f,e[i+1],12,-389564586),f=r(f,m,h,p,e[i+2],17,606105819),p=r(p,f,m,h,e[i+3],22,-1044525330),h=r(h,p,f,m,e[i+4],7,-176418897),m=r(m,h,p,f,e[i+5],12,1200080426),f=r(f,m,h,p,e[i+6],17,-1473231341),p=r(p,f,m,h,e[i+7],22,-45705983),h=r(h,p,f,m,e[i+8],7,1770035416),m=r(m,h,p,f,e[i+9],12,-1958414417),f=r(f,m,h,p,e[i+10],17,-42063),p=r(p,f,m,h,e[i+11],22,-1990404162),h=r(h,p,f,m,e[i+12],7,1804603682),m=r(m,h,p,f,e[i+13],12,-40341101),f=r(f,m,h,p,e[i+14],17,-1502002290),h=a(h,p=r(p,f,m,h,e[i+15],22,1236535329),f,m,e[i+1],5,-165796510),m=a(m,h,p,f,e[i+6],9,-1069501632),f=a(f,m,h,p,e[i+11],14,643717713),p=a(p,f,m,h,e[i],20,-373897302),h=a(h,p,f,m,e[i+5],5,-701558691),m=a(m,h,p,f,e[i+10],9,38016083),f=a(f,m,h,p,e[i+15],14,-660478335),p=a(p,f,m,h,e[i+4],20,-405537848),h=a(h,p,f,m,e[i+9],5,568446438),m=a(m,h,p,f,e[i+14],9,-1019803690),f=a(f,m,h,p,e[i+3],14,-187363961),p=a(p,f,m,h,e[i+8],20,1163531501),h=a(h,p,f,m,e[i+13],5,-1444681467),m=a(m,h,p,f,e[i+2],9,-51403784),f=a(f,m,h,p,e[i+7],14,1735328473),h=o(h,p=a(p,f,m,h,e[i+12],20,-1926607734),f,m,e[i+5],4,-378558),m=o(m,h,p,f,e[i+8],11,-2022574463),f=o(f,m,h,p,e[i+11],16,1839030562),p=o(p,f,m,h,e[i+14],23,-35309556),h=o(h,p,f,m,e[i+1],4,-1530992060),m=o(m,h,p,f,e[i+4],11,1272893353),f=o(f,m,h,p,e[i+7],16,-155497632),p=o(p,f,m,h,e[i+10],23,-1094730640),h=o(h,p,f,m,e[i+13],4,681279174),m=o(m,h,p,f,e[i],11,-358537222),f=o(f,m,h,p,e[i+3],16,-722521979),p=o(p,f,m,h,e[i+6],23,76029189),h=o(h,p,f,m,e[i+9],4,-640364487),m=o(m,h,p,f,e[i+12],11,-421815835),f=o(f,m,h,p,e[i+15],16,530742520),h=s(h,p=o(p,f,m,h,e[i+2],23,-995338651),f,m,e[i],6,-198630844),m=s(m,h,p,f,e[i+7],10,1126891415),f=s(f,m,h,p,e[i+14],15,-1416354905),p=s(p,f,m,h,e[i+5],21,-57434055),h=s(h,p,f,m,e[i+12],6,1700485571),m=s(m,h,p,f,e[i+3],10,-1894986606),f=s(f,m,h,p,e[i+10],15,-1051523),p=s(p,f,m,h,e[i+1],21,-2054922799),h=s(h,p,f,m,e[i+8],6,1873313359),m=s(m,h,p,f,e[i+15],10,-30611744),f=s(f,m,h,p,e[i+6],15,-1560198380),p=s(p,f,m,h,e[i+13],21,1309151649),h=s(h,p,f,m,e[i+4],6,-145523070),m=s(m,h,p,f,e[i+11],10,-1120210379),f=s(f,m,h,p,e[i+2],15,718787259),p=s(p,f,m,h,e[i+9],21,-343485551),h=n(h,c),p=n(p,u),f=n(f,d),m=n(m,l);return[h,p,f,m]}function u(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function d(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function l(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function h(e){return unescape(encodeURIComponent(e))}function p(e){return function(e){return u(c(d(e),8*e.length))}(h(e))}function f(e,t){return function(e,t){var n,i,r=d(e),a=[],o=[];for(a[15]=o[15]=void 0,r.length>16&&(r=c(r,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^r[n],o[n]=1549556828^r[n];return i=c(a.concat(d(t)),512+8*t.length),u(c(o.concat(i),640))}(h(e),h(t))}function m(e,t,n){return t?n?f(t,e):l(f(t,e)):n?p(e):l(p(e))}e.exports?e.exports=m:t.md5=m}(A)}(uK);var dK=uK.exports,lK=function(){function e(t){o(this,e),this.client_=t.client,this.signalChannel_=t.signalChannel,this.log_=Vx.createLogger({id:"mix|"+this.client_.getUserId(),userId:t.client.getUserId(),sdkAppId:t.client.getSDKAppId()}),this.isMixing_=!1,this.config_=null,this.data_=null,this.remoteStreamMap_=new Map,this.installEvents()}var t,i,r,s;return c(e,[{key:"isPresetLayoutMode",get:function(){return this.config_&&this.config_.mode===DI.PRESET_LAYOUT}},{key:"installEvents",value:function(){jA.on(lx,this.onStreamSubscribed,this),jA.on(hx,this.onStreamUnsubscribed,this),this.client_.on("stream-removed",this.onStreamRemoved,this)}},{key:"uninstallEvents",value:function(){jA.off(lx,this.onStreamSubscribed,this),jA.off(hx,this.onStreamUnsubscribed,this),this.client_.off("stream-removed",this.onStreamRemoved,this)}},{key:"reset",value:function(){this.uninstallEvents(),this.isMixing_=!1,this.config_=null}},{key:"onStreamSubscribed",value:function(e){var t=e.client,n=e.stream;t===this.client_&&(this.remoteStreamMap_.set(n.getId(),{remoteStream:n,isUsed:!1}),this.isMixing_&&this.hasAvailablePlaceHolder()&&this.startMixTranscode(this.config_))}},{key:"onStreamUnsubscribed",value:function(e){var t=e.client,n=e.stream;t===this.client_&&this.onStreamRemoved({stream:n})}},{key:"onStreamRemoved",value:function(e){var t=e.stream;if(this.remoteStreamMap_.has(t.getId())){var n=this.remoteStreamMap_.get(t.getId()).isUsed;this.remoteStreamMap_.delete(t.getId()),this.isMixing_&&this.isPresetLayoutMode&&n&&this.startMixTranscode(this.config_)}}},{key:"startMixTranscode",value:(s=a(n().mark((function e(t){var i,r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.resetIsUsedFlag(),this.config_=t,i=this.getInputParam(t,this.remoteStreamMap_),r=this.getOutputParam(t),a=this.getOutputSessionId({config:t,roomId:this.client_.getRoomId(),userId:this.client_.getUserId()}),!this.isMixing_||!this.data_||a===this.data_.outputSessionId){e.next=10;break}return this.log_.info("startMixTranscode() streamId changed, stop mixing before start"),e.next=10,this.doStopMixTranscode();case 10:return e.next=12,this.doStartMixTranscode({outputSessionId:a,inputParam:i,outputParam:r});case 12:e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(0),this.resetIsUsedFlag(),e.t0;case 18:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e){return s.apply(this,arguments)})},{key:"doStartMixTranscode",value:(r=a(n().mark((function e(t){var i,r,a,o,s,c,u,d;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.outputSessionId,r=t.inputParam,a=t.outputParam,o={roomId:String(this.client_.getRoomId()),mcuRequestTime:Date.now(),outputSessionId:i,inputParam:r,outputParam:a},this.data_=o,this.log_.info("startMixTranscode: ".concat(JSON.stringify(o))),this.isMixing_=!0,e.prev=5,e.next=8,this.signalChannel_.sendWaitForResponse({command:vD,data:o,timeout:5e3,responseCommand:eD.START_MIX_TRANSCODE_RES,commandDesc:"startMixTranscode"});case 8:if(s=e.sent,c=s.data,u=c.code,d=c.message,0===u){e.next=15;break}throw-102083===u&&(d="Please enable relayed-push in ".concat(cE," and try later, refer to ").concat(dE,"tutorial-26-advanced-publish-cdn-stream.html")),this.log_.error("startMixTranscode failed, errCode: ".concat(u," errMsg: ").concat(d)),this.isMixing_=!1,new kD({code:bD.START_MIX_TRANSCODE_FAILED,message:sA({key:qw,data:{message:d},link:{className:"Client",fnName:"startMixTranscode"}})});case 15:e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(5),this.isMixing_=!1,e.t0;case 21:case"end":return e.stop()}}),e,this,[[5,17]])}))),function(e){return r.apply(this,arguments)})},{key:"reStartMixTranscode",value:function(){this.isMixing_&&this.startMixTranscode(this.config_)}},{key:"stopMixTranscode",value:(i=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMixing_){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Qw})});case 2:return e.next=4,this.doStopMixTranscode();case 4:this.resetIsUsedFlag();case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doStopMixTranscode",value:(t=a(n().mark((function e(){var t,i,r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={mcuRequestTime:Date.now(),outputSessionId:this.data_.outputSessionId,streamType:this.data_.outputParam.streamType},this.log_.info("stopMixTranscode: ".concat(JSON.stringify(t))),e.next=4,this.signalChannel_.sendWaitForResponse({command:_D,data:t,timeout:5e3,responseCommand:eD.STOP_MIX_TRANSCODE_RES,commandDesc:"stopMixTranscode"});case 4:if(i=e.sent,r=i.data,a=r.code,o=r.message,0!==a){e.next=10;break}this.isMixing_=!1,e.next=12;break;case 10:throw this.log_.error("stopMixTranscode failed, errCode: ".concat(a," errMsg: ").concat(o)),new kD({code:bD.STOP_MIX_TRANSCODE_FAILED,message:sA({key:Kw,data:{message:o},link:{className:"Client",fnName:"stopMixTranscode"}})});case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getOutputSessionId",value:function(e){var t=e.config,n=e.userId,i=e.roomId;return _A(t.streamId)&&t.streamId.length>0?t.streamId:dK("".concat(i,"_").concat(n,"_main"))}},{key:"getInputParam",value:function(e,t){var n=this,i=e.mixUsers.map((function(e){return{userId:e.userId,roomId:String(e.roomId||n.client_.getRoomId()),width:e.width||0,height:e.height||0,locationX:e.locationX||0,locationY:e.locationY||0,zOrder:e.zOrder,streamType:vA(e.streamType)||e.streamType!==HT?0:1,inputType:e.pureAudio?OI.IT_PURE_AUDIO:OI.IT_AUDIO_VIDEO,renderMode:e.renderMode||0}}));return e.mode===DI.PRESET_LAYOUT&&(i.forEach((function(e){if(e.userId===MI.REMOTE){var n=T(t.values()).find((function(e){return!e.isUsed}));n&&(e.userId=n.remoteStream.getUserId(),e.streamType=n.remoteStream.getType()===HT?1:0,n.isUsed=!0)}})),i=i.filter((function(e){return e.userId!==MI.REMOTE}))),i}},{key:"getOutputParam",value:function(e){var t=e.streamId||"";return{streamId:t,streamType:t.length>0?1:0,width:vA(e.videoWidth)?640:e.videoWidth,height:vA(e.videoHeight)?480:e.videoHeight,videoBps:e.videoBitrate||0,fps:e.videoFramerate||15,gop:e.videoGOP||2,audioSampleRate:e.audioSampleRate||48e3,audioBps:e.audioBitrate||64,audioChannels:e.audioChannels||1,backgroundColor:e.backgroundColor||0,backgroundImg:e.backgroundImage||"",extraInfo:"",videoCodec:2,audioCodec:0}}},{key:"hasAvailablePlaceHolder",value:function(){return!!this.isPresetLayoutMode&&this.data_.inputParam.length!==this.config_.mixUsers.length}},{key:"resetIsUsedFlag",value:function(){this.remoteStreamMap_.forEach((function(e){return e.isUsed=!1}))}}]),e}(),hK=function(){function e(t){o(this,e),this.client_=t.client,this.signalChannel_=t.signalChannel,this.publishTencentMainStreamObj_={params_:null,streamId_:void 0,isPublishing_:!1},this.publishTencentAuxStreamObj_={params_:null,streamId_:void 0,isPublishing_:!1},this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1}var t,i,r,s,u,d;return c(e,[{key:"setSignalChannel",value:function(e){this.signalChannel_=e.signalChannel}},{key:"getIsPublishingTencentCDN",value:function(){return this.publishTencentMainStreamObj_.isPublishing_||this.publishTencentAuxStreamObj_.isPublishing_}},{key:"getIsPublishingGivenCDN",value:function(){return this.isPublishingGivenCDN_}},{key:"generatePublishCDNStreamId",value:function(e,t){if(!e){var n="".concat(this.client_.getRoomId(),"_").concat(this.client_.getUserId(),"_").concat(t);return/^[A-Za-z\d_-]*$/.test(n)||(n=dK(n)),"".concat(this.client_.getSDKAppId(),"_").concat(n)}return e}},{key:"generatePublishCDNSessionId",value:function(e){return dK("".concat(this.client_.getRoomId(),"_").concat(this.client_.getUserId(),"_").concat(e))}},{key:"startPublishTencentCDN",value:(d=a(n().mark((function e(t){var i,r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.streamType===Gk?(this.publishTencentAuxStreamObj_.params_=t,this.publishTencentAuxStreamObj_.isPublishing_=!0):(this.publishTencentMainStreamObj_.params_=t,this.publishTencentMainStreamObj_.isPublishing_=!0),this.client_.isJoined_){e.next=3;break}return e.abrupt("return");case 3:return i=this.generatePublishCDNStreamId(t.streamId,t.streamType),r=this.generatePublishCDNSessionId(t.streamType),a=t.streamType===Gk?1:0,o={requestTime:Date.now(),sessionId:r,streamId:i,streamType:a},e.next=9,this.doStartPublishTencentCDN(o,t.streamType);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"doStartPublishTencentCDN",value:(u=a(n().mark((function e(t,i){var r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Vx.info("startPublishTencentCDN: "+JSON.stringify(t)),e.next=4,this.signalChannel_.sendWaitForResponseWithRetry({command:hD,data:t,timeout:2e3,responseCommand:eD.START_PUBLISH_TENCENT_CDN_RES,commandDesc:"startPublishCDNStream",retries:2});case 4:if(r=e.sent,a=r.data,o=a.code,s=a.message,0!==o){e.next=10;break}i===Gk?this.publishTencentAuxStreamObj_.streamId_=t.streamId:this.publishTencentMainStreamObj_.streamId_=t.streamId,e.next=14;break;case 10:throw i===Gk?this.publishTencentAuxStreamObj_.isPublishing_=!1:this.publishTencentMainStreamObj_.isPublishing_=!1,-102083===o&&(s="Please enable relayed-push in ".concat(cE," and try later, refer to ").concat(dE,"tutorial-26-advanced-publish-cdn-stream.html")),Vx.error("startPublishTencentCDN failed, errCode: ".concat(o,", errMsg: ").concat(s)),new kD({code:bD.START_PUBLISH_CDN_FAILED,message:sA({key:yw,data:{message:s},link:{className:"Client",fnName:"startPublishCDNStream"}})});case 14:e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(0),i===Gk?this.publishTencentAuxStreamObj_.isPublishing_=!1:this.publishTencentMainStreamObj_.isPublishing_=!1,e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return u.apply(this,arguments)})},{key:"resetPublishTencentParam",value:function(e){e===rT&&(this.publishTencentMainStreamObj_={params_:null,streamId_:void 0,isPublishing_:!1}),e===Gk&&(this.publishTencentAuxStreamObj_={params_:null,streamId_:void 0,isPublishing_:!1})}},{key:"stopPublishTencentCDN",value:(s=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client_.isJoined_){e.next=4;break}return this.resetPublishTencentParam(rT),this.resetPublishTencentParam(Gk),e.abrupt("return");case 4:if(!this.publishTencentMainStreamObj_.isPublishing_){e.next=7;break}return e.next=7,this.doStopPublishTencentCDN(rT);case 7:if(!this.publishTencentAuxStreamObj_.isPublishing_){e.next=10;break}return e.next=10,this.doStopPublishTencentCDN(Gk);case 10:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"doStopPublishTencentCDN",value:(r=a(n().mark((function e(t){var i,r,a,o,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={requestTime:Date.now(),sessionId:dK("".concat(this.client_.getRoomId(),"_").concat(this.client_.getUserId(),"_").concat(t))},Vx.info("stopPublishTencentCDN: "+JSON.stringify(i)),e.next=4,this.signalChannel_.sendWaitForResponse({command:pD,data:i,timeout:5e3,responseCommand:eD.STOP_PUBLISH_TENCENT_CDN_RES,commandDesc:"stopPublishCDNStream"});case 4:if(r=e.sent,a=r.data,o=a.code,s=a.message,0!==o){e.next=10;break}this.resetPublishTencentParam(t),e.next=17;break;case 10:if(-102069!==o){e.next=15;break}Vx.warn("stopPublishTencentCDN failed, can not stopPublishTencentCDN in auto relayed-push mode"),this.resetPublishTencentParam(t),e.next=17;break;case 15:throw Vx.error("stopPublishTencentCDN failed, errCode: ".concat(o," errMsg: ").concat(s)),new kD({code:bD.STOP_PUBLISH_CDN_FAILED,message:sA({key:Sw,data:{message:s},link:{className:"Client",fnName:"stopPublishCDNStream"}})});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"startPublishGivenCDN",value:(i=a(n().mark((function e(t){var i,r,a,o,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.streamType===rT?this.publishTencentMainStreamObj_.streamId_:this.publishTencentAuxStreamObj_.streamId_,r={pushRequestTime:Date.now(),pushAppId:t.appId,pushBizId:t.bizId,pushCdnUrl:t.url,pushStreamType:t.streamType,pushStreamId:i},Vx.info("startPublishGivenCDN: "+JSON.stringify(r)),this.publishGivenCDNData_=r,this.isPublishingGivenCDN_=!0,this.client_.isJoined_){e.next=7;break}return e.abrupt("return");case 7:return e.prev=7,e.next=10,this.signalChannel_.sendWaitForResponse({command:fD,data:r,timeout:5e3,responseCommand:eD.START_PUBLISH_GIVEN_CDN_RES,commandDesc:"startPublishCDNStream"});case 10:if(a=e.sent,o=a.data,s=o.code,c=o.message,0===s){e.next=17;break}throw Vx.error("startPublishGivenCDN failed, errCode: ".concat(s,", errMsg: ").concat(c)),this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1,new kD({code:bD.START_PUBLISH_CDN_FAILED,message:sA({key:yw,data:{message:c},link:{className:"Client",fnName:"startPublishCDNStream"}})});case 17:e.next=24;break;case 19:throw e.prev=19,e.t0=e.catch(7),this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1,e.t0;case 24:case"end":return e.stop()}}),e,this,[[7,19]])}))),function(e){return i.apply(this,arguments)})},{key:"stopPublishGivenCDN",value:(t=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client_.isJoined_){e.next=4;break}return this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1,e.abrupt("return");case 4:return t=this.publishGivenCDNData_,i=t.pushAppId,r=t.pushBizId,a=t.pushCdnUrl,o=t.pushStreamType,s={pushRequestTime:Date.now(),pushAppId:i,pushBizId:r,pushCdnUrl:a,pushStreamType:o},Vx.info("stopPublishGivenCDN: "+JSON.stringify(s)),e.next=9,this.signalChannel_.sendWaitForResponse({command:mD,data:s,timeout:5e3,responseCommand:eD.STOP_PUBLISH_GIVEN_CDN_RES,commandDesc:"stopPublishCDNStream"});case 9:if(c=e.sent,u=c.data,d=u.code,l=u.message,0!==d){e.next=16;break}this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1,e.next=18;break;case 16:throw Vx.error("stopPublishGivenCDN failed, errCode: ".concat(d," errMsg: ").concat(l)),new kD({code:bD.STOP_PUBLISH_CDN_FAILED,message:sA({key:Sw,data:{message:l},link:{className:"Client",fnName:"stopPublishCDNStream"}})});case 18:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"handleCDNConfigForJoinData",value:function(e){var t,n=e;if(this.publishTencentMainStreamObj_.isPublishing_||this.publishTencentAuxStreamObj_.isPublishing_){var i={};_A(n)&&(i=JSON.parse(n)),i.Str_uc_params||(i.Str_uc_params={}),this.publishTencentMainStreamObj_.isPublishing_&&(this.publishTencentMainStreamObj_.streamId_?i.Str_uc_params.userdefine_streamid_main=this.publishTencentMainStreamObj_.streamId_:this.publishTencentMainStreamObj_.params_&&(i.Str_uc_params.userdefine_streamid_main=this.generatePublishCDNStreamId(this.publishTencentMainStreamObj_.params_.streamId,rT))),this.publishTencentAuxStreamObj_.isPublishing_&&(this.publishTencentAuxStreamObj_.streamId_?i.Str_uc_params.userdefine_streamid_aux=this.publishTencentAuxStreamObj_.streamId_:this.publishTencentAuxStreamObj_.params_&&(i.Str_uc_params.userdefine_streamid_aux=this.generatePublishCDNStreamId(this.publishTencentAuxStreamObj_.params_.streamId,Gk))),n=JSON.stringify(i)}if(this.isPublishingGivenCDN_){var r=this.publishGivenCDNData_,a=r.pushAppId,o=r.pushBizId,s=r.pushCdnUrl,c=r.pushStreamType,u=r.pushStreamId;t={pushRequestTime:Date.now(),pushAppId:a,pushBizId:o,pushCdnUrl:s,pushStreamType:c,pushStreamId:u}}return{bussinessInfo:n,pushUserCdnInfo:t}}},{key:"reset",value:function(){this.resetPublishTencentParam(rT),this.resetPublishTencentParam(Gk),this.publishGivenCDNData_=null,this.isPublishingGivenCDN_=!1}}]),e}(),pK=function(){function e(t){o(this,e),this.client_=t.client,this.durationMap_=new Map,this.installEvents()}return c(e,[{key:"installEvents",value:function(){jA.on(lx,this.handleSubscribed,this),jA.on(cx,this.handleStreamTrackUpdated,this),jA.on(hx,this.handleStreamStopped,this),jA.on(fx,this.handleStreamStopped,this)}},{key:"uninstallEvents",value:function(){jA.off(lx,this.handleSubscribed,this),jA.off(cx,this.handleStreamTrackUpdated,this),jA.off(hx,this.handleStreamStopped,this),jA.off(fx,this.handleStreamStopped,this)}},{key:"handleSubscribed",value:function(e){var t=e.client,n=e.stream;if(t===this.client_){var i=n.getUserId(),r=n.getType(),a="".concat(i,"_").concat(r);if(n.hasAudio())if(n.isMainAudioSubscribed){var o=new oK,s=this.durationMap_.get(a);s?this.isRecording(s.audio)||s.audio.push(o):this.durationMap_.set(a,{userId:i,type:r,audio:[o],video:[]})}else this.stopDurationItem(a,Uk);if(n.hasVideo())if(r===BT&&n.isMainVideoSubscribed||r===HT&&n.isAuxVideoSubscribed){var c=new oK,u=this.durationMap_.get(a);u?this.isRecording(u.video)||u.video.push(c):this.durationMap_.set(a,{userId:i,type:r,audio:[],video:[c]})}else this.stopDurationItem(a,Vk)}}},{key:"handleStreamStopped",value:function(e){var t=e.client,n=e.stream;if(this.clientHitTest(t)){var i=n.getUserId(),r=n.getType(),a="".concat(i,"_").concat(r);this.stopDurationItem(a,Uk),this.stopDurationItem(a,Vk)}}},{key:"handleStreamTrackUpdated",value:function(e){var t=e.client,n=e.userId,i=e.tinyId,r=e.kind,a=e.action;if(this.clientHitTest(t)&&this.client_.getConnections().has(i)){var o=r===Hk?r:BT,s="".concat(n,"_").concat(o);if(a===jI.ADD){var c=this.client_.getConnections().get(i).getSubscribeState();if(r===Uk&&!c.audio||r===Vk&&!c.video||r===Hk&&!c.auxiliary)return;var u=new oK,d=this.durationMap_.get(s);d?(r!==Uk||this.isRecording(d.audio)||d.audio.push(u),r===Uk||this.isRecording(d.video)||d.video.push(u)):this.durationMap_.set(s,{userId:n,type:o,audio:r===Uk?[u]:[],video:r===Uk?[]:[u]})}else this.stopDurationItem(s,r===Uk?Uk:Vk)}}},{key:"isRecording",value:function(e){return e.findIndex((function(e){return 0===e.endTime}))>=0}},{key:"stopDurationItem",value:function(e,t){if(this.durationMap_.has(e)){var n=this.durationMap_.get(e)[t].find((function(e){return 0===e.endTime}));n&&n.stop()}}},{key:"clientHitTest",value:function(e){return this.client_===e}},{key:"getDuration",value:function(e,t){return this.durationMap_.has(e)?this.durationMap_.get(e)[t].reduce((function(e,t){return e+t.getDuration()}),0):0}},{key:"getDurationMap",value:function(){return this.durationMap_}},{key:"reset",value:function(){this.durationMap_.clear()}},{key:"destroy",value:function(){this.client_=null,this.uninstallEvents()}}]),e}();function fK(){return function(e,t,i){var r=i.value,o=new Set;return i.value=a(n().mark((function e(){var i,a,s,c,u=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.has(this)){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:DE,data:{name:t}})});case 2:for(e.prev=2,o.add(this),i=u.length,a=new Array(i),s=0;s<i;s++)a[s]=u[s];return e.next=7,r.apply(this,a);case 7:return c=e.sent,o.delete(this),e.abrupt("return",c);case 12:throw e.prev=12,e.t0=e.catch(2),o.delete(this),e.t0;case 16:case"end":return e.stop()}}),e,this,[[2,12]])}))),i}}function mK(e){return vK.apply(this,arguments)}function vK(){return vK=a(n().mark((function e(t){var i,r,a,o,s,c,u,d,l,h,p,f,m;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.userId,r=t.sdkAppId,a=t.useStringRoomId,o=t.roomId,s=t.userSig,c={delta:0,count:[1,1],msg:[]},e.prev=2,(u=new FormData).append("userId",String(i)),u.append("sdkAppId",String(r)),u.append("isStrGroupId",a),u.append("groupId",String(o)),u.append("sdkVersion",Wa),u.append("userSig",String(s)),YI&&u.append("oversea",!0),d=EA(),e.next=14,bK(u,c,r);case 14:return(l=e.sent).config&&l.config.loggerDomain&&xT(l.config.loggerDomain),c.delta=EA()-d,_K({stat:c,userId:i}),e.abrupt("return",l);case 21:throw e.prev=21,e.t0=e.catch(2),h=bA(e.t0)?e.t0[0]:e.t0,p=gA(h.code)?h.code:0,f="get websocket url failed: ".concat(h.message.includes("timeout")?"timeout":h.message),m=new kD({code:bD.SCHEDULE_FAILED,extraCode:p,message:sA({key:tw,data:{error:f,code:p}})}),Vx.error(m),_K({stat:c,userId:i,roomId:o,error:m}),m;case 30:case"end":return e.stop()}}),e,null,[[2,21]])}))),vK.apply(this,arguments)}function _K(e){var t=e.stat,n=e.userId,i=e.error;i?lM.logFailedEvent({eventType:RI,error:i,userId:n}):lM.logSuccessEvent({eventType:RI,delta:t.delta,userId:n}),lM.uploadEvent({log:"stat-schedule:"+JSON.stringify(t),userId:n})}function gK(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rT;return t=YI||(uA(e)?n===rT?XI:$I:n===rT?KI:QI),"https://".concat(t,"/api/v1/config")}function yK(e,t,n){return new Promise((function(i,r){UA({url:e,body:t,timeout:n.timeout}).then((function(e){0===e.data.code?i(e.data.data):r({code:e.data.code,message:e.data.msg})})).catch(r)}))}var SK=function(e,t){return Mx({retryFunction:yK,settings:{retries:3,timeout:0},onError:t,onRetrying:e})};function bK(e,t,n){return new Promise((function(i,r){var a,o=null;(a=[SK((function(e){return t.count[0]=e+1}),(function(e,n){t.msg[0]=e.message,o||n()}))(gK(n,rT),e,{get timeout(){return 1e3*pA(2+t.count[0])}}),SK((function(e){return t.count[1]=e+1}),(function(e,n){t.msg[1]=e.message,o||n()}))(gK(n,aT),e,{get timeout(){return 1e3*pA(2+t.count[1])}})],new Promise((function(e,t){var n=[];a.forEach((function(i){i.then(e).catch((function(e){n.push(e),n.length===a.length&&t(n)}))}))}))).then((function(e){i(o=e)})).catch(r)}))}var kK=function(){function e(){o(this,e)}return c(e,[{key:"call",value:function(e,t){return mA(this[e])?this[e](t):Promise.reject(new kD({code:bD.INVALID_PARAMETER,message:sA({key:TR,data:{name:e}})}))}},{key:"updatePrivateMapKey",value:function(e){var t=e.privateMapKey;return e.client.setProperty("privateMapKey",t),Promise.resolve()}}]),e}(),TK=new kK;var IK,EK,wK,RK,CK,AK,xK,PK,DK,MK,OK,NK,LK,UK,VK,FK,jK,BK,HK,GK,zK,WK,JK,qK,KK,QK,XK,$K,YK,ZK,eQ,tQ,nQ,iQ,rQ,aQ,oQ,sQ,cQ,uQ,dQ,lQ,hQ,pQ,fQ,mQ,vQ=function(){function e(t){o(this,e),this.userId=t.userId,this.audioCtx=t.audioContext,this.log=t.log,this.initWorklet=t.initWorklet,this.destination=this.audioCtx.destination,this.maxDistance=t.maxDistance,this.panNode=new PannerNode(this.audioCtx,{panningModel:"HRTF",distanceModel:"linear",positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:-1,refDistance:1,maxDistance:this.maxDistance,rolloffFactor:1,coneOuterGain:.4}),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.panNode),this.panNode.connect(this.destination),this.pcmPlayer=null,this.isPlaying=!1}var t;return c(e,[{key:"set3DSpatialReceivingRange",value:function(e){this.maxDistance=e}},{key:"updateRemote3DSpatialPosition",value:function(e){var t=k(e,3),n=t[0],i=t[1],r=t[2];this.panNode.positionX.value=n,this.panNode.positionY.value=r,this.panNode.positionZ.value=-i}},{key:"play",value:(t=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.pcmPlayer){e.next=10;break}e.prev=1,this.pcmPlayer=new AudioWorkletNode(this.audioCtx,"player",{numberOfOutputs:1,outputChannelCount:[2]}),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),e.next=9,this.initWorklet();case 9:this.pcmPlayer=new AudioWorkletNode(this.audioCtx,"player",{numberOfOutputs:1,outputChannelCount:[2]});case 10:this.pcmPlayer?(this.pcmPlayer.connect(this.gainNode),this.isPlaying=!0,this.log.info(this.userId+"play spatial effect success.")):this.log.debug(this.userId+"init spatial player failed.");case 11:case"end":return e.stop()}}),e,this,[[1,5]])}))),function(){return t.apply(this,arguments)})},{key:"stop",value:function(){this.isPlaying=!1,this.log.debug(this.userId+"stop play spatial effect.")}},{key:"setAudioVolume",value:function(e){e>=0&&e<=1&&(this.gainNode.gain.value=e)}},{key:"feed",value:function(e){this.isPlaying&&this.pcmPlayer.port.postMessage({type:"feed",data:e[0]})}},{key:"destroy",value:function(){var e,t,n,i;null===(e=this.gainNode)||void 0===e||e.disconnect(),null===(t=this.panNode)||void 0===t||t.disconnect(),null===(n=this.pcmPlayer)||void 0===n||null===(i=n.port)||void 0===i||i.postMessage({type:"stop"})}}]),e}(),_Q=new Blob(['class t extends AudioWorkletProcessor{constructor(){super(),this.isStop=!1,this.buffer=new Float32Array(0),this.port.onmessage=t=>{const{type:e,data:s}=t.data;if("feed"===e){const t=new Float32Array(this.buffer.length+s.length);t.set(this.buffer,0),t.set(s,this.buffer.length),this.buffer=t,this.buffer.length>4800&&(this.buffer=this.buffer.slice(0,2880))}"stop"===e&&(this.isStop=!0)}}process(t,e){if(this.isStop)return!1;const s=e[0],r=s[0].length;if(this.buffer.length>r&&this.buffer.length>0){for(let t=0;t<2;t++){const e=s[t],r=this.buffer.slice(0,e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}this.buffer=this.buffer.slice(r)}return!0}}registerProcessor("player",t)'],{type:"application/javascript"}),gQ=function(){function e(t){var n=t.client,i=t.log;o(this,e),this.client_=n,this.log_=i,this.audioContext_=PA(),this.addModuleSuccess_=!1,this.listener_=this.audioContext_.listener,this.maxDistance_=1e4,this.userMap_=new Map,this.position_=[0,0,0],this.axisForward_=[],this.axisRight_=[],this.axisUp_=[],this.initWorklet()}var t;return c(e,[{key:"initWorklet",value:(t=a(n().mark((function e(){var t=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.audioContext_.audioWorklet.addModule(URL.createObjectURL(_Q)).then((function(){t.addModuleSuccess_=!0}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"play",value:function(e){this.userMap_.has(e)&&this.userMap_.get(e).spatialPlayer.play()}},{key:"stop",value:function(e){this.userMap_.has(e)&&this.userMap_.get(e).spatialPlayer.stop()}},{key:"setAudioVolume",value:function(e,t){this.userMap_.has(e)&&this.userMap_.get(e).spatialPlayer.setAudioVolume(t)}},{key:"updateSelfPosition",value:function(e,t,n,i){e&&(this.position_=e,this.listener_.positionX.value=e[0],this.listener_.positionZ.value=0-e[1],this.listener_.positionY.value=e[2]),t&&(this.axisRight_=t),n&&(this.axisForward_=n,this.listener_.forwardX.value=n[0],this.listener_.forwardZ.value=-n[1],this.listener_.forwardY.value=n[2]),i&&(this.axisUp_=i,this.listener_.upX.value=i[0],this.listener_.upY.value=i[2],this.listener_.upZ.value=-i[1])}},{key:"updateRemote3DSpatialPosition",value:function(e,t){this.userMap_.has(e)&&this.userMap_.get(e).spatialPlayer.updateRemote3DSpatialPosition(t)}},{key:"updateMaxDistance",value:function(e){this.maxDistance_=e;var t,n=w(this.userMap_.values());try{for(n.s();!(t=n.n()).done;){t.value.spatialPlayer.set3DSpatialReceivingRange(this.maxDistance_)}}catch(i){n.e(i)}finally{n.f()}}},{key:"createSpatialPlayer",value:function(e){var t=e.userId,n=e.connection,i=new vQ({userId:this.client_.getUserId(),initWorklet:this.initWorklet,audioContext:this.audioContext_,maxDistance:this.maxDistance_,log:this.log_});return this.userMap_.set(t,{spatialPlayer:i,connection:n}),i}},{key:"resume",value:function(){var e;"suspended"===(null===(e=this.audioContext_)||void 0===e?void 0:e.state)&&this.audioContext_.resume()}},{key:"reset",value:function(){var e=this;this.userMap_.forEach((function(t,n){var i=t.spatialPlayer;null==i||i.destroy(),e.userMap_.delete(n)}))}},{key:"delete",value:function(e){this.userMap_.delete(e)}}]),e}(),yQ=(IK=fK(),EK=XJ(KJ.CLIENT.join),wK=fK(),RK=aq({retries:3}),CK=fK(),AK=XJ.apply(void 0,T(KJ.CLIENT.publish)),xK=mq(tE),PK=fK(),DK=XJ(KJ.CLIENT.unpublish),MK=XJ.apply(void 0,T(KJ.CLIENT.subscribe)),OK=XJ(KJ.CLIENT.unsubscribe),NK=fK(),LK=XJ(KJ.CLIENT.switchRole),UK=mq(tE),VK=XJ(KJ.CLIENT.startPublishCDNStream),FK=mq(tE),jK=mq(tE),BK=XJ(KJ.CLIENT.startMixTranscode),HK=mq(tE),GK=mq(tE),zK=mq(tE),WK=mq(tE),JK=mq(tE),qK=mq(tE),KK=mq(tE),QK=QJ.apply(void 0,T(KJ.CLIENT.sendSEIMessage)),XK=mq(tE),aQ={timesInSecond:30,maxSizeInSecond:8e3,getSize:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t[0].byteLength}},oQ=aQ.timesInSecond,sQ=aQ.maxSizeInSecond,cQ=aQ.getSize,$K=function(e,t,n){var i=n.value,r=new Map;return jA.on(tx,(function(e){var t=e.client;return r.delete(t)})),n.value=function(){var e=r.get(this);e||(e={callCountInSecond:0,timestamp:0,totalSizeInSecond:0},r.set(this,e)),0===e.timestamp?e.timestamp=Date.now():Date.now()-e.timestamp>1e3&&(e.timestamp=Date.now(),e.callCountInSecond=0,e.totalSizeInSecond=0);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];if(cQ&&(e.totalSizeInSecond+=cQ.apply(void 0,a)),0!==e.timestamp&&Date.now()-e.timestamp<1e3&&(e.callCountInSecond>=oQ||e.totalSizeInSecond>sQ))throw new kD({code:bD.INVALID_OPERATION,message:sA({key:DR,data:{isTimes:e.callCountInSecond>=oQ,isSize:e.totalSizeInSecond>sQ,name:t,timesInSecond:oQ,maxSizeInSecond:sQ}})});return e.callCountInSecond++,i.apply(this,a)},n},YK=QJ(KJ.CLIENT.enable3DSpatialAudioEffect),ZK=QJ.apply(void 0,T(KJ.CLIENT.updateSelf3DSpatialPosition)),eQ=QJ.apply(void 0,T(KJ.CLIENT.updateRemote3DSpatialPosition)),tQ=QJ(KJ.CLIENT.set3DSpatialReceivingRange),nQ=mq(tE),iQ=mq(tE),rQ=function(){function Client(e){var t,n;o(this,Client),this.name_=tE,this.mode_=e.mode,this.sdpSemantics_=PI,vA(e.sdpSemantics)?function(){var e;if(vA(window.RTCRtpTransceiver))return!1;if(!("currentDirection"in RTCRtpTransceiver.prototype))return!1;var t=null,n=!1;try{(t=new RTCPeerConnection({sdpSemantics:xI})).addTransceiver(Uk),n=!0}catch(IQ){}return null===(e=t)||void 0===e||e.close(),n}()&&(this.sdpSemantics_=xI):this.sdpSemantics_=e.sdpSemantics,this.sdkAppId_=e.sdkAppId,this.userId_=e.userId,this.log_=Vx.createLogger({id:"c".concat(e.seq,"|").concat(this.userId_),userId:this.userId_,sdkAppId:this.sdkAppId_}),this.userSig_=e.userSig,this.roomId_=0,this.useStringRoomId_=e.useStringRoomId||!1,this.pureAudioPushMode_=null,this.version_=e.version,this.log_.info("using sdpSemantics: "+this.sdpSemantics_),this.signalChannel_=null,this.role_=LT,this.privateMapKey_="",this.tinyId_=0,this.env_="",this.proxy_=null,this.unifiedProxy_=null,this.connections_=new Map,this.mutedStates_=new Map,this.userMap_=new Map,this.syncUserListInterval_=-1,this.localStream_=null,this.localAuxStream_=null,this.uplinkConnection_=null,this.emitter_=OA(new FA,this.name_),this.isJoined_=!1,this.heartbeat_=-1,this.lastHeartBeatTime_=-1,this.stats_=new QO(this),this.joinTimeout_=-1,this.changeBigSmallRecords_=new Map,this.networkQuality_=null,this.badCaseDetector_=null,this.networkType_=lA(),this.autoSubscribe_=!!vA(e.autoSubscribe)||e.autoSubscribe,this.joinedTimestamp_=0,this.joinOptions_={},this.basis_=(n={browser:rA().name+"/"+rA().version,os:DO(),displayResolution:MO(),isScreenShareSupported:yO(),isWebRTCSupported:uO(),isGetUserMediaSupported:OO(),isWebAudioSupported:NO(),isWebSocketsSupported:"WebSocket"in window&&2===window.WebSocket.CLOSING,isWebCodecSupported:(t={AudioDecoder:!1,AudioEncoder:!1,VideoDecoder:!1,VideoEncoder:!1,ImageDecoder:!1},vA(window.AudioDecoder)||(t.AudioDecoder=!0),vA(window.AudioEncoder)||(t.AudioEncoder=!0),vA(window.VideoDecoder)||(t.VideoDecoder=!0),vA(window.VideoEncoder)||(t.VideoEncoder=!0),vA(window.ImageDecoder)||(t.ImageDecoder=!0),t),isMediaSessionSupported:"mediaSession"in navigator&&!vA(navigator.mediaSession.setActionHandler),isWebTransportSupported:!vA(window.WebTransport)},navigator.userAgent.includes("miniProgram")&&(n.browser="mini/".concat(n.browser)),n),this.initBussinessInfo_(e),this.publishedCDN_=!1,this.publishCDNData_=null,this.mixedMCU_=!1,this.mixTranscodeData_=null,this.checkSystemResult_=null,this.enableAudioVolumeEvaluation_=!1,this.audioVolumeIntervalId_=null,this.mixTranscodeManager_=null,this.publishCDNManager_=new hK({client:this}),this.keyPointManager_=new pq({client:this,frameWorkType:e.frameWorkType,component:e.component}),this.isPublishing_=!1,this.isEnableSmallStream_=!1,this.smallStreamConfig_={bitrate:100,frameRate:15,height:120,width:160},this.turnServers_=[],this.iceTransportPolicy_=e.iceTransportPolicy,this.schedule_={domains:null,iceServers:null,iceTransportPolicy:null,trtcCapability:null},this.enableAutoPlayDialog_=!!vA(e.enableAutoPlayDialog)||e.enableAutoPlayDialog,this.enableMultiAuxStream_=!vA(e.enableMultiAuxStream)&&e.enableMultiAuxStream,this.signalInfo_={},this.enableSEI_=!vA(e.enableSEI)&&e.enableSEI,this.enableSpatial_=!1,this.spatialManager_=null,this.isDestroyed_=!1}var e,i,r,s,u,d,l,h,p,f,m,v,_,g,y,S,b,I,E,R,C,A,x,P,D,M,O;return c(Client,[{key:"initBussinessInfo_",value:function(e){this.bussinessInfo_=e.bussinessInfo;var t={};if(_A(e.bussinessInfo)&&(t=JSON.parse(e.bussinessInfo)),!vA(e.pureAudioPushMode)){if(!Number.isInteger(Number(e.pureAudioPushMode)))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:JE})});this.pureAudioPushMode_=e.pureAudioPushMode,t.Str_uc_params||(t.Str_uc_params={}),t.Str_uc_params.pure_audio_push_mod=this.pureAudioPushMode_}if(!vA(e.streamId)){if(!(_A(e.streamId)&&String(e.streamId)&&String(e.streamId).length<=64))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:qE})});t.Str_uc_params||(t.Str_uc_params={}),t.Str_uc_params.userdefine_streamid_main=e.streamId}if(!vA(e.userDefineRecordId)){if(null===e.userDefineRecordId.match(/^[A-Za-z0-9_-]{1,64}$/gi))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:KE})});t.Str_uc_params||(t.Str_uc_params={}),t.Str_uc_params.userdefine_record_id=e.userDefineRecordId}if(!vA(e.userDefinePushArgs)){if(!(_A(e.userDefinePushArgs)&&String(e.userDefinePushArgs)&&String(e.userDefinePushArgs).length<=256))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:QE})});t.Str_uc_params||(t.Str_uc_params={}),t.Str_uc_params.userdefine_push_args=e.userDefinePushArgs}uM(t)||(this.bussinessInfo_=JSON.stringify(t))}},{key:"schedule",value:(O=a(n().mark((function e(i){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mK({userId:this.userId_,sdkAppId:this.sdkAppId_,roomId:i,useStringRoomId:this.useStringRoomId_,version:this.version_,userSig:this.userSig_});case 2:(r=e.sent)&&(this.log_.info("schedule: ".concat(JSON.stringify(r))),r.trtcCapability=null==r?void 0:r.trtcAutoConf,this.schedule_=t(t({},this.schedule_),r),jA.emit(nx,this.schedule_));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"getSignalChannelUrl",value:function(){var e={mainUrl:"",backupUrl:""},t=cA();return t?e.mainUrl=e.backupUrl="wss://".concat(t,".rtc.qq.com"):this.proxy_?e.mainUrl=e.backupUrl=this.proxy_:this.unifiedProxy_?e.mainUrl=e.backupUrl="wss://".concat(this.unifiedProxy_):Array.isArray(this.schedule_.domains)&&this.schedule_.domains.length>0&&(e.mainUrl=e.backupUrl="wss://".concat(this.schedule_.domains[0]),this.schedule_.domains[1]&&(e.backupUrl="wss://".concat(this.schedule_.domains[1]))),e}},{key:"getUserId",value:function(){return this.userId_}},{key:"getUserSig",value:function(){return this.userSig_}},{key:"getRole",value:function(){return this.role_}},{key:"getSignalInfo",value:function(){return this.signalInfo_}},{key:"getRoomId",value:function(){return this.roomId_}},{key:"getSDKAppId",value:function(){return this.sdkAppId_}},{key:"getTinyId",value:function(){return this.tinyId_}},{key:"getIceTransportPolicy",value:function(){return this.iceTransportPolicy_||this.schedule_.iceTransportPolicy||"all"}},{key:"initialize",value:function(e){var t=this;this.log_.info("setup signal channel");var n=this.getSignalChannelUrl(),i=n.mainUrl,r=n.backupUrl;return this.signalChannel_=new hM({sdkAppId:this.sdkAppId_,userId:this.userId_,userSig:this.userSig_,roomId:e.roomId,url:i,backupUrl:r,signalDomainWhenUnifiedProxy:this.unifiedProxy_?this.schedule_.domains[0]:void 0,client:this}),this.networkQuality_||(this.networkQuality_=new XO({connections:this.connections_,signalChannel:this.signalChannel_,userId:this.userId_,client:this}),this.networkQuality_.on(BO.NETWORK_QUALITY,(function(e){t.emitter_.emit(BO.NETWORK_QUALITY,e)}))),this.deviceDetector_||(this.deviceDetector_=new $O({client:this})),this.subscriptionManager_||(this.subscriptionManager_=new gq({client:this})),this.badCaseDetector_||(this.badCaseDetector_=new sK({client:this,stats:this.stats_})),this.callDurationCalculator_||(this.callDurationCalculator_=new pK({client:this})),this.mixTranscodeManager_||(this.mixTranscodeManager_=new lK({client:this,signalChannel:this.signalChannel_})),this.publishCDNManager_&&this.publishCDNManager_.setSignalChannel({signalChannel:this.signalChannel_}),this.signalChannel_.on(WP,(function(e){t.log_.info("SignalChannel state changed from ".concat(e.prevState," to ").concat(e.state)),t.emitter_.emit(BO.CONNECTION_STATE_CHANGED,e)})),this.signalChannel_.on(qP,(function(e){t.reset(),t.emitter_.emit(BO.ERROR,e)})),this.signalChannel_.once(GP,(function(e){t.tinyId_=e.signalInfo.tinyId,jA.emit(ZA,{client:t})})),this.signalChannel_.on(eD.PEER_JOIN,this.onPeerJoin,this),this.signalChannel_.on(eD.PEER_LEAVE,this.onPeerLeave,this),this.signalChannel_.on(eD.UPDATE_REMOTE_MUTE_STAT,(function(e){Date.now()-t.lastHeartBeatTime_>=1e4&&t.doHeartbeat(),jA.emit(XA,{client:t,data:e.data}),t.onPublishedUserList(e.data),t.onUpdateRemoteMuteStat(e.data)})),this.signalChannel_.on(eD.CLIENT_BANNED,(function(e){var n,i=e.data.data.reason;if(lM.uploadEvent({log:"stat-banned:".concat(i),userId:t.userId_}),i===oT)n="you got banned by the admin";else if(i===sT)n="duplicated userId joining the room";else if(i===uT)n="the room has been disbanded by the admin",i=i.replace("_","-");else if(i===cT)return t.log_.warn("".concat(i," last heart beat time: ").concat(t.lastHeartBeatTime_," interval: ").concat(Date.now()-t.lastHeartBeatTime_,", visibility: ").concat(document.visibilityState)),void t.reJoin();t.log_["kick"===i?"error":"info"]("user was banned because of [".concat(i,"]")),t.reset(),t.emitter_.emit(BO.CLIENT_BANNED,{reason:i,message:sA({key:mw,data:{message:n,reason:i}})||i})})),jA.emit(YA,{client:this}),this.signalChannel_.connect()}},{key:"preJoin",value:(M=a(n().mark((function e(t){var i,r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.joinOptions_=t,e.next=3,vO();case 3:if(this.checkSystemResult_=e.sent,this.checkDestroy(),(i=cA())||(i=TT,this.proxy_&&(this.proxy_.startsWith(bT)?i=IT:this.proxy_.startsWith(kT)&&(i=ET))),this.env_=i,lM.setConfig({env:i,sdkAppId:this.sdkAppId_,userId:this.userId_,roomId:t.roomId}),this.uploadTrtcStats(),r=this.checkSystemResult_.detail,a=r.isH264EncodeSupported,o=r.isVp8EncodeSupported,uO()&&(a||o)){e.next=13;break}throw new kD({code:bD.NOT_SUPPORTED,message:sA({key:lR})});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"join",value:(D=a(n().mark((function e(t){var i,r=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.roomId_=t.roomId,vA(t.role)||(this.role_=t.role),vA(t.privateMapKey)||(this.privateMapKey_=t.privateMapKey),i=EA(),jA.emit(BA,{client:this}),oM(this.userId_,{eventId:HD,eventDesc:"joining room",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_}),e.next=8,this.preJoin(t);case 8:return e.abrupt("return",new Promise(function(){var e=a(n().mark((function e(a,o){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.joinReject_=o,e.prev=1,r.proxy_||r.schedule_.domains){e.next=5;break}return e.next=5,r.schedule(t.roomId);case 5:return r.checkDestroy(),e.next=8,r.initialize(t);case 8:return e.next=10,r.doJoin(t);case 10:r.signalInfo_=r.signalChannel_.getSignalInfo(),jA.emit(zA,{client:r}),r.joinedTimestamp_=EA(),lM.logSuccessEvent({userId:r.userId_,eventType:iI,delta:r.joinedTimestamp_-i}),lM.logSuccessEvent({userId:r.userId_,eventType:nI}),lM.uploadEvent({log:"stat-autoplay-dialog:".concat(r.enableAutoPlayDialog_),userId:r.userId_}),lM.uploadEvent({log:"stat-conv-".concat(tA,"-").concat(location.hostname),userId:r.userId_}),a(),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),jA.emit(WA,{client:r,error:e.t0}),lM.logFailedEvent({userId:r.userId_,eventType:nI,error:e.t0}),r.reset(),o(e.t0);case 26:r.joinReject_=null;case 27:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,n){return e.apply(this,arguments)}}()));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return D.apply(this,arguments)})},{key:"checkDestroy",value:function(){if(this.isDestroyed_)throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Jw,data:{funName:"join"}})})}},{key:"uploadTrtcStats",value:(P=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l,h,p,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,TQ.getMicrophones();case 3:r=e.sent,t=r&&r.length,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:return e.prev=9,e.next=12,TQ.getCameras();case 12:a=e.sent,i=a&&a.length,e.next=18;break;case 16:e.prev=16,e.t1=e.catch(9);case 18:o={microphone:t,camera:i},s=this.checkSystemResult_.detail,c=s.isH264EncodeSupported,u=s.isVp8EncodeSupported,d=s.isH264DecodeSupported,l=s.isVp8DecodeSupported,h={webRTC:this.basis_.isWebRTCSupported,getUserMedia:this.basis_.isGetUserMediaSupported,webSocket:this.basis_.isWebSocketsSupported,screenShare:this.basis_.isScreenShareSupported,webAudio:this.basis_.isWebAudioSupported,h264Encode:c,h264Decode:d,vp8Encode:u,vp8Decode:l},p={browser:this.basis_.browser,os:this.basis_.os,trtc:h,devices:o},f={isWebCodecSupported:this.basis_.isWebCodecSupported,isMediaSessionSupported:this.basis_.isMediaSessionSupported,isWebTransportSupported:this.basis_.isWebTransportSupported},lM.uploadEvent({log:"trtcstats-"+JSON.stringify(p),userId:this.userId_}),this.log_.info("TrtcStats-"+JSON.stringify(p)),lM.uploadEvent({log:"trtcadvancedstats-"+JSON.stringify(f),userId:this.userId_});case 26:case"end":return e.stop()}}),e,this,[[0,7],[9,16]])}))),function(){return P.apply(this,arguments)})},{key:"doJoin",value:function(e){var t=this;return new Promise((function(e,n){t.log_.info("Join() => joining room: ".concat(t.roomId_," useStringRoomId: ").concat(t.useStringRoomId_," mode: ").concat(t.mode_," role: ").concat(t.role_));var i={roomId:String(t.roomId_),useStringRoomId:t.useStringRoomId_,privateMapKey:t.privateMapKey_,trtcRole:t.role_===LT?OT:NT,trtcScene:t.mode_===MT?DT:PT,sdpSemantics:t.sdpSemantics_,version:LA(t.version_),ua:navigator&&navigator.userAgent||"",autoSubscribe:t.autoSubscribe_,terminalType:eC?4:$R?2:QR?3:RC?12:wC?5:CC?13:1,netType:BI[lA()],bussinessInfo:t.bussinessInfo_,receiveMix:!0};if(t.publishCDNManager_){var r=t.publishCDNManager_.handleCDNConfigForJoinData(t.bussinessInfo_),a=r.bussinessInfo,o=r.pushUserCdnInfo;Object.assign(i,{bussinessInfo:a,pushUserCdnInfo:o})}t.log_.debug("join room signal data: ".concat(JSON.stringify(i))),t.joinTimeout_=setTimeout((function(){t.log_.error("join room timeout observed"),n(new kD({code:bD.JOIN_ROOM_FAILED,message:sA({key:ew})}))}),5e3),jA.emit(HA,{client:t}),t.signalChannel_.once(zP,(function(e){t.clearJoinTimeout(),jA.emit(ZA,{client:t,error:e}),n(e)})),t.signalChannel_.send(iD,i),t.signalChannel_.once(eD.JOIN_ROOM_RESULT,(function(i){t.clearJoinTimeout();var r=i.data,a=r.code,o=r.message,s=r.data;t.onPublishedUserList({data:{userList:s.publishers}}),jA.emit(GA,{client:t,code:a}),0===a?(t.isJoined_=!0,t.log_.info("Join room success, start heartbeat"),t.startHeartbeat(),t.badCaseDetector_&&t.badCaseDetector_.start(),t.syncUserList(),t.startSyncUserListInterval(),e()):(t.log_.error("Join room failed result: "+a+" error: "+o),n(new kD({code:bD.JOIN_ROOM_FAILED,extraCode:a,message:sA({key:tw,data:{error:o,code:a}})})))}))}))}},{key:"reJoin",value:(x=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isJoined_){e.next=3;break}return this.log_.warn("reJoin abort"),e.abrupt("return");case 3:return this.isJoined_=!1,e.prev=4,this.log_.warn("reJoin pending: ".concat(this.joinOptions_.roomId)),this.subscriptionManager_&&this.subscriptionManager_.markAllStream(),this.signalChannel_.close(),e.next=10,this.signalChannel_.connect();case 10:return e.next=12,this.doJoin(t(t({},this.joinOptions_),{},{role:this.role_,privateMapKey:this.privateMapKey_}));case 12:this.log_.warn("reJoin success"),lM.logSuccessEvent({userId:this.userId_,eventType:rI}),this.checkConnectionsToReconnect(),this.uplinkConnection_&&!this.uplinkConnection_.getIsReconnecting()&&this.uplinkConnection_.startReconnection(),this.mixTranscodeManager_&&this.mixTranscodeManager_.reStartMixTranscode(),e.next=25;break;case 19:e.prev=19,e.t0=e.catch(4),this.log_.warn("reJoin fail "+e.t0),this.reset(),lM.logFailedEvent({userId:this.userId_,eventType:rI,error:e.t0}),this.emitter_.emit(BO.ERROR,new kD({code:bD.JOIN_ROOM_FAILED,message:sA({key:nw,data:{roomId:this.joinOptions_.roomId}})}));case 25:case"end":return e.stop()}}),e,this,[[4,19]])}))),function(){return x.apply(this,arguments)})},{key:"leave",value:(A=a(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return jA.emit(JA,{client:this}),oM(this.userId_,{eventId:GD,eventDesc:"leaving room",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_}),e.prev=2,e.next=5,this.doHeartbeat();case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:this.doLeave(),jA.emit(KA,{client:this}),lM.logSuccessEvent({userId:this.userId_,eventType:aI}),t=Math.floor((EA()-this.joinedTimestamp_)/1e3),lM.logSuccessEvent({userId:this.userId_,eventType:oI,delta:t});case 14:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return A.apply(this,arguments)})},{key:"doLeave",value:function(){this.isJoined_&&(jA.emit(qA,{client:this}),this.log_.info("leave() => leaving room"),this.signalChannel_.send(rD),this.reset())}},{key:"clearNetworkQuality",value:function(){this.networkQuality_&&(this.networkQuality_.stop(),this.networkQuality_=null)}},{key:"closeConnections",value:function(){var e=this;this.connections_.forEach((function(t){e.closeDownLink(t.getTinyId())}))}},{key:"clearJoinTimeout",value:function(){clearTimeout(this.joinTimeout_),this.joinTimeout_=-1}},{key:"destroy",value:function(){var e,t,n;if(this.isJoined_)throw this.log_.warn(UR.INVALID_DESTROY),new kD({code:bD.INVALID_OPERATION,message:sA({key:iw})});this.isDestroyed_||(this.log_.info("destroy client"),this.joinReject_&&(this.joinReject_(new kD({code:bD.INVALID_OPERATION,message:sA({key:Jw,data:{funName:"join"}})})),this.clearJoinTimeout(),this.reset()),this.off("*"),null===(e=this.callDurationCalculator_)||void 0===e||e.destroy(),null===(t=this.keyPointManager_)||void 0===t||t.destroy(),null===(n=this.deviceDetector_)||void 0===n||n.destroy(),this.callDurationCalculator_=null,this.keyPointManager_=null,this.deviceDetector_=null,this.badCaseDetector_=null,this.publishCDNManager_=null,this.isDestroyed_=!0,this.spatialManager_=null,jA.emit(tx,{client:this}))}},{key:"reset",value:function(){var e;this.isJoined_=!1,this.keyPointManager_&&this.keyPointManager_.prepareReport(),this.mixTranscodeManager_&&(this.mixTranscodeManager_.reset(),this.mixTranscodeManager_=null),this.publishCDNManager_&&this.publishCDNManager_.reset(),this.userMap_.clear(),this.stopSyncUserListInterval(),this.stopHeartbeat(),this.closeConnections(),this.mutedStates_.clear(),this.clearNetworkQuality(),this.badCaseDetector_&&this.callDurationCalculator_&&this.uploadAllCallStats(),this.closeUplink(),this.signalChannel_&&(this.log_.info("destroying SignalChannel"),this.signalChannel_.close(),this.signalChannel_=null),this.stats_.reset(),null===(e=this.spatialManager_)||void 0===e||e.reset()}},{key:"startSyncUserListInterval",value:function(){-1===this.syncUserListInterval_&&(this.syncUserListInterval_=iO.run(gE,this.syncUserList.bind(this)))}},{key:"stopSyncUserListInterval",value:function(){iO.clearTask(this.syncUserListInterval_),this.syncUserListInterval_=-1}},{key:"syncUserList",value:(C=a(n().mark((function e(){var t,i=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getUserList();case 3:t=e.sent,0!==this.userMap_.size&&this.userMap_.forEach((function(e){t.findIndex((function(t){return t.userId===e.userId}))<0&&(i.log_.info("peer leave detected: ".concat(e.userId)),i.cleanUser({userId:e.userId,tinyId:e.tinyId}))})),t.forEach((function(e){var t=e.userId;i.userMap_.has(t)||t===i.userId_||(i.userMap_.set(t,e),i.emitter_.emit(BO.PEER_JOIN,{userId:t}))})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),this.log_.warn("sync user list failed: "+e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return C.apply(this,arguments)})},{key:"getUserList",value:function(){return this.signalChannel_?this.signalChannel_.sendWaitForResponse({command:gD,responseCommand:eD.USER_LIST_RES,enableLog:!1,timeout:2e3}).then((function(e){var t=e.data,n=t.code,i=t.message;if(0===n)return(t.data&&t.data.userList||[]).map((function(e){var t=e.userId,n=e.srcTinyId,i=e.role;return new cK({userId:t,tinyId:n,role:i})}));throw sA({key:bR,data:{signalResponse:eD.USER_LIST_RES,code:n,message:i}})})):[]}},{key:"publish",value:(R=a(n().mark((function e(t){var i,r,a,o,s,c,u,d,l=this,h=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=h.length>1&&void 0!==h[1]?h[1]:{isAuxiliary:!1},t.setPublishState(GI),this.isPublishing_=!0,r=EA(),jA.emit($A,{client:this,stream:t}),a=i.isAuxiliary,o=a?Hk:rT,s=t.getScreen(),this.log_.info("publish() => publishing ".concat(s?Fk+" ":"").concat(o," stream ").concat(t.getId())),c=this.uplinkConnection_,e.prev=10,c||((c=new nK({userId:this.userId_,tinyId:this.tinyId_,client:this,isUplink:!0,signalChannel:this.signalChannel_,enableSEI:this.enableSEI_,enableSpatial:this.enableSpatial_})).initialize(),c.on(jO.ERROR,(function(e){var t=e.getCode();t!==bD.ICE_TRANSPORT_ERROR&&(t===bD.UPLINK_RECONNECTION_FAILED&&l.closeUplink(),l.emitter_.emit(BO.ERROR,e))}))),t.setConnection(c),e.next=15,c.publish(t,a);case 15:this.log_.info("local ".concat(s?Fk+" ":"").concat(o," stream is published")),this.isPublishing_=!1,a?this.localAuxStream_=t:(this.localStream_=t,this.deviceDetector_&&this.deviceDetector_.setLocalStream(this.localStream_),this.localStream_.getBeautyStatus()&&this.log_.info("beauty stream is published successfully")),t.setPublishState(zI),t.setClient(this,a),this.uplinkConnection_=c,u=EA(),d=u-r,lM.logSuccessEvent({userId:this.userId_,eventType:sI}),lM.logSuccessEvent({userId:this.userId_,eventType:cI,delta:d}),t.hasAudio()&&oM(this.userId_,{eventId:ID,eventDesc:"publish audio track",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_}),t.hasVideo()&&oM(this.userId_,{eventId:TD,eventDesc:"publish video track",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_}),this.networkQuality_&&this.networkQuality_.setUplinkConnection(this.uplinkConnection_),jA.emit(mx,{localStream:t,isAuxiliary:a,client:this}),this.notPublishWithoutH264Supported_=!1,t.isAIDenoiser&&fq.handleFunctionState({fnName:"AI_DENOISER"}),e.next=42;break;case 33:throw e.prev=33,e.t0=e.catch(10),e.t0 instanceof kD&&e.t0.getCode()===bD.NOT_SUPPORTED_H264&&(this.notPublishWithoutH264Supported_=!0),t.setPublishState(HI),c.close(),this.log_.error("failed to publish stream "+e.t0),this.isPublishing_=!1,lM.logFailedEvent({userId:this.userId_,eventType:sI,error:e.t0}),e.t0;case 42:case"end":return e.stop()}}),e,this,[[10,33]])}))),function(e){return R.apply(this,arguments)})},{key:"unpublish",value:(E=a(n().mark((function e(t){var i,r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uplinkConnection_){e.next=2;break}return e.abrupt("return");case 2:return i=t===this.localAuxStream_,r=t.getScreen(),this.log_.info("unpublish() => unpublishing local ".concat(r?Fk+" ":"").concat(i?Hk:rT," stream")),e.prev=5,e.next=8,this.uplinkConnection_.unpublish(t);case 8:t.setClient(null),t.setConnection(null),i?this.localAuxStream_=null:(this.localStream_=null,t.hasAudio()&&oM(this.userId_,{eventId:wD,eventDesc:"unpublish audio track",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_}),t.hasVideo()&&oM(this.userId_,{eventId:ED,eventDesc:"unpublish video track",timestamp:i_(),userId:this.userId_,tinyId:this.tinyId_})),this.localStream_||this.localAuxStream_||this.closeUplink(),lM.logSuccessEvent({userId:this.userId_,eventType:uI}),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(5),lM.logFailedEvent({userId:this.userId_,eventType:uI,error:e.t0}),e.t0;case 19:case"end":return e.stop()}}),e,this,[[5,15]])}))),function(e){return E.apply(this,arguments)})},{key:"closeUplink",value:function(){this.uplinkConnection_&&(this.uplinkConnection_.close(),this.uplinkConnection_=null,this.networkQuality_&&this.networkQuality_.setUplinkConnection(null),this.localStream_&&(this.localStream_.setClient(null),this.localStream_.setConnection(null),this.localStream_=null),this.localAuxStream_&&(this.localAuxStream_.setClient(null),this.localAuxStream_.setConnection(null),this.localAuxStream_=null),this.deviceDetector_&&this.deviceDetector_.setLocalStream(null))}},{key:"closeDownLink",value:function(e){var t=this.connections_.get(e);t&&(t.getIsReconnecting()&&t.stopReconnection(),this.subscriptionManager_&&this.subscriptionManager_.delete(t.getUserId()),t.close(),this.connections_.delete(e),this.mutedStates_.delete(e))}},{key:"subscribe",value:(I=a(n().mark((function e(t,i){var r,a,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.log_.info("subscribe() => subscribe to [".concat(t.getUserId(),"] ").concat(t.getType()," stream with options: ").concat(JSON.stringify(i))),vA(i)&&(i={audio:!0,video:!0}),vA(i.audio)&&(i.audio=!0),vA(i.smallVideo)?vA(i.video)&&(i.video=!0):i.smallVideo?vA(i.video)?(i.video=!1,i.smallVideo=!0):i.video&&(i.video=!0,delete i.smallVideo,this.log_.warn("options.video and options.smallVideo can't be both true")):vA(i.video)&&(i.video=!0,delete i.smallVideo),i.video&&this.changeBigSmallRecords_.delete(t.getUserId()),r=t.getConnection(),i.smallVideo&&(r.getTrackState().smallVideo||(this.setRemoteVideoStreamType(t,"small"),i.video=!0,delete i.smallVideo)),e.prev=7,jA.emit(dx,{client:this,stream:t}),e.next=11,r.subscribe(t,i);case 11:this.subscriptionManager_&&this.subscriptionManager_.addSubscriptionRecord(t.getUserId(),t,i),this.notSubscribeWithoutH264Supported_=!1,lM.logSuccessEvent({userId:this.userId_,eventType:dI}),e.next=24;break;case 16:throw e.prev=16,e.t0=e.catch(7),(a=e.t0 instanceof kD?e.t0.getCode():bD.UNKNOWN)===bD.NOT_SUPPORTED_H264&&(this.notSubscribeWithoutH264Supported_=!0),(o=new kD(a===bD.REMOTE_STREAM_NOT_EXIST?{code:bD.API_CALL_ABORTED,message:sA({key:OR,data:{message:e.t0.message,stream:t}})}:{code:a,message:sA({key:dw,data:{message:e.t0.message,stream:t}})})).getCode()===bD.API_CALL_ABORTED?this.log_.warn(o):this.log_.error(o),lM.logFailedEvent({userId:this.userId_,eventType:dI,error:o}),o;case 24:case"end":return e.stop()}}),e,this,[[7,16]])}))),function(e,t){return I.apply(this,arguments)})},{key:"unsubscribe",value:(b=a(n().mark((function e(t){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.log_.info("unsubscribe() => unsubscribe to [".concat(t.getUserId(),"] ").concat(t.getType()," stream")),e.prev=1,i=t.getConnection(),e.next=5,i.unsubscribe(t);case 5:this.subscriptionManager_&&this.subscriptionManager_.addUnsubscriptionRecord(t.getUserId(),t),jA.emit(hx,{client:this,stream:t}),lM.logSuccessEvent({userId:this.userId_,eventType:lI}),e.next=14;break;case 10:throw e.prev=10,e.t0=e.catch(1),lM.logFailedEvent({userId:this.userId_,eventType:lI,error:e.t0}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e){return b.apply(this,arguments)})},{key:"switchRole",value:(S=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.role_!==t){e.next=2;break}return e.abrupt("return");case 2:return t===UT&&this.uplinkConnection_&&this.closeUplink(),this.log_.info("switchRole() => switch role to: "+t),e.next=6,this.doSwitchRole(t);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"doSwitchRole",value:function(e){var t,n,i=this,r={command:yD,data:{role:e===LT?OT:NT,privateMapKey:this.privateMapKey_},responseCommand:eD.SWITCH_ROLE_RES,retries:(null===(t=this.schedule_.config)||void 0===t||null===(n=t.retries)||void 0===n?void 0:n.switchRole)||1};return this.log_.info("switchRole signal data: "+JSON.stringify(r.data)),this.signalChannel_.sendWaitForResponseWithRetry(r).then((function(t){var n=t.data,r=n.code,a=n.message;if(0!==r)throw new kD({code:bD.SWITCH_ROLE_FAILED,message:sA({key:fw,data:{errMsg:a,errCode:r}})});i.role_=e})).catch((function(e){throw e instanceof kD&&e.getCode()===bD.API_CALL_TIMEOUT&&(e=new kD({code:bD.SWITCH_ROLE_FAILED,message:sA({key:pw})})),i.log_.error(e),e}))}},{key:"on",value:function(e,t,n){this.emitter_.on(e,t,n)}},{key:"off",value:function(e,t,n){"*"===e?this.emitter_.removeAllListeners():this.emitter_.off(e,t,n)}},{key:"getRemoteMutedState",value:function(){var e=this,n=[];return this.mutedStates_.forEach((function(i,r,a){var o=e.connections_.get(r);o&&n.push(t({userId:o.getUserId()},i))})),n}},{key:"getTransportStats",value:(y=a(n().mark((function e(){var t,i,r,a,o,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={rtt:0,downlinksRTT:{}},!this.uplinkConnection_){e.next=6;break}return e.next=4,this.stats_.getSenderStats(this.uplinkConnection_);case 4:i=e.sent,t.rtt=i.rtt;case 6:r=w(this.connections_),e.prev=7,r.s();case 9:if((a=r.n()).done){e.next=17;break}return(o=k(a.value,2))[0],s=o[1],e.next=13,this.stats_.getReceiverStats(s);case 13:c=e.sent,t.downlinksRTT[c.userId]=c.rtt;case 15:e.next=9;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),r.e(e.t0);case 22:return e.prev=22,r.f(),e.finish(22);case 25:return e.abrupt("return",t);case 26:case"end":return e.stop()}}),e,this,[[7,19,22,25]])}))),function(){return y.apply(this,arguments)})},{key:"getLocalAudioStats",value:(g=a(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t={})[this.userId_]={bytesSent:0,packetsSent:0},!this.uplinkConnection_){e.next=7;break}return e.next=5,this.stats_.getSenderStats(this.uplinkConnection_);case 5:i=e.sent,t[this.userId_]={bytesSent:i.audio.bytesSent,packetsSent:i.audio.packetsSent};case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"getLocalVideoStats",value:(_=a(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t={})[this.userId_]={bytesSent:0,packetsSent:0,framesEncoded:0,framesSent:0,frameWidth:0,frameHeight:0},!this.uplinkConnection_){e.next=7;break}return e.next=5,this.stats_.getSenderStats(this.uplinkConnection_);case 5:i=e.sent,t[this.userId_]={bytesSent:i.video.bytesSent,packetsSent:i.video.packetsSent,framesEncoded:i.video.framesEncoded,framesSent:i.video.framesSent,frameWidth:i.video.frameWidth,frameHeight:i.video.frameHeight};case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"getRemoteAudioStats",value:(v=a(n().mark((function e(){var t,i,r,a,o,s,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t={},i=w(this.connections_),e.prev=2,i.s();case 4:if((r=i.n()).done){e.next=13;break}return(a=k(r.value,2))[0],o=a[1],s=o.getDelay(),c=s.audioDelay,e.next=9,this.stats_.getReceiverStats(o);case 9:(u=e.sent).hasAudio&&(t[u.userId]={bytesReceived:u.audio.bytesReceived,packetsReceived:u.audio.packetsReceived,packetsLost:u.audio.packetsLost,end2EndDelay:c});case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),i.e(e.t0);case 18:return e.prev=18,i.f(),e.finish(18);case 21:return e.abrupt("return",t);case 22:case"end":return e.stop()}}),e,this,[[2,15,18,21]])}))),function(){return v.apply(this,arguments)})},{key:"getRemoteVideoStats",value:(m=a(n().mark((function e(){var t,i,r,a,o,s,c,u,d,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.length>0&&void 0!==l[0]?l[0]:BT,i={},r=w(this.connections_),e.prev=3,r.s();case 5:if((a=r.n()).done){e.next=15;break}return(o=k(a.value,2))[0],s=o[1],e.next=9,this.stats_.getReceiverStats(s);case 9:c=e.sent,u=s.getDelay(),d=u.videoDelay,t===BT&&c.hasVideo&&(i[c.userId]={bytesReceived:c.video.bytesReceived,packetsReceived:c.video.packetsReceived,packetsLost:c.video.packetsLost,framesDecoded:c.video.framesDecoded,frameWidth:c.video.frameWidth,frameHeight:c.video.frameHeight,end2EndDelay:d}),t===HT&&c.hasAuxiliary&&(i[c.userId]={bytesReceived:c.auxiliary.bytesReceived,packetsReceived:c.auxiliary.packetsReceived,packetsLost:c.auxiliary.packetsLost,framesDecoded:c.auxiliary.framesDecoded,frameWidth:c.auxiliary.frameWidth,frameHeight:c.auxiliary.frameHeight,end2EndDelay:d});case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),r.e(e.t0);case 20:return e.prev=20,r.f(),e.finish(20);case 23:return e.abrupt("return",i);case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])}))),function(){return m.apply(this,arguments)})},{key:"getSdpSemantics",value:function(){return this.sdpSemantics_}},{key:"getIceServers",value:function(){return 0===this.turnServers_.length&&this.schedule_.iceServers?this.schedule_.iceServers:this.turnServers_}},{key:"getConnections",value:function(){return this.connections_}},{key:"getMutedStates",value:function(){return this.mutedStates_}},{key:"startHeartbeat",value:function(){-1===this.heartbeat_&&(this.log_.info("startHeartbeat..."),this.heartbeat_=iO.run(gE,this.doHeartbeat.bind(this),{delay:2e3}))}},{key:"stopHeartbeat",value:function(){-1!==this.heartbeat_&&(this.log_.info("stopHeartbeat"),iO.clearTask(this.heartbeat_),this.heartbeat_=-1,this.lastHeartBeatTime_=-1)}},{key:"doHeartbeat",value:(f=a(n().mark((function e(){var i,r,a,o,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.badCaseDetector_.getMonitorFreeze(),e.next=3,this.stats_.getStatsReport({uplinkConnection:this.uplinkConnection_,downlinkConnections:this.connections_,freezeMap:r});case 3:if(a=e.sent,jA.emit(QA,{client:this,stats:a}),null===(i=this.badCaseDetector_)||void 0===i||i.resetMonitor(),this.signalChannel_){e.next=8;break}return e.abrupt("return");case 8:o=this.signalChannel_.isConnected()?sM(this.userId_):[],s=t(t({str_sdk_version:this.version_,uint64_datetime:(new Date).getTime(),msg_user_info:{str_identifier:this.userId_,uint64_tinyid:this.tinyId_},msg_device_info:{uint32_terminal_type:15,str_device_name:navigator.platform,str_os_version:"",uint32_net_type:BI[this.networkType_]}},a),{},{msg_event_msg:o}),this.signalChannel_.send(aD,s),c=Date.now(),this.lastHeartBeatTime_>0&&c-this.lastHeartBeatTime_>1e4&&this.log_.warn("heartbeat took ".concat(c-this.lastHeartBeatTime_)),this.lastHeartBeatTime_=c,!this.isRelayChanged_&&this.isRelayMaybeFailed()&&(this.reJoin(),this.isRelayChanged_=!0);case 15:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"onRemoteStreamAdded",value:function(e){var t=e.content,n=t.userId,i=t.tinyId,r=t.audio,a=t.bigVideo,o=t.auxVideo,s=t.smallVideo;if(null!==n){this.userMap_.has(n)||(this.userMap_.set(n,new cK({userId:n,tinyId:i,role:LT})),this.emitter_.emit(BO.PEER_JOIN,{userId:n}));var c=this.connections_.get(i);if(c){if(c.getIsReconnecting())return;this.log_.warn("duplicated stream-added observed, rebuild the connection"),c.close(),this.connections_.delete(i)}var u={audio:r,video:a,auxiliary:o,smallVideo:s};this.log_.info("remote peer [".concat(n,"] published stream. trackState: ").concat(JSON.stringify(u))),this.createDownlinkConnection({userId:n,tinyId:i,trackState:u})}else this.log_.warn("received null userId on stream added")}},{key:"createDownlinkConnection",value:function(e){var t=this,n=e.userId,i=e.tinyId,r=e.trackState,a=new aK({userId:n,tinyId:i,client:this,isUplink:!1,signalChannel:this.signalChannel_,autoSubscribe:this.autoSubscribe_,trackState:r,enableSEI:this.enableSEI_,enableSpatial:this.enableSpatial_});this.connections_.set(i,a),this.installDownlinkEvents(a,n,i),this.autoSubscribe_?(a.initialize(),a.connect().catch((function(){!a.getMainStream()&&a.hasMainStream()&&t.initRemoteStream({type:BT,userId:n,downlinkConnection:a}),!a.getAuxStream()&&a.hasAuxStream()&&t.initRemoteStream({type:HT,userId:n,downlinkConnection:a})}))):(a.hasMainStream()&&this.initRemoteStream({type:BT,userId:n,downlinkConnection:a}),a.hasAuxStream()&&this.initRemoteStream({type:HT,userId:n,downlinkConnection:a}))}},{key:"initRemoteStream",value:function(e){var t=e.type,n=e.userId,i=e.downlinkConnection,r=new _q({type:t,userId:n,client:this});r.setConnection(i),i.setRemoteStream(t===BT?VT:FT,r),r.setIsStreamAddedEventEmitted(!0),jA.emit(ux,{client:this,stream:r}),this.emitter_.emit(BO.STREAM_ADDED,{stream:r})}},{key:"installDownlinkEvents",value:function(e,t,n){var i=this;e.on(jO.SEI_MESSAGE,(function(e){i.emitter_.emit(BO.SEI_MESSAGE,e)})),e.on(jO.STREAM_ADDED,(function(e){e.stream.setIsStreamAddedEventEmitted(!0),jA.emit(ux,{client:i,stream:e.stream}),i.emitter_.emit(BO.STREAM_ADDED,{stream:e.stream})})),e.on(jO.STREAM_REMOVED,(function(e){i.changeBigSmallRecords_.delete(e.stream.getUserId()),e.stream.stop(),e.stream.setIsStreamAddedEventEmitted(!1),i.subscriptionManager_&&i.subscriptionManager_.deleteAutoRecoveryFlag(e.stream.getUserId(),e.stream.getType()),jA.emit(fx,{client:i,stream:e.stream}),i.emitter_.emit(BO.STREAM_REMOVED,{stream:e.stream})})),e.on(jO.STREAM_UPDATED,(function(t){jA.emit(px,{client:i,stream:t.stream});var n=e.getMixUserList();n&&(t.mixUserList=n),i.emitter_.emit(BO.STREAM_UPDATED,t)})),e.on(jO.STREAM_SUBSCRIBED,(function(e){jA.emit(lx,{client:i,stream:e.stream}),i.emitter_.emit(BO.STREAM_SUBSCRIBED,{stream:e.stream})})),e.on(jO.ERROR,(function(e){var t=e.getCode();t!==bD.ICE_TRANSPORT_ERROR&&(t===bD.DOWNLINK_RECONNECTION_FAILED&&i.closeDownLink(n),i.emitter_.emit(BO.ERROR,e))}))}},{key:"onPeerJoin",value:function(e){var t=e.data.data,n=t.srcTinyId,i=t.userId,r=t.role;this.userMap_.has(i)||(this.userMap_.set(i,new cK({userId:i,tinyId:n,role:r})),this.emitter_.emit(BO.PEER_JOIN,{userId:i}))}},{key:"onPeerLeave",value:function(e){var t=e.data.data,n=t.srcTinyId,i=t.userId,r=t.reason,a=void 0===r?0:r;this.log_.info("peer leave [".concat(i,"]: ").concat(vE[a])),this.cleanUser({userId:i,tinyId:n})}},{key:"cleanUser",value:function(e){var t,n=e.userId,i=e.tinyId;this.userMap_.delete(n),this.closeDownLink(i),this.emitter_.emit(BO.PEER_LEAVE,{userId:n}),null===(t=this.spatialManager_)||void 0===t||t.delete(n)}},{key:"onPublishedUserList",value:function(e){var t=this;try{var n=T(e.data.userList);e.data.mixRobotList&&n.push.apply(n,T(e.data.mixRobotList));var i=n.map((function(e){return e.userId}));this.connections_.forEach((function(e){var n=e.getUserId(),r=e.getTinyId();i.findIndex((function(e){return e===n}))<0&&(t.log_.info("peer unpublished detected [".concat(n,"]")),t.closeDownLink(r))})),n.forEach((function(e){var n=e.userId,i=e.srcTinyId,r=e.flag,a=e.mixUserList;if(n!==t.userId_){var o=!!(1&r),s=!!(8&r),c=!!(4&r),u=!!(2&r),d=t.connections_.get(i);if((u||o)&&t.checkSubscribeBigSmallVideo(d,u),d){var l=d.getTrackState(),h=l.audio,p=l.video,f=l.auxiliary,m=l.smallVideo;bA(a)&&d.setMixUserList(a),!p&&o&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.ADD,kind:Vk}),!h&&s&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.ADD,kind:Uk}),!f&&c&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.ADD,kind:Hk}),!m&&u&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.ADD,kind:zk}),p&&!o&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.REMOVE,kind:Vk}),h&&!s&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.REMOVE,kind:Uk}),f&&!c&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.REMOVE,kind:Hk}),m&&!u&&jA.emit(cx,{client:t,tinyId:i,userId:n,action:jI.REMOVE,kind:zk})}else t.log_.info("peer published detected [".concat(n,"]")),t.onRemoteStreamAdded({content:{audio:s,bigVideo:o,auxVideo:c,smallVideo:u,userId:n,tinyId:i}})}}))}catch(IQ){}}},{key:"onUpdateRemoteMuteStat",value:function(e){var t=this,n=e.data;(n&&n.userList||[]).forEach((function(e){var n=e.srcTinyId,i=e.userId;if(0!==n&&n!==t.tinyId_){var r=t.connections_.get(n);if(r){var a=r.getMainStream();if(a&&a.getIsStreamAddedEventEmitted()){var o=!!(1&e.flag),s=!!(8&e.flag),c=!!(2&e.flag),u=!!(64&e.flag),d=!!(16&e.flag),l=t.mutedStates_.get(n);if(void 0===l)return t.mutedStates_.set(n,{hasAudio:s,hasVideo:o,hasSmall:c,audioMuted:u,videoMuted:d}),o?d?t.emitter_.emit(BO.MUTE_VIDEO,{userId:i}):t.emitter_.emit(BO.UNMUTE_VIDEO,{userId:i}):t.emitter_.emit(BO.MUTE_VIDEO,{userId:i}),void(s?u?t.emitter_.emit(BO.MUTE_AUDIO,{userId:i}):t.emitter_.emit(BO.UNMUTE_AUDIO,{userId:i}):t.emitter_.emit(BO.MUTE_AUDIO,{userId:i}));var h=!l.audioMuted&&l.hasAudio,p=!u&&s,f=!l.videoMuted&&l.hasVideo,m=!d&&o;t.mutedStates_.set(n,{hasAudio:s,hasVideo:o,hasSmall:c,audioMuted:u,videoMuted:d}),h!==p&&(p?t.emitter_.emit(BO.UNMUTE_AUDIO,{userId:i}):t.emitter_.emit(BO.MUTE_AUDIO,{userId:i})),f!==m&&(m?t.emitter_.emit(BO.UNMUTE_VIDEO,{userId:i}):t.emitter_.emit(BO.MUTE_VIDEO,{userId:i}))}}else t.mutedStates_.delete(n)}}))}},{key:"getEnv",value:function(){return this.env_}},{key:"getSubscriptionManager",value:function(){return this.subscriptionManager_}},{key:"startPublishCDNStream",value:(p=a(n().mark((function e(){var t,i=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:{},this.log_.info("startPublishCDNStream with params: ".concat(JSON.stringify(t),"; isJoined: ").concat(this.isJoined_,"; hasMainStream: ").concat(!!this.localStream_,"; hasAuxStream: ").concat(!!this.localAuxStream_,";")),t.streamType=t.streamType||rT,t.streamType===Hk&&(t.streamType=Gk),t.streamId=t.streamId||"",!this.isJoined_){e.next=10;break}if(t.streamType!==rT||this.localStream_){e.next=8;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:vw})});case 8:if(t.streamType!==Gk||this.localAuxStream_){e.next=10;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:vw})});case 10:return e.next=12,this.publishCDNManager_.startPublishTencentCDN(t);case 12:if(!(t.appId&&t.bizId&&t.url)){e.next=15;break}return e.next=15,this.publishCDNManager_.startPublishGivenCDN(t);case 15:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"stopPublishCDNStream",value:(h=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.publishCDNManager_.getIsPublishingTencentCDN()){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:_w})});case 2:return this.log_.info("stopPublishCDNStream"),e.next=5,this.publishCDNManager_.stopPublishTencentCDN();case 5:if(!this.publishCDNManager_.getIsPublishingGivenCDN()){e.next=8;break}return e.next=8,this.publishCDNManager_.stopPublishGivenCDN();case 8:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"startMixTranscode",value:(l=a(n().mark((function e(t){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isJoined_&&this.mixTranscodeManager_){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:bw})});case 2:return vA(t.mode)&&(t.mode=DI.MANUAL),e.prev=3,this.log_.info("startMixTranscode with config ".concat(JSON.stringify(t))),lM.uploadEvent({log:"mix-transcode-mode:".concat(t.mode),userId:this.userId_}),e.next=8,this.mixTranscodeManager_.startMixTranscode(t);case 8:lM.logSuccessEvent({userId:this.userId_,eventType:II}),e.next=15;break;case 11:throw e.prev=11,e.t0=e.catch(3),lM.logFailedEvent({userId:this.userId_,eventType:II,error:e.t0}),e.t0;case 15:case"end":return e.stop()}}),e,this,[[3,11]])}))),function(e){return l.apply(this,arguments)})},{key:"stopMixTranscode",value:(d=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isJoined_&&this.mixTranscodeManager_){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:kw})});case 2:return e.prev=2,e.next=5,this.mixTranscodeManager_.stopMixTranscode();case 5:lM.logSuccessEvent({userId:this.userId_,eventType:EI}),e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(2),lM.logFailedEvent({userId:this.userId_,eventType:EI,error:e.t0}),e.t0;case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(){return d.apply(this,arguments)})},{key:"getSystemResult",value:function(){return this.checkSystemResult_}},{key:"enableAudioVolumeEvaluation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!gA(t))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Tw})});if(this.log_.info("enableAudioVolumeEvaluation with interval: "+t),t<=0)return this.enableAudioVolumeEvaluation_=!1,iO.clearTask(this.audioVolumeIntervalId_),void(this.audioVolumeIntervalId_=null);t=Math.floor(Math.max(t,16)),jA.emit(ix,{interval:t}),this.audioVolumeIntervalId_&&(iO.clearTask(this.audioVolumeIntervalId_),this.audioVolumeIntervalId_=null),this.enableAudioVolumeEvaluation_=!0,this.audioVolumeIntervalId_=iO.run(yE,(function(){var t=[];if(e.localStream_){var n=Math.floor(100*e.localStream_.getAudioLevel());t.push({userId:e.userId_,audioVolume:n,stream:e.localStream_})}e.connections_.forEach((function(e){var n=e.getSubscribedMainStream();if(n){var i=Math.floor(100*n.getAudioLevel());t.push({userId:e.getUserId(),audioVolume:i,stream:n})}})),e.emitter_.emit(BO.AUDIO_VOLUME,{result:t})}),{fps:1e3/t,backgroundTask:n})}},{key:"callExperimentalAPI",value:function(e,n){return TK.call(e,t({client:this},n))}},{key:"setProperty",value:function(e,t){var n="".concat(e,"_");vA(this[n])||(this[n]=t)}},{key:"uploadAllCallStats",value:function(){var e=this;this.callDurationCalculator_.getDurationMap().forEach((function(t,n){var i={userId:t.userId,type:t.type,duration:e.callDurationCalculator_.getDuration(n,Vk),dataFreeze:e.badCaseDetector_.getDataFreezeDuration(n).dataFreeze,renderFreeze:e.badCaseDetector_.getRenderFreezeDuration(n).renderFreeze};lM.uploadEvent({log:"callStats-"+JSON.stringify(i),userId:e.userId_})})),this.badCaseDetector_.stop(),this.callDurationCalculator_.reset()}},{key:"enableSmallStream",value:(u=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPublished()&&!this.isPublishing_){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Iw})});case 2:if(!LO()){e.next=7;break}this.setIsEnableSmallStream(!0),this.log_.info("SmallStream successfully enabled"),e.next=8;break;case 7:throw new kD({code:bD.INVALID_OPERATION,message:sA({key:ww})});case 8:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"disableSmallStream",value:(s=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPublished()&&!this.isPublishing_){e.next=2;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:Ew})});case 2:this.setIsEnableSmallStream(!1),this.log_.info("SmallStream successfully disabled");case 4:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"setSmallStreamProfile",value:function(e){var t=this;e&&e.framerate&&(e.frameRate=e.framerate),e.width*e.height>307200&&(e.width=320,e.height=240,this.log_.info("Small stream resolution is beyond limitation, which is invalid. Reset to 320 * 240")),Object.keys(this.smallStreamConfig_).forEach((function(n){e[n]&&(t.smallStreamConfig_[n]=e[n])}));var n=this.smallStreamConfig_,i=n.width,r=n.height,a=n.bitrate,o=n.frameRate;if(this.log_.info("setSmallStreamProfile: bitrate=".concat(a,", frameRate=").concat(o,", height=").concat(r,", width=").concat(i)),i<0||r<0||a<0||o<0)throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Rw})})}},{key:"setRemoteVideoStreamType",value:(r=a(n().mark((function e(t,i){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t instanceof _q){e.next=2;break}throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:Cw})});case 2:if(t.getConnection()){e.next=4;break}throw new kD({code:bD.INVALID_OPERATION,message:sA({key:uw})});case 4:if(t.getType()!==HT){e.next=6;break}return e.abrupt("return");case 6:e.t0=i,e.next=e.t0===WI||e.t0===JI?9:12;break;case 9:return e.next=11,this.changeVideoType(t,i);case 11:case 12:return e.abrupt("break",13);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"changeVideoType",value:(i=a(n().mark((function e(t,i){var r,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.getUserId(),a={stream:t,options:{video:i===WI,smallVideo:i===JI},isSubscribing:!1,reSubscribeCount:10},this.changeBigSmallRecords_.set(r,a),this.log_.info("set [".concat(r,"] ").concat(t.getType()," stream video prefer type: ").concat(i));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"checkSubscribeBigSmallVideo",value:(e=a(n().mark((function e(t,i){var r,a,o,s,c,u,d,l,h,p,f;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.isBigStreamSubscribed||null!=t&&t.isSmallStreamSubscribed){e.next=2;break}return e.abrupt("return");case 2:if(r=t.getUserId(),this.changeBigSmallRecords_.has(r)){e.next=5;break}return e.abrupt("return");case 5:if(a=this.changeBigSmallRecords_.get(r),o=t.getSubscribeState(),s=o.video,c=o.smallVideo,u=a.stream,d=a.options,l=a.isSubscribing,h=a.reSubscribeCount,!(d.video&&s||d.smallVideo&&c&&i)){e.next=10;break}return e.abrupt("return");case 10:if(p={video:d.video,smallVideo:d.smallVideo},!(i&&t.isBigStreamSubscribed||t.isSmallStreamSubscribed)){e.next=31;break}if(e.prev=12,!(d&&u&&!l&&h>=1)){e.next=24;break}return a.isSubscribing=!0,a.reSubscribeCount=h-1,f=u.getConnection(),!i&&f.isSmallStreamSubscribed&&(p={video:!0,smallVideo:!1}),p.emitEvent=!1,e.next=21,null==f?void 0:f.subscribe(u,p);case 21:this.log_.info("change [".concat(r,"] to ").concat(p.smallVideo?"small":"big"," video successfully. count ").concat(10-a.reSubscribeCount,".")),a.isSubscribing=!1,a.reSubscribeCount=10;case 24:e.next=31;break;case 26:e.prev=26,e.t0=e.catch(12),this.log_.info("change [".concat(r,"] to ").concat(p.smallVideo?"small":"big"," video failed. count ").concat(10-a.reSubscribeCount,".")),a.isSubscribing=!1,0===h&&this.changeBigSmallRecords_.delete(r);case 31:case"end":return e.stop()}}),e,this,[[12,26]])}))),function(t,n){return e.apply(this,arguments)})},{key:"setIsEnableSmallStream",value:function(e){this.isEnableSmallStream_=e}},{key:"getIsEnableSmallStream",value:function(){return this.isEnableSmallStream_}},{key:"smallStreamConfig",get:function(){return this.smallStreamConfig_}},{key:"isPublished",value:function(){return!!this.localStream_}},{key:"getUplinkConnection",value:function(){return this.uplinkConnection_}},{key:"getLocalStream",value:function(){return this.localStream_}},{key:"getMode",value:function(){return this.mode_}},{key:"getBadCaseDetector",value:function(){return this.badCaseDetector_}},{key:"getCallDurationCalculator",value:function(){return this.callDurationCalculator_}},{key:"getIsJoined",value:function(){return this.isJoined_}},{key:"getAllConnections",value:function(){var e=T(this.connections_.values());return this.uplinkConnection_&&e.push(this.uplinkConnection_),e}},{key:"isRelayMaybeFailed",value:function(){if(!this.signalChannel_.isOnline)return!1;var e=this.getAllConnections();if(0===e.length)return!1;for(var t=0;t<e.length;t++)if(e[t].getReconnectionCount()<6)return!1;return!0}},{key:"getUseStringRoomId",value:function(){return this.useStringRoomId_}},{key:"checkConnectionsToReconnect",value:function(){var e=this;this.getAllConnections().forEach((function(t){if(!t.getIsReconnecting()){var n=t.getPeerConnection();n&&n.connectionState===$T&&(e.log_.warn("[".concat(t.getUserId(),"] pc is closed but not reconnect")),t.startReconnection())}}))}},{key:"getEnableAutoPlayDialog",value:function(){return this.enableAutoPlayDialog_}},{key:"sendSEIMessage",value:function(e,t){this.uplinkConnection_.sendSEI(e,t)}},{key:"enable3DSpatialAudioEffect",value:function(e){if(!AO())throw new kD({code:bD.INVALID_OPERATION,message:sA({key:LR})});return this.log_.debug("3DSpatialAudioEffect enabled: ".concat(e)),this.enableSpatial_=e,e&&!this.spatialManager_&&(this.spatialManager_=new gQ({client:this,log:this.log_})),this.enableSpatial_}},{key:"updateSelf3DSpatialPosition",value:function(e,t,n,i){var r;null===(r=this.spatialManager_)||void 0===r||r.updateSelfPosition(e,t,n,i)}},{key:"updateRemote3DSpatialPosition",value:function(e,t){var n;null===(n=this.spatialManager_)||void 0===n||n.updateRemote3DSpatialPosition(e,t)}},{key:"set3DSpatialReceivingRange",value:function(e){var t;this.log_.debug("update receiving range: ".concat(e)),null===(t=this.spatialManager_)||void 0===t||t.updateMaxDistance(e>0?e:0)}},{key:"isSpatialEnabled",get:function(){return this.enableSpatial_&&AO()}},{key:"getSpatialManager",value:function(){return this.spatialManager_}},{key:"setProxyServer",value:function(e){if(this.log_.info("set proxy server: ".concat(JSON.stringify(e))),_A(e)){if(!e.startsWith("wss://"))throw new kD({code:bD.INVALID_PARAMETER,message:sA({key:XE})});this.proxy_=e}else if(hA(e)){var t=e.websocketProxy,n=e.loggerProxy,i=e.scheduleProxy,r=e.unifiedProxy;t&&(this.proxy_=t),n&&xT(n),i&&ZI(i),r&&(this.unifiedProxy_=r,xT("https://".concat(r)),ZI(r))}}},{key:"setTurnServer",value:function(e){this.log_.info("set turn server: "+JSON.stringify(e));var t=[];Array.isArray(e)?e.forEach((function(e){return t.push(IA(e))})):hA(e)&&t.push(IA(e)),this.turnServers_=t}},{key:"get2k4kFlag",value:function(){var e,t;return null===(e=this.schedule_)||void 0===e||null===(t=e.trtcCapability)||void 0===t?void 0:t["2k4k"]}}]),Client}(),C(rQ.prototype,"join",[IK,EK],Object.getOwnPropertyDescriptor(rQ.prototype,"join"),rQ.prototype),C(rQ.prototype,"leave",[wK],Object.getOwnPropertyDescriptor(rQ.prototype,"leave"),rQ.prototype),C(rQ.prototype,"getUserList",[RK],Object.getOwnPropertyDescriptor(rQ.prototype,"getUserList"),rQ.prototype),C(rQ.prototype,"publish",[CK,AK,xK],Object.getOwnPropertyDescriptor(rQ.prototype,"publish"),rQ.prototype),C(rQ.prototype,"unpublish",[PK,DK],Object.getOwnPropertyDescriptor(rQ.prototype,"unpublish"),rQ.prototype),C(rQ.prototype,"subscribe",[MK],Object.getOwnPropertyDescriptor(rQ.prototype,"subscribe"),rQ.prototype),C(rQ.prototype,"unsubscribe",[OK],Object.getOwnPropertyDescriptor(rQ.prototype,"unsubscribe"),rQ.prototype),C(rQ.prototype,"switchRole",[NK,LK,UK],Object.getOwnPropertyDescriptor(rQ.prototype,"switchRole"),rQ.prototype),C(rQ.prototype,"startPublishCDNStream",[VK,FK],Object.getOwnPropertyDescriptor(rQ.prototype,"startPublishCDNStream"),rQ.prototype),C(rQ.prototype,"stopPublishCDNStream",[jK],Object.getOwnPropertyDescriptor(rQ.prototype,"stopPublishCDNStream"),rQ.prototype),C(rQ.prototype,"startMixTranscode",[BK,HK],Object.getOwnPropertyDescriptor(rQ.prototype,"startMixTranscode"),rQ.prototype),C(rQ.prototype,"stopMixTranscode",[GK],Object.getOwnPropertyDescriptor(rQ.prototype,"stopMixTranscode"),rQ.prototype),C(rQ.prototype,"enableAudioVolumeEvaluation",[zK],Object.getOwnPropertyDescriptor(rQ.prototype,"enableAudioVolumeEvaluation"),rQ.prototype),C(rQ.prototype,"enableSmallStream",[WK],Object.getOwnPropertyDescriptor(rQ.prototype,"enableSmallStream"),rQ.prototype),C(rQ.prototype,"disableSmallStream",[JK],Object.getOwnPropertyDescriptor(rQ.prototype,"disableSmallStream"),rQ.prototype),C(rQ.prototype,"setSmallStreamProfile",[qK],Object.getOwnPropertyDescriptor(rQ.prototype,"setSmallStreamProfile"),rQ.prototype),C(rQ.prototype,"setRemoteVideoStreamType",[KK],Object.getOwnPropertyDescriptor(rQ.prototype,"setRemoteVideoStreamType"),rQ.prototype),C(rQ.prototype,"sendSEIMessage",[QK,XK,$K],Object.getOwnPropertyDescriptor(rQ.prototype,"sendSEIMessage"),rQ.prototype),C(rQ.prototype,"enable3DSpatialAudioEffect",[YK],Object.getOwnPropertyDescriptor(rQ.prototype,"enable3DSpatialAudioEffect"),rQ.prototype),C(rQ.prototype,"updateSelf3DSpatialPosition",[ZK],Object.getOwnPropertyDescriptor(rQ.prototype,"updateSelf3DSpatialPosition"),rQ.prototype),C(rQ.prototype,"updateRemote3DSpatialPosition",[eQ],Object.getOwnPropertyDescriptor(rQ.prototype,"updateRemote3DSpatialPosition"),rQ.prototype),C(rQ.prototype,"set3DSpatialReceivingRange",[tQ],Object.getOwnPropertyDescriptor(rQ.prototype,"set3DSpatialReceivingRange"),rQ.prototype),C(rQ.prototype,"setProxyServer",[nQ],Object.getOwnPropertyDescriptor(rQ.prototype,"setProxyServer"),rQ.prototype),C(rQ.prototype,"setTurnServer",[iQ],Object.getOwnPropertyDescriptor(rQ.prototype,"setTurnServer"),rQ.prototype),rQ),SQ=0,bQ=0,kQ=(uQ=mq(eE),dQ=mq(eE),lQ=mq(eE),hQ=QJ(KJ.TRTC.createClient),pQ=mq(eE),fQ=QJ(KJ.TRTC.createStream),mQ=function(){function e(){o(this,e),this.name_=eE,this.VERSION=Wa,this.Logger={loggerManager:Vx,LogLevel:fE,setLogLevel:function(e){Vx.setLogLevel(e),e<=1&&oA()},enableUploadLog:function(){fq.handleFunctionState({fnName:"TRTC.enableUploadLog"}),Vx.enableUploadLog()},disableUploadLog:function(){Vx.warn("disableUploadLog"),fq.handleFunctionState({fnName:"TRTC.disableUploadLog"}),Vx.disableUploadLog()}}}var i;return c(e,[{key:"checkSystemRequirements",value:(i=a(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vO();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"isScreenShareSupported",value:function(){return yO()}},{key:"isSmallStreamSupported",value:function(){return LO()}},{key:"getDevices",value:function(){return nN()}},{key:"getCameras",value:function(){return function(){return YO.apply(this,arguments)}()}},{key:"getMicrophones",value:function(){return rN()}},{key:"getSpeakers",value:function(){return function(){return oN.apply(this,arguments)}()}},{key:"createClient",value:function(e){Fx&&(Fx=!1,Vx.getLogLevel()!=TQ.Logger.LogLevel.NONE&&(console.info("******************************************************************************"),console.info("* TRTC Web SDK"),console.info("* API Document: "+"".concat(dE,"index.html")),console.info("* Changelog: https://cloud.tencent.com/document/product/647/38958"),console.info("* Report issues: https://github.com/LiteAVSDK/TRTC_Web/issues"),console.info("******************************************************************************")),Vx.info("TRTC Web SDK Version: 4.15.9"),Vx.info("UserAgent: "+navigator.userAgent),Vx.info("URL of current page: "+location.href));var n={version:this.VERSION},i=new yQ(t(t(t({},n),e),{},{seq:++SQ}));return jA.emit(ex,{client:i}),i}},{key:"createStream",value:function(e){return new eK(t(t({},e),{},{seq:++bQ}))}}]),e}(),C(mQ.prototype,"checkSystemRequirements",[uQ],Object.getOwnPropertyDescriptor(mQ.prototype,"checkSystemRequirements"),mQ.prototype),C(mQ.prototype,"isScreenShareSupported",[dQ],Object.getOwnPropertyDescriptor(mQ.prototype,"isScreenShareSupported"),mQ.prototype),C(mQ.prototype,"isSmallStreamSupported",[lQ],Object.getOwnPropertyDescriptor(mQ.prototype,"isSmallStreamSupported"),mQ.prototype),C(mQ.prototype,"createClient",[hQ,pQ],Object.getOwnPropertyDescriptor(mQ.prototype,"createClient"),mQ.prototype),C(mQ.prototype,"createStream",[fQ],Object.getOwnPropertyDescriptor(mQ.prototype,"createStream"),mQ.prototype),mQ),TQ=new kQ;return TQ}));