multiple-police-situations/public/rtc/AgoraRTC_N-4.11.0.js

31 lines
1.0 MiB
JavaScript
Raw Normal View History

/**
* AgoraWebSDK_N-v4.11.0-0-g961abf54 Copyright AgoraInc.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AgoraRTC=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},r=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i={},n=function(e){try{return!!e()}catch(e){return!0}},o=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),a=s,c=Function.prototype.call,d=a?c.bind(c):function(){return c.apply(c,arguments)},u={},A={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,l=h&&!A.call({1:2},1);u.f=l?function(e){var t=h(this,e);return!!t&&t.enumerable}:A;var p,g,f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},E=s,I=Function.prototype,m=I.bind,_=I.call,C=E&&m.bind(_,_),v=E?function(e){return e&&C(e)}:function(e){return e&&function(){return _.apply(e,arguments)}},S=v,y=S({}.toString),R=S("".slice),T=function(e){return R(y(e),8,-1)},w=v,b=n,O=T,N=r.Object,D=w("".split),L=b((function(){return!N("z").propertyIsEnumerable(0)}))?function(e){return"String"==O(e)?D(e,""):N(e)}:N,k=r.TypeError,P=function(e){if(null==e)throw k("Can't call method on "+e);return e},B=L,M=P,U=function(e){return B(M(e))},Q=function(e){return"function"==typeof e},x=Q,F=function(e){return"object"==typeof e?null!==e:x(e)},V=r,j=Q,G=function(e){return j(e)?e:void 0},K=function(e,t){return arguments.length<2?G(V[e]):V[e]&&V[e][t]},H=v({}.isPrototypeOf),Y=K("navigator","userAgent")||"",W=r,J=Y,q=W.process,z=W.Deno,X=q&&q.versions||z&&z.version,Z=X&&X.v8;Z&&(g=(p=Z.split("."))[0]>0&&p[0]<4?1:+(p[0]+p[1])),!g&&J&&(!(p=J.match(/Edge\/(\d+)/))||p[1]>=74)&&(p=J.match(/Chrome\/(\d+)/))&&(g=+p[1]);var $=g,ee=$,te=n,re=!!Object.getOwnPropertySymbols&&!te((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ee&&ee<41})),ie=re&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ne=K,oe=Q,se=H,ae=ie,ce=r.Object,de=ae?function(e){return"symbol"==typeof e}:function(e){var t=ne("Symbol");return oe(t)&&se(t.prototype,ce(e))},ue=r.String,Ae=function(e){try{return ue(e)}catch(e){return"Object"}},he=Q,le=Ae,pe=r.TypeError,ge=function(e){if(he(e))return e;throw pe(le(e)+" is not a function")},fe=ge,Ee=function(e,t){var r=e[t];return null==r?void 0:fe(r)},Ie=d,me=Q,_e=F,Ce=r.TypeError,ve={exports:{}},Se=r,ye=Object.defineProperty,Re=function(e,t){try{ye(Se,e,{value:t,configurable:!0,writable:!0})}catch(r){Se[e]=t}return t},Te=Re,we="__core-js_shared__",be=r[we]||Te(we,{}),Oe=be;(ve.exports=function(e,t){return Oe[e]||(Oe[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var Ne=P,De=r.Object,Le=function(e){return De(Ne(e))},ke=Le,Pe=v({}.hasOwnProperty),Be=Object.hasOwn||function(e,t){return Pe(ke(e),t)},Me=v,Ue=0,Qe=Math.random(),xe=Me(1..toString),Fe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+xe(++Ue+Qe,36)},Ve=r,je=ve.exports,Ge=Be,Ke=Fe,He=re,Ye=ie,We=je("wks"),Je=Ve.Symbol,qe=Je&&Je.for,ze=Ye?Je:Je&&Je.withoutSetter||Ke,Xe=function(e){if(!Ge(We,e)||!He&&"string"!=typeof We[e]){var t="Symbol."+e;He&&Ge(Je,e)?We[e]=Je[e]:We[e]=Ye&&qe?qe(t):ze(t)}return We[e]},Ze=d,$e=F,et=de,tt=Ee,rt=function(e,t){var r,i;if("string"===t&&me(r=e.toString)&&!_e(i=Ie(r,e)))return i;if(me(r=e.valueOf)&&!_e(i=Ie(r,e)))return i;if("string"!==t&&me(r=e.toString)&&!_e(i=Ie(r,e)))return i;throw Ce("Can't convert object to primitive value")},it=Xe,nt=r.TypeError,ot=it("toPrimitive"),st=function(e,t){if(!$e(e)
/*!@license
* UAParser.js v0.7.28
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
* Licensed under MIT License
*/!function(t,r){!function(e,i){var n="function",o="object",s="string",a="model",c="name",d="type",u="vendor",A="version",h="architecture",l="console",p="mobile",g="tablet",f="smarttv",E="wearable",I="embedded",m={extend:function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r},has:function(e,t){return typeof e===s&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),void 0===t?e:e.substring(0,255)}},_={rgx:function(e,t){for(var r,s,a,c,d,u,A=0;A<t.length&&!d;){var h=t[A],l=t[A+1];for(r=s=0;r<h.length&&!d;)if(d=h[r++].exec(e))for(a=0;a<l.length;a++)u=d[++s],typeof(c=l[a])===o&&c.length>0?2==c.length?typeof c[1]==n?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3==c.length?typeof c[1]!==n||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4==c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;A+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(m.has(t[r][n],e))return"?"===r?i:r}else if(m.has(t[r],e))return"?"===r?i:r;return e}},C={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},v={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[c,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[c,A],[/opios[\/\s]+([\w\.]+)/i],[A,[c,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[A,[c,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,A],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[A,[c,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[A,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[A,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[c,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[A,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[A,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],A],[/focus\/([\w\.]+)/i],[A,[c,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[A,[c,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[A,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[c,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[A,[c,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[A,[c,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[c,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],A],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],A],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[c,A],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[c],[/;fbav\/([\w\.]+);/i],[A,[c,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[c,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[c,A],[/\bgsa\/([\w\.]+)\s.*safari\//i],[A,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[A,[c,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],A],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[A,[c,"Android Browser"]],[/(chrome|omniw
/*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */function cJ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function dJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cJ(Object(r),!0).forEach((function(t){kO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cJ(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(){var t;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};var n,o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var r=0;r<t.length;++r){var i=t[r];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")}(this);function s(e,t){if(t)e:{var r=o;e=e.split(".");for(var n=0;n<e.length-1;n++){var s=e[n];if(!(s in r))break e;r=r[s]}(t=t(n=r[e=e[e.length-1]]))!=n&&null!=t&&i(r,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function c(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}if(s("Symbol",(function(e){function t(e,t){this.A=e,i(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.A};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",n=0;return function e(i){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(i||"")+"_"+n++,i)}})),s("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var s=o[t[n]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&i(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(r(this))}})}return e})),"function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var d;e:{var u={};try{u.__proto__={a:!0},d=u.a;break e}catch(e){}d=!1}n=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var A=n;function h(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function l(e){if(e.m)throw new TypeError("Generator is already running");e.m=!0}function p(e,t){return e.h=3,{value:t}}function g(e){this.g=new h,this.G=e}function f(e,t,r,i){try{var n=t.call(e.g.j,r);if(!(n instanceof Object))throw new TypeError("Iterator result "+n+" is not an object");if(!n.done)return e.g.m=!1,n;var o=n.value}catch(t){return e.g.j=null,e.g.s(t),E(e)}return e.g.j=null,i.call(e.g,o),E(e)}function E(e){for(;e.g.h;)try{var t=e.G(e.g);if(t)return e.g.m=!1,{value:t.value,done:!1}}catch(t){e.g.v=void 0,e.g.s(t)}if(e.g.m=!1,e.g.l){if(t=e.g.l,e.g.l=null,t.F)throw t.D;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function I(e){this.next=function(t){return e.o(t)},this.throw=function(t){return e.s(t)},this.return=function(t){return function(e,t){l(e.g);var r=e.g.j;return r?f(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),E(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function m(e,t){return t=new I(new g(t)),A&&e.prototype&&A(t,e.prototype),t}if(h.prototype.o=function(e){this.v=e},h.prototype.s=function(e){this.l={D:e,F:!0},this.h=this.C||this.u},h.prototype.return=function(e){this.l={return:e},this.h=this.u},g.prototype.o=function(e){return l(this.g),this.g.j?f(this,this.g.j.next,e,this.g.o):(this.g.o(e),E(this))},g.prototype.s=function(e){return l(this.g),this.g.j?f(this,this.g.j.throw,e,this.g.o):(t
/*@cc_on!@*/
!!document.documentMode&&!!window.StyleMedia&&(HTMLCanvasElement.prototype.getContext=(tq=HTMLCanvasElement.prototype.getContext,function(){let e=arguments;const t=e[0];return"webgl"===t&&(e=[].slice.call(arguments),e[0]="experimental-webgl"),tq.apply(null,e)}));const rq=[31,222,239,159,192,236,164,81,54,227,176,149,2,247,75,141,183,54,213,216,158,92,111,49,228,111,150,6,135,79,35,212,4,155,200,168,37,107,243,110,144,179,51,81,55,78,223,242,191,211,74,119,203,151,142,62,31,41,132,22,35,155,87,123,119,117,216,57,201,53,228,67,201,40,106,24,80,176,187,253,60,63,136,100,20,12,177,99,64,38,101,143,111,176,251,211,145,136,34,23,79,136,202,95,105,199,125,67,180,44,210,179,228,4,85,160,188,64,26,46,6,61,201,103,248,18,97,254,140,36,115,106,48,124,102,216,155,120,36,227,165,217,7,227,191,128,212,157,80,37,117,175,24,214,47,221,183,211,51,174,251,223,159,167,152,53,36,107,199,223,91,62,46,194,11,80,121,188,219,2,99,99,232,229,173,234,21,30,236,177,243,142,97,48,108,56,62,172,56,216,3,42,79,138,23,88,182,39,5,118,68,135,178,56,9,94,189,44,104,9,238,231,174,122,85,247,231,86,74,8,189,147,218,180,58,76,227,17,46,90,194,100,51,178,72,163,151,243,166,130,85,1,223,130,152,242,85,255,28,173,97,252,119,215,177,119,86,104,136,82,40,72,53,11,18,26,240,188,76,110,39,31,189];function iq(e){const t=new Uint8Array([99,114,121,112,116,105,105]),r=t.length,i=e,n=i.length,o=new Uint8Array(n),s=new Uint8Array(256);for(let e=0;e<256;e++)s[e]=e;let a=0;for(let e=0;e<256;e++)a=(a+s[e]+t[e%r])%256,[s[e],s[a]]=[s[a],s[e]];let c,d=0;a=0;for(let e=0;e<0+n;e++)d=(d+1)%256,a=(a+s[d])%256,[s[d],s[a]]=[s[a],s[d]],c=s[(s[d]+s[a])%256],e>=0&&(o[e-0]=i[e-0]^c);const u=String.fromCharCode.apply(null,Array.from(o));return Function("var winSize = 5; return `"+u+"`")()}const nq=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,152,221,191,124,116,248,106,130,251,59,105,43,91,135,199,181,223,10,51,134,194,240,46,9,3,141,22,35,146,76,23,109,117,208,41,201,45,218,76,203,105,51,58,97,154,145,236,49,18,183,127,27,12,210,122,73,42,37,143,36,207,251,211,145,191,56,10,88,222,181,125,22,238,123,71,177,107,218,254,173,28,34,253,249,67,83,97,73,111,219,43,181,82,38,230,136,109,22,67];class oq{constructor(e,t){kO(this,"program",void 0),kO(this,"gl",void 0),kO(this,"kernel",void 0),this.gl=e,this.kernel=t||nq,this.program=function(e,t){const r=iq(t),i=eq(e,[iq(rq),r]);{const t=e.getAttribLocation(i,"a_position"),r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const n=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,n,o,s,a,c)}{const t=e.getAttribLocation(i,"a_texCoord"),r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(t);const n=2,o=e.FLOAT,s=!1,a=0,c=0;e.vertexAttribPointer(t,n,o,s,a,c)}return i}(this.gl,this.kernel)}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY");this.gl.uniform1f(e,1)}}class sq extends oq{constructor(e,t,r,i){super(e,t),kO(this,"xOffset",void 0),kO(this,"yOffset",void 0),kO(this,"denoiseLevel",5),this.xOffset=1/r,this.yOffset=1/i}setUniforms(){const e=this.gl.getUniformLocation(this.program,"u_flipY"),t=this.gl.getUniformLocation(this.program,"u_singleStepOffset"),r=this.gl.getUniformLocation(this.program,"u_denoiseLevel");this.gl.uniform2f(t,this.xOffset,this.yOffset),this.gl.uniform1f(r,this.denoiseLevel),this.gl.uniform1f(e,1)}setParameters(e){void 0!==e.denoiseLevel&&(this.denoiseLevel=e.denoiseLevel)}setSize(e,t){this.xOffset=1/e,this.yOffset=1/t}}const aq=[11,196,242,139,198,252,188,5,59,170,161,152,17,229,24,141,133,54,214,206,133,26,66,126,255,11,245,10,146,92,52,134,108,155,210,164,99,114,228,96,130,251,59,105,43,91,135,199,181,223,10,51,133,194,247,34,31,39,142,28,2,130,18,109,84,124,223,62,140,52,128,47,208,47,115,39,4,200,220,171,53,36,150,101,10,75,247,121,74,36,35,143,108,176,235,211,135,164,36,11,88,160,148,35,6,221,41,32
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function XZ(e,t){function r(){this.constructor=e}zZ(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ZZ=function(){return(ZZ=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function $Z(e,t,r,i){return new(r||(r=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function e$(e,t){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var t$,r$={address:"unknown",candidateType:"unknown",id:"unknown",port:0,priority:0,protocol:"unknown",type:"unknown"},i$={timestamp:0,bitrate:{actualEncoded:0,transmit:0},sendPacketLossRate:0,recvPacketLossRate:0,videoRecv:[],videoSend:[],audioRecv:[],audioSend:[],selectedCandidatePair:{id:"unknown",localCandidate:r$,remoteCandidate:r$}},n$={firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,qpSumPerFrame:0},o$={firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,qpSumPerFrame:0},s$={bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0},a$={jitterBufferMs:0,jitterMs:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0},c$=function(){function e(e,t){var r=this;this.videoIsReady=!1,this.videoIsReady2={},this.stats=WZ(i$),this.isFirstVideoReceived={},this.isFirstVideoDecoded={},this.isFirstAudioReceived={},this.isFirstAudioDecoded={},this.lossRateWindowStats=[],this.pc=e,this.options=t,this.intervalTimer=window.setInterval((function(){return $Z(r,void 0,void 0,(function(){return e$(this,(function(e){return this.updateStats(),[2]}))}))}),this.options.updateInterval)}return e.prototype.getStats=function(){return this.stats},e.prototype.setVideoIsReady=function(e){this.videoIsReady=e},e.prototype.setVideoIsReady2=function(e,t){this.videoIsReady2[e]=t},e.prototype.getVideoIsReady=function(e){return this.videoIsReady2[e]||!1},e.prototype.setIsFirstAudioDecoded=function(e){},e.prototype.destroy=function(){window.clearInterval(this.intervalTimer),this.pc=void 0},e.prototype.calcLossRate=function(e){var t=this;this.lossRateWindowStats.push(e),this.lossRateWindowStats.length>this.options.lossRateInterval&&this.lossRateWindowStats.splice(0,1);for(var r=this.lossRateWindowStats.length,i=0,n=0,o=0,s=0,a=function(a){e[a].forEach((function(e,c){if(t.lossRateWindowStats[r-1][a][c]&&t.lossRateWindowStats[0][a][c]){var d=t.lossRateWindowStats[r-1][a][c].packets-t.lossRateWindowStats[0][a][c].packets,u=t.lossRateWindowStats[r-1][a][c].packetsLost-t.lossRateWindowStats[0][a][c].packetsLost;"videoSend"===a||"audioSend"===a?(i+=d,o+=u):(n+=d,s+=u),Number.isNaN(d)||Number.isNaN(d)?e.packetLostR