media-av 0.0.24 → 0.0.25
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/README.md +1 -9
- package/dist/mediaAV.js +58 -48
- package/dist/mediaAV.umd.cjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/mediaAV.js
CHANGED
|
@@ -1692,22 +1692,22 @@ O.getAdapter = sn.getAdapter;
|
|
|
1692
1692
|
O.HttpStatusCode = bt;
|
|
1693
1693
|
O.default = O;
|
|
1694
1694
|
const {
|
|
1695
|
-
Axios:
|
|
1696
|
-
AxiosError:
|
|
1697
|
-
CanceledError:
|
|
1698
|
-
isCancel:
|
|
1699
|
-
CancelToken:
|
|
1700
|
-
VERSION:
|
|
1701
|
-
all:
|
|
1702
|
-
Cancel:
|
|
1703
|
-
isAxiosError:
|
|
1704
|
-
spread:
|
|
1705
|
-
toFormData:
|
|
1706
|
-
AxiosHeaders:
|
|
1707
|
-
HttpStatusCode:
|
|
1708
|
-
formToJSON:
|
|
1709
|
-
getAdapter:
|
|
1710
|
-
mergeConfig:
|
|
1695
|
+
Axios: hc,
|
|
1696
|
+
AxiosError: mc,
|
|
1697
|
+
CanceledError: yc,
|
|
1698
|
+
isCancel: gc,
|
|
1699
|
+
CancelToken: Sc,
|
|
1700
|
+
VERSION: vc,
|
|
1701
|
+
all: Cc,
|
|
1702
|
+
Cancel: bc,
|
|
1703
|
+
isAxiosError: Rc,
|
|
1704
|
+
spread: Tc,
|
|
1705
|
+
toFormData: Ec,
|
|
1706
|
+
AxiosHeaders: Pc,
|
|
1707
|
+
HttpStatusCode: Oc,
|
|
1708
|
+
formToJSON: Ac,
|
|
1709
|
+
getAdapter: Dc,
|
|
1710
|
+
mergeConfig: _c
|
|
1711
1711
|
} = O;
|
|
1712
1712
|
function un(t) {
|
|
1713
1713
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -4991,12 +4991,22 @@ class Za {
|
|
|
4991
4991
|
}
|
|
4992
4992
|
var E = /* @__PURE__ */ ((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))(E || {}), F = /* @__PURE__ */ ((t) => (t.VIDEO = "video", t.AUDIO = "audio", t))(F || {}), J = /* @__PURE__ */ ((t) => (t.FULL = "full-duplex", t.HALF = "half-duplex", t))(J || {}), pe = /* @__PURE__ */ ((t) => (t.IN = "in", t.OUT = "out", t))(pe || {}), w = /* @__PURE__ */ ((t) => (t.LOGIN = "login", t.LOGOUT = "logout", t.Invite = "invite", t.RING = "ring", t.ANSWER = "answer", t.HANGUP = "hangup", t.DTMF = "dtmf", t))(w || {});
|
|
4993
4993
|
let ci;
|
|
4994
|
-
function
|
|
4994
|
+
function Ic() {
|
|
4995
4995
|
ci = "true";
|
|
4996
4996
|
}
|
|
4997
4997
|
function ec() {
|
|
4998
4998
|
return ci;
|
|
4999
4999
|
}
|
|
5000
|
+
function tc() {
|
|
5001
|
+
let t = !1;
|
|
5002
|
+
try {
|
|
5003
|
+
const e = RTCRtpSender.getCapabilities("video");
|
|
5004
|
+
e && e.codecs.some((n) => n.mimeType.toLowerCase() === "video/h264") && (t = !0);
|
|
5005
|
+
} catch (e) {
|
|
5006
|
+
console.error("Error checking H.264 support:", e);
|
|
5007
|
+
}
|
|
5008
|
+
return t;
|
|
5009
|
+
}
|
|
5000
5010
|
function Ur() {
|
|
5001
5011
|
try {
|
|
5002
5012
|
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
|
|
@@ -5004,14 +5014,14 @@ function Ur() {
|
|
|
5004
5014
|
return !1;
|
|
5005
5015
|
}
|
|
5006
5016
|
}
|
|
5007
|
-
function tc() {
|
|
5008
|
-
return "browser-" + rc() + nc(6);
|
|
5009
|
-
}
|
|
5010
5017
|
function rc() {
|
|
5018
|
+
return "browser-" + nc() + ic(6);
|
|
5019
|
+
}
|
|
5020
|
+
function nc() {
|
|
5011
5021
|
let t = /* @__PURE__ */ new Date();
|
|
5012
5022
|
return `${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`;
|
|
5013
5023
|
}
|
|
5014
|
-
function
|
|
5024
|
+
function ic(t) {
|
|
5015
5025
|
let e = "", n = [
|
|
5016
5026
|
"0",
|
|
5017
5027
|
"1",
|
|
@@ -5055,7 +5065,7 @@ function nc(t) {
|
|
|
5055
5065
|
e += n[Math.floor(Math.random() * (n.length - 1))];
|
|
5056
5066
|
return e;
|
|
5057
5067
|
}
|
|
5058
|
-
class
|
|
5068
|
+
class oc {
|
|
5059
5069
|
constructor(e, n, r) {
|
|
5060
5070
|
S(this, "tel");
|
|
5061
5071
|
S(this, "mediaType");
|
|
@@ -5203,7 +5213,7 @@ class ui {
|
|
|
5203
5213
|
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"));
|
|
5204
5214
|
return;
|
|
5205
5215
|
}
|
|
5206
|
-
this.status > E.IDLE && (console.debug("Another call is currently in progress, hangup it"), this.hangup()), this.mediaType = n, this.callMode = r, this.called = e, this.callDirect = pe.OUT, this.callId =
|
|
5216
|
+
this.status > E.IDLE && (console.debug("Another call is currently in progress, hangup it"), this.hangup()), this.mediaType = n, this.callMode = r, this.called = e, this.callDirect = pe.OUT, this.callId = rc();
|
|
5207
5217
|
let o;
|
|
5208
5218
|
this.callMode == J.HALF ? o = F.VIDEO == n ? v.VIDEO_HALF : v.AUDIO_HALF : o = F.VIDEO == n ? v.VIDEO : v.AUDIO, this.webrtcCreate(o), (i = this.webrtcSession) == null || i.start(!0), this.status = E.TRY;
|
|
5209
5219
|
} catch (o) {
|
|
@@ -5339,7 +5349,7 @@ class ui {
|
|
|
5339
5349
|
}
|
|
5340
5350
|
this.callId = e.callId, this.mediaType = e.mediaType ?? F.AUDIO, this.callMode = e.callMode ?? J.FULL, this.called = e.from ?? "", this.callDirect = pe.IN, this.remoteSdp = e.sdp, this.candidate = e.candidate, this.sendRing(), this.ringtone.currentTime = 0, this.ringtone.play().then(() => {
|
|
5341
5351
|
}).catch(() => {
|
|
5342
|
-
}), this.sessionListener.onNewCall(new
|
|
5352
|
+
}), this.sessionListener.onNewCall(new oc(this.called, this.mediaType, this.callMode));
|
|
5343
5353
|
}
|
|
5344
5354
|
ringHandler(e) {
|
|
5345
5355
|
var n, r;
|
|
@@ -5355,7 +5365,7 @@ class ui {
|
|
|
5355
5365
|
!e.callId || e.callId != this.callId || (this.close(), this.sessionListener.onHangup(e.code));
|
|
5356
5366
|
}
|
|
5357
5367
|
getUserAgent() {
|
|
5358
|
-
return
|
|
5368
|
+
return tc() ? "windows" : "phone";
|
|
5359
5369
|
}
|
|
5360
5370
|
/************************ WebrtcSession ***********************************/
|
|
5361
5371
|
webrtcCreate(e) {
|
|
@@ -5385,7 +5395,7 @@ class ui {
|
|
|
5385
5395
|
this.sessionListener.onStopDesktopShare();
|
|
5386
5396
|
}
|
|
5387
5397
|
}
|
|
5388
|
-
class
|
|
5398
|
+
class sc {
|
|
5389
5399
|
onError(e) {
|
|
5390
5400
|
console.debug("onError:", e);
|
|
5391
5401
|
}
|
|
@@ -5396,8 +5406,8 @@ class oc {
|
|
|
5396
5406
|
console.debug("onStopDesktopShare");
|
|
5397
5407
|
}
|
|
5398
5408
|
}
|
|
5399
|
-
const
|
|
5400
|
-
class
|
|
5409
|
+
const ac = "/media-server/broadcast/webrtc";
|
|
5410
|
+
class cc {
|
|
5401
5411
|
/**
|
|
5402
5412
|
*
|
|
5403
5413
|
* @param tel{string} 广播的号码
|
|
@@ -5408,7 +5418,7 @@ class ac {
|
|
|
5408
5418
|
S(this, "tel");
|
|
5409
5419
|
S(this, "mediaType");
|
|
5410
5420
|
S(this, "webrtcSession");
|
|
5411
|
-
S(this, "sessionListener", new
|
|
5421
|
+
S(this, "sessionListener", new sc());
|
|
5412
5422
|
S(this, "httpClient");
|
|
5413
5423
|
this.tel = e, this.httpClient = n, this.mediaType = r === F.VIDEO ? F.VIDEO : F.AUDIO, this.webrtcSession = new Qt(r == F.VIDEO ? v.VIDEO_PUSH : v.AUDIO_PUSH), this.webrtcSession.setListener(this);
|
|
5414
5424
|
}
|
|
@@ -5439,7 +5449,7 @@ class ac {
|
|
|
5439
5449
|
this.sessionListener.onError(e);
|
|
5440
5450
|
}
|
|
5441
5451
|
onStartSuccess(e) {
|
|
5442
|
-
console.debug("offer:", e.sdp), this.httpClient.Post(
|
|
5452
|
+
console.debug("offer:", e.sdp), this.httpClient.Post(ac, new ai(this.tel, e.sdp ?? "")).then((n) => {
|
|
5443
5453
|
var r, i, o;
|
|
5444
5454
|
if (n.code != 200) {
|
|
5445
5455
|
this.stop(), this.sessionListener.onError(new Error(n.message));
|
|
@@ -5457,15 +5467,15 @@ class ac {
|
|
|
5457
5467
|
}
|
|
5458
5468
|
}
|
|
5459
5469
|
var Mt = /* @__PURE__ */ ((t) => (t.TB_REQUEST = "tb_request", t.TB_GRANTED = "tb_granted", t.TB_TAKEN = "tb_taken", t.TB_DENY = "tb_deny", t.TB_RELEASE = "tb_release", t.TB_IDLE = "tb_idle", t.TB_REVOKE = "tb_revoke", t))(Mt || {});
|
|
5460
|
-
class
|
|
5470
|
+
class lc extends li {
|
|
5461
5471
|
onTbcpMessage(e) {
|
|
5462
5472
|
console.debug("onTbcpMessage:", e);
|
|
5463
5473
|
}
|
|
5464
5474
|
}
|
|
5465
|
-
class
|
|
5475
|
+
class uc extends ui {
|
|
5466
5476
|
constructor(n, r, i) {
|
|
5467
5477
|
super(n, r, i);
|
|
5468
|
-
S(this, "sessionListener", new
|
|
5478
|
+
S(this, "sessionListener", new lc());
|
|
5469
5479
|
}
|
|
5470
5480
|
setCallSessionListener(n) {
|
|
5471
5481
|
this.sessionListener = n;
|
|
@@ -5497,30 +5507,30 @@ class lc extends ui {
|
|
|
5497
5507
|
}
|
|
5498
5508
|
}
|
|
5499
5509
|
let Xt = new On("/"), fi = "/media-server/ws/voip", pi = "/media-server/ws/b-trun-c", Ft = new URL((window.location.protocol == "https:" ? "wss://" : "ws://") + window.location.host + fi), Nt = new URL((window.location.protocol == "https:" ? "wss://" : "ws://") + window.location.host + pi);
|
|
5500
|
-
function
|
|
5510
|
+
function Lc(t) {
|
|
5501
5511
|
Xt = new On(t);
|
|
5502
5512
|
}
|
|
5503
|
-
function
|
|
5513
|
+
function kc(t) {
|
|
5504
5514
|
return new Za(t, Xt);
|
|
5505
5515
|
}
|
|
5506
|
-
function
|
|
5507
|
-
return new
|
|
5516
|
+
function xc(t, e) {
|
|
5517
|
+
return new cc(t, Xt, e);
|
|
5508
5518
|
}
|
|
5509
|
-
function
|
|
5519
|
+
function Mc(t) {
|
|
5510
5520
|
Ft = new URL(t), Ft.pathname = fi, Nt = new URL(t), Nt.pathname = pi;
|
|
5511
5521
|
}
|
|
5512
|
-
function
|
|
5522
|
+
function Fc(t) {
|
|
5513
5523
|
return new ui(Ft.toString(), t);
|
|
5514
5524
|
}
|
|
5515
|
-
function
|
|
5516
|
-
return new
|
|
5525
|
+
function Nc(t, e) {
|
|
5526
|
+
return new uc(Nt.toString(), t, e);
|
|
5517
5527
|
}
|
|
5518
5528
|
export {
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5529
|
+
Nc as createAppCallSession,
|
|
5530
|
+
xc as createBroadcastSession,
|
|
5531
|
+
Fc as createCallSession,
|
|
5532
|
+
kc as createRtspPullSession,
|
|
5533
|
+
Ic as setAllowEmpty,
|
|
5534
|
+
Lc as videoModuleInit,
|
|
5535
|
+
Mc as voipModuleInit
|
|
5526
5536
|
};
|
package/dist/mediaAV.umd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(A,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(A=typeof globalThis<"u"?globalThis:A||self,w(A.mediaAV={}))})(this,function(A){"use strict";var cc=Object.defineProperty;var lc=(A,w,ne)=>w in A?cc(A,w,{enumerable:!0,configurable:!0,writable:!0,value:ne}):A[w]=ne;var S=(A,w,ne)=>lc(A,typeof w!="symbol"?w+"":w,ne);function w(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 ne(t,e){return function(){return t.apply(e,arguments)}}const{toString:mi}=Object.prototype,{getPrototypeOf:it}=Object,Me=(t=>e=>{const n=mi.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),G=t=>(t=t.toLowerCase(),e=>Me(e)===t),Fe=t=>e=>typeof e===t,{isArray:fe}=Array,Ee=Fe("undefined");function yi(t){return t!==null&&!Ee(t)&&t.constructor!==null&&!Ee(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const tr=G("ArrayBuffer");function gi(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&tr(t.buffer),e}const Si=Fe("string"),B=Fe("function"),rr=Fe("number"),Ne=t=>t!==null&&typeof t=="object",vi=t=>t===!0||t===!1,Ue=t=>{if(Me(t)!=="object")return!1;const e=it(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ci=G("Date"),bi=G("File"),Ri=G("Blob"),Ti=G("FileList"),Ei=t=>Ne(t)&&B(t.pipe),Pi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=Me(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Oi=G("URLSearchParams"),[Ai,Di,_i,Ii]=["ReadableStream","Request","Response","Headers"].map(G),Li=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pe(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),fe(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 nr(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 ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ir=t=>!Ee(t)&&t!==ie;function ot(){const{caseless:t}=ir(this)&&this||{},e={},n=(r,i)=>{const o=t&&nr(e,i)||i;Ue(e[o])&&Ue(r)?e[o]=ot(e[o],r):Ue(r)?e[o]=ot({},r):fe(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Pe(arguments[r],n);return e}const ki=(t,e,n,{allOwnKeys:r}={})=>(Pe(e,(i,o)=>{n&&B(i)?t[o]=ne(i,n):t[o]=i},{allOwnKeys:r}),t),xi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Mi=(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&&it(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ni=(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},Ui=t=>{if(!t)return null;if(fe(t))return t;let e=t.length;if(!rr(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},wi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&it(Uint8Array)),Bi=(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])}},ji=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},$i=G("HTMLFormElement"),Hi=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),or=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Gi=G("RegExp"),sr=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pe(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},Vi=t=>{sr(t,(e,n)=>{if(B(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(B(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+"'")})}})},zi=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return fe(t)?r(t):r(String(t).split(e)),n},qi=()=>{},Ji=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,st="abcdefghijklmnopqrstuvwxyz",ar="0123456789",cr={DIGIT:ar,ALPHA:st,ALPHA_DIGIT:st+st.toUpperCase()+ar},Wi=(t=16,e=cr.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Ki(t){return!!(t&&B(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Qi=t=>{const e=new Array(10),n=(r,i)=>{if(Ne(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=fe(r)?[]:{};return Pe(r,(s,a)=>{const l=n(s,i+1);!Ee(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Xi=G("AsyncFunction"),Yi=t=>t&&(Ne(t)||B(t))&&B(t.then)&&B(t.catch),lr=((t,e)=>t?setImmediate:e?((n,r)=>(ie.addEventListener("message",({source:i,data:o})=>{i===ie&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ie.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",B(ie.postMessage)),Zi=typeof queueMicrotask<"u"?queueMicrotask.bind(ie):typeof process<"u"&&process.nextTick||lr,p={isArray:fe,isArrayBuffer:tr,isBuffer:yi,isFormData:Pi,isArrayBufferView:gi,isString:Si,isNumber:rr,isBoolean:vi,isObject:Ne,isPlainObject:Ue,isReadableStream:Ai,isRequest:Di,isResponse:_i,isHeaders:Ii,isUndefined:Ee,isDate:Ci,isFile:bi,isBlob:Ri,isRegExp:Gi,isFunction:B,isStream:Ei,isURLSearchParams:Oi,isTypedArray:wi,isFileList:Ti,forEach:Pe,merge:ot,extend:ki,trim:Li,stripBOM:xi,inherits:Mi,toFlatObject:Fi,kindOf:Me,kindOfTest:G,endsWith:Ni,toArray:Ui,forEachEntry:Bi,matchAll:ji,isHTMLForm:$i,hasOwnProperty:or,hasOwnProp:or,reduceDescriptors:sr,freezeMethods:Vi,toObjectSet:zi,toCamelCase:Hi,noop:qi,toFiniteNumber:Ji,findKey:nr,global:ie,isContextDefined:ir,ALPHABET:cr,generateString:Wi,isSpecCompliantForm:Ki,toJSONObject:Qi,isAsyncFn:Xi,isThenable:Yi,setImmediate:lr,asap:Zi};function b(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)}p.inherits(b,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:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ur=b.prototype,fr={};["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=>{fr[t]={value:t}}),Object.defineProperties(b,fr),Object.defineProperty(ur,"isAxiosError",{value:!0}),b.from=(t,e,n,r,i,o)=>{const s=Object.create(ur);return p.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),b.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const eo=null;function at(t){return p.isPlainObject(t)||p.isArray(t)}function pr(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function dr(t,e,n){return t?t.concat(e).map(function(i,o){return i=pr(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function to(t){return p.isArray(t)&&!t.some(at)}const ro=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function we(t,e,n){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!p.isUndefined(g[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(!l&&p.isBlob(h))throw new b("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,g){let C=h;if(h&&!g&&typeof h=="object"){if(p.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&to(h)||(p.isFileList(h)||p.endsWith(y,"[]"))&&(C=p.toArray(h)))return y=pr(y),C.forEach(function(R,I){!(p.isUndefined(R)||R===null)&&e.append(s===!0?dr([y],I,o):s===null?y:y+"[]",c(R))}),!1}return at(h)?!0:(e.append(dr(g,y,o),c(h)),!1)}const f=[],d=Object.assign(ro,{defaultVisitor:u,convertValue:c,isVisitable:at});function m(h,y){if(!p.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),p.forEach(h,function(C,P){(!(p.isUndefined(C)||C===null)&&i.call(e,C,p.isString(P)?P.trim():P,y,d))===!0&&m(C,y?y.concat(P):[P])}),f.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return m(t),e}function hr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ct(t,e){this._pairs=[],t&&we(t,this,e)}const mr=ct.prototype;mr.append=function(e,n){this._pairs.push([e,n])},mr.toString=function(e){const n=e?function(r){return e.call(this,r,hr)}:hr;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function no(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yr(t,e,n){if(!e)return t;const r=n&&n.encode||no,i=n&&n.serialize;let o;if(i?o=i(e,n):o=p.isURLSearchParams(e)?e.toString():new ct(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class gr{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){p.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},io={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ct,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},lt=typeof window<"u"&&typeof document<"u",oo=(t=>lt&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),so=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ao=lt&&window.location.href||"http://localhost",V={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserEnv:oo,hasStandardBrowserWebWorkerEnv:so,origin:ao},Symbol.toStringTag,{value:"Module"})),...io};function co(t,e){return we(t,new V.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return V.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function lo(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function uo(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 vr(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&p.isArray(i)?i.length:s,l?(p.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!p.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&p.isArray(i[s])&&(i[s]=uo(i[s])),!a)}if(p.isFormData(t)&&p.isFunction(t.entries)){const n={};return p.forEachEntry(t,(r,i)=>{e(lo(r),i,n,0)}),n}return null}function fo(t,e,n){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Oe={transitional:Sr,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=p.isObject(e);if(o&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return i?JSON.stringify(vr(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.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 co(e,this.formSerializer).toString();if((a=p.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return we(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),fo(e)):e}],transformResponse:[function(e){const n=this.transitional||Oe.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.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"?b.from(a,b.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:V.classes.FormData,Blob:V.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Oe.headers[t]={}});const po=p.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"]),ho=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
1
|
+
(function(A,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(A=typeof globalThis<"u"?globalThis:A||self,w(A.mediaAV={}))})(this,function(A){"use strict";var lc=Object.defineProperty;var uc=(A,w,ne)=>w in A?lc(A,w,{enumerable:!0,configurable:!0,writable:!0,value:ne}):A[w]=ne;var S=(A,w,ne)=>uc(A,typeof w!="symbol"?w+"":w,ne);function w(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 ne(t,e){return function(){return t.apply(e,arguments)}}const{toString:mi}=Object.prototype,{getPrototypeOf:it}=Object,Me=(t=>e=>{const n=mi.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),G=t=>(t=t.toLowerCase(),e=>Me(e)===t),Fe=t=>e=>typeof e===t,{isArray:fe}=Array,Ee=Fe("undefined");function yi(t){return t!==null&&!Ee(t)&&t.constructor!==null&&!Ee(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const tr=G("ArrayBuffer");function gi(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&tr(t.buffer),e}const Si=Fe("string"),B=Fe("function"),rr=Fe("number"),Ne=t=>t!==null&&typeof t=="object",vi=t=>t===!0||t===!1,Ue=t=>{if(Me(t)!=="object")return!1;const e=it(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ci=G("Date"),bi=G("File"),Ri=G("Blob"),Ti=G("FileList"),Ei=t=>Ne(t)&&B(t.pipe),Pi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=Me(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Oi=G("URLSearchParams"),[Ai,Di,_i,Ii]=["ReadableStream","Request","Response","Headers"].map(G),Li=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pe(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),fe(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 nr(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 ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ir=t=>!Ee(t)&&t!==ie;function ot(){const{caseless:t}=ir(this)&&this||{},e={},n=(r,i)=>{const o=t&&nr(e,i)||i;Ue(e[o])&&Ue(r)?e[o]=ot(e[o],r):Ue(r)?e[o]=ot({},r):fe(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Pe(arguments[r],n);return e}const ki=(t,e,n,{allOwnKeys:r}={})=>(Pe(e,(i,o)=>{n&&B(i)?t[o]=ne(i,n):t[o]=i},{allOwnKeys:r}),t),xi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Mi=(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&&it(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ni=(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},Ui=t=>{if(!t)return null;if(fe(t))return t;let e=t.length;if(!rr(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},wi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&it(Uint8Array)),Bi=(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])}},ji=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},$i=G("HTMLFormElement"),Hi=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),or=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Gi=G("RegExp"),sr=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pe(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},Vi=t=>{sr(t,(e,n)=>{if(B(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(B(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+"'")})}})},zi=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return fe(t)?r(t):r(String(t).split(e)),n},qi=()=>{},Ji=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,st="abcdefghijklmnopqrstuvwxyz",ar="0123456789",cr={DIGIT:ar,ALPHA:st,ALPHA_DIGIT:st+st.toUpperCase()+ar},Wi=(t=16,e=cr.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Ki(t){return!!(t&&B(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Qi=t=>{const e=new Array(10),n=(r,i)=>{if(Ne(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=fe(r)?[]:{};return Pe(r,(s,a)=>{const l=n(s,i+1);!Ee(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Xi=G("AsyncFunction"),Yi=t=>t&&(Ne(t)||B(t))&&B(t.then)&&B(t.catch),lr=((t,e)=>t?setImmediate:e?((n,r)=>(ie.addEventListener("message",({source:i,data:o})=>{i===ie&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ie.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",B(ie.postMessage)),Zi=typeof queueMicrotask<"u"?queueMicrotask.bind(ie):typeof process<"u"&&process.nextTick||lr,p={isArray:fe,isArrayBuffer:tr,isBuffer:yi,isFormData:Pi,isArrayBufferView:gi,isString:Si,isNumber:rr,isBoolean:vi,isObject:Ne,isPlainObject:Ue,isReadableStream:Ai,isRequest:Di,isResponse:_i,isHeaders:Ii,isUndefined:Ee,isDate:Ci,isFile:bi,isBlob:Ri,isRegExp:Gi,isFunction:B,isStream:Ei,isURLSearchParams:Oi,isTypedArray:wi,isFileList:Ti,forEach:Pe,merge:ot,extend:ki,trim:Li,stripBOM:xi,inherits:Mi,toFlatObject:Fi,kindOf:Me,kindOfTest:G,endsWith:Ni,toArray:Ui,forEachEntry:Bi,matchAll:ji,isHTMLForm:$i,hasOwnProperty:or,hasOwnProp:or,reduceDescriptors:sr,freezeMethods:Vi,toObjectSet:zi,toCamelCase:Hi,noop:qi,toFiniteNumber:Ji,findKey:nr,global:ie,isContextDefined:ir,ALPHABET:cr,generateString:Wi,isSpecCompliantForm:Ki,toJSONObject:Qi,isAsyncFn:Xi,isThenable:Yi,setImmediate:lr,asap:Zi};function b(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)}p.inherits(b,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:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ur=b.prototype,fr={};["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=>{fr[t]={value:t}}),Object.defineProperties(b,fr),Object.defineProperty(ur,"isAxiosError",{value:!0}),b.from=(t,e,n,r,i,o)=>{const s=Object.create(ur);return p.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),b.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const eo=null;function at(t){return p.isPlainObject(t)||p.isArray(t)}function pr(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function dr(t,e,n){return t?t.concat(e).map(function(i,o){return i=pr(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function to(t){return p.isArray(t)&&!t.some(at)}const ro=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function we(t,e,n){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!p.isUndefined(g[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(!l&&p.isBlob(h))throw new b("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,g){let C=h;if(h&&!g&&typeof h=="object"){if(p.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&to(h)||(p.isFileList(h)||p.endsWith(y,"[]"))&&(C=p.toArray(h)))return y=pr(y),C.forEach(function(R,I){!(p.isUndefined(R)||R===null)&&e.append(s===!0?dr([y],I,o):s===null?y:y+"[]",c(R))}),!1}return at(h)?!0:(e.append(dr(g,y,o),c(h)),!1)}const f=[],d=Object.assign(ro,{defaultVisitor:u,convertValue:c,isVisitable:at});function m(h,y){if(!p.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),p.forEach(h,function(C,P){(!(p.isUndefined(C)||C===null)&&i.call(e,C,p.isString(P)?P.trim():P,y,d))===!0&&m(C,y?y.concat(P):[P])}),f.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return m(t),e}function hr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ct(t,e){this._pairs=[],t&&we(t,this,e)}const mr=ct.prototype;mr.append=function(e,n){this._pairs.push([e,n])},mr.toString=function(e){const n=e?function(r){return e.call(this,r,hr)}:hr;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function no(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yr(t,e,n){if(!e)return t;const r=n&&n.encode||no,i=n&&n.serialize;let o;if(i?o=i(e,n):o=p.isURLSearchParams(e)?e.toString():new ct(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class gr{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){p.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},io={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ct,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},lt=typeof window<"u"&&typeof document<"u",oo=(t=>lt&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),so=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ao=lt&&window.location.href||"http://localhost",V={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserEnv:oo,hasStandardBrowserWebWorkerEnv:so,origin:ao},Symbol.toStringTag,{value:"Module"})),...io};function co(t,e){return we(t,new V.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return V.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function lo(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function uo(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 vr(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&p.isArray(i)?i.length:s,l?(p.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!p.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&p.isArray(i[s])&&(i[s]=uo(i[s])),!a)}if(p.isFormData(t)&&p.isFunction(t.entries)){const n={};return p.forEachEntry(t,(r,i)=>{e(lo(r),i,n,0)}),n}return null}function fo(t,e,n){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Oe={transitional:Sr,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=p.isObject(e);if(o&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return i?JSON.stringify(vr(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.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 co(e,this.formSerializer).toString();if((a=p.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return we(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),fo(e)):e}],transformResponse:[function(e){const n=this.transitional||Oe.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.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"?b.from(a,b.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:V.classes.FormData,Blob:V.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Oe.headers[t]={}});const po=p.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"]),ho=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]&&po[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Cr=Symbol("internals");function Ae(t){return t&&String(t).trim().toLowerCase()}function Be(t){return t===!1||t==null?t:p.isArray(t)?t.map(Be):String(t)}function mo(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 yo=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ut(t,e,n,r,i){if(p.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!p.isString(e)){if(p.isString(r))return e.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(e)}}function go(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function So(t,e){const n=p.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})})}let U=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=Ae(l);if(!u)throw new Error("header name must be a non-empty string");const f=p.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Be(a))}const s=(a,l)=>p.forEach(a,(c,u)=>o(c,u,l));if(p.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(p.isString(e)&&(e=e.trim())&&!yo(e))s(ho(e),n);else if(p.isHeaders(e))for(const[a,l]of e.entries())o(l,a,r);else e!=null&&o(n,e,r);return this}get(e,n){if(e=Ae(e),e){const r=p.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return mo(i);if(p.isFunction(n))return n.call(this,i,r);if(p.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ae(e),e){const r=p.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ut(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Ae(s),s){const a=p.findKey(r,s);a&&(!n||ut(r,r[a],a,n))&&(delete r[a],i=!0)}}return p.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||ut(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return p.forEach(this,(i,o)=>{const s=p.findKey(r,o);if(s){n[s]=Be(i),delete n[o];return}const a=e?go(o):String(o).trim();a!==o&&delete n[o],n[a]=Be(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return p.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&p.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
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[Cr]=this[Cr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ae(s);r[a]||(So(i,s),r[a]=!0)}return p.isArray(e)?e.forEach(o):o(e),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(U.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),p.freezeMethods(U);function ft(t,e){const n=this||Oe,r=e||n,i=U.from(r.headers);let o=r.data;return p.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function br(t){return!!(t&&t.__CANCEL__)}function pe(t,e,n){b.call(this,t??"canceled",b.ERR_CANCELED,e,n),this.name="CanceledError"}p.inherits(pe,b,{__CANCEL__:!0});function Rr(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Co(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,d=0;for(;f!==i;)d+=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(d*1e3/m):void 0}}function bo(t,e){let n=0,r=1e3/e,i,o;const s=(c,u=Date.now())=>{n=u,i=null,o&&(clearTimeout(o),o=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const je=(t,e,n=3)=>{let r=0;const i=Co(50,250);return bo(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},Tr=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Er=t=>(...e)=>p.asap(()=>t(...e)),Ro=V.hasStandardBrowserEnv?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=p.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),To=V.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];p.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),p.isString(r)&&s.push("path="+r),p.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Eo(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Po(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Pr(t,e){return t&&!Eo(e)?Po(t,e):e}const Or=t=>t instanceof U?{...t}:t;function oe(t,e){e=e||{};const n={};function r(c,u,f){return p.isPlainObject(c)&&p.isPlainObject(u)?p.merge.call({caseless:f},c,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function i(c,u,f){if(p.isUndefined(u)){if(!p.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!p.isUndefined(u))return r(void 0,u)}function s(c,u){if(p.isUndefined(u)){if(!p.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,withXSRFToken: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(Or(c),Or(u),!0)};return p.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,d=f(t[u],e[u],u);p.isUndefined(d)&&f!==a||(n[u]=d)}),n}const Ar=t=>{const e=oe({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=e;e.headers=s=U.from(s),e.url=yr(Pr(e.baseURL,e.url),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(p.isFormData(n)){if(V.hasStandardBrowserEnv||V.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(V.hasStandardBrowserEnv&&(r&&p.isFunction(r)&&(r=r(e)),r||r!==!1&&Ro(e.url))){const c=i&&o&&To.read(o);c&&s.set(i,c)}return e},Oo=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=Ar(t);let o=i.data;const s=U.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,f,d,m,h;function y(){m&&m(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function C(){if(!g)return;const R=U.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),$={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:R,config:t,request:g};Rr(function(L){n(L),y()},function(L){r(L),y()},$),g=null}"onloadend"in g?g.onloadend=C:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(C)},g.onabort=function(){g&&(r(new b("Request aborted",b.ECONNABORTED,t,g)),g=null)},g.onerror=function(){r(new b("Network Error",b.ERR_NETWORK,t,g)),g=null},g.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const $=i.transitional||Sr;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new b(I,$.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,t,g)),g=null},o===void 0&&s.setContentType(null),"setRequestHeader"in g&&p.forEach(s.toJSON(),function(I,$){g.setRequestHeader($,I)}),p.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),a&&a!=="json"&&(g.responseType=i.responseType),c&&([d,h]=je(c,!0),g.addEventListener("progress",d)),l&&g.upload&&([f,m]=je(l),g.upload.addEventListener("progress",f),g.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(u=R=>{g&&(r(!R||R.type?new pe(null,t,g):R),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const P=vo(i.url);if(P&&V.protocols.indexOf(P)===-1){r(new b("Unsupported protocol "+P+":",b.ERR_BAD_REQUEST,t));return}g.send(o||null)})},Ao=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,s();const c=l instanceof Error?l:this.reason;n.abort(c instanceof b?c:new pe(c instanceof Error?c.message:c))}};let o=e&&setTimeout(()=>{i(new b(`timeout ${e} of ms exceeded`,b.ETIMEDOUT))},e);const s=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{o&&clearTimeout(o),o=null}]},Do=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},_o=async function*(t,e,n){for await(const r of t)yield*Do(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Dr=(t,e,n,r,i)=>{const o=_o(t,e,i);let s=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await o.next();if(u){l(),c.close();return}let d=f.byteLength;if(n){let m=s+=d;n(m)}c.enqueue(new Uint8Array(f))}catch(u){throw l(u),u}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},$e=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_r=$e&&typeof ReadableStream=="function",pt=$e&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Ir=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Io=_r&&Ir(()=>{let t=!1;const e=new Request(V.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Lr=64*1024,dt=_r&&Ir(()=>p.isReadableStream(new Response("").body)),He={stream:dt&&(t=>t.body)};$e&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!He[e]&&(He[e]=p.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new b(`Response type '${e}' is not supported`,b.ERR_NOT_SUPPORT,r)})})})(new Response);const Lo=async t=>{if(t==null)return 0;if(p.isBlob(t))return t.size;if(p.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(p.isArrayBufferView(t)||p.isArrayBuffer(t))return t.byteLength;if(p.isURLSearchParams(t)&&(t=t+""),p.isString(t))return(await pt(t)).byteLength},ko=async(t,e)=>{const n=p.toFiniteNumber(t.getContentLength());return n??Lo(e)},ht={http:eo,xhr:Oo,fetch:$e&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Ar(t);c=c?(c+"").toLowerCase():"text";let[m,h]=i||o||s?Ao([i,o],s):[],y,g;const C=()=>{!y&&setTimeout(()=>{m&&m.unsubscribe()}),y=!0};let P;try{if(l&&Io&&n!=="get"&&n!=="head"&&(P=await ko(u,r))!==0){let N=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(p.isFormData(r)&&(L=N.headers.get("content-type"))&&u.setContentType(L),N.body){const[H,z]=Tr(P,je(Er(l)));r=Dr(N.body,Lr,H,z,pt)}}p.isString(f)||(f=f?"include":"omit"),g=new Request(e,{...d,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:f});let R=await fetch(g);const I=dt&&(c==="stream"||c==="response");if(dt&&(a||I)){const N={};["status","statusText","headers"].forEach(X=>{N[X]=R[X]});const L=p.toFiniteNumber(R.headers.get("content-length")),[H,z]=a&&Tr(L,je(Er(a),!0))||[];R=new Response(Dr(R.body,Lr,H,()=>{z&&z(),I&&C()},pt),N)}c=c||"text";let $=await He[p.findKey(He,c)||"text"](R,t);return!I&&C(),h&&h(),await new Promise((N,L)=>{Rr(N,L,{data:$,headers:U.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:g})})}catch(R){throw C(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,t,g),{cause:R.cause||R}):b.from(R,R&&R.code,t,g)}})};p.forEach(ht,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const kr=t=>`- ${t}`,xo=t=>p.isFunction(t)||t===null||t===!1,xr={getAdapter:t=>{t=p.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!xo(n)&&(r=ht[(s=String(n)).toLowerCase()],r===void 0))throw new b(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
|
|
4
4
|
`+o.map(kr).join(`
|
|
5
5
|
`):" "+kr(o[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ht};function mt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new pe(null,t)}function Mr(t){return mt(t),t.headers=U.from(t.headers),t.data=ft.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),xr.getAdapter(t.adapter||Oe.adapter)(t).then(function(r){return mt(t),r.data=ft.call(t,t.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return br(r)||(mt(t),r&&r.response&&(r.response.data=ft.call(t,t.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Fr="1.7.4",yt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{yt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Nr={};yt.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Fr+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new b(i(s," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!Nr[s]&&(Nr[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 Mo(t,e,n){if(typeof t!="object")throw new b("options must be an object",b.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 b("option "+o+" must be "+l,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const gt={assertOptions:Mo,validators:yt},Z=gt.validators;let se=class{constructor(e){this.defaults=e,this.interceptors={request:new gr,response:new gr}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
-
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=oe(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&>.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean)},!1),i!=null&&(p.isFunction(i)?n.paramsSerializer={serialize:i}:gt.assertOptions(i,{encode:Z.function,serialize:Z.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=U.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,d;if(!l){const h=[Mr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),d=h.length,u=Promise.resolve(n);f<d;)u=u.then(h[f++],h[f++]);return u}d=a.length;let m=n;for(f=0;f<d;){const h=a[f++],y=a[f++];try{m=h(m)}catch(g){y.call(this,g);break}}try{u=Mr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,d=c.length;f<d;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=oe(this.defaults,e);const n=Pr(e.baseURL,e.url);return yr(n,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){se.prototype[e]=function(n,r){return this.request(oe(r||{},{method:e,url:n,data:(r||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(oe(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}se.prototype[e]=n(),se.prototype[e+"Form"]=n(!0)});let Fo=class hi{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 pe(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 hi(function(i){e=i}),cancel:e}}};function No(t){return function(n){return t.apply(null,n)}}function Uo(t){return p.isObject(t)&&t.isAxiosError===!0}const St={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(St).forEach(([t,e])=>{St[e]=t});function Ur(t){const e=new se(t),n=ne(se.prototype.request,e);return p.extend(n,se.prototype,e,{allOwnKeys:!0}),p.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ur(oe(t,i))},n}const O=Ur(Oe);O.Axios=se,O.CanceledError=pe,O.CancelToken=Fo,O.isCancel=br,O.VERSION=Fr,O.toFormData=we,O.AxiosError=b,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=No,O.isAxiosError=Uo,O.mergeConfig=oe,O.AxiosHeaders=U,O.formToJSON=t=>vr(p.isHTMLForm(t)?new FormData(t):t),O.getAdapter=xr.getAdapter,O.HttpStatusCode=St,O.default=O;const{Axios:yc,AxiosError:gc,CanceledError:Sc,isCancel:vc,CancelToken:Cc,VERSION:bc,all:Rc,Cancel:Tc,isAxiosError:Ec,spread:Pc,toFormData:Oc,AxiosHeaders:Ac,HttpStatusCode:Dc,formToJSON:_c,getAdapter:Ic,mergeConfig:Lc}=O;function wr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wo(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 Bo=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},Br=typeof Symbol<"u"&&Symbol,jo=Bo,$o=function(){return typeof Br!="function"||typeof Symbol!="function"||typeof Br("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:jo()},jr={foo:{}},Ho=Object,Go=function(){return{__proto__:jr}.foo===jr.foo&&!({__proto__:null}instanceof Ho)},Vo="Function.prototype.bind called on incompatible ",vt=Array.prototype.slice,zo=Object.prototype.toString,qo="[object Function]",Jo=function(e){var n=this;if(typeof n!="function"||zo.call(n)!==qo)throw new TypeError(Vo+n);for(var r=vt.call(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,r.concat(vt.call(arguments)));return Object(u)===u?u:this}else return n.apply(e,r.concat(vt.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},Wo=Jo,Ct=Function.prototype.bind||Wo,Ko=Ct,Qo=Ko.call(Function.call,Object.prototype.hasOwnProperty),T,de=SyntaxError,$r=Function,he=TypeError,bt=function(t){try{return $r('"use strict"; return ('+t+").constructor;")()}catch{}},ae=Object.getOwnPropertyDescriptor;if(ae)try{ae({},"")}catch{ae=null}var Rt=function(){throw new he},Xo=ae?function(){try{return arguments.callee,Rt}catch{try{return ae(arguments,"callee").get}catch{return Rt}}}():Rt,me=$o(),Yo=Go(),D=Object.getPrototypeOf||(Yo?function(t){return t.__proto__}:null),ye={},Zo=typeof Uint8Array>"u"||!D?T:D(Uint8Array),ce={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":me&&D?D([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":ye,"%AsyncGenerator%":ye,"%AsyncGeneratorFunction%":ye,"%AsyncIteratorPrototype%":ye,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?T:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?T:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":$r,"%GeneratorFunction%":ye,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":me&&D?D(D([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!me||!D?T:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!me||!D?T:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":me&&D?D(""[Symbol.iterator]()):T,"%Symbol%":me?Symbol:T,"%SyntaxError%":de,"%ThrowTypeError%":Xo,"%TypedArray%":Zo,"%TypeError%":he,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet};if(D)try{null.error}catch(t){var es=D(D(t));ce["%Error.prototype%"]=es}var ts=function t(e){var n;if(e==="%AsyncFunction%")n=bt("async function () {}");else if(e==="%GeneratorFunction%")n=bt("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=bt("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&D&&(n=D(i.prototype))}return ce[e]=n,n},Hr={"%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"]},De=Ct,Ge=Qo,rs=De.call(Function.call,Array.prototype.concat),ns=De.call(Function.apply,Array.prototype.splice),Gr=De.call(Function.call,String.prototype.replace),Ve=De.call(Function.call,String.prototype.slice),is=De.call(Function.call,RegExp.prototype.exec),os=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ss=/\\(\\)?/g,as=function(e){var n=Ve(e,0,1),r=Ve(e,-1);if(n==="%"&&r!=="%")throw new de("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new de("invalid intrinsic syntax, expected opening `%`");var i=[];return Gr(e,os,function(o,s,a,l){i[i.length]=a?Gr(l,ss,"$1"):s||o}),i},cs=function(e,n){var r=e,i;if(Ge(Hr,r)&&(i=Hr[r],r="%"+i[0]+"%"),Ge(ce,r)){var o=ce[r];if(o===ye&&(o=ts(r)),typeof o>"u"&&!n)throw new he("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new de("intrinsic "+e+" does not exist!")},Tt=function(e,n){if(typeof e!="string"||e.length===0)throw new he("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new he('"allowMissing" argument must be a boolean');if(is(/^%?[^%]*%?$/,e)===null)throw new de("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=as(e),i=r.length>0?r[0]:"",o=cs("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],ns(r,rs([0,1],c)));for(var u=1,f=!0;u<r.length;u+=1){var d=r[u],m=Ve(d,0,1),h=Ve(d,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new de("property names with quotes must have matching quotes");if((d==="constructor"||!f)&&(l=!0),i+="."+d,s="%"+i+"%",Ge(ce,s))a=ce[s];else if(a!=null){if(!(d in a)){if(!n)throw new he("base intrinsic for "+e+" exists, but the property is not available.");return}if(ae&&u+1>=r.length){var y=ae(a,d);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[d]}else f=Ge(a,d),a=a[d];f&&!l&&(ce[s]=a)}}return a},Vr={exports:{}};(function(t){var e=Ct,n=Tt,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 d=o(e,i,arguments);if(s&&a){var m=s(d,"length");m.configurable&&a(d,"length",{value:1+l(0,f.length-(arguments.length-1))})}return d};var c=function(){return o(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(Vr);var ls=Vr.exports,zr=Tt,qr=ls,us=qr(zr("String.prototype.indexOf")),fs=function(e,n){var r=zr(e,!!n);return typeof r=="function"&&us(e,".prototype.")>-1?qr(r):r};const ps=wo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Et=typeof Map=="function"&&Map.prototype,Pt=Object.getOwnPropertyDescriptor&&Et?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ze=Et&&Pt&&typeof Pt.get=="function"?Pt.get:null,Jr=Et&&Map.prototype.forEach,Ot=typeof Set=="function"&&Set.prototype,At=Object.getOwnPropertyDescriptor&&Ot?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,qe=Ot&&At&&typeof At.get=="function"?At.get:null,Wr=Ot&&Set.prototype.forEach,ds=typeof WeakMap=="function"&&WeakMap.prototype,_e=ds?WeakMap.prototype.has:null,hs=typeof WeakSet=="function"&&WeakSet.prototype,Ie=hs?WeakSet.prototype.has:null,ms=typeof WeakRef=="function"&&WeakRef.prototype,Kr=ms?WeakRef.prototype.deref:null,ys=Boolean.prototype.valueOf,gs=Object.prototype.toString,Ss=Function.prototype.toString,vs=String.prototype.match,Dt=String.prototype.slice,ee=String.prototype.replace,Cs=String.prototype.toUpperCase,Qr=String.prototype.toLowerCase,Xr=RegExp.prototype.test,Yr=Array.prototype.concat,J=Array.prototype.join,bs=Array.prototype.slice,Zr=Math.floor,_t=typeof BigInt=="function"?BigInt.prototype.valueOf:null,It=Object.getOwnPropertySymbols,Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ge=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ge||!0)?Symbol.toStringTag:null,en=Object.prototype.propertyIsEnumerable,tn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function rn(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Xr.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Zr(-t):Zr(t);if(r!==t){var i=String(r),o=Dt.call(e,i.length+1);return ee.call(i,n,"$&_")+"."+ee.call(ee.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ee.call(e,n,"$&_")}var kt=ps,nn=kt.custom,on=cn(nn)?nn:null,Rs=function t(e,n,r,i){var o=n||{};if(te(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(te(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=te(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(te(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(te(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 un(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?rn(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?rn(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 xt(e)?"[Array]":"[Object]";var f=js(o,r);if(typeof i>"u")i=[];else if(ln(i,e)>=0)return"[Circular]";function d(Y,Re,nt){if(Re&&(i=bs.call(i),i.push(Re)),nt){var Te={depth:o.depth};return te(o,"quoteStyle")&&(Te.quoteStyle=o.quoteStyle),t(Y,Te,r+1,i)}return t(Y,o,r+1,i)}if(typeof e=="function"&&!an(e)){var m=Ls(e),h=Je(e,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+J.call(h,", ")+" }":"")}if(cn(e)){var y=ge?ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Lt.call(e);return typeof e=="object"&&!ge?Le(y):y}if(Us(e)){for(var g="<"+Qr.call(String(e.nodeName)),C=e.attributes||[],P=0;P<C.length;P++)g+=" "+C[P].name+"="+sn(Ts(C[P].value),"double",o);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+Qr.call(String(e.nodeName))+">",g}if(xt(e)){if(e.length===0)return"[]";var R=Je(e,d);return f&&!Bs(R)?"["+Ft(R,f)+"]":"[ "+J.call(R,", ")+" ]"}if(Ps(e)){var I=Je(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!en.call(e,"cause")?"{ ["+String(e)+"] "+J.call(Yr.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+J.call(I,", ")+" }"}if(typeof e=="object"&&s){if(on&&typeof e[on]=="function"&&kt)return kt(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ks(e)){var $=[];return Jr&&Jr.call(e,function(Y,Re){$.push(d(Re,e,!0)+" => "+d(Y,e))}),fn("Map",ze.call(e),$,f)}if(Fs(e)){var N=[];return Wr&&Wr.call(e,function(Y){N.push(d(Y,e))}),fn("Set",qe.call(e),N,f)}if(xs(e))return Mt("WeakMap");if(Ns(e))return Mt("WeakSet");if(Ms(e))return Mt("WeakRef");if(As(e))return Le(d(Number(e)));if(_s(e))return Le(d(_t.call(e)));if(Ds(e))return Le(ys.call(e));if(Os(e))return Le(d(String(e)));if(!Es(e)&&!an(e)){var L=Je(e,d),H=tn?tn(e)===Object.prototype:e instanceof Object||e.constructor===Object,z=e instanceof Object?"":"null prototype",X=!H&&k&&Object(e)===e&&k in e?Dt.call(re(e),8,-1):z?"Object":"",xe=H||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=xe+(X||z?"["+J.call(Yr.call([],X||[],z||[]),": ")+"] ":"");return L.length===0?q+"{}":f?q+"{"+Ft(L,f)+"}":q+"{ "+J.call(L,", ")+" }"}return String(e)};function sn(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function Ts(t){return ee.call(String(t),/"/g,""")}function xt(t){return re(t)==="[object Array]"&&(!k||!(typeof t=="object"&&k in t))}function Es(t){return re(t)==="[object Date]"&&(!k||!(typeof t=="object"&&k in t))}function an(t){return re(t)==="[object RegExp]"&&(!k||!(typeof t=="object"&&k in t))}function Ps(t){return re(t)==="[object Error]"&&(!k||!(typeof t=="object"&&k in t))}function Os(t){return re(t)==="[object String]"&&(!k||!(typeof t=="object"&&k in t))}function As(t){return re(t)==="[object Number]"&&(!k||!(typeof t=="object"&&k in t))}function Ds(t){return re(t)==="[object Boolean]"&&(!k||!(typeof t=="object"&&k in t))}function cn(t){if(ge)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Lt)return!1;try{return Lt.call(t),!0}catch{}return!1}function _s(t){if(!t||typeof t!="object"||!_t)return!1;try{return _t.call(t),!0}catch{}return!1}var Is=Object.prototype.hasOwnProperty||function(t){return t in this};function te(t,e){return Is.call(t,e)}function re(t){return gs.call(t)}function Ls(t){if(t.name)return t.name;var e=vs.call(Ss.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function ln(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 ks(t){if(!ze||!t||typeof t!="object")return!1;try{ze.call(t);try{qe.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function xs(t){if(!_e||!t||typeof t!="object")return!1;try{_e.call(t,_e);try{Ie.call(t,Ie)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Ms(t){if(!Kr||!t||typeof t!="object")return!1;try{return Kr.call(t),!0}catch{}return!1}function Fs(t){if(!qe||!t||typeof t!="object")return!1;try{qe.call(t);try{ze.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Ns(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t,Ie);try{_e.call(t,_e)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Us(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function un(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return un(Dt.call(t,0,e.maxStringLength),e)+r}var i=ee.call(ee.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ws);return sn(i,"single",e)}function ws(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":"")+Cs.call(e.toString(16))}function Le(t){return"Object("+t+")"}function Mt(t){return t+" { ? }"}function fn(t,e,n,r){var i=r?Ft(n,r):J.call(n,", ");return t+" ("+e+") {"+i+"}"}function Bs(t){for(var e=0;e<t.length;e++)if(ln(t[e],`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=oe(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&>.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean)},!1),i!=null&&(p.isFunction(i)?n.paramsSerializer={serialize:i}:gt.assertOptions(i,{encode:Z.function,serialize:Z.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=U.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,d;if(!l){const h=[Mr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),d=h.length,u=Promise.resolve(n);f<d;)u=u.then(h[f++],h[f++]);return u}d=a.length;let m=n;for(f=0;f<d;){const h=a[f++],y=a[f++];try{m=h(m)}catch(g){y.call(this,g);break}}try{u=Mr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,d=c.length;f<d;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=oe(this.defaults,e);const n=Pr(e.baseURL,e.url);return yr(n,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){se.prototype[e]=function(n,r){return this.request(oe(r||{},{method:e,url:n,data:(r||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(oe(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}se.prototype[e]=n(),se.prototype[e+"Form"]=n(!0)});let Fo=class hi{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 pe(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 hi(function(i){e=i}),cancel:e}}};function No(t){return function(n){return t.apply(null,n)}}function Uo(t){return p.isObject(t)&&t.isAxiosError===!0}const St={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(St).forEach(([t,e])=>{St[e]=t});function Ur(t){const e=new se(t),n=ne(se.prototype.request,e);return p.extend(n,se.prototype,e,{allOwnKeys:!0}),p.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ur(oe(t,i))},n}const O=Ur(Oe);O.Axios=se,O.CanceledError=pe,O.CancelToken=Fo,O.isCancel=br,O.VERSION=Fr,O.toFormData=we,O.AxiosError=b,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=No,O.isAxiosError=Uo,O.mergeConfig=oe,O.AxiosHeaders=U,O.formToJSON=t=>vr(p.isHTMLForm(t)?new FormData(t):t),O.getAdapter=xr.getAdapter,O.HttpStatusCode=St,O.default=O;const{Axios:gc,AxiosError:Sc,CanceledError:vc,isCancel:Cc,CancelToken:bc,VERSION:Rc,all:Tc,Cancel:Ec,isAxiosError:Pc,spread:Oc,toFormData:Ac,AxiosHeaders:Dc,HttpStatusCode:_c,formToJSON:Ic,getAdapter:Lc,mergeConfig:kc}=O;function wr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wo(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 Bo=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},Br=typeof Symbol<"u"&&Symbol,jo=Bo,$o=function(){return typeof Br!="function"||typeof Symbol!="function"||typeof Br("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:jo()},jr={foo:{}},Ho=Object,Go=function(){return{__proto__:jr}.foo===jr.foo&&!({__proto__:null}instanceof Ho)},Vo="Function.prototype.bind called on incompatible ",vt=Array.prototype.slice,zo=Object.prototype.toString,qo="[object Function]",Jo=function(e){var n=this;if(typeof n!="function"||zo.call(n)!==qo)throw new TypeError(Vo+n);for(var r=vt.call(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,r.concat(vt.call(arguments)));return Object(u)===u?u:this}else return n.apply(e,r.concat(vt.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},Wo=Jo,Ct=Function.prototype.bind||Wo,Ko=Ct,Qo=Ko.call(Function.call,Object.prototype.hasOwnProperty),T,de=SyntaxError,$r=Function,he=TypeError,bt=function(t){try{return $r('"use strict"; return ('+t+").constructor;")()}catch{}},ae=Object.getOwnPropertyDescriptor;if(ae)try{ae({},"")}catch{ae=null}var Rt=function(){throw new he},Xo=ae?function(){try{return arguments.callee,Rt}catch{try{return ae(arguments,"callee").get}catch{return Rt}}}():Rt,me=$o(),Yo=Go(),D=Object.getPrototypeOf||(Yo?function(t){return t.__proto__}:null),ye={},Zo=typeof Uint8Array>"u"||!D?T:D(Uint8Array),ce={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":me&&D?D([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":ye,"%AsyncGenerator%":ye,"%AsyncGeneratorFunction%":ye,"%AsyncIteratorPrototype%":ye,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?T:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?T:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":$r,"%GeneratorFunction%":ye,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":me&&D?D(D([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!me||!D?T:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!me||!D?T:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":me&&D?D(""[Symbol.iterator]()):T,"%Symbol%":me?Symbol:T,"%SyntaxError%":de,"%ThrowTypeError%":Xo,"%TypedArray%":Zo,"%TypeError%":he,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet};if(D)try{null.error}catch(t){var es=D(D(t));ce["%Error.prototype%"]=es}var ts=function t(e){var n;if(e==="%AsyncFunction%")n=bt("async function () {}");else if(e==="%GeneratorFunction%")n=bt("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=bt("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&D&&(n=D(i.prototype))}return ce[e]=n,n},Hr={"%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"]},De=Ct,Ge=Qo,rs=De.call(Function.call,Array.prototype.concat),ns=De.call(Function.apply,Array.prototype.splice),Gr=De.call(Function.call,String.prototype.replace),Ve=De.call(Function.call,String.prototype.slice),is=De.call(Function.call,RegExp.prototype.exec),os=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ss=/\\(\\)?/g,as=function(e){var n=Ve(e,0,1),r=Ve(e,-1);if(n==="%"&&r!=="%")throw new de("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new de("invalid intrinsic syntax, expected opening `%`");var i=[];return Gr(e,os,function(o,s,a,l){i[i.length]=a?Gr(l,ss,"$1"):s||o}),i},cs=function(e,n){var r=e,i;if(Ge(Hr,r)&&(i=Hr[r],r="%"+i[0]+"%"),Ge(ce,r)){var o=ce[r];if(o===ye&&(o=ts(r)),typeof o>"u"&&!n)throw new he("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new de("intrinsic "+e+" does not exist!")},Tt=function(e,n){if(typeof e!="string"||e.length===0)throw new he("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new he('"allowMissing" argument must be a boolean');if(is(/^%?[^%]*%?$/,e)===null)throw new de("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=as(e),i=r.length>0?r[0]:"",o=cs("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],ns(r,rs([0,1],c)));for(var u=1,f=!0;u<r.length;u+=1){var d=r[u],m=Ve(d,0,1),h=Ve(d,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new de("property names with quotes must have matching quotes");if((d==="constructor"||!f)&&(l=!0),i+="."+d,s="%"+i+"%",Ge(ce,s))a=ce[s];else if(a!=null){if(!(d in a)){if(!n)throw new he("base intrinsic for "+e+" exists, but the property is not available.");return}if(ae&&u+1>=r.length){var y=ae(a,d);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[d]}else f=Ge(a,d),a=a[d];f&&!l&&(ce[s]=a)}}return a},Vr={exports:{}};(function(t){var e=Ct,n=Tt,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 d=o(e,i,arguments);if(s&&a){var m=s(d,"length");m.configurable&&a(d,"length",{value:1+l(0,f.length-(arguments.length-1))})}return d};var c=function(){return o(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(Vr);var ls=Vr.exports,zr=Tt,qr=ls,us=qr(zr("String.prototype.indexOf")),fs=function(e,n){var r=zr(e,!!n);return typeof r=="function"&&us(e,".prototype.")>-1?qr(r):r};const ps=wo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Et=typeof Map=="function"&&Map.prototype,Pt=Object.getOwnPropertyDescriptor&&Et?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ze=Et&&Pt&&typeof Pt.get=="function"?Pt.get:null,Jr=Et&&Map.prototype.forEach,Ot=typeof Set=="function"&&Set.prototype,At=Object.getOwnPropertyDescriptor&&Ot?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,qe=Ot&&At&&typeof At.get=="function"?At.get:null,Wr=Ot&&Set.prototype.forEach,ds=typeof WeakMap=="function"&&WeakMap.prototype,_e=ds?WeakMap.prototype.has:null,hs=typeof WeakSet=="function"&&WeakSet.prototype,Ie=hs?WeakSet.prototype.has:null,ms=typeof WeakRef=="function"&&WeakRef.prototype,Kr=ms?WeakRef.prototype.deref:null,ys=Boolean.prototype.valueOf,gs=Object.prototype.toString,Ss=Function.prototype.toString,vs=String.prototype.match,Dt=String.prototype.slice,ee=String.prototype.replace,Cs=String.prototype.toUpperCase,Qr=String.prototype.toLowerCase,Xr=RegExp.prototype.test,Yr=Array.prototype.concat,J=Array.prototype.join,bs=Array.prototype.slice,Zr=Math.floor,_t=typeof BigInt=="function"?BigInt.prototype.valueOf:null,It=Object.getOwnPropertySymbols,Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ge=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ge||!0)?Symbol.toStringTag:null,en=Object.prototype.propertyIsEnumerable,tn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function rn(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Xr.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Zr(-t):Zr(t);if(r!==t){var i=String(r),o=Dt.call(e,i.length+1);return ee.call(i,n,"$&_")+"."+ee.call(ee.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ee.call(e,n,"$&_")}var kt=ps,nn=kt.custom,on=cn(nn)?nn:null,Rs=function t(e,n,r,i){var o=n||{};if(te(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(te(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=te(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(te(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(te(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 un(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?rn(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?rn(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 xt(e)?"[Array]":"[Object]";var f=js(o,r);if(typeof i>"u")i=[];else if(ln(i,e)>=0)return"[Circular]";function d(Y,Re,nt){if(Re&&(i=bs.call(i),i.push(Re)),nt){var Te={depth:o.depth};return te(o,"quoteStyle")&&(Te.quoteStyle=o.quoteStyle),t(Y,Te,r+1,i)}return t(Y,o,r+1,i)}if(typeof e=="function"&&!an(e)){var m=Ls(e),h=Je(e,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+J.call(h,", ")+" }":"")}if(cn(e)){var y=ge?ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Lt.call(e);return typeof e=="object"&&!ge?Le(y):y}if(Us(e)){for(var g="<"+Qr.call(String(e.nodeName)),C=e.attributes||[],P=0;P<C.length;P++)g+=" "+C[P].name+"="+sn(Ts(C[P].value),"double",o);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+Qr.call(String(e.nodeName))+">",g}if(xt(e)){if(e.length===0)return"[]";var R=Je(e,d);return f&&!Bs(R)?"["+Ft(R,f)+"]":"[ "+J.call(R,", ")+" ]"}if(Ps(e)){var I=Je(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!en.call(e,"cause")?"{ ["+String(e)+"] "+J.call(Yr.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+J.call(I,", ")+" }"}if(typeof e=="object"&&s){if(on&&typeof e[on]=="function"&&kt)return kt(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ks(e)){var $=[];return Jr&&Jr.call(e,function(Y,Re){$.push(d(Re,e,!0)+" => "+d(Y,e))}),fn("Map",ze.call(e),$,f)}if(Fs(e)){var N=[];return Wr&&Wr.call(e,function(Y){N.push(d(Y,e))}),fn("Set",qe.call(e),N,f)}if(xs(e))return Mt("WeakMap");if(Ns(e))return Mt("WeakSet");if(Ms(e))return Mt("WeakRef");if(As(e))return Le(d(Number(e)));if(_s(e))return Le(d(_t.call(e)));if(Ds(e))return Le(ys.call(e));if(Os(e))return Le(d(String(e)));if(!Es(e)&&!an(e)){var L=Je(e,d),H=tn?tn(e)===Object.prototype:e instanceof Object||e.constructor===Object,z=e instanceof Object?"":"null prototype",X=!H&&k&&Object(e)===e&&k in e?Dt.call(re(e),8,-1):z?"Object":"",xe=H||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=xe+(X||z?"["+J.call(Yr.call([],X||[],z||[]),": ")+"] ":"");return L.length===0?q+"{}":f?q+"{"+Ft(L,f)+"}":q+"{ "+J.call(L,", ")+" }"}return String(e)};function sn(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function Ts(t){return ee.call(String(t),/"/g,""")}function xt(t){return re(t)==="[object Array]"&&(!k||!(typeof t=="object"&&k in t))}function Es(t){return re(t)==="[object Date]"&&(!k||!(typeof t=="object"&&k in t))}function an(t){return re(t)==="[object RegExp]"&&(!k||!(typeof t=="object"&&k in t))}function Ps(t){return re(t)==="[object Error]"&&(!k||!(typeof t=="object"&&k in t))}function Os(t){return re(t)==="[object String]"&&(!k||!(typeof t=="object"&&k in t))}function As(t){return re(t)==="[object Number]"&&(!k||!(typeof t=="object"&&k in t))}function Ds(t){return re(t)==="[object Boolean]"&&(!k||!(typeof t=="object"&&k in t))}function cn(t){if(ge)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Lt)return!1;try{return Lt.call(t),!0}catch{}return!1}function _s(t){if(!t||typeof t!="object"||!_t)return!1;try{return _t.call(t),!0}catch{}return!1}var Is=Object.prototype.hasOwnProperty||function(t){return t in this};function te(t,e){return Is.call(t,e)}function re(t){return gs.call(t)}function Ls(t){if(t.name)return t.name;var e=vs.call(Ss.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function ln(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 ks(t){if(!ze||!t||typeof t!="object")return!1;try{ze.call(t);try{qe.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function xs(t){if(!_e||!t||typeof t!="object")return!1;try{_e.call(t,_e);try{Ie.call(t,Ie)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Ms(t){if(!Kr||!t||typeof t!="object")return!1;try{return Kr.call(t),!0}catch{}return!1}function Fs(t){if(!qe||!t||typeof t!="object")return!1;try{qe.call(t);try{ze.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Ns(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t,Ie);try{_e.call(t,_e)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Us(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function un(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return un(Dt.call(t,0,e.maxStringLength),e)+r}var i=ee.call(ee.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ws);return sn(i,"single",e)}function ws(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":"")+Cs.call(e.toString(16))}function Le(t){return"Object("+t+")"}function Mt(t){return t+" { ? }"}function fn(t,e,n,r){var i=r?Ft(n,r):J.call(n,", ");return t+" ("+e+") {"+i+"}"}function Bs(t){for(var e=0;e<t.length;e++)if(ln(t[e],`
|
|
7
7
|
`)>=0)return!1;return!0}function js(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 Ft(t,e){if(t.length===0)return"";var n=`
|
|
8
8
|
`+e.prev+e.base;return n+J.call(t,","+n)+`
|
|
9
9
|
`+e.prev}function Je(t,e){var n=xt(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=te(t,i)?e(t[i],t):""}var o=typeof It=="function"?It(t):[],s;if(ge){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)te(t,l)&&(n&&String(Number(l))===l&&l<t.length||ge&&s["$"+l]instanceof Symbol||(Xr.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if(typeof It=="function")for(var c=0;c<o.length;c++)en.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var Nt=Tt,Se=fs,$s=Rs,Hs=Nt("%TypeError%"),We=Nt("%WeakMap%",!0),Ke=Nt("%Map%",!0),Gs=Se("WeakMap.prototype.get",!0),Vs=Se("WeakMap.prototype.set",!0),zs=Se("WeakMap.prototype.has",!0),qs=Se("Map.prototype.get",!0),Js=Se("Map.prototype.set",!0),Ws=Se("Map.prototype.has",!0),Ut=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},Ks=function(t,e){var n=Ut(t,e);return n&&n.value},Qs=function(t,e,n){var r=Ut(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},Xs=function(t,e){return!!Ut(t,e)},Ys=function(){var e,n,r,i={assert:function(o){if(!i.has(o))throw new Hs("Side channel does not contain "+$s(o))},get:function(o){if(We&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Gs(e,o)}else if(Ke){if(n)return qs(n,o)}else if(r)return Ks(r,o)},has:function(o){if(We&&o&&(typeof o=="object"||typeof o=="function")){if(e)return zs(e,o)}else if(Ke){if(n)return Ws(n,o)}else if(r)return Xs(r,o);return!1},set:function(o,s){We&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new We),Vs(e,o,s)):Ke?(n||(n=new Ke),Js(n,o,s)):(r||(r={key:{},next:null}),Qs(r,o,s))}};return i},Zs=String.prototype.replace,ea=/%20/g,wt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Bt={default:wt.RFC3986,formatters:{RFC1738:function(t){return Zs.call(t,ea,"+")},RFC3986:function(t){return String(t)}},RFC1738:wt.RFC1738,RFC3986:wt.RFC3986},ta=Bt,jt=Object.prototype.hasOwnProperty,le=Array.isArray,W=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ra=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(le(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},pn=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},na=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(le(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!jt.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 le(e)&&!le(n)&&(i=pn(e,r)),le(e)&&le(n)?(n.forEach(function(o,s){if(jt.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 jt.call(o,s)?o[s]=t(o[s],a,r):o[s]=a,o},i)},ia=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},oa=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}},sa=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===ta.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+W[c];continue}if(c<2048){a=a+(W[192|c>>6]+W[128|c&63]);continue}if(c<55296||c>=57344){a=a+(W[224|c>>12]+W[128|c>>6&63]+W[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=W[240|c>>18]+W[128|c>>12&63]+W[128|c>>6&63]+W[128|c&63]}return a},aa=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 ra(n),e},ca=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},la=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ua=function(e,n){return[].concat(e,n)},fa=function(e,n){if(le(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},dn={arrayToObject:pn,assign:ia,combine:ua,compact:aa,decode:oa,encode:sa,isBuffer:la,isRegExp:ca,maybeMap:fa,merge:na},hn=Ys,Qe=dn,ke=Bt,pa=Object.prototype.hasOwnProperty,mn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},Q=Array.isArray,da=Array.prototype.push,yn=function(t,e){da.apply(t,Q(e)?e:[e])},ha=Date.prototype.toISOString,gn=ke.default,x={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Qe.encode,encodeValuesOnly:!1,format:gn,formatter:ke.formatters[gn],indices:!1,serializeDate:function(e){return ha.call(e)},skipNulls:!1,strictNullHandling:!1},ma=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},$t={},ya=function t(e,n,r,i,o,s,a,l,c,u,f,d,m,h,y,g){for(var C=e,P=g,R=0,I=!1;(P=P.get($t))!==void 0&&!I;){var $=P.get(e);if(R+=1,typeof $<"u"){if($===R)throw new RangeError("Cyclic object value");I=!0}typeof P.get($t)>"u"&&(R=0)}if(typeof l=="function"?C=l(n,C):C instanceof Date?C=f(C):r==="comma"&&Q(C)&&(C=Qe.maybeMap(C,function(Te){return Te instanceof Date?f(Te):Te})),C===null){if(o)return a&&!h?a(n,x.encoder,y,"key",d):n;C=""}if(ma(C)||Qe.isBuffer(C)){if(a){var N=h?n:a(n,x.encoder,y,"key",d);return[m(N)+"="+m(a(C,x.encoder,y,"value",d))]}return[m(n)+"="+m(String(C))]}var L=[];if(typeof C>"u")return L;var H;if(r==="comma"&&Q(C))h&&a&&(C=Qe.maybeMap(C,a)),H=[{value:C.length>0?C.join(",")||null:void 0}];else if(Q(l))H=l;else{var z=Object.keys(C);H=c?z.sort(c):z}for(var X=i&&Q(C)&&C.length===1?n+"[]":n,xe=0;xe<H.length;++xe){var q=H[xe],Y=typeof q=="object"&&typeof q.value<"u"?q.value:C[q];if(!(s&&Y===null)){var Re=Q(C)?typeof r=="function"?r(X,q):X:X+(u?"."+q:"["+q+"]");g.set(e,R);var nt=hn();nt.set($t,g),yn(L,t(Y,Re,r,i,o,s,r==="comma"&&h&&Q(C)?null:a,l,c,u,f,d,m,h,y,nt))}}return L},ga=function(e){if(!e)return x;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||x.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=ke.default;if(typeof e.format<"u"){if(!pa.call(ke.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=ke.formatters[r],o=x.filter;return(typeof e.filter=="function"||Q(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:x.addQueryPrefix,allowDots:typeof e.allowDots>"u"?x.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:x.charsetSentinel,delimiter:typeof e.delimiter>"u"?x.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:x.encode,encoder:typeof e.encoder=="function"?e.encoder:x.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:x.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:x.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:x.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:x.strictNullHandling}},Sa=function(t,e){var n=t,r=ga(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Q(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in mn?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=mn[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=hn(),f=0;f<i.length;++f){var d=i[f];r.skipNulls&&n[d]===null||yn(s,ya(n[d],d,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:""},ve=dn,Ht=Object.prototype.hasOwnProperty,va=Array.isArray,_={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ve.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ca=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},Sn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ba="utf8=%26%2310003%3B",Ra="utf8=%E2%9C%93",Ta=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]===Ra?c="utf-8":s[l]===ba&&(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("]="),d=f===-1?u.indexOf("="):f+1,m,h;d===-1?(m=n.decoder(u,_.decoder,c,"key"),h=n.strictNullHandling?null:""):(m=n.decoder(u.slice(0,d),_.decoder,c,"key"),h=ve.maybeMap(Sn(u.slice(d+1),n),function(y){return n.decoder(y,_.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=Ca(h)),u.indexOf("[]=")>-1&&(h=va(h)?[h]:h),Ht.call(r,m)?r[m]=ve.combine(r[m],h):r[m]=h}return r},Ea=function(t,e,n,r){for(var i=r?e:Sn(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},Pa=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&&Ht.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&&Ht.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),Ea(u,n,r,i)}},Oa=function(e){if(!e)return _;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"?_.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?_.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:_.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:_.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:_.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:_.comma,decoder:typeof e.decoder=="function"?e.decoder:_.decoder,delimiter:typeof e.delimiter=="string"||ve.isRegExp(e.delimiter)?e.delimiter:_.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:_.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:_.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:_.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:_.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_.strictNullHandling}},Aa=function(t,e){var n=Oa(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?Ta(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],l=Pa(a,r[a],n,typeof t=="string");i=ve.merge(i,l,n)}return n.allowSparse===!0?i:ve.compact(i)},Da=Sa,_a=Aa,Ia=Bt,La={formats:Ia,parse:_a,stringify:Da};const ka=wr(La);class vn{constructor(e){S(this,"axiosInstance");this.axiosInstance=O.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)=>ka.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 xa{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}onDataChannelMessage(e){console.debug("onDataChannelMessage:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}var v=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t[t.AUDIO_PUSH=4]="AUDIO_PUSH",t[t.VIDEO_PUSH=5]="VIDEO_PUSH",t[t.AUDIO_HALF=6]="AUDIO_HALF",t[t.VIDEO_HALF=7]="VIDEO_HALF",t))(v||{}),M=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(M||{});let Cn=!0,bn=!0;function Xe(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function ue(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 Ma(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Cn=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Fa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(bn=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Rn(){if(typeof window=="object"){if(Cn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Gt(t,e){bn&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Na(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=Xe(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=Xe(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=Xe(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 Tn(t){return Object.prototype.toString.call(t)==="[object Object]"}function En(t){return Tn(t)?Object.keys(t).reduce(function(e,n){const r=Tn(t[n]),i=r?En(t[n]):t[n],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[n]:i})},{}):t}function Vt(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Vt(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(i=>{Vt(t,t.get(i),n)})}))}function Pn(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&&Vt(t,a,i)})}),i}const On=Rn;function An(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(d,m){return d?d+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let d={};typeof u.ideal=="number"?(d[f("min",c)]=u.ideal,l.optional.push(d),d={},d[f("max",c)]=u.ideal,l.optional.push(d)):(d[f("",c)]=u.ideal,l.optional.push(d))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(d=>{u[d]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(d,c)]=u[d])})}),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,d){f in u&&!(d in u)&&(u[d]=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(d=>{d=d.filter(h=>h.kind==="videoinput");let m=d.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&d.length&&f.includes("back")&&(m=d[d.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=r(a.video),On("chrome: "+JSON.stringify(a)),l(a)})}a.video=r(a.video)}return On("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 Ua(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 Dn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function _n(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 ue(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function In(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 Ln(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 d={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{d[m]=f.stat(m)}),c[d.id]=d}),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 kn(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=>Pn(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}),ue(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>Pn(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 xn(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 Mn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return xn(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 d=[].slice.call(arguments,1);if(d.length!==1||!d[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(d=>{const m=c._reverseStreams[d],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(d=>{const m=c._reverseStreams[d],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 d=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);d[0].apply(null,[y])},h=>{d[1]&&d[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 d;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(d=this._streams[m])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.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 Fn(t,e){ue(t,"negotiationneeded",n=>{const r=n.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return n})}const Nn=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Fn,shimAddTrackRemoveTrack:Mn,shimAddTrackRemoveTrackWithNative:xn,shimGetDisplayMedia:Ua,shimGetSendersWithDtmf:In,shimGetStats:Ln,shimGetUserMedia:An,shimMediaStream:Dn,shimOnTrack:_n,shimPeerConnection:zt,shimSenderReceiverGetStats:kn},Symbol.toStringTag,{value:"Module"}));function Un(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(i,o,s){Gt("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 wa(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 wn(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 qt(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 Bn(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 jn(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}),ue(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function $n(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){Gt("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&n.getTracks().includes(r.track)&&this.removeTrack(r)})})}function Hn(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function Gn(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 Vn(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 zn(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 qn(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 Jn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:Gn,shimCreateAnswer:qn,shimCreateOffer:zn,shimGetDisplayMedia:wa,shimGetParameters:Vn,shimGetUserMedia:Un,shimOnTrack:wn,shimPeerConnection:qt,shimRTCDataChannel:Hn,shimReceiverGetStats:jn,shimRemoveStream:$n,shimSenderGetStats:Bn},Symbol.toStringTag,{value:"Module"}));function Wn(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 Qn(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],d=n.apply(this,[f]);return u?(d.then(c,u),Promise.resolve()):d},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],d=r.apply(this,[f]);return u?(d.then(c,u),Promise.resolve()):d};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 Xn(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(Yn(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}).bind(e))}function Yn(t){return t&&t.video!==void 0?Object.assign({},t,{video:En(t.video)}):t}function Zn(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?(Gt("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 ei(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 ti(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 ri(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const ni=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:ri,shimCallbacksAPI:Qn,shimConstraints:Yn,shimCreateOfferLegacy:ti,shimGetUserMedia:Xn,shimLocalStreamsAPI:Wn,shimRTCIceServerUrls:Zn,shimRemoteStreamsAPI:Kn,shimTrackEventTransceiver:ei},Symbol.toStringTag,{value:"Module"}));var ii={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(`
|
|
@@ -40,4 +40,4 @@ t=0 0\r
|
|
|
40
40
|
`},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})(ii);var oi=ii.exports;const Ce=wr(oi),Ba=w({__proto__:null,default:Ce},[oi]);function Ye(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=Ce.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,ue(t,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new t.RTCIceCandidate(n.candidate),writable:"false"}),n))}function Jt(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||ue(t,"icecandidate",e=>{if(e.candidate){const n=Ce.parseCandidate(e.candidate.candidate);n.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e})}function Ze(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=Ce.splitSections(a.sdp);return l.shift(),l.some(c=>{const u=Ce.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=Ce.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 d={};Object.defineProperty(d,"maxMessageSize",{get(){return f}}),this._sctp=d}return s.apply(this,arguments)}}function et(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},ue(t,"datachannel",r=>(e(r.channel,r.target),r))}function Wt(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 Kt(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(`
|
|
41
41
|
a=extmap-allow-mixed`)!==-1){const o=i.sdp.split(`
|
|
42
42
|
`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
|
|
43
|
-
`);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 tt(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 rt(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 ja=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Kt,shimAddIceCandidateNullOrEmpty:tt,shimConnectionState:Wt,shimMaxMessageSize:Ze,shimParameterlessSetLocalDescription:rt,shimRTCIceCandidate:Ye,shimRTCIceCandidateRelayProtocol:Jt,shimSendThrowTypeError:et},Symbol.toStringTag,{value:"Module"}));function $a({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Rn,r=Na(t),i={browserDetails:r,commonShim:ja,extractVersion:Xe,disableLog:Ma,disableWarnings:Fa,sdp:Ba};switch(r.browser){case"chrome":if(!Nn||!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=Nn,tt(t,r),rt(t),An(t,r),Dn(t),zt(t,r),_n(t),Mn(t,r),In(t),Ln(t),kn(t),Fn(t,r),Ye(t),Jt(t),Wt(t),Ze(t,r),et(t),Kt(t,r);break;case"firefox":if(!Jn||!qt||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=Jn,tt(t,r),rt(t),Un(t,r),qt(t,r),wn(t),$n(t),Bn(t),jn(t),Hn(t),Gn(t),Vn(t),zn(t),qn(t),Ye(t),Wt(t),Ze(t,r),et(t);break;case"safari":if(!ni||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=ni,tt(t,r),rt(t),Zn(t),ti(t),Qn(t),Wn(t),Kn(t),ei(t),Xn(t),ri(t),Ye(t),Jt(t),Ze(t,r),et(t),Kt(t,r);break;default:n("Unsupported browser!");break}return i}const si=$a({window:typeof window>"u"?void 0:window});class Qt{constructor(e){S(this,"peerConnection");S(this,"sessionListener",new xa);S(this,"isCallOut",!1);S(this,"sessionType",v.UNKNOWN);S(this,"localStream");S(this,"remoteStream");S(this,"dataChannel");S(this,"hasSetRemoteSdp",!1);S(this,"facingMode",M.FRONT_FACING);S(this,"facingChanging",!1);S(this,"muted",!1);S(this,"openCamera",!1);S(this,"desktopSharing",!1);this.sessionType=e,console.debug(si.browserDetails.browser+" "+si.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=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(r=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})):(console.debug("webrtc call in: ",n),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:n})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(r=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})}).catch(r=>{this.error(r)}))},this.peerConnection.onicegatheringstatechange=()=>{var r;console.debug("webrtc onicegatheringstatechange",(r=this.peerConnection)==null?void 0:r.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=r=>{console.debug("webrtc ontrack");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.dataChannel=void 0,this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case v.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:case v.VIDEO:case v.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(n=>{this.error(n),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(n=>{this.peerConnection.addIceCandidate(n).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(r=>console.log(r))})}sendStringData(e){try{this.dataChannel&&this.dataChannel.send(e)}catch(n){console.debug("sendStringData failed",n)}}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==v.VIDEO_PUSH||this.sessionType==v.AUDIO_PUSH||this.sessionType==v.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.localStream)for(let n of this.localStream.getTracks())this.localStream.removeTrack(n),n.stop();this.desktopSharing&&(this.desktopSharing=!1,this.sessionListener.onStopDesktopShare()),this.peerConnection=void 0,this.dataChannel=void 0,this.localStream=void 0,this.remoteStream=void 0,this.isCallOut=!1,this.sessionType=v.UNKNOWN,this.hasSetRemoteSdp=!1,this.facingMode=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.openCamera=!1,this.desktopSharing=!1}changeFacing(){return new Promise((e,n)=>{if(this.sessionType!==v.VIDEO&&this.sessionType!==v.VIDEO_PUSH){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}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))})}startDesktopShare(){return new Promise((e,n)=>{if(this.desktopSharing){n(new Error("desktop sharing has opened"));return}if(this.sessionType!=v.VIDEO&&this.sessionType!=v.VIDEO_PUSH){n(new Error("desktop sharing not in video calling"));return}if(!this.localStream){n(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(r=>{let i=this.changeVideoTrack(r,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});i?(this.desktopSharing=!1,n(i)):e()}).catch(r=>{this.desktopSharing=!1,n(r)})):n(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,n){if(!this.localStream||!this.peerConnection){for(let r of e.getTracks())e.removeTrack(r),r.stop();return new Error("localStream undefined or peerConnection undefined")}for(let r of this.localStream.getVideoTracks())this.localStream.removeTrack(r),r.stop();for(let r of e.getTracks())e.removeTrack(r),r.kind=="video"?(this.localStream.addTrack(r),n&&(r.onended=i=>{n()})):r.stop();for(let r of this.peerConnection.getSenders())r.track&&r.track.kind==="video"&&r.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.error(i)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case v.VIDEO:case v.VIDEO_PUSH:case v.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING};break}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){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===v.VIDEO||this.sessionType===v.VIDEO_PUSH||this.sessionType===v.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(n=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:this.peerConnection.addTransceiver(n,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(n,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===v.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=n=>{this.onDataChannelReceive(n.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==v.VIDEO_HALF||this.sessionType==v.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,n)=>{if(!this.localStream){n(new Error("local stream not found"));return}if(this.localStream.getVideoTracks().length==0){n(new Error("local stream not video track"));return}this.facingChanging=!0,this.localStream.getVideoTracks().forEach(o=>{this.localStream.removeTrack(o),o.stop()});let r,i=this.facingMode;if(this.facingMode===M.FRONT_FACING?(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}):(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(r).then(o=>{this.changeCameraSuccess(o,i),e()}).catch(o=>{console.error("change camera failed, use last camera: "+o,o),i=this.facingMode,this.facingMode===M.FRONT_FACING?(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}):(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}),navigator.mediaDevices.getUserMedia(r).then(s=>{this.changeCameraSuccess(s,i),e()}).catch(s=>{this.changeCameraFailed(s),n(s)})});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),n(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e,n){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.log(i)})}),this.facingMode=n,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 ai{constructor(e,n){S(this,"url");S(this,"offerSdp");this.url=e,this.offerSdp=n}}const Ga="/media-server/video-play/webrtc";class Va{constructor(e,n){S(this,"rtspUrl");S(this,"webrtcSession",new Qt(v.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.sdp),this.httpClient.Post(Ga,new ai(this.rtspUrl,e.sdp??"")).then(n=>{var r,i,o,s;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("rtsp answer",(r=n.data)==null?void 0:r.sdp),console.debug("rtsp answer",(i=n.data)==null?void 0:i.candidateList),this.webrtcSession.setRemoteSdp(((o=n.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=n.data)==null?void 0:s.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var E=(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))(E||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),K=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(K||{}),be=(t=>(t.IN="in",t.OUT="out",t))(be||{}),j=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(j||{});let ci;function za(){ci="true"}function qa(){return ci}function li(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Ja(){return"browser-"+Wa()+Ka(6)}function Wa(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Ka(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 Qa{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"callMode");this.tel=e,this.callMode=r,this.mediaType=n}}class ui{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)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class fi{constructor(e,n,r){S(this,"tel","");S(this,"status",E.OFFLINE);S(this,"mediaType",F.AUDIO);S(this,"callMode",K.FULL);S(this,"callDirect",be.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 ui);S(this,"wsUrl");S(this,"accountId");this.tel=n??"",this.wsUrl=e,this.accountId=r,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var n;if(this.status!=E.RING){console.debug("session is not ring state");return}if(this.callDirect!=be.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==K.HALF?e=F.VIDEO==this.mediaType?v.VIDEO_HALF:v.AUDIO_HALF:e=F.VIDEO==this.mediaType?v.VIDEO:v.AUDIO,this.webrtcCreate(e),(n=this.webrtcSession)==null||n.start(!1,this.remoteSdp)}hangup(){this.status<=E.IDLE||(this.status==E.TALK?this.sendHangup(this.callId??""):this.callDirect==be.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==E.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))})}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.status!=E.TALK&&n(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.status==E.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,n=F.AUDIO,r=K.FULL){var i;try{if(!li()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==E.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}this.status>E.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=n,this.callMode=r,this.called=e,this.callDirect=be.OUT,this.callId=Ja();let o;this.callMode==K.HALF?o=F.VIDEO==n?v.VIDEO_HALF:v.AUDIO_HALF:o=F.VIDEO==n?v.VIDEO:v.AUDIO,this.webrtcCreate(o),(i=this.webrtcSession)==null||i.start(!0),this.status=E.TRY}catch(o){this.status=E.IDLE,this.sessionListener.onError(new Error(""+o))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=E.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=E.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 j.Invite:this.inviteHandler(r);break;case j.ANSWER:this.answerHandler(r);break;case j.RING:this.ringHandler(r);break;case j.HANGUP:this.hangupHandler(r);break;case j.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:j.LOGIN,username:this.tel,allowEmpty:this.tel===""?qa():void 0,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:j.LOGOUT,username:this.tel}),this.status=E.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:j.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=E.TRY}sendRing(){this.sendTo({type:j.RING,callId:this.callId,code:180}),this.status=E.RING}sendAnswer(e){this.sendTo({type:j.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=E.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:j.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(n=>console.debug(n))}sendHangup(e,n=800){this.sendTo({type:j.HANGUP,callId:e,code:n}),e==this.callId&&(this.status=E.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=E.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=E.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!li()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>E.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??K.FULL,this.called=e.from??"",this.callDirect=be.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new Qa(this.called,this.mediaType,this.callMode))}ringHandler(e){var n,r;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=E.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=E.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 Qt(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.status>E.IDLE&&this.hangup(),this.close(),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??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class Xa{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const Ya="/media-server/broadcast/webrtc";class Za{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"webrtcSession");S(this,"sessionListener",new Xa);S(this,"httpClient");this.tel=e,this.httpClient=n,this.mediaType=r===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Qt(r==F.VIDEO?v.VIDEO_PUSH:v.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(Ya,new ai(this.tel,e.sdp??"")).then(n=>{var r,i,o;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("answer",(r=n.data)==null?void 0:r.sdp),this.webrtcSession.setRemoteSdp(((i=n.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((o=n.data)==null?void 0:o.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Xt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Xt||{});class ec extends ui{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class tc extends fi{constructor(n,r,i){super(n,r,i);S(this,"sessionListener",new ec)}setCallSessionListener(n){this.sessionListener=n}audioHalfCall(n){this.makeCall(n,F.AUDIO,K.HALF)}videoHalfCall(n){this.makeCall(n,F.VIDEO,K.HALF)}tbcpRequest(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_REQUEST})))}tbcpRelease(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_RELEASE})))}onDataChannelMessage(n){try{this.sessionListener.onTbcpMessage(JSON.parse(n))}catch(r){console.debug("onDataChannelMessage err: ",r,n)}}}let Yt=new vn("/"),pi="/media-server/ws/voip",di="/media-server/ws/b-trun-c",Zt=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+pi),er=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+di);function rc(t){Yt=new vn(t)}function nc(t){return new Va(t,Yt)}function ic(t,e){return new Za(t,Yt,e)}function oc(t){Zt=new URL(t),Zt.pathname=pi,er=new URL(t),er.pathname=di}function sc(t){return new fi(Zt.toString(),t)}function ac(t,e){return new tc(er.toString(),t,e)}A.createAppCallSession=ac,A.createBroadcastSession=ic,A.createCallSession=sc,A.createRtspPullSession=nc,A.setAllowEmpty=za,A.videoModuleInit=rc,A.voipModuleInit=oc,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
43
|
+
`);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 tt(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 rt(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 ja=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Kt,shimAddIceCandidateNullOrEmpty:tt,shimConnectionState:Wt,shimMaxMessageSize:Ze,shimParameterlessSetLocalDescription:rt,shimRTCIceCandidate:Ye,shimRTCIceCandidateRelayProtocol:Jt,shimSendThrowTypeError:et},Symbol.toStringTag,{value:"Module"}));function $a({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Rn,r=Na(t),i={browserDetails:r,commonShim:ja,extractVersion:Xe,disableLog:Ma,disableWarnings:Fa,sdp:Ba};switch(r.browser){case"chrome":if(!Nn||!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=Nn,tt(t,r),rt(t),An(t,r),Dn(t),zt(t,r),_n(t),Mn(t,r),In(t),Ln(t),kn(t),Fn(t,r),Ye(t),Jt(t),Wt(t),Ze(t,r),et(t),Kt(t,r);break;case"firefox":if(!Jn||!qt||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=Jn,tt(t,r),rt(t),Un(t,r),qt(t,r),wn(t),$n(t),Bn(t),jn(t),Hn(t),Gn(t),Vn(t),zn(t),qn(t),Ye(t),Wt(t),Ze(t,r),et(t);break;case"safari":if(!ni||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=ni,tt(t,r),rt(t),Zn(t),ti(t),Qn(t),Wn(t),Kn(t),ei(t),Xn(t),ri(t),Ye(t),Jt(t),Ze(t,r),et(t),Kt(t,r);break;default:n("Unsupported browser!");break}return i}const si=$a({window:typeof window>"u"?void 0:window});class Qt{constructor(e){S(this,"peerConnection");S(this,"sessionListener",new xa);S(this,"isCallOut",!1);S(this,"sessionType",v.UNKNOWN);S(this,"localStream");S(this,"remoteStream");S(this,"dataChannel");S(this,"hasSetRemoteSdp",!1);S(this,"facingMode",M.FRONT_FACING);S(this,"facingChanging",!1);S(this,"muted",!1);S(this,"openCamera",!1);S(this,"desktopSharing",!1);this.sessionType=e,console.debug(si.browserDetails.browser+" "+si.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=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(r=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})):(console.debug("webrtc call in: ",n),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:n})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(r=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})}).catch(r=>{this.error(r)}))},this.peerConnection.onicegatheringstatechange=()=>{var r;console.debug("webrtc onicegatheringstatechange",(r=this.peerConnection)==null?void 0:r.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=r=>{console.debug("webrtc ontrack");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.dataChannel=void 0,this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case v.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:case v.VIDEO:case v.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(n=>{this.error(n),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(n=>{this.peerConnection.addIceCandidate(n).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(r=>console.log(r))})}sendStringData(e){try{this.dataChannel&&this.dataChannel.send(e)}catch(n){console.debug("sendStringData failed",n)}}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==v.VIDEO_PUSH||this.sessionType==v.AUDIO_PUSH||this.sessionType==v.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.localStream)for(let n of this.localStream.getTracks())this.localStream.removeTrack(n),n.stop();this.desktopSharing&&(this.desktopSharing=!1,this.sessionListener.onStopDesktopShare()),this.peerConnection=void 0,this.dataChannel=void 0,this.localStream=void 0,this.remoteStream=void 0,this.isCallOut=!1,this.sessionType=v.UNKNOWN,this.hasSetRemoteSdp=!1,this.facingMode=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.openCamera=!1,this.desktopSharing=!1}changeFacing(){return new Promise((e,n)=>{if(this.sessionType!==v.VIDEO&&this.sessionType!==v.VIDEO_PUSH){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}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))})}startDesktopShare(){return new Promise((e,n)=>{if(this.desktopSharing){n(new Error("desktop sharing has opened"));return}if(this.sessionType!=v.VIDEO&&this.sessionType!=v.VIDEO_PUSH){n(new Error("desktop sharing not in video calling"));return}if(!this.localStream){n(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(r=>{let i=this.changeVideoTrack(r,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});i?(this.desktopSharing=!1,n(i)):e()}).catch(r=>{this.desktopSharing=!1,n(r)})):n(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,n){if(!this.localStream||!this.peerConnection){for(let r of e.getTracks())e.removeTrack(r),r.stop();return new Error("localStream undefined or peerConnection undefined")}for(let r of this.localStream.getVideoTracks())this.localStream.removeTrack(r),r.stop();for(let r of e.getTracks())e.removeTrack(r),r.kind=="video"?(this.localStream.addTrack(r),n&&(r.onended=i=>{n()})):r.stop();for(let r of this.peerConnection.getSenders())r.track&&r.track.kind==="video"&&r.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.error(i)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case v.VIDEO:case v.VIDEO_PUSH:case v.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING};break}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){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===v.VIDEO||this.sessionType===v.VIDEO_PUSH||this.sessionType===v.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(n=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:this.peerConnection.addTransceiver(n,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(n,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===v.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=n=>{this.onDataChannelReceive(n.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==v.VIDEO_HALF||this.sessionType==v.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,n)=>{if(!this.localStream){n(new Error("local stream not found"));return}if(this.localStream.getVideoTracks().length==0){n(new Error("local stream not video track"));return}this.facingChanging=!0,this.localStream.getVideoTracks().forEach(o=>{this.localStream.removeTrack(o),o.stop()});let r,i=this.facingMode;if(this.facingMode===M.FRONT_FACING?(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}):(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(r).then(o=>{this.changeCameraSuccess(o,i),e()}).catch(o=>{console.error("change camera failed, use last camera: "+o,o),i=this.facingMode,this.facingMode===M.FRONT_FACING?(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}):(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}),navigator.mediaDevices.getUserMedia(r).then(s=>{this.changeCameraSuccess(s,i),e()}).catch(s=>{this.changeCameraFailed(s),n(s)})});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),n(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e,n){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.log(i)})}),this.facingMode=n,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 ai{constructor(e,n){S(this,"url");S(this,"offerSdp");this.url=e,this.offerSdp=n}}const Ga="/media-server/video-play/webrtc";class Va{constructor(e,n){S(this,"rtspUrl");S(this,"webrtcSession",new Qt(v.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.sdp),this.httpClient.Post(Ga,new ai(this.rtspUrl,e.sdp??"")).then(n=>{var r,i,o,s;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("rtsp answer",(r=n.data)==null?void 0:r.sdp),console.debug("rtsp answer",(i=n.data)==null?void 0:i.candidateList),this.webrtcSession.setRemoteSdp(((o=n.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=n.data)==null?void 0:s.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var E=(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))(E||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),K=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(K||{}),be=(t=>(t.IN="in",t.OUT="out",t))(be||{}),j=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(j||{});let ci;function za(){ci="true"}function qa(){return ci}function Ja(){let t=!1;try{const e=RTCRtpSender.getCapabilities("video");e&&e.codecs.some(n=>n.mimeType.toLowerCase()==="video/h264")&&(t=!0)}catch(e){console.error("Error checking H.264 support:",e)}return t}function li(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Wa(){return"browser-"+Ka()+Qa(6)}function Ka(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Qa(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 Xa{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"callMode");this.tel=e,this.callMode=r,this.mediaType=n}}class ui{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)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class fi{constructor(e,n,r){S(this,"tel","");S(this,"status",E.OFFLINE);S(this,"mediaType",F.AUDIO);S(this,"callMode",K.FULL);S(this,"callDirect",be.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 ui);S(this,"wsUrl");S(this,"accountId");this.tel=n??"",this.wsUrl=e,this.accountId=r,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var n;if(this.status!=E.RING){console.debug("session is not ring state");return}if(this.callDirect!=be.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==K.HALF?e=F.VIDEO==this.mediaType?v.VIDEO_HALF:v.AUDIO_HALF:e=F.VIDEO==this.mediaType?v.VIDEO:v.AUDIO,this.webrtcCreate(e),(n=this.webrtcSession)==null||n.start(!1,this.remoteSdp)}hangup(){this.status<=E.IDLE||(this.status==E.TALK?this.sendHangup(this.callId??""):this.callDirect==be.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==E.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))})}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.status!=E.TALK&&n(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.status==E.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,n=F.AUDIO,r=K.FULL){var i;try{if(!li()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==E.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}this.status>E.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=n,this.callMode=r,this.called=e,this.callDirect=be.OUT,this.callId=Wa();let o;this.callMode==K.HALF?o=F.VIDEO==n?v.VIDEO_HALF:v.AUDIO_HALF:o=F.VIDEO==n?v.VIDEO:v.AUDIO,this.webrtcCreate(o),(i=this.webrtcSession)==null||i.start(!0),this.status=E.TRY}catch(o){this.status=E.IDLE,this.sessionListener.onError(new Error(""+o))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=E.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=E.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 j.Invite:this.inviteHandler(r);break;case j.ANSWER:this.answerHandler(r);break;case j.RING:this.ringHandler(r);break;case j.HANGUP:this.hangupHandler(r);break;case j.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:j.LOGIN,username:this.tel,allowEmpty:this.tel===""?qa():void 0,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:j.LOGOUT,username:this.tel}),this.status=E.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:j.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=E.TRY}sendRing(){this.sendTo({type:j.RING,callId:this.callId,code:180}),this.status=E.RING}sendAnswer(e){this.sendTo({type:j.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=E.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:j.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(n=>console.debug(n))}sendHangup(e,n=800){this.sendTo({type:j.HANGUP,callId:e,code:n}),e==this.callId&&(this.status=E.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=E.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=E.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!li()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>E.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??K.FULL,this.called=e.from??"",this.callDirect=be.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new Xa(this.called,this.mediaType,this.callMode))}ringHandler(e){var n,r;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=E.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=E.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return Ja()?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Qt(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.status>E.IDLE&&this.hangup(),this.close(),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??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class Ya{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const Za="/media-server/broadcast/webrtc";class ec{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"webrtcSession");S(this,"sessionListener",new Ya);S(this,"httpClient");this.tel=e,this.httpClient=n,this.mediaType=r===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Qt(r==F.VIDEO?v.VIDEO_PUSH:v.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(Za,new ai(this.tel,e.sdp??"")).then(n=>{var r,i,o;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("answer",(r=n.data)==null?void 0:r.sdp),this.webrtcSession.setRemoteSdp(((i=n.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((o=n.data)==null?void 0:o.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Xt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Xt||{});class tc extends ui{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class rc extends fi{constructor(n,r,i){super(n,r,i);S(this,"sessionListener",new tc)}setCallSessionListener(n){this.sessionListener=n}audioHalfCall(n){this.makeCall(n,F.AUDIO,K.HALF)}videoHalfCall(n){this.makeCall(n,F.VIDEO,K.HALF)}tbcpRequest(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_REQUEST})))}tbcpRelease(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_RELEASE})))}onDataChannelMessage(n){try{this.sessionListener.onTbcpMessage(JSON.parse(n))}catch(r){console.debug("onDataChannelMessage err: ",r,n)}}}let Yt=new vn("/"),pi="/media-server/ws/voip",di="/media-server/ws/b-trun-c",Zt=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+pi),er=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+di);function nc(t){Yt=new vn(t)}function ic(t){return new Va(t,Yt)}function oc(t,e){return new ec(t,Yt,e)}function sc(t){Zt=new URL(t),Zt.pathname=pi,er=new URL(t),er.pathname=di}function ac(t){return new fi(Zt.toString(),t)}function cc(t,e){return new rc(er.toString(),t,e)}A.createAppCallSession=cc,A.createBroadcastSession=oc,A.createCallSession=ac,A.createRtspPullSession=ic,A.setAllowEmpty=za,A.videoModuleInit=nc,A.voipModuleInit=sc,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|