@xy-planning-network/trees 0.4.7 → 0.4.8
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/trees.es.js +619 -405
- package/dist/trees.umd.js +7 -7
- package/package.json +2 -2
- package/types/api/base.d.ts +19 -7
- package/types/composables/index.d.ts +4 -0
- package/types/composables/useBaseAPI.d.ts +105 -0
- package/types/entry.d.ts +3 -0
- package/types/helpers/Debounce.d.ts +1 -0
package/dist/trees.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { cloneVNode, h, inject, provide, watchEffect, defineComponent, ref, onUnmounted, Teleport, reactive, onUpdated, computed, onMounted, nextTick, watch, openBlock, createBlock, createVNode, unref, withCtx, Transition, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, renderSlot, resolveDynamicComponent, mergeProps, createTextVNode, normalizeProps, useAttrs, withModifiers, TransitionGroup, withDirectives, vShow, normalizeStyle, getCurrentInstance, vModelText, resolveComponent, Comment as Comment$1, Text, useSlots } from "vue";
|
|
20
|
+
import { cloneVNode, h, inject, provide, watchEffect, defineComponent, ref, onUnmounted, Teleport, reactive, onUpdated, computed, onMounted, nextTick, watch, openBlock, createBlock, createVNode, unref, withCtx, Transition, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, renderSlot, resolveDynamicComponent, mergeProps, createTextVNode, normalizeProps, useAttrs, withModifiers, TransitionGroup, withDirectives, vShow, normalizeStyle, getCurrentInstance, vModelText, resolveComponent, Comment as Comment$1, Text, useSlots, shallowRef } from "vue";
|
|
21
21
|
var axios$2 = { exports: {} };
|
|
22
22
|
var bind$2 = function bind(fn, thisArg) {
|
|
23
23
|
return function wrap() {
|
|
@@ -30,8 +30,20 @@ var bind$2 = function bind(fn, thisArg) {
|
|
|
30
30
|
};
|
|
31
31
|
var bind$1 = bind$2;
|
|
32
32
|
var toString = Object.prototype.toString;
|
|
33
|
+
var kindOf = function(cache) {
|
|
34
|
+
return function(thing) {
|
|
35
|
+
var str = toString.call(thing);
|
|
36
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
37
|
+
};
|
|
38
|
+
}(Object.create(null));
|
|
39
|
+
function kindOfTest(type) {
|
|
40
|
+
type = type.toLowerCase();
|
|
41
|
+
return function isKindOf(thing) {
|
|
42
|
+
return kindOf(thing) === type;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
33
45
|
function isArray(val) {
|
|
34
|
-
return
|
|
46
|
+
return Array.isArray(val);
|
|
35
47
|
}
|
|
36
48
|
function isUndefined(val) {
|
|
37
49
|
return typeof val === "undefined";
|
|
@@ -39,18 +51,13 @@ function isUndefined(val) {
|
|
|
39
51
|
function isBuffer(val) {
|
|
40
52
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
return toString.call(val) === "[object ArrayBuffer]";
|
|
44
|
-
}
|
|
45
|
-
function isFormData(val) {
|
|
46
|
-
return typeof FormData !== "undefined" && val instanceof FormData;
|
|
47
|
-
}
|
|
54
|
+
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
48
55
|
function isArrayBufferView(val) {
|
|
49
56
|
var result;
|
|
50
57
|
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
51
58
|
result = ArrayBuffer.isView(val);
|
|
52
59
|
} else {
|
|
53
|
-
result = val && val.buffer && val.buffer
|
|
60
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
54
61
|
}
|
|
55
62
|
return result;
|
|
56
63
|
}
|
|
@@ -64,30 +71,27 @@ function isObject(val) {
|
|
|
64
71
|
return val !== null && typeof val === "object";
|
|
65
72
|
}
|
|
66
73
|
function isPlainObject(val) {
|
|
67
|
-
if (
|
|
74
|
+
if (kindOf(val) !== "object") {
|
|
68
75
|
return false;
|
|
69
76
|
}
|
|
70
|
-
var
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
function isDate(val) {
|
|
74
|
-
return toString.call(val) === "[object Date]";
|
|
75
|
-
}
|
|
76
|
-
function isFile(val) {
|
|
77
|
-
return toString.call(val) === "[object File]";
|
|
78
|
-
}
|
|
79
|
-
function isBlob(val) {
|
|
80
|
-
return toString.call(val) === "[object Blob]";
|
|
77
|
+
var prototype2 = Object.getPrototypeOf(val);
|
|
78
|
+
return prototype2 === null || prototype2 === Object.prototype;
|
|
81
79
|
}
|
|
80
|
+
var isDate = kindOfTest("Date");
|
|
81
|
+
var isFile = kindOfTest("File");
|
|
82
|
+
var isBlob = kindOfTest("Blob");
|
|
83
|
+
var isFileList = kindOfTest("FileList");
|
|
82
84
|
function isFunction(val) {
|
|
83
85
|
return toString.call(val) === "[object Function]";
|
|
84
86
|
}
|
|
85
87
|
function isStream(val) {
|
|
86
88
|
return isObject(val) && isFunction(val.pipe);
|
|
87
89
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
+
function isFormData(thing) {
|
|
91
|
+
var pattern = "[object FormData]";
|
|
92
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
|
|
90
93
|
}
|
|
94
|
+
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
91
95
|
function trim(str) {
|
|
92
96
|
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
93
97
|
}
|
|
@@ -150,7 +154,58 @@ function stripBOM(content) {
|
|
|
150
154
|
}
|
|
151
155
|
return content;
|
|
152
156
|
}
|
|
153
|
-
|
|
157
|
+
function inherits(constructor, superConstructor, props, descriptors2) {
|
|
158
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
159
|
+
constructor.prototype.constructor = constructor;
|
|
160
|
+
props && Object.assign(constructor.prototype, props);
|
|
161
|
+
}
|
|
162
|
+
function toFlatObject(sourceObj, destObj, filter) {
|
|
163
|
+
var props;
|
|
164
|
+
var i;
|
|
165
|
+
var prop;
|
|
166
|
+
var merged = {};
|
|
167
|
+
destObj = destObj || {};
|
|
168
|
+
do {
|
|
169
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
170
|
+
i = props.length;
|
|
171
|
+
while (i-- > 0) {
|
|
172
|
+
prop = props[i];
|
|
173
|
+
if (!merged[prop]) {
|
|
174
|
+
destObj[prop] = sourceObj[prop];
|
|
175
|
+
merged[prop] = true;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
179
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
180
|
+
return destObj;
|
|
181
|
+
}
|
|
182
|
+
function endsWith(str, searchString, position) {
|
|
183
|
+
str = String(str);
|
|
184
|
+
if (position === void 0 || position > str.length) {
|
|
185
|
+
position = str.length;
|
|
186
|
+
}
|
|
187
|
+
position -= searchString.length;
|
|
188
|
+
var lastIndex = str.indexOf(searchString, position);
|
|
189
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
190
|
+
}
|
|
191
|
+
function toArray(thing) {
|
|
192
|
+
if (!thing)
|
|
193
|
+
return null;
|
|
194
|
+
var i = thing.length;
|
|
195
|
+
if (isUndefined(i))
|
|
196
|
+
return null;
|
|
197
|
+
var arr = new Array(i);
|
|
198
|
+
while (i-- > 0) {
|
|
199
|
+
arr[i] = thing[i];
|
|
200
|
+
}
|
|
201
|
+
return arr;
|
|
202
|
+
}
|
|
203
|
+
var isTypedArray = function(TypedArray) {
|
|
204
|
+
return function(thing) {
|
|
205
|
+
return TypedArray && thing instanceof TypedArray;
|
|
206
|
+
};
|
|
207
|
+
}(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
|
|
208
|
+
var utils$h = {
|
|
154
209
|
isArray,
|
|
155
210
|
isArrayBuffer,
|
|
156
211
|
isBuffer,
|
|
@@ -172,9 +227,17 @@ var utils$d = {
|
|
|
172
227
|
merge,
|
|
173
228
|
extend,
|
|
174
229
|
trim,
|
|
175
|
-
stripBOM
|
|
230
|
+
stripBOM,
|
|
231
|
+
inherits,
|
|
232
|
+
toFlatObject,
|
|
233
|
+
kindOf,
|
|
234
|
+
kindOfTest,
|
|
235
|
+
endsWith,
|
|
236
|
+
toArray,
|
|
237
|
+
isTypedArray,
|
|
238
|
+
isFileList
|
|
176
239
|
};
|
|
177
|
-
var utils$
|
|
240
|
+
var utils$g = utils$h;
|
|
178
241
|
function encode(val) {
|
|
179
242
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
180
243
|
}
|
|
@@ -185,23 +248,23 @@ var buildURL$2 = function buildURL(url, params, paramsSerializer) {
|
|
|
185
248
|
var serializedParams;
|
|
186
249
|
if (paramsSerializer) {
|
|
187
250
|
serializedParams = paramsSerializer(params);
|
|
188
|
-
} else if (utils$
|
|
251
|
+
} else if (utils$g.isURLSearchParams(params)) {
|
|
189
252
|
serializedParams = params.toString();
|
|
190
253
|
} else {
|
|
191
254
|
var parts = [];
|
|
192
|
-
utils$
|
|
255
|
+
utils$g.forEach(params, function serialize(val, key) {
|
|
193
256
|
if (val === null || typeof val === "undefined") {
|
|
194
257
|
return;
|
|
195
258
|
}
|
|
196
|
-
if (utils$
|
|
259
|
+
if (utils$g.isArray(val)) {
|
|
197
260
|
key = key + "[]";
|
|
198
261
|
} else {
|
|
199
262
|
val = [val];
|
|
200
263
|
}
|
|
201
|
-
utils$
|
|
202
|
-
if (utils$
|
|
264
|
+
utils$g.forEach(val, function parseValue(v) {
|
|
265
|
+
if (utils$g.isDate(v)) {
|
|
203
266
|
v = v.toISOString();
|
|
204
|
-
} else if (utils$
|
|
267
|
+
} else if (utils$g.isObject(v)) {
|
|
205
268
|
v = JSON.stringify(v);
|
|
206
269
|
}
|
|
207
270
|
parts.push(encode(key) + "=" + encode(v));
|
|
@@ -218,7 +281,7 @@ var buildURL$2 = function buildURL(url, params, paramsSerializer) {
|
|
|
218
281
|
}
|
|
219
282
|
return url;
|
|
220
283
|
};
|
|
221
|
-
var utils$
|
|
284
|
+
var utils$f = utils$h;
|
|
222
285
|
function InterceptorManager$1() {
|
|
223
286
|
this.handlers = [];
|
|
224
287
|
}
|
|
@@ -237,31 +300,34 @@ InterceptorManager$1.prototype.eject = function eject(id2) {
|
|
|
237
300
|
}
|
|
238
301
|
};
|
|
239
302
|
InterceptorManager$1.prototype.forEach = function forEach2(fn) {
|
|
240
|
-
utils$
|
|
303
|
+
utils$f.forEach(this.handlers, function forEachHandler(h2) {
|
|
241
304
|
if (h2 !== null) {
|
|
242
305
|
fn(h2);
|
|
243
306
|
}
|
|
244
307
|
});
|
|
245
308
|
};
|
|
246
309
|
var InterceptorManager_1 = InterceptorManager$1;
|
|
247
|
-
var utils$
|
|
310
|
+
var utils$e = utils$h;
|
|
248
311
|
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
249
|
-
utils$
|
|
250
|
-
if (
|
|
312
|
+
utils$e.forEach(headers, function processHeader(value, name) {
|
|
313
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
251
314
|
headers[normalizedName] = value;
|
|
252
|
-
delete headers[
|
|
315
|
+
delete headers[name];
|
|
253
316
|
}
|
|
254
317
|
});
|
|
255
318
|
};
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
319
|
+
var utils$d = utils$h;
|
|
320
|
+
function AxiosError$5(message, code, config, request2, response) {
|
|
321
|
+
Error.call(this);
|
|
322
|
+
this.message = message;
|
|
323
|
+
this.name = "AxiosError";
|
|
324
|
+
code && (this.code = code);
|
|
325
|
+
config && (this.config = config);
|
|
326
|
+
request2 && (this.request = request2);
|
|
327
|
+
response && (this.response = response);
|
|
328
|
+
}
|
|
329
|
+
utils$d.inherits(AxiosError$5, Error, {
|
|
330
|
+
toJSON: function toJSON() {
|
|
265
331
|
return {
|
|
266
332
|
message: this.message,
|
|
267
333
|
name: this.name,
|
|
@@ -272,38 +338,114 @@ var enhanceError$2 = function enhanceError(error, config, code, request2, respon
|
|
|
272
338
|
columnNumber: this.columnNumber,
|
|
273
339
|
stack: this.stack,
|
|
274
340
|
config: this.config,
|
|
275
|
-
code: this.code
|
|
341
|
+
code: this.code,
|
|
342
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
276
343
|
};
|
|
277
|
-
}
|
|
278
|
-
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
var prototype = AxiosError$5.prototype;
|
|
347
|
+
var descriptors = {};
|
|
348
|
+
[
|
|
349
|
+
"ERR_BAD_OPTION_VALUE",
|
|
350
|
+
"ERR_BAD_OPTION",
|
|
351
|
+
"ECONNABORTED",
|
|
352
|
+
"ETIMEDOUT",
|
|
353
|
+
"ERR_NETWORK",
|
|
354
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
355
|
+
"ERR_DEPRECATED",
|
|
356
|
+
"ERR_BAD_RESPONSE",
|
|
357
|
+
"ERR_BAD_REQUEST",
|
|
358
|
+
"ERR_CANCELED"
|
|
359
|
+
].forEach(function(code) {
|
|
360
|
+
descriptors[code] = { value: code };
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperties(AxiosError$5, descriptors);
|
|
363
|
+
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
364
|
+
AxiosError$5.from = function(error, code, config, request2, response, customProps) {
|
|
365
|
+
var axiosError = Object.create(prototype);
|
|
366
|
+
utils$d.toFlatObject(error, axiosError, function filter(obj) {
|
|
367
|
+
return obj !== Error.prototype;
|
|
368
|
+
});
|
|
369
|
+
AxiosError$5.call(axiosError, error.message, code, config, request2, response);
|
|
370
|
+
axiosError.name = error.name;
|
|
371
|
+
customProps && Object.assign(axiosError, customProps);
|
|
372
|
+
return axiosError;
|
|
279
373
|
};
|
|
280
|
-
var
|
|
281
|
-
var
|
|
282
|
-
|
|
283
|
-
|
|
374
|
+
var AxiosError_1 = AxiosError$5;
|
|
375
|
+
var transitional = {
|
|
376
|
+
silentJSONParsing: true,
|
|
377
|
+
forcedJSONParsing: true,
|
|
378
|
+
clarifyTimeoutError: false
|
|
284
379
|
};
|
|
285
|
-
var
|
|
380
|
+
var utils$c = utils$h;
|
|
381
|
+
function toFormData$1(obj, formData) {
|
|
382
|
+
formData = formData || new FormData();
|
|
383
|
+
var stack = [];
|
|
384
|
+
function convertValue(value) {
|
|
385
|
+
if (value === null)
|
|
386
|
+
return "";
|
|
387
|
+
if (utils$c.isDate(value)) {
|
|
388
|
+
return value.toISOString();
|
|
389
|
+
}
|
|
390
|
+
if (utils$c.isArrayBuffer(value) || utils$c.isTypedArray(value)) {
|
|
391
|
+
return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
392
|
+
}
|
|
393
|
+
return value;
|
|
394
|
+
}
|
|
395
|
+
function build(data2, parentKey) {
|
|
396
|
+
if (utils$c.isPlainObject(data2) || utils$c.isArray(data2)) {
|
|
397
|
+
if (stack.indexOf(data2) !== -1) {
|
|
398
|
+
throw Error("Circular reference detected in " + parentKey);
|
|
399
|
+
}
|
|
400
|
+
stack.push(data2);
|
|
401
|
+
utils$c.forEach(data2, function each(value, key) {
|
|
402
|
+
if (utils$c.isUndefined(value))
|
|
403
|
+
return;
|
|
404
|
+
var fullKey = parentKey ? parentKey + "." + key : key;
|
|
405
|
+
var arr;
|
|
406
|
+
if (value && !parentKey && typeof value === "object") {
|
|
407
|
+
if (utils$c.endsWith(key, "{}")) {
|
|
408
|
+
value = JSON.stringify(value);
|
|
409
|
+
} else if (utils$c.endsWith(key, "[]") && (arr = utils$c.toArray(value))) {
|
|
410
|
+
arr.forEach(function(el) {
|
|
411
|
+
!utils$c.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
412
|
+
});
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
build(value, fullKey);
|
|
417
|
+
});
|
|
418
|
+
stack.pop();
|
|
419
|
+
} else {
|
|
420
|
+
formData.append(parentKey, convertValue(data2));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
build(obj);
|
|
424
|
+
return formData;
|
|
425
|
+
}
|
|
426
|
+
var toFormData_1 = toFormData$1;
|
|
427
|
+
var AxiosError$4 = AxiosError_1;
|
|
286
428
|
var settle$1 = function settle(resolve, reject, response) {
|
|
287
429
|
var validateStatus2 = response.config.validateStatus;
|
|
288
430
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
289
431
|
resolve(response);
|
|
290
432
|
} else {
|
|
291
|
-
reject(
|
|
433
|
+
reject(new AxiosError$4("Request failed with status code " + response.status, [AxiosError$4.ERR_BAD_REQUEST, AxiosError$4.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
292
434
|
}
|
|
293
435
|
};
|
|
294
|
-
var utils$
|
|
295
|
-
var cookies$1 = utils$
|
|
436
|
+
var utils$b = utils$h;
|
|
437
|
+
var cookies$1 = utils$b.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
296
438
|
return {
|
|
297
|
-
write: function write(
|
|
439
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
298
440
|
var cookie = [];
|
|
299
|
-
cookie.push(
|
|
300
|
-
if (utils$
|
|
441
|
+
cookie.push(name + "=" + encodeURIComponent(value));
|
|
442
|
+
if (utils$b.isNumber(expires)) {
|
|
301
443
|
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
302
444
|
}
|
|
303
|
-
if (utils$
|
|
445
|
+
if (utils$b.isString(path)) {
|
|
304
446
|
cookie.push("path=" + path);
|
|
305
447
|
}
|
|
306
|
-
if (utils$
|
|
448
|
+
if (utils$b.isString(domain)) {
|
|
307
449
|
cookie.push("domain=" + domain);
|
|
308
450
|
}
|
|
309
451
|
if (secure === true) {
|
|
@@ -311,12 +453,12 @@ var cookies$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
|
311
453
|
}
|
|
312
454
|
document.cookie = cookie.join("; ");
|
|
313
455
|
},
|
|
314
|
-
read: function read(
|
|
315
|
-
var match2 = document.cookie.match(new RegExp("(^|;\\s*)(" +
|
|
456
|
+
read: function read(name) {
|
|
457
|
+
var match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
316
458
|
return match2 ? decodeURIComponent(match2[3]) : null;
|
|
317
459
|
},
|
|
318
|
-
remove: function remove(
|
|
319
|
-
this.write(
|
|
460
|
+
remove: function remove(name) {
|
|
461
|
+
this.write(name, "", Date.now() - 864e5);
|
|
320
462
|
}
|
|
321
463
|
};
|
|
322
464
|
}() : function nonStandardBrowserEnv() {
|
|
@@ -331,20 +473,20 @@ var cookies$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
|
331
473
|
};
|
|
332
474
|
}();
|
|
333
475
|
var isAbsoluteURL$1 = function isAbsoluteURL(url) {
|
|
334
|
-
return /^([a-z][a-z\d
|
|
476
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
335
477
|
};
|
|
336
478
|
var combineURLs$1 = function combineURLs(baseURL, relativeURL) {
|
|
337
479
|
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
338
480
|
};
|
|
339
481
|
var isAbsoluteURL2 = isAbsoluteURL$1;
|
|
340
482
|
var combineURLs2 = combineURLs$1;
|
|
341
|
-
var buildFullPath$
|
|
483
|
+
var buildFullPath$2 = function buildFullPath(baseURL, requestedURL) {
|
|
342
484
|
if (baseURL && !isAbsoluteURL2(requestedURL)) {
|
|
343
485
|
return combineURLs2(baseURL, requestedURL);
|
|
344
486
|
}
|
|
345
487
|
return requestedURL;
|
|
346
488
|
};
|
|
347
|
-
var utils$
|
|
489
|
+
var utils$a = utils$h;
|
|
348
490
|
var ignoreDuplicateOf = [
|
|
349
491
|
"age",
|
|
350
492
|
"authorization",
|
|
@@ -372,10 +514,10 @@ var parseHeaders$1 = function parseHeaders(headers) {
|
|
|
372
514
|
if (!headers) {
|
|
373
515
|
return parsed;
|
|
374
516
|
}
|
|
375
|
-
utils$
|
|
517
|
+
utils$a.forEach(headers.split("\n"), function parser(line) {
|
|
376
518
|
i = line.indexOf(":");
|
|
377
|
-
key = utils$
|
|
378
|
-
val = utils$
|
|
519
|
+
key = utils$a.trim(line.substr(0, i)).toLowerCase();
|
|
520
|
+
val = utils$a.trim(line.substr(i + 1));
|
|
379
521
|
if (key) {
|
|
380
522
|
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
381
523
|
return;
|
|
@@ -389,8 +531,8 @@ var parseHeaders$1 = function parseHeaders(headers) {
|
|
|
389
531
|
});
|
|
390
532
|
return parsed;
|
|
391
533
|
};
|
|
392
|
-
var utils$
|
|
393
|
-
var isURLSameOrigin$1 = utils$
|
|
534
|
+
var utils$9 = utils$h;
|
|
535
|
+
var isURLSameOrigin$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv2() {
|
|
394
536
|
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
395
537
|
var urlParsingNode = document.createElement("a");
|
|
396
538
|
var originURL;
|
|
@@ -414,7 +556,7 @@ var isURLSameOrigin$1 = utils$7.isStandardBrowserEnv() ? function standardBrowse
|
|
|
414
556
|
}
|
|
415
557
|
originURL = resolveURL(window.location.href);
|
|
416
558
|
return function isURLSameOrigin2(requestURL) {
|
|
417
|
-
var parsed = utils$
|
|
559
|
+
var parsed = utils$9.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
418
560
|
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
419
561
|
};
|
|
420
562
|
}() : function nonStandardBrowserEnv2() {
|
|
@@ -422,20 +564,46 @@ var isURLSameOrigin$1 = utils$7.isStandardBrowserEnv() ? function standardBrowse
|
|
|
422
564
|
return true;
|
|
423
565
|
};
|
|
424
566
|
}();
|
|
425
|
-
var
|
|
567
|
+
var AxiosError$3 = AxiosError_1;
|
|
568
|
+
var utils$8 = utils$h;
|
|
569
|
+
function CanceledError$3(message) {
|
|
570
|
+
AxiosError$3.call(this, message == null ? "canceled" : message, AxiosError$3.ERR_CANCELED);
|
|
571
|
+
this.name = "CanceledError";
|
|
572
|
+
}
|
|
573
|
+
utils$8.inherits(CanceledError$3, AxiosError$3, {
|
|
574
|
+
__CANCEL__: true
|
|
575
|
+
});
|
|
576
|
+
var CanceledError_1 = CanceledError$3;
|
|
577
|
+
var parseProtocol$1 = function parseProtocol(url) {
|
|
578
|
+
var match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
579
|
+
return match2 && match2[1] || "";
|
|
580
|
+
};
|
|
581
|
+
var utils$7 = utils$h;
|
|
426
582
|
var settle2 = settle$1;
|
|
427
583
|
var cookies = cookies$1;
|
|
428
584
|
var buildURL$1 = buildURL$2;
|
|
429
|
-
var
|
|
585
|
+
var buildFullPath$1 = buildFullPath$2;
|
|
430
586
|
var parseHeaders2 = parseHeaders$1;
|
|
431
587
|
var isURLSameOrigin = isURLSameOrigin$1;
|
|
432
|
-
var
|
|
588
|
+
var transitionalDefaults$1 = transitional;
|
|
589
|
+
var AxiosError$2 = AxiosError_1;
|
|
590
|
+
var CanceledError$2 = CanceledError_1;
|
|
591
|
+
var parseProtocol2 = parseProtocol$1;
|
|
433
592
|
var xhr = function xhrAdapter(config) {
|
|
434
593
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
435
594
|
var requestData = config.data;
|
|
436
595
|
var requestHeaders = config.headers;
|
|
437
596
|
var responseType = config.responseType;
|
|
438
|
-
|
|
597
|
+
var onCanceled;
|
|
598
|
+
function done() {
|
|
599
|
+
if (config.cancelToken) {
|
|
600
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
601
|
+
}
|
|
602
|
+
if (config.signal) {
|
|
603
|
+
config.signal.removeEventListener("abort", onCanceled);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (utils$7.isFormData(requestData) && utils$7.isStandardBrowserEnv()) {
|
|
439
607
|
delete requestHeaders["Content-Type"];
|
|
440
608
|
}
|
|
441
609
|
var request2 = new XMLHttpRequest();
|
|
@@ -444,7 +612,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
444
612
|
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
445
613
|
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
446
614
|
}
|
|
447
|
-
var fullPath =
|
|
615
|
+
var fullPath = buildFullPath$1(config.baseURL, config.url);
|
|
448
616
|
request2.open(config.method.toUpperCase(), buildURL$1(fullPath, config.params, config.paramsSerializer), true);
|
|
449
617
|
request2.timeout = config.timeout;
|
|
450
618
|
function onloadend() {
|
|
@@ -461,7 +629,13 @@ var xhr = function xhrAdapter(config) {
|
|
|
461
629
|
config,
|
|
462
630
|
request: request2
|
|
463
631
|
};
|
|
464
|
-
settle2(
|
|
632
|
+
settle2(function _resolve(value) {
|
|
633
|
+
resolve(value);
|
|
634
|
+
done();
|
|
635
|
+
}, function _reject(err) {
|
|
636
|
+
reject(err);
|
|
637
|
+
done();
|
|
638
|
+
}, response);
|
|
465
639
|
request2 = null;
|
|
466
640
|
}
|
|
467
641
|
if ("onloadend" in request2) {
|
|
@@ -481,29 +655,30 @@ var xhr = function xhrAdapter(config) {
|
|
|
481
655
|
if (!request2) {
|
|
482
656
|
return;
|
|
483
657
|
}
|
|
484
|
-
reject(
|
|
658
|
+
reject(new AxiosError$2("Request aborted", AxiosError$2.ECONNABORTED, config, request2));
|
|
485
659
|
request2 = null;
|
|
486
660
|
};
|
|
487
661
|
request2.onerror = function handleError() {
|
|
488
|
-
reject(
|
|
662
|
+
reject(new AxiosError$2("Network Error", AxiosError$2.ERR_NETWORK, config, request2, request2));
|
|
489
663
|
request2 = null;
|
|
490
664
|
};
|
|
491
665
|
request2.ontimeout = function handleTimeout() {
|
|
492
|
-
var timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded";
|
|
666
|
+
var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
667
|
+
var transitional3 = config.transitional || transitionalDefaults$1;
|
|
493
668
|
if (config.timeoutErrorMessage) {
|
|
494
669
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
495
670
|
}
|
|
496
|
-
reject(
|
|
671
|
+
reject(new AxiosError$2(timeoutErrorMessage, transitional3.clarifyTimeoutError ? AxiosError$2.ETIMEDOUT : AxiosError$2.ECONNABORTED, config, request2));
|
|
497
672
|
request2 = null;
|
|
498
673
|
};
|
|
499
|
-
if (utils$
|
|
674
|
+
if (utils$7.isStandardBrowserEnv()) {
|
|
500
675
|
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
501
676
|
if (xsrfValue) {
|
|
502
677
|
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
503
678
|
}
|
|
504
679
|
}
|
|
505
680
|
if ("setRequestHeader" in request2) {
|
|
506
|
-
utils$
|
|
681
|
+
utils$7.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
507
682
|
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
508
683
|
delete requestHeaders[key];
|
|
509
684
|
} else {
|
|
@@ -511,7 +686,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
511
686
|
}
|
|
512
687
|
});
|
|
513
688
|
}
|
|
514
|
-
if (!utils$
|
|
689
|
+
if (!utils$7.isUndefined(config.withCredentials)) {
|
|
515
690
|
request2.withCredentials = !!config.withCredentials;
|
|
516
691
|
}
|
|
517
692
|
if (responseType && responseType !== "json") {
|
|
@@ -523,30 +698,42 @@ var xhr = function xhrAdapter(config) {
|
|
|
523
698
|
if (typeof config.onUploadProgress === "function" && request2.upload) {
|
|
524
699
|
request2.upload.addEventListener("progress", config.onUploadProgress);
|
|
525
700
|
}
|
|
526
|
-
if (config.cancelToken) {
|
|
527
|
-
|
|
701
|
+
if (config.cancelToken || config.signal) {
|
|
702
|
+
onCanceled = function(cancel) {
|
|
528
703
|
if (!request2) {
|
|
529
704
|
return;
|
|
530
705
|
}
|
|
706
|
+
reject(!cancel || cancel && cancel.type ? new CanceledError$2() : cancel);
|
|
531
707
|
request2.abort();
|
|
532
|
-
reject(cancel);
|
|
533
708
|
request2 = null;
|
|
534
|
-
}
|
|
709
|
+
};
|
|
710
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
711
|
+
if (config.signal) {
|
|
712
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
713
|
+
}
|
|
535
714
|
}
|
|
536
715
|
if (!requestData) {
|
|
537
716
|
requestData = null;
|
|
538
717
|
}
|
|
718
|
+
var protocol = parseProtocol2(fullPath);
|
|
719
|
+
if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
|
|
720
|
+
reject(new AxiosError$2("Unsupported protocol " + protocol + ":", AxiosError$2.ERR_BAD_REQUEST, config));
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
539
723
|
request2.send(requestData);
|
|
540
724
|
});
|
|
541
725
|
};
|
|
542
|
-
var
|
|
726
|
+
var _null = null;
|
|
727
|
+
var utils$6 = utils$h;
|
|
543
728
|
var normalizeHeaderName2 = normalizeHeaderName$1;
|
|
544
|
-
var
|
|
729
|
+
var AxiosError$1 = AxiosError_1;
|
|
730
|
+
var transitionalDefaults = transitional;
|
|
731
|
+
var toFormData = toFormData_1;
|
|
545
732
|
var DEFAULT_CONTENT_TYPE = {
|
|
546
733
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
547
734
|
};
|
|
548
735
|
function setContentTypeIfUnset(headers, value) {
|
|
549
|
-
if (!utils$
|
|
736
|
+
if (!utils$6.isUndefined(headers) && utils$6.isUndefined(headers["Content-Type"])) {
|
|
550
737
|
headers["Content-Type"] = value;
|
|
551
738
|
}
|
|
552
739
|
}
|
|
@@ -560,10 +747,10 @@ function getDefaultAdapter() {
|
|
|
560
747
|
return adapter;
|
|
561
748
|
}
|
|
562
749
|
function stringifySafely(rawValue, parser, encoder) {
|
|
563
|
-
if (utils$
|
|
750
|
+
if (utils$6.isString(rawValue)) {
|
|
564
751
|
try {
|
|
565
752
|
(parser || JSON.parse)(rawValue);
|
|
566
|
-
return utils$
|
|
753
|
+
return utils$6.trim(rawValue);
|
|
567
754
|
} catch (e) {
|
|
568
755
|
if (e.name !== "SyntaxError") {
|
|
569
756
|
throw e;
|
|
@@ -573,98 +760,107 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
573
760
|
return (encoder || JSON.stringify)(rawValue);
|
|
574
761
|
}
|
|
575
762
|
var defaults$4 = {
|
|
576
|
-
transitional:
|
|
577
|
-
silentJSONParsing: true,
|
|
578
|
-
forcedJSONParsing: true,
|
|
579
|
-
clarifyTimeoutError: false
|
|
580
|
-
},
|
|
763
|
+
transitional: transitionalDefaults,
|
|
581
764
|
adapter: getDefaultAdapter(),
|
|
582
|
-
transformRequest: [function transformRequest(
|
|
765
|
+
transformRequest: [function transformRequest(data2, headers) {
|
|
583
766
|
normalizeHeaderName2(headers, "Accept");
|
|
584
767
|
normalizeHeaderName2(headers, "Content-Type");
|
|
585
|
-
if (utils$
|
|
586
|
-
return
|
|
768
|
+
if (utils$6.isFormData(data2) || utils$6.isArrayBuffer(data2) || utils$6.isBuffer(data2) || utils$6.isStream(data2) || utils$6.isFile(data2) || utils$6.isBlob(data2)) {
|
|
769
|
+
return data2;
|
|
587
770
|
}
|
|
588
|
-
if (utils$
|
|
589
|
-
return
|
|
771
|
+
if (utils$6.isArrayBufferView(data2)) {
|
|
772
|
+
return data2.buffer;
|
|
590
773
|
}
|
|
591
|
-
if (utils$
|
|
774
|
+
if (utils$6.isURLSearchParams(data2)) {
|
|
592
775
|
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
593
|
-
return
|
|
594
|
-
}
|
|
595
|
-
|
|
776
|
+
return data2.toString();
|
|
777
|
+
}
|
|
778
|
+
var isObjectPayload = utils$6.isObject(data2);
|
|
779
|
+
var contentType = headers && headers["Content-Type"];
|
|
780
|
+
var isFileList2;
|
|
781
|
+
if ((isFileList2 = utils$6.isFileList(data2)) || isObjectPayload && contentType === "multipart/form-data") {
|
|
782
|
+
var _FormData = this.env && this.env.FormData;
|
|
783
|
+
return toFormData(isFileList2 ? { "files[]": data2 } : data2, _FormData && new _FormData());
|
|
784
|
+
} else if (isObjectPayload || contentType === "application/json") {
|
|
596
785
|
setContentTypeIfUnset(headers, "application/json");
|
|
597
|
-
return stringifySafely(
|
|
786
|
+
return stringifySafely(data2);
|
|
598
787
|
}
|
|
599
|
-
return
|
|
788
|
+
return data2;
|
|
600
789
|
}],
|
|
601
|
-
transformResponse: [function transformResponse(
|
|
602
|
-
var
|
|
603
|
-
var silentJSONParsing =
|
|
604
|
-
var forcedJSONParsing =
|
|
790
|
+
transformResponse: [function transformResponse(data2) {
|
|
791
|
+
var transitional3 = this.transitional || defaults$4.transitional;
|
|
792
|
+
var silentJSONParsing = transitional3 && transitional3.silentJSONParsing;
|
|
793
|
+
var forcedJSONParsing = transitional3 && transitional3.forcedJSONParsing;
|
|
605
794
|
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
606
|
-
if (strictJSONParsing || forcedJSONParsing && utils$
|
|
795
|
+
if (strictJSONParsing || forcedJSONParsing && utils$6.isString(data2) && data2.length) {
|
|
607
796
|
try {
|
|
608
|
-
return JSON.parse(
|
|
797
|
+
return JSON.parse(data2);
|
|
609
798
|
} catch (e) {
|
|
610
799
|
if (strictJSONParsing) {
|
|
611
800
|
if (e.name === "SyntaxError") {
|
|
612
|
-
throw
|
|
801
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
613
802
|
}
|
|
614
803
|
throw e;
|
|
615
804
|
}
|
|
616
805
|
}
|
|
617
806
|
}
|
|
618
|
-
return
|
|
807
|
+
return data2;
|
|
619
808
|
}],
|
|
620
809
|
timeout: 0,
|
|
621
810
|
xsrfCookieName: "XSRF-TOKEN",
|
|
622
811
|
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
623
812
|
maxContentLength: -1,
|
|
624
813
|
maxBodyLength: -1,
|
|
814
|
+
env: {
|
|
815
|
+
FormData: _null
|
|
816
|
+
},
|
|
625
817
|
validateStatus: function validateStatus(status) {
|
|
626
818
|
return status >= 200 && status < 300;
|
|
819
|
+
},
|
|
820
|
+
headers: {
|
|
821
|
+
common: {
|
|
822
|
+
"Accept": "application/json, text/plain, */*"
|
|
823
|
+
}
|
|
627
824
|
}
|
|
628
825
|
};
|
|
629
|
-
|
|
630
|
-
common: {
|
|
631
|
-
"Accept": "application/json, text/plain, */*"
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
|
-
utils$5.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
826
|
+
utils$6.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
635
827
|
defaults$4.headers[method] = {};
|
|
636
828
|
});
|
|
637
|
-
utils$
|
|
638
|
-
defaults$4.headers[method] = utils$
|
|
829
|
+
utils$6.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
830
|
+
defaults$4.headers[method] = utils$6.merge(DEFAULT_CONTENT_TYPE);
|
|
639
831
|
});
|
|
640
832
|
var defaults_1 = defaults$4;
|
|
641
|
-
var utils$
|
|
833
|
+
var utils$5 = utils$h;
|
|
642
834
|
var defaults$3 = defaults_1;
|
|
643
|
-
var transformData$1 = function transformData(
|
|
835
|
+
var transformData$1 = function transformData(data2, headers, fns) {
|
|
644
836
|
var context = this || defaults$3;
|
|
645
|
-
utils$
|
|
646
|
-
|
|
837
|
+
utils$5.forEach(fns, function transform(fn) {
|
|
838
|
+
data2 = fn.call(context, data2, headers);
|
|
647
839
|
});
|
|
648
|
-
return
|
|
840
|
+
return data2;
|
|
649
841
|
};
|
|
650
842
|
var isCancel$1 = function isCancel(value) {
|
|
651
843
|
return !!(value && value.__CANCEL__);
|
|
652
844
|
};
|
|
653
|
-
var utils$
|
|
845
|
+
var utils$4 = utils$h;
|
|
654
846
|
var transformData2 = transformData$1;
|
|
655
847
|
var isCancel2 = isCancel$1;
|
|
656
848
|
var defaults$2 = defaults_1;
|
|
849
|
+
var CanceledError$1 = CanceledError_1;
|
|
657
850
|
function throwIfCancellationRequested(config) {
|
|
658
851
|
if (config.cancelToken) {
|
|
659
852
|
config.cancelToken.throwIfRequested();
|
|
660
853
|
}
|
|
854
|
+
if (config.signal && config.signal.aborted) {
|
|
855
|
+
throw new CanceledError$1();
|
|
856
|
+
}
|
|
661
857
|
}
|
|
662
858
|
var dispatchRequest$1 = function dispatchRequest(config) {
|
|
663
859
|
throwIfCancellationRequested(config);
|
|
664
860
|
config.headers = config.headers || {};
|
|
665
861
|
config.data = transformData2.call(config, config.data, config.headers, config.transformRequest);
|
|
666
|
-
config.headers = utils$
|
|
667
|
-
utils$
|
|
862
|
+
config.headers = utils$4.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
863
|
+
utils$4.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
668
864
|
delete config.headers[method];
|
|
669
865
|
});
|
|
670
866
|
var adapter = config.adapter || defaults$2.adapter;
|
|
@@ -682,185 +878,87 @@ var dispatchRequest$1 = function dispatchRequest(config) {
|
|
|
682
878
|
return Promise.reject(reason);
|
|
683
879
|
});
|
|
684
880
|
};
|
|
685
|
-
var utils$
|
|
881
|
+
var utils$3 = utils$h;
|
|
686
882
|
var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
687
883
|
config2 = config2 || {};
|
|
688
884
|
var config = {};
|
|
689
|
-
var valueFromConfig2Keys = ["url", "method", "data"];
|
|
690
|
-
var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
|
|
691
|
-
var defaultToConfig2Keys = [
|
|
692
|
-
"baseURL",
|
|
693
|
-
"transformRequest",
|
|
694
|
-
"transformResponse",
|
|
695
|
-
"paramsSerializer",
|
|
696
|
-
"timeout",
|
|
697
|
-
"timeoutMessage",
|
|
698
|
-
"withCredentials",
|
|
699
|
-
"adapter",
|
|
700
|
-
"responseType",
|
|
701
|
-
"xsrfCookieName",
|
|
702
|
-
"xsrfHeaderName",
|
|
703
|
-
"onUploadProgress",
|
|
704
|
-
"onDownloadProgress",
|
|
705
|
-
"decompress",
|
|
706
|
-
"maxContentLength",
|
|
707
|
-
"maxBodyLength",
|
|
708
|
-
"maxRedirects",
|
|
709
|
-
"transport",
|
|
710
|
-
"httpAgent",
|
|
711
|
-
"httpsAgent",
|
|
712
|
-
"cancelToken",
|
|
713
|
-
"socketPath",
|
|
714
|
-
"responseEncoding"
|
|
715
|
-
];
|
|
716
|
-
var directMergeKeys = ["validateStatus"];
|
|
717
885
|
function getMergedValue(target, source2) {
|
|
718
|
-
if (utils$
|
|
719
|
-
return utils$
|
|
720
|
-
} else if (utils$
|
|
721
|
-
return utils$
|
|
722
|
-
} else if (utils$
|
|
886
|
+
if (utils$3.isPlainObject(target) && utils$3.isPlainObject(source2)) {
|
|
887
|
+
return utils$3.merge(target, source2);
|
|
888
|
+
} else if (utils$3.isPlainObject(source2)) {
|
|
889
|
+
return utils$3.merge({}, source2);
|
|
890
|
+
} else if (utils$3.isArray(source2)) {
|
|
723
891
|
return source2.slice();
|
|
724
892
|
}
|
|
725
893
|
return source2;
|
|
726
894
|
}
|
|
727
895
|
function mergeDeepProperties(prop) {
|
|
728
|
-
if (!utils$
|
|
729
|
-
|
|
730
|
-
} else if (!utils$
|
|
731
|
-
|
|
896
|
+
if (!utils$3.isUndefined(config2[prop])) {
|
|
897
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
898
|
+
} else if (!utils$3.isUndefined(config1[prop])) {
|
|
899
|
+
return getMergedValue(void 0, config1[prop]);
|
|
732
900
|
}
|
|
733
901
|
}
|
|
734
|
-
|
|
735
|
-
if (!utils$
|
|
736
|
-
|
|
902
|
+
function valueFromConfig2(prop) {
|
|
903
|
+
if (!utils$3.isUndefined(config2[prop])) {
|
|
904
|
+
return getMergedValue(void 0, config2[prop]);
|
|
737
905
|
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
906
|
+
}
|
|
907
|
+
function defaultToConfig2(prop) {
|
|
908
|
+
if (!utils$3.isUndefined(config2[prop])) {
|
|
909
|
+
return getMergedValue(void 0, config2[prop]);
|
|
910
|
+
} else if (!utils$3.isUndefined(config1[prop])) {
|
|
911
|
+
return getMergedValue(void 0, config1[prop]);
|
|
745
912
|
}
|
|
746
|
-
}
|
|
747
|
-
|
|
913
|
+
}
|
|
914
|
+
function mergeDirectKeys(prop) {
|
|
748
915
|
if (prop in config2) {
|
|
749
|
-
|
|
916
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
750
917
|
} else if (prop in config1) {
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
var
|
|
755
|
-
|
|
756
|
-
|
|
918
|
+
return getMergedValue(void 0, config1[prop]);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
var mergeMap = {
|
|
922
|
+
"url": valueFromConfig2,
|
|
923
|
+
"method": valueFromConfig2,
|
|
924
|
+
"data": valueFromConfig2,
|
|
925
|
+
"baseURL": defaultToConfig2,
|
|
926
|
+
"transformRequest": defaultToConfig2,
|
|
927
|
+
"transformResponse": defaultToConfig2,
|
|
928
|
+
"paramsSerializer": defaultToConfig2,
|
|
929
|
+
"timeout": defaultToConfig2,
|
|
930
|
+
"timeoutMessage": defaultToConfig2,
|
|
931
|
+
"withCredentials": defaultToConfig2,
|
|
932
|
+
"adapter": defaultToConfig2,
|
|
933
|
+
"responseType": defaultToConfig2,
|
|
934
|
+
"xsrfCookieName": defaultToConfig2,
|
|
935
|
+
"xsrfHeaderName": defaultToConfig2,
|
|
936
|
+
"onUploadProgress": defaultToConfig2,
|
|
937
|
+
"onDownloadProgress": defaultToConfig2,
|
|
938
|
+
"decompress": defaultToConfig2,
|
|
939
|
+
"maxContentLength": defaultToConfig2,
|
|
940
|
+
"maxBodyLength": defaultToConfig2,
|
|
941
|
+
"beforeRedirect": defaultToConfig2,
|
|
942
|
+
"transport": defaultToConfig2,
|
|
943
|
+
"httpAgent": defaultToConfig2,
|
|
944
|
+
"httpsAgent": defaultToConfig2,
|
|
945
|
+
"cancelToken": defaultToConfig2,
|
|
946
|
+
"socketPath": defaultToConfig2,
|
|
947
|
+
"responseEncoding": defaultToConfig2,
|
|
948
|
+
"validateStatus": mergeDirectKeys
|
|
949
|
+
};
|
|
950
|
+
utils$3.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
951
|
+
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
952
|
+
var configValue = merge2(prop);
|
|
953
|
+
utils$3.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
757
954
|
});
|
|
758
|
-
utils$2.forEach(otherKeys, mergeDeepProperties);
|
|
759
955
|
return config;
|
|
760
956
|
};
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
const description = "Promise based HTTP client for the browser and node.js";
|
|
764
|
-
const main = "index.js";
|
|
765
|
-
const scripts = {
|
|
766
|
-
test: "grunt test",
|
|
767
|
-
start: "node ./sandbox/server.js",
|
|
768
|
-
build: "NODE_ENV=production grunt build",
|
|
769
|
-
preversion: "npm test",
|
|
770
|
-
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
771
|
-
postversion: "git push && git push --tags",
|
|
772
|
-
examples: "node ./examples/server.js",
|
|
773
|
-
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
774
|
-
fix: "eslint --fix lib/**/*.js"
|
|
775
|
-
};
|
|
776
|
-
const repository = {
|
|
777
|
-
type: "git",
|
|
778
|
-
url: "https://github.com/axios/axios.git"
|
|
779
|
-
};
|
|
780
|
-
const keywords = [
|
|
781
|
-
"xhr",
|
|
782
|
-
"http",
|
|
783
|
-
"ajax",
|
|
784
|
-
"promise",
|
|
785
|
-
"node"
|
|
786
|
-
];
|
|
787
|
-
const author = "Matt Zabriskie";
|
|
788
|
-
const license = "MIT";
|
|
789
|
-
const bugs = {
|
|
790
|
-
url: "https://github.com/axios/axios/issues"
|
|
791
|
-
};
|
|
792
|
-
const homepage = "https://axios-http.com";
|
|
793
|
-
const devDependencies = {
|
|
794
|
-
coveralls: "^3.0.0",
|
|
795
|
-
"es6-promise": "^4.2.4",
|
|
796
|
-
grunt: "^1.3.0",
|
|
797
|
-
"grunt-banner": "^0.6.0",
|
|
798
|
-
"grunt-cli": "^1.2.0",
|
|
799
|
-
"grunt-contrib-clean": "^1.1.0",
|
|
800
|
-
"grunt-contrib-watch": "^1.0.0",
|
|
801
|
-
"grunt-eslint": "^23.0.0",
|
|
802
|
-
"grunt-karma": "^4.0.0",
|
|
803
|
-
"grunt-mocha-test": "^0.13.3",
|
|
804
|
-
"grunt-ts": "^6.0.0-beta.19",
|
|
805
|
-
"grunt-webpack": "^4.0.2",
|
|
806
|
-
"istanbul-instrumenter-loader": "^1.0.0",
|
|
807
|
-
"jasmine-core": "^2.4.1",
|
|
808
|
-
karma: "^6.3.2",
|
|
809
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
810
|
-
"karma-firefox-launcher": "^2.1.0",
|
|
811
|
-
"karma-jasmine": "^1.1.1",
|
|
812
|
-
"karma-jasmine-ajax": "^0.1.13",
|
|
813
|
-
"karma-safari-launcher": "^1.0.0",
|
|
814
|
-
"karma-sauce-launcher": "^4.3.6",
|
|
815
|
-
"karma-sinon": "^1.0.5",
|
|
816
|
-
"karma-sourcemap-loader": "^0.3.8",
|
|
817
|
-
"karma-webpack": "^4.0.2",
|
|
818
|
-
"load-grunt-tasks": "^3.5.2",
|
|
819
|
-
minimist: "^1.2.0",
|
|
820
|
-
mocha: "^8.2.1",
|
|
821
|
-
sinon: "^4.5.0",
|
|
822
|
-
"terser-webpack-plugin": "^4.2.3",
|
|
823
|
-
typescript: "^4.0.5",
|
|
824
|
-
"url-search-params": "^0.10.0",
|
|
825
|
-
webpack: "^4.44.2",
|
|
826
|
-
"webpack-dev-server": "^3.11.0"
|
|
957
|
+
var data = {
|
|
958
|
+
"version": "0.27.2"
|
|
827
959
|
};
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
};
|
|
831
|
-
const jsdelivr = "dist/axios.min.js";
|
|
832
|
-
const unpkg = "dist/axios.min.js";
|
|
833
|
-
const typings = "./index.d.ts";
|
|
834
|
-
const dependencies = {
|
|
835
|
-
"follow-redirects": "^1.14.0"
|
|
836
|
-
};
|
|
837
|
-
const bundlesize = [
|
|
838
|
-
{
|
|
839
|
-
path: "./dist/axios.min.js",
|
|
840
|
-
threshold: "5kB"
|
|
841
|
-
}
|
|
842
|
-
];
|
|
843
|
-
var require$$0 = {
|
|
844
|
-
name,
|
|
845
|
-
version,
|
|
846
|
-
description,
|
|
847
|
-
main,
|
|
848
|
-
scripts,
|
|
849
|
-
repository,
|
|
850
|
-
keywords,
|
|
851
|
-
author,
|
|
852
|
-
license,
|
|
853
|
-
bugs,
|
|
854
|
-
homepage,
|
|
855
|
-
devDependencies,
|
|
856
|
-
browser,
|
|
857
|
-
jsdelivr,
|
|
858
|
-
unpkg,
|
|
859
|
-
typings,
|
|
860
|
-
dependencies,
|
|
861
|
-
bundlesize
|
|
862
|
-
};
|
|
863
|
-
var pkg = require$$0;
|
|
960
|
+
var VERSION = data.version;
|
|
961
|
+
var AxiosError = AxiosError_1;
|
|
864
962
|
var validators$1 = {};
|
|
865
963
|
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
866
964
|
validators$1[type] = function validator2(thing) {
|
|
@@ -868,38 +966,24 @@ var validators$1 = {};
|
|
|
868
966
|
};
|
|
869
967
|
});
|
|
870
968
|
var deprecatedWarnings = {};
|
|
871
|
-
|
|
872
|
-
function isOlderVersion(version2, thanVersion) {
|
|
873
|
-
var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
|
|
874
|
-
var destVer = version2.split(".");
|
|
875
|
-
for (var i = 0; i < 3; i++) {
|
|
876
|
-
if (pkgVersionArr[i] > destVer[i]) {
|
|
877
|
-
return true;
|
|
878
|
-
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
879
|
-
return false;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
return false;
|
|
883
|
-
}
|
|
884
|
-
validators$1.transitional = function transitional(validator2, version2, message) {
|
|
885
|
-
var isDeprecated = version2 && isOlderVersion(version2);
|
|
969
|
+
validators$1.transitional = function transitional2(validator2, version, message) {
|
|
886
970
|
function formatMessage(opt, desc) {
|
|
887
|
-
return "[Axios v" +
|
|
971
|
+
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
888
972
|
}
|
|
889
973
|
return function(value, opt, opts) {
|
|
890
974
|
if (validator2 === false) {
|
|
891
|
-
throw new
|
|
975
|
+
throw new AxiosError(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError.ERR_DEPRECATED);
|
|
892
976
|
}
|
|
893
|
-
if (
|
|
977
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
894
978
|
deprecatedWarnings[opt] = true;
|
|
895
|
-
console.warn(formatMessage(opt, " has been deprecated since v" +
|
|
979
|
+
console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
|
|
896
980
|
}
|
|
897
981
|
return validator2 ? validator2(value, opt, opts) : true;
|
|
898
982
|
};
|
|
899
983
|
};
|
|
900
984
|
function assertOptions(options, schema, allowUnknown) {
|
|
901
985
|
if (typeof options !== "object") {
|
|
902
|
-
throw new
|
|
986
|
+
throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
|
|
903
987
|
}
|
|
904
988
|
var keys = Object.keys(options);
|
|
905
989
|
var i = keys.length;
|
|
@@ -910,25 +994,25 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
910
994
|
var value = options[opt];
|
|
911
995
|
var result = value === void 0 || validator2(value, opt, options);
|
|
912
996
|
if (result !== true) {
|
|
913
|
-
throw new
|
|
997
|
+
throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
|
|
914
998
|
}
|
|
915
999
|
continue;
|
|
916
1000
|
}
|
|
917
1001
|
if (allowUnknown !== true) {
|
|
918
|
-
throw
|
|
1002
|
+
throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
|
|
919
1003
|
}
|
|
920
1004
|
}
|
|
921
1005
|
}
|
|
922
1006
|
var validator$1 = {
|
|
923
|
-
isOlderVersion,
|
|
924
1007
|
assertOptions,
|
|
925
1008
|
validators: validators$1
|
|
926
1009
|
};
|
|
927
|
-
var utils$
|
|
1010
|
+
var utils$2 = utils$h;
|
|
928
1011
|
var buildURL2 = buildURL$2;
|
|
929
1012
|
var InterceptorManager = InterceptorManager_1;
|
|
930
1013
|
var dispatchRequest2 = dispatchRequest$1;
|
|
931
1014
|
var mergeConfig$1 = mergeConfig$2;
|
|
1015
|
+
var buildFullPath2 = buildFullPath$2;
|
|
932
1016
|
var validator = validator$1;
|
|
933
1017
|
var validators = validator.validators;
|
|
934
1018
|
function Axios$1(instanceConfig) {
|
|
@@ -938,12 +1022,12 @@ function Axios$1(instanceConfig) {
|
|
|
938
1022
|
response: new InterceptorManager()
|
|
939
1023
|
};
|
|
940
1024
|
}
|
|
941
|
-
Axios$1.prototype.request = function request(config) {
|
|
942
|
-
if (typeof
|
|
943
|
-
config = arguments[1] || {};
|
|
944
|
-
config.url = arguments[0];
|
|
945
|
-
} else {
|
|
1025
|
+
Axios$1.prototype.request = function request(configOrUrl, config) {
|
|
1026
|
+
if (typeof configOrUrl === "string") {
|
|
946
1027
|
config = config || {};
|
|
1028
|
+
config.url = configOrUrl;
|
|
1029
|
+
} else {
|
|
1030
|
+
config = configOrUrl || {};
|
|
947
1031
|
}
|
|
948
1032
|
config = mergeConfig$1(this.defaults, config);
|
|
949
1033
|
if (config.method) {
|
|
@@ -953,12 +1037,12 @@ Axios$1.prototype.request = function request(config) {
|
|
|
953
1037
|
} else {
|
|
954
1038
|
config.method = "get";
|
|
955
1039
|
}
|
|
956
|
-
var
|
|
957
|
-
if (
|
|
958
|
-
validator.assertOptions(
|
|
959
|
-
silentJSONParsing: validators.transitional(validators.boolean
|
|
960
|
-
forcedJSONParsing: validators.transitional(validators.boolean
|
|
961
|
-
clarifyTimeoutError: validators.transitional(validators.boolean
|
|
1040
|
+
var transitional3 = config.transitional;
|
|
1041
|
+
if (transitional3 !== void 0) {
|
|
1042
|
+
validator.assertOptions(transitional3, {
|
|
1043
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
1044
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
1045
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
962
1046
|
}, false);
|
|
963
1047
|
}
|
|
964
1048
|
var requestInterceptorChain = [];
|
|
@@ -1008,9 +1092,10 @@ Axios$1.prototype.request = function request(config) {
|
|
|
1008
1092
|
};
|
|
1009
1093
|
Axios$1.prototype.getUri = function getUri(config) {
|
|
1010
1094
|
config = mergeConfig$1(this.defaults, config);
|
|
1011
|
-
|
|
1095
|
+
var fullPath = buildFullPath2(config.baseURL, config.url);
|
|
1096
|
+
return buildURL2(fullPath, config.params, config.paramsSerializer);
|
|
1012
1097
|
};
|
|
1013
|
-
utils$
|
|
1098
|
+
utils$2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
1014
1099
|
Axios$1.prototype[method] = function(url, config) {
|
|
1015
1100
|
return this.request(mergeConfig$1(config || {}, {
|
|
1016
1101
|
method,
|
|
@@ -1019,25 +1104,24 @@ utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoDa
|
|
|
1019
1104
|
}));
|
|
1020
1105
|
};
|
|
1021
1106
|
});
|
|
1022
|
-
utils$
|
|
1023
|
-
|
|
1024
|
-
return
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1107
|
+
utils$2.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
1108
|
+
function generateHTTPMethod(isForm) {
|
|
1109
|
+
return function httpMethod(url, data2, config) {
|
|
1110
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
1111
|
+
method,
|
|
1112
|
+
headers: isForm ? {
|
|
1113
|
+
"Content-Type": "multipart/form-data"
|
|
1114
|
+
} : {},
|
|
1115
|
+
url,
|
|
1116
|
+
data: data2
|
|
1117
|
+
}));
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
Axios$1.prototype[method] = generateHTTPMethod();
|
|
1121
|
+
Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
1030
1122
|
});
|
|
1031
1123
|
var Axios_1 = Axios$1;
|
|
1032
|
-
|
|
1033
|
-
this.message = message;
|
|
1034
|
-
}
|
|
1035
|
-
Cancel$1.prototype.toString = function toString2() {
|
|
1036
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
1037
|
-
};
|
|
1038
|
-
Cancel$1.prototype.__CANCEL__ = true;
|
|
1039
|
-
var Cancel_1 = Cancel$1;
|
|
1040
|
-
var Cancel = Cancel_1;
|
|
1124
|
+
var CanceledError = CanceledError_1;
|
|
1041
1125
|
function CancelToken(executor) {
|
|
1042
1126
|
if (typeof executor !== "function") {
|
|
1043
1127
|
throw new TypeError("executor must be a function.");
|
|
@@ -1047,11 +1131,32 @@ function CancelToken(executor) {
|
|
|
1047
1131
|
resolvePromise = resolve;
|
|
1048
1132
|
});
|
|
1049
1133
|
var token = this;
|
|
1134
|
+
this.promise.then(function(cancel) {
|
|
1135
|
+
if (!token._listeners)
|
|
1136
|
+
return;
|
|
1137
|
+
var i;
|
|
1138
|
+
var l = token._listeners.length;
|
|
1139
|
+
for (i = 0; i < l; i++) {
|
|
1140
|
+
token._listeners[i](cancel);
|
|
1141
|
+
}
|
|
1142
|
+
token._listeners = null;
|
|
1143
|
+
});
|
|
1144
|
+
this.promise.then = function(onfulfilled) {
|
|
1145
|
+
var _resolve;
|
|
1146
|
+
var promise = new Promise(function(resolve) {
|
|
1147
|
+
token.subscribe(resolve);
|
|
1148
|
+
_resolve = resolve;
|
|
1149
|
+
}).then(onfulfilled);
|
|
1150
|
+
promise.cancel = function reject() {
|
|
1151
|
+
token.unsubscribe(_resolve);
|
|
1152
|
+
};
|
|
1153
|
+
return promise;
|
|
1154
|
+
};
|
|
1050
1155
|
executor(function cancel(message) {
|
|
1051
1156
|
if (token.reason) {
|
|
1052
1157
|
return;
|
|
1053
1158
|
}
|
|
1054
|
-
token.reason = new
|
|
1159
|
+
token.reason = new CanceledError(message);
|
|
1055
1160
|
resolvePromise(token.reason);
|
|
1056
1161
|
});
|
|
1057
1162
|
}
|
|
@@ -1060,6 +1165,26 @@ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
|
1060
1165
|
throw this.reason;
|
|
1061
1166
|
}
|
|
1062
1167
|
};
|
|
1168
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
1169
|
+
if (this.reason) {
|
|
1170
|
+
listener(this.reason);
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
if (this._listeners) {
|
|
1174
|
+
this._listeners.push(listener);
|
|
1175
|
+
} else {
|
|
1176
|
+
this._listeners = [listener];
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
1180
|
+
if (!this._listeners) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
var index = this._listeners.indexOf(listener);
|
|
1184
|
+
if (index !== -1) {
|
|
1185
|
+
this._listeners.splice(index, 1);
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1063
1188
|
CancelToken.source = function source() {
|
|
1064
1189
|
var cancel;
|
|
1065
1190
|
var token = new CancelToken(function executor(c) {
|
|
@@ -1076,10 +1201,11 @@ var spread = function spread2(callback) {
|
|
|
1076
1201
|
return callback.apply(null, arr);
|
|
1077
1202
|
};
|
|
1078
1203
|
};
|
|
1204
|
+
var utils$1 = utils$h;
|
|
1079
1205
|
var isAxiosError = function isAxiosError2(payload) {
|
|
1080
|
-
return
|
|
1206
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
1081
1207
|
};
|
|
1082
|
-
var utils = utils$
|
|
1208
|
+
var utils = utils$h;
|
|
1083
1209
|
var bind2 = bind$2;
|
|
1084
1210
|
var Axios = Axios_1;
|
|
1085
1211
|
var mergeConfig2 = mergeConfig$2;
|
|
@@ -1089,16 +1215,20 @@ function createInstance(defaultConfig) {
|
|
|
1089
1215
|
var instance = bind2(Axios.prototype.request, context);
|
|
1090
1216
|
utils.extend(instance, Axios.prototype, context);
|
|
1091
1217
|
utils.extend(instance, context);
|
|
1218
|
+
instance.create = function create(instanceConfig) {
|
|
1219
|
+
return createInstance(mergeConfig2(defaultConfig, instanceConfig));
|
|
1220
|
+
};
|
|
1092
1221
|
return instance;
|
|
1093
1222
|
}
|
|
1094
1223
|
var axios$1 = createInstance(defaults$1);
|
|
1095
1224
|
axios$1.Axios = Axios;
|
|
1096
|
-
axios$1.
|
|
1097
|
-
return createInstance(mergeConfig2(axios$1.defaults, instanceConfig));
|
|
1098
|
-
};
|
|
1099
|
-
axios$1.Cancel = Cancel_1;
|
|
1225
|
+
axios$1.CanceledError = CanceledError_1;
|
|
1100
1226
|
axios$1.CancelToken = CancelToken_1;
|
|
1101
1227
|
axios$1.isCancel = isCancel$1;
|
|
1228
|
+
axios$1.VERSION = data.version;
|
|
1229
|
+
axios$1.toFormData = toFormData_1;
|
|
1230
|
+
axios$1.AxiosError = AxiosError_1;
|
|
1231
|
+
axios$1.Cancel = axios$1.CanceledError;
|
|
1102
1232
|
axios$1.all = function all(promises) {
|
|
1103
1233
|
return Promise.all(promises);
|
|
1104
1234
|
};
|
|
@@ -1107,44 +1237,55 @@ axios$1.isAxiosError = isAxiosError;
|
|
|
1107
1237
|
axios$2.exports = axios$1;
|
|
1108
1238
|
axios$2.exports.default = axios$1;
|
|
1109
1239
|
var axios = axios$2.exports;
|
|
1240
|
+
const apiDelayReqIntercept = (config) => {
|
|
1241
|
+
const delay = config.withDelay || 0;
|
|
1242
|
+
return new Promise((resolve) => {
|
|
1243
|
+
setTimeout(() => {
|
|
1244
|
+
resolve(config);
|
|
1245
|
+
}, Math.max(delay, 0));
|
|
1246
|
+
});
|
|
1247
|
+
};
|
|
1248
|
+
const apiDataRespIntercept = (response) => {
|
|
1249
|
+
var _a;
|
|
1250
|
+
if (response.config.dataIntercept && ((_a = response.data) == null ? void 0 : _a.data)) {
|
|
1251
|
+
response.data = response.data.data;
|
|
1252
|
+
}
|
|
1253
|
+
return response;
|
|
1254
|
+
};
|
|
1110
1255
|
const apiAxiosInstance = axios.create({
|
|
1111
1256
|
baseURL: process.env.VUE_APP_BASE_API_URL || "/api/v1",
|
|
1112
1257
|
responseType: "json",
|
|
1113
|
-
withCredentials: true
|
|
1258
|
+
withCredentials: true,
|
|
1259
|
+
headers: {
|
|
1260
|
+
"Content-Type": "application/json"
|
|
1261
|
+
}
|
|
1114
1262
|
});
|
|
1263
|
+
apiAxiosInstance.interceptors.request.use(apiDelayReqIntercept);
|
|
1264
|
+
apiAxiosInstance.interceptors.response.use(apiDataRespIntercept);
|
|
1115
1265
|
const BaseAPI = {
|
|
1116
|
-
makeRequest(
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
if (!opts.skipLoader)
|
|
1127
|
-
window.VueBus.emit("Spinner-hide");
|
|
1128
|
-
resolve(success.data);
|
|
1129
|
-
}, (error) => {
|
|
1130
|
-
window.clearTimeout(wait);
|
|
1131
|
-
if (!opts.skipLoader)
|
|
1132
|
-
window.VueBus.emit("Spinner-hide");
|
|
1133
|
-
reject(error.response);
|
|
1134
|
-
});
|
|
1266
|
+
makeRequest(opts) {
|
|
1267
|
+
const wait = window.setTimeout(() => {
|
|
1268
|
+
if (!opts.skipLoader) {
|
|
1269
|
+
window.VueBus.emit("Spinner-show");
|
|
1270
|
+
}
|
|
1271
|
+
}, 200);
|
|
1272
|
+
return apiAxiosInstance(opts).then((success) => success.data).finally(() => {
|
|
1273
|
+
if (!opts.skipLoader)
|
|
1274
|
+
window.VueBus.emit("Spinner-hide");
|
|
1275
|
+
window.clearTimeout(wait);
|
|
1135
1276
|
});
|
|
1136
1277
|
},
|
|
1137
1278
|
get(path, opts, params) {
|
|
1138
|
-
return this.makeRequest({ url: path, method: "GET", params }, opts);
|
|
1279
|
+
return this.makeRequest(__spreadValues({ url: path, method: "GET", params }, opts));
|
|
1139
1280
|
},
|
|
1140
1281
|
delete(path, opts) {
|
|
1141
|
-
return this.makeRequest({ url: path, method: "DELETE" }, opts);
|
|
1282
|
+
return this.makeRequest(__spreadValues({ url: path, method: "DELETE" }, opts));
|
|
1142
1283
|
},
|
|
1143
|
-
post(path,
|
|
1144
|
-
return this.makeRequest({ url: path, data, method: "POST" }, opts);
|
|
1284
|
+
post(path, data2, opts) {
|
|
1285
|
+
return this.makeRequest(__spreadValues({ url: path, data: data2, method: "POST" }, opts));
|
|
1145
1286
|
},
|
|
1146
|
-
put(path,
|
|
1147
|
-
return this.makeRequest({ url: path, data, method: "PUT" }, opts);
|
|
1287
|
+
put(path, data2, opts) {
|
|
1288
|
+
return this.makeRequest(__spreadValues({ url: path, data: data2, method: "PUT" }, opts));
|
|
1148
1289
|
}
|
|
1149
1290
|
};
|
|
1150
1291
|
function _extends() {
|
|
@@ -1245,21 +1386,21 @@ var RenderStrategy;
|
|
|
1245
1386
|
RenderStrategy2[RenderStrategy2["Hidden"] = 1] = "Hidden";
|
|
1246
1387
|
})(RenderStrategy || (RenderStrategy = {}));
|
|
1247
1388
|
function render$8(_ref) {
|
|
1248
|
-
var _ref$visible = _ref.visible, visible = _ref$visible === void 0 ? true : _ref$visible, _ref$features = _ref.features, features = _ref$features === void 0 ? Features.None : _ref$features,
|
|
1389
|
+
var _ref$visible = _ref.visible, visible = _ref$visible === void 0 ? true : _ref$visible, _ref$features = _ref.features, features = _ref$features === void 0 ? Features.None : _ref$features, main = _objectWithoutPropertiesLoose(_ref, ["visible", "features"]);
|
|
1249
1390
|
if (visible)
|
|
1250
|
-
return _render(
|
|
1391
|
+
return _render(main);
|
|
1251
1392
|
if (features & Features.Static) {
|
|
1252
|
-
if (
|
|
1253
|
-
return _render(
|
|
1393
|
+
if (main.props["static"])
|
|
1394
|
+
return _render(main);
|
|
1254
1395
|
}
|
|
1255
1396
|
if (features & Features.RenderStrategy) {
|
|
1256
1397
|
var _main$props$unmount, _match;
|
|
1257
|
-
var strategy = ((_main$props$unmount =
|
|
1398
|
+
var strategy = ((_main$props$unmount = main.props.unmount) != null ? _main$props$unmount : true) ? RenderStrategy.Unmount : RenderStrategy.Hidden;
|
|
1258
1399
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function() {
|
|
1259
1400
|
return null;
|
|
1260
1401
|
}, _match[RenderStrategy.Hidden] = function() {
|
|
1261
|
-
return _render(_extends({},
|
|
1262
|
-
props: _extends({},
|
|
1402
|
+
return _render(_extends({}, main, {
|
|
1403
|
+
props: _extends({}, main.props, {
|
|
1263
1404
|
hidden: true,
|
|
1264
1405
|
style: {
|
|
1265
1406
|
display: "none"
|
|
@@ -1268,17 +1409,17 @@ function render$8(_ref) {
|
|
|
1268
1409
|
}));
|
|
1269
1410
|
}, _match));
|
|
1270
1411
|
}
|
|
1271
|
-
return _render(
|
|
1412
|
+
return _render(main);
|
|
1272
1413
|
}
|
|
1273
1414
|
function _render(_ref2) {
|
|
1274
|
-
var props = _ref2.props, attrs = _ref2.attrs, slots = _ref2.slots, slot = _ref2.slot,
|
|
1415
|
+
var props = _ref2.props, attrs = _ref2.attrs, slots = _ref2.slots, slot = _ref2.slot, name = _ref2.name;
|
|
1275
1416
|
var _omit = omit(props, ["unmount", "static"]), as = _omit.as, passThroughProps = _objectWithoutPropertiesLoose(_omit, ["as"]);
|
|
1276
1417
|
var children = slots["default"] == null ? void 0 : slots["default"](slot);
|
|
1277
1418
|
if (as === "template") {
|
|
1278
1419
|
if (Object.keys(passThroughProps).length > 0 || Object.keys(attrs).length > 0) {
|
|
1279
1420
|
var _ref3 = children != null ? children : [], firstChild = _ref3[0], other = _ref3.slice(1);
|
|
1280
1421
|
if (!isValidElement(firstChild) || other.length > 0) {
|
|
1281
|
-
throw new Error(['Passing props on "template"!', "", "The current component <" +
|
|
1422
|
+
throw new Error(['Passing props on "template"!', "", "The current component <" + name + ' /> is rendering a "template".', "However we need to passthrough the following props:", Object.keys(passThroughProps).concat(Object.keys(attrs)).map(function(line) {
|
|
1282
1423
|
return " - " + line;
|
|
1283
1424
|
}).join("\n"), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map(function(line) {
|
|
1284
1425
|
return " - " + line;
|
|
@@ -1798,7 +1939,7 @@ function useInertOthers(container, enabled) {
|
|
|
1798
1939
|
}
|
|
1799
1940
|
var DescriptionContext = /* @__PURE__ */ Symbol("DescriptionContext");
|
|
1800
1941
|
function useDescriptions(_temp) {
|
|
1801
|
-
var _ref = _temp === void 0 ? {} : _temp, _ref$slot = _ref.slot, slot = _ref$slot === void 0 ? ref({}) : _ref$slot, _ref$name = _ref.name,
|
|
1942
|
+
var _ref = _temp === void 0 ? {} : _temp, _ref$slot = _ref.slot, slot = _ref$slot === void 0 ? ref({}) : _ref$slot, _ref$name = _ref.name, name = _ref$name === void 0 ? "Description" : _ref$name, _ref$props = _ref.props, props = _ref$props === void 0 ? {} : _ref$props;
|
|
1802
1943
|
var descriptionIds = ref([]);
|
|
1803
1944
|
function register(value) {
|
|
1804
1945
|
descriptionIds.value.push(value);
|
|
@@ -1812,7 +1953,7 @@ function useDescriptions(_temp) {
|
|
|
1812
1953
|
provide(DescriptionContext, {
|
|
1813
1954
|
register,
|
|
1814
1955
|
slot,
|
|
1815
|
-
name
|
|
1956
|
+
name,
|
|
1816
1957
|
props
|
|
1817
1958
|
});
|
|
1818
1959
|
return computed(function() {
|
|
@@ -2158,10 +2299,10 @@ function resolveType(type, as) {
|
|
|
2158
2299
|
return "button";
|
|
2159
2300
|
return void 0;
|
|
2160
2301
|
}
|
|
2161
|
-
function useResolveButtonType(
|
|
2162
|
-
var type = ref(resolveType(
|
|
2302
|
+
function useResolveButtonType(data2, refElement) {
|
|
2303
|
+
var type = ref(resolveType(data2.value.type, data2.value.as));
|
|
2163
2304
|
onMounted(function() {
|
|
2164
|
-
type.value = resolveType(
|
|
2305
|
+
type.value = resolveType(data2.value.type, data2.value.as);
|
|
2165
2306
|
});
|
|
2166
2307
|
watchEffect(function() {
|
|
2167
2308
|
var _dom;
|
|
@@ -6324,22 +6465,22 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
|
6324
6465
|
return self.close();
|
|
6325
6466
|
self.open(e);
|
|
6326
6467
|
}
|
|
6327
|
-
function triggerEvent(event,
|
|
6468
|
+
function triggerEvent(event, data2) {
|
|
6328
6469
|
if (self.config === void 0)
|
|
6329
6470
|
return;
|
|
6330
6471
|
const hooks = self.config[event];
|
|
6331
6472
|
if (hooks !== void 0 && hooks.length > 0) {
|
|
6332
6473
|
for (let i = 0; hooks[i] && i < hooks.length; i++)
|
|
6333
|
-
hooks[i](self.selectedDates, self.input.value, self,
|
|
6474
|
+
hooks[i](self.selectedDates, self.input.value, self, data2);
|
|
6334
6475
|
}
|
|
6335
6476
|
if (event === "onChange") {
|
|
6336
6477
|
self.input.dispatchEvent(createEvent("change"));
|
|
6337
6478
|
self.input.dispatchEvent(createEvent("input"));
|
|
6338
6479
|
}
|
|
6339
6480
|
}
|
|
6340
|
-
function createEvent(
|
|
6481
|
+
function createEvent(name) {
|
|
6341
6482
|
const e = document.createEvent("Event");
|
|
6342
|
-
e.initEvent(
|
|
6483
|
+
e.initEvent(name, true, true);
|
|
6343
6484
|
return e;
|
|
6344
6485
|
}
|
|
6345
6486
|
function isDateSelected(date) {
|
|
@@ -9287,9 +9428,82 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
9287
9428
|
TextArea: _sfc_main$1,
|
|
9288
9429
|
YesOrNoRadio: _sfc_main
|
|
9289
9430
|
});
|
|
9431
|
+
function useBaseAPI(path, method = "GET", initOpts = {}) {
|
|
9432
|
+
const result = ref();
|
|
9433
|
+
const error = shallowRef();
|
|
9434
|
+
const hasFetched = ref(false);
|
|
9435
|
+
const isFinished = ref(false);
|
|
9436
|
+
const isLoading = ref(false);
|
|
9437
|
+
const isAborted = ref(false);
|
|
9438
|
+
let requestCount = 0;
|
|
9439
|
+
let controller;
|
|
9440
|
+
const abort = () => {
|
|
9441
|
+
if (controller !== void 0) {
|
|
9442
|
+
controller.abort();
|
|
9443
|
+
}
|
|
9444
|
+
};
|
|
9445
|
+
const execute = (data2 = {}, opts = {}) => {
|
|
9446
|
+
requestCount++;
|
|
9447
|
+
const count = requestCount;
|
|
9448
|
+
controller = new AbortController();
|
|
9449
|
+
isAborted.value = false;
|
|
9450
|
+
isFinished.value = false;
|
|
9451
|
+
isLoading.value = true;
|
|
9452
|
+
const requestOpts = __spreadValues(__spreadProps(__spreadValues({}, initOpts), {
|
|
9453
|
+
data: ["POST", "post", "PUT", "put"].includes(method) ? data2 : {},
|
|
9454
|
+
method,
|
|
9455
|
+
params: ["GET", "get"].includes(method) ? data2 : {},
|
|
9456
|
+
signal: controller.signal,
|
|
9457
|
+
url: path
|
|
9458
|
+
}), opts);
|
|
9459
|
+
return BaseAPI.makeRequest(requestOpts).then((success) => {
|
|
9460
|
+
result.value = success;
|
|
9461
|
+
error.value = void 0;
|
|
9462
|
+
isAborted.value = false;
|
|
9463
|
+
return success;
|
|
9464
|
+
}, (err) => {
|
|
9465
|
+
error.value = err;
|
|
9466
|
+
if (axios.isCancel(err)) {
|
|
9467
|
+
isAborted.value = true;
|
|
9468
|
+
}
|
|
9469
|
+
throw err;
|
|
9470
|
+
}).finally(() => {
|
|
9471
|
+
if (count == requestCount) {
|
|
9472
|
+
isFinished.value = true;
|
|
9473
|
+
isLoading.value = false;
|
|
9474
|
+
}
|
|
9475
|
+
hasFetched.value = true;
|
|
9476
|
+
});
|
|
9477
|
+
};
|
|
9478
|
+
if ((initOpts == null ? void 0 : initOpts.immediate) && initOpts.immediate === true) {
|
|
9479
|
+
execute();
|
|
9480
|
+
}
|
|
9481
|
+
return {
|
|
9482
|
+
result,
|
|
9483
|
+
error,
|
|
9484
|
+
isFinished,
|
|
9485
|
+
isLoading,
|
|
9486
|
+
isAborted,
|
|
9487
|
+
hasFetched,
|
|
9488
|
+
abort,
|
|
9489
|
+
execute
|
|
9490
|
+
};
|
|
9491
|
+
}
|
|
9492
|
+
function useBaseAPIGet(url, opts = {}) {
|
|
9493
|
+
return useBaseAPI(url, "GET", opts);
|
|
9494
|
+
}
|
|
9495
|
+
function useBaseAPIDelete(url, opts = {}) {
|
|
9496
|
+
return useBaseAPI(url, "DELETE", opts);
|
|
9497
|
+
}
|
|
9498
|
+
function useBaseAPIPost(url, opts = {}) {
|
|
9499
|
+
return useBaseAPI(url, "POST", opts);
|
|
9500
|
+
}
|
|
9501
|
+
function useBaseAPIPut(url, opts = {}) {
|
|
9502
|
+
return useBaseAPI(url, "PUT", opts);
|
|
9503
|
+
}
|
|
9290
9504
|
const install = function installTrees(app) {
|
|
9291
9505
|
Object.entries(components).forEach(([componentName, component]) => {
|
|
9292
9506
|
app.component(componentName, component);
|
|
9293
9507
|
});
|
|
9294
9508
|
};
|
|
9295
|
-
export { _sfc_main$v as ActionsDropdown, BaseAPI, _sfc_main$q as BaseInput, _sfc_main$u as Cards, _sfc_main$5 as Checkbox, _sfc_main$t as ContentModal, _sfc_main$n as DateFilter, _sfc_main$p as DateRangePicker, _sfc_main$l as DetailList, _sfc_main$k as DownloadCell, _sfc_main$4 as FieldsetLegend, _sfc_main$j as Flash, _sfc_main$r as InputHelp, _sfc_main$s as InputLabel, _sfc_main$i as Modal, _sfc_main$3 as MultiCheckboxes, _sfc_main$m as Paginator, _sfc_main$f as Popover, PopoverContent, _sfc_main$f as PopoverPosition, _sfc_main$2 as Radio, _sfc_main$o as Select, _sfc_main$g as SidebarLayout, _sfc_main$d as Slideover, _sfc_main$h as Spinner, _sfc_main$b as StackedLayout, _sfc_main$a as StaticTable, _sfc_main$9 as Steps, _sfc_main$8 as Table, _sfc_main$7 as Tabs, _sfc_main$1 as TextArea, _sfc_main$6 as Toggle, _sfc_main$c as Tooltip, _sfc_main as YesOrNoRadio, install as default };
|
|
9509
|
+
export { _sfc_main$v as ActionsDropdown, BaseAPI, _sfc_main$q as BaseInput, _sfc_main$u as Cards, _sfc_main$5 as Checkbox, _sfc_main$t as ContentModal, _sfc_main$n as DateFilter, _sfc_main$p as DateRangePicker, _sfc_main$l as DetailList, _sfc_main$k as DownloadCell, _sfc_main$4 as FieldsetLegend, _sfc_main$j as Flash, _sfc_main$r as InputHelp, _sfc_main$s as InputLabel, _sfc_main$i as Modal, _sfc_main$3 as MultiCheckboxes, _sfc_main$m as Paginator, _sfc_main$f as Popover, PopoverContent, _sfc_main$f as PopoverPosition, _sfc_main$2 as Radio, _sfc_main$o as Select, _sfc_main$g as SidebarLayout, _sfc_main$d as Slideover, _sfc_main$h as Spinner, _sfc_main$b as StackedLayout, _sfc_main$a as StaticTable, _sfc_main$9 as Steps, _sfc_main$8 as Table, _sfc_main$7 as Tabs, _sfc_main$1 as TextArea, _sfc_main$6 as Toggle, _sfc_main$c as Tooltip, _sfc_main as YesOrNoRadio, install as default, useBaseAPI, useBaseAPIDelete, useBaseAPIGet, useBaseAPIPost, useBaseAPIPut };
|