varsnap 1.8.0 → 1.8.3
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/CHANGELOG.md +22 -0
- package/dist/built/varsnap/core.d.ts +2 -4
- package/dist/built/varsnap/core.js +7 -4
- package/dist/built/varsnap/gitbranchenv.d.ts +1 -1
- package/dist/built/varsnap/gitbranchenv.js +2 -1
- package/dist/varsnap.js +376 -412
- package/dist/varsnap.min.js +2 -2
- package/package.json +8 -3
package/dist/varsnap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Varsnap.js v1.8.
|
|
2
|
+
* Varsnap.js v1.8.3
|
|
3
3
|
*/
|
|
4
4
|
(function(exports) {
|
|
5
5
|
!function(e) {
|
|
@@ -7,172 +7,43 @@
|
|
|
7
7
|
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).varsnap = e();
|
|
8
8
|
}
|
|
9
9
|
}(function() {
|
|
10
|
-
var e = function(e) {
|
|
11
|
-
var t;
|
|
12
|
-
return function(n) {
|
|
13
|
-
return t || e(t = {
|
|
14
|
-
exports: {},
|
|
15
|
-
parent: n
|
|
16
|
-
}, t.exports), t.exports;
|
|
17
|
-
};
|
|
18
|
-
}, t = e(function(e, t) {
|
|
19
|
-
(function(t) {
|
|
20
|
-
(function() {
|
|
21
|
-
"use strict";
|
|
22
|
-
var r = {
|
|
23
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
24
|
-
};
|
|
25
|
-
function o(e, t) {
|
|
26
|
-
!f.isUndefined(e) && f.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
|
|
27
|
-
}
|
|
28
|
-
var i, a = {
|
|
29
|
-
transitional: {
|
|
30
|
-
silentJSONParsing: !0,
|
|
31
|
-
forcedJSONParsing: !0,
|
|
32
|
-
clarifyTimeoutError: !1
|
|
33
|
-
},
|
|
34
|
-
adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== t && "[object process]" === Object.prototype.toString.call(t)) && (i = n({})),
|
|
35
|
-
i),
|
|
36
|
-
transformRequest: [ function(e, t) {
|
|
37
|
-
return g(t, "Accept"), g(t, "Content-Type"), f.isFormData(e) || f.isArrayBuffer(e) || f.isBuffer(e) || f.isStream(e) || f.isFile(e) || f.isBlob(e) ? e : f.isArrayBufferView(e) ? e.buffer : f.isURLSearchParams(e) ? (o(t, "application/x-www-form-urlencoded;charset=utf-8"),
|
|
38
|
-
e.toString()) : f.isObject(e) || t && "application/json" === t["Content-Type"] ? (o(t, "application/json"),
|
|
39
|
-
function(e, t, n) {
|
|
40
|
-
if (f.isString(e)) try {
|
|
41
|
-
return (0, JSON.parse)(e), f.trim(e);
|
|
42
|
-
} catch (r) {
|
|
43
|
-
if ("SyntaxError" !== r.name) throw r;
|
|
44
|
-
}
|
|
45
|
-
return (0, JSON.stringify)(e);
|
|
46
|
-
}(e)) : e;
|
|
47
|
-
} ],
|
|
48
|
-
transformResponse: [ function(e) {
|
|
49
|
-
var t = this.transitional || a.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing, o = !n && "json" === this.responseType;
|
|
50
|
-
if (o || r && f.isString(e) && e.length) try {
|
|
51
|
-
return JSON.parse(e);
|
|
52
|
-
} catch (i) {
|
|
53
|
-
if (o) {
|
|
54
|
-
if ("SyntaxError" === i.name) throw m(i, this, "E_JSON_PARSE");
|
|
55
|
-
throw i;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return e;
|
|
59
|
-
} ],
|
|
60
|
-
timeout: 0,
|
|
61
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
62
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
63
|
-
maxContentLength: -1,
|
|
64
|
-
maxBodyLength: -1,
|
|
65
|
-
validateStatus: function(e) {
|
|
66
|
-
return e >= 200 && e < 300;
|
|
67
|
-
},
|
|
68
|
-
headers: {
|
|
69
|
-
common: {
|
|
70
|
-
Accept: "application/json, text/plain, */*"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
f.forEach([ "delete", "get", "head" ], function(e) {
|
|
75
|
-
a.headers[e] = {};
|
|
76
|
-
}), f.forEach([ "post", "put", "patch" ], function(e) {
|
|
77
|
-
a.headers[e] = f.merge(r);
|
|
78
|
-
}), e.exports = a;
|
|
79
|
-
}).call(this);
|
|
80
|
-
}).call(this, x);
|
|
81
|
-
}), n = e(function(e, n) {
|
|
82
|
-
"use strict";
|
|
83
|
-
var r = t({});
|
|
84
|
-
e.exports = function(e) {
|
|
85
|
-
return new Promise(function(t, n) {
|
|
86
|
-
var o, i = e.data, a = e.headers, s = e.responseType;
|
|
87
|
-
function u() {
|
|
88
|
-
e.cancelToken && e.cancelToken.unsubscribe(o), e.signal && e.signal.removeEventListener("abort", o);
|
|
89
|
-
}
|
|
90
|
-
f.isFormData(i) && delete a["Content-Type"];
|
|
91
|
-
var c = new XMLHttpRequest();
|
|
92
|
-
if (e.auth) {
|
|
93
|
-
var l = e.auth.username || "", d = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
94
|
-
a.Authorization = "Basic " + btoa(l + ":" + d);
|
|
95
|
-
}
|
|
96
|
-
var h = w(e.baseURL, e.url);
|
|
97
|
-
function g() {
|
|
98
|
-
if (c) {
|
|
99
|
-
var r = "getAllResponseHeaders" in c ? T(c.getAllResponseHeaders()) : null, o = {
|
|
100
|
-
data: s && "text" !== s && "json" !== s ? c.response : c.responseText,
|
|
101
|
-
status: c.status,
|
|
102
|
-
statusText: c.statusText,
|
|
103
|
-
headers: r,
|
|
104
|
-
config: e,
|
|
105
|
-
request: c
|
|
106
|
-
};
|
|
107
|
-
y(function(e) {
|
|
108
|
-
t(e), u();
|
|
109
|
-
}, function(e) {
|
|
110
|
-
n(e), u();
|
|
111
|
-
}, o), c = null;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (c.open(e.method.toUpperCase(), p(h, e.params, e.paramsSerializer), !0), c.timeout = e.timeout,
|
|
115
|
-
"onloadend" in c ? c.onloadend = g : c.onreadystatechange = function() {
|
|
116
|
-
c && 4 === c.readyState && (0 !== c.status || c.responseURL && 0 === c.responseURL.indexOf("file:")) && setTimeout(g);
|
|
117
|
-
}, c.onabort = function() {
|
|
118
|
-
c && (n(v("Request aborted", e, "ECONNABORTED", c)), c = null);
|
|
119
|
-
}, c.onerror = function() {
|
|
120
|
-
n(v("Network Error", e, null, c)), c = null;
|
|
121
|
-
}, c.ontimeout = function() {
|
|
122
|
-
var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", o = e.transitional || r.transitional;
|
|
123
|
-
e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(v(t, e, o.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
|
|
124
|
-
c = null;
|
|
125
|
-
}, f.isStandardBrowserEnv()) {
|
|
126
|
-
var m = (e.withCredentials || k(h)) && e.xsrfCookieName ? b.read(e.xsrfCookieName) : void 0;
|
|
127
|
-
m && (a[e.xsrfHeaderName] = m);
|
|
128
|
-
}
|
|
129
|
-
"setRequestHeader" in c && f.forEach(a, function(e, t) {
|
|
130
|
-
void 0 === i && "content-type" === t.toLowerCase() ? delete a[t] : c.setRequestHeader(t, e);
|
|
131
|
-
}), f.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
|
|
132
|
-
s && "json" !== s && (c.responseType = e.responseType), "function" == typeof e.onDownloadProgress && c.addEventListener("progress", e.onDownloadProgress),
|
|
133
|
-
"function" == typeof e.onUploadProgress && c.upload && c.upload.addEventListener("progress", e.onUploadProgress),
|
|
134
|
-
(e.cancelToken || e.signal) && (o = function(e) {
|
|
135
|
-
c && (n(!e || e && e.type ? new C("canceled") : e), c.abort(), c = null);
|
|
136
|
-
}, e.cancelToken && e.cancelToken.subscribe(o), e.signal && (e.signal.aborted ? o() : e.signal.addEventListener("abort", o))),
|
|
137
|
-
i || (i = null), c.send(i);
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
}), r = function(e, t) {
|
|
10
|
+
var e = function(e, t) {
|
|
141
11
|
return function() {
|
|
142
12
|
for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r];
|
|
143
13
|
return e.apply(t, n);
|
|
144
14
|
};
|
|
145
|
-
},
|
|
146
|
-
function
|
|
147
|
-
return
|
|
15
|
+
}, t = Object.prototype.toString;
|
|
16
|
+
function n(e) {
|
|
17
|
+
return Array.isArray(e);
|
|
148
18
|
}
|
|
149
|
-
function
|
|
19
|
+
function r(e) {
|
|
150
20
|
return void 0 === e;
|
|
151
21
|
}
|
|
152
|
-
function
|
|
22
|
+
function o(e) {
|
|
23
|
+
return "[object ArrayBuffer]" === t.call(e);
|
|
24
|
+
}
|
|
25
|
+
function i(e) {
|
|
153
26
|
return null !== e && "object" == typeof e;
|
|
154
27
|
}
|
|
155
|
-
function
|
|
156
|
-
if ("[object Object]" !==
|
|
157
|
-
var
|
|
158
|
-
return null ===
|
|
28
|
+
function a(e) {
|
|
29
|
+
if ("[object Object]" !== t.call(e)) return !1;
|
|
30
|
+
var n = Object.getPrototypeOf(e);
|
|
31
|
+
return null === n || n === Object.prototype;
|
|
159
32
|
}
|
|
160
|
-
function
|
|
161
|
-
if (null != e) if ("object" != typeof e && (e = [ e ]),
|
|
33
|
+
function s(e, t) {
|
|
34
|
+
if (null != e) if ("object" != typeof e && (e = [ e ]), n(e)) for (var r = 0, o = e.length; r < o; r++) t.call(null, e[r], r, e); else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e);
|
|
162
35
|
}
|
|
163
|
-
var
|
|
164
|
-
isArray:
|
|
165
|
-
isArrayBuffer:
|
|
166
|
-
return "[object ArrayBuffer]" === o.call(e);
|
|
167
|
-
},
|
|
36
|
+
var u = {
|
|
37
|
+
isArray: n,
|
|
38
|
+
isArrayBuffer: o,
|
|
168
39
|
isBuffer: function(e) {
|
|
169
|
-
return null !== e && !
|
|
40
|
+
return null !== e && !r(e) && null !== e.constructor && !r(e.constructor) && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
|
|
170
41
|
},
|
|
171
42
|
isFormData: function(e) {
|
|
172
|
-
return "
|
|
43
|
+
return "[object FormData]" === t.call(e);
|
|
173
44
|
},
|
|
174
45
|
isArrayBufferView: function(e) {
|
|
175
|
-
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer
|
|
46
|
+
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && o(e.buffer);
|
|
176
47
|
},
|
|
177
48
|
isString: function(e) {
|
|
178
49
|
return "string" == typeof e;
|
|
@@ -180,58 +51,59 @@
|
|
|
180
51
|
isNumber: function(e) {
|
|
181
52
|
return "number" == typeof e;
|
|
182
53
|
},
|
|
183
|
-
isObject:
|
|
184
|
-
isPlainObject:
|
|
185
|
-
isUndefined:
|
|
54
|
+
isObject: i,
|
|
55
|
+
isPlainObject: a,
|
|
56
|
+
isUndefined: r,
|
|
186
57
|
isDate: function(e) {
|
|
187
|
-
return "[object Date]" ===
|
|
58
|
+
return "[object Date]" === t.call(e);
|
|
188
59
|
},
|
|
189
60
|
isFile: function(e) {
|
|
190
|
-
return "[object File]" ===
|
|
61
|
+
return "[object File]" === t.call(e);
|
|
191
62
|
},
|
|
192
63
|
isBlob: function(e) {
|
|
193
|
-
return "[object Blob]" ===
|
|
64
|
+
return "[object Blob]" === t.call(e);
|
|
194
65
|
},
|
|
195
66
|
isStream: function(e) {
|
|
196
|
-
return
|
|
197
|
-
return "[object Function]" ===
|
|
67
|
+
return i(e) && function(e) {
|
|
68
|
+
return "[object Function]" === t.call(e);
|
|
198
69
|
}(e.pipe);
|
|
199
70
|
},
|
|
200
71
|
isURLSearchParams: function(e) {
|
|
201
|
-
return "
|
|
72
|
+
return "[object URLSearchParams]" === t.call(e);
|
|
202
73
|
},
|
|
203
74
|
isStandardBrowserEnv: function() {
|
|
204
75
|
return ("undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document;
|
|
205
76
|
},
|
|
206
|
-
forEach:
|
|
77
|
+
forEach: s,
|
|
207
78
|
merge: function e() {
|
|
208
79
|
var t = {};
|
|
209
|
-
function
|
|
210
|
-
|
|
80
|
+
function r(r, o) {
|
|
81
|
+
a(t[o]) && a(r) ? t[o] = e(t[o], r) : a(r) ? t[o] = e({}, r) : n(r) ? t[o] = r.slice() : t[o] = r;
|
|
211
82
|
}
|
|
212
|
-
for (var
|
|
83
|
+
for (var o = 0, i = arguments.length; o < i; o++) s(arguments[o], r);
|
|
213
84
|
return t;
|
|
214
85
|
},
|
|
215
|
-
extend: function(
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
}),
|
|
86
|
+
extend: function(t, n, r) {
|
|
87
|
+
return s(n, function(n, o) {
|
|
88
|
+
t[o] = r && "function" == typeof n ? e(n, r) : n;
|
|
89
|
+
}), t;
|
|
219
90
|
},
|
|
220
91
|
trim: function(e) {
|
|
221
92
|
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
222
93
|
}
|
|
223
94
|
};
|
|
224
|
-
function
|
|
95
|
+
function c(e) {
|
|
225
96
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
226
97
|
}
|
|
227
|
-
var
|
|
98
|
+
var f = function(e, t, n) {
|
|
228
99
|
if (!t) return e;
|
|
229
100
|
var r;
|
|
230
|
-
if (n) r = n(t); else if (
|
|
101
|
+
if (n) r = n(t); else if (u.isURLSearchParams(t)) r = t.toString(); else {
|
|
231
102
|
var o = [];
|
|
232
|
-
|
|
233
|
-
null != e && (
|
|
234
|
-
|
|
103
|
+
u.forEach(t, function(e, t) {
|
|
104
|
+
null != e && (u.isArray(e) ? t += "[]" : e = [ e ], u.forEach(e, function(e) {
|
|
105
|
+
u.isDate(e) ? e = e.toISOString() : u.isObject(e) && (e = JSON.stringify(e)),
|
|
106
|
+
o.push(c(t) + "=" + c(e));
|
|
235
107
|
}));
|
|
236
108
|
}), r = o.join("&");
|
|
237
109
|
}
|
|
@@ -240,31 +112,31 @@
|
|
|
240
112
|
-1 !== i && (e = e.slice(0, i)), e += (-1 === e.indexOf("?") ? "?" : "&") + r;
|
|
241
113
|
}
|
|
242
114
|
return e;
|
|
243
|
-
},
|
|
244
|
-
function
|
|
115
|
+
}, l = {};
|
|
116
|
+
function p() {
|
|
245
117
|
this.handlers = [];
|
|
246
118
|
}
|
|
247
|
-
|
|
119
|
+
p.prototype.use = function(e, t, n) {
|
|
248
120
|
return this.handlers.push({
|
|
249
121
|
fulfilled: e,
|
|
250
122
|
rejected: t,
|
|
251
123
|
synchronous: !!n && n.synchronous,
|
|
252
124
|
runWhen: n ? n.runWhen : null
|
|
253
125
|
}), this.handlers.length - 1;
|
|
254
|
-
},
|
|
126
|
+
}, p.prototype.eject = function(e) {
|
|
255
127
|
this.handlers[e] && (this.handlers[e] = null);
|
|
256
|
-
},
|
|
257
|
-
|
|
128
|
+
}, p.prototype.forEach = function(e) {
|
|
129
|
+
u.forEach(this.handlers, function(t) {
|
|
258
130
|
null !== t && e(t);
|
|
259
131
|
});
|
|
260
|
-
},
|
|
261
|
-
var
|
|
262
|
-
|
|
132
|
+
}, l = p;
|
|
133
|
+
var d = function(e, t) {
|
|
134
|
+
u.forEach(e, function(n, r) {
|
|
263
135
|
r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r]);
|
|
264
136
|
});
|
|
265
|
-
},
|
|
266
|
-
return e.config = t, n && (e.code = n), e.request = r, e.response = o,
|
|
267
|
-
e.toJSON = function() {
|
|
137
|
+
}, h = function(e, t, n, r, o) {
|
|
138
|
+
return e.config = t, n && (e.code = n), e.request = r, e.response = o,
|
|
139
|
+
e.isAxiosError = !0, e.toJSON = function() {
|
|
268
140
|
return {
|
|
269
141
|
message: this.message,
|
|
270
142
|
name: this.name,
|
|
@@ -279,18 +151,19 @@
|
|
|
279
151
|
status: this.response && this.response.status ? this.response.status : null
|
|
280
152
|
};
|
|
281
153
|
}, e;
|
|
282
|
-
},
|
|
154
|
+
}, g = {
|
|
155
|
+
silentJSONParsing: !0,
|
|
156
|
+
forcedJSONParsing: !0,
|
|
157
|
+
clarifyTimeoutError: !1
|
|
158
|
+
}, m = function(e, t, n, r, o) {
|
|
283
159
|
var i = new Error(e);
|
|
284
|
-
return
|
|
285
|
-
},
|
|
286
|
-
var r = n.config.validateStatus;
|
|
287
|
-
n.status && r && !r(n.status) ? t(v("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
|
|
288
|
-
}, b = f.isStandardBrowserEnv() ? {
|
|
160
|
+
return h(i, t, n, r, o);
|
|
161
|
+
}, v = u.isStandardBrowserEnv() ? {
|
|
289
162
|
write: function(e, t, n, r, o, i) {
|
|
290
163
|
var a = [];
|
|
291
|
-
a.push(e + "=" + encodeURIComponent(t)),
|
|
292
|
-
|
|
293
|
-
document.cookie = a.join("; ");
|
|
164
|
+
a.push(e + "=" + encodeURIComponent(t)), u.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()),
|
|
165
|
+
u.isString(r) && a.push("path=" + r), u.isString(o) && a.push("domain=" + o),
|
|
166
|
+
!0 === i && a.push("secure"), document.cookie = a.join("; ");
|
|
294
167
|
},
|
|
295
168
|
read: function(e) {
|
|
296
169
|
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -305,20 +178,7 @@
|
|
|
305
178
|
return null;
|
|
306
179
|
},
|
|
307
180
|
remove: function() {}
|
|
308
|
-
},
|
|
309
|
-
return e && !/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t) ? function(e, t) {
|
|
310
|
-
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
311
|
-
}(e, t) : t;
|
|
312
|
-
}, S = [ "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" ], T = function(e) {
|
|
313
|
-
var t, n, r, o = {};
|
|
314
|
-
return e ? (f.forEach(e.split("\n"), function(e) {
|
|
315
|
-
if (r = e.indexOf(":"), t = f.trim(e.substr(0, r)).toLowerCase(), n = f.trim(e.substr(r + 1)),
|
|
316
|
-
t) {
|
|
317
|
-
if (o[t] && S.indexOf(t) >= 0) return;
|
|
318
|
-
o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([ n ]) : o[t] ? o[t] + ", " + n : n;
|
|
319
|
-
}
|
|
320
|
-
}), o) : o;
|
|
321
|
-
}, k = f.isStandardBrowserEnv() ? function() {
|
|
181
|
+
}, y = [ "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" ], b = u.isStandardBrowserEnv() ? function() {
|
|
322
182
|
var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
|
|
323
183
|
function r(e) {
|
|
324
184
|
var r = e;
|
|
@@ -335,142 +195,272 @@
|
|
|
335
195
|
};
|
|
336
196
|
}
|
|
337
197
|
return e = r(window.location.href), function(t) {
|
|
338
|
-
var n =
|
|
198
|
+
var n = u.isString(t) ? r(t) : t;
|
|
339
199
|
return n.protocol === e.protocol && n.host === e.host;
|
|
340
200
|
};
|
|
341
201
|
}() : function() {
|
|
342
202
|
return !0;
|
|
343
|
-
},
|
|
344
|
-
function
|
|
203
|
+
}, w = {};
|
|
204
|
+
function S(e) {
|
|
345
205
|
this.message = e;
|
|
346
206
|
}
|
|
347
|
-
|
|
207
|
+
S.prototype.toString = function() {
|
|
348
208
|
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
349
|
-
},
|
|
350
|
-
var
|
|
351
|
-
|
|
209
|
+
}, S.prototype.__CANCEL__ = !0, w = S;
|
|
210
|
+
var T, k, E, C = function(e) {
|
|
211
|
+
return new Promise(function(t, n) {
|
|
212
|
+
var r, o = e.data, i = e.headers, a = e.responseType;
|
|
213
|
+
function s() {
|
|
214
|
+
e.cancelToken && e.cancelToken.unsubscribe(r), e.signal && e.signal.removeEventListener("abort", r);
|
|
215
|
+
}
|
|
216
|
+
u.isFormData(o) && delete i["Content-Type"];
|
|
217
|
+
var c = new XMLHttpRequest();
|
|
218
|
+
if (e.auth) {
|
|
219
|
+
var l = e.auth.username || "", p = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
220
|
+
i.Authorization = "Basic " + btoa(l + ":" + p);
|
|
221
|
+
}
|
|
222
|
+
var d, h, S = (d = e.baseURL, h = e.url, d && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(h) ? function(e, t) {
|
|
223
|
+
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
224
|
+
}(d, h) : h);
|
|
225
|
+
function T() {
|
|
226
|
+
if (c) {
|
|
227
|
+
var r = "getAllResponseHeaders" in c ? (o = c.getAllResponseHeaders(),
|
|
228
|
+
p = {}, o ? (u.forEach(o.split("\n"), function(e) {
|
|
229
|
+
if (l = e.indexOf(":"), i = u.trim(e.substr(0, l)).toLowerCase(),
|
|
230
|
+
f = u.trim(e.substr(l + 1)), i) {
|
|
231
|
+
if (p[i] && y.indexOf(i) >= 0) return;
|
|
232
|
+
p[i] = "set-cookie" === i ? (p[i] ? p[i] : []).concat([ f ]) : p[i] ? p[i] + ", " + f : f;
|
|
233
|
+
}
|
|
234
|
+
}), p) : p) : null;
|
|
235
|
+
(function(e, t, n) {
|
|
236
|
+
var r = n.config.validateStatus;
|
|
237
|
+
n.status && r && !r(n.status) ? t(m("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
|
|
238
|
+
})(function(e) {
|
|
239
|
+
t(e), s();
|
|
240
|
+
}, function(e) {
|
|
241
|
+
n(e), s();
|
|
242
|
+
}, {
|
|
243
|
+
data: a && "text" !== a && "json" !== a ? c.response : c.responseText,
|
|
244
|
+
status: c.status,
|
|
245
|
+
statusText: c.statusText,
|
|
246
|
+
headers: r,
|
|
247
|
+
config: e,
|
|
248
|
+
request: c
|
|
249
|
+
}), c = null;
|
|
250
|
+
}
|
|
251
|
+
var o, i, f, l, p;
|
|
252
|
+
}
|
|
253
|
+
if (c.open(e.method.toUpperCase(), f(S, e.params, e.paramsSerializer), !0),
|
|
254
|
+
c.timeout = e.timeout, "onloadend" in c ? c.onloadend = T : c.onreadystatechange = function() {
|
|
255
|
+
c && 4 === c.readyState && (0 !== c.status || c.responseURL && 0 === c.responseURL.indexOf("file:")) && setTimeout(T);
|
|
256
|
+
}, c.onabort = function() {
|
|
257
|
+
c && (n(m("Request aborted", e, "ECONNABORTED", c)), c = null);
|
|
258
|
+
}, c.onerror = function() {
|
|
259
|
+
n(m("Network Error", e, null, c)), c = null;
|
|
260
|
+
}, c.ontimeout = function() {
|
|
261
|
+
var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", r = e.transitional || g;
|
|
262
|
+
e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(m(t, e, r.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
|
|
263
|
+
c = null;
|
|
264
|
+
}, u.isStandardBrowserEnv()) {
|
|
265
|
+
var k = (e.withCredentials || b(S)) && e.xsrfCookieName ? v.read(e.xsrfCookieName) : void 0;
|
|
266
|
+
k && (i[e.xsrfHeaderName] = k);
|
|
267
|
+
}
|
|
268
|
+
"setRequestHeader" in c && u.forEach(i, function(e, t) {
|
|
269
|
+
void 0 === o && "content-type" === t.toLowerCase() ? delete i[t] : c.setRequestHeader(t, e);
|
|
270
|
+
}), u.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
|
|
271
|
+
a && "json" !== a && (c.responseType = e.responseType), "function" == typeof e.onDownloadProgress && c.addEventListener("progress", e.onDownloadProgress),
|
|
272
|
+
"function" == typeof e.onUploadProgress && c.upload && c.upload.addEventListener("progress", e.onUploadProgress),
|
|
273
|
+
(e.cancelToken || e.signal) && (r = function(e) {
|
|
274
|
+
c && (n(!e || e && e.type ? new w("canceled") : e), c.abort(),
|
|
275
|
+
c = null);
|
|
276
|
+
}, e.cancelToken && e.cancelToken.subscribe(r), e.signal && (e.signal.aborted ? r() : e.signal.addEventListener("abort", r))),
|
|
277
|
+
o || (o = null), c.send(o);
|
|
278
|
+
});
|
|
279
|
+
}, j = T = {};
|
|
280
|
+
function O() {
|
|
352
281
|
throw new Error("setTimeout has not been defined");
|
|
353
282
|
}
|
|
354
|
-
function
|
|
283
|
+
function _() {
|
|
355
284
|
throw new Error("clearTimeout has not been defined");
|
|
356
285
|
}
|
|
357
|
-
function
|
|
358
|
-
if (
|
|
359
|
-
if ((
|
|
286
|
+
function x(e) {
|
|
287
|
+
if (k === setTimeout) return setTimeout(e, 0);
|
|
288
|
+
if ((k === O || !k) && setTimeout) return k = setTimeout, setTimeout(e, 0);
|
|
360
289
|
try {
|
|
361
|
-
return
|
|
290
|
+
return k(e, 0);
|
|
362
291
|
} catch (t) {
|
|
363
292
|
try {
|
|
364
|
-
return
|
|
293
|
+
return k.call(null, e, 0);
|
|
365
294
|
} catch (t) {
|
|
366
|
-
return
|
|
295
|
+
return k.call(this, e, 0);
|
|
367
296
|
}
|
|
368
297
|
}
|
|
369
298
|
}
|
|
370
299
|
!function() {
|
|
371
300
|
try {
|
|
372
|
-
|
|
301
|
+
k = "function" == typeof setTimeout ? setTimeout : O;
|
|
373
302
|
} catch (e) {
|
|
374
|
-
|
|
303
|
+
k = O;
|
|
375
304
|
}
|
|
376
305
|
try {
|
|
377
|
-
|
|
306
|
+
E = "function" == typeof clearTimeout ? clearTimeout : _;
|
|
378
307
|
} catch (e) {
|
|
379
|
-
|
|
308
|
+
E = _;
|
|
380
309
|
}
|
|
381
310
|
}();
|
|
382
|
-
var
|
|
383
|
-
function
|
|
384
|
-
|
|
311
|
+
var P, A = [], N = !1, R = -1;
|
|
312
|
+
function U() {
|
|
313
|
+
N && P && (N = !1, P.length ? A = P.concat(A) : R = -1, A.length && L());
|
|
385
314
|
}
|
|
386
|
-
function
|
|
387
|
-
if (!
|
|
388
|
-
var e =
|
|
389
|
-
|
|
390
|
-
for (var t =
|
|
391
|
-
for (
|
|
392
|
-
|
|
315
|
+
function L() {
|
|
316
|
+
if (!N) {
|
|
317
|
+
var e = x(U);
|
|
318
|
+
N = !0;
|
|
319
|
+
for (var t = A.length; t; ) {
|
|
320
|
+
for (P = A, A = []; ++R < t; ) P && P[R].run();
|
|
321
|
+
R = -1, t = A.length;
|
|
393
322
|
}
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
if ((
|
|
323
|
+
P = null, N = !1, function(e) {
|
|
324
|
+
if (E === clearTimeout) return clearTimeout(e);
|
|
325
|
+
if ((E === _ || !E) && clearTimeout) return E = clearTimeout,
|
|
326
|
+
clearTimeout(e);
|
|
397
327
|
try {
|
|
398
|
-
|
|
328
|
+
E(e);
|
|
399
329
|
} catch (t) {
|
|
400
330
|
try {
|
|
401
|
-
return
|
|
331
|
+
return E.call(null, e);
|
|
402
332
|
} catch (t) {
|
|
403
|
-
return
|
|
333
|
+
return E.call(this, e);
|
|
404
334
|
}
|
|
405
335
|
}
|
|
406
336
|
}(e);
|
|
407
337
|
}
|
|
408
338
|
}
|
|
409
|
-
function
|
|
339
|
+
function B(e, t) {
|
|
410
340
|
this.fun = e, this.array = t;
|
|
411
341
|
}
|
|
412
|
-
function
|
|
413
|
-
|
|
342
|
+
function q() {}
|
|
343
|
+
j.nextTick = function(e) {
|
|
414
344
|
var t = new Array(arguments.length - 1);
|
|
415
345
|
if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
416
|
-
|
|
417
|
-
},
|
|
346
|
+
A.push(new B(e, t)), 1 !== A.length || N || x(L);
|
|
347
|
+
}, B.prototype.run = function() {
|
|
418
348
|
this.fun.apply(null, this.array);
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
349
|
+
}, j.title = "browser", j.browser = !0, j.env = {}, j.argv = [], j.version = "",
|
|
350
|
+
j.versions = {}, j.on = q, j.addListener = q, j.once = q, j.off = q, j.removeListener = q,
|
|
351
|
+
j.removeAllListeners = q, j.emit = q, j.prependListener = q, j.prependOnceListener = q,
|
|
352
|
+
j.listeners = function(e) {
|
|
423
353
|
return [];
|
|
424
|
-
},
|
|
354
|
+
}, j.binding = function(e) {
|
|
425
355
|
throw new Error("process.binding is not supported");
|
|
426
|
-
},
|
|
356
|
+
}, j.cwd = function() {
|
|
427
357
|
return "/";
|
|
428
|
-
},
|
|
358
|
+
}, j.chdir = function(e) {
|
|
429
359
|
throw new Error("process.chdir is not supported");
|
|
430
|
-
},
|
|
360
|
+
}, j.umask = function() {
|
|
431
361
|
return 0;
|
|
432
362
|
};
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
-
|
|
363
|
+
var z = {};
|
|
364
|
+
(function(e) {
|
|
365
|
+
(function() {
|
|
366
|
+
"use strict";
|
|
367
|
+
var t = {
|
|
368
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
369
|
+
};
|
|
370
|
+
function n(e, t) {
|
|
371
|
+
!u.isUndefined(e) && u.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
|
|
372
|
+
}
|
|
373
|
+
var r, o = {
|
|
374
|
+
transitional: g,
|
|
375
|
+
adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== e && "[object process]" === Object.prototype.toString.call(e)) && (r = C),
|
|
376
|
+
r),
|
|
377
|
+
transformRequest: [ function(e, t) {
|
|
378
|
+
return d(t, "Accept"), d(t, "Content-Type"), u.isFormData(e) || u.isArrayBuffer(e) || u.isBuffer(e) || u.isStream(e) || u.isFile(e) || u.isBlob(e) ? e : u.isArrayBufferView(e) ? e.buffer : u.isURLSearchParams(e) ? (n(t, "application/x-www-form-urlencoded;charset=utf-8"),
|
|
379
|
+
e.toString()) : u.isObject(e) || t && "application/json" === t["Content-Type"] ? (n(t, "application/json"),
|
|
380
|
+
function(e, t, n) {
|
|
381
|
+
if (u.isString(e)) try {
|
|
382
|
+
return (0, JSON.parse)(e), u.trim(e);
|
|
383
|
+
} catch (r) {
|
|
384
|
+
if ("SyntaxError" !== r.name) throw r;
|
|
385
|
+
}
|
|
386
|
+
return (0, JSON.stringify)(e);
|
|
387
|
+
}(e)) : e;
|
|
388
|
+
} ],
|
|
389
|
+
transformResponse: [ function(e) {
|
|
390
|
+
var t = this.transitional || o.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing, i = !n && "json" === this.responseType;
|
|
391
|
+
if (i || r && u.isString(e) && e.length) try {
|
|
392
|
+
return JSON.parse(e);
|
|
393
|
+
} catch (a) {
|
|
394
|
+
if (i) {
|
|
395
|
+
if ("SyntaxError" === a.name) throw h(a, this, "E_JSON_PARSE");
|
|
396
|
+
throw a;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return e;
|
|
400
|
+
} ],
|
|
401
|
+
timeout: 0,
|
|
402
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
403
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
404
|
+
maxContentLength: -1,
|
|
405
|
+
maxBodyLength: -1,
|
|
406
|
+
validateStatus: function(e) {
|
|
407
|
+
return e >= 200 && e < 300;
|
|
408
|
+
},
|
|
409
|
+
headers: {
|
|
410
|
+
common: {
|
|
411
|
+
Accept: "application/json, text/plain, */*"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
u.forEach([ "delete", "get", "head" ], function(e) {
|
|
416
|
+
o.headers[e] = {};
|
|
417
|
+
}), u.forEach([ "post", "put", "patch" ], function(e) {
|
|
418
|
+
o.headers[e] = u.merge(t);
|
|
419
|
+
}), z = o;
|
|
420
|
+
}).call(this);
|
|
421
|
+
}).call(this, T);
|
|
422
|
+
var D = function(e, t, n) {
|
|
423
|
+
var r = this || z;
|
|
424
|
+
return u.forEach(n, function(n) {
|
|
436
425
|
e = n.call(r, e, t);
|
|
437
426
|
}), e;
|
|
438
|
-
},
|
|
427
|
+
}, J = function(e) {
|
|
439
428
|
return !(!e || !e.__CANCEL__);
|
|
440
|
-
}
|
|
441
|
-
function
|
|
442
|
-
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new
|
|
429
|
+
};
|
|
430
|
+
function F(e) {
|
|
431
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new w("canceled");
|
|
443
432
|
}
|
|
444
|
-
var
|
|
445
|
-
return
|
|
446
|
-
e.headers =
|
|
447
|
-
|
|
433
|
+
var I, V = function(e) {
|
|
434
|
+
return F(e), e.headers = e.headers || {}, e.data = D.call(e, e.data, e.headers, e.transformRequest),
|
|
435
|
+
e.headers = u.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers),
|
|
436
|
+
u.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(t) {
|
|
448
437
|
delete e.headers[t];
|
|
449
|
-
}), (e.adapter ||
|
|
450
|
-
return
|
|
438
|
+
}), (e.adapter || z.adapter)(e).then(function(t) {
|
|
439
|
+
return F(e), t.data = D.call(e, t.data, t.headers, e.transformResponse),
|
|
440
|
+
t;
|
|
451
441
|
}, function(t) {
|
|
452
|
-
return
|
|
442
|
+
return J(t) || (F(e), t && t.response && (t.response.data = D.call(e, t.response.data, t.response.headers, e.transformResponse))),
|
|
453
443
|
Promise.reject(t);
|
|
454
444
|
});
|
|
455
|
-
},
|
|
445
|
+
}, H = function(e, t) {
|
|
456
446
|
t = t || {};
|
|
457
447
|
var n = {};
|
|
458
448
|
function r(e, t) {
|
|
459
|
-
return
|
|
449
|
+
return u.isPlainObject(e) && u.isPlainObject(t) ? u.merge(e, t) : u.isPlainObject(t) ? u.merge({}, t) : u.isArray(t) ? t.slice() : t;
|
|
460
450
|
}
|
|
461
451
|
function o(n) {
|
|
462
|
-
return
|
|
452
|
+
return u.isUndefined(t[n]) ? u.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(e[n], t[n]);
|
|
463
453
|
}
|
|
464
454
|
function i(e) {
|
|
465
|
-
if (!
|
|
455
|
+
if (!u.isUndefined(t[e])) return r(void 0, t[e]);
|
|
466
456
|
}
|
|
467
457
|
function a(n) {
|
|
468
|
-
return
|
|
458
|
+
return u.isUndefined(t[n]) ? u.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(void 0, t[n]);
|
|
469
459
|
}
|
|
470
460
|
function s(n) {
|
|
471
461
|
return n in t ? r(e[n], t[n]) : n in e ? r(void 0, e[n]) : void 0;
|
|
472
462
|
}
|
|
473
|
-
var
|
|
463
|
+
var c = {
|
|
474
464
|
url: i,
|
|
475
465
|
method: i,
|
|
476
466
|
data: i,
|
|
@@ -498,28 +488,28 @@
|
|
|
498
488
|
responseEncoding: a,
|
|
499
489
|
validateStatus: s
|
|
500
490
|
};
|
|
501
|
-
return
|
|
502
|
-
var t =
|
|
503
|
-
|
|
491
|
+
return u.forEach(Object.keys(e).concat(Object.keys(t)), function(e) {
|
|
492
|
+
var t = c[e] || o, r = t(e);
|
|
493
|
+
u.isUndefined(r) && t !== s || (n[e] = r);
|
|
504
494
|
}), n;
|
|
505
|
-
},
|
|
495
|
+
}, M = "0.26.1", $ = M, G = {};
|
|
506
496
|
[ "object", "boolean", "number", "function", "string", "symbol" ].forEach(function(e, t) {
|
|
507
|
-
|
|
497
|
+
G[e] = function(n) {
|
|
508
498
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
509
499
|
};
|
|
510
500
|
});
|
|
511
|
-
var
|
|
512
|
-
|
|
501
|
+
var X = {};
|
|
502
|
+
G.transitional = function(e, t, n) {
|
|
513
503
|
function r(e, t) {
|
|
514
|
-
return "[Axios v" +
|
|
504
|
+
return "[Axios v" + $ + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
|
|
515
505
|
}
|
|
516
506
|
return function(n, o, i) {
|
|
517
507
|
if (!1 === e) throw new Error(r(o, " has been removed" + (t ? " in " + t : "")));
|
|
518
|
-
return t && !
|
|
508
|
+
return t && !X[o] && (X[o] = !0, console.warn(r(o, " has been deprecated since v" + t + " and will be removed in the near future"))),
|
|
519
509
|
!e || e(n, o, i);
|
|
520
510
|
};
|
|
521
511
|
};
|
|
522
|
-
var
|
|
512
|
+
var W = {}, K = (I = {
|
|
523
513
|
assertOptions: function(e, t, n) {
|
|
524
514
|
if ("object" != typeof e) throw new TypeError("options must be an object");
|
|
525
515
|
for (var r = Object.keys(e), o = r.length; o-- > 0; ) {
|
|
@@ -530,73 +520,72 @@
|
|
|
530
520
|
} else if (!0 !== n) throw Error("Unknown option " + i);
|
|
531
521
|
}
|
|
532
522
|
},
|
|
533
|
-
validators:
|
|
523
|
+
validators: G
|
|
534
524
|
}).validators;
|
|
535
|
-
function
|
|
525
|
+
function Y(e) {
|
|
536
526
|
this.defaults = e, this.interceptors = {
|
|
537
|
-
request: new
|
|
538
|
-
response: new
|
|
527
|
+
request: new l(),
|
|
528
|
+
response: new l()
|
|
539
529
|
};
|
|
540
530
|
}
|
|
541
|
-
|
|
542
|
-
"string" == typeof e ? (
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
clarifyTimeoutError: ee.transitional(ee.boolean)
|
|
531
|
+
Y.prototype.request = function(e, t) {
|
|
532
|
+
"string" == typeof e ? (t = t || {}).url = e : t = e || {}, (t = H(this.defaults, t)).method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
|
|
533
|
+
var n = t.transitional;
|
|
534
|
+
void 0 !== n && I.assertOptions(n, {
|
|
535
|
+
silentJSONParsing: K.transitional(K.boolean),
|
|
536
|
+
forcedJSONParsing: K.transitional(K.boolean),
|
|
537
|
+
clarifyTimeoutError: K.transitional(K.boolean)
|
|
549
538
|
}, !1);
|
|
550
|
-
var
|
|
551
|
-
this.interceptors.request.forEach(function(
|
|
552
|
-
"function" == typeof
|
|
553
|
-
|
|
539
|
+
var r = [], o = !0;
|
|
540
|
+
this.interceptors.request.forEach(function(e) {
|
|
541
|
+
"function" == typeof e.runWhen && !1 === e.runWhen(t) || (o = o && e.synchronous,
|
|
542
|
+
r.unshift(e.fulfilled, e.rejected));
|
|
554
543
|
});
|
|
555
|
-
var
|
|
544
|
+
var i, a = [];
|
|
556
545
|
if (this.interceptors.response.forEach(function(e) {
|
|
557
|
-
|
|
558
|
-
}), !
|
|
559
|
-
var
|
|
560
|
-
for (Array.prototype.unshift.apply(
|
|
561
|
-
return
|
|
546
|
+
a.push(e.fulfilled, e.rejected);
|
|
547
|
+
}), !o) {
|
|
548
|
+
var s = [ V, void 0 ];
|
|
549
|
+
for (Array.prototype.unshift.apply(s, r), s = s.concat(a), i = Promise.resolve(t); s.length; ) i = i.then(s.shift(), s.shift());
|
|
550
|
+
return i;
|
|
562
551
|
}
|
|
563
|
-
for (var
|
|
564
|
-
var
|
|
552
|
+
for (var u = t; r.length; ) {
|
|
553
|
+
var c = r.shift(), f = r.shift();
|
|
565
554
|
try {
|
|
566
|
-
|
|
567
|
-
} catch (
|
|
568
|
-
|
|
555
|
+
u = c(u);
|
|
556
|
+
} catch (l) {
|
|
557
|
+
f(l);
|
|
569
558
|
break;
|
|
570
559
|
}
|
|
571
560
|
}
|
|
572
561
|
try {
|
|
573
|
-
|
|
574
|
-
} catch (
|
|
575
|
-
return Promise.reject(
|
|
562
|
+
i = V(u);
|
|
563
|
+
} catch (l) {
|
|
564
|
+
return Promise.reject(l);
|
|
576
565
|
}
|
|
577
|
-
for (;
|
|
578
|
-
return
|
|
579
|
-
},
|
|
580
|
-
return e =
|
|
581
|
-
},
|
|
582
|
-
|
|
583
|
-
return this.request(
|
|
566
|
+
for (;a.length; ) i = i.then(a.shift(), a.shift());
|
|
567
|
+
return i;
|
|
568
|
+
}, Y.prototype.getUri = function(e) {
|
|
569
|
+
return e = H(this.defaults, e), f(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
|
|
570
|
+
}, u.forEach([ "delete", "get", "head", "options" ], function(e) {
|
|
571
|
+
Y.prototype[e] = function(t, n) {
|
|
572
|
+
return this.request(H(n || {}, {
|
|
584
573
|
method: e,
|
|
585
574
|
url: t,
|
|
586
575
|
data: (n || {}).data
|
|
587
576
|
}));
|
|
588
577
|
};
|
|
589
|
-
}),
|
|
590
|
-
|
|
591
|
-
return this.request(
|
|
578
|
+
}), u.forEach([ "post", "put", "patch" ], function(e) {
|
|
579
|
+
Y.prototype[e] = function(t, n, r) {
|
|
580
|
+
return this.request(H(r || {}, {
|
|
592
581
|
method: e,
|
|
593
582
|
url: t,
|
|
594
583
|
data: n
|
|
595
584
|
}));
|
|
596
585
|
};
|
|
597
|
-
}),
|
|
598
|
-
var
|
|
599
|
-
function
|
|
586
|
+
}), W = Y;
|
|
587
|
+
var Q;
|
|
588
|
+
function Z(e) {
|
|
600
589
|
if ("function" != typeof e) throw new TypeError("executor must be a function.");
|
|
601
590
|
var t;
|
|
602
591
|
this.promise = new Promise(function(e) {
|
|
@@ -617,81 +606,44 @@
|
|
|
617
606
|
n.unsubscribe(t);
|
|
618
607
|
}, r;
|
|
619
608
|
}, e(function(e) {
|
|
620
|
-
n.reason || (n.reason = new
|
|
609
|
+
n.reason || (n.reason = new w(e), t(n.reason));
|
|
621
610
|
});
|
|
622
611
|
}
|
|
623
|
-
|
|
612
|
+
Z.prototype.throwIfRequested = function() {
|
|
624
613
|
if (this.reason) throw this.reason;
|
|
625
|
-
},
|
|
614
|
+
}, Z.prototype.subscribe = function(e) {
|
|
626
615
|
this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [ e ];
|
|
627
|
-
},
|
|
616
|
+
}, Z.prototype.unsubscribe = function(e) {
|
|
628
617
|
if (this._listeners) {
|
|
629
618
|
var t = this._listeners.indexOf(e);
|
|
630
619
|
-1 !== t && this._listeners.splice(t, 1);
|
|
631
620
|
}
|
|
632
|
-
},
|
|
621
|
+
}, Z.source = function() {
|
|
633
622
|
var e;
|
|
634
623
|
return {
|
|
635
|
-
token: new
|
|
624
|
+
token: new Z(function(t) {
|
|
636
625
|
e = t;
|
|
637
626
|
}),
|
|
638
627
|
cancel: e
|
|
639
628
|
};
|
|
640
|
-
},
|
|
641
|
-
var
|
|
642
|
-
var
|
|
643
|
-
return
|
|
644
|
-
return
|
|
629
|
+
}, Q = Z;
|
|
630
|
+
var ee = {}, te = function t(n) {
|
|
631
|
+
var r = new W(n), o = e(W.prototype.request, r);
|
|
632
|
+
return u.extend(o, W.prototype, r), u.extend(o, r), o.create = function(e) {
|
|
633
|
+
return t(H(n, e));
|
|
645
634
|
}, o;
|
|
646
|
-
}(
|
|
647
|
-
|
|
648
|
-
|
|
635
|
+
}(z);
|
|
636
|
+
te.Axios = W, te.Cancel = w, te.CancelToken = Q, te.isCancel = J, te.VERSION = M,
|
|
637
|
+
te.all = function(e) {
|
|
649
638
|
return Promise.all(e);
|
|
650
|
-
},
|
|
639
|
+
}, te.spread = function(e) {
|
|
651
640
|
return function(t) {
|
|
652
641
|
return e.apply(null, t);
|
|
653
642
|
};
|
|
654
|
-
},
|
|
655
|
-
return
|
|
656
|
-
}, (
|
|
657
|
-
var
|
|
658
|
-
Array.isArray;
|
|
659
|
-
var se = function(e) {
|
|
660
|
-
switch (typeof e) {
|
|
661
|
-
case "string":
|
|
662
|
-
return e;
|
|
663
|
-
|
|
664
|
-
case "boolean":
|
|
665
|
-
return e ? "true" : "false";
|
|
666
|
-
|
|
667
|
-
case "number":
|
|
668
|
-
return isFinite(e) ? e : "";
|
|
669
|
-
|
|
670
|
-
default:
|
|
671
|
-
return "";
|
|
672
|
-
}
|
|
673
|
-
}, ue = Array.isArray || function(e) {
|
|
674
|
-
return "[object Array]" === Object.prototype.toString.call(e);
|
|
675
|
-
};
|
|
676
|
-
function ce(e, t) {
|
|
677
|
-
if (e.map) return e.map(t);
|
|
678
|
-
for (var n = [], r = 0; r < e.length; r++) n.push(t(e[r], r));
|
|
679
|
-
return n;
|
|
680
|
-
}
|
|
681
|
-
var fe = Object.keys || function(e) {
|
|
682
|
-
var t = [];
|
|
683
|
-
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
|
|
684
|
-
return t;
|
|
685
|
-
}, le = {
|
|
686
|
-
stringify: function(e, t, n, r) {
|
|
687
|
-
return t = t || "&", n = n || "=", null === e && (e = void 0), "object" == typeof e ? ce(fe(e), function(r) {
|
|
688
|
-
var o = encodeURIComponent(se(r)) + n;
|
|
689
|
-
return ue(e[r]) ? ce(e[r], function(e) {
|
|
690
|
-
return o + encodeURIComponent(se(e));
|
|
691
|
-
}).join(t) : o + encodeURIComponent(se(e[r]));
|
|
692
|
-
}).join(t) : r ? encodeURIComponent(se(r)) + n + encodeURIComponent(se(e)) : "";
|
|
693
|
-
}
|
|
694
|
-
}, pe = {}, de = {};
|
|
643
|
+
}, te.isAxiosError = function(e) {
|
|
644
|
+
return u.isObject(e) && !0 === e.isAxiosError;
|
|
645
|
+
}, (ee = te).default = te;
|
|
646
|
+
var ne = ee, re = {}, oe = {};
|
|
695
647
|
return function(e) {
|
|
696
648
|
(function() {
|
|
697
649
|
"use strict";
|
|
@@ -744,7 +696,8 @@
|
|
|
744
696
|
if (e) {
|
|
745
697
|
if ("string" == typeof e) return r(e, t);
|
|
746
698
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
747
|
-
return "Object" === n && e.constructor && (n = e.constructor.name),
|
|
699
|
+
return "Object" === n && e.constructor && (n = e.constructor.name),
|
|
700
|
+
"Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? r(e, t) : void 0;
|
|
748
701
|
}
|
|
749
702
|
}
|
|
750
703
|
function r(e, t) {
|
|
@@ -765,8 +718,8 @@
|
|
|
765
718
|
function a(e, t) {
|
|
766
719
|
for (var n = 0; n < t.length; n++) {
|
|
767
720
|
var r = t[n];
|
|
768
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0,
|
|
769
|
-
Object.defineProperty(e, r.key, r);
|
|
721
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0,
|
|
722
|
+
"value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
770
723
|
}
|
|
771
724
|
}
|
|
772
725
|
function s(e, t, n) {
|
|
@@ -774,10 +727,10 @@
|
|
|
774
727
|
writable: !1
|
|
775
728
|
}), e;
|
|
776
729
|
}
|
|
777
|
-
Object.defineProperty(
|
|
730
|
+
Object.defineProperty(oe, "__esModule", {
|
|
778
731
|
value: !0
|
|
779
|
-
}),
|
|
780
|
-
|
|
732
|
+
}), oe.varsnap = oe.clientName = oe.version = void 0;
|
|
733
|
+
oe.version = "1.8.3", oe.clientName = "javascript." + oe.version;
|
|
781
734
|
var u = {
|
|
782
735
|
varsnap: !0,
|
|
783
736
|
env: "development",
|
|
@@ -799,8 +752,8 @@
|
|
|
799
752
|
}, {
|
|
800
753
|
key: "setConfig",
|
|
801
754
|
value: function(e, t, n) {
|
|
802
|
-
return "varsnap" === t && ("string" == typeof n && (n = "true" === n),
|
|
803
|
-
"env" !== t && "producerToken" !== t && "consumerToken" !== t && "branch" !== t || (e[t] = n),
|
|
755
|
+
return "varsnap" === t && ("string" == typeof n && (n = "true" === n),
|
|
756
|
+
e[t] = n), "env" !== t && "producerToken" !== t && "consumerToken" !== t && "branch" !== t || (e[t] = n),
|
|
804
757
|
"logger" === t && (e[t] = n), e;
|
|
805
758
|
}
|
|
806
759
|
}, {
|
|
@@ -808,7 +761,7 @@
|
|
|
808
761
|
value: function(e, t) {
|
|
809
762
|
var n = "";
|
|
810
763
|
return n = "" !== t && void 0 !== t ? t : (n = (n = e.toString().split("{")[0]).replace(/^\s+|\s+$/g, "")).replace(/,\s+/g, ","),
|
|
811
|
-
"javascript." +
|
|
764
|
+
"javascript." + oe.version + "." + n;
|
|
812
765
|
}
|
|
813
766
|
}, {
|
|
814
767
|
key: "ajax",
|
|
@@ -819,12 +772,14 @@
|
|
|
819
772
|
headers: {
|
|
820
773
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
821
774
|
},
|
|
822
|
-
data:
|
|
775
|
+
data: new URLSearchParams(n).toString(),
|
|
823
776
|
responseType: "json"
|
|
824
777
|
};
|
|
825
|
-
return t.isNode() && r.headers && (r.headers["User-Agent"] = "varsnap.js"),
|
|
826
|
-
|
|
778
|
+
return t.isNode() && r.headers && (r.headers["User-Agent"] = "varsnap.js"),
|
|
779
|
+
(0, ne.default)(r).then(function(e) {
|
|
827
780
|
return e.data;
|
|
781
|
+
}).catch(function(e) {
|
|
782
|
+
return e;
|
|
828
783
|
});
|
|
829
784
|
}
|
|
830
785
|
}, {
|
|
@@ -880,7 +835,7 @@
|
|
|
880
835
|
return n ? new Promise(function(e) {
|
|
881
836
|
return e(n);
|
|
882
837
|
}) : t.isNode() ? new Promise(function(e) {
|
|
883
|
-
(0,
|
|
838
|
+
(0, re.exec)("git rev-parse --abbrev-ref HEAD", function(t, n) {
|
|
884
839
|
return e(n.trim());
|
|
885
840
|
});
|
|
886
841
|
}) : new Promise(function(e) {
|
|
@@ -901,7 +856,8 @@
|
|
|
901
856
|
key: "produce",
|
|
902
857
|
value: function(t, n) {
|
|
903
858
|
var r = this;
|
|
904
|
-
return this.isEnabled() ? (l.debug(this.config, "Sending call to Varsnap"),
|
|
859
|
+
return this.isEnabled() ? (l.debug(this.config, "Sending call to Varsnap"),
|
|
860
|
+
Promise.resolve(n).then(function(n) {
|
|
905
861
|
var o = {
|
|
906
862
|
producer_token: l.getConfig(r.config, "producerToken"),
|
|
907
863
|
signature: r.signature,
|
|
@@ -947,7 +903,8 @@
|
|
|
947
903
|
value: function(o) {
|
|
948
904
|
var i = this;
|
|
949
905
|
if (!this.isEnabled()) return new Promise(function(e) {
|
|
950
|
-
return l.error(i.config, "Varsnap not enabled for testing"),
|
|
906
|
+
return l.error(i.config, "Varsnap not enabled for testing"),
|
|
907
|
+
e(!1);
|
|
951
908
|
});
|
|
952
909
|
var a = {
|
|
953
910
|
consumer_token: l.getConfig(this.config, "consumerToken"),
|
|
@@ -956,7 +913,8 @@
|
|
|
956
913
|
return l.ajax("https://www.varsnap.com/api/snap/consume/", a).then(function(s) {
|
|
957
914
|
var u = s;
|
|
958
915
|
if (!u || "ok" !== u.status) return [ new Promise(function(e) {
|
|
959
|
-
return l.error(i.config, "Received error from Varsnap: " + u.status),
|
|
916
|
+
return l.error(i.config, "Received error from Varsnap: " + u.status),
|
|
917
|
+
e(!1);
|
|
960
918
|
}) ];
|
|
961
919
|
0 === u.results.length && l.log(i.config, "No snaps found for signature: " + a.signature);
|
|
962
920
|
var c, f = [], d = t(u.results);
|
|
@@ -996,7 +954,8 @@
|
|
|
996
954
|
});
|
|
997
955
|
});
|
|
998
956
|
}).catch(function(e) {
|
|
999
|
-
return l.error(i.config, "Cannot contact Varsnap: " + e),
|
|
957
|
+
return l.error(i.config, "Cannot contact Varsnap: " + e),
|
|
958
|
+
!1;
|
|
1000
959
|
});
|
|
1001
960
|
}
|
|
1002
961
|
}, {
|
|
@@ -1007,7 +966,7 @@
|
|
|
1007
966
|
consumer_token: l.getConfig(this.config, "consumerToken"),
|
|
1008
967
|
snap_id: t.id,
|
|
1009
968
|
test_outputs: p.serialize(r),
|
|
1010
|
-
matches: o,
|
|
969
|
+
matches: o.toString(),
|
|
1011
970
|
snap_outputs_formatted: p.serialize_formatted(n),
|
|
1012
971
|
test_outputs_formatted: p.serialize_formatted(r)
|
|
1013
972
|
};
|
|
@@ -1015,15 +974,18 @@
|
|
|
1015
974
|
var t = e;
|
|
1016
975
|
return !(!t || "ok" !== t.status) && t.trial_url;
|
|
1017
976
|
}).catch(function(e) {
|
|
1018
|
-
return l.error(i.config, "Cannot upload test results to Varsnap: " + e),
|
|
977
|
+
return l.error(i.config, "Cannot upload test results to Varsnap: " + e),
|
|
978
|
+
!1;
|
|
1019
979
|
});
|
|
1020
980
|
}
|
|
1021
981
|
}, {
|
|
1022
982
|
key: "reportLog",
|
|
1023
983
|
value: function(e, t, n, r, o, i) {
|
|
1024
984
|
l.log(this.config, ""), l.log(this.config, "Testing with Varsnap uuid: " + e),
|
|
1025
|
-
l.log(this.config, "Signature: " + this.signature),
|
|
1026
|
-
l.log(this.config, "
|
|
985
|
+
l.log(this.config, "Signature: " + this.signature),
|
|
986
|
+
l.log(this.config, "Function input args: " + l.limitString(t)),
|
|
987
|
+
l.log(this.config, "Production function outputs: " + l.limitString(n)),
|
|
988
|
+
l.log(this.config, "Your function outputs: " + l.limitString(r)),
|
|
1027
989
|
l.log(this.config, "Matching outputs: " + o);
|
|
1028
990
|
var a = "Cannot upload trial";
|
|
1029
991
|
i && (a = String(i)), l.log(this.config, "Trial URL: " + a);
|
|
@@ -1051,15 +1013,17 @@
|
|
|
1051
1013
|
}
|
|
1052
1014
|
return r.produce(o, t), t;
|
|
1053
1015
|
};
|
|
1054
|
-
return i.producer = r, i.consumer = o, i.signature = n, c.push(r),
|
|
1016
|
+
return i.producer = r, i.consumer = o, i.signature = n, c.push(r),
|
|
1017
|
+
f.push(o), i;
|
|
1055
1018
|
}
|
|
1056
1019
|
function g() {
|
|
1057
1020
|
var e, n = l.getConsumers();
|
|
1058
|
-
return 0 === n.length ? Promise.resolve(!0) : (e = n[0].config,
|
|
1021
|
+
return 0 === n.length ? Promise.resolve(!0) : (e = n[0].config,
|
|
1022
|
+
l.getBranch(e).then(function(t) {
|
|
1059
1023
|
return {
|
|
1060
1024
|
branch: t,
|
|
1061
1025
|
consumer_token: l.getConfig(e, "consumerToken"),
|
|
1062
|
-
client:
|
|
1026
|
+
client: oe.clientName
|
|
1063
1027
|
};
|
|
1064
1028
|
}).then(function(e) {
|
|
1065
1029
|
var t = e;
|
|
@@ -1094,7 +1058,7 @@
|
|
|
1094
1058
|
});
|
|
1095
1059
|
});
|
|
1096
1060
|
}
|
|
1097
|
-
|
|
1061
|
+
oe.varsnap = h, h._config = u, h.updateConfig = function(e) {
|
|
1098
1062
|
for (var t = h._config, n = 0, r = Object.keys(h._config); n < r.length; n++) {
|
|
1099
1063
|
var o = r[n];
|
|
1100
1064
|
Object.prototype.hasOwnProperty.call(e, o) && (t = l.setConfig(t, o, e[o]));
|
|
@@ -1102,8 +1066,8 @@
|
|
|
1102
1066
|
h._config = t;
|
|
1103
1067
|
}, h.reset = function() {
|
|
1104
1068
|
l.resetConsumers(), l.resetProducers();
|
|
1105
|
-
}, h.version =
|
|
1069
|
+
}, h.version = oe.version, h.runTests = g;
|
|
1106
1070
|
}).call(this);
|
|
1107
|
-
}.call(this,
|
|
1071
|
+
}.call(this, T), oe.varsnap;
|
|
1108
1072
|
});
|
|
1109
1073
|
})(typeof Varsnap == "undefined" ? Varsnap = {} : Varsnap);
|