media-av 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mediaAV.js CHANGED
@@ -4702,24 +4702,25 @@ class xa {
4702
4702
  }
4703
4703
  class _a {
4704
4704
  constructor(e, r) {
4705
- S(this, "tel");
4706
- S(this, "called", "");
4707
- S(this, "callId");
4705
+ S(this, "tel", "");
4708
4706
  S(this, "status", R.OFFLINE);
4709
4707
  S(this, "mediaType", se.AUDIO);
4710
4708
  S(this, "callMode", ze.FULL);
4711
4709
  S(this, "callDirect", K.OUT);
4710
+ S(this, "called", "");
4711
+ S(this, "callId");
4712
4712
  S(this, "remoteSdp");
4713
4713
  S(this, "candidate");
4714
4714
  S(this, "ringBackTone", new Audio("sound/ringbacktone.wav"));
4715
4715
  S(this, "ringtone", new Audio("sound/ringtone.wav"));
4716
+ S(this, "dtmfAudio", new Audio("sound/dtmf.wav"));
4716
4717
  S(this, "ws");
4717
4718
  S(this, "wsConnected", !1);
4718
4719
  S(this, "closeBySelf", !1);
4719
4720
  S(this, "webrtcSession");
4720
4721
  S(this, "sessionListener", new xa());
4721
4722
  S(this, "wsUrl");
4722
- this.tel = r, this.wsUrl = e, this.ringBackTone.loop = !0, this.ringtone.loop = !0;
4723
+ this.tel = r ?? "", this.wsUrl = e, this.ringBackTone.loop = !0, this.ringtone.loop = !0;
4723
4724
  }
4724
4725
  setCallSessionListener(e) {
4725
4726
  this.sessionListener = e;
@@ -4762,32 +4763,43 @@ class _a {
4762
4763
  hangup() {
4763
4764
  this.status <= R.IDLE || (this.status == R.TALK ? this.sendHangup(this.callId ?? "") : this.callDirect == K.IN ? this.sendHangup(this.callId ?? "", 488) : this.sendHangup(this.callId ?? "", 801), this.close());
4764
4765
  }
4766
+ dtmf(e) {
4767
+ return this.status !== R.TALK ? !1 : (this.sendDtmf(e), !0);
4768
+ }
4765
4769
  /**
4766
4770
  * 转换前后置摄像头
4767
- * @returns {Promise<string>|*}
4771
+ * @returns {Promise<string>}
4768
4772
  * @constructor
4769
4773
  */
4770
4774
  changeCamera() {
4771
- var e;
4772
- return (e = this.webrtcSession) == null ? void 0 : e.changeFacing();
4775
+ return new Promise((e, r) => {
4776
+ var n;
4777
+ this.webrtcSession || r(new Error("webrtc session not start")), (n = this.webrtcSession) == null || n.changeFacing().then((i) => e(i)).catch((i) => r(i));
4778
+ });
4773
4779
  }
4774
4780
  /**
4775
4781
  * 改变麦克风状态
4776
- * @returns {Promise<boolean>|*}
4782
+ * @returns {Promise<boolean>}
4777
4783
  * @constructor
4778
4784
  */
4779
4785
  changeMuted() {
4780
- var e;
4781
- return (e = this.webrtcSession) == null ? void 0 : e.changeMuted();
4786
+ return new Promise((e, r) => {
4787
+ this.webrtcSession || r(new Error("webrtc session not start")), this.webrtcSession.changeMuted().then((n) => e(n)).catch((n) => r(n));
4788
+ });
4782
4789
  }
4783
4790
  /**
4784
4791
  * 改变本地摄像头状态, 打开或关闭本地摄像头
4785
- * @returns {Promise<boolean>|*}
4792
+ * @returns {Promise<boolean>}
4786
4793
  * @constructor
4787
4794
  */
4788
4795
  changeCameraOpened() {
4796
+ return new Promise((e, r) => {
4797
+ this.webrtcSession || r(new Error("webrtc session not start")), this.webrtcSession.changeCameraOpened().then((n) => e(n)).catch((n) => r(n));
4798
+ });
4799
+ }
4800
+ destroy() {
4789
4801
  var e;
4790
- return (e = this.webrtcSession) == null ? void 0 : e.changeCameraOpened();
4802
+ this.closeBySelf = !0, this.hangup(), this.close(), (e = this.ws) == null || e.close();
4791
4803
  }
4792
4804
  close() {
4793
4805
  this.webrtcClose();
@@ -4878,6 +4890,14 @@ class _a {
4878
4890
  sdp: e
4879
4891
  }), this.status = R.TALK, this.ringtone.pause(), this.ringBackTone.pause();
4880
4892
  }
4893
+ sendDtmf(e) {
4894
+ this.sendTo({
4895
+ type: D.DTMF,
4896
+ callId: this.callId,
4897
+ callInfo: "dtmf=" + e
4898
+ }), this.dtmfAudio.play().then(() => {
4899
+ }).catch((r) => console.debug(r));
4900
+ }
4881
4901
  sendHangup(e, r = 800) {
4882
4902
  this.sendTo({
4883
4903
  type: D.HANGUP,
@@ -4891,7 +4911,7 @@ class _a {
4891
4911
  (r = this.ws) == null || r.close(), this.wsConnected = !1, this.ws = void 0, this.status = R.OFFLINE, this.sessionListener.onInitResult(!1);
4892
4912
  return;
4893
4913
  }
4894
- this.tel = e.username, this.status = R.IDLE, this.sessionListener.onInitResult(!0);
4914
+ this.tel = e.username ?? "", this.status = R.IDLE, this.sessionListener.onInitResult(!0);
4895
4915
  }
4896
4916
  inviteHandler(e) {
4897
4917
  if (!e.callId) {
@@ -1,9 +1,9 @@
1
- (function(I,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(I=typeof globalThis<"u"?globalThis:I||self,D(I.mediaAV={}))})(this,function(I){"use strict";var xa=Object.defineProperty;var _a=(I,D,H)=>D in I?xa(I,D,{enumerable:!0,configurable:!0,writable:!0,value:H}):I[D]=H;var S=(I,D,H)=>(_a(I,typeof D!="symbol"?D+"":D,H),H);function D(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function H(t,e){return function(){return t.apply(e,arguments)}}const{toString:Kn}=Object.prototype,{getPrototypeOf:nt}=Object,_e=(t=>e=>{const n=Kn.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=t=>(t=t.toLowerCase(),e=>_e(e)===t),Ie=t=>e=>typeof e===t,{isArray:ne}=Array,Se=Ie("undefined");function Qn(t){return t!==null&&!Se(t)&&t.constructor!==null&&!Se(t.constructor)&&k(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qt=F("ArrayBuffer");function Yn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qt(t.buffer),e}const Xn=Ie("string"),k=Ie("function"),Kt=Ie("number"),De=t=>t!==null&&typeof t=="object",Zn=t=>t===!0||t===!1,Le=t=>{if(_e(t)!=="object")return!1;const e=nt(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ei=F("Date"),ti=F("File"),ri=F("Blob"),ni=F("FileList"),ii=t=>De(t)&&k(t.pipe),oi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||k(t.append)&&((e=_e(t))==="formdata"||e==="object"&&k(t.toString)&&t.toString()==="[object FormData]"))},si=F("URLSearchParams"),ai=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ve(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ne(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function Qt(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Yt=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Xt=t=>!Se(t)&&t!==Yt;function it(){const{caseless:t}=Xt(this)&&this||{},e={},n=(r,i)=>{const o=t&&Qt(e,i)||i;Le(e[o])&&Le(r)?e[o]=it(e[o],r):Le(r)?e[o]=it({},r):ne(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ve(arguments[r],n);return e}const ci=(t,e,n,{allOwnKeys:r}={})=>(ve(e,(i,o)=>{n&&k(i)?t[o]=H(i,n):t[o]=i},{allOwnKeys:r}),t),li=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ui=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},fi=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&nt(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},pi=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},di=t=>{if(!t)return null;if(ne(t))return t;let e=t.length;if(!Kt(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},hi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&nt(Uint8Array)),mi=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},yi=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},gi=F("HTMLFormElement"),Si=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Zt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),vi=F("RegExp"),er=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ve(n,(i,o)=>{e(i,o,t)!==!1&&(r[o]=i)}),Object.defineProperties(t,r)},Ci=t=>{er(t,(e,n)=>{if(k(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(k(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ri=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return ne(t)?r(t):r(String(t).split(e)),n},bi=()=>{},Ti=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ot="abcdefghijklmnopqrstuvwxyz",tr="0123456789",rr={DIGIT:tr,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+tr},Pi=(t=16,e=rr.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Ei(t){return!!(t&&k(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Oi=t=>{const e=new Array(10),n=(r,i)=>{if(De(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=ne(r)?[]:{};return ve(r,(s,a)=>{const l=n(s,i+1);!Se(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Ai=F("AsyncFunction"),d={isArray:ne,isArrayBuffer:qt,isBuffer:Qn,isFormData:oi,isArrayBufferView:Yn,isString:Xn,isNumber:Kt,isBoolean:Zn,isObject:De,isPlainObject:Le,isUndefined:Se,isDate:ei,isFile:ti,isBlob:ri,isRegExp:vi,isFunction:k,isStream:ii,isURLSearchParams:si,isTypedArray:hi,isFileList:ni,forEach:ve,merge:it,extend:ci,trim:ai,stripBOM:li,inherits:ui,toFlatObject:fi,kindOf:_e,kindOfTest:F,endsWith:pi,toArray:di,forEachEntry:mi,matchAll:yi,isHTMLForm:gi,hasOwnProperty:Zt,hasOwnProp:Zt,reduceDescriptors:er,freezeMethods:Ci,toObjectSet:Ri,toCamelCase:Si,noop:bi,toFiniteNumber:Ti,findKey:Qt,global:Yt,isContextDefined:Xt,ALPHABET:rr,generateString:Pi,isSpecCompliantForm:Ei,toJSONObject:Oi,isAsyncFn:Ai,isThenable:t=>t&&(De(t)||k(t))&&k(t.then)&&k(t.catch)};function C(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}d.inherits(C,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const nr=C.prototype,ir={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ir[t]={value:t}}),Object.defineProperties(C,ir),Object.defineProperty(nr,"isAxiosError",{value:!0}),C.from=(t,e,n,r,i,o)=>{const s=Object.create(nr);return d.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),C.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const xi=null;function st(t){return d.isPlainObject(t)||d.isArray(t)}function or(t){return d.endsWith(t,"[]")?t.slice(0,-2):t}function sr(t,e,n){return t?t.concat(e).map(function(i,o){return i=or(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function _i(t){return d.isArray(t)&&!t.some(st)}const Ii=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(t,e,n){if(!d.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!d.isUndefined(T[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(e);if(!d.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(d.isDate(h))return h.toISOString();if(!l&&d.isBlob(h))throw new C("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(h)||d.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,T){let g=h;if(h&&!T&&typeof h=="object"){if(d.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(d.isArray(h)&&_i(h)||(d.isFileList(h)||d.endsWith(y,"[]"))&&(g=d.toArray(h)))return y=or(y),g.forEach(function(L,q){!(d.isUndefined(L)||L===null)&&e.append(s===!0?sr([y],q,o):s===null?y:y+"[]",c(L))}),!1}return st(h)?!0:(e.append(sr(T,y,o),c(h)),!1)}const f=[],p=Object.assign(Ii,{defaultVisitor:u,convertValue:c,isVisitable:st});function m(h,y){if(!d.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),d.forEach(h,function(g,_){(!(d.isUndefined(g)||g===null)&&i.call(e,g,d.isString(_)?_.trim():_,y,p))===!0&&m(g,y?y.concat(_):[_])}),f.pop()}}if(!d.isObject(t))throw new TypeError("data must be an object");return m(t),e}function ar(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function at(t,e){this._pairs=[],t&&ke(t,this,e)}const cr=at.prototype;cr.append=function(e,n){this._pairs.push([e,n])},cr.toString=function(e){const n=e?function(r){return e.call(this,r,ar)}:ar;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Di(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lr(t,e,n){if(!e)return t;const r=n&&n.encode||Di,i=n&&n.serialize;let o;if(i?o=i(e,n):o=d.isURLSearchParams(e)?e.toString():new at(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Li{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){d.forEach(this.handlers,function(r){r!==null&&e(r)})}}const ur=Li,fr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ki=typeof URLSearchParams<"u"?URLSearchParams:at,Mi=typeof FormData<"u"?FormData:null,Ni=typeof Blob<"u"?Blob:null,Fi=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ui=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),U={isBrowser:!0,classes:{URLSearchParams:ki,FormData:Mi,Blob:Ni},isStandardBrowserEnv:Fi,isStandardBrowserWebWorkerEnv:Ui,protocols:["http","https","file","blob","url","data"]};function ji(t,e){return ke(t,new U.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return U.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Bi(t){return d.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function $i(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function pr(t){function e(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&d.isArray(i)?i.length:s,l?(d.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!d.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&d.isArray(i[s])&&(i[s]=$i(i[s])),!a)}if(d.isFormData(t)&&d.isFunction(t.entries)){const n={};return d.forEachEntry(t,(r,i)=>{e(Bi(r),i,n,0)}),n}return null}const Gi={"Content-Type":void 0};function zi(t,e,n){if(d.isString(t))try{return(e||JSON.parse)(t),d.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Me={transitional:fr,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=d.isObject(e);if(o&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return i&&i?JSON.stringify(pr(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ji(e,this.formSerializer).toString();if((a=d.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ke(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),zi(e)):e}],transformResponse:[function(e){const n=this.transitional||Me.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&d.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?C.from(a,C.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};d.forEach(["delete","get","head"],function(e){Me.headers[e]={}}),d.forEach(["post","put","patch"],function(e){Me.headers[e]=d.merge(Gi)});const ct=Me,Hi=d.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"]),wi=t=>{const e={};let n,r,i;return t&&t.split(`
1
+ (function(I,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(I=typeof globalThis<"u"?globalThis:I||self,D(I.mediaAV={}))})(this,function(I){"use strict";var xa=Object.defineProperty;var _a=(I,D,H)=>D in I?xa(I,D,{enumerable:!0,configurable:!0,writable:!0,value:H}):I[D]=H;var S=(I,D,H)=>(_a(I,typeof D!="symbol"?D+"":D,H),H);function D(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function H(t,e){return function(){return t.apply(e,arguments)}}const{toString:Kn}=Object.prototype,{getPrototypeOf:nt}=Object,_e=(t=>e=>{const n=Kn.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=t=>(t=t.toLowerCase(),e=>_e(e)===t),Ie=t=>e=>typeof e===t,{isArray:ne}=Array,Se=Ie("undefined");function Qn(t){return t!==null&&!Se(t)&&t.constructor!==null&&!Se(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qt=F("ArrayBuffer");function Yn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qt(t.buffer),e}const Xn=Ie("string"),M=Ie("function"),Kt=Ie("number"),De=t=>t!==null&&typeof t=="object",Zn=t=>t===!0||t===!1,Le=t=>{if(_e(t)!=="object")return!1;const e=nt(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ei=F("Date"),ti=F("File"),ri=F("Blob"),ni=F("FileList"),ii=t=>De(t)&&M(t.pipe),oi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=_e(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},si=F("URLSearchParams"),ai=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ve(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ne(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function Qt(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Yt=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Xt=t=>!Se(t)&&t!==Yt;function it(){const{caseless:t}=Xt(this)&&this||{},e={},n=(r,i)=>{const o=t&&Qt(e,i)||i;Le(e[o])&&Le(r)?e[o]=it(e[o],r):Le(r)?e[o]=it({},r):ne(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ve(arguments[r],n);return e}const ci=(t,e,n,{allOwnKeys:r}={})=>(ve(e,(i,o)=>{n&&M(i)?t[o]=H(i,n):t[o]=i},{allOwnKeys:r}),t),li=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ui=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},fi=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&nt(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},pi=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},di=t=>{if(!t)return null;if(ne(t))return t;let e=t.length;if(!Kt(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},hi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&nt(Uint8Array)),mi=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},yi=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},gi=F("HTMLFormElement"),Si=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Zt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),vi=F("RegExp"),er=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ve(n,(i,o)=>{e(i,o,t)!==!1&&(r[o]=i)}),Object.defineProperties(t,r)},Ci=t=>{er(t,(e,n)=>{if(M(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(M(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ri=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return ne(t)?r(t):r(String(t).split(e)),n},bi=()=>{},Ti=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ot="abcdefghijklmnopqrstuvwxyz",tr="0123456789",rr={DIGIT:tr,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+tr},Pi=(t=16,e=rr.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Ei(t){return!!(t&&M(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Oi=t=>{const e=new Array(10),n=(r,i)=>{if(De(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=ne(r)?[]:{};return ve(r,(s,a)=>{const l=n(s,i+1);!Se(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Ai=F("AsyncFunction"),d={isArray:ne,isArrayBuffer:qt,isBuffer:Qn,isFormData:oi,isArrayBufferView:Yn,isString:Xn,isNumber:Kt,isBoolean:Zn,isObject:De,isPlainObject:Le,isUndefined:Se,isDate:ei,isFile:ti,isBlob:ri,isRegExp:vi,isFunction:M,isStream:ii,isURLSearchParams:si,isTypedArray:hi,isFileList:ni,forEach:ve,merge:it,extend:ci,trim:ai,stripBOM:li,inherits:ui,toFlatObject:fi,kindOf:_e,kindOfTest:F,endsWith:pi,toArray:di,forEachEntry:mi,matchAll:yi,isHTMLForm:gi,hasOwnProperty:Zt,hasOwnProp:Zt,reduceDescriptors:er,freezeMethods:Ci,toObjectSet:Ri,toCamelCase:Si,noop:bi,toFiniteNumber:Ti,findKey:Qt,global:Yt,isContextDefined:Xt,ALPHABET:rr,generateString:Pi,isSpecCompliantForm:Ei,toJSONObject:Oi,isAsyncFn:Ai,isThenable:t=>t&&(De(t)||M(t))&&M(t.then)&&M(t.catch)};function C(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}d.inherits(C,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const nr=C.prototype,ir={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ir[t]={value:t}}),Object.defineProperties(C,ir),Object.defineProperty(nr,"isAxiosError",{value:!0}),C.from=(t,e,n,r,i,o)=>{const s=Object.create(nr);return d.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),C.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const xi=null;function st(t){return d.isPlainObject(t)||d.isArray(t)}function or(t){return d.endsWith(t,"[]")?t.slice(0,-2):t}function sr(t,e,n){return t?t.concat(e).map(function(i,o){return i=or(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function _i(t){return d.isArray(t)&&!t.some(st)}const Ii=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(t,e,n){if(!d.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!d.isUndefined(T[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(e);if(!d.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(d.isDate(h))return h.toISOString();if(!l&&d.isBlob(h))throw new C("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(h)||d.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,T){let g=h;if(h&&!T&&typeof h=="object"){if(d.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(d.isArray(h)&&_i(h)||(d.isFileList(h)||d.endsWith(y,"[]"))&&(g=d.toArray(h)))return y=or(y),g.forEach(function(k,q){!(d.isUndefined(k)||k===null)&&e.append(s===!0?sr([y],q,o):s===null?y:y+"[]",c(k))}),!1}return st(h)?!0:(e.append(sr(T,y,o),c(h)),!1)}const f=[],p=Object.assign(Ii,{defaultVisitor:u,convertValue:c,isVisitable:st});function m(h,y){if(!d.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),d.forEach(h,function(g,_){(!(d.isUndefined(g)||g===null)&&i.call(e,g,d.isString(_)?_.trim():_,y,p))===!0&&m(g,y?y.concat(_):[_])}),f.pop()}}if(!d.isObject(t))throw new TypeError("data must be an object");return m(t),e}function ar(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function at(t,e){this._pairs=[],t&&ke(t,this,e)}const cr=at.prototype;cr.append=function(e,n){this._pairs.push([e,n])},cr.toString=function(e){const n=e?function(r){return e.call(this,r,ar)}:ar;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Di(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lr(t,e,n){if(!e)return t;const r=n&&n.encode||Di,i=n&&n.serialize;let o;if(i?o=i(e,n):o=d.isURLSearchParams(e)?e.toString():new at(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Li{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){d.forEach(this.handlers,function(r){r!==null&&e(r)})}}const ur=Li,fr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ki=typeof URLSearchParams<"u"?URLSearchParams:at,Mi=typeof FormData<"u"?FormData:null,Ni=typeof Blob<"u"?Blob:null,Fi=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ui=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),U={isBrowser:!0,classes:{URLSearchParams:ki,FormData:Mi,Blob:Ni},isStandardBrowserEnv:Fi,isStandardBrowserWebWorkerEnv:Ui,protocols:["http","https","file","blob","url","data"]};function ji(t,e){return ke(t,new U.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return U.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Bi(t){return d.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function $i(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function pr(t){function e(n,r,i,o){let s=n[o++];const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&d.isArray(i)?i.length:s,l?(d.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!d.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&d.isArray(i[s])&&(i[s]=$i(i[s])),!a)}if(d.isFormData(t)&&d.isFunction(t.entries)){const n={};return d.forEachEntry(t,(r,i)=>{e(Bi(r),i,n,0)}),n}return null}const Gi={"Content-Type":void 0};function zi(t,e,n){if(d.isString(t))try{return(e||JSON.parse)(t),d.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Me={transitional:fr,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=d.isObject(e);if(o&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return i&&i?JSON.stringify(pr(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ji(e,this.formSerializer).toString();if((a=d.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ke(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),zi(e)):e}],transformResponse:[function(e){const n=this.transitional||Me.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&d.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?C.from(a,C.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};d.forEach(["delete","get","head"],function(e){Me.headers[e]={}}),d.forEach(["post","put","patch"],function(e){Me.headers[e]=d.merge(Gi)});const ct=Me,Hi=d.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"]),wi=t=>{const e={};let n,r,i;return t&&t.split(`
2
2
  `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&Hi[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},dr=Symbol("internals");function Ce(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return t===!1||t==null?t:d.isArray(t)?t.map(Ne):String(t)}function Vi(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Wi=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function lt(t,e,n,r,i){if(d.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!d.isString(e)){if(d.isString(r))return e.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(e)}}function Ji(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function qi(t,e){const n=d.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class Fe{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=Ce(l);if(!u)throw new Error("header name must be a non-empty string");const f=d.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Ne(a))}const s=(a,l)=>d.forEach(a,(c,u)=>o(c,u,l));return d.isPlainObject(e)||e instanceof this.constructor?s(e,n):d.isString(e)&&(e=e.trim())&&!Wi(e)?s(wi(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=Ce(e),e){const r=d.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return Vi(i);if(d.isFunction(n))return n.call(this,i,r);if(d.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ce(e),e){const r=d.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||lt(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Ce(s),s){const a=d.findKey(r,s);a&&(!n||lt(r,r[a],a,n))&&(delete r[a],i=!0)}}return d.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||lt(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return d.forEach(this,(i,o)=>{const s=d.findKey(r,o);if(s){n[s]=Ne(i),delete n[o];return}const a=e?Ji(o):String(o).trim();a!==o&&delete n[o],n[a]=Ne(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return d.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[dr]=this[dr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ce(s);r[a]||(qi(i,s),r[a]=!0)}return d.isArray(e)?e.forEach(o):o(e),this}}Fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),d.freezeMethods(Fe.prototype),d.freezeMethods(Fe);const $=Fe;function ut(t,e){const n=this||ct,r=e||n,i=$.from(r.headers);let o=r.data;return d.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function hr(t){return!!(t&&t.__CANCEL__)}function Re(t,e,n){C.call(this,t??"canceled",C.ERR_CANCELED,e,n),this.name="CanceledError"}d.inherits(Re,C,{__CANCEL__:!0});function Ki(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new C("Request failed with status code "+n.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Qi=U.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const l=[];l.push(n+"="+encodeURIComponent(r)),d.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),d.isString(o)&&l.push("path="+o),d.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Yi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xi(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function mr(t,e){return t&&!Yi(e)?Xi(t,e):e}const Zi=U.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=d.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function eo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function to(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,p=0;for(;f!==i;)p+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(p*1e3/m):void 0}}function yr(t,e){let n=0;const r=to(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),c=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const Ue={http:xi,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){let i=t.data;const o=$.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}d.isFormData(i)&&(U.isStandardBrowserEnv||U.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+h))}const u=mr(t.baseURL,t.url);c.open(t.method.toUpperCase(),lr(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function f(){if(!c)return;const m=$.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:m,config:t,request:c};Ki(function(g){n(g),l()},function(g){r(g),l()},y),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(r(new C("Request aborted",C.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new C("Network Error",C.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||fr;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),r(new C(h,y.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,c)),c=null},U.isStandardBrowserEnv){const m=(t.withCredentials||Zi(u))&&t.xsrfCookieName&&Qi.read(t.xsrfCookieName);m&&o.set(t.xsrfHeaderName,m)}i===void 0&&o.setContentType(null),"setRequestHeader"in c&&d.forEach(o.toJSON(),function(h,y){c.setRequestHeader(y,h)}),d.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",yr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",yr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=m=>{c&&(r(!m||m.type?new Re(null,t,c):m),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=eo(u);if(p&&U.protocols.indexOf(p)===-1){r(new C("Unsupported protocol "+p+":",C.ERR_BAD_REQUEST,t));return}c.send(i||null)})}};d.forEach(Ue,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ro={getAdapter:t=>{t=d.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let i=0;i<e&&(n=t[i],!(r=d.isString(n)?Ue[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new C(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(d.hasOwnProp(Ue,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!d.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Ue};function ft(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Re(null,t)}function gr(t){return ft(t),t.headers=$.from(t.headers),t.data=ut.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ro.getAdapter(t.adapter||ct.adapter)(t).then(function(r){return ft(t),r.data=ut.call(t,t.transformResponse,r),r.headers=$.from(r.headers),r},function(r){return hr(r)||(ft(t),r&&r.response&&(r.response.data=ut.call(t,t.transformResponse,r.response),r.response.headers=$.from(r.response.headers))),Promise.reject(r)})}const Sr=t=>t instanceof $?t.toJSON():t;function ie(t,e){e=e||{};const n={};function r(c,u,f){return d.isPlainObject(c)&&d.isPlainObject(u)?d.merge.call({caseless:f},c,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function i(c,u,f){if(d.isUndefined(u)){if(!d.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!d.isUndefined(u))return r(void 0,u)}function s(c,u){if(d.isUndefined(u)){if(!d.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(Sr(c),Sr(u),!0)};return d.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,p=f(t[u],e[u],u);d.isUndefined(p)&&f!==a||(n[u]=p)}),n}const vr="1.4.0",pt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Cr={};pt.transitional=function(e,n,r){function i(o,s){return"[Axios v"+vr+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new C(i(s," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!Cr[s]&&(Cr[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function no(t,e,n){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new C("option "+o+" must be "+l,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+o,C.ERR_BAD_OPTION)}}const dt={assertOptions:no,validators:pt},w=dt.validators;class je{constructor(e){this.defaults=e,this.interceptors={request:new ur,response:new ur}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ie(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&dt.assertOptions(r,{silentJSONParsing:w.transitional(w.boolean),forcedJSONParsing:w.transitional(w.boolean),clarifyTimeoutError:w.transitional(w.boolean)},!1),i!=null&&(d.isFunction(i)?n.paramsSerializer={serialize:i}:dt.assertOptions(i,{encode:w.function,serialize:w.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&d.merge(o.common,o[n.method]),s&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=$.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,f=0,p;if(!l){const h=[gr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,u=Promise.resolve(n);f<p;)u=u.then(h[f++],h[f++]);return u}p=a.length;let m=n;for(f=0;f<p;){const h=a[f++],y=a[f++];try{m=h(m)}catch(T){y.call(this,T);break}}try{u=gr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=ie(this.defaults,e);const n=mr(e.baseURL,e.url);return lr(n,e.params,e.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(e){je.prototype[e]=function(n,r){return this.request(ie(r||{},{method:e,url:n,data:(r||{}).data}))}}),d.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(ie(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}je.prototype[e]=n(),je.prototype[e+"Form"]=n(!0)});const Be=je;class ht{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Re(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new ht(function(i){e=i}),cancel:e}}}const io=ht;function oo(t){return function(n){return t.apply(null,n)}}function so(t){return d.isObject(t)&&t.isAxiosError===!0}const mt={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(mt).forEach(([t,e])=>{mt[e]=t});const ao=mt;function Rr(t){const e=new Be(t),n=H(Be.prototype.request,e);return d.extend(n,Be.prototype,e,{allOwnKeys:!0}),d.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Rr(ie(t,i))},n}const b=Rr(ct);b.Axios=Be,b.CanceledError=Re,b.CancelToken=io,b.isCancel=hr,b.VERSION=vr,b.toFormData=ke,b.AxiosError=C,b.Cancel=b.CanceledError,b.all=function(e){return Promise.all(e)},b.spread=oo,b.isAxiosError=so,b.mergeConfig=ie,b.AxiosHeaders=$,b.formToJSON=t=>pr(d.isHTMLForm(t)?new FormData(t):t),b.HttpStatusCode=ao,b.default=b;const co=b;function br(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function lo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var uo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},Tr=typeof Symbol<"u"&&Symbol,fo=uo,po=function(){return typeof Tr!="function"||typeof Symbol!="function"||typeof Tr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:fo()},Pr={foo:{}},ho=Object,mo=function(){return{__proto__:Pr}.foo===Pr.foo&&!({__proto__:null}instanceof ho)},yo="Function.prototype.bind called on incompatible ",yt=Array.prototype.slice,go=Object.prototype.toString,So="[object Function]",vo=function(e){var n=this;if(typeof n!="function"||go.call(n)!==So)throw new TypeError(yo+n);for(var r=yt.call(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,r.concat(yt.call(arguments)));return Object(u)===u?u:this}else return n.apply(e,r.concat(yt.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i},Co=vo,gt=Function.prototype.bind||Co,Ro=gt,bo=Ro.call(Function.call,Object.prototype.hasOwnProperty),v,oe=SyntaxError,Er=Function,se=TypeError,St=function(t){try{return Er('"use strict"; return ('+t+").constructor;")()}catch{}},Q=Object.getOwnPropertyDescriptor;if(Q)try{Q({},"")}catch{Q=null}var vt=function(){throw new se},To=Q?function(){try{return arguments.callee,vt}catch{try{return Q(arguments,"callee").get}catch{return vt}}}():vt,ae=po(),Po=mo(),P=Object.getPrototypeOf||(Po?function(t){return t.__proto__}:null),ce={},Eo=typeof Uint8Array>"u"||!P?v:P(Uint8Array),Y={"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":ae&&P?P([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":ce,"%AsyncGenerator%":ce,"%AsyncGeneratorFunction%":ce,"%AsyncIteratorPrototype%":ce,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":Er,"%GeneratorFunction%":ce,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ae&&P?P(P([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ae||!P?v:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ae||!P?v:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ae&&P?P(""[Symbol.iterator]()):v,"%Symbol%":ae?Symbol:v,"%SyntaxError%":oe,"%ThrowTypeError%":To,"%TypedArray%":Eo,"%TypeError%":se,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet};if(P)try{null.error}catch(t){var Oo=P(P(t));Y["%Error.prototype%"]=Oo}var Ao=function t(e){var n;if(e==="%AsyncFunction%")n=St("async function () {}");else if(e==="%GeneratorFunction%")n=St("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=St("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&P&&(n=P(i.prototype))}return Y[e]=n,n},Or={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},be=gt,$e=bo,xo=be.call(Function.call,Array.prototype.concat),_o=be.call(Function.apply,Array.prototype.splice),Ar=be.call(Function.call,String.prototype.replace),Ge=be.call(Function.call,String.prototype.slice),Io=be.call(Function.call,RegExp.prototype.exec),Do=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lo=/\\(\\)?/g,ko=function(e){var n=Ge(e,0,1),r=Ge(e,-1);if(n==="%"&&r!=="%")throw new oe("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new oe("invalid intrinsic syntax, expected opening `%`");var i=[];return Ar(e,Do,function(o,s,a,l){i[i.length]=a?Ar(l,Lo,"$1"):s||o}),i},Mo=function(e,n){var r=e,i;if($e(Or,r)&&(i=Or[r],r="%"+i[0]+"%"),$e(Y,r)){var o=Y[r];if(o===ce&&(o=Ao(r)),typeof o>"u"&&!n)throw new se("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new oe("intrinsic "+e+" does not exist!")},Ct=function(e,n){if(typeof e!="string"||e.length===0)throw new se("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new se('"allowMissing" argument must be a boolean');if(Io(/^%?[^%]*%?$/,e)===null)throw new oe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=ko(e),i=r.length>0?r[0]:"",o=Mo("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],_o(r,xo([0,1],c)));for(var u=1,f=!0;u<r.length;u+=1){var p=r[u],m=Ge(p,0,1),h=Ge(p,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new oe("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),i+="."+p,s="%"+i+"%",$e(Y,s))a=Y[s];else if(a!=null){if(!(p in a)){if(!n)throw new se("base intrinsic for "+e+" exists, but the property is not available.");return}if(Q&&u+1>=r.length){var y=Q(a,p);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[p]}else f=$e(a,p),a=a[p];f&&!l&&(Y[s]=a)}}return a},xr={exports:{}};(function(t){var e=gt,n=Ct,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||e.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var p=o(e,i,arguments);if(s&&a){var m=s(p,"length");m.configurable&&a(p,"length",{value:1+l(0,f.length-(arguments.length-1))})}return p};var c=function(){return o(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(xr);var No=xr.exports,_r=Ct,Ir=No,Fo=Ir(_r("String.prototype.indexOf")),Uo=function(e,n){var r=_r(e,!!n);return typeof r=="function"&&Fo(e,".prototype.")>-1?Ir(r):r};const jo=lo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Rt=typeof Map=="function"&&Map.prototype,bt=Object.getOwnPropertyDescriptor&&Rt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ze=Rt&&bt&&typeof bt.get=="function"?bt.get:null,Dr=Rt&&Map.prototype.forEach,Tt=typeof Set=="function"&&Set.prototype,Pt=Object.getOwnPropertyDescriptor&&Tt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=Tt&&Pt&&typeof Pt.get=="function"?Pt.get:null,Lr=Tt&&Set.prototype.forEach,Bo=typeof WeakMap=="function"&&WeakMap.prototype,Te=Bo?WeakMap.prototype.has:null,$o=typeof WeakSet=="function"&&WeakSet.prototype,Pe=$o?WeakSet.prototype.has:null,Go=typeof WeakRef=="function"&&WeakRef.prototype,kr=Go?WeakRef.prototype.deref:null,zo=Boolean.prototype.valueOf,Ho=Object.prototype.toString,wo=Function.prototype.toString,Vo=String.prototype.match,Et=String.prototype.slice,V=String.prototype.replace,Wo=String.prototype.toUpperCase,Mr=String.prototype.toLowerCase,Nr=RegExp.prototype.test,Fr=Array.prototype.concat,j=Array.prototype.join,Jo=Array.prototype.slice,Ur=Math.floor,Ot=typeof BigInt=="function"?BigInt.prototype.valueOf:null,At=Object.getOwnPropertySymbols,xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",O=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===le||"symbol")?Symbol.toStringTag:null,jr=Object.prototype.propertyIsEnumerable,Br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $r(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Nr.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Ur(-t):Ur(t);if(r!==t){var i=String(r),o=Et.call(e,i.length+1);return V.call(i,n,"$&_")+"."+V.call(V.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return V.call(e,n,"$&_")}var _t=jo,Gr=_t.custom,zr=Vr(Gr)?Gr:null,qo=function t(e,n,r,i){var o=n||{};if(W(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=W(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Jr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?$r(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?$r(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof e=="object")return It(e)?"[Array]":"[Object]";var f=ps(o,r);if(typeof i>"u")i=[];else if(Wr(i,e)>=0)return"[Circular]";function p(z,ye,rt){if(ye&&(i=Jo.call(i),i.push(ye)),rt){var ge={depth:o.depth};return W(o,"quoteStyle")&&(ge.quoteStyle=o.quoteStyle),t(z,ge,r+1,i)}return t(z,o,r+1,i)}if(typeof e=="function"&&!wr(e)){var m=ns(e),h=we(e,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+j.call(h,", ")+" }":"")}if(Vr(e)){var y=le?V.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):xt.call(e);return typeof e=="object"&&!le?Ee(y):y}if(ls(e)){for(var T="<"+Mr.call(String(e.nodeName)),g=e.attributes||[],_=0;_<g.length;_++)T+=" "+g[_].name+"="+Hr(Ko(g[_].value),"double",o);return T+=">",e.childNodes&&e.childNodes.length&&(T+="..."),T+="</"+Mr.call(String(e.nodeName))+">",T}if(It(e)){if(e.length===0)return"[]";var L=we(e,p);return f&&!fs(L)?"["+Lt(L,f)+"]":"[ "+j.call(L,", ")+" ]"}if(Yo(e)){var q=we(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!jr.call(e,"cause")?"{ ["+String(e)+"] "+j.call(Fr.call("[cause]: "+p(e.cause),q),", ")+" }":q.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(q,", ")+" }"}if(typeof e=="object"&&s){if(zr&&typeof e[zr]=="function"&&_t)return _t(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(is(e)){var Ae=[];return Dr&&Dr.call(e,function(z,ye){Ae.push(p(ye,e,!0)+" => "+p(z,e))}),qr("Map",ze.call(e),Ae,f)}if(as(e)){var tt=[];return Lr&&Lr.call(e,function(z){tt.push(p(z,e))}),qr("Set",He.call(e),tt,f)}if(os(e))return Dt("WeakMap");if(cs(e))return Dt("WeakSet");if(ss(e))return Dt("WeakRef");if(Zo(e))return Ee(p(Number(e)));if(ts(e))return Ee(p(Ot.call(e)));if(es(e))return Ee(zo.call(e));if(Xo(e))return Ee(p(String(e)));if(!Qo(e)&&!wr(e)){var re=we(e,p),K=Br?Br(e)===Object.prototype:e instanceof Object||e.constructor===Object,he=e instanceof Object?"":"null prototype",me=!K&&O&&Object(e)===e&&O in e?Et.call(J(e),8,-1):he?"Object":"",xe=K||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",N=xe+(me||he?"["+j.call(Fr.call([],me||[],he||[]),": ")+"] ":"");return re.length===0?N+"{}":f?N+"{"+Lt(re,f)+"}":N+"{ "+j.call(re,", ")+" }"}return String(e)};function Hr(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function Ko(t){return V.call(String(t),/"/g,"&quot;")}function It(t){return J(t)==="[object Array]"&&(!O||!(typeof t=="object"&&O in t))}function Qo(t){return J(t)==="[object Date]"&&(!O||!(typeof t=="object"&&O in t))}function wr(t){return J(t)==="[object RegExp]"&&(!O||!(typeof t=="object"&&O in t))}function Yo(t){return J(t)==="[object Error]"&&(!O||!(typeof t=="object"&&O in t))}function Xo(t){return J(t)==="[object String]"&&(!O||!(typeof t=="object"&&O in t))}function Zo(t){return J(t)==="[object Number]"&&(!O||!(typeof t=="object"&&O in t))}function es(t){return J(t)==="[object Boolean]"&&(!O||!(typeof t=="object"&&O in t))}function Vr(t){if(le)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!xt)return!1;try{return xt.call(t),!0}catch{}return!1}function ts(t){if(!t||typeof t!="object"||!Ot)return!1;try{return Ot.call(t),!0}catch{}return!1}var rs=Object.prototype.hasOwnProperty||function(t){return t in this};function W(t,e){return rs.call(t,e)}function J(t){return Ho.call(t)}function ns(t){if(t.name)return t.name;var e=Vo.call(wo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Wr(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function is(t){if(!ze||!t||typeof t!="object")return!1;try{ze.call(t);try{He.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function os(t){if(!Te||!t||typeof t!="object")return!1;try{Te.call(t,Te);try{Pe.call(t,Pe)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ss(t){if(!kr||!t||typeof t!="object")return!1;try{return kr.call(t),!0}catch{}return!1}function as(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{ze.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function cs(t){if(!Pe||!t||typeof t!="object")return!1;try{Pe.call(t,Pe);try{Te.call(t,Te)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ls(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Jr(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Jr(Et.call(t,0,e.maxStringLength),e)+r}var i=V.call(V.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,us);return Hr(i,"single",e)}function us(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Wo.call(e.toString(16))}function Ee(t){return"Object("+t+")"}function Dt(t){return t+" { ? }"}function qr(t,e,n,r){var i=r?Lt(n,r):j.call(n,", ");return t+" ("+e+") {"+i+"}"}function fs(t){for(var e=0;e<t.length;e++)if(Wr(t[e],`
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[dr]=this[dr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ce(s);r[a]||(qi(i,s),r[a]=!0)}return d.isArray(e)?e.forEach(o):o(e),this}}Fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),d.freezeMethods(Fe.prototype),d.freezeMethods(Fe);const $=Fe;function ut(t,e){const n=this||ct,r=e||n,i=$.from(r.headers);let o=r.data;return d.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function hr(t){return!!(t&&t.__CANCEL__)}function Re(t,e,n){C.call(this,t??"canceled",C.ERR_CANCELED,e,n),this.name="CanceledError"}d.inherits(Re,C,{__CANCEL__:!0});function Ki(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new C("Request failed with status code "+n.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Qi=U.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const l=[];l.push(n+"="+encodeURIComponent(r)),d.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),d.isString(o)&&l.push("path="+o),d.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Yi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xi(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function mr(t,e){return t&&!Yi(e)?Xi(t,e):e}const Zi=U.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=d.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function eo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function to(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,p=0;for(;f!==i;)p+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(p*1e3/m):void 0}}function yr(t,e){let n=0;const r=to(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),c=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const Ue={http:xi,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){let i=t.data;const o=$.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}d.isFormData(i)&&(U.isStandardBrowserEnv||U.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+h))}const u=mr(t.baseURL,t.url);c.open(t.method.toUpperCase(),lr(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function f(){if(!c)return;const m=$.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:m,config:t,request:c};Ki(function(g){n(g),l()},function(g){r(g),l()},y),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(r(new C("Request aborted",C.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new C("Network Error",C.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||fr;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),r(new C(h,y.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,c)),c=null},U.isStandardBrowserEnv){const m=(t.withCredentials||Zi(u))&&t.xsrfCookieName&&Qi.read(t.xsrfCookieName);m&&o.set(t.xsrfHeaderName,m)}i===void 0&&o.setContentType(null),"setRequestHeader"in c&&d.forEach(o.toJSON(),function(h,y){c.setRequestHeader(y,h)}),d.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",yr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",yr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=m=>{c&&(r(!m||m.type?new Re(null,t,c):m),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=eo(u);if(p&&U.protocols.indexOf(p)===-1){r(new C("Unsupported protocol "+p+":",C.ERR_BAD_REQUEST,t));return}c.send(i||null)})}};d.forEach(Ue,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ro={getAdapter:t=>{t=d.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let i=0;i<e&&(n=t[i],!(r=d.isString(n)?Ue[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new C(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(d.hasOwnProp(Ue,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!d.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Ue};function ft(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Re(null,t)}function gr(t){return ft(t),t.headers=$.from(t.headers),t.data=ut.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ro.getAdapter(t.adapter||ct.adapter)(t).then(function(r){return ft(t),r.data=ut.call(t,t.transformResponse,r),r.headers=$.from(r.headers),r},function(r){return hr(r)||(ft(t),r&&r.response&&(r.response.data=ut.call(t,t.transformResponse,r.response),r.response.headers=$.from(r.response.headers))),Promise.reject(r)})}const Sr=t=>t instanceof $?t.toJSON():t;function ie(t,e){e=e||{};const n={};function r(c,u,f){return d.isPlainObject(c)&&d.isPlainObject(u)?d.merge.call({caseless:f},c,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function i(c,u,f){if(d.isUndefined(u)){if(!d.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!d.isUndefined(u))return r(void 0,u)}function s(c,u){if(d.isUndefined(u)){if(!d.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(Sr(c),Sr(u),!0)};return d.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,p=f(t[u],e[u],u);d.isUndefined(p)&&f!==a||(n[u]=p)}),n}const vr="1.4.0",pt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Cr={};pt.transitional=function(e,n,r){function i(o,s){return"[Axios v"+vr+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new C(i(s," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!Cr[s]&&(Cr[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function no(t,e,n){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new C("option "+o+" must be "+l,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+o,C.ERR_BAD_OPTION)}}const dt={assertOptions:no,validators:pt},w=dt.validators;class je{constructor(e){this.defaults=e,this.interceptors={request:new ur,response:new ur}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ie(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&dt.assertOptions(r,{silentJSONParsing:w.transitional(w.boolean),forcedJSONParsing:w.transitional(w.boolean),clarifyTimeoutError:w.transitional(w.boolean)},!1),i!=null&&(d.isFunction(i)?n.paramsSerializer={serialize:i}:dt.assertOptions(i,{encode:w.function,serialize:w.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&d.merge(o.common,o[n.method]),s&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=$.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,f=0,p;if(!l){const h=[gr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,u=Promise.resolve(n);f<p;)u=u.then(h[f++],h[f++]);return u}p=a.length;let m=n;for(f=0;f<p;){const h=a[f++],y=a[f++];try{m=h(m)}catch(T){y.call(this,T);break}}try{u=gr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=ie(this.defaults,e);const n=mr(e.baseURL,e.url);return lr(n,e.params,e.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(e){je.prototype[e]=function(n,r){return this.request(ie(r||{},{method:e,url:n,data:(r||{}).data}))}}),d.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(ie(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}je.prototype[e]=n(),je.prototype[e+"Form"]=n(!0)});const Be=je;class ht{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Re(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new ht(function(i){e=i}),cancel:e}}}const io=ht;function oo(t){return function(n){return t.apply(null,n)}}function so(t){return d.isObject(t)&&t.isAxiosError===!0}const mt={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(mt).forEach(([t,e])=>{mt[e]=t});const ao=mt;function Rr(t){const e=new Be(t),n=H(Be.prototype.request,e);return d.extend(n,Be.prototype,e,{allOwnKeys:!0}),d.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Rr(ie(t,i))},n}const b=Rr(ct);b.Axios=Be,b.CanceledError=Re,b.CancelToken=io,b.isCancel=hr,b.VERSION=vr,b.toFormData=ke,b.AxiosError=C,b.Cancel=b.CanceledError,b.all=function(e){return Promise.all(e)},b.spread=oo,b.isAxiosError=so,b.mergeConfig=ie,b.AxiosHeaders=$,b.formToJSON=t=>pr(d.isHTMLForm(t)?new FormData(t):t),b.HttpStatusCode=ao,b.default=b;const co=b;function br(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function lo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var uo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},Tr=typeof Symbol<"u"&&Symbol,fo=uo,po=function(){return typeof Tr!="function"||typeof Symbol!="function"||typeof Tr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:fo()},Pr={foo:{}},ho=Object,mo=function(){return{__proto__:Pr}.foo===Pr.foo&&!({__proto__:null}instanceof ho)},yo="Function.prototype.bind called on incompatible ",yt=Array.prototype.slice,go=Object.prototype.toString,So="[object Function]",vo=function(e){var n=this;if(typeof n!="function"||go.call(n)!==So)throw new TypeError(yo+n);for(var r=yt.call(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,r.concat(yt.call(arguments)));return Object(u)===u?u:this}else return n.apply(e,r.concat(yt.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i},Co=vo,gt=Function.prototype.bind||Co,Ro=gt,bo=Ro.call(Function.call,Object.prototype.hasOwnProperty),v,oe=SyntaxError,Er=Function,se=TypeError,St=function(t){try{return Er('"use strict"; return ('+t+").constructor;")()}catch{}},Q=Object.getOwnPropertyDescriptor;if(Q)try{Q({},"")}catch{Q=null}var vt=function(){throw new se},To=Q?function(){try{return arguments.callee,vt}catch{try{return Q(arguments,"callee").get}catch{return vt}}}():vt,ae=po(),Po=mo(),P=Object.getPrototypeOf||(Po?function(t){return t.__proto__}:null),ce={},Eo=typeof Uint8Array>"u"||!P?v:P(Uint8Array),Y={"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":ae&&P?P([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":ce,"%AsyncGenerator%":ce,"%AsyncGeneratorFunction%":ce,"%AsyncIteratorPrototype%":ce,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":Er,"%GeneratorFunction%":ce,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ae&&P?P(P([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ae||!P?v:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ae||!P?v:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ae&&P?P(""[Symbol.iterator]()):v,"%Symbol%":ae?Symbol:v,"%SyntaxError%":oe,"%ThrowTypeError%":To,"%TypedArray%":Eo,"%TypeError%":se,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet};if(P)try{null.error}catch(t){var Oo=P(P(t));Y["%Error.prototype%"]=Oo}var Ao=function t(e){var n;if(e==="%AsyncFunction%")n=St("async function () {}");else if(e==="%GeneratorFunction%")n=St("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=St("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&P&&(n=P(i.prototype))}return Y[e]=n,n},Or={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},be=gt,$e=bo,xo=be.call(Function.call,Array.prototype.concat),_o=be.call(Function.apply,Array.prototype.splice),Ar=be.call(Function.call,String.prototype.replace),Ge=be.call(Function.call,String.prototype.slice),Io=be.call(Function.call,RegExp.prototype.exec),Do=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lo=/\\(\\)?/g,ko=function(e){var n=Ge(e,0,1),r=Ge(e,-1);if(n==="%"&&r!=="%")throw new oe("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new oe("invalid intrinsic syntax, expected opening `%`");var i=[];return Ar(e,Do,function(o,s,a,l){i[i.length]=a?Ar(l,Lo,"$1"):s||o}),i},Mo=function(e,n){var r=e,i;if($e(Or,r)&&(i=Or[r],r="%"+i[0]+"%"),$e(Y,r)){var o=Y[r];if(o===ce&&(o=Ao(r)),typeof o>"u"&&!n)throw new se("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new oe("intrinsic "+e+" does not exist!")},Ct=function(e,n){if(typeof e!="string"||e.length===0)throw new se("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new se('"allowMissing" argument must be a boolean');if(Io(/^%?[^%]*%?$/,e)===null)throw new oe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=ko(e),i=r.length>0?r[0]:"",o=Mo("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],_o(r,xo([0,1],c)));for(var u=1,f=!0;u<r.length;u+=1){var p=r[u],m=Ge(p,0,1),h=Ge(p,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new oe("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),i+="."+p,s="%"+i+"%",$e(Y,s))a=Y[s];else if(a!=null){if(!(p in a)){if(!n)throw new se("base intrinsic for "+e+" exists, but the property is not available.");return}if(Q&&u+1>=r.length){var y=Q(a,p);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[p]}else f=$e(a,p),a=a[p];f&&!l&&(Y[s]=a)}}return a},xr={exports:{}};(function(t){var e=gt,n=Ct,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||e.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var p=o(e,i,arguments);if(s&&a){var m=s(p,"length");m.configurable&&a(p,"length",{value:1+l(0,f.length-(arguments.length-1))})}return p};var c=function(){return o(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(xr);var No=xr.exports,_r=Ct,Ir=No,Fo=Ir(_r("String.prototype.indexOf")),Uo=function(e,n){var r=_r(e,!!n);return typeof r=="function"&&Fo(e,".prototype.")>-1?Ir(r):r};const jo=lo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Rt=typeof Map=="function"&&Map.prototype,bt=Object.getOwnPropertyDescriptor&&Rt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ze=Rt&&bt&&typeof bt.get=="function"?bt.get:null,Dr=Rt&&Map.prototype.forEach,Tt=typeof Set=="function"&&Set.prototype,Pt=Object.getOwnPropertyDescriptor&&Tt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=Tt&&Pt&&typeof Pt.get=="function"?Pt.get:null,Lr=Tt&&Set.prototype.forEach,Bo=typeof WeakMap=="function"&&WeakMap.prototype,Te=Bo?WeakMap.prototype.has:null,$o=typeof WeakSet=="function"&&WeakSet.prototype,Pe=$o?WeakSet.prototype.has:null,Go=typeof WeakRef=="function"&&WeakRef.prototype,kr=Go?WeakRef.prototype.deref:null,zo=Boolean.prototype.valueOf,Ho=Object.prototype.toString,wo=Function.prototype.toString,Vo=String.prototype.match,Et=String.prototype.slice,V=String.prototype.replace,Wo=String.prototype.toUpperCase,Mr=String.prototype.toLowerCase,Nr=RegExp.prototype.test,Fr=Array.prototype.concat,j=Array.prototype.join,Jo=Array.prototype.slice,Ur=Math.floor,Ot=typeof BigInt=="function"?BigInt.prototype.valueOf:null,At=Object.getOwnPropertySymbols,xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",O=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===le||"symbol")?Symbol.toStringTag:null,jr=Object.prototype.propertyIsEnumerable,Br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $r(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Nr.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Ur(-t):Ur(t);if(r!==t){var i=String(r),o=Et.call(e,i.length+1);return V.call(i,n,"$&_")+"."+V.call(V.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return V.call(e,n,"$&_")}var _t=jo,Gr=_t.custom,zr=Vr(Gr)?Gr:null,qo=function t(e,n,r,i){var o=n||{};if(W(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=W(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Jr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?$r(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?$r(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof e=="object")return It(e)?"[Array]":"[Object]";var f=ps(o,r);if(typeof i>"u")i=[];else if(Wr(i,e)>=0)return"[Circular]";function p(z,ye,rt){if(ye&&(i=Jo.call(i),i.push(ye)),rt){var ge={depth:o.depth};return W(o,"quoteStyle")&&(ge.quoteStyle=o.quoteStyle),t(z,ge,r+1,i)}return t(z,o,r+1,i)}if(typeof e=="function"&&!wr(e)){var m=ns(e),h=we(e,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+j.call(h,", ")+" }":"")}if(Vr(e)){var y=le?V.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):xt.call(e);return typeof e=="object"&&!le?Ee(y):y}if(ls(e)){for(var T="<"+Mr.call(String(e.nodeName)),g=e.attributes||[],_=0;_<g.length;_++)T+=" "+g[_].name+"="+Hr(Ko(g[_].value),"double",o);return T+=">",e.childNodes&&e.childNodes.length&&(T+="..."),T+="</"+Mr.call(String(e.nodeName))+">",T}if(It(e)){if(e.length===0)return"[]";var k=we(e,p);return f&&!fs(k)?"["+Lt(k,f)+"]":"[ "+j.call(k,", ")+" ]"}if(Yo(e)){var q=we(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!jr.call(e,"cause")?"{ ["+String(e)+"] "+j.call(Fr.call("[cause]: "+p(e.cause),q),", ")+" }":q.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(q,", ")+" }"}if(typeof e=="object"&&s){if(zr&&typeof e[zr]=="function"&&_t)return _t(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(is(e)){var Ae=[];return Dr&&Dr.call(e,function(z,ye){Ae.push(p(ye,e,!0)+" => "+p(z,e))}),qr("Map",ze.call(e),Ae,f)}if(as(e)){var tt=[];return Lr&&Lr.call(e,function(z){tt.push(p(z,e))}),qr("Set",He.call(e),tt,f)}if(os(e))return Dt("WeakMap");if(cs(e))return Dt("WeakSet");if(ss(e))return Dt("WeakRef");if(Zo(e))return Ee(p(Number(e)));if(ts(e))return Ee(p(Ot.call(e)));if(es(e))return Ee(zo.call(e));if(Xo(e))return Ee(p(String(e)));if(!Qo(e)&&!wr(e)){var re=we(e,p),K=Br?Br(e)===Object.prototype:e instanceof Object||e.constructor===Object,he=e instanceof Object?"":"null prototype",me=!K&&O&&Object(e)===e&&O in e?Et.call(J(e),8,-1):he?"Object":"",xe=K||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",N=xe+(me||he?"["+j.call(Fr.call([],me||[],he||[]),": ")+"] ":"");return re.length===0?N+"{}":f?N+"{"+Lt(re,f)+"}":N+"{ "+j.call(re,", ")+" }"}return String(e)};function Hr(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function Ko(t){return V.call(String(t),/"/g,"&quot;")}function It(t){return J(t)==="[object Array]"&&(!O||!(typeof t=="object"&&O in t))}function Qo(t){return J(t)==="[object Date]"&&(!O||!(typeof t=="object"&&O in t))}function wr(t){return J(t)==="[object RegExp]"&&(!O||!(typeof t=="object"&&O in t))}function Yo(t){return J(t)==="[object Error]"&&(!O||!(typeof t=="object"&&O in t))}function Xo(t){return J(t)==="[object String]"&&(!O||!(typeof t=="object"&&O in t))}function Zo(t){return J(t)==="[object Number]"&&(!O||!(typeof t=="object"&&O in t))}function es(t){return J(t)==="[object Boolean]"&&(!O||!(typeof t=="object"&&O in t))}function Vr(t){if(le)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!xt)return!1;try{return xt.call(t),!0}catch{}return!1}function ts(t){if(!t||typeof t!="object"||!Ot)return!1;try{return Ot.call(t),!0}catch{}return!1}var rs=Object.prototype.hasOwnProperty||function(t){return t in this};function W(t,e){return rs.call(t,e)}function J(t){return Ho.call(t)}function ns(t){if(t.name)return t.name;var e=Vo.call(wo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Wr(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function is(t){if(!ze||!t||typeof t!="object")return!1;try{ze.call(t);try{He.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function os(t){if(!Te||!t||typeof t!="object")return!1;try{Te.call(t,Te);try{Pe.call(t,Pe)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ss(t){if(!kr||!t||typeof t!="object")return!1;try{return kr.call(t),!0}catch{}return!1}function as(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{ze.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function cs(t){if(!Pe||!t||typeof t!="object")return!1;try{Pe.call(t,Pe);try{Te.call(t,Te)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ls(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Jr(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Jr(Et.call(t,0,e.maxStringLength),e)+r}var i=V.call(V.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,us);return Hr(i,"single",e)}function us(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Wo.call(e.toString(16))}function Ee(t){return"Object("+t+")"}function Dt(t){return t+" { ? }"}function qr(t,e,n,r){var i=r?Lt(n,r):j.call(n,", ");return t+" ("+e+") {"+i+"}"}function fs(t){for(var e=0;e<t.length;e++)if(Wr(t[e],`
4
4
  `)>=0)return!1;return!0}function ps(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=j.call(Array(t.indent+1)," ");else return null;return{base:n,prev:j.call(Array(e+1),n)}}function Lt(t,e){if(t.length===0)return"";var n=`
5
5
  `+e.prev+e.base;return n+j.call(t,","+n)+`
6
- `+e.prev}function we(t,e){var n=It(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=W(t,i)?e(t[i],t):""}var o=typeof At=="function"?At(t):[],s;if(le){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)W(t,l)&&(n&&String(Number(l))===l&&l<t.length||le&&s["$"+l]instanceof Symbol||(Nr.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if(typeof At=="function")for(var c=0;c<o.length;c++)jr.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var kt=Ct,ue=Uo,ds=qo,hs=kt("%TypeError%"),Ve=kt("%WeakMap%",!0),We=kt("%Map%",!0),ms=ue("WeakMap.prototype.get",!0),ys=ue("WeakMap.prototype.set",!0),gs=ue("WeakMap.prototype.has",!0),Ss=ue("Map.prototype.get",!0),vs=ue("Map.prototype.set",!0),Cs=ue("Map.prototype.has",!0),Mt=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},Rs=function(t,e){var n=Mt(t,e);return n&&n.value},bs=function(t,e,n){var r=Mt(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},Ts=function(t,e){return!!Mt(t,e)},Ps=function(){var e,n,r,i={assert:function(o){if(!i.has(o))throw new hs("Side channel does not contain "+ds(o))},get:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return ms(e,o)}else if(We){if(n)return Ss(n,o)}else if(r)return Rs(r,o)},has:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return gs(e,o)}else if(We){if(n)return Cs(n,o)}else if(r)return Ts(r,o);return!1},set:function(o,s){Ve&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ve),ys(e,o,s)):We?(n||(n=new We),vs(n,o,s)):(r||(r={key:{},next:null}),bs(r,o,s))}};return i},Es=String.prototype.replace,Os=/%20/g,Nt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ft={default:Nt.RFC3986,formatters:{RFC1738:function(t){return Es.call(t,Os,"+")},RFC3986:function(t){return String(t)}},RFC1738:Nt.RFC1738,RFC3986:Nt.RFC3986},As=Ft,Ut=Object.prototype.hasOwnProperty,X=Array.isArray,B=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),xs=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(X(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},Kr=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},_s=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(X(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Ut.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return X(e)&&!X(n)&&(i=Kr(e,r)),X(e)&&X(n)?(n.forEach(function(o,s){if(Ut.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,r):e.push(o)}else e[s]=o}),e):Object.keys(n).reduce(function(o,s){var a=n[s];return Ut.call(o,s)?o[s]=t(o[s],a,r):o[s]=a,o},i)},Is=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Ds=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Ls=function(e,n,r,i,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;++l){var c=s.charCodeAt(l);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===As.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+B[c];continue}if(c<2048){a=a+(B[192|c>>6]+B[128|c&63]);continue}if(c<55296||c>=57344){a=a+(B[224|c>>12]+B[128|c>>6&63]+B[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=B[240|c>>18]+B[128|c>>12&63]+B[128|c>>6&63]+B[128|c&63]}return a},ks=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:s,prop:c}),r.push(u))}return xs(n),e},Ms=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ns=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Fs=function(e,n){return[].concat(e,n)},Us=function(e,n){if(X(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Qr={arrayToObject:Kr,assign:Is,combine:Fs,compact:ks,decode:Ds,encode:Ls,isBuffer:Ns,isRegExp:Ms,maybeMap:Us,merge:_s},Yr=Ps,Je=Qr,Oe=Ft,js=Object.prototype.hasOwnProperty,Xr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},G=Array.isArray,Bs=Array.prototype.push,Zr=function(t,e){Bs.apply(t,G(e)?e:[e])},$s=Date.prototype.toISOString,en=Oe.default,A={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Je.encode,encodeValuesOnly:!1,format:en,formatter:Oe.formatters[en],indices:!1,serializeDate:function(e){return $s.call(e)},skipNulls:!1,strictNullHandling:!1},Gs=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},jt={},zs=function t(e,n,r,i,o,s,a,l,c,u,f,p,m,h,y,T){for(var g=e,_=T,L=0,q=!1;(_=_.get(jt))!==void 0&&!q;){var Ae=_.get(e);if(L+=1,typeof Ae<"u"){if(Ae===L)throw new RangeError("Cyclic object value");q=!0}typeof _.get(jt)>"u"&&(L=0)}if(typeof l=="function"?g=l(n,g):g instanceof Date?g=f(g):r==="comma"&&G(g)&&(g=Je.maybeMap(g,function(ge){return ge instanceof Date?f(ge):ge})),g===null){if(o)return a&&!h?a(n,A.encoder,y,"key",p):n;g=""}if(Gs(g)||Je.isBuffer(g)){if(a){var tt=h?n:a(n,A.encoder,y,"key",p);return[m(tt)+"="+m(a(g,A.encoder,y,"value",p))]}return[m(n)+"="+m(String(g))]}var re=[];if(typeof g>"u")return re;var K;if(r==="comma"&&G(g))h&&a&&(g=Je.maybeMap(g,a)),K=[{value:g.length>0?g.join(",")||null:void 0}];else if(G(l))K=l;else{var he=Object.keys(g);K=c?he.sort(c):he}for(var me=i&&G(g)&&g.length===1?n+"[]":n,xe=0;xe<K.length;++xe){var N=K[xe],z=typeof N=="object"&&typeof N.value<"u"?N.value:g[N];if(!(s&&z===null)){var ye=G(g)?typeof r=="function"?r(me,N):me:me+(u?"."+N:"["+N+"]");T.set(e,L);var rt=Yr();rt.set(jt,T),Zr(re,t(z,ye,r,i,o,s,r==="comma"&&h&&G(g)?null:a,l,c,u,f,p,m,h,y,rt))}}return re},Hs=function(e){if(!e)return A;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||A.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Oe.default;if(typeof e.format<"u"){if(!js.call(Oe.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Oe.formatters[r],o=A.filter;return(typeof e.filter=="function"||G(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:A.addQueryPrefix,allowDots:typeof e.allowDots>"u"?A.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:A.charsetSentinel,delimiter:typeof e.delimiter>"u"?A.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:A.encode,encoder:typeof e.encoder=="function"?e.encoder:A.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:A.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:A.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:A.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:A.strictNullHandling}},ws=function(t,e){var n=t,r=Hs(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):G(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in Xr?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Xr[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var u=Yr(),f=0;f<i.length;++f){var p=i[f];r.skipNulls&&n[p]===null||Zr(s,zs(n[p],p,l,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var m=s.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),m.length>0?h+m:""},fe=Qr,Bt=Object.prototype.hasOwnProperty,Vs=Array.isArray,E={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ws=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},tn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Js="utf8=%26%2310003%3B",qs="utf8=%E2%9C%93",Ks=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===qs?c="utf-8":s[l]===Js&&(c="iso-8859-1"),a=l,l=s.length);for(l=0;l<s.length;++l)if(l!==a){var u=s[l],f=u.indexOf("]="),p=f===-1?u.indexOf("="):f+1,m,h;p===-1?(m=n.decoder(u,E.decoder,c,"key"),h=n.strictNullHandling?null:""):(m=n.decoder(u.slice(0,p),E.decoder,c,"key"),h=fe.maybeMap(tn(u.slice(p+1),n),function(y){return n.decoder(y,E.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=Ws(h)),u.indexOf("[]=")>-1&&(h=Vs(h)?[h]:h),Bt.call(r,m)?r[m]=fe.combine(r[m],h):r[m]=h}return r},Qs=function(t,e,n,r){for(var i=r?e:tn(e,n),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!n.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},Ys=function(e,n,r,i){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!r.plainObjects&&Bt.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var f=0;r.depth>0&&(l=a.exec(o))!==null&&f<r.depth;){if(f+=1,!r.plainObjects&&Bt.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),Qs(u,n,r,i)}},Xs=function(e){if(!e)return E;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?E.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?E.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:E.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:E.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:E.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:E.comma,decoder:typeof e.decoder=="function"?e.decoder:E.decoder,delimiter:typeof e.delimiter=="string"||fe.isRegExp(e.delimiter)?e.delimiter:E.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:E.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:E.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:E.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:E.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}},Zs=function(t,e){var n=Xs(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?Ks(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],l=Ys(a,r[a],n,typeof t=="string");i=fe.merge(i,l,n)}return n.allowSparse===!0?i:fe.compact(i)},ea=ws,ta=Zs,ra=Ft,na={formats:ra,parse:ta,stringify:ea};const ia=br(na);class rn{constructor(e){S(this,"axiosInstance");this.axiosInstance=co.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((n,r)=>{this.axiosInstance.request(e).then(i=>n(i)).catch(i=>r(i))})}Get(e,n,r){return new Promise((i,o)=>{n&&(r?r.params=n:r={params:n}),r&&(r.paramsSerializer={serialize:(s,a)=>ia.stringify(s,{indices:!1})}),this.axiosInstance.get(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Post(e,n,r){return new Promise((i,o)=>{this.axiosInstance.post(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Put(e,n,r){return new Promise((i,o)=>{this.axiosInstance.put(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Delete(e,n,r){return new Promise((i,o)=>{n&&(r?r.data=n:r={data:n}),this.axiosInstance.delete(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}}class oa{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}}var x=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t))(x||{}),Z=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(Z||{});let nn=!0,on=!0;function qe(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function ee(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const l=c=>{const u=n(c);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,l),i.apply(this,[s,l])};const o=r.removeEventListener;r.removeEventListener=function(s,a){if(s!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(a))return o.apply(this,arguments);const l=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[s,l])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function sa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(nn=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function aa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(on=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function sn(){if(typeof window=="object"){if(nn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $t(t,e){on&&console.warn(t+" is deprecated, please use "+e+" instead.")}function ca(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=qe(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=qe(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=qe(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function an(t){return Object.prototype.toString.call(t)==="[object Object]"}function cn(t){return an(t)?Object.keys(t).reduce(function(e,n){const r=an(t[n]),i=r?cn(t[n]):t[n],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[n]:i})},{}):t}function Gt(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Gt(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(i=>{Gt(t,t.get(i),n)})}))}function ln(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const o=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&o.push(s)}),o.forEach(s=>{t.forEach(a=>{a.type===r&&a.trackId===s.id&&Gt(t,a,i)})}),i}const un=sn;function fn(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const l={};return Object.keys(a).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof a[c]=="object"?a[c]:{ideal:a[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const f=function(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",c)]=u.ideal,l.optional.push(p),p={},p[f("max",c)]=u.ideal,l.optional.push(p)):(p[f("",c)]=u.ideal,l.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(p,c)]=u[p])})}),a.advanced&&(l.optional=(l.optional||[]).concat(a.advanced)),l},i=function(a,l){if(e.version>=61)return l(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const c=function(u,f,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=r(a.audio)}if(a&&typeof a.video=="object"){let c=a.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete a.video.facingMode;let f;if(c.exact==="environment"||c.ideal==="environment"?f=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(f=["front"]),f)return n.mediaDevices.enumerateDevices().then(p=>{p=p.filter(h=>h.kind==="videoinput");let m=p.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=r(a.video),un("chrome: "+JSON.stringify(a)),l(a)})}a.video=r(a.video)}return un("chrome: "+JSON.stringify(a)),l(a)},o=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(a,l,c){i(a,u=>{n.webkitGetUserMedia(u,l,f=>{c&&c(o(f))})})};if(n.getUserMedia=s.bind(n),n.mediaDevices.getUserMedia){const a=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(l){return i(l,c=>a(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(o(u))))}}}function la(t,e){if(!(t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices)&&t.navigator.mediaDevices){if(typeof e!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}t.navigator.mediaDevices.getDisplayMedia=function(r){return e(r).then(i=>{const o=r.video&&r.video.width,s=r.video&&r.video.height,a=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:a||3}},o&&(r.video.mandatory.maxWidth=o),s&&(r.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(r)})}}}function pn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function dn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.track.id):o={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.id):o={track:i};const s=new Event("track");s.track=i,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else ee(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function hn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(a,l){let c=i.apply(this,arguments);return c||(c=e(this,a),this._senders.push(c)),c};const o=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(a){o.apply(this,arguments);const l=this._senders.indexOf(a);l!==-1&&this._senders.splice(l,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],n.apply(this,[o]),o.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(s=>{const a=this._senders.find(l=>l.track===s);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function mn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,i,o]=arguments;if(arguments.length>0&&typeof r=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof r!="function"))return e.apply(this,[]);const s=function(l){const c={};return l.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),c[p.id]=p}),c},a=function(l){return new Map(Object.keys(l).map(c=>[c,l[c]]))};if(arguments.length>=2){const l=function(c){i(a(s(c)))};return e.apply(this,[l,r])}return new Promise((l,c)=>{e.apply(this,[function(u){l(a(s(u)))},c])}).then(i,o)}}function yn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const n=t.RTCPeerConnection.prototype.getSenders;n&&(t.RTCPeerConnection.prototype.getSenders=function(){const o=n.apply(this,[]);return o.forEach(s=>s._pc=this),o});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const o=r.apply(this,arguments);return o._pc=this,o}),t.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(s=>ln(s,o.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const n=t.RTCPeerConnection.prototype.getReceivers;n&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=n.apply(this,[]);return i.forEach(o=>o._pc=this),i}),ee(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>ln(o,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const r=arguments[0];let i,o,s;return this.getSenders().forEach(a=>{a.track===r&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===r&&(o?s=!0:o=a),a.track===r)),s||i&&o?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():o?o.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function gn(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const l=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(l)===-1&&this._shimmedLocalStreams[a.id].push(l):this._shimmedLocalStreams[a.id]=[a,l],l};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(f=>f.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();n.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(l)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const l=this._shimmedLocalStreams[a].indexOf(s);l!==-1&&this._shimmedLocalStreams[a].splice(l,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),i.apply(this,arguments)}}function Sn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return gn(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=n.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(f=>{if(this.getSenders().find(m=>m.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const f=new t.MediaStream(u.getTracks());this._streams[u.id]=f,this._reverseStreams[f.id]=u,u=f}r.apply(this,[u])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},t.RTCPeerConnection.prototype.addTrack=function(u,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const p=[].slice.call(arguments,1);if(p.length!==1||!p[0].getTracks().find(y=>y===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(y=>y.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const h=this._streams[f.id];if(h)h.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const y=new t.MediaStream([u]);this._streams[f.id]=y,this._reverseStreams[y.id]=f,this.addStream(y)}return this.getSenders().find(y=>y.track===u)};function o(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(p=>{const m=c._reverseStreams[p],h=c._streams[m.id];f=f.replace(new RegExp(h.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:f})}function s(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(p=>{const m=c._reverseStreams[p],h=c._streams[m.id];f=f.replace(new RegExp(m.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:f})}["createOffer","createAnswer"].forEach(function(c){const u=t.RTCPeerConnection.prototype[c],f={[c](){const p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);p[0].apply(null,[y])},h=>{p[1]&&p[1].apply(null,h)},arguments[2]]):u.apply(this,arguments).then(h=>o(this,h))}};t.RTCPeerConnection.prototype[c]=f[c]});const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=s(this,arguments[0]),a.apply(this,arguments))};const l=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=l.get.apply(this);return c.type===""?c:o(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function zt(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=t.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=i[n]})}function vn(t,e){ee(t,"negotiationneeded",n=>{const r=n.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return n})}const Cn=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:vn,shimAddTrackRemoveTrack:Sn,shimAddTrackRemoveTrackWithNative:gn,shimGetDisplayMedia:la,shimGetSendersWithDtmf:hn,shimGetStats:mn,shimGetUserMedia:fn,shimMediaStream:pn,shimOnTrack:dn,shimPeerConnection:zt,shimSenderReceiverGetStats:yn},Symbol.toStringTag,{value:"Module"}));function Rn(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(i,o,s){$t("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(i).then(o,s)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const i=function(s,a,l){a in s&&!(l in s)&&(s[l]=s[a],delete s[a])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),o(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[a])}}}}function ua(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}function bn(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ht(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[o,s,a]=arguments;return r.apply(this,[o||null]).then(l=>{if(e.version<53&&!s)try{l.forEach(c=>{c.type=n[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,f)=>{l.set(f,Object.assign({},u,{type:n[u.type]||u.type}))})}return l}).then(s,a)}}function Tn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(o=>o._pc=this),i});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=n.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Pn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),ee(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function En(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){$t("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&n.getTracks().includes(r.track)&&this.removeTrack(r)})})}function On(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function An(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const o=e.apply(this,arguments);if(i){const{sender:s}=o,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return o})}function xn(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function _n(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function In(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}const Dn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:An,shimCreateAnswer:In,shimCreateOffer:_n,shimGetDisplayMedia:ua,shimGetParameters:xn,shimGetUserMedia:Rn,shimOnTrack:bn,shimPeerConnection:Ht,shimRTCDataChannel:On,shimReceiverGetStats:Pn,shimRemoveStream:En,shimSenderGetStats:Tn},Symbol.toStringTag,{value:"Module"}));function Ln(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},t.RTCPeerConnection.prototype.addTrack=function(r,...i){return i&&i.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(n);if(r===-1)return;this._localStreams.splice(r,1);const i=n.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function kn(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(o)>=0)return;r._remoteStreams.push(o);const s=new Event("addstream");s.stream=o,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Mn(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p};let a=function(l,c,u){const f=i.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f};e.setLocalDescription=a,a=function(l,c,u){const f=o.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.setRemoteDescription=a,a=function(l,c,u){const f=s.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.addIceCandidate=a}function Nn(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=i=>r(Fn(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}).bind(e))}function Fn(t){return t&&t.video!==void 0?Object.assign({},t,{video:cn(t.video)}):t}function Un(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const o=[];for(let s=0;s<r.iceServers.length;s++){let a=r.iceServers[s];a.urls===void 0&&a.url?($t("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,o.push(a)):o.push(r.iceServers[s])}r.iceServers=o}return new e(r,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function jn(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Bn(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const o=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function $n(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const Gn=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:$n,shimCallbacksAPI:Mn,shimConstraints:Fn,shimCreateOfferLegacy:Bn,shimGetUserMedia:Nn,shimLocalStreamsAPI:Ln,shimRTCIceServerUrls:Un,shimRemoteStreamsAPI:kn,shimTrackEventTransceiver:jn},Symbol.toStringTag,{value:"Module"}));var zn={exports:{}};(function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(n){return n.trim().split(`
6
+ `+e.prev}function we(t,e){var n=It(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=W(t,i)?e(t[i],t):""}var o=typeof At=="function"?At(t):[],s;if(le){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)W(t,l)&&(n&&String(Number(l))===l&&l<t.length||le&&s["$"+l]instanceof Symbol||(Nr.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if(typeof At=="function")for(var c=0;c<o.length;c++)jr.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var kt=Ct,ue=Uo,ds=qo,hs=kt("%TypeError%"),Ve=kt("%WeakMap%",!0),We=kt("%Map%",!0),ms=ue("WeakMap.prototype.get",!0),ys=ue("WeakMap.prototype.set",!0),gs=ue("WeakMap.prototype.has",!0),Ss=ue("Map.prototype.get",!0),vs=ue("Map.prototype.set",!0),Cs=ue("Map.prototype.has",!0),Mt=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},Rs=function(t,e){var n=Mt(t,e);return n&&n.value},bs=function(t,e,n){var r=Mt(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},Ts=function(t,e){return!!Mt(t,e)},Ps=function(){var e,n,r,i={assert:function(o){if(!i.has(o))throw new hs("Side channel does not contain "+ds(o))},get:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return ms(e,o)}else if(We){if(n)return Ss(n,o)}else if(r)return Rs(r,o)},has:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return gs(e,o)}else if(We){if(n)return Cs(n,o)}else if(r)return Ts(r,o);return!1},set:function(o,s){Ve&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ve),ys(e,o,s)):We?(n||(n=new We),vs(n,o,s)):(r||(r={key:{},next:null}),bs(r,o,s))}};return i},Es=String.prototype.replace,Os=/%20/g,Nt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ft={default:Nt.RFC3986,formatters:{RFC1738:function(t){return Es.call(t,Os,"+")},RFC3986:function(t){return String(t)}},RFC1738:Nt.RFC1738,RFC3986:Nt.RFC3986},As=Ft,Ut=Object.prototype.hasOwnProperty,X=Array.isArray,B=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),xs=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(X(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},Kr=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},_s=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(X(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Ut.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return X(e)&&!X(n)&&(i=Kr(e,r)),X(e)&&X(n)?(n.forEach(function(o,s){if(Ut.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,r):e.push(o)}else e[s]=o}),e):Object.keys(n).reduce(function(o,s){var a=n[s];return Ut.call(o,s)?o[s]=t(o[s],a,r):o[s]=a,o},i)},Is=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Ds=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Ls=function(e,n,r,i,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;++l){var c=s.charCodeAt(l);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===As.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+B[c];continue}if(c<2048){a=a+(B[192|c>>6]+B[128|c&63]);continue}if(c<55296||c>=57344){a=a+(B[224|c>>12]+B[128|c>>6&63]+B[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=B[240|c>>18]+B[128|c>>12&63]+B[128|c>>6&63]+B[128|c&63]}return a},ks=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:s,prop:c}),r.push(u))}return xs(n),e},Ms=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ns=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Fs=function(e,n){return[].concat(e,n)},Us=function(e,n){if(X(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Qr={arrayToObject:Kr,assign:Is,combine:Fs,compact:ks,decode:Ds,encode:Ls,isBuffer:Ns,isRegExp:Ms,maybeMap:Us,merge:_s},Yr=Ps,Je=Qr,Oe=Ft,js=Object.prototype.hasOwnProperty,Xr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},G=Array.isArray,Bs=Array.prototype.push,Zr=function(t,e){Bs.apply(t,G(e)?e:[e])},$s=Date.prototype.toISOString,en=Oe.default,A={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Je.encode,encodeValuesOnly:!1,format:en,formatter:Oe.formatters[en],indices:!1,serializeDate:function(e){return $s.call(e)},skipNulls:!1,strictNullHandling:!1},Gs=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},jt={},zs=function t(e,n,r,i,o,s,a,l,c,u,f,p,m,h,y,T){for(var g=e,_=T,k=0,q=!1;(_=_.get(jt))!==void 0&&!q;){var Ae=_.get(e);if(k+=1,typeof Ae<"u"){if(Ae===k)throw new RangeError("Cyclic object value");q=!0}typeof _.get(jt)>"u"&&(k=0)}if(typeof l=="function"?g=l(n,g):g instanceof Date?g=f(g):r==="comma"&&G(g)&&(g=Je.maybeMap(g,function(ge){return ge instanceof Date?f(ge):ge})),g===null){if(o)return a&&!h?a(n,A.encoder,y,"key",p):n;g=""}if(Gs(g)||Je.isBuffer(g)){if(a){var tt=h?n:a(n,A.encoder,y,"key",p);return[m(tt)+"="+m(a(g,A.encoder,y,"value",p))]}return[m(n)+"="+m(String(g))]}var re=[];if(typeof g>"u")return re;var K;if(r==="comma"&&G(g))h&&a&&(g=Je.maybeMap(g,a)),K=[{value:g.length>0?g.join(",")||null:void 0}];else if(G(l))K=l;else{var he=Object.keys(g);K=c?he.sort(c):he}for(var me=i&&G(g)&&g.length===1?n+"[]":n,xe=0;xe<K.length;++xe){var N=K[xe],z=typeof N=="object"&&typeof N.value<"u"?N.value:g[N];if(!(s&&z===null)){var ye=G(g)?typeof r=="function"?r(me,N):me:me+(u?"."+N:"["+N+"]");T.set(e,k);var rt=Yr();rt.set(jt,T),Zr(re,t(z,ye,r,i,o,s,r==="comma"&&h&&G(g)?null:a,l,c,u,f,p,m,h,y,rt))}}return re},Hs=function(e){if(!e)return A;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||A.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Oe.default;if(typeof e.format<"u"){if(!js.call(Oe.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Oe.formatters[r],o=A.filter;return(typeof e.filter=="function"||G(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:A.addQueryPrefix,allowDots:typeof e.allowDots>"u"?A.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:A.charsetSentinel,delimiter:typeof e.delimiter>"u"?A.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:A.encode,encoder:typeof e.encoder=="function"?e.encoder:A.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:A.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:A.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:A.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:A.strictNullHandling}},ws=function(t,e){var n=t,r=Hs(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):G(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in Xr?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Xr[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var u=Yr(),f=0;f<i.length;++f){var p=i[f];r.skipNulls&&n[p]===null||Zr(s,zs(n[p],p,l,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var m=s.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),m.length>0?h+m:""},fe=Qr,Bt=Object.prototype.hasOwnProperty,Vs=Array.isArray,E={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ws=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},tn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Js="utf8=%26%2310003%3B",qs="utf8=%E2%9C%93",Ks=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===qs?c="utf-8":s[l]===Js&&(c="iso-8859-1"),a=l,l=s.length);for(l=0;l<s.length;++l)if(l!==a){var u=s[l],f=u.indexOf("]="),p=f===-1?u.indexOf("="):f+1,m,h;p===-1?(m=n.decoder(u,E.decoder,c,"key"),h=n.strictNullHandling?null:""):(m=n.decoder(u.slice(0,p),E.decoder,c,"key"),h=fe.maybeMap(tn(u.slice(p+1),n),function(y){return n.decoder(y,E.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=Ws(h)),u.indexOf("[]=")>-1&&(h=Vs(h)?[h]:h),Bt.call(r,m)?r[m]=fe.combine(r[m],h):r[m]=h}return r},Qs=function(t,e,n,r){for(var i=r?e:tn(e,n),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!n.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},Ys=function(e,n,r,i){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!r.plainObjects&&Bt.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var f=0;r.depth>0&&(l=a.exec(o))!==null&&f<r.depth;){if(f+=1,!r.plainObjects&&Bt.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),Qs(u,n,r,i)}},Xs=function(e){if(!e)return E;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?E.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?E.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:E.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:E.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:E.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:E.comma,decoder:typeof e.decoder=="function"?e.decoder:E.decoder,delimiter:typeof e.delimiter=="string"||fe.isRegExp(e.delimiter)?e.delimiter:E.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:E.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:E.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:E.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:E.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}},Zs=function(t,e){var n=Xs(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?Ks(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],l=Ys(a,r[a],n,typeof t=="string");i=fe.merge(i,l,n)}return n.allowSparse===!0?i:fe.compact(i)},ea=ws,ta=Zs,ra=Ft,na={formats:ra,parse:ta,stringify:ea};const ia=br(na);class rn{constructor(e){S(this,"axiosInstance");this.axiosInstance=co.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((n,r)=>{this.axiosInstance.request(e).then(i=>n(i)).catch(i=>r(i))})}Get(e,n,r){return new Promise((i,o)=>{n&&(r?r.params=n:r={params:n}),r&&(r.paramsSerializer={serialize:(s,a)=>ia.stringify(s,{indices:!1})}),this.axiosInstance.get(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Post(e,n,r){return new Promise((i,o)=>{this.axiosInstance.post(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Put(e,n,r){return new Promise((i,o)=>{this.axiosInstance.put(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Delete(e,n,r){return new Promise((i,o)=>{n&&(r?r.data=n:r={data:n}),this.axiosInstance.delete(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}}class oa{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}}var x=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t))(x||{}),Z=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(Z||{});let nn=!0,on=!0;function qe(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function ee(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const l=c=>{const u=n(c);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,l),i.apply(this,[s,l])};const o=r.removeEventListener;r.removeEventListener=function(s,a){if(s!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(a))return o.apply(this,arguments);const l=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[s,l])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function sa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(nn=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function aa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(on=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function sn(){if(typeof window=="object"){if(nn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $t(t,e){on&&console.warn(t+" is deprecated, please use "+e+" instead.")}function ca(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=qe(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=qe(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=qe(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function an(t){return Object.prototype.toString.call(t)==="[object Object]"}function cn(t){return an(t)?Object.keys(t).reduce(function(e,n){const r=an(t[n]),i=r?cn(t[n]):t[n],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[n]:i})},{}):t}function Gt(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Gt(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(i=>{Gt(t,t.get(i),n)})}))}function ln(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const o=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&o.push(s)}),o.forEach(s=>{t.forEach(a=>{a.type===r&&a.trackId===s.id&&Gt(t,a,i)})}),i}const un=sn;function fn(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const l={};return Object.keys(a).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof a[c]=="object"?a[c]:{ideal:a[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const f=function(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",c)]=u.ideal,l.optional.push(p),p={},p[f("max",c)]=u.ideal,l.optional.push(p)):(p[f("",c)]=u.ideal,l.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(p,c)]=u[p])})}),a.advanced&&(l.optional=(l.optional||[]).concat(a.advanced)),l},i=function(a,l){if(e.version>=61)return l(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const c=function(u,f,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=r(a.audio)}if(a&&typeof a.video=="object"){let c=a.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete a.video.facingMode;let f;if(c.exact==="environment"||c.ideal==="environment"?f=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(f=["front"]),f)return n.mediaDevices.enumerateDevices().then(p=>{p=p.filter(h=>h.kind==="videoinput");let m=p.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=r(a.video),un("chrome: "+JSON.stringify(a)),l(a)})}a.video=r(a.video)}return un("chrome: "+JSON.stringify(a)),l(a)},o=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(a,l,c){i(a,u=>{n.webkitGetUserMedia(u,l,f=>{c&&c(o(f))})})};if(n.getUserMedia=s.bind(n),n.mediaDevices.getUserMedia){const a=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(l){return i(l,c=>a(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(o(u))))}}}function la(t,e){if(!(t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices)&&t.navigator.mediaDevices){if(typeof e!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}t.navigator.mediaDevices.getDisplayMedia=function(r){return e(r).then(i=>{const o=r.video&&r.video.width,s=r.video&&r.video.height,a=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:a||3}},o&&(r.video.mandatory.maxWidth=o),s&&(r.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(r)})}}}function pn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function dn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.track.id):o={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.id):o={track:i};const s=new Event("track");s.track=i,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else ee(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function hn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(a,l){let c=i.apply(this,arguments);return c||(c=e(this,a),this._senders.push(c)),c};const o=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(a){o.apply(this,arguments);const l=this._senders.indexOf(a);l!==-1&&this._senders.splice(l,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],n.apply(this,[o]),o.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(s=>{const a=this._senders.find(l=>l.track===s);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function mn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,i,o]=arguments;if(arguments.length>0&&typeof r=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof r!="function"))return e.apply(this,[]);const s=function(l){const c={};return l.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),c[p.id]=p}),c},a=function(l){return new Map(Object.keys(l).map(c=>[c,l[c]]))};if(arguments.length>=2){const l=function(c){i(a(s(c)))};return e.apply(this,[l,r])}return new Promise((l,c)=>{e.apply(this,[function(u){l(a(s(u)))},c])}).then(i,o)}}function yn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const n=t.RTCPeerConnection.prototype.getSenders;n&&(t.RTCPeerConnection.prototype.getSenders=function(){const o=n.apply(this,[]);return o.forEach(s=>s._pc=this),o});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const o=r.apply(this,arguments);return o._pc=this,o}),t.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(s=>ln(s,o.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const n=t.RTCPeerConnection.prototype.getReceivers;n&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=n.apply(this,[]);return i.forEach(o=>o._pc=this),i}),ee(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>ln(o,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const r=arguments[0];let i,o,s;return this.getSenders().forEach(a=>{a.track===r&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===r&&(o?s=!0:o=a),a.track===r)),s||i&&o?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():o?o.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function gn(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const l=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(l)===-1&&this._shimmedLocalStreams[a.id].push(l):this._shimmedLocalStreams[a.id]=[a,l],l};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(f=>f.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();n.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(l)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const l=this._shimmedLocalStreams[a].indexOf(s);l!==-1&&this._shimmedLocalStreams[a].splice(l,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),i.apply(this,arguments)}}function Sn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return gn(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=n.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(f=>{if(this.getSenders().find(m=>m.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const f=new t.MediaStream(u.getTracks());this._streams[u.id]=f,this._reverseStreams[f.id]=u,u=f}r.apply(this,[u])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},t.RTCPeerConnection.prototype.addTrack=function(u,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const p=[].slice.call(arguments,1);if(p.length!==1||!p[0].getTracks().find(y=>y===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(y=>y.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const h=this._streams[f.id];if(h)h.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const y=new t.MediaStream([u]);this._streams[f.id]=y,this._reverseStreams[y.id]=f,this.addStream(y)}return this.getSenders().find(y=>y.track===u)};function o(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(p=>{const m=c._reverseStreams[p],h=c._streams[m.id];f=f.replace(new RegExp(h.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:f})}function s(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(p=>{const m=c._reverseStreams[p],h=c._streams[m.id];f=f.replace(new RegExp(m.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:f})}["createOffer","createAnswer"].forEach(function(c){const u=t.RTCPeerConnection.prototype[c],f={[c](){const p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);p[0].apply(null,[y])},h=>{p[1]&&p[1].apply(null,h)},arguments[2]]):u.apply(this,arguments).then(h=>o(this,h))}};t.RTCPeerConnection.prototype[c]=f[c]});const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=s(this,arguments[0]),a.apply(this,arguments))};const l=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=l.get.apply(this);return c.type===""?c:o(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function zt(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=t.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=i[n]})}function vn(t,e){ee(t,"negotiationneeded",n=>{const r=n.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return n})}const Cn=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:vn,shimAddTrackRemoveTrack:Sn,shimAddTrackRemoveTrackWithNative:gn,shimGetDisplayMedia:la,shimGetSendersWithDtmf:hn,shimGetStats:mn,shimGetUserMedia:fn,shimMediaStream:pn,shimOnTrack:dn,shimPeerConnection:zt,shimSenderReceiverGetStats:yn},Symbol.toStringTag,{value:"Module"}));function Rn(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(i,o,s){$t("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(i).then(o,s)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const i=function(s,a,l){a in s&&!(l in s)&&(s[l]=s[a],delete s[a])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),o(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[a])}}}}function ua(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}function bn(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ht(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[o,s,a]=arguments;return r.apply(this,[o||null]).then(l=>{if(e.version<53&&!s)try{l.forEach(c=>{c.type=n[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,f)=>{l.set(f,Object.assign({},u,{type:n[u.type]||u.type}))})}return l}).then(s,a)}}function Tn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(o=>o._pc=this),i});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=n.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Pn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),ee(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function En(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){$t("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&n.getTracks().includes(r.track)&&this.removeTrack(r)})})}function On(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function An(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const o=e.apply(this,arguments);if(i){const{sender:s}=o,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return o})}function xn(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function _n(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function In(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}const Dn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:An,shimCreateAnswer:In,shimCreateOffer:_n,shimGetDisplayMedia:ua,shimGetParameters:xn,shimGetUserMedia:Rn,shimOnTrack:bn,shimPeerConnection:Ht,shimRTCDataChannel:On,shimReceiverGetStats:Pn,shimRemoveStream:En,shimSenderGetStats:Tn},Symbol.toStringTag,{value:"Module"}));function Ln(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},t.RTCPeerConnection.prototype.addTrack=function(r,...i){return i&&i.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(n);if(r===-1)return;this._localStreams.splice(r,1);const i=n.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function kn(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(o)>=0)return;r._remoteStreams.push(o);const s=new Event("addstream");s.stream=o,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Mn(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=r.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p};let a=function(l,c,u){const f=i.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f};e.setLocalDescription=a,a=function(l,c,u){const f=o.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.setRemoteDescription=a,a=function(l,c,u){const f=s.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.addIceCandidate=a}function Nn(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=i=>r(Fn(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}).bind(e))}function Fn(t){return t&&t.video!==void 0?Object.assign({},t,{video:cn(t.video)}):t}function Un(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const o=[];for(let s=0;s<r.iceServers.length;s++){let a=r.iceServers[s];a.urls===void 0&&a.url?($t("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,o.push(a)):o.push(r.iceServers[s])}r.iceServers=o}return new e(r,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function jn(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Bn(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const o=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function $n(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const Gn=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:$n,shimCallbacksAPI:Mn,shimConstraints:Fn,shimCreateOfferLegacy:Bn,shimGetUserMedia:Nn,shimLocalStreamsAPI:Ln,shimRTCIceServerUrls:Un,shimRemoteStreamsAPI:kn,shimTrackEventTransceiver:jn},Symbol.toStringTag,{value:"Module"}));var zn={exports:{}};(function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(n){return n.trim().split(`
7
7
  `).map(r=>r.trim())},e.splitSections=function(n){return n.split(`
8
8
  m=`).map((i,o)=>(o>0?"m="+i:i).trim()+`\r
9
9
  `)},e.getDescription=function(n){const r=e.splitSections(n);return r&&r[0]},e.getMediaSections=function(n){const r=e.splitSections(n);return r.shift(),r},e.matchPrefix=function(n,r){return e.splitLines(n).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(n){let r;n.indexOf("a=candidate:")===0?r=n.substring(12).split(" "):r=n.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let o=8;o<r.length;o+=2)switch(r[o]){case"raddr":i.relatedAddress=r[o+1];break;case"rport":i.relatedPort=parseInt(r[o+1],10);break;case"tcptype":i.tcpType=r[o+1];break;case"ufrag":i.ufrag=r[o+1],i.usernameFragment=r[o+1];break;default:i[r[o]]===void 0&&(i[r[o]]=r[o+1]);break}return i},e.writeCandidate=function(n){const r=[];r.push(n.foundation);const i=n.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(n.protocol.toUpperCase()),r.push(n.priority),r.push(n.address||n.ip),r.push(n.port);const o=n.type;return r.push("typ"),r.push(o),o!=="host"&&n.relatedAddress&&n.relatedPort&&(r.push("raddr"),r.push(n.relatedAddress),r.push("rport"),r.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(r.push("ufrag"),r.push(n.usernameFragment||n.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(n){return n.substring(14).split(" ")},e.parseRtpMap=function(n){let r=n.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(n){let r=n.payloadType;n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType);const i=n.channels||n.numChannels||1;return"a=rtpmap:"+r+" "+n.name+"/"+n.clockRate+(i!==1?"/"+i:"")+`\r
@@ -37,4 +37,4 @@ t=0 0\r
37
37
  `},e.getDirection=function(n,r){const i=e.splitLines(n);for(let o=0;o<i.length;o++)switch(i[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[o].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(n){return e.splitLines(n)[0].split(" ")[0].substring(2)},e.isRejected=function(n){return n.split(" ",2)[1]==="0"},e.parseMLine=function(n){const i=e.splitLines(n)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(n){const i=e.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const r=e.splitLines(n);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},t.exports=e})(zn);var Hn=zn.exports;const pe=br(Hn),fa=D({__proto__:null,default:pe},[Hn]);function Ke(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),o=pe.parseCandidate(r.candidate);for(const s in o)s in i||Object.defineProperty(i,s,{value:o[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},t.RTCIceCandidate.prototype=e.prototype,ee(t,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new t.RTCIceCandidate(n.candidate),writable:"false"}),n))}function wt(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||ee(t,"icecandidate",e=>{if(e.candidate){const n=pe.parseCandidate(e.candidate.candidate);n.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e})}function Qe(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(a){if(!a||!a.sdp)return!1;const l=pe.splitSections(a.sdp);return l.shift(),l.some(c=>{const u=pe.parseMLine(c);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},r=function(a){const l=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(l===null||l.length<2)return-1;const c=parseInt(l[1],10);return c!==c?-1:c},i=function(a){let l=65536;return e.browser==="firefox"&&(e.version<57?a===-1?l=16384:l=2147483637:e.version<60?l=e.version===57?65535:65536:l=2147483637),l},o=function(a,l){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const u=pe.matchPrefix(a.sdp,"a=max-message-size:");return u.length>0?c=parseInt(u[0].substring(19),10):e.browser==="firefox"&&l!==-1&&(c=2147483637),c},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:l}=this.getConfiguration();l==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const l=r(arguments[0]),c=i(l),u=o(arguments[0],l);let f;c===0&&u===0?f=Number.POSITIVE_INFINITY:c===0||u===0?f=Math.max(c,u):f=Math.min(c,u);const p={};Object.defineProperty(p,"maxMessageSize",{get(){return f}}),this._sctp=p}return s.apply(this,arguments)}}function Ye(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(r,i){const o=r.send;r.send=function(){const a=arguments[0],l=a.length||a.size||a.byteLength;if(r.readyState==="open"&&i.sctp&&l>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return o.apply(r,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const i=n.apply(this,arguments);return e(i,this),i},ee(t,"datachannel",r=>(e(r.channel,r.target),r))}function Vt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const r=e[n];e[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const o=i.target;if(o._lastConnectionState!==o.connectionState){o._lastConnectionState=o.connectionState;const s=new Event("connectionstatechange",i);o.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function Wt(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
38
38
  a=extmap-allow-mixed`)!==-1){const o=i.sdp.split(`
39
39
  `).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
40
- `);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:o}):i.sdp=o}return n.apply(this,arguments)}}function Xe(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ze(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return n.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?n.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>n.apply(this,[s]))})}const pa=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Wt,shimAddIceCandidateNullOrEmpty:Xe,shimConnectionState:Vt,shimMaxMessageSize:Qe,shimParameterlessSetLocalDescription:Ze,shimRTCIceCandidate:Ke,shimRTCIceCandidateRelayProtocol:wt,shimSendThrowTypeError:Ye},Symbol.toStringTag,{value:"Module"}));function da({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=sn,r=ca(t),i={browserDetails:r,commonShim:pa,extractVersion:qe,disableLog:sa,disableWarnings:aa,sdp:fa};switch(r.browser){case"chrome":if(!Cn||!zt||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=Cn,Xe(t,r),Ze(t),fn(t,r),pn(t),zt(t,r),dn(t),Sn(t,r),hn(t),mn(t),yn(t),vn(t,r),Ke(t),wt(t),Vt(t),Qe(t,r),Ye(t),Wt(t,r);break;case"firefox":if(!Dn||!Ht||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=Dn,Xe(t,r),Ze(t),Rn(t,r),Ht(t,r),bn(t),En(t),Tn(t),Pn(t),On(t),An(t),xn(t),_n(t),In(t),Ke(t),Vt(t),Qe(t,r),Ye(t);break;case"safari":if(!Gn||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=Gn,Xe(t,r),Ze(t),Un(t),Bn(t),Mn(t),Ln(t),kn(t),jn(t),Nn(t),$n(t),Ke(t),wt(t),Qe(t,r),Ye(t),Wt(t,r);break;default:n("Unsupported browser!");break}return i}const wn=da({window:typeof window>"u"?void 0:window});class Vn{constructor(e){S(this,"peerConnection");S(this,"sessionListener",new oa);S(this,"isCallOut",!1);S(this,"sessionType",x.UNKNOWN);S(this,"localStream");S(this,"remoteStream");S(this,"hasSetRemoteSdp",!1);S(this,"facingMode",Z.FRONT_FACING);S(this,"facingChanging",!1);S(this,"muted",!1);S(this,"openCamera",!1);this.sessionType=e,console.debug(wn.browserDetails.browser+" "+wn.browserDetails.version)}setListener(e){this.sessionListener=e}start(e,n){if(!e&&!n){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=Z.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{e?this.peerConnection.createOffer().then(r=>{this.peerConnection.setLocalDescription(r).then(()=>{}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)}):(console.debug(n),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:n})).then(()=>{this.peerConnection.createAnswer().then(r=>{this.peerConnection.setLocalDescription(r).then(()=>{}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})}).catch(r=>{this.error(r)}))},this.peerConnection.onicecandidate=r=>{},this.peerConnection.onicegatheringstatechange=()=>{this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=r=>{for(let i=0;i<r.streams.length;i++)this.remoteStream?r.streams[i].getTracks().forEach(o=>{var s;(s=this.remoteStream)==null||s.addTrack(o)}):this.remoteStream=new MediaStream(r.streams[i]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=r=>{var i,o,s,a,l;console.debug("oniceconnectionstatechange",(i=this.peerConnection)==null?void 0:i.iceConnectionState),(((o=this.peerConnection)==null?void 0:o.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((l=this.peerConnection)==null?void 0:l.iceConnectionState)=="closed")&&(this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case x.RTSP_PULL:this.addTransceivers();break;case x.VIDEO:case x.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){if(this.peerConnection&&this.isCallOut){if(this.hasSetRemoteSdp)return;this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{}).catch(n=>{this.error(n)})}}addRemoteCandidate(e){this.peerConnection&&e.forEach(n=>{this.peerConnection.addIceCandidate(n).then(()=>{}).catch(r=>console.log(r))})}stop(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=void 0),this.localStream&&(this.localStream.getTracks().forEach(e=>{this.localStream.removeTrack(e),e.stop()}),this.localStream=void 0),this.remoteStream=void 0}changeFacing(){return new Promise((e,n)=>{if(this.sessionType!==x.VIDEO){n(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){n(new Error("not in calling or not video call"));return}if(this.facingChanging){n(new Error("camera switching in progress"));return}if(!/mobile/i.test(navigator.userAgent)){n(new Error("not mobile device"));return}this.facingChanging=!0,this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(r=>n(r))})}changeMuted(){return new Promise((e,n)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?n(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(r=>{r.enabled=!r.enabled,this.muted=!r.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,n)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?n(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(r=>{r.enabled=!r.enabled,this.openCamera=!r.enabled}),e(this.openCamera))})}error(e){this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"sendrecv"}),this.peerConnection.addTransceiver("video",{direction:"sendrecv"})}gotLocalMedia(){let e;switch(this.sessionType){case x.AUDIO:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:!1};break;case x.VIDEO:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280}}};break;default:this.error(new Error("session type unknown."));return}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(n=>{this.getMediaSuccess(n)}).catch(n=>{this.getMediaFailed(n)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){this.localStream=e,this.sessionType===x.VIDEO&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(n=>{this.peerConnection.addTrack(n,e)}),this.muted=!1}getMediaFailed(e){if(this.sessionType===x.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=x.AUDIO,this.gotLocalMedia();return}this.error(e)}changeCameraLocalMedia(){return new Promise((e,n)=>{let r;if(this.facingMode===Z.FRONT_FACING?r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:"environment"}}:r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:"user"}},navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(r).then(i=>{this.changeCameraSuccess(i),e()}).catch(i=>{this.changeCameraFailed(i),n(i)});else{let i=new Error("Browser does not support WebRTC");this.changeCameraFailed(i),n(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e){if(!this.localStream){e.getTracks().forEach(n=>{n.stop()}),this.facingChanging=!1;return}this.localStream.getVideoTracks().forEach(n=>{this.localStream.removeTrack(n),n.stop()}),e.getVideoTracks().forEach(n=>{this.localStream.addTrack(n)}),this.peerConnection.getSenders().forEach(n=>{n.track&&n.track.kind==="video"&&n.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(r=>{console.log(r)})}),this.facingMode===Z.FRONT_FACING?this.facingMode=Z.BACK_FACING:this.facingMode=Z.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class ha{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class ma{constructor(e,n){S(this,"url");S(this,"offerSdp");this.url=e,this.offerSdp=n}}const ya="/media-server/video-play/webrtc";class ga{constructor(e,n){S(this,"rtspUrl");S(this,"webrtcSession",new Vn(x.RTSP_PULL));S(this,"sessionListener",new ha);S(this,"httpClient");this.rtspUrl=e,this.httpClient=n,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer",e),this.httpClient.Post(ya,new ma(this.rtspUrl,e.sdp??"")).then(n=>{var r,i;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("rtsp answer",n.data),this.webrtcSession.setRemoteSdp(((r=n.data)==null?void 0:r.sdp)??""),this.webrtcSession.addRemoteCandidate(((i=n.data)==null?void 0:i.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}}var R=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(R||{}),de=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(de||{}),et=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(et||{}),te=(t=>(t.IN="in",t.OUT="out",t))(te||{}),M=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(M||{});function Wn(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Sa(){return"browser-"+va()+Ca(6)}function va(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Ca(t){let e="",n=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let r=0;r<t;r++)e+=n[Math.floor(Math.random()*(n.length-1))];return e}class Ra{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"callMode");this.tel=e,this.callMode=r,this.mediaType=n}}class ba{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}}class Ta{constructor(e,n){S(this,"tel");S(this,"called","");S(this,"callId");S(this,"status",R.OFFLINE);S(this,"mediaType",de.AUDIO);S(this,"callMode",et.FULL);S(this,"callDirect",te.OUT);S(this,"remoteSdp");S(this,"candidate");S(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));S(this,"ringtone",new Audio("sound/ringtone.wav"));S(this,"ws");S(this,"wsConnected",!1);S(this,"closeBySelf",!1);S(this,"webrtcSession");S(this,"sessionListener",new ba);S(this,"wsUrl");this.tel=n,this.wsUrl=e,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}makeCall(e,n=de.AUDIO,r=et.FULL){var i;try{if(this.status==R.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}if(this.status>R.IDLE){console.debug("Another call is currently in progress"),this.sessionListener.onError(new Error("Another call is currently in progress"));return}if(!Wn()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}this.mediaType=n,this.callMode=r,this.called=e,this.callDirect=te.OUT,this.callId=Sa(),this.webrtcCreate(de.VIDEO==n?x.VIDEO:x.AUDIO),(i=this.webrtcSession)==null||i.start(!0),this.status=R.TRY}catch(o){this.status=R.IDLE,this.sessionListener.onError(new Error(""+o))}}answer(){var e;if(this.status!=R.RING){console.debug("session is not ring state");return}if(this.callDirect!=te.IN){console.debug("session is call out, not allow answer");return}this.webrtcCreate(de.VIDEO==this.mediaType?x.VIDEO:x.AUDIO),(e=this.webrtcSession)==null||e.start(!1,this.remoteSdp)}hangup(){this.status<=R.IDLE||(this.status==R.TALK?this.sendHangup(this.callId??""):this.callDirect==te.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}changeCamera(){var e;return(e=this.webrtcSession)==null?void 0:e.changeFacing()}changeMuted(){var e;return(e=this.webrtcSession)==null?void 0:e.changeMuted()}changeCameraOpened(){var e;return(e=this.webrtcSession)==null?void 0:e.changeCameraOpened()}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=R.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=n=>{console.error("ws on close: ",n),this.wsConnected=!1,this.close(),this.status=R.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(n.reason)),this.ws=void 0},this.ws.onmessage=n=>{try{let r=JSON.parse(n.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",r),r.type){case M.Invite:this.inviteHandler(r);break;case M.ANSWER:this.answerHandler(r);break;case M.RING:this.ringHandler(r);break;case M.HANGUP:this.hangupHandler(r);break;case M.LOGIN:this.loginHandler(r);break}}catch(r){console.error("receive msg from server, but process error: ",r,n)}},this.ws.onerror=n=>{console.error("ws on error: ",n)}}sendTo(e){var n;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(n=this.ws)==null||n.send(JSON.stringify(e))):console.error("ws not connected.")}catch(r){console.debug("FullSession sendTo error: ",r)}}sendLogin(){this.sendTo({type:M.LOGIN,username:this.tel,userAgent:this.getUserAgent()})}sendLogout(){this.sendTo({type:M.LOGOUT,username:this.tel}),this.status=R.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:M.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=R.TRY}sendRing(){this.sendTo({type:M.RING,callId:this.callId,code:180}),this.status=R.RING}sendAnswer(e){this.sendTo({type:M.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=R.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendHangup(e,n=800){this.sendTo({type:M.HANGUP,callId:e,code:n}),e==this.callId&&(this.status=R.IDLE,this.callId=void 0)}loginHandler(e){var n;if(e.code!=200){(n=this.ws)==null||n.close(),this.wsConnected=!1,this.ws=void 0,this.status=R.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username,this.status=R.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Wn()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>R.IDLE){e.callId!=this.callId&&(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486));return}this.callId=e.callId,this.mediaType=e.mediaType??de.AUDIO,this.callMode=e.callMode??et.FULL,this.called=e.from??"",this.callDirect=te.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sessionListener.onNewCall(new Ra(this.called,this.mediaType,this.callMode)),this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{})}ringHandler(e){var n;!e.callId||e.callId!=this.callId||(e.code==183?((n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),this.ringBackTone.pause()):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=R.RING)}answerHandler(e){var n,r;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=R.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Vn(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==te.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var n;e.type=="answer"?(this.sendAnswer(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}}let Jn=new rn("/"),qn="/media-server/ws/voip",Jt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+qn);function Pa(t){Jn=new rn(t)}function Ea(t){return new ga(t,Jn)}function Oa(t){Jt=new URL(t),Jt.pathname=qn}function Aa(t){return new Ta(Jt.toString(),t)}I.createCallSession=Aa,I.createRtspPullSession=Ea,I.videoModuleInit=Pa,I.voipModuleInit=Oa,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
40
+ `);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:o}):i.sdp=o}return n.apply(this,arguments)}}function Xe(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ze(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return n.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?n.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>n.apply(this,[s]))})}const pa=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Wt,shimAddIceCandidateNullOrEmpty:Xe,shimConnectionState:Vt,shimMaxMessageSize:Qe,shimParameterlessSetLocalDescription:Ze,shimRTCIceCandidate:Ke,shimRTCIceCandidateRelayProtocol:wt,shimSendThrowTypeError:Ye},Symbol.toStringTag,{value:"Module"}));function da({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=sn,r=ca(t),i={browserDetails:r,commonShim:pa,extractVersion:qe,disableLog:sa,disableWarnings:aa,sdp:fa};switch(r.browser){case"chrome":if(!Cn||!zt||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=Cn,Xe(t,r),Ze(t),fn(t,r),pn(t),zt(t,r),dn(t),Sn(t,r),hn(t),mn(t),yn(t),vn(t,r),Ke(t),wt(t),Vt(t),Qe(t,r),Ye(t),Wt(t,r);break;case"firefox":if(!Dn||!Ht||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=Dn,Xe(t,r),Ze(t),Rn(t,r),Ht(t,r),bn(t),En(t),Tn(t),Pn(t),On(t),An(t),xn(t),_n(t),In(t),Ke(t),Vt(t),Qe(t,r),Ye(t);break;case"safari":if(!Gn||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=Gn,Xe(t,r),Ze(t),Un(t),Bn(t),Mn(t),Ln(t),kn(t),jn(t),Nn(t),$n(t),Ke(t),wt(t),Qe(t,r),Ye(t),Wt(t,r);break;default:n("Unsupported browser!");break}return i}const wn=da({window:typeof window>"u"?void 0:window});class Vn{constructor(e){S(this,"peerConnection");S(this,"sessionListener",new oa);S(this,"isCallOut",!1);S(this,"sessionType",x.UNKNOWN);S(this,"localStream");S(this,"remoteStream");S(this,"hasSetRemoteSdp",!1);S(this,"facingMode",Z.FRONT_FACING);S(this,"facingChanging",!1);S(this,"muted",!1);S(this,"openCamera",!1);this.sessionType=e,console.debug(wn.browserDetails.browser+" "+wn.browserDetails.version)}setListener(e){this.sessionListener=e}start(e,n){if(!e&&!n){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=Z.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{e?this.peerConnection.createOffer().then(r=>{this.peerConnection.setLocalDescription(r).then(()=>{}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)}):(console.debug(n),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:n})).then(()=>{this.peerConnection.createAnswer().then(r=>{this.peerConnection.setLocalDescription(r).then(()=>{}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})}).catch(r=>{this.error(r)}))},this.peerConnection.onicecandidate=r=>{},this.peerConnection.onicegatheringstatechange=()=>{this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=r=>{for(let i=0;i<r.streams.length;i++)this.remoteStream?r.streams[i].getTracks().forEach(o=>{var s;(s=this.remoteStream)==null||s.addTrack(o)}):this.remoteStream=new MediaStream(r.streams[i]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=r=>{var i,o,s,a,l;console.debug("oniceconnectionstatechange",(i=this.peerConnection)==null?void 0:i.iceConnectionState),(((o=this.peerConnection)==null?void 0:o.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((l=this.peerConnection)==null?void 0:l.iceConnectionState)=="closed")&&(this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case x.RTSP_PULL:this.addTransceivers();break;case x.VIDEO:case x.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){if(this.peerConnection&&this.isCallOut){if(this.hasSetRemoteSdp)return;this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{}).catch(n=>{this.error(n)})}}addRemoteCandidate(e){this.peerConnection&&e.forEach(n=>{this.peerConnection.addIceCandidate(n).then(()=>{}).catch(r=>console.log(r))})}stop(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=void 0),this.localStream&&(this.localStream.getTracks().forEach(e=>{this.localStream.removeTrack(e),e.stop()}),this.localStream=void 0),this.remoteStream=void 0}changeFacing(){return new Promise((e,n)=>{if(this.sessionType!==x.VIDEO){n(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){n(new Error("not in calling or not video call"));return}if(this.facingChanging){n(new Error("camera switching in progress"));return}if(!/mobile/i.test(navigator.userAgent)){n(new Error("not mobile device"));return}this.facingChanging=!0,this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(r=>n(r))})}changeMuted(){return new Promise((e,n)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?n(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(r=>{r.enabled=!r.enabled,this.muted=!r.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,n)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?n(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(r=>{r.enabled=!r.enabled,this.openCamera=!r.enabled}),e(this.openCamera))})}error(e){this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"sendrecv"}),this.peerConnection.addTransceiver("video",{direction:"sendrecv"})}gotLocalMedia(){let e;switch(this.sessionType){case x.AUDIO:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:!1};break;case x.VIDEO:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280}}};break;default:this.error(new Error("session type unknown."));return}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(n=>{this.getMediaSuccess(n)}).catch(n=>{this.getMediaFailed(n)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){this.localStream=e,this.sessionType===x.VIDEO&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(n=>{this.peerConnection.addTrack(n,e)}),this.muted=!1}getMediaFailed(e){if(this.sessionType===x.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=x.AUDIO,this.gotLocalMedia();return}this.error(e)}changeCameraLocalMedia(){return new Promise((e,n)=>{let r;if(this.facingMode===Z.FRONT_FACING?r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:"environment"}}:r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:"user"}},navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(r).then(i=>{this.changeCameraSuccess(i),e()}).catch(i=>{this.changeCameraFailed(i),n(i)});else{let i=new Error("Browser does not support WebRTC");this.changeCameraFailed(i),n(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e){if(!this.localStream){e.getTracks().forEach(n=>{n.stop()}),this.facingChanging=!1;return}this.localStream.getVideoTracks().forEach(n=>{this.localStream.removeTrack(n),n.stop()}),e.getVideoTracks().forEach(n=>{this.localStream.addTrack(n)}),this.peerConnection.getSenders().forEach(n=>{n.track&&n.track.kind==="video"&&n.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(r=>{console.log(r)})}),this.facingMode===Z.FRONT_FACING?this.facingMode=Z.BACK_FACING:this.facingMode=Z.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class ha{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class ma{constructor(e,n){S(this,"url");S(this,"offerSdp");this.url=e,this.offerSdp=n}}const ya="/media-server/video-play/webrtc";class ga{constructor(e,n){S(this,"rtspUrl");S(this,"webrtcSession",new Vn(x.RTSP_PULL));S(this,"sessionListener",new ha);S(this,"httpClient");this.rtspUrl=e,this.httpClient=n,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer",e),this.httpClient.Post(ya,new ma(this.rtspUrl,e.sdp??"")).then(n=>{var r,i;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("rtsp answer",n.data),this.webrtcSession.setRemoteSdp(((r=n.data)==null?void 0:r.sdp)??""),this.webrtcSession.addRemoteCandidate(((i=n.data)==null?void 0:i.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}}var R=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(R||{}),de=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(de||{}),et=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(et||{}),te=(t=>(t.IN="in",t.OUT="out",t))(te||{}),L=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(L||{});function Wn(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Sa(){return"browser-"+va()+Ca(6)}function va(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Ca(t){let e="",n=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let r=0;r<t;r++)e+=n[Math.floor(Math.random()*(n.length-1))];return e}class Ra{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"callMode");this.tel=e,this.callMode=r,this.mediaType=n}}class ba{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}}class Ta{constructor(e,n){S(this,"tel","");S(this,"status",R.OFFLINE);S(this,"mediaType",de.AUDIO);S(this,"callMode",et.FULL);S(this,"callDirect",te.OUT);S(this,"called","");S(this,"callId");S(this,"remoteSdp");S(this,"candidate");S(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));S(this,"ringtone",new Audio("sound/ringtone.wav"));S(this,"dtmfAudio",new Audio("sound/dtmf.wav"));S(this,"ws");S(this,"wsConnected",!1);S(this,"closeBySelf",!1);S(this,"webrtcSession");S(this,"sessionListener",new ba);S(this,"wsUrl");this.tel=n??"",this.wsUrl=e,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}makeCall(e,n=de.AUDIO,r=et.FULL){var i;try{if(this.status==R.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}if(this.status>R.IDLE){console.debug("Another call is currently in progress"),this.sessionListener.onError(new Error("Another call is currently in progress"));return}if(!Wn()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}this.mediaType=n,this.callMode=r,this.called=e,this.callDirect=te.OUT,this.callId=Sa(),this.webrtcCreate(de.VIDEO==n?x.VIDEO:x.AUDIO),(i=this.webrtcSession)==null||i.start(!0),this.status=R.TRY}catch(o){this.status=R.IDLE,this.sessionListener.onError(new Error(""+o))}}answer(){var e;if(this.status!=R.RING){console.debug("session is not ring state");return}if(this.callDirect!=te.IN){console.debug("session is call out, not allow answer");return}this.webrtcCreate(de.VIDEO==this.mediaType?x.VIDEO:x.AUDIO),(e=this.webrtcSession)==null||e.start(!1,this.remoteSdp)}hangup(){this.status<=R.IDLE||(this.status==R.TALK?this.sendHangup(this.callId??""):this.callDirect==te.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==R.TALK?!1:(this.sendDtmf(e),!0)}changeCamera(){return new Promise((e,n)=>{var r;this.webrtcSession||n(new Error("webrtc session not start")),(r=this.webrtcSession)==null||r.changeFacing().then(i=>e(i)).catch(i=>n(i))})}changeMuted(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.changeMuted().then(r=>e(r)).catch(r=>n(r))})}changeCameraOpened(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.changeCameraOpened().then(r=>e(r)).catch(r=>n(r))})}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=R.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=n=>{console.error("ws on close: ",n),this.wsConnected=!1,this.close(),this.status=R.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(n.reason)),this.ws=void 0},this.ws.onmessage=n=>{try{let r=JSON.parse(n.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",r),r.type){case L.Invite:this.inviteHandler(r);break;case L.ANSWER:this.answerHandler(r);break;case L.RING:this.ringHandler(r);break;case L.HANGUP:this.hangupHandler(r);break;case L.LOGIN:this.loginHandler(r);break}}catch(r){console.error("receive msg from server, but process error: ",r,n)}},this.ws.onerror=n=>{console.error("ws on error: ",n)}}sendTo(e){var n;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(n=this.ws)==null||n.send(JSON.stringify(e))):console.error("ws not connected.")}catch(r){console.debug("FullSession sendTo error: ",r)}}sendLogin(){this.sendTo({type:L.LOGIN,username:this.tel,userAgent:this.getUserAgent()})}sendLogout(){this.sendTo({type:L.LOGOUT,username:this.tel}),this.status=R.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:L.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=R.TRY}sendRing(){this.sendTo({type:L.RING,callId:this.callId,code:180}),this.status=R.RING}sendAnswer(e){this.sendTo({type:L.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=R.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:L.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(n=>console.debug(n))}sendHangup(e,n=800){this.sendTo({type:L.HANGUP,callId:e,code:n}),e==this.callId&&(this.status=R.IDLE,this.callId=void 0)}loginHandler(e){var n;if(e.code!=200){(n=this.ws)==null||n.close(),this.wsConnected=!1,this.ws=void 0,this.status=R.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=R.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Wn()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>R.IDLE){e.callId!=this.callId&&(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486));return}this.callId=e.callId,this.mediaType=e.mediaType??de.AUDIO,this.callMode=e.callMode??et.FULL,this.called=e.from??"",this.callDirect=te.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sessionListener.onNewCall(new Ra(this.called,this.mediaType,this.callMode)),this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{})}ringHandler(e){var n;!e.callId||e.callId!=this.callId||(e.code==183?((n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),this.ringBackTone.pause()):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=R.RING)}answerHandler(e){var n,r;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=R.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Vn(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==te.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var n;e.type=="answer"?(this.sendAnswer(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}}let Jn=new rn("/"),qn="/media-server/ws/voip",Jt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+qn);function Pa(t){Jn=new rn(t)}function Ea(t){return new ga(t,Jn)}function Oa(t){Jt=new URL(t),Jt.pathname=qn}function Aa(t){return new Ta(Jt.toString(),t)}I.createCallSession=Aa,I.createRtspPullSession=Ea,I.videoModuleInit=Pa,I.voipModuleInit=Oa,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
package/index.d.ts CHANGED
@@ -214,7 +214,7 @@ export interface ICallSession {
214
214
  /**
215
215
  * 注销
216
216
  */
217
- destroy();
217
+ destroy():void;
218
218
  }
219
219
 
220
220
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "media-av",
3
3
  "private": false,
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "author": "W.w.",
7
7
  "license": "MIT",