@whereby.com/browser-sdk 2.0.0-alpha3 → 2.0.0-alpha4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,12 +7,12 @@ function O(e){return e.join(T).replace(N,z).replace(A,F)}var D=" \\f\\n\\r\\t",j
7
7
  /*! (c) Andrea Giammarchi - ISC */
8
8
  var K=function(e){var t="fragment",n="template",i="content"in r(n)?function(e){var t=r(n);return t.innerHTML=e,t.content}:function(e){var i=r(t),a=r(n),o=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;a.innerHTML="<table>"+e+"</table>",o=a.querySelectorAll(c)}else a.innerHTML=e,o=a.childNodes;return s(i,o),i};return function(e,t){return("svg"===t?a:i)(e)};function s(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function r(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function a(e){var n=r(t),i=r("div");return i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",s(n,i.firstChild.childNodes),n}}(document),J=(e,t,n,i,s)=>{const r=n.length;let a=t.length,o=r,c=0,p=0,d=null;for(;c<a||p<o;)if(a===c){const t=o<r?p?i(n[p-1],-0).nextSibling:i(n[o-p],0):s;for(;p<o;)e.insertBefore(i(n[p++],1),t)}else if(o===p)for(;c<a;)d&&d.has(t[c])||e.removeChild(i(t[c],-1)),c++;else if(t[c]===n[p])c++,p++;else if(t[a-1]===n[o-1])a--,o--;else if(t[c]===n[o-1]&&n[p]===t[a-1]){const s=i(t[--a],-1).nextSibling;e.insertBefore(i(n[p++],1),i(t[c++],-1).nextSibling),e.insertBefore(i(n[--o],1),s),t[a]=n[o]}else{if(!d){d=new Map;let e=p;for(;e<o;)d.set(n[e],e++)}if(d.has(t[c])){const s=d.get(t[c]);if(p<s&&s<o){let r=c,l=1;for(;++r<a&&r<o&&d.get(t[r])===s+l;)l++;if(l>s-p){const r=i(t[c],0);for(;p<s;)e.insertBefore(i(n[p++],1),r)}else e.replaceChild(i(n[p++],1),i(t[c++],-1))}else c++}else e.removeChild(i(t[c++],-1))}return n},Q=function(e,t,n,i,s){var r=s in e,a=e.createDocumentFragment();return a.appendChild(e.createTextNode("g")),a.appendChild(e.createTextNode("")),(r?e.importNode(a,!0):a.cloneNode(!0)).childNodes.length<2?function e(t,n){for(var i=t.cloneNode(),s=t.childNodes||[],r=s.length,a=0;n&&a<r;a++)i.appendChild(e(s[a],n));return i}:r?e.importNode:function(e,t){return e.cloneNode(!!t)}}(document,0,0,0,"importNode"),Y="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},X=R?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function Z(e,t){for(var n=t.length,i=0;i<n;)e=e.childNodes[t[i++]];return e}function ee(e,t,n,i){for(var s=e.childNodes,r=s.length,a=0;a<r;){var o=s[a];switch(o.nodeType){case 1:var c=i.concat(a);te(o,t,n,c),ee(o,t,n,c);break;case 8:var p=o.textContent;if(p===C)n.shift(),t.push(P.test(e.nodeName)?se(e,i):ne(o,i.concat(a)));else switch(p.slice(0,2)){case"/*":if("*/"!==p.slice(-2))break;case"👻":e.removeChild(o),a--,r--}break;case 3:P.test(e.nodeName)&&Y.call(o.textContent)===T&&(n.shift(),t.push(se(e,i)))}a++}}function te(e,t,n,i){for(var s=e.attributes,r=[],a=[],o=X(s,n),c=o.length,p=0;p<c;){var d,l=o[p++],u=l.value===C;if(u||1<(d=l.value.split(T)).length){var m=l.name;if(r.indexOf(m)<0){r.push(m);var h=n.shift().replace(u?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+m+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),f=s[h]||s[h.toLowerCase()];if(u)t.push(ie(f,i,h,null));else{for(var g=d.length-2;g--;)n.shift();t.push(ie(f,i,h,d))}}a.push(l)}}p=0;for(var v=(0<(c=a.length)&&R&&!("ownerSVGElement"in e));p<c;){var b=a[p++];v&&(b.value=""),e.removeAttribute(b.name)}var y=e.nodeName;if(/^script$/i.test(y)){var _=document.createElement(y);for(c=s.length,p=0;p<c;)_.setAttributeNode(s[p++].cloneNode(!0));_.textContent=e.textContent,e.parentNode.replaceChild(_,e)}}function ne(e,t){return{type:"any",node:e,path:t}}function ie(e,t,n,i){return{type:"attr",node:e,path:t,name:n,sparse:i}}function se(e,t){return{type:"text",node:e,path:t}}var re=H(new b);function ae(e,t){var n=(e.convert||O)(t),i=e.transform;i&&(n=i(n));var s=K(n,e.type);pe(s);var r=[];return ee(s,r,t.slice(0),[]),{content:s,updates:function(n){for(var i=[],s=r.length,a=0,o=0;a<s;){var c=r[a++],p=Z(n,c.path);switch(c.type){case"any":i.push({fn:e.any(p,[]),sparse:!1});break;case"attr":var d=c.sparse,l=e.attribute(p,c.name,c.node);null===d?i.push({fn:l,sparse:!1}):(o+=d.length-2,i.push({fn:l,sparse:!0,values:d}));break;case"text":i.push({fn:e.text(p),sparse:!1}),p.textContent=""}}return s+=o,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var r=1,a=1;r<e;){var o=i[r-a];if(o.sparse){var c=o.values,p=c[0],d=1,l=c.length;for(a+=l-2;d<l;)p+=arguments[r++]+c[d++];o.fn(p)}else o.fn(arguments[r++])}return n}}}}function oe(e,t){var n=re.get(t)||re.set(t,ae(e,t));return n.updates(Q.call(document,n.content,!0))}var ce=[];function pe(e){for(var t=e.childNodes,n=t.length;n--;){var i=t[n];1!==i.nodeType&&0===Y.call(i.textContent).length&&e.removeChild(i)}}
9
9
  /*! (c) Andrea Giammarchi - ISC */var de=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var n;t?n=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),n=e.getAttributeNode("style"));return n.value="",e.setAttributeNode(n),i(n,!0)}(e,t):i(e.style,!1)};function n(e,t,n){return t+"-"+n.toLowerCase()}function i(i,s){var r,a;return function(o){var c,p,d,l;switch(typeof o){case"object":if(o){if("object"===r){if(!s&&a!==o)for(p in a)p in o||(i[p]="")}else s?i.value="":i.cssText="";for(p in c=s?{}:i,o)d="number"!=typeof(l=o[p])||e.test(p)?l:l+"px",!s&&/^--/.test(p)?c.setProperty(p,d):c[p]=d;r="object",s?i.value=function(e){var i,s=[];for(i in e)s.push(i.replace(t,n),":",e[i],";");return s.join("")}(a=c):a=o;break}default:a!=o&&(r="string",a=o,s?i.value=o||"":i.cssText=o||"")}}}}();const le=(e,t)=>{let n,i=!0;const s=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?i||(e.removeAttributeNode(s),i=!0):(s.value=t,i&&(e.setAttributeNodeNS(s),i=!1)))}},ue=({dataset:e})=>t=>{for(const n in t){const i=t[n];null==i?delete e[n]:e[n]=i}},me=(e,t)=>"dataset"===t?ue(e):n=>{e[t]=n},he=/^(?:form|list)$/i,fe=(e,t)=>e.ownerDocument.createTextNode(t);function ge(e){return this.type=e,function(e){var t=ce,n=pe;return function(i){return t!==i&&(n=oe(e,t=i)),n.apply(null,arguments)}}(this)}function ve(e){return e(this)}ge.prototype={attribute(e,t,n){const i="svg"===this.type;switch(t){case"class":if(i)return le(e,t);t="className";case"props":return me(e,t);case"aria":return(e=>t=>{for(const n in t){const i="role"===n?n:`aria-${n}`,s=t[n];null==s?e.removeAttribute(i):e.setAttribute(i,s)}})(e);case"style":return de(e,n,i);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return ue(e);default:return"."===t.slice(0,1)?me(e,t.slice(1)):"?"===t.slice(0,1)?((e,t,n)=>i=>{n!==!!i&&((n=!!i)?e.setAttribute(t,""):e.removeAttribute(t))})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,i=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(i=i.toLowerCase()),t=>{const s=q(t)?t:[t,!1];n!==s[0]&&(n&&e.removeEventListener(i,n,s[1]),(n=s[0])&&e.addEventListener(i,n,s[1]))}})(e,t):!(t in e)||i||he.test(t)?le(e,t):((e,t)=>{let n;return i=>{n!==i&&(n=i,e[t]!==i&&(null==i?(e[t]="",e.removeAttribute(t)):e[t]=i))}})(e,t)}},any(e,t){const{type:n}=this;let i,s=!1;const r=a=>{switch(typeof a){case"string":case"number":case"boolean":s?i!==a&&(i=a,t[0].textContent=a):(s=!0,i=a,t=J(e.parentNode,t,[fe(e,a)],W,e));break;case"function":r(a(e));break;case"object":case"undefined":if(null==a){s=!1,t=J(e.parentNode,t,[],W,e);break}default:if(s=!1,i=a,q(a))if(0===a.length)t.length&&(t=J(e.parentNode,t,[],W,e));else switch(typeof a[0]){case"string":case"number":case"boolean":r(String(a));break;case"function":r(a.map(ve,e));break;case"object":q(a[0])&&(a=a.concat.apply([],a));default:t=J(e.parentNode,t,a,W,e)}else"ELEMENT_NODE"in a?t=J(e.parentNode,t,11===a.nodeType?V.call(a.childNodes):[a],W,e):"text"in a?r(String(a.text)):"any"in a?r(a.any):"html"in a?t=J(e.parentNode,t,V.call(K([].concat(a.html).join(""),n).childNodes),W,e):"length"in a&&r(V.call(a))}};return r},text(e){let t;const n=i=>{if(t!==i){t=i;const s=typeof i;"object"===s&&i?"text"in i?n(String(i.text)):"any"in i?n(i.any):"html"in i?n([].concat(i.html).join("")):"length"in i&&n(V.call(i).join("")):"function"===s?n(i(e)):e.textContent=null==i?"":i}};return n}};const{create:be,freeze:ye,keys:_e}=Object,xe=ge.prototype,we=H(new b),Se=e=>({html:Ce("html",e),svg:Ce("svg",e),render(t,n){const i="function"==typeof n?n():n,s=we.get(t)||we.set(t,ke()),r=i instanceof Pe?Re(e,s,i):i;return r!==s.wire&&(s.wire=r,t.textContent="",t.appendChild(r.valueOf())),t}}),ke=()=>({stack:[],entry:null,wire:null}),Ce=(e,t)=>{const n=H(new b);return i.for=(e,s)=>{const r=n.get(e)||n.set(e,be(null));return r[s]||(r[s]=(e=>function(){return Re(t,e,i.apply(null,arguments))})(ke()))},i.node=function(){return Re(t,ke(),i.apply(null,arguments)).valueOf()},i;function i(){return new Pe(e,Oe.apply(null,arguments))}},Re=(e,t,{type:n,template:i,values:s})=>{const{length:r}=s;Te(e,t,s,r);let{entry:a}=t;if(a&&a.template===i&&a.type===n)a.tag(i,...s);else{const r=new e(n);t.entry=a={type:n,template:i,tag:r,wire:G(r(i,...s))}}return a.wire},Te=(e,{stack:t},n,i)=>{for(let s=0;s<i;s++){const i=n[s];i instanceof Ee?n[s]=Re(e,t[s]||(t[s]=ke()),i):q(i)?Te(e,t[s]||(t[s]=ke()),i,i.length):t[s]=null}i<t.length&&t.splice(i)};function Pe(e,t){this.type=e,this.template=t.shift(),this.values=t}ye(Pe);const Ee=Pe;function Oe(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}Se(ge);var De="function"==typeof cancelAnimationFrame,je=De?cancelAnimationFrame:clearTimeout,Ie=De?requestAnimationFrame:setTimeout;function Me(e){var t,n,i,s,r;return o(),function(e,o,p){return i=e,s=o,r=p,n||(n=Ie(a)),--t<0&&c(!0),c};function a(){o(),i.apply(s,r||[])}function o(){t=e||1/0,n=De?0:null}function c(e){var t=!!n;return t&&(je(n),e&&a()),t}}
10
- /*! (c) Andrea Giammarchi - ISC */let Le=null;const Ae=H(new WeakMap),Ne=(e,t,n)=>{e.apply(t,n)},Be={async:!1,always:!1},Fe=(e,t)=>"function"==typeof t?t(e):t,Ue=(e,t,n,i)=>{const s=Le.i++,{hook:r,args:a,stack:o,length:c}=Le;s===c&&(Le.length=o.push({}));const p=o[s];if(p.args=a,s===c){const s="function"==typeof n,{async:a,always:o}=(s?i:n)||i||Be;p.$=s?n(t):Fe(void 0,t),p._=a?Ae.get(r)||Ae.set(r,Me()):Ne,p.f=t=>{const n=e(p.$,t);(o||p.$!==n)&&(p.$=n,p._(r,null,p.args))}}return[p.$,p.f]},ze=new WeakMap;function qe({hook:e}){return e===this.hook}const $e=new WeakMap,Ve=H($e),He=()=>{},We=e=>(t,n)=>{const i=Le.i++,{hook:s,after:r,stack:a,length:o}=Le;if(i<o){const s=a[i],{update:o,values:c,stop:p}=s;if(!n||n.some(Ye,c)){s.values=n,e&&p(e);const{clean:i}=s;i&&(s.clean=null,i());const a=()=>{s.clean=t()};e?o(a):r.push(a)}}else{const i=e?Me():He,o={clean:null,update:i,values:n,stop:He};Le.length=a.push(o),(Ve.get(s)||Ve.set(s,[])).push(o);const c=()=>{o.clean=t()};e?o.stop=i(c):r.push(c)}},Ge=e=>{($e.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};$e.has.bind($e);const Ke=We(!0),Je=We(!1),Qe=(e,t)=>{const n=Le.i++,{stack:i,length:s}=Le;return n===s?Le.length=i.push({$:e(),_:t}):t&&!t.some(Ye,i[n]._)||(i[n]={$:e(),_:t}),i[n].$};function Ye(e,t){return e!==this[t]}let Xe=null;try{Xe=new{o(){}}.o}catch(Qt){}let Ze=e=>class extends e{};if(Xe){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,i){const s=[null];for(let e=0;e<n.length;e++)s.push(n[e]);const r=e.bind.apply(e,s);return t(new r,i.prototype)}};Ze=function(i,s){function r(){return n(s?e(i):i,arguments,r)}return t(r.prototype,i.prototype),t(r,i)}}const et={map:{},re:null},tt=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let nt=null;const it=(e,t)=>{const{map:n,re:i}=nt||t;return e.replace(i,((e,t,i,s)=>{const{tagName:r,is:a,element:o}=n[i];return o?t?`</${a}>`:`<${a}${s}`:t?`</${r}>`:`<${r} is="${a}"${s}`}))},st=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,rt=()=>nt,at=e=>{nt=e},ot={useCallback:(e,t)=>Qe((()=>e),t),useContext:e=>{const{hook:t,args:n}=Le,i=ze.get(e),s={hook:t,args:n};return i.some(qe,s)||i.push(s),e.value},useEffect:Ke,useLayoutEffect:Je,useMemo:Qe,useReducer:Ue,useRef:e=>{const t=Le.i++,{stack:n,length:i}=Le;return t===i&&(Le.length=n.push({current:e})),n[t]},useState:(e,t)=>Ue(Fe,e,void 0,t)},{render:ct,html:pt,svg:dt}=(e=>{const t=be(xe);return _e(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?O:String))})),n.prototype=t,Se(n);function n(){return ge.apply(this,arguments)}})({transform:()=>e=>it(e,et)}),{defineProperties:lt}=Object,ut=new b,mt=new b,ht=new b,ft=new k,gt="attributeChangedCallback",vt="connectedCallback",bt=`dis${vt}`,yt=(e,t,n)=>{if(n in e){const i=e[n];t[n]={configurable:true,value(){return Dt.call(this),i.apply(this,arguments)}}}else t[n]={configurable:true,value:Dt}},_t=e=>{const{prototype:t}=e,n=[],i={html:{configurable:true,get:Pt},svg:{configurable:true,get:Et}};if(i["_🔥"]={value:{events:n,info:null}},"handleEvent"in t||(i.handleEvent={configurable:true,value:Ot}),"render"in t&&t.render.length){const{oninit:e}=t;lt(t,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const i=Le,s=[];Le={hook:n,args:arguments,stack:t,i:0,length:t.length,after:s};try{return e.apply(null,arguments)}finally{Le=i;for(let e=0,{length:t}=s;e<t;e++)s[e]()}}})(this.render.bind(this,ot));lt(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Ge.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in t&&(n.push("init"),yt(t,i,"render")),yt(t,i,gt),yt(t,i,vt),yt(t,i,bt),[[gt,"onattributechanged",jt],[vt,"onconnected",It],[bt,"ondisconnected",Lt],[vt,"render",Mt]].forEach((([e,s,r])=>{if(!(e in t)&&s in t)if("render"!==s&&n.push(s.slice(2)),e in i){const t=i[e].value;i[e]={configurable:true,value(){return t.apply(this,arguments),r.apply(this,arguments)}}}else i[e]={configurable:true,value:r}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})}));const r=e.observedAttributes||[];r.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}));(e.mappedAttributes||[]).forEach((e=>{const s=new b,r="on"+e in t;r&&n.push(e),i[e]={configurable:true,get(){return s.get(this)},set(t){if(s.set(this,t),r){const n=xt(e);if(n.detail=t,ft.has(this))this.dispatchEvent(n);else{const e=ht.get(this);e?e.push(n):ht.set(this,[n])}}}}})),lt(t,i);const a=s.concat(r);return a.length?lt(e,{observedAttributes:{configurable:true,get:()=>a}}):e},xt=e=>new _(e),wt=(...e)=>new Ee("html",e);wt.for=pt.for;const St=(...e)=>new Ee("svg",e);St.for=dt.for;const kt=(e,t,n)=>{const i=Ct(e,t,new b);return n.set(e,i),i},Ct=(e,t,n)=>(i,...s)=>{const r=n.get(i)||((e,t,{info:n})=>{const i=n?it(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,i),i})(n,i,e["_🔥"]);return ct(e,(()=>t(r,...s)))};function Rt(e){this.addEventListener(e,this)}function Tt(e){this.dispatchEvent(e)}function Pt(){return ut.get(this)||kt(this,wt,ut)}function Et(){return mt.get(this)||kt(this,St,mt)}function Ot(e){this[`on${e.type}`](e)}function Dt(){if(!ft.has(this)){ft.add(this),this["_🔥"].events.forEach(Rt,this),this.dispatchEvent(xt("init"));const e=ht.get(this);e&&(ht.delete(this),e.forEach(Tt,this))}}function jt(e,t,n){const i=xt("attributechanged");i.attributeName=e,i.oldValue=t,i.newValue=n,this.dispatchEvent(i)}function It(){this.dispatchEvent(xt("connected"))}function Mt(){this.render()}function Lt(){this.dispatchEvent(xt("disconnected"))}const{create:At,defineProperty:Nt,defineProperties:Bt,getOwnPropertyNames:Ft,getOwnPropertySymbols:Ut,getOwnPropertyDescriptor:zt,keys:qt}=Object,$t={element:HTMLElement},Vt=new b;new b;const Ht=new b;new b;const Wt=e=>{const t=At(null),n=At(null),i={prototype:n,statics:t};return Ft(e).concat(Ut(e)).forEach((i=>{const s=zt(e,i);switch(s.enumerable=!1,i){case"extends":i="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[i]=s;break;default:n[i]=s}})),i},Gt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:i,$3:s,$4:r}=RegExp;let a=s||r||t.tagName||t.extends||"element";const o="fragment"===a;if(o)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",p="";a.indexOf("-")<0?(c=i.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g,"$2$5-$3$6").toLowerCase()+n,c.indexOf("-")<0&&(p="-heresy")):(c=a+n,a="element");const d=c+p;if(customElements.get(d))throw`Duplicated ${d} definition`;const l=Ze("object"==typeof t?Ht.get(t)||((e,t)=>{const{statics:n,prototype:i}=Wt(e),s=Ze($t[t]||($t[t]=document.createElement(t).constructor),!1);return Bt(s.prototype,i),Bt(s,n),Ht.set(e,_t(s)),s})(t,a):Vt.get(t)||(e=>{const t=Ze(e,!1);return Vt.set(e,_t(t)),t})(t),!0),u="element"===a;if(Nt(l,"new",{value:u?()=>document.createElement(d):()=>document.createElement(a,{is:d})}),Nt(l.prototype,"is",{value:d}),""===n){const e=(e=>{const{length:t}=e;let n=0,i=0;for(;i<t;)n=(n<<5)-n+e.charCodeAt(i++),n&=n;return n.toString(36)})(c.toUpperCase());et.map[i]=Kt(l,a,d,{id:e,i:0}),et.re=tt(qt(et.map))}if(o){const{render:e}=l.prototype;Nt(l.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const{firstChild:e}=this;let t=null;if(e){const n=document.createRange();n.setStartBefore(e),n.setEndAfter(this.lastChild),t=n.extractContents(),this.parentNode.replaceChild(t,this)}}}})}const m=[d,l];return u||m.push({extends:a}),customElements.define(...m),{Class:l,is:d,name:i,tagName:a}},Kt=(e,t,n,i)=>{const{prototype:s}=e,r=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[st(r)],o=e.includes||e.contains;if(o){const e={};qt(o).forEach((t=>{const n=`-${i.id}-${i.i++}`,{Class:s,is:r,name:c,tagName:p}=Gt(t,o[t],n);a.push(st(e[c]=Kt(s,p,r,i)))}));const t=tt(qt(e)),{events:n}=s["_🔥"],r={events:n,info:{map:e,re:t}};if(Nt(s,"_🔥",{value:r}),"render"in s){const{render:e}=s,{info:t}=r;Nt(s,"render",{configurable:!0,value(){const n=rt();at(t);const i=e.apply(this,arguments);return at(n),i}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),r},Jt=["audio","background","cameraaccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Qt,Yt;function Xt(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))}Qt="WherebyEmbed",Yt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this.onmessage)},ondisconnected(){window.removeEventListener("message",this.onmessage)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl",...Jt].map((e=>e.toLowerCase())),onattributechanged({attributeName:e,oldValue:t}){["room","subdomain"].includes(e)&&null==t||this.render()},style:e=>`\n ${e} {\n display: block;\n }\n ${e} iframe {\n border: none;\n height: 100%;\n width: 100%;\n }\n `,_postCommand(e,t=[]){if(this.iframe.current){const n=new URL(this.room,`https://${this.subdomain}.whereby.com`);this.iframe.current.contentWindow.postMessage({command:e,args:t},n.origin)}},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},onmessage({origin:e,data:t}){if(e!==new URL(this.room,`https://${this.subdomain}.whereby.com`).origin)return;const{type:n,payload:i}=t;this.dispatchEvent(new CustomEvent(n,{detail:i}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:i,minimal:s,room:r,groups:a,virtualbackgroundurl:o}=this;if(!r)return this.html`Whereby: Missing room attribute.`;const c=/https:\/\/([^.]+)\.whereby.com\/.+/.exec(r),p=c&&c[1]||this.subdomain;if(!p)return this.html`Whereby: Missing subdomain attr.`;const d=new URL(r,`https://${p}.whereby.com`);return Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({jsApi:!0,we:"2.0.0-alpha3",iframeSource:p},t&&{displayName:t}),n&&{lang:n}),i&&{metadata:i}),a&&{groups:a}),o&&{virtualBackgroundUrl:o}),e&&{avatarUrl:e}),null!=s&&{embed:s}),Jt.reduce(((e,t)=>null!=this[t.toLowerCase()]?Object.assign(Object.assign({},e),{[t]:this[t.toLowerCase()]}):e),{}))).forEach((([e,t])=>{d.searchParams.has(e)||"string"!=typeof t||d.searchParams.set(e,t)})),this.html`
10
+ /*! (c) Andrea Giammarchi - ISC */let Le=null;const Ae=H(new WeakMap),Ne=(e,t,n)=>{e.apply(t,n)},Be={async:!1,always:!1},Fe=(e,t)=>"function"==typeof t?t(e):t,Ue=(e,t,n,i)=>{const s=Le.i++,{hook:r,args:a,stack:o,length:c}=Le;s===c&&(Le.length=o.push({}));const p=o[s];if(p.args=a,s===c){const s="function"==typeof n,{async:a,always:o}=(s?i:n)||i||Be;p.$=s?n(t):Fe(void 0,t),p._=a?Ae.get(r)||Ae.set(r,Me()):Ne,p.f=t=>{const n=e(p.$,t);(o||p.$!==n)&&(p.$=n,p._(r,null,p.args))}}return[p.$,p.f]},ze=new WeakMap;function qe({hook:e}){return e===this.hook}const $e=new WeakMap,Ve=H($e),He=()=>{},We=e=>(t,n)=>{const i=Le.i++,{hook:s,after:r,stack:a,length:o}=Le;if(i<o){const s=a[i],{update:o,values:c,stop:p}=s;if(!n||n.some(Ye,c)){s.values=n,e&&p(e);const{clean:i}=s;i&&(s.clean=null,i());const a=()=>{s.clean=t()};e?o(a):r.push(a)}}else{const i=e?Me():He,o={clean:null,update:i,values:n,stop:He};Le.length=a.push(o),(Ve.get(s)||Ve.set(s,[])).push(o);const c=()=>{o.clean=t()};e?o.stop=i(c):r.push(c)}},Ge=e=>{($e.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};$e.has.bind($e);const Ke=We(!0),Je=We(!1),Qe=(e,t)=>{const n=Le.i++,{stack:i,length:s}=Le;return n===s?Le.length=i.push({$:e(),_:t}):t&&!t.some(Ye,i[n]._)||(i[n]={$:e(),_:t}),i[n].$};function Ye(e,t){return e!==this[t]}let Xe=null;try{Xe=new{o(){}}.o}catch(Qt){}let Ze=e=>class extends e{};if(Xe){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,i){const s=[null];for(let e=0;e<n.length;e++)s.push(n[e]);const r=e.bind.apply(e,s);return t(new r,i.prototype)}};Ze=function(i,s){function r(){return n(s?e(i):i,arguments,r)}return t(r.prototype,i.prototype),t(r,i)}}const et={map:{},re:null},tt=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let nt=null;const it=(e,t)=>{const{map:n,re:i}=nt||t;return e.replace(i,((e,t,i,s)=>{const{tagName:r,is:a,element:o}=n[i];return o?t?`</${a}>`:`<${a}${s}`:t?`</${r}>`:`<${r} is="${a}"${s}`}))},st=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,rt=()=>nt,at=e=>{nt=e},ot={useCallback:(e,t)=>Qe((()=>e),t),useContext:e=>{const{hook:t,args:n}=Le,i=ze.get(e),s={hook:t,args:n};return i.some(qe,s)||i.push(s),e.value},useEffect:Ke,useLayoutEffect:Je,useMemo:Qe,useReducer:Ue,useRef:e=>{const t=Le.i++,{stack:n,length:i}=Le;return t===i&&(Le.length=n.push({current:e})),n[t]},useState:(e,t)=>Ue(Fe,e,void 0,t)},{render:ct,html:pt,svg:dt}=(e=>{const t=be(xe);return _e(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?O:String))})),n.prototype=t,Se(n);function n(){return ge.apply(this,arguments)}})({transform:()=>e=>it(e,et)}),{defineProperties:lt}=Object,ut=new b,mt=new b,ht=new b,ft=new k,gt="attributeChangedCallback",vt="connectedCallback",bt=`dis${vt}`,yt=(e,t,n)=>{if(n in e){const i=e[n];t[n]={configurable:true,value(){return Dt.call(this),i.apply(this,arguments)}}}else t[n]={configurable:true,value:Dt}},_t=e=>{const{prototype:t}=e,n=[],i={html:{configurable:true,get:Pt},svg:{configurable:true,get:Et}};if(i["_🔥"]={value:{events:n,info:null}},"handleEvent"in t||(i.handleEvent={configurable:true,value:Ot}),"render"in t&&t.render.length){const{oninit:e}=t;lt(t,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const i=Le,s=[];Le={hook:n,args:arguments,stack:t,i:0,length:t.length,after:s};try{return e.apply(null,arguments)}finally{Le=i;for(let e=0,{length:t}=s;e<t;e++)s[e]()}}})(this.render.bind(this,ot));lt(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Ge.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in t&&(n.push("init"),yt(t,i,"render")),yt(t,i,gt),yt(t,i,vt),yt(t,i,bt),[[gt,"onattributechanged",jt],[vt,"onconnected",It],[bt,"ondisconnected",Lt],[vt,"render",Mt]].forEach((([e,s,r])=>{if(!(e in t)&&s in t)if("render"!==s&&n.push(s.slice(2)),e in i){const t=i[e].value;i[e]={configurable:true,value(){return t.apply(this,arguments),r.apply(this,arguments)}}}else i[e]={configurable:true,value:r}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})}));const r=e.observedAttributes||[];r.forEach((e=>{e in t||(i[e]={configurable:true,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}));(e.mappedAttributes||[]).forEach((e=>{const s=new b,r="on"+e in t;r&&n.push(e),i[e]={configurable:true,get(){return s.get(this)},set(t){if(s.set(this,t),r){const n=xt(e);if(n.detail=t,ft.has(this))this.dispatchEvent(n);else{const e=ht.get(this);e?e.push(n):ht.set(this,[n])}}}}})),lt(t,i);const a=s.concat(r);return a.length?lt(e,{observedAttributes:{configurable:true,get:()=>a}}):e},xt=e=>new _(e),wt=(...e)=>new Ee("html",e);wt.for=pt.for;const St=(...e)=>new Ee("svg",e);St.for=dt.for;const kt=(e,t,n)=>{const i=Ct(e,t,new b);return n.set(e,i),i},Ct=(e,t,n)=>(i,...s)=>{const r=n.get(i)||((e,t,{info:n})=>{const i=n?it(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,i),i})(n,i,e["_🔥"]);return ct(e,(()=>t(r,...s)))};function Rt(e){this.addEventListener(e,this)}function Tt(e){this.dispatchEvent(e)}function Pt(){return ut.get(this)||kt(this,wt,ut)}function Et(){return mt.get(this)||kt(this,St,mt)}function Ot(e){this[`on${e.type}`](e)}function Dt(){if(!ft.has(this)){ft.add(this),this["_🔥"].events.forEach(Rt,this),this.dispatchEvent(xt("init"));const e=ht.get(this);e&&(ht.delete(this),e.forEach(Tt,this))}}function jt(e,t,n){const i=xt("attributechanged");i.attributeName=e,i.oldValue=t,i.newValue=n,this.dispatchEvent(i)}function It(){this.dispatchEvent(xt("connected"))}function Mt(){this.render()}function Lt(){this.dispatchEvent(xt("disconnected"))}const{create:At,defineProperty:Nt,defineProperties:Bt,getOwnPropertyNames:Ft,getOwnPropertySymbols:Ut,getOwnPropertyDescriptor:zt,keys:qt}=Object,$t={element:HTMLElement},Vt=new b;new b;const Ht=new b;new b;const Wt=e=>{const t=At(null),n=At(null),i={prototype:n,statics:t};return Ft(e).concat(Ut(e)).forEach((i=>{const s=zt(e,i);switch(s.enumerable=!1,i){case"extends":i="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[i]=s;break;default:n[i]=s}})),i},Gt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:i,$3:s,$4:r}=RegExp;let a=s||r||t.tagName||t.extends||"element";const o="fragment"===a;if(o)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",p="";a.indexOf("-")<0?(c=i.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g,"$2$5-$3$6").toLowerCase()+n,c.indexOf("-")<0&&(p="-heresy")):(c=a+n,a="element");const d=c+p;if(customElements.get(d))throw`Duplicated ${d} definition`;const l=Ze("object"==typeof t?Ht.get(t)||((e,t)=>{const{statics:n,prototype:i}=Wt(e),s=Ze($t[t]||($t[t]=document.createElement(t).constructor),!1);return Bt(s.prototype,i),Bt(s,n),Ht.set(e,_t(s)),s})(t,a):Vt.get(t)||(e=>{const t=Ze(e,!1);return Vt.set(e,_t(t)),t})(t),!0),u="element"===a;if(Nt(l,"new",{value:u?()=>document.createElement(d):()=>document.createElement(a,{is:d})}),Nt(l.prototype,"is",{value:d}),""===n){const e=(e=>{const{length:t}=e;let n=0,i=0;for(;i<t;)n=(n<<5)-n+e.charCodeAt(i++),n&=n;return n.toString(36)})(c.toUpperCase());et.map[i]=Kt(l,a,d,{id:e,i:0}),et.re=tt(qt(et.map))}if(o){const{render:e}=l.prototype;Nt(l.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const{firstChild:e}=this;let t=null;if(e){const n=document.createRange();n.setStartBefore(e),n.setEndAfter(this.lastChild),t=n.extractContents(),this.parentNode.replaceChild(t,this)}}}})}const m=[d,l];return u||m.push({extends:a}),customElements.define(...m),{Class:l,is:d,name:i,tagName:a}},Kt=(e,t,n,i)=>{const{prototype:s}=e,r=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[st(r)],o=e.includes||e.contains;if(o){const e={};qt(o).forEach((t=>{const n=`-${i.id}-${i.i++}`,{Class:s,is:r,name:c,tagName:p}=Gt(t,o[t],n);a.push(st(e[c]=Kt(s,p,r,i)))}));const t=tt(qt(e)),{events:n}=s["_🔥"],r={events:n,info:{map:e,re:t}};if(Nt(s,"_🔥",{value:r}),"render"in s){const{render:e}=s,{info:t}=r;Nt(s,"render",{configurable:!0,value(){const n=rt();at(t);const i=e.apply(this,arguments);return at(n),i}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),r},Jt=["audio","background","cameraaccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Qt,Yt;function Xt(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))}Qt="WherebyEmbed",Yt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this.onmessage)},ondisconnected(){window.removeEventListener("message",this.onmessage)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl",...Jt].map((e=>e.toLowerCase())),onattributechanged({attributeName:e,oldValue:t}){["room","subdomain"].includes(e)&&null==t||this.render()},style:e=>`\n ${e} {\n display: block;\n }\n ${e} iframe {\n border: none;\n height: 100%;\n width: 100%;\n }\n `,_postCommand(e,t=[]){if(this.iframe.current){const n=new URL(this.room,`https://${this.subdomain}.whereby.com`);this.iframe.current.contentWindow.postMessage({command:e,args:t},n.origin)}},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},onmessage({origin:e,data:t}){if(e!==new URL(this.room,`https://${this.subdomain}.whereby.com`).origin)return;const{type:n,payload:i}=t;this.dispatchEvent(new CustomEvent(n,{detail:i}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:i,minimal:s,room:r,groups:a,virtualbackgroundurl:o}=this;if(!r)return this.html`Whereby: Missing room attribute.`;const c=/https:\/\/([^.]+)\.whereby.com\/.+/.exec(r),p=c&&c[1]||this.subdomain;if(!p)return this.html`Whereby: Missing subdomain attr.`;const d=new URL(r,`https://${p}.whereby.com`);return Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({jsApi:!0,we:"2.0.0-alpha4",iframeSource:p},t&&{displayName:t}),n&&{lang:n}),i&&{metadata:i}),a&&{groups:a}),o&&{virtualBackgroundUrl:o}),e&&{avatarUrl:e}),null!=s&&{embed:s}),Jt.reduce(((e,t)=>null!=this[t.toLowerCase()]?Object.assign(Object.assign({},e),{[t]:this[t.toLowerCase()]}):e),{}))).forEach((([e,t])=>{d.searchParams.has(e)||"string"!=typeof t||d.searchParams.set(e,t)})),this.html`
11
11
  <iframe
12
12
  ref=${this.iframe}
13
13
  src=${d}
14
14
  allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
15
- `}},("string"==typeof Qt?Gt(Qt,Yt,""):Gt(Qt.name,Qt,"")).Class;var Zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var i=Function.bind.apply(t,n);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var nn,sn={},rn={};function an(){if(nn)return rn;nn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),l=Symbol.iterator;var u={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function f(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}function g(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=f.prototype;var b=v.prototype=new g;b.constructor=v,m(b,f.prototype),b.isPureReactComponent=!0;var y=Array.isArray,_=Object.prototype.hasOwnProperty,x={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function S(t,n,i){var s,r={},a=null,o=null;if(null!=n)for(s in void 0!==n.ref&&(o=n.ref),void 0!==n.key&&(a=""+n.key),n)_.call(n,s)&&!w.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var p=Array(c),d=0;d<c;d++)p[d]=arguments[d+2];r.children=p}if(t&&t.defaultProps)for(s in c=t.defaultProps)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:a,ref:o,props:r,_owner:x.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function R(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(n,i,s,r,a){var o=typeof n;"undefined"!==o&&"boolean"!==o||(n=null);var c=!1;if(null===n)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(n.$$typeof){case e:case t:c=!0}}if(c)return a=a(c=n),n=""===r?"."+R(c,0):r,y(a)?(s="",null!=n&&(s=n.replace(C,"$&/")+"/"),T(a,i,s,"",(function(e){return e}))):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,s+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),i.push(a)),1;if(c=0,r=""===r?".":r+":",y(n))for(var p=0;p<n.length;p++){var d=r+R(o=n[p],p);c+=T(o,i,s,d,a)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=l&&e[l]||e["@@iterator"])?e:null}(n),"function"==typeof d)for(n=d.call(n),p=0;!(o=n.next()).done;)c+=T(o=o.value,i,s,d=r+R(o,p++),a);else if("object"===o)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function P(e,t,n){if(null==e)return e;var i=[],s=0;return T(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function E(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},D={transition:null},j={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:D,ReactCurrentOwner:x};return rn.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},rn.Component=f,rn.Fragment=n,rn.Profiler=s,rn.PureComponent=v,rn.StrictMode=i,rn.Suspense=c,rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,rn.cloneElement=function(t,n,i){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=m({},t.props),r=t.key,a=t.ref,o=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,o=x.current),void 0!==n.key&&(r=""+n.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(p in n)_.call(n,p)&&!w.hasOwnProperty(p)&&(s[p]=void 0===n[p]&&void 0!==c?c[p]:n[p])}var p=arguments.length-2;if(1===p)s.children=i;else if(1<p){c=Array(p);for(var d=0;d<p;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:a,props:s,_owner:o}},rn.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:r,_context:e},e.Consumer=e},rn.createElement=S,rn.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},rn.createRef=function(){return{current:null}},rn.forwardRef=function(e){return{$$typeof:o,render:e}},rn.isValidElement=k,rn.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:E}},rn.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},rn.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},rn.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},rn.useCallback=function(e,t){return O.current.useCallback(e,t)},rn.useContext=function(e){return O.current.useContext(e)},rn.useDebugValue=function(){},rn.useDeferredValue=function(e){return O.current.useDeferredValue(e)},rn.useEffect=function(e,t){return O.current.useEffect(e,t)},rn.useId=function(){return O.current.useId()},rn.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},rn.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},rn.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},rn.useMemo=function(e,t){return O.current.useMemo(e,t)},rn.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},rn.useRef=function(e){return O.current.useRef(e)},rn.useState=function(e){return O.current.useState(e)},rn.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},rn.useTransition=function(){return O.current.useTransition()},rn.version="18.2.0",rn}var on,cn,pn={},dn={get exports(){return pn},set exports(e){pn=e}};function ln(){return on||(on=1,e=dn,t=pn,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),f=Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var t=f&&e[f]||e["@@iterator"];return"function"==typeof t?t:null}var v={current:null},b={transition:null},y={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},_={current:null},x={},w=null;function S(e){w=e}x.setExtraStackFrame=function(e){w=e},x.getCurrentStack=null,x.getStackAddendum=function(){var e="";w&&(e+=w);var t=x.getCurrentStack;return t&&(e+=t()||""),e};var k={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:b,ReactCurrentOwner:_};function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("warn",e,n)}function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("error",e,n)}function T(e,t,n){var i=k.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var s=n.map((function(e){return String(e)}));s.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,s)}k.ReactDebugCurrentFrame=x,k.ReactCurrentActQueue=y;var P={};function E(e,t){var n=e.constructor,i=n&&(n.displayName||n.name)||"ReactClass",s=i+"."+t;P[s]||(R("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,i),P[s]=!0)}var O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){E(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,i){E(e,"replaceState")},enqueueSetState:function(e,t,n,i){E(e,"setState")}},D=Object.assign,j={};function I(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}Object.freeze(j),I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var M={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},L=function(e,t){Object.defineProperty(I.prototype,e,{get:function(){C("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var A in M)M.hasOwnProperty(A)&&L(A,M[A]);function N(){}function B(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}N.prototype=I.prototype;var F=B.prototype=new N;F.constructor=B,D(F,I.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function z(e){return U(e)}function q(e){return""+e}function $(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}function V(e){return e.displayName||"Context"}function H(e){if(null==e)return null;if("number"==typeof e.tag&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case i:return"Portal";case a:return"Profiler";case r:return"StrictMode";case d:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return V(e)+".Consumer";case o:return V(e._context)+".Provider";case p:return function(e,t,n){var i=e.displayName;if(i)return i;var s=t.displayName||t.name||"";return""!==s?n+"("+s+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:H(e.type)||"Memo";case m:var n=e,h=n._payload,f=n._init;try{return H(f(h))}catch(e){return null}}return null}var W,G,K,J=Object.prototype.hasOwnProperty,Q={key:!0,ref:!0,__self:!0,__source:!0};function Y(e){if(J.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function X(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function Z(e,t){var n=function(){W||(W=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function ee(e,t){var n=function(){G||(G=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}function te(e){if("string"==typeof e.ref&&_.current&&e.__self&&_.current.stateNode!==e.__self){var t=H(_.current.type);K[t]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),K[t]=!0)}}K={};var ne=function(e,t,i,s,r,a,o){var c={$$typeof:n,type:e,key:t,ref:i,props:o,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ie(e,t,n){var i,s={},r=null,a=null,o=null,c=null;if(null!=t)for(i in Y(t)&&(a=t.ref,te(t)),X(t)&&($(t.key),r=""+t.key),o=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(s[i]=t[i]);var p=arguments.length-2;if(1===p)s.children=n;else if(p>1){for(var d=Array(p),l=0;l<p;l++)d[l]=arguments[l+2];Object.freeze&&Object.freeze(d),s.children=d}if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===s[i]&&(s[i]=u[i])}if(r||a){var m="function"==typeof e?e.displayName||e.name||"Unknown":e;r&&Z(s,m),a&&ee(s,m)}return ne(e,r,a,o,c,_.current,s)}function se(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i,s,r=D({},e.props),a=e.key,o=e.ref,c=e._self,p=e._source,d=e._owner;if(null!=t)for(i in Y(t)&&(o=t.ref,d=_.current),X(t)&&($(t.key),a=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==s?r[i]=s[i]:r[i]=t[i]);var l=arguments.length-2;if(1===l)r.children=n;else if(l>1){for(var u=Array(l),m=0;m<l;m++)u[m]=arguments[m+2];r.children=u}return ne(e.type,a,o,c,p,d,r)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var ae,oe=!1,ce=/\/+/g;function pe(e){return e.replace(ce,"$&/")}function de(e,t){return"object"==typeof e&&null!==e&&null!=e.key?($(e.key),n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function le(e,t,s,r,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var c,p,d,l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l){var u=e,m=a(u),h=""===r?"."+de(u,0):r;if(z(m)){var f="";null!=h&&(f=pe(h)+"/"),le(m,t,f,"",(function(e){return e}))}else null!=m&&(re(m)&&(!m.key||u&&u.key===m.key||$(m.key),c=m,p=s+(!m.key||u&&u.key===m.key?"":pe(""+m.key)+"/")+h,m=ne(c.type,p,c.ref,c._self,c._source,c._owner,c.props)),t.push(m));return 1}var v=0,b=""===r?".":r+":";if(z(e))for(var y=0;y<e.length;y++)v+=le(d=e[y],t,s,b+de(d,y),a);else{var _=g(e);if("function"==typeof _){var x=e;_===x.entries&&(oe||C("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oe=!0);for(var w,S=_.call(x),k=0;!(w=S.next()).done;)v+=le(d=w.value,t,s,b+de(d,k++),a)}else if("object"===o){var R=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}}return v}function ue(e,t,n){if(null==e)return e;var i=[],s=0;return le(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function me(e){if(-1===e._status){var t=(0,e._result)();if(t.then((function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}}),(function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}})),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var i=e._result;return void 0===i&&R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",i),"default"in i||R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",i),i.default}throw e._result}function he(e){return"string"==typeof e||"function"==typeof e||e===s||e===a||e===r||e===d||e===l||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===o||e.$$typeof===c||e.$$typeof===p||e.$$typeof===ae||void 0!==e.getModuleId)}function fe(){var e=v.current;return null===e&&R("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}ae=Symbol.for("react.module.reference");var ge,ve,be,ye,_e,xe,we,Se=0;function ke(){}ke.__reactDisabledLog=!0;var Ce,Re=k.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===Ce)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);Ce=i&&i[1]||""}return"\n"+Ce+e}var Pe,Ee=!1,Oe="function"==typeof WeakMap?WeakMap:Map;function De(e,t){if(!e||Ee)return"";var n,i=Pe.get(e);if(void 0!==i)return i;Ee=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=Re.current,Re.current=null,function(){if(0===Se){ge=console.log,ve=console.info,be=console.warn,ye=console.error,_e=console.group,xe=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Se++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),c=n.stack.split("\n"),p=o.length-1,d=c.length-1;p>=1&&d>=0&&o[p]!==c[d];)d--;for(;p>=1&&d>=0;p--,d--)if(o[p]!==c[d]){if(1!==p||1!==d)do{if(p--,--d<0||o[p]!==c[d]){var l="\n"+o[p].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&Pe.set(e,l),l}}while(p>=1&&d>=0);break}}}finally{Ee=!1,Re.current=s,function(){if(0==--Se){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ge}),info:D({},e,{value:ve}),warn:D({},e,{value:be}),error:D({},e,{value:ye}),group:D({},e,{value:_e}),groupCollapsed:D({},e,{value:xe}),groupEnd:D({},e,{value:we})})}Se<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=e?e.displayName||e.name:"",m=u?Te(u):"";return"function"==typeof e&&Pe.set(e,m),m}function je(e,t,n){if(null==e)return"";if("function"==typeof e)return De(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Te(e);switch(e){case d:return Te("Suspense");case l:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case p:return De(e.render,!1);case u:return je(e.type,t,n);case m:var i=e,s=i._payload,r=i._init;try{return je(r(s),t,n)}catch(e){}}return""}Pe=new Oe;var Ie,Me={},Le=k.ReactDebugCurrentFrame;function Ae(e){if(e){var t=e._owner,n=je(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(n)}else Le.setExtraStackFrame(null)}function Ne(e){if(e){var t=e._owner;S(je(e.type,e._source,t?t.type:null))}else S(null)}function Be(){if(_.current){var e=H(_.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Fe(e){return null!=e&&void 0!==(t=e.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"";var t}Ie=!1;var Ue={};function ze(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Be();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!Ue[n]){Ue[n]=!0;var i="";e&&e._owner&&e._owner!==_.current&&(i=" It was passed a child from "+H(e._owner.type)+"."),Ne(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),Ne(null)}}}function qe(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var i=e[n];re(i)&&ze(i,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var s=g(e);if("function"==typeof s&&s!==e.entries)for(var r,a=s.call(e);!(r=a.next()).done;)re(r.value)&&ze(r.value,t)}}function $e(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==p&&n.$$typeof!==u)return;t=n.propTypes}if(t){var i=H(n);!function(e,t,n,i,s){var r=Function.call.bind(J);for(var a in e)if(r(e,a)){var o=void 0;try{if("function"!=typeof e[a]){var c=Error((i||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}o=e[a](t,a,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){o=e}!o||o instanceof Error||(Ae(s),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,a,typeof o),Ae(null)),o instanceof Error&&!(o.message in Me)&&(Me[o.message]=!0,Ae(s),R("Failed %s type: %s",n,o.message),Ae(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||Ie||(Ie=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ve(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){Ne(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),Ne(null);break}}null!==e.ref&&(Ne(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),Ne(null))}function He(e,t,i){var r=he(e);if(!r){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var o,c=Fe(t);a+=c||Be(),null===e?o="null":z(e)?o="array":void 0!==e&&e.$$typeof===n?(o="<"+(H(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,R("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,a)}var p=ie.apply(this,arguments);if(null==p)return p;if(r)for(var d=2;d<arguments.length;d++)qe(arguments[d],e);return e===s?Ve(p):$e(p),p}var We=!1,Ge=!1,Ke=null,Je=0,Qe=!1;function Ye(e){e!==Je-1&&R("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Je=e}function Xe(t,n,i){var s=y.current;if(null!==s)try{et(s),function(t){if(null===Ke)try{var n=("require"+Math.random()).slice(0,7),i=e&&e[n];Ke=i.call(e,"timers").setImmediate}catch(e){Ke=function(e){!1===Ge&&(Ge=!0,"undefined"==typeof MessageChannel&&R("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ke(t)}((function(){0===s.length?(y.current=null,n(t)):Xe(t,n,i)}))}catch(e){i(e)}else n(t)}var Ze=!1;function et(e){if(!Ze){Ze=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(n){throw e=e.slice(t+1),n}finally{Ze=!1}}}var tt=He,nt=function(e,t,n){for(var i=se.apply(this,arguments),s=2;s<arguments.length;s++)qe(arguments[s],i.type);return $e(i),i},it=function(e){var t=He.bind(null,e);return t.type=e,We||(We=!0,C("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return C("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},st={map:ue,forEach:function(e,t,n){ue(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return ue(e,(function(){t++})),t},toArray:function(e){return ue(e,(function(e){return e}))||[]},only:function(e){if(!re(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=st,t.Component=I,t.Fragment=s,t.Profiler=a,t.PureComponent=B,t.StrictMode=r,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k,t.cloneElement=nt,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:o,_context:t};var n=!1,i=!1,s=!1,r={$$typeof:c,_context:t};return Object.defineProperties(r,{Provider:{get:function(){return i||(i=!0,R("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,R("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){s||(C("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),s=!0)}}}),t.Consumer=r,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=tt,t.createFactory=it,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===u?R("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?R("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&R("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||R("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:p,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=re,t.lazy=function(e){var t,n,i={$$typeof:m,_payload:{_status:-1,_result:e},_init:me};return Object.defineProperties(i,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){R("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(i,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){R("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(i,"propTypes",{enumerable:!0})}}}),i},t.memo=function(e,t){he(e)||R("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,i={$$typeof:u,type:e,compare:void 0===t?null:t};return Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),i},t.startTransition=function(e,t){var n=b.transition;b.transition={};var i=b.transition;b.transition._updatedFibers=new Set;try{e()}finally{b.transition=n,null===n&&i._updatedFibers&&(i._updatedFibers.size>10&&C("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),i._updatedFibers.clear())}},t.unstable_act=function(e){var t=Je;Je++,null===y.current&&(y.current=[]);var n,i=y.isBatchingLegacy;try{if(y.isBatchingLegacy=!0,n=e(),!i&&y.didScheduleLegacyUpdate){var s=y.current;null!==s&&(y.didScheduleLegacyUpdate=!1,et(s))}}catch(e){throw Ye(t),e}finally{y.isBatchingLegacy=i}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var r=n,a=!1,o={then:function(e,n){a=!0,r.then((function(i){Ye(t),0===Je?Xe(i,e,n):e(i)}),(function(e){Ye(t),n(e)}))}};return Qe||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){a||(Qe=!0,R("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),o}var c=n;if(Ye(t),0===Je){var p=y.current;return null!==p&&(et(p),y.current=null),{then:function(e,t){null===y.current?(y.current=[],Xe(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return fe().useCallback(e,t)},t.useContext=function(e){var t=fe();if(void 0!==e._context){var n=e._context;n.Consumer===e?R("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&R("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return fe().useDebugValue(e,t)},t.useDeferredValue=function(e){return fe().useDeferredValue(e)},t.useEffect=function(e,t){return fe().useEffect(e,t)},t.useId=function(){return fe().useId()},t.useImperativeHandle=function(e,t,n){return fe().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return fe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return fe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return fe().useMemo(e,t)},t.useReducer=function(e,t,n){return fe().useReducer(e,t,n)},t.useRef=function(e){return fe().useRef(e)},t.useState=function(e){return fe().useState(e)},t.useSyncExternalStore=function(e,t,n){return fe().useSyncExternalStore(e,t,n)},t.useTransition=function(){return fe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pn;var e,t}cn={get exports(){return sn},set exports(e){sn=e}},"production"===process.env.NODE_ENV?cn.exports=an():cn.exports=ln();var un=en(sn),mn=e=>{var{stream:t}=e,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["stream"]);const i=sn.useCallback((e=>{null!==e&&e.srcObject!==t&&(e.srcObject=t)}),[]);return un.createElement("video",Object.assign({ref:i,autoPlay:!0,playsInline:!0},n))};const hn="client_connection_status_changed",fn="stream_added",gn="rtc_manager_created",vn="rtc_manager_destroyed",bn="local_stream_track_added",yn="local_stream_track_removed",_n="connecting",xn="connection_failed",wn="connection_successful",Sn="connection_disconnected",kn="fetch_mediaserver_config",Cn="start_screenshare",Rn="stop_screenshare",Tn="mediaserver_config",Pn="room_joined",En="ice_candidate",On="ice_endofcandidates",Dn="ready_to_receive_offer",jn="sdp_answer",In="sdp_offer";let Mn=!0,Ln=!0;function An(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function Nn(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,s=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return s.apply(this,arguments);const r=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,r),s.apply(this,[e,r])};const r=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return r.apply(this,arguments);if(!this._eventMap[t].has(n))return r.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mn=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Fn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ln=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Un(){if("object"==typeof window){if(Mn)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function zn(e,t){Ln&&console.warn(e+" is deprecated, please use "+t+" instead.")}function qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function $n(e){return qn(e)?Object.keys(e).reduce((function(t,n){const i=qn(e[n]),s=i?$n(e[n]):e[n],r=i&&!Object.keys(s).length;return void 0===s||r?t:Object.assign(t,{[n]:s})}),{}):e}function Vn(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?Vn(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((t=>{Vn(e,e.get(t),n)}))})))}function Hn(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",s=new Map;if(null===t)return s;const r=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((t=>{e.forEach((n=>{n.type===i&&n.trackId===t.id&&Vn(e,n,s)}))})),s}const Wn=Un;function Gn(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[s("min",n)]=i.ideal,t.optional.push(e),e={},e[s("max",n)]=i.ideal,t.optional.push(e)):(e[s("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=i.exact):["min","max"].forEach((e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=i[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,s){if(t.version>=61)return s(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let r=e.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const a=t.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===r.exact||"environment"===r.ideal?t=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{n=n.filter((e=>"videoinput"===e.kind));let a=n.find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=r.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=i(e.video),Wn("chrome: "+JSON.stringify(e)),s(e)}))}e.video=i(e.video)}return Wn("chrome: "+JSON.stringify(e)),s(e)},r=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){s(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{i&&i(r(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return s(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(r(e))))))}}}function Kn(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Jn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const s=new Event("track");s.track=n.track,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)})),t.stream.getTracks().forEach((n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const s=new Event("track");s.track=n,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Nn(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Qn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let s=n.apply(this,arguments);return s||(s=t(this,e),this._senders.push(s)),s};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yn(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const s=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},r=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const i=function(e){n(r(s(e)))};return t.apply(this,[i,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(r(s(t)))},n])})).then(n,i)}}function Xn(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach((n=>{n.track===e&&(t?i=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?i=!0:n=t),t.track===e))),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Zn(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const s=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),s.apply(this,arguments)}}function ei(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Zn(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const s=e.RTCPeerConnection.prototype.removeStream;function r(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(s.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),s.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const s=this.getSenders().find((e=>e.track===t));if(s)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const r=this._streams[n.id];if(r)r.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=r(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>r(this,e)))}};e.RTCPeerConnection.prototype[t]=i[t]}));const o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:r(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ti(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function ni(e,t){Nn(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var ii=Object.freeze({__proto__:null,shimMediaStream:Kn,shimOnTrack:Jn,shimGetSendersWithDtmf:Qn,shimGetStats:Yn,shimSenderReceiverGetStats:Xn,shimAddTrackRemoveTrackWithNative:Zn,shimAddTrackRemoveTrack:ei,shimPeerConnection:ti,fixNegotiationNeeded:ni,shimGetUserMedia:Gn,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const i=n.video&&n.video.width,s=n.video&&n.video.height,r=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},i&&(n.video.mandatory.maxWidth=i),s&&(n.video.mandatory.maxHeight=s),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function si(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){zn("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ri(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ai(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,s,r]=arguments;return i.apply(this,[e||null]).then((e=>{if(t.version<53&&!s)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(s,r)}}function oi(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ci(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function pi(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){zn("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function di(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function li(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function ui(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function mi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function hi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var fi=Object.freeze({__proto__:null,shimOnTrack:ri,shimPeerConnection:ai,shimSenderGetStats:oi,shimReceiverGetStats:ci,shimRemoveStream:pi,shimRTCDataChannel:di,shimAddTransceiver:li,shimGetParameters:ui,shimCreateOffer:mi,shimCreateAnswer:hi,shimGetUserMedia:si,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function gi(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function vi(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function bi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,s=t.setLocalDescription,r=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],s=n.apply(this,[i]);return t?(s.then(e,t),Promise.resolve()):s},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],s=i.apply(this,[n]);return t?(s.then(e,t),Promise.resolve()):s};let o=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=o,o=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=o,o=function(e,t,n){const i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=o}function yi(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(_i(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function _i(e){return e&&void 0!==e.video?Object.assign({},e,{video:$n(e.video)}):e}function xi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(zn("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function wi(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Si(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ki(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ci=Object.freeze({__proto__:null,shimLocalStreamsAPI:gi,shimRemoteStreamsAPI:vi,shimCallbacksAPI:bi,shimGetUserMedia:yi,shimConstraints:_i,shimRTCIceServerUrls:xi,shimTrackEventTransceiver:wi,shimCreateOfferLegacy:Si,shimAudioContext:ki}),Ri={};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const i=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<i.length;e++)n=i[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substring(t+1,i),n.value=e.substring(i+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],s=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" ");for(let s=3;s<i.length;s++){const r=i[s],a=t.matchPrefix(e,"a=rtpmap:"+r+" ")[0];if(a){const i=t.parseRtpMap(a),s=t.matchPrefix(e,"a=fmtp:"+r+" ");switch(i.parameters=s.length?t.parseFmtp(s[0]):{},i.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+r+" ").map(t.parseRtcpFb),n.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))}));const s=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{s.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)}));let s=0;return n.codecs.forEach((e=>{e.maxptime>s&&(s=e.maxptime)})),s>0&&(i+="a=maxptime:"+s+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{i+=t.writeExtmap(e)})),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),s=-1!==i.fecMechanisms.indexOf("RED"),r=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let c;const p=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));p.length>0&&p[0].length>1&&p[0][0]===o&&(c=p[0][1]),i.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&c&&(t.rtx={ssrc:c}),n.push(t),s&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&o&&n.push({ssrc:o});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const s=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=0===s.length;const r=t.matchPrefix(e,"a=rtcp-mux");return n.mux=r.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(1===i.length)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return s.length>0?(n=s[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const r=t.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:n.fmt,maxMessageSize:s};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:s}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let s;const r=void 0!==n?n:2;s=e||t.generateSessionId();return"v=0\r\no="+(i||"thisisadapterortc")+" "+s+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const i=t.splitLines(e);for(let e=0;e<i.length;e++)switch(i[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[e].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t}({get exports(){return Ri},set exports(e){Ri=e}});var Ti=Ri,Pi=g({__proto__:null,default:Ti},[Ri]);function Ei(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),i=Ti.parseCandidate(e.candidate),s=Object.assign(n,i);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Nn(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Oi(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Nn(e,"icecandidate",(e=>{if(e.candidate){const t=Ti.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Di(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=Ti.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Ti.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},r=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const s=Ti.matchPrefix(e.sdp,"a=max-message-size:");return s.length>0?i=parseInt(s[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=s(e),n=r(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>a}),this._sctp=o}return a.apply(this,arguments)}}function ji(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],s=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&s>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Nn(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ii(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function Mi(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Li(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ai(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})}var Ni=Object.freeze({__proto__:null,shimRTCIceCandidate:Ei,shimRTCIceCandidateRelayProtocol:Oi,shimMaxMessageSize:Di,shimSendThrowTypeError:ji,shimConnectionState:Ii,removeExtmapAllowMixed:Mi,shimAddIceCandidateNullOrEmpty:Li,shimParameterlessSetLocalDescription:Ai});const Bi=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Un,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=An(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=An(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=An(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),s={browserDetails:i,commonShim:Ni,extractVersion:An,disableLog:Bn,disableWarnings:Fn,sdp:Pi};switch(i.browser){case"chrome":if(!ii||!ti||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),s;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),s;n("adapter.js shimming chrome."),s.browserShim=ii,Li(e,i),Ai(e),Gn(e,i),Kn(e),ti(e,i),Jn(e),ei(e,i),Qn(e),Yn(e),Xn(e),ni(e,i),Ei(e),Oi(e),Ii(e),Di(e,i),ji(e),Mi(e,i);break;case"firefox":if(!fi||!ai||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),s;n("adapter.js shimming firefox."),s.browserShim=fi,Li(e,i),Ai(e),si(e,i),ai(e,i),ri(e),pi(e),oi(e),ci(e),di(e),li(e),ui(e),mi(e),hi(e),Ei(e),Ii(e),Di(e,i),ji(e);break;case"safari":if(!Ci||!t.shimSafari)return n("Safari shim is not included in this adapter release."),s;n("adapter.js shimming safari."),s.browserShim=Ci,Li(e,i),Ai(e),xi(e),Si(e),bi(e),gi(e),vi(e),wi(e),yi(e),ki(e),Ei(e),Oi(e),Di(e,i),ji(e),Mi(e,i);break;default:n("Unsupported browser!")}return s}({window:"undefined"==typeof window?void 0:window});var Fi,Ui,zi,qi,$i={},Vi={get exports(){return $i},set exports(e){$i=e}},Hi=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Gi=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=Hi.exec(e||""),r={},a=14;a--;)r[Wi[a]]=s[a]||"";return-1!=n&&-1!=i&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r},Ki={},Ji={},Qi={get exports(){return Ji},set exports(e){Ji=e}},Yi={},Xi={get exports(){return Yi},set exports(e){Yi=e}};function Zi(){if(Ui)return Fi;Ui=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Fi=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Fi}function es(){return zi||(zi=1,function(e,t){(t=Xi.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Zi(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,Yi)),Yi}var ts,ns={},is={get exports(){return ns},set exports(e){ns=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(qi||(qi=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=Qi.exports=es()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Ji)),Ji):s.exports=(ts||(ts=1,function(s,r){var a=e,o=t;(r=is.exports=es()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,ns)),ns)}({get exports(){return Ki},set exports(e){Ki=e}});var ss=Gi,rs=Ki("socket.io-client:url"),as=function(e,t){var n=e;t=t||Zt.location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(rs("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),rs("parse %s",e),n=ss(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n};var os={},cs={},ps={get exports(){return cs},set exports(e){cs=e}},ds={},ls={get exports(){return ds},set exports(e){ds=e}},us=1e3,ms=60*us,hs=60*ms,fs=24*hs,gs=365.25*fs,vs=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*gs;case"days":case"day":case"d":return n*fs;case"hours":case"hour":case"hrs":case"hr":case"h":return n*hs;case"minutes":case"minute":case"mins":case"min":case"m":return n*ms;case"seconds":case"second":case"secs":case"sec":case"s":return n*us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return bs(e,fs,"day")||bs(e,hs,"hour")||bs(e,ms,"minute")||bs(e,us,"second")||e+" ms"}(e):function(e){return e>=fs?Math.round(e/fs)+"d":e>=hs?Math.round(e/hs)+"h":e>=ms?Math.round(e/ms)+"m":e>=us?Math.round(e/us)+"s":e+"ms"}(e)};function bs(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){t=ls.exports=function(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());var o=Array.prototype.slice.call(arguments);o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var c=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;c++;var s=t.formatters[i];if("function"==typeof s){var r=o[c];n=s.call(e,r),o.splice(c,1),c--}return n})),"function"==typeof t.formatArgs&&(o=t.formatArgs.apply(e,o));var p=r.log||t.log||console.log.bind(console);p.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a},t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=vs,t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}}(0,ds),function(s,r){var a=e,o=t;(r=ps.exports=ds).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){var e=arguments,t=this.useColors,n=this.namespace;if(t){var i=this.color;e[0]=" [3"+i+";1m"+n+" "+e[0]+"[3"+i+"m +"+r.humanize(this.diff)+""}else e[0]=(new Date).toUTCString()+" "+n+" "+e[0];return e},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c);var d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,cs);var ys={};
15
+ `}},("string"==typeof Qt?Gt(Qt,Yt,""):Gt(Qt.name,Qt,"")).Class;var Zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var i=Function.bind.apply(t,n);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var nn,sn={},rn={};function an(){if(nn)return rn;nn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),l=Symbol.iterator;var u={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function f(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}function g(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||u}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=f.prototype;var b=v.prototype=new g;b.constructor=v,m(b,f.prototype),b.isPureReactComponent=!0;var y=Array.isArray,_=Object.prototype.hasOwnProperty,x={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function S(t,n,i){var s,r={},a=null,o=null;if(null!=n)for(s in void 0!==n.ref&&(o=n.ref),void 0!==n.key&&(a=""+n.key),n)_.call(n,s)&&!w.hasOwnProperty(s)&&(r[s]=n[s]);var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){for(var p=Array(c),d=0;d<c;d++)p[d]=arguments[d+2];r.children=p}if(t&&t.defaultProps)for(s in c=t.defaultProps)void 0===r[s]&&(r[s]=c[s]);return{$$typeof:e,type:t,key:a,ref:o,props:r,_owner:x.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function R(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(n,i,s,r,a){var o=typeof n;"undefined"!==o&&"boolean"!==o||(n=null);var c=!1;if(null===n)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(n.$$typeof){case e:case t:c=!0}}if(c)return a=a(c=n),n=""===r?"."+R(c,0):r,y(a)?(s="",null!=n&&(s=n.replace(C,"$&/")+"/"),T(a,i,s,"",(function(e){return e}))):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,s+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),i.push(a)),1;if(c=0,r=""===r?".":r+":",y(n))for(var p=0;p<n.length;p++){var d=r+R(o=n[p],p);c+=T(o,i,s,d,a)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=l&&e[l]||e["@@iterator"])?e:null}(n),"function"==typeof d)for(n=d.call(n),p=0;!(o=n.next()).done;)c+=T(o=o.value,i,s,d=r+R(o,p++),a);else if("object"===o)throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.");return c}function P(e,t,n){if(null==e)return e;var i=[],s=0;return T(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function E(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},D={transition:null},j={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:D,ReactCurrentOwner:x};return rn.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},rn.Component=f,rn.Fragment=n,rn.Profiler=s,rn.PureComponent=v,rn.StrictMode=i,rn.Suspense=c,rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,rn.cloneElement=function(t,n,i){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=m({},t.props),r=t.key,a=t.ref,o=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,o=x.current),void 0!==n.key&&(r=""+n.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(p in n)_.call(n,p)&&!w.hasOwnProperty(p)&&(s[p]=void 0===n[p]&&void 0!==c?c[p]:n[p])}var p=arguments.length-2;if(1===p)s.children=i;else if(1<p){c=Array(p);for(var d=0;d<p;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:e,type:t.type,key:r,ref:a,props:s,_owner:o}},rn.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:r,_context:e},e.Consumer=e},rn.createElement=S,rn.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},rn.createRef=function(){return{current:null}},rn.forwardRef=function(e){return{$$typeof:o,render:e}},rn.isValidElement=k,rn.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:E}},rn.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},rn.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},rn.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},rn.useCallback=function(e,t){return O.current.useCallback(e,t)},rn.useContext=function(e){return O.current.useContext(e)},rn.useDebugValue=function(){},rn.useDeferredValue=function(e){return O.current.useDeferredValue(e)},rn.useEffect=function(e,t){return O.current.useEffect(e,t)},rn.useId=function(){return O.current.useId()},rn.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},rn.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},rn.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},rn.useMemo=function(e,t){return O.current.useMemo(e,t)},rn.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},rn.useRef=function(e){return O.current.useRef(e)},rn.useState=function(e){return O.current.useState(e)},rn.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},rn.useTransition=function(){return O.current.useTransition()},rn.version="18.2.0",rn}var on,cn,pn={},dn={get exports(){return pn},set exports(e){pn=e}};function ln(){return on||(on=1,e=dn,t=pn,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),f=Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var t=f&&e[f]||e["@@iterator"];return"function"==typeof t?t:null}var v={current:null},b={transition:null},y={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},_={current:null},x={},w=null;function S(e){w=e}x.setExtraStackFrame=function(e){w=e},x.getCurrentStack=null,x.getStackAddendum=function(){var e="";w&&(e+=w);var t=x.getCurrentStack;return t&&(e+=t()||""),e};var k={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:b,ReactCurrentOwner:_};function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("warn",e,n)}function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];T("error",e,n)}function T(e,t,n){var i=k.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var s=n.map((function(e){return String(e)}));s.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,s)}k.ReactDebugCurrentFrame=x,k.ReactCurrentActQueue=y;var P={};function E(e,t){var n=e.constructor,i=n&&(n.displayName||n.name)||"ReactClass",s=i+"."+t;P[s]||(R("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,i),P[s]=!0)}var O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){E(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,i){E(e,"replaceState")},enqueueSetState:function(e,t,n,i){E(e,"setState")}},D=Object.assign,j={};function I(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}Object.freeze(j),I.prototype.isReactComponent={},I.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},I.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var M={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},L=function(e,t){Object.defineProperty(I.prototype,e,{get:function(){C("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var A in M)M.hasOwnProperty(A)&&L(A,M[A]);function N(){}function B(e,t,n){this.props=e,this.context=t,this.refs=j,this.updater=n||O}N.prototype=I.prototype;var F=B.prototype=new N;F.constructor=B,D(F,I.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function z(e){return U(e)}function q(e){return""+e}function $(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}function V(e){return e.displayName||"Context"}function H(e){if(null==e)return null;if("number"==typeof e.tag&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case i:return"Portal";case a:return"Profiler";case r:return"StrictMode";case d:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return V(e)+".Consumer";case o:return V(e._context)+".Provider";case p:return function(e,t,n){var i=e.displayName;if(i)return i;var s=t.displayName||t.name||"";return""!==s?n+"("+s+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:H(e.type)||"Memo";case m:var n=e,h=n._payload,f=n._init;try{return H(f(h))}catch(e){return null}}return null}var W,G,K,J=Object.prototype.hasOwnProperty,Q={key:!0,ref:!0,__self:!0,__source:!0};function Y(e){if(J.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function X(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function Z(e,t){var n=function(){W||(W=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function ee(e,t){var n=function(){G||(G=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}function te(e){if("string"==typeof e.ref&&_.current&&e.__self&&_.current.stateNode!==e.__self){var t=H(_.current.type);K[t]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),K[t]=!0)}}K={};var ne=function(e,t,i,s,r,a,o){var c={$$typeof:n,type:e,key:t,ref:i,props:o,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ie(e,t,n){var i,s={},r=null,a=null,o=null,c=null;if(null!=t)for(i in Y(t)&&(a=t.ref,te(t)),X(t)&&($(t.key),r=""+t.key),o=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(s[i]=t[i]);var p=arguments.length-2;if(1===p)s.children=n;else if(p>1){for(var d=Array(p),l=0;l<p;l++)d[l]=arguments[l+2];Object.freeze&&Object.freeze(d),s.children=d}if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===s[i]&&(s[i]=u[i])}if(r||a){var m="function"==typeof e?e.displayName||e.name||"Unknown":e;r&&Z(s,m),a&&ee(s,m)}return ne(e,r,a,o,c,_.current,s)}function se(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i,s,r=D({},e.props),a=e.key,o=e.ref,c=e._self,p=e._source,d=e._owner;if(null!=t)for(i in Y(t)&&(o=t.ref,d=_.current),X(t)&&($(t.key),a=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)J.call(t,i)&&!Q.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==s?r[i]=s[i]:r[i]=t[i]);var l=arguments.length-2;if(1===l)r.children=n;else if(l>1){for(var u=Array(l),m=0;m<l;m++)u[m]=arguments[m+2];r.children=u}return ne(e.type,a,o,c,p,d,r)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var ae,oe=!1,ce=/\/+/g;function pe(e){return e.replace(ce,"$&/")}function de(e,t){return"object"==typeof e&&null!==e&&null!=e.key?($(e.key),n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function le(e,t,s,r,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var c,p,d,l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l){var u=e,m=a(u),h=""===r?"."+de(u,0):r;if(z(m)){var f="";null!=h&&(f=pe(h)+"/"),le(m,t,f,"",(function(e){return e}))}else null!=m&&(re(m)&&(!m.key||u&&u.key===m.key||$(m.key),c=m,p=s+(!m.key||u&&u.key===m.key?"":pe(""+m.key)+"/")+h,m=ne(c.type,p,c.ref,c._self,c._source,c._owner,c.props)),t.push(m));return 1}var v=0,b=""===r?".":r+":";if(z(e))for(var y=0;y<e.length;y++)v+=le(d=e[y],t,s,b+de(d,y),a);else{var _=g(e);if("function"==typeof _){var x=e;_===x.entries&&(oe||C("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oe=!0);for(var w,S=_.call(x),k=0;!(w=S.next()).done;)v+=le(d=w.value,t,s,b+de(d,k++),a)}else if("object"===o){var R=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===R?"object with keys {"+Object.keys(e).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}}return v}function ue(e,t,n){if(null==e)return e;var i=[],s=0;return le(e,i,"","",(function(e){return t.call(n,e,s++)})),i}function me(e){if(-1===e._status){var t=(0,e._result)();if(t.then((function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}}),(function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}})),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var i=e._result;return void 0===i&&R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",i),"default"in i||R("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",i),i.default}throw e._result}function he(e){return"string"==typeof e||"function"==typeof e||e===s||e===a||e===r||e===d||e===l||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===o||e.$$typeof===c||e.$$typeof===p||e.$$typeof===ae||void 0!==e.getModuleId)}function fe(){var e=v.current;return null===e&&R("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}ae=Symbol.for("react.module.reference");var ge,ve,be,ye,_e,xe,we,Se=0;function ke(){}ke.__reactDisabledLog=!0;var Ce,Re=k.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===Ce)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);Ce=i&&i[1]||""}return"\n"+Ce+e}var Pe,Ee=!1,Oe="function"==typeof WeakMap?WeakMap:Map;function De(e,t){if(!e||Ee)return"";var n,i=Pe.get(e);if(void 0!==i)return i;Ee=!0;var s,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,s=Re.current,Re.current=null,function(){if(0===Se){ge=console.log,ve=console.info,be=console.warn,ye=console.error,_e=console.group,xe=console.groupCollapsed,we=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Se++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),c=n.stack.split("\n"),p=o.length-1,d=c.length-1;p>=1&&d>=0&&o[p]!==c[d];)d--;for(;p>=1&&d>=0;p--,d--)if(o[p]!==c[d]){if(1!==p||1!==d)do{if(p--,--d<0||o[p]!==c[d]){var l="\n"+o[p].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&Pe.set(e,l),l}}while(p>=1&&d>=0);break}}}finally{Ee=!1,Re.current=s,function(){if(0==--Se){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ge}),info:D({},e,{value:ve}),warn:D({},e,{value:be}),error:D({},e,{value:ye}),group:D({},e,{value:_e}),groupCollapsed:D({},e,{value:xe}),groupEnd:D({},e,{value:we})})}Se<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var u=e?e.displayName||e.name:"",m=u?Te(u):"";return"function"==typeof e&&Pe.set(e,m),m}function je(e,t,n){if(null==e)return"";if("function"==typeof e)return De(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Te(e);switch(e){case d:return Te("Suspense");case l:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case p:return De(e.render,!1);case u:return je(e.type,t,n);case m:var i=e,s=i._payload,r=i._init;try{return je(r(s),t,n)}catch(e){}}return""}Pe=new Oe;var Ie,Me={},Le=k.ReactDebugCurrentFrame;function Ae(e){if(e){var t=e._owner,n=je(e.type,e._source,t?t.type:null);Le.setExtraStackFrame(n)}else Le.setExtraStackFrame(null)}function Ne(e){if(e){var t=e._owner;S(je(e.type,e._source,t?t.type:null))}else S(null)}function Be(){if(_.current){var e=H(_.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Fe(e){return null!=e&&void 0!==(t=e.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"";var t}Ie=!1;var Ue={};function ze(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Be();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!Ue[n]){Ue[n]=!0;var i="";e&&e._owner&&e._owner!==_.current&&(i=" It was passed a child from "+H(e._owner.type)+"."),Ne(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),Ne(null)}}}function qe(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var i=e[n];re(i)&&ze(i,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var s=g(e);if("function"==typeof s&&s!==e.entries)for(var r,a=s.call(e);!(r=a.next()).done;)re(r.value)&&ze(r.value,t)}}function $e(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==p&&n.$$typeof!==u)return;t=n.propTypes}if(t){var i=H(n);!function(e,t,n,i,s){var r=Function.call.bind(J);for(var a in e)if(r(e,a)){var o=void 0;try{if("function"!=typeof e[a]){var c=Error((i||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}o=e[a](t,a,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){o=e}!o||o instanceof Error||(Ae(s),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,a,typeof o),Ae(null)),o instanceof Error&&!(o.message in Me)&&(Me[o.message]=!0,Ae(s),R("Failed %s type: %s",n,o.message),Ae(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||Ie||(Ie=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",H(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ve(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){Ne(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),Ne(null);break}}null!==e.ref&&(Ne(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),Ne(null))}function He(e,t,i){var r=he(e);if(!r){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var o,c=Fe(t);a+=c||Be(),null===e?o="null":z(e)?o="array":void 0!==e&&e.$$typeof===n?(o="<"+(H(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):o=typeof e,R("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",o,a)}var p=ie.apply(this,arguments);if(null==p)return p;if(r)for(var d=2;d<arguments.length;d++)qe(arguments[d],e);return e===s?Ve(p):$e(p),p}var We=!1,Ge=!1,Ke=null,Je=0,Qe=!1;function Ye(e){e!==Je-1&&R("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Je=e}function Xe(t,n,i){var s=y.current;if(null!==s)try{et(s),function(t){if(null===Ke)try{var n=("require"+Math.random()).slice(0,7),i=e&&e[n];Ke=i.call(e,"timers").setImmediate}catch(e){Ke=function(e){!1===Ge&&(Ge=!0,"undefined"==typeof MessageChannel&&R("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ke(t)}((function(){0===s.length?(y.current=null,n(t)):Xe(t,n,i)}))}catch(e){i(e)}else n(t)}var Ze=!1;function et(e){if(!Ze){Ze=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(n){throw e=e.slice(t+1),n}finally{Ze=!1}}}var tt=He,nt=function(e,t,n){for(var i=se.apply(this,arguments),s=2;s<arguments.length;s++)qe(arguments[s],i.type);return $e(i),i},it=function(e){var t=He.bind(null,e);return t.type=e,We||(We=!0,C("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return C("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},st={map:ue,forEach:function(e,t,n){ue(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return ue(e,(function(){t++})),t},toArray:function(e){return ue(e,(function(e){return e}))||[]},only:function(e){if(!re(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=st,t.Component=I,t.Fragment=s,t.Profiler=a,t.PureComponent=B,t.StrictMode=r,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k,t.cloneElement=nt,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:o,_context:t};var n=!1,i=!1,s=!1,r={$$typeof:c,_context:t};return Object.defineProperties(r,{Provider:{get:function(){return i||(i=!0,R("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,R("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){s||(C("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),s=!0)}}}),t.Consumer=r,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=tt,t.createFactory=it,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===u?R("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?R("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&R("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||R("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:p,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=re,t.lazy=function(e){var t,n,i={$$typeof:m,_payload:{_status:-1,_result:e},_init:me};return Object.defineProperties(i,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){R("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(i,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){R("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(i,"propTypes",{enumerable:!0})}}}),i},t.memo=function(e,t){he(e)||R("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,i={$$typeof:u,type:e,compare:void 0===t?null:t};return Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),i},t.startTransition=function(e,t){var n=b.transition;b.transition={};var i=b.transition;b.transition._updatedFibers=new Set;try{e()}finally{b.transition=n,null===n&&i._updatedFibers&&(i._updatedFibers.size>10&&C("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),i._updatedFibers.clear())}},t.unstable_act=function(e){var t=Je;Je++,null===y.current&&(y.current=[]);var n,i=y.isBatchingLegacy;try{if(y.isBatchingLegacy=!0,n=e(),!i&&y.didScheduleLegacyUpdate){var s=y.current;null!==s&&(y.didScheduleLegacyUpdate=!1,et(s))}}catch(e){throw Ye(t),e}finally{y.isBatchingLegacy=i}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var r=n,a=!1,o={then:function(e,n){a=!0,r.then((function(i){Ye(t),0===Je?Xe(i,e,n):e(i)}),(function(e){Ye(t),n(e)}))}};return Qe||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){a||(Qe=!0,R("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),o}var c=n;if(Ye(t),0===Je){var p=y.current;return null!==p&&(et(p),y.current=null),{then:function(e,t){null===y.current?(y.current=[],Xe(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return fe().useCallback(e,t)},t.useContext=function(e){var t=fe();if(void 0!==e._context){var n=e._context;n.Consumer===e?R("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&R("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return fe().useDebugValue(e,t)},t.useDeferredValue=function(e){return fe().useDeferredValue(e)},t.useEffect=function(e,t){return fe().useEffect(e,t)},t.useId=function(){return fe().useId()},t.useImperativeHandle=function(e,t,n){return fe().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return fe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return fe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return fe().useMemo(e,t)},t.useReducer=function(e,t,n){return fe().useReducer(e,t,n)},t.useRef=function(e){return fe().useRef(e)},t.useState=function(e){return fe().useState(e)},t.useSyncExternalStore=function(e,t,n){return fe().useSyncExternalStore(e,t,n)},t.useTransition=function(){return fe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pn;var e,t}cn={get exports(){return sn},set exports(e){sn=e}},"production"===process.env.NODE_ENV?cn.exports=an():cn.exports=ln();var un=en(sn),mn=e=>{var{muted:t,stream:n}=e,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["muted","stream"]);const s=sn.useRef(null);return sn.useEffect((()=>{s.current&&(s.current.srcObject!==n&&(s.current.srcObject=n),s.current.muted!==t&&(s.current.muted=Boolean(t)))}),[t,n,s]),un.createElement("video",Object.assign({ref:s,autoPlay:!0,playsInline:!0},i))};const hn="client_connection_status_changed",fn="stream_added",gn="rtc_manager_created",vn="rtc_manager_destroyed",bn="local_stream_track_added",yn="local_stream_track_removed",_n="connecting",xn="connection_failed",wn="connection_successful",Sn="connection_disconnected",kn="fetch_mediaserver_config",Cn="start_screenshare",Rn="stop_screenshare",Tn="mediaserver_config",Pn="room_joined",En="ice_candidate",On="ice_endofcandidates",Dn="ready_to_receive_offer",jn="sdp_answer",In="sdp_offer";let Mn=!0,Ln=!0;function An(e,t,n){const i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function Nn(e,t,n){if(!e.RTCPeerConnection)return;const i=e.RTCPeerConnection.prototype,s=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return s.apply(this,arguments);const r=e=>{const t=n(e);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(i,r),s.apply(this,[e,r])};const r=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return r.apply(this,arguments);if(!this._eventMap[t].has(n))return r.apply(this,arguments);const i=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function Bn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Mn=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function Fn(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(Ln=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function Un(){if("object"==typeof window){if(Mn)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function zn(e,t){Ln&&console.warn(e+" is deprecated, please use "+t+" instead.")}function qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function $n(e){return qn(e)?Object.keys(e).reduce((function(t,n){const i=qn(e[n]),s=i?$n(e[n]):e[n],r=i&&!Object.keys(s).length;return void 0===s||r?t:Object.assign(t,{[n]:s})}),{}):e}function Vn(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?Vn(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((t=>{Vn(e,e.get(t),n)}))})))}function Hn(e,t,n){const i=n?"outbound-rtp":"inbound-rtp",s=new Map;if(null===t)return s;const r=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&r.push(e)})),r.forEach((t=>{e.forEach((n=>{n.type===i&&n.trackId===t.id&&Vn(e,n,s)}))})),s}const Wn=Un;function Gn(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const i="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const s=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let e={};"number"==typeof i.ideal?(e[s("min",n)]=i.ideal,t.optional.push(e),e={},e[s("max",n)]=i.ideal,t.optional.push(e)):(e[s("",n)]=i.ideal,t.optional.push(e))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[s("",n)]=i.exact):["min","max"].forEach((e=>{void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[s(e,n)]=i[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,s){if(t.version>=61)return s(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"==typeof e.video){let r=e.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const a=t.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===r.exact||"environment"===r.ideal?t=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{n=n.filter((e=>"videoinput"===e.kind));let a=n.find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=r.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=i(e.video),Wn("chrome: "+JSON.stringify(e)),s(e)}))}e.video=i(e.video)}return Wn("chrome: "+JSON.stringify(e)),s(e)},r=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,i){s(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{i&&i(r(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return s(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(r(e))))))}}}function Kn(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Jn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const s=new Event("track");s.track=n.track,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)})),t.stream.getTracks().forEach((n=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const s=new Event("track");s.track=n,s.receiver=i,s.transceiver={receiver:i},s.streams=[t.stream],this.dispatchEvent(s)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Nn(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function Qn(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){let s=n.apply(this,arguments);return s||(s=t(this,e),this._senders.push(s)),s};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yn(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,i]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const s=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},r=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const i=function(e){n(r(s(e)))};return t.apply(this,[i,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(r(s(t)))},n])})).then(n,i)}}function Xn(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>Hn(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,i;return this.getSenders().forEach((n=>{n.track===e&&(t?i=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?i=!0:n=t),t.track===e))),i||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Zn(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const i=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(i)};const i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};const s=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),s.apply(this,arguments)}}function ei(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Zn(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}i.apply(this,[t])};const s=e.RTCPeerConnection.prototype.removeStream;function r(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(s.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const i=e._reverseStreams[t],s=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),s.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const s=this.getSenders().find((e=>e.track===t));if(s)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const r=this._streams[n.id];if(r)r.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new e.MediaStream([t]);this._streams[n.id]=i,this._reverseStreams[i.id]=n,this.addStream(i)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=r(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>r(this,e)))}};e.RTCPeerConnection.prototype[t]=i[t]}));const o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=a(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:r(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ti(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}))}function ni(e,t){Nn(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var ii=Object.freeze({__proto__:null,shimMediaStream:Kn,shimOnTrack:Jn,shimGetSendersWithDtmf:Qn,shimGetStats:Yn,shimSenderReceiverGetStats:Xn,shimAddTrackRemoveTrackWithNative:Zn,shimAddTrackRemoveTrack:ei,shimPeerConnection:ti,fixNegotiationNeeded:ni,shimGetUserMedia:Gn,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const i=n.video&&n.video.width,s=n.video&&n.video.height,r=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:r||3}},i&&(n.video.mandatory.maxWidth=i),s&&(n.video.mandatory.maxHeight=s),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function si(e,t){const n=e&&e.navigator,i=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){zn("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function ri(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ai(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=i[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,s,r]=arguments;return i.apply(this,[e||null]).then((e=>{if(t.version<53&&!s)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,i)=>{e.set(i,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(s,r)}}function oi(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ci(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),Nn(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function pi(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){zn("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function di(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function li(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(n){const{sender:t}=i,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function ui(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function mi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function hi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var fi=Object.freeze({__proto__:null,shimOnTrack:ri,shimPeerConnection:ai,shimSenderGetStats:oi,shimReceiverGetStats:ci,shimRemoveStream:pi,shimRTCDataChannel:di,shimAddTransceiver:li,shimGetParameters:ui,shimCreateOffer:mi,shimCreateAnswer:hi,shimGetUserMedia:si,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function gi(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function vi(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function bi(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,s=t.setLocalDescription,r=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const i=arguments.length>=2?arguments[2]:arguments[0],s=n.apply(this,[i]);return t?(s.then(e,t),Promise.resolve()):s},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],s=i.apply(this,[n]);return t?(s.then(e,t),Promise.resolve()):s};let o=function(e,t,n){const i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=o,o=function(e,t,n){const i=r.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=o,o=function(e,t,n){const i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=o}function yi(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(_i(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))}function _i(e){return e&&void 0!==e.video?Object.assign({},e,{video:$n(e.video)}):e}function xi(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let i=e.iceServers[n];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(zn("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function wi(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Si(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ki(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Ci=Object.freeze({__proto__:null,shimLocalStreamsAPI:gi,shimRemoteStreamsAPI:vi,shimCallbacksAPI:bi,shimGetUserMedia:yi,shimConstraints:_i,shimRTCIceServerUrls:xi,shimTrackEventTransceiver:wi,shimCreateOfferLegacy:Si,shimAudioContext:ki}),Ri={};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const i=e.type;return t.push("typ"),t.push(i),"host"!==i&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const i=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<i.length;e++)n=i[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const i=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substring(t+1,i),n.value=e.substring(i+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const i=t.matchPrefix(e+n,"a=ice-ufrag:")[0],s=t.matchPrefix(e+n,"a=ice-pwd:")[0];return i&&s?{usernameFragment:i.substring(12),password:s.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(e)[0].split(" ");for(let s=3;s<i.length;s++){const r=i[s],a=t.matchPrefix(e,"a=rtpmap:"+r+" ")[0];if(a){const i=t.parseRtpMap(a),s=t.matchPrefix(e,"a=fmtp:"+r+" ");switch(i.parameters=s.length?t.parseFmtp(s[0]):{},i.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+r+" ").map(t.parseRtcpFb),n.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))}));const s=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{s.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let i="";i+="m="+e+" ",i+=n.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{i+=t.writeRtpMap(e),i+=t.writeFmtp(e),i+=t.writeRtcpFb(e)}));let s=0;return n.codecs.forEach((e=>{e.maxptime>s&&(s=e.maxptime)})),s>0&&(i+="a=maxptime:"+s+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{i+=t.writeExtmap(e)})),i},t.parseRtpEncodingParameters=function(e){const n=[],i=t.parseRtpParameters(e),s=-1!==i.fecMechanisms.indexOf("RED"),r=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let c;const p=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));p.length>0&&p[0].length>1&&p[0][0]===o&&(c=p[0][1]),i.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&c&&(t.rtx={ssrc:c}),n.push(t),s&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&o&&n.push({ssrc:o});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){const n={},i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const s=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=0===s.length;const r=t.matchPrefix(e,"a=rtcp-mux");return n.mux=r.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const i=t.matchPrefix(e,"a=msid:");if(1===i.length)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return s.length>0?(n=s[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),i=t.matchPrefix(e,"a=max-message-size:");let s;i.length>0&&(s=parseInt(i[0].substring(19),10)),isNaN(s)&&(s=65536);const r=t.matchPrefix(e,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:n.fmt,maxMessageSize:s};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:s}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,i){let s;const r=void 0!==n?n:2;s=e||t.generateSessionId();return"v=0\r\no="+(i||"thisisadapterortc")+" "+s+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const i=t.splitLines(e);for(let e=0;e<i.length;e++)switch(i[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[e].substring(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t}({get exports(){return Ri},set exports(e){Ri=e}});var Ti=Ri,Pi=g({__proto__:null,default:Ti},[Ri]);function Ei(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),i=Ti.parseCandidate(e.candidate),s=Object.assign(n,i);return s.toJSON=function(){return{candidate:s.candidate,sdpMid:s.sdpMid,sdpMLineIndex:s.sdpMLineIndex,usernameFragment:s.usernameFragment}},s}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Nn(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Oi(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||Nn(e,"icecandidate",(e=>{if(e.candidate){const t=Ti.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Di(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=Ti.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Ti.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},r=function(e,n){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const s=Ti.matchPrefix(e.sdp,"a=max-message-size:");return s.length>0?i=parseInt(s[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},a=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=i(arguments[0]),t=s(e),n=r(arguments[0],e);let a;a=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const o={};Object.defineProperty(o,"maxMessageSize",{get:()=>a}),this._sctp=o}return a.apply(this,arguments)}}function ji(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const i=arguments[0],s=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&s>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},Nn(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function Ii(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function Mi(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function Li(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ai(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})}var Ni=Object.freeze({__proto__:null,shimRTCIceCandidate:Ei,shimRTCIceCandidateRelayProtocol:Oi,shimMaxMessageSize:Di,shimSendThrowTypeError:ji,shimConnectionState:Ii,removeExtmapAllowMixed:Mi,shimAddIceCandidateNullOrEmpty:Li,shimParameterlessSetLocalDescription:Ai});const Bi=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Un,i=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=An(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=An(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=An(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),s={browserDetails:i,commonShim:Ni,extractVersion:An,disableLog:Bn,disableWarnings:Fn,sdp:Pi};switch(i.browser){case"chrome":if(!ii||!ti||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),s;if(null===i.version)return n("Chrome shim can not determine version, not shimming."),s;n("adapter.js shimming chrome."),s.browserShim=ii,Li(e,i),Ai(e),Gn(e,i),Kn(e),ti(e,i),Jn(e),ei(e,i),Qn(e),Yn(e),Xn(e),ni(e,i),Ei(e),Oi(e),Ii(e),Di(e,i),ji(e),Mi(e,i);break;case"firefox":if(!fi||!ai||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),s;n("adapter.js shimming firefox."),s.browserShim=fi,Li(e,i),Ai(e),si(e,i),ai(e,i),ri(e),pi(e),oi(e),ci(e),di(e),li(e),ui(e),mi(e),hi(e),Ei(e),Ii(e),Di(e,i),ji(e);break;case"safari":if(!Ci||!t.shimSafari)return n("Safari shim is not included in this adapter release."),s;n("adapter.js shimming safari."),s.browserShim=Ci,Li(e,i),Ai(e),xi(e),Si(e),bi(e),gi(e),vi(e),wi(e),yi(e),ki(e),Ei(e),Oi(e),Di(e,i),ji(e),Mi(e,i);break;default:n("Unsupported browser!")}return s}({window:"undefined"==typeof window?void 0:window});var Fi,Ui,zi,qi,$i={},Vi={get exports(){return $i},set exports(e){$i=e}},Hi=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Gi=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=Hi.exec(e||""),r={},a=14;a--;)r[Wi[a]]=s[a]||"";return-1!=n&&-1!=i&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r},Ki={},Ji={},Qi={get exports(){return Ji},set exports(e){Ji=e}},Yi={},Xi={get exports(){return Yi},set exports(e){Yi=e}};function Zi(){if(Ui)return Fi;Ui=1;var e=1e3,t=60*e,n=60*t,i=24*n,s=365.25*i;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Fi=function(a,o){o=o||{};var c=typeof a;if("string"===c&&a.length>0)return function(r){if((r=String(r)).length>1e4)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(!a)return;var o=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(a);if("number"===c&&!1===isNaN(a))return o.long?function(s){return r(s,i,"day")||r(s,n,"hour")||r(s,t,"minute")||r(s,e,"second")||s+" ms"}(a):function(s){if(s>=i)return Math.round(s/i)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Fi}function es(){return zi||(zi=1,function(e,t){(t=Xi.exports=r.debug=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Zi(),t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}function r(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());for(var o=new Array(arguments.length),c=0;c<o.length;c++)o[c]=arguments[c];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var p=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;p++;var s=t.formatters[i];if("function"==typeof s){var r=o[p];n=s.call(e,r),o.splice(p,1),p--}return n})),o=t.formatArgs.apply(e,o);var d=r.log||t.log||console.log.bind(console);d.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a}}(0,Yi)),Yi}var ts,ns={},is={get exports(){return ns},set exports(e){ns=e}};!function(s){"undefined"!=typeof process&&"renderer"===process.type?s.exports=(qi||(qi=1,function(e,t){function n(){try{return t.storage.debug}catch(e){}if("undefined"!=typeof process&&"env"in process)return process.env.DEBUG}(t=Qi.exports=es()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var s=0,r=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(s++,"%c"===e&&(r=s))})),e.splice(r,0,i),e},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Ji)),Ji):s.exports=(ts||(ts=1,function(s,r){var a=e,o=t;(r=is.exports=es()).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){for(var e=arguments.length,t=new Array(e),n=this.useColors,i=this.namespace,s=0;s<e;s++)t[s]=arguments[s];if(n){var a=this.color;t[0]=" [3"+a+";1m"+i+" "+t[0],t.push("[3"+a+"m+"+r.humanize(this.diff)+"")}else t[0]=(new Date).toUTCString()+" "+i+" "+t[0];return t},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c),d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=r.formatters.O=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,ns)),ns)}({get exports(){return Ki},set exports(e){Ki=e}});var ss=Gi,rs=Ki("socket.io-client:url"),as=function(e,t){var n=e;t=t||Zt.location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(rs("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),rs("parse %s",e),n=ss(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n};var os={},cs={},ps={get exports(){return cs},set exports(e){cs=e}},ds={},ls={get exports(){return ds},set exports(e){ds=e}},us=1e3,ms=60*us,hs=60*ms,fs=24*hs,gs=365.25*fs,vs=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*gs;case"days":case"day":case"d":return n*fs;case"hours":case"hour":case"hrs":case"hr":case"h":return n*hs;case"minutes":case"minute":case"mins":case"min":case"m":return n*ms;case"seconds":case"second":case"secs":case"sec":case"s":return n*us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return bs(e,fs,"day")||bs(e,hs,"hour")||bs(e,ms,"minute")||bs(e,us,"second")||e+" ms"}(e):function(e){return e>=fs?Math.round(e/fs)+"d":e>=hs?Math.round(e/hs)+"h":e>=ms?Math.round(e/ms)+"m":e>=us?Math.round(e/us)+"s":e+"ms"}(e)};function bs(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){t=ls.exports=function(e){function i(){}function r(){var e=r,i=+new Date,a=i-(n||i);e.diff=a,e.prev=n,e.curr=i,n=i,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=s());var o=Array.prototype.slice.call(arguments);o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&(o=["%o"].concat(o));var c=0;o[0]=o[0].replace(/%([a-z%])/g,(function(n,i){if("%%"===n)return n;c++;var s=t.formatters[i];if("function"==typeof s){var r=o[c];n=s.call(e,r),o.splice(c,1),c--}return n})),"function"==typeof t.formatArgs&&(o=t.formatArgs.apply(e,o));var p=r.log||t.log||console.log.bind(console);p.apply(e,o)}i.enabled=!1,r.enabled=!0;var a=t.enabled(e)?r:i;return a.namespace=e,a},t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var n=(e||"").split(/[\s,]+/),i=n.length,s=0;s<i;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=vs,t.names=[],t.skips=[],t.formatters={};var n,i=0;function s(){return t.colors[i++%t.colors.length]}}(0,ds),function(s,r){var a=e,o=t;(r=ps.exports=ds).log=function(){return p.write(o.format.apply(this,arguments)+"\n")},r.formatArgs=function(){var e=arguments,t=this.useColors,n=this.namespace;if(t){var i=this.color;e[0]=" [3"+i+";1m"+n+" "+e[0]+"[3"+i+"m +"+r.humanize(this.diff)+""}else e[0]=(new Date).toUTCString()+" "+n+" "+e[0];return e},r.save=function(e){null==e?delete process.env.DEBUG:process.env.DEBUG=e},r.load=l,r.useColors=function(){var e=(process.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?a.isatty(c):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e},r.colors=[6,2,3,4,5,1];var c=parseInt(process.env.DEBUG_FD,10)||2,p=1===c?process.stdout:2===c?process.stderr:function(e){var t;switch(process.binding("tty_wrap").guessHandleType(e)){case"TTY":(t=new a.WriteStream(e))._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":(t=new n.SyncWriteStream(e,{autoClose:!1}))._type="fs";break;case"PIPE":case"TCP":(t=new i.Socket({fd:e,readable:!1,writable:!0})).readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}(c);var d=4===o.inspect.length?function(e,t){return o.inspect(e,void 0,void 0,t)}:function(e,t){return o.inspect(e,{colors:t})};function l(){return process.env.DEBUG}r.formatters.o=function(e){return d(e,this.useColors).replace(/\s*\n\s*/g," ")},r.enable(l())}(0,cs);var ys={};
16
16
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
17
17
  !function(e,t){(function(){var n={function:!0,object:!0},i=t&&!t.nodeType&&t,s=n[typeof window]&&window||this,r=i&&n.object&&e&&!e.nodeType&&"object"==typeof Zt&&Zt;function a(e,t){e||(e=s.Object()),t||(t=s.Object());var i=e.Number||s.Number,r=e.String||s.String,o=e.Object||s.Object,c=e.Date||s.Date,p=e.SyntaxError||s.SyntaxError,d=e.TypeError||s.TypeError,l=e.Math||s.Math,u=e.JSON||s.JSON;"object"==typeof u&&u&&(t.stringify=u.stringify,t.parse=u.parse);var m,h,f,g=o.prototype,v=g.toString,b=new c(-0xc782b5b800cec);try{b=-109252==b.getUTCFullYear()&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(e){}function y(e){if(y[e]!==f)return y[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=y("json-stringify")&&y("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var o=t.stringify,p="function"==typeof o&&b;if(p){(s=function(){return 1}).toJSON=s;try{p="0"===o(0)&&"0"===o(new i)&&'""'==o(new r)&&o(v)===f&&o(f)===f&&o()===f&&"1"===o(s)&&"[1]"==o([s])&&"[null]"==o([f])&&"null"==o(null)&&"[null,null,null]"==o([f,v,null])&&o({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===o(null,s)&&"[\n 1,\n 2\n]"==o([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==o(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==o(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==o(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==o(new c(-1))}catch(e){p=!1}}n=p}if("json-parse"==e){var d=t.parse;if("function"==typeof d)try{if(0===d("0")&&!d(!1)){var l=5==(s=d(a)).a.length&&1===s.a[0];if(l){try{l=!d('"\t"')}catch(e){}if(l)try{l=1!==d("01")}catch(e){}if(l)try{l=1!==d("1.")}catch(e){}}}}catch(e){l=!1}n=l}}return y[e]=!!n}if(!y("json")){var _="[object Function]",x="[object Number]",w="[object String]",S="[object Array]",k=y("bug-string-char-index");if(!b)var C=l.floor,R=[0,31,59,90,120,151,181,212,243,273,304,334],T=function(e,t){return R[t]+365*(e-1970)+C((e-1969+(t=+(t>1)))/4)-C((e-1901+t)/100)+C((e-1601+t)/400)};if((m=g.hasOwnProperty)||(m=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=v?m=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,m=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,m.call(this,e)}),h=function(e,t){var i,s,r,a=0;for(r in(i=function(){this.valueOf=0}).prototype.valueOf=0,s=new i)m.call(s,r)&&a++;return i=s=null,a?h=2==a?function(e,t){var n,i={},s=v.call(e)==_;for(n in e)s&&"prototype"==n||m.call(i,n)||!(i[n]=1)||!m.call(e,n)||t(n)}:function(e,t){var n,i,s=v.call(e)==_;for(n in e)s&&"prototype"==n||!m.call(e,n)||(i="constructor"===n)||t(n);(i||m.call(e,n="constructor"))&&t(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],h=function(e,t){var i,r,a=v.call(e)==_,o=!a&&"function"!=typeof e.constructor&&n[typeof e.hasOwnProperty]&&e.hasOwnProperty||m;for(i in e)a&&"prototype"==i||!o.call(e,i)||t(i);for(r=s.length;i=s[--r];o.call(e,i)&&t(i));}),h(e,t)},!y("json-stringify")){var P={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E=function(e,t){return("000000"+(t||0)).slice(-e)},O=function(e){for(var t='"',n=0,i=e.length,s=!k||i>10,r=s&&(k?e.split(""):e);n<i;n++){var a=e.charCodeAt(n);switch(a){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=P[a];break;default:if(a<32){t+="\\u00"+E(2,a.toString(16));break}t+=s?r[n]:e.charAt(n)}}return t+'"'},D=function(e,t,n,i,s,r,a){var o,c,p,l,u,g,b,y,_,k,R,P,j,I,M,L;try{o=t[e]}catch(e){}if("object"==typeof o&&o)if("[object Date]"!=(c=v.call(o))||m.call(o,"toJSON"))"function"==typeof o.toJSON&&(c!=x&&c!=w&&c!=S||m.call(o,"toJSON"))&&(o=o.toJSON(e));else if(o>-1/0&&o<1/0){if(T){for(u=C(o/864e5),p=C(u/365.2425)+1970-1;T(p+1,0)<=u;p++);for(l=C((u-T(p,0))/30.42);T(p,l+1)<=u;l++);u=1+u-T(p,l),b=C((g=(o%864e5+864e5)%864e5)/36e5)%24,y=C(g/6e4)%60,_=C(g/1e3)%60,k=g%1e3}else p=o.getUTCFullYear(),l=o.getUTCMonth(),u=o.getUTCDate(),b=o.getUTCHours(),y=o.getUTCMinutes(),_=o.getUTCSeconds(),k=o.getUTCMilliseconds();o=(p<=0||p>=1e4?(p<0?"-":"+")+E(6,p<0?-p:p):E(4,p))+"-"+E(2,l+1)+"-"+E(2,u)+"T"+E(2,b)+":"+E(2,y)+":"+E(2,_)+"."+E(3,k)+"Z"}else o=null;if(n&&(o=n.call(t,e,o)),null===o)return"null";if("[object Boolean]"==(c=v.call(o)))return""+o;if(c==x)return o>-1/0&&o<1/0?""+o:"null";if(c==w)return O(""+o);if("object"==typeof o){for(I=a.length;I--;)if(a[I]===o)throw d();if(a.push(o),R=[],M=r,r+=s,c==S){for(j=0,I=o.length;j<I;j++)P=D(j,o,n,i,s,r,a),R.push(P===f?"null":P);L=R.length?s?"[\n"+r+R.join(",\n"+r)+"\n"+M+"]":"["+R.join(",")+"]":"[]"}else h(i||o,(function(e){var t=D(e,o,n,i,s,r,a);t!==f&&R.push(O(e)+":"+(s?" ":"")+t)})),L=R.length?s?"{\n"+r+R.join(",\n"+r)+"\n"+M+"}":"{"+R.join(",")+"}":"{}";return a.pop(),L}};t.stringify=function(e,t,i){var s,r,a,o;if(n[typeof t]&&t)if((o=v.call(t))==_)r=t;else if(o==S){a={};for(var c,p=0,d=t.length;p<d;c=t[p++],((o=v.call(c))==w||o==x)&&(a[c]=1));}if(i)if((o=v.call(i))==x){if((i-=i%1)>0)for(s="",i>10&&(i=10);s.length<i;s+=" ");}else o==w&&(s=i.length<=10?i:i.slice(0,10));return D("",((c={})[""]=e,c),r,a,s,"",[])}}if(!y("json-parse")){var j,I,M=r.fromCharCode,L={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},A=function(){throw j=I=null,p()},N=function(){for(var e,t,n,i,s,r=I,a=r.length;j<a;)switch(s=r.charCodeAt(j)){case 9:case 10:case 13:case 32:j++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=k?r.charAt(j):r[j],j++,e;case 34:for(e="@",j++;j<a;)if((s=r.charCodeAt(j))<32)A();else if(92==s)switch(s=r.charCodeAt(++j)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=L[s],j++;break;case 117:for(t=++j,n=j+4;j<n;j++)(s=r.charCodeAt(j))>=48&&s<=57||s>=97&&s<=102||s>=65&&s<=70||A();e+=M("0x"+r.slice(t,j));break;default:A()}else{if(34==s)break;for(s=r.charCodeAt(j),t=j;s>=32&&92!=s&&34!=s;)s=r.charCodeAt(++j);e+=r.slice(t,j)}if(34==r.charCodeAt(j))return j++,e;A();default:if(t=j,45==s&&(i=!0,s=r.charCodeAt(++j)),s>=48&&s<=57){for(48==s&&((s=r.charCodeAt(j+1))>=48&&s<=57)&&A(),i=!1;j<a&&((s=r.charCodeAt(j))>=48&&s<=57);j++);if(46==r.charCodeAt(j)){for(n=++j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}if(101==(s=r.charCodeAt(j))||69==s){for(43!=(s=r.charCodeAt(++j))&&45!=s||j++,n=j;n<a&&((s=r.charCodeAt(n))>=48&&s<=57);n++);n==j&&A(),j=n}return+r.slice(t,j)}if(i&&A(),"true"==r.slice(j,j+4))return j+=4,!0;if("false"==r.slice(j,j+5))return j+=5,!1;if("null"==r.slice(j,j+4))return j+=4,null;A()}return"$"},B=function(e){var t,n;if("$"==e&&A(),"string"==typeof e){if("@"==(k?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=N());n||(n=!0))n&&(","==e?"]"==(e=N())&&A():A()),","==e&&A(),t.push(B(e));return t}if("{"==e){for(t={};"}"!=(e=N());n||(n=!0))n&&(","==e?"}"==(e=N())&&A():A()),","!=e&&"string"==typeof e&&"@"==(k?e.charAt(0):e[0])&&":"==N()||A(),t[e.slice(1)]=B(N());return t}A()}return e},F=function(e,t,n){var i=U(e,t,n);i===f?delete e[t]:e[t]=i},U=function(e,t,n){var i,s=e[t];if("object"==typeof s&&s)if(v.call(s)==S)for(i=s.length;i--;)F(s,i,n);else h(s,(function(e){F(s,e,n)}));return n.call(e,t,s)};t.parse=function(e,t){var n,i;return j=0,I=""+e,n=B(N()),"$"!=N()&&A(),j=I=null,t&&v.call(t)==_?U(((i={})[""]=n,i),"",t):n}}}return t.runInContext=a,t}if(!r||r.global!==r&&r.window!==r&&r.self!==r||(s=r),i)a(s,i);else{var o=s.JSON,c=s.JSON3,p=!1,d=a(s,s.JSON3={noConflict:function(){return p||(p=!0,s.JSON=o,s.JSON3=c,o=c=null),d}});s.JSON={parse:d.parse,stringify:d.stringify}}}).call(Zt)}({get exports(){return ys},set exports(e){ys=e}},ys);var _s=xs;function xs(e){if(e)return function(e){for(var t in xs.prototype)e[t]=xs.prototype[t];return e}(e)}xs.prototype.on=xs.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},xs.prototype.once=function(e,t){var n=this;function i(){n.off(e,i),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},xs.prototype.off=xs.prototype.removeListener=xs.prototype.removeAllListeners=xs.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var s=0;s<i.length;s++)if((n=i[s])===t||n.fn===t){i.splice(s,1);break}return this},xs.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n)for(var i=0,s=(n=n.slice(0)).length;i<s;++i)n[i].apply(this,t);return this},xs.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},xs.prototype.hasListeners=function(e){return!!this.listeners(e).length};var ws={},Ss=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},ks=function(e){return Zt.Buffer&&Zt.Buffer.isBuffer(e)||Zt.ArrayBuffer&&e instanceof ArrayBuffer};var Cs=Ss,Rs=ks;ws.deconstructPacket=function(e){var t=[],n=e.data;var i=e;return i.data=function e(n){if(!n)return n;if(Rs(n)){var i={_placeholder:!0,num:t.length};return t.push(n),i}if(Cs(n)){for(var s=new Array(n.length),r=0;r<n.length;r++)s[r]=e(n[r]);return s}if("object"==typeof n&&!(n instanceof Date)){s={};for(var a in n)s[a]=e(n[a]);return s}return n}(n),i.attachments=t.length,{packet:i,buffers:t}},ws.reconstructPacket=function(e,t){return e.data=function e(n){if(n&&n._placeholder)return t[n.num];if(Cs(n)){for(var i=0;i<n.length;i++)n[i]=e(n[i]);return n}if(n&&"object"==typeof n){for(var s in n)n[s]=e(n[s]);return n}return n}(e.data),e.attachments=void 0,e},ws.removeBlobs=function(e,t){var n=0,i=e;!function e(s,r,a){if(!s)return s;if(Zt.Blob&&s instanceof Blob||Zt.File&&s instanceof File){n++;var o=new FileReader;o.onload=function(){a?a[r]=this.result:i=this.result,--n||t(i)},o.readAsArrayBuffer(s)}else if(Cs(s))for(var c=0;c<s.length;c++)e(s[c],c,s);else if(s&&"object"==typeof s&&!Rs(s))for(var p in s)e(s[p],p,s)}(i),n||t(i)},function(e){var t=cs("socket.io-parser"),n=ys,i=_s,s=ws,r=ks;function a(){}function o(i){var s="",r=!1;return s+=i.type,e.BINARY_EVENT!=i.type&&e.BINARY_ACK!=i.type||(s+=i.attachments,s+="-"),i.nsp&&"/"!=i.nsp&&(r=!0,s+=i.nsp),null!=i.id&&(r&&(s+=",",r=!1),s+=i.id),null!=i.data&&(r&&(s+=","),s+=n.stringify(i.data)),t("encoded %j as %s",i,s),s}function c(){this.reconstructor=null}function p(e){this.reconPack=e,this.buffers=[]}function d(t){return{type:e.ERROR,data:"parser error"}}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=a,e.Decoder=c,a.prototype.encode=function(n,i){(t("encoding packet %j",n),e.BINARY_EVENT==n.type||e.BINARY_ACK==n.type)?function(e,t){function n(e){var n=s.deconstructPacket(e),i=o(n.packet),r=n.buffers;r.unshift(i),t(r)}s.removeBlobs(e,n)}(n,i):i([o(n)])},i(c.prototype),c.prototype.add=function(i){var s;if("string"==typeof i)s=function(i){var s={},r=0;if(s.type=Number(i.charAt(0)),null==e.types[s.type])return d();if(e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type){for(var a="";"-"!=i.charAt(++r)&&(a+=i.charAt(r),r!=i.length););if(a!=Number(a)||"-"!=i.charAt(r))throw new Error("Illegal attachments");s.attachments=Number(a)}if("/"==i.charAt(r+1))for(s.nsp="";++r;){if(","==(c=i.charAt(r)))break;if(s.nsp+=c,r==i.length)break}else s.nsp="/";var o=i.charAt(r+1);if(""!==o&&Number(o)==o){for(s.id="";++r;){var c;if(null==(c=i.charAt(r))||Number(c)!=c){--r;break}if(s.id+=i.charAt(r),r==i.length)break}s.id=Number(s.id)}i.charAt(++r)&&(s=function(e,t){try{e.data=n.parse(t)}catch(e){return d()}return e}(s,i.substr(r)));return t("decoded %s as %j",i,s),s}(i),e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type?(this.reconstructor=new p(s),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",s)):this.emit("decoded",s);else{if(!r(i)&&!i.base64)throw new Error("Unknown type: "+i);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(s=this.reconstructor.takeBinaryData(i))&&(this.reconstructor=null,this.emit("decoded",s))}},c.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}(os);var Ts={},Ps={get exports(){return Ts},set exports(e){Ts=e}},Es={},Os={get exports(){return Es},set exports(e){Es=e}},Ds={},js=n,Is=s,Ms=r.spawn,Ls=As;function As(e){e=e||{};var t,n,i=this,s=a,r=o,c={},p=!1,d={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},l=Object.assign({},d),u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],m=["TRACE","TRACK","CONNECT"],h=!1,f=!1,g=!1,v={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null;this.open=function(e,t,n,i,s){if(this.abort(),f=!1,g=!1,!function(e){return e&&-1===m.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");c={method:e,url:t.toString(),async:"boolean"!=typeof n||n,user:i||null,password:s||null},b(this.OPENED)},this.setDisableHeaderCheck=function(e){p=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!function(e){return p||e&&-1===u.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(h)throw new Error("INVALID_STATE_ERR: send flag is true");return l[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&n.headers[e.toLowerCase()]&&!f?n.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||f)return"";var e="";for(var t in n.headers)"set-cookie"!==t&&"set-cookie2"!==t&&(e+=t+": "+n.headers[t]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&l[e]?l[e]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var o,p=!1,d=!1,u=Is.parse(c.url);switch(u.protocol){case"https:":p=!0;case"http:":o=u.hostname;break;case"file:":d=!0;break;case void 0:case"":o="localhost";break;default:throw new Error("Protocol not supported.")}if(d){if("GET"!==c.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(c.async)js.readFile(unescape(u.pathname),"utf8",(function(e,t){e?i.handleError(e):(i.status=200,i.responseText=t,b(i.DONE))}));else try{this.responseText=js.readFileSync(unescape(u.pathname),"utf8"),this.status=200,b(i.DONE)}catch(e){this.handleError(e)}}else{var m=u.port||(p?443:80),g=u.pathname+(u.search?u.search:"");if(l.Host=o,p&&443===m||80===m||(l.Host+=":"+u.port),c.user){void 0===c.password&&(c.password="");var v=new Buffer(c.user+":"+c.password);l.Authorization="Basic "+v.toString("base64")}"GET"===c.method||"HEAD"===c.method?a=null:a?(l["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),l["Content-Type"]||(l["Content-Type"]="text/plain;charset=UTF-8")):"POST"===c.method&&(l["Content-Length"]=0);var y=e.agent||!1,_={host:o,port:m,path:g,method:c.method,headers:l,agent:y};if(p&&(_.pfx=e.pfx,_.key=e.key,_.passphrase=e.passphrase,_.cert=e.cert,_.ca=e.ca,_.ciphers=e.ciphers,_.rejectUnauthorized=!1!==e.rejectUnauthorized),f=!1,c.async){var x=p?r.request:s.request;h=!0,i.dispatchEvent("readystatechange");var w=function(s){if(302===(n=s).statusCode||303===n.statusCode||307===n.statusCode){c.url=n.headers.location;var r=Is.parse(c.url);o=r.hostname;var a={hostname:r.hostname,port:r.port,path:r.path,method:303===n.statusCode?"GET":c.method,headers:l};return p&&(a.pfx=e.pfx,a.key=e.key,a.passphrase=e.passphrase,a.cert=e.cert,a.ca=e.ca,a.ciphers=e.ciphers,a.rejectUnauthorized=!1!==e.rejectUnauthorized),void(t=x(a,w).on("error",S)).end()}n&&n.setEncoding&&n.setEncoding("utf8"),b(i.HEADERS_RECEIVED),i.status=n.statusCode,n.on("data",(function(e){e&&(i.responseText+=e),h&&b(i.LOADING)})),n.on("end",(function(){h&&(h=!1,b(i.DONE))})),n.on("error",(function(e){i.handleError(e)}))},S=function(e){i.handleError(e)};t=x(_,w).on("error",S),a&&t.write(a),t.end(),i.dispatchEvent("loadstart")}else{var k=".node-xmlhttprequest-content-"+process.pid,C=".node-xmlhttprequest-sync-"+process.pid;js.writeFileSync(C,"","utf8");for(var R="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(p?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');fs.unlinkSync('"+C+"');});response.on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});}).on('error', function(error) {fs.writeFileSync('"+k+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+C+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",T=Ms(process.argv[0],["-e",R]);js.existsSync(C););if(i.responseText=js.readFileSync(k,"utf8"),T.stdin.end(),js.unlinkSync(k),i.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var P=i.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,"");i.handleError(P,503)}else i.status=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1"),i.responseText=i.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"),b(i.DONE)}}},this.handleError=function(e,t){this.status=t||0,this.statusText=e,this.responseText=e.stack,f=!0,b(this.DONE)},this.abort=function(){t&&(t.abort(),t=null),l=Object.assign({},d),this.responseText="",this.responseXML="",f=g=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,b(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(e,t){e in v||(v[e]=[]),v[e].push(t)},this.removeEventListener=function(e,t){e in v&&(v[e]=v[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof i["on"+e]&&(this.readyState===this.DONE?setImmediate((function(){i["on"+e]()})):i["on"+e]()),e in v)for(let t=0,n=v[e].length;t<n;t++)this.readyState===this.DONE?setImmediate((function(){v[e][t].call(i)})):v[e][t].call(i)};var b=function(e){if(!(i.readyState===e||i.readyState===i.UNSENT&&g)&&(i.readyState=e,(c.async||i.readyState<i.OPENED||i.readyState===i.DONE)&&i.dispatchEvent("readystatechange"),i.readyState===i.DONE)){let e;e=g?"abort":f?"error":"load",i.dispatchEvent(e),i.dispatchEvent("loadend")}}}As.XMLHttpRequest=As;var Ns={},Bs={get exports(){return Ns},set exports(e){Ns=e}},Fs={},Us={get exports(){return Fs},set exports(e){Fs=e}},zs={},qs={};
18
18
  /*! https://mths.be/wtf8 v1.0.0 by @mathias */
@@ -102,4 +102,4 @@ var t=Zr.exports=Aa();t.Server=Na(),t.Sender=ha(),t.Receiver=Pa(),t.createServer
102
102
  * Copyright(c) 2015 Douglas Christopher Wilson
103
103
  * MIT Licensed
104
104
  */
105
- function(e){var t=Hf,n=f.extname,i=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function r(e){if(!e||"string"!=typeof e)return!1;var n=i.exec(e),r=n&&t[n[1].toLowerCase()];return r&&r.charset?r.charset:!(!n||!s.test(n[1]))&&"UTF-8"}e.charset=r,e.charsets={lookup:r},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=i.exec(t),s=n&&e.extensions[n[1].toLowerCase()];if(!s||!s.length)return!1;return s[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=n("x."+t).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),function(e,n){var i=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(s){var r=t[s],a=r.extensions;if(a&&a.length){e[s]=a;for(var o=0;o<a.length;o++){var c=a[o];if(n[c]){var p=i.indexOf(t[n[c]].source),d=i.indexOf(r.source);if("application/octet-stream"!==n[c]&&(p>d||p===d&&"application/"===n[c].substr(0,12)))continue}n[c]=s}}}))}(e.extensions,e.types)}(Vf);var Gf=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},Kf=function(e){var t=!1;return Gf((function(){t=!0})),function(n,i){t?e(n,i):Gf((function(){e(n,i)}))}};var Jf=function(e){Object.keys(e.jobs).forEach(Qf.bind(e)),e.jobs={}};function Qf(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yf=Kf,Xf=Jf,Zf=function(e,t,n,i){var s=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[s]=function(e,t,n,i){var s;s=2==e.length?e(n,Yf(i)):e(n,t,Yf(i));return s}(t,s,e[s],(function(e,t){s in n.jobs&&(delete n.jobs[s],e?Xf(n):n.results[s]=t,i(e,n.results))}))};var eg=function(e,t){var n=!Array.isArray(e),i={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};t&&i.keyedList.sort(n?t:function(n,i){return t(e[n],e[i])});return i};var tg=Jf,ng=Kf,ig=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,tg(this),ng(e)(null,this.results)};var sg=Zf,rg=eg,ag=ig,og=function(e,t,n){var i=rg(e);for(;i.index<(i.keyedList||e).length;)sg(e,t,i,(function(e,t){e?n(e,t):0!==Object.keys(i.jobs).length||n(null,i.results)})),i.index++;return ag.bind(i,n)};var cg={},pg=Zf,dg=eg,lg=ig;function ug(e,t){return e<t?-1:e>t?1:0}({get exports(){return cg},set exports(e){cg=e}}).exports=function(e,t,n,i){var s=dg(e,n);return pg(e,t,s,(function n(r,a){r?i(r,a):(s.index++,s.index<(s.keyedList||e).length?pg(e,t,s,n):i(null,s.results))})),lg.bind(s,i)},cg.ascending=ug,cg.descending=function(e,t){return-1*ug(e,t)};var mg=cg;var hg={parallel:og,serial:function(e,t,n){return mg(e,t,null,n)},serialOrdered:cg},fg=qf,gg=t,vg=f,bg=a,yg=o,_g=s.parse,xg=n,wg=p.Stream,Sg=Vf,kg=hg,Cg=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e},Rg=Tg;function Tg(e){if(!(this instanceof Tg))return new Tg(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fg.call(this),e=e||{})this[t]=e[t]}function Pg(e){return jf.isPlainObject(e)||jf.isArray(e)}function Eg(e){return jf.endsWith(e,"[]")?e.slice(0,-2):e}function Og(e,t,n){return e?e.concat(t).map((function(e,t){return e=Eg(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}gg.inherits(Tg,fg),Tg.LINE_BREAK="\r\n",Tg.DEFAULT_CONTENT_TYPE="application/octet-stream",Tg.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=fg.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),gg.isArray(t))this._error(new Error("Arrays are not supported."));else{var s=this._multiPartHeader(e,t,n),r=this._multiPartFooter();i(s),i(t),i(r),this._trackLength(s,t,n)}},Tg.prototype._trackLength=function(e,t,n){var i=0;null!=n.knownLength?i+=+n.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+Tg.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof wg)&&(n.knownLength||this._valuesToMeasure.push(t))},Tg.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):xg.stat(e.path,(function(n,i){var s;n?t(n):(s=i.size-(e.start?e.start:0),t(null,s))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},Tg.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var i,s=this._getContentDisposition(t,n),r=this._getContentType(t,n),a="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(s||[]),"Content-Type":[].concat(r||[])};for(var c in"object"==typeof n.header&&Cg(o,n.header),o)o.hasOwnProperty(c)&&null!=(i=o[c])&&(Array.isArray(i)||(i=[i]),i.length&&(a+=c+": "+i.join("; ")+Tg.LINE_BREAK));return"--"+this.getBoundary()+Tg.LINE_BREAK+a+Tg.LINE_BREAK},Tg.prototype._getContentDisposition=function(e,t){var n,i;return"string"==typeof t.filepath?n=vg.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=vg.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=vg.basename(e.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i},Tg.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=Sg.lookup(e.name)),!n&&e.path&&(n=Sg.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=Sg.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=Tg.DEFAULT_CONTENT_TYPE),n},Tg.prototype._multiPartFooter=function(){return function(e){var t=Tg.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Tg.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Tg.LINE_BREAK},Tg.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},Tg.prototype.setBoundary=function(e){this._boundary=e},Tg.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Tg.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Tg.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Tg.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Tg.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Tg.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Tg.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?kg.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,i){n?e(n):(i.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},Tg.prototype.submit=function(e,t){var n,i,s={method:"post"};return"string"==typeof e?(e=_g(e),i=Cg({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},s)):(i=Cg(e,s)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),n="https:"==i.protocol?yg.request(i):bg.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&n.setHeader("Content-Length",i),this.pipe(n),t){var s,r=function(e,i){return n.removeListener("error",r),n.removeListener("response",s),t.call(this,e,i)};s=r.bind(this,null),n.on("error",r),n.on("response",s)}}.bind(this)),n},Tg.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Tg.prototype.toString=function(){return"[object FormData]"};const Dg=jf.toFlatObject(jf,{},null,(function(e){return/^is[A-Z]/.test(e)}));function jg(e,t,n){if(!jf.isObject(e))throw new TypeError("target must be an object");t=t||new(Rg||FormData);const i=(n=jf.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jf.isUndefined(t[e])}))).metaTokens,s=n.visitor||d,r=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((c=t)&&jf.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!jf.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(jf.isDate(e))return e.toISOString();if(!o&&jf.isBlob(e))throw new If("Blob is not supported. Use a Buffer instead.");return jf.isArrayBuffer(e)||jf.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(jf.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(jf.isArray(e)&&function(e){return jf.isArray(e)&&!e.some(Pg)}(e)||jf.isFileList(e)||jf.endsWith(n,"[]")&&(o=jf.toArray(e)))return n=Eg(n),o.forEach((function(e,i){!jf.isUndefined(e)&&null!==e&&t.append(!0===a?Og([n],i,r):null===a?n:n+"[]",p(e))})),!1;return!!Pg(e)||(t.append(Og(s,n,r),p(e)),!1)}const l=[],u=Object.assign(Dg,{defaultVisitor:d,convertValue:p,isVisitable:Pg});if(!jf.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!jf.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+i.join("."));l.push(n),jf.forEach(n,(function(n,r){!0===(!(jf.isUndefined(n)||null===n)&&s.call(t,n,jf.isString(r)?r.trim():r,i,u))&&e(n,i?i.concat(r):[r])})),l.pop()}}(e),t}function Ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Mg(e,t){this._pairs=[],e&&jg(e,this,t)}const Lg=Mg.prototype;function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ng(e,t,n){if(!t)return e;const i=n&&n.encode||Ag,s=n&&n.serialize;let r;if(r=s?s(t,n):jf.isURLSearchParams(t)?t.toString():new Mg(t,n).toString(i),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Lg.append=function(e,t){this._pairs.push([e,t])},Lg.toString=function(e){const t=e?function(t){return e.call(this,t,Ig)}:Ig;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Bg{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jf.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Fg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ug={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Rg,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function zg(e){function t(e,n,i,s){let r=e[s++];const a=Number.isFinite(+r),o=s>=e.length;if(r=!r&&jf.isArray(i)?i.length:r,o)return jf.hasOwnProp(i,r)?i[r]=[i[r],n]:i[r]=n,!a;i[r]&&jf.isObject(i[r])||(i[r]=[]);return t(e,n,i[r],s)&&jf.isArray(i[r])&&(i[r]=function(e){const t={},n=Object.keys(e);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],t[r]=e[r];return t}(i[r])),!a}if(jf.isFormData(e)&&jf.isFunction(e.entries)){const n={};return jf.forEachEntry(e,((e,i)=>{t(function(e){return jf.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0)})),n}return null}const qg={"Content-Type":void 0};const $g={transitional:Fg,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=jf.isObject(e);s&&jf.isHTMLForm(e)&&(e=new FormData(e));if(jf.isFormData(e))return i&&i?JSON.stringify(zg(e)):e;if(jf.isArrayBuffer(e)||jf.isBuffer(e)||jf.isStream(e)||jf.isFile(e)||jf.isBlob(e))return e;if(jf.isArrayBufferView(e))return e.buffer;if(jf.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return jg(e,new Ug.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return jf.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=jf.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return jg(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),function(e,t,n){if(jf.isString(e))try{return(t||JSON.parse)(e),jf.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&jf.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw If.from(e,If.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ug.classes.FormData,Blob:Ug.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};jf.forEach(["delete","get","head"],(function(e){$g.headers[e]={}})),jf.forEach(["post","put","patch"],(function(e){$g.headers[e]=jf.merge(qg)}));const Vg=jf.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Hg=Symbol("internals");function Wg(e){return e&&String(e).trim().toLowerCase()}function Gg(e){return!1===e||null==e?e:jf.isArray(e)?e.map(Gg):String(e)}function Kg(e,t,n,i){return jf.isFunction(i)?i.call(this,t,n):jf.isString(t)?jf.isString(i)?-1!==t.indexOf(i):jf.isRegExp(i)?i.test(t):void 0:void 0}class Jg{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(e,t,n){const s=Wg(t);if(!s)throw new Error("header name must be a non-empty string");const r=jf.findKey(i,s);(!r||void 0===i[r]||!0===n||void 0===n&&!1!==i[r])&&(i[r||t]=Gg(e))}const r=(e,t)=>jf.forEach(e,((e,n)=>s(e,n,t)));return jf.isPlainObject(e)||e instanceof this.constructor?r(e,t):jf.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?r((e=>{const t={};let n,i,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),i=e.substring(s+1).trim(),!n||t[n]&&Vg[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)})),t})(e),t):null!=e&&s(t,e,n),this}get(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(jf.isFunction(t))return t.call(this,e,n);if(jf.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);return!(!n||t&&!Kg(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function s(e){if(e=Wg(e)){const s=jf.findKey(n,e);!s||t&&!Kg(0,n[s],s,t)||(delete n[s],i=!0)}}return jf.isArray(e)?e.forEach(s):s(e),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return jf.forEach(this,((i,s)=>{const r=jf.findKey(n,s);if(r)return t[r]=Gg(i),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Gg(i),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jf.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&jf.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Hg]=this[Hg]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Wg(e);t[i]||(!function(e,t){const n=jf.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,s){return this[i].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[i]=!0)}return jf.isArray(e)?e.forEach(i):i(e),this}}function Qg(e,t){const n=this||$g,i=t||n,s=Jg.from(i.headers);let r=i.data;return jf.forEach(e,(function(e){r=e.call(n,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function Yg(e){return!(!e||!e.__CANCEL__)}function Xg(e,t,n){If.call(this,null==e?"canceled":e,If.ERR_CANCELED,t,n),this.name="CanceledError"}function Zg(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new If("Request failed with status code "+n.status,[If.ERR_BAD_REQUEST,If.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function ev(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}Jg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),jf.freezeMethods(Jg.prototype),jf.freezeMethods(Jg),jf.inherits(Xg,If,{__CANCEL__:!0});var tv=s.parse,nv={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},iv=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sv(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rv,av=function(e){var t="string"==typeof e?tv(e):e||{},n=t.protocol,i=t.host,s=t.port;if("string"!=typeof i||!i||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=(sv("npm_config_no_proxy")||sv("no_proxy")).toLowerCase();if(!n)return!0;if("*"===n)return!1;return n.split(/[,\s]/).every((function(n){if(!n)return!0;var i=n.match(/^(.+):(\d+)$/),s=i?i[1]:n,r=i?parseInt(i[2]):0;return!(!r||r===t)||(/^[.*]/.test(s)?("*"===s.charAt(0)&&(s=s.slice(1)),!iv.call(e,s)):e!==s)}))}(i=i.replace(/:\d*$/,""),s=parseInt(s)||nv[n]||0))return"";var r=sv("npm_config_"+n+"_proxy")||sv(n+"_proxy")||sv("npm_config_proxy")||sv("all_proxy");return r&&-1===r.indexOf("://")&&(r=n+"://"+r),r},ov={},cv={get exports(){return ov},set exports(e){ov=e}},pv=s,dv=pv.URL,lv=a,uv=o,mv=p.Writable,hv=m,fv=function(){if(!rv){try{rv=gc("follow-redirects")}catch(e){}"function"!=typeof rv&&(rv=function(){})}rv.apply(null,arguments)},gv=["abort","aborted","connect","error","socket","timeout"],vv=Object.create(null);gv.forEach((function(e){vv[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}}));var bv=Pv("ERR_INVALID_URL","Invalid URL",TypeError),yv=Pv("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),_v=Pv("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),xv=Pv("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wv=Pv("ERR_STREAM_WRITE_AFTER_END","write after end");function Sv(e,t){mv.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function kv(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(i){var s=i+":",r=n[s]=e[i],a=t[i]=Object.create(r);Object.defineProperties(a,{request:{value:function(e,i,r){if(Ov(e)){var a;try{a=Rv(new dv(e))}catch(t){a=pv.parse(e)}if(!Ov(a.protocol))throw new bv({input:e});e=a}else dv&&e instanceof dv?e=Rv(e):(r=i,i=e,e={protocol:s});return Dv(i)&&(r=i,i=null),(i=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,i)).nativeProtocols=n,Ov(i.host)||Ov(i.hostname)||(i.hostname="::1"),hv.equal(i.protocol,s,"protocol mismatch"),fv("options",i),new Sv(i,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var i=a.request(e,t,n);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),t}function Cv(){}function Rv(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function Tv(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return null==n?void 0:String(n).trim()}function Pv(e,t,n){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Ev(e){for(var t of gv)e.removeListener(t,vv[t]);e.on("error",Cv),e.abort()}function Ov(e){return"string"==typeof e||e instanceof String}function Dv(e){return"function"==typeof e}Sv.prototype=Object.create(mv.prototype),Sv.prototype.abort=function(){Ev(this._currentRequest),this.emit("abort")},Sv.prototype.write=function(e,t,n){if(this._ending)throw new wv;if(!Ov(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Dv(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new xv),this.abort()):n&&n()},Sv.prototype.end=function(e,t,n){if(Dv(e)?(n=e,e=t=null):Dv(t)&&(n=t,t=null),e){var i=this,s=this._currentRequest;this.write(e,t,(function(){i._ended=!0,s.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Sv.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Sv.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Sv.prototype.setTimeout=function(e,t){var n=this;function i(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function s(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),r()}),e),i(t)}function r(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",r),n.removeListener("error",r),n.removeListener("response",r),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",s)}return t&&this.on("timeout",t),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",i),this.on("abort",r),this.on("error",r),this.on("response",r),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){Sv.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(Sv.prototype,e,{get:function(){return this._currentRequest[e]}})})),Sv.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Sv.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,gv))i.on(s,vv[s]);if(this._currentUrl=/^\//.test(this._options.path)?pv.format(this._options):this._options.path,this._isRedirect){var r=0,a=this,o=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(r<o.length){var n=o[r++];i.finished||i.write(n.data,n.encoding,e)}else a._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},Sv.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ev(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new _v);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var r=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Tv(/^content-/i,this._options.headers));var a,o=Tv(/^host$/i,this._options.headers),c=pv.parse(this._currentUrl),p=o||c.host,d=/^\w+:/.test(n)?this._currentUrl:pv.format(Object.assign(c,{host:p}));try{a=pv.resolve(d,n)}catch(e){return void this.emit("error",new yv({cause:e}))}fv("redirecting to",a),this._isRedirect=!0;var l=pv.parse(a);if(Object.assign(this._options,l),(l.protocol!==c.protocol&&"https:"!==l.protocol||l.host!==p&&!function(e,t){hv(Ov(e)&&Ov(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(l.host,p))&&Tv(/^(?:authorization|cookie)$/i,this._options.headers),Dv(s)){var u={headers:e.headers,statusCode:t},m={url:d,method:r,headers:i};try{s(this._options,u,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new yv({cause:e}))}}},cv.exports=kv({http:lv,https:uv}),ov.wrap=kv;function jv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Iv=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Mv(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s,r=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),p=i[a];s||(s=c),n[r]=o,i[r]=c;let d=a,l=0;for(;d!==r;)l+=n[d++],d%=e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-s<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}const Lv=Symbol("internals");class Av extends p.Transform{constructor(e){super({readableHighWaterMark:(e=jf.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!jf.isUndefined(t[e])))).chunkSize});const t=this,n=this[Lv]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Mv(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let s=0;n.updateProgress=function(e,t){let n=0;const i=1e3/t;let s=null;return function(t,r){const a=Date.now();if(t||a-n>i)return s&&(clearTimeout(s),s=null),n=a,e.apply(null,r);s||(s=setTimeout((()=>(s=null,n=Date.now(),e.apply(null,r))),i-(a-n)))}}((function(){const e=n.length,r=n.bytesSeen,a=r-s;if(!a||t.destroyed)return;const o=i(a);s=r,process.nextTick((()=>{t.emit("progress",{loaded:r,total:e,progress:e?r/e:void 0,bytes:a,rate:o||void 0,estimated:o&&e&&r<=e?(e-r)/o:void 0})}))}),n.ticksRate);const r=()=>{n.updateProgress(!0)};this.once("end",r),this.once("error",r)}_read(e){const t=this[Lv];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const i=this,s=this[Lv],r=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,c=r/(1e3/o),p=!1!==s.minChunkSize?Math.max(s.minChunkSize,.01*c):0;const d=(e,t)=>{const n=Buffer.byteLength(e);let d,l=null,u=a,m=0;if(r){const e=Date.now();(!s.ts||(m=e-s.ts)>=o)&&(s.ts=e,d=c-s.bytes,s.bytes=d<0?-d:0,m=0),d=c-s.bytes}if(r){if(d<=0)return setTimeout((()=>{t(null,e)}),o-m);d<u&&(u=d)}u&&n>u&&n-u>p&&(l=e.subarray(u),e=e.subarray(0,u)),function(e,t){const n=Buffer.byteLength(e);s.bytesSeen+=n,s.bytes+=n,s.isCaptured&&s.updateProgress(),i.push(e)?process.nextTick(t):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(t)}}(e,l?()=>{process.nextTick(t,null,l)}:t)};d(e,(function e(t,i){if(t)return n(t);i?d(i,e):n(null)}))}setLength(e){return this[Lv].length=+e,this}}const Nv={flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH},Bv={flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH},Fv=jf.isFunction(u.createBrotliDecompress),{http:Uv,https:zv}=ov,qv=/https:?/,$v=Ug.protocols.map((e=>e+":"));function Vv(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Hv(e,t,n){let i=t;if(!i&&!1!==i){const e=av(n);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const t=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=i.hostname||i.host;e.hostname=t,e.host=t,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){Hv(e,t,e.href)}}var Wv="undefined"!=typeof process&&"process"===jf.kindOf(process)&&function(e){return new Promise((function(t,n){let i=e.data;const s=e.responseType,r=e.responseEncoding,c=e.method.toUpperCase();let l,m,h,f=!1;const g=new d;function v(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(x),e.signal&&e.signal.removeEventListener("abort",x),g.removeAllListeners())}function b(e,i){m||(m=!0,i&&(f=!0,v()),i?n(e):t(e))}const y=function(e){b(e)},_=function(e){b(e,!0)};function x(t){g.emit("abort",!t||t.type?new Xg(null,e,h):t)}g.once("abort",_),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(x),e.signal&&(e.signal.aborted?x():e.signal.addEventListener("abort",x)));const w=ev(e.baseURL,e.url),S=new URL(w),k=S.protocol||$v[0];if("data:"===k){let t;if("GET"!==c)return Zg(y,_,{status:405,statusText:"method not allowed",headers:{},config:e});try{t=function(e,t,n){const i=n&&n.Blob||Ug.classes.Blob,s=jv(e);if(void 0===t&&i&&(t=!0),"data"===s){e=s.length?e.slice(s.length+1):e;const n=Iv.exec(e);if(!n)throw new If("Invalid URL",If.ERR_INVALID_URL);const r=n[1],a=n[2],o=n[3],c=Buffer.from(decodeURIComponent(o),a?"base64":"utf8");if(t){if(!i)throw new If("Blob is not supported",If.ERR_NOT_SUPPORT);return new i([c],{type:r})}return c}throw new If("Unsupported protocol "+s,If.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(t){throw If.from(t,If.ERR_BAD_REQUEST,e)}return"text"===s?(t=t.toString(r),r&&"utf8"!==r||(i=jf.stripBOM(t))):"stream"===s&&(t=p.Readable.from(t)),Zg(y,_,{data:t,status:200,statusText:"OK",headers:new Jg,config:e})}if(-1===$v.indexOf(k))return _(new If("Unsupported protocol "+k,If.ERR_BAD_REQUEST,e));const C=Jg.from(e.headers).normalize();C.set("User-Agent","axios/1.2.3",!1);const R=e.onDownloadProgress,T=e.onUploadProgress,P=e.maxRate;let E,O;if(jf.isFormData(i)&&jf.isFunction(i.getHeaders))C.set(i.getHeaders());else if(i&&!jf.isStream(i)){if(Buffer.isBuffer(i));else if(jf.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!jf.isString(i))return _(new If("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",If.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(C.set("Content-Length",i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return _(new If("Request body larger than maxBodyLength limit",If.ERR_BAD_REQUEST,e))}const D=jf.toFiniteNumber(C.getContentLength());let j,I;if(jf.isArray(P)?(E=P[0],O=P[1]):E=O=P,i&&(T||E)&&(jf.isStream(i)||(i=p.Readable.from(i,{objectMode:!1})),i=p.pipeline([i,new Av({length:D,maxRate:jf.toFiniteNumber(E)})],jf.noop),T&&i.on("progress",(e=>{T(Object.assign(e,{upload:!0}))}))),e.auth){j=(e.auth.username||"")+":"+(e.auth.password||"")}if(!j&&S.username){j=S.username+":"+S.password}j&&C.delete("authorization");try{I=Ng(S.pathname+S.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,_(n)}C.set("Accept-Encoding","gzip, compress, deflate"+(Fv?", br":""),!1);const M={path:I,method:c,headers:C.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:j,protocol:k,beforeRedirect:Vv,beforeRedirects:{}};let L;e.socketPath?M.socketPath=e.socketPath:(M.hostname=S.hostname,M.port=S.port,Hv(M,e.proxy,k+"//"+S.hostname+(S.port?":"+S.port:"")+M.path));const A=qv.test(M.protocol);if(M.agent=A?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=A?o:a:(e.maxRedirects&&(M.maxRedirects=e.maxRedirects),e.beforeRedirect&&(M.beforeRedirects.config=e.beforeRedirect),L=A?zv:Uv),e.maxBodyLength>-1?M.maxBodyLength=e.maxBodyLength:M.maxBodyLength=1/0,e.insecureHTTPParser&&(M.insecureHTTPParser=e.insecureHTTPParser),h=L.request(M,(function(t){if(h.destroyed)return;const n=[t],i=+t.headers["content-length"];if(R){const e=new Av({length:jf.toFiniteNumber(i),maxRate:jf.toFiniteNumber(O)});R&&e.on("progress",(e=>{R(Object.assign(e,{download:!0}))})),n.push(e)}let a=t;const o=t.req||h;if(!1!==e.decompress&&t.headers["content-encoding"])switch("HEAD"!==c&&204!==t.statusCode||delete t.headers["content-encoding"],t.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":n.push(u.createUnzip(Nv)),delete t.headers["content-encoding"];break;case"br":Fv&&(n.push(u.createBrotliDecompress(Bv)),delete t.headers["content-encoding"])}a=n.length>1?p.pipeline(n,jf.noop):n[0];const d=p.finished(a,(()=>{d(),v()})),l={status:t.statusCode,statusText:t.statusMessage,headers:new Jg(t.headers),config:e,request:o};if("stream"===s)l.data=a,Zg(y,_,l);else{const t=[];let n=0;a.on("data",(function(i){t.push(i),n+=i.length,e.maxContentLength>-1&&n>e.maxContentLength&&(f=!0,a.destroy(),_(new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o)))})),a.on("aborted",(function(){if(f)return;const t=new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o);a.destroy(t),_(t)})),a.on("error",(function(t){h.destroyed||_(If.from(t,null,e,o))})),a.on("end",(function(){try{let e=1===t.length?t[0]:Buffer.concat(t);"arraybuffer"!==s&&(e=e.toString(r),r&&"utf8"!==r||(e=jf.stripBOM(e))),l.data=e}catch(t){_(If.from(t,null,e,l.request,l))}Zg(y,_,l)}))}g.once("abort",(e=>{a.destroyed||(a.emit("error",e),a.destroy())}))})),g.once("abort",(e=>{_(e),h.destroy(e)})),h.on("error",(function(t){_(If.from(t,null,e,h))})),h.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(isNaN(t))return void _(new If("error trying to parse `config.timeout` to int",If.ERR_BAD_OPTION_VALUE,e,h));h.setTimeout(t,(function(){if(m)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),_(new If(t,n.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,h)),x()}))}if(jf.isStream(i)){let t=!1,n=!1;i.on("end",(()=>{t=!0})),i.once("error",(e=>{n=!0,h.destroy(e)})),i.on("close",(()=>{t||n||x(new Xg("Request stream has been aborted",e,h))})),i.pipe(h)}else h.end(i)}))},Gv=Ug.isStandardBrowserEnv?{write:function(e,t,n,i,s,r){const a=[];a.push(e+"="+encodeURIComponent(t)),jf.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jf.isString(i)&&a.push("path="+i),jf.isString(s)&&a.push("domain="+s),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Kv=Ug.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=jf.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Jv(e,t){let n=0;const i=Mv(50,250);return s=>{const r=s.loaded,a=s.lengthComputable?s.total:void 0,o=r-n,c=i(o);n=r;const p={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:s};p[t?"download":"upload"]=!0,e(p)}}const Qv={http:Wv,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const s=Jg.from(e.headers).normalize(),r=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}jf.isFormData(i)&&(Ug.isStandardBrowserEnv||Ug.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+n))}const p=ev(e.baseURL,e.url);function d(){if(!c)return;const i=Jg.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Zg((function(e){t(e),o()}),(function(e){n(e),o()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ng(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(n(new If("Request aborted",If.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new If("Network Error",If.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new If(t,i.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,c)),c=null},Ug.isStandardBrowserEnv){const t=(e.withCredentials||Kv(p))&&e.xsrfCookieName&&Gv.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===i&&s.setContentType(null),"setRequestHeader"in c&&jf.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),jf.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Jv(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Jv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(n(!t||t.type?new Xg(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=jv(p);l&&-1===Ug.protocols.indexOf(l)?n(new If("Unsupported protocol "+l+":",If.ERR_BAD_REQUEST,e)):c.send(i||null)}))}};jf.forEach(Qv,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Yv=e=>{e=jf.isArray(e)?e:[e];const{length:t}=e;let n,i;for(let s=0;s<t&&(n=e[s],!(i=jf.isString(n)?Qv[n.toLowerCase()]:n));s++);if(!i){if(!1===i)throw new If(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(jf.hasOwnProp(Qv,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!jf.isFunction(i))throw new TypeError("adapter is not a function");return i};function Xv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xg(null,e)}function Zv(e){Xv(e),e.headers=Jg.from(e.headers),e.data=Qg.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yv(e.adapter||$g.adapter)(e).then((function(t){return Xv(e),t.data=Qg.call(e,e.transformResponse,t),t.headers=Jg.from(t.headers),t}),(function(t){return Yg(t)||(Xv(e),t&&t.response&&(t.response.data=Qg.call(e,e.transformResponse,t.response),t.response.headers=Jg.from(t.response.headers))),Promise.reject(t)}))}const eb=e=>e instanceof Jg?e.toJSON():e;function tb(e,t){t=t||{};const n={};function i(e,t,n){return jf.isPlainObject(e)&&jf.isPlainObject(t)?jf.merge.call({caseless:n},e,t):jf.isPlainObject(t)?jf.merge({},t):jf.isArray(t)?t.slice():t}function s(e,t,n){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function r(e,t){if(!jf.isUndefined(t))return i(void 0,t)}function a(e,t){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(n,s,r){return r in t?i(n,s):r in e?i(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(eb(e),eb(t),!0)};return jf.forEach(Object.keys(e).concat(Object.keys(t)),(function(i){const r=c[i]||s,a=r(e[i],t[i],i);jf.isUndefined(a)&&r!==o||(n[i]=a)})),n}const nb={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{nb[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ib={};nb.transitional=function(e,t,n){function i(e,t){return"[Axios v1.2.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,r)=>{if(!1===e)throw new If(i(s," has been removed"+(t?" in "+t:"")),If.ERR_DEPRECATED);return t&&!ib[s]&&(ib[s]=!0,console.warn(i(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,r)}};var sb={assertOptions:function(e,t,n){if("object"!=typeof e)throw new If("options must be an object",If.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const r=i[s],a=t[r];if(a){const t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new If("option "+r+" must be "+n,If.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new If("Unknown option "+r,If.ERR_BAD_OPTION)}},validators:nb};const rb=sb.validators;class ab{constructor(e){this.defaults=e,this.interceptors={request:new Bg,response:new Bg}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tb(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;let r;void 0!==n&&sb.assertOptions(n,{silentJSONParsing:rb.transitional(rb.boolean),forcedJSONParsing:rb.transitional(rb.boolean),clarifyTimeoutError:rb.transitional(rb.boolean)},!1),void 0!==i&&sb.assertOptions(i,{encode:rb.function,serialize:rb.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&jf.merge(s.common,s[t.method]),r&&jf.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Jg.concat(r,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!o){const e=[Zv.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=a.length;let u=t;for(l=0;l<d;){const e=a[l++],t=a[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Zv.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ng(ev((e=tb(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}jf.forEach(["delete","get","head","options"],(function(e){ab.prototype[e]=function(t,n){return this.request(tb(n||{},{method:e,url:t,data:(n||{}).data}))}})),jf.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,s){return this.request(tb(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ab.prototype[e]=t(),ab.prototype[e+"Form"]=t(!0)}));class ob{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e,i,s){n.reason||(n.reason=new Xg(e,i,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new ob((function(t){e=t})),cancel:e}}}const cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cb).forEach((([e,t])=>{cb[t]=e}));const pb=function e(t){const n=new ab(t),i=nf(ab.prototype.request,n);return jf.extend(i,ab.prototype,n,{allOwnKeys:!0}),jf.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(tb(t,n))},i}($g);pb.Axios=ab,pb.CanceledError=Xg,pb.CancelToken=ob,pb.isCancel=Yg,pb.VERSION="1.2.3",pb.toFormData=jg,pb.AxiosError=If,pb.Cancel=pb.CanceledError,pb.all=function(e){return Promise.all(e)},pb.spread=function(e){return function(t){return e.apply(null,t)}},pb.isAxiosError=function(e){return jf.isObject(e)&&!0===e.isAxiosError},pb.mergeConfig=tb,pb.AxiosHeaders=Jg,pb.formToJSON=e=>zg(jf.isHTMLForm(e)?new FormData(e):e),pb.HttpStatusCode=cb,pb.default=pb;class db{constructor(e={}){this.data=void 0===e.data?{}:e.data,this.headers=e.headers||{},this.status=e.status||200,this.statusText=e.statusText||"OK",this.url=e.url||null}}function lb(e,t){return m.ok(e,`${t} is required`),e}function ub(e,t){return m.ok("boolean"==typeof e,`${t}<boolean> is required`),e}function mb(e,t){return m.ok("number"==typeof e,`${t}<number> is required`),e}function hb(e,t){return m.ok("string"==typeof e,`${t}<string> is required`),e}function fb(e,t,n){const i=n||t.name[0].toLowerCase()+t.name.substring(1);return m.ok(e instanceof t,`${i}<${t.name}> is required`),e}function gb(e,t="roomName"){return hb(e,t),m.equal("string"==typeof e&&e[0],"/",`${t} must begin with a '/'`),e}function vb(e,t){return m.ok(Array.isArray(e),`${t}<array> is required`),e}function bb(e,t){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error(`${t} must be a record. ${JSON.stringify(e)}`);return e}function yb(e,t,n){hb(t,"name"),function(e,t,n,i){hb(n,"name");const s=i||`${n} must be null or of type ${t}`;m.ok(null===e||typeof e===t,s)}(e,"string",t,n)}function _b({baseUrl:e,url:t}){return m.ok("string"==typeof t,"url<String> is required"),e?e+t:t}class xb{constructor({baseUrl:e}){hb(e,"baseUrl"),this._baseUrl=e}_requestAxios(e,t){const n=Object.assign({},t,{url:e,baseURL:this._baseUrl});return pb.request(n)}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this._requestAxios(e,t).then((e=>{const{data:t,headers:n,status:i,statusText:s,config:r}=e,a=r&&r.url?_b({baseUrl:r.baseURL,url:r.url}):null;return new db({data:t,headers:n,status:i,statusText:s,url:a})})).catch((e=>{const t=e.response;if(!t)throw new Error("Could not make the request.");const{data:n,headers:i,status:s,statusText:r,config:a}=t,o=a&&a.url?_b({baseUrl:a.baseURL,url:a.url}):null;return Promise.reject(new db({data:n,headers:i,status:s,statusText:r,url:o}))}))}}class wb{constructor({httpClient:e}){m.ok(e,"httpClient is required"),this._httpClient=e}static dataToFormData(e){m.ok(e,"data is required");const t=new FormData;return Object.keys(e).forEach((n=>{const i=e[n];t.append(n,i)})),t}request(e,t={}){const n=Object.assign(t.headers||{},{"Content-Type":void 0});return this._httpClient.request(e,Object.assign(t,{headers:n,transformRequest:wb.dataToFormData}))}}let Sb;Sb="object"==typeof window?window.btoa||tf:"object"==typeof global&&global.btoa||tf;const kb=()=>Promise.resolve(null);class Cb{constructor({httpClient:e,fetchDeviceCredentials:t}){this._httpClient=e,this._fetchDeviceCredentials=t}request(e,t){return this._fetchDeviceCredentials().then((n=>{const i=Object.assign({},t.headers,function(e){if(e&&e.credentials){const t=`${e.credentials.uuid}:${e.hmac}`;return{Authorization:`Basic ${Sb(t)}`}}return{}}(n),{"X-Appearin-Device-Platform":"web"}),s=Object.assign({},t,{headers:i});return this._httpClient.request(e,s)}))}}class Rb{constructor({baseUrl:e="https://api.appearin.net",fetchDeviceCredentials:t=kb}={}){hb(e,"baseUrl"),m.ok("function"==typeof t,"fetchDeviceCredentials<Function> is required"),this.authenticatedHttpClient=new Cb({httpClient:new xb({baseUrl:e}),fetchDeviceCredentials:t}),this.authenticatedFormDataHttpClient=new wb({httpClient:this.authenticatedHttpClient})}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedHttpClient.request(e,t)}requestMultipart(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedFormDataHttpClient.request(e,t)}}function Tb(e,t){return hb(bb(e,"data")[t],t)}const Pb=(Eb=Tb,(e,t)=>{const n=bb(e,"data")[t];return null==n?null:Eb(e,t)});var Eb;function Ob(e,t){const n=Tb(e,t),i=new Date(n);if(isNaN(i.getTime()))throw new Error(`Invalid date for ${n}`);return i}function Db(e,t,n){return function(e,t){return vb(bb(e,"data")[t],t)}(e,t).map((e=>n(e)))}class jb{constructor(e,t,n){this.credentials={uuid:e},this.hmac=t,this.userId=n}toJson(){return Object.assign({credentials:this.credentials,hmac:this.hmac},this.userId&&{userId:this.userId})}static fromJson(e){return new jb(Tb(function(e,t){const n=bb(e,"data")[t];return void 0===n?null:n}(e,"credentials"),"uuid"),Tb(e,"hmac"),Pb(e,"userId")||void 0)}}class Ib{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}getCredentials(){return this._apiClient.request("/devices",{method:"post"}).then((({data:e})=>jb.fromJson(e))).catch((e=>{if(e.response&&404===e.response.status)return null;throw e}))}}class Mb{constructor(e,t){this._key=e,this._chromeStorage=t}loadOrDefault(e){return new Promise((t=>{this._chromeStorage.get(this._key,(n=>{t(n[this._key]||e)}))}))}save(e){return new Promise((t=>{this._chromeStorage.set({[this._key]:e},(()=>{t()}))}))}}class Lb{constructor(e,t){lb(t,"localStorage"),this._key=hb(e,"key"),this._localStorage=t}loadOrDefault(e){try{const t=this._localStorage.getItem(this._key);if(t)try{return Promise.resolve(JSON.parse(t))}catch(e){}return Promise.resolve(e)}catch(t){return console.warn("Error getting access to storage. Are cookies blocked?",t),Promise.resolve(e)}}save(e){try{return this._localStorage.setItem(this._key,JSON.stringify(e)),Promise.resolve()}catch(e){return console.warn("Error getting access to storage. Are cookies blocked?",e),Promise.reject(e)}}}let Ab;try{Ab=self.localStorage}catch(e){Ab={getItem:()=>{},key:()=>{},setItem:()=>{},removeItem:()=>{},hasOwnProperty:()=>{},length:0}}var Nb=Ab;const Bb="credentials_saved";class Fb extends d{constructor({deviceService:e,credentialsStore:t}){super(),this._deviceService=fb(e,Ib),this._credentialsStore=t}static create({baseUrl:e,storeName:t="CredentialsStorage",storeType:n="localStorage"}){const i=new Ib({apiClient:new Rb({baseUrl:e})});let s=null;if("localStorage"===n)s=new Lb(t,Nb);else{if("chromeStorage"!==n)throw new Error(`Unknown store type: ${n}`);s=new Mb(t,window.chrome.storage.local)}return new Fb({deviceService:i,credentialsStore:s})}_fetchNewCredentialsFromApi(){const e=this._credentialsStore;return new Promise((t=>{const n=()=>{this._deviceService.getCredentials().then((n=>e.save(n?n.toJson():null).then((()=>t(n))))).catch((()=>{setTimeout(n,2e3)}))};n()}))}getCurrentCredentials(){return this._credentialsStore.loadOrDefault(null).then((e=>e?jb.fromJson(e):null))}getCredentials(){return this.credentialsPromise||(this.credentialsPromise=this.getCurrentCredentials().then((e=>e||this._fetchNewCredentialsFromApi()))),this.credentialsPromise}saveCredentials(e){return this.credentialsPromise=void 0,this._credentialsStore.save(e.toJson()).then((()=>(this.emit(Bb,e),e)))}setUserId(e){return this.getCurrentCredentials().then((t=>{t||console.error("Illegal state: no credentials to set user id for.");if(null===t||t.userId!==e)return this._credentialsStore.save(Object.assign({},null==t?void 0:t.toJson(),{userId:e}))})).then((()=>{}))}}const Ub=()=>Promise.resolve(void 0);class zb{constructor({apiClient:e,fetchOrganization:t=Ub}){this._apiClient=fb(e,Rb),m.ok("function"==typeof t,"fetchOrganization<Function> is required"),this._fetchOrganization=t,this._apiClient=e}_callRequestMethod(e,t,n){return hb(t,"url"),m.equal(t[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(n,"options are required"),this._fetchOrganization().then((i=>{if(!i)return this._apiClient[e](t,n);const{organizationId:s}=i;return this._apiClient[e](`/organizations/${encodeURIComponent(s)}${t}`,n)}))}request(e,t){return this._callRequestMethod("request",e,t)}requestMultipart(e,t){return this._callRequestMethod("requestMultipart",e,t)}}class qb{constructor({isExhausted:e,renewsAt:t,totalMinutesLimit:n,totalMinutesUsed:i}){this.isExhausted=e,this.renewsAt=t,this.totalMinutesLimit=n,this.totalMinutesUsed=i}static fromJson(e){return new qb({isExhausted:ub(e.isExhausted,"isExhausted"),renewsAt:new Date(hb(e.renewsAt,"renewsAt")),totalMinutesLimit:mb(e.totalMinutesLimit,"totalMinutesLimit"),totalMinutesUsed:mb(e.totalMinutesUsed,"totalMinutesUsed")})}}class $b{constructor({basePlanId:e,embeddedFreeTierStatus:t,isDeactivated:n,isOnTrial:i,onTrialUntil:s,trialStatus:r}){this.basePlanId=e,this.isDeactivated=n,this.isOnTrial=i,this.onTrialUntil=s||null,this.trialStatus=r||null,this.embeddedFreeTierStatus=t||null}static fromJson(e){return new $b({basePlanId:"string"==typeof e.basePlanId?e.basePlanId:null,isDeactivated:ub(e.isDeactivated,"isDeactivated"),isOnTrial:ub(e.isOnTrial,"isOnTrial"),onTrialUntil:"string"==typeof e.onTrialUntil?new Date(e.onTrialUntil):null,trialStatus:"string"==typeof e.trialStatus?e.trialStatus:null,embeddedFreeTierStatus:e.embeddedFreeTierStatus?qb.fromJson(e.embeddedFreeTierStatus):null})}}function Vb(e){return null!=e}function Hb(e={}){return{maxNumberOfInvitationsAndUsers:Vb(null==e?void 0:e.maxNumberOfInvitationsAndUsers)?Number(null==e?void 0:e.maxNumberOfInvitationsAndUsers):null,maxNumberOfClaimedRooms:Vb(null==e?void 0:e.maxNumberOfClaimedRooms)?Number(null==e?void 0:e.maxNumberOfClaimedRooms):null,maxRoomLimitPerOrganization:Vb(null==e?void 0:e.maxRoomLimitPerOrganization)?Number(null==e?void 0:e.maxRoomLimitPerOrganization):null,trialMinutesLimit:Vb(null==e?void 0:e.trialMinutesLimit)?Number(null==e?void 0:e.trialMinutesLimit):null,includedUnits:Vb(null==e?void 0:e.includedUnits)?Number(null==e?void 0:e.includedUnits):null}}class Wb{constructor(e){this.logoImageUrl=null,this.roomBackgroundImageUrl=null,this.roomBackgroundThumbnailUrl=null,this.roomKnockPageBackgroundImageUrl=null,this.roomKnockPageBackgroundThumbnailUrl=null,this.preferences=null,this.onboardingSurvey=null,this.type=null,fb(e,Object,"properties"),hb(e.organizationId,"organizationId"),hb(e.organizationName,"organizationName"),hb(e.subdomain,"subdomain"),fb(e.permissions,Object,"permissions"),fb(e.limits,Object,"limits"),this.organizationId=e.organizationId,this.organizationName=e.organizationName,this.subdomain=e.subdomain,this.permissions=e.permissions,this.limits=e.limits,this.account=e.account?new $b(e.account):null,this.logoImageUrl=e.logoImageUrl,this.roomBackgroundImageUrl=e.roomBackgroundImageUrl,this.roomBackgroundThumbnailUrl=e.roomBackgroundThumbnailUrl,this.roomKnockPageBackgroundImageUrl=e.roomKnockPageBackgroundImageUrl,this.roomKnockPageBackgroundThumbnailUrl=e.roomKnockPageBackgroundThumbnailUrl,this.preferences=e.preferences,this.onboardingSurvey=e.onboardingSurvey,this.type=e.type}static fromJson(e){const t=fb(e,Object,"data"),n=(null==t?void 0:t.preferences)||{},i=(null==t?void 0:t.onboardingSurvey)||null,s=fb(t.permissions,Object,"permissions");return new Wb({organizationId:hb(t.organizationId,"organizationId"),organizationName:hb(t.organizationName,"organizationName"),subdomain:hb(t.subdomain,"subdomain"),permissions:s,limits:Hb(fb(t.limits,Object,"limits")),account:t.account?$b.fromJson(t.account):null,logoImageUrl:"string"==typeof t.logoImageUrl?t.logoImageUrl:null,roomBackgroundImageUrl:"string"==typeof t.roomBackgroundImageUrl?t.roomBackgroundImageUrl:null,roomBackgroundThumbnailUrl:"string"==typeof t.roomBackgroundThumbnailUrl?t.roomBackgroundThumbnailUrl:null,roomKnockPageBackgroundImageUrl:"string"==typeof t.roomKnockPageBackgroundImageUrl?t.roomKnockPageBackgroundImageUrl:null,roomKnockPageBackgroundThumbnailUrl:"string"==typeof t.roomKnockPageBackgroundThumbnailUrl?t.roomKnockPageBackgroundThumbnailUrl:null,preferences:n,onboardingSurvey:i,type:"string"==typeof t.type?t.type:null})}}Wb.GLOBAL_ORGANIZATION_ID="1";class Gb{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}createOrganization({organizationName:e,subdomain:t,owner:n}){const{displayName:i,consents:s}=n||{},r="email"in n?{value:n.email,verificationCode:hb(n.verificationCode,"owner.verificationCode")}:null,a="idToken"in n?n.idToken:null;if(hb(t,"subdomain"),hb(e,"organizationName"),hb(i,"owner.displayName"),m.ok(r||a,"owner.email or owner.idToken is required"),s){vb(s,"consents");for(const{consentRevisionId:e,action:t}of s)hb(e,"consentRevisionId"),yb(t,"action")}return this._apiClient.request("/organizations",{method:"POST",data:{organizationName:e,type:"private",subdomain:t,owner:Object.assign(Object.assign(Object.assign(Object.assign({},r&&{email:r}),a&&{idToken:a}),s&&{consents:s}),{displayName:i})}}).then((({data:e})=>Tb(e,"organizationId")))}getOrganizationBySubdomain(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/?fields=permissions,account,onboardingSurvey`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationByOrganizationId(e){return hb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}?fields=permissions,account`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationsByContactPoint(e){const{code:t}=e,n="email"in e?e.email:null,i="phoneNumber"in e?e.phoneNumber:null;m.ok((n||i)&&!(n&&i),"either email or phoneNumber is required"),hb(t,"code");const s=n?{type:"email",value:n}:{type:"phoneNumber",value:i};return this._apiClient.request("/organization-queries",{method:"POST",data:{contactPoint:s,code:t}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(e)))))}getOrganizationsByIdToken({idToken:e}){return hb(e,"idToken"),this._apiClient.request("/organization-queries",{method:"POST",data:{idToken:e}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getOrganizationsByLoggedInUser(){return this._apiClient.request("/user/organizations",{method:"GET"}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getSubdomainAvailability(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/availability`,{method:"GET"}).then((({data:e})=>(fb(e,Object,"data"),{status:Tb(e,"status")})))}updatePreferences({organizationId:e,preferences:t}){return lb(e,"organizationId"),lb(t,"preferences"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}deleteOrganization({organizationId:e}){return lb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}`,{method:"DELETE"}).then((()=>{}))}}class Kb{constructor({organizationService:e,subdomain:t}){fb(e,Gb),hb(t,"subdomain"),this._organizationService=e,this._subdomain=t,this._organizationPromise=null}initOrganization(){return this.fetchOrganization().then((()=>{}))}fetchOrganization(){return this._organizationPromise||(this._organizationPromise=this._organizationService.getOrganizationBySubdomain(this._subdomain)),this._organizationPromise}}class Jb{constructor(e={}){m.ok(e instanceof Object,"properties<object> must be empty or an object"),this.isClaimed=!1,this.isBanned=!1,this.isLocked=!1,this.knockPage={backgroundImageUrl:null,backgroundThumbnailUrl:null},this.logoUrl=null,this.backgroundImageUrl=null,this.backgroundThumbnailUrl=null,this.type=null,this.legacyRoomType=null,this.mode=null,this.product=null,this.roomName=null,this.theme=null,this.preferences={},this.protectedPreferences={},this.publicProfile=null;const t={};Object.getOwnPropertyNames(e).forEach((n=>{-1!==Object.getOwnPropertyNames(this).indexOf(n)&&(t[n]=e[n])})),void 0!==e.ownerId&&(this.ownerId=e.ownerId),void 0!==e.meeting&&(this.meeting=e.meeting),Object.assign(this,t)}}class Qb{constructor({meetingId:e,roomName:t,roomUrl:n,startDate:i,endDate:s,hostRoomUrl:r,viewerRoomUrl:a}){hb(e,"meetingId"),hb(t,"roomName"),hb(n,"roomUrl"),fb(i,Date,"startDate"),fb(s,Date,"endDate"),this.meetingId=e,this.roomName=t,this.roomUrl=n,this.startDate=i,this.endDate=s,this.hostRoomUrl=r,this.viewerRoomUrl=a}static fromJson(e){return new Qb({meetingId:Tb(e,"meetingId"),roomName:Tb(e,"roomName"),roomUrl:Tb(e,"roomUrl"),startDate:Ob(e,"startDate"),endDate:Ob(e,"endDate"),hostRoomUrl:Pb(e,"hostRoomUrl"),viewerRoomUrl:Pb(e,"viewerRoomUrl")})}}function Yb(e,t=""){return`/room/${encodeURIComponent(e.substring(1))}${t}`}class Xb{constructor({organizationApiClient:e}){this._organizationApiClient=fb(e,zb)}getRooms({types:e,fields:t=[]}={}){return vb(e,"types"),vb(t,"fields"),this._organizationApiClient.request("/room",{method:"GET",params:{types:e.join(","),fields:t.join(","),includeOnlyLegacyRoomType:"false"}}).then((({data:e})=>e.rooms.map((e=>new Jb(e)))))}getRoom({roomName:e,fields:t}){gb(e);const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/rooms/${n}`,{method:"GET",params:Object.assign({includeOnlyLegacyRoomType:"false"},t&&{fields:t.join(",")})}).then((({data:t})=>new Jb(Object.assign({},t,Object.assign({roomName:e},t.meeting&&{meeting:Qb.fromJson(t.meeting)}))))).catch((t=>{if(404===t.status)return new Jb({roomName:e,isClaimed:!1,mode:"normal",product:{categoryName:"personal_free"},type:"personal",legacyRoomType:"free"});if(400===t.status&&"Banned room"===t.data.error)return new Jb({roomName:e,isBanned:!0});throw new Error(t.data?t.data.error:"Could not fetch room information")}))}claimRoom({roomName:e,type:t,mode:n,isLocked:i}){return gb(e),hb(t,"type"),this._organizationApiClient.request("/room/claim",{method:"POST",data:Object.assign(Object.assign({roomName:e,type:t},"string"==typeof n&&{mode:n}),"boolean"==typeof i&&{isLocked:i})}).then((()=>{})).catch((e=>{throw new Error(e.data.error||"Failed to claim room")}))}unclaimRoom(e){gb(e);const t=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${t}`,{method:"DELETE"}).then((()=>{}))}renameRoom({roomName:e,newRoomName:t}){gb(e),hb(t,"newRoomName");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/roomName`,{method:"PUT",data:{newRoomName:t}}).then((()=>{}))}changeMode({roomName:e,mode:t}){gb(e),hb(t,"mode");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/mode`,{method:"PUT",data:{mode:t}}).then((()=>{}))}updatePreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}updateProtectedPreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/protected-preferences`,{method:"PATCH",data:t}).then((()=>{}))}getRoomPermissions(e,{roomKey:t}={}){return gb(e),this._organizationApiClient.request(Yb(e,"/permissions"),Object.assign({method:"GET"},t&&{headers:{"X-Whereby-Room-Key":t}})).then((e=>{const{permissions:t,limits:n}=e.data;return{permissions:t,limits:n}}))}getRoomMetrics({roomName:e,metrics:t,from:n,to:i}){return gb(e),hb(t,"metrics"),this._organizationApiClient.request(Yb(e,"/metrics"),{method:"GET",params:{metrics:t,from:n,to:i}}).then((e=>e.data))}changeType({roomName:e,type:t}){gb(e),function(e,t,n){if(lb(e,"value"),vb(t,"allowedValues"),!t.includes(e))throw new Error(`${n}<string> must be one of the following: ${t.join(", ")}`)}(t,["personal","personal_xl"],"type");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/type`,{method:"PUT",data:{type:t}}).then((()=>{}))}getForestSocialImage({roomName:e,count:t}){return gb(e),mb(t,"count"),this._organizationApiClient.request(Yb(e,`/forest-social-image/${t}`),{method:"GET"}).then((e=>e.data.imageUrl))}}class Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){this.isLocalParticipant=!1,this.displayName=e,this.id=t,this.stream=n,this.isAudioEnabled=i,this.isVideoEnabled=s}}class ey extends Zb{constructor({displayName:e,id:t,newJoiner:n,streams:i,isAudioEnabled:s,isVideoEnabled:r}){super({displayName:e,id:t,isAudioEnabled:s,isVideoEnabled:r}),this.newJoiner=n,this.streams=i.map((e=>({id:e,state:n?"new_accept":"to_accept"})))}updateStreamState(e,t){const n=this.streams.find((t=>t.id===e));n&&(n.state=t)}}class ty extends Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){super({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}),this.isLocalParticipant=!0}}const ny=["recorder","streamer"];const iy=()=>{},sy=EventTarget;class ry extends sy{constructor(e,{displayName:t,localMediaConstraints:n,localStream:i,logger:s}){super(),this.localParticipant=null,this.remoteParticipants=[],this.roomConnectionState="",this.roomUrl=new URL(e),this.logger=s||{debug:iy,error:iy,log:iy,warn:iy},this.displayName=t,this.localStream=i,this.localMediaConstraints=n;const r=ef({host:this.roomUrl.host});this.credentialsService=Fb.create({baseUrl:"https://api.appearin.net"}),this.apiClient=new Rb({fetchDeviceCredentials:this.credentialsService.getCredentials.bind(this.credentialsService),baseUrl:"https://api.appearin.net"}),this.organizationService=new Gb({apiClient:this.apiClient}),this.organizationServiceCache=new Kb({organizationService:this.organizationService,subdomain:r.subdomain}),this.organizationApiClient=new zb({apiClient:this.apiClient,fetchOrganization:()=>Xt(this,void 0,void 0,(function*(){return(yield this.organizationServiceCache.fetchOrganization())||void 0}))}),this.roomService=new Xb({organizationApiClient:this.organizationApiClient}),this.signalSocket=function(){const e=new URL("wss://signal.appearin.net"),t=`${e.pathname.replace(/^\/$/,"")}/protocol/socket.io/v1`,n=e.origin;return new Go(n,{host:n,path:t,reconnectionDelay:5e3,reconnectionDelayMax:3e4,timeout:1e4})}(),this.signalSocket.on("new_client",this._handleNewClient.bind(this)),this.signalSocket.on("client_left",this._handleClientLeft.bind(this)),this.signalSocket.on("audio_enabled",this._handleClientAudioEnabled.bind(this)),this.signalSocket.on("video_enabled",this._handleClientVideoEnabled.bind(this)),this.signalSocket.on("client_metadata_received",this._handleClientMetadataReceived.bind(this))}_handleNewClient({client:e}){if(ny.includes(e.role.roleName))return;const t=new ey(Object.assign(Object.assign({},e),{newJoiner:!0}));this.remoteParticipants=[...this.remoteParticipants,t],this._handleAcceptStreams([t]),this.dispatchEvent(new CustomEvent("participant_joined",{detail:{remoteParticipant:t}}))}_handleClientLeft({clientId:e}){const t=this.remoteParticipants.find((t=>t.id===e));this.remoteParticipants=this.remoteParticipants.filter((t=>t.id!==e)),t&&this.dispatchEvent(new CustomEvent("participant_left",{detail:{participantId:t.id}}))}_handleClientAudioEnabled({clientId:e,isAudioEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_audio_enabled",{detail:{participantId:n.id,isAudioEnabled:t}}))}_handleClientVideoEnabled({clientId:e,isVideoEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_video_enabled",{detail:{participantId:n.id,isVideoEnabled:t}}))}_handleClientMetadataReceived({payload:{clientId:e,displayName:t}}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_metadata_changed",{detail:{participantId:n.id,displayName:t}}))}_handleRtcEvent(e,t){return"rtc_manager_created"===e?this._handleRtcManagerCreated(t):"stream_added"===e?this._handleStreamAdded(t):void this.logger.log(`Unhandled RTC event ${e}`)}_handleRtcManagerCreated({rtcManager:e}){var t,n,i;this.rtcManager=e,this.localStream&&(null===(t=this.rtcManager)||void 0===t||t.addNewStream("0",this.localStream,!(null===(n=this.localStream)||void 0===n?void 0:n.getAudioTracks().find((e=>e.enabled))),!(null===(i=this.localStream)||void 0===i?void 0:i.getVideoTracks().find((e=>e.enabled)))))}_handleAcceptStreams(e){var t,n;if(!this.rtcManager)return void this.logger.log("Unable to accept streams, no rtc manager");const i=null===(n=(t=this.rtcManager).shouldAcceptStreamsFromBothSides)||void 0===n?void 0:n.call(t);e.forEach((e=>{const{id:t,streams:n,newJoiner:s}=e;n.forEach((n=>{var r,a;const{id:o,state:c}=n;let p;if("done_accept"!==c&&(p=(s&&"0"===o?"new":"to")+"_accept"),p){if("to_accept"===p||"new_accept"===p&&i||"old_accept"===p&&!i)this.logger.log(`Accepting stream ${o} from ${t}`),null===(r=this.rtcManager)||void 0===r||r.acceptNewStream({streamId:"0"===o?t:o,clientId:t,shouldAddLocalVideo:"0"===o,activeBreakout:false});else if("new_accept"===p||"old_accept"===p);else if("to_unaccept"===p)this.logger.log(`Disconnecting stream ${o} from ${t}`),null===(a=this.rtcManager)||void 0===a||a.disconnect("0"===o?t:o,false);else if("done_accept"!==p)return void this.logger.warn(`Stream state not handled: ${p} for ${t}-${o}`);e.updateStreamState(o,c.replace(/to_|new_|old_/,"done_"))}}))}))}_handleStreamAdded({clientId:e,stream:t,streamId:n}){this.remoteParticipants.find((t=>t.id===e))?this.dispatchEvent(new CustomEvent("participant_stream_added",{detail:{participantId:e,stream:t,streamId:n}})):this.logger.log("WARN: Could not find participant for incoming stream")}join(){return Xt(this,void 0,void 0,(function*(){if(["connected","connecting"].includes(this.roomConnectionState))return void console.warn(`Trying to join room state is ${this.roomConnectionState}`);if(this.logger.log("Joining room"),this.roomConnectionState="connecting",!this.localStream&&this.localMediaConstraints){const e=yield navigator.mediaDevices.getUserMedia(this.localMediaConstraints);this.localStream=e}const e=yield this.organizationServiceCache.fetchOrganization();if(!e)throw new Error("Invalid room url");const t={getMediaConstraints:()=>{var e,t;return{audio:!!(null===(e=this.localStream)||void 0===e?void 0:e.getAudioTracks().find((e=>e.enabled))),video:!!(null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks().find((e=>e.enabled)))}},deferrable:e=>!e};this.rtcManagerDispatcher=new Xh({emitter:{emit:this._handleRtcEvent.bind(this)},serverSocket:this.signalSocket,webrtcProvider:t,features:{lowDataModeEnabled:!1,sfuServerOverrideHost:void 0,turnServerOverrideHost:void 0,useOnlyTURN:void 0,vp9On:!1,h264On:!1,simulcastScreenshareOn:!1}});const n=yield this.credentialsService.getCredentials();setTimeout((()=>{this.logger.log("Connected to signal socket"),this.signalSocket.emit("identify_device",{deviceCredentials:n})}),2e3),this.signalSocket.once("device_identified",(()=>{var t,n;this.signalSocket.emit("join_room",{avatarUrl:null,config:{isAudioEnabled:!!(null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks().find((e=>e.enabled))),isVideoEnabled:!!(null===(n=this.localStream)||void 0===n?void 0:n.getVideoTracks().find((e=>e.enabled)))},deviceCapabilities:{canScreenshare:!0},displayName:this.displayName,isCoLocated:!1,isDevicePermissionDenied:!1,kickFromOtherRooms:!1,organizationId:e.organizationId,roomKey:null,roomName:this.roomUrl.pathname,selfId:""})})),this.signalSocket.once("room_joined",(e=>{const{selfId:t,room:{clients:n}}=e,i=n.find((e=>e.id===t));if(!i)throw new Error("Missing local client");this.localParticipant=new ty(Object.assign(Object.assign({},i),{stream:this.localStream})),this.remoteParticipants=n.filter((e=>e.id!==t)).map((e=>new ey(Object.assign(Object.assign({},e),{newJoiner:!1})))),this.rtcManager&&this._handleAcceptStreams(this.remoteParticipants),this.roomConnectionState="connected",this.dispatchEvent(new CustomEvent("room_joined",{detail:{localParticipant:this.localParticipant,remoteParticipants:this.remoteParticipants}}))}))}))}leave(){return new Promise((e=>{if(!this.signalSocket)return e();this.signalSocket.emit("leave_room");const t=setTimeout((()=>{e()}),200);this.signalSocket.once("room_left",(()=>{clearTimeout(t),this.signalSocket.disconnect(),e()}))}))}toggleCamera(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing video track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_video",{enabled:i})}toggleMicrophone(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing audio track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_audio",{enabled:i})}setDisplayName(e){this.signalSocket.emit("send_client_metadata",{type:"UserData",payload:{displayName:e}})}}function ay(e,t,n){const i=e.find((e=>e.id===t));if(!i)return e;const s=e.indexOf(i);return[...e.slice(0,s),Object.assign(Object.assign({},i),n),...e.slice(s+1)]}function oy(e,t){switch(t.type){case"ROOM_JOINED":return Object.assign(Object.assign({},e),{localParticipant:t.payload.localParticipant,remoteParticipants:t.payload.remoteParticipants,roomConnectionStatus:"connected"});case"PARTICIPANT_AUDIO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isAudioEnabled:t.payload.isAudioEnabled})});case"PARTICIPANT_JOINED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants,t.payload.paritipant]});case"PARTICIPANT_LEFT":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.filter((e=>e.id!==t.payload.participantId))]});case"PARTICIPANT_STREAM_ADDED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{stream:t.payload.stream})});case"PARTICIPANT_VIDEO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isVideoEnabled:t.payload.isVideoEnabled})});case"PARTICIPANT_METADATA_CHANGED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.map((e=>e.id===t.payload.participantId?Object.assign(Object.assign({},e),{displayName:t.payload.displayName}):e))]});case"LOCAL_CLIENT_DISPLAY_NAME_CHANGED":return e.localParticipant?Object.assign(Object.assign({},e),{localParticipant:Object.assign(Object.assign({},e.localParticipant),{displayName:t.payload.displayName})}):e;default:throw e}}function cy(e,t){const[n,i]=sn.useState(null),[s,r]=sn.useReducer(oy,{remoteParticipants:[]});return sn.useEffect((()=>{i(new ry(e,t))}),[e]),sn.useEffect((()=>{if(n)return n.addEventListener("participant_audio_enabled",(e=>{const{participantId:t,isAudioEnabled:n}=e.detail;r({type:"PARTICIPANT_AUDIO_ENABLED",payload:{participantId:t,isAudioEnabled:n}})})),n.addEventListener("participant_joined",(e=>{const{remoteParticipant:t}=e.detail;r({type:"PARTICIPANT_JOINED",payload:{paritipant:t}})})),n.addEventListener("participant_left",(e=>{const{participantId:t}=e.detail;r({type:"PARTICIPANT_LEFT",payload:{participantId:t}})})),n.addEventListener("participant_stream_added",(e=>{const{participantId:t,stream:n}=e.detail;r({type:"PARTICIPANT_STREAM_ADDED",payload:{participantId:t,stream:n}})})),n.addEventListener("room_joined",(e=>{const{localParticipant:t,remoteParticipants:n}=e.detail;r({type:"ROOM_JOINED",payload:{localParticipant:t,remoteParticipants:n}})})),n.addEventListener("participant_video_enabled",(e=>{const{participantId:t,isVideoEnabled:n}=e.detail;r({type:"PARTICIPANT_VIDEO_ENABLED",payload:{participantId:t,isVideoEnabled:n}})})),n.addEventListener("participant_metadata_changed",(e=>{const{participantId:t,displayName:n}=e.detail;r({type:"PARTICIPANT_METADATA_CHANGED",payload:{participantId:t,displayName:n}})})),n.join(),()=>{n.leave()}}),[n]),[s,{toggleCamera:e=>{null==n||n.toggleCamera(e)},toggleMicrophone:e=>{null==n||n.toggleMicrophone(e)},setDisplayName:e=>{null==n||n.setDisplayName(e),r({type:"LOCAL_CLIENT_DISPLAY_NAME_CHANGED",payload:{displayName:e}})}},{VideoView:mn}]}const py="2.0.0-alpha3";export{py as sdkVersion,cy as useRoomConnection};
105
+ function(e){var t=Hf,n=f.extname,i=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;function r(e){if(!e||"string"!=typeof e)return!1;var n=i.exec(e),r=n&&t[n[1].toLowerCase()];return r&&r.charset?r.charset:!(!n||!s.test(n[1]))&&"UTF-8"}e.charset=r,e.charsets={lookup:r},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=i.exec(t),s=n&&e.extensions[n[1].toLowerCase()];if(!s||!s.length)return!1;return s[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=n("x."+t).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),function(e,n){var i=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(s){var r=t[s],a=r.extensions;if(a&&a.length){e[s]=a;for(var o=0;o<a.length;o++){var c=a[o];if(n[c]){var p=i.indexOf(t[n[c]].source),d=i.indexOf(r.source);if("application/octet-stream"!==n[c]&&(p>d||p===d&&"application/"===n[c].substr(0,12)))continue}n[c]=s}}}))}(e.extensions,e.types)}(Vf);var Gf=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},Kf=function(e){var t=!1;return Gf((function(){t=!0})),function(n,i){t?e(n,i):Gf((function(){e(n,i)}))}};var Jf=function(e){Object.keys(e.jobs).forEach(Qf.bind(e)),e.jobs={}};function Qf(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Yf=Kf,Xf=Jf,Zf=function(e,t,n,i){var s=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[s]=function(e,t,n,i){var s;s=2==e.length?e(n,Yf(i)):e(n,t,Yf(i));return s}(t,s,e[s],(function(e,t){s in n.jobs&&(delete n.jobs[s],e?Xf(n):n.results[s]=t,i(e,n.results))}))};var eg=function(e,t){var n=!Array.isArray(e),i={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};t&&i.keyedList.sort(n?t:function(n,i){return t(e[n],e[i])});return i};var tg=Jf,ng=Kf,ig=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,tg(this),ng(e)(null,this.results)};var sg=Zf,rg=eg,ag=ig,og=function(e,t,n){var i=rg(e);for(;i.index<(i.keyedList||e).length;)sg(e,t,i,(function(e,t){e?n(e,t):0!==Object.keys(i.jobs).length||n(null,i.results)})),i.index++;return ag.bind(i,n)};var cg={},pg=Zf,dg=eg,lg=ig;function ug(e,t){return e<t?-1:e>t?1:0}({get exports(){return cg},set exports(e){cg=e}}).exports=function(e,t,n,i){var s=dg(e,n);return pg(e,t,s,(function n(r,a){r?i(r,a):(s.index++,s.index<(s.keyedList||e).length?pg(e,t,s,n):i(null,s.results))})),lg.bind(s,i)},cg.ascending=ug,cg.descending=function(e,t){return-1*ug(e,t)};var mg=cg;var hg={parallel:og,serial:function(e,t,n){return mg(e,t,null,n)},serialOrdered:cg},fg=qf,gg=t,vg=f,bg=a,yg=o,_g=s.parse,xg=n,wg=p.Stream,Sg=Vf,kg=hg,Cg=function(e,t){return Object.keys(t).forEach((function(n){e[n]=e[n]||t[n]})),e},Rg=Tg;function Tg(e){if(!(this instanceof Tg))return new Tg(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fg.call(this),e=e||{})this[t]=e[t]}function Pg(e){return jf.isPlainObject(e)||jf.isArray(e)}function Eg(e){return jf.endsWith(e,"[]")?e.slice(0,-2):e}function Og(e,t,n){return e?e.concat(t).map((function(e,t){return e=Eg(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}gg.inherits(Tg,fg),Tg.LINE_BREAK="\r\n",Tg.DEFAULT_CONTENT_TYPE="application/octet-stream",Tg.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var i=fg.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),gg.isArray(t))this._error(new Error("Arrays are not supported."));else{var s=this._multiPartHeader(e,t,n),r=this._multiPartFooter();i(s),i(t),i(r),this._trackLength(s,t,n)}},Tg.prototype._trackLength=function(e,t,n){var i=0;null!=n.knownLength?i+=+n.knownLength:Buffer.isBuffer(t)?i=t.length:"string"==typeof t&&(i=Buffer.byteLength(t)),this._valueLength+=i,this._overheadLength+=Buffer.byteLength(e)+Tg.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion")||t instanceof wg)&&(n.knownLength||this._valuesToMeasure.push(t))},Tg.prototype._lengthRetriever=function(e,t){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):xg.stat(e.path,(function(n,i){var s;n?t(n):(s=i.size-(e.start?e.start:0),t(null,s))})):e.hasOwnProperty("httpVersion")?t(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(n){e.pause(),t(null,+n.headers["content-length"])})),e.resume()):t("Unknown stream")},Tg.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var i,s=this._getContentDisposition(t,n),r=this._getContentType(t,n),a="",o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(s||[]),"Content-Type":[].concat(r||[])};for(var c in"object"==typeof n.header&&Cg(o,n.header),o)o.hasOwnProperty(c)&&null!=(i=o[c])&&(Array.isArray(i)||(i=[i]),i.length&&(a+=c+": "+i.join("; ")+Tg.LINE_BREAK));return"--"+this.getBoundary()+Tg.LINE_BREAK+a+Tg.LINE_BREAK},Tg.prototype._getContentDisposition=function(e,t){var n,i;return"string"==typeof t.filepath?n=vg.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e.name||e.path?n=vg.basename(t.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(n=vg.basename(e.client._httpMessage.path||"")),n&&(i='filename="'+n+'"'),i},Tg.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e.name&&(n=Sg.lookup(e.name)),!n&&e.path&&(n=Sg.lookup(e.path)),!n&&e.readable&&e.hasOwnProperty("httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=Sg.lookup(t.filepath||t.filename)),n||"object"!=typeof e||(n=Tg.DEFAULT_CONTENT_TYPE),n},Tg.prototype._multiPartFooter=function(){return function(e){var t=Tg.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Tg.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Tg.LINE_BREAK},Tg.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)e.hasOwnProperty(t)&&(n[t.toLowerCase()]=e[t]);return n},Tg.prototype.setBoundary=function(e){this._boundary=e},Tg.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Tg.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,i=this._streams.length;n<i;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Tg.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Tg.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;t<24;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Tg.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Tg.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Tg.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?kg.parallel(this._valuesToMeasure,this._lengthRetriever,(function(n,i){n?e(n):(i.forEach((function(e){t+=e})),e(null,t))})):process.nextTick(e.bind(this,null,t))},Tg.prototype.submit=function(e,t){var n,i,s={method:"post"};return"string"==typeof e?(e=_g(e),i=Cg({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},s)):(i=Cg(e,s)).port||(i.port="https:"==i.protocol?443:80),i.headers=this.getHeaders(e.headers),n="https:"==i.protocol?yg.request(i):bg.request(i),this.getLength(function(e,i){if(e&&"Unknown stream"!==e)this._error(e);else if(i&&n.setHeader("Content-Length",i),this.pipe(n),t){var s,r=function(e,i){return n.removeListener("error",r),n.removeListener("response",s),t.call(this,e,i)};s=r.bind(this,null),n.on("error",r),n.on("response",s)}}.bind(this)),n},Tg.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Tg.prototype.toString=function(){return"[object FormData]"};const Dg=jf.toFlatObject(jf,{},null,(function(e){return/^is[A-Z]/.test(e)}));function jg(e,t,n){if(!jf.isObject(e))throw new TypeError("target must be an object");t=t||new(Rg||FormData);const i=(n=jf.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jf.isUndefined(t[e])}))).metaTokens,s=n.visitor||d,r=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((c=t)&&jf.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!jf.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(jf.isDate(e))return e.toISOString();if(!o&&jf.isBlob(e))throw new If("Blob is not supported. Use a Buffer instead.");return jf.isArrayBuffer(e)||jf.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(jf.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(jf.isArray(e)&&function(e){return jf.isArray(e)&&!e.some(Pg)}(e)||jf.isFileList(e)||jf.endsWith(n,"[]")&&(o=jf.toArray(e)))return n=Eg(n),o.forEach((function(e,i){!jf.isUndefined(e)&&null!==e&&t.append(!0===a?Og([n],i,r):null===a?n:n+"[]",p(e))})),!1;return!!Pg(e)||(t.append(Og(s,n,r),p(e)),!1)}const l=[],u=Object.assign(Dg,{defaultVisitor:d,convertValue:p,isVisitable:Pg});if(!jf.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!jf.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+i.join("."));l.push(n),jf.forEach(n,(function(n,r){!0===(!(jf.isUndefined(n)||null===n)&&s.call(t,n,jf.isString(r)?r.trim():r,i,u))&&e(n,i?i.concat(r):[r])})),l.pop()}}(e),t}function Ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Mg(e,t){this._pairs=[],e&&jg(e,this,t)}const Lg=Mg.prototype;function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ng(e,t,n){if(!t)return e;const i=n&&n.encode||Ag,s=n&&n.serialize;let r;if(r=s?s(t,n):jf.isURLSearchParams(t)?t.toString():new Mg(t,n).toString(i),r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Lg.append=function(e,t){this._pairs.push([e,t])},Lg.toString=function(e){const t=e?function(t){return e.call(this,t,Ig)}:Ig;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Bg{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jf.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Fg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ug={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Rg,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function zg(e){function t(e,n,i,s){let r=e[s++];const a=Number.isFinite(+r),o=s>=e.length;if(r=!r&&jf.isArray(i)?i.length:r,o)return jf.hasOwnProp(i,r)?i[r]=[i[r],n]:i[r]=n,!a;i[r]&&jf.isObject(i[r])||(i[r]=[]);return t(e,n,i[r],s)&&jf.isArray(i[r])&&(i[r]=function(e){const t={},n=Object.keys(e);let i;const s=n.length;let r;for(i=0;i<s;i++)r=n[i],t[r]=e[r];return t}(i[r])),!a}if(jf.isFormData(e)&&jf.isFunction(e.entries)){const n={};return jf.forEachEntry(e,((e,i)=>{t(function(e){return jf.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,n,0)})),n}return null}const qg={"Content-Type":void 0};const $g={transitional:Fg,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=jf.isObject(e);s&&jf.isHTMLForm(e)&&(e=new FormData(e));if(jf.isFormData(e))return i&&i?JSON.stringify(zg(e)):e;if(jf.isArrayBuffer(e)||jf.isBuffer(e)||jf.isStream(e)||jf.isFile(e)||jf.isBlob(e))return e;if(jf.isArrayBufferView(e))return e.buffer;if(jf.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return jg(e,new Ug.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return jf.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=jf.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return jg(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),function(e,t,n){if(jf.isString(e))try{return(t||JSON.parse)(e),jf.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&jf.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw If.from(e,If.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ug.classes.FormData,Blob:Ug.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};jf.forEach(["delete","get","head"],(function(e){$g.headers[e]={}})),jf.forEach(["post","put","patch"],(function(e){$g.headers[e]=jf.merge(qg)}));const Vg=jf.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Hg=Symbol("internals");function Wg(e){return e&&String(e).trim().toLowerCase()}function Gg(e){return!1===e||null==e?e:jf.isArray(e)?e.map(Gg):String(e)}function Kg(e,t,n,i){return jf.isFunction(i)?i.call(this,t,n):jf.isString(t)?jf.isString(i)?-1!==t.indexOf(i):jf.isRegExp(i)?i.test(t):void 0:void 0}class Jg{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(e,t,n){const s=Wg(t);if(!s)throw new Error("header name must be a non-empty string");const r=jf.findKey(i,s);(!r||void 0===i[r]||!0===n||void 0===n&&!1!==i[r])&&(i[r||t]=Gg(e))}const r=(e,t)=>jf.forEach(e,((e,n)=>s(e,n,t)));return jf.isPlainObject(e)||e instanceof this.constructor?r(e,t):jf.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?r((e=>{const t={};let n,i,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),i=e.substring(s+1).trim(),!n||t[n]&&Vg[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)})),t})(e),t):null!=e&&s(t,e,n),this}get(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(jf.isFunction(t))return t.call(this,e,n);if(jf.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wg(e)){const n=jf.findKey(this,e);return!(!n||t&&!Kg(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function s(e){if(e=Wg(e)){const s=jf.findKey(n,e);!s||t&&!Kg(0,n[s],s,t)||(delete n[s],i=!0)}}return jf.isArray(e)?e.forEach(s):s(e),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return jf.forEach(this,((i,s)=>{const r=jf.findKey(n,s);if(r)return t[r]=Gg(i),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Gg(i),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jf.forEach(this,((n,i)=>{null!=n&&!1!==n&&(t[i]=e&&jf.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Hg]=this[Hg]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Wg(e);t[i]||(!function(e,t){const n=jf.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+n,{value:function(e,n,s){return this[i].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[i]=!0)}return jf.isArray(e)?e.forEach(i):i(e),this}}function Qg(e,t){const n=this||$g,i=t||n,s=Jg.from(i.headers);let r=i.data;return jf.forEach(e,(function(e){r=e.call(n,r,s.normalize(),t?t.status:void 0)})),s.normalize(),r}function Yg(e){return!(!e||!e.__CANCEL__)}function Xg(e,t,n){If.call(this,null==e?"canceled":e,If.ERR_CANCELED,t,n),this.name="CanceledError"}function Zg(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new If("Request failed with status code "+n.status,[If.ERR_BAD_REQUEST,If.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function ev(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}Jg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),jf.freezeMethods(Jg.prototype),jf.freezeMethods(Jg),jf.inherits(Xg,If,{__CANCEL__:!0});var tv=s.parse,nv={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},iv=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function sv(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var rv,av=function(e){var t="string"==typeof e?tv(e):e||{},n=t.protocol,i=t.host,s=t.port;if("string"!=typeof i||!i||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=(sv("npm_config_no_proxy")||sv("no_proxy")).toLowerCase();if(!n)return!0;if("*"===n)return!1;return n.split(/[,\s]/).every((function(n){if(!n)return!0;var i=n.match(/^(.+):(\d+)$/),s=i?i[1]:n,r=i?parseInt(i[2]):0;return!(!r||r===t)||(/^[.*]/.test(s)?("*"===s.charAt(0)&&(s=s.slice(1)),!iv.call(e,s)):e!==s)}))}(i=i.replace(/:\d*$/,""),s=parseInt(s)||nv[n]||0))return"";var r=sv("npm_config_"+n+"_proxy")||sv(n+"_proxy")||sv("npm_config_proxy")||sv("all_proxy");return r&&-1===r.indexOf("://")&&(r=n+"://"+r),r},ov={},cv={get exports(){return ov},set exports(e){ov=e}},pv=s,dv=pv.URL,lv=a,uv=o,mv=p.Writable,hv=m,fv=function(){if(!rv){try{rv=gc("follow-redirects")}catch(e){}"function"!=typeof rv&&(rv=function(){})}rv.apply(null,arguments)},gv=["abort","aborted","connect","error","socket","timeout"],vv=Object.create(null);gv.forEach((function(e){vv[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}}));var bv=Pv("ERR_INVALID_URL","Invalid URL",TypeError),yv=Pv("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),_v=Pv("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),xv=Pv("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),wv=Pv("ERR_STREAM_WRITE_AFTER_END","write after end");function Sv(e,t){mv.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function kv(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(i){var s=i+":",r=n[s]=e[i],a=t[i]=Object.create(r);Object.defineProperties(a,{request:{value:function(e,i,r){if(Ov(e)){var a;try{a=Rv(new dv(e))}catch(t){a=pv.parse(e)}if(!Ov(a.protocol))throw new bv({input:e});e=a}else dv&&e instanceof dv?e=Rv(e):(r=i,i=e,e={protocol:s});return Dv(i)&&(r=i,i=null),(i=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,i)).nativeProtocols=n,Ov(i.host)||Ov(i.hostname)||(i.hostname="::1"),hv.equal(i.protocol,s,"protocol mismatch"),fv("options",i),new Sv(i,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var i=a.request(e,t,n);return i.end(),i},configurable:!0,enumerable:!0,writable:!0}})})),t}function Cv(){}function Rv(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function Tv(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return null==n?void 0:String(n).trim()}function Pv(e,t,n){function i(n){Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i}function Ev(e){for(var t of gv)e.removeListener(t,vv[t]);e.on("error",Cv),e.abort()}function Ov(e){return"string"==typeof e||e instanceof String}function Dv(e){return"function"==typeof e}Sv.prototype=Object.create(mv.prototype),Sv.prototype.abort=function(){Ev(this._currentRequest),this.emit("abort")},Sv.prototype.write=function(e,t,n){if(this._ending)throw new wv;if(!Ov(e)&&("object"!=typeof(i=e)||!("length"in i)))throw new TypeError("data should be a string, Buffer or Uint8Array");var i;Dv(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new xv),this.abort()):n&&n()},Sv.prototype.end=function(e,t,n){if(Dv(e)?(n=e,e=t=null):Dv(t)&&(n=t,t=null),e){var i=this,s=this._currentRequest;this.write(e,t,(function(){i._ended=!0,s.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Sv.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Sv.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Sv.prototype.setTimeout=function(e,t){var n=this;function i(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function s(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),r()}),e),i(t)}function r(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",r),n.removeListener("error",r),n.removeListener("response",r),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",s)}return t&&this.on("timeout",t),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",i),this.on("abort",r),this.on("error",r),this.on("response",r),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){Sv.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(Sv.prototype,e,{get:function(){return this._currentRequest[e]}})})),Sv.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Sv.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(t){if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var s of(i._redirectable=this,gv))i.on(s,vv[s]);if(this._currentUrl=/^\//.test(this._options.path)?pv.format(this._options):this._options.path,this._isRedirect){var r=0,a=this,o=this._requestBodyBuffers;!function e(t){if(i===a._currentRequest)if(t)a.emit("error",t);else if(r<o.length){var n=o[r++];i.finished||i.write(n.data,n.encoding,e)}else a._ended&&i.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},Sv.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ev(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new _v);else{var i,s=this._options.beforeRedirect;s&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var r=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Tv(/^content-/i,this._options.headers));var a,o=Tv(/^host$/i,this._options.headers),c=pv.parse(this._currentUrl),p=o||c.host,d=/^\w+:/.test(n)?this._currentUrl:pv.format(Object.assign(c,{host:p}));try{a=pv.resolve(d,n)}catch(e){return void this.emit("error",new yv({cause:e}))}fv("redirecting to",a),this._isRedirect=!0;var l=pv.parse(a);if(Object.assign(this._options,l),(l.protocol!==c.protocol&&"https:"!==l.protocol||l.host!==p&&!function(e,t){hv(Ov(e)&&Ov(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(l.host,p))&&Tv(/^(?:authorization|cookie)$/i,this._options.headers),Dv(s)){var u={headers:e.headers,statusCode:t},m={url:d,method:r,headers:i};try{s(this._options,u,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new yv({cause:e}))}}},cv.exports=kv({http:lv,https:uv}),ov.wrap=kv;function jv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Iv=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Mv(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s,r=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),p=i[a];s||(s=c),n[r]=o,i[r]=c;let d=a,l=0;for(;d!==r;)l+=n[d++],d%=e;if(r=(r+1)%e,r===a&&(a=(a+1)%e),c-s<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}const Lv=Symbol("internals");class Av extends p.Transform{constructor(e){super({readableHighWaterMark:(e=jf.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!jf.isUndefined(t[e])))).chunkSize});const t=this,n=this[Lv]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=Mv(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let s=0;n.updateProgress=function(e,t){let n=0;const i=1e3/t;let s=null;return function(t,r){const a=Date.now();if(t||a-n>i)return s&&(clearTimeout(s),s=null),n=a,e.apply(null,r);s||(s=setTimeout((()=>(s=null,n=Date.now(),e.apply(null,r))),i-(a-n)))}}((function(){const e=n.length,r=n.bytesSeen,a=r-s;if(!a||t.destroyed)return;const o=i(a);s=r,process.nextTick((()=>{t.emit("progress",{loaded:r,total:e,progress:e?r/e:void 0,bytes:a,rate:o||void 0,estimated:o&&e&&r<=e?(e-r)/o:void 0})}))}),n.ticksRate);const r=()=>{n.updateProgress(!0)};this.once("end",r),this.once("error",r)}_read(e){const t=this[Lv];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const i=this,s=this[Lv],r=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,c=r/(1e3/o),p=!1!==s.minChunkSize?Math.max(s.minChunkSize,.01*c):0;const d=(e,t)=>{const n=Buffer.byteLength(e);let d,l=null,u=a,m=0;if(r){const e=Date.now();(!s.ts||(m=e-s.ts)>=o)&&(s.ts=e,d=c-s.bytes,s.bytes=d<0?-d:0,m=0),d=c-s.bytes}if(r){if(d<=0)return setTimeout((()=>{t(null,e)}),o-m);d<u&&(u=d)}u&&n>u&&n-u>p&&(l=e.subarray(u),e=e.subarray(0,u)),function(e,t){const n=Buffer.byteLength(e);s.bytesSeen+=n,s.bytes+=n,s.isCaptured&&s.updateProgress(),i.push(e)?process.nextTick(t):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(t)}}(e,l?()=>{process.nextTick(t,null,l)}:t)};d(e,(function e(t,i){if(t)return n(t);i?d(i,e):n(null)}))}setLength(e){return this[Lv].length=+e,this}}const Nv={flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH},Bv={flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH},Fv=jf.isFunction(u.createBrotliDecompress),{http:Uv,https:zv}=ov,qv=/https:?/,$v=Ug.protocols.map((e=>e+":"));function Vv(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Hv(e,t,n){let i=t;if(!i&&!1!==i){const e=av(n);e&&(i=new URL(e))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));const t=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=i.hostname||i.host;e.hostname=t,e.host=t,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(e){Hv(e,t,e.href)}}var Wv="undefined"!=typeof process&&"process"===jf.kindOf(process)&&function(e){return new Promise((function(t,n){let i=e.data;const s=e.responseType,r=e.responseEncoding,c=e.method.toUpperCase();let l,m,h,f=!1;const g=new d;function v(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(x),e.signal&&e.signal.removeEventListener("abort",x),g.removeAllListeners())}function b(e,i){m||(m=!0,i&&(f=!0,v()),i?n(e):t(e))}const y=function(e){b(e)},_=function(e){b(e,!0)};function x(t){g.emit("abort",!t||t.type?new Xg(null,e,h):t)}g.once("abort",_),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(x),e.signal&&(e.signal.aborted?x():e.signal.addEventListener("abort",x)));const w=ev(e.baseURL,e.url),S=new URL(w),k=S.protocol||$v[0];if("data:"===k){let t;if("GET"!==c)return Zg(y,_,{status:405,statusText:"method not allowed",headers:{},config:e});try{t=function(e,t,n){const i=n&&n.Blob||Ug.classes.Blob,s=jv(e);if(void 0===t&&i&&(t=!0),"data"===s){e=s.length?e.slice(s.length+1):e;const n=Iv.exec(e);if(!n)throw new If("Invalid URL",If.ERR_INVALID_URL);const r=n[1],a=n[2],o=n[3],c=Buffer.from(decodeURIComponent(o),a?"base64":"utf8");if(t){if(!i)throw new If("Blob is not supported",If.ERR_NOT_SUPPORT);return new i([c],{type:r})}return c}throw new If("Unsupported protocol "+s,If.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(t){throw If.from(t,If.ERR_BAD_REQUEST,e)}return"text"===s?(t=t.toString(r),r&&"utf8"!==r||(i=jf.stripBOM(t))):"stream"===s&&(t=p.Readable.from(t)),Zg(y,_,{data:t,status:200,statusText:"OK",headers:new Jg,config:e})}if(-1===$v.indexOf(k))return _(new If("Unsupported protocol "+k,If.ERR_BAD_REQUEST,e));const C=Jg.from(e.headers).normalize();C.set("User-Agent","axios/1.2.3",!1);const R=e.onDownloadProgress,T=e.onUploadProgress,P=e.maxRate;let E,O;if(jf.isFormData(i)&&jf.isFunction(i.getHeaders))C.set(i.getHeaders());else if(i&&!jf.isStream(i)){if(Buffer.isBuffer(i));else if(jf.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!jf.isString(i))return _(new If("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",If.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(C.set("Content-Length",i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return _(new If("Request body larger than maxBodyLength limit",If.ERR_BAD_REQUEST,e))}const D=jf.toFiniteNumber(C.getContentLength());let j,I;if(jf.isArray(P)?(E=P[0],O=P[1]):E=O=P,i&&(T||E)&&(jf.isStream(i)||(i=p.Readable.from(i,{objectMode:!1})),i=p.pipeline([i,new Av({length:D,maxRate:jf.toFiniteNumber(E)})],jf.noop),T&&i.on("progress",(e=>{T(Object.assign(e,{upload:!0}))}))),e.auth){j=(e.auth.username||"")+":"+(e.auth.password||"")}if(!j&&S.username){j=S.username+":"+S.password}j&&C.delete("authorization");try{I=Ng(S.pathname+S.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,_(n)}C.set("Accept-Encoding","gzip, compress, deflate"+(Fv?", br":""),!1);const M={path:I,method:c,headers:C.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:j,protocol:k,beforeRedirect:Vv,beforeRedirects:{}};let L;e.socketPath?M.socketPath=e.socketPath:(M.hostname=S.hostname,M.port=S.port,Hv(M,e.proxy,k+"//"+S.hostname+(S.port?":"+S.port:"")+M.path));const A=qv.test(M.protocol);if(M.agent=A?e.httpsAgent:e.httpAgent,e.transport?L=e.transport:0===e.maxRedirects?L=A?o:a:(e.maxRedirects&&(M.maxRedirects=e.maxRedirects),e.beforeRedirect&&(M.beforeRedirects.config=e.beforeRedirect),L=A?zv:Uv),e.maxBodyLength>-1?M.maxBodyLength=e.maxBodyLength:M.maxBodyLength=1/0,e.insecureHTTPParser&&(M.insecureHTTPParser=e.insecureHTTPParser),h=L.request(M,(function(t){if(h.destroyed)return;const n=[t],i=+t.headers["content-length"];if(R){const e=new Av({length:jf.toFiniteNumber(i),maxRate:jf.toFiniteNumber(O)});R&&e.on("progress",(e=>{R(Object.assign(e,{download:!0}))})),n.push(e)}let a=t;const o=t.req||h;if(!1!==e.decompress&&t.headers["content-encoding"])switch("HEAD"!==c&&204!==t.statusCode||delete t.headers["content-encoding"],t.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":n.push(u.createUnzip(Nv)),delete t.headers["content-encoding"];break;case"br":Fv&&(n.push(u.createBrotliDecompress(Bv)),delete t.headers["content-encoding"])}a=n.length>1?p.pipeline(n,jf.noop):n[0];const d=p.finished(a,(()=>{d(),v()})),l={status:t.statusCode,statusText:t.statusMessage,headers:new Jg(t.headers),config:e,request:o};if("stream"===s)l.data=a,Zg(y,_,l);else{const t=[];let n=0;a.on("data",(function(i){t.push(i),n+=i.length,e.maxContentLength>-1&&n>e.maxContentLength&&(f=!0,a.destroy(),_(new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o)))})),a.on("aborted",(function(){if(f)return;const t=new If("maxContentLength size of "+e.maxContentLength+" exceeded",If.ERR_BAD_RESPONSE,e,o);a.destroy(t),_(t)})),a.on("error",(function(t){h.destroyed||_(If.from(t,null,e,o))})),a.on("end",(function(){try{let e=1===t.length?t[0]:Buffer.concat(t);"arraybuffer"!==s&&(e=e.toString(r),r&&"utf8"!==r||(e=jf.stripBOM(e))),l.data=e}catch(t){_(If.from(t,null,e,l.request,l))}Zg(y,_,l)}))}g.once("abort",(e=>{a.destroyed||(a.emit("error",e),a.destroy())}))})),g.once("abort",(e=>{_(e),h.destroy(e)})),h.on("error",(function(t){_(If.from(t,null,e,h))})),h.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(isNaN(t))return void _(new If("error trying to parse `config.timeout` to int",If.ERR_BAD_OPTION_VALUE,e,h));h.setTimeout(t,(function(){if(m)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),_(new If(t,n.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,h)),x()}))}if(jf.isStream(i)){let t=!1,n=!1;i.on("end",(()=>{t=!0})),i.once("error",(e=>{n=!0,h.destroy(e)})),i.on("close",(()=>{t||n||x(new Xg("Request stream has been aborted",e,h))})),i.pipe(h)}else h.end(i)}))},Gv=Ug.isStandardBrowserEnv?{write:function(e,t,n,i,s,r){const a=[];a.push(e+"="+encodeURIComponent(t)),jf.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jf.isString(i)&&a.push("path="+i),jf.isString(s)&&a.push("domain="+s),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Kv=Ug.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(n){let i=n;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(e){const t=jf.isString(e)?i(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Jv(e,t){let n=0;const i=Mv(50,250);return s=>{const r=s.loaded,a=s.lengthComputable?s.total:void 0,o=r-n,c=i(o);n=r;const p={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:s};p[t?"download":"upload"]=!0,e(p)}}const Qv={http:Wv,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let i=e.data;const s=Jg.from(e.headers).normalize(),r=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}jf.isFormData(i)&&(Ug.isStandardBrowserEnv||Ug.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+n))}const p=ev(e.baseURL,e.url);function d(){if(!c)return;const i=Jg.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Zg((function(e){t(e),o()}),(function(e){n(e),o()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ng(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(n(new If("Request aborted",If.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new If("Network Error",If.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||Fg;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new If(t,i.clarifyTimeoutError?If.ETIMEDOUT:If.ECONNABORTED,e,c)),c=null},Ug.isStandardBrowserEnv){const t=(e.withCredentials||Kv(p))&&e.xsrfCookieName&&Gv.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===i&&s.setContentType(null),"setRequestHeader"in c&&jf.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),jf.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),r&&"json"!==r&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Jv(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Jv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(n(!t||t.type?new Xg(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=jv(p);l&&-1===Ug.protocols.indexOf(l)?n(new If("Unsupported protocol "+l+":",If.ERR_BAD_REQUEST,e)):c.send(i||null)}))}};jf.forEach(Qv,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Yv=e=>{e=jf.isArray(e)?e:[e];const{length:t}=e;let n,i;for(let s=0;s<t&&(n=e[s],!(i=jf.isString(n)?Qv[n.toLowerCase()]:n));s++);if(!i){if(!1===i)throw new If(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(jf.hasOwnProp(Qv,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!jf.isFunction(i))throw new TypeError("adapter is not a function");return i};function Xv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xg(null,e)}function Zv(e){Xv(e),e.headers=Jg.from(e.headers),e.data=Qg.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yv(e.adapter||$g.adapter)(e).then((function(t){return Xv(e),t.data=Qg.call(e,e.transformResponse,t),t.headers=Jg.from(t.headers),t}),(function(t){return Yg(t)||(Xv(e),t&&t.response&&(t.response.data=Qg.call(e,e.transformResponse,t.response),t.response.headers=Jg.from(t.response.headers))),Promise.reject(t)}))}const eb=e=>e instanceof Jg?e.toJSON():e;function tb(e,t){t=t||{};const n={};function i(e,t,n){return jf.isPlainObject(e)&&jf.isPlainObject(t)?jf.merge.call({caseless:n},e,t):jf.isPlainObject(t)?jf.merge({},t):jf.isArray(t)?t.slice():t}function s(e,t,n){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e,n):i(e,t,n)}function r(e,t){if(!jf.isUndefined(t))return i(void 0,t)}function a(e,t){return jf.isUndefined(t)?jf.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(n,s,r){return r in t?i(n,s):r in e?i(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(eb(e),eb(t),!0)};return jf.forEach(Object.keys(e).concat(Object.keys(t)),(function(i){const r=c[i]||s,a=r(e[i],t[i],i);jf.isUndefined(a)&&r!==o||(n[i]=a)})),n}const nb={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{nb[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ib={};nb.transitional=function(e,t,n){function i(e,t){return"[Axios v1.2.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,r)=>{if(!1===e)throw new If(i(s," has been removed"+(t?" in "+t:"")),If.ERR_DEPRECATED);return t&&!ib[s]&&(ib[s]=!0,console.warn(i(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,r)}};var sb={assertOptions:function(e,t,n){if("object"!=typeof e)throw new If("options must be an object",If.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const r=i[s],a=t[r];if(a){const t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new If("option "+r+" must be "+n,If.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new If("Unknown option "+r,If.ERR_BAD_OPTION)}},validators:nb};const rb=sb.validators;class ab{constructor(e){this.defaults=e,this.interceptors={request:new Bg,response:new Bg}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tb(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;let r;void 0!==n&&sb.assertOptions(n,{silentJSONParsing:rb.transitional(rb.boolean),forcedJSONParsing:rb.transitional(rb.boolean),clarifyTimeoutError:rb.transitional(rb.boolean)},!1),void 0!==i&&sb.assertOptions(i,{encode:rb.function,serialize:rb.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),r=s&&jf.merge(s.common,s[t.method]),r&&jf.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Jg.concat(r,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!o){const e=[Zv.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=a.length;let u=t;for(l=0;l<d;){const e=a[l++],t=a[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Zv.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ng(ev((e=tb(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}jf.forEach(["delete","get","head","options"],(function(e){ab.prototype[e]=function(t,n){return this.request(tb(n||{},{method:e,url:t,data:(n||{}).data}))}})),jf.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,s){return this.request(tb(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}ab.prototype[e]=t(),ab.prototype[e+"Form"]=t(!0)}));class ob{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e,i,s){n.reason||(n.reason=new Xg(e,i,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new ob((function(t){e=t})),cancel:e}}}const cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cb).forEach((([e,t])=>{cb[t]=e}));const pb=function e(t){const n=new ab(t),i=nf(ab.prototype.request,n);return jf.extend(i,ab.prototype,n,{allOwnKeys:!0}),jf.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(tb(t,n))},i}($g);pb.Axios=ab,pb.CanceledError=Xg,pb.CancelToken=ob,pb.isCancel=Yg,pb.VERSION="1.2.3",pb.toFormData=jg,pb.AxiosError=If,pb.Cancel=pb.CanceledError,pb.all=function(e){return Promise.all(e)},pb.spread=function(e){return function(t){return e.apply(null,t)}},pb.isAxiosError=function(e){return jf.isObject(e)&&!0===e.isAxiosError},pb.mergeConfig=tb,pb.AxiosHeaders=Jg,pb.formToJSON=e=>zg(jf.isHTMLForm(e)?new FormData(e):e),pb.HttpStatusCode=cb,pb.default=pb;class db{constructor(e={}){this.data=void 0===e.data?{}:e.data,this.headers=e.headers||{},this.status=e.status||200,this.statusText=e.statusText||"OK",this.url=e.url||null}}function lb(e,t){return m.ok(e,`${t} is required`),e}function ub(e,t){return m.ok("boolean"==typeof e,`${t}<boolean> is required`),e}function mb(e,t){return m.ok("number"==typeof e,`${t}<number> is required`),e}function hb(e,t){return m.ok("string"==typeof e,`${t}<string> is required`),e}function fb(e,t,n){const i=n||t.name[0].toLowerCase()+t.name.substring(1);return m.ok(e instanceof t,`${i}<${t.name}> is required`),e}function gb(e,t="roomName"){return hb(e,t),m.equal("string"==typeof e&&e[0],"/",`${t} must begin with a '/'`),e}function vb(e,t){return m.ok(Array.isArray(e),`${t}<array> is required`),e}function bb(e,t){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error(`${t} must be a record. ${JSON.stringify(e)}`);return e}function yb(e,t,n){hb(t,"name"),function(e,t,n,i){hb(n,"name");const s=i||`${n} must be null or of type ${t}`;m.ok(null===e||typeof e===t,s)}(e,"string",t,n)}function _b({baseUrl:e,url:t}){return m.ok("string"==typeof t,"url<String> is required"),e?e+t:t}class xb{constructor({baseUrl:e}){hb(e,"baseUrl"),this._baseUrl=e}_requestAxios(e,t){const n=Object.assign({},t,{url:e,baseURL:this._baseUrl});return pb.request(n)}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this._requestAxios(e,t).then((e=>{const{data:t,headers:n,status:i,statusText:s,config:r}=e,a=r&&r.url?_b({baseUrl:r.baseURL,url:r.url}):null;return new db({data:t,headers:n,status:i,statusText:s,url:a})})).catch((e=>{const t=e.response;if(!t)throw new Error("Could not make the request.");const{data:n,headers:i,status:s,statusText:r,config:a}=t,o=a&&a.url?_b({baseUrl:a.baseURL,url:a.url}):null;return Promise.reject(new db({data:n,headers:i,status:s,statusText:r,url:o}))}))}}class wb{constructor({httpClient:e}){m.ok(e,"httpClient is required"),this._httpClient=e}static dataToFormData(e){m.ok(e,"data is required");const t=new FormData;return Object.keys(e).forEach((n=>{const i=e[n];t.append(n,i)})),t}request(e,t={}){const n=Object.assign(t.headers||{},{"Content-Type":void 0});return this._httpClient.request(e,Object.assign(t,{headers:n,transformRequest:wb.dataToFormData}))}}let Sb;Sb="object"==typeof window?window.btoa||tf:"object"==typeof global&&global.btoa||tf;const kb=()=>Promise.resolve(null);class Cb{constructor({httpClient:e,fetchDeviceCredentials:t}){this._httpClient=e,this._fetchDeviceCredentials=t}request(e,t){return this._fetchDeviceCredentials().then((n=>{const i=Object.assign({},t.headers,function(e){if(e&&e.credentials){const t=`${e.credentials.uuid}:${e.hmac}`;return{Authorization:`Basic ${Sb(t)}`}}return{}}(n),{"X-Appearin-Device-Platform":"web"}),s=Object.assign({},t,{headers:i});return this._httpClient.request(e,s)}))}}class Rb{constructor({baseUrl:e="https://api.appearin.net",fetchDeviceCredentials:t=kb}={}){hb(e,"baseUrl"),m.ok("function"==typeof t,"fetchDeviceCredentials<Function> is required"),this.authenticatedHttpClient=new Cb({httpClient:new xb({baseUrl:e}),fetchDeviceCredentials:t}),this.authenticatedFormDataHttpClient=new wb({httpClient:this.authenticatedHttpClient})}request(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedHttpClient.request(e,t)}requestMultipart(e,t){return hb(e,"url"),m.equal(e[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(t,"options are required"),this.authenticatedFormDataHttpClient.request(e,t)}}function Tb(e,t){return hb(bb(e,"data")[t],t)}const Pb=(Eb=Tb,(e,t)=>{const n=bb(e,"data")[t];return null==n?null:Eb(e,t)});var Eb;function Ob(e,t){const n=Tb(e,t),i=new Date(n);if(isNaN(i.getTime()))throw new Error(`Invalid date for ${n}`);return i}function Db(e,t,n){return function(e,t){return vb(bb(e,"data")[t],t)}(e,t).map((e=>n(e)))}class jb{constructor(e,t,n){this.credentials={uuid:e},this.hmac=t,this.userId=n}toJson(){return Object.assign({credentials:this.credentials,hmac:this.hmac},this.userId&&{userId:this.userId})}static fromJson(e){return new jb(Tb(function(e,t){const n=bb(e,"data")[t];return void 0===n?null:n}(e,"credentials"),"uuid"),Tb(e,"hmac"),Pb(e,"userId")||void 0)}}class Ib{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}getCredentials(){return this._apiClient.request("/devices",{method:"post"}).then((({data:e})=>jb.fromJson(e))).catch((e=>{if(e.response&&404===e.response.status)return null;throw e}))}}class Mb{constructor(e,t){this._key=e,this._chromeStorage=t}loadOrDefault(e){return new Promise((t=>{this._chromeStorage.get(this._key,(n=>{t(n[this._key]||e)}))}))}save(e){return new Promise((t=>{this._chromeStorage.set({[this._key]:e},(()=>{t()}))}))}}class Lb{constructor(e,t){lb(t,"localStorage"),this._key=hb(e,"key"),this._localStorage=t}loadOrDefault(e){try{const t=this._localStorage.getItem(this._key);if(t)try{return Promise.resolve(JSON.parse(t))}catch(e){}return Promise.resolve(e)}catch(t){return console.warn("Error getting access to storage. Are cookies blocked?",t),Promise.resolve(e)}}save(e){try{return this._localStorage.setItem(this._key,JSON.stringify(e)),Promise.resolve()}catch(e){return console.warn("Error getting access to storage. Are cookies blocked?",e),Promise.reject(e)}}}let Ab;try{Ab=self.localStorage}catch(e){Ab={getItem:()=>{},key:()=>{},setItem:()=>{},removeItem:()=>{},hasOwnProperty:()=>{},length:0}}var Nb=Ab;const Bb="credentials_saved";class Fb extends d{constructor({deviceService:e,credentialsStore:t}){super(),this._deviceService=fb(e,Ib),this._credentialsStore=t}static create({baseUrl:e,storeName:t="CredentialsStorage",storeType:n="localStorage"}){const i=new Ib({apiClient:new Rb({baseUrl:e})});let s=null;if("localStorage"===n)s=new Lb(t,Nb);else{if("chromeStorage"!==n)throw new Error(`Unknown store type: ${n}`);s=new Mb(t,window.chrome.storage.local)}return new Fb({deviceService:i,credentialsStore:s})}_fetchNewCredentialsFromApi(){const e=this._credentialsStore;return new Promise((t=>{const n=()=>{this._deviceService.getCredentials().then((n=>e.save(n?n.toJson():null).then((()=>t(n))))).catch((()=>{setTimeout(n,2e3)}))};n()}))}getCurrentCredentials(){return this._credentialsStore.loadOrDefault(null).then((e=>e?jb.fromJson(e):null))}getCredentials(){return this.credentialsPromise||(this.credentialsPromise=this.getCurrentCredentials().then((e=>e||this._fetchNewCredentialsFromApi()))),this.credentialsPromise}saveCredentials(e){return this.credentialsPromise=void 0,this._credentialsStore.save(e.toJson()).then((()=>(this.emit(Bb,e),e)))}setUserId(e){return this.getCurrentCredentials().then((t=>{t||console.error("Illegal state: no credentials to set user id for.");if(null===t||t.userId!==e)return this._credentialsStore.save(Object.assign({},null==t?void 0:t.toJson(),{userId:e}))})).then((()=>{}))}}const Ub=()=>Promise.resolve(void 0);class zb{constructor({apiClient:e,fetchOrganization:t=Ub}){this._apiClient=fb(e,Rb),m.ok("function"==typeof t,"fetchOrganization<Function> is required"),this._fetchOrganization=t,this._apiClient=e}_callRequestMethod(e,t,n){return hb(t,"url"),m.equal(t[0],"/",'url<String> only accepts relative URLs beginning with "/".'),m.ok(n,"options are required"),this._fetchOrganization().then((i=>{if(!i)return this._apiClient[e](t,n);const{organizationId:s}=i;return this._apiClient[e](`/organizations/${encodeURIComponent(s)}${t}`,n)}))}request(e,t){return this._callRequestMethod("request",e,t)}requestMultipart(e,t){return this._callRequestMethod("requestMultipart",e,t)}}class qb{constructor({isExhausted:e,renewsAt:t,totalMinutesLimit:n,totalMinutesUsed:i}){this.isExhausted=e,this.renewsAt=t,this.totalMinutesLimit=n,this.totalMinutesUsed=i}static fromJson(e){return new qb({isExhausted:ub(e.isExhausted,"isExhausted"),renewsAt:new Date(hb(e.renewsAt,"renewsAt")),totalMinutesLimit:mb(e.totalMinutesLimit,"totalMinutesLimit"),totalMinutesUsed:mb(e.totalMinutesUsed,"totalMinutesUsed")})}}class $b{constructor({basePlanId:e,embeddedFreeTierStatus:t,isDeactivated:n,isOnTrial:i,onTrialUntil:s,trialStatus:r}){this.basePlanId=e,this.isDeactivated=n,this.isOnTrial=i,this.onTrialUntil=s||null,this.trialStatus=r||null,this.embeddedFreeTierStatus=t||null}static fromJson(e){return new $b({basePlanId:"string"==typeof e.basePlanId?e.basePlanId:null,isDeactivated:ub(e.isDeactivated,"isDeactivated"),isOnTrial:ub(e.isOnTrial,"isOnTrial"),onTrialUntil:"string"==typeof e.onTrialUntil?new Date(e.onTrialUntil):null,trialStatus:"string"==typeof e.trialStatus?e.trialStatus:null,embeddedFreeTierStatus:e.embeddedFreeTierStatus?qb.fromJson(e.embeddedFreeTierStatus):null})}}function Vb(e){return null!=e}function Hb(e={}){return{maxNumberOfInvitationsAndUsers:Vb(null==e?void 0:e.maxNumberOfInvitationsAndUsers)?Number(null==e?void 0:e.maxNumberOfInvitationsAndUsers):null,maxNumberOfClaimedRooms:Vb(null==e?void 0:e.maxNumberOfClaimedRooms)?Number(null==e?void 0:e.maxNumberOfClaimedRooms):null,maxRoomLimitPerOrganization:Vb(null==e?void 0:e.maxRoomLimitPerOrganization)?Number(null==e?void 0:e.maxRoomLimitPerOrganization):null,trialMinutesLimit:Vb(null==e?void 0:e.trialMinutesLimit)?Number(null==e?void 0:e.trialMinutesLimit):null,includedUnits:Vb(null==e?void 0:e.includedUnits)?Number(null==e?void 0:e.includedUnits):null}}class Wb{constructor(e){this.logoImageUrl=null,this.roomBackgroundImageUrl=null,this.roomBackgroundThumbnailUrl=null,this.roomKnockPageBackgroundImageUrl=null,this.roomKnockPageBackgroundThumbnailUrl=null,this.preferences=null,this.onboardingSurvey=null,this.type=null,fb(e,Object,"properties"),hb(e.organizationId,"organizationId"),hb(e.organizationName,"organizationName"),hb(e.subdomain,"subdomain"),fb(e.permissions,Object,"permissions"),fb(e.limits,Object,"limits"),this.organizationId=e.organizationId,this.organizationName=e.organizationName,this.subdomain=e.subdomain,this.permissions=e.permissions,this.limits=e.limits,this.account=e.account?new $b(e.account):null,this.logoImageUrl=e.logoImageUrl,this.roomBackgroundImageUrl=e.roomBackgroundImageUrl,this.roomBackgroundThumbnailUrl=e.roomBackgroundThumbnailUrl,this.roomKnockPageBackgroundImageUrl=e.roomKnockPageBackgroundImageUrl,this.roomKnockPageBackgroundThumbnailUrl=e.roomKnockPageBackgroundThumbnailUrl,this.preferences=e.preferences,this.onboardingSurvey=e.onboardingSurvey,this.type=e.type}static fromJson(e){const t=fb(e,Object,"data"),n=(null==t?void 0:t.preferences)||{},i=(null==t?void 0:t.onboardingSurvey)||null,s=fb(t.permissions,Object,"permissions");return new Wb({organizationId:hb(t.organizationId,"organizationId"),organizationName:hb(t.organizationName,"organizationName"),subdomain:hb(t.subdomain,"subdomain"),permissions:s,limits:Hb(fb(t.limits,Object,"limits")),account:t.account?$b.fromJson(t.account):null,logoImageUrl:"string"==typeof t.logoImageUrl?t.logoImageUrl:null,roomBackgroundImageUrl:"string"==typeof t.roomBackgroundImageUrl?t.roomBackgroundImageUrl:null,roomBackgroundThumbnailUrl:"string"==typeof t.roomBackgroundThumbnailUrl?t.roomBackgroundThumbnailUrl:null,roomKnockPageBackgroundImageUrl:"string"==typeof t.roomKnockPageBackgroundImageUrl?t.roomKnockPageBackgroundImageUrl:null,roomKnockPageBackgroundThumbnailUrl:"string"==typeof t.roomKnockPageBackgroundThumbnailUrl?t.roomKnockPageBackgroundThumbnailUrl:null,preferences:n,onboardingSurvey:i,type:"string"==typeof t.type?t.type:null})}}Wb.GLOBAL_ORGANIZATION_ID="1";class Gb{constructor({apiClient:e}){this._apiClient=fb(e,Rb)}createOrganization({organizationName:e,subdomain:t,owner:n}){const{displayName:i,consents:s}=n||{},r="email"in n?{value:n.email,verificationCode:hb(n.verificationCode,"owner.verificationCode")}:null,a="idToken"in n?n.idToken:null;if(hb(t,"subdomain"),hb(e,"organizationName"),hb(i,"owner.displayName"),m.ok(r||a,"owner.email or owner.idToken is required"),s){vb(s,"consents");for(const{consentRevisionId:e,action:t}of s)hb(e,"consentRevisionId"),yb(t,"action")}return this._apiClient.request("/organizations",{method:"POST",data:{organizationName:e,type:"private",subdomain:t,owner:Object.assign(Object.assign(Object.assign(Object.assign({},r&&{email:r}),a&&{idToken:a}),s&&{consents:s}),{displayName:i})}}).then((({data:e})=>Tb(e,"organizationId")))}getOrganizationBySubdomain(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/?fields=permissions,account,onboardingSurvey`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationByOrganizationId(e){return hb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}?fields=permissions,account`,{method:"GET"}).then((({data:e})=>Wb.fromJson(e))).catch((e=>{if(e instanceof db){if(404===e.status)return null;throw new Error(e.statusText)}throw e}))}getOrganizationsByContactPoint(e){const{code:t}=e,n="email"in e?e.email:null,i="phoneNumber"in e?e.phoneNumber:null;m.ok((n||i)&&!(n&&i),"either email or phoneNumber is required"),hb(t,"code");const s=n?{type:"email",value:n}:{type:"phoneNumber",value:i};return this._apiClient.request("/organization-queries",{method:"POST",data:{contactPoint:s,code:t}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(e)))))}getOrganizationsByIdToken({idToken:e}){return hb(e,"idToken"),this._apiClient.request("/organization-queries",{method:"POST",data:{idToken:e}}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getOrganizationsByLoggedInUser(){return this._apiClient.request("/user/organizations",{method:"GET"}).then((({data:e})=>Db(e,"organizations",(e=>Wb.fromJson(Object.assign({permissions:{},limits:{}},bb(e,"organization")))))))}getSubdomainAvailability(e){return hb(e,"subdomain"),this._apiClient.request(`/organization-subdomains/${encodeURIComponent(e)}/availability`,{method:"GET"}).then((({data:e})=>(fb(e,Object,"data"),{status:Tb(e,"status")})))}updatePreferences({organizationId:e,preferences:t}){return lb(e,"organizationId"),lb(t,"preferences"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}deleteOrganization({organizationId:e}){return lb(e,"organizationId"),this._apiClient.request(`/organizations/${encodeURIComponent(e)}`,{method:"DELETE"}).then((()=>{}))}}class Kb{constructor({organizationService:e,subdomain:t}){fb(e,Gb),hb(t,"subdomain"),this._organizationService=e,this._subdomain=t,this._organizationPromise=null}initOrganization(){return this.fetchOrganization().then((()=>{}))}fetchOrganization(){return this._organizationPromise||(this._organizationPromise=this._organizationService.getOrganizationBySubdomain(this._subdomain)),this._organizationPromise}}class Jb{constructor(e={}){m.ok(e instanceof Object,"properties<object> must be empty or an object"),this.isClaimed=!1,this.isBanned=!1,this.isLocked=!1,this.knockPage={backgroundImageUrl:null,backgroundThumbnailUrl:null},this.logoUrl=null,this.backgroundImageUrl=null,this.backgroundThumbnailUrl=null,this.type=null,this.legacyRoomType=null,this.mode=null,this.product=null,this.roomName=null,this.theme=null,this.preferences={},this.protectedPreferences={},this.publicProfile=null;const t={};Object.getOwnPropertyNames(e).forEach((n=>{-1!==Object.getOwnPropertyNames(this).indexOf(n)&&(t[n]=e[n])})),void 0!==e.ownerId&&(this.ownerId=e.ownerId),void 0!==e.meeting&&(this.meeting=e.meeting),Object.assign(this,t)}}class Qb{constructor({meetingId:e,roomName:t,roomUrl:n,startDate:i,endDate:s,hostRoomUrl:r,viewerRoomUrl:a}){hb(e,"meetingId"),hb(t,"roomName"),hb(n,"roomUrl"),fb(i,Date,"startDate"),fb(s,Date,"endDate"),this.meetingId=e,this.roomName=t,this.roomUrl=n,this.startDate=i,this.endDate=s,this.hostRoomUrl=r,this.viewerRoomUrl=a}static fromJson(e){return new Qb({meetingId:Tb(e,"meetingId"),roomName:Tb(e,"roomName"),roomUrl:Tb(e,"roomUrl"),startDate:Ob(e,"startDate"),endDate:Ob(e,"endDate"),hostRoomUrl:Pb(e,"hostRoomUrl"),viewerRoomUrl:Pb(e,"viewerRoomUrl")})}}function Yb(e,t=""){return`/room/${encodeURIComponent(e.substring(1))}${t}`}class Xb{constructor({organizationApiClient:e}){this._organizationApiClient=fb(e,zb)}getRooms({types:e,fields:t=[]}={}){return vb(e,"types"),vb(t,"fields"),this._organizationApiClient.request("/room",{method:"GET",params:{types:e.join(","),fields:t.join(","),includeOnlyLegacyRoomType:"false"}}).then((({data:e})=>e.rooms.map((e=>new Jb(e)))))}getRoom({roomName:e,fields:t}){gb(e);const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/rooms/${n}`,{method:"GET",params:Object.assign({includeOnlyLegacyRoomType:"false"},t&&{fields:t.join(",")})}).then((({data:t})=>new Jb(Object.assign({},t,Object.assign({roomName:e},t.meeting&&{meeting:Qb.fromJson(t.meeting)}))))).catch((t=>{if(404===t.status)return new Jb({roomName:e,isClaimed:!1,mode:"normal",product:{categoryName:"personal_free"},type:"personal",legacyRoomType:"free"});if(400===t.status&&"Banned room"===t.data.error)return new Jb({roomName:e,isBanned:!0});throw new Error(t.data?t.data.error:"Could not fetch room information")}))}claimRoom({roomName:e,type:t,mode:n,isLocked:i}){return gb(e),hb(t,"type"),this._organizationApiClient.request("/room/claim",{method:"POST",data:Object.assign(Object.assign({roomName:e,type:t},"string"==typeof n&&{mode:n}),"boolean"==typeof i&&{isLocked:i})}).then((()=>{})).catch((e=>{throw new Error(e.data.error||"Failed to claim room")}))}unclaimRoom(e){gb(e);const t=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${t}`,{method:"DELETE"}).then((()=>{}))}renameRoom({roomName:e,newRoomName:t}){gb(e),hb(t,"newRoomName");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/roomName`,{method:"PUT",data:{newRoomName:t}}).then((()=>{}))}changeMode({roomName:e,mode:t}){gb(e),hb(t,"mode");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/mode`,{method:"PUT",data:{mode:t}}).then((()=>{}))}updatePreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/preferences`,{method:"PATCH",data:t}).then((()=>{}))}updateProtectedPreferences({roomName:e,preferences:t}){gb(e),fb(t,Object,"preferences");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/protected-preferences`,{method:"PATCH",data:t}).then((()=>{}))}getRoomPermissions(e,{roomKey:t}={}){return gb(e),this._organizationApiClient.request(Yb(e,"/permissions"),Object.assign({method:"GET"},t&&{headers:{"X-Whereby-Room-Key":t}})).then((e=>{const{permissions:t,limits:n}=e.data;return{permissions:t,limits:n}}))}getRoomMetrics({roomName:e,metrics:t,from:n,to:i}){return gb(e),hb(t,"metrics"),this._organizationApiClient.request(Yb(e,"/metrics"),{method:"GET",params:{metrics:t,from:n,to:i}}).then((e=>e.data))}changeType({roomName:e,type:t}){gb(e),function(e,t,n){if(lb(e,"value"),vb(t,"allowedValues"),!t.includes(e))throw new Error(`${n}<string> must be one of the following: ${t.join(", ")}`)}(t,["personal","personal_xl"],"type");const n=encodeURIComponent(e.substring(1));return this._organizationApiClient.request(`/room/${n}/type`,{method:"PUT",data:{type:t}}).then((()=>{}))}getForestSocialImage({roomName:e,count:t}){return gb(e),mb(t,"count"),this._organizationApiClient.request(Yb(e,`/forest-social-image/${t}`),{method:"GET"}).then((e=>e.data.imageUrl))}}class Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){this.isLocalParticipant=!1,this.displayName=e,this.id=t,this.stream=n,this.isAudioEnabled=i,this.isVideoEnabled=s}}class ey extends Zb{constructor({displayName:e,id:t,newJoiner:n,streams:i,isAudioEnabled:s,isVideoEnabled:r}){super({displayName:e,id:t,isAudioEnabled:s,isVideoEnabled:r}),this.newJoiner=n,this.streams=i.map((e=>({id:e,state:n?"new_accept":"to_accept"})))}updateStreamState(e,t){const n=this.streams.find((t=>t.id===e));n&&(n.state=t)}}class ty extends Zb{constructor({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}){super({displayName:e,id:t,stream:n,isAudioEnabled:i,isVideoEnabled:s}),this.isLocalParticipant=!0}}const ny=["recorder","streamer"];const iy=()=>{},sy=EventTarget;class ry extends sy{constructor(e,{displayName:t,localMediaConstraints:n,localStream:i,logger:s}){super(),this.localParticipant=null,this.remoteParticipants=[],this.roomConnectionState="",this.roomUrl=new URL(e),this.logger=s||{debug:iy,error:iy,log:iy,warn:iy},this.displayName=t,this.localStream=i,this.localMediaConstraints=n;const r=ef({host:this.roomUrl.host});this.credentialsService=Fb.create({baseUrl:"https://api.appearin.net"}),this.apiClient=new Rb({fetchDeviceCredentials:this.credentialsService.getCredentials.bind(this.credentialsService),baseUrl:"https://api.appearin.net"}),this.organizationService=new Gb({apiClient:this.apiClient}),this.organizationServiceCache=new Kb({organizationService:this.organizationService,subdomain:r.subdomain}),this.organizationApiClient=new zb({apiClient:this.apiClient,fetchOrganization:()=>Xt(this,void 0,void 0,(function*(){return(yield this.organizationServiceCache.fetchOrganization())||void 0}))}),this.roomService=new Xb({organizationApiClient:this.organizationApiClient}),this.signalSocket=function(){const e=new URL("wss://signal.appearin.net"),t=`${e.pathname.replace(/^\/$/,"")}/protocol/socket.io/v1`,n=e.origin;return new Go(n,{host:n,path:t,reconnectionDelay:5e3,reconnectionDelayMax:3e4,timeout:1e4})}(),this.signalSocket.on("new_client",this._handleNewClient.bind(this)),this.signalSocket.on("client_left",this._handleClientLeft.bind(this)),this.signalSocket.on("audio_enabled",this._handleClientAudioEnabled.bind(this)),this.signalSocket.on("video_enabled",this._handleClientVideoEnabled.bind(this)),this.signalSocket.on("client_metadata_received",this._handleClientMetadataReceived.bind(this))}_handleNewClient({client:e}){if(ny.includes(e.role.roleName))return;const t=new ey(Object.assign(Object.assign({},e),{newJoiner:!0}));this.remoteParticipants=[...this.remoteParticipants,t],this._handleAcceptStreams([t]),this.dispatchEvent(new CustomEvent("participant_joined",{detail:{remoteParticipant:t}}))}_handleClientLeft({clientId:e}){const t=this.remoteParticipants.find((t=>t.id===e));this.remoteParticipants=this.remoteParticipants.filter((t=>t.id!==e)),t&&this.dispatchEvent(new CustomEvent("participant_left",{detail:{participantId:t.id}}))}_handleClientAudioEnabled({clientId:e,isAudioEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_audio_enabled",{detail:{participantId:n.id,isAudioEnabled:t}}))}_handleClientVideoEnabled({clientId:e,isVideoEnabled:t}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_video_enabled",{detail:{participantId:n.id,isVideoEnabled:t}}))}_handleClientMetadataReceived({payload:{clientId:e,displayName:t}}){const n=this.remoteParticipants.find((t=>t.id===e));n&&this.dispatchEvent(new CustomEvent("participant_metadata_changed",{detail:{participantId:n.id,displayName:t}}))}_handleRtcEvent(e,t){return"rtc_manager_created"===e?this._handleRtcManagerCreated(t):"stream_added"===e?this._handleStreamAdded(t):void this.logger.log(`Unhandled RTC event ${e}`)}_handleRtcManagerCreated({rtcManager:e}){var t,n,i;this.rtcManager=e,this.localStream&&(null===(t=this.rtcManager)||void 0===t||t.addNewStream("0",this.localStream,!(null===(n=this.localStream)||void 0===n?void 0:n.getAudioTracks().find((e=>e.enabled))),!(null===(i=this.localStream)||void 0===i?void 0:i.getVideoTracks().find((e=>e.enabled)))))}_handleAcceptStreams(e){var t,n;if(!this.rtcManager)return void this.logger.log("Unable to accept streams, no rtc manager");const i=null===(n=(t=this.rtcManager).shouldAcceptStreamsFromBothSides)||void 0===n?void 0:n.call(t);e.forEach((e=>{const{id:t,streams:n,newJoiner:s}=e;n.forEach((n=>{var r,a;const{id:o,state:c}=n;let p;if("done_accept"!==c&&(p=(s&&"0"===o?"new":"to")+"_accept"),p){if("to_accept"===p||"new_accept"===p&&i||"old_accept"===p&&!i)this.logger.log(`Accepting stream ${o} from ${t}`),null===(r=this.rtcManager)||void 0===r||r.acceptNewStream({streamId:"0"===o?t:o,clientId:t,shouldAddLocalVideo:"0"===o,activeBreakout:false});else if("new_accept"===p||"old_accept"===p);else if("to_unaccept"===p)this.logger.log(`Disconnecting stream ${o} from ${t}`),null===(a=this.rtcManager)||void 0===a||a.disconnect("0"===o?t:o,false);else if("done_accept"!==p)return void this.logger.warn(`Stream state not handled: ${p} for ${t}-${o}`);e.updateStreamState(o,c.replace(/to_|new_|old_/,"done_"))}}))}))}_handleStreamAdded({clientId:e,stream:t,streamId:n}){this.remoteParticipants.find((t=>t.id===e))?this.dispatchEvent(new CustomEvent("participant_stream_added",{detail:{participantId:e,stream:t,streamId:n}})):this.logger.log("WARN: Could not find participant for incoming stream")}join(){return Xt(this,void 0,void 0,(function*(){if(["connected","connecting"].includes(this.roomConnectionState))return void console.warn(`Trying to join room state is ${this.roomConnectionState}`);if(this.logger.log("Joining room"),this.roomConnectionState="connecting",!this.localStream&&this.localMediaConstraints){const e=yield navigator.mediaDevices.getUserMedia(this.localMediaConstraints);this.localStream=e}const e=yield this.organizationServiceCache.fetchOrganization();if(!e)throw new Error("Invalid room url");const t={getMediaConstraints:()=>{var e,t;return{audio:!!(null===(e=this.localStream)||void 0===e?void 0:e.getAudioTracks().find((e=>e.enabled))),video:!!(null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks().find((e=>e.enabled)))}},deferrable:e=>!e};this.rtcManagerDispatcher=new Xh({emitter:{emit:this._handleRtcEvent.bind(this)},serverSocket:this.signalSocket,webrtcProvider:t,features:{lowDataModeEnabled:!1,sfuServerOverrideHost:void 0,turnServerOverrideHost:void 0,useOnlyTURN:void 0,vp9On:!1,h264On:!1,simulcastScreenshareOn:!1}});const n=yield this.credentialsService.getCredentials();setTimeout((()=>{this.logger.log("Connected to signal socket"),this.signalSocket.emit("identify_device",{deviceCredentials:n})}),2e3),this.signalSocket.once("device_identified",(()=>{var t,n;this.signalSocket.emit("join_room",{avatarUrl:null,config:{isAudioEnabled:!!(null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks().find((e=>e.enabled))),isVideoEnabled:!!(null===(n=this.localStream)||void 0===n?void 0:n.getVideoTracks().find((e=>e.enabled)))},deviceCapabilities:{canScreenshare:!0},displayName:this.displayName,isCoLocated:!1,isDevicePermissionDenied:!1,kickFromOtherRooms:!1,organizationId:e.organizationId,roomKey:null,roomName:this.roomUrl.pathname,selfId:""})})),this.signalSocket.once("room_joined",(e=>{const{selfId:t,room:{clients:n}}=e,i=n.find((e=>e.id===t));if(!i)throw new Error("Missing local client");this.localParticipant=new ty(Object.assign(Object.assign({},i),{stream:this.localStream})),this.remoteParticipants=n.filter((e=>e.id!==t)).map((e=>new ey(Object.assign(Object.assign({},e),{newJoiner:!1})))),this.rtcManager&&this._handleAcceptStreams(this.remoteParticipants),this.roomConnectionState="connected",this.dispatchEvent(new CustomEvent("room_joined",{detail:{localParticipant:this.localParticipant,remoteParticipants:this.remoteParticipants}}))}))}))}leave(){return new Promise((e=>{if(!this.signalSocket)return e();this.signalSocket.emit("leave_room");const t=setTimeout((()=>{e()}),200);this.signalSocket.once("room_left",(()=>{clearTimeout(t),this.signalSocket.disconnect(),e()}))}))}toggleCamera(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getVideoTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing video track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_video",{enabled:i})}toggleMicrophone(e){var t;const n=null===(t=this.localStream)||void 0===t?void 0:t.getAudioTracks()[0];if(!n)return void this.logger.log("Tried toggling non-existing audio track");const i=null!=e?e:!n.enabled;n.enabled=i,this.signalSocket.emit("enable_audio",{enabled:i})}setDisplayName(e){this.signalSocket.emit("send_client_metadata",{type:"UserData",payload:{displayName:e}})}}function ay(e,t,n){const i=e.find((e=>e.id===t));if(!i)return e;const s=e.indexOf(i);return[...e.slice(0,s),Object.assign(Object.assign({},i),n),...e.slice(s+1)]}function oy(e,t){switch(t.type){case"ROOM_JOINED":return Object.assign(Object.assign({},e),{localParticipant:t.payload.localParticipant,remoteParticipants:t.payload.remoteParticipants,roomConnectionStatus:"connected"});case"PARTICIPANT_AUDIO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isAudioEnabled:t.payload.isAudioEnabled})});case"PARTICIPANT_JOINED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants,t.payload.paritipant]});case"PARTICIPANT_LEFT":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.filter((e=>e.id!==t.payload.participantId))]});case"PARTICIPANT_STREAM_ADDED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{stream:t.payload.stream})});case"PARTICIPANT_VIDEO_ENABLED":return Object.assign(Object.assign({},e),{remoteParticipants:ay(e.remoteParticipants,t.payload.participantId,{isVideoEnabled:t.payload.isVideoEnabled})});case"PARTICIPANT_METADATA_CHANGED":return Object.assign(Object.assign({},e),{remoteParticipants:[...e.remoteParticipants.map((e=>e.id===t.payload.participantId?Object.assign(Object.assign({},e),{displayName:t.payload.displayName}):e))]});case"LOCAL_CLIENT_DISPLAY_NAME_CHANGED":return e.localParticipant?Object.assign(Object.assign({},e),{localParticipant:Object.assign(Object.assign({},e.localParticipant),{displayName:t.payload.displayName})}):e;default:throw e}}function cy(e,t){const[n,i]=sn.useState(null),[s,r]=sn.useReducer(oy,{remoteParticipants:[]});return sn.useEffect((()=>{i(new ry(e,t))}),[e]),sn.useEffect((()=>{if(n)return n.addEventListener("participant_audio_enabled",(e=>{const{participantId:t,isAudioEnabled:n}=e.detail;r({type:"PARTICIPANT_AUDIO_ENABLED",payload:{participantId:t,isAudioEnabled:n}})})),n.addEventListener("participant_joined",(e=>{const{remoteParticipant:t}=e.detail;r({type:"PARTICIPANT_JOINED",payload:{paritipant:t}})})),n.addEventListener("participant_left",(e=>{const{participantId:t}=e.detail;r({type:"PARTICIPANT_LEFT",payload:{participantId:t}})})),n.addEventListener("participant_stream_added",(e=>{const{participantId:t,stream:n}=e.detail;r({type:"PARTICIPANT_STREAM_ADDED",payload:{participantId:t,stream:n}})})),n.addEventListener("room_joined",(e=>{const{localParticipant:t,remoteParticipants:n}=e.detail;r({type:"ROOM_JOINED",payload:{localParticipant:t,remoteParticipants:n}})})),n.addEventListener("participant_video_enabled",(e=>{const{participantId:t,isVideoEnabled:n}=e.detail;r({type:"PARTICIPANT_VIDEO_ENABLED",payload:{participantId:t,isVideoEnabled:n}})})),n.addEventListener("participant_metadata_changed",(e=>{const{participantId:t,displayName:n}=e.detail;r({type:"PARTICIPANT_METADATA_CHANGED",payload:{participantId:t,displayName:n}})})),n.join(),()=>{n.leave()}}),[n]),[s,{toggleCamera:e=>{null==n||n.toggleCamera(e)},toggleMicrophone:e=>{null==n||n.toggleMicrophone(e)},setDisplayName:e=>{null==n||n.setDisplayName(e),r({type:"LOCAL_CLIENT_DISPLAY_NAME_CHANGED",payload:{displayName:e}})}},{VideoView:mn}]}const py="2.0.0-alpha4";export{py as sdkVersion,cy as useRoomConnection};