@byteplus/rtc 4.36.0-rc.0 → 4.36.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2020 The BytePlusRTC project authors. All Rights Reserved.
3
+ * @brief BytePlusRTC Advance API
4
+ * version: 4.36.0-rc.1
5
+ */
6
+ function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(e){return e&&e.Math==Math&&e},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")(),i={},o=function(e){try{return!!e()}catch(e){return!0}},a=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=s,u=Function.prototype.call,d=c?u.bind(u):function(){return u.apply(u,arguments)},l={},f={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p=h&&!f.call({1:2},1);l.f=p?function(e){var t=h(this,e);return!!t&&t.enumerable}:f;var _,v,m=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=s,y=Function.prototype,E=y.bind,S=y.call,b=g&&E.bind(S,S),T=g?function(e){return e&&b(e)}:function(e){return e&&function(){return S.apply(e,arguments)}},I=T,A=I({}.toString),R=I("".slice),C=function(e){return R(A(e),8,-1)},O=T,w=o,N=C,k=n.Object,D=O("".split),P=w((function(){return!k("z").propertyIsEnumerable(0)}))?function(e){return"String"==N(e)?D(e,""):k(e)}:k,M=n.TypeError,U=function(e){if(null==e)throw M("Can't call method on "+e);return e},L=P,x=U,B=function(e){return L(x(e))},V=function(e){return"function"==typeof e},j=V,F=function(e){return"object"==typeof e?null!==e:j(e)},G=n,z=V,H=function(e){return z(e)?e:void 0},W=function(e,t){return arguments.length<2?H(G[e]):G[e]&&G[e][t]},Y=T({}.isPrototypeOf),K=W("navigator","userAgent")||"",X=n,q=K,J=X.process,Z=X.Deno,$=J&&J.versions||Z&&Z.version,Q=$&&$.v8;Q&&(v=(_=Q.split("."))[0]>0&&_[0]<4?1:+(_[0]+_[1])),!v&&q&&(!(_=q.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=q.match(/Chrome\/(\d+)/))&&(v=+_[1]);var ee=v,te=ee,re=o,ne=!!Object.getOwnPropertySymbols&&!re((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&te&&te<41})),ie=ne&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,oe=W,ae=V,se=Y,ce=ie,ue=n.Object,de=ce?function(e){return"symbol"==typeof e}:function(e){var t=oe("Symbol");return ae(t)&&se(t.prototype,ue(e))},le=n.String,fe=function(e){try{return le(e)}catch(e){return"Object"}},he=V,pe=fe,_e=n.TypeError,ve=function(e){if(he(e))return e;throw _e(pe(e)+" is not a function")},me=ve,ge=function(e,t){var r=e[t];return null==r?void 0:me(r)},ye=d,Ee=V,Se=F,be=n.TypeError,Te={exports:{}},Ie=n,Ae=Object.defineProperty,Re=function(e,t){try{Ae(Ie,e,{value:t,configurable:!0,writable:!0})}catch(r){Ie[e]=t}return t},Ce=Re,Oe=n["__core-js_shared__"]||Ce("__core-js_shared__",{}),we=Oe;(Te.exports=function(e,t){return we[e]||(we[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ne=U,ke=n.Object,De=function(e){return ke(Ne(e))},Pe=De,Me=T({}.hasOwnProperty),Ue=Object.hasOwn||function(e,t){return Me(Pe(e),t)},Le=T,xe=0,Be=Math.random(),Ve=Le(1..toString),je=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ve(++xe+Be,36)},Fe=n,Ge=Te.exports,ze=Ue,He=je,We=ne,Ye=ie,Ke=Ge("wks"),Xe=Fe.Symbol,qe=Xe&&Xe.for,Je=Ye?Xe:Xe&&Xe.withoutSetter||He,Ze=function(e){if(!ze(Ke,e)||!We&&"string"!=typeof Ke[e]){var t="Symbol."+e;We&&ze(Xe,e)?Ke[e]=Xe[e]:Ke[e]=Ye&&qe?qe(t):Je(t)}return Ke[e]},$e=d,Qe=F,et=de,tt=ge,rt=function(e,t){var r,n;if("string"===t&&Ee(r=e.toString)&&!Se(n=ye(r,e)))return n;if(Ee(r=e.valueOf)&&!Se(n=ye(r,e)))return n;if("string"!==t&&Ee(r=e.toString)&&!Se(n=ye(r,e)))return n;throw be("Can't convert object to primitive value")},nt=Ze,it=n.TypeError,ot=nt("toPrimitive"),at=function(e,t){if(!Qe(e)||et(e))return e;var r,n=tt(e,ot);if(n){if(void 0===t&&(t="default"),r=$e(n,e,t),!Qe(r)||et(r))return r;throw it("Can't convert object to primitive value")}return void 0===t&&(t="number"),rt(e,t)},st=at,ct=de,ut=function(e){var t=st(e,"string");return ct(t)?t:t+""},dt=F,lt=n.document,ft=dt(lt)&&dt(lt.createElement),ht=function(e){return ft?lt.createElement(e):{}},pt=ht,_t=!a&&!o((function(){return 7!=Object.defineProperty(pt("div"),"a",{get:function(){return 7}}).a})),vt=a,mt=d,gt=l,yt=m,Et=B,St=ut,bt=Ue,Tt=_t,It=Object.getOwnPropertyDescriptor;i.f=vt?It:function(e,t){if(e=Et(e),t=St(t),Tt)try{return It(e,t)}catch(e){}if(bt(e,t))return yt(!mt(gt.f,e,t),e[t])};var At={},Rt=a&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ct=n,Ot=F,wt=Ct.String,Nt=Ct.TypeError,kt=function(e){if(Ot(e))return e;throw Nt(wt(e)+" is not an object")},Dt=a,Pt=_t,Mt=Rt,Ut=kt,Lt=ut,xt=n.TypeError,Bt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor;At.f=Dt?Mt?function(e,t,r){if(Ut(e),t=Lt(t),Ut(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=Vt(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Bt(e,t,r)}:Bt:function(e,t,r){if(Ut(e),t=Lt(t),Ut(r),Pt)try{return Bt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw xt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var jt=At,Ft=m,Gt=a?function(e,t,r){return jt.f(e,t,Ft(1,r))}:function(e,t,r){return e[t]=r,e},zt={exports:{}},Ht=V,Wt=Oe,Yt=T(Function.toString);Ht(Wt.inspectSource)||(Wt.inspectSource=function(e){return Yt(e)});var Kt,Xt,qt,Jt=Wt.inspectSource,Zt=V,$t=Jt,Qt=n.WeakMap,er=Zt(Qt)&&/native code/.test($t(Qt)),tr=Te.exports,rr=je,nr=tr("keys"),ir=function(e){return nr[e]||(nr[e]=rr(e))},or={},ar=er,sr=n,cr=T,ur=F,dr=Gt,lr=Ue,fr=Oe,hr=ir,pr=or,_r=sr.TypeError,vr=sr.WeakMap;if(ar||fr.state){var mr=fr.state||(fr.state=new vr),gr=cr(mr.get),yr=cr(mr.has),Er=cr(mr.set);Kt=function(e,t){if(yr(mr,e))throw new _r("Object already initialized");return t.facade=e,Er(mr,e,t),t},Xt=function(e){return gr(mr,e)||{}},qt=function(e){return yr(mr,e)}}else{var Sr=hr("state");pr[Sr]=!0,Kt=function(e,t){if(lr(e,Sr))throw new _r("Object already initialized");return t.facade=e,dr(e,Sr,t),t},Xt=function(e){return lr(e,Sr)?e[Sr]:{}},qt=function(e){return lr(e,Sr)}}var br={set:Kt,get:Xt,has:qt,enforce:function(e){return qt(e)?Xt(e):Kt(e,{})},getterFor:function(e){return function(t){var r;if(!ur(t)||(r=Xt(t)).type!==e)throw _r("Incompatible receiver, "+e+" required");return r}}},Tr=a,Ir=Ue,Ar=Function.prototype,Rr=Tr&&Object.getOwnPropertyDescriptor,Cr=Ir(Ar,"name"),Or={EXISTS:Cr,PROPER:Cr&&"something"===function(){}.name,CONFIGURABLE:Cr&&(!Tr||Tr&&Rr(Ar,"name").configurable)},wr=n,Nr=V,kr=Ue,Dr=Gt,Pr=Re,Mr=Jt,Ur=Or.CONFIGURABLE,Lr=br.get,xr=br.enforce,Br=String(String).split("String");(zt.exports=function(e,t,r,n){var i,o=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,c=n&&void 0!==n.name?n.name:t;Nr(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!kr(r,"name")||Ur&&r.name!==c)&&Dr(r,"name",c),(i=xr(r)).source||(i.source=Br.join("string"==typeof c?c:""))),e!==wr?(o?!s&&e[t]&&(a=!0):delete e[t],a?e[t]=r:Dr(e,t,r)):a?e[t]=r:Pr(t,r)})(Function.prototype,"toString",(function(){return Nr(this)&&Lr(this).source||Mr(this)}));var Vr={},jr=Math.ceil,Fr=Math.floor,Gr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Fr:jr)(t)},zr=Gr,Hr=Math.max,Wr=Math.min,Yr=function(e,t){var r=zr(e);return r<0?Hr(r+t,0):Wr(r,t)},Kr=Gr,Xr=Math.min,qr=function(e){return e>0?Xr(Kr(e),9007199254740991):0},Jr=qr,Zr=function(e){return Jr(e.length)},$r=B,Qr=Yr,en=Zr,tn=function(e){return function(t,r,n){var i,o=$r(t),a=en(o),s=Qr(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},rn={includes:tn(!0),indexOf:tn(!1)},nn=Ue,on=B,an=rn.indexOf,sn=or,cn=T([].push),un=function(e,t){var r,n=on(e),i=0,o=[];for(r in n)!nn(sn,r)&&nn(n,r)&&cn(o,r);for(;t.length>i;)nn(n,r=t[i++])&&(~an(o,r)||cn(o,r));return o},dn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ln=un,fn=dn.concat("length","prototype");Vr.f=Object.getOwnPropertyNames||function(e){return ln(e,fn)};var hn={};hn.f=Object.getOwnPropertySymbols;var pn=W,_n=Vr,vn=hn,mn=kt,gn=T([].concat),yn=pn("Reflect","ownKeys")||function(e){var t=_n.f(mn(e)),r=vn.f;return r?gn(t,r(e)):t},En=Ue,Sn=yn,bn=i,Tn=At,In=o,An=V,Rn=/#|\.prototype\./,Cn=function(e,t){var r=wn[On(e)];return r==kn||r!=Nn&&(An(t)?In(t):!!t)},On=Cn.normalize=function(e){return String(e).replace(Rn,".").toLowerCase()},wn=Cn.data={},Nn=Cn.NATIVE="N",kn=Cn.POLYFILL="P",Dn=Cn,Pn=n,Mn=i.f,Un=Gt,Ln=zt.exports,xn=Re,Bn=function(e,t,r){for(var n=Sn(t),i=Tn.f,o=bn.f,a=0;a<n.length;a++){var s=n[a];En(e,s)||r&&En(r,s)||i(e,s,o(t,s))}},Vn=Dn,jn=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,u=e.stat;if(r=c?Pn:u?Pn[s]||xn(s,{}):(Pn[s]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(a=Mn(r,n))&&a.value:r[n],!Vn(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Bn(o,i)}(e.sham||i&&i.sham)&&Un(o,"sham",!0),Ln(r,n,o,e)}},Fn=jn,Gn=T,zn=n.Date,Hn=Gn(zn.prototype.getTime);Fn({target:"Date",stat:!0},{now:function(){return Hn(new zn)}});var Wn=T,Yn=zt.exports,Kn=Date.prototype,Xn=Wn(Kn.toString),qn=Wn(Kn.getTime);"Invalid Date"!=String(new Date(NaN))&&Yn(Kn,"toString",(function(){var e=qn(this);return e==e?Xn(this):"Invalid Date"}));var Jn=function(e,t){return Jn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Jn(e,t)};function Zn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Jn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var $n=function(){return $n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$n.apply(this,arguments)};function Qn(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function ei(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function ti(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function ri(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ni(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function ii(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}let oi=!0,ai=!0;function si(e,t,r){const n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function ci(e,t,r){if(!e.RTCPeerConnection)return;const n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,o),i.apply(this,[e,o])};const o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(r))return o.apply(this,arguments);const n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,n])},Object.defineProperty(n,"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 ui(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(oi=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function di(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(ai=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function li(){if("object"==typeof window){if(oi)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function fi(e,t){ai&&console.warn(e+" is deprecated, please use "+t+" instead.")}function hi(e){return"[object Object]"===Object.prototype.toString.call(e)}function pi(e){return hi(e)?Object.keys(e).reduce((function(t,r){const n=hi(e[r]),i=n?pi(e[r]):e[r],o=n&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[r]:i})}),{}):e}function _i(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((n=>{n.endsWith("Id")?_i(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((t=>{_i(e,e.get(t),r)}))})))}function vi(e,t,r){const n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((r=>{r.type===n&&r.trackId===t.id&&_i(e,r,i)}))})),i}const mi=li;function gi(e,t){const r=e&&e.navigator;if(!r.mediaDevices)return;const n=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const n="object"==typeof e[r]?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];let e={};"number"==typeof n.ideal?(e[i("min",r)]=n.ideal,t.optional.push(e),e={},e[i("max",r)]=n.ideal,t.optional.push(e)):(e[i("",r)]=n.ideal,t.optional.push(e))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((e=>{void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const a=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return r.mediaDevices.enumerateDevices().then((r=>{let a=(r=r.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&r.length&&t.includes("back")&&(a=r[r.length-1]),a&&(e.video.deviceId=o.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=n(e.video),mi("chrome: "+JSON.stringify(e)),i(e)}))}e.video=n(e.video)}return mi("chrome: "+JSON.stringify(e)),i(e)},o=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(r.getUserMedia=function(e,t,n){i(e,(e=>{r.webkitGetUserMedia(e,t,(e=>{n&&n(o(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){const e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(t){return i(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(o(e))))))}}}function yi(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Ei(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",(r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.track.id)):{track:r.track};const i=new Event("track");i.track=r.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((r=>{let n;n=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===r.id)):{track:r};const i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else ci(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Si(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 r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){let i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],n.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 bi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,r,n]=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 i=function(e){const t={};return e.result().forEach((e=>{const r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{r[t]=e.stat(t)})),t[r.id]=r})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const n=function(e){r(o(i(e)))};return t.apply(this,[n,e])}return new Promise(((e,r)=>{t.apply(this,[function(t){e(o(i(t)))},r])})).then(r,n)}}function Ti(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 r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>vi(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}),ci(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>vi(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,r,n;return this.getSenders().forEach((r=>{r.track===e&&(t?n=!0:t=r)})),this.getReceivers().forEach((t=>(t.track===e&&(r?n=!0:r=t),t.track===e))),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Ii(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,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};const r=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();r.apply(this,arguments);const n=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(n)};const n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const r=this._shimmedLocalStreams[t].indexOf(e);-1!==r&&this._shimmedLocalStreams[t].splice(r,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function Ai(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Ii(e);const r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=r.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const n=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 r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}n.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}function a(e,t){let r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.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,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[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 i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new e.MediaStream([t]);this._streams[r.id]=n,this._reverseStreams[n.id]=r,this.addStream(n)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[t=>{const r=o(this,t);e[0].apply(null,[r])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):r.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=n[t]}));const s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(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:o(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((r=>{this._streams[r].getTracks().find((t=>e.track===t))&&(t=this._streams[r])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Ri(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}))}function Ci(e,t){ci(e,"negotiationneeded",(e=>{const r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))}var Oi=Object.freeze({__proto__:null,shimMediaStream:yi,shimOnTrack:Ei,shimGetSendersWithDtmf:Si,shimGetStats:bi,shimSenderReceiverGetStats:Ti,shimAddTrackRemoveTrackWithNative:Ii,shimAddTrackRemoveTrack:Ai,shimPeerConnection:Ri,fixNegotiationNeeded:Ci,shimGetUserMedia:gi,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((t=>{const n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function wi(e,t){const r=e&&e.navigator,n=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){fi("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const e=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),e(r.audio,"autoGainControl","mozAutoGainControl"),e(r.audio,"noiseSuppression","mozNoiseSuppression")),t(r)},n&&n.prototype.getSettings){const t=n.prototype.getSettings;n.prototype.getSettings=function(){const r=t.apply(this,arguments);return e(r,"mozAutoGainControl","autoGainControl"),e(r,"mozNoiseSuppression","noiseSuppression"),r}}if(n&&n.prototype.applyConstraints){const t=n.prototype.applyConstraints;n.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),e(r,"autoGainControl","mozAutoGainControl"),e(r,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[r])}}}}function Ni(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 ki(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 r=e.RTCPeerConnection.prototype[t],n={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=n[t]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return n.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,n)=>{e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,o)}}function Di(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 r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=r.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 Pi(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}),ci(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Mi(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){fi("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function Ui(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Li(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],r=e&&"sendEncodings"in e;r&&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 n=t.apply(this,arguments);if(r){const{sender:t}=n,r=t.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(r).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return n})}function xi(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 Bi(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 Vi(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 ji=Object.freeze({__proto__:null,shimOnTrack:Ni,shimPeerConnection:ki,shimSenderGetStats:Di,shimReceiverGetStats:Pi,shimRemoveStream:Mi,shimRTCDataChannel:Ui,shimAddTransceiver:Li,shimGetParameters:xi,shimCreateOffer:Bi,shimCreateAnswer:Vi,shimGetUserMedia:wi,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}});function Fi(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((r=>t.call(this,r,e))),e.getVideoTracks().forEach((r=>t.call(this,r,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...r){return r&&r.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 r=e.getTracks();this.getSenders().forEach((e=>{r.includes(e.track)&&this.removeTrack(e)}))})}}function Gi(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 r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}))}),t.apply(e,arguments)}}}function zi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,r){const n=i.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=s,s=function(e,t,r){const n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=s,s=function(e,t,r){const n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=s}function Hi(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,r=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>r(Wi(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))}function Wi(e){return e&&void 0!==e.video?Object.assign({},e,{video:pi(e.video)}):e}function Yi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){const t=[];for(let r=0;r<e.iceServers.length;r++){let n=e.iceServers[r];!n.hasOwnProperty("urls")&&n.hasOwnProperty("url")?(fi("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,t.push(n)):t.push(e.iceServers[r])}e.iceServers=t}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function Ki(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 Xi(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",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const r=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function qi(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ji=Object.freeze({__proto__:null,shimLocalStreamsAPI:Fi,shimRemoteStreamsAPI:Gi,shimCallbacksAPI:zi,shimGetUserMedia:Hi,shimConstraints:Wi,shimRTCIceServerUrls:Yi,shimTrackEventTransceiver:Ki,shimCreateOfferLegacy:Xi,shimAudioContext:qi}),Zi={exports:{}};!function(e){const 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((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const 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){let t=e.substr(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const 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){const t={};let r;const n=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},t.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substr(6)},t.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const 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;const 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,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");for(let i=3;i<n.length;i++){const o=n[i],a=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substr(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===s&&(c=u[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&s&&r.push({ssrc:s});let 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,r.forEach((e=>{e.maxBitrate=d}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substr(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substr(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="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&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,r,n){let i;const o=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substr(2)}return r?t.getDirection(r):"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){const r=t.splitLines(e)[0].substr(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(Zi);var $i=Zi.exports,Qi=Object.freeze(e({__proto__:null,default:$i},[Zi.exports]));function eo(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 r=new t(e),n=$i.parseCandidate(e.candidate),i=Object.assign(r,n);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,ci(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function to(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 r=function(e){if(!e||!e.sdp)return!1;const t=$i.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=$i.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},n=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const r=parseInt(t[1],10);return r!=r?-1:r},i=function(e){let r=65536;return"firefox"===t.browser&&(r=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),r},o=function(e,r){let n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);const i=$i.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n},a=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(r(arguments[0])){const e=n(arguments[0]),t=i(e),r=o(arguments[0],e);let a;a=0===t&&0===r?Number.POSITIVE_INFINITY:0===t||0===r?Math.max(t,r):Math.min(t,r);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>a}),this._sctp=s}return a.apply(this,arguments)}}function ro(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const r=e.send;e.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}const r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=r.apply(this,arguments);return t(e,this),e},ci(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function no(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 r=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 r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function io(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const r=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:r}):t.sdp=r}return r.apply(this,arguments)}}function oo(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.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():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ao(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return r.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return r.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>r.apply(this,[e])))})}var so=Object.freeze({__proto__:null,shimRTCIceCandidate:eo,shimMaxMessageSize:to,shimSendThrowTypeError:ro,shimConnectionState:no,removeExtmapAllowMixed:io,shimAddIceCandidateNullOrEmpty:oo,shimParameterlessSetLocalDescription:ao});!function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=li,n=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=si(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=si(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=si(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),i={browserDetails:n,commonShim:so,extractVersion:si,disableLog:ui,disableWarnings:di,sdp:Qi};switch(n.browser){case"chrome":if(!Oi||!Ri||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(null===n.version)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=Oi,oo(e,n),ao(e),gi(e,n),yi(e),Ri(e,n),Ei(e),Ai(e,n),Si(e),bi(e),Ti(e),Ci(e,n),eo(e),no(e),to(e,n),ro(e),io(e,n);break;case"firefox":if(!ji||!ki||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=ji,oo(e,n),ao(e),wi(e,n),ki(e,n),Ni(e),Mi(e),Di(e),Pi(e),Ui(e),Li(e),xi(e),Bi(e),Vi(e),eo(e),no(e),to(e,n),ro(e);break;case"safari":if(!Ji||!t.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=Ji,oo(e,n),ao(e),Yi(e),Xi(e),zi(e),Fi(e),Gi(e),Ki(e),Hi(e),qi(e),eo(e),to(e,n),ro(e),io(e,n);break;default:r("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});var co={},uo=un,lo=dn,fo=Object.keys||function(e){return uo(e,lo)},ho=a,po=Rt,_o=At,vo=kt,mo=B,go=fo;co.f=ho&&!po?Object.defineProperties:function(e,t){vo(e);for(var r,n=mo(t),i=go(t),o=i.length,a=0;o>a;)_o.f(e,r=i[a++],n[r]);return e};var yo,Eo=W("document","documentElement"),So=kt,bo=co,To=dn,Io=or,Ao=Eo,Ro=ht,Co=ir("IE_PROTO"),Oo=function(){},wo=function(e){return"<script>"+e+"<\/script>"},No=function(e){e.write(wo("")),e.close();var t=e.parentWindow.Object;return e=null,t},ko=function(){try{yo=new ActiveXObject("htmlfile")}catch(e){}var e,t;ko="undefined"!=typeof document?document.domain&&yo?No(yo):((t=Ro("iframe")).style.display="none",Ao.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(wo("document.F=Object")),e.close(),e.F):No(yo);for(var r=To.length;r--;)delete ko.prototype[To[r]];return ko()};Io[Co]=!0;var Do=Object.create||function(e,t){var r;return null!==e?(Oo.prototype=So(e),r=new Oo,Oo.prototype=null,r[Co]=e):r=ko(),void 0===t?r:bo.f(r,t)},Po=Do,Mo=At,Uo=Ze("unscopables"),Lo=Array.prototype;null==Lo[Uo]&&Mo.f(Lo,Uo,{configurable:!0,value:Po(null)});var xo,Bo,Vo,jo=function(e){Lo[Uo][e]=!0},Fo={},Go=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),zo=n,Ho=Ue,Wo=V,Yo=De,Ko=Go,Xo=ir("IE_PROTO"),qo=zo.Object,Jo=qo.prototype,Zo=Ko?qo.getPrototypeOf:function(e){var t=Yo(e);if(Ho(t,Xo))return t[Xo];var r=t.constructor;return Wo(r)&&t instanceof r?r.prototype:t instanceof qo?Jo:null},$o=o,Qo=V,ea=Zo,ta=zt.exports,ra=Ze("iterator"),na=!1;[].keys&&("next"in(Vo=[].keys())?(Bo=ea(ea(Vo)))!==Object.prototype&&(xo=Bo):na=!0);var ia=null==xo||$o((function(){var e={};return xo[ra].call(e)!==e}));ia&&(xo={}),Qo(xo[ra])||ta(xo,ra,(function(){return this}));var oa={IteratorPrototype:xo,BUGGY_SAFARI_ITERATORS:na},aa=At.f,sa=Ue,ca=Ze("toStringTag"),ua=function(e,t,r){e&&!r&&(e=e.prototype),e&&!sa(e,ca)&&aa(e,ca,{configurable:!0,value:t})},da=oa.IteratorPrototype,la=Do,fa=m,ha=ua,pa=Fo,_a=function(){return this},va=function(e,t,r,n){var i=t+" Iterator";return e.prototype=la(da,{next:fa(+!n,r)}),ha(e,i,!1),pa[i]=_a,e},ma=n,ga=V,ya=ma.String,Ea=ma.TypeError,Sa=T,ba=kt,Ta=function(e){if("object"==typeof e||ga(e))return e;throw Ea("Can't set "+ya(e)+" as a prototype")},Ia=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Sa(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return ba(r),Ta(n),t?e(r,n):r.__proto__=n,r}}():void 0),Aa=jn,Ra=d,Ca=Or,Oa=V,wa=va,Na=Zo,ka=Ia,Da=ua,Pa=Gt,Ma=zt.exports,Ua=Fo,La=Ca.PROPER,xa=Ca.CONFIGURABLE,Ba=oa.IteratorPrototype,Va=oa.BUGGY_SAFARI_ITERATORS,ja=Ze("iterator"),Fa=function(){return this},Ga=function(e,t,r,n,i,o,a){wa(r,t,n);var s,c,u,d=function(e){if(e===i&&_)return _;if(!Va&&e in h)return h[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,h=e.prototype,p=h[ja]||h["@@iterator"]||i&&h[i],_=!Va&&p||d(i),v="Array"==t&&h.entries||p;if(v&&(s=Na(v.call(new e)))!==Object.prototype&&s.next&&(Na(s)!==Ba&&(ka?ka(s,Ba):Oa(s[ja])||Ma(s,ja,Fa)),Da(s,l,!0)),La&&"values"==i&&p&&"values"!==p.name&&(xa?Pa(h,"name","values"):(f=!0,_=function(){return Ra(p,this)})),i)if(c={values:d("values"),keys:o?_:d("keys"),entries:d("entries")},a)for(u in c)(Va||f||!(u in h))&&Ma(h,u,c[u]);else Aa({target:t,proto:!0,forced:Va||f},c);return h[ja]!==_&&Ma(h,ja,_,{name:i}),Ua[t]=_,c},za=B,Ha=jo,Wa=Fo,Ya=br,Ka=At.f,Xa=Ga,qa=a,Ja=Ya.set,Za=Ya.getterFor("Array Iterator"),$a=Xa(Array,"Array",(function(e,t){Ja(this,{type:"Array Iterator",target:za(e),index:0,kind:t})}),(function(){var e=Za(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),Qa=Wa.Arguments=Wa.Array;if(Ha("keys"),Ha("values"),Ha("entries"),qa&&"values"!==Qa.name)try{Ka(Qa,"name",{value:"values"})}catch(e){}var es={exports:{}},ts={},rs=ut,ns=At,is=m,os=function(e,t,r){var n=rs(t);n in e?ns.f(e,n,is(0,r)):e[n]=r},as=Yr,ss=Zr,cs=os,us=n.Array,ds=Math.max,ls=function(e,t,r){for(var n=ss(e),i=as(t,n),o=as(void 0===r?n:r,n),a=us(ds(o-i,0)),s=0;i<o;i++,s++)cs(a,s,e[i]);return a.length=s,a},fs=C,hs=B,ps=Vr.f,_s=ls,vs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ts.f=function(e){return vs&&"Window"==fs(e)?function(e){try{return ps(e)}catch(e){return _s(vs)}}(e):ps(hs(e))};var ms=o((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),gs=o,ys=F,Es=C,Ss=ms,bs=Object.isExtensible,Ts=gs((function(){bs(1)}))||Ss?function(e){return!!ys(e)&&((!Ss||"ArrayBuffer"!=Es(e))&&(!bs||bs(e)))}:bs,Is=!o((function(){return Object.isExtensible(Object.preventExtensions({}))})),As=jn,Rs=T,Cs=or,Os=F,ws=Ue,Ns=At.f,ks=Vr,Ds=ts,Ps=Ts,Ms=Is,Us=!1,Ls=je("meta"),xs=0,Bs=function(e){Ns(e,Ls,{value:{objectID:"O"+xs++,weakData:{}}})},Vs=es.exports={enable:function(){Vs.enable=function(){},Us=!0;var e=ks.f,t=Rs([].splice),r={};r[Ls]=1,e(r).length&&(ks.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===Ls){t(n,i,1);break}return n},As({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ds.f}))},fastKey:function(e,t){if(!Os(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!ws(e,Ls)){if(!Ps(e))return"F";if(!t)return"E";Bs(e)}return e[Ls].objectID},getWeakData:function(e,t){if(!ws(e,Ls)){if(!Ps(e))return!0;if(!t)return!1;Bs(e)}return e[Ls].weakData},onFreeze:function(e){return Ms&&Us&&Ps(e)&&!ws(e,Ls)&&Bs(e),e}};Cs[Ls]=!0;var js=ve,Fs=s,Gs=T(T.bind),zs=function(e,t){return js(e),void 0===t?e:Fs?Gs(e,t):function(){return e.apply(t,arguments)}},Hs=Fo,Ws=Ze("iterator"),Ys=Array.prototype,Ks=function(e){return void 0!==e&&(Hs.Array===e||Ys[Ws]===e)},Xs={};Xs[Ze("toStringTag")]="z";var qs="[object z]"===String(Xs),Js=n,Zs=qs,$s=V,Qs=C,ec=Ze("toStringTag"),tc=Js.Object,rc="Arguments"==Qs(function(){return arguments}()),nc=Zs?Qs:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=tc(e),ec))?r:rc?Qs(t):"Object"==(n=Qs(t))&&$s(t.callee)?"Arguments":n},ic=nc,oc=ge,ac=Fo,sc=Ze("iterator"),cc=function(e){if(null!=e)return oc(e,sc)||oc(e,"@@iterator")||ac[ic(e)]},uc=d,dc=ve,lc=kt,fc=fe,hc=cc,pc=n.TypeError,_c=function(e,t){var r=arguments.length<2?hc(e):t;if(dc(r))return lc(uc(r,e));throw pc(fc(e)+" is not iterable")},vc=d,mc=kt,gc=ge,yc=function(e,t,r){var n,i;mc(e);try{if(!(n=gc(e,"return"))){if("throw"===t)throw r;return r}n=vc(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return mc(n),r},Ec=zs,Sc=d,bc=kt,Tc=fe,Ic=Ks,Ac=Zr,Rc=Y,Cc=_c,Oc=cc,wc=yc,Nc=n.TypeError,kc=function(e,t){this.stopped=e,this.result=t},Dc=kc.prototype,Pc=function(e,t,r){var n,i,o,a,s,c,u,d=r&&r.that,l=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),p=Ec(t,d),_=function(e){return n&&wc(n,"normal",e),new kc(!0,e)},v=function(e){return l?(bc(e),h?p(e[0],e[1],_):p(e[0],e[1])):h?p(e,_):p(e)};if(f)n=e;else{if(!(i=Oc(e)))throw Nc(Tc(e)+" is not iterable");if(Ic(i)){for(o=0,a=Ac(e);a>o;o++)if((s=v(e[o]))&&Rc(Dc,s))return s;return new kc(!1)}n=Cc(e,i)}for(c=n.next;!(u=Sc(c,n)).done;){try{s=v(u.value)}catch(e){wc(n,"throw",e)}if("object"==typeof s&&s&&Rc(Dc,s))return s}return new kc(!1)},Mc=Y,Uc=n.TypeError,Lc=function(e,t){if(Mc(t,e))return e;throw Uc("Incorrect invocation")},xc=Ze("iterator"),Bc=!1;try{var Vc=0,jc={next:function(){return{done:!!Vc++}},return:function(){Bc=!0}};jc[xc]=function(){return this},Array.from(jc,(function(){throw 2}))}catch(e){}var Fc=function(e,t){if(!t&&!Bc)return!1;var r=!1;try{var n={};n[xc]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Gc=V,zc=F,Hc=Ia,Wc=function(e,t,r){var n,i;return Hc&&Gc(n=t.constructor)&&n!==r&&zc(i=n.prototype)&&i!==r.prototype&&Hc(e,i),e},Yc=jn,Kc=n,Xc=T,qc=Dn,Jc=zt.exports,Zc=es.exports,$c=Pc,Qc=Lc,eu=V,tu=F,ru=o,nu=Fc,iu=ua,ou=Wc,au=function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=n?"set":"add",a=Kc[e],s=a&&a.prototype,c=a,u={},d=function(e){var t=Xc(s[e]);Jc(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!tu(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!tu(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!tu(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(qc(e,!eu(a)||!(i||s.forEach&&!ru((function(){(new a).entries().next()})))))c=r.getConstructor(t,e,n,o),Zc.enable();else if(qc(e,!0)){var l=new c,f=l[o](i?{}:-0,1)!=l,h=ru((function(){l.has(1)})),p=nu((function(e){new a(e)})),_=!i&&ru((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Qc(e,s);var r=ou(new a,e,c);return null!=t&&$c(t,r[o],{that:r,AS_ENTRIES:n}),r}))).prototype=s,s.constructor=c),(h||_)&&(d("delete"),d("has"),n&&d("get")),(_||f)&&d(o),i&&s.clear&&delete s.clear}return u[e]=c,Yc({global:!0,forced:c!=a},u),iu(c,e),i||r.setStrong(c,e,n),c},su=zt.exports,cu=function(e,t,r){for(var n in t)su(e,n,t[n],r);return e},uu=W,du=At,lu=a,fu=Ze("species"),hu=function(e){var t=uu(e),r=du.f;lu&&t&&!t[fu]&&r(t,fu,{configurable:!0,get:function(){return this}})},pu=At.f,_u=Do,vu=cu,mu=zs,gu=Lc,yu=Pc,Eu=Ga,Su=hu,bu=a,Tu=es.exports.fastKey,Iu=br.set,Au=br.getterFor,Ru={getConstructor:function(e,t,r,n){var i=e((function(e,i){gu(e,o),Iu(e,{type:t,index:_u(null),first:void 0,last:void 0,size:0}),bu||(e.size=0),null!=i&&yu(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=Au(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=Tu(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),bu?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=Tu(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return vu(o,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,bu?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=c(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),bu?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=mu(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),vu(o,r?{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)}}),bu&&pu(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Au(t),o=Au(n);Eu(e,t,(function(e,t){Iu(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),Su(t)}};au("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Ru);var Cu=nc,Ou=qs?{}.toString:function(){return"[object "+Cu(this)+"]"},wu=qs,Nu=zt.exports,ku=Ou;wu||Nu(Object.prototype,"toString",ku,{unsafe:!0});var Du=nc,Pu=n.String,Mu=function(e){if("Symbol"===Du(e))throw TypeError("Cannot convert a Symbol value to a string");return Pu(e)},Uu=T,Lu=Gr,xu=Mu,Bu=U,Vu=Uu("".charAt),ju=Uu("".charCodeAt),Fu=Uu("".slice),Gu=function(e){return function(t,r){var n,i,o=xu(Bu(t)),a=Lu(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=ju(o,a))<55296||n>56319||a+1===s||(i=ju(o,a+1))<56320||i>57343?e?Vu(o,a):n:e?Fu(o,a,a+2):i-56320+(n-55296<<10)+65536}},zu={codeAt:Gu(!1),charAt:Gu(!0)},Hu=zu.charAt,Wu=Mu,Yu=br,Ku=Ga,Xu=Yu.set,qu=Yu.getterFor("String Iterator");Ku(String,"String",(function(e){Xu(this,{type:"String Iterator",string:Wu(e),index:0})}),(function(){var e,t=qu(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Hu(r,n),t.index+=e.length,{value:e,done:!1})}));var Ju={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},Zu=ht("span").classList,$u=Zu&&Zu.constructor&&Zu.constructor.prototype,Qu=$u===Object.prototype?void 0:$u,ed=n,td=Ju,rd=Qu,nd=$a,id=Gt,od=Ze,ad=od("iterator"),sd=od("toStringTag"),cd=nd.values,ud=function(e,t){if(e){if(e[ad]!==cd)try{id(e,ad,cd)}catch(t){e[ad]=cd}if(e[sd]||id(e,sd,t),td[t])for(var r in nd)if(e[r]!==nd[r])try{id(e,r,nd[r])}catch(t){e[r]=nd[r]}}};for(var dd in td)ud(ed[dd]&&ed[dd].prototype,dd);ud(rd,"DOMTokenList");var ld=jn,fd=a,hd=At.f;ld({target:"Object",stat:!0,forced:Object.defineProperty!==hd,sham:!fd},{defineProperty:hd});var pd=T([].slice),_d=T,vd=ve,md=F,gd=Ue,yd=pd,Ed=s,Sd=n.Function,bd=_d([].concat),Td=_d([].join),Id={},Ad=function(e,t,r){if(!gd(Id,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Id[t]=Sd("C,a","return new C("+Td(n,",")+")")}return Id[t](e,r)},Rd=Ed?Sd.bind:function(e){var t=vd(this),r=t.prototype,n=yd(arguments,1),i=function(){var r=bd(n,yd(arguments));return this instanceof i?Ad(t,r.length,r):t.apply(e,r)};return md(r)&&(i.prototype=r),i},Cd=Rd;jn({target:"Function",proto:!0,forced:Function.bind!==Cd},{bind:Cd});var Od=o,wd=function(e,t){var r=[][e];return!!r&&Od((function(){r.call(null,t||function(){throw 1},1)}))},Nd=jn,kd=P,Dd=B,Pd=wd,Md=T([].join),Ud=kd!=Object,Ld=Pd("join",",");Nd({target:"Array",proto:!0,forced:Ud||!Ld},{join:function(e){return Md(Dd(this),void 0===e?",":e)}});var xd=C,Bd=Array.isArray||function(e){return"Array"==xd(e)},Vd=T,jd=o,Fd=V,Gd=nc,zd=Jt,Hd=function(){},Wd=[],Yd=W("Reflect","construct"),Kd=/^\s*(?:class|function)\b/,Xd=Vd(Kd.exec),qd=!Kd.exec(Hd),Jd=function(e){if(!Fd(e))return!1;try{return Yd(Hd,Wd,e),!0}catch(e){return!1}},Zd=function(e){if(!Fd(e))return!1;switch(Gd(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qd||!!Xd(Kd,zd(e))}catch(e){return!0}};Zd.sham=!0;var $d=!Yd||jd((function(){var e;return Jd(Jd.call)||!Jd(Object)||!Jd((function(){e=!0}))||e}))?Zd:Jd,Qd=n,el=Bd,tl=$d,rl=F,nl=Ze("species"),il=Qd.Array,ol=function(e){var t;return el(e)&&(t=e.constructor,(tl(t)&&(t===il||el(t.prototype))||rl(t)&&null===(t=t[nl]))&&(t=void 0)),void 0===t?il:t},al=function(e,t){return new(ol(e))(0===t?0:t)},sl=zs,cl=P,ul=De,dl=Zr,ll=al,fl=T([].push),hl=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,d,l){for(var f,h,p=ul(c),_=cl(p),v=sl(u,d),m=dl(_),g=0,y=l||ll,E=t?y(c,m):r||a?y(c,0):void 0;m>g;g++)if((s||g in _)&&(h=v(f=_[g],g,p),e))if(t)E[g]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return g;case 2:fl(E,f)}else switch(e){case 4:return!1;case 7:fl(E,f)}return o?-1:n||i?i:E}},pl={forEach:hl(0),map:hl(1),filter:hl(2),some:hl(3),every:hl(4),find:hl(5),findIndex:hl(6),filterReject:hl(7)},_l=pl.forEach,vl=wd("forEach")?[].forEach:function(e){return _l(this,e,arguments.length>1?arguments[1]:void 0)};jn({target:"Array",proto:!0,forced:[].forEach!=vl},{forEach:vl});var ml=n,gl=Ju,yl=Qu,El=vl,Sl=Gt,bl=function(e){if(e&&e.forEach!==El)try{Sl(e,"forEach",El)}catch(t){e.forEach=El}};for(var Tl in gl)gl[Tl]&&bl(ml[Tl]&&ml[Tl].prototype);bl(yl);var Il=jn,Al=pl.find,Rl=jo,Cl=!0;"find"in[]&&Array(1).find((function(){Cl=!1})),Il({target:"Array",proto:!0,forced:Cl},{find:function(e){return Al(this,e,arguments.length>1?arguments[1]:void 0)}}),Rl("find");var Ol=o,wl=ee,Nl=Ze("species"),kl=function(e){return wl>=51||!Ol((function(){var t=[];return(t.constructor={})[Nl]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Dl=jn,Pl=n,Ml=o,Ul=Bd,Ll=F,xl=De,Bl=Zr,Vl=os,jl=al,Fl=kl,Gl=ee,zl=Ze("isConcatSpreadable"),Hl=Pl.TypeError,Wl=Gl>=51||!Ml((function(){var e=[];return e[zl]=!1,e.concat()[0]!==e})),Yl=Fl("concat"),Kl=function(e){if(!Ll(e))return!1;var t=e[zl];return void 0!==t?!!t:Ul(e)};Dl({target:"Array",proto:!0,forced:!Wl||!Yl},{concat:function(e){var t,r,n,i,o,a=xl(this),s=jl(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(Kl(o=-1===t?a:arguments[t])){if(c+(i=Bl(o))>9007199254740991)throw Hl("Maximum allowed index exceeded");for(r=0;r<i;r++,c++)r in o&&Vl(s,c,o[r])}else{if(c>=9007199254740991)throw Hl("Maximum allowed index exceeded");Vl(s,c++,o)}return s.length=c,s}});var Xl,ql,Jl,Zl,$l=n.Promise,Ql=$d,ef=fe,tf=n.TypeError,rf=function(e){if(Ql(e))return e;throw tf(ef(e)+" is not a constructor")},nf=kt,of=rf,af=Ze("species"),sf=function(e,t){var r,n=nf(e).constructor;return void 0===n||null==(r=nf(n)[af])?t:of(r)},cf=s,uf=Function.prototype,df=uf.apply,lf=uf.call,ff="object"==typeof Reflect&&Reflect.apply||(cf?lf.bind(df):function(){return lf.apply(df,arguments)}),hf=n.TypeError,pf=function(e,t){if(e<t)throw hf("Not enough arguments");return e},_f=/(?:ipad|iphone|ipod).*applewebkit/i.test(K),vf="process"==C(n.process),mf=n,gf=ff,yf=zs,Ef=V,Sf=Ue,bf=o,Tf=Eo,If=pd,Af=ht,Rf=pf,Cf=_f,Of=vf,wf=mf.setImmediate,Nf=mf.clearImmediate,kf=mf.process,Df=mf.Dispatch,Pf=mf.Function,Mf=mf.MessageChannel,Uf=mf.String,Lf=0,xf={};try{Xl=mf.location}catch(e){}var Bf=function(e){if(Sf(xf,e)){var t=xf[e];delete xf[e],t()}},Vf=function(e){return function(){Bf(e)}},jf=function(e){Bf(e.data)},Ff=function(e){mf.postMessage(Uf(e),Xl.protocol+"//"+Xl.host)};wf&&Nf||(wf=function(e){Rf(arguments.length,1);var t=Ef(e)?e:Pf(e),r=If(arguments,1);return xf[++Lf]=function(){gf(t,void 0,r)},ql(Lf),Lf},Nf=function(e){delete xf[e]},Of?ql=function(e){kf.nextTick(Vf(e))}:Df&&Df.now?ql=function(e){Df.now(Vf(e))}:Mf&&!Cf?(Zl=(Jl=new Mf).port2,Jl.port1.onmessage=jf,ql=yf(Zl.postMessage,Zl)):mf.addEventListener&&Ef(mf.postMessage)&&!mf.importScripts&&Xl&&"file:"!==Xl.protocol&&!bf(Ff)?(ql=Ff,mf.addEventListener("message",jf,!1)):ql="onreadystatechange"in Af("script")?function(e){Tf.appendChild(Af("script")).onreadystatechange=function(){Tf.removeChild(this),Bf(e)}}:function(e){setTimeout(Vf(e),0)});var Gf,zf,Hf,Wf,Yf,Kf,Xf,qf,Jf={set:wf,clear:Nf},Zf=n,$f=/ipad|iphone|ipod/i.test(K)&&void 0!==Zf.Pebble,Qf=/web0s(?!.*chrome)/i.test(K),eh=n,th=zs,rh=i.f,nh=Jf.set,ih=_f,oh=$f,ah=Qf,sh=vf,ch=eh.MutationObserver||eh.WebKitMutationObserver,uh=eh.document,dh=eh.process,lh=eh.Promise,fh=rh(eh,"queueMicrotask"),hh=fh&&fh.value;hh||(Gf=function(){var e,t;for(sh&&(e=dh.domain)&&e.exit();zf;){t=zf.fn,zf=zf.next;try{t()}catch(e){throw zf?Wf():Hf=void 0,e}}Hf=void 0,e&&e.enter()},ih||sh||ah||!ch||!uh?!oh&&lh&&lh.resolve?((Xf=lh.resolve(void 0)).constructor=lh,qf=th(Xf.then,Xf),Wf=function(){qf(Gf)}):sh?Wf=function(){dh.nextTick(Gf)}:(nh=th(nh,eh),Wf=function(){nh(Gf)}):(Yf=!0,Kf=uh.createTextNode(""),new ch(Gf).observe(Kf,{characterData:!0}),Wf=function(){Kf.data=Yf=!Yf}));var ph=hh||function(e){var t={fn:e,next:void 0};Hf&&(Hf.next=t),zf||(zf=t,Wf()),Hf=t},_h={},vh=ve,mh=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=vh(t),this.reject=vh(r)};_h.f=function(e){return new mh(e)};var gh=kt,yh=F,Eh=_h,Sh=n,bh=function(){this.head=null,this.tail=null};bh.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 Th,Ih,Ah,Rh,Ch=bh,Oh="object"==typeof window,wh=jn,Nh=n,kh=W,Dh=d,Ph=$l,Mh=zt.exports,Uh=cu,Lh=Ia,xh=ua,Bh=hu,Vh=ve,jh=V,Fh=F,Gh=Lc,zh=Jt,Hh=Pc,Wh=Fc,Yh=sf,Kh=Jf.set,Xh=ph,qh=function(e,t){if(gh(e),yh(t)&&t.constructor===e)return t;var r=Eh.f(e);return(0,r.resolve)(t),r.promise},Jh=function(e,t){var r=Sh.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Zh=_h,$h=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Qh=Ch,ep=br,tp=Dn,rp=Oh,np=vf,ip=ee,op=Ze("species"),ap="Promise",sp=ep.getterFor(ap),cp=ep.set,up=ep.getterFor(ap),dp=Ph&&Ph.prototype,lp=Ph,fp=dp,hp=Nh.TypeError,pp=Nh.document,_p=Nh.process,vp=Zh.f,mp=vp,gp=!!(pp&&pp.createEvent&&Nh.dispatchEvent),yp=jh(Nh.PromiseRejectionEvent),Ep=!1,Sp=tp(ap,(function(){var e=zh(lp),t=e!==String(lp);if(!t&&66===ip)return!0;if(ip>=51&&/native code/.test(e))return!1;var r=new lp((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[op]=n,!(Ep=r.then((function(){}))instanceof n)||!t&&rp&&!yp})),bp=Sp||!Wh((function(e){lp.all(e).catch((function(){}))})),Tp=function(e){var t;return!(!Fh(e)||!jh(t=e.then))&&t},Ip=function(e,t){var r,n,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&wp(t),t.rejection=1),!0===s?r=o:(d&&d.enter(),r=s(o),d&&(d.exit(),i=!0)),r===e.promise?u(hp("Promise-chain cycle")):(n=Tp(r))?Dh(n,r,c,u):c(r)):u(o)}catch(e){d&&!i&&d.exit(),u(e)}},Ap=function(e,t){e.notified||(e.notified=!0,Xh((function(){for(var r,n=e.reactions;r=n.get();)Ip(r,e);e.notified=!1,t&&!e.rejection&&Cp(e)})))},Rp=function(e,t,r){var n,i;gp?((n=pp.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Nh.dispatchEvent(n)):n={promise:t,reason:r},!yp&&(i=Nh["on"+e])?i(n):"unhandledrejection"===e&&Jh("Unhandled promise rejection",r)},Cp=function(e){Dh(Kh,Nh,(function(){var t,r=e.facade,n=e.value;if(Op(e)&&(t=$h((function(){np?_p.emit("unhandledRejection",n,r):Rp("unhandledrejection",r,n)})),e.rejection=np||Op(e)?2:1,t.error))throw t.value}))},Op=function(e){return 1!==e.rejection&&!e.parent},wp=function(e){Dh(Kh,Nh,(function(){var t=e.facade;np?_p.emit("rejectionHandled",t):Rp("rejectionhandled",t,e.value)}))},Np=function(e,t,r){return function(n){e(t,n,r)}},kp=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Ap(e,!0))},Dp=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw hp("Promise can't be resolved itself");var n=Tp(t);n?Xh((function(){var r={done:!1};try{Dh(n,t,Np(Dp,r,e),Np(kp,r,e))}catch(t){kp(r,t,e)}})):(e.value=t,e.state=1,Ap(e,!1))}catch(t){kp({done:!1},t,e)}}};if(Sp&&(fp=(lp=function(e){Gh(this,fp),Vh(e),Dh(Th,this);var t=sp(this);try{e(Np(Dp,t),Np(kp,t))}catch(e){kp(t,e)}}).prototype,(Th=function(e){cp(this,{type:ap,done:!1,notified:!1,parent:!1,reactions:new Qh,rejection:!1,state:0,value:void 0})}).prototype=Uh(fp,{then:function(e,t){var r=up(this),n=vp(Yh(this,lp));return r.parent=!0,n.ok=!jh(e)||e,n.fail=jh(t)&&t,n.domain=np?_p.domain:void 0,0==r.state?r.reactions.add(n):Xh((function(){Ip(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),Ih=function(){var e=new Th,t=sp(e);this.promise=e,this.resolve=Np(Dp,t),this.reject=Np(kp,t)},Zh.f=vp=function(e){return e===lp||e===Ah?new Ih(e):mp(e)},jh(Ph)&&dp!==Object.prototype)){Rh=dp.then,Ep||(Mh(dp,"then",(function(e,t){var r=this;return new lp((function(e,t){Dh(Rh,r,e,t)})).then(e,t)}),{unsafe:!0}),Mh(dp,"catch",fp.catch,{unsafe:!0}));try{delete dp.constructor}catch(e){}Lh&&Lh(dp,fp)}wh({global:!0,wrap:!0,forced:Sp},{Promise:lp}),xh(lp,ap,!1),Bh(ap),Ah=kh(ap),wh({target:ap,stat:!0,forced:Sp},{reject:function(e){var t=vp(this);return Dh(t.reject,void 0,e),t.promise}}),wh({target:ap,stat:!0,forced:Sp},{resolve:function(e){return qh(this,e)}}),wh({target:ap,stat:!0,forced:bp},{all:function(e){var t=this,r=vp(t),n=r.resolve,i=r.reject,o=$h((function(){var r=Vh(t.resolve),o=[],a=0,s=1;Hh(e,(function(e){var c=a++,u=!1;s++,Dh(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=vp(t),n=r.reject,i=$h((function(){var i=Vh(t.resolve);Hh(e,(function(e){Dh(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),jn({target:"Array",stat:!0},{isArray:Bd});var Pp=jn,Mp=n,Up=Bd,Lp=$d,xp=F,Bp=Yr,Vp=Zr,jp=B,Fp=os,Gp=Ze,zp=pd,Hp=kl("slice"),Wp=Gp("species"),Yp=Mp.Array,Kp=Math.max;Pp({target:"Array",proto:!0,forced:!Hp},{slice:function(e,t){var r,n,i,o=jp(this),a=Vp(o),s=Bp(e,a),c=Bp(void 0===t?a:t,a);if(Up(o)&&(r=o.constructor,(Lp(r)&&(r===Yp||Up(r.prototype))||xp(r)&&null===(r=r[Wp]))&&(r=void 0),r===Yp||void 0===r))return zp(o,s,c);for(n=new(void 0===r?Yp:r)(Kp(c-s,0)),i=0;s<c;s++,i++)s in o&&Fp(n,i,o[s]);return n.length=i,n}});var Xp=ls,qp=Math.floor,Jp=function(e,t){var r=e.length,n=qp(r/2);return r<8?Zp(e,t):$p(e,Jp(Xp(e,0,n),t),Jp(Xp(e,n),t),t)},Zp=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},$p=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e},Qp=Jp,e_=K.match(/firefox\/(\d+)/i),t_=!!e_&&+e_[1],r_=/MSIE|Trident/.test(K),n_=K.match(/AppleWebKit\/(\d+)\./),i_=!!n_&&+n_[1],o_=jn,a_=T,s_=ve,c_=De,u_=Zr,d_=Mu,l_=o,f_=Qp,h_=wd,p_=t_,__=r_,v_=ee,m_=i_,g_=[],y_=a_(g_.sort),E_=a_(g_.push),S_=l_((function(){g_.sort(void 0)})),b_=l_((function(){g_.sort(null)})),T_=h_("sort"),I_=!l_((function(){if(v_)return v_<70;if(!(p_&&p_>3)){if(__)return!0;if(m_)return m_<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)g_.push({k:t+n,v:r})}for(g_.sort((function(e,t){return t.v-e.v})),n=0;n<g_.length;n++)t=g_[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));o_({target:"Array",proto:!0,forced:S_||!b_||!T_||!I_},{sort:function(e){void 0!==e&&s_(e);var t=c_(this);if(I_)return void 0===e?y_(t):y_(t,e);var r,n,i=[],o=u_(t);for(n=0;n<o;n++)n in t&&E_(i,t[n]);for(f_(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:d_(t)>d_(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<o;)delete t[n++];return t}});var A_="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,R_=Gr,C_=qr,O_=n.RangeError,w_=function(e){if(void 0===e)return 0;var t=R_(e),r=C_(t);if(t!==r)throw O_("Wrong length or index");return r},N_=n.Array,k_=Math.abs,D_=Math.pow,P_=Math.floor,M_=Math.log,U_=Math.LN2,L_={pack:function(e,t,r){var n,i,o,a=N_(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,d=23===t?D_(2,-24)-D_(2,-77):0,l=e<0||0===e&&1/e<0?1:0,f=0;for((e=k_(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=P_(M_(e)/U_),e*(o=D_(2,-n))<1&&(n--,o*=2),(e+=n+u>=1?d/o:d*D_(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*D_(2,t),n+=u):(i=e*D_(2,u-1)*D_(2,t),n=0));t>=8;)a[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)a[f++]=255&n,n/=256,s-=8;return a[--f]|=128*l,a},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],d=127&u;for(u>>=7;s>0;)d=256*d+e[c--],s-=8;for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===d)d=1-a;else{if(d===o)return r?NaN:u?-1/0:1/0;r+=D_(2,t),d-=a}return(u?-1:1)*r*D_(2,d-t)}},x_=De,B_=Yr,V_=Zr,j_=function(e){for(var t=x_(this),r=V_(t),n=arguments.length,i=B_(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:B_(o,r);a>i;)t[i++]=e;return t},F_=n,G_=T,z_=a,H_=A_,W_=Or,Y_=Gt,K_=cu,X_=o,q_=Lc,J_=Gr,Z_=qr,$_=w_,Q_=L_,ev=Zo,tv=Ia,rv=Vr.f,nv=At.f,iv=j_,ov=ls,av=ua,sv=W_.PROPER,cv=W_.CONFIGURABLE,uv=br.get,dv=br.set,lv=F_.ArrayBuffer,fv=lv,hv=fv&&fv.prototype,pv=F_.DataView,_v=pv&&pv.prototype,vv=Object.prototype,mv=F_.Array,gv=F_.RangeError,yv=G_(iv),Ev=G_([].reverse),Sv=Q_.pack,bv=Q_.unpack,Tv=function(e){return[255&e]},Iv=function(e){return[255&e,e>>8&255]},Av=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Rv=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Cv=function(e){return Sv(e,23,4)},Ov=function(e){return Sv(e,52,8)},wv=function(e,t){nv(e.prototype,t,{get:function(){return uv(this)[t]}})},Nv=function(e,t,r,n){var i=$_(r),o=uv(e);if(i+t>o.byteLength)throw gv("Wrong index");var a=uv(o.buffer).bytes,s=i+o.byteOffset,c=ov(a,s,s+t);return n?c:Ev(c)},kv=function(e,t,r,n,i,o){var a=$_(r),s=uv(e);if(a+t>s.byteLength)throw gv("Wrong index");for(var c=uv(s.buffer).bytes,u=a+s.byteOffset,d=n(+i),l=0;l<t;l++)c[u+l]=d[o?l:t-l-1]};if(H_){var Dv=sv&&"ArrayBuffer"!==lv.name;if(X_((function(){lv(1)}))&&X_((function(){new lv(-1)}))&&!X_((function(){return new lv,new lv(1.5),new lv(NaN),Dv&&!cv})))Dv&&cv&&Y_(lv,"name","ArrayBuffer");else{(fv=function(e){return q_(this,hv),new lv($_(e))}).prototype=hv;for(var Pv,Mv=rv(lv),Uv=0;Mv.length>Uv;)(Pv=Mv[Uv++])in fv||Y_(fv,Pv,lv[Pv]);hv.constructor=fv}tv&&ev(_v)!==vv&&tv(_v,vv);var Lv=new pv(new fv(2)),xv=G_(_v.setInt8);Lv.setInt8(0,2147483648),Lv.setInt8(1,2147483649),!Lv.getInt8(0)&&Lv.getInt8(1)||K_(_v,{setInt8:function(e,t){xv(this,e,t<<24>>24)},setUint8:function(e,t){xv(this,e,t<<24>>24)}},{unsafe:!0})}else hv=(fv=function(e){q_(this,hv);var t=$_(e);dv(this,{bytes:yv(mv(t),0),byteLength:t}),z_||(this.byteLength=t)}).prototype,_v=(pv=function(e,t,r){q_(this,_v),q_(e,hv);var n=uv(e).byteLength,i=J_(t);if(i<0||i>n)throw gv("Wrong offset");if(i+(r=void 0===r?n-i:Z_(r))>n)throw gv("Wrong length");dv(this,{buffer:e,byteLength:r,byteOffset:i}),z_||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,z_&&(wv(fv,"byteLength"),wv(pv,"buffer"),wv(pv,"byteLength"),wv(pv,"byteOffset")),K_(_v,{getInt8:function(e){return Nv(this,1,e)[0]<<24>>24},getUint8:function(e){return Nv(this,1,e)[0]},getInt16:function(e){var t=Nv(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Nv(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Rv(Nv(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Rv(Nv(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return bv(Nv(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return bv(Nv(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){kv(this,1,e,Tv,t)},setUint8:function(e,t){kv(this,1,e,Tv,t)},setInt16:function(e,t){kv(this,2,e,Iv,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){kv(this,2,e,Iv,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){kv(this,4,e,Av,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){kv(this,4,e,Av,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){kv(this,4,e,Cv,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){kv(this,8,e,Ov,t,arguments.length>2?arguments[2]:void 0)}});av(fv,"ArrayBuffer"),av(pv,"DataView");var Bv={ArrayBuffer:fv,DataView:pv},Vv=jn,jv=T,Fv=o,Gv=kt,zv=Yr,Hv=qr,Wv=sf,Yv=Bv.ArrayBuffer,Kv=Bv.DataView,Xv=Kv.prototype,qv=jv(Yv.prototype.slice),Jv=jv(Xv.getUint8),Zv=jv(Xv.setUint8);Vv({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Fv((function(){return!new Yv(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(qv&&void 0===t)return qv(Gv(this),e);for(var r=Gv(this).byteLength,n=zv(e,r),i=zv(void 0===t?r:t,r),o=new(Wv(this,Yv))(Hv(i-n)),a=new Kv(this),s=new Kv(o),c=0;n<i;)Zv(s,c++,Jv(a,n++));return o}});var $v,Qv,em,tm={exports:{}},rm=A_,nm=a,im=n,om=V,am=F,sm=Ue,cm=nc,um=fe,dm=Gt,lm=zt.exports,fm=At.f,hm=Y,pm=Zo,_m=Ia,vm=Ze,mm=je,gm=im.Int8Array,ym=gm&&gm.prototype,Em=im.Uint8ClampedArray,Sm=Em&&Em.prototype,bm=gm&&pm(gm),Tm=ym&&pm(ym),Im=Object.prototype,Am=im.TypeError,Rm=vm("toStringTag"),Cm=mm("TYPED_ARRAY_TAG"),Om=mm("TYPED_ARRAY_CONSTRUCTOR"),wm=rm&&!!_m&&"Opera"!==cm(im.opera),Nm=!1,km={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Dm={BigInt64Array:8,BigUint64Array:8},Pm=function(e){if(!am(e))return!1;var t=cm(e);return sm(km,t)||sm(Dm,t)};for($v in km)(em=(Qv=im[$v])&&Qv.prototype)?dm(em,Om,Qv):wm=!1;for($v in Dm)(em=(Qv=im[$v])&&Qv.prototype)&&dm(em,Om,Qv);if((!wm||!om(bm)||bm===Function.prototype)&&(bm=function(){throw Am("Incorrect invocation")},wm))for($v in km)im[$v]&&_m(im[$v],bm);if((!wm||!Tm||Tm===Im)&&(Tm=bm.prototype,wm))for($v in km)im[$v]&&_m(im[$v].prototype,Tm);if(wm&&pm(Sm)!==Tm&&_m(Sm,Tm),nm&&!sm(Tm,Rm))for($v in Nm=!0,fm(Tm,Rm,{get:function(){return am(this)?this[Cm]:void 0}}),km)im[$v]&&dm(im[$v],Cm,$v);var Mm={NATIVE_ARRAY_BUFFER_VIEWS:wm,TYPED_ARRAY_CONSTRUCTOR:Om,TYPED_ARRAY_TAG:Nm&&Cm,aTypedArray:function(e){if(Pm(e))return e;throw Am("Target is not a typed array")},aTypedArrayConstructor:function(e){if(om(e)&&(!_m||hm(bm,e)))return e;throw Am(um(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(nm){if(r)for(var i in km){var o=im[i];if(o&&sm(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}Tm[e]&&!r||lm(Tm,e,r?t:wm&&ym[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(nm){if(_m){if(r)for(n in km)if((i=im[n])&&sm(i,e))try{delete i[e]}catch(e){}if(bm[e]&&!r)return;try{return lm(bm,e,r?t:wm&&bm[e]||t)}catch(e){}}for(n in km)!(i=im[n])||i[e]&&!r||lm(i,e,t)}},isView:function(e){if(!am(e))return!1;var t=cm(e);return"DataView"===t||sm(km,t)||sm(Dm,t)},isTypedArray:Pm,TypedArray:bm,TypedArrayPrototype:Tm},Um=n,Lm=o,xm=Fc,Bm=Mm.NATIVE_ARRAY_BUFFER_VIEWS,Vm=Um.ArrayBuffer,jm=Um.Int8Array,Fm=!Bm||!Lm((function(){jm(1)}))||!Lm((function(){new jm(-1)}))||!xm((function(e){new jm,new jm(null),new jm(1.5),new jm(e)}),!0)||Lm((function(){return 1!==new jm(new Vm(2),1,void 0).length})),Gm=F,zm=Math.floor,Hm=Number.isInteger||function(e){return!Gm(e)&&isFinite(e)&&zm(e)===e},Wm=Gr,Ym=n.RangeError,Km=function(e){var t=Wm(e);if(t<0)throw Ym("The argument can't be less than 0");return t},Xm=n.RangeError,qm=function(e,t){var r=Km(e);if(r%t)throw Xm("Wrong offset");return r},Jm=zs,Zm=d,$m=rf,Qm=De,eg=Zr,tg=_c,rg=cc,ng=Ks,ig=Mm.aTypedArrayConstructor,og=jn,ag=n,sg=d,cg=a,ug=Fm,dg=Mm,lg=Bv,fg=Lc,hg=m,pg=Gt,_g=Hm,vg=qr,mg=w_,gg=qm,yg=ut,Eg=Ue,Sg=nc,bg=F,Tg=de,Ig=Do,Ag=Y,Rg=Ia,Cg=Vr.f,Og=function(e){var t,r,n,i,o,a,s=$m(this),c=Qm(e),u=arguments.length,d=u>1?arguments[1]:void 0,l=void 0!==d,f=rg(c);if(f&&!ng(f))for(a=(o=tg(c,f)).next,c=[];!(i=Zm(a,o)).done;)c.push(i.value);for(l&&u>2&&(d=Jm(d,arguments[2])),r=eg(c),n=new(ig(s))(r),t=0;r>t;t++)n[t]=l?d(c[t],t):c[t];return n},wg=pl.forEach,Ng=hu,kg=At,Dg=i,Pg=Wc,Mg=br.get,Ug=br.set,Lg=kg.f,xg=Dg.f,Bg=Math.round,Vg=ag.RangeError,jg=lg.ArrayBuffer,Fg=jg.prototype,Gg=lg.DataView,zg=dg.NATIVE_ARRAY_BUFFER_VIEWS,Hg=dg.TYPED_ARRAY_CONSTRUCTOR,Wg=dg.TYPED_ARRAY_TAG,Yg=dg.TypedArray,Kg=dg.TypedArrayPrototype,Xg=dg.aTypedArrayConstructor,qg=dg.isTypedArray,Jg=function(e,t){Xg(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},Zg=function(e,t){Lg(e,t,{get:function(){return Mg(this)[t]}})},$g=function(e){var t;return Ag(Fg,e)||"ArrayBuffer"==(t=Sg(e))||"SharedArrayBuffer"==t},Qg=function(e,t){return qg(e)&&!Tg(t)&&t in e&&_g(+t)&&t>=0},ey=function(e,t){return t=yg(t),Qg(e,t)?hg(2,e[t]):xg(e,t)},ty=function(e,t,r){return t=yg(t),!(Qg(e,t)&&bg(r)&&Eg(r,"value"))||Eg(r,"get")||Eg(r,"set")||r.configurable||Eg(r,"writable")&&!r.writable||Eg(r,"enumerable")&&!r.enumerable?Lg(e,t,r):(e[t]=r.value,e)};cg?(zg||(Dg.f=ey,kg.f=ty,Zg(Kg,"buffer"),Zg(Kg,"byteOffset"),Zg(Kg,"byteLength"),Zg(Kg,"length")),og({target:"Object",stat:!0,forced:!zg},{getOwnPropertyDescriptor:ey,defineProperty:ty}),tm.exports=function(e,t,r){var n=e.match(/\d+$/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=ag[i],c=s,u=c&&c.prototype,d={},l=function(e,t){Lg(e,t,{get:function(){return function(e,t){var r=Mg(e);return r.view[o](t*n+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=Mg(e);r&&(i=(i=Bg(i))<0?0:i>255?255:255&i),o.view[a](t*n+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};zg?ug&&(c=t((function(e,t,r,i){return fg(e,u),Pg(bg(t)?$g(t)?void 0!==i?new s(t,gg(r,n),i):void 0!==r?new s(t,gg(r,n)):new s(t):qg(t)?Jg(c,t):sg(Og,c,t):new s(mg(t)),e,c)})),Rg&&Rg(c,Yg),wg(Cg(s),(function(e){e in c||pg(c,e,s[e])})),c.prototype=u):(c=t((function(e,t,r,i){fg(e,u);var o,a,s,d=0,f=0;if(bg(t)){if(!$g(t))return qg(t)?Jg(c,t):sg(Og,c,t);o=t,f=gg(r,n);var h=t.byteLength;if(void 0===i){if(h%n)throw Vg("Wrong length");if((a=h-f)<0)throw Vg("Wrong length")}else if((a=vg(i)*n)+f>h)throw Vg("Wrong length");s=a/n}else s=mg(t),o=new jg(a=s*n);for(Ug(e,{buffer:o,byteOffset:f,byteLength:a,length:s,view:new Gg(o)});d<s;)l(e,d++)})),Rg&&Rg(c,Yg),u=c.prototype=Ig(Kg)),u.constructor!==c&&pg(u,"constructor",c),pg(u,Hg,c),Wg&&pg(u,Wg,i),d[i]=c,og({global:!0,forced:c!=s,sham:!zg},d),"BYTES_PER_ELEMENT"in c||pg(c,"BYTES_PER_ELEMENT",n),"BYTES_PER_ELEMENT"in u||pg(u,"BYTES_PER_ELEMENT",n),Ng(i)}):tm.exports=function(){},(0,tm.exports)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var ry=De,ny=Yr,iy=Zr,oy=Math.min,ay=[].copyWithin||function(e,t){var r=ry(this),n=iy(r),i=ny(e,n),o=ny(t,n),a=arguments.length>2?arguments[2]:void 0,s=oy((void 0===a?n:ny(a,n))-o,n-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:delete r[i],i+=c,o+=c;return r},sy=Mm,cy=T(ay),uy=sy.aTypedArray;(0,sy.exportTypedArrayMethod)("copyWithin",(function(e,t){return cy(uy(this),e,t,arguments.length>2?arguments[2]:void 0)}));var dy=pl.every,ly=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("every",(function(e){return dy(ly(this),e,arguments.length>1?arguments[1]:void 0)}));var fy=d,hy=j_,py=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return fy(hy,py(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var _y=Zr,vy=sf,my=Mm.TYPED_ARRAY_CONSTRUCTOR,gy=Mm.aTypedArrayConstructor,yy=function(e){return gy(vy(e,e[my]))},Ey=function(e,t){for(var r=0,n=_y(t),i=new e(n);n>r;)i[r]=t[r++];return i},Sy=yy,by=pl.filter,Ty=function(e,t){return Ey(Sy(e),t)},Iy=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("filter",(function(e){var t=by(Iy(this),e,arguments.length>1?arguments[1]:void 0);return Ty(this,t)}));var Ay=pl.find,Ry=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("find",(function(e){return Ay(Ry(this),e,arguments.length>1?arguments[1]:void 0)}));var Cy=pl.findIndex,Oy=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("findIndex",(function(e){return Cy(Oy(this),e,arguments.length>1?arguments[1]:void 0)}));var wy=pl.forEach,Ny=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("forEach",(function(e){wy(Ny(this),e,arguments.length>1?arguments[1]:void 0)}));var ky=rn.includes,Dy=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("includes",(function(e){return ky(Dy(this),e,arguments.length>1?arguments[1]:void 0)}));var Py=rn.indexOf,My=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("indexOf",(function(e){return Py(My(this),e,arguments.length>1?arguments[1]:void 0)}));var Uy=n,Ly=o,xy=T,By=Mm,Vy=$a,jy=Ze("iterator"),Fy=Uy.Uint8Array,Gy=xy(Vy.values),zy=xy(Vy.keys),Hy=xy(Vy.entries),Wy=By.aTypedArray,Yy=By.exportTypedArrayMethod,Ky=Fy&&Fy.prototype,Xy=!Ly((function(){Ky[jy].call([1])})),qy=!!Ky&&Ky.values&&Ky[jy]===Ky.values&&"values"===Ky.values.name,Jy=function(){return Gy(Wy(this))};Yy("entries",(function(){return Hy(Wy(this))}),Xy),Yy("keys",(function(){return zy(Wy(this))}),Xy),Yy("values",Jy,Xy||!qy,{name:"values"}),Yy(jy,Jy,Xy||!qy,{name:"values"});var Zy=Mm.aTypedArray,$y=Mm.exportTypedArrayMethod,Qy=T([].join);$y("join",(function(e){return Qy(Zy(this),e)}));var eE=ff,tE=B,rE=Gr,nE=Zr,iE=wd,oE=Math.min,aE=[].lastIndexOf,sE=!!aE&&1/[1].lastIndexOf(1,-0)<0,cE=iE("lastIndexOf"),uE=sE||!cE?function(e){if(sE)return eE(aE,this,arguments)||0;var t=tE(this),r=nE(t),n=r-1;for(arguments.length>1&&(n=oE(n,rE(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:aE,dE=ff,lE=uE,fE=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return dE(lE,fE(this),t>1?[e,arguments[1]]:[e])}));var hE=pl.map,pE=yy,_E=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("map",(function(e){return hE(_E(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(pE(e))(t)}))}));var vE=ve,mE=De,gE=P,yE=Zr,EE=n.TypeError,SE=function(e){return function(t,r,n,i){vE(r);var o=mE(t),a=gE(o),s=yE(o),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw EE("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=r(i,a[c],c,o));return i}},bE={left:SE(!1),right:SE(!0)},TE=bE.left,IE=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return TE(IE(this),e,t,t>1?arguments[1]:void 0)}));var AE=bE.right,RE=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return AE(RE(this),e,t,t>1?arguments[1]:void 0)}));var CE=Mm.aTypedArray,OE=Mm.exportTypedArrayMethod,wE=Math.floor;OE("reverse",(function(){for(var e,t=this,r=CE(t).length,n=wE(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var NE=n,kE=d,DE=Mm,PE=Zr,ME=qm,UE=De,LE=o,xE=NE.RangeError,BE=NE.Int8Array,VE=BE&&BE.prototype,jE=VE&&VE.set,FE=DE.aTypedArray,GE=DE.exportTypedArrayMethod,zE=!LE((function(){var e=new Uint8ClampedArray(2);return kE(jE,e,{length:1,0:3},1),3!==e[1]})),HE=zE&&DE.NATIVE_ARRAY_BUFFER_VIEWS&&LE((function(){var e=new BE(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));GE("set",(function(e){FE(this);var t=ME(arguments.length>1?arguments[1]:void 0,1),r=UE(e);if(zE)return kE(jE,this,r,t);var n=this.length,i=PE(r),o=0;if(i+t>n)throw xE("Wrong length");for(;o<i;)this[t+o]=r[o++]}),!zE||HE);var WE=yy,YE=pd,KE=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("slice",(function(e,t){for(var r=YE(KE(this),e,t),n=WE(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),o((function(){new Int8Array(1).slice()})));var XE=pl.some,qE=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("some",(function(e){return XE(qE(this),e,arguments.length>1?arguments[1]:void 0)}));var JE=n,ZE=T,$E=o,QE=ve,eS=Qp,tS=Mm,rS=t_,nS=r_,iS=ee,oS=i_,aS=JE.Array,sS=tS.aTypedArray,cS=tS.exportTypedArrayMethod,uS=JE.Uint16Array,dS=uS&&ZE(uS.prototype.sort),lS=!(!dS||$E((function(){dS(new uS(2),null)}))&&$E((function(){dS(new uS(2),{})}))),fS=!!dS&&!$E((function(){if(iS)return iS<74;if(rS)return rS<67;if(nS)return!0;if(oS)return oS<602;var e,t,r=new uS(516),n=aS(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(dS(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));cS("sort",(function(e){return void 0!==e&&QE(e),fS?dS(this,e):eS(sS(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!fS||lS);var hS=qr,pS=Yr,_S=yy,vS=Mm.aTypedArray;(0,Mm.exportTypedArrayMethod)("subarray",(function(e,t){var r=vS(this),n=r.length,i=pS(e,n);return new(_S(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,hS((void 0===t?n:pS(t,n))-i))}));var mS=ff,gS=Mm,yS=o,ES=pd,SS=n.Int8Array,bS=gS.aTypedArray,TS=gS.exportTypedArrayMethod,IS=[].toLocaleString,AS=!!SS&&yS((function(){IS.call(new SS(1))}));TS("toLocaleString",(function(){return mS(IS,AS?ES(bS(this)):bS(this),ES(arguments))}),yS((function(){return[1,2].toLocaleString()!=new SS([1,2]).toLocaleString()}))||!yS((function(){SS.prototype.toLocaleString.call([1,2])})));var RS=Mm.exportTypedArrayMethod,CS=o,OS=T,wS=n.Uint8Array,NS=wS&&wS.prototype||{},kS=[].toString,DS=OS([].join);CS((function(){kS.call({})}))&&(kS=function(){return DS(this)});var PS=NS.toString!=kS;RS("toString",kS,PS);var MS=jn,US=n,LS=ff,xS=V,BS=pd,VS=pf,jS=/MSIE .\./.test(K),FS=US.Function,GS=function(e){return function(t,r){var n=VS(arguments.length,1)>2,i=xS(t)?t:FS(t),o=n?BS(arguments,2):void 0;return e(n?function(){LS(i,this,o)}:i,r)}};MS({global:!0,bind:!0,forced:jS},{setTimeout:GS(US.setTimeout),setInterval:GS(US.setInterval)});var zS=jn,HS=pl.findIndex,WS=jo,YS=!0;"findIndex"in[]&&Array(1).findIndex((function(){YS=!1})),zS({target:"Array",proto:!0,forced:YS},{findIndex:function(e){return HS(this,e,arguments.length>1?arguments[1]:void 0)}}),WS("findIndex");var KS=jn,XS=n,qS=Yr,JS=Gr,ZS=Zr,$S=De,QS=al,eb=os,tb=kl("splice"),rb=XS.TypeError,nb=Math.max,ib=Math.min;KS({target:"Array",proto:!0,forced:!tb},{splice:function(e,t){var r,n,i,o,a,s,c=$S(this),u=ZS(c),d=qS(e,u),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=u-d):(r=l-2,n=ib(nb(JS(t),0),u-d)),u+r-n>9007199254740991)throw rb("Maximum allowed length exceeded");for(i=QS(c,n),o=0;o<n;o++)(a=d+o)in c&&eb(i,o,c[a]);if(i.length=n,r<n){for(o=d;o<u-n;o++)s=o+r,(a=o+n)in c?c[s]=c[a]:delete c[s];for(o=u;o>u-n+r;o--)delete c[o-1]}else if(r>n)for(o=u-n;o>d;o--)s=o+r-1,(a=o+n-1)in c?c[s]=c[a]:delete c[s];for(o=0;o<r;o++)c[o+d]=arguments[o+2];return c.length=u-n+r,i}});var ob=rn.includes,ab=jo;jn({target:"Array",proto:!0},{includes:function(e){return ob(this,e,arguments.length>1?arguments[1]:void 0)}}),ab("includes");var sb=F,cb=C,ub=Ze("match"),db=function(e){var t;return sb(e)&&(void 0!==(t=e[ub])?!!t:"RegExp"==cb(e))},lb=db,fb=n.TypeError,hb=function(e){if(lb(e))throw fb("The method doesn't accept regular expressions");return e},pb=Ze("match"),_b=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[pb]=!1,"/./"[e](t)}catch(e){}}return!1},vb=jn,mb=hb,gb=U,yb=Mu,Eb=_b,Sb=T("".indexOf);vb({target:"String",proto:!0,forced:!Eb("includes")},{includes:function(e){return!!~Sb(yb(gb(this)),yb(mb(e)),arguments.length>1?arguments[1]:void 0)}});var bb=hu,Tb=Bv.ArrayBuffer;jn({global:!0,forced:n.ArrayBuffer!==Tb},{ArrayBuffer:Tb}),bb("ArrayBuffer");var Ib=De,Ab=fo;jn({target:"Object",stat:!0,forced:o((function(){Ab(1)}))},{keys:function(e){return Ab(Ib(e))}});var Rb,Cb,Ob=kt,wb=function(){var e=Ob(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Nb=o,kb=n.RegExp,Db=Nb((function(){var e=kb("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Pb=Db||Nb((function(){return!kb("a","y").sticky})),Mb={BROKEN_CARET:Db||Nb((function(){var e=kb("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Pb,UNSUPPORTED_Y:Db},Ub=o,Lb=n.RegExp,xb=Ub((function(){var e=Lb(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Bb=o,Vb=n.RegExp,jb=Bb((function(){var e=Vb("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Fb=d,Gb=T,zb=Mu,Hb=wb,Wb=Mb,Yb=Te.exports,Kb=Do,Xb=br.get,qb=xb,Jb=jb,Zb=Yb("native-string-replace",String.prototype.replace),$b=RegExp.prototype.exec,Qb=$b,eT=Gb("".charAt),tT=Gb("".indexOf),rT=Gb("".replace),nT=Gb("".slice),iT=(Cb=/b*/g,Fb($b,Rb=/a/,"a"),Fb($b,Cb,"a"),0!==Rb.lastIndex||0!==Cb.lastIndex),oT=Wb.BROKEN_CARET,aT=void 0!==/()??/.exec("")[1];(iT||aT||oT||qb||Jb)&&(Qb=function(e){var t,r,n,i,o,a,s,c=this,u=Xb(c),d=zb(e),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=Fb(Qb,l,d),c.lastIndex=l.lastIndex,t;var f=u.groups,h=oT&&c.sticky,p=Fb(Hb,c),_=c.source,v=0,m=d;if(h&&(p=rT(p,"y",""),-1===tT(p,"g")&&(p+="g"),m=nT(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==eT(d,c.lastIndex-1))&&(_="(?: "+_+")",m=" "+m,v++),r=new RegExp("^(?:"+_+")",p)),aT&&(r=new RegExp("^"+_+"$(?!\\s)",p)),iT&&(n=c.lastIndex),i=Fb($b,h?r:c,m),h?i?(i.input=nT(i.input,v),i[0]=nT(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:iT&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),aT&&i&&i.length>1&&Fb(Zb,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&f)for(i.groups=a=Kb(null),o=0;o<f.length;o++)a[(s=f[o])[0]]=i[s[1]];return i});var sT,cT,uT=Qb;jn({target:"RegExp",proto:!0,forced:/./.exec!==uT},{exec:uT}),function(e){e.INVALID_ENGINE="INVALID_ENGINE",e.INVALID_PARAMS="INVALID_PARAMS",e.INVALID_TOKEN="INVALID_TOKEN",e.JOIN_ROOM_FAILED="JOIN_ROOM_FAILED",e.REPEAT_JOIN="REPEAT_JOIN",e.REPEAT_PUBLISH="REPEAT_PUBLISH",e.PUBLISH_BEFORE_JOIN="PUBLISH_BEFORE_JOIN",e.UNPUBLISH_BEFORE_JOIN="UNPUBLISH_BEFORE_JOIN",e.SUBSCRIBE_BEFORE_JOIN="SUBSCRIBE_BEFORE_JOIN",e.UNSUBSCRIBE_BEFORE_JOIN="UNSUBSCRIBE_BEFORE_JOIN",e.NO_PUBLISH_PERMISSION="NO_PUBLISH_PERMISSION",e.STREAM_NOT_EXIST="STREAM_NOT_EXIST",e.EMPTY_STREAM="EMPTY_STREAM",e.NOT_CONNECTED_YET="NOT_CONNECTED_YET",e.IM_BEFORE_JOIN="IM_BEFORE_JOIN",e.USER_NOT_EXIST="USER_NOT_EXIST",e.ALREADY_IN_ROOM="ALREADY_IN_ROOM",e.DUPLICATE_LOGIN="DUPLICATE_LOGIN",e.REPEAT_CAPTURE="REPEAT_CAPTURE",e.GET_VIDEO_TRACK_FAILED="GET_VIDEO_TRACK_FAILED",e.GET_AUDIO_TRACK_FAILED="GET_AUDIO_TRACK_FAILED",e.GET_SCREEN_TRACK_FAILED="GET_SCREEN_TRACK_FAILED",e.STREAM_TYPE_NOT_MATCH="STREAM_TYPE_NOT_MATCH",e.CANT_FIND_DOM="CANT_FIND_DOM",e.INVALID_DEVICE_ID="INVALID_DEVICE_ID",e.NO_PERMISSION="NO_PERMISSION",e.NOT_SUPPORTED="NOT_SUPPORTED",e.ICE_SERVER_WRONG="ICE_SERVER_WRONG",e.ESTABLISH_DATACHANNEL_FAILED="ESTABLISH_DATACHANNEL_FAILED",e.LOAD_RESOURCES_FAILED="LOAD_RESOURCES_FAILED",e.SIGNALING_CHANNEL_NOT_OPEN="SIGNALING_CHANNEL_NOT_OPEN",e.TIME_OUT="TIME_OUT",e.REFUSE_OPERATION_IN_DISCONNECT="REFUSE_OPERATION_IN_DISCONNECT",e.ADD_TRANSCEIVER_FAILED="ADD_TRANSCEIVER_FAILED",e.UPDATE_TRACK_FAILED="UPDATE_TRACK_FAILED",e.PUBLISH_FAILED="PUBLISH_FAILED",e.UNPUBLISH_FAILED="UNPUBLISH_FAILED",e.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",e.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",e.OPERATION_CANCEL="OPERATION_CANCEL",e.UNEXPECTED_ERROR="UNEXPECTED_ERROR"}(sT||(sT={})),function(e){e[e.AUDIO_MIXING_ERROR_OK=0]="AUDIO_MIXING_ERROR_OK",e[e.AUDIO_MIXING_ERROR_PRELOAD_FAILED=1]="AUDIO_MIXING_ERROR_PRELOAD_FAILED",e[e.AUDIO_MIXING_ERROR_START_FAILED=2]="AUDIO_MIXING_ERROR_START_FAILED",e[e.AUDIO_MIXING_ERROR_ID_NOT_FOUND=3]="AUDIO_MIXING_ERROR_ID_NOT_FOUND",e[e.AUDIO_MIXING_ERROR_SET_POSITION_FAILED=4]="AUDIO_MIXING_ERROR_SET_POSITION_FAILED",e[e.AUDIO_MIXING_ERROR_INVALID_VOLUME=5]="AUDIO_MIXING_ERROR_INVALID_VOLUME",e[e.AUDIO_MIXING_ERROR_LOAD_CONFLICT=6]="AUDIO_MIXING_ERROR_LOAD_CONFLICT",e[e.AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH=7]="AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH",e[e.AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH=8]="AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH",e[e.AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK=9]="AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK"}(cT||(cT={}));var dT=function(e,t,r){this.code=e,this.message=t,this.error=r};function lT(e){return lT="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},lT(e)}var fT=a,hT=T,pT=fo,_T=B,vT=hT(l.f),mT=hT([].push),gT=function(e){return function(t){for(var r,n=_T(t),i=pT(n),o=i.length,a=0,s=[];o>a;)r=i[a++],fT&&!vT(n,r)||mT(s,e?[r,n[r]]:n[r]);return s}},yT={entries:gT(!0),values:gT(!1)}.entries;jn({target:"Object",stat:!0},{entries:function(e){return yT(e)}});var ET=T,ST=zt.exports,bT=uT,TT=o,IT=Ze,AT=Gt,RT=IT("species"),CT=RegExp.prototype,OT=function(e,t,r,n){var i=IT(e),o=!TT((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!TT((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[RT]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var s=ET(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var a=ET(e),c=t.exec;return c===bT||c===CT.exec?o&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));ST(String.prototype,e,c[0]),ST(CT,i,c[1])}n&&AT(CT[i],"sham",!0)},wT=zu.charAt,NT=function(e,t,r){return t+(r?wT(e,t).length:1)},kT=d,DT=kt,PT=V,MT=C,UT=uT,LT=n.TypeError,xT=function(e,t){var r=e.exec;if(PT(r)){var n=kT(r,e,t);return null!==n&&DT(n),n}if("RegExp"===MT(e))return kT(UT,e,t);throw LT("RegExp#exec called on incompatible receiver")},BT=d,VT=kt,jT=qr,FT=Mu,GT=U,zT=ge,HT=NT,WT=xT;OT("match",(function(e,t,r){return[function(t){var r=GT(this),n=null==t?void 0:zT(t,e);return n?BT(n,t,r):new RegExp(t)[e](FT(r))},function(e){var n=VT(this),i=FT(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return WT(n,i);var a=n.unicode;n.lastIndex=0;for(var s,c=[],u=0;null!==(s=WT(n,i));){var d=FT(s[0]);c[u]=d,""===d&&(n.lastIndex=HT(i,jT(n.lastIndex),a)),u++}return 0===u?null:c}]}));var YT=Gr,KT=Mu,XT=U,qT=n.RangeError,JT=T,ZT=qr,$T=Mu,QT=U,eI=JT((function(e){var t=KT(XT(this)),r="",n=YT(e);if(n<0||n==1/0)throw qT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),tI=JT("".slice),rI=Math.ceil,nI=function(e){return function(t,r,n){var i,o,a=$T(QT(t)),s=ZT(r),c=a.length,u=void 0===n?" ":$T(n);return s<=c||""==u?a:((o=eI(u,rI((i=s-c)/u.length))).length>i&&(o=tI(o,0,i)),e?a+o:o+a)}},iI={start:nI(!1),end:nI(!0)},oI=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(K),aI=iI.end;jn({target:"String",proto:!0,forced:oI},{padEnd:function(e){return aI(this,e,arguments.length>1?arguments[1]:void 0)}});var sI=T,cI=Or.PROPER,uI=zt.exports,dI=kt,lI=Y,fI=Mu,hI=o,pI=wb,_I=RegExp.prototype,vI=_I.toString,mI=sI(pI),gI=hI((function(){return"/a/b"!=vI.call({source:"a",flags:"b"})})),yI=cI&&"toString"!=vI.name;(gI||yI)&&uI(RegExp.prototype,"toString",(function(){var e=dI(this),t=fI(e.source),r=e.flags;return"/"+t+"/"+fI(void 0===r&&lI(_I,e)&&!("flags"in _I)?mI(e):r)}),{unsafe:!0});var EI=ff,SI=d,bI=T,TI=OT,II=db,AI=kt,RI=U,CI=sf,OI=NT,wI=qr,NI=Mu,kI=ge,DI=ls,PI=xT,MI=uT,UI=o,LI=Mb.UNSUPPORTED_Y,xI=Math.min,BI=[].push,VI=bI(/./.exec),jI=bI(BI),FI=bI("".slice);TI("split",(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=NI(RI(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!II(e))return SI(t,n,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,l=new RegExp(e.source,u+"g");(o=SI(MI,l,n))&&!((a=l.lastIndex)>d&&(jI(c,FI(n,d,o.index)),o.length>1&&o.index<n.length&&EI(BI,c,DI(o,1)),s=o[0].length,d=a,c.length>=i));)l.lastIndex===o.index&&l.lastIndex++;return d===n.length?!s&&VI(l,"")||jI(c,""):jI(c,FI(n,d)),c.length>i?DI(c,0,i):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:SI(t,this,e,r)}:t,[function(t,r){var i=RI(this),o=null==t?void 0:kI(t,e);return o?SI(o,t,i,r):SI(n,NI(i),t,r)},function(e,i){var o=AI(this),a=NI(e),s=r(n,o,a,i,n!==t);if(s.done)return s.value;var c=CI(o,RegExp),u=o.unicode,d=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(LI?"g":"y"),l=new c(LI?"^(?:"+o.source+")":o,d),f=void 0===i?4294967295:i>>>0;if(0===f)return[];if(0===a.length)return null===PI(l,a)?[a]:[];for(var h=0,p=0,_=[];p<a.length;){l.lastIndex=LI?0:p;var v,m=PI(l,LI?FI(a,p):a);if(null===m||(v=xI(wI(l.lastIndex+(LI?p:0)),a.length))===h)p=OI(a,p,u);else{if(jI(_,FI(a,h,p)),_.length===f)return _;for(var g=1;g<=m.length-1;g++)if(jI(_,m[g]),_.length===f)return _;p=h=v}}return jI(_,FI(a,h)),_}]}),!!UI((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),LI);var GI=pl.map;jn({target:"Array",proto:!0,forced:!kl("map")},{map:function(e){return GI(this,e,arguments.length>1?arguments[1]:void 0)}});var zI=U,HI=Mu,WI=T("".replace),YI="[\t\n\v\f\r                 \u2028\u2029\ufeff]",KI=RegExp("^"+YI+YI+"*"),XI=RegExp(YI+YI+"*$"),qI=function(e){return function(t){var r=HI(zI(t));return 1&e&&(r=WI(r,KI,"")),2&e&&(r=WI(r,XI,"")),r}},JI={start:qI(1),end:qI(2),trim:qI(3)},ZI=n,$I=o,QI=T,eA=Mu,tA=JI.trim,rA=ZI.parseInt,nA=ZI.Symbol,iA=nA&&nA.iterator,oA=/^[+-]?0x/i,aA=QI(oA.exec),sA=8!==rA("\t\n\v\f\r                 \u2028\u2029\ufeff08")||22!==rA("\t\n\v\f\r                 \u2028\u2029\ufeff0x16")||iA&&!$I((function(){rA(Object(iA))}))?function(e,t){var r=tA(eA(e));return rA(r,t>>>0||(aA(oA,r)?16:10))}:rA;jn({target:"Number",stat:!0,forced:Number.parseInt!=sA},{parseInt:sA});var cA=T(1..valueOf),uA=a,dA=n,lA=T,fA=Dn,hA=zt.exports,pA=Ue,_A=Wc,vA=Y,mA=de,gA=at,yA=o,EA=Vr.f,SA=i.f,bA=At.f,TA=cA,IA=JI.trim,AA=dA.Number,RA=AA.prototype,CA=dA.TypeError,OA=lA("".slice),wA=lA("".charCodeAt),NA=function(e){var t=gA(e,"number");return"bigint"==typeof t?t:kA(t)},kA=function(e){var t,r,n,i,o,a,s,c,u=gA(e,"number");if(mA(u))throw CA("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=IA(u),43===(t=wA(u,0))||45===t){if(88===(r=wA(u,2))||120===r)return NaN}else if(48===t){switch(wA(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(a=(o=OA(u,2)).length,s=0;s<a;s++)if((c=wA(o,s))<48||c>i)return NaN;return parseInt(o,n)}return+u};if(fA("Number",!AA(" 0o1")||!AA("0b1")||AA("+0x1"))){for(var DA,PA=function(e){var t=arguments.length<1?0:AA(NA(e)),r=this;return vA(RA,r)&&yA((function(){TA(r)}))?_A(Object(t),r,PA):t},MA=uA?EA(AA):"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(","),UA=0;MA.length>UA;UA++)pA(AA,DA=MA[UA])&&!pA(PA,DA)&&bA(PA,DA,SA(AA,DA));PA.prototype=RA,RA.constructor=PA,hA(dA,"Number",PA)}jn({target:"ArrayBuffer",stat:!0,forced:!Mm.NATIVE_ARRAY_BUFFER_VIEWS},{isView:Mm.isView}),jn({global:!0,forced:!A_},{DataView:Bv.DataView});var LA=kt,xA=yc,BA=zs,VA=d,jA=De,FA=function(e,t,r,n){try{return n?t(LA(r)[0],r[1]):t(r)}catch(t){xA(e,"throw",t)}},GA=Ks,zA=$d,HA=Zr,WA=os,YA=_c,KA=cc,XA=n.Array,qA=function(e){var t=jA(e),r=zA(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=BA(i,n>2?arguments[2]:void 0));var a,s,c,u,d,l,f=KA(t),h=0;if(!f||this==XA&&GA(f))for(a=HA(t),s=r?new this(a):XA(a);a>h;h++)l=o?i(t[h],h):t[h],WA(s,h,l);else for(d=(u=YA(t,f)).next,s=r?new this:[];!(c=VA(d,u)).done;h++)l=o?FA(u,i,[c.value,h],!0):c.value,WA(s,h,l);return s.length=h,s},JA=qA;jn({target:"Array",stat:!0,forced:!Fc((function(e){Array.from(e)}))},{from:JA});var ZA=jn,$A=Bd,QA=T([].reverse),eR=[1,2];ZA({target:"Array",proto:!0,forced:String(eR)===String(eR.reverse())},{reverse:function(){return $A(this)&&(this.length=this.length),QA(this)}});var tR,rR=a,nR=Or.EXISTS,iR=T,oR=At.f,aR=Function.prototype,sR=iR(aR.toString),cR=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,uR=iR(cR.exec);rR&&!nR&&oR(aR,"name",{configurable:!0,get:function(){try{return uR(cR,sR(this))[1]}catch(e){return""}}});var dR=new Uint8Array(16);function lR(){if(!tR&&!(tR="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tR(dR)}var fR=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function hR(e){return"string"==typeof e&&fR.test(e)}for(var pR=[],_R=0;_R<256;++_R)pR.push((_R+256).toString(16).substr(1));function vR(e,t,r){var n=(e=e||{}).random||(e.rng||lR)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(pR[e[t+0]]+pR[e[t+1]]+pR[e[t+2]]+pR[e[t+3]]+"-"+pR[e[t+4]]+pR[e[t+5]]+"-"+pR[e[t+6]]+pR[e[t+7]]+"-"+pR[e[t+8]]+pR[e[t+9]]+"-"+pR[e[t+10]]+pR[e[t+11]]+pR[e[t+12]]+pR[e[t+13]]+pR[e[t+14]]+pR[e[t+15]]).toLowerCase();if(!hR(r))throw TypeError("Stringified UUID is invalid");return r}(n)}const mR="function"==typeof atob,gR="function"==typeof btoa,yR="function"==typeof Buffer,ER="function"==typeof TextDecoder?new TextDecoder:void 0,SR="function"==typeof TextEncoder?new TextEncoder:void 0,bR=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),TR=(e=>{let t={};return bR.forEach(((e,r)=>t[e]=r)),t})(),IR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,AR=String.fromCharCode.bind(String),RR="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),CR=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),OR=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),wR=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=bR[t>>18&63]+bR[t>>12&63]+bR[t>>6&63]+bR[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},NR=gR?e=>btoa(e):yR?e=>Buffer.from(e,"binary").toString("base64"):wR,kR=yR?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(AR.apply(null,e.subarray(r,r+4096)));return NR(t.join(""))},DR=(e,t=!1)=>t?CR(kR(e)):kR(e),PR=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?AR(192|t>>>6)+AR(128|63&t):AR(224|t>>>12&15)+AR(128|t>>>6&63)+AR(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return AR(240|t>>>18&7)+AR(128|t>>>12&63)+AR(128|t>>>6&63)+AR(128|63&t)},MR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,UR=e=>e.replace(MR,PR),LR=yR?e=>Buffer.from(e,"utf8").toString("base64"):SR?e=>kR(SR.encode(e)):e=>NR(UR(e)),xR=(e,t=!1)=>t?CR(LR(e)):LR(e),BR=e=>xR(e,!0),VR=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,jR=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return AR(55296+(t>>>10))+AR(56320+(1023&t));case 3:return AR((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return AR((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},FR=e=>e.replace(VR,jR),GR=e=>{if(e=e.replace(/\s+/g,""),!IR.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=TR[e.charAt(o++)]<<18|TR[e.charAt(o++)]<<12|(r=TR[e.charAt(o++)])<<6|(n=TR[e.charAt(o++)]),i+=64===r?AR(t>>16&255):64===n?AR(t>>16&255,t>>8&255):AR(t>>16&255,t>>8&255,255&t);return i},zR=mR?e=>atob(OR(e)):yR?e=>Buffer.from(e,"base64").toString("binary"):GR,HR=yR?e=>RR(Buffer.from(e,"base64")):e=>RR(zR(e),(e=>e.charCodeAt(0))),WR=e=>HR(KR(e)),YR=yR?e=>Buffer.from(e,"base64").toString("utf8"):ER?e=>ER.decode(HR(e)):e=>FR(zR(e)),KR=e=>OR(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),XR=e=>YR(KR(e)),qR=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),JR=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,qR(t));e("fromBase64",(function(){return XR(this)})),e("toBase64",(function(e){return xR(this,e)})),e("toBase64URI",(function(){return xR(this,!0)})),e("toBase64URL",(function(){return xR(this,!0)})),e("toUint8Array",(function(){return WR(this)}))},ZR=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,qR(t));e("toBase64",(function(e){return DR(this,e)})),e("toBase64URI",(function(){return DR(this,!0)})),e("toBase64URL",(function(){return DR(this,!0)}))},$R={version:"3.7.2",VERSION:"3.7.2",atob:zR,atobPolyfill:GR,btoa:NR,btoaPolyfill:wR,fromBase64:XR,toBase64:xR,encode:xR,encodeURI:BR,encodeURL:BR,utob:UR,btou:FR,decode:XR,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:DR,toUint8Array:WR,extendString:JR,extendUint8Array:ZR,extendBuiltins:()=>{JR(),ZR()}};var QR={encodeBase64:$R.encode,decodeBase64:$R.decode},eC=new TextDecoder,tC=new TextEncoder,rC=function(){return vR()},nC=function(){return Date.now()};function iC(e){for(var t,r,n,i,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var s=0;try{for(var c=ri(o),u=c.next();!u.done;u=c.next()){s+=(p=u.value).length}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var d=new e(s),l=0;try{for(var f=ri(o),h=f.next();!h.done;h=f.next()){var p=h.value;d.set(p,l),l+=p.length}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return d}var oC=function(){function e(){}return e.token2auth=function(t,r,n,i){return i?"Bearer ".concat(i):"Basic ".concat(e.createUnsafeToken(t,r,n))},e.createUnsafeToken=function(e,t,r){return QR.encodeBase64([e,t,r].join(":"))},e.merge=function(t,r){var n,i;void 0===t&&(t={}),void 0===r&&(r={});try{for(var o=ri(Object.entries(t)),a=o.next();!a.done;a=o.next()){var s=ni(a.value,2),c=s[0],u=s[1];null!==u&&"object"===lT(u)?e.merge(t[c],r[c]):void 0!==r[c]&&(t[c]=r[c])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.ab2str=function(e){return eC.decode(e)},e.ab2obj=function(t){try{var r=e.ab2str(t);return JSON.parse(r)}catch(e){return{}}},e.str2ab=function(e){return tC.encode(e).buffer},e}();function aC(){for(var e=(+"".concat(Math.random()).slice(-7).padEnd(7,"0")).toString(2).padEnd(28,"1").split(""),t=[];e.length;)t.push(e.splice(0,7));return t.map((function(e,r){var n=r===t.length-1?"0":"1";return Number.parseInt(n+e.join(""),2)}))}var sC;function cC(e){return e.map((function e(t){if(t instanceof HTMLElement)return t.toString();if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){var r=ArrayBuffer.isView(t)?t.buffer:t,n=r.byteLength,i=[];if(n>10){var o=new DataView(r),a=Array.from({length:5}).map((function(e,t){return o.getUint8(t)})),s=Array.from({length:5}).map((function(e,t){return n-1-t})).reverse().map((function(e){return o.getUint8(e)}));i=ii(ii(ii([],ni(a),!1),["..."],!1),ni(s),!1)}else i=Array.from(new Uint8Array(r));return"".concat(t.constructor.name,"(").concat(n,") [").concat(i.join(", "),"]")}if(Array.isArray(t))return t.map(e);if("[object Object]"===Object.prototype.toString.call(t)){var c={};for(var u in t)c[u]=e(t[u]);return c}return t}))}function uC(e,t){if("boolean"!=typeof e)throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,": The value should be boolean type."))}function dC(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=1e4),e<r||e>n||"number"!=typeof e)throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,": the value range is [").concat(r,", ").concat(n,"]. integer only"))}function lC(e,t,r,n){if(void 0===r&&(r=1),void 0===n&&(n=255),null==e)throw new dT(sT.INVALID_PARAMS,"".concat(t," cannot be empty"));if(!function(e,t,r){void 0===t&&(t=1);void 0===r&&(r=255);return"string"==typeof e&&e.length<=r&&e.length>=t}(e,r,n))throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,": The value should be string type. Length of the string: [").concat(r,",").concat(n,"]"))}function fC(e,t,r){if(!r.includes(e))throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,": The value can only be set as ").concat(JSON.stringify(r)))}function hC(e,t){if(_C(e))throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,", should not be empty"))}function pC(e){var t,r;try{var n=navigator.mediaDevices.getSupportedConstraints();try{for(var i=ri(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]||delete e[a]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}catch(e){}}function _C(e){return null==e}function vC(e){hC(e,"userInfo"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new dT(sT.INVALID_PARAMS,"The userId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e.userId),_C(e.extraInfo)||lC(e.extraInfo,"userInfo.extraInfo",1,200)}function mC(e){hC(e,"videoPlayerOption")}function gC(e,t){var r,n;if(void 0===t&&(t=64),!e||0===(null===(r=e)||void 0===r?void 0:r.byteLength))throw new dT(sT.INVALID_PARAMS,"The message cannot be empty");if((null==(n=e instanceof ArrayBuffer?e:oC.str2ab(JSON.stringify(e)))?void 0:n.byteLength)>1e3*t)throw new dT(sT.INVALID_PARAMS,"The message length must be less than ".concat(t,"K"))}function yC(e){return![sC.onRemoteStreamStats,sC.onLocalStreamStats].includes(e)}!function(e){e.onTrackEnded="onTrackEnded",e.onPlayerEvent="onPlayerEvent",e.onAutoplayFailed="onAutoplayFailed",e.onUserJoined="onUserJoined",e.onUserLeave="onUserLeave",e.onConnectionStateChanged="onConnectionStateChanged",e.onStreamAdd="onStreamAdd",e.onStreamRemove="onStreamRemove",e.onRoomMessageReceived="onRoomMessageReceived",e.onRoomBinaryMessageReceived="onRoomBinaryMessageReceived",e.onUserMessageReceived="onUserMessageReceived",e.onUserBinaryMessageReceived="onUserBinaryMessageReceived",e.onUserMuteAudio="onUserMuteAudio",e.onUserMuteVideo="onUserMuteVideo",e.onVideoFirstFrameRendered="onVideoFirstFrameRendered",e.onVideoFirstFrameDecoded="onVideoFirstFrameDecoded",e.onAudioFirstFrameDecoded="onAudioFirstFrameDecoded",e.onMediaDeviceStateChanged="onMediaDeviceStateChanged",e.onRemoteStreamStats="onRemoteStreamStats",e.onLocalStreamStats="onLocalStreamStats",e.onAudioVolumeIndication="onAudioVolumeIndication",e.onAudioPlaybackDeviceChanged="onAudioPlaybackDeviceChanged",e.onUserStartVideoCapture="onUserStartVideoCapture",e.onUserStopVideoCapture="onUserStopVideoCapture",e.onUserStartAudioCapture="onUserStartAudioCapture",e.onUserStopAudioCapture="onUserStopAudioCapture",e.onAutoPublishResult="onAutoPublishResult",e.onAutoSubscribeResult="onAutoSubscribeResult",e.onLiveTranscodingResult="onLiveTranscodingResult",e.onSEIMessageReceived="onSEIMessageReceived",e.onError="onError",e.onAudioMixingStateChanged="onAudioMixingStateChanged"}(sC||(sC={}));var EC=pl.filter;jn({target:"Array",proto:!0,forced:!kl("filter")},{filter:function(e){return EC(this,e,arguments.length>1?arguments[1]:void 0)}});var SC={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),c=r?r+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 a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+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,n),!0;case 4:return d.fn.call(d.context,t,n,i),!0;case 5:return d.fn.call(d.context,t,n,i,o),!0;case 6:return d.fn.call(d.context,t,n,i,o,a),!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 f,h=d.length;for(u=0;u<h;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,n);break;case 4:d[u].fn.call(d[u].context,t,n,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];d[u].fn.apply(d[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var c=0,u=[],d=s.length;c<d;c++)(s[c].fn!==t||i&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(SC);var bC=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},TC=d,IC=kt,AC=U,RC=bC,CC=Mu,OC=ge,wC=xT;OT("search",(function(e,t,r){return[function(t){var r=AC(this),n=null==t?void 0:OC(t,e);return n?TC(n,t,r):new RegExp(t)[e](CC(r))},function(e){var n=IC(this),i=CC(e),o=r(t,n,i);if(o.done)return o.value;var a=n.lastIndex;RC(a,0)||(n.lastIndex=0);var s=wC(n,i);return RC(n.lastIndex,a)||(n.lastIndex=a),null===s?-1:s.index}]}));var NC=["#0050b3","#0050b3","#0050b3","#0050b3"],kC=location.search.includes("_rtc_debug_"),DC=function(){function e(e,t,r){this._module=e,this._indent=t}return e.prototype.print=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(kC){for(var n="",i=0;i<this._indent;i++)n+=" ";console.log.apply(console,ii(["%c".concat("[VERTC]").concat(n,"[").concat(this._module,".").concat(e,"] ").concat(t.shift()),"color:".concat(NC[this._indent],";")],ni(t),!1))}},e}(),PC=new DC("VERTC",0),MC=function(e){function t(){return e.call(this)||this}return Zn(t,e),t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this.listenerCount(t);try{return e.prototype.emit.apply(this,ii([t],ni(r),!1))}catch(e){return PC.print("safaEmit","safeEmit() | event listener threw an error [event:%s]:%o",t,e),Boolean(i)}},t.prototype.safeEmitAsPromise=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ei(this,void 0,void 0,(function(){var r=this;return ti(this,(function(n){return[2,new Promise((function(n,i){try{r.emit.apply(r,ii(ii([e],ni(t),!1),[n,i],!1))}catch(t){PC.print("safeEmitAsPromise","safeEmitAsPromise() | event listener threw an error [event:%s]:%o",e,t),i(t)}}))]}))}))},t}(SC.exports.EventEmitter),UC=Ue,LC=function(e){return void 0!==e&&(UC(e,"value")||UC(e,"writable"))},xC=d,BC=F,VC=kt,jC=LC,FC=i,GC=Zo;jn({target:"Reflect",stat:!0},{get:function e(t,r){var n,i,o=arguments.length<3?t:arguments[2];return VC(t)===o?t[r]:(n=FC.f(t,r))?jC(n)?n.value:void 0===n.get?void 0:xC(n.get,o):BC(i=GC(t))?e(i,r,o):void 0}});var zC=jn,HC=d,WC=kt,YC=F,KC=LC,XC=At,qC=i,JC=Zo,ZC=m;var $C=o((function(){var e=function(){},t=XC.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));zC({target:"Reflect",stat:!0,forced:$C},{set:function e(t,r,n){var i,o,a,s=arguments.length<4?t:arguments[3],c=qC.f(WC(t),r);if(!c){if(YC(o=JC(t)))return e(o,r,n,s);c=ZC(0)}if(KC(c)){if(!1===c.writable||!YC(s))return!1;if(i=qC.f(s,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,XC.f(s,r,i)}else XC.f(s,r,ZC(0,n))}else{if(void 0===(a=c.set))return!1;HC(a,s,n)}return!0}});var QC,eO,tO,rO,nO,iO,oO,aO,sO,cO,uO,dO,lO,fO,hO,pO,_O,vO=jn,mO=T,gO=i.f,yO=qr,EO=Mu,SO=hb,bO=U,TO=_b,IO=mO("".endsWith),AO=mO("".slice),RO=Math.min,CO=TO("endsWith");vO({target:"String",proto:!0,forced:!!(CO||(QC=gO(String.prototype,"endsWith"),!QC||QC.writable))&&!CO},{endsWith:function(e){var t=EO(bO(this));SO(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:RO(yO(r),n),o=EO(e);return IO?IO(t,o,i):AO(t,i-o.length,i)===o}}),function(e){e[e.VIDEO_SOURCE_TYPE_EXTERNAL=0]="VIDEO_SOURCE_TYPE_EXTERNAL",e[e.VIDEO_SOURCE_TYPE_INTERNAL=1]="VIDEO_SOURCE_TYPE_INTERNAL"}(eO||(eO={})),function(e){e[e.AUDIO_SOURCE_TYPE_EXTERNAL=0]="AUDIO_SOURCE_TYPE_EXTERNAL",e[e.AUDIO_SOURCE_TYPE_INTERNAL=1]="AUDIO_SOURCE_TYPE_INTERNAL"}(tO||(tO={})),function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(rO||(rO={})),function(e){e[e.AUTO_SUBSCRIBE_MODE=0]="AUTO_SUBSCRIBE_MODE",e[e.MANUAL_SUBSCRIBE_MODE=1]="MANUAL_SUBSCRIBE_MODE"}(nO||(nO={})),function(e){e[e.MUTE_STATE_OFF=0]="MUTE_STATE_OFF",e[e.MUTE_STATE_ON=1]="MUTE_STATE_ON"}(iO||(iO={})),function(e){e[e.SUBSCRIBE_SUCC=0]="SUBSCRIBE_SUCC",e[e.SUBSCRIBE_FAIL=1]="SUBSCRIBE_FAIL"}(oO||(oO={})),function(e){e[e.PUBLISH_SUCC=0]="PUBLISH_SUCC",e[e.PUBLISH_FAIL=1]="PUBLISH_FAIL"}(aO||(aO={})),function(e){e[e.MIRROR_MODE_OFF=0]="MIRROR_MODE_OFF",e[e.MIRROR_MODE_ON=1]="MIRROR_MODE_ON"}(sO||(sO={})),function(e){e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO=0]="RTC_PAUSE_RESUME_CONTROL_AUDIO",e[e.RTC_PAUSE_RESUME_CONTROL_VIDEO=1]="RTC_PAUSE_RESUME_CONTROL_VIDEO",e[e.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO=2]="RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO"}(cO||(cO={})),function(e){e[e.RENDER_MODE_HIDDEN=0]="RENDER_MODE_HIDDEN",e[e.RENDER_MODE_FIT=1]="RENDER_MODE_FIT"}(uO||(uO={})),function(e){e[e.STREAM_INDEX_MAIN=0]="STREAM_INDEX_MAIN",e[e.STREAM_INDEX_SCREEN=1]="STREAM_INDEX_SCREEN"}(dO||(dO={})),function(e){e[e.AUDIO_ONLY=0]="AUDIO_ONLY",e[e.VIDEO_ONLY=1]="VIDEO_ONLY",e[e.AUDIO_AND_VIDEO=2]="AUDIO_AND_VIDEO",e[e.NONE=3]="NONE"}(lO||(lO={})),function(e){e[e.STREAM_REMOVE_REASON_UNPUBLISH=0]="STREAM_REMOVE_REASON_UNPUBLISH",e[e.STREAM_REMOVE_REASON_PUBLISH_FAILED=1]="STREAM_REMOVE_REASON_PUBLISH_FAILED",e[e.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED=2]="STREAM_REMOVE_REASON_KEEP_LIVE_FAILED",e[e.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED=3]="STREAM_REMOVE_REASON_CLIENT_DISCONNECTED",e[e.STREAM_REMOVE_REASON_REPUBLISH=4]="STREAM_REMOVE_REASON_REPUBLISH",e[e.STREAM_REMOVE_REASON_OTHER=5]="STREAM_REMOVE_REASON_OTHER"}(fO||(fO={})),function(e){e[e.CONNECTION_START=0]="CONNECTION_START",e[e.CONNECTION_STATE_DISCONNECTED=1]="CONNECTION_STATE_DISCONNECTED",e[e.CONNECTION_STATE_CONNECTING=2]="CONNECTION_STATE_CONNECTING",e[e.CONNECTION_STATE_CONNECTED=3]="CONNECTION_STATE_CONNECTED",e[e.CONNECTION_STATE_RECONNECTING=4]="CONNECTION_STATE_RECONNECTING",e[e.CONNECTION_STATE_RECONNECTED=5]="CONNECTION_STATE_RECONNECTED"}(hO||(hO={})),function(e){e[e.MIRROR_TYPE_NONE=0]="MIRROR_TYPE_NONE",e[e.MIRROR_TYPE_RENDER=1]="MIRROR_TYPE_RENDER"}(pO||(pO={})),function(e){e[e.domestic=0]="domestic",e[e.overseas=1]="overseas"}(_O||(_O={}));var OO="rtc-access.rtcplus.com,rtc-access-sg.rtcplus.com,rtc-access-va.rtcplus.com,rtc-access-fr.rtcplus.com".split(",");function wO(e){return void 0===e&&(e=""),e.endsWith("com")||e.endsWith("net")||e.endsWith("org")?"https://".concat(e,"/dispatch/v1/AccessInfo?Action=GetAccessInfo"):e}var NO={VERSION:"4.36.0-rc.1",ICE_CONFIG_REQUEST_URLS_INTERNAL:OO.map(wO),ICE_CONFIG_REQUEST_URLS:[],EXPECTED_ADDR:"",LOG_SERVER_URL:"https://web-log-report.rtcplus.com/video/v1/webrtc_log/"};function kO(e,t){if("VERSION"!==e)return"ICE_CONFIG_REQUEST_URLS"===e?("string"==typeof t&&(t=[t]),void(NO.ICE_CONFIG_REQUEST_URLS=t.map(wO))):void("LOG_SERVER_URL"!==e||t!==_O.overseas?"LOG_SERVER_URL"!==e||t!==_O.domestic?NO[e]=t:NO.LOG_SERVER_URL="https://web-log-report.rtcplus.com/video/v1/webrtc_log/":NO.LOG_SERVER_URL="https://web-log-report.rtcplus.com/video/v1/webrtc_log/")}function DO(e){return NO[e]}function PO(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return{type:"transcode",action:e,transcodeMeta:{transcode:{url:t.url},audio:{codec:(null===(r=t.audio)||void 0===r?void 0:r.codec)||"AAC",bitRate:1e3*((null===(n=t.audio)||void 0===n?void 0:n.kBitRate)||48),sampleRate:1e3*((null===(i=t.audio)||void 0===i?void 0:i.sampleRate)||44.1),channels:(null===(o=t.audio)||void 0===o?void 0:o.channels)||1,profile:(null===(a=t.audio)||void 0===a?void 0:a.AACProfile)||"LC"},video:{codec:(null===(s=t.video)||void 0===s?void 0:s.codec)||"H264",fps:(null===(c=t.video)||void 0===c?void 0:c.fps)||15,gop:(null===(u=t.video)||void 0===u?void 0:u.gop)||30,lowLatency:null===(l=null===(d=t.video)||void 0===d?void 0:d.lowLatency)||void 0===l||l,bitRate:1e3*((null===(f=t.video)||void 0===f?void 0:f.kBitRate)||40),width:(null===(h=t.video)||void 0===h?void 0:h.width)||640,height:(null===(p=t.video)||void 0===p?void 0:p.height)||360},layout:{canvas:{bgnd:(null===(_=t.layout)||void 0===_?void 0:_.backgroundColor)||"#000000"},regions:(null===(m=null===(v=t.layout)||void 0===v?void 0:v.regions)||void 0===m?void 0:m.map((function(e){return{alpha:Math.min(Math.max(+e.alpha,0),1),uid:e.userId,zorder:e.zorder,x:Math.min(Math.max(+e.x,0),1),y:Math.min(Math.max(+e.y,0),1),w:Math.min(Math.max(+e.w,0),1),h:Math.min(Math.max(+e.h,0),1),renderMode:e.renderMode||1,contentControl:e.contentControl||0,screen:e.isScreenStream,local_user:e.isLocalUser}})))||[],app_data:(null===(g=t.layout)||void 0===g?void 0:g.appData)||""}}}}var MO=jn,UO=rn.indexOf,LO=wd,xO=T([].indexOf),BO=!!xO&&1/xO([1],1,-0)<0,VO=LO("indexOf");MO({target:"Array",proto:!0,forced:BO||!VO},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return BO?xO(this,e,t)||0:UO(this,e,t)}});var jO={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},i={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(jO);var FO={},GO={},zO={},HO=jO;function WO(e){for(var t=e.length;--t>=0;)e[t]=0}var YO=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],KO=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],XO=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],qO=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],JO=new Array(576);WO(JO);var ZO=new Array(60);WO(ZO);var $O=new Array(512);WO($O);var QO=new Array(256);WO(QO);var ew=new Array(29);WO(ew);var tw,rw,nw,iw=new Array(30);function ow(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function aw(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function sw(e){return e<256?$O[e]:$O[256+(e>>>7)]}function cw(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function uw(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,cw(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function dw(e,t,r){uw(e,r[2*t],r[2*t+1])}function lw(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function fw(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=lw(o[s]++,s))}}function hw(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function pw(e){e.bi_valid>8?cw(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function _w(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function vw(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&_w(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!_w(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function mw(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?dw(e,i,t):(dw(e,(o=QO[i])+256+1,t),0!==(a=YO[o])&&uw(e,i-=ew[o],a),dw(e,o=sw(--n),r),0!==(a=KO[o])&&uw(e,n-=iw[o],a))}while(s<e.last_lit);dw(e,256,t)}function gw(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)vw(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],vw(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,vw(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,c=t.dyn_tree,u=t.max_code,d=t.stat_desc.static_tree,l=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,_++),c[2*n+1]=o,n>u||(e.bl_count[o]++,a=0,n>=h&&(a=f[n-h]),s=c[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(d[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),fw(o,u,e.bl_count)}function yw(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<c&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4))}function Ew(e,t,r){var n,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<c&&i===a)){if(s<u)do{dw(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(dw(e,i,e.bl_tree),s--),dw(e,16,e.bl_tree),uw(e,s-3,2)):s<=10?(dw(e,17,e.bl_tree),uw(e,s-3,3)):(dw(e,18,e.bl_tree),uw(e,s-11,7));s=0,o=i,0===a?(c=138,u=3):i===a?(c=6,u=3):(c=7,u=4)}}WO(iw);var Sw=!1;function bw(e,t,r,n){uw(e,0+(n?1:0),3),function(e,t,r,n){pw(e),n&&(cw(e,r),cw(e,~r)),HO.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}zO._tr_init=function(e){Sw||(!function(){var e,t,r,n,i,o=new Array(16);for(r=0,n=0;n<28;n++)for(ew[n]=r,e=0;e<1<<YO[n];e++)QO[r++]=n;for(QO[r-1]=n,i=0,n=0;n<16;n++)for(iw[n]=i,e=0;e<1<<KO[n];e++)$O[i++]=n;for(i>>=7;n<30;n++)for(iw[n]=i<<7,e=0;e<1<<KO[n]-7;e++)$O[256+i++]=n;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)JO[2*e+1]=8,e++,o[8]++;for(;e<=255;)JO[2*e+1]=9,e++,o[9]++;for(;e<=279;)JO[2*e+1]=7,e++,o[7]++;for(;e<=287;)JO[2*e+1]=8,e++,o[8]++;for(fw(JO,287,o),e=0;e<30;e++)ZO[2*e+1]=5,ZO[2*e]=lw(e,5);tw=new ow(JO,YO,257,286,15),rw=new ow(ZO,KO,0,30,15),nw=new ow(new Array(0),XO,0,19,7)}(),Sw=!0),e.l_desc=new aw(e.dyn_ltree,tw),e.d_desc=new aw(e.dyn_dtree,rw),e.bl_desc=new aw(e.bl_tree,nw),e.bi_buf=0,e.bi_valid=0,hw(e)},zO._tr_stored_block=bw,zO._tr_flush_block=function(e,t,r,n){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),gw(e,e.l_desc),gw(e,e.d_desc),a=function(e){var t;for(yw(e,e.dyn_ltree,e.l_desc.max_code),yw(e,e.dyn_dtree,e.d_desc.max_code),gw(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*qO[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?bw(e,t,r,n):4===e.strategy||o===i?(uw(e,2+(n?1:0),3),mw(e,JO,ZO)):(uw(e,4+(n?1:0),3),function(e,t,r,n){var i;for(uw(e,t-257,5),uw(e,r-1,5),uw(e,n-4,4),i=0;i<n;i++)uw(e,e.bl_tree[2*qO[i]+1],3);Ew(e,e.dyn_ltree,t-1),Ew(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),mw(e,e.dyn_ltree,e.dyn_dtree)),hw(e),n&&pw(e)},zO._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(QO[r]+256+1)]++,e.dyn_dtree[2*sw(t)]++),e.last_lit===e.lit_bufsize-1},zO._tr_align=function(e){uw(e,2,3),dw(e,256,JO),function(e){16===e.bi_valid?(cw(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var Tw=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};var Iw=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var Aw,Rw=function(e,t,r,n){var i=Iw,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},Cw={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ow=jO,ww=zO,Nw=Tw,kw=Rw,Dw=Cw;function Pw(e,t){return e.msg=Dw[t],t}function Mw(e){return(e<<1)-(e>4?9:0)}function Uw(e){for(var t=e.length;--t>=0;)e[t]=0}function Lw(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(Ow.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function xw(e,t){ww._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Lw(e.strm)}function Bw(e,t){e.pending_buf[e.pending++]=t}function Vw(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function jw(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,u=e.window,d=e.w_mask,l=e.prev,f=e.strstart+258,h=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===h&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<f);if(n=258-(f-o),o=f-258,n>a){if(e.match_start=t,a=n,n>=s)break;h=u[o+a-1],p=u[o+a]}}}while((t=l[t&d])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Fw(e){var t,r,n,i,o,a,s,c,u,d,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-262)){Ow.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=l?n-l:0}while(--r);t=r=l;do{n=e.prev[--t],e.prev[t]=n>=l?n-l:0}while(--r);i+=l}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,c=e.strstart+e.lookahead,u=i,d=void 0,(d=a.avail_in)>u&&(d=u),r=0===d?0:(a.avail_in-=d,Ow.arraySet(s,a.input,a.next_in,d,c),1===a.state.wrap?a.adler=Nw(a.adler,s,d,c):2===a.state.wrap&&(a.adler=kw(a.adler,s,d,c)),a.next_in+=d,a.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function Gw(e,t){for(var r,n;;){if(e.lookahead<262){if(Fw(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=jw(e,r)),e.match_length>=3)if(n=ww._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=ww._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(xw(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(xw(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(xw(e,!1),0===e.strm.avail_out)?1:2}function zw(e,t){for(var r,n,i;;){if(e.lookahead<262){if(Fw(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=jw(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=ww._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(xw(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=ww._tr_tally(e,0,e.window[e.strstart-1]))&&xw(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=ww._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(xw(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(xw(e,!1),0===e.strm.avail_out)?1:2}function Hw(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function Ww(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ow.Buf16(1146),this.dyn_dtree=new Ow.Buf16(122),this.bl_tree=new Ow.Buf16(78),Uw(this.dyn_ltree),Uw(this.dyn_dtree),Uw(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ow.Buf16(16),this.heap=new Ow.Buf16(573),Uw(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ow.Buf16(573),Uw(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Yw(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,ww._tr_init(t),0):Pw(e,-2)}function Kw(e){var t,r=Yw(e);return 0===r&&((t=e.state).window_size=2*t.w_size,Uw(t.head),t.max_lazy_match=Aw[t.level].max_lazy,t.good_match=Aw[t.level].good_length,t.nice_match=Aw[t.level].nice_length,t.max_chain_length=Aw[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function Xw(e,t,r,n,i,o){if(!e)return-2;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return Pw(e,-2);8===n&&(n=9);var s=new Ww;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Ow.Buf8(2*s.w_size),s.head=new Ow.Buf16(s.hash_size),s.prev=new Ow.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Ow.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Kw(e)}Aw=[new Hw(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Fw(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,xw(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(xw(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(xw(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(xw(e,!1),e.strm.avail_out),1)})),new Hw(4,4,8,4,Gw),new Hw(4,5,16,8,Gw),new Hw(4,6,32,32,Gw),new Hw(4,4,16,16,zw),new Hw(8,16,32,32,zw),new Hw(8,16,128,128,zw),new Hw(8,32,128,256,zw),new Hw(32,128,258,1024,zw),new Hw(32,258,258,4096,zw)],GO.deflateInit=function(e,t){return Xw(e,t,8,15,8,0)},GO.deflateInit2=Xw,GO.deflateReset=Kw,GO.deflateResetKeep=Yw,GO.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},GO.deflate=function(e,t){var r,n,i,o;if(!e||!e.state||t>5||t<0)return e?Pw(e,-2):-2;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||666===n.status&&4!==t)return Pw(e,0===e.avail_out?-5:-2);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,Bw(n,31),Bw(n,139),Bw(n,8),n.gzhead?(Bw(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Bw(n,255&n.gzhead.time),Bw(n,n.gzhead.time>>8&255),Bw(n,n.gzhead.time>>16&255),Bw(n,n.gzhead.time>>24&255),Bw(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),Bw(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Bw(n,255&n.gzhead.extra.length),Bw(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=kw(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(Bw(n,0),Bw(n,0),Bw(n,0),Bw(n,0),Bw(n,0),Bw(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),Bw(n,3),n.status=113);else{var a=8+(n.w_bits-8<<4)<<8;a|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=113,Vw(n,a),0!==n.strstart&&(Vw(n,e.adler>>>16),Vw(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),Lw(e),i=n.pending,n.pending!==n.pending_buf_size));)Bw(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),Lw(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Bw(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),Lw(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Bw(n,o)}while(0!==o);n.gzhead.hcrc&&n.pending>i&&(e.adler=kw(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Lw(e),n.pending+2<=n.pending_buf_size&&(Bw(n,255&e.adler),Bw(n,e.adler>>8&255),e.adler=0,n.status=113)):n.status=113),0!==n.pending){if(Lw(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&Mw(t)<=Mw(r)&&4!==t)return Pw(e,-5);if(666===n.status&&0!==e.avail_in)return Pw(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&666!==n.status){var s=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(Fw(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=ww._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(xw(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(xw(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(xw(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=258){if(Fw(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=258-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=ww._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=ww._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(xw(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(xw(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(xw(e,!1),0===e.strm.avail_out)?1:2}(n,t):Aw[n.level].func(n,t);if(3!==s&&4!==s||(n.status=666),1===s||3===s)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===s&&(1===t?ww._tr_align(n):5!==t&&(ww._tr_stored_block(n,0,0,!1),3===t&&(Uw(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Lw(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(Bw(n,255&e.adler),Bw(n,e.adler>>8&255),Bw(n,e.adler>>16&255),Bw(n,e.adler>>24&255),Bw(n,255&e.total_in),Bw(n,e.total_in>>8&255),Bw(n,e.total_in>>16&255),Bw(n,e.total_in>>24&255)):(Vw(n,e.adler>>>16),Vw(n,65535&e.adler)),Lw(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},GO.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?Pw(e,-2):(e.state=null,113===t?Pw(e,-3):0):-2},GO.deflateSetDictionary=function(e,t){var r,n,i,o,a,s,c,u,d=t.length;if(!e||!e.state)return-2;if(2===(o=(r=e.state).wrap)||1===o&&42!==r.status||r.lookahead)return-2;for(1===o&&(e.adler=Nw(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===o&&(Uw(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Ow.Buf8(r.w_size),Ow.arraySet(u,t,d-r.w_size,r.w_size,0),t=u,d=r.w_size),a=e.avail_in,s=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,Fw(r);r.lookahead>=3;){n=r.strstart,i=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=2,Fw(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=c,e.avail_in=a,r.wrap=o,0},GO.deflateInfo="pako deflate (from Nodeca project)";var qw={},Jw=jO,Zw=!0,$w=!0;try{String.fromCharCode.apply(null,[0])}catch(e){Zw=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){$w=!1}for(var Qw=new Jw.Buf8(256),eN=0;eN<256;eN++)Qw[eN]=eN>=252?6:eN>=248?5:eN>=240?4:eN>=224?3:eN>=192?2:1;function tN(e,t){if(t<65534&&(e.subarray&&$w||!e.subarray&&Zw))return String.fromCharCode.apply(null,Jw.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Qw[254]=Qw[254]=1,qw.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Jw.Buf8(s),o=0,i=0;o<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},qw.buf2binstring=function(e){return tN(e,e.length)},qw.binstring2buf=function(e){for(var t=new Jw.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},qw.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)s[n++]=i;else if((o=Qw[i])>4)s[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?s[n++]=65533:i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|1023&i)}return tN(s,n)},qw.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Qw[e[r]]>t?r:t};var rN=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},nN=GO,iN=jO,oN=qw,aN=Cw,sN=rN,cN=Object.prototype.toString;function uN(e){if(!(this instanceof uN))return new uN(e);this.options=iN.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sN,this.strm.avail_out=0;var r=nN.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(aN[r]);if(t.header&&nN.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?oN.string2buf(t.dictionary):"[object ArrayBuffer]"===cN.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=nN.deflateSetDictionary(this.strm,n)))throw new Error(aN[r]);this._dict_set=!0}}function dN(e,t){var r=new uN(t);if(r.push(e,!0),r.err)throw r.msg||aN[r.err];return r.result}uN.prototype.push=function(e,t){var r,n,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=oN.string2buf(e):"[object ArrayBuffer]"===cN.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new iN.Buf8(o),i.next_out=0,i.avail_out=o),1!==(r=nN.deflate(i,n))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(oN.buf2binstring(iN.shrinkBuf(i.output,i.next_out))):this.onData(iN.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=nN.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==n||(this.onEnd(0),i.avail_out=0,!0)},uN.prototype.onData=function(e){this.chunks.push(e)},uN.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=iN.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},FO.Deflate=uN,FO.deflate=dN,FO.deflateRaw=function(e,t){return(t=t||{}).raw=!0,dN(e,t)},FO.gzip=function(e,t){return(t=t||{}).gzip=!0,dN(e,t)};var lN={},fN={},hN=jO,pN=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],_N=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],vN=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],mN=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],gN=jO,yN=Tw,EN=Rw,SN=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,l=r.wnext,f=r.window,h=r.hold,p=r.bits,_=r.lencode,v=r.distcode,m=(1<<r.lenbits)-1,g=(1<<r.distbits)-1;e:do{p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=_[h&m];t:for(;;){if(h>>>=E=y>>>24,p-=E,0===(E=y>>>16&255))R[o++]=65535&y;else{if(!(16&E)){if(0==(64&E)){y=_[(65535&y)+(h&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&y,(E&=15)&&(p<E&&(h+=A[n++]<<p,p+=8),S+=h&(1<<E)-1,h>>>=E,p-=E),p<15&&(h+=A[n++]<<p,p+=8,h+=A[n++]<<p,p+=8),y=v[h&g];r:for(;;){if(h>>>=E=y>>>24,p-=E,!(16&(E=y>>>16&255))){if(0==(64&E)){y=v[(65535&y)+(h&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(b=65535&y,p<(E&=15)&&(h+=A[n++]<<p,(p+=8)<E&&(h+=A[n++]<<p,p+=8)),(b+=h&(1<<E)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=E,p-=E,b>(E=o-a)){if((E=b-E)>d&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(T=0,I=f,0===l){if(T+=u-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}else if(l<E){if(T+=u+l-E,(E-=l)<S){S-=E;do{R[o++]=f[T++]}while(--E);if(T=0,l<S){S-=E=l;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}}}else if(T+=l-E,E<S){S-=E;do{R[o++]=f[T++]}while(--E);T=o-b,I=R}for(;S>2;)R[o++]=I[T++],R[o++]=I[T++],R[o++]=I[T++],S-=3;S&&(R[o++]=I[T++],S>1&&(R[o++]=I[T++]))}else{T=o-b;do{R[o++]=R[T++],R[o++]=R[T++],R[o++]=R[T++],S-=3}while(S>2);S&&(R[o++]=R[T++],S>1&&(R[o++]=R[T++]))}break}}break}}while(n<i&&o<s);n-=S=p>>3,h&=(1<<(p-=S<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p},bN=function(e,t,r,n,i,o,a,s){var c,u,d,l,f,h,p,_,v,m=s.bits,g=0,y=0,E=0,S=0,b=0,T=0,I=0,A=0,R=0,C=0,O=null,w=0,N=new hN.Buf16(16),k=new hN.Buf16(16),D=null,P=0;for(g=0;g<=15;g++)N[g]=0;for(y=0;y<n;y++)N[t[r+y]]++;for(b=m,S=15;S>=1&&0===N[S];S--);if(b>S&&(b=S),0===S)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<S&&0===N[E];E++);for(b<E&&(b=E),A=1,g=1;g<=15;g++)if(A<<=1,(A-=N[g])<0)return-1;if(A>0&&(0===e||1!==S))return-1;for(k[1]=0,g=1;g<15;g++)k[g+1]=k[g]+N[g];for(y=0;y<n;y++)0!==t[r+y]&&(a[k[t[r+y]]++]=y);if(0===e?(O=D=a,h=19):1===e?(O=pN,w-=257,D=_N,P-=257,h=256):(O=vN,D=mN,h=-1),C=0,y=0,g=E,f=o,T=b,I=0,d=-1,l=(R=1<<b)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){p=g-I,a[y]<h?(_=0,v=a[y]):a[y]>h?(_=D[P+a[y]],v=O[w+a[y]]):(_=96,v=0),c=1<<g-I,E=u=1<<T;do{i[f+(C>>I)+(u-=c)]=p<<24|_<<16|v|0}while(0!==u);for(c=1<<g-1;C&c;)c>>=1;if(0!==c?(C&=c-1,C+=c):C=0,y++,0==--N[g]){if(g===S)break;g=t[r+a[y]]}if(g>b&&(C&l)!==d){for(0===I&&(I=b),f+=E,A=1<<(T=g-I);T+I<S&&!((A-=N[T+I])<=0);)T++,A<<=1;if(R+=1<<T,1===e&&R>852||2===e&&R>592)return 1;i[d=C&l]=b<<24|T<<16|f-o|0}}return 0!==C&&(i[f+C]=g-I<<24|64<<16|0),s.bits=b,0};function TN(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function IN(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new gN.Buf16(320),this.work=new gN.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function AN(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new gN.Buf32(852),t.distcode=t.distdyn=new gN.Buf32(592),t.sane=1,t.back=-1,0):-2}function RN(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,AN(e)):-2}function CN(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,RN(e))):-2}function ON(e,t){var r,n;return e?(n=new IN,e.state=n,n.window=null,0!==(r=CN(e,t))&&(e.state=null),r):-2}var wN,NN,kN=!0;function DN(e){if(kN){var t;for(wN=new gN.Buf32(512),NN=new gN.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(bN(1,e.lens,0,288,wN,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;bN(2,e.lens,0,32,NN,0,e.work,{bits:5}),kN=!1}e.lencode=wN,e.lenbits=9,e.distcode=NN,e.distbits=5}function PN(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new gN.Buf8(o.wsize)),n>=o.wsize?(gN.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),gN.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(gN.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}fN.inflateReset=RN,fN.inflateReset2=CN,fN.inflateResetKeep=AN,fN.inflateInit=function(e){return ON(e,15)},fN.inflateInit2=ON,fN.inflate=function(e,t){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T,I,A,R=0,C=new gN.Buf8(4),O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,l=s,f=c,T=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(2&r.wrap&&35615===u){r.check=0,C[0]=255&u,C[1]=u>>>8&255,r.check=EN(r.check,C,2,0),u=0,d=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(d-=4,b=8+(15&(u>>>=4)),0===r.wbits)r.wbits=b;else if(b>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<b,e.adler=r.check=1,r.mode=512&u?10:12,u=0,d=0;break;case 2:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.flags=u,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=EN(r.check,C,2,0)),u=0,d=0,r.mode=3;case 3:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.time=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,r.check=EN(r.check,C,4,0)),u=0,d=0,r.mode=4;case 4:for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=EN(r.check,C,2,0)),u=0,d=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(C[0]=255&u,C[1]=u>>>8&255,r.check=EN(r.check,C,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=r.length)>s&&(h=s),h&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),gN.arraySet(r.head.extra,n,o,h,b)),512&r.flags&&(r.check=EN(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=EN(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;h=0;do{b=n[o+h++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&h<s);if(512&r.flags&&(r.check=EN(r.check,n,h,o)),s-=h,o+=h,b)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;d<16;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}u=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}e.adler=r.check=TN(u),u=0,d=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){u>>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}switch(r.last=1&u,d-=1,3&(u>>>=1)){case 0:r.mode=14;break;case 1:if(DN(r),r.mode=20,6===t){u>>>=2,d-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,d-=2;break;case 14:for(u>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,u=0,d=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(h>s&&(h=s),h>c&&(h=c),0===h)break e;gN.arraySet(i,n,o,h,a),s-=h,o+=h,c-=h,a+=h,r.length-=h;break}r.mode=12;break;case 17:for(;d<14;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(r.nlen=257+(31&u),u>>>=5,d-=5,r.ndist=1+(31&u),u>>>=5,d-=5,r.ncode=4+(15&u),u>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;d<3;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.lens[O[r.have++]]=7&u,u>>>=3,d-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=bN(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(g<16)u>>>=v,d-=v,r.lens[r.have++]=g;else{if(16===g){for(A=v+2;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u>>>=v,d-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}b=r.lens[r.have-1],h=3+(3&u),u>>>=2,d-=2}else if(17===g){for(A=v+3;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=3+(7&(u>>>=v)),u>>>=3,d-=3}else{for(A=v+7;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}d-=v,b=0,h=11+(127&(u>>>=v)),u>>>=7,d-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;h--;)r.lens[r.have++]=b}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,I={bits:r.lenbits},T=bN(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=bN(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,SN(e,f),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,u=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;m=(R=r.lencode[u&(1<<r.lenbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(m&&0==(240&m)){for(y=v,E=m,S=g;m=(R=r.lencode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,r.length=g,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=12;break}if(64&m){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(R=r.distcode[u&(1<<r.distbits)-1])>>>16&255,g=65535&R,!((v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(0==(240&m)){for(y=v,E=m,S=g;m=(R=r.distcode[S+((u&(1<<y+E)-1)>>y)])>>>16&255,g=65535&R,!(y+(v=R>>>24)<=d);){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}u>>>=y,d-=y,r.back+=y}if(u>>>=v,d-=v,r.back+=v,64&m){e.msg="invalid distance code",r.mode=30;break}r.offset=g,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(A=r.extra;d<A;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(h=f-c,r.offset>h){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),_=r.window}else _=i,p=a-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do{i[a++]=_[p++]}while(--h);0===r.length&&(r.mode=21);break;case 26:if(0===c)break e;i[a++]=r.length,c--,r.mode=21;break;case 27:if(r.wrap){for(;d<32;){if(0===s)break e;s--,u|=n[o++]<<d,d+=8}if(f-=c,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?EN(r.check,i,f,a-f):yN(r.check,i,f,a-f)),f=c,(r.flags?u:TN(u))!==r.check){e.msg="incorrect data check",r.mode=30;break}u=0,d=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;d<32;){if(0===s)break e;s--,u+=n[o++]<<d,d+=8}if(u!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}u=0,d=0}r.mode=29;case 29:T=1;break e;case 30:T=-3;break e;case 31:return-4;default:return-2}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,r.hold=u,r.bits=d,(r.wsize||f!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&PN(e,e.output,e.next_out,f-e.avail_out),l-=e.avail_in,f-=e.avail_out,e.total_in+=l,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?EN(r.check,i,f,e.next_out-f):yN(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===l&&0===f||4===t)&&0===T&&(T=-5),T},fN.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},fN.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},fN.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&yN(1,t,n,0)!==r.check?-3:PN(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},fN.inflateInfo="pako inflate (from Nodeca project)";var MN={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var UN=fN,LN=jO,xN=qw,BN=MN,VN=Cw,jN=rN,FN=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},GN=Object.prototype.toString;function zN(e){if(!(this instanceof zN))return new zN(e);this.options=LN.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jN,this.strm.avail_out=0;var r=UN.inflateInit2(this.strm,t.windowBits);if(r!==BN.Z_OK)throw new Error(VN[r]);if(this.header=new FN,UN.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=xN.string2buf(t.dictionary):"[object ArrayBuffer]"===GN.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=UN.inflateSetDictionary(this.strm,t.dictionary))!==BN.Z_OK))throw new Error(VN[r])}function HN(e,t){var r=new zN(t);if(r.push(e,!0),r.err)throw r.msg||VN[r.err];return r.result}zN.prototype.push=function(e,t){var r,n,i,o,a,s=this.strm,c=this.options.chunkSize,u=this.options.dictionary,d=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?BN.Z_FINISH:BN.Z_NO_FLUSH,"string"==typeof e?s.input=xN.binstring2buf(e):"[object ArrayBuffer]"===GN.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new LN.Buf8(c),s.next_out=0,s.avail_out=c),(r=UN.inflate(s,BN.Z_NO_FLUSH))===BN.Z_NEED_DICT&&u&&(r=UN.inflateSetDictionary(this.strm,u)),r===BN.Z_BUF_ERROR&&!0===d&&(r=BN.Z_OK,d=!1),r!==BN.Z_STREAM_END&&r!==BN.Z_OK)return this.onEnd(r),this.ended=!0,!1;s.next_out&&(0!==s.avail_out&&r!==BN.Z_STREAM_END&&(0!==s.avail_in||n!==BN.Z_FINISH&&n!==BN.Z_SYNC_FLUSH)||("string"===this.options.to?(i=xN.utf8border(s.output,s.next_out),o=s.next_out-i,a=xN.buf2string(s.output,i),s.next_out=o,s.avail_out=c-o,o&&LN.arraySet(s.output,s.output,i,o,0),this.onData(a)):this.onData(LN.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(d=!0)}while((s.avail_in>0||0===s.avail_out)&&r!==BN.Z_STREAM_END);return r===BN.Z_STREAM_END&&(n=BN.Z_FINISH),n===BN.Z_FINISH?(r=UN.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===BN.Z_OK):n!==BN.Z_SYNC_FLUSH||(this.onEnd(BN.Z_OK),s.avail_out=0,!0)},zN.prototype.onData=function(e){this.chunks.push(e)},zN.prototype.onEnd=function(e){e===BN.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=LN.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},lN.Inflate=zN,lN.inflate=HN,lN.inflateRaw=function(e,t){return(t=t||{}).raw=!0,HN(e,t)},lN.ungzip=HN;var WN={};(0,jO.assign)(WN,FO,lN,MN);var YN,KN,XN,qN,JN,ZN,$N,QN,ek,tk,rk,nk,ik,ok,ak,sk,ck,uk,dk,lk,fk,hk,pk,_k,vk,mk,gk,yk,Ek,Sk,bk,Tk,Ik,Ak,Rk,Ck,Ok,wk,Nk,kk,Dk,Pk,Mk,Uk,Lk,xk,Bk=WN,Vk=a,jk=T,Fk=d,Gk=o,zk=fo,Hk=hn,Wk=l,Yk=De,Kk=P,Xk=Object.assign,qk=Object.defineProperty,Jk=jk([].concat),Zk=!Xk||Gk((function(){if(Vk&&1!==Xk({b:1},Xk(qk({},"a",{enumerable:!0,get:function(){qk(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=Xk({},e)[r]||zk(Xk({},t)).join("")!=n}))?function(e,t){for(var r=Yk(e),n=arguments.length,i=1,o=Hk.f,a=Wk.f;n>i;)for(var s,c=Kk(arguments[i++]),u=o?Jk(zk(c),o(c)):zk(c),d=u.length,l=0;d>l;)s=u[l++],Vk&&!Fk(a,c,s)||(r[s]=c[s]);return r}:Xk,$k=Zk;jn({target:"Object",stat:!0,forced:Object.assign!==$k},{assign:$k}),function(e){e.RTC_SDK_API_CALL="rtc_sdk_api_call",e.RTC_SDK_CALLBACK="rtc_sdk_callback",e.RTC_RECONNECT="rtc_reconnect",e.RTC_RECONNECTED="rtc_reconnected",e.RTC_GET_ACCESS="rtc_get_access",e.RTC_PRE_ICE_STATE="rtc_pre_ice_state",e.RTC_NODE_CHANGE="rtc_node_change",e.RTC_SIGNALING_MSG_ERROR="rtc_signaling_msg_error",e.RTC_SIGNALING="rtc_signaling",e.RTC_JOIN_ROOM="rtc_join_room",e.RTC_LEAVE_ROOM="rtc_leave_room",e.RTC_BEGIN_CREATE_OFFER="rtc_begin_create_offer",e.RTC_CREATE_OFFER="rtc_create_offer",e.RTC_SET_DESCRIPTION="rtc_set_description",e.RTC_RECV_ANSWER="rtc_recv_answer",e.FIRST_REMOTE_AUDIO_RENDER="first_remote_audio_render",e.FIRST_REMOTE_VIDEO_RENDER="first_remote_video_render",e.RTC_PUBLISH_STAT="rtc_publish_stat",e.RTC_SUBSCRIBE_STAT="rtc_subscribe_stat",e.RTC_AUDIO_DEVICE="rtc_audio_device",e.RTC_MEDIA_STATISTICS="rtc_media_statistics",e.RTC_MESSAGE_STATISTICS="rtc_message_statistics",e.RTC_ERROR="rtc_error",e.RTC_INVOKE_STATUS="rtc_invoke_status",e.RTC_FIRST_FRAME="rtc_first_frame",e.RTC_MUTE_REMOTE="rtc_mute_remote",e.SDK_INIT_ENGINE="sdk_init_engine",e.JOIN_ROOM="join_room",e.P2P_CONNECTION_STATUS="p2p_connection_status",e.P2P_CONNECT_CLOSED="p2p_connect_closed",e.RTC_DEVICE_ERROR="rtc_device_error",e.RTC_VIDEO_DEVICE="rtc_video_device",e.RTC_VIDEO_CAPTURE_EVENT="rtc_video_capture_event",e.RTC_ENCODE_FIRST_FRAME="rtc_encode_first_frame",e.RTC_FIRST_FRAME_ENCODED="rtc_first_frame_encoded",e.RTC_SEND_FIRST_PACKET="rtc_send_first_packet",e.RTC_RECV_FIRST_PACKET="rtc_recv_first_packet",e.RTC_RECV_FIRST_FRAME="rtc_recv_first_frame",e.RTC_DECODE_FIRST_FRAME="rtc_decode_first_frame"}(YN||(YN={})),function(e){e.RTC="rtc"}(KN||(KN={})),function(e){e.W_5="5"}(XN||(XN={})),function(e){e.IOS="ios",e.ANDROID="android",e.WEB="web",e.WINDOWS="windows",e.MAC="mac",e.LINUX="linux"}(qN||(qN={})),function(e){e.UNKNOWN="unknown",e.DISCONNECTED="disconnected",e.LAN="lan",e.WIFI="wifi",e.W_2="2g",e.W_3="3g",e.W_4="4g",e.W_5="5g"}(JN||(JN={})),function(e){e.UNKNOWN="unknown",e.BROADCASTER="broadcaster",e.AUDIENCE="audience",e.SILENTAUDIENCE="silentAudience"}(ZN||(ZN={})),function(e){e.WEBSOCKET_RECONNECTING="websocket reconnecting",e.PEERCONNECTION_RECONNECTING="peerconnection reconnecting",e.DISCONNECTED="DISCONNECTED",e.LAN="LAN",e.WIFI="WIFI",e.W_2="2G",e.W_3="3G",e.W_4="4G",e.W_5="5G",e.UNKNOWN="UNKNOWN"}($N||($N={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(QN||(QN={})),function(e){e.WEBSOCKET_RECONNECTED="websocket reconnected",e.PEERCONNECTION_RECONNECTED="peerconnection reconnected"}(ek||(ek={})),function(e){e.WEBSOCKET="websocket",e.NETWORKCHANGED="networkChanged",e.PEERCONNECTION="peerconnection"}(tk||(tk={})),function(e){e.REQUEST="request",e.RESPONSE="response",e.KCP_REQUEST="kcp request",e.KCP_RESPONSE="kcp response",e.QUIC_REQUEST="quic request",e.QUIC_RESPONSE="quic response"}(rk||(rk={})),function(e){e.NEW="NEW",e.CHECKING="CHECKING",e.CONNECTED="CONNECTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.DISCONNECTED="DISCONNECTED",e.CLOSED="CLOSED",e.DATACHANNEL_CONNECTING="DATACHANNEL_CONNECTING",e.DATACHANNEL_OPEN="DATACHANNEL_OPEN",e.DATACHANNEL_CLOSING="DATACHANNEL_CLOSING",e.DATACHANNEL_CLOSED="DATACHANNEL_CLOSED"}(nk||(nk={})),function(e){e.SUCCEED="succeed",e.MESSAGE_ID_ERROR="message id error",e.ZIP_FAILED="zip failed",e.UNZIP_FAILED="unzip failed",e.MESSAGE_KEY_EMPTY="message key empty",e.MESSAGE_KEY_PARSE_FAILED="message key parse failed",e.MESSAGE_KEY_INVALID="message key invalid",e.ENCRYPT_FAILED="encrypt failed",e.DECRYPT_FAILED="decrypt failed",e.MESSAGE_TOO_BIG="message too big",e.INVALID_DATA="invalid data",e.MESSAGE_PARSE_FAILED="message parse failed"}(ik||(ik={})),function(e){e.CALL_JOINROOM="call-joinRoom",e.JOINROOM="joinRoom",e.CALL_RECONNECTED="call-reconnected",e.RECONNECTED="reconnected",e.CALL_PUBLISH="call-publish",e.PUBLISH="publish",e.CALL_UPDATESTREAMATTRIBUTES="call-updateStreamAttributes",e.UPDATESTREAMATTRIBUTES="updateStreamAttributes",e.CALL_UNPUBLISH="call-unpublish",e.UNPUBLISH="unpublish",e.CALL_SUBSCRIBE="call-subscribe",e.SUBSCRIBE="subscribe",e.CALL_UPDATESUBSCRIBE="call-updateSubscribe",e.UPDATESUBSCRIBE="updateSubscribe",e.CALL_UNSUBSCRIBE="call-unsubscribe",e.UNSUBSCRIBE="unsubscribe",e.CALL_UPDATEUSERATTRIBUTES="call-updateUserAttributes",e.UPDATEUSERATTRIBUTES="updateUserAttributes",e.CALL_LEAVEROOM="call-leaveRoom",e.LEAVEROOM="leaveRoom",e.ON_USERCONNECTION="on-userConnection",e.ON_USERDISCONNECTION="on-userDisconnection",e.ON_ONADDSTREAM="on-onAddStream",e.ON_ONPUSHSTREAM="on-onPushStream",e.ON_ONREMOVESTREAM="on-onRemoveStream",e.ON_ONPUSHTRACK="on-onPushTrack",e.ON_ONREMOVETRACK="on-onRemoveTrack",e.ON_ONUPDATEUSERATTRIBUTES="on-onUpdateUserAttributes",e.ON_ONUPDATEROOMATTRIBUTES="on-onUpdateRoomAttributes",e.ON_ONUPDATESTREAMATTRIBUTES="on-onUpdateStreamAttributes",e.ON_STREAMFAILED="on-streamFailed",e.ON_POSTPROCESSINGMESSAGE="on-postProcessingMessage",e.ON_ENGINECONTROLMESSAGE="on-engineControlMessage",e.ON_WEBSOCKETENGINECUSTOMMESSAGE="on-websocketEngineCustomMessage",e.UNKNOWN="unknown",e.CALL_UPDATEPUBLISHSTREAMCHANNEL="call-updatePublishStreamChannel",e.UPDATEPUBLISHSTREAMCHANNEL="updatePublishStreamChannel",e.CALL_UPDATESUBSCRIBESTREAMCHANNEL="call-updateSubscribeStreamChannel",e.UPDATESUBSCRIBESTREAMCHANNEL="updateSubscribeStreamChannel",e.ON_ONSTREAMCHANNELCHANGE="on-onStreamChannelChange",e.P2PDIRECT="p2pdirect",e.INTERNAL_CUSTOM="internal_custom",e.REPORT="report",e.CONNECTION_CONTROL="connection_control",e.ON_INTERNAL_CUSTOM="on_internal_custom",e.CONTROLMESSAGE="controlMessage",e.CALL_LOGIN="call-login",e.LOGIN="login",e.CALL_RECONNECTLOGIN="call-reconnectLogin",e.RECONNECTLOGIN="reconnectLogin",e.CALL_LOGOUT="call-logout",e.LOGOUT="logout",e.CALL_UPDATELOGINTOKEN="call-updateLoginToken",e.UPDATELOGINTOKEN="updateLoginToken",e.CALL_SETSERVERPARAMS="call-setServerParams",e.SETSERVERPARAMS="setServerParams",e.CALL_GETPEERONLINESTATUS="call-getPeerOnlineStatus",e.GETPEERONLINESTATUS="getPeerOnlineStatus",e.ON_ONSCENECONFIG="on-onSceneConfig",e.ON_STREAMCONTROLMESSAGE="on-streamControlMessage",e.CALL_STARTPUSHSTREAM="call-startPushStream",e.STARTPUSHSTREAM="startPushStream",e.CALL_STOPPUSHSTREAM="call-stopPushStream",e.STOPPUSHSTREAM="stopPushStream",e.CALL_STARTPULLSTREAM="call-startPullStream",e.STARTPULLSTREAM="startPullStream",e.CALL_STOPPULLSTREAM="call-stopPullStream",e.STOPPULLSTREAM="stopPullStream",e.CALL_UPDATEPULLSTREAM="call-updatePullStream",e.UPDATEPULLSTREAM="updatePullStream",e.ON_ONSTREAMPUSHEDBYOTHER="on-onStreamPushedByOther"}(ok||(ok={})),function(e){e.UP="up",e.DOWN="down",e.DIRECT="direct"}(ak||(ak={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(sk||(sk={})),function(e){e.UP="up",e.DOWN="down",e.PRE="pre"}(ck||(ck={})),function(e){e.W_0="0",e.W_1="1"}(uk||(uk={})),function(e){e.UP="up",e.DOWN="down"}(dk||(dk={})),function(e){e.ANSWER="answer",e.INCRANSWER="incranswer"}(lk||(lk={})),function(e){e.UP="up",e.DOWN="down"}(fk||(fk={})),function(e){e.SUCCESS="success",e.FAIL="fail"}(hk||(hk={})),function(e){e.W_0="0",e.W_1="1"}(pk||(pk={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.JOIN_ROOM_ACK_FAILED="join room ack failed",e.UNKNOWN="unknown"}(_k||(_k={})),function(e){e.SUCCESS="success",e.FAIL="fail",e.IGNORE="ignore"}(vk||(vk={})),function(e){e.LEAVE_ROOM="leave room",e.ACK_FAILED="ack failed",e.SET_ANSWER_SDP_FAILED="set answer sdp failed",e.ICE_FAILED="ice failed",e.STREAM_FAILED="stream failed",e.NETWORK_RECONNECTED="network reconnected",e.ON_STREAM_REMOVE="on stream remove",e.PUBLISH_MUTE="publish mute",e.UNKNOWN="unknown",e.ON_STREAM_REMOVE_CLIENT_UNPUBLISHED="on stream remove:client unpublished",e.ON_STREAM_REMOVE_PUBLISH_FAILED="on stream remove:publish failed",e.ON_STREAM_REMOVE_STREAM_REMOVED="on stream remove:stream removed",e.ON_STREAM_REMOVE_CLIENT_DISCONNECTED="on stream remove:client disconnected",e.ON_STREAM_REMOVE_CLIENT_REPUBLISH="on stream remove:client republish"}(mk||(mk={})),function(e){e.PLAYOUT_DEVICE_SWITCH="playout_device_switch",e.RECORD_DEVICE_SWITCH="record_device_switch",e.UNKNOWN="unknown"}(gk||(gk={})),function(e){e.BEGIN_SEND="begin_send",e.SENT_END="sent_end",e.BEGIN_RECV="begin_recv",e.RECV_END="recv_end"}(yk||(yk={})),function(e){e.AUDIO="audio",e.VIDEO="video",e.SCREEN_VIDEO="screen_video",e.SCREEN_AUDIO="screen_audio"}(Ek||(Ek={})),function(e){e.LOGIN="login",e.PUBLISHER="publisher",e.UNMUTE="unmute",e.ENABLE="enable",e.PUSH="push",e.PUBLISH="publish",e.ONDEMAND="ondemand",e.SUBSCRIBE="subscribe",e.PUSH_TRACK="push_track",e.REMOTE_UNMUTE="remote_unmute",e.P2P="p2p"}(Sk||(Sk={})),function(e){e.TIMEOUT="timeout",e.AUDIENCE="audience",e.MUTE="mute",e.DISABLE="disable",e.STOP_PUSH="stop_push",e.UNPUBLISH="unpublish",e.NO_DEMAND="no_demand",e.LEAVE_ROOM="leave_room",e.UNSUBSCRIBE="unsubscribe",e.REMOVE_TRACK="remove_track",e.REMOTE_MUTE="remote_mute",e.USER_LEAVE="user_leave"}(bk||(bk={})),function(e){e.AUDIO="audio",e.VIDEO="video"}(Tk||(Tk={})),function(e){e.BEGIN="begin",e.END="end"}(Ik||(Ik={})),function(e){e.BEGIN="begin",e.END="end"}(Ak||(Ak={})),function(e){e.LEAVE_ROOM="leave_room",e.ACK_FAILED="ack_failed",e.TOKEN_ERROR="token_error",e.SIGNALING_ERROR="signaling_error",e.TIMEOUT_10="timeout_10",e.TIMEOUT_60="timeout_60"}(Rk||(Rk={})),function(e){e.UNKNOWN="unknown",e.NEW="new",e.CHECKING="checking",e.CONNECTED="connected",e.FAILED="failed",e.SELECTED="selected",e.CLOSING="closing",e.CLOSED="closed"}(Ck||(Ck={})),function(e){e.NOMINAL="Nominal",e.FAIR="Fair",e.SERIOUS="Serious",e.CRITICAL="Critical",e.UNKNWON="Unknwon"}(Ok||(Ok={})),function(e){e.UNKNOWN="UNKNOWN",e.AUDIO_RECORD="AUDIO_RECORD",e.AUDIO_PLAYOUT="AUDIO_PLAYOUT",e.VIDEO="VIDEO",e.SHARE_AUDIO_RECORD="SHARE_AUDIO_RECORD",e.SHARE_VIDEO="SHARE_VIDEO"}(wk||(wk={})),function(e){e.P2P="p2p",e.P2P_OUTSIDE_ROOM="p2p_outside_room",e.P2SERVER="p2server"}(Nk||(Nk={})),function(e){e.START="start",e.START_CAPTURE_RESULT="start_capture_result",e.STARTED="started",e.RUNNING_FAILED="running_failed",e.STOP="stop",e.STOPPED="stopped"}(kk||(kk={})),function(e){e.DSHOW="dshow",e.MF="mf",e.AVCAPTURESESSION="avcapturesession",e.CAMERA1="camera1",e.CAMERA2="camera2"}(Dk||(Dk={})),function(e){e.SUCCESS="success",e.CAMERA_DEVICE_NO_PERMISSION="camera_device_no_permission",e.CAMERA_DEVICE_BUSY="camera_device_busy",e.CAMERA_DEVICE_FAILURE="camera_device_failure",e.CAMERA_DEVICE_NOT_FOUND="camera_device_not_found",e.CAMERA_DEVICE_DISCONNECTED="camera_device_disconnected",e.TIMEOUT="timeout",e.ABORT="abort"}(Pk||(Pk={})),function(e){e.UNKNOWN="unknown",e.MUSIC="music",e.HIGHQUALITY_COMMUNICATION="highquality_communication",e.COMMUNICATION="communication",e.MEDIA="media",e.GAME_STREAMING="game_streaming"}(Mk||(Mk={})),function(e){e.UNKNOWN="unknown",e.MEDIA="media",e.COMMUNICATION="communication"}(Uk||(Uk={})),function(e){e.UNKNOWN="unknown",e.SLEEP="Sleep",e.AWAKE="Awake"}(Lk||(Lk={})),function(e){e.UNKNOWN="unknown",e.PRODUCT="product",e.BOE="boe",e.TEST="test"}(xk||(xk={}));var Qk,eD,tD,rD=function(){function e(){}return e.prototype.setStats=function(e){var t=this;Object.keys(e).forEach((function(r){t["_"+r]=e[r]})),aD.StartUp()},Object.defineProperty(e.prototype,"event_key",{get:function(){return this._event_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_id",{get:function(){return this._device_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_app_id",{get:function(){return this._rtc_app_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"product_line",{get:function(){return this._product_line},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_version",{get:function(){return this._report_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"os",{get:function(){return this._os},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_version",{get:function(){return this._rtc_sdk_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_timestamp",{get:function(){return this._rtc_timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sdk_git_commit",{get:function(){return this._rtc_sdk_git_commit},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"report_id",{get:function(){return this._report_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connection_id",{get:function(){return this._connection_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_sid",{get:function(){return this._rtc_sid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"engine_session_id",{get:function(){return this._engine_session_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_business_id",{get:function(){return this._rtc_business_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"project_key",{get:function(){return this._project_key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"network_type",{get:function(){return this._network_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"app_version",{get:function(){return this._app_version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aid",{get:function(){return this._aid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_model",{get:function(){return this._device_model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"device_brand",{get:function(){return this._device_brand},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"common_extra_info",{get:function(){return this._common_extra_info},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"had_selected_p2p",{get:function(){return this._had_selected_p2p},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_env_type",{get:function(){return this._rtc_env_type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"room_id",{get:function(){return this._room_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"user_id",{get:function(){return this._user_id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtc_session_id",{get:function(){return this._rtc_session_id},enumerable:!1,configurable:!0}),e}(),nD=new rD,iD=NO.LOG_SERVER_URL,oD=function(){function e(){var e=this;this.report_id=0,this.dataBuffer=[],this.posting=!1,this.report_common={},this.preSucTime=0,this.errSendDelay=100,"undefined"!=typeof window&&window.addEventListener("beforeunload",(function(){clearTimeout(e.errSendTimer),clearTimeout(e.sucSendTimer),e.send(null,!0)}))}return e.prototype.push=function(e,t){t?this.send(e):(this.dataBuffer.push(e),!this.posting&&!this.errSendTimer&&Date.now()-this.preSucTime>2e3&&(clearTimeout(this.sucSendTimer),this.send()))},e.prototype.unshift=function(e){this.dataBuffer=e.concat(this.dataBuffer)},e.prototype.send=function(e,t){var r=this;if(e||this.dataBuffer.length){var n={data:e||this.dataBuffer.splice(0,4e3),header:this.report_common,from:"web",os:"web",version:"1"},i=new XMLHttpRequest;if(i.timeout=1e4,i.onreadystatechange=function(){if(4===i.readyState){e||(r.posting=!1);var o=void 0;if(200===i.status||304===i.status)try{o=JSON.parse(i.responseText)}catch(e){}o&&0===o.StatusCode?e||t||r.sucSend():e?r.send(e):(r.unshift(n.data),t?r.send():r.errSend())}},i.open("POST",iD,!0),e||(this.posting=!0),location.search.includes("_rtc_debug_"))i.send(JSON.stringify(n));else{var o=Bk.gzip(JSON.stringify(n));i.setRequestHeader("Content-Encoding","gzip"),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.send(o)}}},e.prototype.sucSend=function(){this.errSendDelay=100,this.preSucTime=Date.now(),this.sucSendTimer=setTimeout(this.send.bind(this),2e3)},e.prototype.errSend=function(){var e=this;this.errSendTimer=setTimeout((function(){e.send(),e.errSendTimer=null}),this.errSendDelay),this.errSendDelay*=2},e.prototype.StartUp=function(){var e=this.report_common,t=nD.event_key,r=nD.device_id,n=nD.rtc_app_id,i=nD.product_line,o=nD.report_version,a=nD.os,s=nD.rtc_sdk_version,c=nD.rtc_timestamp,u=nD.rtc_sdk_git_commit,d=nD.report_id,l=nD.connection_id,f=nD.rtc_sid,h=nD.engine_session_id,p=nD.rtc_business_id,_=nD.project_key,v=nD.network_type,m=nD.app_version,g=nD.aid,y=nD.device_model,E=nD.device_brand,S=nD.common_extra_info,b=nD.had_selected_p2p,T=nD.rtc_env_type;Object.assign(e,{event_key:t,device_id:r,rtc_app_id:n,product_line:i,report_version:o,os:a,rtc_sdk_version:s,rtc_timestamp:c,rtc_sdk_git_commit:u,report_id:d,connection_id:l,rtc_sid:f,engine_session_id:h,rtc_business_id:p,project_key:_,network_type:v,app_version:m,aid:g,device_model:y,device_brand:E,common_extra_info:S,had_selected_p2p:b,rtc_env_type:T}),nD.room_id&&(e.room_id=nD.room_id),nD.user_id&&(e.user_id=nD.user_id),nD.rtc_session_id&&(e.rtc_session_id=nD.rtc_session_id)},e.prototype.rtcSdkApiCall=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_sdk_api_call",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_api_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcSdkCallback=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_sdk_callback",report_id:this.report_id++,rtc_timestamp:Date.now(),sdk_callback_name:e,error_code:t,message:r},n);this.push(i)},e.prototype.rtcReconnect=function(e,t,r,n,i){void 0===i&&(i={});var o=$n({event_key:"rtc_reconnect",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reconnect_id:r,reconnect_type:n},i);this.push(o)},e.prototype.rtcReconnected=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"rtc_reconnected",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,reconnect_type:t},r);this.push(n)},e.prototype.rtcGetAccess=function(e,t,r,n,i,o,a){void 0===a&&(a={});var s=$n({event_key:"rtc_get_access",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r,type:n,host:i,connect_session_id:o},a);this.push(s)},e.prototype.rtcPreIceState=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"rtc_pre_ice_state",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,ice_state:t},r);this.push(n)},e.prototype.rtcNodeChange=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_node_change",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignalingMsgError=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_signaling_msg_error",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,reason:r},n);this.push(i)},e.prototype.rtcSignaling=function(e,t,r,n,i,o){void 0===o&&(o={});var a=$n({event_key:"rtc_signaling",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,signaling_event:r,signaling_type:n,direction:i},o);this.push(a)},e.prototype.rtcJoinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=$n({event_key:"rtc_join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,deviceModel:t,deviceManufacturer:r,elapse:n},i);this.push(o)},e.prototype.rtcLeaveRoom=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_leave_room",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,elapse:r},n);this.push(i)},e.prototype.rtcBeginCreateOffer=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_begin_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),direction:e,stream_id:t,stream_user_id:r},n);this.push(i)},e.prototype.rtcCreateOffer=function(e,t,r,n,i,o){void 0===o&&(o={});var a=$n({event_key:"rtc_create_offer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,direction:t,stream_id:r,stream_user_id:n,elapse:i},o);this.push(a)},e.prototype.rtcSetDescription=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=$n({event_key:"rtc_set_description",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,message:t,is_local:r,direction:n,stream_id:i,stream_user_id:o,elapse:a},s);this.push(c)},e.prototype.rtcRecvAnswer=function(e,t,r,n,i,o,a,s){void 0===s&&(s={});var c=$n({event_key:"rtc_recv_answer",report_id:this.report_id++,rtc_timestamp:Date.now(),error_code:e,answer_type:t,sequence_id:r,message:n,direction:i,stream_id:o,stream_user_id:a},s);this.push(c)},e.prototype.firstRemoteAudioRender=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"first_remote_audio_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.firstRemoteVideoRender=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"first_remote_video_render",report_id:this.report_id++,rtc_timestamp:Date.now(),stream_id:e,stream_user_id:t},r);this.push(n)},e.prototype.rtcPublishStat=function(e,t,r,n,i){void 0===i&&(i={});var o=$n({event_key:"rtc_publish_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,is_screen:t,start:r,message:n},i);this.push(o)},e.prototype.rtcSubscribeStat=function(e,t,r,n,i){void 0===i&&(i={});var o=$n({event_key:"rtc_subscribe_stat",report_id:this.report_id++,rtc_timestamp:Date.now(),result:e,start:t,message:r,stream_user_id:n},i);this.push(o)},e.prototype.rtcAudioDevice=function(e,t,r,n){void 0===n&&(n={});var i=$n({event_key:"rtc_audio_device",report_id:this.report_id++,rtc_timestamp:Date.now(),audio_event:e,message:t,error_code:r},n);this.push(i)},e.prototype.rtcMediaStatistics=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_media_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcMessageStatistics=function(e,t,r,n){void 0===n&&(n={});var i=$n($n($n($n({event_key:"rtc_message_statistics",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),{media_server_ip:r}),n);this.push(i)},e.prototype.rtcError=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"rtc_error",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t},r);this.push(n)},e.prototype.rtcInvokeStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=$n({event_key:"rtc_invoke_status",report_id:this.report_id++,rtc_timestamp:Date.now(),message:e,error_code:t,sdk_api_name:r,stream_id:n,elapse:i},o);this.push(a)},e.prototype.rtcFirstFrame=function(e,t){void 0===t&&(t={});var r=$n($n({event_key:"rtc_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcMuteRemote=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_mute_remote",report_id:this.report_id++,rtc_timestamp:Date.now()},e),{media_type:t}),r);this.push(n)},e.prototype.sdkInitEngine=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"sdk_init_engine",report_id:this.report_id++,rtc_timestamp:Date.now(),start:e,type:t},r);this.push(n)},e.prototype.joinRoom=function(e,t,r,n,i){void 0===i&&(i={});var o=$n({event_key:"join_room",report_id:this.report_id++,rtc_timestamp:Date.now(),type:e,start:t,result:r,reason:n},i);this.push(o)},e.prototype.p2pConnectionStatus=function(e,t,r,n,i,o){void 0===o&&(o={});var a=$n({event_key:"p2p_connection_status",report_id:this.report_id++,rtc_timestamp:Date.now(),room_id:e,user_id:t,peer_user_id:r,status:n,elapse:i},o);this.push(a)},e.prototype.p2pConnectClosed=function(e,t){void 0===t&&(t={});var r=$n({event_key:"p2p_connect_closed",report_id:this.report_id++,rtc_timestamp:Date.now(),p2p_selected:e},t);this.push(r)},e.prototype.rtcDeviceError=function(e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v){void 0===v&&(v={});var m=$n({event_key:"rtc_device_error",report_id:this.report_id++,rtc_timestamp:Date.now(),device_type:e,device_stage:t,error_code:r,system_error_code:n,system_api:i,call_parameters:o,location:a,message:s,media_device_id:c,media_device_name:u,elapse:d,scenario:l,event_session_id:f,device_pid:h,device_vid:p,media_mode:_},v);this.push(m)},e.prototype.rtcVideoDevice=function(e,t,r){void 0===r&&(r={});var n=$n({event_key:"rtc_video_device",report_id:this.report_id++,rtc_timestamp:Date.now(),media_device_id:e,media_device_name:t},r);this.push(n)},e.prototype.rtcVideoCaptureEvent=function(e,t){void 0===t&&(t={});var r=$n($n({event_key:"rtc_video_capture_event",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t);this.push(r)},e.prototype.rtcEncodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_encode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcFirstFrameEncoded=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_first_frame_encoded",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcSendFirstPacket=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_send_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstPacket=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_recv_first_packet",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcRecvFirstFrame=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_recv_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e.prototype.rtcDecodeFirstFrame=function(e,t,r){void 0===r&&(r={});var n=$n($n($n({event_key:"rtc_decode_first_frame",report_id:this.report_id++,rtc_timestamp:Date.now()},e),t),r);this.push(n)},e}(),aD=new oD;function sD(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t,r,n){if("function"==typeof n.value){var i=n.value;n.value=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o={};return e.forEach((function(e,r){o[e]=t[r]})),aD.rtcSdkApiCall(r,0,JSON.stringify(cC(t)),o),i.apply(this,t)}}}}function cD(e,t,r){void 0===r&&(r=0),aD.rtcSdkCallback(e,r,JSON.stringify(t))}function uD(e,t,r){void 0===r&&(r=0),aD.rtcInvokeStatus(JSON.stringify(t),r,e,"",0)}!function(e){e.streamRemovedBySchedule308="stream removed",e.clientRePublish="client republish",e.publishStreamFaied="publish failed",e.clientUnPublish="client unpublished",e.clientDisconnected="client disconnected",e.videoMuted="video muted"}(Qk||(Qk={})),function(e){e.ON_ADD_STREAM="onAddStream",e.ON_REMOVE_STREAM="onRemoveStream",e.USER_DISCONNECTION="userDisconnection",e.USER_CONNECTION="userConnection",e.ON_UPDATE_STREAM_ATTRIBUTES="onUpdateStreamAttributes",e.ON_UPDATE_ROOM_ATTRIBUTES="onUpdateRoomAttributes",e.ON_PUSH_TRACK="onPushTrack",e.ON_REMOVE_TRACK="onRemoveTrack",e.ON_CUSTOM_MESSAGE="onCustomMessage",e.NODE_CHANGE="nodeChange",e.USER_MESSAGE_RECEIVED="userMessageReceived",e.USER_BINARY_MESSAGE_RECEIVED="userBinaryMessageReceived",e.POST_PROCESSING_MESSAGE="postProcessingMessage"}(eD||(eD={})),function(e){e.ON_CONNECTION_STATE_CHANGE="onConnectionStateChange",e.ABNORMAL_DISCONNECTION="normalConnection"}(tD||(tD={}));var dD=new DC("DataChannelSignaling",3),lD=0,fD=1,hD=0,pD=0,_D=function(e){function t(t){var r=t.appId,n=t.roomId,i=t.clientId,o=t.dataChannel,a=e.call(this)||this;return a._appId=r,a._roomId=n,a._clientId=i,a._dataChannel=o,a._resolveCallbacks=new Map,a._rejectCallbacks=new Map,a._p2pResolveCallbacks=new Map,a._p2pRejectCallbacks=new Map,a._p2pMessageId=0,a._rttIds={},a._signalingType=new Map,a._timer={},a._clearDataChannelListener=a._handleHandler(),window.__rtc_mock_signaling__=a.emit.bind(a),a}return Zn(t,e),t.prototype.destroy=function(){this._dataChannel&&(this._clearDataChannelListener(),this._dataChannel.close()),this._resolveCallbacks=new Map,this._rejectCallbacks=new Map,this._p2pResolveCallbacks=new Map,this._p2pRejectCallbacks=new Map,this._p2pMessageId=0,this._rttIds={},this._signalingType=new Map,this._timer={}},t.prototype.sendSignaling=function(e,t){var r=this;return aD.rtcSignaling(0,JSON.stringify(t),"call-".concat(e),"Send",ak.UP),new Promise((function(n,i){if(!r._dataChannel||"open"!==r._dataChannel.readyState)return i(new dT(sT.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,1],a=aC();o=o.concat(a);var s=a.join("-");r._resolveCallbacks.set(s,n),r._rejectCallbacks.set(s,i),r._signalingType.set(s,e),r._timer[s]=setTimeout((function(){i(new dT(sT.TIME_OUT,"Signaling message time out"))}),1e4),dD.print("Signal",">>>>>> [".concat(e,"][").concat(s,"]"),t),r._sendMessage(e,o,t)}))},t.prototype.sendPingMessage=function(){var e="CheckConnectivity",t=aC(),r={ts:(new Date).getTime()};aD.rtcSignaling(0,JSON.stringify(r),"call-".concat(e),"Send",ak.UP),dD.print("Signal",">>>>>> [".concat(e,"][").concat(t.join("-"),"] ping")),this._sendMessage(e,ii([2,9],ni(t),!1),r)},t.prototype.sendP2PMessage=function(e,t){var r=t instanceof ArrayBuffer,n=r?QR.encodeBase64(oC.ab2str(t)):JSON.stringify(t);return this._sendP2PMessage(e,n,!1,!1,r)},t.prototype._sendP2PMessage=function(e,t,r,n,i,o){var a=this;void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1);var s=this._p2pMessageId++,c=o||{ver:1,id:+s,time:Date.now(),dir:lD,type:hD,err:pD,app:this._appId,room:this._roomId,from:this._clientId,to:e,binary:i,msg:t};return n||-1!==(null==t?void 0:t.indexOf("__web__rtc__rtt__"))||dD.print("_sendP2PMessage [DC Signaling p2p >>]",JSON.stringify(c)),new Promise((function(e,i){if(!a._dataChannel||"open"!==a._dataChannel.readyState)return i(new dT(sT.SIGNALING_CHANNEL_NOT_OPEN,"DataChannel not open"));var o=[2,5];(null==t?void 0:t.indexOf("__web__rtc__rtt__"))>-1&&(a._rttIds[s]=s,n=!0);var u=aC();o=o.concat(u),r||(a._p2pResolveCallbacks.set(s,e),a._p2pRejectCallbacks.set(s,i),a._timer[s]=setTimeout((function(){i(new dT(sT.TIME_OUT,"P2P message timeout"))}),1e4)),a._sendMessage("p2p",o,c)}))},t.prototype._sendMessage=function(e,t,r){return ei(this,void 0,void 0,(function(){var n,i;return ti(this,(function(o){return n=oC.str2ab(JSON.stringify([e,r])),i=iC(Uint8Array,t,new Uint8Array(n)),this._dataChannel.send(i.buffer),[2]}))}))},t.prototype._dispartData=function(e){var t={messageType:0,compress:!1,direction:"ack"},r="",n=(new Uint8Array([]),new Uint8Array(e)),i=n[0],o=n[1],a=1&o;t.messageType=(60&o)>>2,t.compress=16==(16&i),t.direction=2==(2&o)?"ack":"send";var s=0;if(a||"ack"===t.direction){for(var c=2;c<=6;c++){var u=n[c];if(128!=(128&u)){s=c-2+1;break}}r=n.slice(2,2+s).join("-")}return{config:t,id:r,data:n.slice(2+s),needAck:a}},t.prototype._feedbackSignaling=function(e,t){void 0===e&&(e="");var r=e.split("-").map((function(e){return+e})),n=[2,3];n=n.concat(r);var i=r.join("-");dD.print("Signal",">>>>>> [".concat(t,"-res][").concat(i,"]")),this._sendMessage("".concat(t,"-res"),n,"")},t.prototype._feedbackMessage=function(e){var t,r=(null===(t=null==e?void 0:e.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1;e.dir=fD,e.msg="",this._sendP2PMessage(e.to,"",!0,r,!1,e)},t.prototype._handleFeedback=function(e){var t=(e=$n({},e)).id,r=this._p2pResolveCallbacks.get(t),n=this._p2pRejectCallbacks.get(t);if(clearTimeout(this._timer[t]),this._p2pResolveCallbacks.delete(t),this._p2pRejectCallbacks.delete(t),e.err===pD)"function"==typeof r&&r(t);else"function"==typeof n&&n(e)},t.prototype._handleMessage=function(e){var t,r;return ei(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_,v,m;return ti(this,(function(g){switch(g.label){case 0:return n=this._dispartData(e),i=n.config,o=n.id,a=n.data,s=a,i.compress&&((c=new Bk.Inflate).push(s,!0),s=c.result),[4,oC.ab2str(s)];case 1:u=g.sent(),d=[];try{d=JSON.parse(u)}catch(e){return e instanceof Error&&aD.rtcSignalingMsgError(-1,e.message,ik.MESSAGE_PARSE_FAILED),[2]}switch(l="p2p",i.messageType){case 0:"ack"===i.direction?(f=this._resolveCallbacks.get(o),h=this._rejectCallbacks.get(o),p=d[0]||{},clearTimeout(this._timer[o]),this._resolveCallbacks.delete(o),this._rejectCallbacks.delete(o),200===(null==p?void 0:p.code)?"function"==typeof f&&f(p):"function"==typeof h&&h(p),(l=this._signalingType.get(o))&&(this._signalingType.delete(o),dD.print("Signal","<<<<<< [".concat(l,"-ack]"),p)),aD.rtcSignaling(0,u,l,"Ack",ak.DOWN)):Array.isArray(d)&&(l=d[0],d=d[1],dD.print("Signal","<<<<<< ".concat(l),d,o),this._feedbackSignaling(o,l),d.binary&&"string"==typeof d.message&&(d.message=oC.str2ab(QR.decodeBase64(d.message))),this.emit(l,$n({},d)),aD.rtcSignaling(0,u,"on-".concat(l),"Recv",ak.DOWN));break;case 1:switch(Array.isArray(d)&&(l=d[0],d=d[1]),_=null==d?void 0:d.id,this._rttIds[_]||(null==d?void 0:d.dir)===fD||(null===(t=null==d?void 0:d.msg)||void 0===t?void 0:t.indexOf("__web__rtc__rtt__"))>-1?delete this._rttIds[_]:dD.print("Signal","<<<<<< p2p response",d),d.dir){case lD:-1===(null===(r=null==d?void 0:d.msg)||void 0===r?void 0:r.indexOf("__web__rtc__rtt__"))&&(v=d.binary,m=d.msg,this.emit(v?eD.USER_BINARY_MESSAGE_RECEIVED:eD.USER_MESSAGE_RECEIVED,$n($n({},d),{msg:v?oC.str2ab(QR.decodeBase64(m)):m}))),this._feedbackMessage(d);break;case fD:this._handleFeedback(d)}break;case 2:dD.print("Signal","<<<<<< pong"),aD.rtcSignaling(0,u,"CheckConnectivity","Recv",ak.DOWN)}return[2]}}))}))},t.prototype._handleHandler=function(){var e=this,t=function(t){dD.print("_handleHandler","dataChannel close",t),e.emit("close",t)},r=function(t){dD.print("_handleHandler","dataChannel error",t),e.emit("close",t)},n=function(t){e._handleMessage(t.data)};return this._dataChannel.addEventListener("close",t),this._dataChannel.addEventListener("error",r),this._dataChannel.addEventListener("message",n),function(){e._dataChannel.removeEventListener("close",t),e._dataChannel.removeEventListener("error",r),e._dataChannel.removeEventListener("message",n)}},t}(SC.exports.EventEmitter),vD=function(){function e(){this.isSending=!1}return e.prototype.ajax=function(e){var t=this,r=e.method,n=e.url,i=e.body,o=void 0===i?{}:i,a=e.headers,s=void 0===a?{}:a,c=e.stringify,u=void 0===c||c;return new Promise((function(e,i){var a,c;t.isSending=!0;var d=new XMLHttpRequest;d.open(r,n,!0);try{for(var l=ri(Object.entries(s)),f=l.next();!f.done;f=l.next()){var h=ni(f.value,2),p=h[0],_=h[1];d.setRequestHeader(p,_)}}catch(e){a={error:e}}finally{try{f&&!f.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}d.onreadystatechange=function(){4===d.readyState&&(t.isSending=!1,200===d.status?e(JSON.parse(d.responseText)):i({message:d.statusText,code:d.status})),0===d.status&&i({code:0,message:"Request abort"})},d.onerror=function(e){var r=sT.UNEXPECTED_ERROR;t.isSending=!1,i({code:r,message:d.responseText||"unknown"})},u&&(o=JSON.stringify(o)),d.send(o),t.xhr=d}))},e.prototype.get=function(e,t){return this.ajax({method:"GET",url:e,headers:t})},e.prototype.post=function(e,t,r,n){return this.ajax({method:"POST",url:e,body:t,headers:r,stringify:n})},e.prototype.abort=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}(),mD=function(){function e(){}return e.prototype.get=function(e){var t=localStorage.getItem(e);if(!t)return null;try{var r=JSON.parse(t);return r.ttl>0&&Date.now()-r.saveTime>r.ttl?(this.delete(e),null):r.message}catch(e){return null}},e.prototype.set=function(e,t,r){void 0===r&&(r=-1);var n={ttl:r,saveTime:Date.now(),message:t};try{return localStorage.setItem(e,JSON.stringify(n)),!0}catch(e){return!1}},e.prototype.delete=function(e){try{return localStorage.removeItem(e),!0}catch(e){return!1}},e}(),gD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Zn(t,e),t.prototype.getDeviceId=function(){var e=this.get("RTC_DEVICE_ID");return e||(e=vR()),this.set("RTC_DEVICE_ID",e),e},t.prototype.getDefaultSdp=function(){return this.get("RTC_DEFAULT_SDP")},t.prototype.setDefaultSdp=function(e){return this.set("RTC_DEFAULT_SDP",e,108e6)},t.prototype.getAccessNode=function(e){return this.get("".concat("RTC_ACCESS_NODE","_").concat(e,"-BytePlus"))},t.prototype.setAccessNode=function(e,t,r){return this.set("".concat("RTC_ACCESS_NODE","_").concat(e,"-BytePlus"),t,1e3*r)},t.prototype.getAccessUrls=function(){return this.get("".concat("RTC_ACCESS_URLS","-BytePlus"))},t.prototype.setAccessUrls=function(e){var t=e.map((function(e){var t=e.host,r=e.path;return"https://".concat(t).concat(r)}));return this.set("".concat("RTC_ACCESS_URLS","-BytePlus"),t)},t.prototype.clearAccessUrls=function(){this.delete("".concat("RTC_ACCESS_URLS","-BytePlus"))},t}(mD),yD=new gD,ED=new DC("ICE Request",3),SD=function(){function e(){this._request=new vD}return e.prototype.getAccessNode=function(e,t,r,n,i,o){return ei(this,void 0,void 0,(function(){var a;return ti(this,(function(s){return(a=yD.getAccessNode(e))?(this.getAccessNodeFromServer(e,t,r,n,i,o),uD("es.R.node.cache",a),[2,Promise.resolve(a)]):[2,this.getAccessNodeFromServer(e,t,r,n,i,o)]}))}))},e.prototype.getAccessNodeFromServer=function(e,t,r,n,i,o){return ei(this,void 0,void 0,(function(){var a,s,c=this;return ti(this,(function(u){return a=yD.getAccessUrls(),s=!0,uD("es.R.req.cache.urls",a),(null==a?void 0:a.length)>0||(a=NO.ICE_CONFIG_REQUEST_URLS,s=!1,uD("es.R.req.external.urls",a)),(null==a?void 0:a.length)>0||(a=NO.ICE_CONFIG_REQUEST_URLS_INTERNAL,s=!1,uD("es.R.req.internal.urls",a)),[2,this.getICEConfigFromServer(a,e,t,r,n,i,o).then((function(t){var r=t.nodes[0];return yD.setAccessNode(e,r,t.ttl||11200),yD.setAccessUrls(t.dispatchDomains),r})).catch((function(a){if(s)return uD("es.R.req.fallback",""),yD.clearAccessUrls(),c.getAccessNodeFromServer(e,t,r,n,i,o);throw a}))]}))}))},e.prototype.getICEConfigFromServer=function(e,t,r,n,i,o,a){var s;return ei(this,void 0,void 0,(function(){var c,u,d,l=this;return ti(this,(function(f){return c={appID:t,roomID:r,userID:n,deviceID:i,connectSessionID:rC(),os:"web",sdkVersion:NO.VERSION,expectedAddr:DO("EXPECTED_ADDR"),productPlatform:"BytePlus"},o&&a&&(c.feedbackInfo=[{feedbackIP:null===(s=a.publicIPs[0])||void 0===s?void 0:s.ip,feedbackReason:{type:"NodeChanged",reason:o}}],delete c.expectedAddr),u=Date.now(),aD.rtcGetAccess(0,JSON.stringify(c),0,rk.REQUEST,e.join(","),c.connectSessionID),d=e.map((function(e,t){return ei(l,void 0,void 0,(function(){var r,n,i;return ti(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._request.post(e,c)];case 1:return r=o.sent(),[3,3];case 2:throw n=o.sent(),new dT(sT.ICE_SERVER_WRONG,"get ICE config failed",n);case 3:if(200!==r.code)throw new dT(sT.ICE_SERVER_WRONG,"get ICE config failed",{server_code:r.code,message:JSON.stringify(r)});if(!(i=r.nodes[0]))throw new dT(sT.ICE_SERVER_WRONG,"ICE config server return empty nodes",{code:r.code,message:JSON.stringify(r)});return[2,{result:r,firstNode:i,index:t}]}}))}))})),[2,Promise.race(d).then((function(t){var r=t.result;t.firstNode;var n=t.index;return aD.rtcGetAccess(200,JSON.stringify(r),Date.now()-u,rk.RESPONSE,e[n],c.connectSessionID),r})).catch((function(t){throw aD.rtcGetAccess(t.error.code||t.error.server_code,t.error.message,Date.now()-u,rk.RESPONSE,e.join(","),c.connectSessionID),t}))]}))}))},e.prototype.abort=function(){this._request.isSending&&(ED.print("abort","HTTP Request of [getICEConfigFromServer] abort"),this._request.abort())},e}(),bD=bE.left,TD=ee,ID=vf;jn({target:"Array",proto:!0,forced:!wd("reduce")||!ID&&TD>79&&TD<83},{reduce:function(e){var t=arguments.length;return bD(this,e,t,t>1?arguments[1]:void 0)}});var AD={},RD={},CD={exports:{}},OD=CD.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(OD).forEach((function(e){OD[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},r=function(e,r,n){var i=e.name&&e.names;e.push&&!r[e.push]?r[e.push]=[]:i&&!r[e.name]&&(r[e.name]={});var o=e.push?{}:i?r[e.name]:r;!function(e,r,n,i){if(i&&!n)r[i]=t(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(r[n[o]]=t(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&r[e.push].push(o)},n=CD.exports,i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(n[t]||[]).length;s+=1){var c=n[t][s];if(c.reg.test(i))return r(c,a,i)}})),t.media=o,t};var o=function(e,r){var n=r.split(/=(.+)/,2);return 2===n.length?e[n[0]]=t(n[1]):1===n.length&&r.length>1&&(e[n[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var r=[],n=e.split(" ").map(t),i=0;i<n.length;i+=3)r.push({component:n[i],ip:n[i+1],port:n[i+2]});return r},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var r,n=!1;return"~"!==e[0]?r=t(e):(r=t(e.substring(1,e.length)),n=!0),{scid:r,paused:n}}))}))}}(RD);var wD=CD.exports,ND=/%[sdv%]/g,kD=function(e){var t=1,r=arguments,n=r.length;return e.replace(ND,(function(e){if(t>=n)return e;var i=r[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},DD=function(e,t,r){var n=[e+"="+(t.format instanceof Function?t.format(t.push?r:r[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?n.push(r[t.name][o]):n.push(r[t.names[i]])}else n.push(r[t.name]);return kD.apply(null,n)},PD=["v","o","s","i","u","e","p","c","b","t","r","z","a"],MD=["i","c","b","a"],UD=RD,LD=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 r=t.outerOrder||PD,n=t.innerOrder||MD,i=[];return r.forEach((function(t){wD[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(DD(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(DD(t,r,e))}))}))})),e.media.forEach((function(e){i.push(DD("m",wD.m[0],e)),n.forEach((function(t){wD[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(DD(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(DD(t,r,e))}))}))}))})),i.join("\r\n")+"\r\n"};AD.write=LD,AD.parse=UD.parse,AD.parseParams=UD.parseParams,AD.parseFmtpConfig=UD.parseFmtpConfig,AD.parsePayloads=UD.parsePayloads,AD.parseRemoteCandidates=UD.parseRemoteCandidates,AD.parseImageAttributes=UD.parseImageAttributes,AD.parseSimulcastStreamList=UD.parseSimulcastStreamList;var xD=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this._iceConfigNode.iceParams,n=AD.parse(e);return null===(t=n.media)||void 0===t||t.forEach((function(e){e.iceUfrag=null==r?void 0:r.clientIceUfrag,e.icePwd=null==r?void 0:r.clientIcePwd,e.iceOptions="renomination"})),AD.write(n)},e}(),BD=function(){function e(e){this._iceConfigNode=e}return e.prototype.modifyByIceNode=function(e){var t,r=this,n=this._iceConfigNode.certFingerprint,i=AD.parse(e);return(null==i?void 0:i.fingerprint)&&(i.fingerprint={type:"sha-256",hash:n}),null===(t=null==i?void 0:i.media)||void 0===t||t.forEach((function(e){return r.modifyMlineByIceNode(e)})),AD.write(i)},e.prototype.modifyMlineByIceNode=function(e){var t=this._iceConfigNode,r=t.publicIPs,n=t.certFingerprint,i=t.iceParams;e.fingerprint&&(e.fingerprint={type:"sha-256",hash:n}),e.icePwd=i.serverIcePwd,this._iceUfrag||(this._iceUfrag=XD(i.serverIceUfrag),nD.setStats({connection_id:this._iceUfrag})),e.iceUfrag=this._iceUfrag,e.setup="active",this._candidates||(this._candidates=KD(r)),e.candidates=this._candidates,e.iceOptions="renomination","application"===e.type&&(e.sctpmap={sctpmapNumber:5e3,app:"webrtc-datachannel",maxMessageSize:262144})},e}();function VD(e,t){var r,n=AD.parse(e),i=[];return n.media=n.media.map((function(e){return t.includes(e.mid+"")?(e.direction="inactive",e.port=0,delete e.ext,delete e.ssrcs,delete e.ssrcGroups,delete e.simulcast,delete e.simulcast_03,delete e.rids,delete e.extmapAllowMixed,delete e.bundleOnly):"inactive"!==e.direction&&i.push(e.mid),e})),(null===(r=n.groups)||void 0===r?void 0:r[0])&&(n.groups[0].mids=i.join(" ")),n}var jD,FD,GD,zD,HD,WD=function(e,t){var r,n;try{var i=AD.parse(e),o=AD.parse(t),a="".concat(null===(r=o.groups)||void 0===r?void 0:r[0].mids).split(" "),s="".concat(null===(n=i.groups)||void 0===n?void 0:n[0].mids).split(" "),c={};a.forEach((function(e){return c[e]=e}));var u={};s.forEach((function(e){c[e]||(u[e]=e)}));var d="",l="";return i.media=i.media.filter((function(e){return u[e.mid]&&"audio"===e.type?d="".concat(e.mid):u[e.mid]&&"video"===e.type&&(l="".concat(e.mid)),u[e.mid]})),delete i.groups,delete i.msidSemantic,{partialSdp:AD.write(i),audioMid:d,videoMid:l}}catch(e){return null}},YD=function(e,t){var r;try{var n=AD.parse(e),i=[];return null===(r=n.media)||void 0===r||r.forEach((function(e){(null==t?void 0:t.includes("".concat(e.mid)))&&i.push(e)})),n.media=i,delete n.groups,delete n.msidSemantic,AD.write(n)}catch(e){return""}},KD=function(e){if(!Array.isArray(e))return[];var t=0,r=2130706431,n=[];return e.forEach((function(e){var i={component:1,ip:e.ip,type:"host",generation:e.generation};e.udpPorts&&e.udpPorts.forEach((function(e){n.push($n($n({},i),{foundation:t++,transport:"udp",port:e,priority:r}))})),e.tcpPorts&&e.tcpPorts.forEach((function(e){n.push($n($n({},i),{foundation:t++,transport:"tcp",port:e,tcptype:"passive",priority:2130705431}))}))})),n},XD=function(e){var t=new TextEncoder,r=t.encode("PREC"),n=new Uint8Array(oC.str2ab(e)),i=t.encode(Date.now().toString()).slice(-4),o=new Uint8Array(4);o[0]=0,o[1]=1,o[2]=1,o[3]=1;var a=iC(Uint8Array,r,n,i,o),s=oC.ab2str(a.buffer);return QR.encodeBase64(s)},qD="safari"===(jD="none",null!==window.navigator.userAgent.match("Firefox")?jD="mozilla":null!==window.navigator.userAgent.match("Chrome")?(jD="chrome-stable",null!==window.navigator.userAgent.match("Electron")&&(jD="electron")):(null!==window.navigator.userAgent.match("Safari")||null!==window.navigator.userAgent.match("AppleWebKit"))&&(jD="safari"),jD);!function(e){e.codec="codec",e.inboundRtp="inbound-rtp",e.outboundRtp="outbound-rtp",e.remoteInboundRtp="remote-inbound-rtp",e.remoteOutboundRtp="remote-outbound-rtp",e.mediaSource="media-source",e.csrc="csrc",e.peerConnection="peer-connection",e.dataChannel="data-channel",e.stream="stream",e.track="track",e.transceiver="transceiver",e.sender="sender",e.receiver="receiver",e.transport="transport",e.sctpTransport="sctp-transport",e.candidatePair="candidate-pair",e.localCandidate="local-candidate",e.remoteCandidate="remote-candidate",e.certificate="certificate",e.iceServer="ice-server"}(FD||(FD={})),function(e){e[e.encode=0]="encode",e[e.decode=1]="decode"}(GD||(GD={})),function(e){e[e.none=0]="none",e[e.cpu=1]="cpu",e[e.bandwidth=2]="bandwidth",e[e.other=3]="other"}(zD||(zD={})),function(e){e[e.unknown=0]="unknown",e[e.controlling=1]="controlling",e[e.controlled=2]="controlled"}(HD||(HD={}));var JD,ZD,$D,QD=function(){function e(e){this.peer=e,this.stats=[]}return e.prototype.handleCodec=function(e){return e},e.prototype.handleInboundRtp=function(e){return e},e.prototype.handleOutboundRtp=function(e){var t=e.ssrc;return t&&(e.rtxSsrc=t),e},e.prototype.handleRemoteInboundRtp=function(e){return e},e.prototype.handleRemoteOutboundRtp=function(e){return e},e.prototype.handleMediaSource=function(e){return e},e.prototype.handleCsrc=function(e){return e},e.prototype.handlePeerConnection=function(e){return e},e.prototype.handleDataChannel=function(e){return e},e.prototype.handleStream=function(e){return e},e.prototype.handleTrack=function(e){return e},e.prototype.handleTransceiver=function(e){return e},e.prototype.handleSender=function(e){return e},e.prototype.handleReceiver=function(e){return e},e.prototype.handleTransport=function(e){return e},e.prototype.handleSctpTransport=function(e){return e},e.prototype.handleCandidatePair=function(e){return e},e.prototype.handleLocalCandidate=function(e){return e},e.prototype.handleRemoteCandidate=function(e){return e},e.prototype.handleCertificate=function(e){return e},e.prototype.handleIceServer=function(e){return e},e.prototype.processStats=function(e){var t=this;e.forEach((function(e){var r;switch(e.type){case FD.candidatePair:r=t.handleCandidatePair;break;case FD.certificate:r=t.handleCertificate;break;case FD.remoteCandidate:r=t.handleRemoteCandidate;break;case FD.remoteInboundRtp:r=t.handleInboundRtp;break;case FD.remoteOutboundRtp:r=t.handleOutboundRtp;break;case FD.sctpTransport:r=t.handleSctpTransport;break;case FD.sender:r=t.handleSender;break;case FD.stream:r=t.handleStream;break;case FD.track:r=t.handleTrack;break;case FD.transceiver:r=t.handleTransceiver;break;case FD.transport:r=t.handleTransport;break;case FD.codec:r=t.handleCodec;break;case FD.csrc:r=t.handleCsrc;break;case FD.dataChannel:r=t.handleDataChannel;break;case FD.iceServer:r=t.handleIceServer;break;case FD.mediaSource:r=t.handleMediaSource;break;case FD.outboundRtp:r=t.handleOutboundRtp;break;case FD.inboundRtp:r=t.handleInboundRtp;break;case FD.peerConnection:r=t.handlePeerConnection;break;case FD.receiver:r=t.handleReceiver;break;case FD.localCandidate:r=t.handleLocalCandidate;break;default:r=function(e){return e}}r=r.bind(t),t.stats.push(r(e))}))},e.prototype.getExtraStats=function(){return ei(this,void 0,void 0,(function(){var e=this;return ti(this,(function(t){return[2,new Promise((function(t,r){if(qD||void 0!==window.InstallTrigger)return t(e.stats);try{e.peer.getStats((function(r){r.result().forEach((function(t){if(!eP.includes(t.type)){var r={};t.names().forEach((function(e){r[e]=t.stat(e)})),r.id=t.id,r.type=t.type,r.timestamp=t.timestamp,e.stats.push(r)}})),t(e.stats)}))}catch(e){r(e)}}))]}))}))},e.prototype.getStats=function(e){return ei(this,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),[4,this.peer.getStats(e)];case 1:t=r.sent(),this.processStats(t),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this.getExtraStats()];case 3:case 4:return r.sent(),[3,5];case 5:return[3,7];case 6:return r.sent(),[3,7];case 7:return[2,this.stats]}}))}))},e}(),eP=["codec","inbound-rtp","outbound-rtp","remote-inbound-rtp","remote-outbound-rtp","media-source","csrc","peer-connection","data-channel","stream","track","transceiver","sender","receiver","transport","sctp-transport","candidate-pair","local-candidate","remote-candidate","certificate","ice-server"];!function(e){e[e.AUTO=0]="AUTO",e[e.MODE_L=1]="MODE_L",e[e.MODE_R=2]="MODE_R",e[e.MODE_MIX=3]="MODE_MIX"}(JD||(JD={})),function(e){e[e.PLAYOUT=0]="PLAYOUT",e[e.PUBLISH=1]="PUBLISH",e[e.PLAYOUT_AND_PUBLISH=2]="PLAYOUT_AND_PUBLISH"}(ZD||(ZD={})),function(e){e[e.AUDIO_MIXING_STATE_PRELOADED=0]="AUDIO_MIXING_STATE_PRELOADED",e[e.AUDIO_MIXING_STATE_PLAYING=1]="AUDIO_MIXING_STATE_PLAYING",e[e.AUDIO_MIXING_STATE_PAUSED=2]="AUDIO_MIXING_STATE_PAUSED",e[e.AUDIO_MIXING_STATE_STOPPED=3]="AUDIO_MIXING_STATE_STOPPED",e[e.AUDIO_MIXING_STATE_FAILED=4]="AUDIO_MIXING_STATE_FAILED",e[e.AUDIO_MIXING_STATE_FINISHED=5]="AUDIO_MIXING_STATE_FINISHED",e[e.AUDIO_MIXING_STATE_PCM_ENABLED=6]="AUDIO_MIXING_STATE_PCM_ENABLED",e[e.AUDIO_MIXING_STATE_PCM_DISABLED=7]="AUDIO_MIXING_STATE_PCM_DISABLED"}($D||($D={}));var tP=function(){var e;try{var t=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.toLowerCase();if(t.indexOf("ucbrowser")>-1&&t.indexOf("iphone"))return!1}catch(e){return!1}return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)},rP=function(){return"undefined"!=typeof TransformStream&&void 0!==RTCRtpSender.prototype.createEncodedStreams&&void 0!==RTCRtpReceiver.prototype.createEncodedStreams},nP=new DC("BasicHandler",3),iP=rP(),oP={iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan",encodedInsertableStreams:!!iP||void 0},aP=function(e){function t(){var t=e.call(this)||this;return t._peerConnection=new RTCPeerConnection(oP),t._dataChannel=t._peerConnection.createDataChannel("signaling"),t._dataChannel.binaryType="arraybuffer",t._peerConnection.ontrack=function(e){var r,n;nP.print("constructor","pc.ontrack ".concat(e.track.kind," ").concat(e.track.id," ").concat(null===(n=null===(r=e.streams)||void 0===r?void 0:r[0])||void 0===n?void 0:n.id)),t.emit("ontrack",e)},t._peerConnection.onconnectionstatechange=function(e){nP.print("constructor","onconnectionstatechange ".concat(t._peerConnection.iceConnectionState," -> ").concat(t._peerConnection.connectionState)),"failed"!==t._peerConnection.iceConnectionState&&"closed"!==t._peerConnection.iceConnectionState&&"failed"!==t._peerConnection.connectionState||t.emit("disconnect")},t._peerConnection.oniceconnectionstatechange=function(){var e=t._peerConnection.iceConnectionState;aD.rtcPreIceState(e,nk["".concat(e.toUpperCase())])},t}return Zn(t,e),t.prototype.connect=function(e){return ei(this,void 0,void 0,(function(){var t,r,n=this;return ti(this,(function(i){switch(i.label){case 0:return nP.print("connect","invoke connect"),[4,this._peerConnection.createOffer()];case 1:return t=i.sent(),this._localSdp=new xD(e),[4,this.setLocalDescription(t.sdp)];case 2:return i.sent(),uD("es.connect.offer",t.sdp),this._remoteSdp=new BD(e),r=this._remoteSdp.modifyByIceNode(t.sdp),[4,this.setRemoteDescription(r)];case 3:return i.sent(),uD("es.connect.answer",r),[4,new Promise((function(e,t){n._dataChannel.onopen=function(){nP.print("connect","dataChannel open"),uD("es.dc.open",""),e("")},n._dataChannel.onerror=function(e){aD.rtcSignalingMsgError(e.error.sdpLineNumber,e.error.errorDetail,ik.INVALID_DATA),uD("es.dc.error",""),t(e)},n._dataChannel.onclose=function(e){uD("es.dc.close",""),t(e)}}))];case 4:return i.sent(),nP.print("connect","dataChannel establish success"),[2,this._dataChannel]}}))}))},t.prototype.disconnect=function(){this._peerConnection.close(),this._dataChannel.close(),this._peerConnection.ontrack=null},t.prototype.destroy=function(){this.disconnect(),this._localSdp=void 0,this._remoteSdp=void 0},t.prototype.publish=function(e){var t;return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g;return ti(this,(function(y){switch(y.label){case 0:if(r=e.stream,n=null==e?void 0:e.videoTrack,i=null==e?void 0:e.audioTrack,o={},a=[],Array.isArray(null==e?void 0:e.videoEncodeConfig))for(s=null==e?void 0:e.videoEncodeConfig.length,c=null==n?void 0:n.getTrack(),u={width:640,height:480,framerate:30},c&&(d=null==c?void 0:c.getSettings(),u={width:Math.floor(d.width),height:Math.floor(d.height),framerate:Math.floor(d.frameRate)}),o.sendEncodings=[],l=0;l<s;l++)f=null==e?void 0:e.videoEncodeConfig[l],h={maxBitrate:1e3*f.maxKbps},p=Math.pow(2,l),s>1&&(h.rid="".concat(l),h.scaleResolutionDownBy=p),null===(t=o.sendEncodings)||void 0===t||t.unshift(h),a.push({width:Math.floor(u.width/p),height:Math.floor(u.height/p),framerate:u.framerate,maxkbps:f.maxKbps,rid:"".concat(l)});return nP.print("publish videoTransceiverInit videoDescriptions","",o,a),_=null==i?void 0:i.getTrack(),(null==i?void 0:i.mixType)!==ZD.PLAYOUT&&(null==i?void 0:i.mixedAudioTrack)&&(_=null==i?void 0:i.mixedAudioTrack),e.audioTransceiver=this._peerConnection.addTransceiver(_||"audio",{direction:"sendonly",streams:[r]}),iP&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver((null==n?void 0:n.getTrack())||"video",$n({direction:"sendonly",streams:[r]},o)),iP&&e.initVideoEncodedTransform(),nP.print("sender.getParameters()",e.videoTransceiver.sender.getParameters()),v=nC(),aD.rtcBeginCreateOffer(sk.UP,e.streamId,e.userId),[4,this._peerConnection.createOffer()];case 1:if(m=y.sent(),aD.rtcCreateOffer(0,ck.UP,e.streamId,e.userId,nC()-v),g=WD(m.sdp,this.getLocalDescriptionSdp()),!m.sdp||!g)throw new dT(sT.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,$n($n({sdp:m.sdp},g),{type:"incroffer",semantics:"unified-plan",videoDescriptions:a})]}}))}))},t.prototype.subscribe=function(e,t){return ei(this,void 0,void 0,(function(){var r,n,i,o,a;return ti(this,(function(s){switch(s.label){case 0:return r="incroffer",n="unified-plan",t?[2,{sdp:this.getLocalDescriptionSdp(),partialSdp:YD(this.getLocalDescriptionSdp(),[t.audioMid,t.videoMid]),audioMid:t.audioMid,videoMid:t.videoMid,type:r,semantics:n}]:(e.audioTransceiver=this._peerConnection.addTransceiver("audio",{direction:"recvonly"}),iP&&e.initAudioEncodedTransform(),e.videoTransceiver=this._peerConnection.addTransceiver("video",{direction:"recvonly"}),iP&&e.initVideoEncodedTransform(),i=nC(),aD.rtcBeginCreateOffer(sk.DOWN,e.streamId,e.userId),[4,this._peerConnection.createOffer()]);case 1:if(o=s.sent(),aD.rtcCreateOffer(0,ck.DOWN,e.streamId,e.userId,nC()-i),a=WD(o.sdp,this.getLocalDescriptionSdp()),!o.sdp||!a)throw new dT(sT.ADD_TRANSCEIVER_FAILED,"createOffer failed");return[2,$n($n({sdp:o.sdp},a),{type:r,semantics:n})]}}))}))},t.prototype.setAnswerSdp=function(e,t,r,n,i){var o;return ei(this,void 0,void 0,(function(){var a,s,c,u,d,l;return ti(this,(function(f){switch(f.label){case 0:return aD.rtcRecvAnswer(0,lk.INCRANSWER,0,t,i,n.streamId,n.userId),a=this._peerConnection.remoteDescription,s=AD.parse(null==a?void 0:a.sdp),c=null===(o=s.media)||void 0===o?void 0:o.reduce((function(e,t){return e[t.mid]=t,e}),{}),AD.parse(t).media.forEach((function(e){return c[e.mid]=e})),u=[],d=AD.parse(e),l=d.media.map((function(e){r&&r[e.mid]&&(e.mid=r[e.mid]),"inactive"!==e.direction&&u.push(e.mid);var t=c[e.mid];return t.port=e.port,t})),s.media=l,d.groups=[{mids:u.join(" "),type:"BUNDLE"}],s.groups=d.groups,[4,this.setLocalDescription(AD.write(d),n,i)];case 1:return f.sent(),[4,this.setRemoteDescription(AD.write(s),n,i)];case 2:return f.sent(),[2]}}))}))},t.prototype.setLocalDescription=function(e,t,r){var n;return ei(this,void 0,void 0,(function(){var i,o,a,s;return ti(this,(function(c){switch(c.label){case 0:i=null===(n=this._localSdp)||void 0===n?void 0:n.modifyByIceNode(e),o=new RTCSessionDescription({type:"offer",sdp:i}),a=nC(),c.label=1;case 1:return c.trys.push([1,3,,4]),nP.print("setOffer","set offer: ",o),[4,this._peerConnection.setLocalDescription(o)];case 2:return c.sent(),t&&aD.rtcSetDescription(0,"",uk.W_1,r,t.streamId,t.userId,nC()-a),[3,4];case 3:throw(s=c.sent())instanceof Error&&t&&aD.rtcSetDescription(-1,s.message,uk.W_1,r,t.streamId,t.userId,nC()-a),s;case 4:return[2]}}))}))},t.prototype.setRemoteDescription=function(e,t,r){return ei(this,void 0,void 0,(function(){var n,i,o;return ti(this,(function(a){switch(a.label){case 0:n=new RTCSessionDescription({type:"answer",sdp:e}),i=nC(),a.label=1;case 1:return a.trys.push([1,3,,4]),nP.print("setAnswer","set answer: ",n),[4,this._peerConnection.setRemoteDescription(n)];case 2:return a.sent(),t&&aD.rtcSetDescription(0,"",uk.W_0,r,t.streamId,t.userId,nC()-i),[3,4];case 3:throw(o=a.sent())instanceof Error&&t&&aD.rtcSetDescription(-1,o.message,uk.W_0,r,t.streamId,t.userId,nC()-i),o;case 4:return[2]}}))}))},t.prototype.getLocalDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.localDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.localDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.getRemoteDescriptionSdp=function(){var e,t,r,n;if(null===(t=null===(e=this._peerConnection)||void 0===e?void 0:e.remoteDescription)||void 0===t?void 0:t.sdp)return null===(n=null===(r=this._peerConnection)||void 0===r?void 0:r.remoteDescription)||void 0===n?void 0:n.sdp;throw Error()},t.prototype.closeMLine=function(e){var t,r;return ei(this,void 0,void 0,(function(){var n,i,o,a,s=this;return ti(this,(function(c){switch(c.label){case 0:return nP.print("closeMids","closeMids: ",e),n=this.getLocalDescriptionSdp(),i=VD(n,e),o=this.getRemoteDescriptionSdp(),a=VD(o,e),[4,this.setLocalDescription(AD.write(i))];case 1:return c.sent(),(null===(t=null==i?void 0:i.media)||void 0===t?void 0:t.length)!==(null===(r=null==a?void 0:a.media)||void 0===r?void 0:r.length)&&i.media.slice(a.media.length).forEach((function(e){var t;null===(t=s._remoteSdp)||void 0===t||t.modifyMlineByIceNode(e),a.media.push(e)})),Array.isArray(i.media)&&Array.isArray(a.media)&&i.media.forEach((function(e,t){a.media[t]&&(a.media[t].mid=e.mid)})),[4,this.setRemoteDescription(AD.write(a))];case 2:return c.sent(),[2]}}))}))},t.prototype.getDefaultSdp=function(){return ei(this,void 0,void 0,(function(){var e,t,r;return ti(this,(function(n){switch(n.label){case 0:return(e=yD.getDefaultSdp())?[3,2]:((t=new RTCPeerConnection(oP)).createDataChannel("default"),t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"}),[4,t.createOffer()]);case 1:r=n.sent(),e=null==r?void 0:r.sdp,t.close(),yD.setDefaultSdp(e),n.label=2;case 2:return[2,{sdp:e,semantics:"unified-plan",type:"offer"}]}}))}))},t.prototype.getStats=function(e){return t=this._peerConnection,r=e,ei(void 0,void 0,void 0,(function(){var e;return ti(this,(function(n){switch(n.label){case 0:return e=[],t instanceof RTCPeerConnection?[4,new QD(t).getStats(r)]:[2,e];case 1:return[2,e=n.sent()]}}))}));var t,r},t.prototype.rollback=function(e,t){var r;return ei(this,void 0,void 0,(function(){return ti(this,(function(n){switch(n.label){case 0:return nP.print("rollback()","signalingState: %o",this._peerConnection.signalingState),"stable"!==this._peerConnection.signalingState?[3,2]:[4,null===(r=this._peerConnection)||void 0===r?void 0:r.setLocalDescription(new RTCSessionDescription({sdp:e,type:"offer"}))];case 1:n.sent(),n.label=2;case 2:return[4,this.closeMLine(t)];case 3:return n.sent(),[2]}}))}))},Object.defineProperty(t.prototype,"pc",{get:function(){return this._peerConnection},enumerable:!1,configurable:!0}),t}(SC.exports.EventEmitter),sP=new DC("Locker",2),cP=1,uP=function(){function e(e){this.lockingPromise=Promise.resolve(),this.locks=0,this.name="",this.lockId=cP++,e&&(this.name=e),sP.print("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}return Object.defineProperty(e.prototype,"isLocked",{get:function(){return this.locks>0},enumerable:!1,configurable:!0}),e.prototype.lock=function(){var e,t=this;this.locks+=1,sP.print("[lock-".concat(this.name,"-").concat(this.lockId,"] locked, current queue ").concat(this.locks,"."));var r=new Promise((function(r){e=function(){t.locks-=1,sP.print("[lock-".concat(t.name,"-").concat(t.lockId,"] unlocked, current queue ").concat(t.locks,".")),r()}})),n=this.lockingPromise.then((function(){return e}));return this.lockingPromise=this.lockingPromise.then((function(){return r})),n},e}(),dP=Math.log,lP=Math.LOG10E;jn({target:"Math",stat:!0},{log10:Math.log10||function(e){return dP(e)*lP}}),jn({target:"Number",stat:!0},{isNaN:function(e){return e!=e}}),new DC("Stats",2);var fP,hP=function(){function e(e,t){this._client=e,this._handler=t,this.dataChannelRTT={},this._rttTimer={},this._remoteStreamStasEvtIntervals={},this._localStreamStasEvtIntervals={},this._firstFrameStarted={},this._videoInWaiting={}}return e.prototype.setRemoteStreamStatsEvtInterval=function(e){var t,r,n=this;this.getDataChannelRTT(e.userId);var i={audio:{},video:{},remoteStream:e},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getRemoteAudioStats(o,i),this.getRemoteVideoStats(a,i),this.delRemoteStreamStatsEvtInterval(e);this._remoteStreamStasEvtIntervals[e.streamId]=setInterval((function(){return ei(n,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:return[4,ei(n,void 0,void 0,(function(){var t,r,n,o,a,s;return ti(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getRemoteAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getRemoteVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen,userId:e.userId}]}}))}))];case 1:return t=r.sent(),this._client.emit("onRemoteStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delRemoteStreamStatsEvtInterval=function(e){clearInterval(this._remoteStreamStasEvtIntervals[e.streamId])},e.prototype.unsubscribe=function(e){this.delRemoteStreamStatsEvtInterval(e),clearTimeout(this._rttTimer[e.userId]),this._videoInWaiting[e.streamId]=!1,this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:e.isScreen?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bk.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:e.isScreen?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bk.UNSUBSCRIBE,stream_user_id:e.userId}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getRemoteAudioStats=function(e,t){return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return ti(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.audioMid,u=i.hasAudio,d={media_type:"audio",direction:"down",stream_id:o,stream_user_id:a,vid:c,remote_muted:!u},e&&this._handler?(t.audioStart||(t.audioStart=nC(),aD.rtcFirstFrame({event_type:yk.BEGIN_RECV,media_type:s?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.SUBSCRIBE,start:t.audioStart,event_session_id:o,stream_user_id:a}),u?this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart:aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:s?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.PUBLISH,start:t.audioStart,event_session_id:o,result:!1,reason:bk.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(l=_.sent()).length?(l.forEach((function(e){var i=e.type,c=e.packetsLost,u=e.packetsReceived,l=e.bytesReceived,f=e.jitterBufferDelay,h=e.jitterBufferEmittedCount,_=e.clockRate,v=e.channels,m=e.totalSamplesReceived,g=e.concealedSamples,y=e.concealmentEvents,E=e.totalRoundTripTime,S=e.state,b=e.currentRoundTripTime,T=e.audioLevel,I=e.totalAudioEnergy,A=e.totalSamplesDuration,R=e.mimeType,C=e.googDecodingNormal,O=e.fecPacketsReceived,w=e.availableIncomingBitrate,N=e.availableOutgoingBitrate,k=e.bytesSent,D=e.nominated,P=e.id,M=e.writable,U=e.jitter,L=e.candidateType,x=e.ip,B=e.networkType,V=e.port,j=e.protocol,F=e.audioOutputLevel,G=e.requestsReceived,z=e.responsesReceived,H=e.requestsSent,W=e.consentRequestsSent,Y=e.responsesSent,K=e.ssrc,X=e.kind;"inbound-rtp"===i?(n.packetsLost=c,n.packetsReceived=u,d.packets=u,n.bytesReceived=l,d.bytes=l,r.jitterBufferDelay=f/h*1e3,d.jitter_buffer_delay=r.jitterBufferDelay,n.totalSamplesReceived=m,r.concealedSamples=g,n.concealedSamples=g,d.concealed_samples=g,r.concealmentEvents=y,d.fec_packets_received=O,d.jitter=1e3*U,d.ssrc=K,d.total_samples_received=m,m>0&&p._firstFrameStarted["".concat(o,"-audio")]&&(aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:s?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.SUBSCRIBE,event_session_id:o,result:!0,start:t.audioStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-audio")])):"codec"===i?(r.recordSampleRate=_,r.numChannels=v,d.codec=R):"candidate-pair"===i?(d.ice_available_incoming_bitrate=w,d.ice_available_outgoing_bitrate=N,d.ice_bytes_received=l,d.ice_bytes_sent=k,d.ice_nominated=+D,d.ice_pair_id=P,d.ice_pair_rtt=b,d.rtt=1e3*b,d.ice_pair_state=S,d.ice_pair_writable=M,d.recv_ping_requests=G,d.recv_ping_responses=z,d.sent_ping_requests_before_first_response=H,d.sent_ping_requests_total=H+W,d.sent_ping_responses=Y,"succeeded"===S&&(r.rtt=1e3*b,r.total_rtt=1e3*E)):"track"===i&&"audio"===X?(d.audio_level=-10*Math.log10(Math.pow(T,2)),d.volume=255*T,d.total_audio_energy=I,d.total_samples_duration=A):"ssrc"===i?(d.decoding_normal=C,d.recv_level=F):"local-candidate"===i?(d.local_candidate_type=L,d.local_ip=x,d.local_network_type=B,d.local_port=V,d.protocol=j):"remote-candidate"===i&&(d.remote_candidate_type=L,d.remote_ip=x,d.remote_port=V)})),(f=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-f.packetsLost)/(n.packetsReceived-f.packetsReceived+(n.packetsLost-f.packetsLost)),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,d.packets_lost=Math.round(n.packetsLost-f.packetsLost),d.fraction_lost=r.audioLossRate,d.packets_lost_rate=r.audioLossRate,r.statsInterval=n.timestamp-f.timestamp,r.receivedKBitrate=(n.bytesReceived-f.bytesReceived||0)/r.statsInterval,d.bitrate=Math.round(8e3*r.receivedKBitrate),d.bandwidth=Math.round(d.bitrate/1024),d.interval_concealed_samples=n.concealedSamples-f.concealedSamples,d.interval_samples_received=n.totalSamplesReceived-f.totalSamplesReceived,r.receivedSampleRate=1e3*d.interval_samples_received/r.statsInterval,t.audio=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+(r.jitterBufferDelay||0),d.web_e2e_delay=r.e2eDelay,d.total_rtt_ms=h),t.remoteStream.subAudio&&aD.rtcMediaStatistics(d,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getRemoteVideoStats=function(e,t){return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l,f,h,p=this;return ti(this,(function(_){switch(_.label){case 0:return r={},n={timestamp:Date.now()},i=t.remoteStream,o=i.streamId,a=i.userId,s=i.isScreen,c=i.hasVideo,u={media_type:"video",direction:"down",stream_id:o,stream_user_id:a,vid:t.remoteStream.videoMid,remote_muted:!c},e&&this._handler?(t.videoStart||(t.videoStart=nC(),aD.rtcFirstFrame({event_type:yk.BEGIN_RECV,media_type:s?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.SUBSCRIBE,start:t.videoStart,event_session_id:o,stream_user_id:a}),c?this._firstFrameStarted["".concat(o,"-video")]=t.videoStart:aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:s?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.PUBLISH,start:t.videoStart,event_session_id:o,result:!1,reason:bk.DISABLE,stream_user_id:a})),[4,this._handler.getStats(e)]):[2,r];case 1:return(d=_.sent()).length?(d.forEach((function(e){var i=e.type,c=e.frameHeight,d=e.frameWidth,l=e.packetsLost,f=e.packetsReceived,h=e.bytesReceived,_=e.framesDecoded,v=e.roundTripTime,m=e.jitterBufferDelay,g=e.jitterBufferEmittedCount,y=e.mimeType,E=e.firCount,S=e.availableIncomingBitrate,b=e.availableOutgoingBitrate,T=e.bytesSent,I=e.nominated,A=e.id,R=e.currentRoundTripTime,C=e.state,O=e.writable,w=e.candidateType,N=e.ip,k=e.networkType,D=e.port,P=e.nackCount,M=e.pliCount,U=e.protocol,L=e.requestsReceived,x=e.responsesReceived,B=e.requestsSent,V=e.consentRequestsSent,j=e.responsesSent,F=e.ssrc;e.totalRoundTripTime;var G=e.jitter,z=e.framesReceived,H=e.keyFramesDecoded,W=e.totalDecodeTime,Y=e.decoderImplementation,K=e.lastPacketReceivedTimestamp;"inbound-rtp"===i?(r.width=d,u.frame_size_width=d,r.height=c,u.frame_size_height=c,n.packetsLost=l,u.packets_lost=l,n.packetsReceived=f,u.packets=f,n.bytesReceived=h,u.bytes=h,n.framesDecoded=_,n.jitterBufferDelay=m/g*1e3,u.jitter_buffer_delay=n.jitterBufferDelay,u.fir_count=E,u.nack_count=P,u.pli_count=M,u.ssrc=F,u.jitter=G,u.frames_received=z,u.frames_decoded=_,u.key_frames_decoded=H,u.total_decode_time=W,u.decoder_implementation=Y,u.last_packet_received_timestamp=K,_>0&&p._firstFrameStarted["".concat(o,"-video")]&&(aD.rtcFirstFrame({event_type:yk.RECV_END,media_type:s?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.SUBSCRIBE,event_session_id:o,result:!0,start:t.videoStart,stream_user_id:a}),delete p._firstFrameStarted["".concat(o,"-video")])):"remote-outbound-rtp"===i?(r.rtt=1e3*v,u.rtt=v):"codec"===i?u.codec=y:"candidate-pair"===i?(u.ice_available_incoming_bitrate=S,u.ice_available_outgoing_bitrate=b,u.ice_bytes_received=h,u.ice_bytes_sent=T,u.ice_nominated=+I,u.ice_pair_id=A,u.ice_pair_rtt=R,u.rtt=1e3*R,u.ice_pair_state=C,u.ice_pair_writable=O,u.recv_ping_requests=L,u.recv_ping_responses=x,u.sent_ping_requests_before_first_response=B,u.sent_ping_requests_total=B+V,u.sent_ping_responses=j):"local-candidate"===i?(u.local_candidate_type=w,u.local_ip=N,u.local_network_type=k,u.local_port=D,u.protocol=U):"remote-candidate"===i&&(u.remote_candidate_type=w,u.remote_ip=N,u.remote_port=D)})),l=t.video,f=t.remoteStream,l.timestamp?(r.videoLossRate=(n.packetsLost-l.packetsLost)/(n.packetsReceived-l.packetsReceived+(n.packetsLost-l.packetsLost)),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,u.fraction_lost=r.videoLossRate,u.packets_lost_rate=r.videoLossRate,r.statsInterval=n.timestamp-l.timestamp,r.receivedKBitrate=(n.bytesReceived-l.bytesReceived||0)/r.statsInterval,u.bitrate=Math.round(8e3*r.receivedKBitrate),u.bandwidth=Math.round(u.bitrate/1024),r.decoderOutputFrameRate=1e3*(n.framesDecoded-l.framesDecoded)/r.statsInterval,u.frame_rate_decoded=Math.round(r.decoderOutputFrameRate),u.frame_rate_received=u.frame_rate_decoded,t.video=n,this.dataChannelRTT[t.remoteStream.userId]&&(h=this.dataChannelRTT[t.remoteStream.userId]/2,r.e2eDelay=h+n.jitterBufferDelay,u.web_e2e_delay=r.e2eDelay,u.total_rtt_ms=h),f.subVideo&&(this.processStall(f,u),aD.rtcMediaStatistics(u,{})),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.processStall=function(e,t){var r=0,n=0,i=0;e.recordedVideoFrames.forEach((function(e){e.isStall&&(r+=e.stallCount,n+=e.stallDuration),i=e.playTime})),e.recordedVideoFrames.length||(n=2e3,r=this._videoInWaiting[e.streamId]?0:1,this._videoInWaiting[e.streamId]=!0);var o=e.recordedVideoFrames.pop();o&&(o.isStall?this._videoInWaiting[e.streamId]=!0:this._videoInWaiting[e.streamId]=!1),e.recordedVideoFrames=[],t.stall_count=r,t.stall_duration=n,t.play_time=i},e.prototype.setLocalStreamStatsEvtInterval=function(e){var t,r,n=this,i={audio:{},video:{},localStream:e,firstframeReported:!1},o=null===(t=e.audioTrack)||void 0===t?void 0:t.getTrack(),a=null===(r=e.videoTrack)||void 0===r?void 0:r.getTrack();this.getAudioStats(o,i),this.getVideoStats(a,i),this.delLocalStreamStatsEvtInterval(e);this._localStreamStasEvtIntervals[e.streamId]=setInterval((function(){return ei(n,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:return[4,ei(n,void 0,void 0,(function(){var t,r,n,o,a,s;return ti(this,(function(c){switch(c.label){case 0:return t=null===(a=e.audioTrack)||void 0===a?void 0:a.getTrack(),r=null===(s=e.videoTrack)||void 0===s?void 0:s.getTrack(),[4,this.getAudioStats(t,i)];case 1:return n=c.sent(),[4,this.getVideoStats(r,i)];case 2:return(o=c.sent()).isScreen=e.isScreen,[2,{audioStats:n,videoStats:o,isScreen:e.isScreen}]}}))}))];case 1:return t=r.sent(),this._client.emit("onLocalStreamStats",t),[2]}}))}))}),2e3)},e.prototype.delLocalStreamStatsEvtInterval=function(e){clearInterval(this._localStreamStasEvtIntervals[e.streamId])},e.prototype.unpublish=function(e){this.delLocalStreamStatsEvtInterval(e),this._firstFrameStarted["".concat(e.streamId,"-audio")]&&(aD.rtcFirstFrame({event_type:yk.SENT_END,media_type:e.isScreen?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-audio")],event_session_id:e.streamId,result:!1,reason:bk.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-audio")]),this._firstFrameStarted["".concat(e.streamId,"-video")]&&(aD.rtcFirstFrame({event_type:yk.SENT_END,media_type:e.isScreen?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.PUBLISH,start:this._firstFrameStarted["".concat(e.streamId,"-video")],event_session_id:e.streamId,result:!1,reason:bk.UNPUBLISH}),delete this._firstFrameStarted["".concat(e.streamId,"-video")])},e.prototype.getAudioStats=function(e,t){return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return ti(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.audioMid,s=i.isScreen,c={media_type:"audio",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.audioStart||(t.audioStart=nC(),aD.rtcFirstFrame({event_type:yk.BEGIN_SEND,media_type:s?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.PUBLISH,start:t.audioStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-audio")]=t.audioStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.packetsSent,u=e.packetsLost,d=e.bytesSent,f=e.clockRate,h=e.roundTripTime,p=e.channels,_=e.audioLevel,v=e.googRtt,m=e.mimeType,g=e.availableIncomingBitrate,y=e.availableOutgoingBitrate,E=e.bytesReceived,S=e.nominated,b=e.id,T=e.currentRoundTripTime,I=e.state,A=e.writable,R=e.requestsReceived,C=e.responsesReceived,O=e.requestsSent,w=e.consentRequestsSent,N=e.responsesSent,k=e.jitter,D=e.candidateType,P=e.ip,M=e.networkType,U=e.port,L=e.protocol,x=e.nackCount,B=e.retransmittedBytesSent,V=e.retransmittedPacketsSent,j=e.roundTripTimeMeasurements,F=e.audioInputLevel,G=e.ssrc,z=e.totalAudioEnergy,H=e.totalSamplesDuration,W=e.mediaType;"outbound-rtp"===i?(n.packetsSent=a,a>0&&l._firstFrameStarted["".concat(o,"-audio")]&&(aD.rtcFirstFrame({event_type:yk.SENT_END,media_type:s?Ek.SCREEN_AUDIO:Ek.AUDIO,type:Sk.PUBLISH,event_session_id:o,result:!0,start:t.audioStart}),delete l._firstFrameStarted["".concat(o,"-audio")]),n.bytesSent=d,c.bytes=d,c.packets=a,c.nack_count=x,c.ssrc=G,c.retransmitted_bytes_sent=B,c.retransmitted_packets_sent=V):"remote-inbound-rtp"===i?(n.packetsLost=u,c.packets_lost=u,c.jitter=1e3*k,r.rtt=1e3*h,c.rtt=r.rtt,c.round_trip_time_measurements=j):"codec"===i?(r.recordSampleRate=f,r.numChannels=p,c.codec=m):"media-source"===i?(c.audio_level=-10*Math.log10(Math.pow(_,2)),c.volume=255*_,c.total_audio_energy=z,c.total_samples_duration=H):"ssrc"===i&&"audio"===W?(c.audio_network_elapse=v,c.send_level=F):"candidate-pair"===i?(c.ice_available_incoming_bitrate=g,c.ice_available_outgoing_bitrate=y,c.ice_bytes_received=E,c.ice_bytes_sent=d,c.ice_nominated=+S,c.ice_pair_id=b,c.ice_pair_rtt=T,c.ice_pair_state=I,c.ice_pair_writable=A,c.recv_ping_requests=R,c.recv_ping_responses=C,c.sent_ping_requests_before_first_response=O,c.sent_ping_requests_total=O+w,c.sent_ping_responses=N):"local-candidate"===i?(c.local_candidate_type=D,c.local_ip=P,c.local_network_type=M,c.local_port=U,c.protocol=L):"remote-candidate"===i&&(c.remote_candidate_type=D,c.remote_ip=P,c.remote_port=U)})),(d=t.audio).timestamp?(r.audioLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.audioLossRate=Number.isNaN(r.audioLossRate)?0:r.audioLossRate,c.fraction_lost=r.audioLossRate,r.statsInterval=n.timestamp-d.timestamp,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),t.audio=n,aD.rtcMediaStatistics(c,{}),[2,r]):(t.audio=n,[2,r])):[2,r]}}))}))},e.prototype.getVideoStats=function(e,t){return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,d,l=this;return ti(this,(function(f){switch(f.label){case 0:return r={},n={timestamp:Date.now()},i=t.localStream,o=i.streamId,a=i.videoMid,s=i.isScreen,c={media_type:"video",direction:"up",stream_id:o,vid:a},e&&this._handler?(t.videoStart||(t.videoStart=nC(),aD.rtcFirstFrame({event_type:yk.BEGIN_SEND,media_type:s?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.PUBLISH,start:t.videoStart,event_session_id:o}),this._firstFrameStarted["".concat(o,"-video")]=t.videoStart),[4,this._handler.getStats(e)]):[2,r];case 1:return(u=f.sent()).length?(u.forEach((function(e){var i=e.type,a=e.framesEncoded,u=e.packetsLost,d=e.bytesSent,f=e.framesSent,h=e.roundTripTime,p=e.mimeType,_=e.totalSamplesReceived,v=e.frameWidth,m=e.frameHeight,g=e.clockRate,y=e.packetsSent,E=e.googActualEncBitrate,S=e.googAvailableReceiveBandwidth,b=e.googAvailableSendBandwidth,T=e.googAvgEncodeMs,I=e.googBucketDelay,A=e.googEncodeUsagePercent,R=e.googFrameRateInput,C=e.availableIncomingBitrate,O=e.availableOutgoingBitrate,w=e.bytesReceived,N=e.nominated,k=e.id,D=e.currentRoundTripTime,P=e.state,M=e.writable,U=e.candidateType,L=e.ip,x=e.networkType,B=e.port,V=e.nackCount,j=e.pliCount,F=e.protocol,G=e.qpSum,z=e.requestsReceived,H=e.responsesReceived,W=e.googRetransmitBitrate,Y=e.requestsSent,K=e.consentRequestsSent,X=e.responsesSent,q=e.ssrc,J=e.googTargetEncBitrate,Z=e.googTransmitBitrate,$=e.googRtt,Q=e.retransmittedPacketsSent,ee=e.encoderImplementation,te=e.jitter;"outbound-rtp"===i?(n.framesEncoded=a,n.bytesSent=d,c.bytes=d,n.framesSent=f,f>0&&l._firstFrameStarted["".concat(o,"-video")]&&(t.firstframeVideoReported=!0,aD.rtcFirstFrame({event_type:yk.SENT_END,media_type:s?Ek.SCREEN_VIDEO:Ek.VIDEO,type:Sk.PUBLISH,start:t.videoStart,event_session_id:o,result:!0}),delete l._firstFrameStarted["".concat(o,"-video")]),r.encodedFrameWidth=v,r.encodedFrameHeight=m,c.frame_size_height=m,c.frame_size_width=v,n.packetsSent=y,c.packets=y,c.nack_count=V,c.pli_count=j,c.qp_sum=G,c.ssrc=q,c.retransmitted_packets_sent=Q,c.encoder_implementation=ee):"remote-inbound-rtp"===i?(n.packetsLost=u,r.rtt=1e3*h,c.rtt=r.rtt,c.jitter=te,c.packets_lost=u):"codec"===i?(r.codecType=p,c.codec=p,r.inputFrameRate=g):"track"===i?n.totalSamplesReceived=_:"candidate-pair"===i?(c.ice_available_incoming_bitrate=C,c.ice_available_outgoing_bitrate=O,c.ice_bytes_received=w,c.ice_bytes_sent=d,c.ice_nominated=+N,c.ice_pair_id=k,c.ice_pair_rtt=D,c.ice_pair_state=P,c.ice_pair_writable=M,c.recv_ping_requests=z,c.recv_ping_responses=H,c.sent_ping_requests_before_first_response=Y,c.sent_ping_requests_total=Y+K,c.sent_ping_responses=X):"local-candidate"===i?(c.local_candidate_type=U,c.local_ip=L,c.local_network_type=x,c.local_port=B,c.protocol=F):"remote-candidate"===i?(c.remote_candidate_type=U,c.remote_ip=L,c.remote_port=B):"VideoBwe"===i?(c.actual_enc_bitrate=E,c.available_receive_bandwidth=S,c.available_send_bandwidth=b,c.bucket_delay=I,c.retransmit_bitrate=W,c.target_enc_bitrate=J,c.transmit_bitrate=Z):"ssrc"===i&&(c.video_network_elapse=$,c.avg_encode_ms=T,c.encode_usage_percent=A,c.frame_rate_input=R)})),(d=t.video).timestamp?(r.statsInterval=n.timestamp-d.timestamp,r.encodedFrameCount=n.framesSent-d.framesSent,r.sentKBitrate=(n.bytesSent-d.bytesSent||0)/r.statsInterval,c.bitrate=Math.round(8e3*r.sentKBitrate),c.bandwidth=Math.round(c.bitrate/1024),r.encoderOutputFrameRate=1e3*(n.framesEncoded-d.framesEncoded)/r.statsInterval,c.frame_rate_encoded=Math.round(r.encoderOutputFrameRate),r.sentFrameRate=1e3*(n.framesSent-d.framesSent)/r.statsInterval,c.frame_rate_sent=Math.round(r.sentFrameRate),r.videoLossRate=(n.packetsLost-d.packetsLost)/(n.packetsSent-d.packetsSent),r.videoLossRate=Number.isNaN(r.videoLossRate)?0:r.videoLossRate,c.fraction_lost=r.videoLossRate,t.video=n,aD.rtcMediaStatistics(c,{}),[2,r]):(t.video=n,[2,r])):[2,r]}}))}))},e.prototype.getDataChannelRTT=function(e){var t,r=this,n=nC();null===(t=this._client.sendUserMessage(e,"__web__rtc__rtt__"))||void 0===t||t.then((function(t){if("timeout"!==t){var i=Date.now()-n;i>0&&i<2e3&&(r.dataChannelRTT[e]=i)}else clearTimeout(r._rttTimer[e])})).catch((function(){clearTimeout(r._rttTimer[e])})),clearTimeout(this._rttTimer[e]),this._rttTimer[e]=setTimeout((function(){r.getDataChannelRTT(e)}),2e3)},e.prototype.destroy=function(){var e=this;Object.keys(this._localStreamStasEvtIntervals).forEach((function(t){clearInterval(e._localStreamStasEvtIntervals[t])})),Object.keys(this._remoteStreamStasEvtIntervals).forEach((function(t){clearInterval(e._remoteStreamStasEvtIntervals[t])})),Object.keys(this._rttTimer).forEach((function(t){clearTimeout(e._rttTimer[t])})),this._rttTimer={},this.dataChannelRTT={},this._videoInWaiting={}},e}(),pP=new DC("MediaServerClient",2);!function(e){e.DISCONNECTED="disconnected",e.DISCONNECTING="disconnecting",e.CONNECTED="connected",e.CONNECTING="connecting"}(fP||(fP={}));var _P=function(e,t){pP.print(e,"userId: %o, subAudio: %o, subVideo: %o, paused: %o, audioMid: %o, videoMid: %o, workaround_1_: %o, sequenceId: %o",t.userId,t.subAudio,t.subVideo,t.paused,t.audioMid,t.videoMid,t._workaround_1_,t.sequenceId)},vP=function(e){function t(){var t=e.call(this)||this;return t._ontrackCallbackMap=new Map,t._pubSubLock=new uP("pubSubLock"),t._joinLeaveLock=new uP("joinLeaveLock"),t._state=fP.DISCONNECTED,t._roomAttributes={multiChatMode:!1,bigRoomMode:!1},t}return Zn(t,e),t.prototype._addHandlerEvents=function(){var e,t=this;null===(e=this._handler)||void 0===e||e.once("disconnect",(function(){pP.print("emit ABNORMAL_DISCONNECTION ice"),t.safeEmit(tD.ABNORMAL_DISCONNECTION)}))},t.prototype._addSignalEventHandler=function(){var e,t=this;[eD.ON_ADD_STREAM,eD.ON_REMOVE_STREAM,eD.USER_CONNECTION,eD.USER_DISCONNECTION,eD.ON_UPDATE_STREAM_ATTRIBUTES,eD.ON_UPDATE_ROOM_ATTRIBUTES,eD.ON_PUSH_TRACK,eD.ON_REMOVE_TRACK,eD.NODE_CHANGE,eD.ON_CUSTOM_MESSAGE,eD.USER_MESSAGE_RECEIVED,eD.USER_BINARY_MESSAGE_RECEIVED,eD.POST_PROCESSING_MESSAGE].forEach((function(e){var r;null===(r=t._dataChannelSignal)||void 0===r||r.on(e,(function(r){t.safeEmit(e,r)}))})),null===(e=this._dataChannelSignal)||void 0===e||e.once("close",(function(){pP.print("emit ABNORMAL_DISCONNECTION datachannel"),t.safeEmit(tD.ABNORMAL_DISCONNECTION)}))},t.prototype._removeSignalEventHandler=function(){var e,t;null===(e=this._dataChannelSignal)||void 0===e||e.removeAllListeners(),null===(t=this._handler)||void 0===t||t.removeAllListeners()},Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._state},set:function(e){this._state!==e&&(this.safeEmit(tD.ON_CONNECTION_STATE_CHANGE,{prev:this._state,next:e}),this._state=e)},enumerable:!1,configurable:!0}),t.prototype.join=function(e,t,r,n){var i,o;return void 0===t&&(t={}),void 0===r&&(r=!1),ei(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,h,p=this;return ti(this,(function(_){switch(_.label){case 0:return pP.print("join()","info: %o, params: %o, reconnect: %o, controlMessage: %o",e,t,r,n),this._appId=e.appId,this._token=e.token,this._roomId=e.roomId,this._clientId=e.userInfo.userId,this._businessId=e.userInfo.businessId,this._userInfo=e.userInfo,this._sessionId=vR(),nD.setStats({rtc_session_id:this._sessionId}),this.connectionState=fP.CONNECTING,this._handler&&(this._removeSignalEventHandler(),this._handler.destroy()),t.node?(a=t.node,uD("es.join.nodeChange",t),[3,3]):[3,1];case 1:return Promise.resolve().then((function(){return p.emit("onGetIceConfigHook")})),this._iceConfigRequestManager=new SD,[4,null===(i=this._iceConfigRequestManager)||void 0===i?void 0:i.getAccessNode(this._appId,this._roomId,this._clientId,yD.getDeviceId(),null==t?void 0:t.reason,this._prevICENode)];case 2:if(!(a=_.sent()))throw uD("es.join.getNodeFailed",""),new dT(sT.ICE_SERVER_WRONG,"get ICE config failed");uD("es.join.getNodeSuccess",a),_.label=3;case 3:this._prevICENode=a,this._handler=new aP,this._addHandlerEvents(),this._statsReport=new hP(this,this._handler),Promise.resolve().then((function(){return p.emit("onEstablishConnectionHook")})),_.label=4;case 4:return _.trys.push([4,6,,7]),[4,this._handler.connect(a)];case 5:return s=_.sent(),pP.print("join","establish peerConnection success"),[3,7];case 6:throw c=_.sent(),this.connectionState=fP.DISCONNECTED,new dT(sT.ESTABLISH_DATACHANNEL_FAILED,"establish dataChannel failed",c);case 7:return this._dataChannelSignal=new _D({appId:this._appId,roomId:this._roomId,clientId:this._clientId,dataChannel:s}),this._addSignalEventHandler(),this._dataChannelSignal.sendPingMessage(),[4,null===(o=this._handler)||void 0===o?void 0:o.getDefaultSdp()];case 8:u=_.sent(),d={Authorization:oC.token2auth(this._appId,this._roomId,this._clientId,this._token),sessionId:this._sessionId,timestamp:Date.now(),controlMessage:n,userAttributes:{extra_info:this._userInfo.extraInfo,role:this._userInfo.role},params:{deviceType:"web",userAgent:window.navigator.userAgent,sdkVersion:NO.VERSION,deviceId:yD.getDeviceId(),appId:this._appId,roomId:this._roomId,userId:this._clientId,businessId:this._businessId},options:{enableUnBundleMode:!0},sdpInfo:u},Promise.resolve().then((function(){return p.emit("onSendingJoinMessageHook")})),_.label=9;case 9:return _.trys.push([9,11,,12]),l=r?"reconnected":"joinRoom",[4,this._dataChannelSignal.sendSignaling(l,d)];case 10:return f=_.sent(),pP.print("join","send join message success"),this._authorization=d.Authorization,this.connectionState=fP.CONNECTED,[2,f];case 11:if(h=_.sent(),this.connectionState=fP.DISCONNECTED,705===(null==h?void 0:h.code))throw new dT(sT.INVALID_TOKEN,(null==h?void 0:h.message)||"Invalid token");if(200!==(null==h?void 0:h.code))throw new dT(sT.JOIN_ROOM_FAILED,(null==h?void 0:h.message)||"Join room failed");return[3,12];case 12:return[2]}}))}))},t.prototype.publish=function(e){var t,r,n,i,o,a,s,c;return ei(this,void 0,void 0,(function(){var u,d,l,f,h,p,_,v,m,g,y;return ti(this,(function(E){switch(E.label){case 0:pP.print("publish()","localStream: %o",e),u=e.videoTrack,d=e.audioTrack,l=nC(),f="",h="",p="",E.label=1;case 1:return E.trys.push([1,5,,8]),[4,null===(t=this._handler)||void 0===t?void 0:t.publish(e)];case 2:if(!(_=E.sent()))throw new dT(sT.ADD_TRANSCEIVER_FAILED,"add transceiver failed");return f=_.audioMid,h=_.videoMid,p=_.sdp,e.pubAttributes={localaudio:!!d,localvideo:!!u,videostream:!!(null===(r=null==u?void 0:u.getTrack())||void 0===r?void 0:r.enabled),audiostream:!!(null===(n=null==d?void 0:d.getTrack())||void 0===n?void 0:n.enabled)},v={attributes:$n({videoDescriptions:_.videoDescriptions},e.pubAttributes),audio:!0,video:!0,screen:e.isScreen,audioMid:f,videoMid:h,sdpInfo:{msid:e.stream.id,type:_.type,sdp:_.partialSdp,semantics:_.semantics}},[4,null===(i=this._dataChannelSignal)||void 0===i?void 0:i.sendSignaling("publish",v)];case 3:if(200!==(null==(m=E.sent())?void 0:m.code))throw new dT(sT.PUBLISH_FAILED,(null==m?void 0:m.message)||"publish failed");return g=null===(o=null==m?void 0:m.relayMessage)||void 0===o?void 0:o.sdp,[4,null===(a=this._handler)||void 0===a?void 0:a.setAnswerSdp(_.sdp,g,void 0,e,dk.UP)];case 4:return E.sent(),e.streamId=m.streamId,e.videoMid=h,e.audioMid=f,aD.rtcPublishStat(hk.SUCCESS,pk.W_0,l,_k.UNKNOWN),null===(s=this._statsReport)||void 0===s||s.setLocalStreamStatsEvtInterval(e),[2];case 5:return(y=E.sent())instanceof Error&&aD.rtcPublishStat(hk.FAIL,pk.W_0,l,y.message),f&&h?[4,null===(c=this._handler)||void 0===c?void 0:c.rollback(p,[f,h])]:[3,7];case 6:E.sent(),E.label=7;case 7:throw y;case 8:return[2]}}))}))},t.prototype.updatePubTrack=function(e){var t,r,n,i,o,a;return ei(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b;return ti(this,(function(T){switch(T.label){case 0:pP.print("updatePubTrack()","localStream: %o",e),s=e.videoTrack,c=e.audioTrack,null===(t=e.videoTransceiver)||void 0===t||t.sender.replaceTrack((null==s?void 0:s.getTrack())||null),c?(u=c.mixType,d=c.mixedAudioTrack,l=null==c?void 0:c.getTrack(),d&&u!==ZD.PLAYOUT&&!0===l.enabled&&(l=d),null===(r=e.audioTransceiver)||void 0===r||r.sender.replaceTrack(l)):null===(n=e.audioTransceiver)||void 0===n||n.sender.replaceTrack(null),f={localaudio:!!c,localvideo:!!s,videostream:!!(null===(i=null==s?void 0:s.getTrack())||void 0===i?void 0:i.enabled),audiostream:!!(null===(o=null==c?void 0:c.getTrack())||void 0===o?void 0:o.enabled)},h={};try{for(p=ri(Object.entries(f)),_=p.next();!_.done;_=p.next())v=ni(_.value,2),m=v[0],(g=v[1])!==Reflect.get(e.pubAttributes,m)&&Reflect.set(h,m,g)}catch(e){S={error:e}}finally{try{_&&!_.done&&(b=p.return)&&b.call(p)}finally{if(S)throw S.error}}return Object.keys(h).length?(e.pubAttributes=f,y={roomId:this._roomId,streamId:e.streamId,attributes:h},[4,null===(a=this._dataChannelSignal)||void 0===a?void 0:a.sendSignaling("updateStreamAttributes",y)]):[2];case 1:if(200!==(null==(E=T.sent())?void 0:E.code))throw new dT(sT.UPDATE_TRACK_FAILED,(null==E?void 0:E.message)||"update track failed");return[2]}}))}))},t.prototype.unpublish=function(e){var t,r,n;return ei(this,void 0,void 0,(function(){var i,o;return ti(this,(function(a){switch(a.label){case 0:return pP.print("unpublish()","localStream: %o",e),i={roomId:this._roomId,initStreamId:e.initStreamId,streamId:e.streamId},[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unpublish",i)];case 1:if(200!==(null==(o=a.sent())?void 0:o.code))throw new dT(sT.UNPUBLISH_FAILED,(null==o?void 0:o.message)||"unpublish failed");return[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 2:return a.sent(),null===(n=this._statsReport)||void 0===n||n.unpublish(e),[2]}}))}))},t.prototype.subscribe=function(e,t,r){var n,i,o,a,s,c,u,d,l;return ei(this,void 0,void 0,(function(){var f,h,p,_,v,m,g,y,E,S,b,T,I,A,R,C,O,w,N,k;return ti(this,(function(D){switch(D.label){case 0:if(e.hasSubscribed)return[2,this._updateSubTrack(e,t,r)];pP.print("subscribe()","mediaType: %o, config: %o",t,r),_P("subscribe()",e),f=!1,h=!1,t===lO.VIDEO_ONLY?f=!0:t===lO.AUDIO_ONLY?h=!0:t===lO.AUDIO_AND_VIDEO?(f=!0,h=!0):t===lO.NONE&&(f=!1,h=!1),p=nC(),_=e.audioMid,v=e.videoMid,g=!1,D.label=1;case 1:return D.trys.push([1,12,,15]),_&&v?(g=!0,[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e,{audioMid:_,videoMid:v})]):[3,3];case 2:return m=D.sent(),[3,5];case 3:return[4,null===(i=this._handler)||void 0===i?void 0:i.subscribe(e)];case 4:if(!(m=D.sent()))throw new dT(sT.ADD_TRANSCEIVER_FAILED,"add transceiver failed");_=m.audioMid,v=m.videoMid,D.label=5;case 5:return y={audio:!this._multiChatMode(),video:!0,data:!0,screen:e.isScreen,browser:"chrome-stable",videoMid:v,audioMid:_,sdpInfo:{sdp:null==m?void 0:m.partialSdp,semantics:null==m?void 0:m.semantics,type:null==m?void 0:m.type},streamUserId:e.userId,streamId:e.streamId,config:{enableMediaType:{audio:!!this._multiChatMode()||h,video:f},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(o=this._dataChannelSignal)||void 0===o?void 0:o.sendSignaling("subscribe",y)];case 6:if(200!==(null==(E=D.sent())?void 0:E.code))throw new dT(sT.SUBSCRIBE_FAILED,(null==E?void 0:E.message)||"subscribe failed");return S=[],b=!this._multiChatMode(),!(_&&v)&&S.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new dT(sT.TIME_OUT,"wait video timeout for userId: ".concat(e.userId)))}),5e3);e.on("ontrack",(function r(i){"video"===i.mediaType&&(pP.print("remoteStream ".concat(e.userId," received video track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),b&&S.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new dT(sT.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),5e3);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(pP.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),T=function(t){e.ontrack(t)},null===(a=this._handler)||void 0===a||a.on("ontrack",T),this._ontrackCallbackMap.set(e,T),I=null==E?void 0:E.relayMessage,A=I.audioMid,R=I.videoMid,C=I.sequenceId,O=I.sdp,g&&_!==A?(pP.print("subscribe","mid mot match",_,A),[4,null===(s=this._handler)||void 0===s?void 0:s.closeMLine([_,v])]):[3,9];case 7:return D.sent(),[4,null===(c=this._handler)||void 0===c?void 0:c.subscribe(e)];case 8:if(!(m=D.sent()))throw new dT(sT.ADD_TRANSCEIVER_FAILED,"add transceiver failed");_=m.audioMid,v=m.videoMid,D.label=9;case 9:return(k={})[_]=A,k[v]=R,w=k,e.videoMid=R,e.audioMid=A,e.sequenceId=C,e.subConfig=r,e._workaround_1_=!1,e.paused=!1,e.subMediaType=t,e.hasSubscribed=!0,[4,null===(u=this._handler)||void 0===u?void 0:u.setAnswerSdp(null==m?void 0:m.sdp,O,w,e,dk.DOWN)];case 10:return D.sent(),[4,Promise.all(S)];case 11:return D.sent(),this._multiChatMode()||(e.subAudio=h),e.subVideo=f,aD.rtcSubscribeStat(vk.SUCCESS,p,mk.UNKNOWN,e.userId),null===(d=this._statsReport)||void 0===d||d.setRemoteStreamStatsEvtInterval(e),[2];case 12:return(N=D.sent())instanceof Error&&aD.rtcSubscribeStat(vk.FAIL,p,N.message,e.userId),_&&v?[4,null===(l=this._handler)||void 0===l?void 0:l.rollback(null==m?void 0:m.sdp,[_,v])]:[3,14];case 13:D.sent(),D.label=14;case 14:throw N;case 15:return[2]}}))}))},t.prototype.controlMessage=function(e){var t;return ei(this,void 0,void 0,(function(){return ti(this,(function(r){switch(r.label){case 0:return pP.print("controlMessage()","params: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("controlMessage",$n($n({},e),{roomId:this._roomId}))];case 1:return r.sent(),[2]}}))}))},t.prototype.updateUserAttributes=function(e){var t;return ei(this,void 0,void 0,(function(){return ti(this,(function(r){switch(r.label){case 0:return pP.print("updateUserAttributes()","attributes: %o",e),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("updateUserAttributes",{roomId:this._roomId,sessionId:this._sessionId,attributes:e})];case 1:return r.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){return ei(this,void 0,void 0,(function(){return ti(this,(function(n){return[2,this._updateSubTrack(e,t,r)]}))}))},t.prototype._updateSubTrack=function(e,t,r){var n;return ei(this,void 0,void 0,(function(){var i,o,a,s;return ti(this,(function(c){switch(c.label){case 0:return pP.print("updateSubTrack()","mediaType: %o, config: %o",t,r),_P("updateSubTrack()",e),i=!1,o=!1,t===lO.VIDEO_ONLY?(i=!0,o=!1):t===lO.AUDIO_ONLY?(o=!0,i=!1):t===lO.AUDIO_AND_VIDEO?(i=!0,o=!0):t===lO.NONE&&(i=!1,o=!1),a={roomId:this._roomId,streamList:[e.streamId],config:{enableMediaType:{video:i,audio:!!this._multiChatMode()||o},qualityLayer:{spatialLayer:r.videoIndex,temporalLayer:r.videoIndex}}},[4,null===(n=this._dataChannelSignal)||void 0===n?void 0:n.sendSignaling("updateSubscribe",a)];case 1:if(200!==(null==(s=c.sent())?void 0:s.code))throw new dT(sT.UPDATE_TRACK_FAILED,(null==s?void 0:s.message)||"update track failed");return e.paused=!i,this._multiChatMode()||(e.subAudio=o),e.subVideo=i,e.subMediaType=t,e.subConfig=r,[2,e]}}))}))},t.prototype.subscribe4pushTrack=function(e,t){var r,n,i,o,a;return ei(this,void 0,void 0,(function(){var s,c,u,d,l,f,h,p,_,v,m,g,y;return ti(this,(function(E){switch(E.label){case 0:if(pP.print("subscribe4pushTrack()","streamInfo: %o",t),_P("subscribe4pushTrack()",e),s=null==t?void 0:t.message,c=s.audioMid,u=s.videoMid,d=s.sequenceId,l=s.sdp,e.subAudio=!0,d<e.sequenceId)return pP.print("subscribe4pushTrack","sequenceId return",d,e.sequenceId),[2];f=e.audioMid,h=e.videoMid,E.label=1;case 1:return E.trys.push([1,8,,11]),f&&h?[4,null===(r=this._handler)||void 0===r?void 0:r.subscribe(e,{audioMid:f,videoMid:h})]:[3,3];case 2:return p=E.sent(),[3,5];case 3:return[4,null===(n=this._handler)||void 0===n?void 0:n.subscribe(e)];case 4:if(!(p=E.sent()))throw new dT(sT.ADD_TRANSCEIVER_FAILED,"add transceiver failed");f=p.audioMid,h=p.videoMid,E.label=5;case 5:return(y={})[f]=c,y[h]=u,_=y,pP.print("onpushtrack midmap",e.userId,_),e.audioMid=c,e.videoMid=u,e.sequenceId=d,v=[],e.audioTrack||v.push(new Promise((function(t,r){var n=setTimeout((function(){return r(new dT(sT.TIME_OUT,"wait audio timeout for userId: ".concat(e.userId)))}),5e3);e.on("ontrack",(function r(i){"audio"===i.mediaType&&(pP.print("remoteStream ".concat(e.userId," received audio track")),e.off("ontrack",r),clearTimeout(n),t(0))}))}))),m=function(t){e.ontrack(t)},null===(i=this._handler)||void 0===i||i.on("ontrack",m),this._ontrackCallbackMap.set(e,m),[4,null===(o=this._handler)||void 0===o?void 0:o.setAnswerSdp(null==p?void 0:p.sdp,l,_,e,dk.DOWN)];case 6:return E.sent(),[4,Promise.all(v)];case 7:return E.sent(),[2];case 8:return g=E.sent(),p?[4,null===(a=this._handler)||void 0===a?void 0:a.rollback(null==p?void 0:p.sdp,[f,h])]:[3,10];case 9:E.sent(),E.label=10;case 10:throw g;case 11:return[2]}}))}))},t.prototype.unsubscribe4removeTrack=function(e,t){var r;return ei(this,void 0,void 0,(function(){return ti(this,(function(n){switch(n.label){case 0:return _P("unsubscribe4removeTrack()",e),pP.print("unsubscribe4removeTrack()","sequenceId: ",t.sequenceId),t.sequenceId<e.sequenceId?(pP.print("unsubscribe4removeTrack()","sequenceId return"),[2]):(e.subAudio=!1,e.subVideo||e.paused?(e.sequenceId=t.sequenceId,[2]):[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])]);case 1:return n.sent(),pP.print("clean unsubscribe4removeTrack"),e.clean(),e.resetHasSubscribed(),[2]}}))}))},t.prototype.unsubscribe=function(e){var t,r,n;return ei(this,void 0,void 0,(function(){var i;return ti(this,(function(o){switch(o.label){case 0:_P("unsubscribe()",e),i={roomId:this._roomId,streamId:e.streamId,userId:e.userId},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("unsubscribe",i)];case 2:case 3:return o.sent(),[3,4];case 4:return e.hasSubscribed=!1,e.subVideo=!1,e.paused=!1,e._workaround_1_||(e.subAudio=!1),e.subAudio?[3,6]:[4,null===(r=this._handler)||void 0===r?void 0:r.closeMLine([e.videoMid||"",e.audioMid||""])];case 5:o.sent(),pP.print("unsubscribe","clean unsub ".concat(e.userId)),e.clean(),e.resetHasSubscribed(),this.removeOnTrackListener(e),null===(n=this._statsReport)||void 0===n||n.unsubscribe(e),o.label=6;case 6:return[2]}}))}))},t.prototype.removeOnTrackListener=function(e){var t,r=this._ontrackCallbackMap.get(e);r&&(null===(t=this._handler)||void 0===t||t.off("ontrack",r),this._ontrackCallbackMap.delete(e))},t.prototype.handleRemoveStream=function(e,t){return ei(this,void 0,void 0,(function(){return ti(this,(function(r){return _P("handleRemoveStream()",e),e.subVideo=!1,t.message&&t.message!==Qk.videoMuted?e._workaround_1_=!1:e._workaround_1_=!0,this.unsubscribe(e),[2]}))}))},t.prototype.leave=function(){var e;return ei(this,void 0,void 0,(function(){var t,r;return ti(this,(function(n){switch(n.label){case 0:return pP.print("leave()"),(this.connectionState=fP.CONNECTED)?(this.connectionState=fP.DISCONNECTING,t={Authorization:this._authorization,roomId:this._roomId,sessionId:this._sessionId},[4,this._joinLeaveLock.lock()]):[3,7];case 1:r=n.sent(),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,null===(e=this._dataChannelSignal)||void 0===e?void 0:e.sendSignaling("leaveRoom",t)];case 3:case 4:return n.sent(),[3,6];case 5:return r(),[7];case 6:return[3,8];case 7:return[2,Promise.resolve()];case 8:return[2]}}))}))},t.prototype.destroy=function(){var e,t,r,n;pP.print("destroy()"),this._token=void 0,this._appId=void 0,this._roomId=void 0,this._clientId=void 0,this._authorization=void 0,this._sessionId=void 0,null===(e=this._handler)||void 0===e||e.destroy(),null===(t=this._dataChannelSignal)||void 0===t||t.destroy(),null===(r=this._iceConfigRequestManager)||void 0===r||r.abort(),this._handler=void 0,this._dataChannelSignal=void 0,this._iceConfigRequestManager=void 0,this._removeSignalEventHandler(),null===(n=this._statsReport)||void 0===n||n.destroy(),this.connectionState=fP.DISCONNECTED,this.emit("INTERRUPT")},t.prototype.sendUserMessage=function(e,t){var r;return null===(r=this._dataChannelSignal)||void 0===r?void 0:r.sendP2PMessage(e,t)},t.prototype.sendRoomMessage=function(e){var t;return null===(t=this._dataChannelSignal)||void 0===t?void 0:t.sendSignaling("customMessage",e)},t.prototype._multiChatMode=function(){var e;return null===(e=this._roomAttributes)||void 0===e?void 0:e.multiChatMode},Object.defineProperty(t.prototype,"handler",{get:function(){return this._handler},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomAttributes",{set:function(e){this._roomAttributes=e},enumerable:!1,configurable:!0}),Qn([yP],t.prototype,"join",null),Qn([gP,mP],t.prototype,"publish",null),Qn([gP,mP],t.prototype,"updatePubTrack",null),Qn([gP,mP],t.prototype,"unpublish",null),Qn([gP,mP],t.prototype,"subscribe",null),Qn([mP],t.prototype,"controlMessage",null),Qn([mP],t.prototype,"updateUserAttributes",null),Qn([gP,mP],t.prototype,"updateSubTrack",null),Qn([gP,mP],t.prototype,"subscribe4pushTrack",null),Qn([gP,mP],t.prototype,"unsubscribe4removeTrack",null),Qn([gP,mP],t.prototype,"unsubscribe",null),Qn([gP,mP],t.prototype,"handleRemoveStream",null),t}(MC);function mP(e,t,r){var n=r.value;return r.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return ei(this,void 0,void 0,(function(){return ti(this,(function(r){switch(r.label){case 0:return this._handler&&this._state===fP.CONNECTED?[4,n.apply(this,e)]:[3,2];case 1:return r.sent(),[3,3];case 2:throw new dT(sT.NOT_CONNECTED_YET,"error in ".concat(t,": try again after joined"));case 3:return[2]}}))}))},r}function gP(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ei(this,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:return[4,this._pubSubLock.lock()];case 1:t=r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,n.apply(this,e)];case 3:return[2,r.sent()];case 4:return t(),[7];case 5:return[2]}}))}))},r}function yP(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ei(this,void 0,void 0,(function(){var t,r=this;return ti(this,(function(i){return t=!1,[2,new Promise((function(i,o){return ei(r,void 0,void 0,(function(){var r,a;return ti(this,(function(s){switch(s.label){case 0:this.on("INTERRUPT",(function(){t=!0,o(new dT(sT.OPERATION_CANCEL,"operation not finish when leave"))})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,n.apply(this,e)];case 2:return r=s.sent(),i(r),[3,4];case 3:return a=s.sent(),t||o(a),[3,4];case 4:return[2]}}))}))}))]}))}))},r}var EP=T,SP=cu,bP=es.exports.getWeakData,TP=kt,IP=F,AP=Lc,RP=Pc,CP=Ue,OP=br.set,wP=br.getterFor,NP=pl.find,kP=pl.findIndex,DP=EP([].splice),PP=0,MP=function(e){return e.frozen||(e.frozen=new UP)},UP=function(){this.entries=[]},LP=function(e,t){return NP(e.entries,(function(e){return e[0]===t}))};UP.prototype={get:function(e){var t=LP(this,e);if(t)return t[1]},has:function(e){return!!LP(this,e)},set:function(e,t){var r=LP(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=kP(this.entries,(function(t){return t[0]===e}));return~t&&DP(this.entries,t,1),!!~t}};var xP,BP={getConstructor:function(e,t,r,n){var i=e((function(e,i){AP(e,o),OP(e,{type:t,id:PP++,frozen:void 0}),null!=i&&RP(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=wP(t),s=function(e,t,r){var n=a(e),i=bP(TP(t),!0);return!0===i?MP(n).set(t,r):i[n.id]=r,e};return SP(o,{delete:function(e){var t=a(this);if(!IP(e))return!1;var r=bP(e);return!0===r?MP(t).delete(e):r&&CP(r,t.id)&&delete r[t.id]},has:function(e){var t=a(this);if(!IP(e))return!1;var r=bP(e);return!0===r?MP(t).has(e):r&&CP(r,t.id)}}),SP(o,r?{get:function(e){var t=a(this);if(IP(e)){var r=bP(e);return!0===r?MP(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}},VP=n,jP=T,FP=cu,GP=es.exports,zP=au,HP=BP,WP=F,YP=Ts,KP=br.enforce,XP=er,qP=!VP.ActiveXObject&&"ActiveXObject"in VP,JP=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},ZP=zP("WeakMap",JP,HP);if(XP&&qP){xP=HP.getConstructor(JP,"WeakMap",!0),GP.enable();var $P=ZP.prototype,QP=jP($P.delete),eM=jP($P.has),tM=jP($P.get),rM=jP($P.set);FP($P,{delete:function(e){if(WP(e)&&!YP(e)){var t=KP(this);return t.frozen||(t.frozen=new xP),QP(this,e)||t.frozen.delete(e)}return QP(this,e)},has:function(e){if(WP(e)&&!YP(e)){var t=KP(this);return t.frozen||(t.frozen=new xP),eM(this,e)||t.frozen.has(e)}return eM(this,e)},get:function(e){if(WP(e)&&!YP(e)){var t=KP(this);return t.frozen||(t.frozen=new xP),eM(this,e)?tM(this,e):t.frozen.get(e)}return tM(this,e)},set:function(e,t){if(WP(e)&&!YP(e)){var r=KP(this);r.frozen||(r.frozen=new xP),eM(this,e)?rM(this,e,t):r.frozen.set(e,t)}else rM(this,e,t);return this}})}var nM=new(function(e){function t(){var t=e.call(this)||this;return t._hasVideoPermission=!1,t._hasAudioPermission=!1,t.inited=!1,t.deviceMap=new Map,t._handleDeviceChange=t._handleDeviceChange.bind(t),t.refreshDevices(),t}return Zn(t,e),t.prototype.refreshDevices=function(){return ei(this,void 0,void 0,(function(){var e=this;return ti(this,(function(t){switch(t.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return t.sent().filter((function(e){return""!==e.deviceId})).forEach((function(t){e.deviceMap.set(t.deviceId,{deviceName:t.label,deviceInfo:t,deviceId:t.deviceId,deviceType:t.kind,deviceState:"active"})})),this.inited||this.initListener(),this.inited=!0,[2]}}))}))},t.prototype.initListener=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){return navigator.mediaDevices.addEventListener("devicechange",this._handleDeviceChange),[2]}))}))},t.prototype._handleDeviceChange=function(){return ei(this,void 0,void 0,(function(){var e,t,r=this;return ti(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:return e=n.sent(),t=Array.from(this.deviceMap.values()),e.forEach((function(e){var t=r.deviceMap.get(e.deviceId);r.deviceMap.set(e.deviceId,{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"}),t&&"inactive"!==t.deviceState||r.emit("onMediaDeviceStateChanged",{deviceName:e.label,deviceType:e.kind,deviceId:e.deviceId,deviceInfo:e,deviceState:"active"})})),t.forEach((function(t){e.find((function(e){return e.deviceId===t.deviceId}))||(t.deviceState="inactive",r.deviceMap.delete(t.deviceId),r.emit(sC.onMediaDeviceStateChanged,t))})),[2]}}))}))},t.prototype.getVideoPermission=function(){return ei(this,void 0,void 0,(function(){var e=this;return ti(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new dT(sT.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasVideoPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasVideoPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasVideoPermission]}}))}))},t.prototype.getAudioPermission=function(){return ei(this,void 0,void 0,(function(){var e=this;return ti(this,(function(t){switch(t.label){case 0:if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new dT(sT.NOT_SUPPORTED,"GetUserMedia not supported");if(this.hasAudioPermission)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){t&&(t.getTracks().forEach((function(e){return e.stop()})),e.hasAudioPermission=!0,e.inited||e.refreshDevices())}))];case 2:case 3:return t.sent(),[3,4];case 4:return[2,this.hasAudioPermission]}}))}))},t.prototype.getDevices=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.getAudioPermission()];case 1:case 2:return e.sent(),[3,3];case 3:return e.trys.push([3,5,,6]),[4,this.getVideoPermission()];case 4:case 5:return e.sent(),[3,6];case 6:return[4,this.refreshDevices()];case 7:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState}))]}}))}))},t.prototype.getMicrophones=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return[4,this.refreshDevices()];case 1:return e.sent(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audioinput"===e.deviceType}))]}}))}))},t.prototype.getCameras=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"videoinput"===e.deviceType}))]}))}))},t.prototype.getAudioPlayback=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){return this.refreshDevices(),[2,Array.from(this.deviceMap.values()).filter((function(e){return"active"===e.deviceState})).filter((function(e){return"audiooutput"===e.deviceType}))]}))}))},t.prototype.getDeviceById=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return[4,this.getDevices()];case 1:return[2,t.sent().find((function(t){return t.deviceId===e}))]}}))}))},Object.defineProperty(t.prototype,"hasAudioPermission",{get:function(){return this._hasAudioPermission},set:function(e){if(!e)throw new dT(sT.NO_PERMISSION,"Cannot revoke audio permission");this.refreshDevices(),this._hasAudioPermission=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVideoPermission",{get:function(){return this._hasVideoPermission},set:function(e){if(!e)throw new dT(sT.NO_PERMISSION,"Cannot revoke Video permission");this.inited||this.refreshDevices(),this._hasVideoPermission=!0},enumerable:!1,configurable:!0}),t}(MC)),iM=window.AudioContext||window.webkitAudioContext,oM=function(){function e(){}return e.prototype.getAudioContextInstance=function(){return this._audioContextInstance||(this._audioContextInstance=new iM),this._audioContextInstance},e}(),aM=function(){function e(e){var t=sM.getAudioContextInstance();this._track=e;var r=new MediaStream;r.addTrack(e);var n=t.createMediaStreamSource(r),i=t.createAnalyser();n.connect(i),this._analyserNode=i}return e.prototype.getAudioLevel=function(){var e=new Uint8Array(2048);this._analyserNode.getByteTimeDomainData(e);var t=0;return e.forEach((function(e){return t=Math.max(t,Math.abs(e-128))})),t/128*255},e}(),sM=new oM,cM=new DC("VERTC",0),uM=new WeakMap,dM=function(e){return uM.get(e)},lM=function(e){function t(t,r){var n=e.call(this)||this;return n._trackId=t,n.mediaType=r,n}return Zn(t,e),t.prototype.getId=function(){return this._trackId},t}(MC),fM=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i._initListeners(),i}return Zn(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t.prototype.close=function(){var e;return null===(e=this._mediaTrack)||void 0===e?void 0:e.stop()},t.prototype._initListeners=function(){var e=this;this._mediaTrack instanceof MediaStreamTrack&&this._mediaTrack.addEventListener("ended",(function(){aD.rtcError("track-ended mediaType: ".concat(e._mediaTrack.kind),-1001),e.emit("track-ended",e)}))},t}(lM),hM=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i._mediaTrack=t,i}return Zn(t,e),t.prototype.getTrack=function(){return this._mediaTrack},t}(lM),pM=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return Zn(t,e),t.prototype.updateVideoCaptureConfig=function(){var e;return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return this.videoCaptureConfig?(cM.print("updateVideoEncoderConfig","update localVideoTrack: ",this.videoCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.videoCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(fM),_M=function(e){function t(t,r){var n=e.call(this,t,r,"audio")||this;return n.mixType=ZD.PLAYOUT_AND_PUBLISH,n}return Zn(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new aM(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t.prototype.updateAudioCaptureConfig=function(){var e;return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return this.audioCaptureConfig?(cM.print("updateAudioCaptureConfig","update localAudioTrack: ",this.audioCaptureConfig),[4,null===(e=this.getTrack())||void 0===e?void 0:e.applyConstraints(this.audioCaptureConfig)]):[2];case 1:return t.sent(),[2]}}))}))},t}(fM),vM=function(e){function t(t,r){return e.call(this,t,r,"video")||this}return Zn(t,e),t}(hM),mM=function(e){function t(t,r){return e.call(this,t,r,"audio")||this}return Zn(t,e),t.prototype.getAudioLevel=function(){return this._audioLevelFetcher||(this._audioLevelFetcher=new aM(this.getTrack())),this._audioLevelFetcher.getAudioLevel()},t}(hM),gM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(_M),yM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(pM),EM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(pM),SM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(_M),bM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(pM),TM=function(e){function t(t,r){return e.call(this,t,r)||this}return Zn(t,e),t}(_M);function IM(e){var t;return ei(this,void 0,void 0,(function(){var r,n,i,o,a,s;return ti(this,(function(c){switch(c.label){case 0:n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",c.label=1;case 1:return c.trys.push([1,3,,4]),cM.print("createCameraVideoTrack","constraints:",e),aD.rtcVideoCaptureEvent({event_type:kk.START,media_device_id:n}),i=nC(),[4,navigator.mediaDevices.getUserMedia({video:e})];case 2:return r=c.sent(),aD.rtcVideoCaptureEvent({event_type:kk.START_CAPTURE_RESULT,media_device_id:n,reason:Pk.SUCCESS,elapse:nC()-i}),nM.hasVideoPermission=!0,[3,4];case 3:throw o=c.sent(),aD.rtcVideoCaptureEvent({event_type:kk.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new dT(sT.GET_VIDEO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getVideoTracks()[0],uM.set(a,r),(s=new yM(a,rC())).videoCaptureConfig=e,[2,s]}}))}))}function AM(e){var t;return ei(this,void 0,void 0,(function(){var r,n,i,o,a;return ti(this,(function(s){switch(s.label){case 0:cM.print("createCameraVideoTrack","constraints:",e),n=(null===(t=null==e?void 0:e.deviceId)||void 0===t?void 0:t.exact)||"default",s.label=1;case 1:return s.trys.push([1,3,,4]),aD.rtcVideoCaptureEvent({event_type:kk.START,media_device_id:n}),i=nC(),[4,navigator.mediaDevices.getUserMedia({audio:e})];case 2:return r=s.sent(),aD.rtcVideoCaptureEvent({event_type:kk.START_CAPTURE_RESULT,media_device_id:n,reason:Pk.SUCCESS,elapse:nC()-i}),nM.hasAudioPermission=!0,[3,4];case 3:throw o=s.sent(),aD.rtcVideoCaptureEvent({event_type:kk.RUNNING_FAILED,media_device_id:n,error_code:o.code,reason:JSON.stringify(o)}),new dT(sT.GET_AUDIO_TRACK_FAILED,"throw error from getUserMedia",o);case 4:return a=r.getAudioTracks()[0],uM.set(a,r),[2,new gM(a,rC())]}}))}))}function RM(e){return void 0===e&&(e=!1),ei(this,void 0,void 0,(function(){var t,r,n;return ti(this,(function(i){switch(i.label){case 0:cM.print("createScreenStream","withAudio:",e),i.label=1;case 1:return i.trys.push([1,3,,4]),aD.rtcVideoCaptureEvent({event_type:kk.START,media_device_id:"screen"}),r=nC(),[4,navigator.mediaDevices.getDisplayMedia({video:!0,audio:e})];case 2:return t=i.sent(),aD.rtcVideoCaptureEvent({event_type:kk.START_CAPTURE_RESULT,media_device_id:"screen",reason:Pk.SUCCESS,elapse:nC()-r}),[3,4];case 3:throw n=i.sent(),aD.rtcVideoCaptureEvent({event_type:kk.RUNNING_FAILED,media_device_id:"screen",error_code:n.code,reason:JSON.stringify(n)}),new dT(sT.GET_SCREEN_TRACK_FAILED,"throw error from getDisplayMedia",n);case 4:return[2,t]}}))}))}var CM,OM,wM=function(){function e(){}return e.getNalunits=function(t){if(t.length-t.position<4)return[];var r=t.position;return 1===t.getInt32(r)||0===t.getInt16(r)&&1===t.getInt8(r+2)?e.getAnnexbNals(t):e.getAvccNals(t)},e.getAnnexbNals=function(t){for(var r=[],n=e.getHeaderPositionAnnexB(t),i=n.pos,o=i;i<t.length-4;){var a=new Uint8Array(t.buffer.slice(i,i+n.headerLength));n.pos===t.position&&t.skip(n.headerLength),o=(n=e.getHeaderPositionAnnexB(t)).pos;var s={header:a,body:new Uint8Array(t.buffer.slice(i+a.byteLength,o)),type:-1};e.analyseNal(s),s.type<=9&&0!==s.type&&r.push(s),t.skip(o-t.position),i=o}return r},e.getAvccNals=function(t){for(var r=[];t.position<t.length-4;){var n=t.getInt32(t.position);if(!(t.length-t.position>=n))break;var i=new Uint8Array(t.buffer.slice(t.position,t.position+4));t.skip(4);var o=new Uint8Array(t.buffer.slice(t.position,t.position+n));t.skip(n);var a={header:i,body:o,type:-1};e.analyseNal(a),a.type<=9&&0!==a.type&&r.push(a)}return r},e.analyseNal=function(e){var t=31&e.body[0];switch(e.type=t,t){case 1:e.ndr=!0;break;case 5:e.idr=!0;break;case 6:e.sei=!0;break;case 7:e.sps=!0;break;case 8:e.pps=!0}},e.getHeaderPositionAnnexB=function(e){for(var t=e.position,r=0,n=e.length;3!==r&&4!==r&&t<n-4;)0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:1===e.getInt8(t+2)?r=3:t++:t++;return t===n-4&&(0===e.getInt16(t)?1===e.getInt16(t+2)?r=4:t=n:(t++,0===e.getInt16(t)&&1===e.getInt8(t)?r=3:t=n)),{pos:t,headerLength:r}},e.getAvcc=function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength+11);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var n=6;return r.set(new Uint8Array([e.byteLength>>>8&255,255&e.byteLength]),n),n+=2,r.set(e,n),r[n+=e.byteLength]=1,n++,r.set(new Uint8Array([t.byteLength>>>8&255,255&t.byteLength]),n),n+=2,r.set(t,n),r},e}(),NM=function(){function e(e){this._position=0,this._dataview=new DataView(e)}return Object.defineProperty(e.prototype,"length",{get:function(){return this.buffer.byteLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._dataview.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!1,configurable:!0}),e.prototype.back=function(e){this.position-=e},e.prototype.getUint8=function(e){return this._dataview.getUint8(e)},e.prototype.getInt8=function(e){return this._dataview.getInt8(e)},e.prototype.getInt16=function(e){return this._dataview.getInt16(e)},e.prototype.getUint16=function(e){return this._dataview.getUint16(e)},e.prototype.getUint32=function(e){return this._dataview.getUint32(e)},e.prototype.getInt32=function(e){return this._dataview.getInt32(e)},e.prototype.skip=function(t){for(var r=Math.floor(t/4),n=t%4,i=0;i<r;i++)e.readByte(this,4);n>0&&e.readByte(this,n)},e.readByte=function(e,t,r){var n;switch(t){case 1:n=r?e.getInt8(e.position):e.getUint8(e.position);break;case 2:n=r?e.getInt16(e.position):e.getUint16(e.position);break;case 3:if(r)throw new Error("not supported for readByte 3");n=e.getUint8(e.position)<<16,n|=e.getUint8(e.position+1)<<8,n|=e.getUint8(e.position+2);break;case 4:n=r?e.getInt32(e.position):e.getUint32(e.position);break;case 8:if(r)throw new Error("not supported for readBody 8");n=e.getUint32(e.position)<<32,n|=e.getUint32(e.position+4);break;default:n=""}return e.position+=t,n},e.prototype.readUint8=function(){return e.readByte(this,1)},e.prototype.readUint16=function(){return e.readByte(this,2)},e.prototype.readUint24=function(){return e.readByte(this,3)},e.prototype.readUint32=function(){return e.readByte(this,4)},e.prototype.readUint64=function(){return e.readByte(this,8)},e.prototype.readInt8=function(){return e.readByte(this,1,!0)},e.prototype.readInt16=function(){return e.readByte(this,2,!0)},e.prototype.readInt32=function(){return e.readByte(this,4,!0)},e.prototype.writeUint32=function(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])},e}(),kM=new DC("Stream",0),DM=function(){function e(){this.isScreen=!1,this.seiList=[],this.stream=new MediaStream,this.pubAttributes={localaudio:!1,localvideo:!1,videostream:!1,audiostream:!1}}return Object.defineProperty(e.prototype,"hasPublished",{get:function(){return this.videoTransceiver&&this.audioTransceiver},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmptyStream",{get:function(){return!this.audioTrack&&!this.videoTrack},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initStreamId",{get:function(){return this.stream.id},enumerable:!1,configurable:!0}),e.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.sender){var t=this.videoTransceiver.sender;if(rP()){var r=t.createEncodedStreams(),n=r.readable,i=r.writable,o=new TransformStream({transform:function(t,r){var n=e.seiList[0];if(n){var i=new Uint8Array(n.content.byteLength+5);i.set([0,0,0,1,6]),i.set(n.content,5);var o=new Uint8Array(i.byteLength+t.data.byteLength);0===n.repeatCount&&e.seiList.splice(0,1),n.repeatCount--,o.set(new Uint8Array(t.data)),o.set(i,t.data.byteLength),t.data=o.buffer,r.enqueue(t)}else r.enqueue(t)}});n.pipeThrough(o).pipeTo(i)}}else kM.print("no sender found when trying to bind encodedTransform")},e.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.sender){var e=this.audioTransceiver.sender.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else kM.print("no sender found when trying to bind encodedTransform")},e.prototype.clean=function(){this.audioMid=void 0,this.videoMid=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0},e.prototype.updateVideoBitrate=function(e){var t,r=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.maxKbps;if("number"==typeof r&&r&&this.videoTransceiver){var n=this.videoTransceiver.sender,i=n.getParameters();i.encodings&&0!==i.encodings.length||(i.encodings=[{}]),i.encodings[0].maxBitrate=1e3*r,kM.print("updateVideoBitrate","set sendEncodings: ",i),n.setParameters(i)}},e.prototype.switchTrackEnableState=function(e,t){var r;"audio"===e?r=this.audioTrack:"video"===e&&(r=this.videoTrack);var n=null==r?void 0:r.getTrack();return!(!n||(null==n?void 0:n.enabled)===t)&&(n.enabled=t,!0)},e}(),PM=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.userId=t,o.isScreen=n,o.streamId=r,o.hasAudio=i.localaudio,o.hasVideo=i.localvideo,o._attributes=i,o.subVideo=!1,o.subAudio=!1,o._sequenceId=0,o.subMediaType=lO.NONE,o.recordedVideoFrames=[],o.subConfig={videoIndex:0},o.hasSubscribed=!1,o}return Zn(t,e),Object.defineProperty(t.prototype,"sequenceId",{get:function(){return this._sequenceId||-1},set:function(e){"number"==typeof e&&(this._sequenceId=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){return this._attributes},set:function(e){this.hasVideo=e.localvideo,this.hasAudio=e.localaudio,this._attributes=e},enumerable:!1,configurable:!0}),t.prototype.initVideoEncodedTransform=function(){var e=this;if(this.videoTransceiver&&this.videoTransceiver.receiver){var t=this.videoTransceiver.receiver.createEncodedStreams(),r=t.readable,n=t.writable;r.pipeThrough(new TransformStream({transform:function(t,r){var n=wM.getNalunits(new NM(t.data)).find((function(e){return e.sei}));n&&e.safeEmit("onSEIMessage",n.body.slice(1)),r.enqueue(t)}})).pipeTo(n)}else kM.print("no receiver found when trying to bind encodedTransform")},t.prototype.initAudioEncodedTransform=function(){if(this.audioTransceiver&&this.audioTransceiver.receiver){var e=this.audioTransceiver.receiver.createEncodedStreams(),t=e.readable,r=e.writable;t.pipeThrough(new TransformStream({transform:function(e,t){t.enqueue(e)}})).pipeTo(r)}else kM.print("no receiver found when trying to bind encodedTransform")},t.prototype.ontrack=function(e){var t,r,n;if((null===(r=null===(t=e.streams)||void 0===t?void 0:t[0])||void 0===r?void 0:r.id)===this.streamId){var i=e.track;"video"===(null==i?void 0:i.kind)?this._setVideoTrack(i):"audio"===(null===(n=e.track)||void 0===n?void 0:n.kind)&&this._setAudioTrack(i),this._setStream(e.streams[0])}this.safeEmit("ontrack",e)},t.prototype.clean=function(){kM.print("clean","exec stream.clean ".concat(this.streamId," ").concat(this.userId)),this.subAudio=!1,this.subVideo=!1,this.audioMid=void 0,this.videoMid=void 0,this.sequenceId=0,this.videoTrack=void 0,this.audioTrack=void 0,this.stream=void 0,this.videoTransceiver=void 0,this.audioTransceiver=void 0,this.recordedVideoFrames=[],this.paused=!1,this._workaround_1_=!1},t.prototype.resetHasSubscribed=function(){this.hasSubscribed=!1},t.prototype._setStream=function(e){var t=this;this.stream=e,e.onaddtrack=function(e){"video"===e.track.kind?t._setVideoTrack(e.track):"audio"===e.track.kind&&t._setAudioTrack(e.track)}},t.prototype._setAudioTrack=function(e){var t,r;(null===(r=null===(t=this.audioTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.audioTrack=new mM(e,rC()),this.emit("ontrack",this.audioTrack))},t.prototype._setVideoTrack=function(e){var t,r;(null===(r=null===(t=this.videoTrack)||void 0===t?void 0:t.getTrack())||void 0===r?void 0:r.id)!==(null==e?void 0:e.id)&&(this.videoTrack=new vM(e,rC()),this.emit("ontrack",this.videoTrack))},t}(MC);!function(e){e[e.CHANNEL_PROFILE_COMMUNICATION=0]="CHANNEL_PROFILE_COMMUNICATION",e[e.CHANNEL_PROFILE_LIVE_BROADCASTING=1]="CHANNEL_PROFILE_LIVE_BROADCASTING"}(CM||(CM={})),function(e){e.RESUBSCRIBE="resubscribe",e.STREAM_FAILED="stream_failed",e.SUBSCRIBE_PUSH_TRACK="subscribe_push_track",e.REMOVE_PUSH_TRACK="remove_push_track",e.VIDEO_FIRST_FRAME="video_first_frame",e.ON_USER_MUTE_AUDIO="on_user_mute_audio",e.ON_USER_MUTE_VIDEO="on_user_mute_video",e.ON_USER_START_AUDIO_CAPTURE="on_user_start_audio_capture",e.ON_USER_STOP_AUDIO_CAPTURE="on_user_stop_audio_capture",e.ON_USER_START_VIDEO_CAPTURE="on_user_start_video_capture",e.ON_USER_STOP_VIDEO_CAPTURE="on_user_stop_video_capture",e.ON_SEI_MESSAGED_RECEIVED="on_sei_messaged_received",e.ON_PUBLISH_RESULT="on_publish_result"}(OM||(OM={}));var MM,UM,LM=new DC("Room",1),xM=function(e){function t(t){var r=e.call(this)||this;return r._remoteUsers=new Map,r._remoteStreams=new Map,r._roomConfig=t,r._mediaServerClient=new vP,r._addHandlerEventHandler(),r._isReconnecting=!1,r}return Zn(t,e),Object.defineProperty(t.prototype,"hasScreenPublished",{get:function(){var e;return null===(e=this._localScreenStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublished",{get:function(){var e;return null===(e=this._localStream)||void 0===e?void 0:e.hasPublished},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){return this._mediaServerClient.connectionState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteUsers",{get:function(){return this._remoteUsers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteStreams",{get:function(){return this._remoteStreams},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localStream",{get:function(){return this._localStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localScreenStream",{get:function(){return this._localScreenStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomInfo",{get:function(){return this._roomInfo},enumerable:!1,configurable:!0}),t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m=this;null===(e=this._mediaServerClient)||void 0===e||e.on(eD.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._mediaServerClient)||void 0===t||t.on(eD.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._mediaServerClient)||void 0===r||r.on(eD.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._mediaServerClient)||void 0===n||n.on(eD.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._mediaServerClient)||void 0===i||i.on(eD.ON_UPDATE_ROOM_ATTRIBUTES,this._onUpdateRoomAttributes.bind(this)),null===(o=this._mediaServerClient)||void 0===o||o.on(eD.ON_UPDATE_STREAM_ATTRIBUTES,this._onUpdateStreamAttributes.bind(this)),null===(a=this._mediaServerClient)||void 0===a||a.on(eD.ON_PUSH_TRACK,this._onPushTrack.bind(this)),null===(s=this._mediaServerClient)||void 0===s||s.on(eD.ON_REMOVE_TRACK,this._onRemoveTrack.bind(this)),null===(c=this._mediaServerClient)||void 0===c||c.on(eD.NODE_CHANGE,this._nodeChange.bind(this)),null===(u=this._mediaServerClient)||void 0===u||u.on(eD.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(d=this._mediaServerClient)||void 0===d||d.on(eD.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(l=this._mediaServerClient)||void 0===l||l.on(eD.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(f=this._mediaServerClient)||void 0===f||f.on(eD.POST_PROCESSING_MESSAGE,this._onPostProcessingMessage.bind(this)),null===(h=this._mediaServerClient)||void 0===h||h.on(tD.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(p=this._mediaServerClient)||void 0===p||p.on(tD.ABNORMAL_DISCONNECTION,this._handleAbnormalDisconnection.bind(this)),null===(_=this._mediaServerClient)||void 0===_||_.on("onRemoteStreamStats",(function(e){m.emit("onRemoteStreamStats",e)})),null===(v=this._mediaServerClient)||void 0===v||v.on("onLocalStreamStats",(function(e){m.emit("onLocalStreamStats",e)}))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._mediaServerClient)||void 0===e||e.removeAllListeners()},t.prototype.join=function(e,t,r,n,i){return ei(this,void 0,void 0,(function(){var o=this;return ti(this,(function(a){return nD.setStats({rtc_app_id:e,room_id:t,user_id:n.userId}),LM.print("join()"),[2,new Promise((function(a,s){return ei(o,void 0,void 0,(function(){var o;return ti(this,(function(c){return this._joinResolveCallback=a,this._joinRejectCallback=s,this._controlMessage=i,this._roomInfo={appId:e,roomId:t,token:r,userInfo:n},o=nC(),aD.joinRoom(Ak.BEGIN,o,!1,""),this._join((function(e){aD.joinRoom(Ak.END,o,!0,e.message),a(e)}),(function(e){aD.joinRoom(Ak.END,o,!1,e.message),s(e)})),[2]}))}))}))]}))}))},t.prototype._join=function(e,t,r){var n;return void 0===r&&(r=!1),ei(this,void 0,void 0,(function(){var i,o,a;return ti(this,(function(s){switch(s.label){case 0:i=nC(),LM.print("_join()"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._mediaServerClient.join(this._roomInfo,{node:this._getAccessNode,reason:this._getAccessFeedback},r,this._controlMessage)];case 2:return o=s.sent(),this._mediaServerClient.roomAttributes=o.roomAttributes,this._joinResolveCallback=void 0,this._joinRejectCallback=void 0,this._getAccessFeedback=void 0,this._getAccessNode=void 0,"function"==typeof e&&e(null===(n=this._roomInfo)||void 0===n?void 0:n.userInfo),this._isReconnecting=!1,aD.rtcJoinRoom(0,"web","web",nC()-i),this._onJoinSucc(o,r),[3,4];case 3:return(a=s.sent()).code!==sT.OPERATION_CANCEL&&"function"==typeof t?[2,t(a)]:[3,4];case 4:return[2]}}))}))},t.prototype.publishScreen=function(e,t,r){return ei(this,void 0,void 0,(function(){return ti(this,(function(n){switch(n.label){case 0:return LM.print("publishScreen()"),this._localScreenStream||(this._localScreenStream=new DM,this._localScreenStream.isScreen=!0),this._localScreenStream.videoTrack=t,this._localScreenStream.audioTrack=r,this._localScreenStream.videoEncodeConfig=e,this._localScreenStream.hasPublished?[3,2]:[4,this._mediaServerClient.publish(this._localScreenStream)];case 1:return n.sent(),[3,4];case 2:return[4,this.updatePubScreenTrack()];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.updatePubScreenTrack=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return LM.print("updatePubScreenTrack","Invoke updatePubScreenTrack"),this._localScreenStream?[4,this._mediaServerClient.updatePubTrack(this._localScreenStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublishScreen=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return LM.print("unpublish","Invoke unpublishScreen"),this._localScreenStream?[4,this._mediaServerClient.unpublish(this._localScreenStream)]:[3,2];case 1:e.sent(),this._localScreenStream.clean(),this._localScreenStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.controlMessage=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return LM.print("controlMessage","Invoke controlMessage"),this._controlMessage=e,[4,this._mediaServerClient.controlMessage(e)];case 1:return t.sent(),"stopped"===e.action&&delete this._controlMessage,[2]}}))}))},t.prototype.updateUserAttributes=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return LM.print("updateUserAttributes","Invoke updateUserAttributes"),e.role&&this._roomInfo&&(this._roomInfo.userInfo.role=e.role),[4,this._mediaServerClient.updateUserAttributes(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.publish=function(e,t,r){return ei(this,void 0,void 0,(function(){var n;return ti(this,(function(i){switch(i.label){case 0:if(LM.print("publish","Invoke publish"),this._localStream||(this._localStream=new DM),this._localStream.videoTrack=t,this._localStream.audioTrack=r,this._localStream.videoEncodeConfig=e,this._localStream.hasPublished)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._mediaServerClient.publish(this._localStream)];case 2:return i.sent(),this.emit(OM.ON_PUBLISH_RESULT,{isScreen:!1,state:aO.PUBLISH_SUCC}),[3,4];case 3:throw n=i.sent(),this.emit(OM.ON_PUBLISH_RESULT,{isScreen:!1,state:aO.PUBLISH_FAIL}),n;case 4:return[3,7];case 5:return[4,this.updatePubTrack()];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))},t.prototype.updatePubTrack=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return LM.print("updatePubTrack","Invoke updatePubTrack"),this._localStream?[4,this._mediaServerClient.updatePubTrack(this._localStream)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.unpublish=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return LM.print("unpublish","Invoke unpublish"),this._localStream?[4,this._mediaServerClient.unpublish(this._localStream)]:[3,2];case 1:e.sent(),this._localStream.clean(),this._localStream=void 0,e.label=2;case 2:return[2]}}))}))},t.prototype.subscribe=function(e,t,r){return ei(this,void 0,void 0,(function(){return ti(this,(function(n){switch(n.label){case 0:return LM.print("subscribe","remoteStream %o",e),[4,this._mediaServerClient.subscribe(e,t,r)];case 1:return n.sent(),[2]}}))}))},t.prototype.updateSubTrack=function(e,t,r){var n,i;return ei(this,void 0,void 0,(function(){return ti(this,(function(o){return LM.print("updateSubTrack","Invoke updateSubTrack"),e.subMediaType===t&&(null===(n=null==e?void 0:e.subConfig)||void 0===n?void 0:n.videoIndex)===(null==r?void 0:r.videoIndex)?[2,Promise.resolve(e)]:[2,null===(i=this._mediaServerClient)||void 0===i?void 0:i.updateSubTrack(e,t,r)]}))}))},t.prototype.unsubscribe=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:return LM.print("unsubscribe","Invoke unsubscribe"),[4,this._mediaServerClient.unsubscribe(e)];case 1:return t.sent(),[2]}}))}))},t.prototype.leave=function(){return ei(this,void 0,void 0,(function(){var e,t;return ti(this,(function(r){switch(r.label){case 0:LM.print("leave","Invoke leave"),e=nC(),r.label=1;case 1:return r.trys.push([1,3,4,5]),clearTimeout(this._reconnectTimer),[4,this._mediaServerClient.leave()];case 2:return r.sent(),aD.rtcLeaveRoom(0,"",nC()-e),[3,5];case 3:return(t=r.sent())instanceof Error&&aD.rtcLeaveRoom(-1,t.message,nC()-e),[3,5];case 4:return this.destroy(),[7];case 5:return[2]}}))}))},t.prototype.destroy=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:return LM.print("destroy","Invoke destroy"),this.connectionState!==fP.CONNECTED?[3,2]:[4,this.leave()];case 1:e.sent(),e.label=2;case 2:return this._destroyAndInitMediaServerClient(),this._roomInfo=void 0,this._remoteUsers=new Map,this._remoteStreams=new Map,this._localStream=void 0,this._localScreenStream=void 0,this._removeHandlerEventHandler(),[2]}}))}))},t.prototype.updateToken=function(e){LM.print("updateToken","Invoke updateToken"),this._roomInfo&&(this._roomInfo.token=e)},t.prototype.muteLocalTrack=function(e,t){var r,n;return ei(this,void 0,void 0,(function(){var i,o;return ti(this,(function(a){switch(a.label){case 0:return this._localStream&&(null===(r=this._localStream)||void 0===r?void 0:r.hasPublished)?(i=t!==iO.MUTE_STATE_OFF,(o=this._localStream.switchTrackEnableState(e,i))?[4,null===(n=this._mediaServerClient)||void 0===n?void 0:n.updatePubTrack(this._localStream)]:[3,2]):[2,!1];case 1:a.sent(),a.label=2;case 2:return[2,o]}}))}))},t.prototype.pauseAllSubscribedStream=function(e){return ei(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return ti(this,(function(c){t=[];try{for(r=ri(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case cO.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===lO.AUDIO_ONLY?n=lO.NONE:r.subMediaType===lO.AUDIO_AND_VIDEO&&(n=lO.VIDEO_ONLY);break;case cO.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===lO.VIDEO_ONLY?n=lO.NONE:r.subMediaType===lO.AUDIO_AND_VIDEO&&(n=lO.AUDIO_ONLY);break;case cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==lO.NONE&&(n=lO.NONE)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.resumeAllSubscribedStream=function(e){return ei(this,void 0,void 0,(function(){var t,r,n,i,o,a,s=this;return ti(this,(function(c){t=[];try{for(r=ri(this._remoteStreams.values()),n=r.next();!n.done;n=r.next())i=n.value,Array.isArray(i)&&i.forEach((function(r){if(r.hasSubscribed){var n=null;switch(e){case cO.RTC_PAUSE_RESUME_CONTROL_AUDIO:r.subMediaType===lO.NONE?n=lO.AUDIO_ONLY:r.subMediaType===lO.VIDEO_ONLY&&(n=lO.AUDIO_AND_VIDEO);break;case cO.RTC_PAUSE_RESUME_CONTROL_VIDEO:r.subMediaType===lO.NONE?n=lO.VIDEO_ONLY:r.subMediaType===lO.AUDIO_ONLY&&(n=lO.AUDIO_AND_VIDEO);break;case cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO:r.subMediaType!==lO.AUDIO_AND_VIDEO&&(n=lO.AUDIO_AND_VIDEO)}if(null!==n){var i=s.updateSubTrack(r,n,r.subConfig);i&&t.push(i)}}}))}catch(e){o={error:e}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2,Promise.all(t)]}))}))},t.prototype.sendUserMessage=function(e,t){var r;return this._remoteUsers.has(e)?null===(r=this._mediaServerClient)||void 0===r?void 0:r.sendUserMessage(e,t):Promise.reject(new dT(sT.USER_NOT_EXIST,"User does not exist"))},t.prototype.sendRoomMessage=function(e,t){var r,n;void 0===t&&(t=!1);var i={clientId:null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId,binary:t,message:""};if(t){var o=oC.ab2str(e);i.message=QR.encodeBase64(o)}else i.message=e;return null===(n=this._mediaServerClient)||void 0===n?void 0:n.sendRoomMessage(i)},t.prototype._destroyAndInitMediaServerClient=function(){LM.print("_destroyAndInitMediaServerClient()"),this._mediaServerClient&&(this._mediaServerClient.destroy(),this._removeHandlerEventHandler()),this._mediaServerClient=new vP,this._addHandlerEventHandler()},t.prototype._onJoinSucc=function(e,t){var r,n,i,o,a,s=this;LM.print("JoinSuccess()");var c=[],u=[],d=[],l=[];null===(a=e.clientsDetail)||void 0===a||a.forEach((function(t){if(t.clientId!==e.clientId){var r=s._remoteUsers.get(t.clientId);r?r._stillExist=!0:c.push(t)}}));try{for(var f=ri(this._remoteUsers.values()),h=f.next();!h.done;h=f.next()){var p=h.value;p._stillExist?delete p._stillExist:u.push({clientId:p.userId,leaveReason:"Left during disconnection"})}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}e.streams.forEach((function(e){var t=s._findRemoteStreamByScreen(e.clientId,e.screen);t?(t.stillExist=!0,t.streamId=e.streamId):l.push(e)}));try{for(var _=ri(this._remoteStreams.values()),v=_.next();!v.done;v=_.next()){var m=v.value;Array.isArray(m)&&m.forEach((function(e){e.stillExist?delete e.stillExist:d.push({clientId:e.userId,streamId:e.streamId,message:Qk.clientDisconnected})}))}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}setTimeout((function(){u.forEach((function(e){return s._onUserDisconnection(e)})),c.forEach((function(e){return s._onUserConnection(e)})),d.forEach((function(e){return s._onRemoveStream(e)})),l.forEach((function(e){return s._onAddStream(e)})),t&&s._handleSendOrRecvStreamAfterReconnect()}))},t.prototype._handleSendOrRecvStreamAfterReconnect=function(){var e,t,r=this;this._localStream&&(this._localStream.clean(),this._mediaServerClient.publish(this._localStream).catch((function(e){}))),this._localScreenStream&&(this._localScreenStream.clean(),this._mediaServerClient.publish(this._localScreenStream).catch((function(e){})));try{for(var n=ri(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return ei(r,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:if(!e.hasSubscribed)return[3,4];e.resetHasSubscribed(),r.label=1;case 1:return r.trys.push([1,3,,4]),LM.print("start resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),[4,this._mediaServerClient.subscribe(e,e.subMediaType,e.subConfig)];case 2:return r.sent(),LM.print("success resubscribe ".concat(e.userId," with ").concat(e.subMediaType)),this.safeEmit(OM.RESUBSCRIBE,{stream:e}),[3,4];case 3:return t=r.sent(),LM.print("failed resubscribe ".concat(e.userId," with ").concat(e.subMediaType,", error:").concat(t)),e.clean(),null==e||e.resetHasSubscribed(),[3,4];case 4:return[2]}}))}))}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype._findRemoteStream=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.streamId===t})):null},t.prototype._findRemoteStreamByScreen=function(e,t){var r=this._remoteStreams.get(e);return Array.isArray(r)?r.find((function(e){return e.isScreen===t})):null},t.prototype._onAddStream=function(e,t){var r;if(void 0===t&&(t=!0),e.clientId!==(null===(r=this._roomInfo)||void 0===r?void 0:r.userInfo.userId)){var n=this._findRemoteStream(e.clientId,e.streamId);if(!n){n=new PM(e.clientId,e.streamId,e.screen,e.attributes),this._initStreamListeners(n);var i=this._remoteStreams.get(e.clientId);i?i.push(n):this._remoteStreams.set(e.clientId,[n])}return t&&this.safeEmit(eD.ON_ADD_STREAM,{stream:n}),!n.isScreen&&n.hasVideo&&this.safeEmit(OM.ON_USER_START_VIDEO_CAPTURE,{userId:n.userId}),!n.isScreen&&n.hasAudio&&this.safeEmit(OM.ON_USER_START_AUDIO_CAPTURE,{userId:n.userId}),n}},t.prototype._onUserConnection=function(e){var t;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var r={userId:e.clientId,extraInfo:e.attributes.extra_info};this._remoteUsers.set(e.clientId,$n($n({},r),{_stillExist:!0})),this.safeEmit(eD.USER_CONNECTION,{userInfo:r})}},t.prototype._onUserDisconnection=function(e){var t,r,n=this,i=e.clientId,o=e.leaveReason,a=this._remoteUsers.get(i);this._remoteUsers.delete(i);var s=this._remoteStreams.get(i);Array.isArray(s)&&s.length&&(s.forEach((function(e){n.safeEmit(eD.ON_REMOVE_STREAM,{stream:e,reason:"Client leave"})})),this._remoteStreams.delete(i)),"userDuplicateLogin"===e.tag&&i===(null===(r=null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo)||void 0===r?void 0:r.userId)&&(a={userId:i},o=e.tag),this.safeEmit(eD.USER_DISCONNECTION,{userInfo:{userId:null==a?void 0:a.userId},reason:o})},t.prototype._onRemoveStream=function(e){var t,r,n=this;if(e.clientId!==(null===(t=this._roomInfo)||void 0===t?void 0:t.userInfo.userId)){var i=this._remoteStreams.get(e.clientId);if(i){var o=i.find((function(t){return t.streamId==e.streamId}));o&&(null===(r=this._mediaServerClient)||void 0===r||r.handleRemoveStream(o,e).then((function(){if(!(null==o?void 0:o._workaround_1_)){var t=n._remoteStreams.get(e.clientId);if(!t)return;t=t.filter((function(t){return t.streamId!==e.streamId})),n._remoteStreams.set(e.clientId,t)}})),this.safeEmit(eD.ON_REMOVE_STREAM,{stream:o,reason:e.message}))}}},t.prototype._onUpdateRoomAttributes=function(e){e.roomAttributes&&(this._mediaServerClient.roomAttributes=e.roomAttributes)},t.prototype._onUpdateStreamAttributes=function(e){var t=e.clientId,r=e.streamId,n=e.attributes,i=this._findRemoteStream(t,r);if(i){var o=i.attributes,a=$n($n({},o),n);i.attributes=a,a.localaudio!==o.localaudio&&(a.localaudio?this.safeEmit(OM.ON_USER_START_AUDIO_CAPTURE,{userId:t}):this.safeEmit(OM.ON_USER_STOP_AUDIO_CAPTURE,{userId:t})),a.localvideo!==o.localvideo&&(a.localvideo?this.safeEmit(OM.ON_USER_START_VIDEO_CAPTURE,{userId:t}):this.safeEmit(OM.ON_USER_STOP_VIDEO_CAPTURE,{userId:t})),a.audiostream!==o.audiostream&&(a.audiostream?this.safeEmit(OM.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:iO.MUTE_STATE_ON}):this.safeEmit(OM.ON_USER_MUTE_AUDIO,{userInfo:{userId:t},muteState:iO.MUTE_STATE_OFF})),a.videostream!==o.videostream&&(a.videostream?this.safeEmit(OM.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:iO.MUTE_STATE_ON}):this.safeEmit(OM.ON_USER_MUTE_VIDEO,{userInfo:{userId:t},muteState:iO.MUTE_STATE_OFF}))}},t.prototype._onPushTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=this._findRemoteStream(r,n);i||(i=this._onAddStream(e,!1)),this._mediaServerClient.subscribe4pushTrack(i,e).then((function(){return t.safeEmit(OM.SUBSCRIBE_PUSH_TRACK,{stream:i})})).catch((function(e){LM.print("subscribe push track failed: ".concat(e))}))},t.prototype._onRemoveTrack=function(e){var t=this,r=e.clientId,n=e.streamId,i=e.message,o=this._findRemoteStream(r,n);o&&this._mediaServerClient.unsubscribe4removeTrack(o,i).then((function(){var e;if(o._workaround_1_){var i=null===(e=t._remoteStreams.get(r))||void 0===e?void 0:e.filter((function(e){return e.streamId!==n}));t._remoteStreams.set(r,i||[])}t.safeEmit(OM.REMOVE_PUSH_TRACK,{stream:o})})).catch((function(e){LM.print("remove push track failed: ".concat(e))}))},t.prototype._nodeChange=function(e){var t=e.nodes,r=e.reason;this._destroyAndInitMediaServerClient(),Array.isArray(t)&&t.length?this._getAccessNode=t[0]:this._getAccessFeedback=r,aD.rtcNodeChange(0,JSON.stringify(e),JSON.stringify(r)),this._joinResolveCallback&&this._joinRejectCallback?this._join(this._joinResolveCallback,this._joinRejectCallback):this._reconnect()},t.prototype._reconnect=function(){var e,t,r=this;this._isReconnecting=!0,aD.rtcReconnect(1002,$N.PEERCONNECTION_RECONNECTING,this._roomInfo.userInfo.userId,QN.PEERCONNECTION);try{for(var n=ri(this._remoteStreams.values()),i=n.next();!i.done;i=n.next()){var o=i.value;Array.isArray(o)&&o.forEach((function(e){return e.clean()}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._join((function(){aD.rtcReconnected(ek.PEERCONNECTION_RECONNECTED,tk.PEERCONNECTION)}),(function(e){LM.print("Reconnecting error, will reconnect after 3s",e),r._reconnectTimer=setTimeout(r._reconnect.bind(r),3e3)}),!0)},t.prototype._handleAbnormalDisconnection=function(){LM.print("on ABNORMAL_DISCONNECTION"),this._destroyAndInitMediaServerClient(),navigator.onLine?this._reconnect():this._reconnectTimer=setTimeout(this._reconnect.bind(this),3e3)},t.prototype._onConnectionStateChange=function(e){var t;if(e.next===fP.DISCONNECTED)t=hO.CONNECTION_STATE_DISCONNECTED;else if(e.next===fP.CONNECTED)t=this._isReconnecting?hO.CONNECTION_STATE_RECONNECTED:hO.CONNECTION_STATE_CONNECTED;else{if(e.next!==fP.CONNECTING)return;t=this._isReconnecting?hO.CONNECTION_STATE_RECONNECTING:hO.CONNECTION_STATE_CONNECTING}this.safeEmit(tD.ON_CONNECTION_STATE_CHANGE,{state:t})},t.prototype._initStreamListeners=function(e){var t=this;e.on("ontrack",(function(e){e.track})),e.on("onSEIMessage",(function(r){var n;t.emit(OM.ON_SEI_MESSAGED_RECEIVED,{sei:r,remoteStreamKey:{userId:e.userId,roomId:null===(n=t._roomInfo)||void 0===n?void 0:n.roomId,streamIndex:e.isScreen?dO.STREAM_INDEX_SCREEN:dO.STREAM_INDEX_MAIN}})}))},t.prototype._onCustomMessage=function(e){this.safeEmit(eD.ON_CUSTOM_MESSAGE,e)},t.prototype._onUserMessageReceived=function(e){var t=e.msg;try{t=JSON.parse(t)}catch(e){}this.safeEmit(eD.USER_MESSAGE_RECEIVED,{userId:e.from,message:t})},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(eD.USER_BINARY_MESSAGE_RECEIVED,{userId:e.from,message:e.msg})},t.prototype._onPostProcessingMessage=function(e){var t,r=(null===(t=e.body)||void 0===t?void 0:t.error)||0;this.safeEmit(eD.POST_PROCESSING_MESSAGE,{code:r,message:["success","parameter error","subscription timeout","ffmpeg error","cdn error"][r]})},t}(MC),BM=function(e,t){return void 0===t&&(t={}),t.id&&(e.id=t.id),t.classList&&t.classList.forEach((function(t){e.classList.add(t)})),t.style&&Object.assign(e.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(t){var r=ni(t,2),n=r[0],i=r[1];e.setAttribute(n,i)})),e},VM=new DC("Player",0),jM=["play","playing","pause","ended","error","seeking","seeked","waiting","canplay","canplaythrough","durationchange","volumechange","loadedmetadata","loadeddata","loadstart","timeupdate"],FM={playsinline:"","webkit-playsinline":""},GM={playsinline:"","webkit-playsinline":"","x5-playsinline":"","x5-video-player-type":"h5","x-webkit-airplay":"allow",preload:"",muted:""},zM=function(){function e(){this.videoCache=[],this.audioCache=[]}return e.prototype.getOrCreate=function(e,t){var r="audio"===e?FM:GM;if("video"===e&&this.videoCache.length>0){if(n=this.videoCache.pop())return BM(n,{style:t,attributes:r}),n}else if("audio"===e&&this.audioCache.length>0){var n;if(n=this.audioCache.pop())return BM(n,{style:t,attributes:r}),n}return function(e,t){void 0===t&&(t={});var r=document.createElement(e);return t.id&&(r.id=t.id),t.classList&&t.classList.forEach((function(e){r.classList.add(e)})),t.style&&Object.assign(r.style,t.style),t.attributes&&Object.entries(t.attributes).forEach((function(e){var t=ni(e,2),n=t[0],i=t[1];r.setAttribute(n,i)})),r}(e,{style:t,attributes:r})},e.prototype.recycle=function(e){for(;e.attributes.length>0;)e.removeAttribute(e.attributes[0].name);e instanceof HTMLVideoElement?this.videoCache.push(e):this.audioCache.push(e)},e}(),HM=new zM,WM=function(e){function t(t){var r=e.call(this)||this;r.emitVideoEvent=function(e){var t,n,i={type:"video",rawEvent:e,readyState:(null===(t=r._videoDom)||void 0===t?void 0:t.readyState)||0,userId:r.userId,eventName:e.type,currentTime:(null===(n=r._videoDom)||void 0===n?void 0:n.currentTime)||0,isScreen:r.isScreen};r.emit("playback_event",i)},r._internalPlay=function(){var e;if(null===(e=r._videoDom)||void 0===e?void 0:e.paused)return r._videoDom.play()};var n=t.renderDom,i=t.userId;r.renderMode=void 0!==t.renderMode?t.renderMode:uO.RENDER_MODE_FIT;var o="string"==typeof n?document.getElementById(n):n;if(!o)throw new dT(sT.CANT_FIND_DOM,"can't find dom");return r._containerDom=o,r.userId=i,r.isScreen=!!t.isScreen,r._initVideo(),r}return Zn(t,e),t.prototype._initVideo=function(){this._videoDom||(this._videoDom=HM.getOrCreate("video",{width:"100%",height:"100%",background:"black"}),this._videoDom.id="".concat(this.userId,"_").concat(rC()),this.renderMode===uO.RENDER_MODE_FIT?this._videoDom.style.objectFit="contain":this._videoDom.style.objectFit="cover"),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._videoDom&&jM.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._videoDom&&(jM.forEach((function(t){var r;null===(r=e._videoDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._videoDom.addEventListener("canplay",this._internalPlay),this._videoDom.addEventListener("loadeddata",this._internalPlay))},t.prototype._recordFrame=function(e){var t=this;this.on("playback_event",(function(r){var n;if("timeupdate"===r.eventName){if(void 0===t.__cumulativeTime&&(t.__cumulativeTime=0),0===(null===(n=t._videoDom)||void 0===n?void 0:n.currentTime))return;if(t._videoDom.currentTime>t.__cumulativeTime){var i=Math.floor(1e3*(t._videoDom.currentTime-t.__cumulativeTime)),o=t._videoDom.currentTime-t.__cumulativeTime>.5;e.recordedVideoFrames.push({playTime:t._videoDom.currentTime,isStall:o,stallCount:o?1:0,stallDuration:i%2e3})}t.__cumulativeTime=t._videoDom.currentTime}}))},t.prototype.playVideo=function(e,t){var r;return ei(this,void 0,void 0,(function(){var n,i;return ti(this,(function(o){return n=this._videoDom,VM.print("playVideo","play video track: ".concat(this.userId)),n&&n.srcObject instanceof MediaStream&&n.srcObject.getTrackById(null===(r=e.getTrack())||void 0===r?void 0:r.id)||(n||(this._initVideo(),n=this._videoDom),VM.print("playVideo","play video by dom: ".concat(null==n?void 0:n.id)),(i=new MediaStream).addTrack(e.getTrack()),n.srcObject=i,this._containerDom.appendChild(n),n.addEventListener("canplay",this._internalPlay),n.addEventListener("loadeddata",this._internalPlay),t&&this._recordFrame(t)),[2]}))}))},t.prototype.updateSrcObject=function(e){var t=e.getTrack();if(t&&this._videoDom){var r=new MediaStream;r.addTrack(t),this._videoDom.srcObject=r}},t.prototype.mirror=function(e){VM.print("mirror","".concat(this.userId," set mirror: ").concat(e)),this._videoDom&&(this._videoDom.style.transform=e?"rotateY(180deg)":"")},t.prototype.stop=function(){var e=this._containerDom;VM.print("stop","stop video track: ".concat(this.userId)),this._videoDom&&(this._videoDom.srcObject=null,e&&e.contains(this._videoDom)&&e.removeChild(this._videoDom),HM.recycle(this._videoDom),this._removeListeners(),delete this._videoDom),this._videoDom=void 0,this.__cumulativeTime=void 0},t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._videoDom},enumerable:!1,configurable:!0}),t}(SC.exports.EventEmitter),YM=function(e){function t(t,r){var n=e.call(this)||this;if(n.emitVideoEvent=function(e){var t,r,i={type:"audio",rawEvent:e,readyState:(null===(t=n._audioDom)||void 0===t?void 0:t.readyState)||0,userId:n.userId,eventName:e.type,currentTime:(null===(r=n._audioDom)||void 0===r?void 0:r.currentTime)||0};n.emit("playback_event",i)},n._internalPlay=function(){var e;if(null===(e=n._audioDom)||void 0===e?void 0:e.paused){var t=n._audioDom.play();(null==t?void 0:t.then)&&t.catch((function(e){var t;aD.rtcError("autoplay failed, userId: ".concat(n.userId),-1e3),n.emit("playback_event",{type:"audio",rawEvent:e,readyState:n._audioDom.readyState||0,userId:n.userId,eventName:"autoplay-error",currentTime:(null===(t=n._audioDom)||void 0===t?void 0:t.currentTime)||0})}))}},r){var i=document.getElementById(r);if(!i)throw new dT(sT.CANT_FIND_DOM,"can't find dom");n._containerDom=i}else n._containerDom=document.body;return n.userId=t,n._initAudio(),n}return Zn(t,e),t.prototype._initAudio=function(){this._audioDom||(this._audioDom=HM.getOrCreate("audio",{display:"none"}),this._audioDom.id="".concat(this.userId,"_").concat(rC()),this._containerDom.appendChild(this._audioDom)),this._initListeners()},t.prototype._initListeners=function(){var e=this;this._audioDom&&jM.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.addEventListener(t,e.emitVideoEvent)}))},t.prototype._removeListeners=function(){var e=this;this._audioDom&&(jM.forEach((function(t){var r;null===(r=e._audioDom)||void 0===r||r.removeEventListener(t,e.emitVideoEvent)})),this._audioDom.removeEventListener("canplay",this._internalPlay),this._audioDom.removeEventListener("loadeddata",this._internalPlay))},t.prototype.playAudio=function(e){var t;return ei(this,void 0,void 0,(function(){var r,n;return ti(this,(function(i){return VM.print("playAudio","play audio track: ".concat(this.userId)),(r=this._audioDom)&&r.srcObject instanceof MediaStream&&r.srcObject.getTrackById(null===(t=e.getTrack())||void 0===t?void 0:t.id)||(r||(this._initAudio(),r=this._audioDom),(n=new MediaStream).addTrack(e.getTrack()),r.srcObject=n,null==r||r.addEventListener("canplay",this._internalPlay),null==r||r.addEventListener("loadeddata",this._internalPlay)),[2]}))}))},t.prototype.manuallyPlay=function(){if(VM.print("Invoke AudioPlayer.manuallyPlay"),!this._audioDom)throw new dT(sT.INVALID_PARAMS,"Player not found");var e=this._audioDom.play();return(null==e?void 0:e.then)?e:Promise.resolve(e)},t.prototype.setPlaybackDevice=function(e){return ei(this,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:return VM.print("setPlaybackDevice","setPlaybackDevice: ".concat(e)),[4,nM.getAudioPlayback()];case 1:return t=r.sent(),t.map((function(e){return e.deviceId})).includes(e)&&this._audioDom&&this._audioDom.setSinkId?[4,this._audioDom.setSinkId(e)]:[2];case 2:return r.sent(),[2]}}))}))},t.prototype.stop=function(){var e=this._containerDom;VM.print("stopAudio","stop audio track: ".concat(this.userId)),this._audioDom&&(this._audioDom.srcObject=null,e&&e.contains(this._audioDom)&&e.removeChild(this._audioDom),HM.recycle(this._audioDom),this._removeListeners(),delete this._audioDom),this._audioDom=void 0},Object.defineProperty(t.prototype,"domElement",{get:function(){return this._audioDom},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.stop(),e.prototype.removeAllListeners.call(this)},t}(SC.exports.EventEmitter),KM={exports:{}};MM=KM,UM=KM.exports,function(){var e,r="Expected a function",n="__lodash_hash_undefined__",i="__lodash_placeholder__",o=16,a=32,s=64,c=128,u=256,d=1/0,l=9007199254740991,f=NaN,h=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",a],["partialRight",s],["rearg",u]],_="[object Arguments]",v="[object Array]",m="[object Boolean]",g="[object Date]",y="[object Error]",E="[object Function]",S="[object GeneratorFunction]",b="[object Map]",T="[object Number]",I="[object Object]",A="[object Promise]",R="[object RegExp]",C="[object Set]",O="[object String]",w="[object Symbol]",N="[object WeakMap]",k="[object ArrayBuffer]",D="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",U="[object Int8Array]",L="[object Int16Array]",x="[object Int32Array]",B="[object Uint8Array]",V="[object Uint8ClampedArray]",j="[object Uint16Array]",F="[object Uint32Array]",G=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,K=RegExp(W.source),X=RegExp(Y.source),q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,_e=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",be="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Re="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ce="['’]",Oe="[\\ud800-\\udfff]",we="["+Re+"]",Ne="["+Se+"]",ke="\\d+",De="[\\u2700-\\u27bf]",Pe="["+Te+"]",Me="[^\\ud800-\\udfff"+Re+ke+be+Te+Ie+"]",Ue="\\ud83c[\\udffb-\\udfff]",Le="[^\\ud800-\\udfff]",xe="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Ie+"]",je="(?:"+Pe+"|"+Me+")",Fe="(?:"+Ve+"|"+Me+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ne+"|"+Ue+")?",We="[\\ufe0e\\ufe0f]?",Ye=We+He+"(?:\\u200d(?:"+[Le,xe,Be].join("|")+")"+We+He+")*",Ke="(?:"+[De,xe,Be].join("|")+")"+Ye,Xe="(?:"+[Le+Ne+"?",Ne,xe,Be,Oe].join("|")+")",qe=RegExp(Ce,"g"),Je=RegExp(Ne,"g"),Ze=RegExp(Ue+"(?="+Ue+")|"+Xe+Ye,"g"),$e=RegExp([Ve+"?"+Pe+"+"+Ge+"(?="+[we,Ve,"$"].join("|")+")",Fe+"+"+ze+"(?="+[we,Ve+je,"$"].join("|")+")",Ve+"?"+je+"+"+Ge,Ve+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Ke].join("|"),"g"),Qe=RegExp("[\\u200d\\ud800-\\udfff"+Se+Ae+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,nt={};nt[P]=nt[M]=nt[U]=nt[L]=nt[x]=nt[B]=nt[V]=nt[j]=nt[F]=!0,nt[_]=nt[v]=nt[k]=nt[m]=nt[D]=nt[g]=nt[y]=nt[E]=nt[b]=nt[T]=nt[I]=nt[R]=nt[C]=nt[O]=nt[N]=!1;var it={};it[_]=it[v]=it[k]=it[D]=it[m]=it[g]=it[P]=it[M]=it[U]=it[L]=it[x]=it[b]=it[T]=it[I]=it[R]=it[C]=it[O]=it[w]=it[B]=it[V]=it[j]=it[F]=!0,it[y]=it[E]=it[N]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,st=parseInt,ct="object"==typeof t&&t&&t.Object===Object&&t,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),lt=UM&&!UM.nodeType&&UM,ft=lt&&MM&&!MM.nodeType&&MM,ht=ft&&ft.exports===lt,pt=ht&&ct.process,_t=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),vt=_t&&_t.isArrayBuffer,mt=_t&&_t.isDate,gt=_t&&_t.isMap,yt=_t&&_t.isRegExp,Et=_t&&_t.isSet,St=_t&&_t.isTypedArray;function bt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Tt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function It(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Rt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Ct(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Ot(e,t){return!(null==e||!e.length)&&Bt(e,t,0)>-1}function wt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Nt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function kt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Dt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Pt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Mt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Ut=Gt("length");function Lt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function xt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Bt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):xt(e,jt,r)}function Vt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function jt(e){return e!=e}function Ft(e,t){var r=null==e?0:e.length;return r?Wt(e,t)/r:f}function Gt(t){return function(r){return null==r?e:r[t]}}function zt(t){return function(r){return null==t?e:t[r]}}function Ht(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Wt(t,r){for(var n,i=-1,o=t.length;++i<o;){var a=r(t[i]);a!==e&&(n=n===e?a:n+a)}return n}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Kt(e){return e?e.slice(0,lr(e)+1).replace(ne,""):e}function Xt(e){return function(t){return e(t)}}function qt(e,t){return Nt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function Zt(e,t){for(var r=-1,n=e.length;++r<n&&Bt(t,e[r],0)>-1;);return r}function $t(e,t){for(var r=e.length;r--&&Bt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var er=zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=zt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+ot[e]}function nr(e){return Qe.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function ar(e,t){for(var r=-1,n=e.length,o=0,a=[];++r<n;){var s=e[r];s!==t&&s!==i||(e[r]=i,a[o++]=r)}return a}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Ze.lastIndex=0;Ze.test(e);)++t;return t}(e):Ut(e)}function dr(e){return nr(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.split("")}(e)}function lr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var fr=zt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hr=function t(ie){var Se=(ie=null==ie?dt:hr.defaults(dt.Object(),ie,hr.pick(dt,tt))).Array,be=ie.Date,Te=ie.Error,Ie=ie.Function,Ae=ie.Math,Re=ie.Object,Ce=ie.RegExp,Oe=ie.String,we=ie.TypeError,Ne=Se.prototype,ke=Ie.prototype,De=Re.prototype,Pe=ie["__core-js_shared__"],Me=ke.toString,Ue=De.hasOwnProperty,Le=0,xe=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=De.toString,Ve=Me.call(Re),je=dt._,Fe=Ce("^"+Me.call(Ue).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=ht?ie.Buffer:e,ze=ie.Symbol,He=ie.Uint8Array,We=Ge?Ge.allocUnsafe:e,Ye=or(Re.getPrototypeOf,Re),Ke=Re.create,Xe=De.propertyIsEnumerable,Ze=Ne.splice,Qe=ze?ze.isConcatSpreadable:e,ot=ze?ze.iterator:e,ct=ze?ze.toStringTag:e,ut=function(){try{var e=ho(Re,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=ie.clearTimeout!==dt.clearTimeout&&ie.clearTimeout,ft=be&&be.now!==dt.Date.now&&be.now,pt=ie.setTimeout!==dt.setTimeout&&ie.setTimeout,_t=Ae.ceil,Ut=Ae.floor,zt=Re.getOwnPropertySymbols,pr=Ge?Ge.isBuffer:e,_r=ie.isFinite,vr=Ne.join,mr=or(Re.keys,Re),gr=Ae.max,yr=Ae.min,Er=be.now,Sr=ie.parseInt,br=Ae.random,Tr=Ne.reverse,Ir=ho(ie,"DataView"),Ar=ho(ie,"Map"),Rr=ho(ie,"Promise"),Cr=ho(ie,"Set"),Or=ho(ie,"WeakMap"),wr=ho(Re,"create"),Nr=Or&&new Or,kr={},Dr=jo(Ir),Pr=jo(Ar),Mr=jo(Rr),Ur=jo(Cr),Lr=jo(Or),xr=ze?ze.prototype:e,Br=xr?xr.valueOf:e,Vr=xr?xr.toString:e;function jr(e){if(ns(e)&&!Ya(e)&&!(e instanceof Hr)){if(e instanceof zr)return e;if(Ue.call(e,"__wrapped__"))return Fo(e)}return new zr(e)}var Fr=function(){function t(){}return function(r){if(!rs(r))return{};if(Ke)return Ke(r);t.prototype=r;var n=new t;return t.prototype=e,n}}();function Gr(){}function zr(t,r){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=e}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Yr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Xr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Kr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new Yr(e);this.size=t.size}function Jr(e,t){var r=Ya(e),n=!r&&Wa(e),i=!r&&!n&&Ja(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Yt(e.length,Oe):[],c=s.length;for(var u in e)!t&&!Ue.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Eo(u,c))||s.push(u);return s}function Zr(t){var r=t.length;return r?t[qn(0,r-1)]:e}function $r(e,t){return xo(Ni(e),cn(t,0,e.length))}function Qr(e){return xo(Ni(e))}function en(t,r,n){(n!==e&&!Ga(t[r],n)||n===e&&!(r in t))&&an(t,r,n)}function tn(t,r,n){var i=t[r];Ue.call(t,r)&&Ga(i,n)&&(n!==e||r in t)||an(t,r,n)}function rn(e,t){for(var r=e.length;r--;)if(Ga(e[r][0],t))return r;return-1}function nn(e,t,r,n){return hn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&ki(t,Ps(t),e)}function an(e,t,r){"__proto__"==t&&ut?ut(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function sn(t,r){for(var n=-1,i=r.length,o=Se(i),a=null==t;++n<i;)o[n]=a?e:Os(t,r[n]);return o}function cn(t,r,n){return t==t&&(n!==e&&(t=t<=n?t:n),r!==e&&(t=t>=r?t:r)),t}function un(t,r,n,i,o,a){var s,c=1&r,u=2&r,d=4&r;if(n&&(s=o?n(t,i,o,a):n(t)),s!==e)return s;if(!rs(t))return t;var l=Ya(t);if(l){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ue.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(t),!c)return Ni(t,s)}else{var f=vo(t),h=f==E||f==S;if(Ja(t))return Ii(t,c);if(f==I||f==_||h&&!o){if(s=u||h?{}:go(t),!c)return u?function(e,t){return ki(e,_o(e),t)}(t,function(e,t){return e&&ki(t,Ms(t),e)}(s,t)):function(e,t){return ki(e,po(e),t)}(t,on(s,t))}else{if(!it[f])return o?t:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case k:return Ai(e);case m:case g:return new i(+e);case D:return function(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case M:case U:case L:case x:case B:case V:case j:case F:return Ri(e,r);case b:return new i;case T:case O:return new i(e);case R:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case w:return n=e,Br?Re(Br.call(n)):{}}}(t,f,c)}}a||(a=new qr);var p=a.get(t);if(p)return p;a.set(t,s),cs(t)?t.forEach((function(e){s.add(un(e,r,n,e,t,a))})):is(t)&&t.forEach((function(e,i){s.set(i,un(e,r,n,i,t,a))}));var v=l?e:(d?u?oo:io:u?Ms:Ps)(t);return It(v||t,(function(e,i){v&&(e=t[i=e]),tn(s,i,un(e,r,n,i,t,a))})),s}function dn(t,r,n){var i=n.length;if(null==t)return!i;for(t=Re(t);i--;){var o=n[i],a=r[o],s=t[o];if(s===e&&!(o in t)||!a(s))return!1}return!0}function ln(t,n,i){if("function"!=typeof t)throw new we(r);return Po((function(){t.apply(e,i)}),n)}function fn(e,t,r,n){var i=-1,o=Ot,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Nt(t,Xt(r))),n?(o=wt,a=!1):t.length>=200&&(o=Jt,a=!1,t=new Xr(t));e:for(;++i<s;){var d=e[i],l=null==r?d:r(d);if(d=n||0!==d?d:0,a&&l==l){for(var f=u;f--;)if(t[f]===l)continue e;c.push(d)}else o(t,l,n)||c.push(d)}return c}jr.templateSettings={escape:q,evaluate:J,interpolate:Z,variable:"",imports:{_:jr}},jr.prototype=Gr.prototype,jr.prototype.constructor=jr,zr.prototype=Fr(Gr.prototype),zr.prototype.constructor=zr,Hr.prototype=Fr(Gr.prototype),Hr.prototype.constructor=Hr,Wr.prototype.clear=function(){this.__data__=wr?wr(null):{},this.size=0},Wr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wr.prototype.get=function(t){var r=this.__data__;if(wr){var i=r[t];return i===n?e:i}return Ue.call(r,t)?r[t]:e},Wr.prototype.has=function(t){var r=this.__data__;return wr?r[t]!==e:Ue.call(r,t)},Wr.prototype.set=function(t,r){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=wr&&r===e?n:r,this},Yr.prototype.clear=function(){this.__data__=[],this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0||(r==t.length-1?t.pop():Ze.call(t,r,1),--this.size,0))},Yr.prototype.get=function(t){var r=this.__data__,n=rn(r,t);return n<0?e:r[n][1]},Yr.prototype.has=function(e){return rn(this.__data__,e)>-1},Yr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ar||Yr),string:new Wr}},Kr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Kr.prototype.get=function(e){return lo(this,e).get(e)},Kr.prototype.has=function(e){return lo(this,e).has(e)},Kr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(e){return this.__data__.set(e,n),this},Xr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new Yr,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Yr){var n=r.__data__;if(!Ar||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Kr(n)}return r.set(e,t),this.size=r.size,this};var hn=Mi(Sn),pn=Mi(bn,!0);function _n(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function vn(t,r,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r(a);if(null!=s&&(c===e?s==s&&!ds(s):n(s,c)))var c=s,u=a}return u}function mn(e,t){var r=[];return hn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function gn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?gn(s,t-1,r,n,i):kt(i,s):n||(i[i.length]=s)}return i}var yn=Ui(),En=Ui(!0);function Sn(e,t){return e&&yn(e,t,Ps)}function bn(e,t){return e&&En(e,t,Ps)}function Tn(e,t){return Ct(t,(function(t){return Qa(e[t])}))}function In(t,r){for(var n=0,i=(r=Ei(r,t)).length;null!=t&&n<i;)t=t[Vo(r[n++])];return n&&n==i?t:e}function An(e,t,r){var n=t(e);return Ya(e)?n:kt(n,r(e))}function Rn(t){return null==t?t===e?"[object Undefined]":"[object Null]":ct&&ct in Re(t)?function(t){var r=Ue.call(t,ct),n=t[ct];try{t[ct]=e;var i=!0}catch(e){}var o=Be.call(t);return i&&(r?t[ct]=n:delete t[ct]),o}(t):function(e){return Be.call(e)}(t)}function Cn(e,t){return e>t}function On(e,t){return null!=e&&Ue.call(e,t)}function wn(e,t){return null!=e&&t in Re(e)}function Nn(t,r,n){for(var i=n?wt:Ot,o=t[0].length,a=t.length,s=a,c=Se(a),u=1/0,d=[];s--;){var l=t[s];s&&r&&(l=Nt(l,Xt(r))),u=yr(l.length,u),c[s]=!n&&(r||o>=120&&l.length>=120)?new Xr(s&&l):e}l=t[0];var f=-1,h=c[0];e:for(;++f<o&&d.length<u;){var p=l[f],_=r?r(p):p;if(p=n||0!==p?p:0,!(h?Jt(h,_):i(d,_,n))){for(s=a;--s;){var v=c[s];if(!(v?Jt(v,_):i(t[s],_,n)))continue e}h&&h.push(_),d.push(p)}}return d}function kn(t,r,n){var i=null==(t=wo(t,r=Ei(r,t)))?t:t[Vo($o(r))];return null==i?e:bt(i,t,n)}function Dn(e){return ns(e)&&Rn(e)==_}function Pn(t,r,n,i,o){return t===r||(null==t||null==r||!ns(t)&&!ns(r)?t!=t&&r!=r:function(t,r,n,i,o,a){var s=Ya(t),c=Ya(r),u=s?v:vo(t),d=c?v:vo(r),l=(u=u==_?I:u)==I,f=(d=d==_?I:d)==I,h=u==d;if(h&&Ja(t)){if(!Ja(r))return!1;s=!0,l=!1}if(h&&!l)return a||(a=new qr),s||ls(t)?ro(t,r,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case g:case T:return Ga(+e,+t);case y:return e.name==t.name&&e.message==t.message;case R:case O:return e==t+"";case b:var s=ir;case C:var c=1&n;if(s||(s=sr),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=ro(s(e),s(t),n,i,o,a);return a.delete(e),d;case w:if(Br)return Br.call(e)==Br.call(t)}return!1}(t,r,u,n,i,o,a);if(!(1&n)){var p=l&&Ue.call(t,"__wrapped__"),E=f&&Ue.call(r,"__wrapped__");if(p||E){var S=p?t.value():t,A=E?r.value():r;return a||(a=new qr),o(S,A,n,i,a)}}return!!h&&(a||(a=new qr),function(t,r,n,i,o,a){var s=1&n,c=io(t),u=c.length,d=io(r).length;if(u!=d&&!s)return!1;for(var l=u;l--;){var f=c[l];if(!(s?f in r:Ue.call(r,f)))return!1}var h=a.get(t),p=a.get(r);if(h&&p)return h==r&&p==t;var _=!0;a.set(t,r),a.set(r,t);for(var v=s;++l<u;){var m=t[f=c[l]],g=r[f];if(i)var y=s?i(g,m,f,r,t,a):i(m,g,f,t,r,a);if(!(y===e?m===g||o(m,g,n,i,a):y)){_=!1;break}v||(v="constructor"==f)}if(_&&!v){var E=t.constructor,S=r.constructor;E==S||!("constructor"in t)||!("constructor"in r)||"function"==typeof E&&E instanceof E&&"function"==typeof S&&S instanceof S||(_=!1)}return a.delete(t),a.delete(r),_}(t,r,n,i,o,a))}(t,r,n,i,Pn,o))}function Mn(t,r,n,i){var o=n.length,a=o,s=!i;if(null==t)return!a;for(t=Re(t);o--;){var c=n[o];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<a;){var u=(c=n[o])[0],d=t[u],l=c[1];if(s&&c[2]){if(d===e&&!(u in t))return!1}else{var f=new qr;if(i)var h=i(d,l,u,t,r,f);if(!(h===e?Pn(l,d,3,i,f):h))return!1}}return!0}function Un(e){return!(!rs(e)||(t=e,xe&&xe in t))&&(Qa(e)?Fe:_e).test(jo(e));var t}function Ln(e){return"function"==typeof e?e:null==e?oc:"object"==typeof e?Ya(e)?Gn(e[0],e[1]):Fn(e):pc(e)}function xn(e){if(!Ao(e))return mr(e);var t=[];for(var r in Re(e))Ue.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Bn(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var r in Re(e))t.push(r);return t}(e);var t=Ao(e),r=[];for(var n in e)("constructor"!=n||!t&&Ue.call(e,n))&&r.push(n);return r}function Vn(e,t){return e<t}function jn(e,t){var r=-1,n=Xa(e)?Se(e.length):[];return hn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Fn(e){var t=fo(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(r){return r===e||Mn(r,e,t)}}function Gn(t,r){return bo(t)&&Ro(r)?Co(Vo(t),r):function(n){var i=Os(n,t);return i===e&&i===r?ws(n,t):Pn(r,i,3)}}function zn(t,r,n,i,o){t!==r&&yn(r,(function(a,s){if(o||(o=new qr),rs(a))!function(t,r,n,i,o,a,s){var c=ko(t,n),u=ko(r,n),d=s.get(u);if(d)en(t,n,d);else{var l=a?a(c,u,n+"",t,r,s):e,f=l===e;if(f){var h=Ya(u),p=!h&&Ja(u),_=!h&&!p&&ls(u);l=u,h||p||_?Ya(c)?l=c:qa(c)?l=Ni(c):p?(f=!1,l=Ii(u,!0)):_?(f=!1,l=Ri(u,!0)):l=[]:as(u)||Wa(u)?(l=c,Wa(c)?l=ys(c):rs(c)&&!Qa(c)||(l=go(u))):f=!1}f&&(s.set(u,l),o(l,u,i,a,s),s.delete(u)),en(t,n,l)}}(t,r,s,n,zn,i,o);else{var c=i?i(ko(t,s),a,s+"",t,r,o):e;c===e&&(c=a),en(t,s,c)}}),Ms)}function Hn(t,r){var n=t.length;if(n)return Eo(r+=r<0?n:0,n)?t[r]:e}function Wn(e,t,r){t=t.length?Nt(t,(function(e){return Ya(e)?function(t){return In(t,1===e.length?e[0]:e)}:e})):[oc];var n=-1;t=Nt(t,Xt(uo()));var i=jn(e,(function(e,r,i){var o=Nt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;++n<a;){var c=Ci(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Yn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=In(e,a);r(s,a)&&ei(o,Ei(a,e),s)}return o}function Kn(e,t,r,n){var i=n?Vt:Bt,o=-1,a=t.length,s=e;for(e===t&&(t=Ni(t)),r&&(s=Nt(e,Xt(r)));++o<a;)for(var c=0,u=t[o],d=r?r(u):u;(c=i(s,d,c,n))>-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Xn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;Eo(i)?Ze.call(e,i,1):fi(e,i)}}return e}function qn(e,t){return e+Ut(br()*(t-e+1))}function Jn(e,t){var r="";if(!e||t<1||t>l)return r;do{t%2&&(r+=e),(t=Ut(t/2))&&(e+=e)}while(t);return r}function Zn(e,t){return Mo(Oo(e,t,oc),e+"")}function $n(e){return Zr(Gs(e))}function Qn(e,t){var r=Gs(e);return xo(r,cn(t,0,r.length))}function ei(t,r,n,i){if(!rs(t))return t;for(var o=-1,a=(r=Ei(r,t)).length,s=a-1,c=t;null!=c&&++o<a;){var u=Vo(r[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var l=c[u];(d=i?i(l,u,c):e)===e&&(d=rs(l)?l:Eo(r[o+1])?[]:{})}tn(c,u,d),c=c[u]}return t}var ti=Nr?function(e,t){return Nr.set(e,t),e}:oc,ri=ut?function(e,t){return ut(e,"toString",{configurable:!0,enumerable:!1,value:rc(t),writable:!0})}:oc;function ni(e){return xo(Gs(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Se(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return hn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ai(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ds(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return si(e,t,oc,r)}function si(t,r,n,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(r=n(r))!=r,c=null===r,u=ds(r),d=r===e;o<a;){var l=Ut((o+a)/2),f=n(t[l]),h=f!==e,p=null===f,_=f==f,v=ds(f);if(s)var m=i||_;else m=d?_&&(i||h):c?_&&h&&(i||!p):u?_&&h&&!p&&(i||!v):!p&&!v&&(i?f<=r:f<r);m?o=l+1:a=l}return yr(a,4294967294)}function ci(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Ga(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function ui(e){return"number"==typeof e?e:ds(e)?f:+e}function di(e){if("string"==typeof e)return e;if(Ya(e))return Nt(e,di)+"";if(ds(e))return Vr?Vr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function li(e,t,r){var n=-1,i=Ot,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=wt;else if(o>=200){var u=t?null:Ji(e);if(u)return sr(u);a=!1,i=Jt,c=new Xr}else c=t?[]:s;e:for(;++n<o;){var d=e[n],l=t?t(d):d;if(d=r||0!==d?d:0,a&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue e;t&&c.push(l),s.push(d)}else i(c,l,r)||(c!==s&&c.push(l),s.push(d))}return s}function fi(e,t){return null==(e=wo(e,t=Ei(t,e)))||delete e[Vo($o(t))]}function hi(e,t,r,n){return ei(e,t,r(In(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function _i(e,t){var r=e;return r instanceof Hr&&(r=r.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,kt([e],t.args))}),r)}function vi(e,t,r){var n=e.length;if(n<2)return n?li(e[0]):[];for(var i=-1,o=Se(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=fn(o[i]||a,e[s],t,r));return li(gn(o,1),t,r)}function mi(t,r,n){for(var i=-1,o=t.length,a=r.length,s={};++i<o;){var c=i<a?r[i]:e;n(s,t[i],c)}return s}function gi(e){return qa(e)?e:[]}function yi(e){return"function"==typeof e?e:oc}function Ei(e,t){return Ya(e)?e:bo(e,t)?[e]:Bo(Es(e))}var Si=Zn;function bi(t,r,n){var i=t.length;return n=n===e?i:n,!r&&n>=i?t:ii(t,r,n)}var Ti=lt||function(e){return dt.clearTimeout(e)};function Ii(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function Ai(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Ri(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ci(t,r){if(t!==r){var n=t!==e,i=null===t,o=t==t,a=ds(t),s=r!==e,c=null===r,u=r==r,d=ds(r);if(!c&&!d&&!a&&t>r||a&&s&&u&&!c&&!d||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!d&&t<r||d&&n&&o&&!i&&!a||c&&n&&o||!s&&o||!u)return-1}return 0}function Oi(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,c=t.length,u=gr(o-a,0),d=Se(c+u),l=!n;++s<c;)d[s]=t[s];for(;++i<a;)(l||i<o)&&(d[r[i]]=e[i]);for(;u--;)d[s++]=e[i++];return d}function wi(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,c=-1,u=t.length,d=gr(o-s,0),l=Se(d+u),f=!n;++i<d;)l[i]=e[i];for(var h=i;++c<u;)l[h+c]=t[c];for(;++a<s;)(f||i<o)&&(l[h+r[a]]=e[i++]);return l}function Ni(e,t){var r=-1,n=e.length;for(t||(t=Se(n));++r<n;)t[r]=e[r];return t}function ki(t,r,n,i){var o=!n;n||(n={});for(var a=-1,s=r.length;++a<s;){var c=r[a],u=i?i(n[c],t[c],c,n,t):e;u===e&&(u=t[c]),o?an(n,c,u):tn(n,c,u)}return n}function Di(e,t){return function(r,n){var i=Ya(r)?Tt:nn,o=t?t():{};return i(r,e,uo(n,2),o)}}function Pi(t){return Zn((function(r,n){var i=-1,o=n.length,a=o>1?n[o-1]:e,s=o>2?n[2]:e;for(a=t.length>3&&"function"==typeof a?(o--,a):e,s&&So(n[0],n[1],s)&&(a=o<3?e:a,o=1),r=Re(r);++i<o;){var c=n[i];c&&t(r,c,i,a)}return r}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Xa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Re(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ui(e){return function(t,r,n){for(var i=-1,o=Re(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function Li(t){return function(r){var n=nr(r=Es(r))?dr(r):e,i=n?n[0]:r.charAt(0),o=n?bi(n,1).join(""):r.slice(1);return i[t]()+o}}function xi(e){return function(t){return Dt(Qs(Ws(t).replace(qe,"")),e,"")}}function Bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return rs(n)?n:r}}function Vi(t){return function(r,n,i){var o=Re(r);if(!Xa(r)){var a=uo(n,3);r=Ps(r),n=function(e){return a(o[e],e,o)}}var s=t(r,n,i);return s>-1?o[a?r[s]:s]:e}}function ji(t){return no((function(n){var i=n.length,o=i,a=zr.prototype.thru;for(t&&n.reverse();o--;){var s=n[o];if("function"!=typeof s)throw new we(r);if(a&&!c&&"wrapper"==so(s))var c=new zr([],!0)}for(o=c?o:i;++o<i;){var u=so(s=n[o]),d="wrapper"==u?ao(s):e;c=d&&To(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?c[so(d[0])].apply(c,d[3]):1==s.length&&To(s)?c[u]():c.thru(s)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&Ya(t))return c.plant(t).value();for(var r=0,o=i?n[r].apply(this,e):t;++r<i;)o=n[r].call(this,o);return o}}))}function Fi(t,r,n,i,o,a,s,u,d,l){var f=r&c,h=1&r,p=2&r,_=24&r,v=512&r,m=p?e:Bi(t);return function e(){for(var c=arguments.length,g=Se(c),y=c;y--;)g[y]=arguments[y];if(_)var E=co(e),S=Qt(g,E);if(i&&(g=Oi(g,i,o,_)),a&&(g=wi(g,a,s,_)),c-=S,_&&c<l){var b=ar(g,E);return Xi(t,r,Fi,e.placeholder,n,g,b,u,d,l-c)}var T=h?n:this,I=p?T[t]:t;return c=g.length,u?g=No(g,u):v&&c>1&&g.reverse(),f&&d<c&&(g.length=d),this&&this!==dt&&this instanceof e&&(I=m||Bi(I)),I.apply(T,g)}}function Gi(e,t){return function(r,n){return function(e,t,r,n){return Sn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function zi(t,r){return function(n,i){var o;if(n===e&&i===e)return r;if(n!==e&&(o=n),i!==e){if(o===e)return i;"string"==typeof n||"string"==typeof i?(n=di(n),i=di(i)):(n=ui(n),i=ui(i)),o=t(n,i)}return o}}function Hi(e){return no((function(t){return t=Nt(t,Xt(uo())),Zn((function(r){var n=this;return e(t,(function(e){return bt(e,n,r)}))}))}))}function Wi(t,r){var n=(r=r===e?" ":di(r)).length;if(n<2)return n?Jn(r,t):r;var i=Jn(r,_t(t/ur(r)));return nr(r)?bi(dr(i),0,t).join(""):i.slice(0,t)}function Yi(t){return function(r,n,i){return i&&"number"!=typeof i&&So(r,n,i)&&(n=i=e),r=_s(r),n===e?(n=r,r=0):n=_s(n),function(e,t,r,n){for(var i=-1,o=gr(_t((t-e)/(r||1)),0),a=Se(o);o--;)a[n?o:++i]=e,e+=r;return a}(r,n,i=i===e?r<n?1:-1:_s(i),t)}}function Ki(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Xi(t,r,n,i,o,c,u,d,l,f){var h=8&r;r|=h?a:s,4&(r&=~(h?s:a))||(r&=-4);var p=[t,r,o,h?c:e,h?u:e,h?e:c,h?e:u,d,l,f],_=n.apply(e,p);return To(t)&&Do(_,p),_.placeholder=i,Uo(_,t,r)}function qi(e){var t=Ae[e];return function(e,r){if(e=gs(e),(r=null==r?0:yr(vs(r),292))&&_r(e)){var n=(Es(e)+"e").split("e");return+((n=(Es(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ji=Cr&&1/sr(new Cr([,-0]))[1]==d?function(e){return new Cr(e)}:dc;function Zi(e){return function(t){var r=vo(t);return r==b?ir(t):r==C?cr(t):function(e,t){return Nt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function $i(t,n,d,l,f,h,p,_){var v=2&n;if(!v&&"function"!=typeof t)throw new we(r);var m=l?l.length:0;if(m||(n&=-97,l=f=e),p=p===e?p:gr(vs(p),0),_=_===e?_:vs(_),m-=f?f.length:0,n&s){var g=l,y=f;l=f=e}var E=v?e:ao(t),S=[t,n,d,l,f,g,y,h,p,_];if(E&&function(e,t){var r=e[1],n=t[1],o=r|n,a=o<131,s=n==c&&8==r||n==c&&r==u&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!s)return e;1&n&&(e[2]=t[2],o|=1&r?0:4);var d=t[3];if(d){var l=e[3];e[3]=l?Oi(l,d,t[4]):d,e[4]=l?ar(e[3],i):t[4]}(d=t[5])&&(l=e[5],e[5]=l?wi(l,d,t[6]):d,e[6]=l?ar(e[5],i):t[6]),(d=t[7])&&(e[7]=d),n&c&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(S,E),t=S[0],n=S[1],d=S[2],l=S[3],f=S[4],!(_=S[9]=S[9]===e?v?0:t.length:gr(S[9]-m,0))&&24&n&&(n&=-25),n&&1!=n)b=8==n||n==o?function(t,r,n){var i=Bi(t);return function o(){for(var a=arguments.length,s=Se(a),c=a,u=co(o);c--;)s[c]=arguments[c];var d=a<3&&s[0]!==u&&s[a-1]!==u?[]:ar(s,u);return(a-=d.length)<n?Xi(t,r,Fi,o.placeholder,e,s,d,e,e,n-a):bt(this&&this!==dt&&this instanceof o?i:t,this,s)}}(t,n,_):n!=a&&33!=n||f.length?Fi.apply(e,S):function(e,t,r,n){var i=1&t,o=Bi(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=n.length,d=Se(u+s),l=this&&this!==dt&&this instanceof t?o:e;++c<u;)d[c]=n[c];for(;s--;)d[c++]=arguments[++a];return bt(l,i?r:this,d)}}(t,n,d,l);else var b=function(e,t,r){var n=1&t,i=Bi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(t,n,d);return Uo((E?ti:Do)(b,S),t,n)}function Qi(t,r,n,i){return t===e||Ga(t,De[n])&&!Ue.call(i,n)?r:t}function eo(t,r,n,i,o,a){return rs(t)&&rs(r)&&(a.set(r,t),zn(t,r,e,eo,a),a.delete(r)),t}function to(t){return as(t)?e:t}function ro(t,r,n,i,o,a){var s=1&n,c=t.length,u=r.length;if(c!=u&&!(s&&u>c))return!1;var d=a.get(t),l=a.get(r);if(d&&l)return d==r&&l==t;var f=-1,h=!0,p=2&n?new Xr:e;for(a.set(t,r),a.set(r,t);++f<c;){var _=t[f],v=r[f];if(i)var m=s?i(v,_,f,r,t,a):i(_,v,f,t,r,a);if(m!==e){if(m)continue;h=!1;break}if(p){if(!Mt(r,(function(e,t){if(!Jt(p,t)&&(_===e||o(_,e,n,i,a)))return p.push(t)}))){h=!1;break}}else if(_!==v&&!o(_,v,n,i,a)){h=!1;break}}return a.delete(t),a.delete(r),h}function no(t){return Mo(Oo(t,e,Ko),t+"")}function io(e){return An(e,Ps,po)}function oo(e){return An(e,Ms,_o)}var ao=Nr?function(e){return Nr.get(e)}:dc;function so(e){for(var t=e.name+"",r=kr[t],n=Ue.call(kr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(Ue.call(jr,"placeholder")?jr:e).placeholder}function uo(){var e=jr.iteratee||ac;return e=e===ac?Ln:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function fo(e){for(var t=Ps(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ro(i)]}return t}function ho(t,r){var n=function(t,r){return null==t?e:t[r]}(t,r);return Un(n)?n:e}var po=zt?function(e){return null==e?[]:(e=Re(e),Ct(zt(e),(function(t){return Xe.call(e,t)})))}:mc,_o=zt?function(e){for(var t=[];e;)kt(t,po(e)),e=Ye(e);return t}:mc,vo=Rn;function mo(e,t,r){for(var n=-1,i=(t=Ei(t,e)).length,o=!1;++n<i;){var a=Vo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ts(i)&&Eo(a,i)&&(Ya(e)||Wa(e))}function go(e){return"function"!=typeof e.constructor||Ao(e)?{}:Fr(Ye(e))}function yo(e){return Ya(e)||Wa(e)||!!(Qe&&e&&e[Qe])}function Eo(e,t){var r=typeof e;return!!(t=null==t?l:t)&&("number"==r||"symbol"!=r&&me.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,r){if(!rs(r))return!1;var n=typeof t;return!!("number"==n?Xa(r)&&Eo(t,r.length):"string"==n&&t in r)&&Ga(r[t],e)}function bo(e,t){if(Ya(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ds(e))||Q.test(e)||!$.test(e)||null!=t&&e in Re(t)}function To(e){var t=so(e),r=jr[t];if("function"!=typeof r||!(t in Hr.prototype))return!1;if(e===r)return!0;var n=ao(r);return!!n&&e===n[0]}(Ir&&vo(new Ir(new ArrayBuffer(1)))!=D||Ar&&vo(new Ar)!=b||Rr&&vo(Rr.resolve())!=A||Cr&&vo(new Cr)!=C||Or&&vo(new Or)!=N)&&(vo=function(t){var r=Rn(t),n=r==I?t.constructor:e,i=n?jo(n):"";if(i)switch(i){case Dr:return D;case Pr:return b;case Mr:return A;case Ur:return C;case Lr:return N}return r});var Io=Pe?Qa:gc;function Ao(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||De)}function Ro(e){return e==e&&!rs(e)}function Co(t,r){return function(n){return null!=n&&n[t]===r&&(r!==e||t in Re(n))}}function Oo(t,r,n){return r=gr(r===e?t.length-1:r,0),function(){for(var e=arguments,i=-1,o=gr(e.length-r,0),a=Se(o);++i<o;)a[i]=e[r+i];i=-1;for(var s=Se(r+1);++i<r;)s[i]=e[i];return s[r]=n(a),bt(t,this,s)}}function wo(e,t){return t.length<2?e:In(e,ii(t,0,-1))}function No(t,r){for(var n=t.length,i=yr(r.length,n),o=Ni(t);i--;){var a=r[i];t[i]=Eo(a,n)?o[a]:e}return t}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=Lo(ti),Po=pt||function(e,t){return dt.setTimeout(e,t)},Mo=Lo(ri);function Uo(e,t,r){var n=t+"";return Mo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return It(p,(function(r){var n="_."+r[0];t&r[1]&&!Ot(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(n),r)))}function Lo(t){var r=0,n=0;return function(){var i=Er(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(e,arguments)}}function xo(t,r){var n=-1,i=t.length,o=i-1;for(r=r===e?i:r;++n<r;){var a=qn(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=r,t}var Bo=function(e){var t=La(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(de,"$1"):r||e)})),t}));function Vo(e){if("string"==typeof e||ds(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fo(e){if(e instanceof Hr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ni(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Go=Zn((function(e,t){return qa(e)?fn(e,gn(t,1,qa,!0)):[]})),zo=Zn((function(t,r){var n=$o(r);return qa(n)&&(n=e),qa(t)?fn(t,gn(r,1,qa,!0),uo(n,2)):[]})),Ho=Zn((function(t,r){var n=$o(r);return qa(n)&&(n=e),qa(t)?fn(t,gn(r,1,qa,!0),e,n):[]}));function Wo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),xt(e,uo(t,3),i)}function Yo(t,r,n){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return n!==e&&(o=vs(n),o=n<0?gr(i+o,0):yr(o,i-1)),xt(t,uo(r,3),o,!0)}function Ko(e){return null!=e&&e.length?gn(e,1):[]}function Xo(t){return t&&t.length?t[0]:e}var qo=Zn((function(e){var t=Nt(e,gi);return t.length&&t[0]===e[0]?Nn(t):[]})),Jo=Zn((function(t){var r=$o(t),n=Nt(t,gi);return r===$o(n)?r=e:n.pop(),n.length&&n[0]===t[0]?Nn(n,uo(r,2)):[]})),Zo=Zn((function(t){var r=$o(t),n=Nt(t,gi);return(r="function"==typeof r?r:e)&&n.pop(),n.length&&n[0]===t[0]?Nn(n,e,r):[]}));function $o(t){var r=null==t?0:t.length;return r?t[r-1]:e}var Qo=Zn(ea);function ea(e,t){return e&&e.length&&t&&t.length?Kn(e,t):e}var ta=no((function(e,t){var r=null==e?0:e.length,n=sn(e,t);return Xn(e,Nt(t,(function(e){return Eo(e,r)?+e:e})).sort(Ci)),n}));function ra(e){return null==e?e:Tr.call(e)}var na=Zn((function(e){return li(gn(e,1,qa,!0))})),ia=Zn((function(t){var r=$o(t);return qa(r)&&(r=e),li(gn(t,1,qa,!0),uo(r,2))})),oa=Zn((function(t){var r=$o(t);return r="function"==typeof r?r:e,li(gn(t,1,qa,!0),e,r)}));function aa(e){if(!e||!e.length)return[];var t=0;return e=Ct(e,(function(e){if(qa(e))return t=gr(e.length,t),!0})),Yt(t,(function(t){return Nt(e,Gt(t))}))}function sa(t,r){if(!t||!t.length)return[];var n=aa(t);return null==r?n:Nt(n,(function(t){return bt(r,e,t)}))}var ca=Zn((function(e,t){return qa(e)?fn(e,t):[]})),ua=Zn((function(e){return vi(Ct(e,qa))})),da=Zn((function(t){var r=$o(t);return qa(r)&&(r=e),vi(Ct(t,qa),uo(r,2))})),la=Zn((function(t){var r=$o(t);return r="function"==typeof r?r:e,vi(Ct(t,qa),e,r)})),fa=Zn(aa),ha=Zn((function(t){var r=t.length,n=r>1?t[r-1]:e;return n="function"==typeof n?(t.pop(),n):e,sa(t,n)}));function pa(e){var t=jr(e);return t.__chain__=!0,t}function _a(e,t){return t(e)}var va=no((function(t){var r=t.length,n=r?t[0]:0,i=this.__wrapped__,o=function(e){return sn(e,t)};return!(r>1||this.__actions__.length)&&i instanceof Hr&&Eo(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:_a,args:[o],thisArg:e}),new zr(i,this.__chain__).thru((function(t){return r&&!t.length&&t.push(e),t}))):this.thru(o)})),ma=Di((function(e,t,r){Ue.call(e,r)?++e[r]:an(e,r,1)})),ga=Vi(Wo),ya=Vi(Yo);function Ea(e,t){return(Ya(e)?It:hn)(e,uo(t,3))}function Sa(e,t){return(Ya(e)?At:pn)(e,uo(t,3))}var ba=Di((function(e,t,r){Ue.call(e,r)?e[r].push(t):an(e,r,[t])})),Ta=Zn((function(e,t,r){var n=-1,i="function"==typeof t,o=Xa(e)?Se(e.length):[];return hn(e,(function(e){o[++n]=i?bt(t,e,r):kn(e,t,r)})),o})),Ia=Di((function(e,t,r){an(e,r,t)}));function Aa(e,t){return(Ya(e)?Nt:jn)(e,uo(t,3))}var Ra=Di((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),Ca=Zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&So(e,t[0],t[1])?t=[]:r>2&&So(t[0],t[1],t[2])&&(t=[t[0]]),Wn(e,gn(t,1),[])})),Oa=ft||function(){return dt.Date.now()};function wa(t,r,n){return r=n?e:r,r=t&&null==r?t.length:r,$i(t,c,e,e,e,e,r)}function Na(t,n){var i;if("function"!=typeof n)throw new we(r);return t=vs(t),function(){return--t>0&&(i=n.apply(this,arguments)),t<=1&&(n=e),i}}var ka=Zn((function(e,t,r){var n=1;if(r.length){var i=ar(r,co(ka));n|=a}return $i(e,n,t,r,i)})),Da=Zn((function(e,t,r){var n=3;if(r.length){var i=ar(r,co(Da));n|=a}return $i(t,n,e,r,i)}));function Pa(t,n,i){var o,a,s,c,u,d,l=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new we(r);function _(r){var n=o,i=a;return o=a=e,l=r,c=t.apply(i,n)}function v(e){return l=e,u=Po(g,n),f?_(e):c}function m(t){var r=t-d;return d===e||r>=n||r<0||h&&t-l>=s}function g(){var e=Oa();if(m(e))return y(e);u=Po(g,function(e){var t=n-(e-d);return h?yr(t,s-(e-l)):t}(e))}function y(t){return u=e,p&&o?_(t):(o=a=e,c)}function E(){var t=Oa(),r=m(t);if(o=arguments,a=this,d=t,r){if(u===e)return v(d);if(h)return Ti(u),u=Po(g,n),_(d)}return u===e&&(u=Po(g,n)),c}return n=gs(n)||0,rs(i)&&(f=!!i.leading,s=(h="maxWait"in i)?gr(gs(i.maxWait)||0,n):s,p="trailing"in i?!!i.trailing:p),E.cancel=function(){u!==e&&Ti(u),l=0,o=d=a=u=e},E.flush=function(){return u===e?c:y(Oa())},E}var Ma=Zn((function(e,t){return ln(e,1,t)})),Ua=Zn((function(e,t,r){return ln(e,gs(t)||0,r)}));function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new we(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||Kr),n}function xa(e){if("function"!=typeof e)throw new we(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=Kr;var Ba=Si((function(e,t){var r=(t=1==t.length&&Ya(t[0])?Nt(t[0],Xt(uo())):Nt(gn(t,1),Xt(uo()))).length;return Zn((function(n){for(var i=-1,o=yr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return bt(e,this,n)}))})),Va=Zn((function(t,r){var n=ar(r,co(Va));return $i(t,a,e,r,n)})),ja=Zn((function(t,r){var n=ar(r,co(ja));return $i(t,s,e,r,n)})),Fa=no((function(t,r){return $i(t,u,e,e,e,r)}));function Ga(e,t){return e===t||e!=e&&t!=t}var za=Ki(Cn),Ha=Ki((function(e,t){return e>=t})),Wa=Dn(function(){return arguments}())?Dn:function(e){return ns(e)&&Ue.call(e,"callee")&&!Xe.call(e,"callee")},Ya=Se.isArray,Ka=vt?Xt(vt):function(e){return ns(e)&&Rn(e)==k};function Xa(e){return null!=e&&ts(e.length)&&!Qa(e)}function qa(e){return ns(e)&&Xa(e)}var Ja=pr||gc,Za=mt?Xt(mt):function(e){return ns(e)&&Rn(e)==g};function $a(e){if(!ns(e))return!1;var t=Rn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Qa(e){if(!rs(e))return!1;var t=Rn(e);return t==E||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function es(e){return"number"==typeof e&&e==vs(e)}function ts(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=l}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var is=gt?Xt(gt):function(e){return ns(e)&&vo(e)==b};function os(e){return"number"==typeof e||ns(e)&&Rn(e)==T}function as(e){if(!ns(e)||Rn(e)!=I)return!1;var t=Ye(e);if(null===t)return!0;var r=Ue.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Ve}var ss=yt?Xt(yt):function(e){return ns(e)&&Rn(e)==R},cs=Et?Xt(Et):function(e){return ns(e)&&vo(e)==C};function us(e){return"string"==typeof e||!Ya(e)&&ns(e)&&Rn(e)==O}function ds(e){return"symbol"==typeof e||ns(e)&&Rn(e)==w}var ls=St?Xt(St):function(e){return ns(e)&&ts(e.length)&&!!nt[Rn(e)]},fs=Ki(Vn),hs=Ki((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Xa(e))return us(e)?dr(e):Ni(e);if(ot&&e[ot])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[ot]());var t=vo(e);return(t==b?ir:t==C?sr:Gs)(e)}function _s(e){return e?(e=gs(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=_s(e),r=t%1;return t==t?r?t-r:t:0}function ms(e){return e?cn(vs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ds(e))return f;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var r=pe.test(e);return r||ve.test(e)?st(e.slice(2),r?2:8):he.test(e)?f:+e}function ys(e){return ki(e,Ms(e))}function Es(e){return null==e?"":di(e)}var Ss=Pi((function(e,t){if(Ao(t)||Xa(t))ki(t,Ps(t),e);else for(var r in t)Ue.call(t,r)&&tn(e,r,t[r])})),bs=Pi((function(e,t){ki(t,Ms(t),e)})),Ts=Pi((function(e,t,r,n){ki(t,Ms(t),e,n)})),Is=Pi((function(e,t,r,n){ki(t,Ps(t),e,n)})),As=no(sn),Rs=Zn((function(t,r){t=Re(t);var n=-1,i=r.length,o=i>2?r[2]:e;for(o&&So(r[0],r[1],o)&&(i=1);++n<i;)for(var a=r[n],s=Ms(a),c=-1,u=s.length;++c<u;){var d=s[c],l=t[d];(l===e||Ga(l,De[d])&&!Ue.call(t,d))&&(t[d]=a[d])}return t})),Cs=Zn((function(t){return t.push(e,eo),bt(Ls,e,t)}));function Os(t,r,n){var i=null==t?e:In(t,r);return i===e?n:i}function ws(e,t){return null!=e&&mo(e,t,wn)}var Ns=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),e[t]=r}),rc(oc)),ks=Gi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Be.call(t)),Ue.call(e,t)?e[t].push(r):e[t]=[r]}),uo),Ds=Zn(kn);function Ps(e){return Xa(e)?Jr(e):xn(e)}function Ms(e){return Xa(e)?Jr(e,!0):Bn(e)}var Us=Pi((function(e,t,r){zn(e,t,r)})),Ls=Pi((function(e,t,r,n){zn(e,t,r,n)})),xs=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=Nt(t,(function(t){return t=Ei(t,e),n||(n=t.length>1),t})),ki(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)fi(r,t[i]);return r})),Bs=no((function(e,t){return null==e?{}:function(e,t){return Yn(e,t,(function(t,r){return ws(e,r)}))}(e,t)}));function Vs(e,t){if(null==e)return{};var r=Nt(oo(e),(function(e){return[e]}));return t=uo(t),Yn(e,r,(function(e,r){return t(e,r[0])}))}var js=Zi(Ps),Fs=Zi(Ms);function Gs(e){return null==e?[]:qt(e,Ps(e))}var zs=xi((function(e,t,r){return t=t.toLowerCase(),e+(r?Hs(t):t)}));function Hs(e){return $s(Es(e).toLowerCase())}function Ws(e){return(e=Es(e))&&e.replace(ge,er).replace(Je,"")}var Ys=xi((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ks=xi((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Xs=Li("toLowerCase"),qs=xi((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Js=xi((function(e,t,r){return e+(r?" ":"")+$s(t)})),Zs=xi((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$s=Li("toUpperCase");function Qs(t,r,n){return t=Es(t),(r=n?e:r)===e?function(e){return et.test(e)}(t)?function(e){return e.match($e)||[]}(t):function(e){return e.match(ce)||[]}(t):t.match(r)||[]}var ec=Zn((function(t,r){try{return bt(t,e,r)}catch(e){return $a(e)?e:new Te(e)}})),tc=no((function(e,t){return It(t,(function(t){t=Vo(t),an(e,t,ka(e[t],e))})),e}));function rc(e){return function(){return e}}var nc=ji(),ic=ji(!0);function oc(e){return e}function ac(e){return Ln("function"==typeof e?e:un(e,1))}var sc=Zn((function(e,t){return function(r){return kn(r,e,t)}})),cc=Zn((function(e,t){return function(r){return kn(e,r,t)}}));function uc(e,t,r){var n=Ps(t),i=Tn(t,n);null!=r||rs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Tn(t,Ps(t)));var o=!(rs(r)&&"chain"in r&&!r.chain),a=Qa(e);return It(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=Ni(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,kt([this.value()],arguments))})})),e}function dc(){}var lc=Hi(Nt),fc=Hi(Rt),hc=Hi(Mt);function pc(e){return bo(e)?Gt(Vo(e)):function(e){return function(t){return In(t,e)}}(e)}var _c=Yi(),vc=Yi(!0);function mc(){return[]}function gc(){return!1}var yc,Ec=zi((function(e,t){return e+t}),0),Sc=qi("ceil"),bc=zi((function(e,t){return e/t}),1),Tc=qi("floor"),Ic=zi((function(e,t){return e*t}),1),Ac=qi("round"),Rc=zi((function(e,t){return e-t}),0);return jr.after=function(e,t){if("function"!=typeof t)throw new we(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},jr.ary=wa,jr.assign=Ss,jr.assignIn=bs,jr.assignInWith=Ts,jr.assignWith=Is,jr.at=As,jr.before=Na,jr.bind=ka,jr.bindAll=tc,jr.bindKey=Da,jr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},jr.chain=pa,jr.chunk=function(t,r,n){r=(n?So(t,r,n):r===e)?1:gr(vs(r),0);var i=null==t?0:t.length;if(!i||r<1)return[];for(var o=0,a=0,s=Se(_t(i/r));o<i;)s[a++]=ii(t,o,o+=r);return s},jr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},jr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Se(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return kt(Ya(r)?Ni(r):[r],gn(t,1))},jr.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?Nt(e,(function(e){if("function"!=typeof e[1])throw new we(r);return[n(e[0]),e[1]]})):[],Zn((function(r){for(var n=-1;++n<t;){var i=e[n];if(bt(i[0],this,r))return bt(i[1],this,r)}}))},jr.conforms=function(e){return function(e){var t=Ps(e);return function(r){return dn(r,e,t)}}(un(e,1))},jr.constant=rc,jr.countBy=ma,jr.create=function(e,t){var r=Fr(e);return null==t?r:on(r,t)},jr.curry=function t(r,n,i){var o=$i(r,8,e,e,e,e,e,n=i?e:n);return o.placeholder=t.placeholder,o},jr.curryRight=function t(r,n,i){var a=$i(r,o,e,e,e,e,e,n=i?e:n);return a.placeholder=t.placeholder,a},jr.debounce=Pa,jr.defaults=Rs,jr.defaultsDeep=Cs,jr.defer=Ma,jr.delay=Ua,jr.difference=Go,jr.differenceBy=zo,jr.differenceWith=Ho,jr.drop=function(t,r,n){var i=null==t?0:t.length;return i?ii(t,(r=n||r===e?1:vs(r))<0?0:r,i):[]},jr.dropRight=function(t,r,n){var i=null==t?0:t.length;return i?ii(t,0,(r=i-(r=n||r===e?1:vs(r)))<0?0:r):[]},jr.dropRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0,!0):[]},jr.dropWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0):[]},jr.fill=function(t,r,n,i){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&So(t,r,n)&&(n=0,i=o),function(t,r,n,i){var o=t.length;for((n=vs(n))<0&&(n=-n>o?0:o+n),(i=i===e||i>o?o:vs(i))<0&&(i+=o),i=n>i?0:ms(i);n<i;)t[n++]=r;return t}(t,r,n,i)):[]},jr.filter=function(e,t){return(Ya(e)?Ct:mn)(e,uo(t,3))},jr.flatMap=function(e,t){return gn(Aa(e,t),1)},jr.flatMapDeep=function(e,t){return gn(Aa(e,t),d)},jr.flatMapDepth=function(t,r,n){return n=n===e?1:vs(n),gn(Aa(t,r),n)},jr.flatten=Ko,jr.flattenDeep=function(e){return null!=e&&e.length?gn(e,d):[]},jr.flattenDepth=function(t,r){return null!=t&&t.length?gn(t,r=r===e?1:vs(r)):[]},jr.flip=function(e){return $i(e,512)},jr.flow=nc,jr.flowRight=ic,jr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},jr.functions=function(e){return null==e?[]:Tn(e,Ps(e))},jr.functionsIn=function(e){return null==e?[]:Tn(e,Ms(e))},jr.groupBy=ba,jr.initial=function(e){return null!=e&&e.length?ii(e,0,-1):[]},jr.intersection=qo,jr.intersectionBy=Jo,jr.intersectionWith=Zo,jr.invert=Ns,jr.invertBy=ks,jr.invokeMap=Ta,jr.iteratee=ac,jr.keyBy=Ia,jr.keys=Ps,jr.keysIn=Ms,jr.map=Aa,jr.mapKeys=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,t(e,n,i),e)})),r},jr.mapValues=function(e,t){var r={};return t=uo(t,3),Sn(e,(function(e,n,i){an(r,n,t(e,n,i))})),r},jr.matches=function(e){return Fn(un(e,1))},jr.matchesProperty=function(e,t){return Gn(e,un(t,1))},jr.memoize=La,jr.merge=Us,jr.mergeWith=Ls,jr.method=sc,jr.methodOf=cc,jr.mixin=uc,jr.negate=xa,jr.nthArg=function(e){return e=vs(e),Zn((function(t){return Hn(t,e)}))},jr.omit=xs,jr.omitBy=function(e,t){return Vs(e,xa(uo(t)))},jr.once=function(e){return Na(2,e)},jr.orderBy=function(t,r,n,i){return null==t?[]:(Ya(r)||(r=null==r?[]:[r]),Ya(n=i?e:n)||(n=null==n?[]:[n]),Wn(t,r,n))},jr.over=lc,jr.overArgs=Ba,jr.overEvery=fc,jr.overSome=hc,jr.partial=Va,jr.partialRight=ja,jr.partition=Ra,jr.pick=Bs,jr.pickBy=Vs,jr.property=pc,jr.propertyOf=function(t){return function(r){return null==t?e:In(t,r)}},jr.pull=Qo,jr.pullAll=ea,jr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Kn(e,t,uo(r,2)):e},jr.pullAllWith=function(t,r,n){return t&&t.length&&r&&r.length?Kn(t,r,e,n):t},jr.pullAt=ta,jr.range=_c,jr.rangeRight=vc,jr.rearg=Fa,jr.reject=function(e,t){return(Ya(e)?Ct:mn)(e,xa(uo(t,3)))},jr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=uo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Xn(e,i),r},jr.rest=function(t,n){if("function"!=typeof t)throw new we(r);return Zn(t,n=n===e?n:vs(n))},jr.reverse=ra,jr.sampleSize=function(t,r,n){return r=(n?So(t,r,n):r===e)?1:vs(r),(Ya(t)?$r:Qn)(t,r)},jr.set=function(e,t,r){return null==e?e:ei(e,t,r)},jr.setWith=function(t,r,n,i){return i="function"==typeof i?i:e,null==t?t:ei(t,r,n,i)},jr.shuffle=function(e){return(Ya(e)?Qr:ni)(e)},jr.slice=function(t,r,n){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&So(t,r,n)?(r=0,n=i):(r=null==r?0:vs(r),n=n===e?i:vs(n)),ii(t,r,n)):[]},jr.sortBy=Ca,jr.sortedUniq=function(e){return e&&e.length?ci(e):[]},jr.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},jr.split=function(t,r,n){return n&&"number"!=typeof n&&So(t,r,n)&&(r=n=e),(n=n===e?h:n>>>0)?(t=Es(t))&&("string"==typeof r||null!=r&&!ss(r))&&!(r=di(r))&&nr(t)?bi(dr(t),0,n):t.split(r,n):[]},jr.spread=function(e,t){if("function"!=typeof e)throw new we(r);return t=null==t?0:gr(vs(t),0),Zn((function(r){var n=r[t],i=bi(r,0,t);return n&&kt(i,n),bt(e,this,i)}))},jr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},jr.take=function(t,r,n){return t&&t.length?ii(t,0,(r=n||r===e?1:vs(r))<0?0:r):[]},jr.takeRight=function(t,r,n){var i=null==t?0:t.length;return i?ii(t,(r=i-(r=n||r===e?1:vs(r)))<0?0:r,i):[]},jr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},jr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},jr.tap=function(e,t){return t(e),e},jr.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new we(r);return rs(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Pa(e,t,{leading:i,maxWait:t,trailing:o})},jr.thru=_a,jr.toArray=ps,jr.toPairs=js,jr.toPairsIn=Fs,jr.toPath=function(e){return Ya(e)?Nt(e,Vo):ds(e)?[e]:Ni(Bo(Es(e)))},jr.toPlainObject=ys,jr.transform=function(e,t,r){var n=Ya(e),i=n||Ja(e)||ls(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:rs(e)&&Qa(o)?Fr(Ye(e)):{}}return(i?It:Sn)(e,(function(e,n,i){return t(r,e,n,i)})),r},jr.unary=function(e){return wa(e,1)},jr.union=na,jr.unionBy=ia,jr.unionWith=oa,jr.uniq=function(e){return e&&e.length?li(e):[]},jr.uniqBy=function(e,t){return e&&e.length?li(e,uo(t,2)):[]},jr.uniqWith=function(t,r){return r="function"==typeof r?r:e,t&&t.length?li(t,e,r):[]},jr.unset=function(e,t){return null==e||fi(e,t)},jr.unzip=aa,jr.unzipWith=sa,jr.update=function(e,t,r){return null==e?e:hi(e,t,yi(r))},jr.updateWith=function(t,r,n,i){return i="function"==typeof i?i:e,null==t?t:hi(t,r,yi(n),i)},jr.values=Gs,jr.valuesIn=function(e){return null==e?[]:qt(e,Ms(e))},jr.without=ca,jr.words=Qs,jr.wrap=function(e,t){return Va(yi(t),e)},jr.xor=ua,jr.xorBy=da,jr.xorWith=la,jr.zip=fa,jr.zipObject=function(e,t){return mi(e||[],t||[],tn)},jr.zipObjectDeep=function(e,t){return mi(e||[],t||[],ei)},jr.zipWith=ha,jr.entries=js,jr.entriesIn=Fs,jr.extend=bs,jr.extendWith=Ts,uc(jr,jr),jr.add=Ec,jr.attempt=ec,jr.camelCase=zs,jr.capitalize=Hs,jr.ceil=Sc,jr.clamp=function(t,r,n){return n===e&&(n=r,r=e),n!==e&&(n=(n=gs(n))==n?n:0),r!==e&&(r=(r=gs(r))==r?r:0),cn(gs(t),r,n)},jr.clone=function(e){return un(e,4)},jr.cloneDeep=function(e){return un(e,5)},jr.cloneDeepWith=function(t,r){return un(t,5,r="function"==typeof r?r:e)},jr.cloneWith=function(t,r){return un(t,4,r="function"==typeof r?r:e)},jr.conformsTo=function(e,t){return null==t||dn(e,t,Ps(t))},jr.deburr=Ws,jr.defaultTo=function(e,t){return null==e||e!=e?t:e},jr.divide=bc,jr.endsWith=function(t,r,n){t=Es(t),r=di(r);var i=t.length,o=n=n===e?i:cn(vs(n),0,i);return(n-=r.length)>=0&&t.slice(n,o)==r},jr.eq=Ga,jr.escape=function(e){return(e=Es(e))&&X.test(e)?e.replace(Y,tr):e},jr.escapeRegExp=function(e){return(e=Es(e))&&re.test(e)?e.replace(te,"\\$&"):e},jr.every=function(t,r,n){var i=Ya(t)?Rt:_n;return n&&So(t,r,n)&&(r=e),i(t,uo(r,3))},jr.find=ga,jr.findIndex=Wo,jr.findKey=function(e,t){return Lt(e,uo(t,3),Sn)},jr.findLast=ya,jr.findLastIndex=Yo,jr.findLastKey=function(e,t){return Lt(e,uo(t,3),bn)},jr.floor=Tc,jr.forEach=Ea,jr.forEachRight=Sa,jr.forIn=function(e,t){return null==e?e:yn(e,uo(t,3),Ms)},jr.forInRight=function(e,t){return null==e?e:En(e,uo(t,3),Ms)},jr.forOwn=function(e,t){return e&&Sn(e,uo(t,3))},jr.forOwnRight=function(e,t){return e&&bn(e,uo(t,3))},jr.get=Os,jr.gt=za,jr.gte=Ha,jr.has=function(e,t){return null!=e&&mo(e,t,On)},jr.hasIn=ws,jr.head=Xo,jr.identity=oc,jr.includes=function(e,t,r,n){e=Xa(e)?e:Gs(e),r=r&&!n?vs(r):0;var i=e.length;return r<0&&(r=gr(i+r,0)),us(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Bt(e,t,r)>-1},jr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=gr(n+i,0)),Bt(e,t,i)},jr.inRange=function(t,r,n){return r=_s(r),n===e?(n=r,r=0):n=_s(n),function(e,t,r){return e>=yr(t,r)&&e<gr(t,r)}(t=gs(t),r,n)},jr.invoke=Ds,jr.isArguments=Wa,jr.isArray=Ya,jr.isArrayBuffer=Ka,jr.isArrayLike=Xa,jr.isArrayLikeObject=qa,jr.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Rn(e)==m},jr.isBuffer=Ja,jr.isDate=Za,jr.isElement=function(e){return ns(e)&&1===e.nodeType&&!as(e)},jr.isEmpty=function(e){if(null==e)return!0;if(Xa(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||Ja(e)||ls(e)||Wa(e)))return!e.length;var t=vo(e);if(t==b||t==C)return!e.size;if(Ao(e))return!xn(e).length;for(var r in e)if(Ue.call(e,r))return!1;return!0},jr.isEqual=function(e,t){return Pn(e,t)},jr.isEqualWith=function(t,r,n){var i=(n="function"==typeof n?n:e)?n(t,r):e;return i===e?Pn(t,r,e,n):!!i},jr.isError=$a,jr.isFinite=function(e){return"number"==typeof e&&_r(e)},jr.isFunction=Qa,jr.isInteger=es,jr.isLength=ts,jr.isMap=is,jr.isMatch=function(e,t){return e===t||Mn(e,t,fo(t))},jr.isMatchWith=function(t,r,n){return n="function"==typeof n?n:e,Mn(t,r,fo(r),n)},jr.isNaN=function(e){return os(e)&&e!=+e},jr.isNative=function(e){if(Io(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Un(e)},jr.isNil=function(e){return null==e},jr.isNull=function(e){return null===e},jr.isNumber=os,jr.isObject=rs,jr.isObjectLike=ns,jr.isPlainObject=as,jr.isRegExp=ss,jr.isSafeInteger=function(e){return es(e)&&e>=-9007199254740991&&e<=l},jr.isSet=cs,jr.isString=us,jr.isSymbol=ds,jr.isTypedArray=ls,jr.isUndefined=function(t){return t===e},jr.isWeakMap=function(e){return ns(e)&&vo(e)==N},jr.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Rn(e)},jr.join=function(e,t){return null==e?"":vr.call(e,t)},jr.kebabCase=Ys,jr.last=$o,jr.lastIndexOf=function(t,r,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==e&&(o=(o=vs(n))<0?gr(i+o,0):yr(o,i-1)),r==r?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(t,r,o):xt(t,jt,o,!0)},jr.lowerCase=Ks,jr.lowerFirst=Xs,jr.lt=fs,jr.lte=hs,jr.max=function(t){return t&&t.length?vn(t,oc,Cn):e},jr.maxBy=function(t,r){return t&&t.length?vn(t,uo(r,2),Cn):e},jr.mean=function(e){return Ft(e,oc)},jr.meanBy=function(e,t){return Ft(e,uo(t,2))},jr.min=function(t){return t&&t.length?vn(t,oc,Vn):e},jr.minBy=function(t,r){return t&&t.length?vn(t,uo(r,2),Vn):e},jr.stubArray=mc,jr.stubFalse=gc,jr.stubObject=function(){return{}},jr.stubString=function(){return""},jr.stubTrue=function(){return!0},jr.multiply=Ic,jr.nth=function(t,r){return t&&t.length?Hn(t,vs(r)):e},jr.noConflict=function(){return dt._===this&&(dt._=je),this},jr.noop=dc,jr.now=Oa,jr.pad=function(e,t,r){e=Es(e);var n=(t=vs(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Wi(Ut(i),r)+e+Wi(_t(i),r)},jr.padEnd=function(e,t,r){e=Es(e);var n=(t=vs(t))?ur(e):0;return t&&n<t?e+Wi(t-n,r):e},jr.padStart=function(e,t,r){e=Es(e);var n=(t=vs(t))?ur(e):0;return t&&n<t?Wi(t-n,r)+e:e},jr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Sr(Es(e).replace(ne,""),t||0)},jr.random=function(t,r,n){if(n&&"boolean"!=typeof n&&So(t,r,n)&&(r=n=e),n===e&&("boolean"==typeof r?(n=r,r=e):"boolean"==typeof t&&(n=t,t=e)),t===e&&r===e?(t=0,r=1):(t=_s(t),r===e?(r=t,t=0):r=_s(r)),t>r){var i=t;t=r,r=i}if(n||t%1||r%1){var o=br();return yr(t+o*(r-t+at("1e-"+((o+"").length-1))),r)}return qn(t,r)},jr.reduce=function(e,t,r){var n=Ya(e)?Dt:Ht,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},jr.reduceRight=function(e,t,r){var n=Ya(e)?Pt:Ht,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},jr.repeat=function(t,r,n){return r=(n?So(t,r,n):r===e)?1:vs(r),Jn(Es(t),r)},jr.replace=function(){var e=arguments,t=Es(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jr.result=function(t,r,n){var i=-1,o=(r=Ei(r,t)).length;for(o||(o=1,t=e);++i<o;){var a=null==t?e:t[Vo(r[i])];a===e&&(i=o,a=n),t=Qa(a)?a.call(t):a}return t},jr.round=Ac,jr.runInContext=t,jr.sample=function(e){return(Ya(e)?Zr:$n)(e)},jr.size=function(e){if(null==e)return 0;if(Xa(e))return us(e)?ur(e):e.length;var t=vo(e);return t==b||t==C?e.size:xn(e).length},jr.snakeCase=qs,jr.some=function(t,r,n){var i=Ya(t)?Mt:oi;return n&&So(t,r,n)&&(r=e),i(t,uo(r,3))},jr.sortedIndex=function(e,t){return ai(e,t)},jr.sortedIndexBy=function(e,t,r){return si(e,t,uo(r,2))},jr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ai(e,t);if(n<r&&Ga(e[n],t))return n}return-1},jr.sortedLastIndex=function(e,t){return ai(e,t,!0)},jr.sortedLastIndexBy=function(e,t,r){return si(e,t,uo(r,2),!0)},jr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ai(e,t,!0)-1;if(Ga(e[r],t))return r}return-1},jr.startCase=Js,jr.startsWith=function(e,t,r){return e=Es(e),r=null==r?0:cn(vs(r),0,e.length),t=di(t),e.slice(r,r+t.length)==t},jr.subtract=Rc,jr.sum=function(e){return e&&e.length?Wt(e,oc):0},jr.sumBy=function(e,t){return e&&e.length?Wt(e,uo(t,2)):0},jr.template=function(t,r,n){var i=jr.templateSettings;n&&So(t,r,n)&&(r=e),t=Es(t),r=Ts({},r,i,Qi);var o,a,s=Ts({},r.imports,i.imports,Qi),c=Ps(s),u=qt(s,c),d=0,l=r.interpolate||ye,f="__p += '",h=Ce((r.escape||ye).source+"|"+l.source+"|"+(l===Z?le:ye).source+"|"+(r.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Ue.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";t.replace(h,(function(e,r,n,i,s,c){return n||(n=i),f+=t.slice(d,c).replace(Ee,rr),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=c+e.length,e})),f+="';\n";var _=Ue.call(r,"variable")&&r.variable;if(_){if(ue.test(_))throw new Te("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(G,""):f).replace(z,"$1").replace(H,"$1;"),f="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=ec((function(){return Ie(c,p+"return "+f).apply(e,u)}));if(v.source=f,$a(v))throw v;return v},jr.times=function(e,t){if((e=vs(e))<1||e>l)return[];var r=h,n=yr(e,h);t=uo(t),e-=h;for(var i=Yt(n,t);++r<e;)t(r);return i},jr.toFinite=_s,jr.toInteger=vs,jr.toLength=ms,jr.toLower=function(e){return Es(e).toLowerCase()},jr.toNumber=gs,jr.toSafeInteger=function(e){return e?cn(vs(e),-9007199254740991,l):0===e?e:0},jr.toString=Es,jr.toUpper=function(e){return Es(e).toUpperCase()},jr.trim=function(t,r,n){if((t=Es(t))&&(n||r===e))return Kt(t);if(!t||!(r=di(r)))return t;var i=dr(t),o=dr(r);return bi(i,Zt(i,o),$t(i,o)+1).join("")},jr.trimEnd=function(t,r,n){if((t=Es(t))&&(n||r===e))return t.slice(0,lr(t)+1);if(!t||!(r=di(r)))return t;var i=dr(t);return bi(i,0,$t(i,dr(r))+1).join("")},jr.trimStart=function(t,r,n){if((t=Es(t))&&(n||r===e))return t.replace(ne,"");if(!t||!(r=di(r)))return t;var i=dr(t);return bi(i,Zt(i,dr(r))).join("")},jr.truncate=function(t,r){var n=30,i="...";if(rs(r)){var o="separator"in r?r.separator:o;n="length"in r?vs(r.length):n,i="omission"in r?di(r.omission):i}var a=(t=Es(t)).length;if(nr(t)){var s=dr(t);a=s.length}if(n>=a)return t;var c=n-ur(i);if(c<1)return i;var u=s?bi(s,0,c).join(""):t.slice(0,c);if(o===e)return u+i;if(s&&(c+=u.length-c),ss(o)){if(t.slice(c).search(o)){var d,l=u;for(o.global||(o=Ce(o.source,Es(fe.exec(o))+"g")),o.lastIndex=0;d=o.exec(l);)var f=d.index;u=u.slice(0,f===e?c:f)}}else if(t.indexOf(di(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},jr.unescape=function(e){return(e=Es(e))&&K.test(e)?e.replace(W,fr):e},jr.uniqueId=function(e){var t=++Le;return Es(e)+t},jr.upperCase=Zs,jr.upperFirst=$s,jr.each=Ea,jr.eachRight=Sa,jr.first=Xo,uc(jr,(yc={},Sn(jr,(function(e,t){Ue.call(jr.prototype,t)||(yc[t]=e)})),yc),{chain:!1}),jr.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){jr[e].placeholder=jr})),It(["drop","take"],(function(t,r){Hr.prototype[t]=function(n){n=n===e?1:gr(vs(n),0);var i=this.__filtered__&&!r?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=yr(n,i.__takeCount__):i.__views__.push({size:yr(n,h),type:t+(i.__dir__<0?"Right":"")}),i},Hr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),It(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),It(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(oc)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Zn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return kn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(xa(uo(e)))},Hr.prototype.slice=function(t,r){t=vs(t);var n=this;return n.__filtered__&&(t>0||r<0)?new Hr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),r!==e&&(n=(r=vs(r))<0?n.dropRight(-r):n.take(r-t)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(h)},Sn(Hr.prototype,(function(t,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),o=jr[i?"take"+("last"==r?"Right":""):r],a=i||/^find/.test(r);o&&(jr.prototype[r]=function(){var r=this.__wrapped__,s=i?[1]:arguments,c=r instanceof Hr,u=s[0],d=c||Ya(r),l=function(e){var t=o.apply(jr,kt([e],s));return i&&f?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(c=d=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,_=c&&!h;if(!a&&d){r=_?r:new Hr(this);var v=t.apply(r,s);return v.__actions__.push({func:_a,args:[l],thisArg:e}),new zr(v,f)}return p&&_?t.apply(this,s):(v=this.thru(l),p?i?v.value()[0]:v.value():v)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);jr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[r]((function(r){return t.apply(Ya(r)?r:[],e)}))}})),Sn(Hr.prototype,(function(e,t){var r=jr[t];if(r){var n=r.name+"";Ue.call(kr,n)||(kr[n]=[]),kr[n].push({name:t,func:r})}})),kr[Fi(e,2).name]=[{name:"wrapper",func:e}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ni(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ni(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ni(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ya(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yr(t,e+a);break;case"takeRight":e=gr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=n?s:a-1,d=this.__iteratees__,l=d.length,f=0,h=yr(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return _i(e,this.__actions__);var p=[];e:for(;c--&&f<h;){for(var _=-1,v=e[u+=t];++_<l;){var m=d[_],g=m.iteratee,y=m.type,E=g(v);if(2==y)v=E;else if(!E){if(1==y)continue e;break e}}p[f++]=v}return p},jr.prototype.at=va,jr.prototype.chain=function(){return pa(this)},jr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},jr.prototype.next=function(){this.__values__===e&&(this.__values__=ps(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},jr.prototype.plant=function(t){for(var r,n=this;n instanceof Gr;){var i=Fo(n);i.__index__=0,i.__values__=e,r?o.__wrapped__=i:r=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,r},jr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Hr){var r=t;return this.__actions__.length&&(r=new Hr(this)),(r=r.reverse()).__actions__.push({func:_a,args:[ra],thisArg:e}),new zr(r,this.__chain__)}return this.thru(ra)},jr.prototype.toJSON=jr.prototype.valueOf=jr.prototype.value=function(){return _i(this.__wrapped__,this.__actions__)},jr.prototype.first=jr.prototype.head,ot&&(jr.prototype[ot]=function(){return this}),jr}();ft?((ft.exports=hr)._=hr,lt._=hr):dt._=hr}.call(t);var XM=o,qM=Ze("iterator"),JM=!XM((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+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[qM]||"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"!==r||"x"!==new URL("http://x",void 0).host})),ZM=T,$M=/[^\0-\u007E]/,QM=/[.\u3002\uFF0E\uFF61]/g,eU="Overflow: input needs wider integers to process",tU=n.RangeError,rU=ZM(QM.exec),nU=Math.floor,iU=String.fromCharCode,oU=ZM("".charCodeAt),aU=ZM([].join),sU=ZM([].push),cU=ZM("".replace),uU=ZM("".split),dU=ZM("".toLowerCase),lU=function(e){return e+22+75*(e<26)},fU=function(e,t,r){var n=0;for(e=r?nU(e/700):e>>1,e+=nU(e/t);e>455;)e=nU(e/35),n+=36;return nU(n+36*e/(e+38))},hU=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=oU(e,r++);if(i>=55296&&i<=56319&&r<n){var o=oU(e,r++);56320==(64512&o)?sU(t,((1023&i)<<10)+(1023&o)+65536):(sU(t,i),r--)}else sU(t,i)}return t}(e);var r,n,i=e.length,o=128,a=0,s=72;for(r=0;r<e.length;r++)(n=e[r])<128&&sU(t,iU(n));var c=t.length,u=c;for(c&&sU(t,"-");u<i;){var d=2147483647;for(r=0;r<e.length;r++)(n=e[r])>=o&&n<d&&(d=n);var l=u+1;if(d-o>nU((2147483647-a)/l))throw tU(eU);for(a+=(d-o)*l,o=d,r=0;r<e.length;r++){if((n=e[r])<o&&++a>2147483647)throw tU(eU);if(n==o){for(var f=a,h=36;;){var p=h<=s?1:h>=s+26?26:h-s;if(f<p)break;var _=f-p,v=36-p;sU(t,iU(lU(p+_%v))),f=nU(_/v),h+=36}sU(t,iU(lU(f))),s=fU(a,l,u==c),a=0,u++}}a++,o++}return aU(t,"")},pU=jn,_U=n,vU=W,mU=d,gU=T,yU=JM,EU=zt.exports,SU=cu,bU=ua,TU=va,IU=br,AU=Lc,RU=V,CU=Ue,OU=zs,wU=nc,NU=kt,kU=F,DU=Mu,PU=Do,MU=m,UU=_c,LU=cc,xU=pf,BU=Qp,VU=Ze("iterator"),jU=IU.set,FU=IU.getterFor("URLSearchParams"),GU=IU.getterFor("URLSearchParamsIterator"),zU=vU("fetch"),HU=vU("Request"),WU=vU("Headers"),YU=HU&&HU.prototype,KU=WU&&WU.prototype,XU=_U.RegExp,qU=_U.TypeError,JU=_U.decodeURIComponent,ZU=_U.encodeURIComponent,$U=gU("".charAt),QU=gU([].join),eL=gU([].push),tL=gU("".replace),rL=gU([].shift),nL=gU([].splice),iL=gU("".split),oL=gU("".slice),aL=/\+/g,sL=Array(4),cL=function(e){return sL[e-1]||(sL[e-1]=XU("((?:%[\\da-f]{2}){"+e+"})","gi"))},uL=function(e){try{return JU(e)}catch(t){return e}},dL=function(e){var t=tL(e,aL," "),r=4;try{return JU(t)}catch(e){for(;r;)t=tL(t,cL(r--),uL);return t}},lL=/[!'()~]|%20/g,fL={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},hL=function(e){return fL[e]},pL=function(e){return tL(ZU(e),lL,hL)},_L=TU((function(e,t){jU(this,{type:"URLSearchParamsIterator",iterator:UU(FU(e).entries),kind:t})}),"Iterator",(function(){var e=GU(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),vL=function(e){this.entries=[],this.url=null,void 0!==e&&(kU(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===$U(e,0)?oL(e,1):e:DU(e)))};vL.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,a,s,c=LU(e);if(c)for(r=(t=UU(e,c)).next;!(n=mU(r,t)).done;){if(o=(i=UU(NU(n.value))).next,(a=mU(o,i)).done||(s=mU(o,i)).done||!mU(o,i).done)throw qU("Expected sequence with length 2");eL(this.entries,{key:DU(a.value),value:DU(s.value)})}else for(var u in e)CU(e,u)&&eL(this.entries,{key:u,value:DU(e[u])})},parseQuery:function(e){if(e)for(var t,r,n=iL(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=iL(t,"="),eL(this.entries,{key:dL(rL(r)),value:dL(QU(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],eL(r,pL(e.key)+"="+pL(e.value));return QU(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var mL=function(){AU(this,gL);var e=arguments.length>0?arguments[0]:void 0;jU(this,new vL(e))},gL=mL.prototype;if(SU(gL,{append:function(e,t){xU(arguments.length,2);var r=FU(this);eL(r.entries,{key:DU(e),value:DU(t)}),r.updateURL()},delete:function(e){xU(arguments.length,1);for(var t=FU(this),r=t.entries,n=DU(e),i=0;i<r.length;)r[i].key===n?nL(r,i,1):i++;t.updateURL()},get:function(e){xU(arguments.length,1);for(var t=FU(this).entries,r=DU(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){xU(arguments.length,1);for(var t=FU(this).entries,r=DU(e),n=[],i=0;i<t.length;i++)t[i].key===r&&eL(n,t[i].value);return n},has:function(e){xU(arguments.length,1);for(var t=FU(this).entries,r=DU(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){xU(arguments.length,1);for(var r,n=FU(this),i=n.entries,o=!1,a=DU(e),s=DU(t),c=0;c<i.length;c++)(r=i[c]).key===a&&(o?nL(i,c--,1):(o=!0,r.value=s));o||eL(i,{key:a,value:s}),n.updateURL()},sort:function(){var e=FU(this);BU(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=FU(this).entries,n=OU(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new _L(this,"keys")},values:function(){return new _L(this,"values")},entries:function(){return new _L(this,"entries")}},{enumerable:!0}),EU(gL,VU,gL.entries,{name:"entries"}),EU(gL,"toString",(function(){return FU(this).serialize()}),{enumerable:!0}),bU(mL,"URLSearchParams"),pU({global:!0,forced:!yU},{URLSearchParams:mL}),!yU&&RU(WU)){var yL=gU(KU.has),EL=gU(KU.set),SL=function(e){if(kU(e)){var t,r=e.body;if("URLSearchParams"===wU(r))return t=e.headers?new WU(e.headers):new WU,yL(t,"content-type")||EL(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),PU(e,{body:MU(0,DU(r)),headers:MU(0,t)})}return e};if(RU(zU)&&pU({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return zU(e,arguments.length>1?SL(arguments[1]):{})}}),RU(HU)){var bL=function(e){return AU(this,YU),new HU(e,arguments.length>1?SL(arguments[1]):{})};YU.constructor=bL,bL.prototype=YU,pU({global:!0,forced:!0},{Request:bL})}}var TL,IL={URLSearchParams:mL,getState:FU},AL=jn,RL=a,CL=JM,OL=n,wL=zs,NL=T,kL=co.f,DL=zt.exports,PL=Lc,ML=Ue,UL=Zk,LL=qA,xL=ls,BL=zu.codeAt,VL=function(e){var t,r,n=[],i=uU(cU(dU(e),QM,"."),".");for(t=0;t<i.length;t++)r=i[t],sU(n,rU($M,r)?"xn--"+hU(r):r);return aU(n,".")},jL=Mu,FL=ua,GL=pf,zL=IL,HL=br,WL=HL.set,YL=HL.getterFor("URL"),KL=zL.URLSearchParams,XL=zL.getState,qL=OL.URL,JL=OL.TypeError,ZL=OL.parseInt,$L=Math.floor,QL=Math.pow,ex=NL("".charAt),tx=NL(/./.exec),rx=NL([].join),nx=NL(1..toString),ix=NL([].pop),ox=NL([].push),ax=NL("".replace),sx=NL([].shift),cx=NL("".split),ux=NL("".slice),dx=NL("".toLowerCase),lx=NL([].unshift),fx=/[a-z]/i,hx=/[\d+-.a-z]/i,px=/\d/,_x=/^0x/i,vx=/^[0-7]+$/,mx=/^\d+$/,gx=/^[\da-f]+$/i,yx=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ex=/[\0\t\n\r #/:<>?@[\\\]^|]/,Sx=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,bx=/[\t\n\r]/g,Tx=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)lx(t,e%256),e=$L(e/256);return rx(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,o=0;o<8;o++)0!==e[o]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=nx(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Ix={},Ax=UL({},Ix,{" ":1,'"':1,"<":1,">":1,"`":1}),Rx=UL({},Ax,{"#":1,"?":1,"{":1,"}":1}),Cx=UL({},Rx,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ox=function(e,t){var r=BL(e,0);return r>32&&r<127&&!ML(t,e)?e:encodeURIComponent(e)},wx={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Nx=function(e,t){var r;return 2==e.length&&tx(fx,ex(e,0))&&(":"==(r=ex(e,1))||!t&&"|"==r)},kx=function(e){var t;return e.length>1&&Nx(ux(e,0,2))&&(2==e.length||"/"===(t=ex(e,2))||"\\"===t||"?"===t||"#"===t)},Dx=function(e){return"."===e||"%2e"===dx(e)},Px={},Mx={},Ux={},Lx={},xx={},Bx={},Vx={},jx={},Fx={},Gx={},zx={},Hx={},Wx={},Yx={},Kx={},Xx={},qx={},Jx={},Zx={},$x={},Qx={},eB=function(e,t,r){var n,i,o,a=jL(e);if(t){if(i=this.parse(a))throw JL(i);this.searchParams=null}else{if(void 0!==r&&(n=new eB(r,!0)),i=this.parse(a,null,n))throw JL(i);(o=XL(new KL)).bindURL(this),this.searchParams=o}};eB.prototype={type:"URL",parse:function(e,t,r){var n,i,o,a,s,c=this,u=t||Px,d=0,l="",f=!1,h=!1,p=!1;for(e=jL(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=ax(e,Sx,"")),e=ax(e,bx,""),n=LL(e);d<=n.length;){switch(i=n[d],u){case Px:if(!i||!tx(fx,i)){if(t)return"Invalid scheme";u=Ux;continue}l+=dx(i),u=Mx;break;case Mx:if(i&&(tx(hx,i)||"+"==i||"-"==i||"."==i))l+=dx(i);else{if(":"!=i){if(t)return"Invalid scheme";l="",u=Ux,d=0;continue}if(t&&(c.isSpecial()!=ML(wx,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,t)return void(c.isSpecial()&&wx[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=Yx:c.isSpecial()&&r&&r.scheme==c.scheme?u=Lx:c.isSpecial()?u=jx:"/"==n[d+1]?(u=xx,d++):(c.cannotBeABaseURL=!0,ox(c.path,""),u=Zx)}break;case Ux:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=xL(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=Qx;break}u="file"==r.scheme?Yx:Bx;continue;case Lx:if("/"!=i||"/"!=n[d+1]){u=Bx;continue}u=Fx,d++;break;case xx:if("/"==i){u=Gx;break}u=Jx;continue;case Bx:if(c.scheme=r.scheme,i==TL)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=xL(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())u=Vx;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=xL(r.path),c.query="",u=$x;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=xL(r.path),c.path.length--,u=Jx;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=xL(r.path),c.query=r.query,c.fragment="",u=Qx}break;case Vx:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=Jx;continue}u=Gx}else u=Fx;break;case jx:if(u=Fx,"/"!=i||"/"!=ex(l,d+1))continue;d++;break;case Fx:if("/"!=i&&"\\"!=i){u=Gx;continue}break;case Gx:if("@"==i){f&&(l="%40"+l),f=!0,o=LL(l);for(var _=0;_<o.length;_++){var v=o[_];if(":"!=v||p){var m=Ox(v,Cx);p?c.password+=m:c.username+=m}else p=!0}l=""}else if(i==TL||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(f&&""==l)return"Invalid authority";d-=LL(l).length+1,l="",u=zx}else l+=i;break;case zx:case Hx:if(t&&"file"==c.scheme){u=Xx;continue}if(":"!=i||h){if(i==TL||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==l)return"Invalid host";if(t&&""==l&&(c.includesCredentials()||null!==c.port))return;if(a=c.parseHost(l))return a;if(l="",u=qx,t)return;continue}"["==i?h=!0:"]"==i&&(h=!1),l+=i}else{if(""==l)return"Invalid host";if(a=c.parseHost(l))return a;if(l="",u=Wx,t==Hx)return}break;case Wx:if(!tx(px,i)){if(i==TL||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=l){var g=ZL(l,10);if(g>65535)return"Invalid port";c.port=c.isSpecial()&&g===wx[c.scheme]?null:g,l=""}if(t)return;u=qx;continue}return"Invalid port"}l+=i;break;case Yx:if(c.scheme="file","/"==i||"\\"==i)u=Kx;else{if(!r||"file"!=r.scheme){u=Jx;continue}if(i==TL)c.host=r.host,c.path=xL(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=xL(r.path),c.query="",u=$x;else{if("#"!=i){kx(rx(xL(n,d),""))||(c.host=r.host,c.path=xL(r.path),c.shortenPath()),u=Jx;continue}c.host=r.host,c.path=xL(r.path),c.query=r.query,c.fragment="",u=Qx}}break;case Kx:if("/"==i||"\\"==i){u=Xx;break}r&&"file"==r.scheme&&!kx(rx(xL(n,d),""))&&(Nx(r.path[0],!0)?ox(c.path,r.path[0]):c.host=r.host),u=Jx;continue;case Xx:if(i==TL||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&Nx(l))u=Jx;else if(""==l){if(c.host="",t)return;u=qx}else{if(a=c.parseHost(l))return a;if("localhost"==c.host&&(c.host=""),t)return;l="",u=qx}continue}l+=i;break;case qx:if(c.isSpecial()){if(u=Jx,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=TL&&(u=Jx,"/"!=i))continue}else c.fragment="",u=Qx;else c.query="",u=$x;break;case Jx:if(i==TL||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=dx(s=l))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||ox(c.path,"")):Dx(l)?"/"==i||"\\"==i&&c.isSpecial()||ox(c.path,""):("file"==c.scheme&&!c.path.length&&Nx(l)&&(c.host&&(c.host=""),l=ex(l,0)+":"),ox(c.path,l)),l="","file"==c.scheme&&(i==TL||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)sx(c.path);"?"==i?(c.query="",u=$x):"#"==i&&(c.fragment="",u=Qx)}else l+=Ox(i,Rx);break;case Zx:"?"==i?(c.query="",u=$x):"#"==i?(c.fragment="",u=Qx):i!=TL&&(c.path[0]+=Ox(i,Ix));break;case $x:t||"#"!=i?i!=TL&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":Ox(i,Ix)):(c.fragment="",u=Qx);break;case Qx:i!=TL&&(c.fragment+=Ox(i,Ax))}d++}},parseHost:function(e){var t,r,n;if("["==ex(e,0)){if("]"!=ex(e,e.length-1))return"Invalid host";if(t=function(e){var t,r,n,i,o,a,s,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,f=function(){return ex(e,l)};if(":"==f()){if(":"!=ex(e,1))return;l+=2,d=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=r=0;r<4&&tx(gx,f());)t=16*t+ZL(f(),16),l++,r++;if("."==f()){if(0==r)return;if(l-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;l++}if(!tx(px,f()))return;for(;tx(px,f());){if(o=ZL(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(a=u-d,u=7;0!=u&&a>0;)s=c[u],c[u--]=c[d+a-1],c[d+--a]=s;else if(8!=u)return;return c}(ux(e,1,-1)),!t)return"Invalid host";this.host=t}else if(this.isSpecial()){if(e=VL(e),tx(yx,e))return"Invalid host";if(t=function(e){var t,r,n,i,o,a,s,c=cx(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(o=10,i.length>1&&"0"==ex(i,0)&&(o=tx(_x,i)?16:8,i=ux(i,8==o?1:2)),""===i)a=0;else{if(!tx(10==o?mx:8==o?vx:gx,i))return e;a=ZL(i,o)}ox(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=QL(256,5-t))return null}else if(a>255)return null;for(s=ix(r),n=0;n<r.length;n++)s+=r[n]*QL(256,3-n);return s}(e),null===t)return"Invalid host";this.host=t}else{if(tx(Ex,e))return"Invalid host";for(t="",r=LL(e),n=0;n<r.length;n++)t+=Ox(r[n],Ix);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return ML(wx,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&Nx(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,o=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=Tx(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+rx(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw JL(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new tB(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+Tx(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(jL(e)+":",Px)},getUsername:function(){return this.username},setUsername:function(e){var t=LL(jL(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ox(t[r],Cx)}},getPassword:function(){return this.password},setPassword:function(e){var t=LL(jL(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ox(t[r],Cx)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?Tx(e):Tx(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,zx)},getHostname:function(){var e=this.host;return null===e?"":Tx(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Hx)},getPort:function(){var e=this.port;return null===e?"":jL(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=jL(e))?this.port=null:this.parse(e,Wx))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+rx(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,qx))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=jL(e))?this.query=null:("?"==ex(e,0)&&(e=ux(e,1)),this.query="",this.parse(e,$x)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=jL(e))?("#"==ex(e,0)&&(e=ux(e,1)),this.fragment="",this.parse(e,Qx)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var tB=function(e){var t=PL(this,rB),r=GL(arguments.length,1)>1?arguments[1]:void 0,n=WL(t,new eB(e,!1,r));RL||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},rB=tB.prototype,nB=function(e,t){return{get:function(){return YL(this)[e]()},set:t&&function(e){return YL(this)[t](e)},configurable:!0,enumerable:!0}};if(RL&&kL(rB,{href:nB("serialize","setHref"),origin:nB("getOrigin"),protocol:nB("getProtocol","setProtocol"),username:nB("getUsername","setUsername"),password:nB("getPassword","setPassword"),host:nB("getHost","setHost"),hostname:nB("getHostname","setHostname"),port:nB("getPort","setPort"),pathname:nB("getPathname","setPathname"),search:nB("getSearch","setSearch"),searchParams:nB("getSearchParams"),hash:nB("getHash","setHash")}),DL(rB,"toJSON",(function(){return YL(this).serialize()}),{enumerable:!0}),DL(rB,"toString",(function(){return YL(this).serialize()}),{enumerable:!0}),qL){var iB=qL.createObjectURL,oB=qL.revokeObjectURL;iB&&DL(tB,"createObjectURL",wL(iB,qL)),oB&&DL(tB,"revokeObjectURL",wL(oB,qL))}FL(tB,"URL"),AL({global:!0,forced:!CL,sham:!RL},{URL:tB});var aB,sB=function(){function e(e){this._sharedAudioContext=new AudioContext,this._audioDestination=this._sharedAudioContext.createMediaStreamDestination(),this._localGainNode=this._sharedAudioContext.createGain(),this._bufferGainNode=this._sharedAudioContext.createGain(),this.mixingMap=new Map,this.resourcesCache=new Map,this.volumeConfig=new Map,this.cachedBuffer=[],this._context=e,this._localGainNode.gain.value=1}return e.prototype.mixMediaStream=function(e){this._localSource&&this._localSource.disconnect(this._localGainNode),this._localSource=this._sharedAudioContext.createMediaStreamSource(e),this._localSource.connect(this._localGainNode).connect(this._audioDestination)},e.prototype.startAudioMixing=function(e,t,r){return ei(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,d,l,f,h,p,_=this;return ti(this,(function(v){switch(v.label){case 0:if(n=r.playCount,fC(i=r.type,"mixingType",KM.exports.values(ZD)),!(o=this._context.getLocalAudioTrack()))return[2];if((a=dM(o.getTrack()))&&this.mixMediaStream(a),(s=this.mixingMap.get(e))&&s.audioNode){s.audioNode.pause(),this._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_STOPPED,error:cT.AUDIO_MIXING_ERROR_OK});try{s.gainNode.disconnect(this._audioDestination),s.audioSource.disconnect(s.gainNode)}catch(e){}}return(u=this.resourcesCache.get(e))&&u.filePath===t?(c=u.getAudioNode(),[3,3]):[3,1];case 1:return[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw _._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_FAILED,error:cT.AUDIO_MIXING_ERROR_START_FAILED}),new dT(sT.LOAD_RESOURCES_FAILED,t.statusText)}))];case 2:d=v.sent(),c=new Audio(URL.createObjectURL(new Blob([d]))),v.label=3;case 3:return c.crossOrigin="anonymous",n<=0?c.loop=!0:n>0&&(l=n,c.onended=function(){--l>0?c.play():_._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_FINISHED,error:cT.AUDIO_MIXING_ERROR_OK})}),[4,c.play()];case 4:if(v.sent(),f=this._sharedAudioContext.createMediaElementSource(c),h=this._sharedAudioContext.createGain(),p=this.volumeConfig.get(e),h.gain.value=p?p/100:1,f.connect(h).connect(this._audioDestination),this.mixingMap.set(e,{audioSource:f,audioNode:c,gainNode:h,type:"file"}),i===ZD.PUBLISH)try{h.disconnect(this._sharedAudioContext.destination)}catch(e){}else h.connect(this._sharedAudioContext.destination);return this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],r.type),this._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_PLAYING,error:cT.AUDIO_MIXING_ERROR_OK}),[2]}}))}))},e.prototype.stopAudioMixing=function(e){var t=this.mixingMap.get(e);t&&"file"===t.type&&(this.mixingMap.delete(e),t.audioNode.pause(),t.audioSource.disconnect(t.gainNode),t.gainNode.disconnect(this._audioDestination),this._context.updateLocalAudioTrack()),this._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_STOPPED,error:cT.AUDIO_MIXING_ERROR_OK})},e.prototype.pauseAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_PAUSED,error:cT.AUDIO_MIXING_ERROR_OK}),t.audioNode.pause())},e.prototype.resumeAudioMixing=function(e){var t=this.mixingMap.get(e);t&&(this._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_PLAYING,error:cT.AUDIO_MIXING_ERROR_OK}),t.audioNode.play())},e.prototype.preloadAudioMixing=function(e,t){return ei(this,void 0,void 0,(function(){var r,n=this;return ti(this,(function(i){switch(i.label){case 0:return this.stopAudioMixing(e),[4,fetch(t,{mode:"cors",credentials:"include"}).then((function(t){if(t.ok)return t.arrayBuffer();throw n._context.emitMessage({mixId:e,state:$D.AUDIO_MIXING_STATE_FAILED,error:cT.AUDIO_MIXING_ERROR_PRELOAD_FAILED}),new dT(sT.LOAD_RESOURCES_FAILED,t.statusText)})).catch((function(e){throw new dT(sT.LOAD_RESOURCES_FAILED,"Load resources failed",e)}))];case 1:return r=i.sent(),this.resourcesCache.set(e,{getAudioNode:function(){return new Audio(URL.createObjectURL(new Blob([r])))},filePath:t}),[2]}}))}))},e.prototype.unloadAudioMixing=function(e){this.resourcesCache.has(e)&&this.resourcesCache.delete(e)},e.prototype.getAudioMixingVolume=function(e){var t=this.mixingMap.get(e);return t?100*t.gainNode.gain.value:0},e.prototype.setAudioMixingVolume=function(e,t){t<0?t=0:t>400&&(t=400),this.volumeConfig.set(e,t);var r=this.mixingMap.get(e);r&&(r.gainNode.gain.value=Number(t)/100)},e.prototype.getAudioMixingDuration=function(e){var t=this.mixingMap.get(e),r=this.mixingMap.get(e);return t||r?t?1e3*t.audioNode.duration:r?1e3*r.audioNode.duration:0:0},e.prototype.getAudioMixingCurrentPosition=function(e){var t=this.mixingMap.get(e);return t?1e3*t.audioNode.currentTime:0},e.prototype.setAudioMixingPosition=function(e,t){var r=this.mixingMap.get(e);r&&(r.audioNode.currentTime=t/1e3,r.audioNode.play())},e.prototype.enableAudioMixingBuffer=function(e){fC(e,"type",KM.exports.values(ZD));var t=this._context.getLocalAudioTrack();if(t){var r=dM(t.getTrack());if(r&&this.mixMediaStream(r),e===ZD.PUBLISH)try{this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}else this._bufferGainNode.connect(this._sharedAudioContext.destination);this._context.updateLocalAudioTrack(this._audioDestination.stream.getAudioTracks()[0],e),this._bufferGainNode.connect(this._audioDestination)}},e.prototype.disableAudioMixingBuffer=function(){if(this.cachedBuffer=[],this._audioBufferSource){try{this._audioBufferSource.disconnect(this._bufferGainNode),this._bufferGainNode.disconnect(this._audioDestination),this._bufferGainNode.disconnect(this._sharedAudioContext.destination)}catch(e){}finally{this._audioBufferSource=void 0}this._context.updateLocalAudioTrack()}},e.prototype.pushAudioMixingBuffer=function(e){var t=this;this._audioBufferSource&&this.cachedBuffer.push(e),this._audioBufferSource=this._sharedAudioContext.createBufferSource(),this._audioBufferSource.buffer=e,this._audioBufferSource.connect(this._bufferGainNode),this._audioBufferSource.start(),this._audioBufferSource.onended=function(){var e;if(null===(e=t._audioBufferSource)||void 0===e||e.disconnect(t._bufferGainNode),t._audioBufferSource=void 0,t.cachedBuffer.length){var r=t.cachedBuffer.shift();r&&t.pushAudioMixingBuffer(r)}}},e.prototype.stopAll=function(){var e=this;if(this._localSource)try{this._localSource.disconnect(this._localGainNode),delete this._localSource}catch(e){}this.mixingMap.forEach((function(t,r){e.stopAudioMixing(r)}))},Object.defineProperty(e.prototype,"mixTrack",{get:function(){return this._audioDestination.stream.getAudioTracks()[0]},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var e=this._sharedAudioContext;"closed"!==e.state&&"function"==typeof e.close&&e.close(),this.cachedBuffer=[],this.mixingMap.clear(),this.resourcesCache.clear(),this.volumeConfig.clear()},Qn([sD("id","filePath","options")],e.prototype,"startAudioMixing",null),Qn([sD("id")],e.prototype,"stopAudioMixing",null),Qn([sD("id")],e.prototype,"pauseAudioMixing",null),Qn([sD("id")],e.prototype,"resumeAudioMixing",null),Qn([sD("id")],e.prototype,"preloadAudioMixing",null),Qn([sD("id")],e.prototype,"unloadAudioMixing",null),Qn([sD("id")],e.prototype,"getAudioMixingVolume",null),Qn([sD("id","volume")],e.prototype,"setAudioMixingVolume",null),Qn([sD("id")],e.prototype,"getAudioMixingDuration",null),Qn([sD("id")],e.prototype,"getAudioMixingCurrentPosition",null),Qn([sD("id","position")],e.prototype,"setAudioMixingPosition",null),Qn([sD("type")],e.prototype,"enableAudioMixingBuffer",null),Qn([sD()],e.prototype,"disableAudioMixingBuffer",null),Qn([sD("buffer")],e.prototype,"pushAudioMixingBuffer",null),e}();!function(e){e.NORMAL_USER="normalUser",e.SILENT_USER="silentUser"}(aB||(aB={}));var cB=new DC("Engine",0),uB=function(e){function t(t){var r=e.call(this)||this;return r._visibility=!0,r._remoteVideoPlayer=new Map,r._remoteScreenPlayer=new Map,r._remoteAudioPlayer=new Map,r._videoStreamConstraints={},r._audioStreamConstraints={},r._videoStreamEncodeConfig=[{maxKbps:500}],r._screenStreamEncodeConfig=[{maxKbps:500}],r._pauseAllSubscribeState={audio:!1,video:!1},r._mirrorType=pO.MIRROR_TYPE_RENDER,r._updateMixAudioTrack=function(e,t){return void 0===t&&(t=ZD.PLAYOUT_AND_PUBLISH),ei(r,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:return cB.print("_updateMixAudioTrack()"),this._localAudioTrack?(e?(this._localAudioTrack.mixType=t,this._localAudioTrack.mixedAudioTrack=e):(delete this._localAudioTrack.mixType,delete this._localAudioTrack.mixedAudioTrack),(null===(r=this._room)||void 0===r?void 0:r.hasPublished)?[4,this._updatePublish()]:[3,2]):(e&&(this._tempMixingAudioTrack={track:e,type:t}),[2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},r._onAudioMixingMessage=function(e){r.safeEmit(sC.onAudioMixingStateChanged,e)},r._appId=t,r._pubLock=new uP("pubLock"),r._addDeviceEventHandler(),r._audioMixingManager=new sB({getLocalAudioTrack:function(){return r._localAudioTrack},updateLocalAudioTrack:r._updateMixAudioTrack,emitMessage:r._onAudioMixingMessage}),window["__rtc_engine__".concat(Math.floor(100*Math.random()+1))]=r,r._trackSourceType={video:eO.VIDEO_SOURCE_TYPE_INTERNAL,screenVideo:eO.VIDEO_SOURCE_TYPE_INTERNAL,audio:tO.AUDIO_SOURCE_TYPE_INTERNAL,screenAudio:tO.AUDIO_SOURCE_TYPE_INTERNAL},r}return Zn(t,e),Object.defineProperty(t.prototype,"appId",{get:function(){return this._appId},enumerable:!1,configurable:!0}),t.prototype.updateToken=function(e){var t;cB.print("updateToken()","token: %s",e),lC(e,"token"),null===(t=this._room)||void 0===t||t.updateToken(e)},t.prototype.switchCamera=function(e){var t,r;return ei(this,void 0,void 0,(function(){var n,i;return ti(this,(function(o){switch(o.label){case 0:return cB.print("switchCamera()","deviceId: %s",e),lC(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._videoStreamConstraints).deviceId={exact:e},this._videoStreamConstraints=n,[4,IM(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localVideoTrack&&this._localVideoTrack.close(),this._localVideoTrack=i,this._videoPlayer&&(this._videoPlayer.stop(),this._videoPlayer.playVideo(i),this._videoPlayer.mirror(!!this._mirrorType)),this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype.switchMicrophone=function(e){var t,r;return ei(this,void 0,void 0,(function(){var n,i;return ti(this,(function(o){switch(o.label){case 0:return cB.print("switchMicrophone()","deviceId: %s",e),lC(e,"deviceId"),e===(null===(r=null===(t=this._videoStreamConstraints)||void 0===t?void 0:t.deviceId)||void 0===r?void 0:r.exact)?[2]:((n=this._audioStreamConstraints).deviceId={exact:e},this._audioStreamConstraints=n,[4,AM(n)]);case 1:return i=o.sent(),this._initLocalTrackEvents(i),this._localAudioTrack&&this._localAudioTrack.close(),this._localAudioTrack=i,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,3]:[2];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},t.prototype._addDeviceEventHandler=function(){nM.on(sC.onMediaDeviceStateChanged,this._onDeviceStateChange.bind(this))},t.prototype._addHandlerEventHandler=function(){var e,t,r,n,i,o,a,s,c,u,d,l,f,h,p,_,v,m,g,y,E,S,b,T=this;null===(e=this._room)||void 0===e||e.on(eD.ON_ADD_STREAM,this._onAddStream.bind(this)),null===(t=this._room)||void 0===t||t.on(eD.ON_REMOVE_STREAM,this._onRemoveStream.bind(this)),null===(r=this._room)||void 0===r||r.on(eD.USER_CONNECTION,this._onUserConnection.bind(this)),null===(n=this._room)||void 0===n||n.on(eD.USER_DISCONNECTION,this._onUserDisconnection.bind(this)),null===(i=this._room)||void 0===i||i.on(eD.ON_CUSTOM_MESSAGE,this._onCustomMessage.bind(this)),null===(o=this._room)||void 0===o||o.on(eD.USER_MESSAGE_RECEIVED,this._onUserMessageReceived.bind(this)),null===(a=this._room)||void 0===a||a.on(eD.USER_BINARY_MESSAGE_RECEIVED,this._onUserBinaryMessageReceived.bind(this)),null===(s=this._room)||void 0===s||s.on(eD.POST_PROCESSING_MESSAGE,this._onLiveTranscodingResult.bind(this)),null===(c=this._room)||void 0===c||c.on(tD.ON_CONNECTION_STATE_CHANGE,this._onConnectionStateChange.bind(this)),null===(u=this._room)||void 0===u||u.on(OM.RESUBSCRIBE,this._onResubscribe.bind(this)),null===(d=this._room)||void 0===d||d.on(OM.SUBSCRIBE_PUSH_TRACK,this._onSubscribePushTrack.bind(this)),null===(l=this._room)||void 0===l||l.on(OM.REMOVE_PUSH_TRACK,this._onRemovePushTrack.bind(this)),null===(f=this._room)||void 0===f||f.on(OM.VIDEO_FIRST_FRAME,this._onVideoFirstFrameDecoded.bind(this)),null===(h=this._room)||void 0===h||h.on(OM.ON_PUBLISH_RESULT,(function(e){var t;(null===(t=T._room)||void 0===t?void 0:t._roomConfig.isAutoPublish)&&T.safeEmit(sC.onAutoPublishResult,e)})),null===(p=this._room)||void 0===p||p.on("onRemoteStreamStats",(function(e){T.safeEmit(sC.onRemoteStreamStats,e)})),null===(_=this._room)||void 0===_||_.on("onLocalStreamStats",(function(e){T.safeEmit(sC.onLocalStreamStats,e)})),null===(v=this._room)||void 0===v||v.on(OM.ON_USER_MUTE_AUDIO,this._onUserMuteAudio.bind(this)),null===(m=this._room)||void 0===m||m.on(OM.ON_USER_MUTE_VIDEO,this._onUserMuteVideo.bind(this)),null===(g=this._room)||void 0===g||g.on(OM.ON_USER_START_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(sC.onUserStartAudioCapture,{userId:t})})),null===(y=this._room)||void 0===y||y.on(OM.ON_USER_STOP_AUDIO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(sC.onUserStopAudioCapture,{userId:t})})),null===(E=this._room)||void 0===E||E.on(OM.ON_USER_START_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(sC.onUserStartVideoCapture,{userId:t})})),null===(S=this._room)||void 0===S||S.on(OM.ON_USER_STOP_VIDEO_CAPTURE,(function(e){var t=e.userId;T.safeEmit(sC.onUserStopVideoCapture,{userId:t})})),null===(b=this._room)||void 0===b||b.on(OM.ON_SEI_MESSAGED_RECEIVED,(function(e){T.safeEmit(sC.onSEIMessageReceived,e)}))},t.prototype.safeEmit=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return yC(t)&&cD(t,JSON.stringify(cC(r))),e.prototype.safeEmit.apply(this,ii([t],ni(r),!1))},t.prototype._removeHandlerEventHandler=function(){var e;null===(e=this._room)||void 0===e||e.removeAllListeners()},t.prototype.joinRoom=function(e,t,r,n){return void 0===n&&(n={isAutoPublish:!1,isAutoSubscribeAudio:!1,isAutoSubscribeVideo:!1}),ei(this,void 0,void 0,(function(){var i;return ti(this,(function(o){switch(o.label){case 0:if(cB.print("joinRoom()","token: %o roomId: %o, userInfo: %o, roomConfig: %o",e,t,r,n),_C(e)||lC(e,"token"),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new dT(sT.INVALID_PARAMS,"The RoomId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(t),vC(r),function(e){hC(e,"roomConfig"),uC(e.isAutoPublish,"roomConfig.isAutoPublish"),uC(e.isAutoSubscribeAudio,"roomConfig.isAutoSubscribeAudio"),uC(e.isAutoSubscribeVideo,"roomConfig.isAutoSubscribeVideo")}(n),!this._room||this._room.connectionState===fP.DISCONNECTED)return[3,1];throw new dT(sT.REPEAT_JOIN,"Already joined");case 1:return this._room=new xM(n),this._addHandlerEventHandler(),i=this._liveTranscodeConfig&&PO("started",this._liveTranscodeConfig),[4,this._room.join(this._appId,t,e,$n($n({},r),{businessId:this._businessId,role:this._visibility?aB.NORMAL_USER:aB.SILENT_USER}),i)];case 2:return o.sent(),this._roomConfig=n,(this._localAudioTrack||this._localVideoTrack)&&n.isAutoPublish?[4,this._updatePublish()]:[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t.prototype.leaveRoom=function(){var e;cB.print("leaveRoom()"),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.leave().catch,this._liveTranscodeConfig&&this.stopLiveTranscoding(),this._room=void 0,this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0},t.prototype.destroy=function(){var e,t,r;cB.print("destroy()"),this.removeAllListeners(),this._removeHandlerEventHandler(),null===(e=this._room)||void 0===e||e.destroy(),this._room=void 0,null===(t=this._videoPlayer)||void 0===t||t.destroy(),null===(r=this._audioPlayer)||void 0===r||r.destroy(),this._videoPlayer=void 0,this._audioPlayer=void 0,this._screenPlayer=void 0,this._videoStreamConstraints={},this._audioStreamConstraints={},this._videoStreamEncodeConfig=[{maxKbps:500}],this._screenStreamEncodeConfig=[{maxKbps:500}],this._pauseAllSubscribeState={audio:!1,video:!1},clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=void 0,this._localAudioTrack&&(this._localAudioTrack.close(),this._localAudioTrack=void 0),this._localVideoTrack&&(this._localVideoTrack.close(),this._localVideoTrack=void 0),this._localScreenAudioTrack&&(this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0),this._localScreenVideoTrack&&(this._localScreenVideoTrack.close(),this._localScreenVideoTrack=void 0),this._remoteAudioPlayer.forEach((function(e){return e.stop()})),this._remoteAudioPlayer=new Map,this._remoteScreenPlayer.forEach((function(e){return e.stop()})),this._remoteScreenPlayer=new Map,this._remoteVideoPlayer.forEach((function(e){return e.stop()})),this._remoteVideoPlayer=new Map,this._roomConfig=void 0,this._audioMixingManager.destroy()},t.prototype.publish=function(){return ei(this,void 0,void 0,(function(){return ti(this,(function(e){switch(e.label){case 0:if(cB.print("publish()"),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.PUBLISH_BEFORE_JOIN,"join first");return[4,this._updatePublish()];case 1:return e.sent(),[2]}}))}))},t.prototype.unpublish=function(){return ei(this,void 0,void 0,(function(){var e,t;return ti(this,(function(r){switch(r.label){case 0:if(cB.print("unpublish()"),!this._room)throw new dT(sT.UNPUBLISH_BEFORE_JOIN,"join first");return[4,this._pubLock.lock()];case 1:e=r.sent(),r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.unpublish()];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof dT?t:new dT(sT.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype.subscribeUserStream=function(e,t,r,n){var i,o,a,s;return void 0===r&&(r=dO.STREAM_INDEX_MAIN),void 0===n&&(n={videoIndex:0}),ei(this,void 0,void 0,(function(){var c,u,d,l,f,h;return ti(this,(function(p){switch(p.label){case 0:if(cB.print("subscribeStream()","userId: %o, mediaType: %o, streamType: %o, configure: %o",e,t,r,n),lC(e,"userId"),fC(t,"mediaType",[lO.AUDIO_AND_VIDEO,lO.AUDIO_ONLY,lO.VIDEO_ONLY,lO.NONE]),fC(r,"streamType",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),dC(n.videoIndex,"config.videoIndex",0,2),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.SUBSCRIBE_BEFORE_JOIN,"join first");if(c=this._room.remoteStreams.get(e),d=r===dO.STREAM_INDEX_SCREEN,!(u=d?null==c?void 0:c.find((function(e){return e.isScreen})):null==c?void 0:c.find((function(e){return!e.isScreen}))))throw new dT(sT.STREAM_NOT_EXIST,"stream not exist");p.label=1;case 1:return p.trys.push([1,3,,4]),l=t,this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?t=lO.NONE:this._pauseAllSubscribeState.audio&&!this._pauseAllSubscribeState.video?t===lO.AUDIO_AND_VIDEO?t=lO.VIDEO_ONLY:t===lO.AUDIO_ONLY&&(t=lO.NONE):!this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video&&(t===lO.AUDIO_AND_VIDEO?t=lO.AUDIO_ONLY:t===lO.VIDEO_ONLY&&(t=lO.NONE)),t!==l&&cB.print("subscribeUserStream","due to pauseAllState change sub mediaType from ".concat(l," to ").concat(t)),[4,this._room.subscribe(u,t,n)];case 2:return p.sent(),t!==lO.AUDIO_AND_VIDEO&&t!==lO.AUDIO_ONLY||this._updateAudioPlayerState(u),t!==lO.AUDIO_AND_VIDEO&&t!==lO.VIDEO_ONLY||this._updateVideoPlayerState(u),((null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)||(null===(o=this._roomConfig)||void 0===o?void 0:o.isAutoSubscribeVideo))&&(u.audioTrack||u.videoTrack)&&(h={userId:e,isScreen:d,state:oO.SUBSCRIBE_SUCC},this.safeEmit(sC.onAutoSubscribeResult,h)),[3,4];case 3:throw f=p.sent(),((null===(a=this._roomConfig)||void 0===a?void 0:a.isAutoSubscribeAudio)||(null===(s=this._roomConfig)||void 0===s?void 0:s.isAutoSubscribeVideo))&&(h={userId:e,isScreen:d,state:oO.SUBSCRIBE_FAIL},this.safeEmit(sC.onAutoSubscribeResult,h)),f;case 4:return[2]}}))}))},t.prototype.unSubscribe=function(e,t){return ei(this,void 0,void 0,(function(){var r,n;return ti(this,(function(i){switch(i.label){case 0:if(cB.print("unSubscribe()","userId: %s, isScreen: %o",e,t),lC(e,"userId"),uC(t,"isScreen"),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.SUBSCRIBE_BEFORE_JOIN,"join first");if(r=this._room.remoteStreams.get(e),!(n=t?null==r?void 0:r.find((function(e){return e.isScreen})):null==r?void 0:r.find((function(e){return!e.isScreen}))))throw new dT(sT.STREAM_NOT_EXIST,"stream not exist");return[4,this._room.unsubscribe(n)];case 1:return i.sent(),this._updateAudioPlayerState(n),this._updateVideoPlayerState(n),[2]}}))}))},t.prototype.startVideoCapture=function(e){return ei(this,void 0,void 0,(function(){var t,r,n;return ti(this,(function(i){switch(i.label){case 0:if(cB.print("startVideoCapture()","deviceId: %s",e),_C(e)||lC(e,"deviceId"),this._localVideoTrack)throw new dT(sT.REPEAT_CAPTURE,"Has already capture");return t=this._videoStreamConstraints,e&&(t.deviceId={exact:e},this._videoStreamConstraints=t),[4,IM(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localVideoTrack=r,this._videoPlayer&&this._videoPlayer.playVideo(r),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopVideoCapture=function(){var e;return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:if(cB.print("stopVideoCapture()"),this._trackSourceType.video===eO.VIDEO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");return this._videoPlayer&&this._videoPlayer.stop(),null===(e=this._localVideoTrack)||void 0===e||e.close(),this._localVideoTrack=void 0,this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.startAudioCapture=function(e){return ei(this,void 0,void 0,(function(){var t,r,n;return ti(this,(function(i){switch(i.label){case 0:if(cB.print("startAudioCapture()","deviceId: $o",e),_C(e)||lC(e,"deviceId"),this._localAudioTrack)throw new dT(sT.REPEAT_CAPTURE,"Has already capture");return t=this._audioStreamConstraints,e&&(t.deviceId={exact:e},this._audioStreamConstraints=t),[4,AM(t)];case 1:return r=i.sent(),this._initLocalTrackEvents(r),this._localAudioTrack=r,this._tempMixingAudioTrack&&(this._localAudioTrack.mixType=this._tempMixingAudioTrack.type,this._localAudioTrack.mixedAudioTrack=this._tempMixingAudioTrack.track,delete this._tempMixingAudioTrack),this._room?(n=this._room._roomConfig.isAutoPublish,this._room.hasPublished||n?[4,this._updatePublish()]:[3,3]):[2];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},t.prototype.stopAudioCapture=function(){var e;return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:if(cB.print("stopAudioCapture()"),null===(e=this._localAudioTrack)||void 0===e||e.close(),this._localAudioTrack=void 0,this._audioMixingManager.stopAll(),this._trackSourceType.audio===tO.AUDIO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return this._room?this._room.hasPublished?[4,this._updatePublish()]:[3,2]:[2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.getAudioMixingManager=function(){return cB.print("getAudioMixingManager()"),this._audioMixingManager},t.prototype.startScreenCapture=function(e){var t,r;return void 0===e&&(e={}),ei(this,void 0,void 0,(function(){var n,i,o,a;return ti(this,(function(s){switch(s.label){case 0:if(cB.print("startScreenCapture()","config: %o",e),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,n=e.enableAudio,i=void 0!==n&&n,this._trackSourceType.screenVideo===eO.VIDEO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as internal first");if(this._trackSourceType.screenAudio===tO.AUDIO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as internal first");return[4,RM(i)];case 1:return o=s.sent(),this._localScreenVideoTrack=new EM(o.getVideoTracks()[0],rC()),(a=o.getAudioTracks()).length&&(this._localScreenAudioTrack=new SM(a[0],rC()),this._initLocalTrackEvents(this._localScreenAudioTrack)),null===(r=this._screenPlayer)||void 0===r||r.playVideo(this._localScreenVideoTrack),this._initLocalTrackEvents(this._localScreenVideoTrack),[2]}}))}))},t.prototype.stopScreenCapture=function(){var e,t,r;return ei(this,void 0,void 0,(function(){return ti(this,(function(n){return cB.print("stopScreenCapture()"),null===(e=this._screenPlayer)||void 0===e||e.stop(),null===(t=this._localScreenVideoTrack)||void 0===t||t.close(),this._localScreenVideoTrack=void 0,null===(r=this._localScreenAudioTrack)||void 0===r||r.close(),this._localScreenAudioTrack=void 0,[2]}))}))},t.prototype.publishScreen=function(){return ei(this,void 0,void 0,(function(){var e;return ti(this,(function(t){switch(t.label){case 0:if(cB.print("publishScreen()"),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.PUBLISH_BEFORE_JOIN,"join first");if(!this._visibility)throw new dT(sT.NO_PUBLISH_PERMISSION,"no publish permission");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof dT?e:new dT(sT.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.unpublishScreen=function(){return ei(this,void 0,void 0,(function(){var e;return ti(this,(function(t){switch(t.label){case 0:if(cB.print("unpublishScreen()"),!this._room)throw new dT(sT.UNPUBLISH_BEFORE_JOIN,"join first");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._room.unpublishScreen()];case 2:return t.sent(),[3,4];case 3:throw(e=t.sent())instanceof dT?e:new dT(sT.UNEXPECTED_ERROR,"unexpected error",e);case 4:return[2]}}))}))},t.prototype.setLocalVideoPlayer=function(e,t){var r,n;cB.print("setLocalVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),t&&t.renderDom?(mC(t),e==dO.STREAM_INDEX_MAIN?(this._videoPlayer=new WM(t),this._initPlayerEvents(this._videoPlayer),this._localVideoTrack&&this._videoPlayer.playVideo(this._localVideoTrack),this._videoPlayer.mirror(!!this._mirrorType)):(this._screenPlayer=new WM($n($n({},t),{isScreen:!0})),this._initPlayerEvents(this._screenPlayer),this._localScreenVideoTrack&&this._screenPlayer.playVideo(this._localScreenVideoTrack))):e==dO.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.startLiveTranscoding=function(e){var t;return ei(this,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:cB.print("startLiveTranscoding()","transcode: %o",e),lC(e.url,"liveTranscode.url"),this._liveTranscodeConfig=e,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(PO("started",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof dT?r:new dT(sT.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.updateLiveTranscoding=function(e){var t;return ei(this,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:if(cB.print("updateLiveTranscoding()","transcode: %o",e),!this._liveTranscodeConfig)return[2];this._liveTranscodeConfig=KM.exports.assignIn(this._liveTranscodeConfig,e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null===(t=this._room)||void 0===t?void 0:t.controlMessage(PO("layoutChanged",this._liveTranscodeConfig))];case 2:return n.sent(),[3,4];case 3:throw(r=n.sent())instanceof dT?r:new dT(sT.UNEXPECTED_ERROR,"unexpected error",r);case 4:return[2]}}))}))},t.prototype.stopLiveTranscoding=function(){var e;return ei(this,void 0,void 0,(function(){var t;return ti(this,(function(r){switch(r.label){case 0:if(cB.print("stopLiveTranscoding()"),!this._liveTranscodeConfig)return[2];delete this._liveTranscodeConfig,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,null===(e=this._room)||void 0===e?void 0:e.controlMessage({action:"stopped",type:"transcode"})];case 2:return r.sent(),[3,4];case 3:throw(t=r.sent())instanceof dT?t:new dT(sT.UNEXPECTED_ERROR,"unexpected error",t);case 4:return[2]}}))}))},t.prototype.setBusinessId=function(e){if(cB.print("setBusinessId()","businessId: %s",e),function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \_\-\@]{1,128}$/.test(e))throw new dT(sT.INVALID_PARAMS,"The businessId must be within 128 bytes. The supported characters: a-z,A-Z,0-9,@,-,_")}(e),this._room)throw new dT(sT.ALREADY_IN_ROOM,"You should invoke setBusinessId before joinRoom");nD.setStats({rtc_business_id:e}),this._businessId=e},t.prototype.setUserVisibility=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){switch(t.label){case 0:if(cB.print("setUserVisibility()","enable: %o",e),e=!!e,this._visibility===e)return[2];if(!this._room)return this._visibility=e,[2];if(this._room.connectionState!==fP.CONNECTED)throw new dT(sT.NOT_CONNECTED_YET,"server not connected");return!e?[4,this._room.unpublish()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this._room.updateUserAttributes({role:e?aB.NORMAL_USER:aB.SILENT_USER})];case 3:return t.sent(),this._visibility=e,[2]}}))}))},t.prototype._initPlayerEvents=function(e){var t=this;e.on("playback_event",(function(r){var n,i;switch(r.eventName){case"timeupdate":return;case"loadeddata":if("audio"===r.type)t.safeEmit(sC.onAudioFirstFrameDecoded,{userId:e.userId}),aD.firstRemoteAudioRender("",r.userId);else{var o={userId:e.userId,height:(null===(n=e.domElement)||void 0===n?void 0:n.videoHeight)||0,width:(null===(i=e.domElement)||void 0===i?void 0:i.videoWidth)||0};t.safeEmit(sC.onVideoFirstFrameDecoded,o),t.safeEmit(sC.onVideoFirstFrameRendered,o),aD.firstRemoteVideoRender("",r.userId)}break;case"autoplay-error":return void t.safeEmit(sC.onAutoplayFailed,r)}t.safeEmit(sC.onPlayerEvent,r)}))},t.prototype._initLocalTrackEvents=function(e){var t=this;e.on("track-ended",(function(e){var r=!1;e!==t._localScreenAudioTrack&&e!==t._localScreenVideoTrack||(r=!0),t.safeEmit(sC.onTrackEnded,{kind:e.getTrack().kind,isScreen:r})}))},t.prototype.setRemoteVideoPlayer=function(e,t){var r,n,i,o,a,s;if(cB.print("setRemoteVideoPlayer()","streamIndex: %o, videoPlayerOption: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),t.renderDom){mC(t);var c=t.userId;if(e==dO.STREAM_INDEX_MAIN){var u=new WM(t);this._initPlayerEvents(u),this._remoteVideoPlayer.set(c,u),(d=null===(o=null===(i=this._room)||void 0===i?void 0:i.remoteStreams.get(c))||void 0===o?void 0:o.find((function(e){return!e.isScreen})))&&this._updateVideoPlayerState(d)}else{var d;u=new WM($n($n({},t),{isScreen:!0}));this._remoteScreenPlayer.set(c,u),this._initPlayerEvents(u),(d=null===(s=null===(a=this._room)||void 0===a?void 0:a.remoteStreams.get(c))||void 0===s?void 0:s.find((function(e){return e.isScreen})))&&this._updateVideoPlayerState(d)}}else e==dO.STREAM_INDEX_MAIN?(null===(r=this._videoPlayer)||void 0===r||r.destroy(),delete this._videoPlayer):(null===(n=this._screenPlayer)||void 0===n||n.destroy(),delete this._screenPlayer)},t.prototype.setLocalVideoMirrorType=function(e){cB.print("setLocalVideoMirrorType()","mirrorType: %o",e),fC(e,"mirrorType",[pO.MIRROR_TYPE_NONE,pO.MIRROR_TYPE_RENDER]),this._mirrorType=e,this._videoPlayer&&this._videoPlayer.mirror(!!e)},t.prototype.setAudioPlaybackDevice=function(e){var t;return ei(this,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:return cB.print("setAudioPlaybackDevice()","deviceId: %s",e),lC(e,"deviceId"),void 0===HTMLAudioElement.prototype.setSinkId?(cB.print("setAudioPlaybackDevice failed","setSinkId not supported by current browser"),[2]):[4,nM.getDeviceById(e)];case 1:if(!(r=n.sent()))throw new dT(sT.INVALID_DEVICE_ID,"audio playback device id ".concat(e," is invalid"));return this._remoteAudioPlayer.forEach((function(t){t.setPlaybackDevice(e)})),null===(t=this._audioPlayer)||void 0===t||t.setPlaybackDevice(e),this._audioPlaybackDeviceId=e,r&&this.safeEmit(sC.onAudioPlaybackDeviceChanged,r),aD.rtcAudioDevice(gk.PLAYOUT_DEVICE_SWITCH,e,0),[2]}}))}))},t.prototype.play=function(e){return ei(this,void 0,void 0,(function(){var t;return ti(this,(function(r){if(cB.print("play()","userId: %s",e),lC(e,"userId"),(t=this._remoteAudioPlayer.get(e))||(t=this._audioPlayer),!t)throw new dT(sT.INVALID_PARAMS,"Player not found");return[2,t.manuallyPlay()]}))}))},t.prototype.muteLocalAudio=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){if(cB.print("muteLocalAudio()","muteState: %o",e),fC(e,"muteState",[iO.MUTE_STATE_OFF,iO.MUTE_STATE_ON]),!this._room)throw new dT(sT.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("audio",e)]}))}))},t.prototype.muteLocalVideo=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){if(cB.print("muteLocalVideo()","muteState: %o",e),fC(e,"muteState",[iO.MUTE_STATE_OFF,iO.MUTE_STATE_ON]),!this._room)throw new dT(sT.UNPUBLISH_BEFORE_JOIN,"join first");return[2,this._room.muteLocalTrack("video",e)]}))}))},t.prototype.pauseAllSubscribedStream=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){return cB.print("pauseAllSubscribedStream()","mediaType: %o",e),fC(e,"mediaType",[cO.RTC_PAUSE_RESUME_CONTROL_AUDIO,cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,cO.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio&&this._pauseAllSubscribeState.video?[2,Promise.resolve()]:(e===cO.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!0:e===cO.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!0:e===cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!0,this._pauseAllSubscribeState.video=!0),this._room?[2,this._room.pauseAllSubscribedStream(e).then((function(){}))]:[2,Promise.resolve()])}))}))},t.prototype.resumeAllSubscribedStream=function(e){return ei(this,void 0,void 0,(function(){var t=this;return ti(this,(function(r){return cB.print("resumeAllSubscribedStream()","mediaType: %o",e),fC(e,"mediaType",[cO.RTC_PAUSE_RESUME_CONTROL_AUDIO,cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO,cO.RTC_PAUSE_RESUME_CONTROL_VIDEO]),this._pauseAllSubscribeState.audio||this._pauseAllSubscribeState.video?(e===cO.RTC_PAUSE_RESUME_CONTROL_AUDIO?this._pauseAllSubscribeState.audio=!1:e===cO.RTC_PAUSE_RESUME_CONTROL_VIDEO?this._pauseAllSubscribeState.video=!1:e===cO.RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO&&(this._pauseAllSubscribeState.audio=!1,this._pauseAllSubscribeState.video=!1),this._room?[2,this._room.resumeAllSubscribedStream(e).then((function(){var e,r;null===(r=null===(e=t._room)||void 0===e?void 0:e.remoteStreams)||void 0===r||r.forEach((function(e){Array.isArray(e)&&e.forEach((function(e){t._updateAudioPlayerState(e),t._updateVideoPlayerState(e)}))}))}))]:[2,Promise.resolve()]):[2,Promise.resolve()]}))}))},t.prototype.sendUserMessage=function(e,t){return ei(this,void 0,void 0,(function(){return ti(this,(function(r){if(lC(e,"userId",1,128),gC(t),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendUserBinaryMessage=function(e,t){return ei(this,void 0,void 0,(function(){return ti(this,(function(r){if(lC(e,"userId",1,128),function(e,t){if(!(e instanceof ArrayBuffer))throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,", should be ArrayBuffer"))}(t,"message"),gC(t),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.IM_BEFORE_JOIN,"join first");return[2,this._room.sendUserMessage(e,t)]}))}))},t.prototype.sendRoomMessage=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){if(gC(e),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e)]}))}))},t.prototype.sendRoomBinaryMessage=function(e){return ei(this,void 0,void 0,(function(){return ti(this,(function(t){if(gC(e),!this._room||this._room.connectionState!==fP.CONNECTED)throw new dT(sT.IM_BEFORE_JOIN,"join first");return[2,this._room.sendRoomMessage(e,!0)]}))}))},t.prototype.setAudioCaptureConfig=function(e){var t;return void 0===e&&(e={}),ei(this,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:return cB.print("setAudioCaptureConfig()","config: %o",e),delete e.deviceId,pC(e),r=this._audioStreamConstraints.deviceId,this._audioStreamConstraints=e,r&&(this._audioStreamConstraints.deviceId=r),this._localAudioTrack?(this._localAudioTrack.audioCaptureConfig=this._audioStreamConstraints,[4,null===(t=this._localAudioTrack)||void 0===t?void 0:t.updateAudioCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoCaptureConfig=function(e){var t;return void 0===e&&(e={}),ei(this,void 0,void 0,(function(){var r;return ti(this,(function(n){switch(n.label){case 0:return cB.print("setVideoCaptureConfig()","config: %o",e),delete e.deviceId,pC(e),r=this._videoStreamConstraints.deviceId,this._videoStreamConstraints=e,r&&(this._videoStreamConstraints.deviceId=r),this._localVideoTrack?(this._localVideoTrack.videoCaptureConfig=this._videoStreamConstraints,[4,null===(t=this._localVideoTrack)||void 0===t?void 0:t.updateVideoCaptureConfig()]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setVideoEncoderConfig=function(e,t){var r,n,i,o,a,s,c,u;return ei(this,void 0,void 0,(function(){return ti(this,(function(d){if(cB.print("setVideoEncoderConfig()","streamIndex: %o, descriptions: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),function(e,t){if(!Array.isArray(e))throw new dT(sT.INVALID_PARAMS,"Invalid ".concat(t,", should be array"))}(t,"descriptions"),t.length>3&&(t=t.slice(0,3)),t.sort((function(e,t){return t.maxKbps-e.maxKbps})),e===dO.STREAM_INDEX_MAIN){if(null===(n=null===(r=this._room)||void 0===r?void 0:r.localStream)||void 0===n?void 0:n.hasPublished){if(1!==this._videoStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new dT(sT.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(o=null===(i=this._room)||void 0===i?void 0:i.localStream)||void 0===o||o.updateVideoBitrate(t)}this._videoStreamEncodeConfig=t}else{if(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished){if(1!==this._screenStreamEncodeConfig.length||1!==(null==t?void 0:t.length))throw new dT(sT.INVALID_PARAMS,"After publishing, only non simulcast streams can be modified");null===(u=null===(c=this._room)||void 0===c?void 0:c.localScreenStream)||void 0===u||u.updateVideoBitrate([t[0]])}this._screenStreamEncodeConfig=t}return[2]}))}))},t.prototype.sendSEIMessage=function(e,t,r){var n,i,o,a,s,c;cB.print("sendSEIMessage()","streamIdex: %o, message: %o, repeatCount: %o",e,t,r),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),dC(r,"repeatCount",0,30);var u="string"==typeof t?new Uint8Array(oC.str2ab(t)):t;if(t.length){var d;if(e===dO.STREAM_INDEX_MAIN){if(!(null===(i=null===(n=this._room)||void 0===n?void 0:n.localStream)||void 0===i?void 0:i.hasPublished))return;d=null===(o=this._room)||void 0===o?void 0:o.localStream}else{if(!(null===(s=null===(a=this._room)||void 0===a?void 0:a.localScreenStream)||void 0===s?void 0:s.hasPublished))return;d=null===(c=this._room)||void 0===c?void 0:c.localScreenStream}if(u.byteLength>4096)cB.print("sei size must not bigger than 4KB");else{var l=rC();d.seiList.push({content:u,uuid:l,repeatCount:r}),setTimeout((function(){if(d){var e=d.seiList.findIndex((function(e){return e.uuid===l}));e&&d.seiList.splice(e,1)}}),2e3)}}else cB.print("sei message must not be empty")},t.prototype.setAudioVolumeIndicationInterval=function(e){var t=this;cB.print("setAudioVolumeIndicationInterval()","interval %o: ",e),("number"!=typeof e||e<200)&&(e=200);var r=[];this._audioVolumeIndicationTimer&&clearInterval(this._audioVolumeIndicationTimer),this._audioVolumeIndicationTimer=setInterval((function(){var e,n,i,o;r=[],null===(e=t._room)||void 0===e||e.remoteStreams.forEach((function(e,t){var n,i;if(0!==e.length){var o=null===(i=null===(n=e[0])||void 0===n?void 0:n.audioTrack)||void 0===i?void 0:i.getAudioLevel();r.push({userId:t,volume:o||0})}}));var a=null===(n=t._localAudioTrack)||void 0===n?void 0:n.getAudioLevel();r.push({userId:(null===(o=null===(i=t._room)||void 0===i?void 0:i.roomInfo)||void 0===o?void 0:o.userInfo.userId)||"local_user",volume:a||0}),t.safeEmit(sC.onAudioVolumeIndication,{speakers:r})}),e)},t.prototype.setVideoSourceType=function(e,t){var r,n,i,o,a;return ei(this,void 0,void 0,(function(){var s,c;return ti(this,(function(u){switch(u.label){case 0:return cB.print("setVideoSourceType()","index: %o, videoSourceType: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),fC(t,"VideoSourceType",[eO.VIDEO_SOURCE_TYPE_EXTERNAL,eO.VIDEO_SOURCE_TYPE_INTERNAL]),s=e===dO.STREAM_INDEX_MAIN?"video":"screenVideo",this._trackSourceType[s]===t?[3,4]:(this._trackSourceType[s]=t,cB.print("setVideoSourceType","set ".concat(s," source type to ").concat(t)),this._localVideoTrack&&e===dO.STREAM_INDEX_MAIN?(t===eO.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localVideoTrack.close(),null===(r=this._videoPlayer)||void 0===r||r.stop(),this._localVideoTrack=void 0,c=null===(n=this._room)||void 0===n?void 0:n._roomConfig.isAutoPublish,(null===(i=this._room)||void 0===i?void 0:i.hasPublished)||c?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:u.sent(),u.label=2;case 2:return this._localScreenVideoTrack&&e===dO.STREAM_INDEX_SCREEN?(t===eO.VIDEO_SOURCE_TYPE_EXTERNAL&&this._localScreenVideoTrack.close(),null===(o=this._screenPlayer)||void 0===o||o.stop(),this._localScreenVideoTrack=void 0,(null===(a=this._room)||void 0===a?void 0:a.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:u.sent(),u.label=4;case 4:return[2]}}))}))},t.prototype.setExternalVideoTrack=function(e,t){var r,n,i,o,a;return ei(this,void 0,void 0,(function(){var s;return ti(this,(function(c){switch(c.label){case 0:if(cB.print("setExternalVideoTrack()","index: %o, track: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),e!==dO.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.video!==eO.VIDEO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localVideoTrack=new bM(t,rC()),this._initLocalTrackEvents(this._localVideoTrack),null===(r=this._videoPlayer)||void 0===r||r.playVideo(this._localVideoTrack),s=null===(n=this._room)||void 0===n?void 0:n._roomConfig.isAutoPublish,(null===(i=this._room)||void 0===i?void 0:i.hasPublished)||s?[4,this._updatePublish()]:[3,2];case 1:c.sent(),c.label=2;case 2:if(e!==dO.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenVideo!==eO.VIDEO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setVideoSourceType as external first");return this._localScreenVideoTrack=new bM(t,rC()),this._initLocalTrackEvents(this._localScreenVideoTrack),null===(o=this._screenPlayer)||void 0===o||o.playVideo(this._localScreenVideoTrack),(null===(a=this._room)||void 0===a?void 0:a.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))},t.prototype.setAudioSourceType=function(e,t){var r,n,i;return ei(this,void 0,void 0,(function(){var o,a;return ti(this,(function(s){switch(s.label){case 0:return cB.print("setAudioSourceType()","index: %o, audioSourceType: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),fC(t,"audioSourceType",[tO.AUDIO_SOURCE_TYPE_EXTERNAL,tO.AUDIO_SOURCE_TYPE_INTERNAL]),o=e===dO.STREAM_INDEX_MAIN?"audio":"screenAudio",this._trackSourceType[o]===t?[3,4]:(this._trackSourceType[o]=t,cB.print("setVideoSourceType","set ".concat(o," source type to ").concat(t)),this._localAudioTrack&&e===dO.STREAM_INDEX_MAIN?(this._trackSourceType.audio===tO.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localAudioTrack.close(),this._localAudioTrack=void 0,a=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||a?[4,this._updatePublish()]:[3,2]):[3,2]);case 1:s.sent(),s.label=2;case 2:return this._localScreenAudioTrack&&e===dO.STREAM_INDEX_SCREEN?(this._trackSourceType.audio===tO.AUDIO_SOURCE_TYPE_EXTERNAL&&this._localScreenAudioTrack.close(),this._localScreenAudioTrack=void 0,(null===(i=this._room)||void 0===i?void 0:i.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4]):[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))},t.prototype.setExternalAudioTrack=function(e,t){var r,n,i;return ei(this,void 0,void 0,(function(){var o;return ti(this,(function(a){switch(a.label){case 0:if(cB.print("setExternalAudioTrack()","index: %o, track: %o",e,t),fC(e,"streamIndex",[dO.STREAM_INDEX_MAIN,dO.STREAM_INDEX_SCREEN]),e!==dO.STREAM_INDEX_MAIN)return[3,2];if(this._trackSourceType.audio!==tO.AUDIO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localAudioTrack=new TM(t,rC()),this._initLocalTrackEvents(this._localAudioTrack),o=null===(r=this._room)||void 0===r?void 0:r._roomConfig.isAutoPublish,(null===(n=this._room)||void 0===n?void 0:n.hasPublished)||o?[4,this._updatePublish()]:[3,2];case 1:a.sent(),a.label=2;case 2:if(e!==dO.STREAM_INDEX_SCREEN)return[3,4];if(this._trackSourceType.screenAudio!==tO.AUDIO_SOURCE_TYPE_EXTERNAL)throw new dT(sT.STREAM_TYPE_NOT_MATCH,"setAudioSourceType as external first");return this._localScreenAudioTrack=new TM(t,rC()),this._initLocalTrackEvents(this._localScreenAudioTrack),(null===(i=this._room)||void 0===i?void 0:i.hasScreenPublished)?[4,this._updateScreenPublish()]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))},t.prototype._updatePublish=function(){return ei(this,void 0,void 0,(function(){var e,t;return ti(this,(function(r){switch(r.label){case 0:if(cB.print("_updatePublish()"),!this._visibility)throw new dT(sT.NO_PUBLISH_PERMISSION,"no publish permission");return[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==fP.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publish(this._videoStreamEncodeConfig,this._localVideoTrack,this._localAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof dT?t:new dT(sT.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateScreenPublish=function(){return ei(this,void 0,void 0,(function(){var e,t;return ti(this,(function(r){switch(r.label){case 0:return cB.print("_updateScreenPublish()"),[4,this._pubLock.lock()];case 1:if(e=r.sent(),!this._room||this._room.connectionState!==fP.CONNECTED)return e(),[2];r.label=2;case 2:return r.trys.push([2,4,5,6]),[4,this._room.publishScreen(this._screenStreamEncodeConfig,this._localScreenVideoTrack,this._localScreenAudioTrack)];case 3:return r.sent(),[3,6];case 4:throw(t=r.sent())instanceof dT?t:new dT(sT.UNEXPECTED_ERROR,"unexpected error",t);case 5:return e(),[7];case 6:return[2]}}))}))},t.prototype._updateAudioPlayerState=function(e){cB.print("_updateAudioPlayerState()");var t,r=e.userId,n=e.isScreen;if(t=n?this._remoteAudioPlayer.get("".concat(r,"_screen")):this._remoteAudioPlayer.get(r),e.audioTrack){if(!t){var i=n?"".concat(r,"_screen"):r;t=new YM(i),this._initPlayerEvents(t),this._remoteAudioPlayer.set(i,t),this._audioPlaybackDeviceId&&t.setPlaybackDevice(this._audioPlaybackDeviceId)}t.playAudio(e.audioTrack)}else null==t||t.stop()},t.prototype._updateVideoPlayerState=function(e){cB.print("_updateVideoPlayerState()");var t,r=e.userId;t=e.isScreen?this._remoteScreenPlayer.get(r):this._remoteVideoPlayer.get(r),e.videoTrack?t&&t.playVideo(e.videoTrack,e):null==t||t.stop()},t.prototype._onAddStream=function(e){var t,r,n,i,o=e.stream,a={userId:o.userId,isScreen:o.isScreen,hasVideo:o.hasVideo,hasAudio:o.hasAudio,videoStreamDescriptions:o.attributes.videoDescriptions};this.safeEmit(sC.onStreamAdd,{stream:a});var s=null;(null===(t=this._roomConfig)||void 0===t?void 0:t.isAutoSubscribeAudio)&&(s=lO.AUDIO_ONLY),(null===(r=this._roomConfig)||void 0===r?void 0:r.isAutoSubscribeVideo)&&(s=lO.VIDEO_ONLY),(null===(n=this._roomConfig)||void 0===n?void 0:n.isAutoSubscribeVideo)&&(null===(i=this._roomConfig)||void 0===i?void 0:i.isAutoSubscribeAudio)&&(s=lO.AUDIO_AND_VIDEO),cB.print("_onAddStream","autoSubType: ".concat(s)),null===s||o.isScreen||this.subscribeUserStream(o.userId,s)},t.prototype._onRemoveStream=function(e){var t=e.stream,r={userId:t.userId,isScreen:t.isScreen,hasVideo:t.hasVideo,hasAudio:t.hasAudio,videoStreamDescriptions:[]},n=dB[e.reason]||fO.STREAM_REMOVE_REASON_OTHER;this.safeEmit(sC.onStreamRemove,{stream:r,reason:n}),this._stopRemotePlayer(t.userId,t.isScreen)},t.prototype._onUserConnection=function(e){this.safeEmit(sC.onUserJoined,e)},t.prototype._onUserDisconnection=function(e){var t,r,n,i;(null===(t=null==e?void 0:e.userInfo)||void 0===t?void 0:t.userId)===(null===(i=null===(n=null===(r=this._room)||void 0===r?void 0:r.roomInfo)||void 0===n?void 0:n.userInfo)||void 0===i?void 0:i.userId)?"userDuplicateLogin"===(null==e?void 0:e.reason)&&this.safeEmit(sC.onError,{errorCode:sT.DUPLICATE_LOGIN}):this.safeEmit(sC.onUserLeave,{userInfo:e.userInfo,reason:"userLeave"===e.reason?0:1})},t.prototype._onConnectionStateChange=function(e){this.safeEmit(sC.onConnectionStateChanged,e)},t.prototype._stopRemotePlayer=function(e,t){var r=t?"".concat(e,"_screen"):e,n=this._remoteAudioPlayer.get(r),i=this._remoteVideoPlayer.get(r);n&&n.stop(),i&&i.stop()},t.prototype._onResubscribe=function(e){e.stream&&(this._stopRemotePlayer(e.stream.userId,e.stream.isScreen),this._updateAudioPlayerState(e.stream),this._updateVideoPlayerState(e.stream))},t.prototype._onSubscribePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onRemovePushTrack=function(e){e.stream&&this._updateAudioPlayerState(e.stream)},t.prototype._onVideoFirstFrameDecoded=function(e){this.safeEmit(sC.onVideoFirstFrameDecoded,e)},t.prototype._onDeviceStateChange=function(e){this.safeEmit(sC.onMediaDeviceStateChanged,e)},t.prototype._onUserMuteAudio=function(e){this.safeEmit(sC.onUserMuteAudio,e)},t.prototype._onUserMuteVideo=function(e){this.safeEmit(sC.onUserMuteVideo,e)},t.prototype._onCustomMessage=function(e){var t=e.message;e.binary?this.safeEmit(sC.onRoomBinaryMessageReceived,{userId:e.clientId,message:t}):this.safeEmit(sC.onRoomMessageReceived,{userId:e.clientId,message:t})},t.prototype._onUserMessageReceived=function(e){this.safeEmit(sC.onUserMessageReceived,e)},t.prototype._onUserBinaryMessageReceived=function(e){this.safeEmit(sC.onUserBinaryMessageReceived,e)},t.prototype._onLiveTranscodingResult=function(e){this.safeEmit(sC.onLiveTranscodingResult,e)},Qn([sD()],t.prototype,"updateToken",null),Qn([sD()],t.prototype,"switchCamera",null),Qn([sD()],t.prototype,"switchMicrophone",null),Qn([sD()],t.prototype,"joinRoom",null),Qn([sD()],t.prototype,"leaveRoom",null),Qn([sD()],t.prototype,"destroy",null),Qn([sD()],t.prototype,"publish",null),Qn([sD()],t.prototype,"unpublish",null),Qn([sD()],t.prototype,"subscribeUserStream",null),Qn([sD()],t.prototype,"unSubscribe",null),Qn([sD()],t.prototype,"startVideoCapture",null),Qn([sD()],t.prototype,"stopVideoCapture",null),Qn([sD()],t.prototype,"startAudioCapture",null),Qn([sD()],t.prototype,"stopAudioCapture",null),Qn([sD()],t.prototype,"getAudioMixingManager",null),Qn([sD()],t.prototype,"startScreenCapture",null),Qn([sD()],t.prototype,"stopScreenCapture",null),Qn([sD()],t.prototype,"publishScreen",null),Qn([sD()],t.prototype,"unpublishScreen",null),Qn([sD()],t.prototype,"setLocalVideoPlayer",null),Qn([sD()],t.prototype,"startLiveTranscoding",null),Qn([sD()],t.prototype,"updateLiveTranscoding",null),Qn([sD()],t.prototype,"stopLiveTranscoding",null),Qn([sD()],t.prototype,"setBusinessId",null),Qn([sD()],t.prototype,"setUserVisibility",null),Qn([sD()],t.prototype,"setRemoteVideoPlayer",null),Qn([sD()],t.prototype,"setLocalVideoMirrorType",null),Qn([sD()],t.prototype,"setAudioPlaybackDevice",null),Qn([sD()],t.prototype,"play",null),Qn([sD()],t.prototype,"muteLocalAudio",null),Qn([sD()],t.prototype,"muteLocalVideo",null),Qn([sD()],t.prototype,"pauseAllSubscribedStream",null),Qn([sD()],t.prototype,"resumeAllSubscribedStream",null),Qn([sD()],t.prototype,"sendUserMessage",null),Qn([sD()],t.prototype,"sendUserBinaryMessage",null),Qn([sD()],t.prototype,"sendRoomMessage",null),Qn([sD()],t.prototype,"sendRoomBinaryMessage",null),Qn([sD()],t.prototype,"setAudioCaptureConfig",null),Qn([sD()],t.prototype,"setVideoCaptureConfig",null),Qn([sD()],t.prototype,"setVideoEncoderConfig",null),Qn([sD()],t.prototype,"sendSEIMessage",null),Qn([sD()],t.prototype,"setAudioVolumeIndicationInterval",null),Qn([sD()],t.prototype,"setVideoSourceType",null),Qn([sD()],t.prototype,"setExternalVideoTrack",null),Qn([sD()],t.prototype,"setAudioSourceType",null),Qn([sD()],t.prototype,"setExternalAudioTrack",null),t}(MC),dB={"client unpublished":fO.STREAM_REMOVE_REASON_UNPUBLISH,"publish failed":fO.STREAM_REMOVE_REASON_PUBLISH_FAILED,"stream removed":fO.STREAM_REMOVE_REASON_KEEP_LIVE_FAILED,"client disconnected":fO.STREAM_REMOVE_REASON_CLIENT_DISCONNECTED,"client republish":fO.STREAM_REMOVE_REASON_REPUBLISH},lB=new DC("VERTC",0),fB=function(e){return lB.print("createEngine","Invoke VERTC.createEngine"),lC(e,"appId"),nD.setStats({rtc_app_id:e,rtc_sdk_version:yB(),product_line:KN.RTC,report_version:XN.W_5,os:qN.WEB,device_id:yD.getDeviceId()}),aD.sdkInitEngine(Date.now(),Ik.BEGIN),new uB(e)},hB=function(e){if(lB.print("destroyEngine","Invoke VERTC.destroyEngine"),!(e instanceof uB))throw new dT(sT.INVALID_ENGINE,"Invalid engine object");e.destroy(),aD.sdkInitEngine(Date.now(),Ik.END)},pB=function(){return ei(void 0,void 0,void 0,(function(){return ti(this,(function(e){return[2,nM.getDevices()]}))}))},_B=function(e){return void 0===e&&(e={video:!0,audio:!0}),ei(void 0,void 0,void 0,(function(){var t,r,n,i,o;return ti(this,(function(a){switch(a.label){case 0:if(t=e.video,r=e.audio,n={video:!1,audio:!1},!t)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),i=n,[4,nM.getVideoPermission()];case 2:return i.video=a.sent(),[3,4];case 3:return a.sent(),[3,4];case 4:if(!r)return[3,8];a.label=5;case 5:return a.trys.push([5,7,,8]),o=n,[4,nM.getAudioPermission()];case 6:return o.audio=a.sent(),[3,8];case 7:return a.sent(),[3,8];case 8:return[2,n]}}))}))},vB=function(){return ei(void 0,void 0,void 0,(function(){return ti(this,(function(e){return[2,nM.getMicrophones()]}))}))},mB=function(){return ei(void 0,void 0,void 0,(function(){return ti(this,(function(e){return[2,nM.getCameras()]}))}))},gB=function(){return ei(void 0,void 0,void 0,(function(){return ti(this,(function(e){return[2,nM.getAudioPlayback()]}))}))},yB=function(){return NO.VERSION},EB=new function(){this.getSdkVersion=yB,this.createEngine=fB,this.destroyEngine=hB,this.getDevices=pB,this.enableDevices=_B,this.getMicrophones=vB,this.getCameras=mB,this.getAudioPlayback=gB,this.getParameter=DO,this.setParameter=kO,this.isSupported=tP,this.events=sC,this.ErrorCode=sT,this.platform="BytePlus"};export{JD as AudioMixingDualMonoMode,ZD as AudioMixingType,tO as AudioSourceType,rO as ChannelProfile,hO as ConnectionState,_O as LogChannel,sO as MirrorMode,pO as MirrorType,iO as MuteState,cO as PauseResumeControlMediaType,aO as PublishState,dO as StreamIndex,fO as StreamRemoveReason,lO as SubscribeMediaType,nO as SubscribeMode,oO as SubscribeState,uO as VideoRenderMode,eO as VideoSourceType,EB as default};