inl-ui 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.cjs +1319 -94
- package/dist/components/index.js +1336 -111
- package/dist/hooks/index.cjs +1317 -92
- package/dist/hooks/index.js +1317 -92
- package/dist/index.cjs +1323 -98
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1340 -115
- package/dist/tplib/index.cjs +1317 -92
- package/dist/tplib/index.js +1317 -92
- package/dist/video/index.cjs +1319 -94
- package/dist/video/index.js +1332 -107
- package/dist/videoMobile/index.cjs +1319 -94
- package/dist/videoMobile/index.js +1320 -95
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ var vue = require('vue');
|
|
|
6
6
|
var iconsVue = require('@ant-design/icons-vue');
|
|
7
7
|
var vueRouter = require('vue-router');
|
|
8
8
|
var core = require('@vueuse/core');
|
|
9
|
-
var axios = require('axios');
|
|
9
|
+
var axios$2 = require('axios');
|
|
10
10
|
var antDesignVue = require('ant-design-vue');
|
|
11
11
|
var _ = require('lodash');
|
|
12
12
|
var dayjs = require('dayjs');
|
|
@@ -18,7 +18,7 @@ var mobile = require('@sszj-temp/mobile');
|
|
|
18
18
|
|
|
19
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
20
|
|
|
21
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
21
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios$2);
|
|
22
22
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
23
23
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
24
24
|
var EZUIKit__default = /*#__PURE__*/_interopDefaultLegacy(EZUIKit);
|
|
@@ -579,6 +579,10 @@ const Events$1 = {
|
|
|
579
579
|
WEBRTC_ON_REMOTE_STREAMS: "WEBRTC_ON_REMOTE_STREAMS",
|
|
580
580
|
WEBRTC_ON_LOCAL_STREAM: "WEBRTC_ON_LOCAL_STREAM",
|
|
581
581
|
WEBRTC_ON_CONNECTION_STATE_CHANGE: "WEBRTC_ON_CONNECTION_STATE_CHANGE",
|
|
582
|
+
WEBRTC_ON_DATA_CHANNEL_OPEN: "WEBRTC_ON_DATA_CHANNEL_OPEN",
|
|
583
|
+
WEBRTC_ON_DATA_CHANNEL_CLOSE: "WEBRTC_ON_DATA_CHANNEL_CLOSE",
|
|
584
|
+
WEBRTC_ON_DATA_CHANNEL_ERR: "WEBRTC_ON_DATA_CHANNEL_ERR",
|
|
585
|
+
WEBRTC_ON_DATA_CHANNEL_MSG: "WEBRTC_ON_DATA_CHANNEL_MSG",
|
|
582
586
|
CAPTURE_STREAM_FAILED: "CAPTURE_STREAM_FAILED"
|
|
583
587
|
};
|
|
584
588
|
function isFirefox() {
|
|
@@ -727,16 +731,16 @@ function detectBrowser(window2) {
|
|
|
727
731
|
}
|
|
728
732
|
return result;
|
|
729
733
|
}
|
|
730
|
-
function isObject(val) {
|
|
734
|
+
function isObject$1(val) {
|
|
731
735
|
return Object.prototype.toString.call(val) === "[object Object]";
|
|
732
736
|
}
|
|
733
|
-
function compactObject(
|
|
734
|
-
if (!isObject(
|
|
735
|
-
return
|
|
737
|
+
function compactObject(data2) {
|
|
738
|
+
if (!isObject$1(data2)) {
|
|
739
|
+
return data2;
|
|
736
740
|
}
|
|
737
|
-
return Object.keys(
|
|
738
|
-
const isObj = isObject(
|
|
739
|
-
const value = isObj ? compactObject(
|
|
741
|
+
return Object.keys(data2).reduce(function (accumulator, key) {
|
|
742
|
+
const isObj = isObject$1(data2[key]);
|
|
743
|
+
const value = isObj ? compactObject(data2[key]) : data2[key];
|
|
740
744
|
const isEmptyObject = isObj && !Object.keys(value).length;
|
|
741
745
|
if (value === void 0 || isEmptyObject) {
|
|
742
746
|
return accumulator;
|
|
@@ -1540,8 +1544,8 @@ function filterIceServers$1(iceServers, edgeVersion) {
|
|
|
1540
1544
|
if (server && (server.urls || server.url)) {
|
|
1541
1545
|
let urls = server.urls || server.url;
|
|
1542
1546
|
if (server.url && !server.urls) ;
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1547
|
+
const isString2 = typeof urls === "string";
|
|
1548
|
+
if (isString2) {
|
|
1545
1549
|
urls = [urls];
|
|
1546
1550
|
}
|
|
1547
1551
|
urls = urls.filter(url => {
|
|
@@ -1556,7 +1560,7 @@ function filterIceServers$1(iceServers, edgeVersion) {
|
|
|
1556
1560
|
return validTurn && !hasTurn;
|
|
1557
1561
|
});
|
|
1558
1562
|
delete server.url;
|
|
1559
|
-
server.urls =
|
|
1563
|
+
server.urls = isString2 ? urls[0] : urls;
|
|
1560
1564
|
return !!urls.length;
|
|
1561
1565
|
}
|
|
1562
1566
|
});
|
|
@@ -2212,8 +2216,8 @@ function filterIceServers(iceServers, edgeVersion) {
|
|
|
2212
2216
|
if (server && (server.urls || server.url)) {
|
|
2213
2217
|
var urls = server.urls || server.url;
|
|
2214
2218
|
if (server.url && !server.urls) ;
|
|
2215
|
-
var
|
|
2216
|
-
if (
|
|
2219
|
+
var isString2 = typeof urls === "string";
|
|
2220
|
+
if (isString2) {
|
|
2217
2221
|
urls = [urls];
|
|
2218
2222
|
}
|
|
2219
2223
|
urls = urls.filter(function (url) {
|
|
@@ -2225,7 +2229,7 @@ function filterIceServers(iceServers, edgeVersion) {
|
|
|
2225
2229
|
return url.indexOf("stun:") === 0 && edgeVersion >= 14393 && url.indexOf("?transport=udp") === -1;
|
|
2226
2230
|
});
|
|
2227
2231
|
delete server.url;
|
|
2228
|
-
server.urls =
|
|
2232
|
+
server.urls = isString2 ? urls[0] : urls;
|
|
2229
2233
|
return !!urls.length;
|
|
2230
2234
|
}
|
|
2231
2235
|
});
|
|
@@ -4077,13 +4081,13 @@ function shimCallbacksAPI(window2) {
|
|
|
4077
4081
|
if (typeof window2 !== "object" || !window2.RTCPeerConnection) {
|
|
4078
4082
|
return;
|
|
4079
4083
|
}
|
|
4080
|
-
const
|
|
4081
|
-
const origCreateOffer =
|
|
4082
|
-
const origCreateAnswer =
|
|
4083
|
-
const setLocalDescription =
|
|
4084
|
-
const setRemoteDescription =
|
|
4085
|
-
const addIceCandidate =
|
|
4086
|
-
|
|
4084
|
+
const prototype2 = window2.RTCPeerConnection.prototype;
|
|
4085
|
+
const origCreateOffer = prototype2.createOffer;
|
|
4086
|
+
const origCreateAnswer = prototype2.createAnswer;
|
|
4087
|
+
const setLocalDescription = prototype2.setLocalDescription;
|
|
4088
|
+
const setRemoteDescription = prototype2.setRemoteDescription;
|
|
4089
|
+
const addIceCandidate = prototype2.addIceCandidate;
|
|
4090
|
+
prototype2.createOffer = function createOffer(successCallback, failureCallback) {
|
|
4087
4091
|
const options = arguments.length >= 2 ? arguments[2] : arguments[0];
|
|
4088
4092
|
const promise = origCreateOffer.apply(this, [options]);
|
|
4089
4093
|
if (!failureCallback) {
|
|
@@ -4092,7 +4096,7 @@ function shimCallbacksAPI(window2) {
|
|
|
4092
4096
|
promise.then(successCallback, failureCallback);
|
|
4093
4097
|
return Promise.resolve();
|
|
4094
4098
|
};
|
|
4095
|
-
|
|
4099
|
+
prototype2.createAnswer = function createAnswer(successCallback, failureCallback) {
|
|
4096
4100
|
const options = arguments.length >= 2 ? arguments[2] : arguments[0];
|
|
4097
4101
|
const promise = origCreateAnswer.apply(this, [options]);
|
|
4098
4102
|
if (!failureCallback) {
|
|
@@ -4109,7 +4113,7 @@ function shimCallbacksAPI(window2) {
|
|
|
4109
4113
|
promise.then(successCallback, failureCallback);
|
|
4110
4114
|
return Promise.resolve();
|
|
4111
4115
|
};
|
|
4112
|
-
|
|
4116
|
+
prototype2.setLocalDescription = withCallback;
|
|
4113
4117
|
withCallback = function (description, successCallback, failureCallback) {
|
|
4114
4118
|
const promise = setRemoteDescription.apply(this, [description]);
|
|
4115
4119
|
if (!failureCallback) {
|
|
@@ -4118,7 +4122,7 @@ function shimCallbacksAPI(window2) {
|
|
|
4118
4122
|
promise.then(successCallback, failureCallback);
|
|
4119
4123
|
return Promise.resolve();
|
|
4120
4124
|
};
|
|
4121
|
-
|
|
4125
|
+
prototype2.setRemoteDescription = withCallback;
|
|
4122
4126
|
withCallback = function (candidate, successCallback, failureCallback) {
|
|
4123
4127
|
const promise = addIceCandidate.apply(this, [candidate]);
|
|
4124
4128
|
if (!failureCallback) {
|
|
@@ -4127,7 +4131,7 @@ function shimCallbacksAPI(window2) {
|
|
|
4127
4131
|
promise.then(successCallback, failureCallback);
|
|
4128
4132
|
return Promise.resolve();
|
|
4129
4133
|
};
|
|
4130
|
-
|
|
4134
|
+
prototype2.addIceCandidate = withCallback;
|
|
4131
4135
|
}
|
|
4132
4136
|
function shimGetUserMedia(window2) {
|
|
4133
4137
|
const navigator2 = window2 && window2.navigator;
|
|
@@ -4277,7 +4281,7 @@ function shimRTCIceCandidate(window2) {
|
|
|
4277
4281
|
const nativeCandidate = new NativeRTCIceCandidate(args);
|
|
4278
4282
|
const parsedCandidate = sdp.parseCandidate(args.candidate);
|
|
4279
4283
|
const augmentedCandidate = Object.assign(nativeCandidate, parsedCandidate);
|
|
4280
|
-
augmentedCandidate.toJSON = function
|
|
4284
|
+
augmentedCandidate.toJSON = function toJSON2() {
|
|
4281
4285
|
return {
|
|
4282
4286
|
candidate: augmentedCandidate.candidate,
|
|
4283
4287
|
sdpMid: augmentedCandidate.sdpMid,
|
|
@@ -4407,8 +4411,8 @@ function shimSendThrowTypeError(window2) {
|
|
|
4407
4411
|
function wrapDcSend(dc, pc) {
|
|
4408
4412
|
const origDataChannelSend = dc.send;
|
|
4409
4413
|
dc.send = function send() {
|
|
4410
|
-
const
|
|
4411
|
-
const length =
|
|
4414
|
+
const data2 = arguments[0];
|
|
4415
|
+
const length = data2.length || data2.size || data2.byteLength;
|
|
4412
4416
|
if (dc.readyState === "open" && pc.sctp && length > pc.sctp.maxMessageSize) {
|
|
4413
4417
|
throw new TypeError("Message too large (can send a maximum of " + pc.sctp.maxMessageSize + " bytes)");
|
|
4414
4418
|
}
|
|
@@ -4636,21 +4640,21 @@ adapterFactory({
|
|
|
4636
4640
|
});
|
|
4637
4641
|
class AudioTrackConstraints {
|
|
4638
4642
|
// eslint-disable-next-line require-jsdoc
|
|
4639
|
-
constructor(
|
|
4640
|
-
if (!Object.values(AudioSourceInfo).some(v => v ===
|
|
4643
|
+
constructor(source2) {
|
|
4644
|
+
if (!Object.values(AudioSourceInfo).some(v => v === source2)) {
|
|
4641
4645
|
throw new TypeError("Invalid source.");
|
|
4642
4646
|
}
|
|
4643
|
-
this.source =
|
|
4647
|
+
this.source = source2;
|
|
4644
4648
|
this.deviceId = void 0;
|
|
4645
4649
|
}
|
|
4646
4650
|
}
|
|
4647
4651
|
class VideoTrackConstraints {
|
|
4648
4652
|
// eslint-disable-next-line require-jsdoc
|
|
4649
|
-
constructor(
|
|
4650
|
-
if (!Object.values(VideoSourceInfo).some(v => v ===
|
|
4653
|
+
constructor(source2) {
|
|
4654
|
+
if (!Object.values(VideoSourceInfo).some(v => v === source2)) {
|
|
4651
4655
|
throw new TypeError("Invalid source.");
|
|
4652
4656
|
}
|
|
4653
|
-
this.source =
|
|
4657
|
+
this.source = source2;
|
|
4654
4658
|
this.deviceId = void 0;
|
|
4655
4659
|
this.resolution = void 0;
|
|
4656
4660
|
this.frameRate = void 0;
|
|
@@ -4788,21 +4792,1175 @@ class Event$1 {
|
|
|
4788
4792
|
offAll() {
|
|
4789
4793
|
this.listener = {};
|
|
4790
4794
|
}
|
|
4791
|
-
dispatch(event,
|
|
4795
|
+
dispatch(event, data2) {
|
|
4792
4796
|
if (this.listener[event]) {
|
|
4793
4797
|
this.listener[event].map(each => {
|
|
4794
|
-
each.apply(null, [
|
|
4798
|
+
each.apply(null, [data2]);
|
|
4795
4799
|
});
|
|
4796
4800
|
return true;
|
|
4797
4801
|
}
|
|
4798
4802
|
return false;
|
|
4799
4803
|
}
|
|
4800
4804
|
}
|
|
4805
|
+
var bind = function bind2(fn, thisArg) {
|
|
4806
|
+
return function wrap() {
|
|
4807
|
+
var args = new Array(arguments.length);
|
|
4808
|
+
for (var i = 0; i < args.length; i++) {
|
|
4809
|
+
args[i] = arguments[i];
|
|
4810
|
+
}
|
|
4811
|
+
return fn.apply(thisArg, args);
|
|
4812
|
+
};
|
|
4813
|
+
};
|
|
4814
|
+
var toString = Object.prototype.toString;
|
|
4815
|
+
var kindOf = function (cache) {
|
|
4816
|
+
return function (thing) {
|
|
4817
|
+
var str = toString.call(thing);
|
|
4818
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
4819
|
+
};
|
|
4820
|
+
}( /* @__PURE__ */Object.create(null));
|
|
4821
|
+
function kindOfTest(type) {
|
|
4822
|
+
type = type.toLowerCase();
|
|
4823
|
+
return function isKindOf(thing) {
|
|
4824
|
+
return kindOf(thing) === type;
|
|
4825
|
+
};
|
|
4826
|
+
}
|
|
4827
|
+
function isArray(val) {
|
|
4828
|
+
return Array.isArray(val);
|
|
4829
|
+
}
|
|
4830
|
+
function isUndefined(val) {
|
|
4831
|
+
return typeof val === "undefined";
|
|
4832
|
+
}
|
|
4833
|
+
function isBuffer(val) {
|
|
4834
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
4835
|
+
}
|
|
4836
|
+
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
4837
|
+
function isArrayBufferView(val) {
|
|
4838
|
+
var result;
|
|
4839
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
4840
|
+
result = ArrayBuffer.isView(val);
|
|
4841
|
+
} else {
|
|
4842
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
4843
|
+
}
|
|
4844
|
+
return result;
|
|
4845
|
+
}
|
|
4846
|
+
function isString(val) {
|
|
4847
|
+
return typeof val === "string";
|
|
4848
|
+
}
|
|
4849
|
+
function isNumber(val) {
|
|
4850
|
+
return typeof val === "number";
|
|
4851
|
+
}
|
|
4852
|
+
function isObject(val) {
|
|
4853
|
+
return val !== null && typeof val === "object";
|
|
4854
|
+
}
|
|
4855
|
+
function isPlainObject(val) {
|
|
4856
|
+
if (kindOf(val) !== "object") {
|
|
4857
|
+
return false;
|
|
4858
|
+
}
|
|
4859
|
+
var prototype2 = Object.getPrototypeOf(val);
|
|
4860
|
+
return prototype2 === null || prototype2 === Object.prototype;
|
|
4861
|
+
}
|
|
4862
|
+
var isDate = kindOfTest("Date");
|
|
4863
|
+
var isFile = kindOfTest("File");
|
|
4864
|
+
var isBlob = kindOfTest("Blob");
|
|
4865
|
+
var isFileList = kindOfTest("FileList");
|
|
4866
|
+
function isFunction(val) {
|
|
4867
|
+
return toString.call(val) === "[object Function]";
|
|
4868
|
+
}
|
|
4869
|
+
function isStream(val) {
|
|
4870
|
+
return isObject(val) && isFunction(val.pipe);
|
|
4871
|
+
}
|
|
4872
|
+
function isFormData(thing) {
|
|
4873
|
+
var pattern = "[object FormData]";
|
|
4874
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
|
|
4875
|
+
}
|
|
4876
|
+
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
4877
|
+
function trim(str) {
|
|
4878
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
4879
|
+
}
|
|
4880
|
+
function isStandardBrowserEnv() {
|
|
4881
|
+
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
4882
|
+
return false;
|
|
4883
|
+
}
|
|
4884
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
4885
|
+
}
|
|
4886
|
+
function forEach(obj, fn) {
|
|
4887
|
+
if (obj === null || typeof obj === "undefined") {
|
|
4888
|
+
return;
|
|
4889
|
+
}
|
|
4890
|
+
if (typeof obj !== "object") {
|
|
4891
|
+
obj = [obj];
|
|
4892
|
+
}
|
|
4893
|
+
if (isArray(obj)) {
|
|
4894
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
4895
|
+
fn.call(null, obj[i], i, obj);
|
|
4896
|
+
}
|
|
4897
|
+
} else {
|
|
4898
|
+
for (var key in obj) {
|
|
4899
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
4900
|
+
fn.call(null, obj[key], key, obj);
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
}
|
|
4905
|
+
function merge() {
|
|
4906
|
+
var result = {};
|
|
4907
|
+
function assignValue(val, key) {
|
|
4908
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
4909
|
+
result[key] = merge(result[key], val);
|
|
4910
|
+
} else if (isPlainObject(val)) {
|
|
4911
|
+
result[key] = merge({}, val);
|
|
4912
|
+
} else if (isArray(val)) {
|
|
4913
|
+
result[key] = val.slice();
|
|
4914
|
+
} else {
|
|
4915
|
+
result[key] = val;
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
4919
|
+
forEach(arguments[i], assignValue);
|
|
4920
|
+
}
|
|
4921
|
+
return result;
|
|
4922
|
+
}
|
|
4923
|
+
function extend(a, b, thisArg) {
|
|
4924
|
+
forEach(b, function assignValue(val, key) {
|
|
4925
|
+
if (thisArg && typeof val === "function") {
|
|
4926
|
+
a[key] = bind(val, thisArg);
|
|
4927
|
+
} else {
|
|
4928
|
+
a[key] = val;
|
|
4929
|
+
}
|
|
4930
|
+
});
|
|
4931
|
+
return a;
|
|
4932
|
+
}
|
|
4933
|
+
function stripBOM(content) {
|
|
4934
|
+
if (content.charCodeAt(0) === 65279) {
|
|
4935
|
+
content = content.slice(1);
|
|
4936
|
+
}
|
|
4937
|
+
return content;
|
|
4938
|
+
}
|
|
4939
|
+
function inherits(constructor, superConstructor, props, descriptors2) {
|
|
4940
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
4941
|
+
constructor.prototype.constructor = constructor;
|
|
4942
|
+
props && Object.assign(constructor.prototype, props);
|
|
4943
|
+
}
|
|
4944
|
+
function toFlatObject(sourceObj, destObj, filter) {
|
|
4945
|
+
var props;
|
|
4946
|
+
var i;
|
|
4947
|
+
var prop;
|
|
4948
|
+
var merged = {};
|
|
4949
|
+
destObj = destObj || {};
|
|
4950
|
+
do {
|
|
4951
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
4952
|
+
i = props.length;
|
|
4953
|
+
while (i-- > 0) {
|
|
4954
|
+
prop = props[i];
|
|
4955
|
+
if (!merged[prop]) {
|
|
4956
|
+
destObj[prop] = sourceObj[prop];
|
|
4957
|
+
merged[prop] = true;
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
4961
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
4962
|
+
return destObj;
|
|
4963
|
+
}
|
|
4964
|
+
function endsWith(str, searchString, position) {
|
|
4965
|
+
str = String(str);
|
|
4966
|
+
if (position === void 0 || position > str.length) {
|
|
4967
|
+
position = str.length;
|
|
4968
|
+
}
|
|
4969
|
+
position -= searchString.length;
|
|
4970
|
+
var lastIndex = str.indexOf(searchString, position);
|
|
4971
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
4972
|
+
}
|
|
4973
|
+
function toArray(thing) {
|
|
4974
|
+
if (!thing) return null;
|
|
4975
|
+
var i = thing.length;
|
|
4976
|
+
if (isUndefined(i)) return null;
|
|
4977
|
+
var arr = new Array(i);
|
|
4978
|
+
while (i-- > 0) {
|
|
4979
|
+
arr[i] = thing[i];
|
|
4980
|
+
}
|
|
4981
|
+
return arr;
|
|
4982
|
+
}
|
|
4983
|
+
var isTypedArray = function (TypedArray) {
|
|
4984
|
+
return function (thing) {
|
|
4985
|
+
return TypedArray && thing instanceof TypedArray;
|
|
4986
|
+
};
|
|
4987
|
+
}(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
|
|
4988
|
+
var utils = {
|
|
4989
|
+
isArray,
|
|
4990
|
+
isArrayBuffer,
|
|
4991
|
+
isBuffer,
|
|
4992
|
+
isFormData,
|
|
4993
|
+
isArrayBufferView,
|
|
4994
|
+
isString,
|
|
4995
|
+
isNumber,
|
|
4996
|
+
isObject,
|
|
4997
|
+
isPlainObject,
|
|
4998
|
+
isUndefined,
|
|
4999
|
+
isDate,
|
|
5000
|
+
isFile,
|
|
5001
|
+
isBlob,
|
|
5002
|
+
isFunction,
|
|
5003
|
+
isStream,
|
|
5004
|
+
isURLSearchParams,
|
|
5005
|
+
isStandardBrowserEnv,
|
|
5006
|
+
forEach,
|
|
5007
|
+
merge,
|
|
5008
|
+
extend,
|
|
5009
|
+
trim,
|
|
5010
|
+
stripBOM,
|
|
5011
|
+
inherits,
|
|
5012
|
+
toFlatObject,
|
|
5013
|
+
kindOf,
|
|
5014
|
+
kindOfTest,
|
|
5015
|
+
endsWith,
|
|
5016
|
+
toArray,
|
|
5017
|
+
isTypedArray,
|
|
5018
|
+
isFileList
|
|
5019
|
+
};
|
|
5020
|
+
function encode(val) {
|
|
5021
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
5022
|
+
}
|
|
5023
|
+
var buildURL = function buildURL2(url, params, paramsSerializer) {
|
|
5024
|
+
if (!params) {
|
|
5025
|
+
return url;
|
|
5026
|
+
}
|
|
5027
|
+
var serializedParams;
|
|
5028
|
+
if (paramsSerializer) {
|
|
5029
|
+
serializedParams = paramsSerializer(params);
|
|
5030
|
+
} else if (utils.isURLSearchParams(params)) {
|
|
5031
|
+
serializedParams = params.toString();
|
|
5032
|
+
} else {
|
|
5033
|
+
var parts = [];
|
|
5034
|
+
utils.forEach(params, function serialize(val, key) {
|
|
5035
|
+
if (val === null || typeof val === "undefined") {
|
|
5036
|
+
return;
|
|
5037
|
+
}
|
|
5038
|
+
if (utils.isArray(val)) {
|
|
5039
|
+
key = key + "[]";
|
|
5040
|
+
} else {
|
|
5041
|
+
val = [val];
|
|
5042
|
+
}
|
|
5043
|
+
utils.forEach(val, function parseValue(v) {
|
|
5044
|
+
if (utils.isDate(v)) {
|
|
5045
|
+
v = v.toISOString();
|
|
5046
|
+
} else if (utils.isObject(v)) {
|
|
5047
|
+
v = JSON.stringify(v);
|
|
5048
|
+
}
|
|
5049
|
+
parts.push(encode(key) + "=" + encode(v));
|
|
5050
|
+
});
|
|
5051
|
+
});
|
|
5052
|
+
serializedParams = parts.join("&");
|
|
5053
|
+
}
|
|
5054
|
+
if (serializedParams) {
|
|
5055
|
+
var hashmarkIndex = url.indexOf("#");
|
|
5056
|
+
if (hashmarkIndex !== -1) {
|
|
5057
|
+
url = url.slice(0, hashmarkIndex);
|
|
5058
|
+
}
|
|
5059
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
5060
|
+
}
|
|
5061
|
+
return url;
|
|
5062
|
+
};
|
|
5063
|
+
function InterceptorManager() {
|
|
5064
|
+
this.handlers = [];
|
|
5065
|
+
}
|
|
5066
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
5067
|
+
this.handlers.push({
|
|
5068
|
+
fulfilled,
|
|
5069
|
+
rejected,
|
|
5070
|
+
synchronous: options ? options.synchronous : false,
|
|
5071
|
+
runWhen: options ? options.runWhen : null
|
|
5072
|
+
});
|
|
5073
|
+
return this.handlers.length - 1;
|
|
5074
|
+
};
|
|
5075
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
|
5076
|
+
if (this.handlers[id]) {
|
|
5077
|
+
this.handlers[id] = null;
|
|
5078
|
+
}
|
|
5079
|
+
};
|
|
5080
|
+
InterceptorManager.prototype.forEach = function forEach2(fn) {
|
|
5081
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
5082
|
+
if (h !== null) {
|
|
5083
|
+
fn(h);
|
|
5084
|
+
}
|
|
5085
|
+
});
|
|
5086
|
+
};
|
|
5087
|
+
var InterceptorManager_1 = InterceptorManager;
|
|
5088
|
+
var normalizeHeaderName = function normalizeHeaderName2(headers, normalizedName) {
|
|
5089
|
+
utils.forEach(headers, function processHeader(value, name) {
|
|
5090
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
5091
|
+
headers[normalizedName] = value;
|
|
5092
|
+
delete headers[name];
|
|
5093
|
+
}
|
|
5094
|
+
});
|
|
5095
|
+
};
|
|
5096
|
+
function AxiosError(message, code, config, request2, response) {
|
|
5097
|
+
Error.call(this);
|
|
5098
|
+
this.message = message;
|
|
5099
|
+
this.name = "AxiosError";
|
|
5100
|
+
code && (this.code = code);
|
|
5101
|
+
config && (this.config = config);
|
|
5102
|
+
request2 && (this.request = request2);
|
|
5103
|
+
response && (this.response = response);
|
|
5104
|
+
}
|
|
5105
|
+
utils.inherits(AxiosError, Error, {
|
|
5106
|
+
toJSON: function toJSON() {
|
|
5107
|
+
return {
|
|
5108
|
+
// Standard
|
|
5109
|
+
message: this.message,
|
|
5110
|
+
name: this.name,
|
|
5111
|
+
// Microsoft
|
|
5112
|
+
description: this.description,
|
|
5113
|
+
number: this.number,
|
|
5114
|
+
// Mozilla
|
|
5115
|
+
fileName: this.fileName,
|
|
5116
|
+
lineNumber: this.lineNumber,
|
|
5117
|
+
columnNumber: this.columnNumber,
|
|
5118
|
+
stack: this.stack,
|
|
5119
|
+
// Axios
|
|
5120
|
+
config: this.config,
|
|
5121
|
+
code: this.code,
|
|
5122
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
5123
|
+
};
|
|
5124
|
+
}
|
|
5125
|
+
});
|
|
5126
|
+
var prototype = AxiosError.prototype;
|
|
5127
|
+
var descriptors = {};
|
|
5128
|
+
["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"
|
|
5129
|
+
// eslint-disable-next-line func-names
|
|
5130
|
+
].forEach(function (code) {
|
|
5131
|
+
descriptors[code] = {
|
|
5132
|
+
value: code
|
|
5133
|
+
};
|
|
5134
|
+
});
|
|
5135
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
5136
|
+
Object.defineProperty(prototype, "isAxiosError", {
|
|
5137
|
+
value: true
|
|
5138
|
+
});
|
|
5139
|
+
AxiosError.from = function (error2, code, config, request2, response, customProps) {
|
|
5140
|
+
var axiosError = Object.create(prototype);
|
|
5141
|
+
utils.toFlatObject(error2, axiosError, function filter(obj) {
|
|
5142
|
+
return obj !== Error.prototype;
|
|
5143
|
+
});
|
|
5144
|
+
AxiosError.call(axiosError, error2.message, code, config, request2, response);
|
|
5145
|
+
axiosError.name = error2.name;
|
|
5146
|
+
customProps && Object.assign(axiosError, customProps);
|
|
5147
|
+
return axiosError;
|
|
5148
|
+
};
|
|
5149
|
+
var AxiosError_1 = AxiosError;
|
|
5150
|
+
var transitional = {
|
|
5151
|
+
silentJSONParsing: true,
|
|
5152
|
+
forcedJSONParsing: true,
|
|
5153
|
+
clarifyTimeoutError: false
|
|
5154
|
+
};
|
|
5155
|
+
function toFormData(obj, formData) {
|
|
5156
|
+
formData = formData || new FormData();
|
|
5157
|
+
var stack = [];
|
|
5158
|
+
function convertValue(value) {
|
|
5159
|
+
if (value === null) return "";
|
|
5160
|
+
if (utils.isDate(value)) {
|
|
5161
|
+
return value.toISOString();
|
|
5162
|
+
}
|
|
5163
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
5164
|
+
return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
5165
|
+
}
|
|
5166
|
+
return value;
|
|
5167
|
+
}
|
|
5168
|
+
function build(data2, parentKey) {
|
|
5169
|
+
if (utils.isPlainObject(data2) || utils.isArray(data2)) {
|
|
5170
|
+
if (stack.indexOf(data2) !== -1) {
|
|
5171
|
+
throw Error("Circular reference detected in " + parentKey);
|
|
5172
|
+
}
|
|
5173
|
+
stack.push(data2);
|
|
5174
|
+
utils.forEach(data2, function each(value, key) {
|
|
5175
|
+
if (utils.isUndefined(value)) return;
|
|
5176
|
+
var fullKey = parentKey ? parentKey + "." + key : key;
|
|
5177
|
+
var arr;
|
|
5178
|
+
if (value && !parentKey && typeof value === "object") {
|
|
5179
|
+
if (utils.endsWith(key, "{}")) {
|
|
5180
|
+
value = JSON.stringify(value);
|
|
5181
|
+
} else if (utils.endsWith(key, "[]") && (arr = utils.toArray(value))) {
|
|
5182
|
+
arr.forEach(function (el) {
|
|
5183
|
+
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
5184
|
+
});
|
|
5185
|
+
return;
|
|
5186
|
+
}
|
|
5187
|
+
}
|
|
5188
|
+
build(value, fullKey);
|
|
5189
|
+
});
|
|
5190
|
+
stack.pop();
|
|
5191
|
+
} else {
|
|
5192
|
+
formData.append(parentKey, convertValue(data2));
|
|
5193
|
+
}
|
|
5194
|
+
}
|
|
5195
|
+
build(obj);
|
|
5196
|
+
return formData;
|
|
5197
|
+
}
|
|
5198
|
+
var toFormData_1 = toFormData;
|
|
5199
|
+
var settle = function settle2(resolve, reject, response) {
|
|
5200
|
+
var validateStatus2 = response.config.validateStatus;
|
|
5201
|
+
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
5202
|
+
resolve(response);
|
|
5203
|
+
} else {
|
|
5204
|
+
reject(new AxiosError_1("Request failed with status code " + response.status, [AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
5205
|
+
}
|
|
5206
|
+
};
|
|
5207
|
+
var cookies = utils.isStandardBrowserEnv() ?
|
|
5208
|
+
// Standard browser envs support document.cookie
|
|
5209
|
+
function standardBrowserEnv() {
|
|
5210
|
+
return {
|
|
5211
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
5212
|
+
var cookie = [];
|
|
5213
|
+
cookie.push(name + "=" + encodeURIComponent(value));
|
|
5214
|
+
if (utils.isNumber(expires)) {
|
|
5215
|
+
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
5216
|
+
}
|
|
5217
|
+
if (utils.isString(path)) {
|
|
5218
|
+
cookie.push("path=" + path);
|
|
5219
|
+
}
|
|
5220
|
+
if (utils.isString(domain)) {
|
|
5221
|
+
cookie.push("domain=" + domain);
|
|
5222
|
+
}
|
|
5223
|
+
if (secure === true) {
|
|
5224
|
+
cookie.push("secure");
|
|
5225
|
+
}
|
|
5226
|
+
document.cookie = cookie.join("; ");
|
|
5227
|
+
},
|
|
5228
|
+
read: function read(name) {
|
|
5229
|
+
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
5230
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
5231
|
+
},
|
|
5232
|
+
remove: function remove(name) {
|
|
5233
|
+
this.write(name, "", Date.now() - 864e5);
|
|
5234
|
+
}
|
|
5235
|
+
};
|
|
5236
|
+
}() :
|
|
5237
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
5238
|
+
function nonStandardBrowserEnv() {
|
|
5239
|
+
return {
|
|
5240
|
+
write: function write() {},
|
|
5241
|
+
read: function read() {
|
|
5242
|
+
return null;
|
|
5243
|
+
},
|
|
5244
|
+
remove: function remove() {}
|
|
5245
|
+
};
|
|
5246
|
+
}();
|
|
5247
|
+
var isAbsoluteURL = function isAbsoluteURL2(url) {
|
|
5248
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
5249
|
+
};
|
|
5250
|
+
var combineURLs = function combineURLs2(baseURL, relativeURL) {
|
|
5251
|
+
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
5252
|
+
};
|
|
5253
|
+
var buildFullPath = function buildFullPath2(baseURL, requestedURL) {
|
|
5254
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
5255
|
+
return combineURLs(baseURL, requestedURL);
|
|
5256
|
+
}
|
|
5257
|
+
return requestedURL;
|
|
5258
|
+
};
|
|
5259
|
+
var ignoreDuplicateOf = ["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"];
|
|
5260
|
+
var parseHeaders = function parseHeaders2(headers) {
|
|
5261
|
+
var parsed = {};
|
|
5262
|
+
var key;
|
|
5263
|
+
var val;
|
|
5264
|
+
var i;
|
|
5265
|
+
if (!headers) {
|
|
5266
|
+
return parsed;
|
|
5267
|
+
}
|
|
5268
|
+
utils.forEach(headers.split("\n"), function parser(line) {
|
|
5269
|
+
i = line.indexOf(":");
|
|
5270
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
5271
|
+
val = utils.trim(line.substr(i + 1));
|
|
5272
|
+
if (key) {
|
|
5273
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
5274
|
+
return;
|
|
5275
|
+
}
|
|
5276
|
+
if (key === "set-cookie") {
|
|
5277
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
5278
|
+
} else {
|
|
5279
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
});
|
|
5283
|
+
return parsed;
|
|
5284
|
+
};
|
|
5285
|
+
var isURLSameOrigin = utils.isStandardBrowserEnv() ?
|
|
5286
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
5287
|
+
// whether the request URL is of the same origin as current location.
|
|
5288
|
+
function standardBrowserEnv2() {
|
|
5289
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
5290
|
+
var urlParsingNode = document.createElement("a");
|
|
5291
|
+
var originURL;
|
|
5292
|
+
function resolveURL(url) {
|
|
5293
|
+
var href = url;
|
|
5294
|
+
if (msie) {
|
|
5295
|
+
urlParsingNode.setAttribute("href", href);
|
|
5296
|
+
href = urlParsingNode.href;
|
|
5297
|
+
}
|
|
5298
|
+
urlParsingNode.setAttribute("href", href);
|
|
5299
|
+
return {
|
|
5300
|
+
href: urlParsingNode.href,
|
|
5301
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
5302
|
+
host: urlParsingNode.host,
|
|
5303
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
5304
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
5305
|
+
hostname: urlParsingNode.hostname,
|
|
5306
|
+
port: urlParsingNode.port,
|
|
5307
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
5308
|
+
};
|
|
5309
|
+
}
|
|
5310
|
+
originURL = resolveURL(window.location.href);
|
|
5311
|
+
return function isURLSameOrigin2(requestURL) {
|
|
5312
|
+
var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
5313
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
5314
|
+
};
|
|
5315
|
+
}() :
|
|
5316
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
5317
|
+
function nonStandardBrowserEnv2() {
|
|
5318
|
+
return function isURLSameOrigin2() {
|
|
5319
|
+
return true;
|
|
5320
|
+
};
|
|
5321
|
+
}();
|
|
5322
|
+
function CanceledError(message) {
|
|
5323
|
+
AxiosError_1.call(this, message == null ? "canceled" : message, AxiosError_1.ERR_CANCELED);
|
|
5324
|
+
this.name = "CanceledError";
|
|
5325
|
+
}
|
|
5326
|
+
utils.inherits(CanceledError, AxiosError_1, {
|
|
5327
|
+
__CANCEL__: true
|
|
5328
|
+
});
|
|
5329
|
+
var CanceledError_1 = CanceledError;
|
|
5330
|
+
var parseProtocol = function parseProtocol2(url) {
|
|
5331
|
+
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
5332
|
+
return match && match[1] || "";
|
|
5333
|
+
};
|
|
5334
|
+
var xhr = function xhrAdapter(config) {
|
|
5335
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
5336
|
+
var requestData = config.data;
|
|
5337
|
+
var requestHeaders = config.headers;
|
|
5338
|
+
var responseType = config.responseType;
|
|
5339
|
+
var onCanceled;
|
|
5340
|
+
function done() {
|
|
5341
|
+
if (config.cancelToken) {
|
|
5342
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
5343
|
+
}
|
|
5344
|
+
if (config.signal) {
|
|
5345
|
+
config.signal.removeEventListener("abort", onCanceled);
|
|
5346
|
+
}
|
|
5347
|
+
}
|
|
5348
|
+
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
|
|
5349
|
+
delete requestHeaders["Content-Type"];
|
|
5350
|
+
}
|
|
5351
|
+
var request2 = new XMLHttpRequest();
|
|
5352
|
+
if (config.auth) {
|
|
5353
|
+
var username = config.auth.username || "";
|
|
5354
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
5355
|
+
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
5356
|
+
}
|
|
5357
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
5358
|
+
request2.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
5359
|
+
request2.timeout = config.timeout;
|
|
5360
|
+
function onloadend() {
|
|
5361
|
+
if (!request2) {
|
|
5362
|
+
return;
|
|
5363
|
+
}
|
|
5364
|
+
var responseHeaders = "getAllResponseHeaders" in request2 ? parseHeaders(request2.getAllResponseHeaders()) : null;
|
|
5365
|
+
var responseData = !responseType || responseType === "text" || responseType === "json" ? request2.responseText : request2.response;
|
|
5366
|
+
var response = {
|
|
5367
|
+
data: responseData,
|
|
5368
|
+
status: request2.status,
|
|
5369
|
+
statusText: request2.statusText,
|
|
5370
|
+
headers: responseHeaders,
|
|
5371
|
+
config,
|
|
5372
|
+
request: request2
|
|
5373
|
+
};
|
|
5374
|
+
settle(function _resolve(value) {
|
|
5375
|
+
resolve(value);
|
|
5376
|
+
done();
|
|
5377
|
+
}, function _reject(err) {
|
|
5378
|
+
reject(err);
|
|
5379
|
+
done();
|
|
5380
|
+
}, response);
|
|
5381
|
+
request2 = null;
|
|
5382
|
+
}
|
|
5383
|
+
if ("onloadend" in request2) {
|
|
5384
|
+
request2.onloadend = onloadend;
|
|
5385
|
+
} else {
|
|
5386
|
+
request2.onreadystatechange = function handleLoad() {
|
|
5387
|
+
if (!request2 || request2.readyState !== 4) {
|
|
5388
|
+
return;
|
|
5389
|
+
}
|
|
5390
|
+
if (request2.status === 0 && !(request2.responseURL && request2.responseURL.indexOf("file:") === 0)) {
|
|
5391
|
+
return;
|
|
5392
|
+
}
|
|
5393
|
+
setTimeout(onloadend);
|
|
5394
|
+
};
|
|
5395
|
+
}
|
|
5396
|
+
request2.onabort = function handleAbort() {
|
|
5397
|
+
if (!request2) {
|
|
5398
|
+
return;
|
|
5399
|
+
}
|
|
5400
|
+
reject(new AxiosError_1("Request aborted", AxiosError_1.ECONNABORTED, config, request2));
|
|
5401
|
+
request2 = null;
|
|
5402
|
+
};
|
|
5403
|
+
request2.onerror = function handleError() {
|
|
5404
|
+
reject(new AxiosError_1("Network Error", AxiosError_1.ERR_NETWORK, config, request2, request2));
|
|
5405
|
+
request2 = null;
|
|
5406
|
+
};
|
|
5407
|
+
request2.ontimeout = function handleTimeout() {
|
|
5408
|
+
var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
5409
|
+
var transitional$1 = config.transitional || transitional;
|
|
5410
|
+
if (config.timeoutErrorMessage) {
|
|
5411
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
5412
|
+
}
|
|
5413
|
+
reject(new AxiosError_1(timeoutErrorMessage, transitional$1.clarifyTimeoutError ? AxiosError_1.ETIMEDOUT : AxiosError_1.ECONNABORTED, config, request2));
|
|
5414
|
+
request2 = null;
|
|
5415
|
+
};
|
|
5416
|
+
if (utils.isStandardBrowserEnv()) {
|
|
5417
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
5418
|
+
if (xsrfValue) {
|
|
5419
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
if ("setRequestHeader" in request2) {
|
|
5423
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
5424
|
+
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
5425
|
+
delete requestHeaders[key];
|
|
5426
|
+
} else {
|
|
5427
|
+
request2.setRequestHeader(key, val);
|
|
5428
|
+
}
|
|
5429
|
+
});
|
|
5430
|
+
}
|
|
5431
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
|
5432
|
+
request2.withCredentials = !!config.withCredentials;
|
|
5433
|
+
}
|
|
5434
|
+
if (responseType && responseType !== "json") {
|
|
5435
|
+
request2.responseType = config.responseType;
|
|
5436
|
+
}
|
|
5437
|
+
if (typeof config.onDownloadProgress === "function") {
|
|
5438
|
+
request2.addEventListener("progress", config.onDownloadProgress);
|
|
5439
|
+
}
|
|
5440
|
+
if (typeof config.onUploadProgress === "function" && request2.upload) {
|
|
5441
|
+
request2.upload.addEventListener("progress", config.onUploadProgress);
|
|
5442
|
+
}
|
|
5443
|
+
if (config.cancelToken || config.signal) {
|
|
5444
|
+
onCanceled = function (cancel) {
|
|
5445
|
+
if (!request2) {
|
|
5446
|
+
return;
|
|
5447
|
+
}
|
|
5448
|
+
reject(!cancel || cancel && cancel.type ? new CanceledError_1() : cancel);
|
|
5449
|
+
request2.abort();
|
|
5450
|
+
request2 = null;
|
|
5451
|
+
};
|
|
5452
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
5453
|
+
if (config.signal) {
|
|
5454
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
5455
|
+
}
|
|
5456
|
+
}
|
|
5457
|
+
if (!requestData) {
|
|
5458
|
+
requestData = null;
|
|
5459
|
+
}
|
|
5460
|
+
var protocol = parseProtocol(fullPath);
|
|
5461
|
+
if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
|
|
5462
|
+
reject(new AxiosError_1("Unsupported protocol " + protocol + ":", AxiosError_1.ERR_BAD_REQUEST, config));
|
|
5463
|
+
return;
|
|
5464
|
+
}
|
|
5465
|
+
request2.send(requestData);
|
|
5466
|
+
});
|
|
5467
|
+
};
|
|
5468
|
+
var _null = null;
|
|
5469
|
+
var DEFAULT_CONTENT_TYPE = {
|
|
5470
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
5471
|
+
};
|
|
5472
|
+
function setContentTypeIfUnset(headers, value) {
|
|
5473
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) {
|
|
5474
|
+
headers["Content-Type"] = value;
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
function getDefaultAdapter() {
|
|
5478
|
+
var adapter;
|
|
5479
|
+
if (typeof XMLHttpRequest !== "undefined") {
|
|
5480
|
+
adapter = xhr;
|
|
5481
|
+
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
5482
|
+
adapter = xhr;
|
|
5483
|
+
}
|
|
5484
|
+
return adapter;
|
|
5485
|
+
}
|
|
5486
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
5487
|
+
if (utils.isString(rawValue)) {
|
|
5488
|
+
try {
|
|
5489
|
+
(parser || JSON.parse)(rawValue);
|
|
5490
|
+
return utils.trim(rawValue);
|
|
5491
|
+
} catch (e) {
|
|
5492
|
+
if (e.name !== "SyntaxError") {
|
|
5493
|
+
throw e;
|
|
5494
|
+
}
|
|
5495
|
+
}
|
|
5496
|
+
}
|
|
5497
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
5498
|
+
}
|
|
5499
|
+
var defaults = {
|
|
5500
|
+
transitional,
|
|
5501
|
+
adapter: getDefaultAdapter(),
|
|
5502
|
+
transformRequest: [function transformRequest(data2, headers) {
|
|
5503
|
+
normalizeHeaderName(headers, "Accept");
|
|
5504
|
+
normalizeHeaderName(headers, "Content-Type");
|
|
5505
|
+
if (utils.isFormData(data2) || utils.isArrayBuffer(data2) || utils.isBuffer(data2) || utils.isStream(data2) || utils.isFile(data2) || utils.isBlob(data2)) {
|
|
5506
|
+
return data2;
|
|
5507
|
+
}
|
|
5508
|
+
if (utils.isArrayBufferView(data2)) {
|
|
5509
|
+
return data2.buffer;
|
|
5510
|
+
}
|
|
5511
|
+
if (utils.isURLSearchParams(data2)) {
|
|
5512
|
+
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
5513
|
+
return data2.toString();
|
|
5514
|
+
}
|
|
5515
|
+
var isObjectPayload = utils.isObject(data2);
|
|
5516
|
+
var contentType = headers && headers["Content-Type"];
|
|
5517
|
+
var isFileList2;
|
|
5518
|
+
if ((isFileList2 = utils.isFileList(data2)) || isObjectPayload && contentType === "multipart/form-data") {
|
|
5519
|
+
var _FormData = this.env && this.env.FormData;
|
|
5520
|
+
return toFormData_1(isFileList2 ? {
|
|
5521
|
+
"files[]": data2
|
|
5522
|
+
} : data2, _FormData && new _FormData());
|
|
5523
|
+
} else if (isObjectPayload || contentType === "application/json") {
|
|
5524
|
+
setContentTypeIfUnset(headers, "application/json");
|
|
5525
|
+
return stringifySafely(data2);
|
|
5526
|
+
}
|
|
5527
|
+
return data2;
|
|
5528
|
+
}],
|
|
5529
|
+
transformResponse: [function transformResponse(data2) {
|
|
5530
|
+
var transitional3 = this.transitional || defaults.transitional;
|
|
5531
|
+
var silentJSONParsing = transitional3 && transitional3.silentJSONParsing;
|
|
5532
|
+
var forcedJSONParsing = transitional3 && transitional3.forcedJSONParsing;
|
|
5533
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
5534
|
+
if (strictJSONParsing || forcedJSONParsing && utils.isString(data2) && data2.length) {
|
|
5535
|
+
try {
|
|
5536
|
+
return JSON.parse(data2);
|
|
5537
|
+
} catch (e) {
|
|
5538
|
+
if (strictJSONParsing) {
|
|
5539
|
+
if (e.name === "SyntaxError") {
|
|
5540
|
+
throw AxiosError_1.from(e, AxiosError_1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
5541
|
+
}
|
|
5542
|
+
throw e;
|
|
5543
|
+
}
|
|
5544
|
+
}
|
|
5545
|
+
}
|
|
5546
|
+
return data2;
|
|
5547
|
+
}],
|
|
5548
|
+
/**
|
|
5549
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
5550
|
+
* timeout is not created.
|
|
5551
|
+
*/
|
|
5552
|
+
timeout: 0,
|
|
5553
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
5554
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
5555
|
+
maxContentLength: -1,
|
|
5556
|
+
maxBodyLength: -1,
|
|
5557
|
+
env: {
|
|
5558
|
+
FormData: _null
|
|
5559
|
+
},
|
|
5560
|
+
validateStatus: function validateStatus(status) {
|
|
5561
|
+
return status >= 200 && status < 300;
|
|
5562
|
+
},
|
|
5563
|
+
headers: {
|
|
5564
|
+
common: {
|
|
5565
|
+
Accept: "application/json, text/plain, */*"
|
|
5566
|
+
}
|
|
5567
|
+
}
|
|
5568
|
+
};
|
|
5569
|
+
utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
5570
|
+
defaults.headers[method] = {};
|
|
5571
|
+
});
|
|
5572
|
+
utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
5573
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
5574
|
+
});
|
|
5575
|
+
var defaults_1 = defaults;
|
|
5576
|
+
var transformData = function transformData2(data2, headers, fns) {
|
|
5577
|
+
var context = this || defaults_1;
|
|
5578
|
+
utils.forEach(fns, function transform(fn) {
|
|
5579
|
+
data2 = fn.call(context, data2, headers);
|
|
5580
|
+
});
|
|
5581
|
+
return data2;
|
|
5582
|
+
};
|
|
5583
|
+
var isCancel = function isCancel2(value) {
|
|
5584
|
+
return !!(value && value.__CANCEL__);
|
|
5585
|
+
};
|
|
5586
|
+
function throwIfCancellationRequested(config) {
|
|
5587
|
+
if (config.cancelToken) {
|
|
5588
|
+
config.cancelToken.throwIfRequested();
|
|
5589
|
+
}
|
|
5590
|
+
if (config.signal && config.signal.aborted) {
|
|
5591
|
+
throw new CanceledError_1();
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
var dispatchRequest = function dispatchRequest2(config) {
|
|
5595
|
+
throwIfCancellationRequested(config);
|
|
5596
|
+
config.headers = config.headers || {};
|
|
5597
|
+
config.data = transformData.call(config, config.data, config.headers, config.transformRequest);
|
|
5598
|
+
config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
5599
|
+
utils.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
5600
|
+
delete config.headers[method];
|
|
5601
|
+
});
|
|
5602
|
+
var adapter = config.adapter || defaults_1.adapter;
|
|
5603
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
5604
|
+
throwIfCancellationRequested(config);
|
|
5605
|
+
response.data = transformData.call(config, response.data, response.headers, config.transformResponse);
|
|
5606
|
+
return response;
|
|
5607
|
+
}, function onAdapterRejection(reason) {
|
|
5608
|
+
if (!isCancel(reason)) {
|
|
5609
|
+
throwIfCancellationRequested(config);
|
|
5610
|
+
if (reason && reason.response) {
|
|
5611
|
+
reason.response.data = transformData.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
5612
|
+
}
|
|
5613
|
+
}
|
|
5614
|
+
return Promise.reject(reason);
|
|
5615
|
+
});
|
|
5616
|
+
};
|
|
5617
|
+
var mergeConfig = function mergeConfig2(config1, config2) {
|
|
5618
|
+
config2 = config2 || {};
|
|
5619
|
+
var config = {};
|
|
5620
|
+
function getMergedValue(target, source2) {
|
|
5621
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source2)) {
|
|
5622
|
+
return utils.merge(target, source2);
|
|
5623
|
+
} else if (utils.isPlainObject(source2)) {
|
|
5624
|
+
return utils.merge({}, source2);
|
|
5625
|
+
} else if (utils.isArray(source2)) {
|
|
5626
|
+
return source2.slice();
|
|
5627
|
+
}
|
|
5628
|
+
return source2;
|
|
5629
|
+
}
|
|
5630
|
+
function mergeDeepProperties(prop) {
|
|
5631
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
5632
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
5633
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
5634
|
+
return getMergedValue(void 0, config1[prop]);
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
function valueFromConfig2(prop) {
|
|
5638
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
5639
|
+
return getMergedValue(void 0, config2[prop]);
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
function defaultToConfig2(prop) {
|
|
5643
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
5644
|
+
return getMergedValue(void 0, config2[prop]);
|
|
5645
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
5646
|
+
return getMergedValue(void 0, config1[prop]);
|
|
5647
|
+
}
|
|
5648
|
+
}
|
|
5649
|
+
function mergeDirectKeys(prop) {
|
|
5650
|
+
if (prop in config2) {
|
|
5651
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
5652
|
+
} else if (prop in config1) {
|
|
5653
|
+
return getMergedValue(void 0, config1[prop]);
|
|
5654
|
+
}
|
|
5655
|
+
}
|
|
5656
|
+
var mergeMap = {
|
|
5657
|
+
url: valueFromConfig2,
|
|
5658
|
+
method: valueFromConfig2,
|
|
5659
|
+
data: valueFromConfig2,
|
|
5660
|
+
baseURL: defaultToConfig2,
|
|
5661
|
+
transformRequest: defaultToConfig2,
|
|
5662
|
+
transformResponse: defaultToConfig2,
|
|
5663
|
+
paramsSerializer: defaultToConfig2,
|
|
5664
|
+
timeout: defaultToConfig2,
|
|
5665
|
+
timeoutMessage: defaultToConfig2,
|
|
5666
|
+
withCredentials: defaultToConfig2,
|
|
5667
|
+
adapter: defaultToConfig2,
|
|
5668
|
+
responseType: defaultToConfig2,
|
|
5669
|
+
xsrfCookieName: defaultToConfig2,
|
|
5670
|
+
xsrfHeaderName: defaultToConfig2,
|
|
5671
|
+
onUploadProgress: defaultToConfig2,
|
|
5672
|
+
onDownloadProgress: defaultToConfig2,
|
|
5673
|
+
decompress: defaultToConfig2,
|
|
5674
|
+
maxContentLength: defaultToConfig2,
|
|
5675
|
+
maxBodyLength: defaultToConfig2,
|
|
5676
|
+
beforeRedirect: defaultToConfig2,
|
|
5677
|
+
transport: defaultToConfig2,
|
|
5678
|
+
httpAgent: defaultToConfig2,
|
|
5679
|
+
httpsAgent: defaultToConfig2,
|
|
5680
|
+
cancelToken: defaultToConfig2,
|
|
5681
|
+
socketPath: defaultToConfig2,
|
|
5682
|
+
responseEncoding: defaultToConfig2,
|
|
5683
|
+
validateStatus: mergeDirectKeys
|
|
5684
|
+
};
|
|
5685
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
5686
|
+
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
5687
|
+
var configValue = merge2(prop);
|
|
5688
|
+
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
5689
|
+
});
|
|
5690
|
+
return config;
|
|
5691
|
+
};
|
|
5692
|
+
var data = {
|
|
5693
|
+
version: "0.27.2"
|
|
5694
|
+
};
|
|
5695
|
+
var VERSION = data.version;
|
|
5696
|
+
var validators$1 = {};
|
|
5697
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach(function (type, i) {
|
|
5698
|
+
validators$1[type] = function validator2(thing) {
|
|
5699
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
5700
|
+
};
|
|
5701
|
+
});
|
|
5702
|
+
var deprecatedWarnings = {};
|
|
5703
|
+
validators$1.transitional = function transitional2(validator2, version, message) {
|
|
5704
|
+
function formatMessage(opt, desc) {
|
|
5705
|
+
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
5706
|
+
}
|
|
5707
|
+
return function (value, opt, opts) {
|
|
5708
|
+
if (validator2 === false) {
|
|
5709
|
+
throw new AxiosError_1(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError_1.ERR_DEPRECATED);
|
|
5710
|
+
}
|
|
5711
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
5712
|
+
deprecatedWarnings[opt] = true;
|
|
5713
|
+
}
|
|
5714
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
5715
|
+
};
|
|
5716
|
+
};
|
|
5717
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
5718
|
+
if (typeof options !== "object") {
|
|
5719
|
+
throw new AxiosError_1("options must be an object", AxiosError_1.ERR_BAD_OPTION_VALUE);
|
|
5720
|
+
}
|
|
5721
|
+
var keys = Object.keys(options);
|
|
5722
|
+
var i = keys.length;
|
|
5723
|
+
while (i-- > 0) {
|
|
5724
|
+
var opt = keys[i];
|
|
5725
|
+
var validator2 = schema[opt];
|
|
5726
|
+
if (validator2) {
|
|
5727
|
+
var value = options[opt];
|
|
5728
|
+
var result = value === void 0 || validator2(value, opt, options);
|
|
5729
|
+
if (result !== true) {
|
|
5730
|
+
throw new AxiosError_1("option " + opt + " must be " + result, AxiosError_1.ERR_BAD_OPTION_VALUE);
|
|
5731
|
+
}
|
|
5732
|
+
continue;
|
|
5733
|
+
}
|
|
5734
|
+
if (allowUnknown !== true) {
|
|
5735
|
+
throw new AxiosError_1("Unknown option " + opt, AxiosError_1.ERR_BAD_OPTION);
|
|
5736
|
+
}
|
|
5737
|
+
}
|
|
5738
|
+
}
|
|
5739
|
+
var validator = {
|
|
5740
|
+
assertOptions,
|
|
5741
|
+
validators: validators$1
|
|
5742
|
+
};
|
|
5743
|
+
var validators = validator.validators;
|
|
5744
|
+
function Axios(instanceConfig) {
|
|
5745
|
+
this.defaults = instanceConfig;
|
|
5746
|
+
this.interceptors = {
|
|
5747
|
+
request: new InterceptorManager_1(),
|
|
5748
|
+
response: new InterceptorManager_1()
|
|
5749
|
+
};
|
|
5750
|
+
}
|
|
5751
|
+
Axios.prototype.request = function request(configOrUrl, config) {
|
|
5752
|
+
if (typeof configOrUrl === "string") {
|
|
5753
|
+
config = config || {};
|
|
5754
|
+
config.url = configOrUrl;
|
|
5755
|
+
} else {
|
|
5756
|
+
config = configOrUrl || {};
|
|
5757
|
+
}
|
|
5758
|
+
config = mergeConfig(this.defaults, config);
|
|
5759
|
+
if (config.method) {
|
|
5760
|
+
config.method = config.method.toLowerCase();
|
|
5761
|
+
} else if (this.defaults.method) {
|
|
5762
|
+
config.method = this.defaults.method.toLowerCase();
|
|
5763
|
+
} else {
|
|
5764
|
+
config.method = "get";
|
|
5765
|
+
}
|
|
5766
|
+
var transitional3 = config.transitional;
|
|
5767
|
+
if (transitional3 !== void 0) {
|
|
5768
|
+
validator.assertOptions(transitional3, {
|
|
5769
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
5770
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
5771
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
5772
|
+
}, false);
|
|
5773
|
+
}
|
|
5774
|
+
var requestInterceptorChain = [];
|
|
5775
|
+
var synchronousRequestInterceptors = true;
|
|
5776
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
5777
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
5778
|
+
return;
|
|
5779
|
+
}
|
|
5780
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
5781
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
5782
|
+
});
|
|
5783
|
+
var responseInterceptorChain = [];
|
|
5784
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
5785
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
5786
|
+
});
|
|
5787
|
+
var promise;
|
|
5788
|
+
if (!synchronousRequestInterceptors) {
|
|
5789
|
+
var chain = [dispatchRequest, void 0];
|
|
5790
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
5791
|
+
chain = chain.concat(responseInterceptorChain);
|
|
5792
|
+
promise = Promise.resolve(config);
|
|
5793
|
+
while (chain.length) {
|
|
5794
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
5795
|
+
}
|
|
5796
|
+
return promise;
|
|
5797
|
+
}
|
|
5798
|
+
var newConfig = config;
|
|
5799
|
+
while (requestInterceptorChain.length) {
|
|
5800
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
5801
|
+
var onRejected = requestInterceptorChain.shift();
|
|
5802
|
+
try {
|
|
5803
|
+
newConfig = onFulfilled(newConfig);
|
|
5804
|
+
} catch (error2) {
|
|
5805
|
+
onRejected(error2);
|
|
5806
|
+
break;
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5809
|
+
try {
|
|
5810
|
+
promise = dispatchRequest(newConfig);
|
|
5811
|
+
} catch (error2) {
|
|
5812
|
+
return Promise.reject(error2);
|
|
5813
|
+
}
|
|
5814
|
+
while (responseInterceptorChain.length) {
|
|
5815
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
5816
|
+
}
|
|
5817
|
+
return promise;
|
|
5818
|
+
};
|
|
5819
|
+
Axios.prototype.getUri = function getUri(config) {
|
|
5820
|
+
config = mergeConfig(this.defaults, config);
|
|
5821
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
5822
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
5823
|
+
};
|
|
5824
|
+
utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
5825
|
+
Axios.prototype[method] = function (url, config) {
|
|
5826
|
+
return this.request(mergeConfig(config || {}, {
|
|
5827
|
+
method,
|
|
5828
|
+
url,
|
|
5829
|
+
data: (config || {}).data
|
|
5830
|
+
}));
|
|
5831
|
+
};
|
|
5832
|
+
});
|
|
5833
|
+
utils.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
5834
|
+
function generateHTTPMethod(isForm) {
|
|
5835
|
+
return function httpMethod(url, data2, config) {
|
|
5836
|
+
return this.request(mergeConfig(config || {}, {
|
|
5837
|
+
method,
|
|
5838
|
+
headers: isForm ? {
|
|
5839
|
+
"Content-Type": "multipart/form-data"
|
|
5840
|
+
} : {},
|
|
5841
|
+
url,
|
|
5842
|
+
data: data2
|
|
5843
|
+
}));
|
|
5844
|
+
};
|
|
5845
|
+
}
|
|
5846
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
5847
|
+
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
5848
|
+
});
|
|
5849
|
+
var Axios_1 = Axios;
|
|
5850
|
+
function CancelToken(executor) {
|
|
5851
|
+
if (typeof executor !== "function") {
|
|
5852
|
+
throw new TypeError("executor must be a function.");
|
|
5853
|
+
}
|
|
5854
|
+
var resolvePromise;
|
|
5855
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
5856
|
+
resolvePromise = resolve;
|
|
5857
|
+
});
|
|
5858
|
+
var token = this;
|
|
5859
|
+
this.promise.then(function (cancel) {
|
|
5860
|
+
if (!token._listeners) return;
|
|
5861
|
+
var i;
|
|
5862
|
+
var l = token._listeners.length;
|
|
5863
|
+
for (i = 0; i < l; i++) {
|
|
5864
|
+
token._listeners[i](cancel);
|
|
5865
|
+
}
|
|
5866
|
+
token._listeners = null;
|
|
5867
|
+
});
|
|
5868
|
+
this.promise.then = function (onfulfilled) {
|
|
5869
|
+
var _resolve;
|
|
5870
|
+
var promise = new Promise(function (resolve) {
|
|
5871
|
+
token.subscribe(resolve);
|
|
5872
|
+
_resolve = resolve;
|
|
5873
|
+
}).then(onfulfilled);
|
|
5874
|
+
promise.cancel = function reject() {
|
|
5875
|
+
token.unsubscribe(_resolve);
|
|
5876
|
+
};
|
|
5877
|
+
return promise;
|
|
5878
|
+
};
|
|
5879
|
+
executor(function cancel(message) {
|
|
5880
|
+
if (token.reason) {
|
|
5881
|
+
return;
|
|
5882
|
+
}
|
|
5883
|
+
token.reason = new CanceledError_1(message);
|
|
5884
|
+
resolvePromise(token.reason);
|
|
5885
|
+
});
|
|
5886
|
+
}
|
|
5887
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
5888
|
+
if (this.reason) {
|
|
5889
|
+
throw this.reason;
|
|
5890
|
+
}
|
|
5891
|
+
};
|
|
5892
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
5893
|
+
if (this.reason) {
|
|
5894
|
+
listener(this.reason);
|
|
5895
|
+
return;
|
|
5896
|
+
}
|
|
5897
|
+
if (this._listeners) {
|
|
5898
|
+
this._listeners.push(listener);
|
|
5899
|
+
} else {
|
|
5900
|
+
this._listeners = [listener];
|
|
5901
|
+
}
|
|
5902
|
+
};
|
|
5903
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
5904
|
+
if (!this._listeners) {
|
|
5905
|
+
return;
|
|
5906
|
+
}
|
|
5907
|
+
var index = this._listeners.indexOf(listener);
|
|
5908
|
+
if (index !== -1) {
|
|
5909
|
+
this._listeners.splice(index, 1);
|
|
5910
|
+
}
|
|
5911
|
+
};
|
|
5912
|
+
CancelToken.source = function source() {
|
|
5913
|
+
var cancel;
|
|
5914
|
+
var token = new CancelToken(function executor(c) {
|
|
5915
|
+
cancel = c;
|
|
5916
|
+
});
|
|
5917
|
+
return {
|
|
5918
|
+
token,
|
|
5919
|
+
cancel
|
|
5920
|
+
};
|
|
5921
|
+
};
|
|
5922
|
+
var CancelToken_1 = CancelToken;
|
|
5923
|
+
var spread = function spread2(callback) {
|
|
5924
|
+
return function wrap(arr) {
|
|
5925
|
+
return callback.apply(null, arr);
|
|
5926
|
+
};
|
|
5927
|
+
};
|
|
5928
|
+
var isAxiosError = function isAxiosError2(payload) {
|
|
5929
|
+
return utils.isObject(payload) && payload.isAxiosError === true;
|
|
5930
|
+
};
|
|
5931
|
+
function createInstance(defaultConfig) {
|
|
5932
|
+
var context = new Axios_1(defaultConfig);
|
|
5933
|
+
var instance = bind(Axios_1.prototype.request, context);
|
|
5934
|
+
utils.extend(instance, Axios_1.prototype, context);
|
|
5935
|
+
utils.extend(instance, context);
|
|
5936
|
+
instance.create = function create(instanceConfig) {
|
|
5937
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
5938
|
+
};
|
|
5939
|
+
return instance;
|
|
5940
|
+
}
|
|
5941
|
+
var axios$1 = createInstance(defaults_1);
|
|
5942
|
+
axios$1.Axios = Axios_1;
|
|
5943
|
+
axios$1.CanceledError = CanceledError_1;
|
|
5944
|
+
axios$1.CancelToken = CancelToken_1;
|
|
5945
|
+
axios$1.isCancel = isCancel;
|
|
5946
|
+
axios$1.VERSION = data.version;
|
|
5947
|
+
axios$1.toFormData = toFormData_1;
|
|
5948
|
+
axios$1.AxiosError = AxiosError_1;
|
|
5949
|
+
axios$1.Cancel = axios$1.CanceledError;
|
|
5950
|
+
axios$1.all = function all(promises) {
|
|
5951
|
+
return Promise.all(promises);
|
|
5952
|
+
};
|
|
5953
|
+
axios$1.spread = spread;
|
|
5954
|
+
axios$1.isAxiosError = isAxiosError;
|
|
5955
|
+
var axios_1 = axios$1;
|
|
5956
|
+
var _default = axios$1;
|
|
5957
|
+
axios_1.default = _default;
|
|
5958
|
+
var axios = axios_1;
|
|
4801
5959
|
class RTCEndpoint extends Event$1 {
|
|
4802
5960
|
constructor(options) {
|
|
4803
5961
|
super("RTCPusherPlayer");
|
|
4804
5962
|
this.TAG = "[RTCPusherPlayer]";
|
|
4805
|
-
let
|
|
5963
|
+
let defaults2 = {
|
|
4806
5964
|
element: "",
|
|
4807
5965
|
// html video element
|
|
4808
5966
|
debug: false,
|
|
@@ -4816,9 +5974,10 @@ class RTCEndpoint extends Event$1 {
|
|
|
4816
5974
|
resolution: {
|
|
4817
5975
|
w: 0,
|
|
4818
5976
|
h: 0
|
|
4819
|
-
}
|
|
5977
|
+
},
|
|
5978
|
+
usedatachannel: false
|
|
4820
5979
|
};
|
|
4821
|
-
this.options = Object.assign({},
|
|
5980
|
+
this.options = Object.assign({}, defaults2, options);
|
|
4822
5981
|
if (this.options.debug) {
|
|
4823
5982
|
setLogger();
|
|
4824
5983
|
}
|
|
@@ -4826,15 +5985,28 @@ class RTCEndpoint extends Event$1 {
|
|
|
4826
5985
|
onicecandidate: this._onIceCandidate.bind(this),
|
|
4827
5986
|
ontrack: this._onTrack.bind(this),
|
|
4828
5987
|
onicecandidateerror: this._onIceCandidateError.bind(this),
|
|
4829
|
-
onconnectionstatechange: this._onconnectionstatechange.bind(this)
|
|
5988
|
+
onconnectionstatechange: this._onconnectionstatechange.bind(this),
|
|
5989
|
+
ondatachannelopen: this._onDataChannelOpen.bind(this),
|
|
5990
|
+
ondatachannelmsg: this._onDataChannelMsg.bind(this),
|
|
5991
|
+
ondatachannelerr: this._onDataChannelErr.bind(this),
|
|
5992
|
+
ondatachannelclose: this._onDataChannelClose.bind(this)
|
|
4830
5993
|
};
|
|
4831
5994
|
this._remoteStream = null;
|
|
4832
5995
|
this._localStream = null;
|
|
5996
|
+
this._tracks = [];
|
|
4833
5997
|
this.pc = new RTCPeerConnection(null);
|
|
4834
5998
|
this.pc.onicecandidate = this.e.onicecandidate;
|
|
4835
5999
|
this.pc.onicecandidateerror = this.e.onicecandidateerror;
|
|
4836
6000
|
this.pc.ontrack = this.e.ontrack;
|
|
4837
6001
|
this.pc.onconnectionstatechange = this.e.onconnectionstatechange;
|
|
6002
|
+
this.datachannel = null;
|
|
6003
|
+
if (this.options.usedatachannel) {
|
|
6004
|
+
this.datachannel = this.pc.createDataChannel("chat");
|
|
6005
|
+
this.datachannel.onclose = this.e.ondatachannelclose;
|
|
6006
|
+
this.datachannel.onerror = this.e.ondatachannelerr;
|
|
6007
|
+
this.datachannel.onmessage = this.e.ondatachannelmsg;
|
|
6008
|
+
this.datachannel.onopen = this.e.ondatachannelopen;
|
|
6009
|
+
}
|
|
4838
6010
|
if (!this.options.recvOnly && (this.options.audioEnable || this.options.videoEnable)) this.start();else this.receive();
|
|
4839
6011
|
}
|
|
4840
6012
|
receive() {
|
|
@@ -4846,32 +6018,37 @@ class RTCEndpoint extends Event$1 {
|
|
|
4846
6018
|
direction: "recvonly",
|
|
4847
6019
|
sendEncodings: []
|
|
4848
6020
|
};
|
|
4849
|
-
this.
|
|
4850
|
-
|
|
6021
|
+
if (this.options.videoEnable) {
|
|
6022
|
+
this.pc.addTransceiver("video", VideoTransceiverInit);
|
|
6023
|
+
}
|
|
6024
|
+
if (this.options.audioEnable) {
|
|
6025
|
+
this.pc.addTransceiver("audio", AudioTransceiverInit);
|
|
6026
|
+
}
|
|
4851
6027
|
this.pc.createOffer().then(desc => {
|
|
4852
6028
|
log(this.TAG, "offer:", desc.sdp);
|
|
4853
6029
|
this.pc.setLocalDescription(desc).then(() => {
|
|
4854
|
-
|
|
4855
|
-
method: "
|
|
4856
|
-
|
|
6030
|
+
axios({
|
|
6031
|
+
method: "post",
|
|
6032
|
+
url: this.options.zlmsdpUrl,
|
|
6033
|
+
responseType: "json",
|
|
6034
|
+
data: desc.sdp,
|
|
4857
6035
|
headers: {
|
|
4858
6036
|
"Content-Type": "text/plain;charset=utf-8"
|
|
4859
6037
|
}
|
|
4860
6038
|
}).then(response => {
|
|
4861
|
-
response.
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
});
|
|
6039
|
+
let ret = response.data;
|
|
6040
|
+
if (ret.code != 0) {
|
|
6041
|
+
this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret);
|
|
6042
|
+
return;
|
|
6043
|
+
}
|
|
6044
|
+
let anwser = {};
|
|
6045
|
+
anwser.sdp = ret.sdp;
|
|
6046
|
+
anwser.type = "answer";
|
|
6047
|
+
log(this.TAG, "answer:", ret.sdp);
|
|
6048
|
+
this.pc.setRemoteDescription(anwser).then(() => {
|
|
6049
|
+
log(this.TAG, "set remote sucess");
|
|
6050
|
+
}).catch(e => {
|
|
6051
|
+
error(this.TAG, e);
|
|
4875
6052
|
});
|
|
4876
6053
|
});
|
|
4877
6054
|
});
|
|
@@ -4926,64 +6103,76 @@ class RTCEndpoint extends Event$1 {
|
|
|
4926
6103
|
scaleResolutionDownBy: 4
|
|
4927
6104
|
}];
|
|
4928
6105
|
}
|
|
4929
|
-
if (
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
6106
|
+
if (this.options.audioEnable) {
|
|
6107
|
+
if (stream.getAudioTracks().length > 0) {
|
|
6108
|
+
this.pc.addTransceiver(stream.getAudioTracks()[0], AudioTransceiverInit);
|
|
6109
|
+
} else {
|
|
6110
|
+
AudioTransceiverInit.direction = "recvonly";
|
|
6111
|
+
this.pc.addTransceiver("audio", AudioTransceiverInit);
|
|
6112
|
+
}
|
|
4934
6113
|
}
|
|
4935
|
-
if (
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
6114
|
+
if (this.options.videoEnable) {
|
|
6115
|
+
if (stream.getVideoTracks().length > 0) {
|
|
6116
|
+
this.pc.addTransceiver(stream.getVideoTracks()[0], VideoTransceiverInit);
|
|
6117
|
+
} else {
|
|
6118
|
+
VideoTransceiverInit.direction = "recvonly";
|
|
6119
|
+
this.pc.addTransceiver("video", VideoTransceiverInit);
|
|
6120
|
+
}
|
|
4940
6121
|
}
|
|
4941
6122
|
this.pc.createOffer().then(desc => {
|
|
4942
6123
|
log(this.TAG, "offer:", desc.sdp);
|
|
4943
6124
|
this.pc.setLocalDescription(desc).then(() => {
|
|
4944
|
-
|
|
4945
|
-
method: "
|
|
6125
|
+
axios({
|
|
6126
|
+
method: "post",
|
|
6127
|
+
url: this.options.zlmsdpUrl,
|
|
6128
|
+
responseType: "json",
|
|
6129
|
+
data: desc.sdp,
|
|
4946
6130
|
headers: {
|
|
4947
6131
|
"Content-Type": "text/plain;charset=utf-8"
|
|
4948
|
-
}
|
|
4949
|
-
body: desc.sdp
|
|
6132
|
+
}
|
|
4950
6133
|
}).then(response => {
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
});
|
|
6134
|
+
let ret = response.data;
|
|
6135
|
+
if (ret.code != 0) {
|
|
6136
|
+
this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret);
|
|
6137
|
+
return;
|
|
6138
|
+
}
|
|
6139
|
+
let anwser = {};
|
|
6140
|
+
anwser.sdp = ret.sdp;
|
|
6141
|
+
anwser.type = "answer";
|
|
6142
|
+
log(this.TAG, "answer:", ret.sdp);
|
|
6143
|
+
this.pc.setRemoteDescription(anwser).then(() => {
|
|
6144
|
+
log(this.TAG, "set remote sucess");
|
|
6145
|
+
}).catch(e => {
|
|
6146
|
+
error(this.TAG, e);
|
|
4965
6147
|
});
|
|
4966
6148
|
});
|
|
4967
|
-
}).catch(e => {
|
|
4968
|
-
error(this.TAG, e);
|
|
4969
6149
|
});
|
|
4970
6150
|
}).catch(e => {
|
|
4971
|
-
this.
|
|
6151
|
+
error(this.TAG, e);
|
|
4972
6152
|
});
|
|
6153
|
+
}).catch(e => {
|
|
6154
|
+
this.dispatch(Events$1.CAPTURE_STREAM_FAILED);
|
|
4973
6155
|
});
|
|
4974
6156
|
}
|
|
4975
6157
|
_onIceCandidate(event) {
|
|
4976
6158
|
if (event.candidate) {
|
|
4977
|
-
log("Remote ICE candidate: \n " + event.candidate.candidate);
|
|
6159
|
+
log(this.TAG, "Remote ICE candidate: \n " + event.candidate.candidate);
|
|
4978
6160
|
}
|
|
4979
6161
|
}
|
|
4980
6162
|
_onTrack(event) {
|
|
6163
|
+
this._tracks.push(event.track);
|
|
4981
6164
|
if (this.options.element && event.streams && event.streams.length > 0) {
|
|
4982
6165
|
this.options.element.srcObject = event.streams[0];
|
|
4983
6166
|
this._remoteStream = event.streams[0];
|
|
4984
6167
|
this.dispatch(Events$1.WEBRTC_ON_REMOTE_STREAMS, event);
|
|
4985
6168
|
} else {
|
|
4986
|
-
|
|
6169
|
+
if (this.pc.getReceivers().length == this._tracks.length) {
|
|
6170
|
+
log(this.TAG, "play remote stream ");
|
|
6171
|
+
this._remoteStream = new MediaStream(this._tracks);
|
|
6172
|
+
this.options.element.srcObject = this._remoteStream;
|
|
6173
|
+
} else {
|
|
6174
|
+
error(this.TAG, "wait stream track finish");
|
|
6175
|
+
}
|
|
4987
6176
|
}
|
|
4988
6177
|
}
|
|
4989
6178
|
_onIceCandidateError(event) {
|
|
@@ -4992,7 +6181,37 @@ class RTCEndpoint extends Event$1 {
|
|
|
4992
6181
|
_onconnectionstatechange(event) {
|
|
4993
6182
|
this.dispatch(Events$1.WEBRTC_ON_CONNECTION_STATE_CHANGE, this.pc.connectionState);
|
|
4994
6183
|
}
|
|
6184
|
+
_onDataChannelOpen(event) {
|
|
6185
|
+
log(this.TAG, "ondatachannel open:", event);
|
|
6186
|
+
this.dispatch(Events$1.WEBRTC_ON_DATA_CHANNEL_OPEN, event);
|
|
6187
|
+
}
|
|
6188
|
+
_onDataChannelMsg(event) {
|
|
6189
|
+
log(this.TAG, "ondatachannel msg:", event);
|
|
6190
|
+
this.dispatch(Events$1.WEBRTC_ON_DATA_CHANNEL_MSG, event);
|
|
6191
|
+
}
|
|
6192
|
+
_onDataChannelErr(event) {
|
|
6193
|
+
log(this.TAG, "ondatachannel err:", event);
|
|
6194
|
+
this.dispatch(Events$1.WEBRTC_ON_DATA_CHANNEL_ERR, event);
|
|
6195
|
+
}
|
|
6196
|
+
_onDataChannelClose(event) {
|
|
6197
|
+
log(this.TAG, "ondatachannel close:", event);
|
|
6198
|
+
this.dispatch(Events$1.WEBRTC_ON_DATA_CHANNEL_CLOSE, event);
|
|
6199
|
+
}
|
|
6200
|
+
sendMsg(data2) {
|
|
6201
|
+
if (this.datachannel != null) {
|
|
6202
|
+
this.datachannel.send(data2);
|
|
6203
|
+
} else {
|
|
6204
|
+
error(this.TAG, "data channel is null");
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
closeDataChannel() {
|
|
6208
|
+
if (this.datachannel) {
|
|
6209
|
+
this.datachannel.close();
|
|
6210
|
+
this.datachannel = null;
|
|
6211
|
+
}
|
|
6212
|
+
}
|
|
4995
6213
|
close() {
|
|
6214
|
+
this.closeDataChannel();
|
|
4996
6215
|
if (this.pc) {
|
|
4997
6216
|
this.pc.close();
|
|
4998
6217
|
this.pc = null;
|
|
@@ -5010,6 +6229,10 @@ class RTCEndpoint extends Event$1 {
|
|
|
5010
6229
|
track.stop();
|
|
5011
6230
|
});
|
|
5012
6231
|
}
|
|
6232
|
+
this._tracks.forEach((track, idx) => {
|
|
6233
|
+
track.stop();
|
|
6234
|
+
});
|
|
6235
|
+
this._tracks = [];
|
|
5013
6236
|
}
|
|
5014
6237
|
get remoteStream() {
|
|
5015
6238
|
return this._remoteStream;
|
|
@@ -5129,7 +6352,9 @@ class WebRtcMt$1 {
|
|
|
5129
6352
|
this.log("warn", "ICE \u534F\u5546\u51FA\u9519");
|
|
5130
6353
|
this.rePlay(videoElm);
|
|
5131
6354
|
});
|
|
5132
|
-
player.on(Events.WEBRTC_ON_REMOTE_STREAMS, e => {
|
|
6355
|
+
player.on(Events.WEBRTC_ON_REMOTE_STREAMS, e => {
|
|
6356
|
+
this.log("warn", "\u83B7\u53D6\u5230\u4E86\u8FDC\u7AEF\u6D41\uFF0C\u53EF\u4EE5\u64AD\u653E");
|
|
6357
|
+
});
|
|
5133
6358
|
player.on(Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, e => {
|
|
5134
6359
|
this.log("warn", `offer anwser \u4EA4\u6362\u5931\u8D25\uFF0C\u83B7\u53D6\u89C6\u9891\u6D41\u5931\u8D25, ${e}`);
|
|
5135
6360
|
this.rePlay(videoElm);
|