@eodash/eodash 5.5.2 → 5.6.0
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/core/client/App.vue +1 -1
- package/core/client/eodashSTAC/EodashCollection.js +7 -4
- package/core/client/eodashSTAC/auth.js +19 -9
- package/core/client/eodashSTAC/createLayers.js +130 -24
- package/core/client/eodashSTAC/helpers.js +23 -56
- package/core/client/store/stac.js +9 -0
- package/core/client/types.ts +1 -0
- package/dist/client/{DashboardLayout-BAB1tPv0.js → DashboardLayout-DkKDhfgH.js} +3 -3
- package/dist/client/{DynamicWebComponent-qVeu4sqS.js → DynamicWebComponent-BrpkA-e3.js} +2 -2
- package/dist/client/{EodashChart-CXnNxlhk.js → EodashChart-p7_1FRlF.js} +5 -5
- package/dist/client/{EodashDatePicker-KyJXPgAq.js → EodashDatePicker-HK0Jl7wQ.js} +4 -4
- package/dist/client/{EodashItemFilter-CAlyUnje.js → EodashItemFilter-BYQDA78B.js} +2 -2
- package/dist/client/{EodashLayerControl-D8VobuZJ.js → EodashLayerControl-NcrNncGn.js} +18 -4
- package/dist/client/{EodashLayoutSwitcher-DI6uGF_7.js → EodashLayoutSwitcher-CC2Znd0I.js} +4 -4
- package/dist/client/EodashMapBtns-BJSh7qT-.js +435 -0
- package/dist/client/{EodashStacInfo-Cb28jVEr.js → EodashStacInfo-BA-0UjvT.js} +42 -7
- package/dist/client/{EodashTimeSlider-UIpnhO4N.js → EodashTimeSlider-GDv1hbw7.js} +3 -3
- package/dist/client/{EodashTools-vxReGN8p.js → EodashTools-CWmoH0g_.js} +5 -5
- package/dist/client/{ExportState-D6CBpKUU.js → ExportState-CfAfX4RN.js} +9 -7
- package/dist/client/{Footer-CUgMupXk.js → Footer-DLGxQTZt.js} +2 -2
- package/dist/client/{Header-BZ53ACvp.js → Header-eyEyyzD6.js} +10 -6
- package/dist/client/{IframeWrapper-XzQDZy0T.js → IframeWrapper-BgM9aU8f.js} +1 -1
- package/dist/client/MobileLayout-RzLOyXwL.js +118 -0
- package/dist/client/{PopUp-C6HJH8wM.js → PopUp-WNs6Io2N.js} +3 -3
- package/dist/client/{ProcessList-DQjvv7Cc.js → ProcessList-RzVqbd5E.js} +5 -5
- package/dist/client/{VImg-CWCCg87G.js → VImg-GKUTFoV-.js} +51 -22
- package/dist/client/{VMain-CAzXMN4O.js → VMain-D7_72mHr.js} +1 -1
- package/dist/client/{VTooltip-B1_FzBl_.js → VTooltip-BbmvtvYw.js} +2 -2
- package/dist/client/{WidgetsContainer-Bc8pGq_X.js → WidgetsContainer-Dw5d7SOW.js} +2 -2
- package/dist/client/asWebComponent-DDt7V3Bl.js +9383 -0
- package/dist/client/{async-Byq11ZKl.js → async-CT3KEV52.js} +24 -33
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-D3na5VY2.js → forwardRefs-CVzxyoSq.js} +2 -2
- package/dist/client/{handling-7IVxQxtQ.js → handling-C285F_Mq.js} +3 -3
- package/dist/client/{helpers-Bi-qmnbZ.js → helpers-CZFH0EVN.js} +349 -316
- package/dist/client/{index-Ch4PgFGP.js → index-B-m7V3Kb.js} +24 -11
- package/dist/client/{index-FQrkgCu_.js → index-B_6H-N14.js} +7 -7
- package/dist/client/{index-Dk5_G7Aw.js → index-CF3ZMzTz.js} +4 -4
- package/dist/client/{index-CJOvBxMx.js → index-DgOXD7wd.js} +2 -2
- package/dist/client/templates.js +6 -15
- package/dist/client/{transition-Bp5R_Vzd.js → transition-C2gnrWg0.js} +1 -1
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +2 -5
- package/dist/types/core/client/eodashSTAC/auth.d.ts +6 -2
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +1 -4
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +1 -2
- package/dist/types/core/client/store/stac.d.ts +4 -1
- package/dist/types/core/client/types.d.ts +1 -0
- package/dist/types/templates/baseConfig.d.ts +1 -0
- package/dist/types/widgets/EodashMap/methods/index.d.ts +1 -1
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +140 -25
- package/package.json +31 -31
- package/templates/baseConfig.js +5 -14
- package/widgets/EodashMap/EodashMapBtns.vue +15 -12
- package/widgets/EodashMap/index.vue +5 -1
- package/widgets/EodashMap/methods/index.js +13 -4
- package/widgets/EodashProcess/methods/utils.js +22 -31
- package/widgets/EodashStacInfo.vue +40 -5
- package/dist/client/EodashMapBtns-BjF8Yrpd.js +0 -433
- package/dist/client/MobileLayout-jnu24OJM.js +0 -118
- package/dist/client/asWebComponent-C-6K08Kk.js +0 -9206
|
@@ -18,30 +18,30 @@ function bind(fn, thisArg) {
|
|
|
18
18
|
|
|
19
19
|
// utils is a library of generic helper functions non-specific to axios
|
|
20
20
|
|
|
21
|
-
const {toString} = Object.prototype;
|
|
22
|
-
const {getPrototypeOf} = Object;
|
|
23
|
-
const {iterator, toStringTag} = Symbol;
|
|
21
|
+
const { toString } = Object.prototype;
|
|
22
|
+
const { getPrototypeOf } = Object;
|
|
23
|
+
const { iterator, toStringTag } = Symbol;
|
|
24
24
|
|
|
25
|
-
const kindOf = (cache => thing => {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const kindOf = ((cache) => (thing) => {
|
|
26
|
+
const str = toString.call(thing);
|
|
27
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
28
28
|
})(Object.create(null));
|
|
29
29
|
|
|
30
30
|
const kindOfTest = (type) => {
|
|
31
31
|
type = type.toLowerCase();
|
|
32
|
-
return (thing) => kindOf(thing) === type
|
|
32
|
+
return (thing) => kindOf(thing) === type;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const typeOfTest = type => thing => typeof thing === type;
|
|
35
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Determine if a value is
|
|
38
|
+
* Determine if a value is a non-null object
|
|
39
39
|
*
|
|
40
40
|
* @param {Object} val The value to test
|
|
41
41
|
*
|
|
42
42
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
43
43
|
*/
|
|
44
|
-
const {isArray} = Array;
|
|
44
|
+
const { isArray } = Array;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Determine if a value is undefined
|
|
@@ -50,7 +50,7 @@ const {isArray} = Array;
|
|
|
50
50
|
*
|
|
51
51
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
52
52
|
*/
|
|
53
|
-
const isUndefined = typeOfTest(
|
|
53
|
+
const isUndefined = typeOfTest("undefined");
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Determine if a value is a Buffer
|
|
@@ -60,8 +60,14 @@ const isUndefined = typeOfTest('undefined');
|
|
|
60
60
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
61
61
|
*/
|
|
62
62
|
function isBuffer(val) {
|
|
63
|
-
return
|
|
64
|
-
|
|
63
|
+
return (
|
|
64
|
+
val !== null &&
|
|
65
|
+
!isUndefined(val) &&
|
|
66
|
+
val.constructor !== null &&
|
|
67
|
+
!isUndefined(val.constructor) &&
|
|
68
|
+
isFunction$1(val.constructor.isBuffer) &&
|
|
69
|
+
val.constructor.isBuffer(val)
|
|
70
|
+
);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -71,8 +77,7 @@ function isBuffer(val) {
|
|
|
71
77
|
*
|
|
72
78
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
73
79
|
*/
|
|
74
|
-
const isArrayBuffer = kindOfTest(
|
|
75
|
-
|
|
80
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
76
81
|
|
|
77
82
|
/**
|
|
78
83
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -83,10 +88,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
83
88
|
*/
|
|
84
89
|
function isArrayBufferView(val) {
|
|
85
90
|
let result;
|
|
86
|
-
if (
|
|
91
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
87
92
|
result = ArrayBuffer.isView(val);
|
|
88
93
|
} else {
|
|
89
|
-
result =
|
|
94
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
90
95
|
}
|
|
91
96
|
return result;
|
|
92
97
|
}
|
|
@@ -98,7 +103,7 @@ function isArrayBufferView(val) {
|
|
|
98
103
|
*
|
|
99
104
|
* @returns {boolean} True if value is a String, otherwise false
|
|
100
105
|
*/
|
|
101
|
-
const isString = typeOfTest(
|
|
106
|
+
const isString = typeOfTest("string");
|
|
102
107
|
|
|
103
108
|
/**
|
|
104
109
|
* Determine if a value is a Function
|
|
@@ -106,7 +111,7 @@ const isString = typeOfTest('string');
|
|
|
106
111
|
* @param {*} val The value to test
|
|
107
112
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
108
113
|
*/
|
|
109
|
-
const isFunction$1 = typeOfTest(
|
|
114
|
+
const isFunction$1 = typeOfTest("function");
|
|
110
115
|
|
|
111
116
|
/**
|
|
112
117
|
* Determine if a value is a Number
|
|
@@ -115,7 +120,7 @@ const isFunction$1 = typeOfTest('function');
|
|
|
115
120
|
*
|
|
116
121
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
117
122
|
*/
|
|
118
|
-
const isNumber = typeOfTest(
|
|
123
|
+
const isNumber = typeOfTest("number");
|
|
119
124
|
|
|
120
125
|
/**
|
|
121
126
|
* Determine if a value is an Object
|
|
@@ -124,7 +129,7 @@ const isNumber = typeOfTest('number');
|
|
|
124
129
|
*
|
|
125
130
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
126
131
|
*/
|
|
127
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
132
|
+
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
128
133
|
|
|
129
134
|
/**
|
|
130
135
|
* Determine if a value is a Boolean
|
|
@@ -132,7 +137,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
|
132
137
|
* @param {*} thing The value to test
|
|
133
138
|
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
134
139
|
*/
|
|
135
|
-
const isBoolean = thing => thing === true || thing === false;
|
|
140
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
136
141
|
|
|
137
142
|
/**
|
|
138
143
|
* Determine if a value is a plain Object
|
|
@@ -142,12 +147,18 @@ const isBoolean = thing => thing === true || thing === false;
|
|
|
142
147
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
143
148
|
*/
|
|
144
149
|
const isPlainObject = (val) => {
|
|
145
|
-
if (kindOf(val) !==
|
|
150
|
+
if (kindOf(val) !== "object") {
|
|
146
151
|
return false;
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
const prototype = getPrototypeOf(val);
|
|
150
|
-
return (
|
|
155
|
+
return (
|
|
156
|
+
(prototype === null ||
|
|
157
|
+
prototype === Object.prototype ||
|
|
158
|
+
Object.getPrototypeOf(prototype) === null) &&
|
|
159
|
+
!(toStringTag in val) &&
|
|
160
|
+
!(iterator in val)
|
|
161
|
+
);
|
|
151
162
|
};
|
|
152
163
|
|
|
153
164
|
/**
|
|
@@ -164,7 +175,10 @@ const isEmptyObject = (val) => {
|
|
|
164
175
|
}
|
|
165
176
|
|
|
166
177
|
try {
|
|
167
|
-
return
|
|
178
|
+
return (
|
|
179
|
+
Object.keys(val).length === 0 &&
|
|
180
|
+
Object.getPrototypeOf(val) === Object.prototype
|
|
181
|
+
);
|
|
168
182
|
} catch (e) {
|
|
169
183
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
170
184
|
return false;
|
|
@@ -178,7 +192,7 @@ const isEmptyObject = (val) => {
|
|
|
178
192
|
*
|
|
179
193
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
180
194
|
*/
|
|
181
|
-
const isDate = kindOfTest(
|
|
195
|
+
const isDate = kindOfTest("Date");
|
|
182
196
|
|
|
183
197
|
/**
|
|
184
198
|
* Determine if a value is a File
|
|
@@ -187,7 +201,7 @@ const isDate = kindOfTest('Date');
|
|
|
187
201
|
*
|
|
188
202
|
* @returns {boolean} True if value is a File, otherwise false
|
|
189
203
|
*/
|
|
190
|
-
const isFile = kindOfTest(
|
|
204
|
+
const isFile = kindOfTest("File");
|
|
191
205
|
|
|
192
206
|
/**
|
|
193
207
|
* Determine if a value is a Blob
|
|
@@ -196,7 +210,7 @@ const isFile = kindOfTest('File');
|
|
|
196
210
|
*
|
|
197
211
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
198
212
|
*/
|
|
199
|
-
const isBlob = kindOfTest(
|
|
213
|
+
const isBlob = kindOfTest("Blob");
|
|
200
214
|
|
|
201
215
|
/**
|
|
202
216
|
* Determine if a value is a FileList
|
|
@@ -205,7 +219,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
205
219
|
*
|
|
206
220
|
* @returns {boolean} True if value is a File, otherwise false
|
|
207
221
|
*/
|
|
208
|
-
const isFileList = kindOfTest(
|
|
222
|
+
const isFileList = kindOfTest("FileList");
|
|
209
223
|
|
|
210
224
|
/**
|
|
211
225
|
* Determine if a value is a Stream
|
|
@@ -225,15 +239,16 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
225
239
|
*/
|
|
226
240
|
const isFormData = (thing) => {
|
|
227
241
|
let kind;
|
|
228
|
-
return
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
return (
|
|
243
|
+
thing &&
|
|
244
|
+
((typeof FormData === "function" && thing instanceof FormData) ||
|
|
245
|
+
(isFunction$1(thing.append) &&
|
|
246
|
+
((kind = kindOf(thing)) === "formdata" ||
|
|
247
|
+
// detect form-data instance
|
|
248
|
+
(kind === "object" &&
|
|
249
|
+
isFunction$1(thing.toString) &&
|
|
250
|
+
thing.toString() === "[object FormData]"))))
|
|
251
|
+
);
|
|
237
252
|
};
|
|
238
253
|
|
|
239
254
|
/**
|
|
@@ -243,9 +258,14 @@ const isFormData = (thing) => {
|
|
|
243
258
|
*
|
|
244
259
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
245
260
|
*/
|
|
246
|
-
const isURLSearchParams = kindOfTest(
|
|
261
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
247
262
|
|
|
248
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
263
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
264
|
+
"ReadableStream",
|
|
265
|
+
"Request",
|
|
266
|
+
"Response",
|
|
267
|
+
"Headers",
|
|
268
|
+
].map(kindOfTest);
|
|
249
269
|
|
|
250
270
|
/**
|
|
251
271
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -254,8 +274,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
254
274
|
*
|
|
255
275
|
* @returns {String} The String freed of excess whitespace
|
|
256
276
|
*/
|
|
257
|
-
const trim = (str) =>
|
|
258
|
-
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
277
|
+
const trim = (str) =>
|
|
278
|
+
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
259
279
|
|
|
260
280
|
/**
|
|
261
281
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
@@ -266,15 +286,16 @@ const trim = (str) => str.trim ?
|
|
|
266
286
|
* If 'obj' is an Object callback will be called passing
|
|
267
287
|
* the value, key, and complete object for each property.
|
|
268
288
|
*
|
|
269
|
-
* @param {Object|Array} obj The object to iterate
|
|
289
|
+
* @param {Object|Array<unknown>} obj The object to iterate
|
|
270
290
|
* @param {Function} fn The callback to invoke for each item
|
|
271
291
|
*
|
|
272
|
-
* @param {
|
|
292
|
+
* @param {Object} [options]
|
|
293
|
+
* @param {Boolean} [options.allOwnKeys = false]
|
|
273
294
|
* @returns {any}
|
|
274
295
|
*/
|
|
275
|
-
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
296
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
276
297
|
// Don't bother if no value provided
|
|
277
|
-
if (obj === null || typeof obj ===
|
|
298
|
+
if (obj === null || typeof obj === "undefined") {
|
|
278
299
|
return;
|
|
279
300
|
}
|
|
280
301
|
|
|
@@ -282,7 +303,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
282
303
|
let l;
|
|
283
304
|
|
|
284
305
|
// Force an array if not already something iterable
|
|
285
|
-
if (typeof obj !==
|
|
306
|
+
if (typeof obj !== "object") {
|
|
286
307
|
/*eslint no-param-reassign:0*/
|
|
287
308
|
obj = [obj];
|
|
288
309
|
}
|
|
@@ -299,7 +320,9 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
299
320
|
}
|
|
300
321
|
|
|
301
322
|
// Iterate over object keys
|
|
302
|
-
const keys = allOwnKeys
|
|
323
|
+
const keys = allOwnKeys
|
|
324
|
+
? Object.getOwnPropertyNames(obj)
|
|
325
|
+
: Object.keys(obj);
|
|
303
326
|
const len = keys.length;
|
|
304
327
|
let key;
|
|
305
328
|
|
|
@@ -311,7 +334,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
311
334
|
}
|
|
312
335
|
|
|
313
336
|
function findKey(obj, key) {
|
|
314
|
-
if (isBuffer(obj)){
|
|
337
|
+
if (isBuffer(obj)) {
|
|
315
338
|
return null;
|
|
316
339
|
}
|
|
317
340
|
|
|
@@ -331,10 +354,15 @@ function findKey(obj, key) {
|
|
|
331
354
|
const _global = (() => {
|
|
332
355
|
/*eslint no-undef:0*/
|
|
333
356
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
334
|
-
return typeof self !== "undefined"
|
|
357
|
+
return typeof self !== "undefined"
|
|
358
|
+
? self
|
|
359
|
+
: typeof window !== "undefined"
|
|
360
|
+
? window
|
|
361
|
+
: global;
|
|
335
362
|
})();
|
|
336
363
|
|
|
337
|
-
const isContextDefined = (context) =>
|
|
364
|
+
const isContextDefined = (context) =>
|
|
365
|
+
!isUndefined(context) && context !== _global;
|
|
338
366
|
|
|
339
367
|
/**
|
|
340
368
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -346,7 +374,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
346
374
|
* Example:
|
|
347
375
|
*
|
|
348
376
|
* ```js
|
|
349
|
-
*
|
|
377
|
+
* const result = merge({foo: 123}, {foo: 456});
|
|
350
378
|
* console.log(result.foo); // outputs 456
|
|
351
379
|
* ```
|
|
352
380
|
*
|
|
@@ -355,10 +383,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
355
383
|
* @returns {Object} Result of all merge properties
|
|
356
384
|
*/
|
|
357
385
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
358
|
-
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
386
|
+
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
359
387
|
const result = {};
|
|
360
388
|
const assignValue = (val, key) => {
|
|
361
|
-
|
|
389
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
390
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const targetKey = (caseless && findKey(result, key)) || key;
|
|
362
395
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
363
396
|
result[targetKey] = merge(result[targetKey], val);
|
|
364
397
|
} else if (isPlainObject(val)) {
|
|
@@ -383,17 +416,32 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
383
416
|
* @param {Object} b The object to copy properties from
|
|
384
417
|
* @param {Object} thisArg The object to bind function to
|
|
385
418
|
*
|
|
386
|
-
* @param {
|
|
419
|
+
* @param {Object} [options]
|
|
420
|
+
* @param {Boolean} [options.allOwnKeys]
|
|
387
421
|
* @returns {Object} The resulting value of object a
|
|
388
422
|
*/
|
|
389
|
-
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
390
|
-
forEach(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
423
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
424
|
+
forEach(
|
|
425
|
+
b,
|
|
426
|
+
(val, key) => {
|
|
427
|
+
if (thisArg && isFunction$1(val)) {
|
|
428
|
+
Object.defineProperty(a, key, {
|
|
429
|
+
value: bind(val, thisArg),
|
|
430
|
+
writable: true,
|
|
431
|
+
enumerable: true,
|
|
432
|
+
configurable: true,
|
|
433
|
+
});
|
|
434
|
+
} else {
|
|
435
|
+
Object.defineProperty(a, key, {
|
|
436
|
+
value: val,
|
|
437
|
+
writable: true,
|
|
438
|
+
enumerable: true,
|
|
439
|
+
configurable: true,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{ allOwnKeys },
|
|
444
|
+
);
|
|
397
445
|
return a;
|
|
398
446
|
};
|
|
399
447
|
|
|
@@ -405,7 +453,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
|
405
453
|
* @returns {string} content value without BOM
|
|
406
454
|
*/
|
|
407
455
|
const stripBOM = (content) => {
|
|
408
|
-
if (content.charCodeAt(0) ===
|
|
456
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
409
457
|
content = content.slice(1);
|
|
410
458
|
}
|
|
411
459
|
return content;
|
|
@@ -421,10 +469,18 @@ const stripBOM = (content) => {
|
|
|
421
469
|
* @returns {void}
|
|
422
470
|
*/
|
|
423
471
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
424
|
-
constructor.prototype = Object.create(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
472
|
+
constructor.prototype = Object.create(
|
|
473
|
+
superConstructor.prototype,
|
|
474
|
+
descriptors,
|
|
475
|
+
);
|
|
476
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
477
|
+
value: constructor,
|
|
478
|
+
writable: true,
|
|
479
|
+
enumerable: false,
|
|
480
|
+
configurable: true,
|
|
481
|
+
});
|
|
482
|
+
Object.defineProperty(constructor, "super", {
|
|
483
|
+
value: superConstructor.prototype,
|
|
428
484
|
});
|
|
429
485
|
props && Object.assign(constructor.prototype, props);
|
|
430
486
|
};
|
|
@@ -453,13 +509,20 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
|
453
509
|
i = props.length;
|
|
454
510
|
while (i-- > 0) {
|
|
455
511
|
prop = props[i];
|
|
456
|
-
if (
|
|
512
|
+
if (
|
|
513
|
+
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
514
|
+
!merged[prop]
|
|
515
|
+
) {
|
|
457
516
|
destObj[prop] = sourceObj[prop];
|
|
458
517
|
merged[prop] = true;
|
|
459
518
|
}
|
|
460
519
|
}
|
|
461
520
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
462
|
-
} while (
|
|
521
|
+
} while (
|
|
522
|
+
sourceObj &&
|
|
523
|
+
(!filter || filter(sourceObj, destObj)) &&
|
|
524
|
+
sourceObj !== Object.prototype
|
|
525
|
+
);
|
|
463
526
|
|
|
464
527
|
return destObj;
|
|
465
528
|
};
|
|
@@ -483,7 +546,6 @@ const endsWith = (str, searchString, position) => {
|
|
|
483
546
|
return lastIndex !== -1 && lastIndex === position;
|
|
484
547
|
};
|
|
485
548
|
|
|
486
|
-
|
|
487
549
|
/**
|
|
488
550
|
* Returns new array from array like object or null if failed
|
|
489
551
|
*
|
|
@@ -512,12 +574,12 @@ const toArray = (thing) => {
|
|
|
512
574
|
* @returns {Array}
|
|
513
575
|
*/
|
|
514
576
|
// eslint-disable-next-line func-names
|
|
515
|
-
const isTypedArray = (TypedArray => {
|
|
577
|
+
const isTypedArray = ((TypedArray) => {
|
|
516
578
|
// eslint-disable-next-line func-names
|
|
517
|
-
return thing => {
|
|
579
|
+
return (thing) => {
|
|
518
580
|
return TypedArray && thing instanceof TypedArray;
|
|
519
581
|
};
|
|
520
|
-
})(typeof Uint8Array !==
|
|
582
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
521
583
|
|
|
522
584
|
/**
|
|
523
585
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -560,18 +622,22 @@ const matchAll = (regExp, str) => {
|
|
|
560
622
|
};
|
|
561
623
|
|
|
562
624
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
563
|
-
const isHTMLForm = kindOfTest(
|
|
625
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
564
626
|
|
|
565
|
-
const toCamelCase = str => {
|
|
566
|
-
return str
|
|
567
|
-
|
|
627
|
+
const toCamelCase = (str) => {
|
|
628
|
+
return str
|
|
629
|
+
.toLowerCase()
|
|
630
|
+
.replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
568
631
|
return p1.toUpperCase() + p2;
|
|
569
|
-
}
|
|
570
|
-
);
|
|
632
|
+
});
|
|
571
633
|
};
|
|
572
634
|
|
|
573
635
|
/* Creating a function that will check if an object has a property. */
|
|
574
|
-
const hasOwnProperty = (
|
|
636
|
+
const hasOwnProperty = (
|
|
637
|
+
({ hasOwnProperty }) =>
|
|
638
|
+
(obj, prop) =>
|
|
639
|
+
hasOwnProperty.call(obj, prop)
|
|
640
|
+
)(Object.prototype);
|
|
575
641
|
|
|
576
642
|
/**
|
|
577
643
|
* Determine if a value is a RegExp object
|
|
@@ -580,7 +646,7 @@ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call
|
|
|
580
646
|
*
|
|
581
647
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
582
648
|
*/
|
|
583
|
-
const isRegExp = kindOfTest(
|
|
649
|
+
const isRegExp = kindOfTest("RegExp");
|
|
584
650
|
|
|
585
651
|
const reduceDescriptors = (obj, reducer) => {
|
|
586
652
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -604,7 +670,10 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
604
670
|
const freezeMethods = (obj) => {
|
|
605
671
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
606
672
|
// skip restricted props in strict mode
|
|
607
|
-
if (
|
|
673
|
+
if (
|
|
674
|
+
isFunction$1(obj) &&
|
|
675
|
+
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
676
|
+
) {
|
|
608
677
|
return false;
|
|
609
678
|
}
|
|
610
679
|
|
|
@@ -614,14 +683,14 @@ const freezeMethods = (obj) => {
|
|
|
614
683
|
|
|
615
684
|
descriptor.enumerable = false;
|
|
616
685
|
|
|
617
|
-
if (
|
|
686
|
+
if ("writable" in descriptor) {
|
|
618
687
|
descriptor.writable = false;
|
|
619
688
|
return;
|
|
620
689
|
}
|
|
621
690
|
|
|
622
691
|
if (!descriptor.set) {
|
|
623
692
|
descriptor.set = () => {
|
|
624
|
-
throw Error(
|
|
693
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
625
694
|
};
|
|
626
695
|
}
|
|
627
696
|
});
|
|
@@ -631,12 +700,14 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
631
700
|
const obj = {};
|
|
632
701
|
|
|
633
702
|
const define = (arr) => {
|
|
634
|
-
arr.forEach(value => {
|
|
703
|
+
arr.forEach((value) => {
|
|
635
704
|
obj[value] = true;
|
|
636
705
|
});
|
|
637
706
|
};
|
|
638
707
|
|
|
639
|
-
isArray(arrayOrString)
|
|
708
|
+
isArray(arrayOrString)
|
|
709
|
+
? define(arrayOrString)
|
|
710
|
+
: define(String(arrayOrString).split(delimiter));
|
|
640
711
|
|
|
641
712
|
return obj;
|
|
642
713
|
};
|
|
@@ -644,11 +715,11 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
644
715
|
const noop = () => {};
|
|
645
716
|
|
|
646
717
|
const toFiniteNumber = (value, defaultValue) => {
|
|
647
|
-
return value != null && Number.isFinite(value = +value)
|
|
718
|
+
return value != null && Number.isFinite((value = +value))
|
|
719
|
+
? value
|
|
720
|
+
: defaultValue;
|
|
648
721
|
};
|
|
649
722
|
|
|
650
|
-
|
|
651
|
-
|
|
652
723
|
/**
|
|
653
724
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
654
725
|
*
|
|
@@ -657,14 +728,18 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
657
728
|
* @returns {boolean}
|
|
658
729
|
*/
|
|
659
730
|
function isSpecCompliantForm(thing) {
|
|
660
|
-
return !!(
|
|
731
|
+
return !!(
|
|
732
|
+
thing &&
|
|
733
|
+
isFunction$1(thing.append) &&
|
|
734
|
+
thing[toStringTag] === "FormData" &&
|
|
735
|
+
thing[iterator]
|
|
736
|
+
);
|
|
661
737
|
}
|
|
662
738
|
|
|
663
739
|
const toJSONObject = (obj) => {
|
|
664
740
|
const stack = new Array(10);
|
|
665
741
|
|
|
666
742
|
const visit = (source, i) => {
|
|
667
|
-
|
|
668
743
|
if (isObject(source)) {
|
|
669
744
|
if (stack.indexOf(source) >= 0) {
|
|
670
745
|
return;
|
|
@@ -675,7 +750,7 @@ const toJSONObject = (obj) => {
|
|
|
675
750
|
return source;
|
|
676
751
|
}
|
|
677
752
|
|
|
678
|
-
if(!(
|
|
753
|
+
if (!("toJSON" in source)) {
|
|
679
754
|
stack[i] = source;
|
|
680
755
|
const target = isArray(source) ? [] : {};
|
|
681
756
|
|
|
@@ -696,10 +771,13 @@ const toJSONObject = (obj) => {
|
|
|
696
771
|
return visit(obj, 0);
|
|
697
772
|
};
|
|
698
773
|
|
|
699
|
-
const isAsyncFn = kindOfTest(
|
|
774
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
700
775
|
|
|
701
776
|
const isThenable = (thing) =>
|
|
702
|
-
thing &&
|
|
777
|
+
thing &&
|
|
778
|
+
(isObject(thing) || isFunction$1(thing)) &&
|
|
779
|
+
isFunction$1(thing.then) &&
|
|
780
|
+
isFunction$1(thing.catch);
|
|
703
781
|
|
|
704
782
|
// original code
|
|
705
783
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -709,32 +787,35 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
709
787
|
return setImmediate;
|
|
710
788
|
}
|
|
711
789
|
|
|
712
|
-
return postMessageSupported
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
790
|
+
return postMessageSupported
|
|
791
|
+
? ((token, callbacks) => {
|
|
792
|
+
_global.addEventListener(
|
|
793
|
+
"message",
|
|
794
|
+
({ source, data }) => {
|
|
795
|
+
if (source === _global && data === token) {
|
|
796
|
+
callbacks.length && callbacks.shift()();
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
false,
|
|
800
|
+
);
|
|
718
801
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
isFunction$1(_global.postMessage)
|
|
727
|
-
);
|
|
802
|
+
return (cb) => {
|
|
803
|
+
callbacks.push(cb);
|
|
804
|
+
_global.postMessage(token, "*");
|
|
805
|
+
};
|
|
806
|
+
})(`axios@${Math.random()}`, [])
|
|
807
|
+
: (cb) => setTimeout(cb);
|
|
808
|
+
})(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
728
809
|
|
|
729
|
-
const asap =
|
|
730
|
-
|
|
810
|
+
const asap =
|
|
811
|
+
typeof queueMicrotask !== "undefined"
|
|
812
|
+
? queueMicrotask.bind(_global)
|
|
813
|
+
: (typeof process !== "undefined" && process.nextTick) || _setImmediate;
|
|
731
814
|
|
|
732
815
|
// *********************
|
|
733
816
|
|
|
734
|
-
|
|
735
817
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
736
818
|
|
|
737
|
-
|
|
738
819
|
const utils$1 = {
|
|
739
820
|
isArray,
|
|
740
821
|
isArrayBuffer,
|
|
@@ -792,113 +873,76 @@ const utils$1 = {
|
|
|
792
873
|
isThenable,
|
|
793
874
|
setImmediate: _setImmediate,
|
|
794
875
|
asap,
|
|
795
|
-
isIterable
|
|
876
|
+
isIterable,
|
|
796
877
|
};
|
|
797
878
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
*
|
|
807
|
-
* @returns {Error} The created error.
|
|
808
|
-
*/
|
|
809
|
-
function AxiosError(message, code, config, request, response) {
|
|
810
|
-
Error.call(this);
|
|
879
|
+
class AxiosError extends Error {
|
|
880
|
+
static from(error, code, config, request, response, customProps) {
|
|
881
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
882
|
+
axiosError.cause = error;
|
|
883
|
+
axiosError.name = error.name;
|
|
884
|
+
customProps && Object.assign(axiosError, customProps);
|
|
885
|
+
return axiosError;
|
|
886
|
+
}
|
|
811
887
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
888
|
+
/**
|
|
889
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
890
|
+
*
|
|
891
|
+
* @param {string} message The error message.
|
|
892
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
893
|
+
* @param {Object} [config] The config.
|
|
894
|
+
* @param {Object} [request] The request.
|
|
895
|
+
* @param {Object} [response] The response.
|
|
896
|
+
*
|
|
897
|
+
* @returns {Error} The created error.
|
|
898
|
+
*/
|
|
899
|
+
constructor(message, code, config, request, response) {
|
|
900
|
+
super(message);
|
|
901
|
+
this.name = 'AxiosError';
|
|
902
|
+
this.isAxiosError = true;
|
|
903
|
+
code && (this.code = code);
|
|
904
|
+
config && (this.config = config);
|
|
905
|
+
request && (this.request = request);
|
|
906
|
+
if (response) {
|
|
907
|
+
this.response = response;
|
|
908
|
+
this.status = response.status;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
817
911
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
912
|
+
toJSON() {
|
|
913
|
+
return {
|
|
914
|
+
// Standard
|
|
915
|
+
message: this.message,
|
|
916
|
+
name: this.name,
|
|
917
|
+
// Microsoft
|
|
918
|
+
description: this.description,
|
|
919
|
+
number: this.number,
|
|
920
|
+
// Mozilla
|
|
921
|
+
fileName: this.fileName,
|
|
922
|
+
lineNumber: this.lineNumber,
|
|
923
|
+
columnNumber: this.columnNumber,
|
|
924
|
+
stack: this.stack,
|
|
925
|
+
// Axios
|
|
926
|
+
config: utils$1.toJSONObject(this.config),
|
|
927
|
+
code: this.code,
|
|
928
|
+
status: this.status,
|
|
929
|
+
};
|
|
930
|
+
}
|
|
827
931
|
}
|
|
828
932
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
stack: this.stack,
|
|
843
|
-
// Axios
|
|
844
|
-
config: utils$1.toJSONObject(this.config),
|
|
845
|
-
code: this.code,
|
|
846
|
-
status: this.status
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
|
|
851
|
-
const prototype$1 = AxiosError.prototype;
|
|
852
|
-
const descriptors = {};
|
|
853
|
-
|
|
854
|
-
[
|
|
855
|
-
'ERR_BAD_OPTION_VALUE',
|
|
856
|
-
'ERR_BAD_OPTION',
|
|
857
|
-
'ECONNABORTED',
|
|
858
|
-
'ETIMEDOUT',
|
|
859
|
-
'ERR_NETWORK',
|
|
860
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
861
|
-
'ERR_DEPRECATED',
|
|
862
|
-
'ERR_BAD_RESPONSE',
|
|
863
|
-
'ERR_BAD_REQUEST',
|
|
864
|
-
'ERR_CANCELED',
|
|
865
|
-
'ERR_NOT_SUPPORT',
|
|
866
|
-
'ERR_INVALID_URL'
|
|
867
|
-
// eslint-disable-next-line func-names
|
|
868
|
-
].forEach(code => {
|
|
869
|
-
descriptors[code] = {value: code};
|
|
870
|
-
});
|
|
871
|
-
|
|
872
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
873
|
-
Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
874
|
-
|
|
875
|
-
// eslint-disable-next-line func-names
|
|
876
|
-
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
877
|
-
const axiosError = Object.create(prototype$1);
|
|
878
|
-
|
|
879
|
-
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
880
|
-
return obj !== Error.prototype;
|
|
881
|
-
}, prop => {
|
|
882
|
-
return prop !== 'isAxiosError';
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
const msg = error && error.message ? error.message : 'Error';
|
|
886
|
-
|
|
887
|
-
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
888
|
-
const errCode = code == null && error ? error.code : code;
|
|
889
|
-
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
890
|
-
|
|
891
|
-
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
892
|
-
if (error && axiosError.cause == null) {
|
|
893
|
-
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
axiosError.name = (error && error.name) || 'Error';
|
|
897
|
-
|
|
898
|
-
customProps && Object.assign(axiosError, customProps);
|
|
899
|
-
|
|
900
|
-
return axiosError;
|
|
901
|
-
};
|
|
933
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
934
|
+
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
935
|
+
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
936
|
+
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
|
937
|
+
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
|
938
|
+
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
|
939
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
940
|
+
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
941
|
+
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
942
|
+
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
943
|
+
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
944
|
+
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
945
|
+
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
902
946
|
|
|
903
947
|
// eslint-disable-next-line strict
|
|
904
948
|
const httpAdapter = null;
|
|
@@ -1197,29 +1241,26 @@ function encode(val) {
|
|
|
1197
1241
|
* @returns {string} The formatted url
|
|
1198
1242
|
*/
|
|
1199
1243
|
function buildURL(url, params, options) {
|
|
1200
|
-
/*eslint no-param-reassign:0*/
|
|
1201
1244
|
if (!params) {
|
|
1202
1245
|
return url;
|
|
1203
1246
|
}
|
|
1204
|
-
|
|
1247
|
+
|
|
1205
1248
|
const _encode = options && options.encode || encode;
|
|
1206
1249
|
|
|
1207
|
-
|
|
1208
|
-
options
|
|
1209
|
-
|
|
1210
|
-
};
|
|
1211
|
-
}
|
|
1250
|
+
const _options = utils$1.isFunction(options) ? {
|
|
1251
|
+
serialize: options
|
|
1252
|
+
} : options;
|
|
1212
1253
|
|
|
1213
|
-
const serializeFn =
|
|
1254
|
+
const serializeFn = _options && _options.serialize;
|
|
1214
1255
|
|
|
1215
1256
|
let serializedParams;
|
|
1216
1257
|
|
|
1217
1258
|
if (serializeFn) {
|
|
1218
|
-
serializedParams = serializeFn(params,
|
|
1259
|
+
serializedParams = serializeFn(params, _options);
|
|
1219
1260
|
} else {
|
|
1220
1261
|
serializedParams = utils$1.isURLSearchParams(params) ?
|
|
1221
1262
|
params.toString() :
|
|
1222
|
-
new AxiosURLSearchParams(params,
|
|
1263
|
+
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
1223
1264
|
}
|
|
1224
1265
|
|
|
1225
1266
|
if (serializedParams) {
|
|
@@ -1244,6 +1285,7 @@ class InterceptorManager {
|
|
|
1244
1285
|
*
|
|
1245
1286
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1246
1287
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1288
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
1247
1289
|
*
|
|
1248
1290
|
* @return {Number} An ID used to remove interceptor later
|
|
1249
1291
|
*/
|
|
@@ -1303,7 +1345,8 @@ class InterceptorManager {
|
|
|
1303
1345
|
const transitionalDefaults = {
|
|
1304
1346
|
silentJSONParsing: true,
|
|
1305
1347
|
forcedJSONParsing: true,
|
|
1306
|
-
clarifyTimeoutError: false
|
|
1348
|
+
clarifyTimeoutError: false,
|
|
1349
|
+
legacyInterceptorReqResOrdering: true
|
|
1307
1350
|
};
|
|
1308
1351
|
|
|
1309
1352
|
const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -2021,25 +2064,23 @@ function isCancel(value) {
|
|
|
2021
2064
|
return !!(value && value.__CANCEL__);
|
|
2022
2065
|
}
|
|
2023
2066
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2067
|
+
class CanceledError extends AxiosError {
|
|
2068
|
+
/**
|
|
2069
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
2070
|
+
*
|
|
2071
|
+
* @param {string=} message The message.
|
|
2072
|
+
* @param {Object=} config The config.
|
|
2073
|
+
* @param {Object=} request The request.
|
|
2074
|
+
*
|
|
2075
|
+
* @returns {CanceledError} The created error.
|
|
2076
|
+
*/
|
|
2077
|
+
constructor(message, config, request) {
|
|
2078
|
+
super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
|
2079
|
+
this.name = 'CanceledError';
|
|
2080
|
+
this.__CANCEL__ = true;
|
|
2081
|
+
}
|
|
2037
2082
|
}
|
|
2038
2083
|
|
|
2039
|
-
utils$1.inherits(CanceledError, AxiosError, {
|
|
2040
|
-
__CANCEL__: true
|
|
2041
|
-
});
|
|
2042
|
-
|
|
2043
2084
|
/**
|
|
2044
2085
|
* Resolve or reject a Promise based on response status.
|
|
2045
2086
|
*
|
|
@@ -2279,6 +2320,10 @@ function isAbsoluteURL(url) {
|
|
|
2279
2320
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
2280
2321
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
2281
2322
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
2323
|
+
if (typeof url !== 'string') {
|
|
2324
|
+
return false;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2282
2327
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2283
2328
|
}
|
|
2284
2329
|
|
|
@@ -2314,7 +2359,8 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
2314
2359
|
return requestedURL;
|
|
2315
2360
|
}
|
|
2316
2361
|
|
|
2317
|
-
const headersToObject = (thing) =>
|
|
2362
|
+
const headersToObject = (thing) =>
|
|
2363
|
+
thing instanceof AxiosHeaders ? { ...thing } : thing;
|
|
2318
2364
|
|
|
2319
2365
|
/**
|
|
2320
2366
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -2332,7 +2378,7 @@ function mergeConfig(config1, config2) {
|
|
|
2332
2378
|
|
|
2333
2379
|
function getMergedValue(target, source, prop, caseless) {
|
|
2334
2380
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2335
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
2381
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2336
2382
|
} else if (utils$1.isPlainObject(source)) {
|
|
2337
2383
|
return utils$1.merge({}, source);
|
|
2338
2384
|
} else if (utils$1.isArray(source)) {
|
|
@@ -2341,7 +2387,6 @@ function mergeConfig(config1, config2) {
|
|
|
2341
2387
|
return source;
|
|
2342
2388
|
}
|
|
2343
2389
|
|
|
2344
|
-
// eslint-disable-next-line consistent-return
|
|
2345
2390
|
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2346
2391
|
if (!utils$1.isUndefined(b)) {
|
|
2347
2392
|
return getMergedValue(a, b, prop, caseless);
|
|
@@ -2404,14 +2449,27 @@ function mergeConfig(config1, config2) {
|
|
|
2404
2449
|
socketPath: defaultToConfig2,
|
|
2405
2450
|
responseEncoding: defaultToConfig2,
|
|
2406
2451
|
validateStatus: mergeDirectKeys,
|
|
2407
|
-
headers: (a, b, prop) =>
|
|
2452
|
+
headers: (a, b, prop) =>
|
|
2453
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
2408
2454
|
};
|
|
2409
2455
|
|
|
2410
|
-
utils$1.forEach(
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2456
|
+
utils$1.forEach(
|
|
2457
|
+
Object.keys({ ...config1, ...config2 }),
|
|
2458
|
+
function computeConfigValue(prop) {
|
|
2459
|
+
if (
|
|
2460
|
+
prop === "__proto__" ||
|
|
2461
|
+
prop === "constructor" ||
|
|
2462
|
+
prop === "prototype"
|
|
2463
|
+
)
|
|
2464
|
+
return;
|
|
2465
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop)
|
|
2466
|
+
? mergeMap[prop]
|
|
2467
|
+
: mergeDeepProperties;
|
|
2468
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2469
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
2470
|
+
(config[prop] = configValue);
|
|
2471
|
+
},
|
|
2472
|
+
);
|
|
2415
2473
|
|
|
2416
2474
|
return config;
|
|
2417
2475
|
}
|
|
@@ -2677,7 +2735,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
2677
2735
|
|
|
2678
2736
|
let timer = timeout && setTimeout(() => {
|
|
2679
2737
|
timer = null;
|
|
2680
|
-
onabort(new AxiosError(`timeout ${timeout}
|
|
2738
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
2681
2739
|
}, timeout);
|
|
2682
2740
|
|
|
2683
2741
|
const unsubscribe = () => {
|
|
@@ -3027,14 +3085,14 @@ const factory = (env) => {
|
|
|
3027
3085
|
|
|
3028
3086
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
3029
3087
|
throw Object.assign(
|
|
3030
|
-
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
3088
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
|
|
3031
3089
|
{
|
|
3032
3090
|
cause: err.cause || err
|
|
3033
3091
|
}
|
|
3034
3092
|
)
|
|
3035
3093
|
}
|
|
3036
3094
|
|
|
3037
|
-
throw AxiosError.from(err, err && err.code, config, request);
|
|
3095
|
+
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
3038
3096
|
}
|
|
3039
3097
|
}
|
|
3040
3098
|
};
|
|
@@ -3259,7 +3317,7 @@ function dispatchRequest(config) {
|
|
|
3259
3317
|
});
|
|
3260
3318
|
}
|
|
3261
3319
|
|
|
3262
|
-
const VERSION = "1.13.
|
|
3320
|
+
const VERSION = "1.13.5";
|
|
3263
3321
|
|
|
3264
3322
|
const validators$1 = {};
|
|
3265
3323
|
|
|
@@ -3427,7 +3485,8 @@ class Axios {
|
|
|
3427
3485
|
validator.assertOptions(transitional, {
|
|
3428
3486
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3429
3487
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3430
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
3488
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
3489
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
3431
3490
|
}, false);
|
|
3432
3491
|
}
|
|
3433
3492
|
|
|
@@ -3484,7 +3543,14 @@ class Axios {
|
|
|
3484
3543
|
|
|
3485
3544
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3486
3545
|
|
|
3487
|
-
|
|
3546
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
3547
|
+
const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
|
|
3548
|
+
|
|
3549
|
+
if (legacyInterceptorReqResOrdering) {
|
|
3550
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3551
|
+
} else {
|
|
3552
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3553
|
+
}
|
|
3488
3554
|
});
|
|
3489
3555
|
|
|
3490
3556
|
const responseInterceptorChain = [];
|
|
@@ -3719,7 +3785,7 @@ class CancelToken {
|
|
|
3719
3785
|
*
|
|
3720
3786
|
* ```js
|
|
3721
3787
|
* function f(x, y, z) {}
|
|
3722
|
-
*
|
|
3788
|
+
* const args = [1, 2, 3];
|
|
3723
3789
|
* f.apply(null, args);
|
|
3724
3790
|
* ```
|
|
3725
3791
|
*
|
|
@@ -4588,39 +4654,35 @@ const findLayer = (layers, layer) => {
|
|
|
4588
4654
|
};
|
|
4589
4655
|
|
|
4590
4656
|
/**
|
|
4591
|
-
* Removes
|
|
4592
|
-
*
|
|
4657
|
+
* Removes one or more layers (by id) from a layer/group structure and inserts
|
|
4658
|
+
* new layers in place of the first removed one.
|
|
4659
|
+
* Returns a new array reference at every level that changed (immutable).
|
|
4593
4660
|
*
|
|
4594
|
-
* @param {import("@eox/map").EoxLayer[]} layers -
|
|
4595
|
-
* @param {
|
|
4596
|
-
* @param {
|
|
4597
|
-
* @returns {
|
|
4661
|
+
* @param {import("@eox/map").EoxLayer[]} layers - Current layer array.
|
|
4662
|
+
* @param {string | string[]} toRemove - Id(s) of layers to remove.
|
|
4663
|
+
* @param {import("@eox/map").EoxLayer[]} toInsert - Layers to insert in place of the first removed one.
|
|
4664
|
+
* @returns {import("@eox/map").EoxLayer[]}
|
|
4598
4665
|
*/
|
|
4599
|
-
const
|
|
4600
|
-
const
|
|
4666
|
+
const replaceLayer = (layers, toRemove, toInsert) => {
|
|
4667
|
+
const removeIds = new Set(Array.isArray(toRemove) ? toRemove : [toRemove]);
|
|
4601
4668
|
let inserted = false;
|
|
4669
|
+
const result = [];
|
|
4602
4670
|
|
|
4603
4671
|
for (const layer of layers) {
|
|
4604
4672
|
if (layer.type === "Group" && Array.isArray(layer.layers)) {
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4673
|
+
const newGroupLayers = replaceLayer(layer.layers, toRemove, toInsert);
|
|
4674
|
+
// Only create a new object reference if children changed
|
|
4675
|
+
result.push(
|
|
4676
|
+
newGroupLayers !== layer.layers
|
|
4677
|
+
? { ...layer, layers: newGroupLayers }
|
|
4678
|
+
: layer,
|
|
4610
4679
|
);
|
|
4611
|
-
result.push({ ...layer, layers: newGroupLayers });
|
|
4612
4680
|
continue;
|
|
4613
4681
|
}
|
|
4614
4682
|
|
|
4615
|
-
// Match by reference or id
|
|
4616
4683
|
const id = layer?.properties?.id;
|
|
4617
|
-
const isToRemove = toRemove.some((rem) => {
|
|
4618
|
-
const remId = rem?.properties?.id;
|
|
4619
|
-
return remId === id;
|
|
4620
|
-
});
|
|
4621
4684
|
|
|
4622
|
-
if (
|
|
4623
|
-
// On first removed occurrence, insert the new layers
|
|
4685
|
+
if (id && removeIds.has(id)) {
|
|
4624
4686
|
if (!inserted) {
|
|
4625
4687
|
result.push(...toInsert);
|
|
4626
4688
|
inserted = true;
|
|
@@ -4629,43 +4691,14 @@ const replaceLayersInStructure = (layers, toRemove, toInsert) => {
|
|
|
4629
4691
|
continue;
|
|
4630
4692
|
}
|
|
4631
4693
|
|
|
4632
|
-
result.
|
|
4694
|
+
result.push(layer);
|
|
4633
4695
|
}
|
|
4634
4696
|
|
|
4635
|
-
return
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
* @param {import("@eox/map").EoxLayer[]} currentLayers
|
|
4641
|
-
* @param {string} oldLayer - id of the layer to be replaced
|
|
4642
|
-
* @param {import("@eox/map").EoxLayer[]} newLayers - array of layers to replace the old layer
|
|
4643
|
-
* @returns {import("@eox/map").EoxLayer[]}
|
|
4644
|
-
*/
|
|
4645
|
-
const replaceLayer = (currentLayers, oldLayer, newLayers) => {
|
|
4646
|
-
const oldLayerIdx = currentLayers.findIndex(
|
|
4647
|
-
(l) => l.properties?.id === oldLayer,
|
|
4648
|
-
);
|
|
4649
|
-
|
|
4650
|
-
if (oldLayerIdx !== -1) {
|
|
4651
|
-
log.debug(
|
|
4652
|
-
"Replacing layer",
|
|
4653
|
-
oldLayer,
|
|
4654
|
-
"with",
|
|
4655
|
-
newLayers.map((l) => l.properties?.id),
|
|
4656
|
-
);
|
|
4657
|
-
currentLayers.splice(oldLayerIdx, 1, ...newLayers);
|
|
4658
|
-
}
|
|
4659
|
-
|
|
4660
|
-
for (const l of currentLayers) {
|
|
4661
|
-
if (l.type === "Group") {
|
|
4662
|
-
const updatedGroupLyrs = replaceLayer(l.layers, oldLayer, newLayers);
|
|
4663
|
-
if (updatedGroupLyrs?.length) {
|
|
4664
|
-
l.layers = updatedGroupLyrs;
|
|
4665
|
-
}
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
return currentLayers;
|
|
4697
|
+
// If nothing changed, return the original reference to avoid unnecessary re-renders
|
|
4698
|
+
return result.length === layers.length &&
|
|
4699
|
+
result.every((l, i) => l === layers[i])
|
|
4700
|
+
? layers
|
|
4701
|
+
: result;
|
|
4669
4702
|
};
|
|
4670
4703
|
|
|
4671
4704
|
/**
|
|
@@ -5040,4 +5073,4 @@ function extractEoxLegendLink(link) {
|
|
|
5040
5073
|
return extraProperties;
|
|
5041
5074
|
}
|
|
5042
5075
|
|
|
5043
|
-
export {
|
|
5076
|
+
export { axios$1 as $, revokeCollectionBlobUrls as A, datetime as B, poi as C, activeTemplate as D, mapPosition as E, indicator as F, currentUrl as G, currentCompareUrl as H, compareIndicator as I, comparePoi as J, states as K, actions as L, areChartsSeparateLayout as M, chartSpec as N, compareChartSpec as O, includesProcess as P, shouldShowChartWidget as Q, sanitizeBbox as R, mapCompareEl as S, getColFromLayer as T, setMapProjFromCol as U, isGlobe as V, setActiveTemplate as W, availableMapProjection as X, changeMapProjection as Y, compareChartData as Z, chartData as _, extractEoxLegendLink as a, removeUnneededProperties as a0, extractLayerConfig as b, createLayerID as c, axios as d, extractRoles as e, fetchStyle as f, addTooltipInteraction as g, createAssetID as h, mapEl as i, getProjectionCode as j, isSTACItem as k, extractLayerTimeValues as l, mergeGeojsons as m, fetchApiItems as n, getDatetimeProperty as o, fetchAllStyles as p, findLayer as q, registerProjection as r, findLayersByLayerPrefix as s, replaceLayer as t, generateFeatures as u, getLayers as v, getCompareLayers as w, extractLayerLegend as x, extractCollectionUrls as y, generateLinksFromItems as z };
|