Files
mainsail/assets/JanusStreamer-CQyYvBpk.js
2025-04-29 17:05:55 +09:00

9 lines
220 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{m as ov,B as sv,H as av,P as Gu,R as uv,W as cv,C as fv,n as lv}from"./index-Bku7SJna.js";import{a as Wu,c as Kn}from"./overlayscrollbars-CiKU261J.js";import{a4 as Mo,a5 as Lo,a6 as ko,a7 as er}from"./echarts-DzoUeqWp.js";import{m as dv,n as pv,r as hv}from"./vuetify-Ce4WN_Dg.js";function gv(i,s){for(var n=0;n<s.length;n++){const o=s[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in i)){const u=Object.getOwnPropertyDescriptor(o,a);u&&Object.defineProperty(i,a,u.get?u:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}f.sessions=new Map;f.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){let i=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),s=33;return window.navigator.userAgent.match("Linux")&&(s=35),i>=26&&i<=s?!0:f.extension.isInstalled()}else return!0};var Bu={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return document.querySelector("#janus-extension-installed")!==null},getScreen:function(i){let s=window.setTimeout(function(){let n=new Error("NavigatorUserMediaError");return n.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',i(n)},1e3);this.cache[s]=i,window.postMessage({type:"janusGetScreen",id:s},"*")},init:function(){let i={};this.cache=i,window.addEventListener("message",function(s){if(s.origin==window.location.origin)if(s.data.type=="janusGotScreen"&&i[s.data.id]){let n=i[s.data.id];if(delete i[s.data.id],s.data.sourceId===""){let o=new Error("NavigatorUserMediaError");o.name="You cancelled the request for permission, giving up...",n(o)}else n(null,s.data.sourceId)}else s.data.type=="janusGetScreenPending"&&window.clearTimeout(s.data.id)})}};f.useDefaultDependencies=function(i){let s=i&&i.fetch||fetch,n=i&&i.Promise||Promise,o=i&&i.WebSocket||WebSocket;return{newWebSocket:function(a,u){return new o(a,u)},extension:i&&i.extension||Bu,isArray:function(a){return Array.isArray(a)},webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(a,u){let p={method:u.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};u.verb==="POST"&&(p.headers["Content-Type"]="application/json"),typeof u.withCredentials<"u"&&(p.credentials=u.withCredentials===!0?"include":u.withCredentials?u.withCredentials:"omit"),u.body&&(p.body=JSON.stringify(u.body));let m=s(a,p).catch(function(T){return n.reject({message:"Probably a network error, is the server down?",error:T})});if(u.timeout){let T=new n(function(l,_){let D=setTimeout(function(){return clearTimeout(D),_({message:"Request timed out",timeout:u.timeout})},u.timeout)});m=n.race([m,T])}return m.then(function(T){if(T.ok){if(typeof u.success==typeof f.noop)return T.json().then(function(l){try{u.success(l)}catch(_){f.error("Unhandled httpAPICall success callback error",_)}},function(l){return n.reject({message:"Failed to parse response body",error:l,response:T})})}else return n.reject({message:"API call failed",response:T})}).catch(function(T){typeof u.error==typeof f.noop&&u.error(T.message||"<< internal error >>",T)}),m}}};f.useOldDependencies=function(i){let s=i&&i.jQuery||jQuery,n=i&&i.WebSocket||WebSocket;return{newWebSocket:function(o,a){return new n(o,a)},isArray:function(o){return s.isArray(o)},extension:i&&i.extension||Bu,webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(o,a){let u=typeof a.body<"u"?{contentType:"application/json",data:JSON.stringify(a.body)}:{},p=typeof a.withCredentials<"u"?{xhrFields:{withCredentials:a.withCredentials}}:{};return s.ajax(s.extend(u,p,{url:o,type:a.verb,cache:!1,dataType:"json",async:a.async,timeout:a.timeout,success:function(m){typeof a.success==typeof f.noop&&a.success(m)},error:function(m,T,l){typeof a.error==typeof f.noop&&a.error(T,l)}}))}}};f.mediaToTracks=function(i){let s=[];if(!i)s.push({type:"audio",capture:!0,recv:!0}),s.push({type:"video",capture:!0,recv:!0});else{if(!i.keepAudio&&i.audio!==!1&&(typeof i.audio>"u"||i.audio||i.audioSend||i.audioRecv||i.addAudio||i.replaceAudio||i.removeAudio)){let n={type:"audio"};i.removeAudio?n.remove=!0:(i.addAudio?n.add=!0:i.replaceAudio&&(n.replace=!0),i.audioSend!==!1&&(n.capture=i.audio||!0),i.audioRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}if(!i.keepVideo&&i.video!==!1&&(typeof i.video>"u"||i.video||i.videoSend||i.videoRecv||i.addVideo||i.replaceVideo||i.removeVideo)){let n={type:"video"};i.removeVideo?n.remove=!0:(i.addVideo?n.add=!0:i.replaceVideo&&(n.replace=!0),i.videoSend!==!1&&(n.capture=i.video||!0,["screen","window","desktop"].includes(n.capture)&&(n.type="screen",n.capture={video:{}},i.screenshareFrameRate&&(n.capture.frameRate=i.screenshareFrameRate),i.screenshareHeight&&(n.capture.height=i.screenshareHeight),i.screenshareWidth&&(n.capture.width=i.screenshareWidth))),i.videoRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}i.data&&s.push({type:"data"})}return s};f.trackConstraints=function(i){let s={};if(!i||!i.capture)return s;if(i.type==="audio")s.audio=i.capture;else if(i.type==="video")if((i.simulcast||i.svc)&&i.capture===!0&&(i.capture="hires"),i.capture===!0||typeof i.capture=="object")s.video=i.capture;else{let n=0,o=0;i.capture==="lowres"?(n=320,o=240):i.capture==="lowres-16:9"?(n=320,o=180):i.capture==="hires"||i.capture==="hires-16:9"||i.capture==="hdres"?(n=1280,o=720):i.capture==="fhdres"?(n=1920,o=1080):i.capture==="4kres"?(n=3840,o=2160):i.capture==="stdres"?(n=640,o=480):i.capture==="stdres-16:9"?(n=640,o=360):(f.log("Default video setting is stdres 4:3"),n=640,o=480),s.video={width:{ideal:n},height:{ideal:o}}}else i.type==="screen"&&(s.video=i.capture);return s};f.noop=function(){};f.dataChanDefaultLabel="JanusDataChannel";f.endOfCandidates=null;f.stopAllTracks=function(i){try{let s=i.getTracks();for(let n of s)f.log(n),n&&n.dontStop!==!0&&n.stop()}catch{}};f.init=function(i){if(i=i||{},i.callback=typeof i.callback=="function"?i.callback:f.noop,f.initDone)i.callback();else{if(typeof console.log>"u"&&(console.log=function(){}),f.trace=f.noop,f.debug=f.noop,f.vdebug=f.noop,f.log=f.noop,f.warn=f.noop,f.error=f.noop,i.debug===!0||i.debug==="all")f.trace=console.trace.bind(console),f.debug=console.debug.bind(console),f.vdebug=console.debug.bind(console),f.log=console.log.bind(console),f.warn=console.warn.bind(console),f.error=console.error.bind(console);else if(Array.isArray(i.debug))for(let u of i.debug)switch(u){case"trace":f.trace=console.trace.bind(console);break;case"debug":f.debug=console.debug.bind(console);break;case"vdebug":f.vdebug=console.debug.bind(console);break;case"log":f.log=console.log.bind(console);break;case"warn":f.warn=console.warn.bind(console);break;case"error":f.error=console.error.bind(console);break}f.log("Initializing library");let s=i.dependencies||f.useDefaultDependencies();f.isArray=s.isArray,f.webRTCAdapter=s.webRTCAdapter,f.httpAPICall=s.httpAPICall,f.newWebSocket=s.newWebSocket,f.extension=s.extension,f.extension.init(),f.listDevices=function(u,p){u=typeof u=="function"?u:f.noop,p||(p={audio:!0,video:!0}),f.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(p).then(function(m){navigator.mediaDevices.enumerateDevices().then(function(T){f.debug(T),u(T),f.stopAllTracks(m)})}).catch(function(m){f.error(m),u([])}):(f.warn("navigator.mediaDevices unavailable"),u([]))},f.attachMediaStream=function(u,p){try{u.srcObject=p}catch{try{u.src=URL.createObjectURL(p)}catch(T){f.error("Error attaching stream to element",T)}}},f.reattachMediaStream=function(u,p){try{u.srcObject=p.srcObject}catch{try{u.src=p.src}catch(T){f.error("Error reattaching stream to element",T)}}};let o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,function(){f.log("Closing window");for(const[u,p]of f.sessions)p&&p.destroyOnUnload&&(f.log("Destroying session "+u),p.destroy({unload:!0,notifyDestroyed:!1}));a&&typeof a=="function"&&a()}),f.safariVp8=!1,f.safariVp9=!1,f.webRTCAdapter.browserDetails.browser==="safari"&&f.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(let u of RTCRtpSender.getCapabilities("video").codecs)u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp8"?f.safariVp8=!0:u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp9"&&(f.safariVp9=!0);f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{let u=new RTCPeerConnection({});u.createOffer({offerToReceiveVideo:!0}).then(function(p){f.safariVp8=p.sdp.indexOf("VP8")!==-1,f.safariVp9=p.sdp.indexOf("VP9")!==-1,f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),u.close(),u=null})}f.initDone=!0,i.callback()}};f.isWebrtcSupported=function(){return!!window.RTCPeerConnection};f.isGetUserMediaAvailable=function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia};f.randomString=function(i){let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let o=0;o<i;o++){let a=Math.floor(Math.random()*s.length);n+=s.charAt(a)}return n};function f(i){if(i=i||{},i.success=typeof i.success=="function"?i.success:f.noop,i.error=typeof i.error=="function"?i.error:f.noop,i.destroyed=typeof i.destroyed=="function"?i.destroyed:f.noop,!f.initDone)return i.error("Library not initialized"),{};if(!f.isWebrtcSupported())return i.error("WebRTC not supported by this browser"),{};if(f.log("Library initialized: "+f.initDone),!i.server)return i.error("Invalid server url"),{};let s=!1,n=null,o={},a=null,u=null,p=0,m=i.server;f.isArray(m)?(f.log("Multiple servers provided ("+m.length+"), will use the first that works"),m=null,u=i.server,f.debug(u)):m.indexOf("ws")===0?(s=!0,f.log("Using WebSockets to contact Janus: "+m)):(s=!1,f.log("Using REST API to contact Janus: "+m));let T=i.iceServers||[{urls:"stun:stun.l.google.com:19302"}],l=i.iceTransportPolicy,_=i.bundlePolicy,D=!1;typeof i.withCredentials<"u"&&i.withCredentials!==null&&(D=i.withCredentials===!0);let H=10;typeof i.max_poll_events<"u"&&i.max_poll_events!==null&&(H=i.max_poll_events),H<1&&(H=1);let z=null;typeof i.token<"u"&&i.token!==null&&(z=i.token);let j=null;typeof i.apisecret<"u"&&i.apisecret!==null&&(j=i.apisecret),this.destroyOnUnload=!0,typeof i.destroyOnUnload<"u"&&i.destroyOnUnload!==null&&(this.destroyOnUnload=i.destroyOnUnload===!0);let ee=25e3;typeof i.keepAlivePeriod<"u"&&i.keepAlivePeriod!==null&&(ee=i.keepAlivePeriod),isNaN(ee)&&(ee=25e3);let xe=6e4;typeof i.longPollTimeout<"u"&&i.longPollTimeout!==null&&(xe=i.longPollTimeout),isNaN(xe)&&(xe=6e4);function ot(v){let C={high:9e5,medium:3e5,low:1e5};return typeof v<"u"&&v!==null&&(v.high&&(C.high=v.high),v.medium&&(C.medium=v.medium),v.low&&(C.low=v.low)),C}let _e=!1,$=null,X=new Map,Ie=this,st=0,me=new Map;dn(i),this.getServer=function(){return m},this.isConnected=function(){return _e},this.reconnect=function(v){v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,v.reconnect=!0,dn(v)},this.getSessionId=function(){return $},this.getInfo=function(v){pi(v)},this.destroy=function(v){hi(v)},this.attach=function(v){rr(v)};function ht(){if($==null)return;if(f.debug("Long poll..."),!_e){f.warn("Is the server down? (connected=false)");return}let v=m+"/"+$+"?rid="+new Date().getTime();H&&(v=v+"&maxev="+H),z&&(v=v+"&token="+encodeURIComponent(z)),j&&(v=v+"&apisecret="+encodeURIComponent(j)),f.httpAPICall(v,{verb:"GET",withCredentials:D,success:Zt,timeout:xe,error:function(C,b){if(f.error(C+":",b),st++,st>3){_e=!1,i.error("Lost connection to the server (is it down?)");return}ht()}})}function Zt(v,C){if(st=0,!s&&typeof $<"u"&&$!==null&&C!==!0&&ht(),!s&&f.isArray(v)){for(let b=0;b<v.length;b++)Zt(v[b],!0);return}if(v.janus==="keepalive"){f.vdebug("Got a keepalive on session "+$);return}else if(v.janus==="server_info"){f.debug("Got info on the Janus instance"),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="ack"){f.debug("Got an ack on session "+$),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="success"){f.debug("Got a success on session "+$),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="trickle"){const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}let O=v.candidate;f.debug("Got a trickled candidate on session "+$),f.debug(O);let I=y.webrtcStuff;I.pc&&I.remoteSdp?(f.debug("Adding remote candidate:",O),!O||O.completed===!0?I.pc.addIceCandidate(f.endOfCandidates):I.pc.addIceCandidate(O)):(f.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),I.candidates||(I.candidates=[]),I.candidates.push(O),f.debug(I.candidates))}else if(v.janus==="webrtcup"){f.debug("Got a webrtcup event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.webrtcState(!0);return}else if(v.janus==="hangup"){f.debug("Got a hangup event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.webrtcState(!1,v.reason),y.hangup()}else if(v.janus==="detached"){f.debug("Got a detached event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y)return;y.ondetached(),y.detach()}else if(v.janus==="media"){f.debug("Got a media event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.mediaState(v.type,v.receiving,v.mid)}else if(v.janus==="slowlink"){f.debug("Got a slowlink event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.slowLink(v.uplink,v.lost,v.mid)}else if(v.janus==="error"){f.error("Ooops: "+v.error.code+" "+v.error.reason),f.debug(v);let b=v.transaction;if(b){let y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="event"){f.debug("Got a plugin event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}let y=v.plugindata;if(!y){f.warn("Missing plugindata...");return}f.debug(" -- Event is coming from "+b+" ("+y.plugin+")");let O=y.data;f.debug(O);const I=X.get(b);if(!I){f.warn("This handle is not attached to this session");return}let w=v.jsep;w&&(f.debug("Handling SDP as well..."),f.debug(w));let W=I.onmessage;W?(f.debug("Notifying application..."),W(O,w)):f.debug("No provided notification callback")}else if(v.janus==="timeout"){f.error("Timeout on session "+$),f.debug(v),s&&n.close(3504,"Gateway timeout");return}else f.warn("Unknown message/event '"+v.janus+"' on session "+$),f.debug(v)}function nr(){if(!m||!s||!_e)return;a=setTimeout(nr,ee);let v={janus:"keepalive",session_id:$,transaction:f.randomString(12)};z&&(v.token=z),j&&(v.apisecret=j),n.send(JSON.stringify(v))}function dn(v){let C=f.randomString(12),b={janus:"create",transaction:C};if(v.reconnect&&(_e=!1,b.janus="claim",b.session_id=$,n&&(n.onopen=null,n.onerror=null,n.onclose=null,a&&(clearTimeout(a),a=null))),z&&(b.token=z),j&&(b.apisecret=j),!m&&f.isArray(u)&&(m=u[p],m.indexOf("ws")===0?(s=!0,f.log("Server #"+(p+1)+": trying WebSockets to contact Janus ("+m+")")):(s=!1,f.log("Server #"+(p+1)+": trying REST API to contact Janus ("+m+")"))),s){n=f.newWebSocket(m,"janus-protocol"),o={error:function(){if(f.error("Error connecting to the Janus WebSockets server... "+m),f.isArray(u)&&!v.reconnect){if(p++,p===u.length){v.error("Error connecting to any of the provided Janus servers: Is the server down?");return}m=null,setTimeout(function(){dn(v)},200);return}v.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){me.set(C,function(y){if(f.debug(y),y.janus!=="success"){f.error("Ooops: "+y.error.code+" "+y.error.reason),v.error(y.error.reason);return}a=setTimeout(nr,ee),_e=!0,$=y.session_id?y.session_id:y.data.id,v.reconnect?f.log("Claimed session: "+$):f.log("Created session: "+$),f.sessions.set($,Ie),v.success()}),n.send(JSON.stringify(b))},message:function(y){Zt(JSON.parse(y.data))},close:function(){!m||!_e||(_e=!1,i.error("Lost connection to the server (is it down?)"))}};for(let y in o)n.addEventListener(y,o[y]);return}f.httpAPICall(m,{verb:"POST",withCredentials:D,body:b,success:function(y){if(f.debug(y),y.janus!=="success"){f.error("Ooops: "+y.error.code+" "+y.error.reason),v.error(y.error.reason);return}_e=!0,$=y.session_id?y.session_id:y.data.id,v.reconnect?f.log("Claimed session: "+$):f.log("Created session: "+$),f.sessions.set($,Ie),ht(),v.success()},error:function(y,O){if(f.error(y+":",O),f.isArray(u)&&!v.reconnect){if(p++,p===u.length){v.error("Error connecting to any of the provided Janus servers: Is the server down?");return}m=null,setTimeout(function(){dn(v)},200);return}O===""?v.error(y+": Is the server down?"):O&&O.error?v.error(y+": "+O.error.message):v.error(y+": "+O)}})}function pi(v){if(v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,f.log("Getting info on Janus instance"),!_e){f.warn("Is the server down? (connected=false)"),v.error("Is the server down? (connected=false)");return}let C=f.randomString(12),b={janus:"info",transaction:C};if(z&&(b.token=z),j&&(b.apisecret=j),s){me.set(C,function(y){f.log("Server info:"),f.debug(y),y.janus!=="server_info"&&f.error("Ooops: "+y.error.code+" "+y.error.reason),v.success(y)}),n.send(JSON.stringify(b));return}f.httpAPICall(m,{verb:"POST",withCredentials:D,body:b,success:function(y){f.log("Server info:"),f.debug(y),y.janus!=="server_info"&&f.error("Ooops: "+y.error.code+" "+y.error.reason),v.success(y)},error:function(y,O){f.error(y+":",O),O===""?v.error(y+": Is the server down?"):v.error(y+": "+O)}})}function hi(v){v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop;let C=v.unload===!0,b=!0;typeof v.notifyDestroyed<"u"&&v.notifyDestroyed!==null&&(b=v.notifyDestroyed===!0);let y=v.cleanupHandles===!0;if(f.log("Destroying session "+$+" (unload="+C+")"),!$){f.warn("No session to destroy"),v.success(),b&&i.destroyed();return}if(y)for(const I of X.keys())Lt(I,{noRequest:!0});if(!_e){f.warn("Is the server down? (connected=false)"),$=null,v.success();return}let O={janus:"destroy",transaction:f.randomString(12)};if(z&&(O.token=z),j&&(O.apisecret=j),C){s?(n.onclose=null,n.close(),n=null):navigator.sendBeacon(m+"/"+$,JSON.stringify(O)),f.log("Destroyed session:"),$=null,_e=!1,v.success(),b&&i.destroyed();return}if(s){O.session_id=$;let I=function(){for(let F in o)n.removeEventListener(F,o[F]);n.removeEventListener("message",w),n.removeEventListener("error",W),a&&clearTimeout(a),n.close()},w=function(F){let x=JSON.parse(F.data);x.session_id==O.session_id&&x.transaction==O.transaction&&(I(),v.success(),b&&i.destroyed())},W=function(){I(),v.error("Failed to destroy the server: Is the server down?"),b&&i.destroyed()};n.addEventListener("message",w),n.addEventListener("error",W),n.readyState===1?n.send(JSON.stringify(O)):W();return}f.httpAPICall(m+"/"+$,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed session:"),f.debug(I),$=null,_e=!1,I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),v.success(),b&&i.destroyed()},error:function(I,w){f.error(I+":",w),$=null,_e=!1,v.success(),b&&i.destroyed()}})}function rr(v){if(v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,v.dataChannelOptions=v.dataChannelOptions||{ordered:!0},v.consentDialog=typeof v.consentDialog=="function"?v.consentDialog:f.noop,v.iceState=typeof v.iceState=="function"?v.iceState:f.noop,v.mediaState=typeof v.mediaState=="function"?v.mediaState:f.noop,v.webrtcState=typeof v.webrtcState=="function"?v.webrtcState:f.noop,v.slowLink=typeof v.slowLink=="function"?v.slowLink:f.noop,v.onmessage=typeof v.onmessage=="function"?v.onmessage:f.noop,v.onlocaltrack=typeof v.onlocaltrack=="function"?v.onlocaltrack:f.noop,v.onremotetrack=typeof v.onremotetrack=="function"?v.onremotetrack:f.noop,v.ondata=typeof v.ondata=="function"?v.ondata:f.noop,v.ondataopen=typeof v.ondataopen=="function"?v.ondataopen:f.noop,v.oncleanup=typeof v.oncleanup=="function"?v.oncleanup:f.noop,v.ondetached=typeof v.ondetached=="function"?v.ondetached:f.noop,!_e){f.warn("Is the server down? (connected=false)"),v.error("Is the server down? (connected=false)");return}let C=v.plugin;if(!C){f.error("Invalid plugin"),v.error("Invalid plugin");return}let b=v.opaqueId,y=v.loopIndex,O=v.token?v.token:z,I=f.randomString(12),w={janus:"attach",plugin:C,opaque_id:b,loop_index:y,transaction:I};if(O&&(w.token=O),j&&(w.apisecret=j),s){me.set(I,function(W){if(f.debug(W),W.janus!=="success"){f.error("Ooops: "+W.error.code+" "+W.error.reason),v.error("Ooops: "+W.error.code+" "+W.error.reason);return}let F=W.data.id;f.log("Created handle: "+F);let x={session:Ie,plugin:C,id:F,token:O,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,mySdp:null,mediaConstraints:null,pc:null,dataChannelOptions:v.dataChannelOptions,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,bitrate:{}},getId:function(){return F},getPlugin:function(){return C},getVolume:function(A,B){return at(F,A,!0,B)},getRemoteVolume:function(A,B){return at(F,A,!0,B)},getLocalVolume:function(A,B){return at(F,A,!1,B)},isAudioMuted:function(A){return bt(F,A,!1)},muteAudio:function(A){return ut(F,A,!1,!0)},unmuteAudio:function(A){return ut(F,A,!1,!1)},isVideoMuted:function(A){return bt(F,A,!0)},muteVideo:function(A){return ut(F,A,!0,!0)},unmuteVideo:function(A){return ut(F,A,!0,!1)},getBitrate:function(A){return Ne(F,A)},setMaxBitrate:function(A,B){return Ft(F,A,B)},send:function(A){ir(F,A)},data:function(A){St(F,A)},dtmf:function(A){sr(F,A)},consentDialog:v.consentDialog,iceState:v.iceState,mediaState:v.mediaState,webrtcState:v.webrtcState,slowLink:v.slowLink,onmessage:v.onmessage,createOffer:function(A){pn(F,!0,A)},createAnswer:function(A){pn(F,!1,A)},handleRemoteJsep:function(A){ar(F,A)},replaceTracks:function(A){ur(F,A)},getLocalTracks:function(){return Ut(F)},getRemoteTracks:function(){return cr(F)},onlocaltrack:v.onlocaltrack,onremotetrack:v.onremotetrack,ondata:v.ondata,ondataopen:v.ondataopen,oncleanup:v.oncleanup,ondetached:v.ondetached,hangup:function(A){qe(F,A===!0)},detach:function(A){Lt(F,A)}};X.set(F,x),v.success(x)}),w.session_id=$,n.send(JSON.stringify(w));return}f.httpAPICall(m+"/"+$,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug(W),W.janus!=="success"){f.error("Ooops: "+W.error.code+" "+W.error.reason),v.error("Ooops: "+W.error.code+" "+W.error.reason);return}let F=W.data.id;f.log("Created handle: "+F);let x={session:Ie,plugin:C,id:F,token:O,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,mySdp:null,mediaConstraints:null,pc:null,dataChannelOptions:v.dataChannelOptions,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,bitrate:{}},getId:function(){return F},getPlugin:function(){return C},getVolume:function(A,B){return at(F,A,!0,B)},getRemoteVolume:function(A,B){return at(F,A,!0,B)},getLocalVolume:function(A,B){return at(F,A,!1,B)},isAudioMuted:function(A){return bt(F,A,!1)},muteAudio:function(A){return ut(F,A,!1,!0)},unmuteAudio:function(A){return ut(F,A,!1,!1)},isVideoMuted:function(A){return bt(F,A,!0)},muteVideo:function(A){return ut(F,A,!0,!0)},unmuteVideo:function(A){return ut(F,A,!0,!1)},getBitrate:function(A){return Ne(F,A)},setMaxBitrate:function(A,B){return Ft(F,A,B)},send:function(A){ir(F,A)},data:function(A){St(F,A)},dtmf:function(A){sr(F,A)},consentDialog:v.consentDialog,iceState:v.iceState,mediaState:v.mediaState,webrtcState:v.webrtcState,slowLink:v.slowLink,onmessage:v.onmessage,createOffer:function(A){pn(F,!0,A)},createAnswer:function(A){pn(F,!1,A)},handleRemoteJsep:function(A){ar(F,A)},replaceTracks:function(A){ur(F,A)},getLocalTracks:function(){return Ut(F)},getRemoteTracks:function(){return cr(F)},onlocaltrack:v.onlocaltrack,onremotetrack:v.onremotetrack,ondata:v.ondata,ondataopen:v.ondataopen,oncleanup:v.oncleanup,ondetached:v.ondetached,hangup:function(A){qe(F,A===!0)},detach:function(A){Lt(F,A)}};X.set(F,x),v.success(x)},error:function(W,F){f.error(W+":",F),F===""?v.error(W+": Is the server down?"):v.error(W+": "+F)}})}function ir(v,C){if(C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop,!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=C.message,O=C.jsep,I=f.randomString(12),w={janus:"message",body:y,transaction:I};if(b.token&&(w.token=b.token),j&&(w.apisecret=j),O){w.jsep={type:O.type,sdp:O.sdp},O.e2ee&&(w.jsep.e2ee=!0),(O.rid_order==="hml"||O.rid_order==="lmh")&&(w.jsep.rid_order=O.rid_order),O.force_relay&&(w.jsep.force_relay=!0);let W=null,F=b.webrtcStuff;if(F.pc){let x=F.pc.getTransceivers();if(x&&x.length>0)for(let A in x){let B=x[A];if(B&&B.sender&&B.sender.track&&B.sender.track.kind==="video"){let re=B.sender.getParameters();re&&re.encodings&&re.encodings[0]&&re.encodings[0].scalabilityMode&&(W||(W=[]),W.push({mindex:parseInt(A),mid:B.mid,svc:re.encodings[0].scalabilityMode}))}}}W&&(w.jsep.svc=W)}if(f.debug("Sending message to plugin (handle="+v+"):"),f.debug(w),s){w.session_id=$,w.handle_id=v,me.set(I,function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()}),n.send(JSON.stringify(w));return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()},error:function(W,F){f.error(W+":",F),C.error(W+": "+F)}})}function or(v,C){if(!_e){f.warn("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle");return}let y={janus:"trickle",candidate:C,transaction:f.randomString(12)};if(b.token&&(y.token=b.token),j&&(y.apisecret=j),f.vdebug("Sending trickle candidate (handle="+v+"):"),f.vdebug(y),s){y.session_id=$,y.handle_id=v,n.send(JSON.stringify(y));return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:y,success:function(O){if(f.vdebug("Candidate sent!"),f.vdebug(O),O.janus!=="ack"){f.error("Ooops: "+O.error.code+" "+O.error.reason);return}},error:function(O,I){f.error(O+":",I)}})}function Mt(v,C,b,y,O){let I=X.get(v);if(!I||!I.webrtcStuff){f.warn("Invalid handle");return}let w=I.webrtcStuff;if(!w.pc){f.warn("Invalid PeerConnection");return}let W=function(A){f.log("Received message on data channel:",A);let B=A.target.label;I.ondata(A.data,B)},F=function(A){f.log("Received state change on data channel:",A);let B=A.target.label,re=A.target.protocol,fe=w.dataChannel[B]?w.dataChannel[B].readyState:"null";if(f.log("State change on <"+B+"> data channel: "+fe),fe==="open"){if(w.dataChannel[B].pending&&w.dataChannel[B].pending.length>0){f.log("Sending pending messages on <"+B+">:",w.dataChannel[B].pending.length);for(let ct of w.dataChannel[B].pending)f.log("Sending data on data channel <"+B+">"),f.debug(ct),w.dataChannel[B].send(ct);w.dataChannel[B].pending=[]}I.ondataopen(B,re)}},x=function(A){f.error("Got error on data channel:",A)};if(y)w.dataChannel[C]=y;else{let A=w.dataChannelOptions;b&&(A.protocol=b),w.dataChannel[C]=w.pc.createDataChannel(C,A)}w.dataChannel[C].onmessage=W,w.dataChannel[C].onopen=F,w.dataChannel[C].onclose=F,w.dataChannel[C].onerror=x,w.dataChannel[C].pending=[],O&&w.dataChannel[C].pending.push(O)}function St(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff,O=C.text||C.data;if(!O){f.warn("Invalid data"),C.error("Invalid data");return}let I=C.label?C.label:f.dataChanDefaultLabel;if(!y.dataChannel[I]){Mt(v,I,C.protocol,!1,O,C.protocol),C.success();return}if(y.dataChannel[I].readyState!=="open"){y.dataChannel[I].pending.push(O),C.success();return}f.log("Sending data on data channel <"+I+">"),f.debug(O),y.dataChannel[I].send(O),C.success()}function sr(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff;if(!y.dtmfSender){if(y.pc){let x=y.pc.getSenders().find(function(A){return A.track&&A.track.kind==="audio"});if(!x){f.warn("Invalid DTMF configuration (no audio track)"),C.error("Invalid DTMF configuration (no audio track)");return}y.dtmfSender=x.dtmf,y.dtmfSender&&(f.log("Created DTMF Sender"),y.dtmfSender.ontonechange=function(A){f.debug("Sent DTMF tone: "+A.tone)})}if(!y.dtmfSender){f.warn("Invalid DTMF configuration"),C.error("Invalid DTMF configuration");return}}let O=C.dtmf;if(!O){f.warn("Invalid DTMF parameters"),C.error("Invalid DTMF parameters");return}let I=O.tones;if(!I){f.warn("Invalid DTMF string"),C.error("Invalid DTMF string");return}let w=typeof O.duration=="number"?O.duration:500,W=typeof O.gap=="number"?O.gap:50;f.debug("Sending DTMF string "+I+" (duration "+w+"ms, gap "+W+"ms)"),y.dtmfSender.insertDTMF(I,w,W),C.success()}function Lt(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=C.noRequest===!0;f.log("Destroying handle "+v+" (only-locally="+b+")"),qe(v);let y=X.get(v);if(!y||y.detached){X.delete(v),C.success();return}if(y.detached=!0,b){X.delete(v),C.success();return}if(!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let O={janus:"detach",transaction:f.randomString(12)};if(y.token&&(O.token=y.token),j&&(O.apisecret=j),s){O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O)),X.delete(v),C.success();return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed handle:"),f.debug(I),I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),X.delete(v),C.success()},error:function(I,w){f.error(I+":",w),X.delete(v),C.success()}})}function Ye(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(y.pc)return;let O={iceServers:T,iceTransportPolicy:l,bundlePolicy:_};O.sdpSemantics="unified-plan";let I=!1;if(C.tracks){for(let w of C.tracks)if(w.transforms&&(w.transforms.sender||w.transforms.receiver)){I=!0;break}}RTCRtpSender&&(RTCRtpSender.prototype.createEncodedStreams||RTCRtpSender.prototype.createEncodedAudioStreams&&RTCRtpSender.prototype.createEncodedVideoStreams)&&I&&(y.insertableStreams=!0,O.forceEncodedAudioInsertableStreams=!0,O.forceEncodedVideoInsertableStreams=!0,O.encodedInsertableStreams=!0),f.log("Creating PeerConnection"),y.pc=new RTCPeerConnection(O),f.debug(y.pc),y.pc.getStats&&(y.volume={},y.bitrate.value="0 kbits/sec"),f.log("Preparing local SDP and gathering candidates (trickle="+y.trickle+")"),y.pc.oniceconnectionstatechange=function(){y.pc&&b.iceState(y.pc.iceConnectionState)},y.pc.onicecandidate=function(w){if(!w.candidate||w.candidate.candidate&&w.candidate.candidate.indexOf("endOfCandidates")>0)f.log("End of candidates."),y.iceDone=!0,y.trickle===!0?or(v,{completed:!0}):hn(v,C);else{let W={candidate:w.candidate.candidate,sdpMid:w.candidate.sdpMid,sdpMLineIndex:w.candidate.sdpMLineIndex};y.trickle===!0&&or(v,W)}},y.pc.ontrack=function(w){if(f.log("Handling Remote Track",w),!w.streams||!w.track)return;let W=w.transceiver?w.transceiver.mid:w.track.id;try{b.onremotetrack(w.track,W,!0,{reason:"created"})}catch(x){f.error("Error calling onremotetrack",x)}if(w.track.onended)return;let F=null;f.log("Adding onended callback to track:",w.track),w.track.onended=function(x){f.log("Remote track removed:",x),clearTimeout(F);let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"ended"})}catch(fe){f.error("Error calling onremotetrack on removal",fe)}},w.track.onmute=function(x){f.log("Remote track muted:",x),F||(F=setTimeout(function(){f.log("Removing remote track");let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"mute"})}catch(fe){f.error("Error calling onremotetrack on mute",fe)}F=null},3*840))},w.track.onunmute=function(x){if(f.log("Remote track flowing again:",x),F!=null)clearTimeout(F),F=null;else try{let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;b.onremotetrack(x.target,re,!0,{reason:"unmute"})}catch(A){f.error("Error calling onremotetrack on unmute",A)}}}}async function pn(v,C,b){b=b||{},b.success=typeof b.success=="function"?b.success:f.noop,b.error=typeof b.error=="function"?b.error:fr;let y=b.jsep;if(C&&y){f.error("Provided a JSEP to a createOffer"),b.error("Provided a JSEP to a createOffer");return}else if(!C&&(!y||!y.type||!y.sdp)){f.error("A valid JSEP is required for createAnswer"),b.error("A valid JSEP is required for createAnswer");return}if(b.media&&!b.tracks){if(b.tracks=f.mediaToTracks(b.media),b.simulcast===!0||b.simulcast2===!0||b.svc){for(let w of b.tracks)if(w.type==="video"){b.simulcast===!0||b.simulcast2===!0?w.simulcast=!0:b.svc&&(w.svc=b.svc);break}}f.warn("Deprecated media object passed, use tracks instead. Automatically translated to:",b.tracks)}if(b.tracks&&!Array.isArray(b.tracks)){f.error("Tracks must be an array"),b.error("Tracks must be an array");return}let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),b.error("Invalid handle");return}let I=O.webrtcStuff;I.trickle=lr(b.trickle);try{if(Ye(v,b),C&&await Ct(v,b),y){if(await I.pc.setRemoteDescription(y),f.log("Remote description accepted!"),I.remoteSdp=y.sdp,I.candidates&&I.candidates.length>0){for(let W=0;W<I.candidates.length;W++){let F=I.candidates[W];f.debug("Adding remote candidate:",F),!F||F.completed===!0?I.pc.addIceCandidate(f.endOfCandidates):I.pc.addIceCandidate(F)}I.candidates=[]}await Ct(v,b);let w=await kt(v,b);b.success(w)}else{let w=await gi(v,b);b.success(w)}}catch(w){f.error(w),b.error(w)}}function ar(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:fr,C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=C.jsep,y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let O=y.webrtcStuff;if(b){if(!O.pc){f.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),C.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");return}C.customizeSdp(b),O.pc.setRemoteDescription(b).then(function(){if(f.log("Remote description accepted!"),O.remoteSdp=b.sdp,O.candidates&&O.candidates.length>0){for(let I=0;I<O.candidates.length;I++){let w=O.candidates[I];f.debug("Adding remote candidate:",w),!w||w.completed===!0?O.pc.addIceCandidate(f.endOfCandidates):O.pc.addIceCandidate(w)}O.candidates=[]}C.success()},C.error)}else C.error("Invalid JSEP")}async function gi(v,C){C=C||{},C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;f.log("Creating offer (iceDone="+y.iceDone+")");let O={};C.iceRestart===!0&&(O.iceRestart=!0),f.debug(O);let w=await y.pc.createOffer(O);f.debug(w);let W={type:"offer",sdp:w.sdp};return C.customizeSdp(W),w.sdp=W.sdp,f.log("Setting local description"),y.mySdp={type:"offer",sdp:w.sdp},await y.pc.setLocalDescription(w),y.mediaConstraints=O,!y.iceDone&&!y.trickle?(f.log("Waiting for all candidates..."),null):(y.insertableStreams&&(w.e2ee=!0),w)}async function kt(v,C){C=C||{},C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;f.log("Creating answer (iceDone="+y.iceDone+")");let O=await y.pc.createAnswer();f.debug(O);let I={type:"answer",sdp:O.sdp};return C.customizeSdp(I),O.sdp=I.sdp,f.log("Setting local description"),y.mySdp={type:"answer",sdp:O.sdp},await y.pc.setLocalDescription(O),!y.iceDone&&!y.trickle?(f.log("Waiting for all candidates..."),null):(y.insertableStreams&&(O.e2ee=!0),O)}function hn(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle, not sending anything");return}let y=b.webrtcStuff;if(f.log("Sending offer/answer SDP..."),!y.mySdp){f.warn("Local SDP instance is invalid, not sending anything...");return}y.mySdp={type:y.pc.localDescription.type,sdp:y.pc.localDescription.sdp},y.trickle===!1&&(y.mySdp.trickle=!1),f.debug(C),y.sdpSent=!0,C.success(y.mySdp)}async function ur(v,C){if(C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop,C.tracks&&!Array.isArray(C.tracks)){f.error("Tracks must be an array"),C.error("Tracks must be an array");return}for(let b of C.tracks)(b.add||!b.replace&&!b.remove)&&(b.replace=!0);try{await Ct(v,C),C.success()}catch(b){f.error(b),C.error(b)}}async function Ct(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle, not sending anything"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)throw f.warn("Invalid PeerConnection"),"Invalid PeerConnection";let O=C.tracks;if(!O||!Array.isArray(O)||O.length===0)return;let I=!1,w={};for(let x of O){if(delete x.gumGroup,!x.type||!["audio","video"].includes(x.type)||!x.capture||x.capture instanceof MediaStreamTrack)continue;let A=x.group?x.group:"default";w[A]||(w[A]={}),!w[A][x.type]&&(x.gumGroup=A,w[A][x.type]=x)}let W=Object.keys(w);for(let x of W){let A=w[x];(!A.audio||!A.video)&&(A.audio&&delete A.audio.gumGroup,A.video&&delete A.video.gumGroup,delete w[x])}let F=!!C.jsep;for(let x of O){if(!x.type){f.warn("Missing track type:",x);continue}if(x.type==="data"){if(y.pc.ondatachannel){f.warn("Data channel exists already, not creating another one");continue}f.log("Creating default data channel"),Mt(v,f.dataChanDefaultLabel,null,!1),y.pc.ondatachannel=function(N){f.log("Data channel created by Janus:",N),Mt(v,N.channel.label,N.channel.protocol,N.channel)};continue}if((typeof x.add>"u"||x.add===null)&&(typeof x.remove>"u"||x.remove===null)&&(typeof x.replace>"u"||x.replace===null)&&(x.add=!0),x.add&&x.remove||x.add&&x.remove&&x.replace){f.warn("Conflicting actions for track, ignoring:",x);continue}x.add&&x.replace?(f.warn("Both add and replace provided, falling back to replace:",x),delete x.add):x.remove&&x.replace&&(f.warn("Both remove and replace provided, falling back to remove:",x),delete x.replace);let A=x.type;x.type==="screen"&&(A="video");let B=null,re=null;if(x.mid?B=y.pc.getTransceivers().find(N=>N.mid===x.mid&&N.receiver.track.kind===A):B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),x.replace||x.remove){if(!B){f.warn("Couldn't find a transceiver for track:",x);continue}if(!B.sender){f.warn("No sender in the transceiver for track:",x);continue}re=B.sender}if(F&&!B&&(B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),!B)){f.warn("Couldn't find a transceiver for track:",x);continue}let fe=null,ct=null;if((x.remove||x.replace)&&(f.log("Removing track from PeerConnection",x),ct=re.track?re.track.id:null,await re.replaceTrack(null),ct&&y.myStream)){let N=null;if(A==="audio"&&y.myStream.getAudioTracks()&&y.myStream.getAudioTracks().length)for(let ne of y.myStream.getAudioTracks())ne.id===ct&&(N=ne,f.log("Removing audio track:",N));else if(A==="video"&&y.myStream.getVideoTracks()&&y.myStream.getVideoTracks().length)for(let ne of y.myStream.getVideoTracks())ne.id===ct&&(N=ne,f.log("Removing video track:",N));if(N){try{y.myStream.removeTrack(N),b.onlocaltrack(N,!1)}catch(ne){f.error("Error calling onlocaltrack on removal for renegotiation",ne)}if(N.dontStop!==!0)try{N.stop()}catch{}}}if(x.capture){if(x.gumGroup&&w[x.gumGroup]&&w[x.gumGroup].stream){let N=w[x.gumGroup].stream;fe=x.type==="audio"?N.getAudioTracks()[0]:N.getVideoTracks()[0],delete w[x.gumGroup].stream,delete w[x.gumGroup],delete x.gumGroup}else if(x.capture instanceof MediaStreamTrack)fe=x.capture;else{I||(I=!0,b.consentDialog(!0));let N=f.trackConstraints(x),ne=null;if(x.type==="audio"||x.type==="video"){if(x.gumGroup){let be=x.type==="audio"?"video":"audio";if(w[x.gumGroup]&&w[x.gumGroup][be]){let gt=w[x.gumGroup][be],mi=f.trackConstraints(gt);N[be]=mi[be]}}ne=await navigator.mediaDevices.getUserMedia(N),x.gumGroup&&N.audio&&N.video&&(w[x.gumGroup].stream=ne,delete x.gumGroup)}else ne=await navigator.mediaDevices.getDisplayMedia(N);fe=x.type==="audio"?ne.getAudioTracks()[0]:ne.getVideoTracks()[0]}if(x.replace){await re.replaceTrack(fe);let N="sendrecv";(x.recv===!1||B.direction==="inactive"||B.direction==="sendonly")&&(N="sendonly"),B.setDirection?B.setDirection(N):B.direction=N}else{if(y.myStream||(y.myStream=new MediaStream),A==="audio"||!x.simulcast&&!x.svc)re=y.pc.addTrack(fe,y.myStream),B=y.pc.getTransceivers().find(N=>N.sender===re);else if(x.simulcast){if(f.webRTCAdapter.browserDetails.browser!=="firefox"){f.log("Enabling rid-based simulcasting:",fe);let N=ot(x.simulcastMaxBitrates);B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:x.sendEncodings||[{rid:"h",active:!0,scalabilityMode:"L1T2",maxBitrate:N.high},{rid:"m",active:!0,scalabilityMode:"L1T2",maxBitrate:N.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,scalabilityMode:"L1T2",maxBitrate:N.low,scaleResolutionDownBy:4}]})}else if(f.log("Enabling Simulcasting for Firefox (RID)"),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream]}),re=B?B.sender:null,re){let N=re.getParameters();N||(N={});let ne=ot(x.simulcastMaxBitrates);N.encodings=x.sendEncodings||[{rid:"h",active:!0,maxBitrate:ne.high},{rid:"m",active:!0,maxBitrate:ne.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:ne.low,scaleResolutionDownBy:4}],re.setParameters(N)}}else f.log("Enabling SVC ("+x.svc+"):",fe),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:[{scalabilityMode:x.svc}]});if(re||(re=B?B.sender:null),x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else if(B)try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(x.bitrate){if(x.simulcast||x.svc)f.warn("Ignoring bitrate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.bitrate)||x.bitrate<0)f.warn("Ignoring invalid bitrate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring bitrate for track:",x):(N.encodings[0].maxBitrate=x.bitrate,await re.setParameters(N))}}if(A==="video"&&x.framerate){if(x.simulcast||x.svc)f.warn("Ignoring framerate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.framerate)||x.framerate<0)f.warn("Ignoring invalid framerate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring framerate for track:",x):(N.encodings[0].maxFramerate=x.framerate,await re.setParameters(N))}}if(x.transforms){if(re&&x.transforms.sender){let N=null;RTCRtpSender.prototype.createEncodedStreams?N=re.createEncodedStreams():(RTCRtpSender.prototype.createAudioEncodedStreams||RTCRtpSender.prototype.createEncodedVideoStreams)&&(A==="audio"?N=re.createEncodedAudioStreams():A==="video"&&(N=re.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.sender).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.sender).pipeTo(N.writable))}if(B&&B.receiver&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}}fe&&x.dontStop===!0&&(fe.dontStop=!0)}else if(x.recv&&(B||(B=y.pc.addTransceiver(A)),B)){if(x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(B.receiver&&x.transforms&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}if(fe){y.myStream.addTrack(fe),fe.onended=function(N){f.log("Local track removed:",N);try{b.onlocaltrack(N.target,!1)}catch(ne){f.error("Error calling onlocaltrack following end",ne)}};try{b.onlocaltrack(fe,!0)}catch(N){f.error("Error calling onlocaltrack for track add",N)}}if(B){let N=B.direction,ne=null,be=fe&&B.sender.track,gt=x.recv!==!1&&B.receiver.track;be&&gt?ne="sendrecv":be&&!gt?ne="sendonly":!be&&gt?ne="recvonly":!be&&!gt&&(ne="inactive"),ne&&ne!==N&&(f.warn("Changing direction of transceiver to "+ne+" (was "+N+")",x),B.setDirection?B.setDirection(ne):B.direction=ne)}}I&&b.consentDialog(!1)}function Ut(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.sender&&I.sender.track&&(w={mid:I.mid},w.type=I.sender.track.kind,w.id=I.sender.track.id,w.label=I.sender.track.label),w&&y.push(w)}return y}function cr(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.receiver&&I.receiver.track&&(w={mid:I.mid},w.type=I.receiver.track.kind,w.id=I.receiver.track.id,w.label=I.receiver.track.label),w&&y.push(w)}return y}function at(v,C,b,y){y=typeof y=="function"?y:f.noop;let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),y(0);return}let I=b?"remote":"local",w=O.webrtcStuff;if(w.volume[I]||(w.volume[I]={value:0}),w.pc&&w.pc.getStats&&(f.webRTCAdapter.browserDetails.browser==="chrome"||f.webRTCAdapter.browserDetails.browser==="safari")){let W=w.pc;if(C){let F=w.pc.getTransceivers().find(x=>x.mid===C&&x.receiver.track.kind==="audio");if(!F){f.warn("No audio transceiver with mid "+C),y(0);return}if(b&&!F.receiver){f.warn("Remote transceiver track unavailable"),y(0);return}else if(!b&&!F.sender){f.warn("Local transceiver track unavailable"),y(0);return}W=b?F.receiver:F.sender}return W.getStats().then(function(F){F.forEach(function(x){!x||x.kind!=="audio"||b&&!x.remoteSource||!b&&x.type!=="media-source"||y(x.audioLevel?x.audioLevel:0)})}),w.volume[I].value}else{f.warn("Getting the "+I+" volume unsupported by browser"),y(0);return}}function bt(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff)return f.warn("Invalid handle"),!0;let O=y.webrtcStuff;if(!O.pc)return f.warn("Invalid PeerConnection"),!0;if(!O.myStream)return f.warn("Invalid local MediaStream"),!0;if(b){if(!O.myStream.getVideoTracks()||O.myStream.getVideoTracks().length===0)return f.warn("No video track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="video");return I?!I.sender||!I.sender.track?(f.warn("No video sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No video transceiver with mid "+C),!0)}else return!O.myStream.getVideoTracks()[0].enabled}else{if(!O.myStream.getAudioTracks()||O.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="audio");return I?!I.sender||!I.sender.track?(f.warn("No audio sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No audio transceiver with mid "+C),!0)}else return!O.myStream.getAudioTracks()[0].enabled}}function ut(v,C,b,y){let O=X.get(v);if(!O||!O.webrtcStuff)return f.warn("Invalid handle"),!1;let I=O.webrtcStuff;if(!I.pc)return f.warn("Invalid PeerConnection"),!1;if(!I.myStream)return f.warn("Invalid local MediaStream"),!1;if(b){if(!I.myStream.getVideoTracks()||I.myStream.getVideoTracks().length===0)return f.warn("No video track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No video sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getVideoTracks())w.enabled=!y}else{if(!I.myStream.getAudioTracks()||I.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="audio");if(!w)return f.warn("No audio transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No audio sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getAudioTracks())w.enabled=!y}return!0}function Ne(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)return f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)return"Invalid PeerConnection";if(y.pc.getStats){let O=y.pc,I=C||"default";if(C){let w=y.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),"No video transceiver with mid "+C;if(!w.receiver)return f.warn("No video receiver with mid "+C),"No video receiver with mid "+C;O=w.receiver}return y.bitrate[I]||(y.bitrate[I]={timer:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,value:"0 kbits/sec"}),y.bitrate[I].timer?y.bitrate[I].value:(f.log("Starting bitrate timer"+(C?" for mid "+C:"")+" (via getStats)"),y.bitrate[I].timer=setInterval(function(){O.getStats().then(function(w){w.forEach(function(W){if(!W)return;let F=!1;if(((W.mediaType==="video"||W.id.toLowerCase().indexOf("video")>-1)&&W.type==="inbound-rtp"&&W.id.indexOf("rtcp")<0||W.type=="ssrc"&&W.bytesReceived&&(W.googCodecName==="VP8"||W.googCodecName===""))&&(F=!0),F)if(y.bitrate[I].bsnow=W.bytesReceived,y.bitrate[I].tsnow=W.timestamp,y.bitrate[I].bsbefore===null||y.bitrate[I].tsbefore===null)y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow;else{let x=y.bitrate[I].tsnow-y.bitrate[I].tsbefore;f.webRTCAdapter.browserDetails.browser==="safari"&&(x=x/1e3);let A=Math.round((y.bitrate[I].bsnow-y.bitrate[I].bsbefore)*8/x);f.webRTCAdapter.browserDetails.browser==="safari"&&(A=parseInt(A/1e3)),y.bitrate[I].value=A+" kbits/sec",y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow}})})},1e3),"0 kbits/sec")}else return f.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser"}function Ft(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle");return}let O=y.webrtcStuff;if(!O.pc){f.warn("Invalid PeerConnection");return}let I=O.pc.getTransceivers().find(W=>W.mid===C);if(!I){f.warn("No transceiver with mid",C);return}if(!I.sender){f.warn("No sender for transceiver with mid",C);return}let w=I.sender.getParameters();!w||!w.encodings||w.encodings.length===0?f.warn("No parameters encodings"):w.encodings.length>1?f.warn("Ignoring bitrate for simulcast track, use sendEncodings for that"):isNaN(b)||b<0?f.warn("Invalid bitrate (must be a positive integer)"):(w.encodings[0].maxBitrate=b,I.sender.setParameters(w))}function fr(v){f.error("WebRTC error:",v)}function qe(v,C){f.log("Cleaning WebRTC stuff");let b=X.get(v);if(!b)return;let y=b.webrtcStuff;if(y){if(C===!0){let O={janus:"hangup",transaction:f.randomString(12)};b.token&&(O.token=b.token),j&&(O.apisecret=j),f.debug("Sending hangup request (handle="+v+"):"),f.debug(O),s?(O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O))):f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O})}y.volume&&(y.volume.local&&y.volume.local.timer&&clearInterval(y.volume.local.timer),y.volume.remote&&y.volume.remote.timer&&clearInterval(y.volume.remote.timer));for(let O in y.bitrate)y.bitrate[O].timer&&clearInterval(y.bitrate[O].timer);y.bitrate={},!y.streamExternal&&y.myStream&&(f.log("Stopping local stream tracks"),f.stopAllTracks(y.myStream)),y.streamExternal=!1,y.myStream=null;try{y.pc.close()}catch{}y.pc=null,y.candidates=null,y.mySdp=null,y.remoteSdp=null,y.iceDone=!1,y.dataChannel={},y.dtmfSender=null,y.insertableStreams=!1}b.oncleanup()}function lr(v){return f.debug("isTrickleEnabled:",v),v!==!1}}let Hu=!0,qu=!0;function ri(i,s,n){const o=i.match(s);return o&&o.length>=n&&parseInt(o[n],10)}function In(i,s,n){if(!i.RTCPeerConnection)return;const o=i.RTCPeerConnection.prototype,a=o.addEventListener;o.addEventListener=function(p,m){if(p!==s)return a.apply(this,arguments);const T=l=>{const _=n(l);_&&(m.handleEvent?m.handleEvent(_):m(_))};return this._eventMap=this._eventMap||{},this._eventMap[s]||(this._eventMap[s]=new Map),this._eventMap[s].set(m,T),a.apply(this,[p,T])};const u=o.removeEventListener;o.removeEventListener=function(p,m){if(p!==s||!this._eventMap||!this._eventMap[s])return u.apply(this,arguments);if(!this._eventMap[s].has(m))return u.apply(this,arguments);const T=this._eventMap[s].get(m);return this._eventMap[s].delete(m),this._eventMap[s].size===0&&delete this._eventMap[s],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[p,T])},Object.defineProperty(o,"on"+s,{get(){return this["_on"+s]},set(p){this["_on"+s]&&(this.removeEventListener(s,this["_on"+s]),delete this["_on"+s]),p&&this.addEventListener(s,this["_on"+s]=p)},enumerable:!0,configurable:!0})}function mv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(Hu=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function vv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(qu=!i,"adapter.js deprecation warnings "+(i?"disabled":"enabled"))}function Ju(){if(typeof window=="object"){if(Hu)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Jo(i,s){qu&&console.warn(i+" is deprecated, please use "+s+" instead.")}function yv(i){const s={browser:null,version:null};if(typeof i>"u"||!i.navigator)return s.browser="Not a browser.",s;const{navigator:n}=i;if(n.mozGetUserMedia)s.browser="firefox",s.version=ri(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||i.isSecureContext===!1&&i.webkitRTCPeerConnection&&!i.RTCIceGatherer)s.browser="chrome",s.version=ri(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))s.browser="safari",s.version=ri(n.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=i.RTCRtpTransceiver&&"currentDirection"in i.RTCRtpTransceiver.prototype;else return s.browser="Not a supported browser.",s;return s}function Su(i){return Object.prototype.toString.call(i)==="[object Object]"}function zu(i){return Su(i)?Object.keys(i).reduce(function(s,n){const o=Su(i[n]),a=o?zu(i[n]):i[n],u=o&&!Object.keys(a).length;return a===void 0||u?s:Object.assign(s,{[n]:a})},{}):i}function Uo(i,s,n){!s||n.has(s.id)||(n.set(s.id,s),Object.keys(s).forEach(o=>{o.endsWith("Id")?Uo(i,i.get(s[o]),n):o.endsWith("Ids")&&s[o].forEach(a=>{Uo(i,i.get(a),n)})}))}function Cu(i,s,n){const o=n?"outbound-rtp":"inbound-rtp",a=new Map;if(s===null)return a;const u=[];return i.forEach(p=>{p.type==="track"&&p.trackIdentifier===s.id&&u.push(p)}),u.forEach(p=>{i.forEach(m=>{m.type===o&&m.trackId===p.id&&Uo(i,m,a)})}),a}const bu=Ju;function Vu(i,s){const n=i&&i.navigator;if(!n.mediaDevices)return;const o=function(m){if(typeof m!="object"||m.mandatory||m.optional)return m;const T={};return Object.keys(m).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const _=typeof m[l]=="object"?m[l]:{ideal:m[l]};_.exact!==void 0&&typeof _.exact=="number"&&(_.min=_.max=_.exact);const D=function(H,z){return H?H+z.charAt(0).toUpperCase()+z.slice(1):z==="deviceId"?"sourceId":z};if(_.ideal!==void 0){T.optional=T.optional||[];let H={};typeof _.ideal=="number"?(H[D("min",l)]=_.ideal,T.optional.push(H),H={},H[D("max",l)]=_.ideal,T.optional.push(H)):(H[D("",l)]=_.ideal,T.optional.push(H))}_.exact!==void 0&&typeof _.exact!="number"?(T.mandatory=T.mandatory||{},T.mandatory[D("",l)]=_.exact):["min","max"].forEach(H=>{_[H]!==void 0&&(T.mandatory=T.mandatory||{},T.mandatory[D(H,l)]=_[H])})}),m.advanced&&(T.optional=(T.optional||[]).concat(m.advanced)),T},a=function(m,T){if(s.version>=61)return T(m);if(m=JSON.parse(JSON.stringify(m)),m&&typeof m.audio=="object"){const l=function(_,D,H){D in _&&!(H in _)&&(_[H]=_[D],delete _[D])};m=JSON.parse(JSON.stringify(m)),l(m.audio,"autoGainControl","googAutoGainControl"),l(m.audio,"noiseSuppression","googNoiseSuppression"),m.audio=o(m.audio)}if(m&&typeof m.video=="object"){let l=m.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const _=s.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!_)){delete m.video.facingMode;let D;if(l.exact==="environment"||l.ideal==="environment"?D=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(D=["front"]),D)return n.mediaDevices.enumerateDevices().then(H=>{H=H.filter(j=>j.kind==="videoinput");let z=H.find(j=>D.some(ee=>j.label.toLowerCase().includes(ee)));return!z&&H.length&&D.includes("back")&&(z=H[H.length-1]),z&&(m.video.deviceId=l.exact?{exact:z.deviceId}:{ideal:z.deviceId}),m.video=o(m.video),bu("chrome: "+JSON.stringify(m)),T(m)})}m.video=o(m.video)}return bu("chrome: "+JSON.stringify(m)),T(m)},u=function(m){return s.version>=64?m:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[m.name]||m.name,message:m.message,constraint:m.constraint||m.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},p=function(m,T,l){a(m,_=>{n.webkitGetUserMedia(_,T,D=>{l&&l(u(D))})})};if(n.getUserMedia=p.bind(n),n.mediaDevices.getUserMedia){const m=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(T){return a(T,l=>m(l).then(_=>{if(l.audio&&!_.getAudioTracks().length||l.video&&!_.getVideoTracks().length)throw _.getTracks().forEach(D=>{D.stop()}),new DOMException("","NotFoundError");return _},_=>Promise.reject(u(_))))}}}function _v(i,s){if(!(i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices)&&i.navigator.mediaDevices){if(typeof s!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}i.navigator.mediaDevices.getDisplayMedia=function(o){return s(o).then(a=>{const u=o.video&&o.video.width,p=o.video&&o.video.height,m=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:a,maxFrameRate:m||3}},u&&(o.video.mandatory.maxWidth=u),p&&(o.video.mandatory.maxHeight=p),i.navigator.mediaDevices.getUserMedia(o)})}}}function $u(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function ju(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(m=>m.track&&m.track.id===a.track.id):u={track:a.track};const p=new Event("track");p.track=a.track,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)}),o.stream.getTracks().forEach(a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(m=>m.track&&m.track.id===a.id):u={track:a};const p=new Event("track");p.track=a,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)})},this.addEventListener("addstream",this._ontrackpoly)),s.apply(this,arguments)}}else In(i,"track",s=>(s.transceiver||Object.defineProperty(s,"transceiver",{value:{receiver:s.receiver}}),s))}function Ku(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){const s=function(a,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=a.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:a}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const a=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(m,T){let l=a.apply(this,arguments);return l||(l=s(this,m),this._senders.push(l)),l};const u=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(m){u.apply(this,arguments);const T=this._senders.indexOf(m);T!==-1&&this._senders.splice(T,1)}}const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(p=>{this._senders.push(s(this,p))})};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],o.apply(this,[u]),u.getTracks().forEach(p=>{const m=this._senders.find(T=>T.track===p);m&&this._senders.splice(this._senders.indexOf(m),1)})}}else if(typeof i=="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){const s=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yu(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[o,a,u]=arguments;if(arguments.length>0&&typeof o=="function")return s.apply(this,arguments);if(s.length===0&&(arguments.length===0||typeof o!="function"))return s.apply(this,[]);const p=function(T){const l={};return T.result().forEach(D=>{const H={id:D.id,timestamp:D.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[D.type]||D.type};D.names().forEach(z=>{H[z]=D.stat(z)}),l[H.id]=H}),l},m=function(T){return new Map(Object.keys(T).map(l=>[l,T[l]]))};if(arguments.length>=2){const T=function(l){a(m(p(l)))};return s.apply(this,[T,o])}return new Promise((T,l)=>{s.apply(this,[function(_){T(m(p(_)))},l])}).then(a,u)}}function Zu(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver))return;if(!("getStats"in i.RTCRtpSender.prototype)){const n=i.RTCPeerConnection.prototype.getSenders;n&&(i.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(p=>p._pc=this),u});const o=i.RTCPeerConnection.prototype.addTrack;o&&(i.RTCPeerConnection.prototype.addTrack=function(){const u=o.apply(this,arguments);return u._pc=this,u}),i.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(p=>Cu(p,u.track,!0))}}if(!("getStats"in i.RTCRtpReceiver.prototype)){const n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){const a=n.apply(this,[]);return a.forEach(u=>u._pc=this),a}),In(i,"track",o=>(o.receiver._pc=o.srcElement,o)),i.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(u=>Cu(u,a.track,!1))}}if(!("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype))return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){const o=arguments[0];let a,u,p;return this.getSenders().forEach(m=>{m.track===o&&(a?p=!0:a=m)}),this.getReceivers().forEach(m=>(m.track===o&&(u?p=!0:u=m),m.track===o)),p||a&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return s.apply(this,arguments)}}function Xu(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(p=>this._shimmedLocalStreams[p][0])};const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(p,m){if(!m)return s.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const T=s.apply(this,arguments);return this._shimmedLocalStreams[m.id]?this._shimmedLocalStreams[m.id].indexOf(T)===-1&&this._shimmedLocalStreams[m.id].push(T):this._shimmedLocalStreams[m.id]=[m,T],T};const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(p){this._shimmedLocalStreams=this._shimmedLocalStreams||{},p.getTracks().forEach(l=>{if(this.getSenders().find(D=>D.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const m=this.getSenders();n.apply(this,arguments);const T=this.getSenders().filter(l=>m.indexOf(l)===-1);this._shimmedLocalStreams[p.id]=[p].concat(T)};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[p.id],o.apply(this,arguments)};const a=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},p&&Object.keys(this._shimmedLocalStreams).forEach(m=>{const T=this._shimmedLocalStreams[m].indexOf(p);T!==-1&&this._shimmedLocalStreams[m].splice(T,1),this._shimmedLocalStreams[m].length===1&&delete this._shimmedLocalStreams[m]}),a.apply(this,arguments)}}function Qu(i,s){if(!i.RTCPeerConnection)return;if(i.RTCPeerConnection.prototype.addTrack&&s.version>=65)return Xu(i);const n=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){const _=n.apply(this);return this._reverseStreams=this._reverseStreams||{},_.map(D=>this._reverseStreams[D.id])};const o=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(_){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},_.getTracks().forEach(D=>{if(this.getSenders().find(z=>z.track===D))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[_.id]){const D=new i.MediaStream(_.getTracks());this._streams[_.id]=D,this._reverseStreams[D.id]=_,_=D}o.apply(this,[_])};const a=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(_){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[_.id]||_]),delete this._reverseStreams[this._streams[_.id]?this._streams[_.id].id:_.id],delete this._streams[_.id]},i.RTCPeerConnection.prototype.addTrack=function(_,D){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const H=[].slice.call(arguments,1);if(H.length!==1||!H[0].getTracks().find(ee=>ee===_))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(ee=>ee.track===_))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const j=this._streams[D.id];if(j)j.addTrack(_),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const ee=new i.MediaStream([_]);this._streams[D.id]=ee,this._reverseStreams[ee.id]=D,this.addStream(ee)}return this.getSenders().find(ee=>ee.track===_)};function u(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(j.id,"g"),z.id)}),new RTCSessionDescription({type:_.type,sdp:D})}function p(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(z.id,"g"),j.id)}),new RTCSessionDescription({type:_.type,sdp:D})}["createOffer","createAnswer"].forEach(function(l){const _=i.RTCPeerConnection.prototype[l],D={[l](){const H=arguments;return arguments.length&&typeof arguments[0]=="function"?_.apply(this,[j=>{const ee=u(this,j);H[0].apply(null,[ee])},j=>{H[1]&&H[1].apply(null,j)},arguments[2]]):_.apply(this,arguments).then(j=>u(this,j))}};i.RTCPeerConnection.prototype[l]=D[l]});const m=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?m.apply(this,arguments):(arguments[0]=p(this,arguments[0]),m.apply(this,arguments))};const T=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get(){const l=T.get.apply(this);return l.type===""?l:u(this,l)}}),i.RTCPeerConnection.prototype.removeTrack=function(_){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!_._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(_._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let H;Object.keys(this._streams).forEach(z=>{this._streams[z].getTracks().find(ee=>_.track===ee)&&(H=this._streams[z])}),H&&(H.getTracks().length===1?this.removeStream(this._reverseStreams[H.id]):H.removeTrack(_.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Fo(i,s){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const o=i.RTCPeerConnection.prototype[n],a={[n](){return arguments[0]=new(n==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};i.RTCPeerConnection.prototype[n]=a[n]})}function ec(i,s){In(i,"negotiationneeded",n=>{const o=n.target;if(!((s.version<72||o.getConfiguration&&o.getConfiguration().sdpSemantics==="plan-b")&&o.signalingState!=="stable"))return n})}const Tu=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:ec,shimAddTrackRemoveTrack:Qu,shimAddTrackRemoveTrackWithNative:Xu,shimGetDisplayMedia:_v,shimGetSendersWithDtmf:Ku,shimGetStats:Yu,shimGetUserMedia:Vu,shimMediaStream:$u,shimOnTrack:ju,shimPeerConnection:Fo,shimSenderReceiverGetStats:Zu},Symbol.toStringTag,{value:"Module"}));function tc(i,s){const n=i&&i.navigator,o=i&&i.MediaStreamTrack;if(n.getUserMedia=function(a,u,p){Jo("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(a).then(u,p)},!(s.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const a=function(p,m,T){m in p&&!(T in p)&&(p[T]=p[m],delete p[m])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(p){return typeof p=="object"&&typeof p.audio=="object"&&(p=JSON.parse(JSON.stringify(p)),a(p.audio,"autoGainControl","mozAutoGainControl"),a(p.audio,"noiseSuppression","mozNoiseSuppression")),u(p)},o&&o.prototype.getSettings){const p=o.prototype.getSettings;o.prototype.getSettings=function(){const m=p.apply(this,arguments);return a(m,"mozAutoGainControl","autoGainControl"),a(m,"mozNoiseSuppression","noiseSuppression"),m}}if(o&&o.prototype.applyConstraints){const p=o.prototype.applyConstraints;o.prototype.applyConstraints=function(m){return this.kind==="audio"&&typeof m=="object"&&(m=JSON.parse(JSON.stringify(m)),a(m,"autoGainControl","mozAutoGainControl"),a(m,"noiseSuppression","mozNoiseSuppression")),p.apply(this,[m])}}}}function Sv(i,s){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(o){if(!(o&&o.video)){const a=new DOMException("getDisplayMedia without video constraints is undefined");return a.name="NotFoundError",a.code=8,Promise.reject(a)}return o.video===!0?o.video={mediaSource:s}:o.video.mediaSource=s,i.navigator.mediaDevices.getUserMedia(o)})}function nc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function No(i,s){if(typeof i!="object"||!(i.RTCPeerConnection||i.mozRTCPeerConnection))return;!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(a){const u=i.RTCPeerConnection.prototype[a],p={[a](){return arguments[0]=new(a==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};i.RTCPeerConnection.prototype[a]=p[a]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[u,p,m]=arguments;return o.apply(this,[u||null]).then(T=>{if(s.version<53&&!p)try{T.forEach(l=>{l.type=n[l.type]||l.type})}catch(l){if(l.name!=="TypeError")throw l;T.forEach((_,D)=>{T.set(D,Object.assign({},_,{type:n[_.type]||_.type}))})}return T}).then(p,m)}}function rc(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpSender.prototype)return;const s=i.RTCPeerConnection.prototype.getSenders;s&&(i.RTCPeerConnection.prototype.getSenders=function(){const a=s.apply(this,[]);return a.forEach(u=>u._pc=this),a});const n=i.RTCPeerConnection.prototype.addTrack;n&&(i.RTCPeerConnection.prototype.addTrack=function(){const a=n.apply(this,arguments);return a._pc=this,a}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ic(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpReceiver.prototype)return;const s=i.RTCPeerConnection.prototype.getReceivers;s&&(i.RTCPeerConnection.prototype.getReceivers=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o}),In(i,"track",n=>(n.receiver._pc=n.srcElement,n)),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function oc(i){!i.RTCPeerConnection||"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){Jo("removeStream","removeTrack"),this.getSenders().forEach(o=>{o.track&&n.getTracks().includes(o.track)&&this.removeTrack(o)})})}function sc(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function ac(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.addTransceiver;s&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const o=arguments[1],a=o&&"sendEncodings"in o;a&&o.sendEncodings.forEach(p=>{if("rid"in p&&!/^[a-z0-9]{0,16}$/i.test(p.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in p&&!(parseFloat(p.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in p&&!(parseFloat(p.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=s.apply(this,arguments);if(a){const{sender:p}=u,m=p.getParameters();(!("encodings"in m)||m.encodings.length===1&&Object.keys(m.encodings[0]).length===0)&&(m.encodings=o.sendEncodings,p.sendEncodings=o.sendEncodings,this.setParametersPromises.push(p.setParameters(m).then(()=>{delete p.sendEncodings}).catch(()=>{delete p.sendEncodings})))}return u})}function uc(i){if(!(typeof i=="object"&&i.RTCRtpSender))return;const s=i.RTCRtpSender.prototype.getParameters;s&&(i.RTCRtpSender.prototype.getParameters=function(){const o=s.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function cc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}function fc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}const Ru=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:ac,shimCreateAnswer:fc,shimCreateOffer:cc,shimGetDisplayMedia:Sv,shimGetParameters:uc,shimGetUserMedia:tc,shimOnTrack:nc,shimPeerConnection:No,shimRTCDataChannel:sc,shimReceiverGetStats:ic,shimRemoveStream:oc,shimSenderGetStats:rc},Symbol.toStringTag,{value:"Module"}));function lc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(o){this._localStreams||(this._localStreams=[]),this._localStreams.includes(o)||this._localStreams.push(o),o.getAudioTracks().forEach(a=>s.call(this,a,o)),o.getVideoTracks().forEach(a=>s.call(this,a,o))},i.RTCPeerConnection.prototype.addTrack=function(o,...a){return a&&a.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),s.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const o=this._localStreams.indexOf(n);if(o===-1)return;this._localStreams.splice(o,1);const a=n.getTracks();this.getSenders().forEach(u=>{a.includes(u.track)&&this.removeTrack(u)})})}}function dc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=o=>{o.streams.forEach(a=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(a))return;this._remoteStreams.push(a);const u=new Event("addstream");u.stream=a,this.dispatchEvent(u)})})}});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){const o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(a){a.streams.forEach(u=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(u)>=0)return;o._remoteStreams.push(u);const p=new Event("addstream");p.stream=u,o.dispatchEvent(p)})}),s.apply(o,arguments)}}}function pc(i){if(typeof i!="object"||!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype,n=s.createOffer,o=s.createAnswer,a=s.setLocalDescription,u=s.setRemoteDescription,p=s.addIceCandidate;s.createOffer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=n.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H},s.createAnswer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=o.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H};let m=function(T,l,_){const D=a.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D};s.setLocalDescription=m,m=function(T,l,_){const D=u.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.setRemoteDescription=m,m=function(T,l,_){const D=p.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.addIceCandidate=m}function hc(i){const s=i&&i.navigator;if(s.mediaDevices&&s.mediaDevices.getUserMedia){const n=s.mediaDevices,o=n.getUserMedia.bind(n);s.mediaDevices.getUserMedia=a=>o(gc(a))}!s.getUserMedia&&s.mediaDevices&&s.mediaDevices.getUserMedia&&(s.getUserMedia=(function(o,a,u){s.mediaDevices.getUserMedia(o).then(a,u)}).bind(s))}function gc(i){return i&&i.video!==void 0?Object.assign({},i,{video:zu(i.video)}):i}function mc(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection;i.RTCPeerConnection=function(o,a){if(o&&o.iceServers){const u=[];for(let p=0;p<o.iceServers.length;p++){let m=o.iceServers[p];!m.hasOwnProperty("urls")&&m.hasOwnProperty("url")?(Jo("RTCIceServer.url","RTCIceServer.urls"),m=JSON.parse(JSON.stringify(m)),m.urls=m.url,delete m.url,u.push(m)):u.push(o.iceServers[p])}o.iceServers=u}return new s(o,a)},i.RTCPeerConnection.prototype=s.prototype,"generateCertificate"in s&&Object.defineProperty(i.RTCPeerConnection,"generateCertificate",{get(){return s.generateCertificate}})}function vc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function yc(i){const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(o){if(o){typeof o.offerToReceiveAudio<"u"&&(o.offerToReceiveAudio=!!o.offerToReceiveAudio);const a=this.getTransceivers().find(p=>p.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):o.offerToReceiveAudio===!0&&!a&&this.addTransceiver("audio",{direction:"recvonly"}),typeof o.offerToReceiveVideo<"u"&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);const u=this.getTransceivers().find(p=>p.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):o.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return s.apply(this,arguments)}}function _c(i){typeof i!="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}const xu=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:_c,shimCallbacksAPI:pc,shimConstraints:gc,shimCreateOfferLegacy:yc,shimGetUserMedia:hc,shimLocalStreamsAPI:lc,shimRTCIceServerUrls:mc,shimRemoteStreamsAPI:dc,shimTrackEventTransceiver:vc},Symbol.toStringTag,{value:"Module"}));var Sc={exports:{}};(function(i){const s={};s.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},s.localCName=s.generateIdentifier(),s.splitLines=function(n){return n.trim().split("\n").map(o=>o.trim())},s.splitSections=function(n){return n.split("\nm=").map((a,u)=>(u>0?"m="+a:a).trim()+"\r\n")},s.getDescription=function(n){const o=s.splitSections(n);return o&&o[0]},s.getMediaSections=function(n){const o=s.splitSections(n);return o.shift(),o},s.matchPrefix=function(n,o){return s.splitLines(n).filter(a=>a.indexOf(o)===0)},s.parseCandidate=function(n){let o;n.indexOf("a=candidate:")===0?o=n.substring(12).split(" "):o=n.substring(10).split(" ");const a={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let u=8;u<o.length;u+=2)switch(o[u]){case"raddr":a.relatedAddress=o[u+1];break;case"rport":a.relatedPort=parseInt(o[u+1],10);break;case"tcptype":a.tcpType=o[u+1];break;case"ufrag":a.ufrag=o[u+1],a.usernameFragment=o[u+1];break;default:a[o[u]]===void 0&&(a[o[u]]=o[u+1]);break}return a},s.writeCandidate=function(n){const o=[];o.push(n.foundation);const a=n.component;a==="rtp"?o.push(1):a==="rtcp"?o.push(2):o.push(a),o.push(n.protocol.toUpperCase()),o.push(n.priority),o.push(n.address||n.ip),o.push(n.port);const u=n.type;return o.push("typ"),o.push(u),u!=="host"&&n.relatedAddress&&n.relatedPort&&(o.push("raddr"),o.push(n.relatedAddress),o.push("rport"),o.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(o.push("tcptype"),o.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(o.push("ufrag"),o.push(n.usernameFragment||n.ufrag)),"candidate:"+o.join(" ")},s.parseIceOptions=function(n){return n.substring(14).split(" ")},s.parseRtpMap=function(n){let o=n.substring(9).split(" ");const a={payloadType:parseInt(o.shift(),10)};return o=o[0].split("/"),a.name=o[0],a.clockRate=parseInt(o[1],10),a.channels=o.length===3?parseInt(o[2],10):1,a.numChannels=a.channels,a},s.writeRtpMap=function(n){let o=n.payloadType;n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType);const a=n.channels||n.numChannels||1;return"a=rtpmap:"+o+" "+n.name+"/"+n.clockRate+(a!==1?"/"+a:"")+"\r\n"},s.parseExtmap=function(n){const o=n.substring(9).split(" ");return{id:parseInt(o[0],10),direction:o[0].indexOf("/")>0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}},s.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+"\r\n"},s.parseFmtp=function(n){const o={};let a;const u=n.substring(n.indexOf(" ")+1).split(";");for(let p=0;p<u.length;p++)a=u[p].trim().split("="),o[a[0].trim()]=a[1];return o},s.writeFmtp=function(n){let o="",a=n.payloadType;if(n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const u=[];Object.keys(n.parameters).forEach(p=>{n.parameters[p]!==void 0?u.push(p+"="+n.parameters[p]):u.push(p)}),o+="a=fmtp:"+a+" "+u.join(";")+"\r\n"}return o},s.parseRtcpFb=function(n){const o=n.substring(n.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}},s.writeRtcpFb=function(n){let o="",a=n.payloadType;return n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{o+="a=rtcp-fb:"+a+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+"\r\n"}),o},s.parseSsrcMedia=function(n){const o=n.indexOf(" "),a={ssrc:parseInt(n.substring(7,o),10)},u=n.indexOf(":",o);return u>-1?(a.attribute=n.substring(o+1,u),a.value=n.substring(u+1)):a.attribute=n.substring(o+1),a},s.parseSsrcGroup=function(n){const o=n.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(a=>parseInt(a,10))}},s.getMid=function(n){const o=s.matchPrefix(n,"a=mid:")[0];if(o)return o.substring(6)},s.parseFingerprint=function(n){const o=n.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}},s.getDtlsParameters=function(n,o){return{role:"auto",fingerprints:s.matchPrefix(n+o,"a=fingerprint:").map(s.parseFingerprint)}},s.writeDtlsParameters=function(n,o){let a="a=setup:"+o+"\r\n";return n.fingerprints.forEach(u=>{a+="a=fingerprint:"+u.algorithm+" "+u.value+"\r\n"}),a},s.parseCryptoLine=function(n){const o=n.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}},s.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?s.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+"\r\n"},s.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const o=n.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}},s.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},s.getCryptoParameters=function(n,o){return s.matchPrefix(n+o,"a=crypto:").map(s.parseCryptoLine)},s.getIceParameters=function(n,o){const a=s.matchPrefix(n+o,"a=ice-ufrag:")[0],u=s.matchPrefix(n+o,"a=ice-pwd:")[0];return a&&u?{usernameFragment:a.substring(12),password:u.substring(10)}:null},s.writeIceParameters=function(n){let o="a=ice-ufrag:"+n.usernameFragment+"\r\na=ice-pwd:"+n.password+"\r\n";return n.iceLite&&(o+="a=ice-lite\r\n"),o},s.parseRtpParameters=function(n){const o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=s.splitLines(n)[0].split(" ");o.profile=u[2];for(let m=3;m<u.length;m++){const T=u[m],l=s.matchPrefix(n,"a=rtpmap:"+T+" ")[0];if(l){const _=s.parseRtpMap(l),D=s.matchPrefix(n,"a=fmtp:"+T+" ");switch(_.parameters=D.length?s.parseFmtp(D[0]):{},_.rtcpFeedback=s.matchPrefix(n,"a=rtcp-fb:"+T+" ").map(s.parseRtcpFb),o.codecs.push(_),_.name.toUpperCase()){case"RED":case"ULPFEC":o.fecMechanisms.push(_.name.toUpperCase());break}}}s.matchPrefix(n,"a=extmap:").forEach(m=>{o.headerExtensions.push(s.parseExtmap(m))});const p=s.matchPrefix(n,"a=rtcp-fb:* ").map(s.parseRtcpFb);return o.codecs.forEach(m=>{p.forEach(T=>{m.rtcpFeedback.find(_=>_.type===T.type&&_.parameter===T.parameter)||m.rtcpFeedback.push(T)})}),o},s.writeRtpDescription=function(n,o){let a="";a+="m="+n+" ",a+=o.codecs.length>0?"9":"0",a+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",a+=o.codecs.map(p=>p.preferredPayloadType!==void 0?p.preferredPayloadType:p.payloadType).join(" ")+"\r\n",a+="c=IN IP4 0.0.0.0\r\n",a+="a=rtcp:9 IN IP4 0.0.0.0\r\n",o.codecs.forEach(p=>{a+=s.writeRtpMap(p),a+=s.writeFmtp(p),a+=s.writeRtcpFb(p)});let u=0;return o.codecs.forEach(p=>{p.maxptime>u&&(u=p.maxptime)}),u>0&&(a+="a=maxptime:"+u+"\r\n"),o.headerExtensions&&o.headerExtensions.forEach(p=>{a+=s.writeExtmap(p)}),a},s.parseRtpEncodingParameters=function(n){const o=[],a=s.parseRtpParameters(n),u=a.fecMechanisms.indexOf("RED")!==-1,p=a.fecMechanisms.indexOf("ULPFEC")!==-1,m=s.matchPrefix(n,"a=ssrc:").map(H=>s.parseSsrcMedia(H)).filter(H=>H.attribute==="cname"),T=m.length>0&&m[0].ssrc;let l;const _=s.matchPrefix(n,"a=ssrc-group:FID").map(H=>H.substring(17).split(" ").map(j=>parseInt(j,10)));_.length>0&&_[0].length>1&&_[0][0]===T&&(l=_[0][1]),a.codecs.forEach(H=>{if(H.name.toUpperCase()==="RTX"&&H.parameters.apt){let z={ssrc:T,codecPayloadType:parseInt(H.parameters.apt,10)};T&&l&&(z.rtx={ssrc:l}),o.push(z),u&&(z=JSON.parse(JSON.stringify(z)),z.fec={ssrc:T,mechanism:p?"red+ulpfec":"red"},o.push(z))}}),o.length===0&&T&&o.push({ssrc:T});let D=s.matchPrefix(n,"b=");return D.length&&(D[0].indexOf("b=TIAS:")===0?D=parseInt(D[0].substring(7),10):D[0].indexOf("b=AS:")===0?D=parseInt(D[0].substring(5),10)*1e3*.95-50*40*8:D=void 0,o.forEach(H=>{H.maxBitrate=D})),o},s.parseRtcpParameters=function(n){const o={},a=s.matchPrefix(n,"a=ssrc:").map(m=>s.parseSsrcMedia(m)).filter(m=>m.attribute==="cname")[0];a&&(o.cname=a.value,o.ssrc=a.ssrc);const u=s.matchPrefix(n,"a=rtcp-rsize");o.reducedSize=u.length>0,o.compound=u.length===0;const p=s.matchPrefix(n,"a=rtcp-mux");return o.mux=p.length>0,o},s.writeRtcpParameters=function(n){let o="";return n.reducedSize&&(o+="a=rtcp-rsize\r\n"),n.mux&&(o+="a=rtcp-mux\r\n"),n.ssrc!==void 0&&n.cname&&(o+="a=ssrc:"+n.ssrc+" cname:"+n.cname+"\r\n"),o},s.parseMsid=function(n){let o;const a=s.matchPrefix(n,"a=msid:");if(a.length===1)return o=a[0].substring(7).split(" "),{stream:o[0],track:o[1]};const u=s.matchPrefix(n,"a=ssrc:").map(p=>s.parseSsrcMedia(p)).filter(p=>p.attribute==="msid");if(u.length>0)return o=u[0].value.split(" "),{stream:o[0],track:o[1]}},s.parseSctpDescription=function(n){const o=s.parseMLine(n),a=s.matchPrefix(n,"a=max-message-size:");let u;a.length>0&&(u=parseInt(a[0].substring(19),10)),isNaN(u)&&(u=65536);const p=s.matchPrefix(n,"a=sctp-port:");if(p.length>0)return{port:parseInt(p[0].substring(12),10),protocol:o.fmt,maxMessageSize:u};const m=s.matchPrefix(n,"a=sctpmap:");if(m.length>0){const T=m[0].substring(10).split(" ");return{port:parseInt(T[0],10),protocol:T[1],maxMessageSize:u}}},s.writeSctpDescription=function(n,o){let a=[];return n.protocol!=="DTLS/SCTP"?a=["m="+n.kind+" 9 "+n.protocol+" "+o.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+o.port+"\r\n"]:a=["m="+n.kind+" 9 "+n.protocol+" "+o.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+o.port+" "+o.protocol+" 65535\r\n"],o.maxMessageSize!==void 0&&a.push("a=max-message-size:"+o.maxMessageSize+"\r\n"),a.join("")},s.generateSessionId=function(){return Math.random().toString().substr(2,22)},s.writeSessionBoilerplate=function(n,o,a){let u;const p=o!==void 0?o:2;return n?u=n:u=s.generateSessionId(),"v=0\r\no="+(a||"thisisadapterortc")+" "+u+" "+p+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},s.getDirection=function(n,o){const a=s.splitLines(n);for(let u=0;u<a.length;u++)switch(a[u]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return a[u].substring(2)}return o?s.getDirection(o):"sendrecv"},s.getKind=function(n){return s.splitLines(n)[0].split(" ")[0].substring(2)},s.isRejected=function(n){return n.split(" ",2)[1]==="0"},s.parseMLine=function(n){const a=s.splitLines(n)[0].substring(2).split(" ");return{kind:a[0],port:parseInt(a[1],10),protocol:a[2],fmt:a.slice(3).join(" ")}},s.parseOLine=function(n){const a=s.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:a[0],sessionId:a[1],sessionVersion:parseInt(a[2],10),netType:a[3],addressType:a[4],address:a[5]}},s.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const o=s.splitLines(n);for(let a=0;a<o.length;a++)if(o[a].length<2||o[a].charAt(1)!=="=")return!1;return!0},i.exports=s})(Sc);var Cc=Sc.exports;const Xn=Wu(Cc),Cv=gv({__proto__:null,default:Xn},[Cc]);function ii(i){if(!i.RTCIceCandidate||i.RTCIceCandidate&&"foundation"in i.RTCIceCandidate.prototype)return;const s=i.RTCIceCandidate;i.RTCIceCandidate=function(o){if(typeof o=="object"&&o.candidate&&o.candidate.indexOf("a=")===0&&(o=JSON.parse(JSON.stringify(o)),o.candidate=o.candidate.substr(2)),o.candidate&&o.candidate.length){const a=new s(o),u=Xn.parseCandidate(o.candidate),p=Object.assign(a,u);return p.toJSON=function(){return{candidate:p.candidate,sdpMid:p.sdpMid,sdpMLineIndex:p.sdpMLineIndex,usernameFragment:p.usernameFragment}},p}return new s(o)},i.RTCIceCandidate.prototype=s.prototype,In(i,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new i.RTCIceCandidate(n.candidate),writable:"false"}),n))}function oi(i,s){if(!i.RTCPeerConnection)return;"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(m){if(!m||!m.sdp)return!1;const T=Xn.splitSections(m.sdp);return T.shift(),T.some(l=>{const _=Xn.parseMLine(l);return _&&_.kind==="application"&&_.protocol.indexOf("SCTP")!==-1})},o=function(m){const T=m.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(T===null||T.length<2)return-1;const l=parseInt(T[1],10);return l!==l?-1:l},a=function(m){let T=65536;return s.browser==="firefox"&&(s.version<57?m===-1?T=16384:T=2147483637:s.version<60?T=s.version===57?65535:65536:T=2147483637),T},u=function(m,T){let l=65536;s.browser==="firefox"&&s.version===57&&(l=65535);const _=Xn.matchPrefix(m.sdp,"a=max-message-size:");return _.length>0?l=parseInt(_[0].substr(19),10):s.browser==="firefox"&&T!==-1&&(l=2147483637),l},p=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,s.browser==="chrome"&&s.version>=76){const{sdpSemantics:T}=this.getConfiguration();T==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const T=o(arguments[0]),l=a(T),_=u(arguments[0],T);let D;l===0&&_===0?D=Number.POSITIVE_INFINITY:l===0||_===0?D=Math.max(l,_):D=Math.min(l,_);const H={};Object.defineProperty(H,"maxMessageSize",{get(){return D}}),this._sctp=H}return p.apply(this,arguments)}}function si(i){if(!(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype))return;function s(o,a){const u=o.send;o.send=function(){const m=arguments[0],T=m.length||m.size||m.byteLength;if(o.readyState==="open"&&a.sctp&&T>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return u.apply(o,arguments)}}const n=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){const a=n.apply(this,arguments);return s(a,this),a},In(i,"datachannel",o=>(s(o.channel,o.target),o))}function Go(i){if(!i.RTCPeerConnection||"connectionState"in i.RTCPeerConnection.prototype)return;const s=i.RTCPeerConnection.prototype;Object.defineProperty(s,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(s,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const o=s[n];s[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=a=>{const u=a.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const p=new Event("connectionstatechange",a);u.dispatchEvent(p)}return a},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),o.apply(this,arguments)}})}function Wo(i,s){if(!i.RTCPeerConnection||s.browser==="chrome"&&s.version>=71||s.browser==="safari"&&s.version>=605)return;const n=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(a){if(a&&a.sdp&&a.sdp.indexOf("\na=extmap-allow-mixed")!==-1){const u=a.sdp.split("\n").filter(p=>p.trim()!=="a=extmap-allow-mixed").join("\n");i.RTCSessionDescription&&a instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:a.type,sdp:u}):a.sdp=u}return n.apply(this,arguments)}}function ai(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(s.browser==="chrome"&&s.version<78||s.browser==="firefox"&&s.version<68||s.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ui(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(i.RTCPeerConnection.prototype.setLocalDescription=function(){let a=arguments[0]||{};if(typeof a!="object"||a.type&&a.sdp)return n.apply(this,arguments);if(a={type:a.type,sdp:a.sdp},!a.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":a.type="offer";break;default:a.type="answer";break}return a.sdp||a.type!=="offer"&&a.type!=="answer"?n.apply(this,[a]):(a.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(p=>n.apply(this,[p]))})}const bv=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Wo,shimAddIceCandidateNullOrEmpty:ai,shimConnectionState:Go,shimMaxMessageSize:oi,shimParameterlessSetLocalDescription:ui,shimRTCIceCandidate:ii,shimSendThrowTypeError:si},Symbol.toStringTag,{value:"Module"}));function Tv({window:i}={},s={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Ju,o=yv(i),a={browserDetails:o,commonShim:bv,extractVersion:ri,disableLog:mv,disableWarnings:vv,sdp:Cv};switch(o.browser){case"chrome":if(!Tu||!Fo||!s.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(o.version===null)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=Tu,ai(i,o),ui(i),Vu(i,o),$u(i),Fo(i,o),ju(i),Qu(i,o),Ku(i),Yu(i),Zu(i),ec(i,o),ii(i),Go(i),oi(i,o),si(i),Wo(i,o);break;case"firefox":if(!Ru||!No||!s.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=Ru,ai(i,o),ui(i),tc(i,o),No(i,o),nc(i),oc(i),rc(i),ic(i),sc(i),ac(i),uc(i),cc(i),fc(i),ii(i),Go(i),oi(i,o),si(i);break;case"safari":if(!xu||!s.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=xu,ai(i,o),ui(i),mc(i),yc(i),pc(i),lc(i),dc(i),vc(i),hc(i),_c(i),ii(i),oi(i,o),si(i),Wo(i,o);break;default:n("Unsupported browser!");break}return a}const Pu=Tv({window:typeof window>"u"?void 0:window});function Dt(i){return typeof i=="function"}function bc(i){var s=function(o){Error.call(o),o.stack=new Error().stack},n=i(s);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ao=bc(function(i){return function(n){i(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map(function(o,a){return a+1+") "+o.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}});function Bo(i,s){if(i){var n=i.indexOf(s);0<=n&&i.splice(n,1)}}var di=function(){function i(s){this.initialTeardown=s,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var s,n,o,a,u;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var m=Mo(p),T=m.next();!T.done;T=m.next()){var l=T.value;l.remove(this)}}catch(ee){s={error:ee}}finally{try{T&&!T.done&&(n=m.return)&&n.call(m)}finally{if(s)throw s.error}}else p.remove(this);var _=this.initialTeardown;if(Dt(_))try{_()}catch(ee){u=ee instanceof Ao?ee.errors:[ee]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var H=Mo(D),z=H.next();!z.done;z=H.next()){var j=z.value;try{wu(j)}catch(ee){u=u!=null?u:[],ee instanceof Ao?u=Lo(Lo([],ko(u)),ko(ee.errors)):u.push(ee)}}}catch(ee){o={error:ee}}finally{try{z&&!z.done&&(a=H.return)&&a.call(H)}finally{if(o)throw o.error}}}if(u)throw new Ao(u)}},i.prototype.add=function(s){var n;if(s&&s!==this)if(this.closed)wu(s);else{if(s instanceof i){if(s.closed||s._hasParent(this))return;s._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(s)}},i.prototype._hasParent=function(s){var n=this._parentage;return n===s||Array.isArray(n)&&n.includes(s)},i.prototype._addParent=function(s){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(s),n):n?[n,s]:s},i.prototype._removeParent=function(s){var n=this._parentage;n===s?this._parentage=null:Array.isArray(n)&&Bo(n,s)},i.prototype.remove=function(s){var n=this._finalizers;n&&Bo(n,s),s instanceof i&&s._removeParent(this)},i.EMPTY=function(){var s=new i;return s.closed=!0,s}(),i}(),Tc=di.EMPTY;function Rc(i){return i instanceof di||i&&"closed"in i&&Dt(i.remove)&&Dt(i.add)&&Dt(i.unsubscribe)}function wu(i){Dt(i)?i():i.unsubscribe()}var Rv={Promise:void 0},xv={setTimeout:function(i,s){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return setTimeout.apply(void 0,Lo([i,s],ko(n)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function Pv(i){xv.setTimeout(function(){throw i})}function Eu(){}function ci(i){i()}var xc=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o.isStopped=!1,n?(o.destination=n,Rc(n)&&n.add(o)):o.destination=Ov,o}return s.create=function(n,o,a){return new Ho(n,o,a)},s.prototype.next=function(n){this.isStopped||this._next(n)},s.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},s.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},s.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,i.prototype.unsubscribe.call(this),this.destination=null)},s.prototype._next=function(n){this.destination.next(n)},s.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},s.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},s}(di),wv=function(){function i(s){this.partialObserver=s}return i.prototype.next=function(s){var n=this.partialObserver;if(n.next)try{n.next(s)}catch(o){ei(o)}},i.prototype.error=function(s){var n=this.partialObserver;if(n.error)try{n.error(s)}catch(o){ei(o)}else ei(s)},i.prototype.complete=function(){var s=this.partialObserver;if(s.complete)try{s.complete()}catch(n){ei(n)}},i}(),Ho=function(i){er(s,i);function s(n,o,a){var u=i.call(this)||this,p;return Dt(n)||!n?p={next:n!=null?n:void 0,error:o!=null?o:void 0,complete:a!=null?a:void 0}:p=n,u.destination=new wv(p),u}return s}(xc);function ei(i){Pv(i)}function Ev(i){throw i}var Ov={closed:!0,next:Eu,error:Ev,complete:Eu},Av=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Iv(i){return i}function Dv(i){return i.length===0?Iv:i.length===1?i[0]:function(n){return i.reduce(function(o,a){return a(o)},n)}}var Ou=function(){function i(s){s&&(this._subscribe=s)}return i.prototype.lift=function(s){var n=new i;return n.source=this,n.operator=s,n},i.prototype.subscribe=function(s,n,o){var a=this,u=Lv(s)?s:new Ho(s,n,o);return ci(function(){var p=a,m=p.operator,T=p.source;u.add(m?m.call(u,T):T?a._subscribe(u):a._trySubscribe(u))}),u},i.prototype._trySubscribe=function(s){try{return this._subscribe(s)}catch(n){s.error(n)}},i.prototype.forEach=function(s,n){var o=this;return n=Au(n),new n(function(a,u){var p=new Ho({next:function(m){try{s(m)}catch(T){u(T),p.unsubscribe()}},error:u,complete:a});o.subscribe(p)})},i.prototype._subscribe=function(s){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(s)},i.prototype[Av]=function(){return this},i.prototype.pipe=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];return Dv(s)(this)},i.prototype.toPromise=function(s){var n=this;return s=Au(s),new s(function(o,a){var u;n.subscribe(function(p){return u=p},function(p){return a(p)},function(){return o(u)})})},i.create=function(s){return new i(s)},i}();function Au(i){var s;return(s=i!=null?i:Rv.Promise)!==null&&s!==void 0?s:Promise}function Mv(i){return i&&Dt(i.next)&&Dt(i.error)&&Dt(i.complete)}function Lv(i){return i&&i instanceof xc||Mv(i)&&Rc(i)}var kv=bc(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),cn=function(i){er(s,i);function s(){var n=i.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return s.prototype.lift=function(n){var o=new Iu(this,this);return o.operator=n,o},s.prototype._throwIfClosed=function(){if(this.closed)throw new kv},s.prototype.next=function(n){var o=this;ci(function(){var a,u;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var p=Mo(o.currentObservers),m=p.next();!m.done;m=p.next()){var T=m.value;T.next(n)}}catch(l){a={error:l}}finally{try{m&&!m.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}}})},s.prototype.error=function(n){var o=this;ci(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=n;for(var a=o.observers;a.length;)a.shift().error(n)}})},s.prototype.complete=function(){var n=this;ci(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var o=n.observers;o.length;)o.shift().complete()}})},s.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(s.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),s.prototype._trySubscribe=function(n){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,n)},s.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},s.prototype._innerSubscribe=function(n){var o=this,a=this,u=a.hasError,p=a.isStopped,m=a.observers;return u||p?Tc:(this.currentObservers=null,m.push(n),new di(function(){o.currentObservers=null,Bo(m,n)}))},s.prototype._checkFinalizedStatuses=function(n){var o=this,a=o.hasError,u=o.thrownError,p=o.isStopped;a?n.error(u):p&&n.complete()},s.prototype.asObservable=function(){var n=new Ou;return n.source=this,n},s.create=function(n,o){return new Iu(n,o)},s}(Ou),Iu=function(i){er(s,i);function s(n,o){var a=i.call(this)||this;return a.destination=n,a.source=o,a}return s.prototype.next=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.next)===null||a===void 0||a.call(o,n)},s.prototype.error=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.error)===null||a===void 0||a.call(o,n)},s.prototype.complete=function(){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||o===void 0||o.call(n)},s.prototype._subscribe=function(n){var o,a;return(a=(o=this.source)===null||o===void 0?void 0:o.subscribe(n))!==null&&a!==void 0?a:Tc},s}(cn),_t=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o._value=n,o}return Object.defineProperty(s.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),s.prototype._subscribe=function(n){var o=i.prototype._subscribe.call(this,n);return!o.closed&&n.next(this._value),o},s.prototype.getValue=function(){var n=this,o=n.hasError,a=n.thrownError,u=n._value;if(o)throw a;return this._throwIfClosed(),u},s.prototype.next=function(n){i.prototype.next.call(this,this._value=n)},s}(cn),fi={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/fi.exports;(function(i,s){(function(){var n,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",m="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",l=500,_="__lodash_placeholder__",D=1,H=2,z=4,j=1,ee=2,xe=1,ot=2,_e=4,$=8,X=16,Ie=32,st=64,me=128,ht=256,Zt=512,nr=30,dn="...",pi=800,hi=16,rr=1,ir=2,or=3,Mt=1/0,St=9007199254740991,sr=17976931348623157e292,Lt=NaN,Ye=4294967295,pn=Ye-1,ar=Ye>>>1,gi=[["ary",me],["bind",xe],["bindKey",ot],["curry",$],["curryRight",X],["flip",Zt],["partial",Ie],["partialRight",st],["rearg",ht]],kt="[object Arguments]",hn="[object Array]",ur="[object AsyncFunction]",Ct="[object Boolean]",Ut="[object Date]",cr="[object DOMException]",at="[object Error]",bt="[object Function]",ut="[object GeneratorFunction]",Ne="[object Map]",Ft="[object Number]",fr="[object Null]",qe="[object Object]",lr="[object Promise]",v="[object Proxy]",C="[object RegExp]",b="[object Set]",y="[object String]",O="[object Symbol]",I="[object Undefined]",w="[object WeakMap]",W="[object WeakSet]",F="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",B="[object Float64Array]",re="[object Int8Array]",fe="[object Int16Array]",ct="[object Int32Array]",N="[object Uint8Array]",ne="[object Uint8ClampedArray]",be="[object Uint16Array]",gt="[object Uint32Array]",mi=/\b__p \+= '';/g,Pc=/\b(__p \+=) '' \+/g,wc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Vo=/[&<>"']/g,Ec=RegExp(zo.source),Oc=RegExp(Vo.source),Ac=/<%-([\s\S]+?)%>/g,Ic=/<%([\s\S]+?)%>/g,$o=/<%=([\s\S]+?)%>/g,Dc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mc=/^\w*$/,Lc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vi=/[\\^$.*+?()[\]{}|]/g,kc=RegExp(vi.source),yi=/^\s+/,Uc=/\s/,Fc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nc=/\{\n\/\* \[wrapped with (.+)\] \*/,Gc=/,? & /,Wc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bc=/[()=,{}\[\]\/\s]/,Hc=/\\(\\)?/g,qc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jo=/\w*$/,Jc=/^[-+]0x[0-9a-f]+$/i,zc=/^0b[01]+$/i,Vc=/^\[object .+?Constructor\]$/,$c=/^0o[0-7]+$/i,jc=/^(?:0|[1-9]\d*)$/,Kc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,Yc=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",Zc="\\u0300-\\u036f",Xc="\\ufe20-\\ufe2f",Qc="\\u20d0-\\u20ff",Ko=Zc+Xc+Qc,Yo="\\u2700-\\u27bf",Zo="a-z\\xdf-\\xf6\\xf8-\\xff",ef="\\xac\\xb1\\xd7\\xf7",tf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nf="\\u2000-\\u206f",rf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xo="A-Z\\xc0-\\xd6\\xd8-\\xde",Qo="\\ufe0e\\ufe0f",es=ef+tf+nf+rf,_i="[']",of="["+pr+"]",ts="["+es+"]",hr="["+Ko+"]",ns="\\d+",sf="["+Yo+"]",rs="["+Zo+"]",is="[^"+pr+es+ns+Yo+Zo+Xo+"]",Si="\\ud83c[\\udffb-\\udfff]",af="(?:"+hr+"|"+Si+")",os="[^"+pr+"]",Ci="(?:\\ud83c[\\udde6-\\uddff]){2}",bi="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="["+Xo+"]",ss="\\u200d",as="(?:"+rs+"|"+is+")",uf="(?:"+gn+"|"+is+")",us="(?:"+_i+"(?:d|ll|m|re|s|t|ve))?",cs="(?:"+_i+"(?:D|LL|M|RE|S|T|VE))?",fs=af+"?",ls="["+Qo+"]?",cf="(?:"+ss+"(?:"+[os,Ci,bi].join("|")+")"+ls+fs+")*",ff="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ds=ls+fs+cf,df="(?:"+[sf,Ci,bi].join("|")+")"+ds,pf="(?:"+[os+hr+"?",hr,Ci,bi,of].join("|")+")",hf=RegExp(_i,"g"),gf=RegExp(hr,"g"),Ti=RegExp(Si+"(?="+Si+")|"+pf+ds,"g"),mf=RegExp([gn+"?"+rs+"+"+us+"(?="+[ts,gn,"$"].join("|")+")",uf+"+"+cs+"(?="+[ts,gn+as,"$"].join("|")+")",gn+"?"+as+"+"+us,gn+"+"+cs,lf,ff,ns,df].join("|"),"g"),vf=RegExp("["+ss+pr+Ko+Qo+"]"),yf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_f=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sf=-1,ve={};ve[A]=ve[B]=ve[re]=ve[fe]=ve[ct]=ve[N]=ve[ne]=ve[be]=ve[gt]=!0,ve[kt]=ve[hn]=ve[F]=ve[Ct]=ve[x]=ve[Ut]=ve[at]=ve[bt]=ve[Ne]=ve[Ft]=ve[qe]=ve[C]=ve[b]=ve[y]=ve[w]=!1;var ge={};ge[kt]=ge[hn]=ge[F]=ge[x]=ge[Ct]=ge[Ut]=ge[A]=ge[B]=ge[re]=ge[fe]=ge[ct]=ge[Ne]=ge[Ft]=ge[qe]=ge[C]=ge[b]=ge[y]=ge[O]=ge[N]=ge[ne]=ge[be]=ge[gt]=!0,ge[at]=ge[bt]=ge[w]=!1;var Cf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},bf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xf=parseFloat,Pf=parseInt,ps=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,wf=typeof self=="object"&&self&&self.Object===Object&&self,Oe=ps||wf||Function("return this")(),Ri=s&&!s.nodeType&&s,Xt=Ri&&!0&&i&&!i.nodeType&&i,hs=Xt&&Xt.exports===Ri,xi=hs&&ps.process,Ze=function(){try{var P=Xt&&Xt.require&&Xt.require("util").types;return P||xi&&xi.binding&&xi.binding("util")}catch{}}(),gs=Ze&&Ze.isArrayBuffer,ms=Ze&&Ze.isDate,vs=Ze&&Ze.isMap,ys=Ze&&Ze.isRegExp,_s=Ze&&Ze.isSet,Ss=Ze&&Ze.isTypedArray;function Je(P,L,M){switch(M.length){case 0:return P.call(L);case 1:return P.call(L,M[0]);case 2:return P.call(L,M[0],M[1]);case 3:return P.call(L,M[0],M[1],M[2])}return P.apply(L,M)}function Ef(P,L,M,J){for(var Q=-1,le=P==null?0:P.length;++Q<le;){var Pe=P[Q];L(J,Pe,M(Pe),P)}return J}function Xe(P,L){for(var M=-1,J=P==null?0:P.length;++M<J&&L(P[M],M,P)!==!1;);return P}function Of(P,L){for(var M=P==null?0:P.length;M--&&L(P[M],M,P)!==!1;);return P}function Cs(P,L){for(var M=-1,J=P==null?0:P.length;++M<J;)if(!L(P[M],M,P))return!1;return!0}function Nt(P,L){for(var M=-1,J=P==null?0:P.length,Q=0,le=[];++M<J;){var Pe=P[M];L(Pe,M,P)&&(le[Q++]=Pe)}return le}function gr(P,L){var M=P==null?0:P.length;return!!M&&mn(P,L,0)>-1}function Pi(P,L,M){for(var J=-1,Q=P==null?0:P.length;++J<Q;)if(M(L,P[J]))return!0;return!1}function ye(P,L){for(var M=-1,J=P==null?0:P.length,Q=Array(J);++M<J;)Q[M]=L(P[M],M,P);return Q}function Gt(P,L){for(var M=-1,J=L.length,Q=P.length;++M<J;)P[Q+M]=L[M];return P}function wi(P,L,M,J){var Q=-1,le=P==null?0:P.length;for(J&&le&&(M=P[++Q]);++Q<le;)M=L(M,P[Q],Q,P);return M}function Af(P,L,M,J){var Q=P==null?0:P.length;for(J&&Q&&(M=P[--Q]);Q--;)M=L(M,P[Q],Q,P);return M}function Ei(P,L){for(var M=-1,J=P==null?0:P.length;++M<J;)if(L(P[M],M,P))return!0;return!1}var If=Oi("length");function Df(P){return P.split("")}function Mf(P){return P.match(Wc)||[]}function bs(P,L,M){var J;return M(P,function(Q,le,Pe){if(L(Q,le,Pe))return J=le,!1}),J}function mr(P,L,M,J){for(var Q=P.length,le=M+(J?1:-1);J?le--:++le<Q;)if(L(P[le],le,P))return le;return-1}function mn(P,L,M){return L===L?zf(P,L,M):mr(P,Ts,M)}function Lf(P,L,M,J){for(var Q=M-1,le=P.length;++Q<le;)if(J(P[Q],L))return Q;return-1}function Ts(P){return P!==P}function Rs(P,L){var M=P==null?0:P.length;return M?Ii(P,L)/M:Lt}function Oi(P){return function(L){return L==null?n:L[P]}}function Ai(P){return function(L){return P==null?n:P[L]}}function xs(P,L,M,J,Q){return Q(P,function(le,Pe,he){M=J?(J=!1,le):L(M,le,Pe,he)}),M}function kf(P,L){var M=P.length;for(P.sort(L);M--;)P[M]=P[M].value;return P}function Ii(P,L){for(var M,J=-1,Q=P.length;++J<Q;){var le=L(P[J]);le!==n&&(M=M===n?le:M+le)}return M}function Di(P,L){for(var M=-1,J=Array(P);++M<P;)J[M]=L(M);return J}function Uf(P,L){return ye(L,function(M){return[M,P[M]]})}function Ps(P){return P&&P.slice(0,As(P)+1).replace(yi,"")}function ze(P){return function(L){return P(L)}}function Mi(P,L){return ye(L,function(M){return P[M]})}function Ln(P,L){return P.has(L)}function ws(P,L){for(var M=-1,J=P.length;++M<J&&mn(L,P[M],0)>-1;);return M}function Es(P,L){for(var M=P.length;M--&&mn(L,P[M],0)>-1;);return M}function Ff(P,L){for(var M=P.length,J=0;M--;)P[M]===L&&++J;return J}var Nf=Ai(Cf),Gf=Ai(bf);function Wf(P){return"\\"+Rf[P]}function Bf(P,L){return P==null?n:P[L]}function vn(P){return vf.test(P)}function Hf(P){return yf.test(P)}function qf(P){for(var L,M=[];!(L=P.next()).done;)M.push(L.value);return M}function Li(P){var L=-1,M=Array(P.size);return P.forEach(function(J,Q){M[++L]=[Q,J]}),M}function Os(P,L){return function(M){return P(L(M))}}function Wt(P,L){for(var M=-1,J=P.length,Q=0,le=[];++M<J;){var Pe=P[M];(Pe===L||Pe===_)&&(P[M]=_,le[Q++]=M)}return le}function vr(P){var L=-1,M=Array(P.size);return P.forEach(function(J){M[++L]=J}),M}function Jf(P){var L=-1,M=Array(P.size);return P.forEach(function(J){M[++L]=[J,J]}),M}function zf(P,L,M){for(var J=M-1,Q=P.length;++J<Q;)if(P[J]===L)return J;return-1}function Vf(P,L,M){for(var J=M+1;J--;)if(P[J]===L)return J;return J}function yn(P){return vn(P)?jf(P):If(P)}function ft(P){return vn(P)?Kf(P):Df(P)}function As(P){for(var L=P.length;L--&&Uc.test(P.charAt(L)););return L}var $f=Ai(Tf);function jf(P){for(var L=Ti.lastIndex=0;Ti.test(P);)++L;return L}function Kf(P){return P.match(Ti)||[]}function Yf(P){return P.match(mf)||[]}var Zf=function P(L){L=L==null?Oe:_n.defaults(Oe.Object(),L,_n.pick(Oe,_f));var M=L.Array,J=L.Date,Q=L.Error,le=L.Function,Pe=L.Math,he=L.Object,ki=L.RegExp,Xf=L.String,Qe=L.TypeError,yr=M.prototype,Qf=le.prototype,Sn=he.prototype,_r=L["__core-js_shared__"],Sr=Qf.toString,pe=Sn.hasOwnProperty,el=0,Is=function(){var e=/[^.]+$/.exec(_r&&_r.keys&&_r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Cr=Sn.toString,tl=Sr.call(he),nl=Oe._,rl=ki("^"+Sr.call(pe).replace(vi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),br=hs?L.Buffer:n,Bt=L.Symbol,Tr=L.Uint8Array,Ds=br?br.allocUnsafe:n,Rr=Os(he.getPrototypeOf,he),Ms=he.create,Ls=Sn.propertyIsEnumerable,xr=yr.splice,ks=Bt?Bt.isConcatSpreadable:n,kn=Bt?Bt.iterator:n,Qt=Bt?Bt.toStringTag:n,Pr=function(){try{var e=on(he,"defineProperty");return e({},"",{}),e}catch{}}(),il=L.clearTimeout!==Oe.clearTimeout&&L.clearTimeout,ol=J&&J.now!==Oe.Date.now&&J.now,sl=L.setTimeout!==Oe.setTimeout&&L.setTimeout,wr=Pe.ceil,Er=Pe.floor,Ui=he.getOwnPropertySymbols,al=br?br.isBuffer:n,Us=L.isFinite,ul=yr.join,cl=Os(he.keys,he),we=Pe.max,De=Pe.min,fl=J.now,ll=L.parseInt,Fs=Pe.random,dl=yr.reverse,Fi=on(L,"DataView"),Un=on(L,"Map"),Ni=on(L,"Promise"),Cn=on(L,"Set"),Fn=on(L,"WeakMap"),Nn=on(he,"create"),Or=Fn&&new Fn,bn={},pl=sn(Fi),hl=sn(Un),gl=sn(Ni),ml=sn(Cn),vl=sn(Fn),Ar=Bt?Bt.prototype:n,Gn=Ar?Ar.valueOf:n,Ns=Ar?Ar.toString:n;function h(e){if(Ce(e)&&!te(e)&&!(e instanceof ue)){if(e instanceof et)return e;if(pe.call(e,"__wrapped__"))return Ga(e)}return new et(e)}var Tn=function(){function e(){}return function(t){if(!Se(t))return{};if(Ms)return Ms(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function et(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}h.templateSettings={escape:Ac,evaluate:Ic,interpolate:$o,variable:"",imports:{_:h}},h.prototype=Ir.prototype,h.prototype.constructor=h,et.prototype=Tn(Ir.prototype),et.prototype.constructor=et;function ue(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ye,this.__views__=[]}function yl(){var e=new ue(this.__wrapped__);return e.__actions__=Ge(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ge(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ge(this.__views__),e}function _l(){if(this.__filtered__){var e=new ue(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Sl(){var e=this.__wrapped__.value(),t=this.__dir__,r=te(e),c=t<0,d=r?e.length:0,g=Dd(0,d,this.__views__),S=g.start,R=g.end,E=R-S,k=c?R:S-1,U=this.__iteratees__,G=U.length,q=0,V=De(E,this.__takeCount__);if(!r||!c&&d==E&&V==E)return ua(e,this.__actions__);var Y=[];e:for(;E--&&q<V;){k+=t;for(var oe=-1,Z=e[k];++oe<G;){var ae=U[oe],ce=ae.iteratee,je=ae.type,Ue=ce(Z);if(je==ir)Z=Ue;else if(!Ue){if(je==rr)continue e;break e}}Y[q++]=Z}return Y}ue.prototype=Tn(Ir.prototype),ue.prototype.constructor=ue;function en(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function Cl(){this.__data__=Nn?Nn(null):{},this.size=0}function bl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Tl(e){var t=this.__data__;if(Nn){var r=t[e];return r===T?n:r}return pe.call(t,e)?t[e]:n}function Rl(e){var t=this.__data__;return Nn?t[e]!==n:pe.call(t,e)}function xl(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Nn&&t===n?T:t,this}en.prototype.clear=Cl,en.prototype.delete=bl,en.prototype.get=Tl,en.prototype.has=Rl,en.prototype.set=xl;function Tt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function Pl(){this.__data__=[],this.size=0}function wl(e){var t=this.__data__,r=Dr(t,e);if(r<0)return!1;var c=t.length-1;return r==c?t.pop():xr.call(t,r,1),--this.size,!0}function El(e){var t=this.__data__,r=Dr(t,e);return r<0?n:t[r][1]}function Ol(e){return Dr(this.__data__,e)>-1}function Al(e,t){var r=this.__data__,c=Dr(r,e);return c<0?(++this.size,r.push([e,t])):r[c][1]=t,this}Tt.prototype.clear=Pl,Tt.prototype.delete=wl,Tt.prototype.get=El,Tt.prototype.has=Ol,Tt.prototype.set=Al;function Rt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function Il(){this.size=0,this.__data__={hash:new en,map:new(Un||Tt),string:new en}}function Dl(e){var t=Jr(this,e).delete(e);return this.size-=t?1:0,t}function Ml(e){return Jr(this,e).get(e)}function Ll(e){return Jr(this,e).has(e)}function kl(e,t){var r=Jr(this,e),c=r.size;return r.set(e,t),this.size+=r.size==c?0:1,this}Rt.prototype.clear=Il,Rt.prototype.delete=Dl,Rt.prototype.get=Ml,Rt.prototype.has=Ll,Rt.prototype.set=kl;function tn(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Rt;++t<r;)this.add(e[t])}function Ul(e){return this.__data__.set(e,T),this}function Fl(e){return this.__data__.has(e)}tn.prototype.add=tn.prototype.push=Ul,tn.prototype.has=Fl;function lt(e){var t=this.__data__=new Tt(e);this.size=t.size}function Nl(){this.__data__=new Tt,this.size=0}function Gl(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Wl(e){return this.__data__.get(e)}function Bl(e){return this.__data__.has(e)}function Hl(e,t){var r=this.__data__;if(r instanceof Tt){var c=r.__data__;if(!Un||c.length<a-1)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new Rt(c)}return r.set(e,t),this.size=r.size,this}lt.prototype.clear=Nl,lt.prototype.delete=Gl,lt.prototype.get=Wl,lt.prototype.has=Bl,lt.prototype.set=Hl;function Gs(e,t){var r=te(e),c=!r&&an(e),d=!r&&!c&&Vt(e),g=!r&&!c&&!d&&wn(e),S=r||c||d||g,R=S?Di(e.length,Xf):[],E=R.length;for(var k in e)(t||pe.call(e,k))&&!(S&&(k=="length"||d&&(k=="offset"||k=="parent")||g&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Et(k,E)))&&R.push(k);return R}function Ws(e){var t=e.length;return t?e[Ki(0,t-1)]:n}function ql(e,t){return zr(Ge(e),nn(t,0,e.length))}function Jl(e){return zr(Ge(e))}function Gi(e,t,r){(r!==n&&!dt(e[t],r)||r===n&&!(t in e))&&xt(e,t,r)}function Wn(e,t,r){var c=e[t];(!(pe.call(e,t)&&dt(c,r))||r===n&&!(t in e))&&xt(e,t,r)}function Dr(e,t){for(var r=e.length;r--;)if(dt(e[r][0],t))return r;return-1}function zl(e,t,r,c){return Ht(e,function(d,g,S){t(c,d,r(d),S)}),c}function Bs(e,t){return e&&vt(t,Ee(t),e)}function Vl(e,t){return e&&vt(t,Be(t),e)}function xt(e,t,r){t=="__proto__"&&Pr?Pr(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Wi(e,t){for(var r=-1,c=t.length,d=M(c),g=e==null;++r<c;)d[r]=g?n:Co(e,t[r]);return d}function nn(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function tt(e,t,r,c,d,g){var S,R=t&D,E=t&H,k=t&z;if(r&&(S=d?r(e,c,d,g):r(e)),S!==n)return S;if(!Se(e))return e;var U=te(e);if(U){if(S=Ld(e),!R)return Ge(e,S)}else{var G=Me(e),q=G==bt||G==ut;if(Vt(e))return la(e,R);if(G==qe||G==kt||q&&!d){if(S=E||q?{}:Aa(e),!R)return E?Td(e,Vl(S,e)):bd(e,Bs(S,e))}else{if(!ge[G])return d?e:{};S=kd(e,G,R)}}g||(g=new lt);var V=g.get(e);if(V)return V;g.set(e,S),ou(e)?e.forEach(function(Z){S.add(tt(Z,t,r,Z,e,g))}):ru(e)&&e.forEach(function(Z,ae){S.set(ae,tt(Z,t,r,ae,e,g))});var Y=k?E?so:oo:E?Be:Ee,oe=U?n:Y(e);return Xe(oe||e,function(Z,ae){oe&&(ae=Z,Z=e[ae]),Wn(S,ae,tt(Z,t,r,ae,e,g))}),S}function $l(e){var t=Ee(e);return function(r){return Hs(r,e,t)}}function Hs(e,t,r){var c=r.length;if(e==null)return!c;for(e=he(e);c--;){var d=r[c],g=t[d],S=e[d];if(S===n&&!(d in e)||!g(S))return!1}return!0}function qs(e,t,r){if(typeof e!="function")throw new Qe(p);return $n(function(){e.apply(n,r)},t)}function Bn(e,t,r,c){var d=-1,g=gr,S=!0,R=e.length,E=[],k=t.length;if(!R)return E;r&&(t=ye(t,ze(r))),c?(g=Pi,S=!1):t.length>=a&&(g=Ln,S=!1,t=new tn(t));e:for(;++d<R;){var U=e[d],G=r==null?U:r(U);if(U=c||U!==0?U:0,S&&G===G){for(var q=k;q--;)if(t[q]===G)continue e;E.push(U)}else g(t,G,c)||E.push(U)}return E}var Ht=ma(mt),Js=ma(Hi,!0);function jl(e,t){var r=!0;return Ht(e,function(c,d,g){return r=!!t(c,d,g),r}),r}function Mr(e,t,r){for(var c=-1,d=e.length;++c<d;){var g=e[c],S=t(g);if(S!=null&&(R===n?S===S&&!$e(S):r(S,R)))var R=S,E=g}return E}function Kl(e,t,r,c){var d=e.length;for(r=ie(r),r<0&&(r=-r>d?0:d+r),c=c===n||c>d?d:ie(c),c<0&&(c+=d),c=r>c?0:au(c);r<c;)e[r++]=t;return e}function zs(e,t){var r=[];return Ht(e,function(c,d,g){t(c,d,g)&&r.push(c)}),r}function Ae(e,t,r,c,d){var g=-1,S=e.length;for(r||(r=Fd),d||(d=[]);++g<S;){var R=e[g];t>0&&r(R)?t>1?Ae(R,t-1,r,c,d):Gt(d,R):c||(d[d.length]=R)}return d}var Bi=va(),Vs=va(!0);function mt(e,t){return e&&Bi(e,t,Ee)}function Hi(e,t){return e&&Vs(e,t,Ee)}function Lr(e,t){return Nt(t,function(r){return Ot(e[r])})}function rn(e,t){t=Jt(t,e);for(var r=0,c=t.length;e!=null&&r<c;)e=e[yt(t[r++])];return r&&r==c?e:n}function $s(e,t,r){var c=t(e);return te(e)?c:Gt(c,r(e))}function Le(e){return e==null?e===n?I:fr:Qt&&Qt in he(e)?Id(e):Jd(e)}function qi(e,t){return e>t}function Yl(e,t){return e!=null&&pe.call(e,t)}function Zl(e,t){return e!=null&&t in he(e)}function Xl(e,t,r){return e>=De(t,r)&&e<we(t,r)}function Ji(e,t,r){for(var c=r?Pi:gr,d=e[0].length,g=e.length,S=g,R=M(g),E=1/0,k=[];S--;){var U=e[S];S&&t&&(U=ye(U,ze(t))),E=De(U.length,E),R[S]=!r&&(t||d>=120&&U.length>=120)?new tn(S&&U):n}U=e[0];var G=-1,q=R[0];e:for(;++G<d&&k.length<E;){var V=U[G],Y=t?t(V):V;if(V=r||V!==0?V:0,!(q?Ln(q,Y):c(k,Y,r))){for(S=g;--S;){var oe=R[S];if(!(oe?Ln(oe,Y):c(e[S],Y,r)))continue e}q&&q.push(Y),k.push(V)}}return k}function Ql(e,t,r,c){return mt(e,function(d,g,S){t(c,r(d),g,S)}),c}function Hn(e,t,r){t=Jt(t,e),e=La(e,t);var c=e==null?e:e[yt(rt(t))];return c==null?n:Je(c,e,r)}function js(e){return Ce(e)&&Le(e)==kt}function ed(e){return Ce(e)&&Le(e)==F}function td(e){return Ce(e)&&Le(e)==Ut}function qn(e,t,r,c,d){return e===t?!0:e==null||t==null||!Ce(e)&&!Ce(t)?e!==e&&t!==t:nd(e,t,r,c,qn,d)}function nd(e,t,r,c,d,g){var S=te(e),R=te(t),E=S?hn:Me(e),k=R?hn:Me(t);E=E==kt?qe:E,k=k==kt?qe:k;var U=E==qe,G=k==qe,q=E==k;if(q&&Vt(e)){if(!Vt(t))return!1;S=!0,U=!1}if(q&&!U)return g||(g=new lt),S||wn(e)?wa(e,t,r,c,d,g):Od(e,t,E,r,c,d,g);if(!(r&j)){var V=U&&pe.call(e,"__wrapped__"),Y=G&&pe.call(t,"__wrapped__");if(V||Y){var oe=V?e.value():e,Z=Y?t.value():t;return g||(g=new lt),d(oe,Z,r,c,g)}}return q?(g||(g=new lt),Ad(e,t,r,c,d,g)):!1}function rd(e){return Ce(e)&&Me(e)==Ne}function zi(e,t,r,c){var d=r.length,g=d,S=!c;if(e==null)return!g;for(e=he(e);d--;){var R=r[d];if(S&&R[2]?R[1]!==e[R[0]]:!(R[0]in e))return!1}for(;++d<g;){R=r[d];var E=R[0],k=e[E],U=R[1];if(S&&R[2]){if(k===n&&!(E in e))return!1}else{var G=new lt;if(c)var q=c(k,U,E,e,t,G);if(!(q===n?qn(U,k,j|ee,c,G):q))return!1}}return!0}function Ks(e){if(!Se(e)||Gd(e))return!1;var t=Ot(e)?rl:Vc;return t.test(sn(e))}function id(e){return Ce(e)&&Le(e)==C}function od(e){return Ce(e)&&Me(e)==b}function sd(e){return Ce(e)&&Zr(e.length)&&!!ve[Le(e)]}function Ys(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?te(e)?Qs(e[0],e[1]):Xs(e):yu(e)}function Vi(e){if(!Vn(e))return cl(e);var t=[];for(var r in he(e))pe.call(e,r)&&r!="constructor"&&t.push(r);return t}function ad(e){if(!Se(e))return qd(e);var t=Vn(e),r=[];for(var c in e)c=="constructor"&&(t||!pe.call(e,c))||r.push(c);return r}function $i(e,t){return e<t}function Zs(e,t){var r=-1,c=We(e)?M(e.length):[];return Ht(e,function(d,g,S){c[++r]=t(d,g,S)}),c}function Xs(e){var t=uo(e);return t.length==1&&t[0][2]?Da(t[0][0],t[0][1]):function(r){return r===e||zi(r,e,t)}}function Qs(e,t){return fo(e)&&Ia(t)?Da(yt(e),t):function(r){var c=Co(r,e);return c===n&&c===t?bo(r,e):qn(t,c,j|ee)}}function kr(e,t,r,c,d){e!==t&&Bi(t,function(g,S){if(d||(d=new lt),Se(g))ud(e,t,S,r,kr,c,d);else{var R=c?c(po(e,S),g,S+"",e,t,d):n;R===n&&(R=g),Gi(e,S,R)}},Be)}function ud(e,t,r,c,d,g,S){var R=po(e,r),E=po(t,r),k=S.get(E);if(k){Gi(e,r,k);return}var U=g?g(R,E,r+"",e,t,S):n,G=U===n;if(G){var q=te(E),V=!q&&Vt(E),Y=!q&&!V&&wn(E);U=E,q||V||Y?te(R)?U=R:Te(R)?U=Ge(R):V?(G=!1,U=la(E,!0)):Y?(G=!1,U=da(E,!0)):U=[]:jn(E)||an(E)?(U=R,an(R)?U=uu(R):(!Se(R)||Ot(R))&&(U=Aa(E))):G=!1}G&&(S.set(E,U),d(U,E,c,g,S),S.delete(E)),Gi(e,r,U)}function ea(e,t){var r=e.length;if(r)return t+=t<0?r:0,Et(t,r)?e[t]:n}function ta(e,t,r){t.length?t=ye(t,function(g){return te(g)?function(S){return rn(S,g.length===1?g[0]:g)}:g}):t=[He];var c=-1;t=ye(t,ze(K()));var d=Zs(e,function(g,S,R){var E=ye(t,function(k){return k(g)});return{criteria:E,index:++c,value:g}});return kf(d,function(g,S){return Cd(g,S,r)})}function cd(e,t){return na(e,t,function(r,c){return bo(e,c)})}function na(e,t,r){for(var c=-1,d=t.length,g={};++c<d;){var S=t[c],R=rn(e,S);r(R,S)&&Jn(g,Jt(S,e),R)}return g}function fd(e){return function(t){return rn(t,e)}}function ji(e,t,r,c){var d=c?Lf:mn,g=-1,S=t.length,R=e;for(e===t&&(t=Ge(t)),r&&(R=ye(e,ze(r)));++g<S;)for(var E=0,k=t[g],U=r?r(k):k;(E=d(R,U,E,c))>-1;)R!==e&&xr.call(R,E,1),xr.call(e,E,1);return e}function ra(e,t){for(var r=e?t.length:0,c=r-1;r--;){var d=t[r];if(r==c||d!==g){var g=d;Et(d)?xr.call(e,d,1):Xi(e,d)}}return e}function Ki(e,t){return e+Er(Fs()*(t-e+1))}function ld(e,t,r,c){for(var d=-1,g=we(wr((t-e)/(r||1)),0),S=M(g);g--;)S[c?g:++d]=e,e+=r;return S}function Yi(e,t){var r="";if(!e||t<1||t>St)return r;do t%2&&(r+=e),t=Er(t/2),t&&(e+=e);while(t);return r}function se(e,t){return ho(Ma(e,t,He),e+"")}function dd(e){return Ws(En(e))}function pd(e,t){var r=En(e);return zr(r,nn(t,0,r.length))}function Jn(e,t,r,c){if(!Se(e))return e;t=Jt(t,e);for(var d=-1,g=t.length,S=g-1,R=e;R!=null&&++d<g;){var E=yt(t[d]),k=r;if(E==="__proto__"||E==="constructor"||E==="prototype")return e;if(d!=S){var U=R[E];k=c?c(U,E,R):n,k===n&&(k=Se(U)?U:Et(t[d+1])?[]:{})}Wn(R,E,k),R=R[E]}return e}var ia=Or?function(e,t){return Or.set(e,t),e}:He,hd=Pr?function(e,t){return Pr(e,"toString",{configurable:!0,enumerable:!1,value:Ro(t),writable:!0})}:He;function gd(e){return zr(En(e))}function nt(e,t,r){var c=-1,d=e.length;t<0&&(t=-t>d?0:d+t),r=r>d?d:r,r<0&&(r+=d),d=t>r?0:r-t>>>0,t>>>=0;for(var g=M(d);++c<d;)g[c]=e[c+t];return g}function md(e,t){var r;return Ht(e,function(c,d,g){return r=t(c,d,g),!r}),!!r}function Ur(e,t,r){var c=0,d=e==null?c:e.length;if(typeof t=="number"&&t===t&&d<=ar){for(;c<d;){var g=c+d>>>1,S=e[g];S!==null&&!$e(S)&&(r?S<=t:S<t)?c=g+1:d=g}return d}return Zi(e,t,He,r)}function Zi(e,t,r,c){var d=0,g=e==null?0:e.length;if(g===0)return 0;t=r(t);for(var S=t!==t,R=t===null,E=$e(t),k=t===n;d<g;){var U=Er((d+g)/2),G=r(e[U]),q=G!==n,V=G===null,Y=G===G,oe=$e(G);if(S)var Z=c||Y;else k?Z=Y&&(c||q):R?Z=Y&&q&&(c||!V):E?Z=Y&&q&&!V&&(c||!oe):V||oe?Z=!1:Z=c?G<=t:G<t;Z?d=U+1:g=U}return De(g,pn)}function oa(e,t){for(var r=-1,c=e.length,d=0,g=[];++r<c;){var S=e[r],R=t?t(S):S;if(!r||!dt(R,E)){var E=R;g[d++]=S===0?0:S}}return g}function sa(e){return typeof e=="number"?e:$e(e)?Lt:+e}function Ve(e){if(typeof e=="string")return e;if(te(e))return ye(e,Ve)+"";if($e(e))return Ns?Ns.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function qt(e,t,r){var c=-1,d=gr,g=e.length,S=!0,R=[],E=R;if(r)S=!1,d=Pi;else if(g>=a){var k=t?null:wd(e);if(k)return vr(k);S=!1,d=Ln,E=new tn}else E=t?[]:R;e:for(;++c<g;){var U=e[c],G=t?t(U):U;if(U=r||U!==0?U:0,S&&G===G){for(var q=E.length;q--;)if(E[q]===G)continue e;t&&E.push(G),R.push(U)}else d(E,G,r)||(E!==R&&E.push(G),R.push(U))}return R}function Xi(e,t){return t=Jt(t,e),e=La(e,t),e==null||delete e[yt(rt(t))]}function aa(e,t,r,c){return Jn(e,t,r(rn(e,t)),c)}function Fr(e,t,r,c){for(var d=e.length,g=c?d:-1;(c?g--:++g<d)&&t(e[g],g,e););return r?nt(e,c?0:g,c?g+1:d):nt(e,c?g+1:0,c?d:g)}function ua(e,t){var r=e;return r instanceof ue&&(r=r.value()),wi(t,function(c,d){return d.func.apply(d.thisArg,Gt([c],d.args))},r)}function Qi(e,t,r){var c=e.length;if(c<2)return c?qt(e[0]):[];for(var d=-1,g=M(c);++d<c;)for(var S=e[d],R=-1;++R<c;)R!=d&&(g[d]=Bn(g[d]||S,e[R],t,r));return qt(Ae(g,1),t,r)}function ca(e,t,r){for(var c=-1,d=e.length,g=t.length,S={};++c<d;){var R=c<g?t[c]:n;r(S,e[c],R)}return S}function eo(e){return Te(e)?e:[]}function to(e){return typeof e=="function"?e:He}function Jt(e,t){return te(e)?e:fo(e,t)?[e]:Na(de(e))}var vd=se;function zt(e,t,r){var c=e.length;return r=r===n?c:r,!t&&r>=c?e:nt(e,t,r)}var fa=il||function(e){return Oe.clearTimeout(e)};function la(e,t){if(t)return e.slice();var r=e.length,c=Ds?Ds(r):new e.constructor(r);return e.copy(c),c}function no(e){var t=new e.constructor(e.byteLength);return new Tr(t).set(new Tr(e)),t}function yd(e,t){var r=t?no(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function _d(e){var t=new e.constructor(e.source,jo.exec(e));return t.lastIndex=e.lastIndex,t}function Sd(e){return Gn?he(Gn.call(e)):{}}function da(e,t){var r=t?no(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function pa(e,t){if(e!==t){var r=e!==n,c=e===null,d=e===e,g=$e(e),S=t!==n,R=t===null,E=t===t,k=$e(t);if(!R&&!k&&!g&&e>t||g&&S&&E&&!R&&!k||c&&S&&E||!r&&E||!d)return 1;if(!c&&!g&&!k&&e<t||k&&r&&d&&!c&&!g||R&&r&&d||!S&&d||!E)return-1}return 0}function Cd(e,t,r){for(var c=-1,d=e.criteria,g=t.criteria,S=d.length,R=r.length;++c<S;){var E=pa(d[c],g[c]);if(E){if(c>=R)return E;var k=r[c];return E*(k=="desc"?-1:1)}}return e.index-t.index}function ha(e,t,r,c){for(var d=-1,g=e.length,S=r.length,R=-1,E=t.length,k=we(g-S,0),U=M(E+k),G=!c;++R<E;)U[R]=t[R];for(;++d<S;)(G||d<g)&&(U[r[d]]=e[d]);for(;k--;)U[R++]=e[d++];return U}function ga(e,t,r,c){for(var d=-1,g=e.length,S=-1,R=r.length,E=-1,k=t.length,U=we(g-R,0),G=M(U+k),q=!c;++d<U;)G[d]=e[d];for(var V=d;++E<k;)G[V+E]=t[E];for(;++S<R;)(q||d<g)&&(G[V+r[S]]=e[d++]);return G}function Ge(e,t){var r=-1,c=e.length;for(t||(t=M(c));++r<c;)t[r]=e[r];return t}function vt(e,t,r,c){var d=!r;r||(r={});for(var g=-1,S=t.length;++g<S;){var R=t[g],E=c?c(r[R],e[R],R,r,e):n;E===n&&(E=e[R]),d?xt(r,R,E):Wn(r,R,E)}return r}function bd(e,t){return vt(e,co(e),t)}function Td(e,t){return vt(e,Ea(e),t)}function Nr(e,t){return function(r,c){var d=te(r)?Ef:zl,g=t?t():{};return d(r,e,K(c,2),g)}}function Rn(e){return se(function(t,r){var c=-1,d=r.length,g=d>1?r[d-1]:n,S=d>2?r[2]:n;for(g=e.length>3&&typeof g=="function"?(d--,g):n,S&&ke(r[0],r[1],S)&&(g=d<3?n:g,d=1),t=he(t);++c<d;){var R=r[c];R&&e(t,R,c,g)}return t})}function ma(e,t){return function(r,c){if(r==null)return r;if(!We(r))return e(r,c);for(var d=r.length,g=t?d:-1,S=he(r);(t?g--:++g<d)&&c(S[g],g,S)!==!1;);return r}}function va(e){return function(t,r,c){for(var d=-1,g=he(t),S=c(t),R=S.length;R--;){var E=S[e?R:++d];if(r(g[E],E,g)===!1)break}return t}}function Rd(e,t,r){var c=t&xe,d=zn(e);function g(){var S=this&&this!==Oe&&this instanceof g?d:e;return S.apply(c?r:this,arguments)}return g}function ya(e){return function(t){t=de(t);var r=vn(t)?ft(t):n,c=r?r[0]:t.charAt(0),d=r?zt(r,1).join(""):t.slice(1);return c[e]()+d}}function xn(e){return function(t){return wi(mu(gu(t).replace(hf,"")),e,"")}}function zn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Tn(e.prototype),c=e.apply(r,t);return Se(c)?c:r}}function xd(e,t,r){var c=zn(e);function d(){for(var g=arguments.length,S=M(g),R=g,E=Pn(d);R--;)S[R]=arguments[R];var k=g<3&&S[0]!==E&&S[g-1]!==E?[]:Wt(S,E);if(g-=k.length,g<r)return Ta(e,t,Gr,d.placeholder,n,S,k,n,n,r-g);var U=this&&this!==Oe&&this instanceof d?c:e;return Je(U,this,S)}return d}function _a(e){return function(t,r,c){var d=he(t);if(!We(t)){var g=K(r,3);t=Ee(t),r=function(R){return g(d[R],R,d)}}var S=e(t,r,c);return S>-1?d[g?t[S]:S]:n}}function Sa(e){return wt(function(t){var r=t.length,c=r,d=et.prototype.thru;for(e&&t.reverse();c--;){var g=t[c];if(typeof g!="function")throw new Qe(p);if(d&&!S&&qr(g)=="wrapper")var S=new et([],!0)}for(c=S?c:r;++c<r;){g=t[c];var R=qr(g),E=R=="wrapper"?ao(g):n;E&&lo(E[0])&&E[1]==(me|$|Ie|ht)&&!E[4].length&&E[9]==1?S=S[qr(E[0])].apply(S,E[3]):S=g.length==1&&lo(g)?S[R]():S.thru(g)}return function(){var k=arguments,U=k[0];if(S&&k.length==1&&te(U))return S.plant(U).value();for(var G=0,q=r?t[G].apply(this,k):U;++G<r;)q=t[G].call(this,q);return q}})}function Gr(e,t,r,c,d,g,S,R,E,k){var U=t&me,G=t&xe,q=t&ot,V=t&($|X),Y=t&Zt,oe=q?n:zn(e);function Z(){for(var ae=arguments.length,ce=M(ae),je=ae;je--;)ce[je]=arguments[je];if(V)var Ue=Pn(Z),Ke=Ff(ce,Ue);if(c&&(ce=ha(ce,c,d,V)),g&&(ce=ga(ce,g,S,V)),ae-=Ke,V&&ae<k){var Re=Wt(ce,Ue);return Ta(e,t,Gr,Z.placeholder,r,ce,Re,R,E,k-ae)}var pt=G?r:this,It=q?pt[e]:e;return ae=ce.length,R?ce=zd(ce,R):Y&&ae>1&&ce.reverse(),U&&E<ae&&(ce.length=E),this&&this!==Oe&&this instanceof Z&&(It=oe||zn(It)),It.apply(pt,ce)}return Z}function Ca(e,t){return function(r,c){return Ql(r,e,t(c),{})}}function Wr(e,t){return function(r,c){var d;if(r===n&&c===n)return t;if(r!==n&&(d=r),c!==n){if(d===n)return c;typeof r=="string"||typeof c=="string"?(r=Ve(r),c=Ve(c)):(r=sa(r),c=sa(c)),d=e(r,c)}return d}}function ro(e){return wt(function(t){return t=ye(t,ze(K())),se(function(r){var c=this;return e(t,function(d){return Je(d,c,r)})})})}function Br(e,t){t=t===n?" ":Ve(t);var r=t.length;if(r<2)return r?Yi(t,e):t;var c=Yi(t,wr(e/yn(t)));return vn(t)?zt(ft(c),0,e).join(""):c.slice(0,e)}function Pd(e,t,r,c){var d=t&xe,g=zn(e);function S(){for(var R=-1,E=arguments.length,k=-1,U=c.length,G=M(U+E),q=this&&this!==Oe&&this instanceof S?g:e;++k<U;)G[k]=c[k];for(;E--;)G[k++]=arguments[++R];return Je(q,d?r:this,G)}return S}function ba(e){return function(t,r,c){return c&&typeof c!="number"&&ke(t,r,c)&&(r=c=n),t=At(t),r===n?(r=t,t=0):r=At(r),c=c===n?t<r?1:-1:At(c),ld(t,r,c,e)}}function Hr(e){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=it(t),r=it(r)),e(t,r)}}function Ta(e,t,r,c,d,g,S,R,E,k){var U=t&$,G=U?S:n,q=U?n:S,V=U?g:n,Y=U?n:g;t|=U?Ie:st,t&=~(U?st:Ie),t&_e||(t&=-4);var oe=[e,t,d,V,G,Y,q,R,E,k],Z=r.apply(n,oe);return lo(e)&&ka(Z,oe),Z.placeholder=c,Ua(Z,e,t)}function io(e){var t=Pe[e];return function(r,c){if(r=it(r),c=c==null?0:De(ie(c),292),c&&Us(r)){var d=(de(r)+"e").split("e"),g=t(d[0]+"e"+(+d[1]+c));return d=(de(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-c))}return t(r)}}var wd=Cn&&1/vr(new Cn([,-0]))[1]==Mt?function(e){return new Cn(e)}:wo;function Ra(e){return function(t){var r=Me(t);return r==Ne?Li(t):r==b?Jf(t):Uf(t,e(t))}}function Pt(e,t,r,c,d,g,S,R){var E=t&ot;if(!E&&typeof e!="function")throw new Qe(p);var k=c?c.length:0;if(k||(t&=-97,c=d=n),S=S===n?S:we(ie(S),0),R=R===n?R:ie(R),k-=d?d.length:0,t&st){var U=c,G=d;c=d=n}var q=E?n:ao(e),V=[e,t,r,c,d,U,G,g,S,R];if(q&&Hd(V,q),e=V[0],t=V[1],r=V[2],c=V[3],d=V[4],R=V[9]=V[9]===n?E?0:e.length:we(V[9]-k,0),!R&&t&($|X)&&(t&=-25),!t||t==xe)var Y=Rd(e,t,r);else t==$||t==X?Y=xd(e,t,R):(t==Ie||t==(xe|Ie))&&!d.length?Y=Pd(e,t,r,c):Y=Gr.apply(n,V);var oe=q?ia:ka;return Ua(oe(Y,V),e,t)}function xa(e,t,r,c){return e===n||dt(e,Sn[r])&&!pe.call(c,r)?t:e}function Pa(e,t,r,c,d,g){return Se(e)&&Se(t)&&(g.set(t,e),kr(e,t,n,Pa,g),g.delete(t)),e}function Ed(e){return jn(e)?n:e}function wa(e,t,r,c,d,g){var S=r&j,R=e.length,E=t.length;if(R!=E&&!(S&&E>R))return!1;var k=g.get(e),U=g.get(t);if(k&&U)return k==t&&U==e;var G=-1,q=!0,V=r&ee?new tn:n;for(g.set(e,t),g.set(t,e);++G<R;){var Y=e[G],oe=t[G];if(c)var Z=S?c(oe,Y,G,t,e,g):c(Y,oe,G,e,t,g);if(Z!==n){if(Z)continue;q=!1;break}if(V){if(!Ei(t,function(ae,ce){if(!Ln(V,ce)&&(Y===ae||d(Y,ae,r,c,g)))return V.push(ce)})){q=!1;break}}else if(!(Y===oe||d(Y,oe,r,c,g))){q=!1;break}}return g.delete(e),g.delete(t),q}function Od(e,t,r,c,d,g,S){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F:return!(e.byteLength!=t.byteLength||!g(new Tr(e),new Tr(t)));case Ct:case Ut:case Ft:return dt(+e,+t);case at:return e.name==t.name&&e.message==t.message;case C:case y:return e==t+"";case Ne:var R=Li;case b:var E=c&j;if(R||(R=vr),e.size!=t.size&&!E)return!1;var k=S.get(e);if(k)return k==t;c|=ee,S.set(e,t);var U=wa(R(e),R(t),c,d,g,S);return S.delete(e),U;case O:if(Gn)return Gn.call(e)==Gn.call(t)}return!1}function Ad(e,t,r,c,d,g){var S=r&j,R=oo(e),E=R.length,k=oo(t),U=k.length;if(E!=U&&!S)return!1;for(var G=E;G--;){var q=R[G];if(!(S?q in t:pe.call(t,q)))return!1}var V=g.get(e),Y=g.get(t);if(V&&Y)return V==t&&Y==e;var oe=!0;g.set(e,t),g.set(t,e);for(var Z=S;++G<E;){q=R[G];var ae=e[q],ce=t[q];if(c)var je=S?c(ce,ae,q,t,e,g):c(ae,ce,q,e,t,g);if(!(je===n?ae===ce||d(ae,ce,r,c,g):je)){oe=!1;break}Z||(Z=q=="constructor")}if(oe&&!Z){var Ue=e.constructor,Ke=t.constructor;Ue!=Ke&&"constructor"in e&&"constructor"in t&&!(typeof Ue=="function"&&Ue instanceof Ue&&typeof Ke=="function"&&Ke instanceof Ke)&&(oe=!1)}return g.delete(e),g.delete(t),oe}function wt(e){return ho(Ma(e,n,Ha),e+"")}function oo(e){return $s(e,Ee,co)}function so(e){return $s(e,Be,Ea)}var ao=Or?function(e){return Or.get(e)}:wo;function qr(e){for(var t=e.name+"",r=bn[t],c=pe.call(bn,t)?r.length:0;c--;){var d=r[c],g=d.func;if(g==null||g==e)return d.name}return t}function Pn(e){var t=pe.call(h,"placeholder")?h:e;return t.placeholder}function K(){var e=h.iteratee||xo;return e=e===xo?Ys:e,arguments.length?e(arguments[0],arguments[1]):e}function Jr(e,t){var r=e.__data__;return Nd(t)?r[typeof t=="string"?"string":"hash"]:r.map}function uo(e){for(var t=Ee(e),r=t.length;r--;){var c=t[r],d=e[c];t[r]=[c,d,Ia(d)]}return t}function on(e,t){var r=Bf(e,t);return Ks(r)?r:n}function Id(e){var t=pe.call(e,Qt),r=e[Qt];try{e[Qt]=n;var c=!0}catch{}var d=Cr.call(e);return c&&(t?e[Qt]=r:delete e[Qt]),d}var co=Ui?function(e){return e==null?[]:(e=he(e),Nt(Ui(e),function(t){return Ls.call(e,t)}))}:Eo,Ea=Ui?function(e){for(var t=[];e;)Gt(t,co(e)),e=Rr(e);return t}:Eo,Me=Le;(Fi&&Me(new Fi(new ArrayBuffer(1)))!=x||Un&&Me(new Un)!=Ne||Ni&&Me(Ni.resolve())!=lr||Cn&&Me(new Cn)!=b||Fn&&Me(new Fn)!=w)&&(Me=function(e){var t=Le(e),r=t==qe?e.constructor:n,c=r?sn(r):"";if(c)switch(c){case pl:return x;case hl:return Ne;case gl:return lr;case ml:return b;case vl:return w}return t});function Dd(e,t,r){for(var c=-1,d=r.length;++c<d;){var g=r[c],S=g.size;switch(g.type){case"drop":e+=S;break;case"dropRight":t-=S;break;case"take":t=De(t,e+S);break;case"takeRight":e=we(e,t-S);break}}return{start:e,end:t}}function Md(e){var t=e.match(Nc);return t?t[1].split(Gc):[]}function Oa(e,t,r){t=Jt(t,e);for(var c=-1,d=t.length,g=!1;++c<d;){var S=yt(t[c]);if(!(g=e!=null&&r(e,S)))break;e=e[S]}return g||++c!=d?g:(d=e==null?0:e.length,!!d&&Zr(d)&&Et(S,d)&&(te(e)||an(e)))}function Ld(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Aa(e){return typeof e.constructor=="function"&&!Vn(e)?Tn(Rr(e)):{}}function kd(e,t,r){var c=e.constructor;switch(t){case F:return no(e);case Ct:case Ut:return new c(+e);case x:return yd(e,r);case A:case B:case re:case fe:case ct:case N:case ne:case be:case gt:return da(e,r);case Ne:return new c;case Ft:case y:return new c(e);case C:return _d(e);case b:return new c;case O:return Sd(e)}}function Ud(e,t){var r=t.length;if(!r)return e;var c=r-1;return t[c]=(r>1?"& ":"")+t[c],t=t.join(r>2?", ":" "),e.replace(Fc,"{\n/* [wrapped with "+t+"] */\n")}function Fd(e){return te(e)||an(e)||!!(ks&&e&&e[ks])}function Et(e,t){var r=typeof e;return t=t==null?St:t,!!t&&(r=="number"||r!="symbol"&&jc.test(e))&&e>-1&&e%1==0&&e<t}function ke(e,t,r){if(!Se(r))return!1;var c=typeof t;return(c=="number"?We(r)&&Et(t,r.length):c=="string"&&t in r)?dt(r[t],e):!1}function fo(e,t){if(te(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$e(e)?!0:Mc.test(e)||!Dc.test(e)||t!=null&&e in he(t)}function Nd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function lo(e){var t=qr(e),r=h[t];if(typeof r!="function"||!(t in ue.prototype))return!1;if(e===r)return!0;var c=ao(r);return!!c&&e===c[0]}function Gd(e){return!!Is&&Is in e}var Wd=_r?Ot:Oo;function Vn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Sn;return e===r}function Ia(e){return e===e&&!Se(e)}function Da(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in he(r))}}function Bd(e){var t=Kr(e,function(c){return r.size===l&&r.clear(),c}),r=t.cache;return t}function Hd(e,t){var r=e[1],c=t[1],d=r|c,g=d<(xe|ot|me),S=c==me&&r==$||c==me&&r==ht&&e[7].length<=t[8]||c==(me|ht)&&t[7].length<=t[8]&&r==$;if(!(g||S))return e;c&xe&&(e[2]=t[2],d|=r&xe?0:_e);var R=t[3];if(R){var E=e[3];e[3]=E?ha(E,R,t[4]):R,e[4]=E?Wt(e[3],_):t[4]}return R=t[5],R&&(E=e[5],e[5]=E?ga(E,R,t[6]):R,e[6]=E?Wt(e[5],_):t[6]),R=t[7],R&&(e[7]=R),c&me&&(e[8]=e[8]==null?t[8]:De(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=d,e}function qd(e){var t=[];if(e!=null)for(var r in he(e))t.push(r);return t}function Jd(e){return Cr.call(e)}function Ma(e,t,r){return t=we(t===n?e.length-1:t,0),function(){for(var c=arguments,d=-1,g=we(c.length-t,0),S=M(g);++d<g;)S[d]=c[t+d];d=-1;for(var R=M(t+1);++d<t;)R[d]=c[d];return R[t]=r(S),Je(e,this,R)}}function La(e,t){return t.length<2?e:rn(e,nt(t,0,-1))}function zd(e,t){for(var r=e.length,c=De(t.length,r),d=Ge(e);c--;){var g=t[c];e[c]=Et(g,r)?d[g]:n}return e}function po(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var ka=Fa(ia),$n=sl||function(e,t){return Oe.setTimeout(e,t)},ho=Fa(hd);function Ua(e,t,r){var c=t+"";return ho(e,Ud(c,Vd(Md(c),r)))}function Fa(e){var t=0,r=0;return function(){var c=fl(),d=hi-(c-r);if(r=c,d>0){if(++t>=pi)return arguments[0]}else t=0;return e.apply(n,arguments)}}function zr(e,t){var r=-1,c=e.length,d=c-1;for(t=t===n?c:t;++r<t;){var g=Ki(r,d),S=e[g];e[g]=e[r],e[r]=S}return e.length=t,e}var Na=Bd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Lc,function(r,c,d,g){t.push(d?g.replace(Hc,"$1"):c||r)}),t});function yt(e){if(typeof e=="string"||$e(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function sn(e){if(e!=null){try{return Sr.call(e)}catch{}try{return e+""}catch{}}return""}function Vd(e,t){return Xe(gi,function(r){var c="_."+r[0];t&r[1]&&!gr(e,c)&&e.push(c)}),e.sort()}function Ga(e){if(e instanceof ue)return e.clone();var t=new et(e.__wrapped__,e.__chain__);return t.__actions__=Ge(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function $d(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=we(ie(t),0);var c=e==null?0:e.length;if(!c||t<1)return[];for(var d=0,g=0,S=M(wr(c/t));d<c;)S[g++]=nt(e,d,d+=t);return S}function jd(e){for(var t=-1,r=e==null?0:e.length,c=0,d=[];++t<r;){var g=e[t];g&&(d[c++]=g)}return d}function Kd(){var e=arguments.length;if(!e)return[];for(var t=M(e-1),r=arguments[0],c=e;c--;)t[c-1]=arguments[c];return Gt(te(r)?Ge(r):[r],Ae(t,1))}var Yd=se(function(e,t){return Te(e)?Bn(e,Ae(t,1,Te,!0)):[]}),Zd=se(function(e,t){var r=rt(t);return Te(r)&&(r=n),Te(e)?Bn(e,Ae(t,1,Te,!0),K(r,2)):[]}),Xd=se(function(e,t){var r=rt(t);return Te(r)&&(r=n),Te(e)?Bn(e,Ae(t,1,Te,!0),n,r):[]});function Qd(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),nt(e,t<0?0:t,c)):[]}function ep(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),t=c-t,nt(e,0,t<0?0:t)):[]}function tp(e,t){return e&&e.length?Fr(e,K(t,3),!0,!0):[]}function np(e,t){return e&&e.length?Fr(e,K(t,3),!0):[]}function rp(e,t,r,c){var d=e==null?0:e.length;return d?(r&&typeof r!="number"&&ke(e,t,r)&&(r=0,c=d),Kl(e,t,r,c)):[]}function Wa(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=r==null?0:ie(r);return d<0&&(d=we(c+d,0)),mr(e,K(t,3),d)}function Ba(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=c-1;return r!==n&&(d=ie(r),d=r<0?we(c+d,0):De(d,c-1)),mr(e,K(t,3),d,!0)}function Ha(e){var t=e==null?0:e.length;return t?Ae(e,1):[]}function ip(e){var t=e==null?0:e.length;return t?Ae(e,Mt):[]}function op(e,t){var r=e==null?0:e.length;return r?(t=t===n?1:ie(t),Ae(e,t)):[]}function sp(e){for(var t=-1,r=e==null?0:e.length,c={};++t<r;){var d=e[t];c[d[0]]=d[1]}return c}function qa(e){return e&&e.length?e[0]:n}function ap(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=r==null?0:ie(r);return d<0&&(d=we(c+d,0)),mn(e,t,d)}function up(e){var t=e==null?0:e.length;return t?nt(e,0,-1):[]}var cp=se(function(e){var t=ye(e,eo);return t.length&&t[0]===e[0]?Ji(t):[]}),fp=se(function(e){var t=rt(e),r=ye(e,eo);return t===rt(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Ji(r,K(t,2)):[]}),lp=se(function(e){var t=rt(e),r=ye(e,eo);return t=typeof t=="function"?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Ji(r,n,t):[]});function dp(e,t){return e==null?"":ul.call(e,t)}function rt(e){var t=e==null?0:e.length;return t?e[t-1]:n}function pp(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=c;return r!==n&&(d=ie(r),d=d<0?we(c+d,0):De(d,c-1)),t===t?Vf(e,t,d):mr(e,Ts,d,!0)}function hp(e,t){return e&&e.length?ea(e,ie(t)):n}var gp=se(Ja);function Ja(e,t){return e&&e.length&&t&&t.length?ji(e,t):e}function mp(e,t,r){return e&&e.length&&t&&t.length?ji(e,t,K(r,2)):e}function vp(e,t,r){return e&&e.length&&t&&t.length?ji(e,t,n,r):e}var yp=wt(function(e,t){var r=e==null?0:e.length,c=Wi(e,t);return ra(e,ye(t,function(d){return Et(d,r)?+d:d}).sort(pa)),c});function _p(e,t){var r=[];if(!(e&&e.length))return r;var c=-1,d=[],g=e.length;for(t=K(t,3);++c<g;){var S=e[c];t(S,c,e)&&(r.push(S),d.push(c))}return ra(e,d),r}function go(e){return e==null?e:dl.call(e)}function Sp(e,t,r){var c=e==null?0:e.length;return c?(r&&typeof r!="number"&&ke(e,t,r)?(t=0,r=c):(t=t==null?0:ie(t),r=r===n?c:ie(r)),nt(e,t,r)):[]}function Cp(e,t){return Ur(e,t)}function bp(e,t,r){return Zi(e,t,K(r,2))}function Tp(e,t){var r=e==null?0:e.length;if(r){var c=Ur(e,t);if(c<r&&dt(e[c],t))return c}return-1}function Rp(e,t){return Ur(e,t,!0)}function xp(e,t,r){return Zi(e,t,K(r,2),!0)}function Pp(e,t){var r=e==null?0:e.length;if(r){var c=Ur(e,t,!0)-1;if(dt(e[c],t))return c}return-1}function wp(e){return e&&e.length?oa(e):[]}function Ep(e,t){return e&&e.length?oa(e,K(t,2)):[]}function Op(e){var t=e==null?0:e.length;return t?nt(e,1,t):[]}function Ap(e,t,r){return e&&e.length?(t=r||t===n?1:ie(t),nt(e,0,t<0?0:t)):[]}function Ip(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),t=c-t,nt(e,t<0?0:t,c)):[]}function Dp(e,t){return e&&e.length?Fr(e,K(t,3),!1,!0):[]}function Mp(e,t){return e&&e.length?Fr(e,K(t,3)):[]}var Lp=se(function(e){return qt(Ae(e,1,Te,!0))}),kp=se(function(e){var t=rt(e);return Te(t)&&(t=n),qt(Ae(e,1,Te,!0),K(t,2))}),Up=se(function(e){var t=rt(e);return t=typeof t=="function"?t:n,qt(Ae(e,1,Te,!0),n,t)});function Fp(e){return e&&e.length?qt(e):[]}function Np(e,t){return e&&e.length?qt(e,K(t,2)):[]}function Gp(e,t){return t=typeof t=="function"?t:n,e&&e.length?qt(e,n,t):[]}function mo(e){if(!(e&&e.length))return[];var t=0;return e=Nt(e,function(r){if(Te(r))return t=we(r.length,t),!0}),Di(t,function(r){return ye(e,Oi(r))})}function za(e,t){if(!(e&&e.length))return[];var r=mo(e);return t==null?r:ye(r,function(c){return Je(t,n,c)})}var Wp=se(function(e,t){return Te(e)?Bn(e,t):[]}),Bp=se(function(e){return Qi(Nt(e,Te))}),Hp=se(function(e){var t=rt(e);return Te(t)&&(t=n),Qi(Nt(e,Te),K(t,2))}),qp=se(function(e){var t=rt(e);return t=typeof t=="function"?t:n,Qi(Nt(e,Te),n,t)}),Jp=se(mo);function zp(e,t){return ca(e||[],t||[],Wn)}function Vp(e,t){return ca(e||[],t||[],Jn)}var $p=se(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r=="function"?(e.pop(),r):n,za(e,r)});function Va(e){var t=h(e);return t.__chain__=!0,t}function jp(e,t){return t(e),e}function Vr(e,t){return t(e)}var Kp=wt(function(e){var t=e.length,r=t?e[0]:0,c=this.__wrapped__,d=function(g){return Wi(g,e)};return t>1||this.__actions__.length||!(c instanceof ue)||!Et(r)?this.thru(d):(c=c.slice(r,+r+(t?1:0)),c.__actions__.push({func:Vr,args:[d],thisArg:n}),new et(c,this.__chain__).thru(function(g){return t&&!g.length&&g.push(n),g}))});function Yp(){return Va(this)}function Zp(){return new et(this.value(),this.__chain__)}function Xp(){this.__values__===n&&(this.__values__=su(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function Qp(){return this}function eh(e){for(var t,r=this;r instanceof Ir;){var c=Ga(r);c.__index__=0,c.__values__=n,t?d.__wrapped__=c:t=c;var d=c;r=r.__wrapped__}return d.__wrapped__=e,t}function th(){var e=this.__wrapped__;if(e instanceof ue){var t=e;return this.__actions__.length&&(t=new ue(this)),t=t.reverse(),t.__actions__.push({func:Vr,args:[go],thisArg:n}),new et(t,this.__chain__)}return this.thru(go)}function nh(){return ua(this.__wrapped__,this.__actions__)}var rh=Nr(function(e,t,r){pe.call(e,r)?++e[r]:xt(e,r,1)});function ih(e,t,r){var c=te(e)?Cs:jl;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}function oh(e,t){var r=te(e)?Nt:zs;return r(e,K(t,3))}var sh=_a(Wa),ah=_a(Ba);function uh(e,t){return Ae($r(e,t),1)}function ch(e,t){return Ae($r(e,t),Mt)}function fh(e,t,r){return r=r===n?1:ie(r),Ae($r(e,t),r)}function $a(e,t){var r=te(e)?Xe:Ht;return r(e,K(t,3))}function ja(e,t){var r=te(e)?Of:Js;return r(e,K(t,3))}var lh=Nr(function(e,t,r){pe.call(e,r)?e[r].push(t):xt(e,r,[t])});function dh(e,t,r,c){e=We(e)?e:En(e),r=r&&!c?ie(r):0;var d=e.length;return r<0&&(r=we(d+r,0)),Xr(e)?r<=d&&e.indexOf(t,r)>-1:!!d&&mn(e,t,r)>-1}var ph=se(function(e,t,r){var c=-1,d=typeof t=="function",g=We(e)?M(e.length):[];return Ht(e,function(S){g[++c]=d?Je(t,S,r):Hn(S,t,r)}),g}),hh=Nr(function(e,t,r){xt(e,r,t)});function $r(e,t){var r=te(e)?ye:Zs;return r(e,K(t,3))}function gh(e,t,r,c){return e==null?[]:(te(t)||(t=t==null?[]:[t]),r=c?n:r,te(r)||(r=r==null?[]:[r]),ta(e,t,r))}var mh=Nr(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});function vh(e,t,r){var c=te(e)?wi:xs,d=arguments.length<3;return c(e,K(t,4),r,d,Ht)}function yh(e,t,r){var c=te(e)?Af:xs,d=arguments.length<3;return c(e,K(t,4),r,d,Js)}function _h(e,t){var r=te(e)?Nt:zs;return r(e,Yr(K(t,3)))}function Sh(e){var t=te(e)?Ws:dd;return t(e)}function Ch(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=ie(t);var c=te(e)?ql:pd;return c(e,t)}function bh(e){var t=te(e)?Jl:gd;return t(e)}function Th(e){if(e==null)return 0;if(We(e))return Xr(e)?yn(e):e.length;var t=Me(e);return t==Ne||t==b?e.size:Vi(e).length}function Rh(e,t,r){var c=te(e)?Ei:md;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}var xh=se(function(e,t){if(e==null)return[];var r=t.length;return r>1&&ke(e,t[0],t[1])?t=[]:r>2&&ke(t[0],t[1],t[2])&&(t=[t[0]]),ta(e,Ae(t,1),[])}),jr=ol||function(){return Oe.Date.now()};function Ph(e,t){if(typeof t!="function")throw new Qe(p);return e=ie(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ka(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,Pt(e,me,n,n,n,n,t)}function Ya(e,t){var r;if(typeof t!="function")throw new Qe(p);return e=ie(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var vo=se(function(e,t,r){var c=xe;if(r.length){var d=Wt(r,Pn(vo));c|=Ie}return Pt(e,c,t,r,d)}),Za=se(function(e,t,r){var c=xe|ot;if(r.length){var d=Wt(r,Pn(Za));c|=Ie}return Pt(t,c,e,r,d)});function Xa(e,t,r){t=r?n:t;var c=Pt(e,$,n,n,n,n,n,t);return c.placeholder=Xa.placeholder,c}function Qa(e,t,r){t=r?n:t;var c=Pt(e,X,n,n,n,n,n,t);return c.placeholder=Qa.placeholder,c}function eu(e,t,r){var c,d,g,S,R,E,k=0,U=!1,G=!1,q=!0;if(typeof e!="function")throw new Qe(p);t=it(t)||0,Se(r)&&(U=!!r.leading,G="maxWait"in r,g=G?we(it(r.maxWait)||0,t):g,q="trailing"in r?!!r.trailing:q);function V(Re){var pt=c,It=d;return c=d=n,k=Re,S=e.apply(It,pt),S}function Y(Re){return k=Re,R=$n(ae,t),U?V(Re):S}function oe(Re){var pt=Re-E,It=Re-k,_u=t-pt;return G?De(_u,g-It):_u}function Z(Re){var pt=Re-E,It=Re-k;return E===n||pt>=t||pt<0||G&&It>=g}function ae(){var Re=jr();if(Z(Re))return ce(Re);R=$n(ae,oe(Re))}function ce(Re){return R=n,q&&c?V(Re):(c=d=n,S)}function je(){R!==n&&fa(R),k=0,c=E=d=R=n}function Ue(){return R===n?S:ce(jr())}function Ke(){var Re=jr(),pt=Z(Re);if(c=arguments,d=this,E=Re,pt){if(R===n)return Y(E);if(G)return fa(R),R=$n(ae,t),V(E)}return R===n&&(R=$n(ae,t)),S}return Ke.cancel=je,Ke.flush=Ue,Ke}var wh=se(function(e,t){return qs(e,1,t)}),Eh=se(function(e,t,r){return qs(e,it(t)||0,r)});function Oh(e){return Pt(e,Zt)}function Kr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Qe(p);var r=function(){var c=arguments,d=t?t.apply(this,c):c[0],g=r.cache;if(g.has(d))return g.get(d);var S=e.apply(this,c);return r.cache=g.set(d,S)||g,S};return r.cache=new(Kr.Cache||Rt),r}Kr.Cache=Rt;function Yr(e){if(typeof e!="function")throw new Qe(p);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Ah(e){return Ya(2,e)}var Ih=vd(function(e,t){t=t.length==1&&te(t[0])?ye(t[0],ze(K())):ye(Ae(t,1),ze(K()));var r=t.length;return se(function(c){for(var d=-1,g=De(c.length,r);++d<g;)c[d]=t[d].call(this,c[d]);return Je(e,this,c)})}),yo=se(function(e,t){var r=Wt(t,Pn(yo));return Pt(e,Ie,n,t,r)}),tu=se(function(e,t){var r=Wt(t,Pn(tu));return Pt(e,st,n,t,r)}),Dh=wt(function(e,t){return Pt(e,ht,n,n,n,t)});function Mh(e,t){if(typeof e!="function")throw new Qe(p);return t=t===n?t:ie(t),se(e,t)}function Lh(e,t){if(typeof e!="function")throw new Qe(p);return t=t==null?0:we(ie(t),0),se(function(r){var c=r[t],d=zt(r,0,t);return c&&Gt(d,c),Je(e,this,d)})}function kh(e,t,r){var c=!0,d=!0;if(typeof e!="function")throw new Qe(p);return Se(r)&&(c="leading"in r?!!r.leading:c,d="trailing"in r?!!r.trailing:d),eu(e,t,{leading:c,maxWait:t,trailing:d})}function Uh(e){return Ka(e,1)}function Fh(e,t){return yo(to(t),e)}function Nh(){if(!arguments.length)return[];var e=arguments[0];return te(e)?e:[e]}function Gh(e){return tt(e,z)}function Wh(e,t){return t=typeof t=="function"?t:n,tt(e,z,t)}function Bh(e){return tt(e,D|z)}function Hh(e,t){return t=typeof t=="function"?t:n,tt(e,D|z,t)}function qh(e,t){return t==null||Hs(e,t,Ee(t))}function dt(e,t){return e===t||e!==e&&t!==t}var Jh=Hr(qi),zh=Hr(function(e,t){return e>=t}),an=js(function(){return arguments}())?js:function(e){return Ce(e)&&pe.call(e,"callee")&&!Ls.call(e,"callee")},te=M.isArray,Vh=gs?ze(gs):ed;function We(e){return e!=null&&Zr(e.length)&&!Ot(e)}function Te(e){return Ce(e)&&We(e)}function $h(e){return e===!0||e===!1||Ce(e)&&Le(e)==Ct}var Vt=al||Oo,jh=ms?ze(ms):td;function Kh(e){return Ce(e)&&e.nodeType===1&&!jn(e)}function Yh(e){if(e==null)return!0;if(We(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||wn(e)||an(e)))return!e.length;var t=Me(e);if(t==Ne||t==b)return!e.size;if(Vn(e))return!Vi(e).length;for(var r in e)if(pe.call(e,r))return!1;return!0}function Zh(e,t){return qn(e,t)}function Xh(e,t,r){r=typeof r=="function"?r:n;var c=r?r(e,t):n;return c===n?qn(e,t,n,r):!!c}function _o(e){if(!Ce(e))return!1;var t=Le(e);return t==at||t==cr||typeof e.message=="string"&&typeof e.name=="string"&&!jn(e)}function Qh(e){return typeof e=="number"&&Us(e)}function Ot(e){if(!Se(e))return!1;var t=Le(e);return t==bt||t==ut||t==ur||t==v}function nu(e){return typeof e=="number"&&e==ie(e)}function Zr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=St}function Se(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ce(e){return e!=null&&typeof e=="object"}var ru=vs?ze(vs):rd;function eg(e,t){return e===t||zi(e,t,uo(t))}function tg(e,t,r){return r=typeof r=="function"?r:n,zi(e,t,uo(t),r)}function ng(e){return iu(e)&&e!=+e}function rg(e){if(Wd(e))throw new Q(u);return Ks(e)}function ig(e){return e===null}function og(e){return e==null}function iu(e){return typeof e=="number"||Ce(e)&&Le(e)==Ft}function jn(e){if(!Ce(e)||Le(e)!=qe)return!1;var t=Rr(e);if(t===null)return!0;var r=pe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==tl}var So=ys?ze(ys):id;function sg(e){return nu(e)&&e>=-9007199254740991&&e<=St}var ou=_s?ze(_s):od;function Xr(e){return typeof e=="string"||!te(e)&&Ce(e)&&Le(e)==y}function $e(e){return typeof e=="symbol"||Ce(e)&&Le(e)==O}var wn=Ss?ze(Ss):sd;function ag(e){return e===n}function ug(e){return Ce(e)&&Me(e)==w}function cg(e){return Ce(e)&&Le(e)==W}var fg=Hr($i),lg=Hr(function(e,t){return e<=t});function su(e){if(!e)return[];if(We(e))return Xr(e)?ft(e):Ge(e);if(kn&&e[kn])return qf(e[kn]());var t=Me(e),r=t==Ne?Li:t==b?vr:En;return r(e)}function At(e){if(!e)return e===0?e:0;if(e=it(e),e===Mt||e===-1/0){var t=e<0?-1:1;return t*sr}return e===e?e:0}function ie(e){var t=At(e),r=t%1;return t===t?r?t-r:t:0}function au(e){return e?nn(ie(e),0,Ye):0}function it(e){if(typeof e=="number")return e;if($e(e))return Lt;if(Se(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Se(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ps(e);var r=zc.test(e);return r||$c.test(e)?Pf(e.slice(2),r?2:8):Jc.test(e)?Lt:+e}function uu(e){return vt(e,Be(e))}function dg(e){return e?nn(ie(e),-9007199254740991,St):e===0?e:0}function de(e){return e==null?"":Ve(e)}var pg=Rn(function(e,t){if(Vn(t)||We(t)){vt(t,Ee(t),e);return}for(var r in t)pe.call(t,r)&&Wn(e,r,t[r])}),cu=Rn(function(e,t){vt(t,Be(t),e)}),Qr=Rn(function(e,t,r,c){vt(t,Be(t),e,c)}),hg=Rn(function(e,t,r,c){vt(t,Ee(t),e,c)}),gg=wt(Wi);function mg(e,t){var r=Tn(e);return t==null?r:Bs(r,t)}var vg=se(function(e,t){e=he(e);var r=-1,c=t.length,d=c>2?t[2]:n;for(d&&ke(t[0],t[1],d)&&(c=1);++r<c;)for(var g=t[r],S=Be(g),R=-1,E=S.length;++R<E;){var k=S[R],U=e[k];(U===n||dt(U,Sn[k])&&!pe.call(e,k))&&(e[k]=g[k])}return e}),yg=se(function(e){return e.push(n,Pa),Je(fu,n,e)});function _g(e,t){return bs(e,K(t,3),mt)}function Sg(e,t){return bs(e,K(t,3),Hi)}function Cg(e,t){return e==null?e:Bi(e,K(t,3),Be)}function bg(e,t){return e==null?e:Vs(e,K(t,3),Be)}function Tg(e,t){return e&&mt(e,K(t,3))}function Rg(e,t){return e&&Hi(e,K(t,3))}function xg(e){return e==null?[]:Lr(e,Ee(e))}function Pg(e){return e==null?[]:Lr(e,Be(e))}function Co(e,t,r){var c=e==null?n:rn(e,t);return c===n?r:c}function wg(e,t){return e!=null&&Oa(e,t,Yl)}function bo(e,t){return e!=null&&Oa(e,t,Zl)}var Eg=Ca(function(e,t,r){t!=null&&typeof t.toString!="function"&&(t=Cr.call(t)),e[t]=r},Ro(He)),Og=Ca(function(e,t,r){t!=null&&typeof t.toString!="function"&&(t=Cr.call(t)),pe.call(e,t)?e[t].push(r):e[t]=[r]},K),Ag=se(Hn);function Ee(e){return We(e)?Gs(e):Vi(e)}function Be(e){return We(e)?Gs(e,!0):ad(e)}function Ig(e,t){var r={};return t=K(t,3),mt(e,function(c,d,g){xt(r,t(c,d,g),c)}),r}function Dg(e,t){var r={};return t=K(t,3),mt(e,function(c,d,g){xt(r,d,t(c,d,g))}),r}var Mg=Rn(function(e,t,r){kr(e,t,r)}),fu=Rn(function(e,t,r,c){kr(e,t,r,c)}),Lg=wt(function(e,t){var r={};if(e==null)return r;var c=!1;t=ye(t,function(g){return g=Jt(g,e),c||(c=g.length>1),g}),vt(e,so(e),r),c&&(r=tt(r,D|H|z,Ed));for(var d=t.length;d--;)Xi(r,t[d]);return r});function kg(e,t){return lu(e,Yr(K(t)))}var Ug=wt(function(e,t){return e==null?{}:cd(e,t)});function lu(e,t){if(e==null)return{};var r=ye(so(e),function(c){return[c]});return t=K(t),na(e,r,function(c,d){return t(c,d[0])})}function Fg(e,t,r){t=Jt(t,e);var c=-1,d=t.length;for(d||(d=1,e=n);++c<d;){var g=e==null?n:e[yt(t[c])];g===n&&(c=d,g=r),e=Ot(g)?g.call(e):g}return e}function Ng(e,t,r){return e==null?e:Jn(e,t,r)}function Gg(e,t,r,c){return c=typeof c=="function"?c:n,e==null?e:Jn(e,t,r,c)}var du=Ra(Ee),pu=Ra(Be);function Wg(e,t,r){var c=te(e),d=c||Vt(e)||wn(e);if(t=K(t,4),r==null){var g=e&&e.constructor;d?r=c?new g:[]:Se(e)?r=Ot(g)?Tn(Rr(e)):{}:r={}}return(d?Xe:mt)(e,function(S,R,E){return t(r,S,R,E)}),r}function Bg(e,t){return e==null?!0:Xi(e,t)}function Hg(e,t,r){return e==null?e:aa(e,t,to(r))}function qg(e,t,r,c){return c=typeof c=="function"?c:n,e==null?e:aa(e,t,to(r),c)}function En(e){return e==null?[]:Mi(e,Ee(e))}function Jg(e){return e==null?[]:Mi(e,Be(e))}function zg(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=it(r),r=r===r?r:0),t!==n&&(t=it(t),t=t===t?t:0),nn(it(e),t,r)}function Vg(e,t,r){return t=At(t),r===n?(r=t,t=0):r=At(r),e=it(e),Xl(e,t,r)}function $g(e,t,r){if(r&&typeof r!="boolean"&&ke(e,t,r)&&(t=r=n),r===n&&(typeof t=="boolean"?(r=t,t=n):typeof e=="boolean"&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=At(e),t===n?(t=e,e=0):t=At(t)),e>t){var c=e;e=t,t=c}if(r||e%1||t%1){var d=Fs();return De(e+d*(t-e+xf("1e-"+((d+"").length-1))),t)}return Ki(e,t)}var jg=xn(function(e,t,r){return t=t.toLowerCase(),e+(r?hu(t):t)});function hu(e){return To(de(e).toLowerCase())}function gu(e){return e=de(e),e&&e.replace(Kc,Nf).replace(gf,"")}function Kg(e,t,r){e=de(e),t=Ve(t);var c=e.length;r=r===n?c:nn(ie(r),0,c);var d=r;return r-=t.length,r>=0&&e.slice(r,d)==t}function Yg(e){return e=de(e),e&&Oc.test(e)?e.replace(Vo,Gf):e}function Zg(e){return e=de(e),e&&kc.test(e)?e.replace(vi,"\\$&"):e}var Xg=xn(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Qg=xn(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),em=ya("toLowerCase");function tm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;if(!t||c>=t)return e;var d=(t-c)/2;return Br(Er(d),r)+e+Br(wr(d),r)}function nm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c<t?e+Br(t-c,r):e}function rm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c<t?Br(t-c,r)+e:e}function im(e,t,r){return r||t==null?t=0:t&&(t=+t),ll(de(e).replace(yi,""),t||0)}function om(e,t,r){return(r?ke(e,t,r):t===n)?t=1:t=ie(t),Yi(de(e),t)}function sm(){var e=arguments,t=de(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var am=xn(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});function um(e,t,r){return r&&typeof r!="number"&&ke(e,t,r)&&(t=r=n),r=r===n?Ye:r>>>0,r?(e=de(e),e&&(typeof t=="string"||t!=null&&!So(t))&&(t=Ve(t),!t&&vn(e))?zt(ft(e),0,r):e.split(t,r)):[]}var cm=xn(function(e,t,r){return e+(r?" ":"")+To(t)});function fm(e,t,r){return e=de(e),r=r==null?0:nn(ie(r),0,e.length),t=Ve(t),e.slice(r,r+t.length)==t}function lm(e,t,r){var c=h.templateSettings;r&&ke(e,t,r)&&(t=n),e=de(e),t=Qr({},t,c,xa);var d=Qr({},t.imports,c.imports,xa),g=Ee(d),S=Mi(d,g),R,E,k=0,U=t.interpolate||dr,G="__p += '",q=ki((t.escape||dr).source+"|"+U.source+"|"+(U===$o?qc:dr).source+"|"+(t.evaluate||dr).source+"|$","g"),V="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sf+"]")+"\n";e.replace(q,function(Z,ae,ce,je,Ue,Ke){return ce||(ce=je),G+=e.slice(k,Ke).replace(Yc,Wf),ae&&(R=!0,G+="' +\n__e("+ae+") +\n'"),Ue&&(E=!0,G+="';\n"+Ue+";\n__p += '"),ce&&(G+="' +\n((__t = ("+ce+")) == null ? '' : __t) +\n'"),k=Ke+Z.length,Z}),G+="';\n";var Y=pe.call(t,"variable")&&t.variable;if(!Y)G="with (obj) {\n"+G+"\n}\n";else if(Bc.test(Y))throw new Q(m);G=(E?G.replace(mi,""):G).replace(Pc,"$1").replace(wc,"$1;"),G="function("+(Y||"obj")+") {\n"+(Y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(R?", __e = _.escape":"")+(E?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+G+"return __p\n}";var oe=vu(function(){return le(g,V+"return "+G).apply(n,S)});if(oe.source=G,_o(oe))throw oe;return oe}function dm(e){return de(e).toLowerCase()}function pm(e){return de(e).toUpperCase()}function hm(e,t,r){if(e=de(e),e&&(r||t===n))return Ps(e);if(!e||!(t=Ve(t)))return e;var c=ft(e),d=ft(t),g=ws(c,d),S=Es(c,d)+1;return zt(c,g,S).join("")}function gm(e,t,r){if(e=de(e),e&&(r||t===n))return e.slice(0,As(e)+1);if(!e||!(t=Ve(t)))return e;var c=ft(e),d=Es(c,ft(t))+1;return zt(c,0,d).join("")}function mm(e,t,r){if(e=de(e),e&&(r||t===n))return e.replace(yi,"");if(!e||!(t=Ve(t)))return e;var c=ft(e),d=ws(c,ft(t));return zt(c,d).join("")}function vm(e,t){var r=nr,c=dn;if(Se(t)){var d="separator"in t?t.separator:d;r="length"in t?ie(t.length):r,c="omission"in t?Ve(t.omission):c}e=de(e);var g=e.length;if(vn(e)){var S=ft(e);g=S.length}if(r>=g)return e;var R=r-yn(c);if(R<1)return c;var E=S?zt(S,0,R).join(""):e.slice(0,R);if(d===n)return E+c;if(S&&(R+=E.length-R),So(d)){if(e.slice(R).search(d)){var k,U=E;for(d.global||(d=ki(d.source,de(jo.exec(d))+"g")),d.lastIndex=0;k=d.exec(U);)var G=k.index;E=E.slice(0,G===n?R:G)}}else if(e.indexOf(Ve(d),R)!=R){var q=E.lastIndexOf(d);q>-1&&(E=E.slice(0,q))}return E+c}function ym(e){return e=de(e),e&&Ec.test(e)?e.replace(zo,$f):e}var _m=xn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),To=ya("toUpperCase");function mu(e,t,r){return e=de(e),t=r?n:t,t===n?Hf(e)?Yf(e):Mf(e):e.match(t)||[]}var vu=se(function(e,t){try{return Je(e,n,t)}catch(r){return _o(r)?r:new Q(r)}}),Sm=wt(function(e,t){return Xe(t,function(r){r=yt(r),xt(e,r,vo(e[r],e))}),e});function Cm(e){var t=e==null?0:e.length,r=K();return e=t?ye(e,function(c){if(typeof c[1]!="function")throw new Qe(p);return[r(c[0]),c[1]]}):[],se(function(c){for(var d=-1;++d<t;){var g=e[d];if(Je(g[0],this,c))return Je(g[1],this,c)}})}function bm(e){return $l(tt(e,D))}function Ro(e){return function(){return e}}function Tm(e,t){return e==null||e!==e?t:e}var Rm=Sa(),xm=Sa(!0);function He(e){return e}function xo(e){return Ys(typeof e=="function"?e:tt(e,D))}function Pm(e){return Xs(tt(e,D))}function wm(e,t){return Qs(e,tt(t,D))}var Em=se(function(e,t){return function(r){return Hn(r,e,t)}}),Om=se(function(e,t){return function(r){return Hn(e,r,t)}});function Po(e,t,r){var c=Ee(t),d=Lr(t,c);r==null&&!(Se(t)&&(d.length||!c.length))&&(r=t,t=e,e=this,d=Lr(t,Ee(t)));var g=!(Se(r)&&"chain"in r)||!!r.chain,S=Ot(e);return Xe(d,function(R){var E=t[R];e[R]=E,S&&(e.prototype[R]=function(){var k=this.__chain__;if(g||k){var U=e(this.__wrapped__),G=U.__actions__=Ge(this.__actions__);return G.push({func:E,args:arguments,thisArg:e}),U.__chain__=k,U}return E.apply(e,Gt([this.value()],arguments))})}),e}function Am(){return Oe._===this&&(Oe._=nl),this}function wo(){}function Im(e){return e=ie(e),se(function(t){return ea(t,e)})}var Dm=ro(ye),Mm=ro(Cs),Lm=ro(Ei);function yu(e){return fo(e)?Oi(yt(e)):fd(e)}function km(e){return function(t){return e==null?n:rn(e,t)}}var Um=ba(),Fm=ba(!0);function Eo(){return[]}function Oo(){return!1}function Nm(){return{}}function Gm(){return""}function Wm(){return!0}function Bm(e,t){if(e=ie(e),e<1||e>St)return[];var r=Ye,c=De(e,Ye);t=K(t),e-=Ye;for(var d=Di(c,t);++r<e;)t(r);return d}function Hm(e){return te(e)?ye(e,yt):$e(e)?[e]:Ge(Na(de(e)))}function qm(e){var t=++el;return de(e)+t}var Jm=Wr(function(e,t){return e+t},0),zm=io("ceil"),Vm=Wr(function(e,t){return e/t},1),$m=io("floor");function jm(e){return e&&e.length?Mr(e,He,qi):n}function Km(e,t){return e&&e.length?Mr(e,K(t,2),qi):n}function Ym(e){return Rs(e,He)}function Zm(e,t){return Rs(e,K(t,2))}function Xm(e){return e&&e.length?Mr(e,He,$i):n}function Qm(e,t){return e&&e.length?Mr(e,K(t,2),$i):n}var ev=Wr(function(e,t){return e*t},1),tv=io("round"),nv=Wr(function(e,t){return e-t},0);function rv(e){return e&&e.length?Ii(e,He):0}function iv(e,t){return e&&e.length?Ii(e,K(t,2)):0}return h.after=Ph,h.ary=Ka,h.assign=pg,h.assignIn=cu,h.assignInWith=Qr,h.assignWith=hg,h.at=gg,h.before=Ya,h.bind=vo,h.bindAll=Sm,h.bindKey=Za,h.castArray=Nh,h.chain=Va,h.chunk=$d,h.compact=jd,h.concat=Kd,h.cond=Cm,h.conforms=bm,h.constant=Ro,h.countBy=rh,h.create=mg,h.curry=Xa,h.curryRight=Qa,h.debounce=eu,h.defaults=vg,h.defaultsDeep=yg,h.defer=wh,h.delay=Eh,h.difference=Yd,h.differenceBy=Zd,h.differenceWith=Xd,h.drop=Qd,h.dropRight=ep,h.dropRightWhile=tp,h.dropWhile=np,h.fill=rp,h.filter=oh,h.flatMap=uh,h.flatMapDeep=ch,h.flatMapDepth=fh,h.flatten=Ha,h.flattenDeep=ip,h.flattenDepth=op,h.flip=Oh,h.flow=Rm,h.flowRight=xm,h.fromPairs=sp,h.functions=xg,h.functionsIn=Pg,h.groupBy=lh,h.initial=up,h.intersection=cp,h.intersectionBy=fp,h.intersectionWith=lp,h.invert=Eg,h.invertBy=Og,h.invokeMap=ph,h.iteratee=xo,h.keyBy=hh,h.keys=Ee,h.keysIn=Be,h.map=$r,h.mapKeys=Ig,h.mapValues=Dg,h.matches=Pm,h.matchesProperty=wm,h.memoize=Kr,h.merge=Mg,h.mergeWith=fu,h.method=Em,h.methodOf=Om,h.mixin=Po,h.negate=Yr,h.nthArg=Im,h.omit=Lg,h.omitBy=kg,h.once=Ah,h.orderBy=gh,h.over=Dm,h.overArgs=Ih,h.overEvery=Mm,h.overSome=Lm,h.partial=yo,h.partialRight=tu,h.partition=mh,h.pick=Ug,h.pickBy=lu,h.property=yu,h.propertyOf=km,h.pull=gp,h.pullAll=Ja,h.pullAllBy=mp,h.pullAllWith=vp,h.pullAt=yp,h.range=Um,h.rangeRight=Fm,h.rearg=Dh,h.reject=_h,h.remove=_p,h.rest=Mh,h.reverse=go,h.sampleSize=Ch,h.set=Ng,h.setWith=Gg,h.shuffle=bh,h.slice=Sp,h.sortBy=xh,h.sortedUniq=wp,h.sortedUniqBy=Ep,h.split=um,h.spread=Lh,h.tail=Op,h.take=Ap,h.takeRight=Ip,h.takeRightWhile=Dp,h.takeWhile=Mp,h.tap=jp,h.throttle=kh,h.thru=Vr,h.toArray=su,h.toPairs=du,h.toPairsIn=pu,h.toPath=Hm,h.toPlainObject=uu,h.transform=Wg,h.unary=Uh,h.union=Lp,h.unionBy=kp,h.unionWith=Up,h.uniq=Fp,h.uniqBy=Np,h.uniqWith=Gp,h.unset=Bg,h.unzip=mo,h.unzipWith=za,h.update=Hg,h.updateWith=qg,h.values=En,h.valuesIn=Jg,h.without=Wp,h.words=mu,h.wrap=Fh,h.xor=Bp,h.xorBy=Hp,h.xorWith=qp,h.zip=Jp,h.zipObject=zp,h.zipObjectDeep=Vp,h.zipWith=$p,h.entries=du,h.entriesIn=pu,h.extend=cu,h.extendWith=Qr,Po(h,h),h.add=Jm,h.attempt=vu,h.camelCase=jg,h.capitalize=hu,h.ceil=zm,h.clamp=zg,h.clone=Gh,h.cloneDeep=Bh,h.cloneDeepWith=Hh,h.cloneWith=Wh,h.conformsTo=qh,h.deburr=gu,h.defaultTo=Tm,h.divide=Vm,h.endsWith=Kg,h.eq=dt,h.escape=Yg,h.escapeRegExp=Zg,h.every=ih,h.find=sh,h.findIndex=Wa,h.findKey=_g,h.findLast=ah,h.findLastIndex=Ba,h.findLastKey=Sg,h.floor=$m,h.forEach=$a,h.forEachRight=ja,h.forIn=Cg,h.forInRight=bg,h.forOwn=Tg,h.forOwnRight=Rg,h.get=Co,h.gt=Jh,h.gte=zh,h.has=wg,h.hasIn=bo,h.head=qa,h.identity=He,h.includes=dh,h.indexOf=ap,h.inRange=Vg,h.invoke=Ag,h.isArguments=an,h.isArray=te,h.isArrayBuffer=Vh,h.isArrayLike=We,h.isArrayLikeObject=Te,h.isBoolean=$h,h.isBuffer=Vt,h.isDate=jh,h.isElement=Kh,h.isEmpty=Yh,h.isEqual=Zh,h.isEqualWith=Xh,h.isError=_o,h.isFinite=Qh,h.isFunction=Ot,h.isInteger=nu,h.isLength=Zr,h.isMap=ru,h.isMatch=eg,h.isMatchWith=tg,h.isNaN=ng,h.isNative=rg,h.isNil=og,h.isNull=ig,h.isNumber=iu,h.isObject=Se,h.isObjectLike=Ce,h.isPlainObject=jn,h.isRegExp=So,h.isSafeInteger=sg,h.isSet=ou,h.isString=Xr,h.isSymbol=$e,h.isTypedArray=wn,h.isUndefined=ag,h.isWeakMap=ug,h.isWeakSet=cg,h.join=dp,h.kebabCase=Xg,h.last=rt,h.lastIndexOf=pp,h.lowerCase=Qg,h.lowerFirst=em,h.lt=fg,h.lte=lg,h.max=jm,h.maxBy=Km,h.mean=Ym,h.meanBy=Zm,h.min=Xm,h.minBy=Qm,h.stubArray=Eo,h.stubFalse=Oo,h.stubObject=Nm,h.stubString=Gm,h.stubTrue=Wm,h.multiply=ev,h.nth=hp,h.noConflict=Am,h.noop=wo,h.now=jr,h.pad=tm,h.padEnd=nm,h.padStart=rm,h.parseInt=im,h.random=$g,h.reduce=vh,h.reduceRight=yh,h.repeat=om,h.replace=sm,h.result=Fg,h.round=tv,h.runInContext=P,h.sample=Sh,h.size=Th,h.snakeCase=am,h.some=Rh,h.sortedIndex=Cp,h.sortedIndexBy=bp,h.sortedIndexOf=Tp,h.sortedLastIndex=Rp,h.sortedLastIndexBy=xp,h.sortedLastIndexOf=Pp,h.startCase=cm,h.startsWith=fm,h.subtract=nv,h.sum=rv,h.sumBy=iv,h.template=lm,h.times=Bm,h.toFinite=At,h.toInteger=ie,h.toLength=au,h.toLower=dm,h.toNumber=it,h.toSafeInteger=dg,h.toString=de,h.toUpper=pm,h.trim=hm,h.trimEnd=gm,h.trimStart=mm,h.truncate=vm,h.unescape=ym,h.uniqueId=qm,h.upperCase=_m,h.upperFirst=To,h.each=$a,h.eachRight=ja,h.first=qa,Po(h,function(){var e={};return mt(h,function(t,r){pe.call(h.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),h.VERSION=o,Xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){h[e].placeholder=h}),Xe(["drop","take"],function(e,t){ue.prototype[e]=function(r){r=r===n?1:we(ie(r),0);var c=this.__filtered__&&!t?new ue(this):this.clone();return c.__filtered__?c.__takeCount__=De(r,c.__takeCount__):c.__views__.push({size:De(r,Ye),type:e+(c.__dir__<0?"Right":"")}),c},ue.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),Xe(["filter","map","takeWhile"],function(e,t){var r=t+1,c=r==rr||r==or;ue.prototype[e]=function(d){var g=this.clone();return g.__iteratees__.push({iteratee:K(d,3),type:r}),g.__filtered__=g.__filtered__||c,g}}),Xe(["head","last"],function(e,t){var r="take"+(t?"Right":"");ue.prototype[e]=function(){return this[r](1).value()[0]}}),Xe(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");ue.prototype[e]=function(){return this.__filtered__?new ue(this):this[r](1)}}),ue.prototype.compact=function(){return this.filter(He)},ue.prototype.find=function(e){return this.filter(e).head()},ue.prototype.findLast=function(e){return this.reverse().find(e)},ue.prototype.invokeMap=se(function(e,t){return typeof e=="function"?new ue(this):this.map(function(r){return Hn(r,e,t)})}),ue.prototype.reject=function(e){return this.filter(Yr(K(e)))},ue.prototype.slice=function(e,t){e=ie(e);var r=this;return r.__filtered__&&(e>0||t<0)?new ue(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=ie(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},ue.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ue.prototype.toArray=function(){return this.take(Ye)},mt(ue.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),c=/^(?:head|last)$/.test(t),d=h[c?"take"+(t=="last"?"Right":""):t],g=c||/^find/.test(t);d&&(h.prototype[t]=function(){var S=this.__wrapped__,R=c?[1]:arguments,E=S instanceof ue,k=R[0],U=E||te(S),G=function(ae){var ce=d.apply(h,Gt([ae],R));return c&&q?ce[0]:ce};U&&r&&typeof k=="function"&&k.length!=1&&(E=U=!1);var q=this.__chain__,V=!!this.__actions__.length,Y=g&&!q,oe=E&&!V;if(!g&&U){S=oe?S:new ue(this);var Z=e.apply(S,R);return Z.__actions__.push({func:Vr,args:[G],thisArg:n}),new et(Z,q)}return Y&&oe?e.apply(this,R):(Z=this.thru(G),Y?c?Z.value()[0]:Z.value():Z)})}),Xe(["pop","push","shift","sort","splice","unshift"],function(e){var t=yr[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var d=arguments;if(c&&!this.__chain__){var g=this.value();return t.apply(te(g)?g:[],d)}return this[r](function(S){return t.apply(te(S)?S:[],d)})}}),mt(ue.prototype,function(e,t){var r=h[t];if(r){var c=r.name+"";pe.call(bn,c)||(bn[c]=[]),bn[c].push({name:t,func:r})}}),bn[Gr(n,ot).name]=[{name:"wrapper",func:n}],ue.prototype.clone=yl,ue.prototype.reverse=_l,ue.prototype.value=Sl,h.prototype.at=Kp,h.prototype.chain=Yp,h.prototype.commit=Zp,h.prototype.next=Xp,h.prototype.plant=eh,h.prototype.reverse=th,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=nh,h.prototype.first=h.prototype.head,kn&&(h.prototype[kn]=Qp),h},_n=Zf();Xt?((Xt.exports=_n)._=_n,Ri._=_n):Oe._=_n}).call(Kn)})(fi,fi.exports);var Uv=fi.exports;const fn=Wu(Uv);var un=function(){return un=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},un.apply(this,arguments)},Io=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Do=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Fv=function(){function i(s){this.instance=s}return i.prototype.getServer=function(){return this.instance.getServer()},i.prototype.isConnected=function(){return this.instance.isConnected()},i.prototype.getSessionId=function(){return this.instance.getSessionId()},i.prototype.getObservableControllers=function(s){var n=un({},s),o={onRecordingDataController:new cn,onStatReportsController:new cn,onMessageController:new cn,onLocalTrackController:new _t(null),onRemoteTrackController:new cn,onDataController:new _t(null),onErrorController:new _t(null),onMediaStateController:new _t(null),onIceStateController:new _t(null),onSlowLinkController:new _t(null),onWebRTCStateController:new _t(null),onCleanupController:new _t(null),onDataOpenController:new _t(null),onDetachedController:new _t(null)};return n.onmessage=function(a,u){o.onMessageController.next({message:a,jsep:u})},n.onlocaltrack=function(a,u){o.onLocalTrackController.next({on:u,track:a})},n.onremotetrack=function(a,u,p){o.onRemoteTrackController.next({on:p,track:a,mid:u})},n.ondata=function(a){o.onDataController.next(a)},n.error=function(a){o.onErrorController.next(a)},n.mediaState=function(a,u,p){o.onMediaStateController.next({medium:a,recieving:u,mid:p})},n.slowLink=function(a,u,p){o.onSlowLinkController.next({uplink:a,lost:u,mid:p})},n.webrtcState=function(a){o.onWebRTCStateController.next(a)},n.iceState=function(a){o.onIceStateController.next(a)},n.ondataopen=function(){o.onDataOpenController.next()},n.ondetached=function(){o.onDetachedController.next()},n.oncleanup=function(){o.onCleanupController.next()},{finalOptions:n,controllers:o}},i.prototype.cast=function(s){return s},i.prototype.attach=function(s,n){var o=this,a=un(un({},n),{plugin:s.identifier}),u=this.getObservableControllers(a),p=u.controllers,m=u.finalOptions;return new Promise(function(T,l){m.success=function(_){var D=new s(o.instance,o,_,p);fn.assign(D,fn.omit(_,["data","send","createAnswer","createOffer"])),T(D)},m.error=function(_){l(_)},o.instance.attach(m)})},i.prototype.reconnect=function(){return Io(this,void 0,void 0,function(){var s=this;return Do(this,function(n){return[2,new Promise(function(o,a){s.instance.reconnect({success:function(){o(!0)},error:function(u){a(u)}})})]})})},i.prototype.getInfo=function(){return Io(this,void 0,void 0,function(){var s=this;return Do(this,function(n){return[2,new Promise(function(o,a){s.instance.getInfo({success:function(u){o(u)},error:function(u){a(u)}})})]})})},i.prototype.destroy=function(s){return Io(this,void 0,void 0,function(){var n=this;return Do(this,function(o){return[2,new Promise(function(a,u){n.instance.destroy(un(un({},s),{success:function(){a()},error:function(p){u(p)}}))})]})})},i}(),Qn=function(){return Qn=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},Qn.apply(this,arguments)},Du=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Mu=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},qo=function(){function i(s){this.statsQueryInterval=0,console.log("JanusJs loaded"),this.options=s}return i.isWebrtcSupported=function(){return f.isWebrtcSupported()},i.debug=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.debug(s)},i.log=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.log(s)},i.warn=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.warn(s)},i.error=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.error(s)},i.randomString=function(s){return f.randomString(s)},i.attachMediaStream=function(s,n){f.attachMediaStream(s,n)},i.reattachMediaStream=function(s,n){f.reattachMediaStream(s,n)},i.stopAllTracks=function(s){f.stopAllTracks(s)},i.prototype.init=function(s){return s===void 0&&(s={debug:"all",dependencies:f.useDefaultDependencies({adapter:Pu})}),Du(this,void 0,void 0,function(){return Mu(this,function(n){switch(n.label){case 0:return s.dependencies||(s.dependencies=f.useDefaultDependencies({adapter:Pu})),[4,new Promise(function(o,a){f.init(Qn(Qn({},s),{callback:function(){o()}}))})];case 1:return n.sent(),[2]}})})},i.mix=function(s,n){var o=s.createMediaStreamDestination();return n.forEach(function(a){o.context.createMediaStreamSource(a).connect(o)}),o.stream.getTracks()[0]},i.playMediaStream=function(s){window.AudioContext=window.AudioContext||window.webkitAudioContext;try{var n=new window.AudioContext,o=new Audio;o.srcObject=s;var a=n.createMediaStreamSource(o.srcObject);return a.connect(n.destination),n}catch(u){throw i.error("failed to play media stream",u),u}},i.createRecording=function(s){var n=[];if(fn.each(s.mediaStreams,function(l){l!=null&&l.getTracks&&fn.each(l.getTracks(),function(_){n.push(new MediaStream([_]))})}),n.length!=0){var o=new AudioContext,a=this.mix(o,n),u=new MediaStream([a]),p=new MediaRecorder(u),m=new cn,T=0;return p.ondataavailable=function(l){T++,m.next({blob:l.data,chunkNumber:T})},p.onstop=function(l){m.next({blob:null,chunkNumber:T})},p.start(s.timeSlice),{mediaRecorder:p,controller:m}}},i.prototype.createSession=function(){return Du(this,void 0,void 0,function(){var s=this;return Mu(this,function(n){switch(n.label){case 0:return this.options.destroyed=function(){s.onDestroyed&&s.onDestroyed()},this.options.error=function(o){s.onError&&s.onError(o)},[4,new Promise(function(o,a){s.options.success=function(){o()},s.options.error=function(u){a(u)},s.instance=new f(Qn({},s.options))})];case 1:return n.sent(),[2,new Fv(this.instance)]}})})},i}(),Fe=function(){return Fe=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},Fe.apply(this,arguments)},Yn=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Zn=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Lu=function(i,s,n){if(n||arguments.length===2)for(var o=0,a=s.length,u;o<a;o++)(u||!(o in s))&&(u||(u=Array.prototype.slice.call(s,0,o)),u[o]=s[o]);return i.concat(u||Array.prototype.slice.call(s))},Dn=function(){function i(s,n,o,a){this.recording=!1,this.statsQueryInterval=0,this.instance=s,this.session=n,this.controllers=a,this.handle=o,this.statsReportHookTimer=this.handleStatsHook(this.handle,a,null),this.recording&&(console.info("recording enabled"),this.handleRecordingSetup(a))}return i.prototype.promisify=function(s){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return Yn(this,void 0,void 0,function(){var a;return Zn(this,function(u){return a=fn.first(n),fn.isPlainObject(a)?[2,new Promise(function(p,m){s(Fe(Fe({},fn.omit(a,["success","error"])),{success:function(T){p(T)},error:function(T){m(T)}}))})]:[2,new Promise(function(p,m){s.apply(void 0,Lu(Lu([],n,!1),[function(T){p(T)}],!1))})]})})},i.prototype.replaceTracks=function(s){return Yn(this,void 0,void 0,function(){return Zn(this,function(n){return[2,this.promisify(this.handle.replaceTracks,Fe({},s))]})})},i.prototype.getVolume=function(s){return this.promisify(this.handle.getVolume,s)},i.prototype.getRemoteVolume=function(s){return this.promisify(this.handle.getRemoteVolume,s)},i.prototype.getLocalVolume=function(s){return this.promisify(this.handle.getLocalVolume,s)},i.prototype.isAudioMuted=function(){throw new Error("Method not implemented.")},i.prototype.muteAudio=function(){throw new Error("Method not implemented.")},i.prototype.unmuteAudio=function(){throw new Error("Method not implemented.")},i.prototype.isVideoMuted=function(){throw new Error("Method not implemented.")},i.prototype.muteVideo=function(){throw new Error("Method not implemented.")},i.prototype.unmuteVideo=function(){throw new Error("Method not implemented.")},i.prototype.getBitrate=function(){throw new Error("Method not implemented.")},i.prototype.setMaxBitrate=function(s){throw new Error("Method not implemented.")},i.prototype.getLocalTracks=function(){throw new Error("Method not implemented.")},i.prototype.getRemoteTracks=function(){throw new Error("Method not implemented.")},i.prototype.handleRecordingSetup=function(s){var n=this,o;this.onMessage.subscribe(function(a){var u,p,m=a.message,T=m==null?void 0:m.result;if((T==null?void 0:T.event)==="accepted"||(T==null?void 0:T.event)==="progress"){if(!o){if(!n.webrtcStuff.remoteStream||!n.webrtcStuff.myStream)return;console.info("recording initiated"),o=qo.createRecording({mediaStreams:[n.webrtcStuff.myStream,n.webrtcStuff.remoteStream],timeSlice:n.recordingTimeSlice})}o&&(n.mediaRecorder=o.mediaRecorder,o.controller.subscribe(function(l){s.onRecordingDataController.next(l)}))}(T==null?void 0:T.event)==="hangup"&&((u=n.mediaRecorder)===null||u===void 0?void 0:u.state)!=="inactive"&&((p=n.mediaRecorder)===null||p===void 0||p.stop())})},i.prototype.sendTrickle=function(){return Yn(this,void 0,void 0,function(){return Zn(this,function(s){return[2]})})},i.prototype.handleStatsHook=function(s,n,o){var a=this;return setInterval(function(){return Yn(a,void 0,void 0,function(){var u,p;return Zn(this,function(m){switch(m.label){case 0:return s.webrtcStuff.pc?(u=[],[4,s.webrtcStuff.pc.getStats()]):[2];case 1:return p=m.sent(),p.forEach(function(T){u.push.apply(u,T)}),n.onStatReportsController.next(u),[2]}})})},this.statsQueryInterval)},Object.defineProperty(i.prototype,"recorder",{get:function(){return this.mediaRecorder},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRecordingData",{get:function(){return this.controllers.onRecordingDataController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onStatReports",{get:function(){return this.controllers.onStatReportsController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMessage",{get:function(){return this.controllers.onMessageController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onLocalTrack",{get:function(){return this.controllers.onLocalTrackController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onData",{get:function(){return this.controllers.onDataController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onError",{get:function(){return this.controllers.onErrorController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRemoteTrack",{get:function(){return this.controllers.onRemoteTrackController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMediaState",{get:function(){return this.controllers.onMediaStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onSlowLink",{get:function(){return this.controllers.onSlowLinkController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onWebRTCState",{get:function(){return this.controllers.onWebRTCStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onIceState",{get:function(){return this.controllers.onIceStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataOpen",{get:function(){return this.controllers.onDataOpenController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDetached",{get:function(){return this.controllers.onDetachedController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onCleanup",{get:function(){return this.controllers.onCleanupController.asObservable()},enumerable:!1,configurable:!0}),i.prototype.getId=function(){throw new Error("Method not implemented.")},i.prototype.getPlugin=function(){throw new Error("Method not implemented.")},i.prototype.send=function(s){return Yn(this,void 0,void 0,function(){var n=this;return Zn(this,function(o){return[2,new Promise(function(a,u){n.handle.send(Fe(Fe({},s),{success:function(p){a(p)},error:function(p){u(p)}}))})]})})},i.prototype.createOffer=function(s){var n=this;return new Promise(function(o,a){n.handle.createOffer(Fe(Fe({},s),{success:function(u){o(u)},error:function(u){a(u)}}))})},i.prototype.createAnswer=function(s){var n=this;return new Promise(function(o,a){n.handle.createAnswer(Fe(Fe({},s),{success:function(u){o(u)},error:function(u){a(u)}}))})},i.prototype.data=function(s){var n=this;return new Promise(function(o,a){n.handle.data(Fe(Fe({},s),{success:function(){o()},error:function(u){a(u)}}))})},i.prototype.handleRemoteJsep=function(s){throw new Error("Method not implemented.")},i.prototype.dtmf=function(s){throw new Error("Method not implemented.")},i.prototype.hangup=function(s){throw new Error("Method not implemented.")},i.prototype.detach=function(s){var n=this;return new Promise(function(o,a){n.handle.detach(Fe(Fe({},s),{success:function(){o()},error:function(u){a(u)}}))})},i.prototype.stopCollectingStats=function(){clearInterval(this.statsReportHookTimer)},i.identifier=null,i}(),Mn=function(){function i(){}return i.VIDEO_ROOM="janus.plugin.videoroom",i.VIDEO_CALL="janus.plugin.videocall",i.AUDIO_BRIDGE="janus.plugin.audiobridge",i.SIP="janus.plugin.sip",i.STREAMING="janus.plugin.streaming",i.ECHO_TEST="janus.plugin.echotest",i}(),Nv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),On=function(){return On=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},On.apply(this,arguments)},$t=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},jt=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Nv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.createRoom=function(n){return n===void 0&&(n={}),$t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o=On({request:"create"},n),[2,this.send({message:o})]})})},s.prototype.joinRoomAsPublisher=function(n,o){var a=On({request:"join",room:n,ptype:"publisher"},o);return this.send({message:a})},s.prototype.listParticipants=function(n){return $t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o={request:"listparticipants",room:n},[2,this.send({message:o})]})})},s.prototype.joinRoomAsSubscriber=function(n,o){return $t(this,void 0,void 0,function(){var a;return jt(this,function(u){return a=On({request:"join",ptype:"subscriber",room:n},o),[2,this.send({message:a})]})})},s.prototype.startAsSubscriber=function(n){return $t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o={request:"start"},[2,this.send({message:o,jsep:n.toJSON()})]})})},s.prototype.publishAsPublisher=function(n,o){return $t(this,void 0,void 0,function(){var a;return jt(this,function(u){return a=On({request:"publish"},o),[2,this.send({message:a,jsep:n.toJSON()})]})})},s.prototype.unpublishAsPublisher=function(){return $t(this,void 0,void 0,function(){var n;return jt(this,function(o){return n={request:"unpublish"},[2,this.send({message:n})]})})},s.prototype.updateAsSubscriber=function(n){var o=n.subscribe,a=n.unsubscribe;return $t(this,void 0,void 0,function(){var u;return jt(this,function(p){return u={request:"update",subscribe:o,unsubscribe:a},[2,this.send({message:u})]})})},s.prototype.leave=function(){return $t(this,void 0,void 0,function(){var n;return jt(this,function(o){return n={request:"leave"},[2,this.send({message:n})]})})},s.identifier=Mn.VIDEO_ROOM,s})(Dn);var Gv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),ku=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Uu=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Gv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.register=function(n){return ku(this,void 0,void 0,function(){return Uu(this,function(o){switch(o.label){case 0:return[4,this.send({message:{request:"register",username:n}})];case 1:return o.sent(),[2]}})})},s.prototype.call=function(n,o){return o===void 0&&(o=null),ku(this,void 0,void 0,function(){return Uu(this,function(a){switch(a.label){case 0:return o!==null?[3,2]:[4,this.createOffer({media:{videoSend:!0,videoRecv:!0,audioSend:!0,audioRecv:!0}})];case 1:o=a.sent(),a.label=2;case 2:return[4,this.send({message:{request:"call",username:n},jsep:o.toJSON()})];case 3:return a.sent(),[2]}})})},s.identifier=Mn.VIDEO_CALL,s})(Dn);var Wv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fu=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Nu=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Bv=function(i){Wv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.list=function(){return Fu(this,void 0,void 0,function(){return Nu(this,function(n){return[2,this.send({message:{request:"list"}})]})})},s.prototype.info=function(n,o){return o===void 0&&(o=void 0),Fu(this,void 0,void 0,function(){return Nu(this,function(a){return[2,this.send({message:{request:"info",id:n,secret:o}})]})})},s.identifier=Mn.STREAMING,s}(Dn),Hv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),An=function(){return An=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},An.apply(this,arguments)},Kt=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},Yt=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Hv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.register=function(n,o,a){return Kt(this,void 0,void 0,function(){var u;return Yt(this,function(p){switch(p.label){case 0:return u=An({request:"register",username:"sip:".concat(n,"@").concat(o)},a),u.proxy="sip:".concat(o),[4,this.send({message:u})];case 1:return p.sent(),[2]}})})},s.prototype.call=function(n,o,a){return Kt(this,void 0,void 0,function(){var u;return Yt(this,function(p){switch(p.label){case 0:return a?[3,2]:[4,this.createOffer({media:{audioRecv:!0,audioSend:!0,videoRecv:!1,videoSend:!1}})];case 1:a=p.sent(),p.label=2;case 2:return u=An({request:"call",uri:n},o),[4,this.send({message:u,jsep:a})];case 3:return p.sent(),[2]}})})},s.prototype.update=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return n?[3,2]:[4,this.createOffer({media:{audioRecv:!0,audioSend:!0,videoRecv:!1,videoSend:!1}})];case 1:n=a.sent(),a.label=2;case 2:return o={request:"update"},[4,this.send({message:o,jsep:n.toJSON()})];case 3:return a.sent(),[2]}})})},s.prototype.decline=function(n,o){return Kt(this,void 0,void 0,function(){var a;return Yt(this,function(u){switch(u.label){case 0:return a={request:"decline",code:n,headers:o},[4,this.send({message:a})];case 1:return u.sent(),[2]}})})},s.prototype.accept=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return o=An({request:"accept"},n),[4,this.send({message:o})];case 1:return a.sent(),[2]}})})},s.prototype.hold=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return o={request:"hold",direction:n},[4,this.send({message:o})];case 1:return a.sent(),[2]}})})},s.prototype.unhold=function(){return Kt(this,void 0,void 0,function(){var n;return Yt(this,function(o){switch(o.label){case 0:return n={request:"unhold"},[4,this.send({message:n})];case 1:return o.sent(),[2]}})})},s.prototype.record=function(n,o){return o===void 0&&(o={peer_audio:!0,peer_video:!1,audio:!0,video:!1,filename:"recording_"+new Date().toDateString()}),Kt(this,void 0,void 0,function(){var a;return Yt(this,function(u){switch(u.label){case 0:return a=An({request:"recording",action:n},o),[4,this.send({message:a})];case 1:return u.sent(),[2]}})})},s.identifier=Mn.SIP,s})(Dn);var qv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),li=function(){return li=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},li.apply(this,arguments)},ti=function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function m(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(m,T)}l((o=o.apply(i,s||[])).next())})},ni=function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function m(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){qv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.createRoom=function(n,o){return ti(this,void 0,void 0,function(){var a;return ni(this,function(u){return a=li({request:"create",room:n},o),[2,this.send({message:a})]})})},s.prototype.editRoom=function(n,o){return ti(this,void 0,void 0,function(){var a;return ni(this,function(u){return a=li({request:"edit",room:n},o),[2,this.send({message:a})]})})},s.prototype.joinRoom=function(n,o){var a=o===void 0?{}:o,u=a.id,p=a.group,m=a.pin,T=a.display,l=a.token,_=a.muted,D=a.codec,H=a.preBuffer,z=a.bitrate,j=a.quality,ee=a.expectedLoss,xe=a.volume,ot=a.spatialPosition,_e=a.secret,$=a.audioLevelAverage,X=a.audioActivePackets,Ie=a.record,st=a.filename;return ti(this,void 0,void 0,function(){var me;return ni(this,function(ht){return me={request:"join",room:n,id:u,group:p,pin:m,display:T,token:l,muted:_,codec:D,prebuffer:H,bitrate:z,quality:j,expected_loss:ee,volume:xe,spatial_position:ot,secret:_e,audio_level_average:$,audio_active_packets:X,record:Ie,filename:st},[2,this.send({message:me})]})})},s.prototype.configure=function(n){var o=n.muted,a=n.offer,u=n.display,p=n.preBuffer,m=n.bitrate,T=n.quality,l=n.expectedLoss,_=n.volume,D=n.spatialPosition,H=n.record,z=n.filename,j=n.group;return ti(this,void 0,void 0,function(){var ee;return ni(this,function(xe){return ee={request:"configure",muted:o,display:u,prebuffer:p,bitrate:m,quality:T,expected_loss:l,volume:_,spatial_position:D,record:H,filename:z,group:j},[2,this.send({message:ee,jsep:a})]})})},s.identifier=Mn.AUDIO_BRIDGE,s})(Dn);var Jv=function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}();(function(i){Jv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.boomCall=function(){},s.identifier=Mn.ECHO_TEST,s})(Dn);var zv=Object.defineProperty,Vv=Object.getOwnPropertyDescriptor,tr=(i,s,n,o)=>{for(var a=o>1?void 0:o?Vv(s,n):s,u=i.length-1,p;u>=0;u--)(p=i[u])&&(a=(o?p(s,n,a):p(a))||a);return o&&a&&zv(s,n,a),a};let ln=class extends ov(sv,av){constructor(){super(...arguments),this.janusClient=null,this.session=null,this.handle=null,this.useStun=!1,this.aspectRatio=null,this.status="connecting"}get url(){var o;const s=this.camSettings.stream_url;let n=new URL(s,this.printerUrl===null?this.hostUrl.toString():this.printerUrl);if(n.port="8188",n.protocol=(o=this.printerUrl)!=null&&o.startsWith("https")?"wss":"ws",s.startsWith("ws")||s.startsWith("http")){n=new URL(s);const a=n.pathname.split("/");n.pathname=a.slice(0,a.length-1).join("/")}return n}get streamId(){const s=new URL(this.camSettings.stream_url).pathname.split("/");return s[s.length-1]}get webcamStyle(){var n,o,a;const s={transform:this.generateTransform((n=this.camSettings.flip_horizontal)!=null?n:!1,(o=this.camSettings.flip_vertical)!=null?o:!1,(a=this.camSettings.rotation)!=null?a:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(s.aspectRatio=this.aspectRatio),s}get streamConfig(){let s={server:this.url.toString()};return this.useStun&&(s.iceServers=[{urls:["stun:stun.l.google.com:19302"]}]),s}async startStream(){var n,o;this.janusClient=new qo(this.streamConfig),await this.janusClient.init({debug:!1}),this.session=await this.janusClient.createSession(),this.handle=await this.session.attach(Bv,{}),(n=this.handle)==null||n.onMessage.subscribe(async({message:a,jsep:u})=>{var p,m,T;if((p=a==null?void 0:a.result)!=null&&p.status&&(this.status=a.result.status),u){const l=await((m=this.handle)==null?void 0:m.createAnswer({jsep:u}));(T=this.handle)==null||T.send({message:{request:"start"},jsep:l})}});const s=new MediaStream;qo.attachMediaStream(this.stream,s),(o=this.handle)==null||o.onRemoteTrack.subscribe(({on:a,track:u})=>{a?s.addTrack(u):s.removeTrack(u)}),this.handle.onIceState.subscribe(a=>{console.log("ICE state changed to ".concat(a))}),this.handle.onError.subscribe(a=>{this.status="errored: ".concat(JSON.stringify(a))}),await this.handle.send({message:{request:"watch",id:parseInt(this.streamId)}})}mounted(){this.startStream()}updateAspectRatio(){this.aspectRatio=this.stream.videoWidth/this.stream.videoHeight}beforeDestroy(){var s;(s=this.session)==null||s.destroy({})}async changedUrl(){var s;await((s=this.session)==null?void 0:s.destroy({})),await this.startStream()}};tr([Gu({required:!0})],ln.prototype,"camSettings",2);tr([Gu({default:null})],ln.prototype,"printerUrl",2);tr([uv()],ln.prototype,"stream",2);tr([cv("url")],ln.prototype,"changedUrl",1);ln=tr([fv],ln);var $v=function(){var s=this,n=s._self._c;return s._self._setupProxy,n("div",[n("video",{directives:[{name:"show",rawName:"v-show",value:s.status==="started",expression:"status === 'started'"}],ref:"stream",staticClass:"webcamStream",style:s.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{playing:s.updateAspectRatio}}),s.status!=="started"?n(dv,[n(pv,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[s.status==="connecting"?n(hv,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):s._e(),n("span",{staticClass:"mt-3"},[s._v(s._s(s.status))])],1)],1):s._e()],1)},jv=[],Kv=lv(ln,$v,jv,!1,null,"1ca90143");const ty=Kv.exports;export{ty as default};