@bolttech/form-engine 3.0.0-beta.2 → 3.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -212
- package/index.esm.js +1471 -312
- package/package.json +6 -30
- package/src/components/AsFormField/AsFormField.d.ts +12 -3
- package/src/components/AsFormField/AsFormField.type.d.ts +9 -0
- package/src/components/AsFormFieldBuilder/AsFormFieldBuilder.d.ts +11 -0
- package/src/components/AsFormFieldBuilder/AsFormFieldBuilder.type.d.ts +16 -0
- package/src/components/FieldWrapper/FieldWrapper.d.ts +10 -3
- package/src/components/FieldWrapper/FieldWrapper.type.d.ts +28 -0
- package/src/components/Form/Form.d.ts +8 -3
- package/src/components/Form/Form.type.d.ts +11 -0
- package/src/components/index.d.ts +3 -2
- package/src/context/FormGroupContext.d.ts +16 -24
- package/src/context/FormGroupContext.type.d.ts +46 -0
- package/src/generators/formBuilder.d.ts +20 -5
- package/src/helpers/helpers.d.ts +7 -0
- package/src/hooks/useForm.d.ts +6 -0
- package/src/hooks/useForm.type.d.ts +12 -0
- package/src/types/index.d.ts +15 -42
package/index.esm.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { FormGroup } from '@
|
|
4
|
-
import { createContext, useRef,
|
|
2
|
+
import { FormGroup, FormCore } from '@bolttech/form-engine-core';
|
|
3
|
+
import { createContext, useContext, useRef, useMemo, useState, useEffect, useCallback, Suspense, Children } from 'react';
|
|
5
4
|
|
|
6
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
6
|
|
|
8
|
-
var fails$
|
|
7
|
+
var fails$h = function (exec) {
|
|
9
8
|
try {
|
|
10
9
|
return !!exec();
|
|
11
10
|
} catch (error) {
|
|
@@ -13,9 +12,9 @@ var fails$b = function (exec) {
|
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
14
|
|
|
16
|
-
var fails$
|
|
15
|
+
var fails$g = fails$h;
|
|
17
16
|
|
|
18
|
-
var functionBindNative = !fails$
|
|
17
|
+
var functionBindNative = !fails$g(function () {
|
|
19
18
|
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
20
19
|
var test = (function () { /* empty */ }).bind();
|
|
21
20
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
@@ -25,39 +24,39 @@ var functionBindNative = !fails$a(function () {
|
|
|
25
24
|
var NATIVE_BIND$1 = functionBindNative;
|
|
26
25
|
|
|
27
26
|
var FunctionPrototype$1 = Function.prototype;
|
|
28
|
-
var call$
|
|
29
|
-
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$
|
|
27
|
+
var call$8 = FunctionPrototype$1.call;
|
|
28
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$8, call$8);
|
|
30
29
|
|
|
31
30
|
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
32
31
|
return function () {
|
|
33
|
-
return call$
|
|
32
|
+
return call$8.apply(fn, arguments);
|
|
34
33
|
};
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
var uncurryThis$
|
|
36
|
+
var uncurryThis$f = functionUncurryThis;
|
|
38
37
|
|
|
39
|
-
var toString$
|
|
40
|
-
var stringSlice$
|
|
38
|
+
var toString$5 = uncurryThis$f({}.toString);
|
|
39
|
+
var stringSlice$3 = uncurryThis$f(''.slice);
|
|
41
40
|
|
|
42
|
-
var classofRaw = function (it) {
|
|
43
|
-
return stringSlice$
|
|
41
|
+
var classofRaw$2 = function (it) {
|
|
42
|
+
return stringSlice$3(toString$5(it), 8, -1);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
var uncurryThis$
|
|
47
|
-
var fails$
|
|
48
|
-
var classof = classofRaw;
|
|
45
|
+
var uncurryThis$e = functionUncurryThis;
|
|
46
|
+
var fails$f = fails$h;
|
|
47
|
+
var classof$3 = classofRaw$2;
|
|
49
48
|
|
|
50
|
-
var $Object$
|
|
51
|
-
var split = uncurryThis$
|
|
49
|
+
var $Object$4 = Object;
|
|
50
|
+
var split = uncurryThis$e(''.split);
|
|
52
51
|
|
|
53
52
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
54
|
-
var indexedObject = fails$
|
|
53
|
+
var indexedObject = fails$f(function () {
|
|
55
54
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
56
55
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
57
|
-
return !$Object$
|
|
56
|
+
return !$Object$4('z').propertyIsEnumerable(0);
|
|
58
57
|
}) ? function (it) {
|
|
59
|
-
return classof(it) === 'String' ? split(it, '') : $Object$
|
|
60
|
-
} : $Object$
|
|
58
|
+
return classof$3(it) === 'String' ? split(it, '') : $Object$4(it);
|
|
59
|
+
} : $Object$4;
|
|
61
60
|
|
|
62
61
|
// we can't use just `it == null` since of `document.all` special case
|
|
63
62
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
@@ -67,21 +66,21 @@ var isNullOrUndefined$2 = function (it) {
|
|
|
67
66
|
|
|
68
67
|
var isNullOrUndefined$1 = isNullOrUndefined$2;
|
|
69
68
|
|
|
70
|
-
var $TypeError$
|
|
69
|
+
var $TypeError$8 = TypeError;
|
|
71
70
|
|
|
72
71
|
// `RequireObjectCoercible` abstract operation
|
|
73
72
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
74
|
-
var requireObjectCoercible$
|
|
75
|
-
if (isNullOrUndefined$1(it)) throw new $TypeError$
|
|
73
|
+
var requireObjectCoercible$4 = function (it) {
|
|
74
|
+
if (isNullOrUndefined$1(it)) throw new $TypeError$8("Can't call method on " + it);
|
|
76
75
|
return it;
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
// toObject with fallback for non-array-like ES3 strings
|
|
80
79
|
var IndexedObject$1 = indexedObject;
|
|
81
|
-
var requireObjectCoercible$
|
|
80
|
+
var requireObjectCoercible$3 = requireObjectCoercible$4;
|
|
82
81
|
|
|
83
82
|
var toIndexedObject$5 = function (it) {
|
|
84
|
-
return IndexedObject$1(requireObjectCoercible$
|
|
83
|
+
return IndexedObject$1(requireObjectCoercible$3(it));
|
|
85
84
|
};
|
|
86
85
|
|
|
87
86
|
var check = function (it) {
|
|
@@ -89,7 +88,7 @@ var check = function (it) {
|
|
|
89
88
|
};
|
|
90
89
|
|
|
91
90
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
92
|
-
var global$
|
|
91
|
+
var global$e =
|
|
93
92
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
94
93
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
95
94
|
check(typeof window == 'object' && window) ||
|
|
@@ -102,20 +101,20 @@ var global$b =
|
|
|
102
101
|
|
|
103
102
|
var sharedStore = {exports: {}};
|
|
104
103
|
|
|
105
|
-
var global$
|
|
104
|
+
var global$d = global$e;
|
|
106
105
|
|
|
107
106
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
108
107
|
var defineProperty$5 = Object.defineProperty;
|
|
109
108
|
|
|
110
109
|
var defineGlobalProperty$3 = function (key, value) {
|
|
111
110
|
try {
|
|
112
|
-
defineProperty$5(global$
|
|
111
|
+
defineProperty$5(global$d, key, { value: value, configurable: true, writable: true });
|
|
113
112
|
} catch (error) {
|
|
114
|
-
global$
|
|
113
|
+
global$d[key] = value;
|
|
115
114
|
} return value;
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
var globalThis$1 = global$
|
|
117
|
+
var globalThis$1 = global$e;
|
|
119
118
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
120
119
|
|
|
121
120
|
var SHARED = '__core-js_shared__';
|
|
@@ -131,49 +130,49 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
131
130
|
|
|
132
131
|
var store$2 = sharedStore.exports;
|
|
133
132
|
|
|
134
|
-
var shared$
|
|
133
|
+
var shared$4 = function (key, value) {
|
|
135
134
|
return store$2[key] || (store$2[key] = value || {});
|
|
136
135
|
};
|
|
137
136
|
|
|
138
|
-
var requireObjectCoercible$
|
|
137
|
+
var requireObjectCoercible$2 = requireObjectCoercible$4;
|
|
139
138
|
|
|
140
|
-
var $Object$
|
|
139
|
+
var $Object$3 = Object;
|
|
141
140
|
|
|
142
141
|
// `ToObject` abstract operation
|
|
143
142
|
// https://tc39.es/ecma262/#sec-toobject
|
|
144
|
-
var toObject$
|
|
145
|
-
return $Object$
|
|
143
|
+
var toObject$4 = function (argument) {
|
|
144
|
+
return $Object$3(requireObjectCoercible$2(argument));
|
|
146
145
|
};
|
|
147
146
|
|
|
148
|
-
var uncurryThis$
|
|
149
|
-
var toObject$
|
|
147
|
+
var uncurryThis$d = functionUncurryThis;
|
|
148
|
+
var toObject$3 = toObject$4;
|
|
150
149
|
|
|
151
|
-
var hasOwnProperty = uncurryThis$
|
|
150
|
+
var hasOwnProperty = uncurryThis$d({}.hasOwnProperty);
|
|
152
151
|
|
|
153
152
|
// `HasOwnProperty` abstract operation
|
|
154
153
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
155
154
|
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
156
155
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
157
|
-
return hasOwnProperty(toObject$
|
|
156
|
+
return hasOwnProperty(toObject$3(it), key);
|
|
158
157
|
};
|
|
159
158
|
|
|
160
|
-
var uncurryThis$
|
|
159
|
+
var uncurryThis$c = functionUncurryThis;
|
|
161
160
|
|
|
162
161
|
var id = 0;
|
|
163
162
|
var postfix = Math.random();
|
|
164
|
-
var toString = uncurryThis$
|
|
163
|
+
var toString$4 = uncurryThis$c(1.0.toString);
|
|
165
164
|
|
|
166
165
|
var uid$2 = function (key) {
|
|
167
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
166
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
|
|
168
167
|
};
|
|
169
168
|
|
|
170
169
|
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
171
170
|
|
|
172
|
-
var global$
|
|
173
|
-
var userAgent = engineUserAgent;
|
|
171
|
+
var global$c = global$e;
|
|
172
|
+
var userAgent$2 = engineUserAgent;
|
|
174
173
|
|
|
175
|
-
var process = global$
|
|
176
|
-
var Deno = global$
|
|
174
|
+
var process = global$c.process;
|
|
175
|
+
var Deno = global$c.Deno;
|
|
177
176
|
var versions = process && process.versions || Deno && Deno.version;
|
|
178
177
|
var v8 = versions && versions.v8;
|
|
179
178
|
var match, version;
|
|
@@ -187,10 +186,10 @@ if (v8) {
|
|
|
187
186
|
|
|
188
187
|
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
189
188
|
// so check `userAgent` even if `.v8` exists, but 0
|
|
190
|
-
if (!version && userAgent) {
|
|
191
|
-
match = userAgent.match(/Edge\/(\d+)/);
|
|
189
|
+
if (!version && userAgent$2) {
|
|
190
|
+
match = userAgent$2.match(/Edge\/(\d+)/);
|
|
192
191
|
if (!match || match[1] >= 74) {
|
|
193
|
-
match = userAgent.match(/Chrome\/(\d+)/);
|
|
192
|
+
match = userAgent$2.match(/Chrome\/(\d+)/);
|
|
194
193
|
if (match) version = +match[1];
|
|
195
194
|
}
|
|
196
195
|
}
|
|
@@ -199,19 +198,19 @@ var engineV8Version = version;
|
|
|
199
198
|
|
|
200
199
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
201
200
|
var V8_VERSION = engineV8Version;
|
|
202
|
-
var fails$
|
|
203
|
-
var global$
|
|
201
|
+
var fails$e = fails$h;
|
|
202
|
+
var global$b = global$e;
|
|
204
203
|
|
|
205
|
-
var $String$
|
|
204
|
+
var $String$5 = global$b.String;
|
|
206
205
|
|
|
207
206
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
208
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$
|
|
207
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$e(function () {
|
|
209
208
|
var symbol = Symbol('symbol detection');
|
|
210
209
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
211
210
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
212
211
|
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
213
212
|
// of course, fail.
|
|
214
|
-
return !$String$
|
|
213
|
+
return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
215
214
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
216
215
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
217
216
|
});
|
|
@@ -223,20 +222,20 @@ var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
|
223
222
|
&& !Symbol.sham
|
|
224
223
|
&& typeof Symbol.iterator == 'symbol';
|
|
225
224
|
|
|
226
|
-
var global$
|
|
227
|
-
var shared$
|
|
228
|
-
var hasOwn$
|
|
225
|
+
var global$a = global$e;
|
|
226
|
+
var shared$3 = shared$4;
|
|
227
|
+
var hasOwn$9 = hasOwnProperty_1;
|
|
229
228
|
var uid$1 = uid$2;
|
|
230
229
|
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
231
230
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
232
231
|
|
|
233
|
-
var Symbol$1 = global$
|
|
234
|
-
var WellKnownSymbolsStore = shared$
|
|
232
|
+
var Symbol$1 = global$a.Symbol;
|
|
233
|
+
var WellKnownSymbolsStore = shared$3('wks');
|
|
235
234
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
236
235
|
|
|
237
|
-
var wellKnownSymbol$
|
|
238
|
-
if (!hasOwn$
|
|
239
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$
|
|
236
|
+
var wellKnownSymbol$a = function (name) {
|
|
237
|
+
if (!hasOwn$9(WellKnownSymbolsStore, name)) {
|
|
238
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)
|
|
240
239
|
? Symbol$1[name]
|
|
241
240
|
: createWellKnownSymbol('Symbol.' + name);
|
|
242
241
|
} return WellKnownSymbolsStore[name];
|
|
@@ -248,45 +247,45 @@ var documentAll = typeof document == 'object' && document.all;
|
|
|
248
247
|
// `IsCallable` abstract operation
|
|
249
248
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
250
249
|
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
251
|
-
var isCallable$
|
|
250
|
+
var isCallable$e = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
252
251
|
return typeof argument == 'function' || argument === documentAll;
|
|
253
252
|
} : function (argument) {
|
|
254
253
|
return typeof argument == 'function';
|
|
255
254
|
};
|
|
256
255
|
|
|
257
|
-
var isCallable$
|
|
256
|
+
var isCallable$d = isCallable$e;
|
|
258
257
|
|
|
259
|
-
var isObject$
|
|
260
|
-
return typeof it == 'object' ? it !== null : isCallable$
|
|
258
|
+
var isObject$9 = function (it) {
|
|
259
|
+
return typeof it == 'object' ? it !== null : isCallable$d(it);
|
|
261
260
|
};
|
|
262
261
|
|
|
263
|
-
var isObject$
|
|
262
|
+
var isObject$8 = isObject$9;
|
|
264
263
|
|
|
265
|
-
var $String$
|
|
266
|
-
var $TypeError$
|
|
264
|
+
var $String$4 = String;
|
|
265
|
+
var $TypeError$7 = TypeError;
|
|
267
266
|
|
|
268
267
|
// `Assert: Type(argument) is Object`
|
|
269
|
-
var anObject$
|
|
270
|
-
if (isObject$
|
|
271
|
-
throw new $TypeError$
|
|
268
|
+
var anObject$6 = function (argument) {
|
|
269
|
+
if (isObject$8(argument)) return argument;
|
|
270
|
+
throw new $TypeError$7($String$4(argument) + ' is not an object');
|
|
272
271
|
};
|
|
273
272
|
|
|
274
273
|
var objectDefineProperties = {};
|
|
275
274
|
|
|
276
|
-
var fails$
|
|
275
|
+
var fails$d = fails$h;
|
|
277
276
|
|
|
278
277
|
// Detect IE8's incomplete defineProperty implementation
|
|
279
|
-
var descriptors = !fails$
|
|
278
|
+
var descriptors = !fails$d(function () {
|
|
280
279
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
281
280
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
282
281
|
});
|
|
283
282
|
|
|
284
283
|
var DESCRIPTORS$9 = descriptors;
|
|
285
|
-
var fails$
|
|
284
|
+
var fails$c = fails$h;
|
|
286
285
|
|
|
287
286
|
// V8 ~ Chrome 36-
|
|
288
287
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
289
|
-
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$
|
|
288
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$c(function () {
|
|
290
289
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
291
290
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
292
291
|
value: 42,
|
|
@@ -296,23 +295,23 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$6(function () {
|
|
|
296
295
|
|
|
297
296
|
var objectDefineProperty = {};
|
|
298
297
|
|
|
299
|
-
var global$
|
|
300
|
-
var isObject$
|
|
298
|
+
var global$9 = global$e;
|
|
299
|
+
var isObject$7 = isObject$9;
|
|
301
300
|
|
|
302
|
-
var document$1 = global$
|
|
301
|
+
var document$1 = global$9.document;
|
|
303
302
|
// typeof document.createElement is 'object' in old IE
|
|
304
|
-
var EXISTS$1 = isObject$
|
|
303
|
+
var EXISTS$1 = isObject$7(document$1) && isObject$7(document$1.createElement);
|
|
305
304
|
|
|
306
305
|
var documentCreateElement$2 = function (it) {
|
|
307
306
|
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
308
307
|
};
|
|
309
308
|
|
|
310
309
|
var DESCRIPTORS$8 = descriptors;
|
|
311
|
-
var fails$
|
|
310
|
+
var fails$b = fails$h;
|
|
312
311
|
var createElement = documentCreateElement$2;
|
|
313
312
|
|
|
314
313
|
// Thanks to IE8 for its funny defineProperty
|
|
315
|
-
var ie8DomDefine = !DESCRIPTORS$8 && !fails$
|
|
314
|
+
var ie8DomDefine = !DESCRIPTORS$8 && !fails$b(function () {
|
|
316
315
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
317
316
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
318
317
|
get: function () { return 7; }
|
|
@@ -321,109 +320,109 @@ var ie8DomDefine = !DESCRIPTORS$8 && !fails$5(function () {
|
|
|
321
320
|
|
|
322
321
|
var NATIVE_BIND = functionBindNative;
|
|
323
322
|
|
|
324
|
-
var call$
|
|
323
|
+
var call$7 = Function.prototype.call;
|
|
325
324
|
|
|
326
|
-
var functionCall = NATIVE_BIND ? call$
|
|
327
|
-
return call$
|
|
325
|
+
var functionCall = NATIVE_BIND ? call$7.bind(call$7) : function () {
|
|
326
|
+
return call$7.apply(call$7, arguments);
|
|
328
327
|
};
|
|
329
328
|
|
|
330
|
-
var global$
|
|
331
|
-
var isCallable$
|
|
329
|
+
var global$8 = global$e;
|
|
330
|
+
var isCallable$c = isCallable$e;
|
|
332
331
|
|
|
333
332
|
var aFunction = function (argument) {
|
|
334
|
-
return isCallable$
|
|
333
|
+
return isCallable$c(argument) ? argument : undefined;
|
|
335
334
|
};
|
|
336
335
|
|
|
337
336
|
var getBuiltIn$3 = function (namespace, method) {
|
|
338
|
-
return arguments.length < 2 ? aFunction(global$
|
|
337
|
+
return arguments.length < 2 ? aFunction(global$8[namespace]) : global$8[namespace] && global$8[namespace][method];
|
|
339
338
|
};
|
|
340
339
|
|
|
341
|
-
var uncurryThis$
|
|
340
|
+
var uncurryThis$b = functionUncurryThis;
|
|
342
341
|
|
|
343
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
342
|
+
var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
|
|
344
343
|
|
|
345
344
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
346
|
-
var isCallable$
|
|
347
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
345
|
+
var isCallable$b = isCallable$e;
|
|
346
|
+
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
348
347
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
349
348
|
|
|
350
|
-
var $Object$
|
|
349
|
+
var $Object$2 = Object;
|
|
351
350
|
|
|
352
351
|
var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
|
|
353
352
|
return typeof it == 'symbol';
|
|
354
353
|
} : function (it) {
|
|
355
354
|
var $Symbol = getBuiltIn$2('Symbol');
|
|
356
|
-
return isCallable$
|
|
355
|
+
return isCallable$b($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$2(it));
|
|
357
356
|
};
|
|
358
357
|
|
|
359
|
-
var $String$
|
|
358
|
+
var $String$3 = String;
|
|
360
359
|
|
|
361
|
-
var tryToString$
|
|
360
|
+
var tryToString$2 = function (argument) {
|
|
362
361
|
try {
|
|
363
|
-
return $String$
|
|
362
|
+
return $String$3(argument);
|
|
364
363
|
} catch (error) {
|
|
365
364
|
return 'Object';
|
|
366
365
|
}
|
|
367
366
|
};
|
|
368
367
|
|
|
369
|
-
var isCallable$
|
|
370
|
-
var tryToString = tryToString$
|
|
368
|
+
var isCallable$a = isCallable$e;
|
|
369
|
+
var tryToString$1 = tryToString$2;
|
|
371
370
|
|
|
372
|
-
var $TypeError$
|
|
371
|
+
var $TypeError$6 = TypeError;
|
|
373
372
|
|
|
374
373
|
// `Assert: IsCallable(argument) is true`
|
|
375
|
-
var aCallable$
|
|
376
|
-
if (isCallable$
|
|
377
|
-
throw new $TypeError$
|
|
374
|
+
var aCallable$3 = function (argument) {
|
|
375
|
+
if (isCallable$a(argument)) return argument;
|
|
376
|
+
throw new $TypeError$6(tryToString$1(argument) + ' is not a function');
|
|
378
377
|
};
|
|
379
378
|
|
|
380
|
-
var aCallable$
|
|
379
|
+
var aCallable$2 = aCallable$3;
|
|
381
380
|
var isNullOrUndefined = isNullOrUndefined$2;
|
|
382
381
|
|
|
383
382
|
// `GetMethod` abstract operation
|
|
384
383
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
385
384
|
var getMethod$1 = function (V, P) {
|
|
386
385
|
var func = V[P];
|
|
387
|
-
return isNullOrUndefined(func) ? undefined : aCallable$
|
|
386
|
+
return isNullOrUndefined(func) ? undefined : aCallable$2(func);
|
|
388
387
|
};
|
|
389
388
|
|
|
390
|
-
var call$
|
|
391
|
-
var isCallable$
|
|
392
|
-
var isObject$
|
|
389
|
+
var call$6 = functionCall;
|
|
390
|
+
var isCallable$9 = isCallable$e;
|
|
391
|
+
var isObject$6 = isObject$9;
|
|
393
392
|
|
|
394
|
-
var $TypeError$
|
|
393
|
+
var $TypeError$5 = TypeError;
|
|
395
394
|
|
|
396
395
|
// `OrdinaryToPrimitive` abstract operation
|
|
397
396
|
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
398
397
|
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
399
398
|
var fn, val;
|
|
400
|
-
if (pref === 'string' && isCallable$
|
|
401
|
-
if (isCallable$
|
|
402
|
-
if (pref !== 'string' && isCallable$
|
|
403
|
-
throw new $TypeError$
|
|
399
|
+
if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$6(fn, input))) return val;
|
|
400
|
+
if (isCallable$9(fn = input.valueOf) && !isObject$6(val = call$6(fn, input))) return val;
|
|
401
|
+
if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$6(val = call$6(fn, input))) return val;
|
|
402
|
+
throw new $TypeError$5("Can't convert object to primitive value");
|
|
404
403
|
};
|
|
405
404
|
|
|
406
|
-
var call$
|
|
407
|
-
var isObject$
|
|
405
|
+
var call$5 = functionCall;
|
|
406
|
+
var isObject$5 = isObject$9;
|
|
408
407
|
var isSymbol$1 = isSymbol$2;
|
|
409
408
|
var getMethod = getMethod$1;
|
|
410
409
|
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
411
|
-
var wellKnownSymbol$
|
|
410
|
+
var wellKnownSymbol$9 = wellKnownSymbol$a;
|
|
412
411
|
|
|
413
|
-
var $TypeError$
|
|
414
|
-
var TO_PRIMITIVE = wellKnownSymbol$
|
|
412
|
+
var $TypeError$4 = TypeError;
|
|
413
|
+
var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
|
|
415
414
|
|
|
416
415
|
// `ToPrimitive` abstract operation
|
|
417
416
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
418
417
|
var toPrimitive$1 = function (input, pref) {
|
|
419
|
-
if (!isObject$
|
|
418
|
+
if (!isObject$5(input) || isSymbol$1(input)) return input;
|
|
420
419
|
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
421
420
|
var result;
|
|
422
421
|
if (exoticToPrim) {
|
|
423
422
|
if (pref === undefined) pref = 'default';
|
|
424
|
-
result = call$
|
|
425
|
-
if (!isObject$
|
|
426
|
-
throw new $TypeError$
|
|
423
|
+
result = call$5(exoticToPrim, input, pref);
|
|
424
|
+
if (!isObject$5(result) || isSymbol$1(result)) return result;
|
|
425
|
+
throw new $TypeError$4("Can't convert object to primitive value");
|
|
427
426
|
}
|
|
428
427
|
if (pref === undefined) pref = 'number';
|
|
429
428
|
return ordinaryToPrimitive(input, pref);
|
|
@@ -442,10 +441,10 @@ var toPropertyKey$2 = function (argument) {
|
|
|
442
441
|
var DESCRIPTORS$7 = descriptors;
|
|
443
442
|
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
444
443
|
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
445
|
-
var anObject$
|
|
444
|
+
var anObject$5 = anObject$6;
|
|
446
445
|
var toPropertyKey$1 = toPropertyKey$2;
|
|
447
446
|
|
|
448
|
-
var $TypeError$
|
|
447
|
+
var $TypeError$3 = TypeError;
|
|
449
448
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
450
449
|
var $defineProperty = Object.defineProperty;
|
|
451
450
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -457,9 +456,9 @@ var WRITABLE = 'writable';
|
|
|
457
456
|
// `Object.defineProperty` method
|
|
458
457
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
459
458
|
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
460
|
-
anObject$
|
|
459
|
+
anObject$5(O);
|
|
461
460
|
P = toPropertyKey$1(P);
|
|
462
|
-
anObject$
|
|
461
|
+
anObject$5(Attributes);
|
|
463
462
|
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
464
463
|
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
465
464
|
if (current && current[WRITABLE]) {
|
|
@@ -472,26 +471,26 @@ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
|
|
|
472
471
|
}
|
|
473
472
|
} return $defineProperty(O, P, Attributes);
|
|
474
473
|
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
475
|
-
anObject$
|
|
474
|
+
anObject$5(O);
|
|
476
475
|
P = toPropertyKey$1(P);
|
|
477
|
-
anObject$
|
|
476
|
+
anObject$5(Attributes);
|
|
478
477
|
if (IE8_DOM_DEFINE$1) try {
|
|
479
478
|
return $defineProperty(O, P, Attributes);
|
|
480
479
|
} catch (error) { /* empty */ }
|
|
481
|
-
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$
|
|
480
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$3('Accessors not supported');
|
|
482
481
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
483
482
|
return O;
|
|
484
483
|
};
|
|
485
484
|
|
|
486
485
|
var ceil = Math.ceil;
|
|
487
|
-
var floor = Math.floor;
|
|
486
|
+
var floor$1 = Math.floor;
|
|
488
487
|
|
|
489
488
|
// `Math.trunc` method
|
|
490
489
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
491
490
|
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
492
491
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
493
492
|
var n = +x;
|
|
494
|
-
return (n > 0 ? floor : ceil)(n);
|
|
493
|
+
return (n > 0 ? floor$1 : ceil)(n);
|
|
495
494
|
};
|
|
496
495
|
|
|
497
496
|
var trunc = mathTrunc;
|
|
@@ -507,44 +506,44 @@ var toIntegerOrInfinity$2 = function (argument) {
|
|
|
507
506
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
508
507
|
|
|
509
508
|
var max = Math.max;
|
|
510
|
-
var min$
|
|
509
|
+
var min$2 = Math.min;
|
|
511
510
|
|
|
512
511
|
// Helper for a popular repeating case of the spec:
|
|
513
512
|
// Let integer be ? ToInteger(index).
|
|
514
513
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
515
514
|
var toAbsoluteIndex$1 = function (index, length) {
|
|
516
515
|
var integer = toIntegerOrInfinity$1(index);
|
|
517
|
-
return integer < 0 ? max(integer + length, 0) : min$
|
|
516
|
+
return integer < 0 ? max(integer + length, 0) : min$2(integer, length);
|
|
518
517
|
};
|
|
519
518
|
|
|
520
519
|
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
521
520
|
|
|
522
|
-
var min = Math.min;
|
|
521
|
+
var min$1 = Math.min;
|
|
523
522
|
|
|
524
523
|
// `ToLength` abstract operation
|
|
525
524
|
// https://tc39.es/ecma262/#sec-tolength
|
|
526
|
-
var toLength$
|
|
525
|
+
var toLength$2 = function (argument) {
|
|
527
526
|
var len = toIntegerOrInfinity(argument);
|
|
528
|
-
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
527
|
+
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
529
528
|
};
|
|
530
529
|
|
|
531
|
-
var toLength = toLength$
|
|
530
|
+
var toLength$1 = toLength$2;
|
|
532
531
|
|
|
533
532
|
// `LengthOfArrayLike` abstract operation
|
|
534
533
|
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
535
|
-
var lengthOfArrayLike$
|
|
536
|
-
return toLength(obj.length);
|
|
534
|
+
var lengthOfArrayLike$2 = function (obj) {
|
|
535
|
+
return toLength$1(obj.length);
|
|
537
536
|
};
|
|
538
537
|
|
|
539
538
|
var toIndexedObject$4 = toIndexedObject$5;
|
|
540
539
|
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
541
|
-
var lengthOfArrayLike = lengthOfArrayLike$
|
|
540
|
+
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
542
541
|
|
|
543
542
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
544
543
|
var createMethod = function (IS_INCLUDES) {
|
|
545
544
|
return function ($this, el, fromIndex) {
|
|
546
545
|
var O = toIndexedObject$4($this);
|
|
547
|
-
var length = lengthOfArrayLike(O);
|
|
546
|
+
var length = lengthOfArrayLike$1(O);
|
|
548
547
|
if (length === 0) return !IS_INCLUDES && -1;
|
|
549
548
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
550
549
|
var value;
|
|
@@ -572,23 +571,23 @@ var arrayIncludes = {
|
|
|
572
571
|
|
|
573
572
|
var hiddenKeys$4 = {};
|
|
574
573
|
|
|
575
|
-
var uncurryThis$
|
|
576
|
-
var hasOwn$
|
|
574
|
+
var uncurryThis$a = functionUncurryThis;
|
|
575
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
577
576
|
var toIndexedObject$3 = toIndexedObject$5;
|
|
578
|
-
var indexOf = arrayIncludes.indexOf;
|
|
577
|
+
var indexOf$1 = arrayIncludes.indexOf;
|
|
579
578
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
580
579
|
|
|
581
|
-
var push = uncurryThis$
|
|
580
|
+
var push$1 = uncurryThis$a([].push);
|
|
582
581
|
|
|
583
582
|
var objectKeysInternal = function (object, names) {
|
|
584
583
|
var O = toIndexedObject$3(object);
|
|
585
584
|
var i = 0;
|
|
586
585
|
var result = [];
|
|
587
586
|
var key;
|
|
588
|
-
for (key in O) !hasOwn$
|
|
587
|
+
for (key in O) !hasOwn$8(hiddenKeys$3, key) && hasOwn$8(O, key) && push$1(result, key);
|
|
589
588
|
// Don't enum bug & hidden keys
|
|
590
|
-
while (names.length > i) if (hasOwn$
|
|
591
|
-
~indexOf(result, key) || push(result, key);
|
|
589
|
+
while (names.length > i) if (hasOwn$8(O, key = names[i++])) {
|
|
590
|
+
~indexOf$1(result, key) || push$1(result, key);
|
|
592
591
|
}
|
|
593
592
|
return result;
|
|
594
593
|
};
|
|
@@ -617,7 +616,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
617
616
|
var DESCRIPTORS$6 = descriptors;
|
|
618
617
|
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
619
618
|
var definePropertyModule$3 = objectDefineProperty;
|
|
620
|
-
var anObject$
|
|
619
|
+
var anObject$4 = anObject$6;
|
|
621
620
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
622
621
|
var objectKeys$1 = objectKeys$2;
|
|
623
622
|
|
|
@@ -625,7 +624,7 @@ var objectKeys$1 = objectKeys$2;
|
|
|
625
624
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
626
625
|
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
627
626
|
objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
628
|
-
anObject$
|
|
627
|
+
anObject$4(O);
|
|
629
628
|
var props = toIndexedObject$2(Properties);
|
|
630
629
|
var keys = objectKeys$1(Properties);
|
|
631
630
|
var length = keys.length;
|
|
@@ -639,17 +638,17 @@ var getBuiltIn$1 = getBuiltIn$3;
|
|
|
639
638
|
|
|
640
639
|
var html$1 = getBuiltIn$1('document', 'documentElement');
|
|
641
640
|
|
|
642
|
-
var shared$
|
|
641
|
+
var shared$2 = shared$4;
|
|
643
642
|
var uid = uid$2;
|
|
644
643
|
|
|
645
|
-
var keys = shared$
|
|
644
|
+
var keys = shared$2('keys');
|
|
646
645
|
|
|
647
646
|
var sharedKey$3 = function (key) {
|
|
648
647
|
return keys[key] || (keys[key] = uid(key));
|
|
649
648
|
};
|
|
650
649
|
|
|
651
650
|
/* global ActiveXObject -- old IE, WSH */
|
|
652
|
-
var anObject$
|
|
651
|
+
var anObject$3 = anObject$6;
|
|
653
652
|
var definePropertiesModule = objectDefineProperties;
|
|
654
653
|
var enumBugKeys$1 = enumBugKeys$3;
|
|
655
654
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
@@ -723,7 +722,7 @@ hiddenKeys$2[IE_PROTO$1] = true;
|
|
|
723
722
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
724
723
|
var result;
|
|
725
724
|
if (O !== null) {
|
|
726
|
-
EmptyConstructor[PROTOTYPE] = anObject$
|
|
725
|
+
EmptyConstructor[PROTOTYPE] = anObject$3(O);
|
|
727
726
|
result = new EmptyConstructor();
|
|
728
727
|
EmptyConstructor[PROTOTYPE] = null;
|
|
729
728
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
@@ -732,11 +731,11 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
732
731
|
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
733
732
|
};
|
|
734
733
|
|
|
735
|
-
var wellKnownSymbol$
|
|
736
|
-
var create$
|
|
734
|
+
var wellKnownSymbol$8 = wellKnownSymbol$a;
|
|
735
|
+
var create$2 = objectCreate;
|
|
737
736
|
var defineProperty$4 = objectDefineProperty.f;
|
|
738
737
|
|
|
739
|
-
var UNSCOPABLES = wellKnownSymbol$
|
|
738
|
+
var UNSCOPABLES = wellKnownSymbol$8('unscopables');
|
|
740
739
|
var ArrayPrototype = Array.prototype;
|
|
741
740
|
|
|
742
741
|
// Array.prototype[@@unscopables]
|
|
@@ -744,7 +743,7 @@ var ArrayPrototype = Array.prototype;
|
|
|
744
743
|
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
745
744
|
defineProperty$4(ArrayPrototype, UNSCOPABLES, {
|
|
746
745
|
configurable: true,
|
|
747
|
-
value: create$
|
|
746
|
+
value: create$2(null)
|
|
748
747
|
});
|
|
749
748
|
}
|
|
750
749
|
|
|
@@ -755,12 +754,12 @@ var addToUnscopables$1 = function (key) {
|
|
|
755
754
|
|
|
756
755
|
var iterators = {};
|
|
757
756
|
|
|
758
|
-
var global$
|
|
759
|
-
var isCallable$
|
|
757
|
+
var global$7 = global$e;
|
|
758
|
+
var isCallable$8 = isCallable$e;
|
|
760
759
|
|
|
761
|
-
var WeakMap$1 = global$
|
|
760
|
+
var WeakMap$1 = global$7.WeakMap;
|
|
762
761
|
|
|
763
|
-
var weakMapBasicDetection = isCallable$
|
|
762
|
+
var weakMapBasicDetection = isCallable$8(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
764
763
|
|
|
765
764
|
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
766
765
|
return {
|
|
@@ -783,17 +782,17 @@ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value
|
|
|
783
782
|
};
|
|
784
783
|
|
|
785
784
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
786
|
-
var global$
|
|
787
|
-
var isObject$
|
|
785
|
+
var global$6 = global$e;
|
|
786
|
+
var isObject$4 = isObject$9;
|
|
788
787
|
var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
|
|
789
|
-
var hasOwn$
|
|
790
|
-
var shared = sharedStore.exports;
|
|
788
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
789
|
+
var shared$1 = sharedStore.exports;
|
|
791
790
|
var sharedKey$1 = sharedKey$3;
|
|
792
791
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
793
792
|
|
|
794
793
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
795
|
-
var TypeError$1 = global$
|
|
796
|
-
var WeakMap = global$
|
|
794
|
+
var TypeError$1 = global$6.TypeError;
|
|
795
|
+
var WeakMap = global$6.WeakMap;
|
|
797
796
|
var set, get, has;
|
|
798
797
|
|
|
799
798
|
var enforce = function (it) {
|
|
@@ -803,14 +802,14 @@ var enforce = function (it) {
|
|
|
803
802
|
var getterFor = function (TYPE) {
|
|
804
803
|
return function (it) {
|
|
805
804
|
var state;
|
|
806
|
-
if (!isObject$
|
|
805
|
+
if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
|
|
807
806
|
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
808
807
|
} return state;
|
|
809
808
|
};
|
|
810
809
|
};
|
|
811
810
|
|
|
812
|
-
if (NATIVE_WEAK_MAP || shared.state) {
|
|
813
|
-
var store$1 = shared.state || (shared.state = new WeakMap());
|
|
811
|
+
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
812
|
+
var store$1 = shared$1.state || (shared$1.state = new WeakMap());
|
|
814
813
|
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
815
814
|
store$1.get = store$1.get;
|
|
816
815
|
store$1.has = store$1.has;
|
|
@@ -832,16 +831,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
|
|
|
832
831
|
var STATE = sharedKey$1('state');
|
|
833
832
|
hiddenKeys$1[STATE] = true;
|
|
834
833
|
set = function (it, metadata) {
|
|
835
|
-
if (hasOwn$
|
|
834
|
+
if (hasOwn$7(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
836
835
|
metadata.facade = it;
|
|
837
836
|
createNonEnumerableProperty$3(it, STATE, metadata);
|
|
838
837
|
return metadata;
|
|
839
838
|
};
|
|
840
839
|
get = function (it) {
|
|
841
|
-
return hasOwn$
|
|
840
|
+
return hasOwn$7(it, STATE) ? it[STATE] : {};
|
|
842
841
|
};
|
|
843
842
|
has = function (it) {
|
|
844
|
-
return hasOwn$
|
|
843
|
+
return hasOwn$7(it, STATE);
|
|
845
844
|
};
|
|
846
845
|
}
|
|
847
846
|
|
|
@@ -859,25 +858,25 @@ var objectPropertyIsEnumerable = {};
|
|
|
859
858
|
|
|
860
859
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
861
860
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
862
|
-
var getOwnPropertyDescriptor$
|
|
861
|
+
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
863
862
|
|
|
864
863
|
// Nashorn ~ JDK8 bug
|
|
865
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$
|
|
864
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
866
865
|
|
|
867
866
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
868
867
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
869
868
|
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
870
|
-
var descriptor = getOwnPropertyDescriptor$
|
|
869
|
+
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
871
870
|
return !!descriptor && descriptor.enumerable;
|
|
872
871
|
} : $propertyIsEnumerable;
|
|
873
872
|
|
|
874
873
|
var DESCRIPTORS$4 = descriptors;
|
|
875
|
-
var call$
|
|
874
|
+
var call$4 = functionCall;
|
|
876
875
|
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
877
876
|
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
878
877
|
var toIndexedObject$1 = toIndexedObject$5;
|
|
879
878
|
var toPropertyKey = toPropertyKey$2;
|
|
880
|
-
var hasOwn$
|
|
879
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
881
880
|
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
882
881
|
|
|
883
882
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
@@ -891,19 +890,19 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : f
|
|
|
891
890
|
if (IE8_DOM_DEFINE) try {
|
|
892
891
|
return $getOwnPropertyDescriptor(O, P);
|
|
893
892
|
} catch (error) { /* empty */ }
|
|
894
|
-
if (hasOwn$
|
|
893
|
+
if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call$4(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
895
894
|
};
|
|
896
895
|
|
|
897
896
|
var makeBuiltIn$2 = {exports: {}};
|
|
898
897
|
|
|
899
898
|
var DESCRIPTORS$3 = descriptors;
|
|
900
|
-
var hasOwn$
|
|
899
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
901
900
|
|
|
902
901
|
var FunctionPrototype = Function.prototype;
|
|
903
902
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
904
903
|
var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
|
|
905
904
|
|
|
906
|
-
var EXISTS = hasOwn$
|
|
905
|
+
var EXISTS = hasOwn$5(FunctionPrototype, 'name');
|
|
907
906
|
// additional protection from minified / mangled / dropped function names
|
|
908
907
|
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
909
908
|
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
@@ -914,14 +913,14 @@ var functionName = {
|
|
|
914
913
|
CONFIGURABLE: CONFIGURABLE
|
|
915
914
|
};
|
|
916
915
|
|
|
917
|
-
var uncurryThis$
|
|
918
|
-
var isCallable$
|
|
916
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
917
|
+
var isCallable$7 = isCallable$e;
|
|
919
918
|
var store = sharedStore.exports;
|
|
920
919
|
|
|
921
|
-
var functionToString = uncurryThis$
|
|
920
|
+
var functionToString = uncurryThis$9(Function.toString);
|
|
922
921
|
|
|
923
922
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
924
|
-
if (!isCallable$
|
|
923
|
+
if (!isCallable$7(store.inspectSource)) {
|
|
925
924
|
store.inspectSource = function (it) {
|
|
926
925
|
return functionToString(it);
|
|
927
926
|
};
|
|
@@ -929,51 +928,51 @@ if (!isCallable$6(store.inspectSource)) {
|
|
|
929
928
|
|
|
930
929
|
var inspectSource$1 = store.inspectSource;
|
|
931
930
|
|
|
932
|
-
var uncurryThis$
|
|
933
|
-
var fails$
|
|
934
|
-
var isCallable$
|
|
935
|
-
var hasOwn$
|
|
931
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
932
|
+
var fails$a = fails$h;
|
|
933
|
+
var isCallable$6 = isCallable$e;
|
|
934
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
936
935
|
var DESCRIPTORS$2 = descriptors;
|
|
937
936
|
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
938
937
|
var inspectSource = inspectSource$1;
|
|
939
938
|
var InternalStateModule$1 = internalState;
|
|
940
939
|
|
|
941
940
|
var enforceInternalState = InternalStateModule$1.enforce;
|
|
942
|
-
var getInternalState$
|
|
943
|
-
var $String$
|
|
941
|
+
var getInternalState$2 = InternalStateModule$1.get;
|
|
942
|
+
var $String$2 = String;
|
|
944
943
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
945
944
|
var defineProperty$3 = Object.defineProperty;
|
|
946
|
-
var stringSlice = uncurryThis$
|
|
947
|
-
var replace = uncurryThis$
|
|
948
|
-
var join = uncurryThis$
|
|
945
|
+
var stringSlice$2 = uncurryThis$8(''.slice);
|
|
946
|
+
var replace$1 = uncurryThis$8(''.replace);
|
|
947
|
+
var join = uncurryThis$8([].join);
|
|
949
948
|
|
|
950
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$
|
|
949
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$a(function () {
|
|
951
950
|
return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
952
951
|
});
|
|
953
952
|
|
|
954
953
|
var TEMPLATE = String(String).split('String');
|
|
955
954
|
|
|
956
955
|
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
957
|
-
if (stringSlice($String$
|
|
958
|
-
name = '[' + replace($String$
|
|
956
|
+
if (stringSlice$2($String$2(name), 0, 7) === 'Symbol(') {
|
|
957
|
+
name = '[' + replace$1($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
959
958
|
}
|
|
960
959
|
if (options && options.getter) name = 'get ' + name;
|
|
961
960
|
if (options && options.setter) name = 'set ' + name;
|
|
962
|
-
if (!hasOwn$
|
|
961
|
+
if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
963
962
|
if (DESCRIPTORS$2) defineProperty$3(value, 'name', { value: name, configurable: true });
|
|
964
963
|
else value.name = name;
|
|
965
964
|
}
|
|
966
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$
|
|
965
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
|
|
967
966
|
defineProperty$3(value, 'length', { value: options.arity });
|
|
968
967
|
}
|
|
969
968
|
try {
|
|
970
|
-
if (options && hasOwn$
|
|
969
|
+
if (options && hasOwn$4(options, 'constructor') && options.constructor) {
|
|
971
970
|
if (DESCRIPTORS$2) defineProperty$3(value, 'prototype', { writable: false });
|
|
972
971
|
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
973
972
|
} else if (value.prototype) value.prototype = undefined;
|
|
974
973
|
} catch (error) { /* empty */ }
|
|
975
974
|
var state = enforceInternalState(value);
|
|
976
|
-
if (!hasOwn$
|
|
975
|
+
if (!hasOwn$4(state, 'source')) {
|
|
977
976
|
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
978
977
|
} return value;
|
|
979
978
|
};
|
|
@@ -981,19 +980,19 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
|
981
980
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
982
981
|
// eslint-disable-next-line no-extend-native -- required
|
|
983
982
|
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
984
|
-
return isCallable$
|
|
983
|
+
return isCallable$6(this) && getInternalState$2(this).source || inspectSource(this);
|
|
985
984
|
}, 'toString');
|
|
986
985
|
|
|
987
|
-
var isCallable$
|
|
986
|
+
var isCallable$5 = isCallable$e;
|
|
988
987
|
var definePropertyModule$1 = objectDefineProperty;
|
|
989
988
|
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
990
989
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
991
990
|
|
|
992
|
-
var defineBuiltIn$
|
|
991
|
+
var defineBuiltIn$4 = function (O, key, value, options) {
|
|
993
992
|
if (!options) options = {};
|
|
994
993
|
var simple = options.enumerable;
|
|
995
994
|
var name = options.name !== undefined ? options.name : key;
|
|
996
|
-
if (isCallable$
|
|
995
|
+
if (isCallable$5(value)) makeBuiltIn(value, name, options);
|
|
997
996
|
if (options.global) {
|
|
998
997
|
if (simple) O[key] = value;
|
|
999
998
|
else defineGlobalProperty$1(key, value);
|
|
@@ -1032,21 +1031,21 @@ var objectGetOwnPropertySymbols = {};
|
|
|
1032
1031
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1033
1032
|
|
|
1034
1033
|
var getBuiltIn = getBuiltIn$3;
|
|
1035
|
-
var uncurryThis$
|
|
1034
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
1036
1035
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
1037
1036
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
1038
|
-
var anObject = anObject$
|
|
1037
|
+
var anObject$2 = anObject$6;
|
|
1039
1038
|
|
|
1040
|
-
var concat$1 = uncurryThis$
|
|
1039
|
+
var concat$1 = uncurryThis$7([].concat);
|
|
1041
1040
|
|
|
1042
1041
|
// all object keys, includes non-enumerable and symbols
|
|
1043
1042
|
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1044
|
-
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
1043
|
+
var keys = getOwnPropertyNamesModule.f(anObject$2(it));
|
|
1045
1044
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1046
1045
|
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
1047
1046
|
};
|
|
1048
1047
|
|
|
1049
|
-
var hasOwn$
|
|
1048
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
1050
1049
|
var ownKeys = ownKeys$1;
|
|
1051
1050
|
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1052
1051
|
var definePropertyModule = objectDefineProperty;
|
|
@@ -1057,14 +1056,14 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
|
1057
1056
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1058
1057
|
for (var i = 0; i < keys.length; i++) {
|
|
1059
1058
|
var key = keys[i];
|
|
1060
|
-
if (!hasOwn$
|
|
1059
|
+
if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
|
|
1061
1060
|
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1062
1061
|
}
|
|
1063
1062
|
}
|
|
1064
1063
|
};
|
|
1065
1064
|
|
|
1066
|
-
var fails$
|
|
1067
|
-
var isCallable$
|
|
1065
|
+
var fails$9 = fails$h;
|
|
1066
|
+
var isCallable$4 = isCallable$e;
|
|
1068
1067
|
|
|
1069
1068
|
var replacement = /#|\.prototype\./;
|
|
1070
1069
|
|
|
@@ -1072,7 +1071,7 @@ var isForced$1 = function (feature, detection) {
|
|
|
1072
1071
|
var value = data[normalize(feature)];
|
|
1073
1072
|
return value === POLYFILL ? true
|
|
1074
1073
|
: value === NATIVE ? false
|
|
1075
|
-
: isCallable$
|
|
1074
|
+
: isCallable$4(detection) ? fails$9(detection)
|
|
1076
1075
|
: !!detection;
|
|
1077
1076
|
};
|
|
1078
1077
|
|
|
@@ -1086,10 +1085,10 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
1086
1085
|
|
|
1087
1086
|
var isForced_1 = isForced$1;
|
|
1088
1087
|
|
|
1089
|
-
var global$
|
|
1090
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1088
|
+
var global$5 = global$e;
|
|
1089
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
1091
1090
|
var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
|
|
1092
|
-
var defineBuiltIn$
|
|
1091
|
+
var defineBuiltIn$3 = defineBuiltIn$4;
|
|
1093
1092
|
var defineGlobalProperty = defineGlobalProperty$3;
|
|
1094
1093
|
var copyConstructorProperties = copyConstructorProperties$1;
|
|
1095
1094
|
var isForced = isForced_1;
|
|
@@ -1115,16 +1114,16 @@ var _export = function (options, source) {
|
|
|
1115
1114
|
var STATIC = options.stat;
|
|
1116
1115
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1117
1116
|
if (GLOBAL) {
|
|
1118
|
-
target = global$
|
|
1117
|
+
target = global$5;
|
|
1119
1118
|
} else if (STATIC) {
|
|
1120
|
-
target = global$
|
|
1119
|
+
target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1121
1120
|
} else {
|
|
1122
|
-
target = global$
|
|
1121
|
+
target = global$5[TARGET] && global$5[TARGET].prototype;
|
|
1123
1122
|
}
|
|
1124
1123
|
if (target) for (key in source) {
|
|
1125
1124
|
sourceProperty = source[key];
|
|
1126
1125
|
if (options.dontCallGetSet) {
|
|
1127
|
-
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1126
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
1128
1127
|
targetProperty = descriptor && descriptor.value;
|
|
1129
1128
|
} else targetProperty = target[key];
|
|
1130
1129
|
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
@@ -1137,49 +1136,49 @@ var _export = function (options, source) {
|
|
|
1137
1136
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1138
1137
|
createNonEnumerableProperty$2(sourceProperty, 'sham', true);
|
|
1139
1138
|
}
|
|
1140
|
-
defineBuiltIn$
|
|
1139
|
+
defineBuiltIn$3(target, key, sourceProperty, options);
|
|
1141
1140
|
}
|
|
1142
1141
|
};
|
|
1143
1142
|
|
|
1144
|
-
var fails$
|
|
1143
|
+
var fails$8 = fails$h;
|
|
1145
1144
|
|
|
1146
|
-
var correctPrototypeGetter = !fails$
|
|
1145
|
+
var correctPrototypeGetter = !fails$8(function () {
|
|
1147
1146
|
function F() { /* empty */ }
|
|
1148
1147
|
F.prototype.constructor = null;
|
|
1149
1148
|
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1150
1149
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1151
1150
|
});
|
|
1152
1151
|
|
|
1153
|
-
var hasOwn$
|
|
1154
|
-
var isCallable$
|
|
1155
|
-
var toObject$
|
|
1152
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
1153
|
+
var isCallable$3 = isCallable$e;
|
|
1154
|
+
var toObject$2 = toObject$4;
|
|
1156
1155
|
var sharedKey = sharedKey$3;
|
|
1157
1156
|
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1158
1157
|
|
|
1159
1158
|
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1160
|
-
var $Object = Object;
|
|
1161
|
-
var ObjectPrototype = $Object.prototype;
|
|
1159
|
+
var $Object$1 = Object;
|
|
1160
|
+
var ObjectPrototype = $Object$1.prototype;
|
|
1162
1161
|
|
|
1163
1162
|
// `Object.getPrototypeOf` method
|
|
1164
1163
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1165
1164
|
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1166
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
|
1167
|
-
var object = toObject$
|
|
1168
|
-
if (hasOwn$
|
|
1165
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1166
|
+
var object = toObject$2(O);
|
|
1167
|
+
if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
|
1169
1168
|
var constructor = object.constructor;
|
|
1170
|
-
if (isCallable$
|
|
1169
|
+
if (isCallable$3(constructor) && object instanceof constructor) {
|
|
1171
1170
|
return constructor.prototype;
|
|
1172
|
-
} return object instanceof $Object ? ObjectPrototype : null;
|
|
1171
|
+
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1173
1172
|
};
|
|
1174
1173
|
|
|
1175
|
-
var fails$
|
|
1176
|
-
var isCallable$
|
|
1177
|
-
var isObject$
|
|
1174
|
+
var fails$7 = fails$h;
|
|
1175
|
+
var isCallable$2 = isCallable$e;
|
|
1176
|
+
var isObject$3 = isObject$9;
|
|
1178
1177
|
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1179
|
-
var defineBuiltIn$
|
|
1180
|
-
var wellKnownSymbol$
|
|
1178
|
+
var defineBuiltIn$2 = defineBuiltIn$4;
|
|
1179
|
+
var wellKnownSymbol$7 = wellKnownSymbol$a;
|
|
1181
1180
|
|
|
1182
|
-
var ITERATOR$2 = wellKnownSymbol$
|
|
1181
|
+
var ITERATOR$2 = wellKnownSymbol$7('iterator');
|
|
1183
1182
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1184
1183
|
|
|
1185
1184
|
// `%IteratorPrototype%` object
|
|
@@ -1197,7 +1196,7 @@ if ([].keys) {
|
|
|
1197
1196
|
}
|
|
1198
1197
|
}
|
|
1199
1198
|
|
|
1200
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$
|
|
1199
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$7(function () {
|
|
1201
1200
|
var test = {};
|
|
1202
1201
|
// FF44- legacy iterators case
|
|
1203
1202
|
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
@@ -1207,8 +1206,8 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
|
1207
1206
|
|
|
1208
1207
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1209
1208
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1210
|
-
if (!isCallable$
|
|
1211
|
-
defineBuiltIn$
|
|
1209
|
+
if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
|
|
1210
|
+
defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1212
1211
|
return this;
|
|
1213
1212
|
});
|
|
1214
1213
|
}
|
|
@@ -1219,20 +1218,20 @@ var iteratorsCore = {
|
|
|
1219
1218
|
};
|
|
1220
1219
|
|
|
1221
1220
|
var defineProperty$2 = objectDefineProperty.f;
|
|
1222
|
-
var hasOwn = hasOwnProperty_1;
|
|
1223
|
-
var wellKnownSymbol$
|
|
1221
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1222
|
+
var wellKnownSymbol$6 = wellKnownSymbol$a;
|
|
1224
1223
|
|
|
1225
|
-
var TO_STRING_TAG = wellKnownSymbol$
|
|
1224
|
+
var TO_STRING_TAG$2 = wellKnownSymbol$6('toStringTag');
|
|
1226
1225
|
|
|
1227
1226
|
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1228
1227
|
if (target && !STATIC) target = target.prototype;
|
|
1229
|
-
if (target && !hasOwn(target, TO_STRING_TAG)) {
|
|
1230
|
-
defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
1228
|
+
if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
|
|
1229
|
+
defineProperty$2(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1231
1230
|
}
|
|
1232
1231
|
};
|
|
1233
1232
|
|
|
1234
1233
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1235
|
-
var create = objectCreate;
|
|
1234
|
+
var create$1 = objectCreate;
|
|
1236
1235
|
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1237
1236
|
var setToStringTag$2 = setToStringTag$3;
|
|
1238
1237
|
var Iterators$2 = iterators;
|
|
@@ -1241,42 +1240,42 @@ var returnThis$1 = function () { return this; };
|
|
|
1241
1240
|
|
|
1242
1241
|
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1243
1242
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1244
|
-
IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1243
|
+
IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1245
1244
|
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1246
1245
|
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1247
1246
|
return IteratorConstructor;
|
|
1248
1247
|
};
|
|
1249
1248
|
|
|
1250
|
-
var uncurryThis$
|
|
1251
|
-
var aCallable = aCallable$
|
|
1249
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
1250
|
+
var aCallable$1 = aCallable$3;
|
|
1252
1251
|
|
|
1253
1252
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1254
1253
|
try {
|
|
1255
1254
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1256
|
-
return uncurryThis$
|
|
1255
|
+
return uncurryThis$6(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1257
1256
|
} catch (error) { /* empty */ }
|
|
1258
1257
|
};
|
|
1259
1258
|
|
|
1260
|
-
var isObject$
|
|
1259
|
+
var isObject$2 = isObject$9;
|
|
1261
1260
|
|
|
1262
1261
|
var isPossiblePrototype$1 = function (argument) {
|
|
1263
|
-
return isObject$
|
|
1262
|
+
return isObject$2(argument) || argument === null;
|
|
1264
1263
|
};
|
|
1265
1264
|
|
|
1266
1265
|
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1267
1266
|
|
|
1268
|
-
var $String = String;
|
|
1269
|
-
var $TypeError = TypeError;
|
|
1267
|
+
var $String$1 = String;
|
|
1268
|
+
var $TypeError$2 = TypeError;
|
|
1270
1269
|
|
|
1271
1270
|
var aPossiblePrototype$1 = function (argument) {
|
|
1272
1271
|
if (isPossiblePrototype(argument)) return argument;
|
|
1273
|
-
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
|
1272
|
+
throw new $TypeError$2("Can't set " + $String$1(argument) + ' as a prototype');
|
|
1274
1273
|
};
|
|
1275
1274
|
|
|
1276
1275
|
/* eslint-disable no-proto -- safe */
|
|
1277
1276
|
var uncurryThisAccessor = functionUncurryThisAccessor;
|
|
1278
|
-
var isObject = isObject$
|
|
1279
|
-
var requireObjectCoercible = requireObjectCoercible$
|
|
1277
|
+
var isObject$1 = isObject$9;
|
|
1278
|
+
var requireObjectCoercible$1 = requireObjectCoercible$4;
|
|
1280
1279
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1281
1280
|
|
|
1282
1281
|
// `Object.setPrototypeOf` method
|
|
@@ -1293,34 +1292,34 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1293
1292
|
CORRECT_SETTER = test instanceof Array;
|
|
1294
1293
|
} catch (error) { /* empty */ }
|
|
1295
1294
|
return function setPrototypeOf(O, proto) {
|
|
1296
|
-
requireObjectCoercible(O);
|
|
1295
|
+
requireObjectCoercible$1(O);
|
|
1297
1296
|
aPossiblePrototype(proto);
|
|
1298
|
-
if (!isObject(O)) return O;
|
|
1297
|
+
if (!isObject$1(O)) return O;
|
|
1299
1298
|
if (CORRECT_SETTER) setter(O, proto);
|
|
1300
1299
|
else O.__proto__ = proto;
|
|
1301
1300
|
return O;
|
|
1302
1301
|
};
|
|
1303
1302
|
}() : undefined);
|
|
1304
1303
|
|
|
1305
|
-
var $$
|
|
1306
|
-
var call$
|
|
1304
|
+
var $$4 = _export;
|
|
1305
|
+
var call$3 = functionCall;
|
|
1307
1306
|
var FunctionName = functionName;
|
|
1308
|
-
var isCallable = isCallable$
|
|
1307
|
+
var isCallable$1 = isCallable$e;
|
|
1309
1308
|
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1310
1309
|
var getPrototypeOf = objectGetPrototypeOf;
|
|
1311
1310
|
var setPrototypeOf = objectSetPrototypeOf;
|
|
1312
1311
|
var setToStringTag$1 = setToStringTag$3;
|
|
1313
1312
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
|
|
1314
|
-
var defineBuiltIn = defineBuiltIn$
|
|
1315
|
-
var wellKnownSymbol$
|
|
1313
|
+
var defineBuiltIn$1 = defineBuiltIn$4;
|
|
1314
|
+
var wellKnownSymbol$5 = wellKnownSymbol$a;
|
|
1316
1315
|
var Iterators$1 = iterators;
|
|
1317
1316
|
var IteratorsCore = iteratorsCore;
|
|
1318
1317
|
|
|
1319
|
-
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1318
|
+
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
|
|
1320
1319
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1321
1320
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1322
1321
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1323
|
-
var ITERATOR$1 = wellKnownSymbol$
|
|
1322
|
+
var ITERATOR$1 = wellKnownSymbol$5('iterator');
|
|
1324
1323
|
var KEYS = 'keys';
|
|
1325
1324
|
var VALUES = 'values';
|
|
1326
1325
|
var ENTRIES = 'entries';
|
|
@@ -1360,8 +1359,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1360
1359
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1361
1360
|
if (setPrototypeOf) {
|
|
1362
1361
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1363
|
-
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1364
|
-
defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1362
|
+
} else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1363
|
+
defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1365
1364
|
}
|
|
1366
1365
|
}
|
|
1367
1366
|
// Set @@toStringTag to native iterators
|
|
@@ -1370,12 +1369,12 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1370
1369
|
}
|
|
1371
1370
|
|
|
1372
1371
|
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1373
|
-
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1372
|
+
if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1374
1373
|
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1375
1374
|
createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
|
|
1376
1375
|
} else {
|
|
1377
1376
|
INCORRECT_VALUES_NAME = true;
|
|
1378
|
-
defaultIterator = function values() { return call$
|
|
1377
|
+
defaultIterator = function values() { return call$3(nativeIterator, this); };
|
|
1379
1378
|
}
|
|
1380
1379
|
}
|
|
1381
1380
|
|
|
@@ -1388,14 +1387,14 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1388
1387
|
};
|
|
1389
1388
|
if (FORCED) for (KEY in methods) {
|
|
1390
1389
|
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1391
|
-
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
|
1390
|
+
defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
|
|
1392
1391
|
}
|
|
1393
|
-
} else $$
|
|
1392
|
+
} else $$4({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1394
1393
|
}
|
|
1395
1394
|
|
|
1396
1395
|
// define iterator
|
|
1397
1396
|
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1398
|
-
defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1397
|
+
defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1399
1398
|
}
|
|
1400
1399
|
Iterators$1[NAME] = defaultIterator;
|
|
1401
1400
|
|
|
@@ -1419,7 +1418,7 @@ var DESCRIPTORS$1 = descriptors;
|
|
|
1419
1418
|
|
|
1420
1419
|
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1421
1420
|
var setInternalState = InternalStateModule.set;
|
|
1422
|
-
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1421
|
+
var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1423
1422
|
|
|
1424
1423
|
// `Array.prototype.entries` method
|
|
1425
1424
|
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
@@ -1441,7 +1440,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
|
|
|
1441
1440
|
// `%ArrayIteratorPrototype%.next` method
|
|
1442
1441
|
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1443
1442
|
}, function () {
|
|
1444
|
-
var state = getInternalState(this);
|
|
1443
|
+
var state = getInternalState$1(this);
|
|
1445
1444
|
var target = state.target;
|
|
1446
1445
|
var index = state.index++;
|
|
1447
1446
|
if (!target || index >= target.length) {
|
|
@@ -1513,15 +1512,15 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1513
1512
|
|
|
1514
1513
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1515
1514
|
|
|
1516
|
-
var global$
|
|
1515
|
+
var global$4 = global$e;
|
|
1517
1516
|
var DOMIterables = domIterables;
|
|
1518
1517
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1519
1518
|
var ArrayIteratorMethods = es_array_iterator;
|
|
1520
1519
|
var createNonEnumerableProperty = createNonEnumerableProperty$4;
|
|
1521
1520
|
var setToStringTag = setToStringTag$3;
|
|
1522
|
-
var wellKnownSymbol = wellKnownSymbol$
|
|
1521
|
+
var wellKnownSymbol$4 = wellKnownSymbol$a;
|
|
1523
1522
|
|
|
1524
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
|
1523
|
+
var ITERATOR = wellKnownSymbol$4('iterator');
|
|
1525
1524
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1526
1525
|
|
|
1527
1526
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
@@ -1545,30 +1544,264 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1545
1544
|
};
|
|
1546
1545
|
|
|
1547
1546
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1548
|
-
handlePrototype(global$
|
|
1547
|
+
handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1549
1548
|
}
|
|
1550
1549
|
|
|
1551
1550
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1552
1551
|
|
|
1552
|
+
var tryToString = tryToString$2;
|
|
1553
|
+
|
|
1554
|
+
var $TypeError$1 = TypeError;
|
|
1555
|
+
|
|
1556
|
+
var deletePropertyOrThrow$1 = function (O, P) {
|
|
1557
|
+
if (!delete O[P]) throw new $TypeError$1('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
var wellKnownSymbol$3 = wellKnownSymbol$a;
|
|
1561
|
+
|
|
1562
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
1563
|
+
var test$1 = {};
|
|
1564
|
+
|
|
1565
|
+
test$1[TO_STRING_TAG$1] = 'z';
|
|
1566
|
+
|
|
1567
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
|
1568
|
+
|
|
1569
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1570
|
+
var isCallable = isCallable$e;
|
|
1571
|
+
var classofRaw$1 = classofRaw$2;
|
|
1572
|
+
var wellKnownSymbol$2 = wellKnownSymbol$a;
|
|
1573
|
+
|
|
1574
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
1575
|
+
var $Object = Object;
|
|
1576
|
+
|
|
1577
|
+
// ES3 wrong here
|
|
1578
|
+
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
|
|
1579
|
+
|
|
1580
|
+
// fallback for IE11 Script Access Denied error
|
|
1581
|
+
var tryGet = function (it, key) {
|
|
1582
|
+
try {
|
|
1583
|
+
return it[key];
|
|
1584
|
+
} catch (error) { /* empty */ }
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
1588
|
+
var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
1589
|
+
var O, tag, result;
|
|
1590
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1591
|
+
// @@toStringTag case
|
|
1592
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1593
|
+
// builtinTag case
|
|
1594
|
+
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1595
|
+
// ES3 arguments fallback
|
|
1596
|
+
: (result = classofRaw$1(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
var classof$1 = classof$2;
|
|
1600
|
+
|
|
1601
|
+
var $String = String;
|
|
1602
|
+
|
|
1603
|
+
var toString$3 = function (argument) {
|
|
1604
|
+
if (classof$1(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1605
|
+
return $String(argument);
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
1609
|
+
|
|
1610
|
+
var arraySlice$1 = uncurryThis$5([].slice);
|
|
1611
|
+
|
|
1612
|
+
var arraySlice = arraySlice$1;
|
|
1613
|
+
|
|
1614
|
+
var floor = Math.floor;
|
|
1615
|
+
|
|
1616
|
+
var sort = function (array, comparefn) {
|
|
1617
|
+
var length = array.length;
|
|
1618
|
+
|
|
1619
|
+
if (length < 8) {
|
|
1620
|
+
// insertion sort
|
|
1621
|
+
var i = 1;
|
|
1622
|
+
var element, j;
|
|
1623
|
+
|
|
1624
|
+
while (i < length) {
|
|
1625
|
+
j = i;
|
|
1626
|
+
element = array[i];
|
|
1627
|
+
while (j && comparefn(array[j - 1], element) > 0) {
|
|
1628
|
+
array[j] = array[--j];
|
|
1629
|
+
}
|
|
1630
|
+
if (j !== i++) array[j] = element;
|
|
1631
|
+
}
|
|
1632
|
+
} else {
|
|
1633
|
+
// merge sort
|
|
1634
|
+
var middle = floor(length / 2);
|
|
1635
|
+
var left = sort(arraySlice(array, 0, middle), comparefn);
|
|
1636
|
+
var right = sort(arraySlice(array, middle), comparefn);
|
|
1637
|
+
var llength = left.length;
|
|
1638
|
+
var rlength = right.length;
|
|
1639
|
+
var lindex = 0;
|
|
1640
|
+
var rindex = 0;
|
|
1641
|
+
|
|
1642
|
+
while (lindex < llength || rindex < rlength) {
|
|
1643
|
+
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
1644
|
+
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
1645
|
+
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
return array;
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
var arraySort = sort;
|
|
1653
|
+
|
|
1654
|
+
var fails$6 = fails$h;
|
|
1655
|
+
|
|
1656
|
+
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
1657
|
+
var method = [][METHOD_NAME];
|
|
1658
|
+
return !!method && fails$6(function () {
|
|
1659
|
+
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1660
|
+
method.call(null, argument || function () { return 1; }, 1);
|
|
1661
|
+
});
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1664
|
+
var userAgent$1 = engineUserAgent;
|
|
1665
|
+
|
|
1666
|
+
var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
|
1667
|
+
|
|
1668
|
+
var engineFfVersion = !!firefox && +firefox[1];
|
|
1669
|
+
|
|
1670
|
+
var UA = engineUserAgent;
|
|
1671
|
+
|
|
1672
|
+
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
|
1673
|
+
|
|
1674
|
+
var userAgent = engineUserAgent;
|
|
1675
|
+
|
|
1676
|
+
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
|
1677
|
+
|
|
1678
|
+
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
1679
|
+
|
|
1680
|
+
var $$3 = _export;
|
|
1681
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
1682
|
+
var aCallable = aCallable$3;
|
|
1683
|
+
var toObject$1 = toObject$4;
|
|
1684
|
+
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
1685
|
+
var deletePropertyOrThrow = deletePropertyOrThrow$1;
|
|
1686
|
+
var toString$2 = toString$3;
|
|
1687
|
+
var fails$5 = fails$h;
|
|
1688
|
+
var internalSort = arraySort;
|
|
1689
|
+
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
1690
|
+
var FF = engineFfVersion;
|
|
1691
|
+
var IE_OR_EDGE = engineIsIeOrEdge;
|
|
1692
|
+
var V8 = engineV8Version;
|
|
1693
|
+
var WEBKIT = engineWebkitVersion;
|
|
1694
|
+
|
|
1695
|
+
var test = [];
|
|
1696
|
+
var nativeSort = uncurryThis$4(test.sort);
|
|
1697
|
+
var push = uncurryThis$4(test.push);
|
|
1698
|
+
|
|
1699
|
+
// IE8-
|
|
1700
|
+
var FAILS_ON_UNDEFINED = fails$5(function () {
|
|
1701
|
+
test.sort(undefined);
|
|
1702
|
+
});
|
|
1703
|
+
// V8 bug
|
|
1704
|
+
var FAILS_ON_NULL = fails$5(function () {
|
|
1705
|
+
test.sort(null);
|
|
1706
|
+
});
|
|
1707
|
+
// Old WebKit
|
|
1708
|
+
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
1709
|
+
|
|
1710
|
+
var STABLE_SORT = !fails$5(function () {
|
|
1711
|
+
// feature detection can be too slow, so check engines versions
|
|
1712
|
+
if (V8) return V8 < 70;
|
|
1713
|
+
if (FF && FF > 3) return;
|
|
1714
|
+
if (IE_OR_EDGE) return true;
|
|
1715
|
+
if (WEBKIT) return WEBKIT < 603;
|
|
1716
|
+
|
|
1717
|
+
var result = '';
|
|
1718
|
+
var code, chr, value, index;
|
|
1719
|
+
|
|
1720
|
+
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
1721
|
+
for (code = 65; code < 76; code++) {
|
|
1722
|
+
chr = String.fromCharCode(code);
|
|
1723
|
+
|
|
1724
|
+
switch (code) {
|
|
1725
|
+
case 66: case 69: case 70: case 72: value = 3; break;
|
|
1726
|
+
case 68: case 71: value = 4; break;
|
|
1727
|
+
default: value = 2;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
for (index = 0; index < 47; index++) {
|
|
1731
|
+
test.push({ k: chr + index, v: value });
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
test.sort(function (a, b) { return b.v - a.v; });
|
|
1736
|
+
|
|
1737
|
+
for (index = 0; index < test.length; index++) {
|
|
1738
|
+
chr = test[index].k.charAt(0);
|
|
1739
|
+
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
return result !== 'DGBEFHACIJK';
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
|
1746
|
+
|
|
1747
|
+
var getSortCompare = function (comparefn) {
|
|
1748
|
+
return function (x, y) {
|
|
1749
|
+
if (y === undefined) return -1;
|
|
1750
|
+
if (x === undefined) return 1;
|
|
1751
|
+
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
1752
|
+
return toString$2(x) > toString$2(y) ? 1 : -1;
|
|
1753
|
+
};
|
|
1754
|
+
};
|
|
1755
|
+
|
|
1756
|
+
// `Array.prototype.sort` method
|
|
1757
|
+
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
1758
|
+
$$3({ target: 'Array', proto: true, forced: FORCED }, {
|
|
1759
|
+
sort: function sort(comparefn) {
|
|
1760
|
+
if (comparefn !== undefined) aCallable(comparefn);
|
|
1761
|
+
|
|
1762
|
+
var array = toObject$1(this);
|
|
1763
|
+
|
|
1764
|
+
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
|
1765
|
+
|
|
1766
|
+
var items = [];
|
|
1767
|
+
var arrayLength = lengthOfArrayLike(array);
|
|
1768
|
+
var itemsLength, index;
|
|
1769
|
+
|
|
1770
|
+
for (index = 0; index < arrayLength; index++) {
|
|
1771
|
+
if (index in array) push(items, array[index]);
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
internalSort(items, getSortCompare(comparefn));
|
|
1775
|
+
|
|
1776
|
+
itemsLength = lengthOfArrayLike(items);
|
|
1777
|
+
index = 0;
|
|
1778
|
+
|
|
1779
|
+
while (index < itemsLength) array[index] = items[index++];
|
|
1780
|
+
while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
|
1781
|
+
|
|
1782
|
+
return array;
|
|
1783
|
+
}
|
|
1784
|
+
});
|
|
1785
|
+
|
|
1553
1786
|
var DESCRIPTORS = descriptors;
|
|
1554
|
-
var uncurryThis = functionUncurryThis;
|
|
1555
|
-
var call = functionCall;
|
|
1556
|
-
var fails = fails$
|
|
1787
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
1788
|
+
var call$2 = functionCall;
|
|
1789
|
+
var fails$4 = fails$h;
|
|
1557
1790
|
var objectKeys = objectKeys$2;
|
|
1558
1791
|
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1559
1792
|
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1560
|
-
var toObject = toObject$
|
|
1793
|
+
var toObject = toObject$4;
|
|
1561
1794
|
var IndexedObject = indexedObject;
|
|
1562
1795
|
|
|
1563
1796
|
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1564
1797
|
var $assign = Object.assign;
|
|
1565
1798
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1566
1799
|
var defineProperty = Object.defineProperty;
|
|
1567
|
-
var concat = uncurryThis([].concat);
|
|
1800
|
+
var concat = uncurryThis$3([].concat);
|
|
1568
1801
|
|
|
1569
1802
|
// `Object.assign` method
|
|
1570
1803
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1571
|
-
var objectAssign = !$assign || fails(function () {
|
|
1804
|
+
var objectAssign = !$assign || fails$4(function () {
|
|
1572
1805
|
// should have correct order of operations (Edge bug)
|
|
1573
1806
|
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
|
1574
1807
|
enumerable: true,
|
|
@@ -1602,29 +1835,176 @@ var objectAssign = !$assign || fails(function () {
|
|
|
1602
1835
|
var key;
|
|
1603
1836
|
while (length > j) {
|
|
1604
1837
|
key = keys[j++];
|
|
1605
|
-
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1838
|
+
if (!DESCRIPTORS || call$2(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1606
1839
|
}
|
|
1607
1840
|
} return T;
|
|
1608
1841
|
} : $assign;
|
|
1609
1842
|
|
|
1610
|
-
var
|
|
1843
|
+
var $$2 = _export;
|
|
1611
1844
|
var assign = objectAssign;
|
|
1612
1845
|
|
|
1613
1846
|
// `Object.assign` method
|
|
1614
1847
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
1615
1848
|
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1616
|
-
|
|
1849
|
+
$$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1617
1850
|
assign: assign
|
|
1618
1851
|
});
|
|
1619
1852
|
|
|
1620
|
-
|
|
1853
|
+
var anObject$1 = anObject$6;
|
|
1854
|
+
|
|
1855
|
+
// `RegExp.prototype.flags` getter implementation
|
|
1856
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1857
|
+
var regexpFlags$1 = function () {
|
|
1858
|
+
var that = anObject$1(this);
|
|
1859
|
+
var result = '';
|
|
1860
|
+
if (that.hasIndices) result += 'd';
|
|
1861
|
+
if (that.global) result += 'g';
|
|
1862
|
+
if (that.ignoreCase) result += 'i';
|
|
1863
|
+
if (that.multiline) result += 'm';
|
|
1864
|
+
if (that.dotAll) result += 's';
|
|
1865
|
+
if (that.unicode) result += 'u';
|
|
1866
|
+
if (that.unicodeSets) result += 'v';
|
|
1867
|
+
if (that.sticky) result += 'y';
|
|
1868
|
+
return result;
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
var call$1 = functionCall;
|
|
1872
|
+
var hasOwn = hasOwnProperty_1;
|
|
1873
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
1874
|
+
var regExpFlags = regexpFlags$1;
|
|
1875
|
+
|
|
1876
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
|
1877
|
+
|
|
1878
|
+
var regexpGetFlags = function (R) {
|
|
1879
|
+
var flags = R.flags;
|
|
1880
|
+
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
|
|
1881
|
+
? call$1(regExpFlags, R) : flags;
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
1885
|
+
var defineBuiltIn = defineBuiltIn$4;
|
|
1886
|
+
var anObject = anObject$6;
|
|
1887
|
+
var $toString = toString$3;
|
|
1888
|
+
var fails$3 = fails$h;
|
|
1889
|
+
var getRegExpFlags = regexpGetFlags;
|
|
1890
|
+
|
|
1891
|
+
var TO_STRING = 'toString';
|
|
1892
|
+
var RegExpPrototype = RegExp.prototype;
|
|
1893
|
+
var nativeToString = RegExpPrototype[TO_STRING];
|
|
1894
|
+
|
|
1895
|
+
var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
1896
|
+
// FF44- RegExp#toString has a wrong name
|
|
1897
|
+
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
|
|
1898
|
+
|
|
1899
|
+
// `RegExp.prototype.toString` method
|
|
1900
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
1901
|
+
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
1902
|
+
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
|
|
1903
|
+
var R = anObject(this);
|
|
1904
|
+
var pattern = $toString(R.source);
|
|
1905
|
+
var flags = $toString(getRegExpFlags(R));
|
|
1906
|
+
return '/' + pattern + '/' + flags;
|
|
1907
|
+
}, { unsafe: true });
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
var classofRaw = classofRaw$2;
|
|
1911
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
1912
|
+
|
|
1913
|
+
var functionUncurryThisClause = function (fn) {
|
|
1914
|
+
// Nashorn bug:
|
|
1915
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
1916
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
1917
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$2(fn);
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
var isObject = isObject$9;
|
|
1921
|
+
var classof = classofRaw$2;
|
|
1922
|
+
var wellKnownSymbol$1 = wellKnownSymbol$a;
|
|
1923
|
+
|
|
1924
|
+
var MATCH$1 = wellKnownSymbol$1('match');
|
|
1925
|
+
|
|
1926
|
+
// `IsRegExp` abstract operation
|
|
1927
|
+
// https://tc39.es/ecma262/#sec-isregexp
|
|
1928
|
+
var isRegexp = function (it) {
|
|
1929
|
+
var isRegExp;
|
|
1930
|
+
return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
var isRegExp = isRegexp;
|
|
1934
|
+
|
|
1935
|
+
var $TypeError = TypeError;
|
|
1936
|
+
|
|
1937
|
+
var notARegexp = function (it) {
|
|
1938
|
+
if (isRegExp(it)) {
|
|
1939
|
+
throw new $TypeError("The method doesn't accept regular expressions");
|
|
1940
|
+
} return it;
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1943
|
+
var wellKnownSymbol = wellKnownSymbol$a;
|
|
1944
|
+
|
|
1945
|
+
var MATCH = wellKnownSymbol('match');
|
|
1946
|
+
|
|
1947
|
+
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
1948
|
+
var regexp = /./;
|
|
1949
|
+
try {
|
|
1950
|
+
'/./'[METHOD_NAME](regexp);
|
|
1951
|
+
} catch (error1) {
|
|
1952
|
+
try {
|
|
1953
|
+
regexp[MATCH] = false;
|
|
1954
|
+
return '/./'[METHOD_NAME](regexp);
|
|
1955
|
+
} catch (error2) { /* empty */ }
|
|
1956
|
+
} return false;
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
var $$1 = _export;
|
|
1960
|
+
var uncurryThis$1 = functionUncurryThisClause;
|
|
1961
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1962
|
+
var toLength = toLength$2;
|
|
1963
|
+
var toString$1 = toString$3;
|
|
1964
|
+
var notARegExp = notARegexp;
|
|
1965
|
+
var requireObjectCoercible = requireObjectCoercible$4;
|
|
1966
|
+
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
1967
|
+
|
|
1968
|
+
var stringSlice$1 = uncurryThis$1(''.slice);
|
|
1969
|
+
var min = Math.min;
|
|
1970
|
+
|
|
1971
|
+
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
|
1972
|
+
// https://github.com/zloirock/core-js/pull/702
|
|
1973
|
+
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
1974
|
+
var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
|
|
1975
|
+
return descriptor && !descriptor.writable;
|
|
1976
|
+
}();
|
|
1977
|
+
|
|
1978
|
+
// `String.prototype.startsWith` method
|
|
1979
|
+
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
1980
|
+
$$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
1981
|
+
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
1982
|
+
var that = toString$1(requireObjectCoercible(this));
|
|
1983
|
+
notARegExp(searchString);
|
|
1984
|
+
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
1985
|
+
var search = toString$1(searchString);
|
|
1986
|
+
return stringSlice$1(that, index, index + search.length) === search;
|
|
1987
|
+
}
|
|
1988
|
+
});
|
|
1989
|
+
|
|
1621
1990
|
const FormGroupContext = /*#__PURE__*/createContext({});
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1991
|
+
/**
|
|
1992
|
+
* context interface to be used isolated or with the context provider
|
|
1993
|
+
*
|
|
1994
|
+
* @param {TFormContextProvider} param context parameters
|
|
1995
|
+
* @returns {TFormContext}
|
|
1996
|
+
*/
|
|
1997
|
+
const IsolatedContext = ({
|
|
1998
|
+
debugMode: _debugMode = false,
|
|
1999
|
+
mappers
|
|
1626
2000
|
}) => {
|
|
1627
2001
|
const formGroupInstance = useRef(new FormGroup());
|
|
2002
|
+
const addFormWithIndex = index => {
|
|
2003
|
+
formGroupInstance.current.createFormWithIndex({
|
|
2004
|
+
index,
|
|
2005
|
+
mappers
|
|
2006
|
+
});
|
|
2007
|
+
};
|
|
1628
2008
|
const addForm = ({
|
|
1629
2009
|
key,
|
|
1630
2010
|
formInstance
|
|
@@ -1649,10 +2029,11 @@ const FormGroupContextProvider = ({
|
|
|
1649
2029
|
const printFormGroupInstance = () => {
|
|
1650
2030
|
console.log(formGroupInstance.current.printFormGroupInstance());
|
|
1651
2031
|
};
|
|
1652
|
-
|
|
2032
|
+
function submitMultipleFormsByIndex(indexes) {
|
|
1653
2033
|
return formGroupInstance.current.submitMultipleFormsByIndex(indexes);
|
|
1654
|
-
}
|
|
1655
|
-
|
|
2034
|
+
}
|
|
2035
|
+
return {
|
|
2036
|
+
addFormWithIndex,
|
|
1656
2037
|
addForm,
|
|
1657
2038
|
getForm,
|
|
1658
2039
|
removeForm,
|
|
@@ -1660,24 +2041,802 @@ const FormGroupContextProvider = ({
|
|
|
1660
2041
|
formGroupInstance: formGroupInstance.current,
|
|
1661
2042
|
printFormGroupInstance,
|
|
1662
2043
|
submitMultipleFormsByIndex,
|
|
1663
|
-
debugMode: _debugMode
|
|
2044
|
+
debugMode: _debugMode,
|
|
2045
|
+
active: false
|
|
1664
2046
|
};
|
|
2047
|
+
};
|
|
2048
|
+
/**
|
|
2049
|
+
* context provider to wrap form-engine adapter elements
|
|
2050
|
+
*
|
|
2051
|
+
* @param {PropsWithChildren<TFormContextProvider>} param context parameters
|
|
2052
|
+
* @returns {ReactElement}
|
|
2053
|
+
*/
|
|
2054
|
+
const FormGroupContextProvider = ({
|
|
2055
|
+
children,
|
|
2056
|
+
mappers,
|
|
2057
|
+
debugMode: _debugMode2 = false
|
|
2058
|
+
}) => {
|
|
2059
|
+
const contextValue = IsolatedContext({
|
|
2060
|
+
mappers,
|
|
2061
|
+
debugMode: _debugMode2
|
|
2062
|
+
});
|
|
2063
|
+
contextValue.debugMode = _debugMode2;
|
|
2064
|
+
contextValue.active = true;
|
|
1665
2065
|
return jsxs(FormGroupContext.Provider, {
|
|
1666
2066
|
value: contextValue,
|
|
1667
|
-
children: [
|
|
2067
|
+
children: [_debugMode2 && jsxs(Fragment, {
|
|
1668
2068
|
children: [jsx("button", {
|
|
1669
|
-
onClick: () => console.log(formGroupInstance),
|
|
2069
|
+
onClick: () => console.log(contextValue.formGroupInstance),
|
|
1670
2070
|
children: "printGroupInstance"
|
|
1671
2071
|
}), jsx("br", {}), jsx("hr", {})]
|
|
1672
2072
|
}), children]
|
|
1673
2073
|
});
|
|
1674
2074
|
};
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
2075
|
+
/**
|
|
2076
|
+
* FormGroup context hook to handle context or isolated context implementations
|
|
2077
|
+
*
|
|
2078
|
+
* @param {TFormContextProvider} props form group context parameters
|
|
2079
|
+
* @returns {TFormContext}
|
|
2080
|
+
*/
|
|
2081
|
+
const useFormGroupContext = props => {
|
|
2082
|
+
const context = useContext(FormGroupContext);
|
|
2083
|
+
if (Object.keys(context).length === 0 && props) {
|
|
2084
|
+
return IsolatedContext({
|
|
2085
|
+
debugMode: props.debugMode,
|
|
2086
|
+
mappers: props.mappers
|
|
2087
|
+
});
|
|
1679
2088
|
}
|
|
1680
2089
|
return context;
|
|
1681
2090
|
};
|
|
1682
2091
|
|
|
1683
|
-
|
|
2092
|
+
/**
|
|
2093
|
+
* Renders the React element defined on the mappers configuration
|
|
2094
|
+
*
|
|
2095
|
+
* @param param component props, field instance and children to render
|
|
2096
|
+
* @returns
|
|
2097
|
+
*/
|
|
2098
|
+
const FieldWrapperComponentRender = ({
|
|
2099
|
+
props,
|
|
2100
|
+
fieldInstance,
|
|
2101
|
+
children
|
|
2102
|
+
}) => {
|
|
2103
|
+
var _a, _b, _c;
|
|
2104
|
+
const Component = (_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.component;
|
|
2105
|
+
const Asynccomponent = (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _b === void 0 ? void 0 : _b.asynccomponent;
|
|
2106
|
+
if (Component) return jsx(Component, Object.assign({}, props, {
|
|
2107
|
+
children: children && children
|
|
2108
|
+
}));
|
|
2109
|
+
if (Asynccomponent) return jsx(Suspense, {
|
|
2110
|
+
children: jsx(Asynccomponent, Object.assign({}, props, {
|
|
2111
|
+
children: children && children
|
|
2112
|
+
}))
|
|
2113
|
+
});
|
|
2114
|
+
return jsx("div", {
|
|
2115
|
+
children: `failed to render field ${fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.name} with componentName:${(_c = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _c === void 0 ? void 0 : _c.componentName}, please check mappers`
|
|
2116
|
+
});
|
|
2117
|
+
};
|
|
2118
|
+
/**
|
|
2119
|
+
* Base field Wrapper to render the component with the necessary configurations from the schema
|
|
2120
|
+
* and mapper configuration
|
|
2121
|
+
*
|
|
2122
|
+
* @param {TFieldWrapperProps} param FieldWrapper params
|
|
2123
|
+
* @returns {ReactElement}
|
|
2124
|
+
*/
|
|
2125
|
+
const FieldWrapper = ({
|
|
2126
|
+
name,
|
|
2127
|
+
formIndex,
|
|
2128
|
+
children,
|
|
2129
|
+
props,
|
|
2130
|
+
context
|
|
2131
|
+
}) => {
|
|
2132
|
+
var _a, _b;
|
|
2133
|
+
const localContext = useFormGroupContext({});
|
|
2134
|
+
/**
|
|
2135
|
+
* picks the right context prioritizing the context passed as prop
|
|
2136
|
+
*/
|
|
2137
|
+
const {
|
|
2138
|
+
formGroupInstance,
|
|
2139
|
+
debugMode
|
|
2140
|
+
} = useMemo(() => context ? context : localContext, [context, localContext]);
|
|
2141
|
+
const fieldInstance = useRef((_a = formGroupInstance.getForm({
|
|
2142
|
+
key: formIndex
|
|
2143
|
+
})) === null || _a === void 0 ? void 0 : _a.getField({
|
|
2144
|
+
key: name
|
|
2145
|
+
})).current;
|
|
2146
|
+
const [valueState, setValueState] = useState((fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.stateValue) || {});
|
|
2147
|
+
const [state, setState] = useState({
|
|
2148
|
+
visibility: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.visibility) || true,
|
|
2149
|
+
props: (fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.props) || props
|
|
2150
|
+
});
|
|
2151
|
+
/**
|
|
2152
|
+
* handles the mounting and unmounting logic onto the field instance
|
|
2153
|
+
*/
|
|
2154
|
+
useEffect(() => {
|
|
2155
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mountField({
|
|
2156
|
+
valueSubscription: value => {
|
|
2157
|
+
setValueState(value);
|
|
2158
|
+
},
|
|
2159
|
+
propsSubscription: ({
|
|
2160
|
+
visibility,
|
|
2161
|
+
props,
|
|
2162
|
+
errors
|
|
2163
|
+
}) => {
|
|
2164
|
+
setState(prev => Object.assign(Object.assign({}, prev), {
|
|
2165
|
+
visibility,
|
|
2166
|
+
props,
|
|
2167
|
+
errors
|
|
2168
|
+
}));
|
|
2169
|
+
}
|
|
2170
|
+
});
|
|
2171
|
+
return () => {
|
|
2172
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.destroyField();
|
|
2173
|
+
};
|
|
2174
|
+
}, []);
|
|
2175
|
+
/**
|
|
2176
|
+
* handles the value change onto the field instance
|
|
2177
|
+
*/
|
|
2178
|
+
const handleChange = useCallback(event => {
|
|
2179
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitValue({
|
|
2180
|
+
value: event,
|
|
2181
|
+
event: 'ON_FIELD_CHANGE'
|
|
2182
|
+
});
|
|
2183
|
+
}, []);
|
|
2184
|
+
/**
|
|
2185
|
+
* handles the event emission onto the field instance
|
|
2186
|
+
*/
|
|
2187
|
+
const handleEvent = useCallback(event => {
|
|
2188
|
+
fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.emitEvents({
|
|
2189
|
+
event
|
|
2190
|
+
});
|
|
2191
|
+
}, []);
|
|
2192
|
+
/**
|
|
2193
|
+
* handles the mappers configuration to bind the event submission callback
|
|
2194
|
+
* to the corresponding prop defined on the mappers
|
|
2195
|
+
*/
|
|
2196
|
+
const mapProps = useMemo(() => {
|
|
2197
|
+
var _a;
|
|
2198
|
+
const events = (_a = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.mapper) === null || _a === void 0 ? void 0 : _a.events;
|
|
2199
|
+
const props = {};
|
|
2200
|
+
if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
|
|
2201
|
+
if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
|
|
2202
|
+
if (events === null || events === void 0 ? void 0 : events.onFocus) props[events.onFocus] = () => handleEvent('ON_FIELD_FOCUS');
|
|
2203
|
+
if (events === null || events === void 0 ? void 0 : events.onClick) props[events.onClick] = () => handleEvent('ON_FIELD_CLICK');
|
|
2204
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyUp) props[events.onKeyUp] = () => handleEvent('ON_FIELD_KEYUP');
|
|
2205
|
+
if (events === null || events === void 0 ? void 0 : events.onKeyDown) props[events.onKeyDown] = () => handleEvent('ON_FIELD_KEYDOWN');
|
|
2206
|
+
return props;
|
|
2207
|
+
}, []);
|
|
2208
|
+
return (state === null || state === void 0 ? void 0 : state.visibility) ? jsxs(Fragment, {
|
|
2209
|
+
children: [debugMode && jsx(Fragment, {
|
|
2210
|
+
children: jsxs("div", {
|
|
2211
|
+
style: {
|
|
2212
|
+
width: '100%',
|
|
2213
|
+
display: 'flex',
|
|
2214
|
+
flexDirection: 'column'
|
|
2215
|
+
},
|
|
2216
|
+
children: [jsxs("b", {
|
|
2217
|
+
style: {
|
|
2218
|
+
padding: '0px',
|
|
2219
|
+
margin: '0px'
|
|
2220
|
+
},
|
|
2221
|
+
children: ["name:", name]
|
|
2222
|
+
}), jsxs("b", {
|
|
2223
|
+
style: {
|
|
2224
|
+
padding: '0px',
|
|
2225
|
+
margin: '0px'
|
|
2226
|
+
},
|
|
2227
|
+
children: ["order:", (_b = fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.originalSchema) === null || _b === void 0 ? void 0 : _b.order]
|
|
2228
|
+
}), jsxs("b", {
|
|
2229
|
+
style: {
|
|
2230
|
+
padding: '0px',
|
|
2231
|
+
margin: '0px'
|
|
2232
|
+
},
|
|
2233
|
+
children: ["path:", fieldInstance === null || fieldInstance === void 0 ? void 0 : fieldInstance.path]
|
|
2234
|
+
}), jsx("br", {}), jsx("hr", {})]
|
|
2235
|
+
})
|
|
2236
|
+
}), jsx(FieldWrapperComponentRender, {
|
|
2237
|
+
props: Object.assign(Object.assign(Object.assign(Object.assign({}, mapProps), state.props), state.errors), valueState),
|
|
2238
|
+
fieldInstance: fieldInstance,
|
|
2239
|
+
children: children && children
|
|
2240
|
+
})]
|
|
2241
|
+
}) : jsx(Fragment, {});
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
/**
|
|
2245
|
+
* recursive function to transform form fields from a form instance into
|
|
2246
|
+
* a react component tree
|
|
2247
|
+
*
|
|
2248
|
+
* @param {Map<string,IFormField>} param.fields form instance field Map
|
|
2249
|
+
* @param {string} param.prevPath previous field path to track the tree branch creation
|
|
2250
|
+
* @param {string} param.formIndex form index to aid field identification onto the FieldWrapper
|
|
2251
|
+
* @returns {ReactNode}
|
|
2252
|
+
*/
|
|
2253
|
+
const BuildTree = ({
|
|
2254
|
+
fields,
|
|
2255
|
+
prevPath,
|
|
2256
|
+
formIndex
|
|
2257
|
+
}) => {
|
|
2258
|
+
return Array.from(fields).sort(([, field], [, field2]) => {
|
|
2259
|
+
var _a, _b;
|
|
2260
|
+
return (((_a = field.originalSchema) === null || _a === void 0 ? void 0 : _a.order) || 0) - (((_b = field2.originalSchema) === null || _b === void 0 ? void 0 : _b.order) || 0);
|
|
2261
|
+
}).filter(([, value]) => {
|
|
2262
|
+
return value.path === prevPath;
|
|
2263
|
+
}).map(([, value]) => {
|
|
2264
|
+
const fieldName = value.name;
|
|
2265
|
+
const children = BuildTree({
|
|
2266
|
+
fields,
|
|
2267
|
+
prevPath: `${prevPath ? `${prevPath}.` : ``}${value.name}`,
|
|
2268
|
+
formIndex
|
|
2269
|
+
});
|
|
2270
|
+
const lenght = Children.count(children);
|
|
2271
|
+
return jsx(FieldWrapper, {
|
|
2272
|
+
name: fieldName,
|
|
2273
|
+
formIndex: formIndex,
|
|
2274
|
+
children: lenght > 0 ? children : null
|
|
2275
|
+
}, fieldName);
|
|
2276
|
+
});
|
|
2277
|
+
};
|
|
2278
|
+
/**
|
|
2279
|
+
* function to transform AsFormField elements onto a JSON schema
|
|
2280
|
+
*
|
|
2281
|
+
* @param param.children ReactNode children elements
|
|
2282
|
+
* @returns {IComponentSchema[] | null | undefined}
|
|
2283
|
+
*/
|
|
2284
|
+
const BuildAsFormFieldTree = ({
|
|
2285
|
+
children
|
|
2286
|
+
}) => {
|
|
2287
|
+
return Children.map(children, (child, index) => {
|
|
2288
|
+
var _a, _b, _c, _d, _e;
|
|
2289
|
+
let struct;
|
|
2290
|
+
if (!String((_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.name).startsWith('AsFormField')) {
|
|
2291
|
+
if (typeof child.type === 'function' || typeof child.type === 'object') {
|
|
2292
|
+
const props = Object.assign({}, child.props);
|
|
2293
|
+
delete props.children;
|
|
2294
|
+
struct = {
|
|
2295
|
+
component: ((_b = child === null || child === void 0 ? void 0 : child.type) === null || _b === void 0 ? void 0 : _b.name) || 'customForwardRef',
|
|
2296
|
+
name: `adapter-${Math.floor(Math.random() * Date.now()).toString(16)}`,
|
|
2297
|
+
mapper: {
|
|
2298
|
+
component: child.type,
|
|
2299
|
+
componentName: typeof child.type !== 'string' ? (_c = child === null || child === void 0 ? void 0 : child.type) === null || _c === void 0 ? void 0 : _c.name : child.type
|
|
2300
|
+
},
|
|
2301
|
+
props
|
|
2302
|
+
};
|
|
2303
|
+
} else if (typeof child.type === 'string' || typeof child === 'string') {
|
|
2304
|
+
throw new Error(`Only function components works inside a Form as React Nodes,\n
|
|
2305
|
+
if you want something like this to work: <div>hi</div>\n
|
|
2306
|
+
wrap it onto a function component\n
|
|
2307
|
+
const CustomTextNode = (props:{text:string}) => <div>props</div>\n
|
|
2308
|
+
and use it like <CustomTextNode text="hi"/>`);
|
|
2309
|
+
} else {
|
|
2310
|
+
throw {
|
|
2311
|
+
message: `Unknown error occured, please check the child that was tried to render below`,
|
|
2312
|
+
component: child
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
} else {
|
|
2316
|
+
if (((_d = child === null || child === void 0 ? void 0 : child.type) === null || _d === void 0 ? void 0 : _d.name) === 'AsFormField') {
|
|
2317
|
+
struct = Object.assign({}, child.props);
|
|
2318
|
+
} else {
|
|
2319
|
+
if (!child.type.defaultProps.component) throw new Error(`set defaultProps component name\n
|
|
2320
|
+
ex: AsFormFieldInput.defaultProps = {
|
|
2321
|
+
component = 'input'
|
|
2322
|
+
}`);
|
|
2323
|
+
struct = Object.assign(Object.assign({}, child.props), child.type.defaultProps);
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
if (struct && (struct === null || struct === void 0 ? void 0 : struct.children)) {
|
|
2327
|
+
delete struct.children;
|
|
2328
|
+
}
|
|
2329
|
+
struct.order = index;
|
|
2330
|
+
const childElements = BuildAsFormFieldTree({
|
|
2331
|
+
children: (_e = child.props) === null || _e === void 0 ? void 0 : _e.children
|
|
2332
|
+
});
|
|
2333
|
+
return Object.assign(Object.assign({}, struct), childElements && {
|
|
2334
|
+
children: childElements
|
|
2335
|
+
});
|
|
2336
|
+
});
|
|
2337
|
+
};
|
|
2338
|
+
|
|
2339
|
+
/******************************************************************************
|
|
2340
|
+
Copyright (c) Microsoft Corporation.
|
|
2341
|
+
|
|
2342
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2343
|
+
purpose with or without fee is hereby granted.
|
|
2344
|
+
|
|
2345
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2346
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2347
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2348
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2349
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2350
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2351
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2352
|
+
***************************************************************************** */
|
|
2353
|
+
|
|
2354
|
+
function __rest(s, e) {
|
|
2355
|
+
var t = {};
|
|
2356
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2357
|
+
t[p] = s[p];
|
|
2358
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2359
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2360
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2361
|
+
t[p[i]] = s[p[i]];
|
|
2362
|
+
}
|
|
2363
|
+
return t;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2367
|
+
var e = new Error(message);
|
|
2368
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2369
|
+
};
|
|
2370
|
+
|
|
2371
|
+
/**
|
|
2372
|
+
* events mapping to aid function callback binding
|
|
2373
|
+
*/
|
|
2374
|
+
const eventsMapping = {
|
|
2375
|
+
ON_FIELD_CHANGE: 'onChange',
|
|
2376
|
+
ON_FIELD_BLUR: 'onBlur',
|
|
2377
|
+
ON_FIELD_FOCUS: 'onFocus',
|
|
2378
|
+
ON_FIELD_KEYDOWN: 'onKeyDown',
|
|
2379
|
+
ON_FIELD_KEYUP: 'onKeyUp',
|
|
2380
|
+
ON_FIELD_MOUNT: 'onMount',
|
|
2381
|
+
ON_API_FIELD_RESPONSE: 'onApiResponse',
|
|
2382
|
+
ON_FIELD_CLICK: 'onClick'
|
|
2383
|
+
};
|
|
2384
|
+
|
|
2385
|
+
/**
|
|
2386
|
+
* Hook to register events callback functions
|
|
2387
|
+
*/
|
|
2388
|
+
const useForm = _a => {
|
|
2389
|
+
var {
|
|
2390
|
+
id
|
|
2391
|
+
} = _a,
|
|
2392
|
+
rest = __rest(_a, ["id"]);
|
|
2393
|
+
const {
|
|
2394
|
+
formGroupInstance
|
|
2395
|
+
} = useFormGroupContext({});
|
|
2396
|
+
/**
|
|
2397
|
+
* reference to store all updated callback functions rerendered by props change
|
|
2398
|
+
*/
|
|
2399
|
+
const callbackRefs = useRef(rest);
|
|
2400
|
+
useEffect(() => {
|
|
2401
|
+
callbackRefs.current = rest;
|
|
2402
|
+
}, [rest]);
|
|
2403
|
+
/**
|
|
2404
|
+
* handle function call after the debounce occurs on the form instance field event
|
|
2405
|
+
* subject in order to call the most updated function with the updated function
|
|
2406
|
+
* reference to avoid events get outdated values
|
|
2407
|
+
*/
|
|
2408
|
+
useEffect(() => {
|
|
2409
|
+
var _a;
|
|
2410
|
+
const callback = payload => {
|
|
2411
|
+
var _a, _b;
|
|
2412
|
+
const eventMapping = eventsMapping[payload.event];
|
|
2413
|
+
if (eventMapping && callbackRefs.current[eventMapping]) {
|
|
2414
|
+
(_b = (_a = callbackRefs.current)[eventMapping]) === null || _b === void 0 ? void 0 : _b.call(_a, payload);
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
const sub = (_a = formGroupInstance.getForm({
|
|
2418
|
+
key: id
|
|
2419
|
+
})) === null || _a === void 0 ? void 0 : _a.subscribeFieldEvent({
|
|
2420
|
+
callback
|
|
2421
|
+
});
|
|
2422
|
+
return () => sub === null || sub === void 0 ? void 0 : sub.unsubscribe();
|
|
2423
|
+
}, []);
|
|
2424
|
+
return;
|
|
2425
|
+
};
|
|
2426
|
+
|
|
2427
|
+
/**
|
|
2428
|
+
*
|
|
2429
|
+
* @param {TFormProps} param form properties initializor
|
|
2430
|
+
* @returns {ReactElement}
|
|
2431
|
+
*/
|
|
2432
|
+
const Form = ({
|
|
2433
|
+
schema,
|
|
2434
|
+
index,
|
|
2435
|
+
initialValues,
|
|
2436
|
+
iVars,
|
|
2437
|
+
action,
|
|
2438
|
+
method,
|
|
2439
|
+
onSubmit,
|
|
2440
|
+
onData,
|
|
2441
|
+
onBlur,
|
|
2442
|
+
onChange,
|
|
2443
|
+
onApiResponse,
|
|
2444
|
+
onClick,
|
|
2445
|
+
onFocus,
|
|
2446
|
+
onKeyDown,
|
|
2447
|
+
onKeyUp,
|
|
2448
|
+
onMount,
|
|
2449
|
+
children
|
|
2450
|
+
}) => {
|
|
2451
|
+
const {
|
|
2452
|
+
addForm,
|
|
2453
|
+
removeForm,
|
|
2454
|
+
getForm,
|
|
2455
|
+
mappers,
|
|
2456
|
+
debugMode
|
|
2457
|
+
} = useFormGroupContext({});
|
|
2458
|
+
const [tree, setTree] = useState();
|
|
2459
|
+
const schemaIndex = useMemo(() => index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange', [index, schema]);
|
|
2460
|
+
/**
|
|
2461
|
+
* logic to initialize the form instance and it's removal
|
|
2462
|
+
*/
|
|
2463
|
+
useEffect(() => {
|
|
2464
|
+
if (schemaIndex === 'defaultChange') {
|
|
2465
|
+
console.warn('please, add an unique id to the form, otherwise multiple forms will break');
|
|
2466
|
+
}
|
|
2467
|
+
const formInstance = new FormCore({
|
|
2468
|
+
schema,
|
|
2469
|
+
initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
|
|
2470
|
+
action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
|
|
2471
|
+
method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
|
|
2472
|
+
index: schemaIndex,
|
|
2473
|
+
onSubmit,
|
|
2474
|
+
onData,
|
|
2475
|
+
mappers
|
|
2476
|
+
});
|
|
2477
|
+
addForm({
|
|
2478
|
+
key: schemaIndex,
|
|
2479
|
+
formInstance
|
|
2480
|
+
});
|
|
2481
|
+
/*
|
|
2482
|
+
@TODO check if form instance is killed each time it is unmounted
|
|
2483
|
+
the management of multiple forms needs to be planned
|
|
2484
|
+
*/
|
|
2485
|
+
return () => {
|
|
2486
|
+
removeForm({
|
|
2487
|
+
key: index
|
|
2488
|
+
});
|
|
2489
|
+
};
|
|
2490
|
+
}, []);
|
|
2491
|
+
/**
|
|
2492
|
+
* logic to transform AsFormFields onto JSON schema
|
|
2493
|
+
* and JSON schema onto FieldWrappers, refreshes when
|
|
2494
|
+
* the react tree changes it's children
|
|
2495
|
+
*/
|
|
2496
|
+
useEffect(() => {
|
|
2497
|
+
var _a;
|
|
2498
|
+
const schema = BuildAsFormFieldTree({
|
|
2499
|
+
children
|
|
2500
|
+
});
|
|
2501
|
+
schema && getForm({
|
|
2502
|
+
key: index
|
|
2503
|
+
}).refreshFields(schema);
|
|
2504
|
+
const fields = (_a = getForm({
|
|
2505
|
+
key: index
|
|
2506
|
+
})) === null || _a === void 0 ? void 0 : _a.fields;
|
|
2507
|
+
if (fields) {
|
|
2508
|
+
const buildTree = BuildTree({
|
|
2509
|
+
fields,
|
|
2510
|
+
formIndex: index
|
|
2511
|
+
});
|
|
2512
|
+
setTree(buildTree);
|
|
2513
|
+
}
|
|
2514
|
+
}, [children]);
|
|
2515
|
+
/**
|
|
2516
|
+
* iVars change tracker to update iVars onto form instance
|
|
2517
|
+
*/
|
|
2518
|
+
useEffect(() => {
|
|
2519
|
+
if (iVars) getForm({
|
|
2520
|
+
key: index
|
|
2521
|
+
}).iVars = iVars;
|
|
2522
|
+
}, [iVars]);
|
|
2523
|
+
/**
|
|
2524
|
+
* hook usage to keep event bindings updated on callback functions passed as props
|
|
2525
|
+
*/
|
|
2526
|
+
useForm({
|
|
2527
|
+
id: schemaIndex,
|
|
2528
|
+
onApiResponse,
|
|
2529
|
+
onBlur,
|
|
2530
|
+
onChange,
|
|
2531
|
+
onClick,
|
|
2532
|
+
onFocus,
|
|
2533
|
+
onKeyDown,
|
|
2534
|
+
onKeyUp,
|
|
2535
|
+
onMount
|
|
2536
|
+
});
|
|
2537
|
+
/*
|
|
2538
|
+
@TODO move this logic inside form-core, add action and method onto form element,
|
|
2539
|
+
might need a ref of the form to collect all the form parameters when there is a
|
|
2540
|
+
normal form submition with redirect
|
|
2541
|
+
*/
|
|
2542
|
+
const handleSubmit = event => {
|
|
2543
|
+
const formElement = getForm({
|
|
2544
|
+
key: schemaIndex
|
|
2545
|
+
});
|
|
2546
|
+
if (!(formElement === null || formElement === void 0 ? void 0 : formElement.action) && event) {
|
|
2547
|
+
event.preventDefault();
|
|
2548
|
+
}
|
|
2549
|
+
formElement === null || formElement === void 0 ? void 0 : formElement.submit();
|
|
2550
|
+
};
|
|
2551
|
+
return jsxs(Fragment, {
|
|
2552
|
+
children: [debugMode && jsxs(Fragment, {
|
|
2553
|
+
children: [jsx("b", {
|
|
2554
|
+
style: {
|
|
2555
|
+
padding: '0px',
|
|
2556
|
+
margin: '0px'
|
|
2557
|
+
},
|
|
2558
|
+
children: `form index: ${schemaIndex}`
|
|
2559
|
+
}), jsx("button", {
|
|
2560
|
+
onClick: () => console.log(getForm({
|
|
2561
|
+
key: schemaIndex
|
|
2562
|
+
})),
|
|
2563
|
+
children: "print form instance"
|
|
2564
|
+
}), jsx("button", {
|
|
2565
|
+
onClick: () => {
|
|
2566
|
+
var _a;
|
|
2567
|
+
return (_a = getForm({
|
|
2568
|
+
key: schemaIndex
|
|
2569
|
+
})) === null || _a === void 0 ? void 0 : _a.printValues();
|
|
2570
|
+
},
|
|
2571
|
+
children: "print values"
|
|
2572
|
+
}), jsx("br", {}), jsx("hr", {})]
|
|
2573
|
+
}), jsx("form", {
|
|
2574
|
+
onSubmit: handleSubmit,
|
|
2575
|
+
children: tree && tree
|
|
2576
|
+
})]
|
|
2577
|
+
});
|
|
2578
|
+
};
|
|
2579
|
+
|
|
2580
|
+
/**
|
|
2581
|
+
* Component wrapper to aid building schemas with react without writting a JSON schema
|
|
2582
|
+
* along with BuildAsFormFieldTree inside a Form component, FieldWrapper gets this props
|
|
2583
|
+
* to build the component as it does with a JSON schema, this component only works inside
|
|
2584
|
+
* the Form component
|
|
2585
|
+
*
|
|
2586
|
+
* @param {TAsFormFieldProps} props JSON schema props
|
|
2587
|
+
* @returns {ReactNode}
|
|
2588
|
+
*/
|
|
2589
|
+
const AsFormField = props => {
|
|
2590
|
+
return props.children;
|
|
2591
|
+
};
|
|
2592
|
+
|
|
2593
|
+
var fails$2 = fails$h;
|
|
2594
|
+
var global$3 = global$e;
|
|
2595
|
+
|
|
2596
|
+
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
2597
|
+
var $RegExp$2 = global$3.RegExp;
|
|
2598
|
+
|
|
2599
|
+
var UNSUPPORTED_Y$1 = fails$2(function () {
|
|
2600
|
+
var re = $RegExp$2('a', 'y');
|
|
2601
|
+
re.lastIndex = 2;
|
|
2602
|
+
return re.exec('abcd') !== null;
|
|
2603
|
+
});
|
|
2604
|
+
|
|
2605
|
+
// UC Browser bug
|
|
2606
|
+
// https://github.com/zloirock/core-js/issues/1008
|
|
2607
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2608
|
+
return !$RegExp$2('a', 'y').sticky;
|
|
2609
|
+
});
|
|
2610
|
+
|
|
2611
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$2(function () {
|
|
2612
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
2613
|
+
var re = $RegExp$2('^r', 'gy');
|
|
2614
|
+
re.lastIndex = 2;
|
|
2615
|
+
return re.exec('str') !== null;
|
|
2616
|
+
});
|
|
2617
|
+
|
|
2618
|
+
var regexpStickyHelpers = {
|
|
2619
|
+
BROKEN_CARET: BROKEN_CARET,
|
|
2620
|
+
MISSED_STICKY: MISSED_STICKY,
|
|
2621
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2622
|
+
};
|
|
2623
|
+
|
|
2624
|
+
var fails$1 = fails$h;
|
|
2625
|
+
var global$2 = global$e;
|
|
2626
|
+
|
|
2627
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
2628
|
+
var $RegExp$1 = global$2.RegExp;
|
|
2629
|
+
|
|
2630
|
+
var regexpUnsupportedDotAll = fails$1(function () {
|
|
2631
|
+
var re = $RegExp$1('.', 's');
|
|
2632
|
+
return !(re.dotAll && re.test('\n') && re.flags === 's');
|
|
2633
|
+
});
|
|
2634
|
+
|
|
2635
|
+
var fails = fails$h;
|
|
2636
|
+
var global$1 = global$e;
|
|
2637
|
+
|
|
2638
|
+
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
2639
|
+
var $RegExp = global$1.RegExp;
|
|
2640
|
+
|
|
2641
|
+
var regexpUnsupportedNcg = fails(function () {
|
|
2642
|
+
var re = $RegExp('(?<a>b)', 'g');
|
|
2643
|
+
return re.exec('b').groups.a !== 'b' ||
|
|
2644
|
+
'b'.replace(re, '$<a>c') !== 'bc';
|
|
2645
|
+
});
|
|
2646
|
+
|
|
2647
|
+
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2648
|
+
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2649
|
+
var call = functionCall;
|
|
2650
|
+
var uncurryThis = functionUncurryThis;
|
|
2651
|
+
var toString = toString$3;
|
|
2652
|
+
var regexpFlags = regexpFlags$1;
|
|
2653
|
+
var stickyHelpers = regexpStickyHelpers;
|
|
2654
|
+
var shared = shared$4;
|
|
2655
|
+
var create = objectCreate;
|
|
2656
|
+
var getInternalState = internalState.get;
|
|
2657
|
+
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
2658
|
+
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
2659
|
+
|
|
2660
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2661
|
+
var nativeExec = RegExp.prototype.exec;
|
|
2662
|
+
var patchedExec = nativeExec;
|
|
2663
|
+
var charAt = uncurryThis(''.charAt);
|
|
2664
|
+
var indexOf = uncurryThis(''.indexOf);
|
|
2665
|
+
var replace = uncurryThis(''.replace);
|
|
2666
|
+
var stringSlice = uncurryThis(''.slice);
|
|
2667
|
+
|
|
2668
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2669
|
+
var re1 = /a/;
|
|
2670
|
+
var re2 = /b*/g;
|
|
2671
|
+
call(nativeExec, re1, 'a');
|
|
2672
|
+
call(nativeExec, re2, 'a');
|
|
2673
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2674
|
+
})();
|
|
2675
|
+
|
|
2676
|
+
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2677
|
+
|
|
2678
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2679
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2680
|
+
|
|
2681
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2682
|
+
|
|
2683
|
+
if (PATCH) {
|
|
2684
|
+
patchedExec = function exec(string) {
|
|
2685
|
+
var re = this;
|
|
2686
|
+
var state = getInternalState(re);
|
|
2687
|
+
var str = toString(string);
|
|
2688
|
+
var raw = state.raw;
|
|
2689
|
+
var result, reCopy, lastIndex, match, i, object, group;
|
|
2690
|
+
|
|
2691
|
+
if (raw) {
|
|
2692
|
+
raw.lastIndex = re.lastIndex;
|
|
2693
|
+
result = call(patchedExec, raw, str);
|
|
2694
|
+
re.lastIndex = raw.lastIndex;
|
|
2695
|
+
return result;
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
var groups = state.groups;
|
|
2699
|
+
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2700
|
+
var flags = call(regexpFlags, re);
|
|
2701
|
+
var source = re.source;
|
|
2702
|
+
var charsAdded = 0;
|
|
2703
|
+
var strCopy = str;
|
|
2704
|
+
|
|
2705
|
+
if (sticky) {
|
|
2706
|
+
flags = replace(flags, 'y', '');
|
|
2707
|
+
if (indexOf(flags, 'g') === -1) {
|
|
2708
|
+
flags += 'g';
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
strCopy = stringSlice(str, re.lastIndex);
|
|
2712
|
+
// Support anchored sticky behavior.
|
|
2713
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
|
2714
|
+
source = '(?: ' + source + ')';
|
|
2715
|
+
strCopy = ' ' + strCopy;
|
|
2716
|
+
charsAdded++;
|
|
2717
|
+
}
|
|
2718
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2719
|
+
// simulate the 'y' flag.
|
|
2720
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
if (NPCG_INCLUDED) {
|
|
2724
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2725
|
+
}
|
|
2726
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2727
|
+
|
|
2728
|
+
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2729
|
+
|
|
2730
|
+
if (sticky) {
|
|
2731
|
+
if (match) {
|
|
2732
|
+
match.input = stringSlice(match.input, charsAdded);
|
|
2733
|
+
match[0] = stringSlice(match[0], charsAdded);
|
|
2734
|
+
match.index = re.lastIndex;
|
|
2735
|
+
re.lastIndex += match[0].length;
|
|
2736
|
+
} else re.lastIndex = 0;
|
|
2737
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2738
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2739
|
+
}
|
|
2740
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2741
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2742
|
+
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2743
|
+
call(nativeReplace, match[0], reCopy, function () {
|
|
2744
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
|
2745
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
if (match && groups) {
|
|
2751
|
+
match.groups = object = create(null);
|
|
2752
|
+
for (i = 0; i < groups.length; i++) {
|
|
2753
|
+
group = groups[i];
|
|
2754
|
+
object[group[0]] = match[group[1]];
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
return match;
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
var regexpExec = patchedExec;
|
|
2763
|
+
|
|
2764
|
+
var $ = _export;
|
|
2765
|
+
var exec = regexpExec;
|
|
2766
|
+
|
|
2767
|
+
// `RegExp.prototype.exec` method
|
|
2768
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2769
|
+
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
2770
|
+
exec: exec
|
|
2771
|
+
});
|
|
2772
|
+
|
|
2773
|
+
/**
|
|
2774
|
+
* Component Wrapper to render form fields without the Form component, gets additional formId and mapper since
|
|
2775
|
+
* it won't rely on them and needs to be manually declared
|
|
2776
|
+
*
|
|
2777
|
+
* @param {TAsFormFieldBuilderProps} props JSON schema props along with FieldWrapper props and mapper props
|
|
2778
|
+
* @returns {ReactElement}
|
|
2779
|
+
*/
|
|
2780
|
+
const AsFormFieldBuilder = props => {
|
|
2781
|
+
const context = useFormGroupContext({});
|
|
2782
|
+
/**
|
|
2783
|
+
* state to track the field instance creation process
|
|
2784
|
+
*/
|
|
2785
|
+
const [mounted, setMounted] = useState(false);
|
|
2786
|
+
/**
|
|
2787
|
+
* initializer to create or add a form instance to the formGroup by it's formId
|
|
2788
|
+
* and add the field to the form instance
|
|
2789
|
+
* Also has the logic to remove it once this element is removed
|
|
2790
|
+
*/
|
|
2791
|
+
useEffect(() => {
|
|
2792
|
+
var _a;
|
|
2793
|
+
if (!((_a = context.formGroupInstance) === null || _a === void 0 ? void 0 : _a.forms.has(props.formIndex))) {
|
|
2794
|
+
context.addFormWithIndex(props.formIndex);
|
|
2795
|
+
}
|
|
2796
|
+
const fieldSchema = Object.assign(Object.assign({}, props), {
|
|
2797
|
+
component: props.mapper.componentName,
|
|
2798
|
+
children: undefined
|
|
2799
|
+
});
|
|
2800
|
+
const formInstance = context.formGroupInstance.forms.get(props.formIndex);
|
|
2801
|
+
formInstance === null || formInstance === void 0 ? void 0 : formInstance.addField({
|
|
2802
|
+
fieldSchema,
|
|
2803
|
+
mapperElement: props.mapper
|
|
2804
|
+
});
|
|
2805
|
+
setMounted(true);
|
|
2806
|
+
return () => formInstance === null || formInstance === void 0 ? void 0 : formInstance.removeField({
|
|
2807
|
+
key: props.name
|
|
2808
|
+
});
|
|
2809
|
+
}, []);
|
|
2810
|
+
/**
|
|
2811
|
+
* expensive function to allow both external props and templating work
|
|
2812
|
+
* evaluate if templating will be done onto form-engine or not
|
|
2813
|
+
*/
|
|
2814
|
+
useEffect(() => {
|
|
2815
|
+
var _a;
|
|
2816
|
+
if (!mounted) return;
|
|
2817
|
+
const field = (_a = context.formGroupInstance.forms.get(props.formIndex)) === null || _a === void 0 ? void 0 : _a.fields.get(props.name);
|
|
2818
|
+
const fieldProps = field === null || field === void 0 ? void 0 : field.props;
|
|
2819
|
+
if (props.props) {
|
|
2820
|
+
Object.keys(props.props).forEach(propKey => {
|
|
2821
|
+
var _a, _b;
|
|
2822
|
+
if (typeof ((_a = props.props) === null || _a === void 0 ? void 0 : _a[propKey]) === 'string' &&
|
|
2823
|
+
/**
|
|
2824
|
+
* need to check linting on build, this needs to be casted in order to build..
|
|
2825
|
+
*/
|
|
2826
|
+
/\$/.test((_b = props.props) === null || _b === void 0 ? void 0 : _b[propKey])) {
|
|
2827
|
+
delete props.props[propKey];
|
|
2828
|
+
}
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
field === null || field === void 0 ? void 0 : field.propsSubject$.next(Object.assign(Object.assign({}, fieldProps), props.props));
|
|
2832
|
+
}, [props.props]);
|
|
2833
|
+
return mounted ? jsx(FieldWrapper, {
|
|
2834
|
+
formIndex: props.formIndex,
|
|
2835
|
+
name: props.name,
|
|
2836
|
+
props: props.props,
|
|
2837
|
+
context: !context.active ? context : null,
|
|
2838
|
+
children: props.children && props.children
|
|
2839
|
+
}) : jsx(Fragment, {});
|
|
2840
|
+
};
|
|
2841
|
+
|
|
2842
|
+
export { AsFormField, AsFormFieldBuilder, Form, FormGroupContext, FormGroupContextProvider, useFormGroupContext };
|