@flowplayer/player 3.4.6-rc.1 → 3.4.7-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.
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +3 -3
- package/flowplayer.css +1 -1
- package/package.json +5 -2
- package/plugins/acl.js +1 -0
- package/plugins/ads.js +2 -2
- package/plugins/analytics.js +1 -1
- package/plugins/asel.js +1 -1
- package/plugins/chapters.js +1 -1
- package/plugins/dash.js +1 -1
- package/plugins/endscreen.js +1 -1
- package/plugins/google-analytics.js +1 -1
- package/plugins/health.js +1 -1
- package/plugins/keyboard.js +1 -1
- package/plugins/ovp.js +1 -1
- package/plugins/playlist.js +1 -1
- package/plugins/preview.js +1 -1
- package/plugins/qsel.js +1 -1
- package/plugins/qul.js +1 -1
- package/plugins/rts.js +1 -0
- package/plugins/share.js +1 -1
- package/plugins/speed.js +1 -1
- package/plugins/subtitles.js +1 -1
- package/plugins/thumbnails.js +1 -1
- package/plugins/tizen.js +1 -0
- package/plugins/webos.js +1 -0
- package/plugins/millicast.js +0 -1
package/plugins/rts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.rts=t())}(this,(function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function t(e,t){const r=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),n=(n,...i)=>{try{const o=(null==t?void 0:t.debug)||r;o&&e.match(o)&&console.log(`flowplayer/${e} -- ${n}`,...i)}catch(e){console.warn(e)}};return n.log=n,n}function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}var i=r,o=n;function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}"function"==typeof e.setTimeout&&(i=setTimeout),"function"==typeof e.clearTimeout&&(o=clearTimeout);var a,c=[],u=!1,l=-1;function d(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var e=s(d);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===n||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}p.prototype.run=function(){this.fun.apply(null,this.array)};function h(){}var m=h,g=h,v=h,y=h,w=h,b=h,S=h;var x=e.performance||{},C=x.now||x.mozNow||x.msNow||x.oNow||x.webkitNow||function(){return(new Date).getTime()};var E=new Date;var I={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||u||s(f)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:m,addListener:g,once:v,off:y,removeListener:w,removeAllListeners:b,emit:S,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*C.call(x),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-E)/1e3}};function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,i)}function A(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){P(o,n,i,s,a,"next",e)}function a(e){P(o,n,i,s,a,"throw",e)}s(void 0)}))}}function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(e,t)||L(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){if(e){if("string"==typeof e)return D(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(e,t):void 0}}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=L(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function j(e){var t={exports:{}};return e(t,t.exports),t.exports}var B,_,U=function(e){return e&&e.Math==Math&&e},F=U("object"==typeof globalThis&&globalThis)||U("object"==typeof window&&window)||U("object"==typeof self&&self)||U("object"==typeof N&&N)||function(){return this}()||Function("return this")(),V=function(e){try{return!!e()}catch(e){return!0}},z=!V((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),G=!V((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),q=Function.prototype.call,X=G?q.bind(q):function(){return q.apply(q,arguments)},W={}.propertyIsEnumerable,H=Object.getOwnPropertyDescriptor,Y={f:H&&!W.call({1:2},1)?function(e){var t=H(this,e);return!!t&&t.enumerable}:W},K=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Q=Function.prototype,J=Q.bind,Z=Q.call,ee=G&&J.bind(Z,Z),te=G?function(e){return e&&ee(e)}:function(e){return e&&function(){return Z.apply(e,arguments)}},re=te({}.toString),ne=te("".slice),ie=function(e){return ne(re(e),8,-1)},oe=Object,se=te("".split),ae=V((function(){return!oe("z").propertyIsEnumerable(0)}))?function(e){return"String"==ie(e)?se(e,""):oe(e)}:oe,ce=function(e){return null==e},ue=TypeError,le=function(e){if(ce(e))throw ue("Can't call method on "+e);return e},de=function(e){return ae(le(e))},fe="object"==typeof document&&document.all,pe={all:fe,IS_HTMLDDA:void 0===fe&&void 0!==fe},he=pe.all,me=pe.IS_HTMLDDA?function(e){return"function"==typeof e||e===he}:function(e){return"function"==typeof e},ge=pe.all,ve=pe.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:me(e)||e===ge}:function(e){return"object"==typeof e?null!==e:me(e)},ye=function(e){return me(e)?e:void 0},we=function(e,t){return arguments.length<2?ye(F[e]):F[e]&&F[e][t]},be=te({}.isPrototypeOf),Se=we("navigator","userAgent")||"",xe=F.process,Ce=F.Deno,Ee=xe&&xe.versions||Ce&&Ce.version,Ie=Ee&&Ee.v8;Ie&&(_=(B=Ie.split("."))[0]>0&&B[0]<4?1:+(B[0]+B[1])),!_&&Se&&(!(B=Se.match(/Edge\/(\d+)/))||B[1]>=74)&&(B=Se.match(/Chrome\/(\d+)/))&&(_=+B[1]);var Te=_,Re=!!Object.getOwnPropertySymbols&&!V((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Te&&Te<41})),Pe=Re&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ae=Object,ke=Pe?function(e){return"symbol"==typeof e}:function(e){var t=we("Symbol");return me(t)&&be(t.prototype,Ae(e))},Oe=String,Le=function(e){try{return Oe(e)}catch(e){return"Object"}},De=TypeError,Me=function(e){if(me(e))return e;throw De(Le(e)+" is not a function")},Ne=function(e,t){var r=e[t];return ce(r)?void 0:Me(r)},je=TypeError,Be=Object.defineProperty,_e=function(e,t){try{Be(F,e,{value:t,configurable:!0,writable:!0})}catch(r){F[e]=t}return t},Ue=F["__core-js_shared__"]||_e("__core-js_shared__",{}),Fe=j((function(e){(e.exports=function(e,t){return Ue[e]||(Ue[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.2",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.2/LICENSE",source:"https://github.com/zloirock/core-js"})})),Ve=Object,ze=function(e){return Ve(le(e))},$e=te({}.hasOwnProperty),Ge=Object.hasOwn||function(e,t){return $e(ze(e),t)},qe=0,Xe=Math.random(),We=te(1..toString),He=function(e){return"Symbol("+(void 0===e?"":e)+")_"+We(++qe+Xe,36)},Ye=Fe("wks"),Ke=F.Symbol,Qe=Ke&&Ke.for,Je=Pe?Ke:Ke&&Ke.withoutSetter||He,Ze=function(e){if(!Ge(Ye,e)||!Re&&"string"!=typeof Ye[e]){var t="Symbol."+e;Re&&Ge(Ke,e)?Ye[e]=Ke[e]:Ye[e]=Pe&&Qe?Qe(t):Je(t)}return Ye[e]},et=TypeError,tt=Ze("toPrimitive"),rt=function(e){var t=function(e,t){if(!ve(e)||ke(e))return e;var r,n=Ne(e,tt);if(n){if(void 0===t&&(t="default"),r=X(n,e,t),!ve(r)||ke(r))return r;throw et("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&me(r=e.toString)&&!ve(n=X(r,e)))return n;if(me(r=e.valueOf)&&!ve(n=X(r,e)))return n;if("string"!==t&&me(r=e.toString)&&!ve(n=X(r,e)))return n;throw je("Can't convert object to primitive value")}(e,t)}(e,"string");return ke(t)?t:t+""},nt=F.document,it=ve(nt)&&ve(nt.createElement),ot=function(e){return it?nt.createElement(e):{}},st=!z&&!V((function(){return 7!=Object.defineProperty(ot("div"),"a",{get:function(){return 7}}).a})),at=Object.getOwnPropertyDescriptor,ct={f:z?at:function(e,t){if(e=de(e),t=rt(t),st)try{return at(e,t)}catch(e){}if(Ge(e,t))return K(!X(Y.f,e,t),e[t])}},ut=z&&V((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),lt=String,dt=TypeError,ft=function(e){if(ve(e))return e;throw dt(lt(e)+" is not an object")},pt=TypeError,ht=Object.defineProperty,mt=Object.getOwnPropertyDescriptor,gt={f:z?ut?function(e,t,r){if(ft(e),t=rt(t),ft(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=mt(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 ht(e,t,r)}:ht:function(e,t,r){if(ft(e),t=rt(t),ft(r),st)try{return ht(e,t,r)}catch(e){}if("get"in r||"set"in r)throw pt("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},vt=z?function(e,t,r){return gt.f(e,t,K(1,r))}:function(e,t,r){return e[t]=r,e},yt=Function.prototype,wt=z&&Object.getOwnPropertyDescriptor,bt=Ge(yt,"name"),St={EXISTS:bt,PROPER:bt&&"something"===function(){}.name,CONFIGURABLE:bt&&(!z||z&&wt(yt,"name").configurable)},xt=te(Function.toString);me(Ue.inspectSource)||(Ue.inspectSource=function(e){return xt(e)});var Ct,Et,It,Tt=Ue.inspectSource,Rt=F.WeakMap,Pt=me(Rt)&&/native code/.test(String(Rt)),At=Fe("keys"),kt=function(e){return At[e]||(At[e]=He(e))},Ot={},Lt=F.TypeError,Dt=F.WeakMap;if(Pt||Ue.state){var Mt=Ue.state||(Ue.state=new Dt),Nt=te(Mt.get),jt=te(Mt.has),Bt=te(Mt.set);Ct=function(e,t){if(jt(Mt,e))throw Lt("Object already initialized");return t.facade=e,Bt(Mt,e,t),t},Et=function(e){return Nt(Mt,e)||{}},It=function(e){return jt(Mt,e)}}else{var _t=kt("state");Ot[_t]=!0,Ct=function(e,t){if(Ge(e,_t))throw Lt("Object already initialized");return t.facade=e,vt(e,_t,t),t},Et=function(e){return Ge(e,_t)?e[_t]:{}},It=function(e){return Ge(e,_t)}}var Ut={set:Ct,get:Et,has:It,enforce:function(e){return It(e)?Et(e):Ct(e,{})},getterFor:function(e){return function(t){var r;if(!ve(t)||(r=Et(t)).type!==e)throw Lt("Incompatible receiver, "+e+" required");return r}}},Ft=j((function(e){var t=St.CONFIGURABLE,r=Ut.enforce,n=Ut.get,i=Object.defineProperty,o=z&&!V((function(){return 8!==i((function(){}),"length",{value:8}).length})),s=String(String).split("String"),a=e.exports=function(e,n,a){"Symbol("===String(n).slice(0,7)&&(n="["+String(n).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),a&&a.getter&&(n="get "+n),a&&a.setter&&(n="set "+n),(!Ge(e,"name")||t&&e.name!==n)&&(z?i(e,"name",{value:n,configurable:!0}):e.name=n),o&&a&&Ge(a,"arity")&&e.length!==a.arity&&i(e,"length",{value:a.arity});try{a&&Ge(a,"constructor")&&a.constructor?z&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=r(e);return Ge(c,"source")||(c.source=s.join("string"==typeof n?n:"")),e};Function.prototype.toString=a((function(){return me(this)&&n(this).source||Tt(this)}),"toString")})),Vt=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(me(r)&&Ft(r,o,n),n.global)i?e[t]=r:_e(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:gt.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},zt=Math.ceil,$t=Math.floor,Gt=Math.trunc||function(e){var t=+e;return(t>0?$t:zt)(t)},qt=function(e){var t=+e;return t!=t||0===t?0:Gt(t)},Xt=Math.max,Wt=Math.min,Ht=function(e,t){var r=qt(e);return r<0?Xt(r+t,0):Wt(r,t)},Yt=Math.min,Kt=function(e){return e>0?Yt(qt(e),9007199254740991):0},Qt=function(e){return Kt(e.length)},Jt=function(e){return function(t,r,n){var i,o=de(t),s=Qt(o),a=Ht(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},Zt={includes:Jt(!0),indexOf:Jt(!1)},er=Zt.indexOf,tr=te([].push),rr=function(e,t){var r,n=de(e),i=0,o=[];for(r in n)!Ge(Ot,r)&&Ge(n,r)&&tr(o,r);for(;t.length>i;)Ge(n,r=t[i++])&&(~er(o,r)||tr(o,r));return o},nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ir=nr.concat("length","prototype"),or={f:Object.getOwnPropertyNames||function(e){return rr(e,ir)}},sr={f:Object.getOwnPropertySymbols},ar=te([].concat),cr=we("Reflect","ownKeys")||function(e){var t=or.f(ft(e)),r=sr.f;return r?ar(t,r(e)):t},ur=function(e,t,r){for(var n=cr(t),i=gt.f,o=ct.f,s=0;s<n.length;s++){var a=n[s];Ge(e,a)||r&&Ge(r,a)||i(e,a,o(t,a))}},lr=/#|\.prototype\./,dr=function(e,t){var r=pr[fr(e)];return r==mr||r!=hr&&(me(t)?V(t):!!t)},fr=dr.normalize=function(e){return String(e).replace(lr,".").toLowerCase()},pr=dr.data={},hr=dr.NATIVE="N",mr=dr.POLYFILL="P",gr=dr,vr=ct.f,yr=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?F:u?F[a]||_e(a,{}):(F[a]||{}).prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=vr(r,n))&&s.value:r[n],!gr(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;ur(o,i)}(e.sham||i&&i.sham)&&vt(o,"sham",!0),Vt(r,n,o,e)}},wr=Array.isArray||function(e){return"Array"==ie(e)},br=TypeError,Sr=function(e){if(e>9007199254740991)throw br("Maximum allowed index exceeded");return e},xr=function(e,t,r){var n=rt(t);n in e?gt.f(e,n,K(0,r)):e[n]=r},Cr={};Cr[Ze("toStringTag")]="z";var Er="[object z]"===String(Cr),Ir=Ze("toStringTag"),Tr=Object,Rr="Arguments"==ie(function(){return arguments}()),Pr=Er?ie: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=Tr(e),Ir))?r:Rr?ie(t):"Object"==(n=ie(t))&&me(t.callee)?"Arguments":n},Ar=function(){},kr=[],Or=we("Reflect","construct"),Lr=/^\s*(?:class|function)\b/,Dr=te(Lr.exec),Mr=!Lr.exec(Ar),Nr=function(e){if(!me(e))return!1;try{return Or(Ar,kr,e),!0}catch(e){return!1}},jr=function(e){if(!me(e))return!1;switch(Pr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mr||!!Dr(Lr,Tt(e))}catch(e){return!0}};jr.sham=!0;var Br=!Or||V((function(){var e;return Nr(Nr.call)||!Nr(Object)||!Nr((function(){e=!0}))||e}))?jr:Nr,_r=Ze("species"),Ur=Array,Fr=function(e,t){return new(function(e){var t;return wr(e)&&(t=e.constructor,(Br(t)&&(t===Ur||wr(t.prototype))||ve(t)&&null===(t=t[_r]))&&(t=void 0)),void 0===t?Ur:t}(e))(0===t?0:t)},Vr=Ze("species"),zr=function(e){return Te>=51||!V((function(){var t=[];return(t.constructor={})[Vr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},$r=Ze("isConcatSpreadable"),Gr=Te>=51||!V((function(){var e=[];return e[$r]=!1,e.concat()[0]!==e})),qr=zr("concat"),Xr=function(e){if(!ve(e))return!1;var t=e[$r];return void 0!==t?!!t:wr(e)};yr({target:"Array",proto:!0,arity:1,forced:!Gr||!qr},{concat:function(e){var t,r,n,i,o,s=ze(this),a=Fr(s,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(Xr(o=-1===t?s:arguments[t]))for(i=Qt(o),Sr(c+i),r=0;r<i;r++,c++)r in o&&xr(a,c,o[r]);else Sr(c+1),xr(a,c++,o);return a.length=c,a}});var Wr=te([].slice),Hr=zr("slice"),Yr=Ze("species"),Kr=Array,Qr=Math.max;yr({target:"Array",proto:!0,forced:!Hr},{slice:function(e,t){var r,n,i,o=de(this),s=Qt(o),a=Ht(e,s),c=Ht(void 0===t?s:t,s);if(wr(o)&&(r=o.constructor,(Br(r)&&(r===Kr||wr(r.prototype))||ve(r)&&null===(r=r[Yr]))&&(r=void 0),r===Kr||void 0===r))return Wr(o,a,c);for(n=new(void 0===r?Kr:r)(Qr(c-a,0)),i=0;a<c;a++,i++)a in o&&xr(n,i,o[a]);return n.length=i,n}});var Jr=te(te.bind),Zr=function(e,t){return Me(e),void 0===t?e:G?Jr(e,t):function(){return e.apply(t,arguments)}},en=te([].push),tn=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,l,d){for(var f,p,h=ze(c),m=ae(h),g=Zr(u,l),v=Qt(m),y=0,w=d||Fr,b=t?w(c,v):r||s?w(c,0):void 0;v>y;y++)if((a||y in m)&&(p=g(f=m[y],y,h),e))if(t)b[y]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return y;case 2:en(b,f)}else switch(e){case 4:return!1;case 7:en(b,f)}return o?-1:n||i?i:b}},rn={forEach:tn(0),map:tn(1),filter:tn(2),some:tn(3),every:tn(4),find:tn(5),findIndex:tn(6),filterReject:tn(7)},nn=rn.map,on=zr("map");yr({target:"Array",proto:!0,forced:!on},{map:function(e){return nn(this,e,arguments.length>1?arguments[1]:void 0)}});var sn=Function.prototype,an=sn.apply,cn=sn.call,un="object"==typeof Reflect&&Reflect.apply||(G?cn.bind(an):function(){return cn.apply(an,arguments)}),ln=we("JSON","stringify"),dn=te(/./.exec),fn=te("".charAt),pn=te("".charCodeAt),hn=te("".replace),mn=te(1..toString),gn=/[\uD800-\uDFFF]/g,vn=/^[\uD800-\uDBFF]$/,yn=/^[\uDC00-\uDFFF]$/,wn=!Re||V((function(){var e=we("Symbol")();return"[null]"!=ln([e])||"{}"!=ln({a:e})||"{}"!=ln(Object(e))})),bn=V((function(){return'"\\udf06\\ud834"'!==ln("\udf06\ud834")||'"\\udead"'!==ln("\udead")})),Sn=function(e,t){var r=Wr(arguments),n=t;if((ve(t)||void 0!==e)&&!ke(e))return wr(t)||(t=function(e,t){if(me(n)&&(t=X(n,this,e,t)),!ke(t))return t}),r[1]=t,un(ln,null,r)},xn=function(e,t,r){var n=fn(r,t-1),i=fn(r,t+1);return dn(vn,e)&&!dn(yn,i)||dn(yn,e)&&!dn(vn,n)?"\\u"+mn(pn(e,0),16):e};ln&&yr({target:"JSON",stat:!0,arity:3,forced:wn||bn},{stringify:function(e,t,r){var n=Wr(arguments),i=un(wn?Sn:ln,null,n);return bn&&"string"==typeof i?hn(i,gn,xn):i}});var Cn=j((function(e){!function(t){var r,n={VERSION:"1.6.1"},i={},o=function(e,t){return function(){return t.apply(e,arguments)}},s=function(){var e,t,r=arguments,n=r[0];for(t=1;t<r.length;t++)for(e in r[t])!(e in n)&&r[t].hasOwnProperty(e)&&(n[e]=r[t][e]);return n},a=function(e,t){return{value:e,name:t}};n.TRACE=a(1,"TRACE"),n.DEBUG=a(2,"DEBUG"),n.INFO=a(3,"INFO"),n.TIME=a(4,"TIME"),n.WARN=a(5,"WARN"),n.ERROR=a(8,"ERROR"),n.OFF=a(99,"OFF");var c=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};c.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},getLevel:function(){return this.context.filterLevel},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(n.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(n.TIME,[e,"end"])},invoke:function(e,t){r&&this.enabledFor(e)&&r(t,s({level:e},this.context))}};var u,l=new c({filterLevel:n.OFF});(u=n).enabledFor=o(l,l.enabledFor),u.trace=o(l,l.trace),u.debug=o(l,l.debug),u.time=o(l,l.time),u.timeEnd=o(l,l.timeEnd),u.info=o(l,l.info),u.warn=o(l,l.warn),u.error=o(l,l.error),u.log=u.info,n.setHandler=function(e){r=e},n.setLevel=function(e){for(var t in l.setLevel(e),i)i.hasOwnProperty(t)&&i[t].setLevel(e)},n.getLevel=function(){return l.getLevel()},n.get=function(e){return i[e]||(i[e]=new c(s({name:e},l.context)))},n.createDefaultHandler=function(e){(e=e||{}).formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},r=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(i,o){i=Array.prototype.slice.call(i);var s,a=console.log;o.level===n.TIME?(s=(o.name?"["+o.name+"] ":"")+i[0],"start"===i[1]?console.time?console.time(s):t[s]=(new Date).getTime():console.timeEnd?console.timeEnd(s):r(a,[s+": "+((new Date).getTime()-t[s])+"ms"])):(o.level===n.WARN&&console.warn?a=console.warn:o.level===n.ERROR&&console.error?a=console.error:o.level===n.INFO&&console.info?a=console.info:o.level===n.DEBUG&&console.debug?a=console.debug:o.level===n.TRACE&&console.trace&&(a=console.trace),e.formatter(i,o),r(a,i))}},n.useDefaults=function(e){n.setLevel(e&&e.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(e))},n.setDefaults=n.useDefaults,e.exports?e.exports=n:(n._prevLogger=t.Logger,n.noConflict=function(){return t.Logger=n._prevLogger,n},t.Logger=n)}(N)}));Cn.useDefaults({defaultLevel:Cn.TRACE});const En=(e,t)=>{e.unshift("[".concat(t.name||"Global","] ").concat((new Date).toISOString()," - ").concat(t.level.name," -"))},In=(e,t)=>t?e.value>=kn[t].value:e.value>=An.value,Tn=Cn.createDefaultHandler({formatter:En});Cn.setHandler((e,t)=>{((e,t)=>{e=(e=Array.prototype.slice.call(e)).map(e=>"object"==typeof e?JSON.stringify(e):e),En(e,t),0!==Rn?(Pn.push(e.join(" ")),Pn.length>=Rn&&(Pn=Pn.slice(-Rn))):Pn=[]})(e,t),In(t.level,t.name)&&Tn(e,t);var r,n=M(On);try{for(n.s();!(r=n.n()).done;){const n=r.value,i=n.handler,o=n.level;t.level.value>=o.value&&i(e,t)}}catch(e){n.e(e)}finally{n.f()}});let Rn=1e4,Pn=[],An=Cn.OFF;const kn={},On=[],Ln=R(R({},Cn),{},{enabledFor:In,getHistory:()=>Pn,getHistoryMaxSize:()=>Rn,setHistoryMaxSize:e=>{Rn=e},setLevel:e=>{An=e;for(const t in kn)kn[t]=e},getLevel:()=>An,get:e=>{kn[e]||(kn[e]=An);const t=Cn.get(e);return t.setLevel=t=>{kn[e]=t},t.getLevel=()=>kn[e],t},setHandler:(e,t)=>{On.push({handler:e,level:t})}});var Dn,Mn,Nn,jn,Bn="process"==ie(F.process),_n=String,Un=TypeError,Fn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=te(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return ft(r),function(e){if("object"==typeof e||me(e))return e;throw Un("Can't set "+_n(e)+" as a prototype")}(n),t?e(r,n):r.__proto__=n,r}}():void 0),Vn=gt.f,zn=Ze("toStringTag"),$n=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Ge(e,zn)&&Vn(e,zn,{configurable:!0,value:t})},Gn=Ze("species"),qn=function(e){var t=we(e),r=gt.f;z&&t&&!t[Gn]&&r(t,Gn,{configurable:!0,get:function(){return this}})},Xn=TypeError,Wn=function(e,t){if(be(t,e))return e;throw Xn("Incorrect invocation")},Hn=TypeError,Yn=Ze("species"),Kn=function(e,t){var r,n=ft(e).constructor;return void 0===n||ce(r=ft(n)[Yn])?t:function(e){if(Br(e))return e;throw Hn(Le(e)+" is not a constructor")}(r)},Qn=we("document","documentElement"),Jn=TypeError,Zn=function(e,t){if(e<t)throw Jn("Not enough arguments");return e},ei=/(?:ipad|iphone|ipod).*applewebkit/i.test(Se),ti=F.setImmediate,ri=F.clearImmediate,ni=F.process,ii=F.Dispatch,oi=F.Function,si=F.MessageChannel,ai=F.String,ci=0,ui={};try{Dn=F.location}catch(T){}var li=function(e){if(Ge(ui,e)){var t=ui[e];delete ui[e],t()}},di=function(e){return function(){li(e)}},fi=function(e){li(e.data)},pi=function(e){F.postMessage(ai(e),Dn.protocol+"//"+Dn.host)};ti&&ri||(ti=function(e){Zn(arguments.length,1);var t=me(e)?e:oi(e),r=Wr(arguments,1);return ui[++ci]=function(){un(t,void 0,r)},Mn(ci),ci},ri=function(e){delete ui[e]},Bn?Mn=function(e){ni.nextTick(di(e))}:ii&&ii.now?Mn=function(e){ii.now(di(e))}:si&&!ei?(jn=(Nn=new si).port2,Nn.port1.onmessage=fi,Mn=Zr(jn.postMessage,jn)):F.addEventListener&&me(F.postMessage)&&!F.importScripts&&Dn&&"file:"!==Dn.protocol&&!V(pi)?(Mn=pi,F.addEventListener("message",fi,!1)):Mn="onreadystatechange"in ot("script")?function(e){Qn.appendChild(ot("script")).onreadystatechange=function(){Qn.removeChild(this),li(e)}}:function(e){setTimeout(di(e),0)});var hi,mi,gi,vi,yi,wi,bi,Si,xi={set:ti,clear:ri},Ci=/ipad|iphone|ipod/i.test(Se)&&void 0!==F.Pebble,Ei=/web0s(?!.*chrome)/i.test(Se),Ii=ct.f,Ti=xi.set,Ri=F.MutationObserver||F.WebKitMutationObserver,Pi=F.document,Ai=F.process,ki=F.Promise,Oi=Ii(F,"queueMicrotask"),Li=Oi&&Oi.value;Li||(hi=function(){var e,t;for(Bn&&(e=Ai.domain)&&e.exit();mi;){t=mi.fn,mi=mi.next;try{t()}catch(e){throw mi?vi():gi=void 0,e}}gi=void 0,e&&e.enter()},ei||Bn||Ei||!Ri||!Pi?!Ci&&ki&&ki.resolve?((bi=ki.resolve(void 0)).constructor=ki,Si=Zr(bi.then,bi),vi=function(){Si(hi)}):Bn?vi=function(){Ai.nextTick(hi)}:(Ti=Zr(Ti,F),vi=function(){Ti(hi)}):(yi=!0,wi=Pi.createTextNode(""),new Ri(hi).observe(wi,{characterData:!0}),vi=function(){wi.data=yi=!yi}));var Di=Li||function(e){var t={fn:e,next:void 0};gi&&(gi.next=t),mi||(mi=t,vi()),gi=t},Mi=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Ni=function(){this.head=null,this.tail=null};Ni.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 ji=Ni,Bi=F.Promise,_i="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Ui=!_i&&!Bn&&"object"==typeof window&&"object"==typeof document;Bi&&Bi.prototype;var Fi,Vi,zi,$i=Ze("species"),Gi=!1,qi=me(F.PromiseRejectionEvent),Xi={CONSTRUCTOR:gr("Promise",(function(){var e=Tt(Bi),t=e!==String(Bi);if(!t&&66===Te)return!0;if(!Te||Te<51||!/native code/.test(e)){var r=new Bi((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[$i]=n,!(Gi=r.then((function(){}))instanceof n))return!0}return!t&&(Ui||_i)&&!qi})),REJECTION_EVENT:qi,SUBCLASSING:Gi},Wi=TypeError,Hi=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw Wi("Bad Promise constructor");t=e,r=n})),this.resolve=Me(t),this.reject=Me(r)},Yi={f:function(e){return new Hi(e)}},Ki=xi.set,Qi=Xi.CONSTRUCTOR,Ji=Xi.REJECTION_EVENT,Zi=Xi.SUBCLASSING,eo=Ut.getterFor("Promise"),to=Ut.set,ro=Bi&&Bi.prototype,no=Bi,io=ro,oo=F.TypeError,so=F.document,ao=F.process,co=Yi.f,uo=co,lo=!!(so&&so.createEvent&&F.dispatchEvent),fo=function(e){var t;return!(!ve(e)||!me(t=e.then))&&t},po=function(e,t){var r,n,i,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&yo(t),t.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===e.promise?u(oo("Promise-chain cycle")):(n=fo(r))?X(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},ho=function(e,t){e.notified||(e.notified=!0,Di((function(){for(var r,n=e.reactions;r=n.get();)po(r,e);e.notified=!1,t&&!e.rejection&&go(e)})))},mo=function(e,t,r){var n,i;lo?((n=so.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),F.dispatchEvent(n)):n={promise:t,reason:r},!Ji&&(i=F["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=F.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},go=function(e){X(Ki,F,(function(){var t,r=e.facade,n=e.value;if(vo(e)&&(t=Mi((function(){Bn?ao.emit("unhandledRejection",n,r):mo("unhandledrejection",r,n)})),e.rejection=Bn||vo(e)?2:1,t.error))throw t.value}))},vo=function(e){return 1!==e.rejection&&!e.parent},yo=function(e){X(Ki,F,(function(){var t=e.facade;Bn?ao.emit("rejectionHandled",t):mo("rejectionhandled",t,e.value)}))},wo=function(e,t,r){return function(n){e(t,n,r)}},bo=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,ho(e,!0))},So=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw oo("Promise can't be resolved itself");var n=fo(t);n?Di((function(){var r={done:!1};try{X(n,t,wo(So,r,e),wo(bo,r,e))}catch(t){bo(r,t,e)}})):(e.value=t,e.state=1,ho(e,!1))}catch(t){bo({done:!1},t,e)}}};if(Qi&&(io=(no=function(e){Wn(this,io),Me(e),X(Fi,this);var t=eo(this);try{e(wo(So,t),wo(bo,t))}catch(e){bo(t,e)}}).prototype,(Fi=function(e){to(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new ji,rejection:!1,state:0,value:void 0})}).prototype=Vt(io,"then",(function(e,t){var r=eo(this),n=co(Kn(this,no));return r.parent=!0,n.ok=!me(e)||e,n.fail=me(t)&&t,n.domain=Bn?ao.domain:void 0,0==r.state?r.reactions.add(n):Di((function(){po(n,r)})),n.promise})),Vi=function(){var e=new Fi,t=eo(e);this.promise=e,this.resolve=wo(So,t),this.reject=wo(bo,t)},Yi.f=co=function(e){return e===no||void 0===e?new Vi(e):uo(e)},me(Bi)&&ro!==Object.prototype)){zi=ro.then,Zi||Vt(ro,"then",(function(e,t){var r=this;return new no((function(e,t){X(zi,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete ro.constructor}catch(T){}Fn&&Fn(ro,io)}yr({global:!0,constructor:!0,wrap:!0,forced:Qi},{Promise:no}),$n(no,"Promise",!1),qn("Promise");var xo={},Co=Ze("iterator"),Eo=Array.prototype,Io=function(e){return void 0!==e&&(xo.Array===e||Eo[Co]===e)},To=Ze("iterator"),Ro=function(e){if(!ce(e))return Ne(e,To)||Ne(e,"@@iterator")||xo[Pr(e)]},Po=TypeError,Ao=function(e,t){var r=arguments.length<2?Ro(e):t;if(Me(r))return ft(X(r,e));throw Po(Le(e)+" is not iterable")},ko=function(e,t,r){var n,i;ft(e);try{if(!(n=Ne(e,"return"))){if("throw"===t)throw r;return r}n=X(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return ft(n),r},Oo=TypeError,Lo=function(e,t){this.stopped=e,this.result=t},Do=Lo.prototype,Mo=function(e,t,r){var n,i,o,s,a,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),p=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),m=Zr(t,l),g=function(e){return n&&ko(n,"normal",e),new Lo(!0,e)},v=function(e){return d?(ft(e),h?m(e[0],e[1],g):m(e[0],e[1])):h?m(e,g):m(e)};if(f)n=e.iterator;else if(p)n=e;else{if(!(i=Ro(e)))throw Oo(Le(e)+" is not iterable");if(Io(i)){for(o=0,s=Qt(e);s>o;o++)if((a=v(e[o]))&&be(Do,a))return a;return new Lo(!1)}n=Ao(e,i)}for(c=f?e.next:n.next;!(u=X(c,n)).done;){try{a=v(u.value)}catch(e){ko(n,"throw",e)}if("object"==typeof a&&a&&be(Do,a))return a}return new Lo(!1)},No=Ze("iterator"),jo=!1;try{var Bo=0,_o={next:function(){return{done:!!Bo++}},return:function(){jo=!0}};_o[No]=function(){return this},Array.from(_o,(function(){throw 2}))}catch(T){}var Uo=function(e,t){if(!t&&!jo)return!1;var r=!1;try{var n={};n[No]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Fo=Xi.CONSTRUCTOR||!Uo((function(e){Bi.all(e).then(void 0,(function(){}))}));yr({target:"Promise",stat:!0,forced:Fo},{all:function(e){var t=this,r=Yi.f(t),n=r.resolve,i=r.reject,o=Mi((function(){var r=Me(t.resolve),o=[],s=0,a=1;Mo(e,(function(e){var c=s++,u=!1;a++,X(r,t,e).then((function(e){u||(u=!0,o[c]=e,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise}});var Vo=Xi.CONSTRUCTOR,zo=Bi&&Bi.prototype;if(yr({target:"Promise",proto:!0,forced:Vo,real:!0},{catch:function(e){return this.then(void 0,e)}}),me(Bi)){var $o=we("Promise").prototype.catch;zo.catch!==$o&&Vt(zo,"catch",$o,{unsafe:!0})}yr({target:"Promise",stat:!0,forced:Fo},{race:function(e){var t=this,r=Yi.f(t),n=r.reject,i=Mi((function(){var i=Me(t.resolve);Mo(e,(function(e){X(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),yr({target:"Promise",stat:!0,forced:Xi.CONSTRUCTOR},{reject:function(e){var t=Yi.f(this);return X(t.reject,void 0,e),t.promise}});var Go=Xi.CONSTRUCTOR;we("Promise"),yr({target:"Promise",stat:!0,forced:Go},{resolve:function(e){return function(e,t){if(ft(e),ve(t)&&t.constructor===e)return t;var r=Yi.f(e);return(0,r.resolve)(t),r.promise}(this,e)}});var qo=gt.f,Xo=function(e,t,r){r in e||qo(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},Wo=function(e,t,r){var n,i;return Fn&&me(n=t.constructor)&&n!==r&&ve(i=n.prototype)&&i!==r.prototype&&Fn(e,i),e},Ho=String,Yo=function(e){if("Symbol"===Pr(e))throw TypeError("Cannot convert a Symbol value to a string");return Ho(e)},Ko=function(e,t){return void 0===e?arguments.length<2?"":t:Yo(e)},Qo=function(e,t){ve(t)&&"cause"in t&&vt(e,"cause",t.cause)},Jo=Error,Zo=te("".replace),es=String(Jo("zxcasd").stack),ts=/\n\s*at [^:]*:[^\n]*/,rs=ts.test(es),ns=function(e,t){if(rs&&"string"==typeof e&&!Jo.prepareStackTrace)for(;t--;)e=Zo(e,ts,"");return e},is=!V((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",K(1,7)),7!==e.stack)})),os=function(e,t,r,n){var i="stackTraceLimit",o=n?2:1,s=e.split("."),a=s[s.length-1],c=we.apply(null,s);if(c){var u=c.prototype;if(Ge(u,"cause")&&delete u.cause,!r)return c;var l=we("Error"),d=t((function(e,t){var r=Ko(n?t:e,void 0),i=n?new c(e):new c;return void 0!==r&&vt(i,"message",r),is&&vt(i,"stack",ns(i.stack,2)),this&&be(u,this)&&Wo(i,this,d),arguments.length>o&&Qo(i,arguments[o]),i}));d.prototype=u,"Error"!==a?Fn?Fn(d,l):ur(d,l,{name:!0}):z&&i in c&&(Xo(d,c,i),Xo(d,c,"prepareStackTrace")),ur(d,c);try{u.name!==a&&vt(u,"name",a),u.constructor=d}catch(e){}return d}},ss=F.WebAssembly,as=7!==Error("e",{cause:7}).cause,cs=function(e,t){var r={};r[e]=os(e,t,as),yr({global:!0,constructor:!0,arity:1,forced:as},r)},us=function(e,t){if(ss&&ss[e]){var r={};r[e]=os("WebAssembly."+e,t,as),yr({target:"WebAssembly",stat:!0,constructor:!0,arity:1,forced:as},r)}};cs("Error",(function(e){return function(t){return un(e,this,arguments)}})),cs("EvalError",(function(e){return function(t){return un(e,this,arguments)}})),cs("RangeError",(function(e){return function(t){return un(e,this,arguments)}})),cs("ReferenceError",(function(e){return function(t){return un(e,this,arguments)}})),cs("SyntaxError",(function(e){return function(t){return un(e,this,arguments)}})),cs("TypeError",(function(e){return function(t){return un(e,this,arguments)}})),cs("URIError",(function(e){return function(t){return un(e,this,arguments)}})),us("CompileError",(function(e){return function(t){return un(e,this,arguments)}})),us("LinkError",(function(e){return function(t){return un(e,this,arguments)}})),us("RuntimeError",(function(e){return function(t){return un(e,this,arguments)}}));var ls=Ze("match"),ds=function(e){var t;return ve(e)&&(void 0!==(t=e[ls])?!!t:"RegExp"==ie(e))},fs=function(){var e=ft(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},ps=RegExp.prototype,hs=function(e){var t=e.flags;return void 0!==t||"flags"in ps||Ge(e,"flags")||!be(ps,e)?t:X(fs,e)},ms=F.RegExp,gs=V((function(){var e=ms("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),vs=gs||V((function(){return!ms("a","y").sticky})),ys={BROKEN_CARET:gs||V((function(){var e=ms("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:vs,UNSUPPORTED_Y:gs},ws=F.RegExp,bs=V((function(){var e=ws(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Ss=F.RegExp,xs=V((function(){var e=Ss("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Cs=or.f,Es=Ut.enforce,Is=Ze("match"),Ts=F.RegExp,Rs=Ts.prototype,Ps=F.SyntaxError,As=te(Rs.exec),ks=te("".charAt),Os=te("".replace),Ls=te("".indexOf),Ds=te("".slice),Ms=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Ns=/a/g,js=/a/g,Bs=new Ts(Ns)!==Ns,_s=ys.MISSED_STICKY,Us=ys.UNSUPPORTED_Y,Fs=z&&(!Bs||_s||bs||xs||V((function(){return js[Is]=!1,Ts(Ns)!=Ns||Ts(js)==js||"/a/i"!=Ts(Ns,"i")})));if(gr("RegExp",Fs)){for(var Vs=function(e,t){var r,n,i,o,s,a,c=be(Rs,this),u=ds(e),l=void 0===t,d=[],f=e;if(!c&&u&&l&&e.constructor===Vs)return e;if((u||be(Rs,e))&&(e=e.source,l&&(t=hs(f))),e=void 0===e?"":Yo(e),t=void 0===t?"":Yo(t),f=e,bs&&"dotAll"in Ns&&(n=!!t&&Ls(t,"s")>-1)&&(t=Os(t,/s/g,"")),r=t,_s&&"sticky"in Ns&&(i=!!t&&Ls(t,"y")>-1)&&Us&&(t=Os(t,/y/g,"")),xs&&(e=(o=function(e){for(var t,r=e.length,n=0,i="",o=[],s={},a=!1,c=!1,u=0,l="";n<=r;n++){if("\\"===(t=ks(e,n)))t+=ks(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:As(Ms,Ds(e,n+1))&&(n+=2,c=!0),i+=t,u++;continue;case">"===t&&c:if(""===l||Ge(s,l))throw new Ps("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:i+=t}return[i,o]}(e))[0],d=o[1]),s=Wo(Ts(e,t),c?this:Rs,Vs),(n||i||d.length)&&(a=Es(s),n&&(a.dotAll=!0,a.raw=Vs(function(e){for(var t,r=e.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(t=ks(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+ks(e,++n);return i}(e),r)),i&&(a.sticky=!0),d.length&&(a.groups=d)),e!==f)try{vt(s,"source",""===f?"(?:)":f)}catch(e){}return s},zs=Cs(Ts),$s=0;zs.length>$s;)Xo(Vs,Ts,zs[$s++]);Rs.constructor=Vs,Vs.prototype=Rs,Vt(F,"RegExp",Vs,{constructor:!0})}qn("RegExp");var Gs,qs,Xs,Ws=Ut.get,Hs=RegExp.prototype,Ys=TypeError;z&&bs&&(Gs=Hs,qs="dotAll",(Xs={configurable:!0,get:function(){if(this!==Hs){if("RegExp"===ie(this))return!!Ws(this).dotAll;throw Ys("Incompatible receiver, RegExp required")}}}).get&&Ft(Xs.get,qs,{getter:!0}),Xs.set&&Ft(Xs.set,qs,{setter:!0}),gt.f(Gs,qs,Xs));var Ks,Qs=Object.keys||function(e){return rr(e,nr)},Js={f:z&&!ut?Object.defineProperties:function(e,t){ft(e);for(var r,n=de(t),i=Qs(t),o=i.length,s=0;o>s;)gt.f(e,r=i[s++],n[r]);return e}},Zs=kt("IE_PROTO"),ea=function(){},ta=function(e){return"<script>"+e+"<\/script>"},ra=function(e){e.write(ta("")),e.close();var t=e.parentWindow.Object;return e=null,t},na=function(){try{Ks=new ActiveXObject("htmlfile")}catch(e){}var e,t;na="undefined"!=typeof document?document.domain&&Ks?ra(Ks):((t=ot("iframe")).style.display="none",Qn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ta("document.F=Object")),e.close(),e.F):ra(Ks);for(var r=nr.length;r--;)delete na.prototype[nr[r]];return na()};Ot[Zs]=!0;var ia=Object.create||function(e,t){var r;return null!==e?(ea.prototype=ft(e),r=new ea,ea.prototype=null,r[Zs]=e):r=na(),void 0===t?r:Js.f(r,t)},oa=Ut.get,sa=Fe("native-string-replace",String.prototype.replace),aa=RegExp.prototype.exec,ca=aa,ua=te("".charAt),la=te("".indexOf),da=te("".replace),fa=te("".slice),pa=function(){var e=/a/,t=/b*/g;return X(aa,e,"a"),X(aa,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ha=ys.BROKEN_CARET,ma=void 0!==/()??/.exec("")[1];(pa||ma||ha||bs||xs)&&(ca=function(e){var t,r,n,i,o,s,a,c=this,u=oa(c),l=Yo(e),d=u.raw;if(d)return d.lastIndex=c.lastIndex,t=X(ca,d,l),c.lastIndex=d.lastIndex,t;var f=u.groups,p=ha&&c.sticky,h=X(fs,c),m=c.source,g=0,v=l;if(p&&(h=da(h,"y",""),-1===la(h,"g")&&(h+="g"),v=fa(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==ua(l,c.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),r=new RegExp("^(?:"+m+")",h)),ma&&(r=new RegExp("^"+m+"$(?!\\s)",h)),pa&&(n=c.lastIndex),i=X(aa,p?r:c,v),p?i?(i.input=fa(i.input,g),i[0]=fa(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:pa&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),ma&&i&&i.length>1&&X(sa,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=s=ia(null),o=0;o<f.length;o++)s[(a=f[o])[0]]=i[a[1]];return i});var ga=ca;yr({target:"RegExp",proto:!0,forced:/./.exec!==ga},{exec:ga});var va=te(Y.f),ya=te([].push),wa=function(e){return function(t){for(var r,n=de(t),i=Qs(n),o=i.length,s=0,a=[];o>s;)r=i[s++],z&&!va(n,r)||ya(a,e?[r,n[r]]:n[r]);return a}},ba=(wa(!0),wa(!1));yr({target:"Object",stat:!0},{values:function(e){return ba(e)}});var Sa=Ze("species"),xa=RegExp.prototype,Ca=function(e,t,r,n){var i=Ze(e),o=!V((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=o&&!V((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Sa]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!s||r){var a=te(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var s=te(e),c=t.exec;return c===ga||c===xa.exec?o&&!i?{done:!0,value:a(t,r,n)}:{done:!0,value:s(r,t,n)}:{done:!1}}));Vt(String.prototype,e,c[0]),Vt(xa,i,c[1])}n&&vt(xa[i],"sham",!0)},Ea=te("".charAt),Ia=te("".charCodeAt),Ta=te("".slice),Ra=function(e){return function(t,r){var n,i,o=Yo(le(t)),s=qt(r),a=o.length;return s<0||s>=a?e?"":void 0:(n=Ia(o,s))<55296||n>56319||s+1===a||(i=Ia(o,s+1))<56320||i>57343?e?Ea(o,s):n:e?Ta(o,s,s+2):i-56320+(n-55296<<10)+65536}},Pa=(Ra(!1),Ra(!0)),Aa=function(e,t,r){return t+(r?Pa(e,t).length:1)},ka=TypeError,Oa=function(e,t){var r=e.exec;if(me(r)){var n=X(r,e,t);return null!==n&&ft(n),n}if("RegExp"===ie(e))return X(ga,e,t);throw ka("RegExp#exec called on incompatible receiver")};Ca("match",(function(e,t,r){return[function(t){var r=le(this),n=ce(t)?void 0:Ne(t,e);return n?X(n,t,r):new RegExp(t)[e](Yo(r))},function(e){var n=ft(this),i=Yo(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return Oa(n,i);var s=n.unicode;n.lastIndex=0;for(var a,c=[],u=0;null!==(a=Oa(n,i));){var l=Yo(a[0]);c[u]=l,""===l&&(n.lastIndex=Aa(i,Kt(n.lastIndex),s)),u++}return 0===u?null:c}]}));var La=gt.f,Da=Ze("unscopables"),Ma=Array.prototype;null==Ma[Da]&&La(Ma,Da,{configurable:!0,value:ia(null)});var Na,ja,Ba,_a=function(e){Ma[Da][e]=!0},Ua=!V((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Fa=kt("IE_PROTO"),Va=Object,za=Va.prototype,$a=Ua?Va.getPrototypeOf:function(e){var t=ze(e);if(Ge(t,Fa))return t[Fa];var r=t.constructor;return me(r)&&t instanceof r?r.prototype:t instanceof Va?za:null},Ga=Ze("iterator"),qa=!1;[].keys&&("next"in(Ba=[].keys())?(ja=$a($a(Ba)))!==Object.prototype&&(Na=ja):qa=!0),(!ve(Na)||V((function(){var e={};return Na[Ga].call(e)!==e})))&&(Na={}),me(Na[Ga])||Vt(Na,Ga,(function(){return this}));var Xa={IteratorPrototype:Na,BUGGY_SAFARI_ITERATORS:qa},Wa=Xa.IteratorPrototype,Ha=function(){return this},Ya=function(e,t,r,n){var i=t+" Iterator";return e.prototype=ia(Wa,{next:K(+!n,r)}),$n(e,i,!1),xo[i]=Ha,e},Ka=St.PROPER,Qa=St.CONFIGURABLE,Ja=Xa.IteratorPrototype,Za=Xa.BUGGY_SAFARI_ITERATORS,ec=Ze("iterator"),tc=function(){return this},rc=function(e,t,r,n,i,o,s){Ya(r,t,n);var a,c,u,l=function(e){if(e===i&&m)return m;if(!Za&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,p=e.prototype,h=p[ec]||p["@@iterator"]||i&&p[i],m=!Za&&h||l(i),g="Array"==t&&p.entries||h;if(g&&(a=$a(g.call(new e)))!==Object.prototype&&a.next&&($a(a)!==Ja&&(Fn?Fn(a,Ja):me(a[ec])||Vt(a,ec,tc)),$n(a,d,!0)),Ka&&"values"==i&&h&&"values"!==h.name&&(Qa?vt(p,"name","values"):(f=!0,m=function(){return X(h,this)})),i)if(c={values:l("values"),keys:o?m:l("keys"),entries:l("entries")},s)for(u in c)(Za||f||!(u in p))&&Vt(p,u,c[u]);else yr({target:t,proto:!0,forced:Za||f},c);return p[ec]!==m&&Vt(p,ec,m,{name:i}),xo[t]=m,c},nc=function(e,t){return{value:e,done:t}},ic=gt.f,oc=Ut.set,sc=Ut.getterFor("Array Iterator"),ac=rc(Array,"Array",(function(e,t){oc(this,{type:"Array Iterator",target:de(e),index:0,kind:t})}),(function(){var e=sc(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,nc(void 0,!0)):nc("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),cc=xo.Arguments=xo.Array;if(_a("keys"),_a("values"),_a("entries"),z&&"values"!==cc.name)try{ic(cc,"name",{value:"values"})}catch(T){}var uc={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},lc=ot("span").classList,dc=lc&&lc.constructor&&lc.constructor.prototype,fc=dc===Object.prototype?void 0:dc,pc=Ze("iterator"),hc=Ze("toStringTag"),mc=ac.values,gc=function(e,t){if(e){if(e[pc]!==mc)try{vt(e,pc,mc)}catch(t){e[pc]=mc}if(e[hc]||vt(e,hc,t),uc[t])for(var r in ac)if(e[r]!==ac[r])try{vt(e,r,ac[r])}catch(t){e[r]=ac[r]}}};for(var vc in uc)gc(F[vc]&&F[vc].prototype,vc);gc(fc,"DOMTokenList");var yc=Array,wc=Math.max,bc=or.f,Sc="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],xc={f:function(e){return Sc&&"Window"==ie(e)?function(e){try{return bc(e)}catch(e){return function(e,t,r){for(var n=Qt(e),i=Ht(void 0,n),o=Ht(n,n),s=yc(wc(o-i,0)),a=0;i<o;i++,a++)xr(s,a,e[i]);return s.length=a,s}(Sc)}}(e):bc(de(e))}},Cc=V((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Ec=Object.isExtensible,Ic=V((function(){Ec(1)}))||Cc?function(e){return!!ve(e)&&(!Cc||"ArrayBuffer"!=ie(e))&&(!Ec||Ec(e))}:Ec,Tc=!V((function(){return Object.isExtensible(Object.preventExtensions({}))})),Rc=j((function(e){var t=gt.f,r=!1,n=He("meta"),i=0,o=function(e){t(e,n,{value:{objectID:"O"+i++,weakData:{}}})},s=e.exports={enable:function(){s.enable=function(){},r=!0;var e=or.f,t=te([].splice),i={};i[n]=1,e(i).length&&(or.f=function(r){for(var i=e(r),o=0,s=i.length;o<s;o++)if(i[o]===n){t(i,o,1);break}return i},yr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:xc.f}))},fastKey:function(e,t){if(!ve(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Ge(e,n)){if(!Ic(e))return"F";if(!t)return"E";o(e)}return e[n].objectID},getWeakData:function(e,t){if(!Ge(e,n)){if(!Ic(e))return!0;if(!t)return!1;o(e)}return e[n].weakData},onFreeze:function(e){return Tc&&r&&Ic(e)&&!Ge(e,n)&&o(e),e}};Ot[n]=!0})),Pc=function(e,t,r){for(var n in t)Vt(e,n,t[n],r);return e},Ac=gt.f,kc=Rc.fastKey,Oc=Ut.set,Lc=Ut.getterFor;!function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=n?"set":"add",s=F.Set,a=s&&s.prototype,c=s,u={},l=function(e){var t=te(a[e]);Vt(a,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!ve(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!ve(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!ve(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(gr(e,!me(s)||!(i||a.forEach&&!V((function(){(new s).entries().next()})))))c=r.getConstructor(t,e,n,o),Rc.enable();else if(gr(e,!0)){var d=new c,f=d[o](i?{}:-0,1)!=d,p=V((function(){d.has(1)})),h=Uo((function(e){new s(e)})),m=!i&&V((function(){for(var e=new s,t=5;t--;)e[o](t,t);return!e.has(-0)}));h||((c=t((function(e,t){Wn(e,a);var r=Wo(new s,e,c);return ce(t)||Mo(t,r[o],{that:r,AS_ENTRIES:n}),r}))).prototype=a,a.constructor=c),(p||m)&&(l("delete"),l("has"),n&&l("get")),(m||f)&&l(o),i&&a.clear&&delete a.clear}u.Set=c,yr({global:!0,constructor:!0,forced:c!=s},u),$n(c,e),i||r.setStrong(c,e,n)}("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(e,t,r,n){var i=e((function(e,i){Wn(e,o),Oc(e,{type:t,index:ia(null),first:void 0,last:void 0,size:0}),z||(e.size=0),ce(i)||Mo(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,s=Lc(t),a=function(e,t,r){var n,i,o=s(e),a=c(e,t);return a?a.value=r:(o.last=a={index:i=kc(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),z?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},c=function(e,t){var r,n=s(e),i=kc(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return Pc(o,{clear:function(){for(var e=s(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,z?e.size=0:this.size=0},delete:function(e){var t=this,r=s(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),z?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=s(this),n=Zr(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)}}),Pc(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),z&&Ac(o,"size",{get:function(){return s(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Lc(t),o=Lc(n);rc(e,t,(function(e,t){Oc(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)?nc("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,nc(void 0,!0))}),r?"entries":"values",!r,!0),qn(t)}});var Dc,Mc="object"==typeof Reflect?Reflect:null,Nc=Mc&&"function"==typeof Mc.apply?Mc.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Dc=Mc&&"function"==typeof Mc.ownKeys?Mc.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var jc=Number.isNaN||function(e){return e!=e};function Bc(){Bc.init.call(this)}var _c=Bc;Bc.EventEmitter=Bc,Bc.prototype._events=void 0,Bc.prototype._eventsCount=0,Bc.prototype._maxListeners=void 0;var Uc=10;function Fc(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Vc(e){return void 0===e._maxListeners?Bc.defaultMaxListeners:e._maxListeners}function zc(e,t,r,n){var i,o,s,a;if(Fc(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=Vc(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function $c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function qc(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=$c.bind(n);return i.listener=r,n.wrapFn=i,i}function Xc(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):Hc(i,i.length)}function Wc(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function Hc(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function Yc(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(Bc,"defaultMaxListeners",{enumerable:!0,get:function(){return Uc},set:function(e){if("number"!=typeof e||e<0||jc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Uc=e}}),Bc.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Bc.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||jc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Bc.prototype.getMaxListeners=function(){return Vc(this)},Bc.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)Nc(a,this,t);else{var c=a.length,u=Hc(a,c);for(r=0;r<c;++r)Nc(u[r],this,t)}return!0},Bc.prototype.addListener=function(e,t){return zc(this,e,t,!1)},Bc.prototype.on=Bc.prototype.addListener,Bc.prototype.prependListener=function(e,t){return zc(this,e,t,!0)},Bc.prototype.once=function(e,t){return Fc(t),this.on(e,qc(this,e,t)),this},Bc.prototype.prependOnceListener=function(e,t){return Fc(t),this.prependListener(e,qc(this,e,t)),this},Bc.prototype.removeListener=function(e,t){var r,n,i,o,s;if(Fc(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},Bc.prototype.off=Bc.prototype.removeListener,Bc.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},Bc.prototype.listeners=function(e){return Xc(this,e,!0)},Bc.prototype.rawListeners=function(e){return Xc(this,e,!1)},Bc.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Wc.call(e,t)},Bc.prototype.listenerCount=Wc,Bc.prototype.eventNames=function(){return this._eventsCount>0?Dc(this._events):[]},_c.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}Yc(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&Yc(e,"error",t,{once:!0})}(e,i)}))};var Kc=Jc,Qc=_c.EventEmitter;function Jc(e,t,r){Array.isArray(r)||(r=[r]);var n=[];return r.forEach((function(r){var i=function(){var e=[].slice.call(arguments);e.unshift(r),t.emit.apply(t,e)};n.push(i),e.on(r,i)})),function(){r.forEach((function(t,r){e.removeListener(t,n[r])}))}}Kc.filter=function(e,t){var r=new Qc;return Jc(e,r,t),r};var Zc=Zt.includes,eu=V((function(){return!Array(1).includes()}));yr({target:"Array",proto:!0,forced:eu},{includes:function(e){return Zc(this,e,arguments.length>1?arguments[1]:void 0)}}),_a("includes");var tu=TypeError,ru=function(e){if(ds(e))throw tu("The method doesn't accept regular expressions");return e},nu=Ze("match"),iu=te("".indexOf);yr({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[nu]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~iu(Yo(le(this)),Yo(ru(e)),arguments.length>1?arguments[1]:void 0)}});const ou=Ln.get("PeerConnectionStats");class Gc extends _c{constructor(e){super(),this.peer=e,this.stats=null,this.emitInterval=null,this.previousStats=null}init(){var e=this;ou.info("Initializing peer connection stats"),this.emitInterval=setInterval(A((function*(){const t=yield e.peer.getStats();e.parseStats(t),e.emit("stats",e.stats)})),1e3)}parseStats(e){this.previousStats=this.stats;const t={audio:{inbounds:[],outbounds:[]},video:{inbounds:[],outbounds:[]},raw:e};var r,n=M(e.values());try{for(n.s();!(r=n.n()).done;){const e=r.value;switch(e.type){case"outbound-rtp":su(e,this.previousStats,t);break;case"inbound-rtp":au(e,this.previousStats,t);break;case"candidate-pair":e.nominated&&cu(e,t)}}}catch(e){n.e(e)}finally{n.f()}this.stats=t}stop(){ou.info("Stopping peer connection stats"),clearInterval(this.emitInterval)}}const su=(e,t,r)=>{var n,i;const o=uu(e),s=lu(e.codecId,r.raw),a=du(e,o);a.totalBytesSent=e.bytesSent,a.id=e.id,a.mid=e.mid;const c=t?null!==(n=null===(i=t[o].outbounds.find(e=>e.id===a.id))||void 0===i?void 0:i.totalBytesSent)&&void 0!==n?n:0:null;a.bitrate=c?8*(e.bytesSent-c):0,"video"===o&&(a.qualityLimitationReason=e.qualityLimitationReason),r[o].outbounds.push(R(R({},s),a))},au=(e,t,r)=>{let n=uu(e);const i=lu(e.codecId,r.raw);["audio","video"].includes(n)||(n=e.id.includes("Video")?"video":"audio");const o=du(e,n);if(o.totalBytesReceived=e.bytesReceived,o.totalPacketsReceived=e.packetsReceived,o.totalPacketsLost=e.packetsLost,o.jitter=e.jitter,o.id=e.id,o.mid=e.mid,o.bitrate=0,o.packetsLostRatioPerSecond=0,o.packetsLostDeltaPerSecond=0,t){const r=t[n].inbounds.find(e=>e.id===o.id);if(r){const t=r.totalBytesReceived;o.bitrate=8*(e.bytesReceived-t),o.packetsLostRatioPerSecond=fu(o,r),o.packetsLostDeltaPerSecond=pu(o,r)}}r[n].inbounds.push(R(R({},i),o))},cu=(e,t)=>{t.totalRoundTripTime=e.totalRoundTripTime,t.currentRoundTripTime=e.currentRoundTripTime,t.availableOutgoingBitrate=e.availableOutgoingBitrate,t.candidateType=t.raw.get(e.localCandidateId).candidateType},uu=e=>e.mediaType||e.kind,lu=(e,t)=>{var r;return{mimeType:(e&&null!==(r=t.get(e))&&void 0!==r?r:{}).mimeType}},du=(e,t)=>{const r={};return"video"===t&&(r.framesPerSecond=e.framesPerSecond,r.frameHeight=e.frameHeight,r.frameWidth=e.frameWidth),r.timestamp=e.timestamp,r},fu=(e,t)=>pu(e,t)/(e.totalPacketsReceived-t.totalPacketsReceived),pu=(e,t)=>e.totalPacketsLost-t.totalPacketsLost;var hu=function(e,t,r,n){try{return n?t(ft(r)[0],r[1]):t(r)}catch(t){ko(e,"throw",t)}},mu=Array,gu=!Uo((function(e){Array.from(e)}));yr({target:"Array",stat:!0,forced:gu},{from:function(e){var t=ze(e),r=Br(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=Zr(i,n>2?arguments[2]:void 0));var s,a,c,u,l,d,f=Ro(t),p=0;if(!f||this===mu&&Io(f))for(s=Qt(t),a=r?new this(s):mu(s);s>p;p++)d=o?i(t[p],p):t[p],xr(a,p,d);else for(l=(u=Ao(t,f)).next,a=r?new this:[];!(c=X(l,u)).done;p++)d=o?hu(u,i,[c.value,p],!0):c.value,xr(a,p,d);return a.length=p,a}});var vu=Math.floor,yu=te("".charAt),wu=te("".replace),bu=te("".slice),Su=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,xu=/\$([$&'`]|\d{1,2})/g,Cu=function(e,t,r,n,i,o){var s=r+e.length,a=n.length,c=xu;return void 0!==i&&(i=ze(i),c=Su),wu(o,c,(function(o,c){var u;switch(yu(c,0)){case"$":return"$";case"&":return e;case"`":return bu(t,0,r);case"'":return bu(t,s);case"<":u=i[bu(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var d=vu(l/10);return 0===d?o:d<=a?void 0===n[d-1]?yu(c,1):n[d-1]+yu(c,1):o}u=n[l-1]}return void 0===u?"":u}))},Eu=Ze("replace"),Iu=Math.max,Tu=Math.min,Ru=te([].concat),Pu=te([].push),Au=te("".indexOf),ku=te("".slice),Ou="$0"==="a".replace(/./,"$0"),Lu=!!/./[Eu]&&""===/./[Eu]("a","$0");Ca("replace",(function(e,t,r){var n=Lu?"$":"$0";return[function(e,r){var n=le(this),i=ce(e)?void 0:Ne(e,Eu);return i?X(i,e,n,r):X(t,Yo(n),e,r)},function(e,i){var o=ft(this),s=Yo(e);if("string"==typeof i&&-1===Au(i,n)&&-1===Au(i,"$<")){var a=r(t,o,s,i);if(a.done)return a.value}var c=me(i);c||(i=Yo(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var d=[];;){var f=Oa(o,s);if(null===f)break;if(Pu(d,f),!u)break;""===Yo(f[0])&&(o.lastIndex=Aa(s,Kt(o.lastIndex),l))}for(var p,h="",m=0,g=0;g<d.length;g++){for(var v=Yo((f=d[g])[0]),y=Iu(Tu(qt(f.index),s.length),0),w=[],b=1;b<f.length;b++)Pu(w,void 0===(p=f[b])?p:String(p));var S=f.groups;if(c){var x=Ru([v],w,y,s);void 0!==S&&Pu(x,S);var C=Yo(un(i,void 0,x))}else C=Cu(v,s,y,w,S,i);y>=m&&(h+=ku(s,m,y)+C,m=y+v.length)}return h+ku(s,m)}]}),!!V((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Ou||Lu);var Du=rn.filter,Mu=zr("filter");yr({target:"Array",proto:!0,forced:!Mu},{filter:function(e){return Du(this,e,arguments.length>1?arguments[1]:void 0)}});var Nu,ju="\t\n\v\f\r \u2028\u2029\ufeff",Bu=te("".replace),_u="["+ju+"]",Uu=RegExp("^"+_u+_u+"*"),Fu=RegExp(_u+_u+"*$"),Vu=function(e){return function(t){var r=Yo(le(t));return 1&e&&(r=Bu(r,Uu,"")),2&e&&(r=Bu(r,Fu,"")),r}},zu={start:Vu(1),end:Vu(2),trim:Vu(3)},$u=St.PROPER,Gu=zu.trim;yr({target:"String",proto:!0,forced:(Nu="trim",V((function(){return!!ju[Nu]()||"
"!=="
"[Nu]()||$u&&ju[Nu].name!==Nu})))},{trim:function(){return Gu(this)}});var qu=Ze("matchAll"),Xu=Ut.set,Wu=Ut.getterFor("RegExp String Iterator"),Hu=RegExp.prototype,Yu=TypeError,Ju=te("".indexOf),Zu=te("".matchAll),el=!!Zu&&!V((function(){Zu("a",/./)})),rl=Ya((function(e,t,r,n){Xu(this,{type:"RegExp String Iterator",regexp:e,string:t,global:r,unicode:n,done:!1})}),"RegExp String",(function(){var e=Wu(this);if(e.done)return nc(void 0,!0);var t=e.regexp,r=e.string,n=Oa(t,r);return null===n?(e.done=!0,nc(void 0,!0)):e.global?(""===Yo(n[0])&&(t.lastIndex=Aa(r,Kt(t.lastIndex),e.unicode)),nc(n,!1)):(e.done=!0,nc(n,!1))}));yr({target:"String",proto:!0,forced:el},{matchAll:function(e){var t,r,n,i=le(this);if(ce(e)){if(el)return Zu(i,e)}else{if(ds(e)&&(t=Yo(le(hs(e))),!~Ju(t,"g")))throw Yu("`.matchAll` does not allow non-global regexes");if(el)return Zu(i,e);if(n=Ne(e,qu))return X(n,e,i)}return r=Yo(i),new RegExp(e,"g")[qu](r)}}),qu in Hu||Vt(Hu,qu,(function(e){var t,r,n,i=ft(this),o=Yo(e),s=Kn(i,RegExp),a=Yo(hs(i));return t=new s(s===RegExp?i.source:i,a),r=!!~Ju(a,"g"),n=!!~Ju(a,"u"),t.lastIndex=Kt(i.lastIndex),new rl(t,o,r,n)}));var nl=te([].reverse),il=[1,2];yr({target:"Array",proto:!0,forced:String(il)===String(il.reverse())},{reverse:function(){return wr(this)&&(this.length=this.length),nl(this)}});var ol=j((function(e){var t=e.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")+(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":"")+(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(t).forEach((function(e){t[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))})),al=j((function(e,t){var r=function(e){return String(Number(e))===e?Number(e):e},n=function(e,t,n){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var o=e.push?{}:i?t[e.name]:t;!function(e,t,n,i){if(i&&!n)t[i]=r(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(t[n[o]]=r(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&t[e.push].push(o)},i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(e){var t={},r=[],o=t;return e.split(/(\r\n|\r|\n)/).filter(i).forEach((function(e){var t=e[0],i=e.slice(2);"m"===t&&(r.push({rtp:[],fmtp:[]}),o=r[r.length-1]);for(var s=0;s<(ol[t]||[]).length;s+=1){var a=ol[t][s];if(a.reg.test(i))return n(a,o,i)}})),t.media=r,t};var o=function(e,t){var n=t.split(/=(.+)/,2);return 2===n.length?e[n[0]]=r(n[1]):1===n.length&&t.length>1&&(e[n[0]]=void 0),e};t.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(r),i=0;i<n.length;i+=3)t.push({component:n[i],ip:n[i+1],port:n[i+2]});return t},t.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},t.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,n=!1;return"~"!==e[0]?t=r(e):(t=r(e.substring(1,e.length)),n=!0),{scid:t,paused:n}}))}))}})),ul=/%[sdv%]/g,ll=function(e){var t=1,r=arguments,n=r.length;return e.replace(ul,(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""}}))},dl=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 ll.apply(null,n)},fl=["v","o","s","i","u","e","p","c","b","t","r","z","a"],pl=["i","c","b","a"],hl={write: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||fl,n=t.innerOrder||pl,i=[];return r.forEach((function(t){ol[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(dl(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(dl(t,r,e))}))}))})),e.media.forEach((function(e){i.push(dl("m",ol.m[0],e)),n.forEach((function(t){ol[t].forEach((function(r){r.name in e&&null!=e[r.name]?i.push(dl(t,r,e)):r.push in e&&null!=e[r.push]&&e[r.push].forEach((function(e){i.push(dl(t,r,e))}))}))}))})),i.join("\r\n")+"\r\n"},parse:al.parse,parseParams:al.parseParams,parseFmtpConfig:al.parseFmtpConfig,parsePayloads:al.parsePayloads,parseRemoteCandidates:al.parseRemoteCandidates,parseImageAttributes:al.parseImageAttributes,parseSimulcastStreamList:al.parseSimulcastStreamList};class Ku{constructor(e,t,r,n,i,o,s,a,c){this.foundation=e,this.componentId=t,this.transport=r,this.priority=n,this.address=i,this.port=o,this.type=s,this.relAddr=a,this.relPort=c}equals(e){return e.foundation===this.foundation&&e.componentId===this.componentId&&e.transport===this.transport&&e.priority===this.priority&&e.address===this.address&&e.port===this.port&&e.type===this.type&&e.relAddr===this.relAddr&&e.relPort===this.relPort}clone(){return new Ku(this.foundation,this.componentId,this.transport,this.priority,this.address,this.port,this.type,this.relAddr,this.relPort)}plain(){const e={foundation:this.foundation,componentId:this.componentId,transport:this.transport,priority:this.priority,address:this.address,port:this.port,type:this.type};return this.relAddr&&(e.relAddr=this.relAddr),this.relPort&&(e.relPort=this.relPort),e}getFoundation(){return this.foundation}getComponentId(){return this.componentId}getTransport(){return this.transport}getPriority(){return this.priority}getAddress(){return this.address}getPort(){return this.port}getType(){return this.type}getRelAddr(){return this.relAddr}getRelPort(){return this.relPort}}Ku.expand=function(e){return new Ku(e.foundation,e.componentId,e.transport,e.priority,e.address,e.port,e.type,e.relAddr,e.relPort)};var ml=Ku;class Qu{constructor(e,t){this.id=e,this.params=t||[]}clone(){return new Qu(this.id,this.params)}plain(){return this.params.length?{id:this.id,params:this.params}:{id:this.id}}getId(){return this.id}getParams(){return this.params}}Qu.expand=function(e){return new Qu(e.id,e.params)};var gl=Qu;class tl{constructor(e,t,r){this.codec=e,this.type=t,this.params={},this.rtcpfbs=new Set,r&&this.addParams(r)}clone(){const e=new tl(this.codec,this.type,this.params);this.hasRTX()&&e.setRTX(this.getRTX());for(const t of this.rtcpfbs)e.addRTCPFeedback(t.clone());return this.hasChannels()&&e.setChannels(this.getChannels()),e}plain(){const e={codec:this.codec,type:this.type};this.rtx&&(e.rtx=this.rtx),this.channels&&(e.channels=this.channels),Object.keys(this.params).length&&(e.params=this.params);for(const t of this.rtcpfbs)e.rtcpfbs||(e.rtcpfbs=[]),e.rtcpfbs.push(t.plain());return e}setRTX(e){this.rtx=e}getType(){return this.type}setType(e){this.type=e}getCodec(){return this.codec}getParams(){return this.params}addParams(e){for(const t in e)this.params[t]=e[t]}addParam(e,t){this.params[e]=t}hasParam(e){return this.params.hasOwnProperty(e)}getParam(e,t){return this.hasParam(e)?this.params[e]:""+t}hasRTX(){return this.rtx}getRTX(){return this.rtx}hasChannels(){return this.channels}getChannels(){return this.channels}setChannels(e){this.channels=e}addRTCPFeedback(e){this.rtcpfbs.add(e)}getRTCPFeedbacks(){return this.rtcpfbs}}tl.expand=function(e){const t=new tl(e.codec,e.type,e.params);e.rtx&&t.setRTX(e.rtx),e.channels&&t.setChannels(e.channels);for(let r=0;e.rtcpfbs&&r<e.rtcpfbs.length;++r){const n=gl.expand(e.rtcpfbs[r]);t.addRTCPFeedback(n)}return t},tl.MapFromNames=function(e,t,r){const n=new Map;let i=96;for(let o=0;o<e.length;++o){let s;const a=e[o].split(";"),c=a[0].toLowerCase().trim();s="pcmu"===c?0:"pcma"===c?8:++i;const u=new tl(c,s);"opus"===c?u.setChannels(2):"multiopus"===c&&u.setChannels(6),t&&"ulpfec"!==c&&"flexfec-03"!==c&&"red"!==c&&u.setRTX(++i);for(let e=0;r&&e<r.length;++e)u.addRTCPFeedback(new gl(r[e].id,r[e].params));for(let e=1;e<a.length;++e){let t=a[e].split("=");u.addParam(t[0].trim(),t[1].trim())}n.set(u.getCodec().toLowerCase(),u)}return n};var vl=tl,yl=function e(){var t=this;if(!(this instanceof e))return new(Function.prototype.bind.apply(e,[null].concat(Array.prototype.slice.call(arguments))));Array.from(arguments).forEach((function(e){t[e]=Symbol.for("MEDOOZE_SEMANTIC_SDP_"+e)}))};const wl=yl("ACTIVE","PASSIVE","ACTPASS","INACTIVE");wl.byValue=function(e){switch(e){case wl.ACTIVE:case wl.PASSIVE:case wl.ACTPASS:case wl.INACTIVE:return e}return wl[e.toUpperCase()]},wl.toString=function(e){switch(e){case wl.ACTIVE:return"active";case wl.PASSIVE:return"passive";case wl.ACTPASS:return"actpass";case wl.INACTIVE:return"inactive"}},wl.reverse=function(e){switch(e){case wl.ACTIVE:return wl.PASSIVE;case wl.PASSIVE:return wl.ACTIVE;case wl.ACTPASS:return wl.PASSIVE;case wl.INACTIVE:return wl.INACTIVE}};var bl=wl;class sl{constructor(e,t,r){this.setup=e,this.hash=t,this.fingerprint=r}clone(){return new sl(this.setup,this.hash,this.fingerprint)}plain(){return{setup:bl.toString(this.setup),hash:this.hash,fingerprint:this.fingerprint}}getFingerprint(){return this.fingerprint}getHash(){return this.hash}getSetup(){return this.setup}setSetup(e){this.setup=e}}sl.expand=function(e){return new sl(e.setup?bl.byValue(e.setup):bl.ACTPASS,e.hash,e.fingerprint)};var Sl=sl;class cl{constructor(e,t,r,n){this.tag=e,this.suite=t,this.keyParams=r,this.sessionParams=n}clone(){return new cl(this.tag,this.suite,this.keyParams,this.sessionParams)}plain(){return{tag:this.tag,suite:this.suite,keyParams:this.keyParams,sessionParams:this.sessionParams}}getSessionParams(){return this.sessionParams}getKeyParams(){return this.keyParams}getSuite(){return this.suite}getTag(){return this.tag}}cl.expand=function(e){return new cl(e.tag,e.suite,e.keyParams,e.sessionParams)};for(var xl=cl,Cl=[],El=[],Il="undefined"!=typeof Uint8Array?Uint8Array:Array,Tl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pl=0,Al=Tl.length;Pl<Al;++Pl)Cl[Pl]=Tl[Pl],El[Tl.charCodeAt(Pl)]=Pl;function kl(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function Ll(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(Cl[(i=n)>>18&63]+Cl[i>>12&63]+Cl[i>>6&63]+Cl[63&i]);return o.join("")}El["-".charCodeAt(0)]=62,El["_".charCodeAt(0)]=63;var Ml=function(e){var t,r,n=kl(e),i=n[0],o=n[1],s=new Il(function(e,t,r){return 3*(t+r)/4-r}(0,i,o)),a=0,c=o>0?i-4:i;for(r=0;r<c;r+=4)t=El[e.charCodeAt(r)]<<18|El[e.charCodeAt(r+1)]<<12|El[e.charCodeAt(r+2)]<<6|El[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=El[e.charCodeAt(r)]<<2|El[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=El[e.charCodeAt(r)]<<10|El[e.charCodeAt(r+1)]<<4|El[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},jl=function(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(Ll(e,s,s+o>a?a:s+o));return 1===n?(t=e[r-1],i.push(Cl[t>>2]+Cl[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(Cl[t>>10]+Cl[t>>4&63]+Cl[t<<2&63]+"=")),i.join("")},Bl=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},_l=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=h,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=h,s/=256,u-=8);e[r+p-h]|=128*m},Fl=j((function(e,t){const r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50;const n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|f(e,t);let n=i(r);const s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);const s=function(e){if(o.isBuffer(e)){const t=0|d(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?i(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return a(e),i(e<0?0:0|d(e))}function u(e){const t=e.length<0?0:0|d(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function d(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(W(n))return s;e[r+s]=n}return s}function y(e,t,r,n){return q($(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return q(G(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?jl(e):jl(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(X(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=o.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(X(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)h(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(X(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const c=Math.min(s,a),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<c;++e)if(u[e]!==l[e]){s=u[e],a=l[e];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return b(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const E=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=H[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function A(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function L(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||D(e,0,r,4),_l(e,t,r,n,23,4),r+4}function N(e,t,r,n,i){return t=+t,r>>>=0,i||D(e,0,r,8),_l(e,t,r,n,52,8),r+8}o.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Y((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Y((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Y((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Y((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),Bl(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),Bl(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),Bl(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),Bl(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Y((function(e,t=0){return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Y((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Y((function(e,t=0){return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Y((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};const j={};function B(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function _(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function U(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw F(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=_(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=_(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return Ml(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const H=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?K:e}function K(){throw new Error("BigInt not supported")}})),zl=j((function(e,t){var r=Fl.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=Fl:(n(Fl,t),t.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Fl.SlowBuffer(e)}})),Gl=j((function(e){var t=65536,r=zl.Buffer,n=N.crypto||N.msCrypto;n&&n.getRandomValues?e.exports=function(e,i){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(e);if(e>0)if(e>t)for(var s=0;s<e;s+=t)n.getRandomValues(o.slice(s,s+t));else n.getRandomValues(o);return"function"==typeof i?I.nextTick((function(){i(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}));class Rl{constructor(e,t){this.ufrag=e,this.pwd=t,this.lite=!1,this.endOfCandidates=!1}clone(){const e=new Rl(this.ufrag,this.pwd);return e.setLite(this.lite),e.setEndOfCandidates(this.endOfCandidates),e}plain(){const e={ufrag:this.ufrag,pwd:this.pwd};return this.lite&&(e.lite=this.lite),this.endOfCandidates&&(e.endOfCandidates=this.endOfCandidates),e}getUfrag(){return this.ufrag}getPwd(){return this.pwd}isLite(){return this.lite}setLite(e){this.lite=e}isEndOfCandidates(){return this.endOfCandidates}setEndOfCandidates(e){this.endOfCandidates=e}}Rl.generate=function(e){const t=new Rl,r=Gl(8),n=Gl(24);return t.ufrag=r.toString("hex"),t.pwd=n.toString("hex"),t.lite=e,t},Rl.expand=function(e){const t=new Rl(e.ufrag,e.pwd);return t.setLite(e.lite),t.setEndOfCandidates(e.endOfCandidates),t};var Wl=Rl;const Hl=yl("SEND","RECV");Hl.byValue=function(e){return Hl[e.toUpperCase()]},Hl.toString=function(e){switch(e){case Hl.SEND:return"send";case Hl.RECV:return"recv"}},Hl.reverse=function(e){switch(e){case Hl.SEND:return Hl.RECV;case Hl.RECV:return Hl.SEND}};var Jl=Hl;class Ol{constructor(e,t){this.id=e,this.direction=t,this.formats=[],this.params=new Map}clone(){var e=new Ol(this.id,this.direction);return e.setFormats(this.formats),e.setParams(this.params),e}plain(){var e={id:this.id,direction:Jl.toString(this.direction)};for(var[t,r]of(this.formats&&(e.formats=this.formats),this.params.entries()))e.params||(e.params={}),e.params[t]=r;return e}getId(){return this.id}getDirection(){return this.direction}setDirection(e){this.direction=e}getFormats(){return this.formats}setFormats(e){this.formats=[];for(let t=0;t<e.length;++t)this.formats.push(parseInt(e[t]))}getParams(){return this.params}setParams(e){this.params=new Map(e)}addParam(e,t){this.params.set(e,t)}getDirection(){return this.direction}setDirection(e){this.direction=e}}Ol.expand=function(e){const t=new Ol(e.id,Jl.byValue(e.direction));for(let r in e.params)t.addParam(r,e.params[r]);return e.formats&&t.setFormats(e.formats),t};var Zl=Ol;class Dl{constructor(e,t){this.paused=t,this.id=e}clone(){return new Dl(this.id,this.paused)}plain(){return{id:this.id,paused:this.paused}}isPaused(){return this.paused}getId(){return this.id}}Dl.expand=function(e){return new Dl(e.id,e.paused)};var ed=Dl;class Nl{constructor(){this.send=[],this.recv=[]}clone(){const e=new Nl;for(let t=0;t<this.send.length;++t){let r=[];for(let e=0;t<this.send[e].length;++t)r.push(this.send[t][e].clone());e.addSimulcastAlternativeStreams(Jl.SEND,r)}for(let t=0;t<this.recv.length;++t){let r=[];for(let e=0;t<this.recv[e].length;++t)r.push(this.recv[t][e].clone());e.addSimulcastAlternativeStreams(Jl.RECV,r)}return e}plain(){const e={send:[],recv:[]};for(let t=0;t<this.send.length;++t){let r=[];for(let e=0;e<this.send[t].length;++e)r.push(this.send[t][e].plain());e.send.push(r)}for(let t=0;t<this.recv.length;++t){let r=[];for(let e=0;e<this.recv[t].length;++e)r.push(this.recv[t][e].plain());e.recv.push(r)}return e}addSimulcastAlternativeStreams(e,t){return e===Jl.SEND?this.send.push(t):this.recv.push(t)}addSimulcastStream(e,t){return e===Jl.SEND?this.send.push([t]):this.recv.push([t])}getSimulcastStreams(e){return e===Jl.SEND?this.send:this.recv}}Nl.expand=function(e){const t=new Nl;for(let r=0;r<e.send.length;++r){let n=[];for(let t=0;t<e.send[r].length;++t)n.push(ed.expand(e.send[r][t]));t.addSimulcastAlternativeStreams(Jl.SEND,n)}for(let r=0;r<e.recv.length;++r){let n=[];for(let t=0;t<e.recv[r].length;++t)n.push(ed.expand(e.recv[r][t]));t.addSimulcastAlternativeStreams(Jl.RECV,n)}return t};var td=Nl;const rd=yl("SENDRECV","SENDONLY","RECVONLY","INACTIVE");rd.byValue=function(e){return rd[e.toUpperCase()]},rd.toString=function(e){switch(e){case rd.SENDRECV:return"sendrecv";case rd.SENDONLY:return"sendonly";case rd.RECVONLY:return"recvonly";case rd.INACTIVE:return"inactive"}},rd.reverse=function(e){switch(e){case rd.SENDRECV:return rd.SENDRECV;case rd.SENDONLY:return rd.RECVONLY;case rd.RECVONLY:return rd.SENDONLY;case rd.INACTIVE:return rd.INACTIVE}};var nd=rd;class Ul{constructor(e,t){this.port=e,this.maxMessageSize=t}clone(){return new Ul(this.port,this.maxMessageSize)}plain(){return{port:this.port,maxMessageSize:this.maxMessageSize}}getPort(){return this.port}getMaxMessageSize(){return this.maxMessageSize}}Ul.expand=function(e){return new Ul(e.port,e.maxMessageSize)};var id=Ul;class Vl{constructor(e,t){this.id=e,this.type=t,this.direction=nd.SENDRECV,this.extensions=new Map,this.codecs=new Map,this.rids=new Map,this.simulcast=null,this.bitrate=0,this.control=null,this.dataChannel=null}clone(){const e=new Vl(this.id,this.type);e.setDirection(this.direction),e.setBitrate(this.bitrate);for(const t of this.codecs.values())e.addCodec(t.clone());for(const[t,r]of this.extensions.entries())e.addExtension(t,r);for(const t of this.rids.values())e.addRID(t.clone());return this.simulcast&&e.setSimulcast(this.simulcast.clone()),this.control&&e.setControl(this.control),this.dataChannel&&e.setDatachannel(this.dataChannel.clone()),e}plain(){const e={id:this.id,type:this.type,direction:nd.toString(this.direction),codecs:[]};this.dataChannel&&(e.dataChannel=this.dataChannel.plain()),this.bitrate&&(e.bitrate=this.bitrate);for(const t of this.codecs.values())e.codecs.push(t.plain());for(const[t,r]of this.extensions.entries())e.extensions||(e.extensions={}),e.extensions[t]=r;for(const t of this.rids.values())e.rids||(e.rids=[]),e.rids.push(t.plain());return this.simulcast&&(e.simulcast=this.simulcast.plain()),this.control&&(e.control=this.control),e}getType(){return this.type}getId(){return this.id}setId(e){this.id=e}addExtension(e,t){this.extensions.set(e,t)}addRID(e){this.rids.set(e.getId(),e)}addCodec(e){this.codecs.set(e.getType(),e)}setCodecs(e){this.codecs=e}getCodecForType(e){return this.codecs.get(e)}getCodec(e){for(const t of this.codecs.values())if(t.getCodec().toLowerCase()===e.toLowerCase())return t;return null}hasCodec(e){return null!==this.getCodec(e)}getCodecs(){return this.codecs}hasRTX(){for(const e of this.codecs.values())if(e.hasRTX())return!0;return!1}getExtensions(){return this.extensions}getRIDs(){return this.rids}getRID(e){return this.rids.get(e)}getBitrate(){return this.bitrate}setBitrate(e){this.bitrate=e}getDirection(){return this.direction}setDirection(e){this.direction=e}hasControl(){return!!this.control}getControl(){return this.control}setControl(e){this.control=e}hasDataChannel(){return!!this.dataChannel}getDataChannel(){return this.dataChannel}setDataChannel(e){this.dataChannel=e}answer(e){const t=new Vl(this.id,this.type);if(e){if(t.setDirection(nd.reverse(this.direction)),e.codecs){let r;r=Array.isArray(e.codecs)?vl.MapFromNames(e.codecs,e.rtx,e.rtcpfbs):e.codecs;for(let e of this.codecs.values())if(r.has(e.getCodec().toLowerCase())){const n=r.get(e.getCodec().toLowerCase());if("h264"===n.getCodec()&&n.hasParam("packetization-mode")&&n.getParam("packetization-mode")!=e.getParam("packetization-mode","0"))continue;if("h264"===n.getCodec()&&n.hasParam("profile-level-id")&&e.hasParam("profile-level-id")&&n.getParam("profile-level-id")!=e.getParam("profile-level-id"))continue;if("multiopus"===n.getCodec()&&n.hasParam("num_streams")&&e.hasParam("num_streams")&&n.getParam("num_streams")!=e.getParam("num_streams"))continue;const i=n.clone();i.setType(e.getType()),i.hasRTX()&&i.setRTX(e.getRTX()),e.hasChannels()&&i.setChannels(e.getChannels()),i.addParams(e.getParams()),t.addCodec(i)}}const n=new Set(e.extensions);for(let[e,r]of this.extensions)n.has(r)&&t.addExtension(e,r);if(e.simulcast&&this.simulcast){const e=new td,n=this.simulcast.getSimulcastStreams(Jl.SEND);if(n)for(let t=0;t<n.length;++t){var r=[];for(let e=0;e<n[t].length;++e)r.push(n[t][e].clone());e.addSimulcastAlternativeStreams(Jl.RECV,r)}const i=this.simulcast.getSimulcastStreams(Jl.RECV);if(i)for(let t=0;t<i.length;++t){r=[];for(let e=0;e<i[t].length;++e)r.push(i[t][e].clone());e.addSimulcastAlternativeStreams(Jl.SEND,r)}for(const e of this.rids.values()){const r=e.clone();r.setDirection(Jl.reverse(e.getDirection())),t.addRID(r)}t.setSimulcast(e)}if(e.dataChannel&&this.dataChannel){const r=new id(this.dataChannel.getPort(),e.dataChannel.maxMessageSize?e.dataChannel.maxMessageSize:this.dataChannel.getMaxMessageSize());t.setDataChannel(r)}}else t.setDirection(nd.INACTIVE);return t}getSimulcast(){return this.simulcast}setSimulcast(e){this.simulcast=e}}Vl.create=function(e,t){const r=new Vl(e,e);return t?t.codecs&&(Array.isArray(t.codecs)?r.setCodecs(vl.MapFromNames(t.codecs,t.rtx,t.rtcpfbs)):r.setCodecs(t.codecs)):r.setDirection(nd.INACTIVE),r},Vl.expand=function(e){const t=new Vl(e.id,e.type);if(e.direction&&t.setDirection(nd.byValue(e.direction)),t.setBitrate(e.bitrate),e.dataChannel){const r=id.expand(e.dataChannel);r&&t.setDataChannel(r)}for(let r in e.extensions)t.addExtension(r,e.extensions[r]);for(let r=0;e.codecs&&r<e.codecs.length;++r){const n=vl.expand(e.codecs[r]);n&&t.addCodec(n)}for(let r=0;e.rids&&r<e.rids.length;++r){const n=Zl.expand(e.rids[r]);t.addRID(n)}return e.simulcast&&t.setSimulcast(td.expand(e.simulcast)),e.control&&t.setControl(e.control),t};var od=Vl;class $l{constructor(e,t){this.semantics=e,this.ssrcs=[];for(let e=0;e<t.length;++e)this.ssrcs.push(parseInt(t[e]))}clone(){return new $l(this.semantics,this.ssrcs)}plain(){const e={semantics:this.semantics,ssrcs:[]};for(let t=0;t<this.ssrcs.length;++t)e.ssrcs.push(this.ssrcs[t]);return e}getSemantics(){return this.semantics}getSSRCs(){return this.ssrcs}}$l.expand=function(e){return new $l(e.semantics,e.ssrcs)};var sd=$l;class ql{constructor(e){this.ssrc=e}clone(){const e=new ql(this.ssrc);e.setCName(this.cname),e.setStreamId(this.streamId),e.setTrackId(this.trackId)}plain(){const e={ssrc:this.ssrc};return this.cname&&(e.cname=this.cname),this.streamId&&(e.streamId=this.streamId),this.trackId&&(e.trackid=this.trackId),e}getCName(){return this.cname}setCName(e){this.cname=e}getStreamId(){return this.streamId}setStreamId(e){this.streamId=e}getTrackId(){return this.trackId}setTrackId(e){this.trackId=e}getSSRC(){return this.ssrc}}ql.expand=function(e){const t=new ql(e.ssrc);return t.setCName(e.cname),t.setStreamId(e.streamId),t.setTrackId(e.trackId),t};var cd=ql;class Xl{constructor(e,t){this.id=e,this.paused=t,this.codecs=new Map,this.params=new Map}clone(){var e=new Xl(this.id,this.paused);for(let t of this.codecs.values())e.addCodec(t.clone());return e.setParams(this.params),e}plain(){var e={id:this.id,paused:this.paused,codecs:{},params:{}};for(var[t,r]of this.codecs.entries())e.codecs[t]=r.plain();for(var[t,n]of this.params.entries())e.params[t]=n;return e}getId(){return this.id}getCodecs(){return this.codecs}addCodec(e){this.codecs.set(e.getType(),e)}getParams(){return this.params}setParams(e){this.params=new Map(e)}addParam(e,t){this.params.set(e,t)}isPaused(){return this.paused}}Xl.expand=function(e){const t=new Xl(e.id,e.paused);for(let r in e.codecs)t.addCodec(vl.expand(e.codecs[r]));for(let r in e.params)t.addParam(r,e.params[r]);return t};var ud=Xl;class Yl{constructor(e,t){this.media=e,this.id=t,this.ssrcs=[],this.groups=[],this.encodings=[]}clone(){const e=new Yl(this.media,this.id);this.mediaId&&e.setMediaId(this.mediaId);for(let t=0;t<this.ssrcs.length;++t)e.addSSRC(this.ssrcs[t]);for(let t=0;t<this.groups.length;++t)e.addSourceGroup(this.groups[t].clone());for(let t=0;t<this.encodings.length;++t){const r=[];for(let e=0;e<this.encodings[t].length;++e)r.push(this.encodings[t][e].clone());e.addAlternativeEncodings(r)}return e}plain(){const e={media:this.media,id:this.id,ssrcs:[]};this.mediaId&&(e.mediaId=this.mediaId);for(let t=0;t<this.ssrcs.length;++t)e.ssrcs.push(this.ssrcs[t]);for(let t=0;t<this.groups.length;++t)e.groups||(e.groups=[]),e.groups.push(this.groups[t].plain());for(let t=0;t<this.encodings.length;++t){const r=[];for(let e=0;e<this.encodings[t].length;++e)r.push(this.encodings[t][e].plain());r.length&&(e.encodings||(e.encodings=[]),e.encodings.push(r))}return e}getMedia(){return this.media}setMediaId(e){this.mediaId=e}getMediaId(){return this.mediaId}getId(){return this.id}addSSRC(e){this.ssrcs.push(e)}getSSRCs(){return this.ssrcs}addSourceGroup(e){this.groups.push(e)}getSourceGroup(e){for(const t of this.groups)if(t.getSemantics().toLowerCase()===e.toLowerCase())return t;return null}getSourceGroups(){return this.groups}hasSourceGroup(e){for(const t of this.groups)if(t.getSemantics().toLowerCase()===e.toLowerCase())return!0;return!1}getEncodings(){return this.encodings}addEncoding(e){this.encodings.push([e])}addAlternativeEncodings(e){this.encodings.push(e)}setEncodings(e){this.encodings=e}}Yl.expand=function(e){const t=new Yl(e.media,e.id);e.mediaId&&t.setMediaId(e.mediaId);for(let r=0;e.ssrcs&&r<e.ssrcs.length;++r)t.addSSRC(e.ssrcs[r]);for(let r=0;e.groups&&r<e.groups.length;++r)t.addSourceGroup(sd.expand(e.groups[r]));for(let r=0;e.encodings&&r<e.encodings.length;++r){const n=[];for(let t=0;t<e.encodings[r].length;++t)n.push(ud.expand(e.encodings[r][t]));t.addAlternativeEncodings(n)}return t};var ld=Yl;class Kl{constructor(e){this.id=e,this.tracks=new Map}clone(){const e=new Kl(this.id);for(const t of this.tracks.values())e.addTrack(t.clone());return e}plain(){const e={id:this.id,tracks:[]};for(const t of this.tracks.values())e.tracks.push(t.plain());return e}getId(){return this.id}addTrack(e){this.tracks.set(e.getId(),e)}removeTrack(e){return this.tracks.delete(e.getId())}removeTrackById(e){return this.tracks.delete(e)}getFirstTrack(e){for(let t of this.tracks.values())if(t.getMedia().toLowerCase()===e.toLowerCase())return t;return null}getTracks(){return this.tracks}removeAllTracks(){this.tracks.clear()}getTrack(e){return this.tracks.get(e)}}Kl.expand=function(e){const t=new Kl(e.id,e.paused);for(let r=0;r<e.tracks.length;++r){const n=ld.expand(e.tracks[r]);n&&t.addTrack(n)}return t};var dd=Kl;class Ql{constructor(e){this.version=e||1,this.streams=new Map,this.medias=new Array,this.candidates=new Array,this.ice=null,this.dtls=null,this.crypto=null,this.extmapAllowMixed=!0}clone(){const e=new Ql(this.version);for(let t=0;t<this.medias.length;++t)e.addMedia(this.medias[t].clone());for(const t of this.streams.values())e.addStream(t.clone());for(let t=0;t<this.candidates.length;++t)e.addCandidate(this.candidates[t].clone());return e.setICE(this.ice.clone()),this.dtls&&e.setDTLS(this.dtls.clone()),this.crypto&&e.setCrypto(this.crypto.clone()),e.setExmapAllowMixed(this.extmapAllowMixed),e}plain(){const e={version:this.version,streams:[],medias:[],candidates:[]};for(let t=0;t<this.medias.length;++t)e.medias.push(this.medias[t].plain());for(const t of this.streams.values())e.streams.push(t.plain());for(let t=0;t<this.candidates.length;++t)e.candidates.push(this.candidates[t].plain());return this.ice&&(e.ice=this.ice.plain()),this.dtls&&(e.dtls=this.dtls.plain()),this.crypto&&(e.crypto=this.crypto.plain()),this.extmapAllowMixed||(e.extmapAllowMixedNotSupported=!this.extmapAllowMixed),e}unify(){const e=new Ql(this.version);for(let t=0;t<this.medias.length;++t)e.addMedia(this.medias[t].clone());const t={audio:e.getMediasByType("audio"),video:e.getMediasByType("video")};for(const r of this.streams.values()){const n=r.clone();for(const r of n.getTracks().values()){let n=t[r.getMedia()].pop();n||(n=this.getMedia(r.getMedia()).clone(),n.setId(r.getId()),e.addMedia(n)),r.setMediaId(n.getId())}e.addStream(n)}for(let t=0;t<this.candidates.length;++t)e.addCandidate(this.candidates[t].clone());return this.ice&&e.setICE(this.ice.clone()),this.dtls&&e.setDTLS(this.dtls.clone()),this.crypto&&e.setCrypto(this.crypto.clone()),e}setVersion(e){this.version=e}addMedia(e){this.medias.push(e)}getMedia(e){for(let t in this.medias){let r=this.medias[t];if(r.getType().toLowerCase()===e.toLowerCase())return r}return null}getMediasByType(e){var t=[];for(let r in this.medias){let n=this.medias[r];n.getType().toLowerCase()===e.toLowerCase()&&t.push(n)}return t}getMediaById(e){for(let t in this.medias){let r=this.medias[t];if(r.getId().toLowerCase()===e.toLowerCase())return r}return null}replaceMedia(e){for(let t in this.medias)if(this.medias[t].getId()==e.getId())return this.medias[t]=e,!0;return!1}getMedias(){return this.medias}getVersion(){return this.version}getDTLS(){return this.dtls}setDTLS(e){this.dtls=e}hasCrypto(){return!!this.crypto}getCrypto(){return this.crypto}setCrypto(e){this.crypto=e}hasICE(){return!!this.ice}getICE(){return this.ice}setICE(e){this.ice=e}addCandidate(e){for(let t=0;t<this.candidates.length;++t)if(this.candidates[t].equals(e))return;this.candidates.push(e)}addCandidates(e){for(let t=0;t<e.length;++t)this.addCandidate(e[t])}getCandidates(){return this.candidates}getStream(e){return this.streams.get(e)}getStreams(){return this.streams}getFirstStream(){for(let e of this.streams.values())return e;return null}addStream(e){this.streams.set(e.getId(),e)}removeStream(e){return this.streams.delete(e.getId())}removeAllStreams(){this.streams.clear()}getTrackByMediaId(e){for(let t of this.streams.values())for(let[r,n]of t.getTracks())if(n.getMediaId()==e)return n;return null}getStreamByMediaId(e){for(let t of this.streams.values())for(let[r,n]of t.getTracks())if(n.getMediaId()==e)return t;return null}getExtmapAllowMixed(){return this.extmapAllowMixed}setExtmapAllowMixed(e){this.extmapAllowMixed=e}answer(e){const t=new Ql;e.ice&&(e.ice instanceof Wl?t.setICE(e.ice.clone()):t.setICE(Wl.expand(e.ice))),e.dtls&&(e.dtls instanceof Sl?t.setDTLS(e.dtls):t.setDTLS(Sl.expand(e.dtls))),e.crypto&&(e.crypto instanceof xl?t.setCrypto(e.crypto):t.setCrypto(xl.expand(e.crypto)));for(let r=0;e.candidates&&r<e.candidates.length;++r)e.candidates[r]instanceof ml?t.addCandidate(e.candidates[r].clone()):t.addCandidate(ml.expand(e.candidates[r]));for(const r of this.medias){const n=e&&e.capabilities&&e.capabilities[r.getType()];t.addMedia(r.answer(n))}return t.setExtmapAllowMixed(this.extmapAllowMixed),t}toString(){let e={version:0,media:[]};e.version=0,e.origin={username:"-",sessionId:(new Date).getTime(),sessionVersion:this.version,netType:"IN",ipVer:4,address:"127.0.0.1"},e.name="semantic-sdp",e.connection={version:4,ip:"0.0.0.0"},e.timing={start:0,stop:0},this.hasICE()&&this.getICE().isLite()&&(e.icelite="ice-lite"),e.msidSemantic={semantic:"WMS",token:"*"},e.groups=[],this.extmapAllowMixed&&(e.extmapAllowMixed="extmap-allow-mixed");let t={type:"BUNDLE",mids:[]};for(let r in this.medias){let n=this.medias[r],i={type:n.getType(),port:9,protocol:"",fmtp:[],rtp:[],rtcpFb:[],ext:[],bandwidth:[],candidates:[],ssrcGroups:[],ssrcs:[],rids:[]};i.direction=nd.toString(n.getDirection()),this.extmapAllowMixed&&(i.extmapAllowMixed="extmap-allow-mixed"),i.mid=n.getId(),t.mids.push(n.getId()),n.hasControl()&&(i.control=n.getControl()),n.getBitrate()>0&&(i.bandwidth.push({type:"AS",limit:n.getBitrate()}),i.bandwidth.push({type:"TIAS",limit:1e3*n.getBitrate()}));let o=this.getCandidates();for(let e=0;e<o.length;++e){let t=o[e];i.candidates.push({foundation:t.getFoundation(),component:t.getComponentId(),transport:t.getTransport(),priority:t.getPriority(),ip:t.getAddress(),port:t.getPort(),type:t.getType(),raddr:t.getRelAddr(),rport:t.getRelPort()})}if(this.getICE()&&(i.iceUfrag=this.getICE().getUfrag(),i.icePwd=this.getICE().getPwd()),["audio","video"].includes(n.getType().toLowerCase())){i.rtcpMux="rtcp-mux",i.rtcpRsize="rtcp-rsize",this.getDTLS()?(i.protocol="UDP/TLS/RTP/SAVPF",i.fingerprint={type:this.getDTLS().getHash(),hash:this.getDTLS().getFingerprint()},i.setup=bl.toString(this.getDTLS().getSetup())):this.getCrypto()?(i.protocol="RTP/SAVPF",i.crypto=[{id:this.getCrypto().getTag(),suite:this.getCrypto().getSuite(),config:this.getCrypto().getKeyParams()}]):i.protocol="RTP/AVP";for(let e of n.getCodecs().values()){"video"===n.getType().toLowerCase()?i.rtp.push({payload:e.getType(),codec:e.getCodec().toUpperCase(),rate:9e4}):"opus"===e.getCodec().toLowerCase()||"multiopus"===e.getCodec().toLowerCase()?i.rtp.push({payload:e.getType(),codec:e.getCodec(),rate:48e3,encoding:e.getChannels()}):i.rtp.push({payload:e.getType(),codec:e.getCodec(),rate:8e3});for(const t of e.getRTCPFeedbacks())i.rtcpFb.push({payload:e.getType(),type:t.getId(),subtype:t.getParams().join(" ")});e.hasRTX()&&(i.rtp.push({payload:e.getRTX(),codec:"rtx",rate:9e4}),i.fmtp.push({payload:e.getRTX(),config:"apt="+e.getType()}));const t=e.getParams();if(Object.keys(t).length){const r={payload:e.getType(),config:""};for(const e in t)r.config.length&&(r.config+=";"),t.hasOwnProperty(e)?r.config+=e+"="+t[e]:r.config+=e;i.fmtp.push(r)}}const e=[];for(let t=0;t<i.rtp.length;++t)e.push(i.rtp[t].payload);i.payloads=e.join(" ");for(let[e,t]of n.getExtensions().entries())i.ext.push({value:e,uri:t});for(let e of n.getRIDs().values()){let t={id:e.getId(),direction:Jl.toString(e.getDirection()),params:""};e.getFormats().length&&(t.params="pt="+e.getFormats().join(","));for(let[r,n]of e.getParams().entries())t.params+=(t.params.length?";":"")+r+"="+n;i.rids.push(t)}const t=n.getSimulcast();if(t){let e=1;i.simulcast={};const r=t.getSimulcastStreams(Jl.SEND),n=t.getSimulcastStreams(Jl.RECV);if(r&&r.length){let t="";for(let e=0;e<r.length;++e){let n="";for(let t=0;t<r[e].length;++t)n+=(n.length?",":"")+(r[e][t].isPaused()?"~":"")+r[e][t].getId();t+=(t.length?";":"")+n}i.simulcast["dir"+e]="send",i.simulcast["list"+e]=t,e++}if(n&&n.length){let t=[];for(let e=0;e<n.length;++e){let r="";for(let t=0;t<n[e].length;++t)r+=(r.length?",":"")+(n[e][t].isPaused()?"~":"")+n[e][t].getId();t+=(t.length?";":"")+r}i.simulcast["dir"+e]="recv",i.simulcast["list"+e]=t,e++}}}else if(n.hasDataChannel()){i.protocol="UDP/DTLS/SCTP",i.payloads="webrtc-datachannel";const e=n.getDataChannel();i.sctpPort=e.getPort(),i.maxMessageSize=e.getMaxMessageSize()}e.media.push(i)}for(let t of this.streams.values())for(let r of t.getTracks().values())for(let n in e.media){let i=e.media[n];if(r.getMediaId()){if(r.getMediaId()==i.mid){let e=r.getSourceGroups();for(let t in e){let r=e[t];i.ssrcGroups.push({semantics:r.getSemantics(),ssrcs:r.getSSRCs().join(" ")})}let n=r.getSSRCs();for(let e in n)i.ssrcs.push({id:n[e],attribute:"cname",value:t.getId()}),i.ssrcs.push({id:n[e],attribute:"msid",value:t.getId()+" "+r.getId()});i.msid=t.getId()+" "+r.getId();break}}else if(i.type.toLowerCase()===r.getMedia().toLowerCase()){let e=r.getSourceGroups();for(let t in e){let r=e[t];i.ssrcGroups.push({semantics:r.getSemantics(),ssrcs:r.getSSRCs().join(" ")})}let n=r.getSSRCs();for(let e in n)i.ssrcs.push({id:n[e],attribute:"cname",value:t.getId()}),i.ssrcs.push({id:n[e],attribute:"msid",value:t.getId()+" "+r.getId()});break}}return t.mids=t.mids.join(" "),e.groups.push(t),hl.write(e)}toIceFragmentString(){let e={version:0,media:[],candidates:[]};this.hasICE()&&this.getICE().isLite()&&(e.icelite="ice-lite"),this.getICE()&&(e.iceUfrag=this.getICE().getUfrag(),e.icePwd=this.getICE().getPwd());for(const t of this.getCandidates())e.candidates.push({foundation:t.getFoundation(),component:t.getComponentId(),transport:t.getTransport(),priority:t.getPriority(),ip:t.getAddress(),port:t.getPort(),type:t.getType(),raddr:t.getRelAddr(),rport:t.getRelPort()});return hl.write(e).slice(10)}}Ql.create=function(e){const t=new Ql;e.ice&&(e.ice instanceof Wl?t.setICE(e.ice.clone()):t.setICE(Wl.expand(e.ice))),e.dtls&&(e.dtls instanceof Sl?t.setDTLS(e.dtls):t.setDTLS(Sl.expand(e.dtls))),e.crypto&&(e.crypto instanceof xl?t.setCrypto(e.crypto):t.setCrypto(xl.expand(e.crypto)));for(let r=0;e.candidates&&r<e.candidates.length;++r)e.candidates[r]instanceof ml?t.addCandidate(e.candidates[r].clone()):t.addCandidate(ml.expand(e.candidates[r]));let r=96,n=1;for(let i in e.capabilities){const o=od.create(i,e.capabilities[i]);for(const[e,t]of o.getCodecs())t.getType()>=96&&t.setType(r++),t.getRTX()&&t.setRTX(r++);if(e.capabilities[i].extensions)for(let t of e.capabilities[i].extensions)15===n&&n++,o.addExtension(n++,t);t.addMedia(o)}return t},Ql.expand=function(e){const t=new Ql(e.version);for(let r=0;e.medias&&r<e.medias.length;++r){const n=od.expand(e.medias[r]);n&&t.addMedia(n)}for(let r=0;e.streams&&r<e.streams.length;++r){const n=dd.expand(e.streams[r]);n&&t.addStream(n)}for(let r=0;e.candidates&&r<e.candidates.length;++r){const n=ml.expand(e.candidates[r]);n&&t.addCandidate(n)}return e.ice&&t.setICE(Wl.expand(e.ice)),e.dtls&&t.setDTLS(Sl.expand(e.dtls)),e.crypto&&t.setCrypto(Sl.expand(e.crypto)),e.extmapAllowMixedNotSupported&&(this.extmapAllowMixed=!e.extmapAllowMixedNotSupported),t},Ql.process=function(e){return Ql.parse(e)},Ql.parse=function(e){const t=hl.parse(e),r=new Ql;if(r.setVersion(t.version),t.iceUfrag&&t.icePwd){const e=String(t.iceUfrag),n=String(t.icePwd),i=new Wl(e,n);i.setLite("ice-lite"==t.icelite),i.setEndOfCandidates("end-of-candidates"==t.endOfCandidates),r.setICE(i)}for(let e in t.media){const n=t.media[e],i=n.type,o=n.mid?n.mid.toString():e,s=new od(o,i);if(n.iceUfrag&&n.icePwd){const e=String(n.iceUfrag),i=String(n.icePwd),o=new Wl(e,i);o.setLite("ice-lite"==t.icelite),o.setEndOfCandidates("end-of-candidates"==n.endOfCandidates),r.setICE(o)}for(let e=0;n.candidates&&e<n.candidates.length;++e){const t=n.candidates[e],i=new ml(t.foundation,t.component,t.transport,t.priority,t.ip,t.port,t.type,t.raddr,t.rport);r.addCandidate(i)}const a=n.fingerprint||t.fingerprint;if(a){const e=a.type,t=a.hash;let i=bl.ACTPASS;n.setup&&(i=bl.byValue(n.setup)),r.setDTLS(new Sl(i,e,t))}if(n.crypto){const e=n.crypto[0];r.setCrypto(new xl(e.id,e.suite,e.config,e.sessionConfig))}let c=nd.SENDRECV;n.direction&&(c=nd.byValue(n.direction),s.setDirection(c)),n.control&&s.setControl(n.control),r.setExtmapAllowMixed("extmap-allow-mixed"==n.extmapAllowMixed||"extmap-allow-mixed"==t.extmapAllowMixed);const u=new Map;for(let e in n.rtp){const t=n.rtp[e],r=t.payload,i=t.codec;if("RED"===i.toUpperCase()||"ULPFEC"===i.toUpperCase())continue;let o={};for(let e in n.fmtp){const t=n.fmtp[e];if(t.payload===r){const e=t.config.split(";");for(let t in e){const r=e[t].split("="),n=r[0].trim(),i=r.splice(1).join("=").trim();o[n]=i}}}if("RTX"===i.toUpperCase())u.set(parseInt(o.apt),r);else{const e=new vl(i,r,o);t.encoding>1&&e.setChannels(t.encoding),s.addCodec(e)}}for(let e of u.entries()){const t=s.getCodecForType(e[0]);t&&t.setRTX(e[1])}for(let e=0;n.rtcpFb&&e<n.rtcpFb.length;++e){const t=s.getCodecForType(n.rtcpFb[e].payload);if(t){const r=n.rtcpFb[e].type,i=n.rtcpFb[e].subtype?n.rtcpFb[e].subtype.split(" "):null;t.addRTCPFeedback(new gl(r,i))}}const l=n.ext;for(let e in l){const t=l[e];s.addExtension(t.value,t.uri)}const d=n.rids;for(let e in d){const t=d[e],r=new Zl(t.id,Jl.byValue(t.direction));let n=[];const i=new Map;if(t.params){const e=hl.parseParams(t.params);for(let t in e)"pt"===t?n=e[t].split(","):i.set(t,e[t]);r.setFormats(n),r.setParams(i)}s.addRID(r)}const f=[];if(n.simulcast){const e=new td;if(n.simulcast.dir1){const t=Jl.byValue(n.simulcast.dir1),r=hl.parseSimulcastStreamList(n.simulcast.list1);for(let n=0;n<r.length;++n){const i=[];for(let e=0;e<r[n].length;++e)i.push(new ed(r[n][e].scid,r[n][e].paused));e.addSimulcastAlternativeStreams(t,i)}}if(n.simulcast.dir2){const t=Jl.byValue(n.simulcast.dir2),r=hl.parseSimulcastStreamList(n.simulcast.list2);for(let n=0;n<r.length;++n){const i=[];for(let e=0;e<r[n].length;++e)i.push(new ed(r[n][e].scid,r[n][e].paused));e.addSimulcastAlternativeStreams(t,i)}}for(let t of e.getSimulcastStreams(Jl.SEND)){const e=[];for(let r=0;r<t.length;r++){const n=new ud(t[r].getId(),t[r].isPaused()),i=s.getRID(n.getId());if(i){const t=i.getFormats();for(let e=0;t&&e<t.length;++e){const r=s.getCodecForType(t[e]);r&&n.addCodec(r)}n.setParams(i.getParams()),e.push(n)}}e.length&&f.push(e)}s.setSimulcast(e)}const p=new Map;if(n.ssrcs)for(let e in n.ssrcs){let t=n.ssrcs[e],s=t.id,a=t.attribute,c=t.value,u=p.get(s);if(u||(u=new cd(s),p.set(u.getSSRC(),u)),"cname"===a.toLowerCase())u.setCName(c);else if("msid"===a.toLowerCase()){let e=c.split(" "),t=e[0],n=e[1];u.setStreamId(t),u.setTrackId(n);let a=r.getStream(t);a||(a=new dd(t),r.addStream(a));let l=a.getTrack(n);l||(l=new ld(i,n),l.setMediaId(o),l.setEncodings(f),a.addTrack(l)),l.addSSRC(s)}}if(n.msid){let e=n.msid.split(" "),t=e[0],s=e[1],a=r.getStream(t);a||(a=new dd(t),r.addStream(a));let c=a.getTrack(s);c||(c=new ld(i,s),c.setMediaId(o),c.setEncodings(f),a.addTrack(c));for(let[e,r]of p.entries())r.getStreamId()||(r.setStreamId(t),r.setTrackId(s),c.addSSRC(e))}for(let[e,t]of p.entries())if(!t.getStreamId()){let n=t.getCName(),s=o;t.setStreamId(n),t.setTrackId(s);let a=r.getStream(n);a||(a=new dd(n),r.addStream(a));let c=a.getTrack(s);c||(c=new ld(i,s),c.setMediaId(o),c.setEncodings(f),a.addTrack(c)),c.addSSRC(e)}if(n.ssrcGroups)for(let e in n.ssrcGroups){let t=n.ssrcGroups[e],i=t.ssrcs.split(" "),o=new sd(t.semantics,i),s=p.get(parseInt(i[0]));s&&r.getStream(s.getStreamId()).getTrack(s.getTrackId()).addSourceGroup(o)}if("application"==n.type&&"webrtc-datachannel"==n.payloads){const e=new id(n.sctpPort,n.maxMessageSize);s.setDataChannel(e)}r.addMedia(s)}return r};var fd,hd,md={SDPInfo:Ql,CandidateInfo:ml,CodecInfo:vl,DTLSInfo:Sl,CryptoInfo:xl,ICEInfo:Wl,MediaInfo:od,Setup:bl,SourceGroupInfo:sd,SourceInfo:cd,StreamInfo:dd,TrackInfo:ld,RTCPFeedbackInfo:gl,TrackEncodingInfo:ud,Direction:nd},gd=(fd=!1,(hd=/[ac]/).exec=function(){return fd=!0,/./.exec.apply(this,arguments)},!0===hd.test("abc")&&fd),vd=/./.test;yr({target:"RegExp",proto:!0,forced:!gd},{test:function(e){var t=ft(this),r=Yo(e),n=t.exec;if(!me(n))return X(vd,t,r);var i=X(n,t,r);return null!==i&&(ft(i),!0)}});var yd=j((function(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",c="model",u="name",l="type",d="vendor",f="version",p="architecture",h="console",m="mobile",g="tablet",v="smarttv",y="wearable",w="embedded",b="Amazon",S="Apple",x="ASUS",C="BlackBerry",E="Google",I="Huawei",T="LG",R="Microsoft",P="Motorola",A="Samsung",k="Sony",O="Xiaomi",L="Zebra",D="Facebook",M=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},N=function(e,t){return typeof e===a&&-1!==j(t).indexOf(j(e))},j=function(e){return e.toLowerCase()},B=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,255)},_=function(e,t){for(var r,o,a,c,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=o=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(a=0;a<p.length;a++)l=u[++o],typeof(c=p[a])===s&&c.length>0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):n:this[c[0]]=l?c[1].call(this,l,c[2]):n:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):n):this[c]=l||n;d+=2}},U=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(N(t[r][i],e))return"?"===r?n:r}else if(N(t[r],e))return"?"===r?n:r;return e},F={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],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[f,[u,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[f,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],f],[/\bfocus\/([\w\.]+)/i],[f,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[f,[u,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],f],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,D],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,U,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,f]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,j]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",j]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,j]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[d,A],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,A],[l,m]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[d,S],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[d,S],[l,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[d,I],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[c,[d,I],[l,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[d,O],[l,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[d,O],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[d,"Vivo"],[l,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[d,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[d,P],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[d,P],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[d,T],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,T],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[d,"Nokia"],[l,m]],[/(pixel c)\b/i],[c,[d,E],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[d,E],[l,m]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[d,k],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,k],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,b],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,b],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[d,C],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,x],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,x],[l,m]],[/(nexus 9)/i],[c,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[d,"Meizu"],[l,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,"Sharp"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,c,[l,m]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,c,[l,g]],[/(surface duo)/i],[c,[d,R],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[l,m]],[/(u304aa)/i],[c,[d,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[c,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[c,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[c,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[c,[d,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[c,[d,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[c,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],c,[l,g]],[/\b(ns-?\w{0,9}) b/i],[c,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[l,m]],[/\b(ph-1) /i],[c,[d,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[c,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,c,[l,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,R],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,L],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,L],[l,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[l,h]],[/droid.+; (shield) bui/i],[c,[d,"Nvidia"],[l,h]],[/(playstation [345portablevi]+)/i],[c,[d,k],[l,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[d,R],[l,h]],[/smart-tv.+(samsung)/i],[d,[l,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,A],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,T],[l,v]],[/(apple) ?tv/i],[d,[c,"Apple TV"],[l,v]],[/crkey/i],[[c,"Chromecast"],[d,E],[l,v]],[/droid.+aft(\w)( bui|\))/i],[c,[d,b],[l,v]],[/\(dtv[\);].+(aquos)/i],[c,[d,"Sharp"],[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,B],[c,B],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/((pebble))app/i],[d,c,[l,y]],[/droid.+; (glass) \d/i],[c,[d,E],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[d,L],[l,y]],[/(quest( 2)?)/i],[c,[d,D],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[f,U,F]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[f,U,F]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[u,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,f]]},z=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof z))return new z(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),c=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(V,t):V;return this.getBrowser=function(){var e={};return e.name=n,e.version=n,_.call(e,i,c.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e.architecture=n,_.call(e,i,c.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,_.call(e,i,c.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,_.call(e,i,c.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,_.call(e,i,c.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>255?B(e,255):e,this},this.setUA(i),this};z.VERSION="0.7.31",z.BROWSER=M([u,f,"major"]),z.CPU=M([p]),z.DEVICE=M([c,d,l,h,m,v,g,y,w]),z.ENGINE=z.OS=M([u,f]),e.exports&&(t=e.exports=z),t.UAParser=z;var $=typeof r!==o&&(r.jQuery||r.Zepto);if($&&!$.ua){var G=new z;$.ua=G.getResult(),$.ua.get=function(){return G.getUA()},$.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:N)}));const wd=["iOS"];class ad extends yd{constructor(){super(window.navigator.userAgent)}isChrome(){const e=this.getBrowser();if(!e.name)return!1;const t=this.getOS();let r=!0;return r=!new RegExp(wd.join("|"),"i").test(t.name),e.name.match(/Chrome/i)&&r}isFirefox(){const e=this.getBrowser();return!!e.name&&e.name.match(/Firefox/i)}}const Sd=Ln.get("SdpParser"),xd=Array.from({length:31},(e,t)=>t+35),Cd=Array.from({length:32},(e,t)=>t+96),Ed=Array.from({length:14},(e,t)=>t+1),Id=Array.from({length:240},(e,t)=>t+16);class pd{static setSimulcast(e,t){if(Sd.info("Setting simulcast. Codec: ",t),!(new ad).isChrome())return Sd.warn("Simulcast is only available in Google Chrome browser"),e;if("h264"!==t&&"vp8"!==t)return Sd.warn("Simulcast is only available in h264 and vp8 codecs"),e;try{const t=/m=video[\s\S]*?a=ssrc:(\d*) msid:([\s\S]+?)\r\n/,r=/m=video[\s\S]*?a=ssrc:(\d*) cname:([\s\S]+?)\r\n/.exec(e),n=r[1],i=r[2],o=t.exec(e)[2],s=2,a=[n];for(let t=0;t<s;++t){const r=100+2*t,n=r+1;a.push(r),e+="a=ssrc-group:FID "+r+" "+n+"\r\na=ssrc:"+r+" cname:"+i+"\r\na=ssrc:"+r+" msid:"+o+"\r\na=ssrc:"+n+" cname:"+i+"\r\na=ssrc:"+n+" msid:"+o+"\r\n"}return e+="a=ssrc-group:SIM "+a.join(" ")+"\r\n",Sd.info("Simulcast setted"),Sd.debug("Simulcast SDP: ",e),e}catch(e){throw Sd.error("Error setting SDP for simulcast: ",e),e}}static setStereo(e){return Sd.info("Replacing SDP response for support stereo"),e=e.replace(/useinbandfec=1/g,"useinbandfec=1; stereo=1"),Sd.info("Replaced SDP response for support stereo"),Sd.debug("New SDP value: ",e),e}static setDTX(e){return Sd.info("Replacing SDP response for support dtx"),e=e.replace("useinbandfec=1","useinbandfec=1; usedtx=1"),Sd.info("Replaced SDP response for support dtx"),Sd.debug("New SDP value: ",e),e}static setAbsoluteCaptureTime(e){const t="a=extmap:"+pd.getAvailableHeaderExtensionIdRange(e)[0]+" http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time\r\n";return e=e.replace(/(m=.*\r\n(?:.*\r\n)*?)(a=extmap.*\r\n)/gm,(e,r,n)=>r+t+n),Sd.info("Replaced SDP response for setting absolute capture time"),Sd.debug("New SDP value: ",e),e}static setDependencyDescriptor(e){const t="a=extmap:"+pd.getAvailableHeaderExtensionIdRange(e)[0]+" https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension\r\n";return e=e.replace(/(m=.*\r\n(?:.*\r\n)*?)(a=extmap.*\r\n)/gm,(e,r,n)=>r+t+n),Sd.info("Replaced SDP response for setting depency descriptor"),Sd.debug("New SDP value: ",e),e}static setVideoBitrate(e,t){if(t<1)Sd.info("Remove bitrate restrictions"),e=e.replace(/b=AS:.*\r\n/,"").replace(/b=TIAS:.*\r\n/,"");else{const r=md.SDPInfo.parse(e),n=r.getMedia("video");Sd.info("Setting video bitrate"),n.setBitrate(t),e=r.toString()}return e}static removeSdpLine(e,t){return Sd.debug("SDP before trimming: ",e),e=e.split("\n").filter(e=>e.trim()!==t).join("\n"),Sd.debug("SDP trimmed result: ",e),e}static adaptCodecName(e,t,r){if(!e)return e;const n=new RegExp("".concat(t),"i");return e.replace(n,r)}static setMultiopus(e,t){if(!(new ad).isFirefox()&&(!t||Td(t)))if(e.includes("multiopus/48000/6"))Sd.info("Multiopus already setted");else{Sd.info("Setting multiopus");const t=/m=audio 9 UDP\/TLS\/RTP\/SAVPF (.*)\r\n/.exec(e)[0],r=pd.getAvailablePayloadTypeRange(e)[0],n=t.replace("\r\n"," ")+r+"\r\na=rtpmap:"+r+" multiopus/48000/6\r\na=fmtp:"+r+" channel_mapping=0,4,1,2,3,5;coupled_streams=2;minptime=10;num_streams=4;useinbandfec=1\r\n";e=e.replace(t,n),Sd.info("Multiopus offer created"),Sd.debug("SDP parsed for multioups: ",e)}return e}static getAvailablePayloadTypeRange(e){const t=e.matchAll(/m=(?:.*) (?:.*) UDP\/TLS\/RTP\/SAVPF (.*)\r\n/gm);let r=Cd.concat(xd);var n,i=M(t);try{for(i.s();!(n=i.n()).done;){const e=n.value[1].split(" ").map(e=>parseInt(e));r=r.filter(t=>!e.includes(t))}}catch(e){i.e(e)}finally{i.f()}return r}static getAvailableHeaderExtensionIdRange(e){const t=e.matchAll(/a=extmap:(\d+)(?:.*)\r\n/gm);let r=Ed.concat(Id);var n,i=M(t);try{for(i.s();!(n=i.n()).done;){const e=n.value[1].split(" ").map(e=>parseInt(e));r=r.filter(t=>!e.includes(t))}}catch(e){i.e(e)}finally{i.f()}return r}static renegotiate(e,t){const r=md.SDPInfo.parse(e),n=md.SDPInfo.parse(t);var i,o=M(r.getMedias());try{for(o.s();!(i=o.n()).done;){const t=i.value;let r=n.getMediaById(t.getId());if(!r){r=new md.MediaInfo(t.getId(),t.getType()),r.setDirection(md.Direction.reverse(t.getDirection()));const i=n.getMedia(t.getType());if(i){r.setCodecs(i.getCodecs());var s,a=M(i.getExtensions());try{for(a.s();!(s=a.n()).done;){const e=O(s.value,2),t=e[0],n=e[1];r.addExtension(t,n)}}catch(e){a.e(e)}finally{a.f()}}n.addMedia(r)}}}catch(e){o.e(e)}finally{o.f()}return n.toString()}static updateMissingVideoExtensions(e,t){var r;const n=md.SDPInfo.parse(e),i=null===(r=md.SDPInfo.parse(t).getMediasByType("video")[0])||void 0===r?void 0:r.getExtensions();if(i||i.length){var o,s=M(n.getMediasByType("video"));try{for(s.s();!(o=s.n()).done;){const t=o.value,r=t.getExtensions();i.forEach((n,i)=>{if(!r.get(i)){const r=t.getId(),o="a=extmap:"+i+" "+n+"\r\n",s=new RegExp("(a=mid:"+r+"\r\n(?:.*\r\n)*?)","g");e=e.replace(s,(e,t,r)=>t+o)}})}}catch(e){s.e(e)}finally{s.f()}return e}}}const Td=e=>e.getAudioTracks().some(e=>e.getSettings().channelCount>2);var Rd=Zt.indexOf,Ad=te([].indexOf),kd=!!Ad&&1/Ad([1],1,-0)<0,Od=function(e,t){var r=[].indexOf;return!!r&&V((function(){r.call(null,(function(){return 1}),1)}))}();yr({target:"Array",proto:!0,forced:kd||!Od},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return kd?Ad(this,e,t)||0:Rd(this,e,t)}});class bd extends _c{constructor(e,t){super(),this.namespace=e,this.tm=t}cmd(e,t){return this.tm.cmd(e,t,this.namespace)}event(e,t){return this.tm.event(e,t,this.namespace)}close(){return this.tm.namespaces.delete(this.namespace)}}var Ld=class extends _c{constructor(e){super(),this.maxId=0,this.namespaces=new Map,this.transactions=new Map,this.transport=e,this.listener=t=>{let r;try{r=JSON.parse(t.utf8Data||t.data||t)}catch(e){return}switch(r.type){case"cmd":const t={name:r.name,data:r.data,namespace:r.namespace,accept:t=>{e.send(JSON.stringify({type:"response",transId:r.transId,data:t}))},reject:t=>{e.send(JSON.stringify({type:"error",transId:r.transId,data:t}))}};if(t.namespace){const e=this.namespaces.get(t.namespace);e?e.emit("cmd",t):this.emit("cmd",t)}else this.emit("cmd",t);break;case"response":{const e=this.transactions.get(r.transId);if(!e)return;this.transactions.delete(r.transId),e.resolve(r.data);break}case"error":{const e=this.transactions.get(r.transId);if(!e)return;this.transactions.delete(r.transId),e.reject(r.data);break}case"event":const i={name:r.name,data:r.data,namespace:r.namespace};if(i.namespace){var n=this.namespaces.get(i.namespace);n?n.emit("event",i):this.emit("event",i)}else this.emit("event",i)}},this.transport.addListener?this.transport.addListener("message",this.listener):this.transport.addEventListener("message",this.listener)}cmd(e,t,r){return new Promise((n,i)=>{if(!e||0===e.length)throw new Error("Bad command name");const o={type:"cmd",transId:this.maxId++,name:e,data:t};r&&(o.namespace=r);const s=JSON.stringify(o);o.resolve=n,o.reject=i,this.transactions.set(o.transId,o);try{this.transport.send(s)}catch(e){throw this.transactions.delete(o.transId),e}})}event(e,t,r){if(!e||0===e.length)throw new Error("Bad event name");const n={type:"event",name:e,data:t};r&&(n.namespace=r);const i=JSON.stringify(n);this.transport.send(i)}namespace(e){let t=this.namespaces.get(e);return t||(t=new bd(e,this),this.namespaces.set(e,t),t)}close(){for(const e of this.namespaces.values())e.close();this.transport.removeListener?this.transport.removeListener("message",this.listener):this.transport.removeEventListener("message",this.listener)}};const Dd=Ln.get("Signaling"),Nd="wsConnectionSuccess",jd="wsConnectionError",Bd="broadcastEvent",_d={VP8:"vp8",VP9:"vp9",H264:"h264",AV1:"av1"},Ud={OPUS:"opus",MULTIOPUS:"multiopus"};class Pd extends _c{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{streamName:null,url:"ws://localhost:8080/"};super(),this.streamName=e.streamName,this.wsUrl=e.url,this.webSocket=null,this.transactionManager=null,this.serverId=null,this.clusterId=null}connect(){var e=this;return A((function*(){var t;return Dd.info("Connecting to Signaling Server"),e.transactionManager&&(null===(t=e.webSocket)||void 0===t?void 0:t.readyState)===WebSocket.OPEN?(Dd.info("Connected to server: ",e.webSocket.url),Dd.debug("WebSocket value: ",{url:e.webSocket.url,protocol:e.webSocket.protocol,readyState:e.webSocket.readyState,binaryType:e.webSocket.binaryType,extensions:e.webSocket.extensions}),e.emit(Nd,{ws:e.webSocket,tm:e.transactionManager}),e.webSocket):new Promise((t,r)=>{e.webSocket=new WebSocket(e.wsUrl),e.transactionManager=new Ld(e.webSocket),e.webSocket.onopen=()=>{Dd.info("WebSocket opened"),e.transactionManager.on("event",t=>{e.emit(Bd,t)}),Dd.info("Connected to server: ",e.webSocket.url),Dd.debug("WebSocket value: ",{url:e.webSocket.url,protocol:e.webSocket.protocol,readyState:e.webSocket.readyState,binaryType:e.webSocket.binaryType,extensions:e.webSocket.extensions}),e.emit(Nd,{ws:e.webSocket,tm:e.transactionManager}),t(e.webSocket)},e.webSocket.onerror=()=>{Dd.error("WebSocket not connected: ",e.webSocket.url),e.emit(jd,e.webSocket.url),r(e.webSocket.url)},e.webSocket.onclose=()=>{e.webSocket=null,e.transactionManager=null,Dd.info("Connection closed with Signaling Server."),e.emit("wsConnectionClose")}})}))()}close(){var e;Dd.info("Closing connection with Signaling Server."),null===(e=this.webSocket)||void 0===e||e.close()}subscribe(e,t){var r=arguments,n=this;return A((function*(){let i=r.length>2&&void 0!==r[2]?r[2]:null,o=r.length>3&&void 0!==r[3]?r[3]:null;Dd.info("Starting subscription to streamName: ",n.streamName),Dd.debug("Subcription local description: ",e);const s=Fd(t,i,o),a={sdp:e=pd.adaptCodecName(e,"AV1X",_d.AV1),streamId:n.streamName,pinnedSourceId:s.pinnedSourceId,excludedSourceIds:s.excludedSourceIds};s.vad&&(a.vad=!0),Array.isArray(s.events)&&(a.events=s.events);try{var c,u,l,d,f;yield n.connect(),Dd.info("Sending view command");const e=yield n.transactionManager.cmd("view",a),t=null===(c=(u=RTCRtpReceiver).getCapabilities)||void 0===c||null===(l=c.call(u,"video"))||void 0===l||null===(d=l.codecs)||void 0===d||null===(f=d.find)||void 0===f?void 0:f.call(d,e=>"video/AV1X"===e.mimeType);return e.sdp=t?pd.adaptCodecName(e.sdp,_d.AV1,"AV1X"):e.sdp,Dd.info("Command sent, subscriberId: ",e.subscriberId),Dd.debug("Command result: ",e),n.serverId=e.subscriberId,n.clusterId=e.clusterId,e.sdp}catch(e){throw Dd.error("Error sending view command, error: ",e),e}}))()}publish(e,t){var r=arguments,n=this;return A((function*(){const i=Vd(t,r.length>2&&void 0!==r[2]?r[2]:null,r.length>3&&void 0!==r[3]?r[3]:null);Dd.info("Starting publishing to streamName: ".concat(n.streamName,", codec: ").concat(i.codec)),Dd.debug("Publishing local description: ",e);const o=Object.values(_d);if(-1===o.indexOf(i.codec))throw Dd.error("Invalid codec. Possible values are: ",o),new Error("Invalid codec. Possible values are: ".concat(o));i.codec===_d.AV1&&(e=pd.adaptCodecName(e,"AV1X",_d.AV1));const s={name:n.streamName,sdp:e,codec:i.codec,sourceId:i.sourceId};null!==i.record&&(s.record=i.record),Array.isArray(i.events)&&(s.events=i.events);try{yield n.connect(),Dd.info("Sending publish command");const e=yield n.transactionManager.cmd("publish",s);if(i.codec===_d.AV1){var a,c,u,l,d;const t=null===(a=(c=RTCRtpSender).getCapabilities)||void 0===a||null===(u=a.call(c,"video"))||void 0===u||null===(l=u.codecs)||void 0===l||null===(d=l.find)||void 0===d?void 0:d.call(l,e=>"video/AV1X"===e.mimeType);e.sdp=t?pd.adaptCodecName(e.sdp,_d.AV1,"AV1X"):e.sdp}return Dd.info("Command sent, publisherId: ",e.publisherId),Dd.debug("Command result: ",e),n.serverId=e.publisherId,n.clusterId=e.clusterId,e.sdp}catch(e){throw Dd.error("Error sending publish command, error: ",e),e}}))()}cmd(e,t){var r=this;return A((function*(){return Dd.info("Sending cmd: ".concat(e)),r.transactionManager.cmd(e,t)}))()}}const Fd=(e,t,r)=>{let n="object"==typeof e?e:{};return 0===Object.keys(n).length&&(n={vad:e,pinnedSourceId:t,excludedSourceIds:r}),n},Vd=(e,t,r)=>{let n="object"==typeof e?e:{};if(0===Object.keys(n).length){const i=_d.H264;n={codec:null!=e?e:i,record:t,sourceId:r}}return n},zd=Ln.get("PeerConnection"),$d={track:"track",connectionStateChange:"connectionStateChange"},Gd={stereo:!1,mediaStream:null,codec:"h264",simulcast:!1,scalabilityMode:null,disableAudio:!1,disableVideo:!1,setSDPToPeer:!0};class Md extends _c{constructor(){super(),this.sessionDescription=null,this.peer=null,this.peerConnectionStats=null}createRTCPeer(){var e=arguments,t=this;return A((function*(){let r=e.length>0&&void 0!==e[0]?e[0]:null;zd.info("Creating new RTCPeerConnection"),zd.debug("RTC configuration provided by user: ",r),t.peer=Wd(t,r)}))()}getRTCPeer(){return zd.info("Getting RTC Peer"),this.peer}closeRTCPeer(){var e=this;return A((function*(){var t;zd.info("Closing RTCPeerConnection"),null===(t=e.peer)||void 0===t||t.close(),e.peer=null,e.stopStats(),e.emit($d.connectionStateChange,"closed")}))()}setRTCRemoteSDP(e){var t=this;return A((function*(){zd.info("Setting RTC Remote SDP");const r={type:"answer",sdp:e};try{yield t.peer.setRemoteDescription(r),zd.info("RTC Remote SDP was set successfully."),zd.debug("RTC Remote SDP new value: ",e)}catch(e){throw zd.error("Error while setting RTC Remote SDP: ",e),e}}))()}getRTCLocalSDP(){var e=arguments,t=this;return A((function*(){let r=e.length>0&&void 0!==e[0]?e[0]:Gd;zd.info("Getting RTC Local SDP"),r=R(R({},Gd),r),zd.debug("Options: ",r);const n=Xd(r.mediaStream);n?Kd(t.peer,n,r):Qd(t.peer,r),zd.info("Creating peer offer");const i=yield t.peer.createOffer();return zd.info("Peer offer created"),zd.debug("Peer offer response: ",i.sdp),t.sessionDescription=i,r.disableAudio||(r.stereo&&(t.sessionDescription.sdp=pd.setStereo(t.sessionDescription.sdp)),r.dtx&&(t.sessionDescription.sdp=pd.setDTX(t.sessionDescription.sdp)),t.sessionDescription.sdp=pd.setMultiopus(t.sessionDescription.sdp,n)),!r.disableVideo&&r.simulcast&&(t.sessionDescription.sdp=pd.setSimulcast(t.sessionDescription.sdp,r.codec)),r.absCaptureTime&&(t.sessionDescription.sdp=pd.setAbsoluteCaptureTime(t.sessionDescription.sdp)),r.dependencyDescriptor&&(t.sessionDescription.sdp=pd.setDependencyDescriptor(t.sessionDescription.sdp)),r.setSDPToPeer&&(yield t.peer.setLocalDescription(t.sessionDescription),zd.info("Peer local description set")),t.sessionDescription.sdp}))()}addRemoteTrack(e,t){var r=this;return A((function*(){const n=yield new Promise((n,i)=>{try{const i=r.peer.addTransceiver(e,{direction:"recvonly"});i.resolve=n,i.streams=t}catch(e){i(e)}});var i,o=M(t);try{for(o.s();!(i=o.n()).done;)i.value.addTrack(n.receiver.track)}catch(e){o.e(e)}finally{o.f()}return n}))()}updateBandwidthRestriction(e,t){return zd.info("Updating bandwidth restriction, bitrate value: ",t),zd.debug("SDP value: ",e),pd.setVideoBitrate(e,t)}updateBitrate(){var e=arguments,t=this;return A((function*(){let r=e.length>0&&void 0!==e[0]?e[0]:0;if(!t.peer)throw zd.error("Cannot update bitrate. No peer found."),new Error("Cannot update bitrate. No peer found.");zd.info("Updating bitrate to value: ",r),t.sessionDescription=yield t.peer.createOffer(),yield t.peer.setLocalDescription(t.sessionDescription);const n=t.updateBandwidthRestriction(t.peer.remoteDescription.sdp,r);yield t.setRTCRemoteSDP(n),zd.info("Bitrate restirctions updated: ","".concat(r>0?r:"unlimited"," kbps"))}))()}getRTCPeerStatus(){if(zd.info("Getting RTC peer status"),!this.peer)return null;const e=Jd(this.peer);return zd.info("RTC peer status getted, value: ",e),e}replaceTrack(e){if(!this.peer)return void zd.error("Could not change track if there is not an active connection.");const t=this.peer.getSenders().find(t=>t.track.kind===e.kind);t?t.replaceTrack(e):zd.error("There is no ".concat(e.kind," track in active broadcast."))}static getCapabilities(e){const t=new ad;if(t.isFirefox())return(e=>"video"===e?{codecs:[{codec:"vp8",mimeType:"video/VP8"},{codec:"vp9",mimeType:"video/VP9"},{codec:"h264",mimeType:"video/H264"}],headerExtensions:[]}:"audio"===e?{codecs:[{codec:"opus",mimeType:"audio/opus",channels:2}],headerExtensions:[]}:null)(e);const r=RTCRtpSender.getCapabilities(e);if(r){const o={};let s=new RegExp("^video/(".concat(Object.values(_d).join("|"),")x?$"),"i");"audio"===e&&(s=new RegExp("^audio/(".concat(Object.values(Ud).join("|"),")$"),"i"),t.isChrome()&&(o.multiopus={mimeType:"audio/multiopus",channels:6}));var n,i=M(r.codecs);try{for(i.s();!(n=i.n()).done;){const e=n.value,t=e.mimeType.match(s);if(t){const r=t[1].toLowerCase();if(o[r]=R(R({},o[r]),{},{mimeType:e.mimeType}),e.scalabilityModes){let t=o[r].scalabilityModes||[];t=[...t,...e.scalabilityModes],o[r].scalabilityModes=[...new Set(t)]}e.channels&&(o[r].channels=e.channels)}}}catch(e){i.e(e)}finally{i.f()}r.codecs=Object.keys(o).map(e=>R({codec:e},o[e]))}return r}getTracks(){var e,t;return null===(e=this.peer)||void 0===e||null===(t=e.getSenders())||void 0===t?void 0:t.map(e=>e.track)}initStats(){this.peerConnectionStats?zd.warn("Cannot init peer stats: Already initialized"):this.peer?(this.peerConnectionStats=new Gc(this.peer),this.peerConnectionStats.init(),Kc(this.peerConnectionStats,this,["stats"])):zd.warn("Cannot init peer stats: RTCPeerConnection not initialized")}stopStats(){var e;null===(e=this.peerConnectionStats)||void 0===e||e.stop(),this.peerConnectionStats=null}}const qd=e=>(null==e?void 0:e.getAudioTracks().length)<=1&&(null==e?void 0:e.getVideoTracks().length)<=1,Xd=e=>{if(!e)return null;if(e instanceof MediaStream&&qd(e))return e;if(!(e instanceof MediaStream)){zd.info("Creating MediaStream to add received tracks.");const n=new MediaStream;var t,r=M(e);try{for(r.s();!(t=r.n()).done;){const e=t.value;n.addTrack(e)}}catch(e){r.e(e)}finally{r.f()}if(qd(n))return n}throw zd.error("MediaStream must have 1 audio track and 1 video track, or at least one of them."),new Error("MediaStream must have 1 audio track and 1 video track, or at least one of them.")},Wd=(e,t)=>{const r=new RTCPeerConnection(t);return Yd(e,r),r},Yd=(e,t)=>{var r;t.ontrack=t=>{var r;if(zd.info("New track from peer."),zd.debug("Track event value: ",t),null!=t&&null!==(r=t.transceiver)&&void 0!==r&&r.resolve){const e=t.transceiver.resolve;delete t.transceiver.resolve,e(t.transceiver)}e.emit($d.track,t)},t.connectionState?t.onconnectionstatechange=r=>{zd.info("Peer connection state change: ",t.connectionState),e.emit($d.connectionStateChange,t.connectionState)}:t.oniceconnectionstatechange=r=>{zd.info("Peer ICE connection state change: ",t.iceConnectionState),e.emit($d.connectionStateChange,t.iceConnectionState)},t.onnegotiationneeded=(r=A((function*(e){if(!t.remoteDescription)return;zd.info("Peer onnegotiationneeded, updating local description");const r=yield t.createOffer();zd.info("Peer onnegotiationneeded, got local offer",r.sdp),r.sdp=pd.updateMissingVideoExtensions(r.sdp,t.remoteDescription.sdp),yield t.setLocalDescription(r);const n=pd.renegotiate(r.sdp,t.remoteDescription.sdp);zd.info("Peer onnegotiationneeded, updating remote description",n),yield t.setRemoteDescription({type:"answer",sdp:n}),zd.info("Peer onnegotiationneeded, renegotiation done")})),function(e){return r.apply(this,arguments)})},Kd=(e,t,r)=>{zd.info("Adding mediaStream tracks to RTCPeerConnection");var n,i=M(t.getTracks());try{for(i.s();!(n=i.n()).done;){const i=n.value,o={streams:[t]};"audio"===i.kind&&(o.direction=r.disableAudio?"inactive":"sendonly"),"video"===i.kind&&(o.direction=r.disableVideo?"inactive":"sendonly",r.scalabilityMode&&(new ad).isChrome()?(zd.debug("Video track with scalability mode: ".concat(r.scalabilityMode,".")),o.sendEncodings=[{scalabilityMode:r.scalabilityMode}]):r.scalabilityMode&&zd.warn("SVC is only supported in Google Chrome")),e.addTransceiver(i,o),zd.info("Track '".concat(i.label,"' added: "),"id: ".concat(i.id),"kind: ".concat(i.kind))}}catch(e){i.e(e)}finally{i.f()}},Qd=(e,t)=>{t.disableVideo||e.addTransceiver("video",{direction:"recvonly"}),t.disableAudio||e.addTransceiver("audio",{direction:"recvonly"});for(let r=0;r<t.multiplexedAudioTracks;r++)e.addTransceiver("audio",{direction:"recvonly"})},Jd=e=>{var t;const r=null!==(t=e.connectionState)&&void 0!==t?t:e.iceConnectionState;switch(r){case"checking":return"connecting";case"completed":return"connected";default:return r}},Zd=Ln.get("Director");let ef="",tf="https://realtime1.wowza.com";class Hd{static setEndpoint(e){tf=e.replace(/\/$/,"")}static getEndpoint(){return tf}static setLiveDomain(e){ef=e.replace(/\/$/,"")}static getLiveDomain(){return ef}static getPublisher(e){var t=arguments,r=this;return A((function*(){const n=rf(e,t.length>1&&void 0!==t[1]?t[1]:null,t.length>2&&void 0!==t[2]?t[2]:"WebRtc");Zd.info("Getting publisher connection path for stream name: ",n.streamName);const i={streamName:n.streamName,streamType:n.streamType},o={"Content-Type":"application/json",Authorization:"Bearer ".concat(n.token)},s="".concat(r.getEndpoint(),"/api/director/publish");try{let e=yield fetch(s,{method:"POST",headers:o,body:JSON.stringify(i)});if(e=yield e.json(),"fail"===e.status)throw new Error(e.data.message);return e=sf(e),Zd.debug("Getting publisher response: ",e),e.data}catch(e){throw Zd.error("Error while getting publisher connection path. ",e),e}}))()}static getSubscriber(e){var t=arguments,r=this;return A((function*(){const n=nf(e,t.length>1&&void 0!==t[1]?t[1]:null,t.length>2&&void 0!==t[2]?t[2]:null);Zd.info("Getting subscriber connection data for stream name: ".concat(n.streamName," and account id: ").concat(n.streamAccountId));const i={streamAccountId:n.streamAccountId,streamName:n.streamName};let o={"Content-Type":"application/json"};n.subscriberToken&&(o=R(R({},o),{},{Authorization:"Bearer ".concat(n.subscriberToken)}));const s="".concat(r.getEndpoint(),"/api/director/subscribe");try{let e=yield fetch(s,{method:"POST",headers:o,body:JSON.stringify(i)});if(e=yield e.json(),"fail"===e.status)throw new Error(e.data.message);return e=sf(e),Zd.debug("Getting subscriber response: ",e),e.data}catch(e){throw Zd.error("Error while getting subscriber connection path. ",e),e}}))()}}const rf=(e,t,r)=>{let n="object"==typeof e?e:{};return 0===Object.keys(n).length&&(n={token:e,streamName:t,streamType:r}),n},nf=(e,t,r)=>{let n="object"==typeof e?e:{};return 0===Object.keys(n).length&&(n={streamName:e,streamAccountId:t,subscriberToken:r}),n=R(R({},n),{},{streamAccountId:"bUEzT6"}),n},sf=e=>{if(Hd.getLiveDomain()){const t=/\/\/(.*?)\//,r=e.data.urls.map(e=>{const r=t.exec(e);return e.replace(r[1],Hd.getLiveDomain())});e.data.urls=r}return e};function af(e){this.message=e}function cf(e){this.message=e}let uf;af.prototype=new Error,af.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),cf.prototype=new Error,cf.prototype.name="InvalidTokenError",j((function(e,t){!function(r){if(null!=t&&"number"!=typeof t.nodeType)e.exports=r();else{var n=r(),i="undefined"!=typeof self?self:$.global;"function"!=typeof i.btoa&&(i.btoa=n.btoa),"function"!=typeof i.atob&&(i.atob=n.atob)}}((function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var n,i,o=String(r),s=0,a=e,c="";o.charAt(0|s)||(a="=",s%1);c+=a.charAt(63&n>>8-s%1*8)){if((i=o.charCodeAt(s+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|i}return c},atob:function(r){var n=String(r).replace(/[=]+$/,"");if(n.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,o,s=0,a=0,c="";o=n.charAt(a++);~o&&(i=s%4?64*i+o:o,s++%4)?c+=String.fromCharCode(255&i>>(-2*s&6)):0)o=e.indexOf(o);return c}}}))}));class of extends _c{constructor(e,t,r,n){if(super(),uf=r,!e)throw uf.error("Stream Name is required to construct this module."),new Error("Stream Name is required to construct this module.");if(!t)throw uf.error("Token generator is required to construct this module."),new Error("Token generator is required to construct this module.");this.webRTCPeer=new Md,this.signaling=null,this.streamName=e,this.autoReconnect=n,this.reconnectionInterval=1e3,this.alreadyDisconnected=!1,this.firstReconnection=!0,this.stopReconnection=!1,this.tokenGenerator=t,this.options=null}getRTCPeerConnection(){return this.webRTCPeer?this.webRTCPeer.getRTCPeer():null}stop(){var e;uf.info("Stopping"),this.webRTCPeer.closeRTCPeer(),null===(e=this.signaling)||void 0===e||e.close(),this.signaling=null,this.stopReconnection=!0,this.webRTCPeer=new Md}isActive(){const e=this.webRTCPeer.getRTCPeerStatus();return uf.info("Broadcast status: ",e||"not_established"),"connected"===e}setReconnect(){this.signaling.on("migrate",()=>this.replaceConnection()),this.autoReconnect&&(this.signaling.on(jd,()=>{!this.firstReconnection&&this.alreadyDisconnected||(this.firstReconnection=!1,this.reconnect())}),this.webRTCPeer.on($d.connectionStateChange,e=>{("failed"===e||"disconnected"===e&&this.alreadyDisconnected)&&this.firstReconnection?(this.firstReconnection=!1,this.reconnect()):"disconnected"===e?(this.alreadyDisconnected=!0,setTimeout(()=>this.reconnect(),1500)):this.alreadyDisconnected=!1}))}reconnect(){var e=this;return A((function*(){try{e.isActive()||e.stopReconnection||(e.stop(),yield e.connect(e.options),e.alreadyDisconnected=!1,e.reconnectionInterval=1e3,e.firstReconnection=!0)}catch(t){e.reconnectionInterval=lf(e.reconnectionInterval),uf.error("Reconnection failed, retrying in ".concat(e.reconnectionInterval,"ms. "),t),e.emit("reconnect",{timeout:e.reconnectionInterval,error:t}),setTimeout(()=>e.reconnect(),e.reconnectionInterval)}}))()}}const lf=e=>e<32e3?2*e:e;Ln.get("Publish");const df=Ln.get("View"),pf={disableVideo:!1,disableAudio:!1,peerConfig:{}};class ff extends of{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(e,t,df,!(arguments.length>3&&void 0!==arguments[3])||arguments[3]),r&&this.on($d.track,e=>{r.srcObject=e.streams[0]})}connect(){var e=arguments,t=this;return A((function*(){let r=e.length>0&&void 0!==e[0]?e[0]:pf;t.options=R(R(R({},pf),r),{},{setSDPToPeer:!1}),yield t.initConnection({migrate:!1})}))()}select(){var e=arguments,t=this;return A((function*(){let r=e.length>0&&void 0!==e[0]?e[0]:{};df.debug("Viewer select layer values: ",r),yield t.signaling.cmd("select",{layer:r}),df.info("Connected to streamName: ",t.streamName)}))()}addRemoteTrack(e,t){var r=this;return A((function*(){return df.info("Viewer adding remote % track",e),r.webRTCPeer.addRemoteTrack(e,t)}))()}project(e,t){var r=this;return A((function*(){var n,i=M(t);try{for(i.s();!(n=i.n()).done;){const e=n.value;if(!e.trackId&&!e.media)throw df.error("Error in projection mapping, trackId or mediaId must be set"),new Error("Error in projection mapping, trackId or mediaId must be set");const t=r.webRTCPeer.getRTCPeer();if(e.mediaId&&!t.getTransceivers().find(t=>t.mid===e.mediaId.toString()))throw df.error("Error in projection mapping, ".concat(e.mediaId," mid not found in local transceivers")),new Error("Error in projection mapping, ".concat(e.mediaId," mid not found in local transceivers"))}}catch(e){i.e(e)}finally{i.f()}df.debug("Viewer project source: layer mappings: ",e,t),yield r.signaling.cmd("project",{sourceId:e,mapping:t}),df.info("Projection done")}))()}unproject(e){var t=this;return A((function*(){df.debug("Viewer unproject mediaIds: ",e),yield t.signaling.cmd("unproject",{mediaIds:e}),df.info("Unprojection done")}))()}replaceConnection(){var e=this;return A((function*(){df.info("Migrating current connection"),yield e.initConnection({migrate:!0})}))()}initConnection(e){var t=this;return A((function*(){var r,n;let i,o;if(df.debug("Viewer connect options values: ",t.options),t.stopReconnection=!1,!e.migrate&&t.isActive())throw df.warn("Viewer currently subscribed"),new Error("Viewer currently subscribed");try{var s;o=yield t.tokenGenerator(),t.options.peerConfig.iceServers=null===(s=o)||void 0===s?void 0:s.iceServers}catch(e){throw df.error("Error generating token."),e}if(!o)throw df.error("Error while subscribing. Subscriber data required"),new Error("Subscriber data required");const a=new Pd({streamName:t.streamName,url:"".concat(o.urls[0],"?token=").concat(o.jwt)}),c=e.migrate?new Md:t.webRTCPeer;yield c.createRTCPeer(t.options.peerConfig),null===(r=t.stopReemitingWebRTCPeerInstanceEvents)||void 0===r||r.call(t),null===(n=t.stopReemitingSignalingInstanceEvents)||void 0===n||n.call(t),t.stopReemitingWebRTCPeerInstanceEvents=Kc(c,t,Object.values($d)),t.stopReemitingSignalingInstanceEvents=Kc(a,t,[Bd]);const u=c.getRTCLocalSDP(R(R({},t.options),{},{stereo:!0})),l=a.connect();i=yield Promise.all([u,l]);const d=i[0];let f=t.signaling;t.signaling=a;const p=t.signaling.subscribe(d,R(R({},t.options),{},{vad:t.options.multiplexedAudioTracks>0})),h=c.peer.setLocalDescription(c.sessionDescription);i=yield Promise.all([p,h]);const m=i[0];yield c.setRTCRemoteSDP(m),df.info("Connected to streamName: ",t.streamName);let g=t.webRTCPeer;t.webRTCPeer=c,t.setReconnect(),e.migrate&&t.webRTCPeer.on($d.connectionStateChange,e=>{if("connected"===e)setTimeout(()=>{var e,t,r,n;null===(e=f)||void 0===e||null===(t=e.close)||void 0===t||t.call(e),null===(r=g)||void 0===r||null===(n=r.closeRTCPeer)||void 0===n||n.call(r),f=g=null,df.info("Current connection migrated")},1e3);else if(["disconnected","failed","closed"].includes(e)){var t,r,n,i;null===(t=f)||void 0===t||null===(r=t.close)||void 0===r||r.call(t),null===(n=g)||void 0===n||null===(i=n.closeRTCPeer)||void 0===i||i.call(n),f=g=null}})}))()}}var hf;!function(e){e[e.Err=0]="Err",e[e.Idle=1]="Idle",e[e.Receiving=2]="Receiving",e[e.Broadcasting=3]="Broadcasting"}(hf||(hf={}));class Millicast{constructor(e,r,n=t("rts/millicast")){this.player=e,this.opts=r,this.log=n}static wants(e,t){return"wowza/millicast"==e&&"string"==typeof t}async load(){this.log("loading",this.opts.streamName);(this.view=new ff(this.opts.streamName,()=>Hd.getSubscriber(this.opts),this.player)).on("broadcastEvent",e=>{switch(e.name){case"active":return this.handleActive(e);case"inactive":return this.handleInactive(e)}}),await this.connect()}handleActive(e){return this.player.hasState("is-error")&&this.player.emit("recover"),this.player.emit("rts/status",{status:hf.Receiving})}handleInactive(e){const t={status:hf.Idle,message:this.player.i18n("rts.millicast.inactive","broadcast has become inactive")};this.player.emit("rts/status",t),this.player.emit("error",Object.assign({fatal:!1},t))}async connect(){try{await this._connect()}catch(e){this.log("Connection failed",e),this.player.emit("error",e),setTimeout(()=>{0==this.player.reaper||this.player.currentSrc||(this.player.emit("recover"),this.connect())},3e3)}}async _connect(){var e;const t=this.view;t&&(await t.connect(),null===(e=t.webRTCPeer)||void 0===e||e.initStats())}stop(){var e;null===(e=this.view)||void 0===e||e.stop()}}Millicast.events={ACTIVE:"rts/millicast/active",INACTIVE:"rts/millicast/inactive"};class RTS{constructor(){this.log=t("rts"),console.log("warning / the realtime plugin is in beta release")}init(e,t,r){r.on("reap",()=>{var e;return null===(e=this.engine)||void 0===e?void 0:e.stop()})}onload(e,t,r,n){if(Millicast.wants(n.type,n.streamName)){(this.engine=new Millicast(r,n)).load()}}wants(e,{type:t,streamName:r},n){return Millicast.wants(t,r)}}return RTS.events={},function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const r=e.flowplayer;"function"==typeof r?r(t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t))}(window,RTS),RTS}));
|
package/plugins/share.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.share=t())}(this,(function(){"use strict";const e={name:"fp-facebook"},t={name:"fp-link"},n={name:"fp-share"},s={name:"fp-embed"},o={name:"fp-twitter"};function i(e,t,n){const s=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;s.length;){if(null==e)return n;const t=s.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function r(){try{return(document.querySelector("meta[name='description']")||{content:""}).content}catch(e){return""}}function l(e){if("string"==typeof e.link)return e.link;const t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.toString()}class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),t.translation_key&&this.setAttribute("aria-label",e.i18n(t.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}const a=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const s=window.customElements.get(t);if(!s)throw new Error(`no default flowplayer component with the name ${t} exists`);const o=window.customElements.get(n);return"function"!=typeof o?s:o})(e._customElements,t))(e),c=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)},u="flowplayer-share-menu",m="fp-on",d="fp-invis";class FlowplayerMenu extends FlowplayerComponent{constructor(e){super(e),this.player=e,this.menuContainer=document.createElement("details"),this.summaryEle=document.createElement("summary"),this.olEle=document.createElement("ol"),this.olEle.id=h(),this.menu=document.createElement("div"),this.closeEle=document.createElement("span"),this.menu.classList.add("fp-menu"),this.menu.append(this.closeEle,this.olEle),this.closeEle.classList.add("fp-close"),this.closeEle.textContent="×",this.menuContainer.append(this.summaryEle,this.menu),this.menuContainer.addEventListener("click",t=>{t.preventDefault();const n=this.menuContainer.open;n||(p(),document.active_menu=this.menuContainer),this.menuContainer.open=!n,e.root.classList.toggle("has-menu-opened",!n),this.olEle.setAttribute("aria-expanded",n?"false":"true")}),this.append(this.menuContainer),this.summaryEle.setAttribute("aria-haspopup","true"),this.summaryEle.setAttribute("aria-controls",this.olEle.id),this.summaryEle.setAttribute("tabindex","0"),this.summaryEle.setAttribute("role","button")}get options(){return this.olEle.querySelectorAll("li")}setMenuAttrs(e){if(this.summaryEle.id||(this.summaryEle.id=e.id||h()),this.className=`${e.class} ${d}`,this.menuContainer.classList.add("fp-menu-container"),this.olEle.setAttribute("aria-labelledby",this.summaryEle.id),this.olEle.setAttribute("role","menu"),this.summaryEle.setAttribute("aria-label",e.menuTitle||"Menu"),e.summaryTitle&&(this.summaryEle.textContent=e.summaryTitle),e.summaryIcon){const t=a(this.player,e.summaryIcon);t.setAttribute("tabindex",""),this.summaryEle.append(t)}if(e.menuTitle){const t=document.createElement("h3");t.textContent=e.menuTitle,this.menu.prepend(t)}this.menu.classList.toggle("fp-icons",!!e.icons),this.addEventListener(e.options_event,e=>{this.render(e.data)}),e.item_selected_event&&this.addEventListener(e.item_selected_event,e=>{void 0!==e.data&&this.select_item(e.data.selected_index)})}render(e){this.olEle&&(this.olEle.innerHTML="",e&&e.forEach(this.menuOption,this),this.classList.toggle(d,!(null==e?void 0:e.length)))}menuOption(e,t){const n=document.createElement("li");n.setAttribute("role","menuitem"),n.setAttribute("tabindex","0"),e.icon&&n.append(e.icon);const s=document.createElement("span");s.textContent=e.text,n.append(s),n.addEventListener("click",()=>{this.select_item(t),"function"==typeof e.onclick&&e.onclick()}),this.olEle.appendChild(n)}select_item(e){this.options.forEach((t,n)=>{t.classList.toggle(m,n===e&&("flowplayer-subtitles-menu"!==this.localName||!t.classList.contains(m)))})}unselect_item(){this.options.forEach(e=>{e.classList.remove(m)})}}function p(){Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))})}function h(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function f(e,t,n){const s=function(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}(t,n);return e.dispatchEvent(s),e}function y(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}document.addEventListener("click",(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(p(),this.active_menu=void 0)})),function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();class Share{constructor(i){this.umd=i,this.share_options=[],c(i,u,FlowplayerMenu),c(this.umd,"flowplayer-facebook-icon",class extends FlowplayerIcon{constructor(t){super(t,e)}}),c(this.umd,"flowplayer-twitter-icon",class extends FlowplayerIcon{constructor(e){super(e,o)}}),c(this.umd,"flowplayer-link-icon",class extends FlowplayerIcon{constructor(e){super(e,t)}}),c(this.umd,"flowplayer-embed-icon",class extends FlowplayerIcon{constructor(e){super(e,s)}}),c(this.umd,"flowplayer-share-icon",class extends FlowplayerIcon{constructor(e){super(e,n)}})}init(e,t,n){const s=a(n,u);s instanceof FlowplayerMenu&&s.setMenuAttrs({menuTitle:n.i18n("share.menu_title"),class:"fp-share-menu fp-togglable",summaryIcon:"flowplayer-share-icon",icons:!0,options_event:Share.events.OPTIONS});const o={prev_config:0,webshare_listener:0};n.on("mount",(function(){var e;null===(e=y(n,"flowplayer-header-left-zone"))||void 0===e||e.append(s),s instanceof FlowplayerMenu&&s.menuContainer.addEventListener("toggle",(function(){t.classList.toggle("is-share-menu",this.open);const e=y(n,"flowplayer-control");this.open&&(t.classList.contains("is-small")?n.pause():e&&function(e,t){if(!t)return;e.menu.style.maxHeight=t.getBoundingClientRect().top+parseFloat(window.getComputedStyle(t).getPropertyValue("padding"))-e.menuContainer.getBoundingClientRect().bottom+"px"}(s,e))}))})),n.on("config",t=>{const c=i(t,"data.share",{});if(!1===c)return s instanceof FlowplayerMenu&&void s.classList.remove("webshare-enabled");if(o.prev_config===c)return;if(o.prev_config=c,s instanceof FlowplayerMenu&&function(){try{return"https:"===window.location.protocol&&"function"==typeof navigator.share}catch(e){return!1}}()&&i(c,"web_share",!0))return function(e){e.classList.add("webshare-enabled")}(s),o.webshare_listener||function(e,t,n){n.webshare_listener=!0,t.addEventListener("click",(function(){if(!t.classList.contains("webshare-enabled"))return;t.menuContainer.open=!1;navigator.share({title:i(e,"share.title",document.title),text:i(e,"share.text",r()),url:l(i(e,"share",{}))}).catch((function(){}))}))}(e,s,o);this.share_options=[];const u="string"==typeof c.link?c.link:window.location.toString();if(c.iframe){const e="string"==typeof c.iframe?c.iframe:u;this.share_options.push(w(n,s,"share.embed",g.bind(null,e,n),a(n,"flowplayer-embed-icon")))}c.link&&this.share_options.push(w(n,s,"share.link",_.bind(null,u),a(n,"flowplayer-link-icon"))),c.facebook&&this.share_options.push(w(n,s,"Facebook",v.bind(null,u),a(n,"flowplayer-facebook-icon"))),c.twitter&&this.share_options.push(w(n,s,"Twitter",x.bind(null,u),a(n,"flowplayer-twitter-icon"))),f(s,Share.events.OPTIONS,this.share_options)})}add_options(e,...t){const n=e.root.querySelector(u);n&&t.forEach(t=>{const s=w(e,n,t.text,t.onclick,t.icon);n.menuOption(s,n.options.length)})}}function w(e,t,n,s,o){return{text:b(e,n),icon:o,onclick:E.bind(null,e,t,s)}}function b(e,t){return 0===t.indexOf("share.")?e.i18n(t):t}function E(e,t,n){t instanceof FlowplayerMenu&&t.unselect_item();const s=n();s.success&&s.message&&e.message&&e.emit(e.message.events.SHOW_MESSAGE,{message:s.message})}function g(e,t){const n=t.videoHeight/t.videoWidth;return _('<div style="position:relative;width:100%;display:inline-block;"><iframe src="__IFRAME_SRC__" allowfullscreen style="border:none;position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top: __RATIO__%;"></div></div>'.replace("__IFRAME_SRC__",encodeURI(e)).replace("__RATIO__",""+100*n))}function _(e){const t=document.createElement("textarea");t.setAttribute("style","position:absolute;opacity:0"),t.value=e;const n=document.body;n.append(t),t.select();const s=document.execCommand("copy");return n.removeChild(t),{success:s,message:s?"<trans share.clipboard_success trans>":"<trans share.clipboard_failure trans>"}}function v(e){return A("https://www.facebook.com/sharer.php?u="+encodeURIComponent(e)),{success:!0}}function x(e){return A("https://twitter.com/intent/tweet?url="+encodeURIComponent(e)),{success:!0}}function A(e){let t;const n=screen.height,s=screen.width,o=Math.round(s/2-275);t=0,n>420&&(t=Math.round(n/2-210)),window.open(e,"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+o+",top="+t)}return Share.events={OPTIONS:"share:options"},function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Share),Share}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.share=t())}(this,(function(){"use strict";const e={name:"fp-facebook"},t={name:"fp-link"},n={name:"fp-share"},s={name:"fp-embed"},o={name:"fp-twitter"};function i(e,t,n){const s=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;s.length;){if(null==e)return n;const t=s.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function r(){try{return(document.querySelector("meta[name='description']")||{content:""}).content}catch(e){return""}}function l(e){if("string"==typeof e.link)return e.link;const t=document.querySelector("link[rel=canonical]");return t?t.href:window.location.toString()}class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),t.translation_key&&this.setAttribute("aria-label",e.i18n(t.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}const a=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const s=window.customElements.get(t);if(!s)throw new Error(`no default flowplayer component with the name ${t} exists`);const o=window.customElements.get(n);return"function"!=typeof o?s:o})(e._customElements,t))(e),c=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)},u="flowplayer-share-menu",m="fp-on",p="fp-invis";class FlowplayerMenu extends FlowplayerComponent{constructor(e){super(e),this.player=e,this.menuContainer=document.createElement("details"),this.summaryEle=document.createElement("summary"),this.olEle=document.createElement("ol"),this.olEle.id=h(),this.menu=document.createElement("div"),this.closeEle=document.createElement("span"),this.menu.classList.add("fp-menu"),this.menu.append(this.closeEle,this.olEle),this.closeEle.classList.add("fp-close"),this.closeEle.textContent="×",this.menuContainer.append(this.summaryEle,this.menu),this.menuContainer.addEventListener("click",t=>{t.preventDefault();const n=this.menuContainer.open;n||(d(),document.active_menu=this.menuContainer),this.menuContainer.open=!n,e.root.classList.toggle("has-menu-opened",!n),this.olEle.setAttribute("aria-expanded",n?"false":"true")}),this.append(this.menuContainer),this.summaryEle.setAttribute("aria-haspopup","true"),this.summaryEle.setAttribute("aria-controls",this.olEle.id),this.summaryEle.setAttribute("tabindex","0"),this.summaryEle.setAttribute("role","button")}get options(){return this.olEle.querySelectorAll("li")}setMenuAttrs(e){if(this.summaryEle.id||(this.summaryEle.id=e.id||h()),this.className=e.class,this.menuContainer.classList.add("fp-menu-container"),this.toggle_visibility(!0),this.olEle.setAttribute("aria-labelledby",this.summaryEle.id),this.olEle.setAttribute("role","menu"),this.summaryEle.setAttribute("aria-label",e.menuTitle||"Menu"),e.summaryTitle&&(this.summaryEle.textContent=e.summaryTitle),e.summaryIcon){const t=a(this.player,e.summaryIcon);t.setAttribute("tabindex",""),this.summaryEle.append(t)}if(e.menuTitle){const t=document.createElement("h3");t.textContent=e.menuTitle,this.menu.prepend(t)}this.menu.classList.toggle("fp-icons",!!e.icons),this.addEventListener(e.options_event,e=>{this.render(e.data)}),e.item_selected_event&&this.addEventListener(e.item_selected_event,e=>{void 0!==e.data&&this.select_item(e.data.selected_index)})}render(e){this.olEle&&(this.olEle.innerHTML="",e&&e.forEach(this.menuOption,this),this.toggle_visibility(!(null==e?void 0:e.length)))}menuOption(e,t){const n=document.createElement("li");n.setAttribute("role","menuitem"),n.setAttribute("tabindex","0"),e.icon&&n.append(e.icon);const s=document.createElement("span");s.textContent=e.text,n.append(s),n.addEventListener("click",()=>{this.select_item(t),"function"==typeof e.onclick&&e.onclick()}),this.olEle.appendChild(n)}select_item(e){this.options.forEach((t,n)=>{t.classList.toggle(m,n===e&&("flowplayer-subtitles-menu"!==this.localName||!t.classList.contains(m)))})}unselect_item(){this.options.forEach(e=>{e.classList.remove(m)})}toggle_visibility(e){this.classList.toggle(p,e),this.menu.style.setProperty("display",e?"none":"block")}}function d(){Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))})}function h(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function f(e,t,n){const s=function(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}(t,n);return e.dispatchEvent(s),e}function y(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}document.addEventListener("click",(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(d(),this.active_menu=void 0)})),function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();class Share{constructor(i){this.umd=i,this.share_options=[],c(i,u,FlowplayerMenu),c(this.umd,"flowplayer-facebook-icon",class extends FlowplayerIcon{constructor(t){super(t,e)}}),c(this.umd,"flowplayer-twitter-icon",class extends FlowplayerIcon{constructor(e){super(e,o)}}),c(this.umd,"flowplayer-link-icon",class extends FlowplayerIcon{constructor(e){super(e,t)}}),c(this.umd,"flowplayer-embed-icon",class extends FlowplayerIcon{constructor(e){super(e,s)}}),c(this.umd,"flowplayer-share-icon",class extends FlowplayerIcon{constructor(e){super(e,n)}})}init(e,t,n){const s=a(n,u);s instanceof FlowplayerMenu&&s.setMenuAttrs({menuTitle:n.i18n("share.menu_title"),class:"fp-share-menu fp-togglable",summaryIcon:"flowplayer-share-icon",icons:!0,options_event:Share.events.OPTIONS});const o={prev_config:0,webshare_listener:0};n.on("mount",(function(){var e;null===(e=y(n,"flowplayer-header-left-zone"))||void 0===e||e.append(s),s instanceof FlowplayerMenu&&s.menuContainer.addEventListener("toggle",(function(){t.classList.toggle("is-share-menu",this.open);const e=y(n,"flowplayer-control");this.open&&(t.classList.contains("is-small")?n.pause():e&&function(e,t){if(!t)return;e.menu.style.maxHeight=t.getBoundingClientRect().top+parseFloat(window.getComputedStyle(t).getPropertyValue("padding"))-e.menuContainer.getBoundingClientRect().bottom+"px"}(s,e))}))})),n.on("config",t=>{const c=i(t,"data.share",{});if(!1===c)return s instanceof FlowplayerMenu&&void s.classList.remove("webshare-enabled");if(o.prev_config===c)return;if(o.prev_config=c,s instanceof FlowplayerMenu&&function(){try{return"https:"===window.location.protocol&&"function"==typeof navigator.share}catch(e){return!1}}()&&i(c,"web_share",!0))return function(e){e.classList.add("webshare-enabled")}(s),o.webshare_listener||function(e,t,n){n.webshare_listener=!0,t.addEventListener("click",(function(){if(!t.classList.contains("webshare-enabled"))return;t.menuContainer.open=!1;navigator.share({title:i(e,"share.title",document.title),text:i(e,"share.text",r()),url:l(i(e,"share",{}))}).catch((function(){}))}))}(e,s,o);this.share_options=[];const u="string"==typeof c.link?c.link:window.location.toString();if(c.iframe){const e="string"==typeof c.iframe?c.iframe:u;this.share_options.push(w(n,s,"share.embed",E.bind(null,e,n),a(n,"flowplayer-embed-icon")))}c.link&&this.share_options.push(w(n,s,"share.link",_.bind(null,u),a(n,"flowplayer-link-icon"))),c.facebook&&this.share_options.push(w(n,s,"Facebook",v.bind(null,u),a(n,"flowplayer-facebook-icon"))),c.twitter&&this.share_options.push(w(n,s,"Twitter",x.bind(null,u),a(n,"flowplayer-twitter-icon"))),f(s,Share.events.OPTIONS,this.share_options)})}add_options(e,...t){const n=e.root.querySelector(u);n&&t.forEach(t=>{const s=w(e,n,t.text,t.onclick,t.icon);n.menuOption(s,n.options.length)})}}function w(e,t,n,s,o){return{text:b(e,n),icon:o,onclick:g.bind(null,e,t,s)}}function b(e,t){return 0===t.indexOf("share.")?e.i18n(t):t}function g(e,t,n){t instanceof FlowplayerMenu&&t.unselect_item();const s=n();s.success&&s.message&&e.message&&e.emit(e.message.events.SHOW_MESSAGE,{message:s.message})}function E(e,t){const n=t.videoHeight/t.videoWidth;return _('<div style="position:relative;width:100%;display:inline-block;"><iframe src="__IFRAME_SRC__" allowfullscreen style="border:none;position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top: __RATIO__%;"></div></div>'.replace("__IFRAME_SRC__",encodeURI(e)).replace("__RATIO__",""+100*n))}function _(e){const t=document.createElement("textarea");t.setAttribute("style","position:absolute;opacity:0"),t.value=e;const n=document.body;n.append(t),t.select();const s=document.execCommand("copy");return n.removeChild(t),{success:s,message:s?"<trans share.clipboard_success trans>":"<trans share.clipboard_failure trans>"}}function v(e){return A("https://www.facebook.com/sharer.php?u="+encodeURIComponent(e)),{success:!0}}function x(e){return A("https://twitter.com/intent/tweet?url="+encodeURIComponent(e)),{success:!0}}function A(e){let t;const n=screen.height,s=screen.width,o=Math.round(s/2-275);t=0,n>420&&(t=Math.round(n/2-210)),window.open(e,"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+o+",top="+t)}return Share.events={OPTIONS:"share:options"},function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Share),Share}));
|
package/plugins/speed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.speed=t())}(this,(function(){"use strict";function e(e,t,n){const s=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;s.length;){if(null==e)return n;const t=s.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}const t="flowplayer-speed-menu",n=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const s=window.customElements.get(t);if(!s)throw new Error(`no default flowplayer component with the name ${t} exists`);const
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.speed=t())}(this,(function(){"use strict";function e(e,t,n){const s=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;s.length;){if(null==e)return n;const t=s.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}const t="flowplayer-speed-menu",n=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const s=window.customElements.get(t);if(!s)throw new Error(`no default flowplayer component with the name ${t} exists`);const i=window.customElements.get(n);return"function"!=typeof i?s:i})(e._customElements,t))(e),s="fp-on",i="fp-invis";class FlowplayerMenu extends FlowplayerComponent{constructor(e){super(e),this.player=e,this.menuContainer=document.createElement("details"),this.summaryEle=document.createElement("summary"),this.olEle=document.createElement("ol"),this.olEle.id=l(),this.menu=document.createElement("div"),this.closeEle=document.createElement("span"),this.menu.classList.add("fp-menu"),this.menu.append(this.closeEle,this.olEle),this.closeEle.classList.add("fp-close"),this.closeEle.textContent="×",this.menuContainer.append(this.summaryEle,this.menu),this.menuContainer.addEventListener("click",t=>{t.preventDefault();const n=this.menuContainer.open;n||(o(),document.active_menu=this.menuContainer),this.menuContainer.open=!n,e.root.classList.toggle("has-menu-opened",!n),this.olEle.setAttribute("aria-expanded",n?"false":"true")}),this.append(this.menuContainer),this.summaryEle.setAttribute("aria-haspopup","true"),this.summaryEle.setAttribute("aria-controls",this.olEle.id),this.summaryEle.setAttribute("tabindex","0"),this.summaryEle.setAttribute("role","button")}get options(){return this.olEle.querySelectorAll("li")}setMenuAttrs(e){if(this.summaryEle.id||(this.summaryEle.id=e.id||l()),this.className=e.class,this.menuContainer.classList.add("fp-menu-container"),this.toggle_visibility(!0),this.olEle.setAttribute("aria-labelledby",this.summaryEle.id),this.olEle.setAttribute("role","menu"),this.summaryEle.setAttribute("aria-label",e.menuTitle||"Menu"),e.summaryTitle&&(this.summaryEle.textContent=e.summaryTitle),e.summaryIcon){const t=n(this.player,e.summaryIcon);t.setAttribute("tabindex",""),this.summaryEle.append(t)}if(e.menuTitle){const t=document.createElement("h3");t.textContent=e.menuTitle,this.menu.prepend(t)}this.menu.classList.toggle("fp-icons",!!e.icons),this.addEventListener(e.options_event,e=>{this.render(e.data)}),e.item_selected_event&&this.addEventListener(e.item_selected_event,e=>{void 0!==e.data&&this.select_item(e.data.selected_index)})}render(e){this.olEle&&(this.olEle.innerHTML="",e&&e.forEach(this.menuOption,this),this.toggle_visibility(!(null==e?void 0:e.length)))}menuOption(e,t){const n=document.createElement("li");n.setAttribute("role","menuitem"),n.setAttribute("tabindex","0"),e.icon&&n.append(e.icon);const s=document.createElement("span");s.textContent=e.text,n.append(s),n.addEventListener("click",()=>{this.select_item(t),"function"==typeof e.onclick&&e.onclick()}),this.olEle.appendChild(n)}select_item(e){this.options.forEach((t,n)=>{t.classList.toggle(s,n===e&&("flowplayer-subtitles-menu"!==this.localName||!t.classList.contains(s)))})}unselect_item(){this.options.forEach(e=>{e.classList.remove(s)})}toggle_visibility(e){this.classList.toggle(i,e),this.menu.style.setProperty("display",e?"none":"block")}}function o(){Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))})}function l(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function r(e,t,n){const s=function(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}(t,n);return e.dispatchEvent(s),e}document.addEventListener("click",(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(o(),this.active_menu=void 0)})),function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();class Speed{constructor(e){((e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)})(e,t,FlowplayerMenu)}init(s,i,o){let l=void 0;const u=n(o,t);u instanceof FlowplayerMenu&&u.setMenuAttrs({menuTitle:o.i18n("speed.menu_title"),summaryTitle:"1x",class:"fp-speed",options_event:Speed.events.OPTIONS}),o.on("config",()=>{const t=e(s,"speed",!0);if(t===l)return;if(l=t,0==t)return r(u,Speed.events.OPTIONS,[]);const n=e(s,"speed.options",Speed.DEFAULT_SPEED_OPTIONS),i=e(s,"speed.labels",[]);r(u,Speed.events.OPTIONS,Array.from({length:n.length}).map((e,t)=>{const s=n[t];return{text:i[t]||s+"x",onclick:a.bind(0,o,s)}}))}),o.on("mount",(function(){var e;null===(e=function(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}(o,"flowplayer-control"))||void 0===e||e.append(u)}))}}function a(e,n){var s;const i=null===(s=e.root.querySelector(t))||void 0===s?void 0:s.summaryEle;i&&(i.textContent=n+"x"),isNaN(n)||(e.playbackRate=n)}return Speed.DEFAULT_SPEED_OPTIONS=[.2,.5,1,2,10],Speed.events={OPTIONS:"speed:options"},function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}(window,Speed)}));
|