ui-beyable 1.0.4 → 1.0.5

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.
Files changed (60) hide show
  1. package/README.md +67 -67
  2. package/lib/cjs/components/Button/BYbtn.d.ts +6 -6
  3. package/lib/cjs/components/Collapse/BYcollapse.d.ts +4 -4
  4. package/lib/cjs/components/Modal/BYmodal.d.ts +4 -4
  5. package/lib/cjs/esm/components/BYbtn.d.ts +6 -6
  6. package/lib/cjs/esm/components/Button/BYbtn.d.ts +6 -6
  7. package/lib/cjs/esm/components/Button/type.d.ts +27 -27
  8. package/lib/cjs/esm/components/Button.d.ts +7 -7
  9. package/lib/cjs/esm/components/Collapse/BYcollapse.d.ts +4 -4
  10. package/lib/cjs/esm/components/Collapse/type.d.ts +5 -5
  11. package/lib/cjs/esm/components/Modal/BYmodal.d.ts +4 -4
  12. package/lib/cjs/esm/components/Modal/types.d.ts +11 -11
  13. package/lib/cjs/esm/components/Portal/BYportal.d.ts +3 -3
  14. package/lib/cjs/esm/components/Portal/type.d.ts +6 -6
  15. package/lib/cjs/esm/components/type.d.ts +27 -27
  16. package/lib/cjs/esm/index.d.ts +60 -60
  17. package/lib/cjs/index.css +32 -32
  18. package/lib/cjs/index.css.map +1 -1
  19. package/lib/cjs/index.d.ts +5 -11
  20. package/lib/cjs/index.js +0 -4755
  21. package/lib/cjs/index.js.map +1 -1
  22. package/lib/esm/components/BYbtn.d.ts +6 -6
  23. package/lib/esm/components/Button/BYbtn.d.ts +6 -6
  24. package/lib/esm/components/Button.d.ts +7 -7
  25. package/lib/esm/components/Collapse/BYcollapse.d.ts +4 -4
  26. package/lib/esm/components/Modal/BYmodal.d.ts +4 -4
  27. package/lib/esm/components/type.d.ts +27 -27
  28. package/lib/esm/index.css +32 -32
  29. package/lib/esm/index.css.map +1 -1
  30. package/lib/esm/index.d.ts +5 -11
  31. package/lib/esm/index.js +2 -4751
  32. package/lib/esm/index.js.map +1 -1
  33. package/lib/index.d.ts +40 -40
  34. package/package.json +3 -18
  35. package/lib/cjs/components/Avatar/Avatar.d.ts +0 -5
  36. package/lib/cjs/components/Avatar/type.d.ts +0 -5
  37. package/lib/cjs/components/Breadcrumb/BYbreadcrumbItem.d.ts +0 -4
  38. package/lib/cjs/components/Breadcrumb/Breadcrumb.d.ts +0 -5
  39. package/lib/cjs/components/Breadcrumb/type.d.ts +0 -21
  40. package/lib/cjs/components/Checkbox/Checkbox.d.ts +0 -4
  41. package/lib/cjs/components/Checkbox/type.d.ts +0 -15
  42. package/lib/cjs/components/InputCustom/InputCustom.d.ts +0 -10
  43. package/lib/cjs/components/InputCustom/types.d.ts +0 -40
  44. package/lib/cjs/components/Spinner/Spinner.d.ts +0 -4
  45. package/lib/cjs/components/Spinner/type.d.ts +0 -3
  46. package/lib/cjs/components/SpinnerWheel/BYspinnerWheel.d.ts +0 -6
  47. package/lib/cjs/components/SpinnerWheel/type.d.ts +0 -5
  48. package/lib/esm/components/Avatar/Avatar.d.ts +0 -5
  49. package/lib/esm/components/Avatar/type.d.ts +0 -5
  50. package/lib/esm/components/Breadcrumb/BYbreadcrumbItem.d.ts +0 -4
  51. package/lib/esm/components/Breadcrumb/Breadcrumb.d.ts +0 -5
  52. package/lib/esm/components/Breadcrumb/type.d.ts +0 -21
  53. package/lib/esm/components/Checkbox/Checkbox.d.ts +0 -4
  54. package/lib/esm/components/Checkbox/type.d.ts +0 -15
  55. package/lib/esm/components/InputCustom/InputCustom.d.ts +0 -10
  56. package/lib/esm/components/InputCustom/types.d.ts +0 -40
  57. package/lib/esm/components/Spinner/Spinner.d.ts +0 -4
  58. package/lib/esm/components/Spinner/type.d.ts +0 -3
  59. package/lib/esm/components/SpinnerWheel/BYspinnerWheel.d.ts +0 -6
  60. package/lib/esm/components/SpinnerWheel/type.d.ts +0 -5
package/lib/esm/index.js CHANGED
@@ -1,6 +1,5 @@
1
- import React, { useRef, useEffect } from 'react';
1
+ import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
- import crypto$1 from 'crypto';
4
3
 
5
4
  var Btn = function (_a) {
6
5
  var children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.htmlTag, htmlTag = _c === void 0 ? "button" : _c, onClickFunction = _a.onClickFunction, onClick = _a.onClick, _d = _a.href, href = _d === void 0 ? '' : _d, _e = _a.target, target = _e === void 0 ? '' : _e, _f = _a.message, message = _f === void 0 ? '' : _f, _g = _a.color, color = _g === void 0 ? 'primary' : _g, _h = _a.style, style = _h === void 0 ? '' : _h, _j = _a.rounded, rounded = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.className, className = _l === void 0 ? '' : _l, _m = _a.strong, strong = _m === void 0 ? false : _m, _o = _a.light, light = _o === void 0 ? false : _o, _p = _a.size, size = _p === void 0 ? "" : _p, _q = _a.fontSize, fontSize = _q === void 0 ? '' : _q, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, _s = _a.fullHeight, fullHeight = _s === void 0 ? false : _s, icon = _a.icon, _t = _a.iconPosition, iconPosition = _t === void 0 ? 'before' : _t, _u = _a.arrow, arrow = _u === void 0 ? false : _u, dataFor = _a.dataFor, dataTip = _a.dataTip;
@@ -161,4753 +160,5 @@ function Collapse(_a) {
161
160
  React.createElement("div", { className: styles.body, ref: bodyRef }, children)));
162
161
  }
163
162
 
164
- var Avatar = function (_a) {
165
- var _b = _a.id, id = _b === void 0 ? '42' : _b, _c = _a.name, name = _c === void 0 ? 'A' : _c, _d = _a.size, size = _d === void 0 ? "m" : _d;
166
- var cssClass = ['avatar'];
167
- var colors = ['red', 'orange', 'yellow', 'green_apple', 'green', 'lightblue', 'blue', 'purple', 'pink'];
168
- var getUserColor = function () {
169
- var tmpId = parseInt(id.replace(/^\D+/g, ''));
170
- var nb = colors.length;
171
- var index = tmpId % nb;
172
- return colors[index];
173
- };
174
- // INITIAL
175
- var initial = name.slice(0, 1).toUpperCase();
176
- // SIZE
177
- if (size) {
178
- cssClass.push('size_' + size);
179
- }
180
- // COLOR
181
- var color = getUserColor();
182
- if (color) {
183
- cssClass.push('color_' + color);
184
- }
185
- return (React.createElement("div", { className: cssClass.join(' '), title: name }, initial));
186
- };
187
-
188
- function BreadcrumbItem(_a) {
189
- var index = _a.index, name = _a.name, onClickFunction = _a.onClickFunction, stepSelected = _a.stepSelected, _b = _a.showIndex, showIndex = _b === void 0 ? 1 : _b;
190
- return (React.createElement("li", { className: stepSelected === index ? 'item_active' : 'item', onClick: function () { return onClickFunction(index); } },
191
- showIndex &&
192
- React.createElement("span", { className: 'item_index' },
193
- React.createElement("span", { className: 'item_index_inner' }, index)),
194
- React.createElement("span", { className: 'item_name' }, name)));
195
- }
196
-
197
- function Breadcrumb(_a) {
198
- var itemOfBreadcrumb = _a.itemOfBreadcrumb, onClickFunction = _a.onClickFunction, stepSelected = _a.stepSelected;
199
- return (React.createElement("ul", { className: 'list' }, itemOfBreadcrumb && itemOfBreadcrumb.map(function (item) {
200
- return React.createElement(BreadcrumbItem, { key: item.index, index: item.index, name: item.title, onClickFunction: function () { return onClickFunction(item.index); }, stepSelected: stepSelected });
201
- })));
202
- }
203
-
204
- function getDefaultExportFromCjs (x) {
205
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
206
- }
207
-
208
- var propTypes = {exports: {}};
209
-
210
- var reactIs = {exports: {}};
211
-
212
- var reactIs_production_min = {};
213
-
214
- /** @license React v16.13.1
215
- * react-is.production.min.js
216
- *
217
- * Copyright (c) Facebook, Inc. and its affiliates.
218
- *
219
- * This source code is licensed under the MIT license found in the
220
- * LICENSE file in the root directory of this source tree.
221
- */
222
-
223
- var hasRequiredReactIs_production_min;
224
-
225
- function requireReactIs_production_min () {
226
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
227
- hasRequiredReactIs_production_min = 1;
228
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
229
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
230
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
231
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
232
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
233
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
234
- return reactIs_production_min;
235
- }
236
-
237
- var reactIs_development = {};
238
-
239
- /** @license React v16.13.1
240
- * react-is.development.js
241
- *
242
- * Copyright (c) Facebook, Inc. and its affiliates.
243
- *
244
- * This source code is licensed under the MIT license found in the
245
- * LICENSE file in the root directory of this source tree.
246
- */
247
-
248
- var hasRequiredReactIs_development;
249
-
250
- function requireReactIs_development () {
251
- if (hasRequiredReactIs_development) return reactIs_development;
252
- hasRequiredReactIs_development = 1;
253
-
254
-
255
-
256
- if (process.env.NODE_ENV !== "production") {
257
- (function() {
258
-
259
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
260
- // nor polyfill, then a plain number is used for performance.
261
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
262
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
263
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
264
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
265
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
266
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
267
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
268
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
269
- // (unstable) APIs that have been removed. Can we remove the symbols?
270
-
271
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
272
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
273
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
274
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
275
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
276
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
277
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
278
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
279
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
280
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
281
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
282
-
283
- function isValidElementType(type) {
284
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
285
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
286
- }
287
-
288
- function typeOf(object) {
289
- if (typeof object === 'object' && object !== null) {
290
- var $$typeof = object.$$typeof;
291
-
292
- switch ($$typeof) {
293
- case REACT_ELEMENT_TYPE:
294
- var type = object.type;
295
-
296
- switch (type) {
297
- case REACT_ASYNC_MODE_TYPE:
298
- case REACT_CONCURRENT_MODE_TYPE:
299
- case REACT_FRAGMENT_TYPE:
300
- case REACT_PROFILER_TYPE:
301
- case REACT_STRICT_MODE_TYPE:
302
- case REACT_SUSPENSE_TYPE:
303
- return type;
304
-
305
- default:
306
- var $$typeofType = type && type.$$typeof;
307
-
308
- switch ($$typeofType) {
309
- case REACT_CONTEXT_TYPE:
310
- case REACT_FORWARD_REF_TYPE:
311
- case REACT_LAZY_TYPE:
312
- case REACT_MEMO_TYPE:
313
- case REACT_PROVIDER_TYPE:
314
- return $$typeofType;
315
-
316
- default:
317
- return $$typeof;
318
- }
319
-
320
- }
321
-
322
- case REACT_PORTAL_TYPE:
323
- return $$typeof;
324
- }
325
- }
326
-
327
- return undefined;
328
- } // AsyncMode is deprecated along with isAsyncMode
329
-
330
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
331
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
332
- var ContextConsumer = REACT_CONTEXT_TYPE;
333
- var ContextProvider = REACT_PROVIDER_TYPE;
334
- var Element = REACT_ELEMENT_TYPE;
335
- var ForwardRef = REACT_FORWARD_REF_TYPE;
336
- var Fragment = REACT_FRAGMENT_TYPE;
337
- var Lazy = REACT_LAZY_TYPE;
338
- var Memo = REACT_MEMO_TYPE;
339
- var Portal = REACT_PORTAL_TYPE;
340
- var Profiler = REACT_PROFILER_TYPE;
341
- var StrictMode = REACT_STRICT_MODE_TYPE;
342
- var Suspense = REACT_SUSPENSE_TYPE;
343
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
344
-
345
- function isAsyncMode(object) {
346
- {
347
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
348
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
349
-
350
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
351
- }
352
- }
353
-
354
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
355
- }
356
- function isConcurrentMode(object) {
357
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
358
- }
359
- function isContextConsumer(object) {
360
- return typeOf(object) === REACT_CONTEXT_TYPE;
361
- }
362
- function isContextProvider(object) {
363
- return typeOf(object) === REACT_PROVIDER_TYPE;
364
- }
365
- function isElement(object) {
366
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
367
- }
368
- function isForwardRef(object) {
369
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
370
- }
371
- function isFragment(object) {
372
- return typeOf(object) === REACT_FRAGMENT_TYPE;
373
- }
374
- function isLazy(object) {
375
- return typeOf(object) === REACT_LAZY_TYPE;
376
- }
377
- function isMemo(object) {
378
- return typeOf(object) === REACT_MEMO_TYPE;
379
- }
380
- function isPortal(object) {
381
- return typeOf(object) === REACT_PORTAL_TYPE;
382
- }
383
- function isProfiler(object) {
384
- return typeOf(object) === REACT_PROFILER_TYPE;
385
- }
386
- function isStrictMode(object) {
387
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
388
- }
389
- function isSuspense(object) {
390
- return typeOf(object) === REACT_SUSPENSE_TYPE;
391
- }
392
-
393
- reactIs_development.AsyncMode = AsyncMode;
394
- reactIs_development.ConcurrentMode = ConcurrentMode;
395
- reactIs_development.ContextConsumer = ContextConsumer;
396
- reactIs_development.ContextProvider = ContextProvider;
397
- reactIs_development.Element = Element;
398
- reactIs_development.ForwardRef = ForwardRef;
399
- reactIs_development.Fragment = Fragment;
400
- reactIs_development.Lazy = Lazy;
401
- reactIs_development.Memo = Memo;
402
- reactIs_development.Portal = Portal;
403
- reactIs_development.Profiler = Profiler;
404
- reactIs_development.StrictMode = StrictMode;
405
- reactIs_development.Suspense = Suspense;
406
- reactIs_development.isAsyncMode = isAsyncMode;
407
- reactIs_development.isConcurrentMode = isConcurrentMode;
408
- reactIs_development.isContextConsumer = isContextConsumer;
409
- reactIs_development.isContextProvider = isContextProvider;
410
- reactIs_development.isElement = isElement;
411
- reactIs_development.isForwardRef = isForwardRef;
412
- reactIs_development.isFragment = isFragment;
413
- reactIs_development.isLazy = isLazy;
414
- reactIs_development.isMemo = isMemo;
415
- reactIs_development.isPortal = isPortal;
416
- reactIs_development.isProfiler = isProfiler;
417
- reactIs_development.isStrictMode = isStrictMode;
418
- reactIs_development.isSuspense = isSuspense;
419
- reactIs_development.isValidElementType = isValidElementType;
420
- reactIs_development.typeOf = typeOf;
421
- })();
422
- }
423
- return reactIs_development;
424
- }
425
-
426
- var hasRequiredReactIs;
427
-
428
- function requireReactIs () {
429
- if (hasRequiredReactIs) return reactIs.exports;
430
- hasRequiredReactIs = 1;
431
-
432
- if (process.env.NODE_ENV === 'production') {
433
- reactIs.exports = requireReactIs_production_min();
434
- } else {
435
- reactIs.exports = requireReactIs_development();
436
- }
437
- return reactIs.exports;
438
- }
439
-
440
- /*
441
- object-assign
442
- (c) Sindre Sorhus
443
- @license MIT
444
- */
445
-
446
- var objectAssign;
447
- var hasRequiredObjectAssign;
448
-
449
- function requireObjectAssign () {
450
- if (hasRequiredObjectAssign) return objectAssign;
451
- hasRequiredObjectAssign = 1;
452
- /* eslint-disable no-unused-vars */
453
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
454
- var hasOwnProperty = Object.prototype.hasOwnProperty;
455
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
456
-
457
- function toObject(val) {
458
- if (val === null || val === undefined) {
459
- throw new TypeError('Object.assign cannot be called with null or undefined');
460
- }
461
-
462
- return Object(val);
463
- }
464
-
465
- function shouldUseNative() {
466
- try {
467
- if (!Object.assign) {
468
- return false;
469
- }
470
-
471
- // Detect buggy property enumeration order in older V8 versions.
472
-
473
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
474
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
475
- test1[5] = 'de';
476
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
477
- return false;
478
- }
479
-
480
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
481
- var test2 = {};
482
- for (var i = 0; i < 10; i++) {
483
- test2['_' + String.fromCharCode(i)] = i;
484
- }
485
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
486
- return test2[n];
487
- });
488
- if (order2.join('') !== '0123456789') {
489
- return false;
490
- }
491
-
492
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
493
- var test3 = {};
494
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
495
- test3[letter] = letter;
496
- });
497
- if (Object.keys(Object.assign({}, test3)).join('') !==
498
- 'abcdefghijklmnopqrst') {
499
- return false;
500
- }
501
-
502
- return true;
503
- } catch (err) {
504
- // We don't expect any of the above to throw, but better to be safe.
505
- return false;
506
- }
507
- }
508
-
509
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
510
- var from;
511
- var to = toObject(target);
512
- var symbols;
513
-
514
- for (var s = 1; s < arguments.length; s++) {
515
- from = Object(arguments[s]);
516
-
517
- for (var key in from) {
518
- if (hasOwnProperty.call(from, key)) {
519
- to[key] = from[key];
520
- }
521
- }
522
-
523
- if (getOwnPropertySymbols) {
524
- symbols = getOwnPropertySymbols(from);
525
- for (var i = 0; i < symbols.length; i++) {
526
- if (propIsEnumerable.call(from, symbols[i])) {
527
- to[symbols[i]] = from[symbols[i]];
528
- }
529
- }
530
- }
531
- }
532
-
533
- return to;
534
- };
535
- return objectAssign;
536
- }
537
-
538
- /**
539
- * Copyright (c) 2013-present, Facebook, Inc.
540
- *
541
- * This source code is licensed under the MIT license found in the
542
- * LICENSE file in the root directory of this source tree.
543
- */
544
-
545
- var ReactPropTypesSecret_1;
546
- var hasRequiredReactPropTypesSecret;
547
-
548
- function requireReactPropTypesSecret () {
549
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
550
- hasRequiredReactPropTypesSecret = 1;
551
-
552
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
553
-
554
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
555
- return ReactPropTypesSecret_1;
556
- }
557
-
558
- var has$1;
559
- var hasRequiredHas;
560
-
561
- function requireHas () {
562
- if (hasRequiredHas) return has$1;
563
- hasRequiredHas = 1;
564
- has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
565
- return has$1;
566
- }
567
-
568
- /**
569
- * Copyright (c) 2013-present, Facebook, Inc.
570
- *
571
- * This source code is licensed under the MIT license found in the
572
- * LICENSE file in the root directory of this source tree.
573
- */
574
-
575
- var checkPropTypes_1;
576
- var hasRequiredCheckPropTypes;
577
-
578
- function requireCheckPropTypes () {
579
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
580
- hasRequiredCheckPropTypes = 1;
581
-
582
- var printWarning = function() {};
583
-
584
- if (process.env.NODE_ENV !== 'production') {
585
- var ReactPropTypesSecret = requireReactPropTypesSecret();
586
- var loggedTypeFailures = {};
587
- var has = requireHas();
588
-
589
- printWarning = function(text) {
590
- var message = 'Warning: ' + text;
591
- if (typeof console !== 'undefined') {
592
- console.error(message);
593
- }
594
- try {
595
- // --- Welcome to debugging React ---
596
- // This error was thrown as a convenience so that you can use this stack
597
- // to find the callsite that caused this warning to fire.
598
- throw new Error(message);
599
- } catch (x) { /**/ }
600
- };
601
- }
602
-
603
- /**
604
- * Assert that the values match with the type specs.
605
- * Error messages are memorized and will only be shown once.
606
- *
607
- * @param {object} typeSpecs Map of name to a ReactPropType
608
- * @param {object} values Runtime values that need to be type-checked
609
- * @param {string} location e.g. "prop", "context", "child context"
610
- * @param {string} componentName Name of the component for error messages.
611
- * @param {?Function} getStack Returns the component stack.
612
- * @private
613
- */
614
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
615
- if (process.env.NODE_ENV !== 'production') {
616
- for (var typeSpecName in typeSpecs) {
617
- if (has(typeSpecs, typeSpecName)) {
618
- var error;
619
- // Prop type validation may throw. In case they do, we don't want to
620
- // fail the render phase where it didn't fail before. So we log it.
621
- // After these have been cleaned up, we'll let them throw.
622
- try {
623
- // This is intentionally an invariant that gets caught. It's the same
624
- // behavior as without this statement except with a better message.
625
- if (typeof typeSpecs[typeSpecName] !== 'function') {
626
- var err = Error(
627
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
628
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
629
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
630
- );
631
- err.name = 'Invariant Violation';
632
- throw err;
633
- }
634
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
635
- } catch (ex) {
636
- error = ex;
637
- }
638
- if (error && !(error instanceof Error)) {
639
- printWarning(
640
- (componentName || 'React class') + ': type specification of ' +
641
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
642
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
643
- 'You may have forgotten to pass an argument to the type checker ' +
644
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
645
- 'shape all require an argument).'
646
- );
647
- }
648
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
649
- // Only monitor this failure once because there tends to be a lot of the
650
- // same error.
651
- loggedTypeFailures[error.message] = true;
652
-
653
- var stack = getStack ? getStack() : '';
654
-
655
- printWarning(
656
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
657
- );
658
- }
659
- }
660
- }
661
- }
662
- }
663
-
664
- /**
665
- * Resets warning cache when testing.
666
- *
667
- * @private
668
- */
669
- checkPropTypes.resetWarningCache = function() {
670
- if (process.env.NODE_ENV !== 'production') {
671
- loggedTypeFailures = {};
672
- }
673
- };
674
-
675
- checkPropTypes_1 = checkPropTypes;
676
- return checkPropTypes_1;
677
- }
678
-
679
- /**
680
- * Copyright (c) 2013-present, Facebook, Inc.
681
- *
682
- * This source code is licensed under the MIT license found in the
683
- * LICENSE file in the root directory of this source tree.
684
- */
685
-
686
- var factoryWithTypeCheckers;
687
- var hasRequiredFactoryWithTypeCheckers;
688
-
689
- function requireFactoryWithTypeCheckers () {
690
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
691
- hasRequiredFactoryWithTypeCheckers = 1;
692
-
693
- var ReactIs = requireReactIs();
694
- var assign = requireObjectAssign();
695
-
696
- var ReactPropTypesSecret = requireReactPropTypesSecret();
697
- var has = requireHas();
698
- var checkPropTypes = requireCheckPropTypes();
699
-
700
- var printWarning = function() {};
701
-
702
- if (process.env.NODE_ENV !== 'production') {
703
- printWarning = function(text) {
704
- var message = 'Warning: ' + text;
705
- if (typeof console !== 'undefined') {
706
- console.error(message);
707
- }
708
- try {
709
- // --- Welcome to debugging React ---
710
- // This error was thrown as a convenience so that you can use this stack
711
- // to find the callsite that caused this warning to fire.
712
- throw new Error(message);
713
- } catch (x) {}
714
- };
715
- }
716
-
717
- function emptyFunctionThatReturnsNull() {
718
- return null;
719
- }
720
-
721
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
722
- /* global Symbol */
723
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
724
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
725
-
726
- /**
727
- * Returns the iterator method function contained on the iterable object.
728
- *
729
- * Be sure to invoke the function with the iterable as context:
730
- *
731
- * var iteratorFn = getIteratorFn(myIterable);
732
- * if (iteratorFn) {
733
- * var iterator = iteratorFn.call(myIterable);
734
- * ...
735
- * }
736
- *
737
- * @param {?object} maybeIterable
738
- * @return {?function}
739
- */
740
- function getIteratorFn(maybeIterable) {
741
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
742
- if (typeof iteratorFn === 'function') {
743
- return iteratorFn;
744
- }
745
- }
746
-
747
- /**
748
- * Collection of methods that allow declaration and validation of props that are
749
- * supplied to React components. Example usage:
750
- *
751
- * var Props = require('ReactPropTypes');
752
- * var MyArticle = React.createClass({
753
- * propTypes: {
754
- * // An optional string prop named "description".
755
- * description: Props.string,
756
- *
757
- * // A required enum prop named "category".
758
- * category: Props.oneOf(['News','Photos']).isRequired,
759
- *
760
- * // A prop named "dialog" that requires an instance of Dialog.
761
- * dialog: Props.instanceOf(Dialog).isRequired
762
- * },
763
- * render: function() { ... }
764
- * });
765
- *
766
- * A more formal specification of how these methods are used:
767
- *
768
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
769
- * decl := ReactPropTypes.{type}(.isRequired)?
770
- *
771
- * Each and every declaration produces a function with the same signature. This
772
- * allows the creation of custom validation functions. For example:
773
- *
774
- * var MyLink = React.createClass({
775
- * propTypes: {
776
- * // An optional string or URI prop named "href".
777
- * href: function(props, propName, componentName) {
778
- * var propValue = props[propName];
779
- * if (propValue != null && typeof propValue !== 'string' &&
780
- * !(propValue instanceof URI)) {
781
- * return new Error(
782
- * 'Expected a string or an URI for ' + propName + ' in ' +
783
- * componentName
784
- * );
785
- * }
786
- * }
787
- * },
788
- * render: function() {...}
789
- * });
790
- *
791
- * @internal
792
- */
793
-
794
- var ANONYMOUS = '<<anonymous>>';
795
-
796
- // Important!
797
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
798
- var ReactPropTypes = {
799
- array: createPrimitiveTypeChecker('array'),
800
- bigint: createPrimitiveTypeChecker('bigint'),
801
- bool: createPrimitiveTypeChecker('boolean'),
802
- func: createPrimitiveTypeChecker('function'),
803
- number: createPrimitiveTypeChecker('number'),
804
- object: createPrimitiveTypeChecker('object'),
805
- string: createPrimitiveTypeChecker('string'),
806
- symbol: createPrimitiveTypeChecker('symbol'),
807
-
808
- any: createAnyTypeChecker(),
809
- arrayOf: createArrayOfTypeChecker,
810
- element: createElementTypeChecker(),
811
- elementType: createElementTypeTypeChecker(),
812
- instanceOf: createInstanceTypeChecker,
813
- node: createNodeChecker(),
814
- objectOf: createObjectOfTypeChecker,
815
- oneOf: createEnumTypeChecker,
816
- oneOfType: createUnionTypeChecker,
817
- shape: createShapeTypeChecker,
818
- exact: createStrictShapeTypeChecker,
819
- };
820
-
821
- /**
822
- * inlined Object.is polyfill to avoid requiring consumers ship their own
823
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
824
- */
825
- /*eslint-disable no-self-compare*/
826
- function is(x, y) {
827
- // SameValue algorithm
828
- if (x === y) {
829
- // Steps 1-5, 7-10
830
- // Steps 6.b-6.e: +0 != -0
831
- return x !== 0 || 1 / x === 1 / y;
832
- } else {
833
- // Step 6.a: NaN == NaN
834
- return x !== x && y !== y;
835
- }
836
- }
837
- /*eslint-enable no-self-compare*/
838
-
839
- /**
840
- * We use an Error-like object for backward compatibility as people may call
841
- * PropTypes directly and inspect their output. However, we don't use real
842
- * Errors anymore. We don't inspect their stack anyway, and creating them
843
- * is prohibitively expensive if they are created too often, such as what
844
- * happens in oneOfType() for any type before the one that matched.
845
- */
846
- function PropTypeError(message, data) {
847
- this.message = message;
848
- this.data = data && typeof data === 'object' ? data: {};
849
- this.stack = '';
850
- }
851
- // Make `instanceof Error` still work for returned errors.
852
- PropTypeError.prototype = Error.prototype;
853
-
854
- function createChainableTypeChecker(validate) {
855
- if (process.env.NODE_ENV !== 'production') {
856
- var manualPropTypeCallCache = {};
857
- var manualPropTypeWarningCount = 0;
858
- }
859
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
860
- componentName = componentName || ANONYMOUS;
861
- propFullName = propFullName || propName;
862
-
863
- if (secret !== ReactPropTypesSecret) {
864
- if (throwOnDirectAccess) {
865
- // New behavior only for users of `prop-types` package
866
- var err = new Error(
867
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
868
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
869
- 'Read more at http://fb.me/use-check-prop-types'
870
- );
871
- err.name = 'Invariant Violation';
872
- throw err;
873
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
874
- // Old behavior for people using React.PropTypes
875
- var cacheKey = componentName + ':' + propName;
876
- if (
877
- !manualPropTypeCallCache[cacheKey] &&
878
- // Avoid spamming the console because they are often not actionable except for lib authors
879
- manualPropTypeWarningCount < 3
880
- ) {
881
- printWarning(
882
- 'You are manually calling a React.PropTypes validation ' +
883
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
884
- 'and will throw in the standalone `prop-types` package. ' +
885
- 'You may be seeing this warning due to a third-party PropTypes ' +
886
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
887
- );
888
- manualPropTypeCallCache[cacheKey] = true;
889
- manualPropTypeWarningCount++;
890
- }
891
- }
892
- }
893
- if (props[propName] == null) {
894
- if (isRequired) {
895
- if (props[propName] === null) {
896
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
897
- }
898
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
899
- }
900
- return null;
901
- } else {
902
- return validate(props, propName, componentName, location, propFullName);
903
- }
904
- }
905
-
906
- var chainedCheckType = checkType.bind(null, false);
907
- chainedCheckType.isRequired = checkType.bind(null, true);
908
-
909
- return chainedCheckType;
910
- }
911
-
912
- function createPrimitiveTypeChecker(expectedType) {
913
- function validate(props, propName, componentName, location, propFullName, secret) {
914
- var propValue = props[propName];
915
- var propType = getPropType(propValue);
916
- if (propType !== expectedType) {
917
- // `propValue` being instance of, say, date/regexp, pass the 'object'
918
- // check, but we can offer a more precise error message here rather than
919
- // 'of type `object`'.
920
- var preciseType = getPreciseType(propValue);
921
-
922
- return new PropTypeError(
923
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
924
- {expectedType: expectedType}
925
- );
926
- }
927
- return null;
928
- }
929
- return createChainableTypeChecker(validate);
930
- }
931
-
932
- function createAnyTypeChecker() {
933
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
934
- }
935
-
936
- function createArrayOfTypeChecker(typeChecker) {
937
- function validate(props, propName, componentName, location, propFullName) {
938
- if (typeof typeChecker !== 'function') {
939
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
940
- }
941
- var propValue = props[propName];
942
- if (!Array.isArray(propValue)) {
943
- var propType = getPropType(propValue);
944
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
945
- }
946
- for (var i = 0; i < propValue.length; i++) {
947
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
948
- if (error instanceof Error) {
949
- return error;
950
- }
951
- }
952
- return null;
953
- }
954
- return createChainableTypeChecker(validate);
955
- }
956
-
957
- function createElementTypeChecker() {
958
- function validate(props, propName, componentName, location, propFullName) {
959
- var propValue = props[propName];
960
- if (!isValidElement(propValue)) {
961
- var propType = getPropType(propValue);
962
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
963
- }
964
- return null;
965
- }
966
- return createChainableTypeChecker(validate);
967
- }
968
-
969
- function createElementTypeTypeChecker() {
970
- function validate(props, propName, componentName, location, propFullName) {
971
- var propValue = props[propName];
972
- if (!ReactIs.isValidElementType(propValue)) {
973
- var propType = getPropType(propValue);
974
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
975
- }
976
- return null;
977
- }
978
- return createChainableTypeChecker(validate);
979
- }
980
-
981
- function createInstanceTypeChecker(expectedClass) {
982
- function validate(props, propName, componentName, location, propFullName) {
983
- if (!(props[propName] instanceof expectedClass)) {
984
- var expectedClassName = expectedClass.name || ANONYMOUS;
985
- var actualClassName = getClassName(props[propName]);
986
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
987
- }
988
- return null;
989
- }
990
- return createChainableTypeChecker(validate);
991
- }
992
-
993
- function createEnumTypeChecker(expectedValues) {
994
- if (!Array.isArray(expectedValues)) {
995
- if (process.env.NODE_ENV !== 'production') {
996
- if (arguments.length > 1) {
997
- printWarning(
998
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
999
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1000
- );
1001
- } else {
1002
- printWarning('Invalid argument supplied to oneOf, expected an array.');
1003
- }
1004
- }
1005
- return emptyFunctionThatReturnsNull;
1006
- }
1007
-
1008
- function validate(props, propName, componentName, location, propFullName) {
1009
- var propValue = props[propName];
1010
- for (var i = 0; i < expectedValues.length; i++) {
1011
- if (is(propValue, expectedValues[i])) {
1012
- return null;
1013
- }
1014
- }
1015
-
1016
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1017
- var type = getPreciseType(value);
1018
- if (type === 'symbol') {
1019
- return String(value);
1020
- }
1021
- return value;
1022
- });
1023
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1024
- }
1025
- return createChainableTypeChecker(validate);
1026
- }
1027
-
1028
- function createObjectOfTypeChecker(typeChecker) {
1029
- function validate(props, propName, componentName, location, propFullName) {
1030
- if (typeof typeChecker !== 'function') {
1031
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1032
- }
1033
- var propValue = props[propName];
1034
- var propType = getPropType(propValue);
1035
- if (propType !== 'object') {
1036
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1037
- }
1038
- for (var key in propValue) {
1039
- if (has(propValue, key)) {
1040
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1041
- if (error instanceof Error) {
1042
- return error;
1043
- }
1044
- }
1045
- }
1046
- return null;
1047
- }
1048
- return createChainableTypeChecker(validate);
1049
- }
1050
-
1051
- function createUnionTypeChecker(arrayOfTypeCheckers) {
1052
- if (!Array.isArray(arrayOfTypeCheckers)) {
1053
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1054
- return emptyFunctionThatReturnsNull;
1055
- }
1056
-
1057
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1058
- var checker = arrayOfTypeCheckers[i];
1059
- if (typeof checker !== 'function') {
1060
- printWarning(
1061
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1062
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1063
- );
1064
- return emptyFunctionThatReturnsNull;
1065
- }
1066
- }
1067
-
1068
- function validate(props, propName, componentName, location, propFullName) {
1069
- var expectedTypes = [];
1070
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1071
- var checker = arrayOfTypeCheckers[i];
1072
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1073
- if (checkerResult == null) {
1074
- return null;
1075
- }
1076
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1077
- expectedTypes.push(checkerResult.data.expectedType);
1078
- }
1079
- }
1080
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1081
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1082
- }
1083
- return createChainableTypeChecker(validate);
1084
- }
1085
-
1086
- function createNodeChecker() {
1087
- function validate(props, propName, componentName, location, propFullName) {
1088
- if (!isNode(props[propName])) {
1089
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1090
- }
1091
- return null;
1092
- }
1093
- return createChainableTypeChecker(validate);
1094
- }
1095
-
1096
- function invalidValidatorError(componentName, location, propFullName, key, type) {
1097
- return new PropTypeError(
1098
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1099
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1100
- );
1101
- }
1102
-
1103
- function createShapeTypeChecker(shapeTypes) {
1104
- function validate(props, propName, componentName, location, propFullName) {
1105
- var propValue = props[propName];
1106
- var propType = getPropType(propValue);
1107
- if (propType !== 'object') {
1108
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1109
- }
1110
- for (var key in shapeTypes) {
1111
- var checker = shapeTypes[key];
1112
- if (typeof checker !== 'function') {
1113
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1114
- }
1115
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1116
- if (error) {
1117
- return error;
1118
- }
1119
- }
1120
- return null;
1121
- }
1122
- return createChainableTypeChecker(validate);
1123
- }
1124
-
1125
- function createStrictShapeTypeChecker(shapeTypes) {
1126
- function validate(props, propName, componentName, location, propFullName) {
1127
- var propValue = props[propName];
1128
- var propType = getPropType(propValue);
1129
- if (propType !== 'object') {
1130
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1131
- }
1132
- // We need to check all keys in case some are required but missing from props.
1133
- var allKeys = assign({}, props[propName], shapeTypes);
1134
- for (var key in allKeys) {
1135
- var checker = shapeTypes[key];
1136
- if (has(shapeTypes, key) && typeof checker !== 'function') {
1137
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1138
- }
1139
- if (!checker) {
1140
- return new PropTypeError(
1141
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1142
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1143
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1144
- );
1145
- }
1146
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1147
- if (error) {
1148
- return error;
1149
- }
1150
- }
1151
- return null;
1152
- }
1153
-
1154
- return createChainableTypeChecker(validate);
1155
- }
1156
-
1157
- function isNode(propValue) {
1158
- switch (typeof propValue) {
1159
- case 'number':
1160
- case 'string':
1161
- case 'undefined':
1162
- return true;
1163
- case 'boolean':
1164
- return !propValue;
1165
- case 'object':
1166
- if (Array.isArray(propValue)) {
1167
- return propValue.every(isNode);
1168
- }
1169
- if (propValue === null || isValidElement(propValue)) {
1170
- return true;
1171
- }
1172
-
1173
- var iteratorFn = getIteratorFn(propValue);
1174
- if (iteratorFn) {
1175
- var iterator = iteratorFn.call(propValue);
1176
- var step;
1177
- if (iteratorFn !== propValue.entries) {
1178
- while (!(step = iterator.next()).done) {
1179
- if (!isNode(step.value)) {
1180
- return false;
1181
- }
1182
- }
1183
- } else {
1184
- // Iterator will provide entry [k,v] tuples rather than values.
1185
- while (!(step = iterator.next()).done) {
1186
- var entry = step.value;
1187
- if (entry) {
1188
- if (!isNode(entry[1])) {
1189
- return false;
1190
- }
1191
- }
1192
- }
1193
- }
1194
- } else {
1195
- return false;
1196
- }
1197
-
1198
- return true;
1199
- default:
1200
- return false;
1201
- }
1202
- }
1203
-
1204
- function isSymbol(propType, propValue) {
1205
- // Native Symbol.
1206
- if (propType === 'symbol') {
1207
- return true;
1208
- }
1209
-
1210
- // falsy value can't be a Symbol
1211
- if (!propValue) {
1212
- return false;
1213
- }
1214
-
1215
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1216
- if (propValue['@@toStringTag'] === 'Symbol') {
1217
- return true;
1218
- }
1219
-
1220
- // Fallback for non-spec compliant Symbols which are polyfilled.
1221
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1222
- return true;
1223
- }
1224
-
1225
- return false;
1226
- }
1227
-
1228
- // Equivalent of `typeof` but with special handling for array and regexp.
1229
- function getPropType(propValue) {
1230
- var propType = typeof propValue;
1231
- if (Array.isArray(propValue)) {
1232
- return 'array';
1233
- }
1234
- if (propValue instanceof RegExp) {
1235
- // Old webkits (at least until Android 4.0) return 'function' rather than
1236
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1237
- // passes PropTypes.object.
1238
- return 'object';
1239
- }
1240
- if (isSymbol(propType, propValue)) {
1241
- return 'symbol';
1242
- }
1243
- return propType;
1244
- }
1245
-
1246
- // This handles more types than `getPropType`. Only used for error messages.
1247
- // See `createPrimitiveTypeChecker`.
1248
- function getPreciseType(propValue) {
1249
- if (typeof propValue === 'undefined' || propValue === null) {
1250
- return '' + propValue;
1251
- }
1252
- var propType = getPropType(propValue);
1253
- if (propType === 'object') {
1254
- if (propValue instanceof Date) {
1255
- return 'date';
1256
- } else if (propValue instanceof RegExp) {
1257
- return 'regexp';
1258
- }
1259
- }
1260
- return propType;
1261
- }
1262
-
1263
- // Returns a string that is postfixed to a warning about an invalid type.
1264
- // For example, "undefined" or "of type array"
1265
- function getPostfixForTypeWarning(value) {
1266
- var type = getPreciseType(value);
1267
- switch (type) {
1268
- case 'array':
1269
- case 'object':
1270
- return 'an ' + type;
1271
- case 'boolean':
1272
- case 'date':
1273
- case 'regexp':
1274
- return 'a ' + type;
1275
- default:
1276
- return type;
1277
- }
1278
- }
1279
-
1280
- // Returns class name of the object, if any.
1281
- function getClassName(propValue) {
1282
- if (!propValue.constructor || !propValue.constructor.name) {
1283
- return ANONYMOUS;
1284
- }
1285
- return propValue.constructor.name;
1286
- }
1287
-
1288
- ReactPropTypes.checkPropTypes = checkPropTypes;
1289
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1290
- ReactPropTypes.PropTypes = ReactPropTypes;
1291
-
1292
- return ReactPropTypes;
1293
- };
1294
- return factoryWithTypeCheckers;
1295
- }
1296
-
1297
- /**
1298
- * Copyright (c) 2013-present, Facebook, Inc.
1299
- *
1300
- * This source code is licensed under the MIT license found in the
1301
- * LICENSE file in the root directory of this source tree.
1302
- */
1303
-
1304
- var factoryWithThrowingShims;
1305
- var hasRequiredFactoryWithThrowingShims;
1306
-
1307
- function requireFactoryWithThrowingShims () {
1308
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1309
- hasRequiredFactoryWithThrowingShims = 1;
1310
-
1311
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1312
-
1313
- function emptyFunction() {}
1314
- function emptyFunctionWithReset() {}
1315
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1316
-
1317
- factoryWithThrowingShims = function() {
1318
- function shim(props, propName, componentName, location, propFullName, secret) {
1319
- if (secret === ReactPropTypesSecret) {
1320
- // It is still safe when called from React.
1321
- return;
1322
- }
1323
- var err = new Error(
1324
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1325
- 'Use PropTypes.checkPropTypes() to call them. ' +
1326
- 'Read more at http://fb.me/use-check-prop-types'
1327
- );
1328
- err.name = 'Invariant Violation';
1329
- throw err;
1330
- } shim.isRequired = shim;
1331
- function getShim() {
1332
- return shim;
1333
- } // Important!
1334
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1335
- var ReactPropTypes = {
1336
- array: shim,
1337
- bigint: shim,
1338
- bool: shim,
1339
- func: shim,
1340
- number: shim,
1341
- object: shim,
1342
- string: shim,
1343
- symbol: shim,
1344
-
1345
- any: shim,
1346
- arrayOf: getShim,
1347
- element: shim,
1348
- elementType: shim,
1349
- instanceOf: getShim,
1350
- node: shim,
1351
- objectOf: getShim,
1352
- oneOf: getShim,
1353
- oneOfType: getShim,
1354
- shape: getShim,
1355
- exact: getShim,
1356
-
1357
- checkPropTypes: emptyFunctionWithReset,
1358
- resetWarningCache: emptyFunction
1359
- };
1360
-
1361
- ReactPropTypes.PropTypes = ReactPropTypes;
1362
-
1363
- return ReactPropTypes;
1364
- };
1365
- return factoryWithThrowingShims;
1366
- }
1367
-
1368
- /**
1369
- * Copyright (c) 2013-present, Facebook, Inc.
1370
- *
1371
- * This source code is licensed under the MIT license found in the
1372
- * LICENSE file in the root directory of this source tree.
1373
- */
1374
-
1375
- if (process.env.NODE_ENV !== 'production') {
1376
- var ReactIs = requireReactIs();
1377
-
1378
- // By explicitly using `prop-types` you are opting into new development behavior.
1379
- // http://fb.me/prop-types-in-prod
1380
- var throwOnDirectAccess = true;
1381
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1382
- } else {
1383
- // By explicitly using `prop-types` you are opting into new production behavior.
1384
- // http://fb.me/prop-types-in-prod
1385
- propTypes.exports = requireFactoryWithThrowingShims()();
1386
- }
1387
-
1388
- var propTypesExports = propTypes.exports;
1389
- var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
1390
-
1391
- function rng$1() {
1392
- return crypto$1.randomBytes(16);
1393
- }
1394
-
1395
- /**
1396
- * Convert array of 16 byte values to UUID string format of the form:
1397
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1398
- */
1399
- var byteToHex$1 = [];
1400
-
1401
- for (var i = 0; i < 256; ++i) {
1402
- byteToHex$1[i] = (i + 0x100).toString(16).substr(1);
1403
- }
1404
-
1405
- function bytesToUuid(buf, offset) {
1406
- var i = offset || 0;
1407
- var bth = byteToHex$1; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
1408
-
1409
- return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
1410
- }
1411
-
1412
- function v4$1(options, buf, offset) {
1413
- var i = buf && offset || 0;
1414
-
1415
- if (typeof options == 'string') {
1416
- buf = options === 'binary' ? new Array(16) : null;
1417
- options = null;
1418
- }
1419
-
1420
- options = options || {};
1421
- var rnds = options.random || (options.rng || rng$1)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1422
-
1423
- rnds[6] = rnds[6] & 0x0f | 0x40;
1424
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1425
-
1426
- if (buf) {
1427
- for (var ii = 0; ii < 16; ++ii) {
1428
- buf[i + ii] = rnds[ii];
1429
- }
1430
- }
1431
-
1432
- return buf || bytesToUuid(rnds);
1433
- }
1434
-
1435
- function ownKeys$2(object, enumerableOnly) {
1436
- var keys = Object.keys(object);
1437
- if (Object.getOwnPropertySymbols) {
1438
- var symbols = Object.getOwnPropertySymbols(object);
1439
- enumerableOnly && (symbols = symbols.filter(function (sym) {
1440
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1441
- })), keys.push.apply(keys, symbols);
1442
- }
1443
- return keys;
1444
- }
1445
- function _objectSpread2(target) {
1446
- for (var i = 1; i < arguments.length; i++) {
1447
- var source = null != arguments[i] ? arguments[i] : {};
1448
- i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
1449
- _defineProperty(target, key, source[key]);
1450
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
1451
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1452
- });
1453
- }
1454
- return target;
1455
- }
1456
- function _classCallCheck(instance, Constructor) {
1457
- if (!(instance instanceof Constructor)) {
1458
- throw new TypeError("Cannot call a class as a function");
1459
- }
1460
- }
1461
- function _defineProperties(target, props) {
1462
- for (var i = 0; i < props.length; i++) {
1463
- var descriptor = props[i];
1464
- descriptor.enumerable = descriptor.enumerable || false;
1465
- descriptor.configurable = true;
1466
- if ("value" in descriptor) descriptor.writable = true;
1467
- Object.defineProperty(target, descriptor.key, descriptor);
1468
- }
1469
- }
1470
- function _createClass(Constructor, protoProps, staticProps) {
1471
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1472
- if (staticProps) _defineProperties(Constructor, staticProps);
1473
- Object.defineProperty(Constructor, "prototype", {
1474
- writable: false
1475
- });
1476
- return Constructor;
1477
- }
1478
- function _defineProperty(obj, key, value) {
1479
- if (key in obj) {
1480
- Object.defineProperty(obj, key, {
1481
- value: value,
1482
- enumerable: true,
1483
- configurable: true,
1484
- writable: true
1485
- });
1486
- } else {
1487
- obj[key] = value;
1488
- }
1489
- return obj;
1490
- }
1491
- function _extends() {
1492
- _extends = Object.assign ? Object.assign.bind() : function (target) {
1493
- for (var i = 1; i < arguments.length; i++) {
1494
- var source = arguments[i];
1495
- for (var key in source) {
1496
- if (Object.prototype.hasOwnProperty.call(source, key)) {
1497
- target[key] = source[key];
1498
- }
1499
- }
1500
- }
1501
- return target;
1502
- };
1503
- return _extends.apply(this, arguments);
1504
- }
1505
- function _inherits(subClass, superClass) {
1506
- if (typeof superClass !== "function" && superClass !== null) {
1507
- throw new TypeError("Super expression must either be null or a function");
1508
- }
1509
- subClass.prototype = Object.create(superClass && superClass.prototype, {
1510
- constructor: {
1511
- value: subClass,
1512
- writable: true,
1513
- configurable: true
1514
- }
1515
- });
1516
- Object.defineProperty(subClass, "prototype", {
1517
- writable: false
1518
- });
1519
- if (superClass) _setPrototypeOf(subClass, superClass);
1520
- }
1521
- function _getPrototypeOf(o) {
1522
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
1523
- return o.__proto__ || Object.getPrototypeOf(o);
1524
- };
1525
- return _getPrototypeOf(o);
1526
- }
1527
- function _setPrototypeOf(o, p) {
1528
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
1529
- o.__proto__ = p;
1530
- return o;
1531
- };
1532
- return _setPrototypeOf(o, p);
1533
- }
1534
- function _isNativeReflectConstruct() {
1535
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1536
- if (Reflect.construct.sham) return false;
1537
- if (typeof Proxy === "function") return true;
1538
- try {
1539
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
1540
- return true;
1541
- } catch (e) {
1542
- return false;
1543
- }
1544
- }
1545
- function _assertThisInitialized(self) {
1546
- if (self === void 0) {
1547
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1548
- }
1549
- return self;
1550
- }
1551
- function _possibleConstructorReturn(self, call) {
1552
- if (call && (typeof call === "object" || typeof call === "function")) {
1553
- return call;
1554
- } else if (call !== void 0) {
1555
- throw new TypeError("Derived constructors may only return object or undefined");
1556
- }
1557
- return _assertThisInitialized(self);
1558
- }
1559
- function _createSuper(Derived) {
1560
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
1561
- return function _createSuperInternal() {
1562
- var Super = _getPrototypeOf(Derived),
1563
- result;
1564
- if (hasNativeReflectConstruct) {
1565
- var NewTarget = _getPrototypeOf(this).constructor;
1566
- result = Reflect.construct(Super, arguments, NewTarget);
1567
- } else {
1568
- result = Super.apply(this, arguments);
1569
- }
1570
- return _possibleConstructorReturn(this, result);
1571
- };
1572
- }
1573
- function _unsupportedIterableToArray(o, minLen) {
1574
- if (!o) return;
1575
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1576
- var n = Object.prototype.toString.call(o).slice(8, -1);
1577
- if (n === "Object" && o.constructor) n = o.constructor.name;
1578
- if (n === "Map" || n === "Set") return Array.from(o);
1579
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1580
- }
1581
- function _arrayLikeToArray(arr, len) {
1582
- if (len == null || len > arr.length) len = arr.length;
1583
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1584
- return arr2;
1585
- }
1586
- function _createForOfIteratorHelper(o, allowArrayLike) {
1587
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1588
- if (!it) {
1589
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1590
- if (it) o = it;
1591
- var i = 0;
1592
- var F = function () {};
1593
- return {
1594
- s: F,
1595
- n: function () {
1596
- if (i >= o.length) return {
1597
- done: true
1598
- };
1599
- return {
1600
- done: false,
1601
- value: o[i++]
1602
- };
1603
- },
1604
- e: function (e) {
1605
- throw e;
1606
- },
1607
- f: F
1608
- };
1609
- }
1610
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1611
- }
1612
- var normalCompletion = true,
1613
- didErr = false,
1614
- err;
1615
- return {
1616
- s: function () {
1617
- it = it.call(o);
1618
- },
1619
- n: function () {
1620
- var step = it.next();
1621
- normalCompletion = step.done;
1622
- return step;
1623
- },
1624
- e: function (e) {
1625
- didErr = true;
1626
- err = e;
1627
- },
1628
- f: function () {
1629
- try {
1630
- if (!normalCompletion && it.return != null) it.return();
1631
- } finally {
1632
- if (didErr) throw err;
1633
- }
1634
- }
1635
- };
1636
- }
1637
-
1638
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1639
-
1640
- var check = function (it) {
1641
- return it && it.Math == Math && it;
1642
- };
1643
-
1644
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
1645
- var global$a =
1646
- // eslint-disable-next-line es/no-global-this -- safe
1647
- check(typeof globalThis == 'object' && globalThis) ||
1648
- check(typeof window == 'object' && window) ||
1649
- // eslint-disable-next-line no-restricted-globals -- safe
1650
- check(typeof self == 'object' && self) ||
1651
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
1652
- // eslint-disable-next-line no-new-func -- fallback
1653
- (function () { return this; })() || Function('return this')();
1654
-
1655
- var objectGetOwnPropertyDescriptor = {};
1656
-
1657
- var fails$9 = function (exec) {
1658
- try {
1659
- return !!exec();
1660
- } catch (error) {
1661
- return true;
1662
- }
1663
- };
1664
-
1665
- var fails$8 = fails$9;
1666
-
1667
- // Detect IE8's incomplete defineProperty implementation
1668
- var descriptors = !fails$8(function () {
1669
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1670
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
1671
- });
1672
-
1673
- var fails$7 = fails$9;
1674
-
1675
- var functionBindNative = !fails$7(function () {
1676
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
1677
- var test = (function () { /* empty */ }).bind();
1678
- // eslint-disable-next-line no-prototype-builtins -- safe
1679
- return typeof test != 'function' || test.hasOwnProperty('prototype');
1680
- });
1681
-
1682
- var NATIVE_BIND$2 = functionBindNative;
1683
-
1684
- var call$4 = Function.prototype.call;
1685
-
1686
- var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
1687
- return call$4.apply(call$4, arguments);
1688
- };
1689
-
1690
- var objectPropertyIsEnumerable = {};
1691
-
1692
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
1693
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1694
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
1695
-
1696
- // Nashorn ~ JDK8 bug
1697
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
1698
-
1699
- // `Object.prototype.propertyIsEnumerable` method implementation
1700
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
1701
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
1702
- var descriptor = getOwnPropertyDescriptor$1(this, V);
1703
- return !!descriptor && descriptor.enumerable;
1704
- } : $propertyIsEnumerable;
1705
-
1706
- var createPropertyDescriptor$2 = function (bitmap, value) {
1707
- return {
1708
- enumerable: !(bitmap & 1),
1709
- configurable: !(bitmap & 2),
1710
- writable: !(bitmap & 4),
1711
- value: value
1712
- };
1713
- };
1714
-
1715
- var NATIVE_BIND$1 = functionBindNative;
1716
-
1717
- var FunctionPrototype$1 = Function.prototype;
1718
- var call$3 = FunctionPrototype$1.call;
1719
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$3, call$3);
1720
-
1721
- var functionUncurryThisRaw = function (fn) {
1722
- return NATIVE_BIND$1 ? uncurryThisWithBind(fn) : function () {
1723
- return call$3.apply(fn, arguments);
1724
- };
1725
- };
1726
-
1727
- var uncurryThisRaw$1 = functionUncurryThisRaw;
1728
-
1729
- var toString$1 = uncurryThisRaw$1({}.toString);
1730
- var stringSlice = uncurryThisRaw$1(''.slice);
1731
-
1732
- var classofRaw$2 = function (it) {
1733
- return stringSlice(toString$1(it), 8, -1);
1734
- };
1735
-
1736
- var classofRaw$1 = classofRaw$2;
1737
- var uncurryThisRaw = functionUncurryThisRaw;
1738
-
1739
- var functionUncurryThis = function (fn) {
1740
- // Nashorn bug:
1741
- // https://github.com/zloirock/core-js/issues/1128
1742
- // https://github.com/zloirock/core-js/issues/1130
1743
- if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
1744
- };
1745
-
1746
- var uncurryThis$9 = functionUncurryThis;
1747
- var fails$6 = fails$9;
1748
- var classof$3 = classofRaw$2;
1749
-
1750
- var $Object$3 = Object;
1751
- var split = uncurryThis$9(''.split);
1752
-
1753
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
1754
- var indexedObject = fails$6(function () {
1755
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
1756
- // eslint-disable-next-line no-prototype-builtins -- safe
1757
- return !$Object$3('z').propertyIsEnumerable(0);
1758
- }) ? function (it) {
1759
- return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
1760
- } : $Object$3;
1761
-
1762
- // we can't use just `it == null` since of `document.all` special case
1763
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
1764
- var isNullOrUndefined$2 = function (it) {
1765
- return it === null || it === undefined;
1766
- };
1767
-
1768
- var isNullOrUndefined$1 = isNullOrUndefined$2;
1769
-
1770
- var $TypeError$5 = TypeError;
1771
-
1772
- // `RequireObjectCoercible` abstract operation
1773
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
1774
- var requireObjectCoercible$2 = function (it) {
1775
- if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
1776
- return it;
1777
- };
1778
-
1779
- // toObject with fallback for non-array-like ES3 strings
1780
- var IndexedObject$1 = indexedObject;
1781
- var requireObjectCoercible$1 = requireObjectCoercible$2;
1782
-
1783
- var toIndexedObject$4 = function (it) {
1784
- return IndexedObject$1(requireObjectCoercible$1(it));
1785
- };
1786
-
1787
- var documentAll$2 = typeof document == 'object' && document.all;
1788
-
1789
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
1790
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
1791
-
1792
- var documentAll_1 = {
1793
- all: documentAll$2,
1794
- IS_HTMLDDA: IS_HTMLDDA
1795
- };
1796
-
1797
- var $documentAll$1 = documentAll_1;
1798
-
1799
- var documentAll$1 = $documentAll$1.all;
1800
-
1801
- // `IsCallable` abstract operation
1802
- // https://tc39.es/ecma262/#sec-iscallable
1803
- var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
1804
- return typeof argument == 'function' || argument === documentAll$1;
1805
- } : function (argument) {
1806
- return typeof argument == 'function';
1807
- };
1808
-
1809
- var isCallable$b = isCallable$c;
1810
- var $documentAll = documentAll_1;
1811
-
1812
- var documentAll = $documentAll.all;
1813
-
1814
- var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
1815
- return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
1816
- } : function (it) {
1817
- return typeof it == 'object' ? it !== null : isCallable$b(it);
1818
- };
1819
-
1820
- var global$9 = global$a;
1821
- var isCallable$a = isCallable$c;
1822
-
1823
- var aFunction = function (argument) {
1824
- return isCallable$a(argument) ? argument : undefined;
1825
- };
1826
-
1827
- var getBuiltIn$5 = function (namespace, method) {
1828
- return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
1829
- };
1830
-
1831
- var uncurryThis$8 = functionUncurryThis;
1832
-
1833
- var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
1834
-
1835
- var getBuiltIn$4 = getBuiltIn$5;
1836
-
1837
- var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
1838
-
1839
- var global$8 = global$a;
1840
- var userAgent = engineUserAgent;
1841
-
1842
- var process$1 = global$8.process;
1843
- var Deno = global$8.Deno;
1844
- var versions = process$1 && process$1.versions || Deno && Deno.version;
1845
- var v8 = versions && versions.v8;
1846
- var match, version;
1847
-
1848
- if (v8) {
1849
- match = v8.split('.');
1850
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
1851
- // but their correct versions are not interesting for us
1852
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
1853
- }
1854
-
1855
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
1856
- // so check `userAgent` even if `.v8` exists, but 0
1857
- if (!version && userAgent) {
1858
- match = userAgent.match(/Edge\/(\d+)/);
1859
- if (!match || match[1] >= 74) {
1860
- match = userAgent.match(/Chrome\/(\d+)/);
1861
- if (match) version = +match[1];
1862
- }
1863
- }
1864
-
1865
- var engineV8Version = version;
1866
-
1867
- /* eslint-disable es/no-symbol -- required for testing */
1868
-
1869
- var V8_VERSION = engineV8Version;
1870
- var fails$5 = fails$9;
1871
-
1872
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
1873
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
1874
- var symbol = Symbol();
1875
- // Chrome 38 Symbol has incorrect toString conversion
1876
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
1877
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
1878
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1879
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
1880
- });
1881
-
1882
- /* eslint-disable es/no-symbol -- required for testing */
1883
-
1884
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
1885
-
1886
- var useSymbolAsUid = NATIVE_SYMBOL$1
1887
- && !Symbol.sham
1888
- && typeof Symbol.iterator == 'symbol';
1889
-
1890
- var getBuiltIn$3 = getBuiltIn$5;
1891
- var isCallable$9 = isCallable$c;
1892
- var isPrototypeOf = objectIsPrototypeOf;
1893
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
1894
-
1895
- var $Object$2 = Object;
1896
-
1897
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
1898
- return typeof it == 'symbol';
1899
- } : function (it) {
1900
- var $Symbol = getBuiltIn$3('Symbol');
1901
- return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
1902
- };
1903
-
1904
- var $String$1 = String;
1905
-
1906
- var tryToString$1 = function (argument) {
1907
- try {
1908
- return $String$1(argument);
1909
- } catch (error) {
1910
- return 'Object';
1911
- }
1912
- };
1913
-
1914
- var isCallable$8 = isCallable$c;
1915
- var tryToString = tryToString$1;
1916
-
1917
- var $TypeError$4 = TypeError;
1918
-
1919
- // `Assert: IsCallable(argument) is true`
1920
- var aCallable$2 = function (argument) {
1921
- if (isCallable$8(argument)) return argument;
1922
- throw $TypeError$4(tryToString(argument) + ' is not a function');
1923
- };
1924
-
1925
- var aCallable$1 = aCallable$2;
1926
- var isNullOrUndefined = isNullOrUndefined$2;
1927
-
1928
- // `GetMethod` abstract operation
1929
- // https://tc39.es/ecma262/#sec-getmethod
1930
- var getMethod$1 = function (V, P) {
1931
- var func = V[P];
1932
- return isNullOrUndefined(func) ? undefined : aCallable$1(func);
1933
- };
1934
-
1935
- var call$2 = functionCall;
1936
- var isCallable$7 = isCallable$c;
1937
- var isObject$5 = isObject$6;
1938
-
1939
- var $TypeError$3 = TypeError;
1940
-
1941
- // `OrdinaryToPrimitive` abstract operation
1942
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
1943
- var ordinaryToPrimitive$1 = function (input, pref) {
1944
- var fn, val;
1945
- if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
1946
- if (isCallable$7(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
1947
- if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
1948
- throw $TypeError$3("Can't convert object to primitive value");
1949
- };
1950
-
1951
- var shared$3 = {exports: {}};
1952
-
1953
- var global$7 = global$a;
1954
-
1955
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1956
- var defineProperty$2 = Object.defineProperty;
1957
-
1958
- var defineGlobalProperty$3 = function (key, value) {
1959
- try {
1960
- defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
1961
- } catch (error) {
1962
- global$7[key] = value;
1963
- } return value;
1964
- };
1965
-
1966
- var global$6 = global$a;
1967
- var defineGlobalProperty$2 = defineGlobalProperty$3;
1968
-
1969
- var SHARED = '__core-js_shared__';
1970
- var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
1971
-
1972
- var sharedStore = store$3;
1973
-
1974
- var store$2 = sharedStore;
1975
-
1976
- (shared$3.exports = function (key, value) {
1977
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
1978
- })('versions', []).push({
1979
- version: '3.25.5',
1980
- mode: 'global',
1981
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
1982
- license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
1983
- source: 'https://github.com/zloirock/core-js'
1984
- });
1985
-
1986
- var requireObjectCoercible = requireObjectCoercible$2;
1987
-
1988
- var $Object$1 = Object;
1989
-
1990
- // `ToObject` abstract operation
1991
- // https://tc39.es/ecma262/#sec-toobject
1992
- var toObject$2 = function (argument) {
1993
- return $Object$1(requireObjectCoercible(argument));
1994
- };
1995
-
1996
- var uncurryThis$7 = functionUncurryThis;
1997
- var toObject$1 = toObject$2;
1998
-
1999
- var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
2000
-
2001
- // `HasOwnProperty` abstract operation
2002
- // https://tc39.es/ecma262/#sec-hasownproperty
2003
- // eslint-disable-next-line es/no-object-hasown -- safe
2004
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
2005
- return hasOwnProperty(toObject$1(it), key);
2006
- };
2007
-
2008
- var uncurryThis$6 = functionUncurryThis;
2009
-
2010
- var id = 0;
2011
- var postfix = Math.random();
2012
- var toString = uncurryThis$6(1.0.toString);
2013
-
2014
- var uid$2 = function (key) {
2015
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
2016
- };
2017
-
2018
- var global$5 = global$a;
2019
- var shared$2 = shared$3.exports;
2020
- var hasOwn$6 = hasOwnProperty_1;
2021
- var uid$1 = uid$2;
2022
- var NATIVE_SYMBOL = symbolConstructorDetection;
2023
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
2024
-
2025
- var WellKnownSymbolsStore = shared$2('wks');
2026
- var Symbol$1 = global$5.Symbol;
2027
- var symbolFor = Symbol$1 && Symbol$1['for'];
2028
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
2029
-
2030
- var wellKnownSymbol$5 = function (name) {
2031
- if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
2032
- var description = 'Symbol.' + name;
2033
- if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
2034
- WellKnownSymbolsStore[name] = Symbol$1[name];
2035
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
2036
- WellKnownSymbolsStore[name] = symbolFor(description);
2037
- } else {
2038
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
2039
- }
2040
- } return WellKnownSymbolsStore[name];
2041
- };
2042
-
2043
- var call$1 = functionCall;
2044
- var isObject$4 = isObject$6;
2045
- var isSymbol$1 = isSymbol$2;
2046
- var getMethod = getMethod$1;
2047
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
2048
- var wellKnownSymbol$4 = wellKnownSymbol$5;
2049
-
2050
- var $TypeError$2 = TypeError;
2051
- var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
2052
-
2053
- // `ToPrimitive` abstract operation
2054
- // https://tc39.es/ecma262/#sec-toprimitive
2055
- var toPrimitive$1 = function (input, pref) {
2056
- if (!isObject$4(input) || isSymbol$1(input)) return input;
2057
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
2058
- var result;
2059
- if (exoticToPrim) {
2060
- if (pref === undefined) pref = 'default';
2061
- result = call$1(exoticToPrim, input, pref);
2062
- if (!isObject$4(result) || isSymbol$1(result)) return result;
2063
- throw $TypeError$2("Can't convert object to primitive value");
2064
- }
2065
- if (pref === undefined) pref = 'number';
2066
- return ordinaryToPrimitive(input, pref);
2067
- };
2068
-
2069
- var toPrimitive = toPrimitive$1;
2070
- var isSymbol = isSymbol$2;
2071
-
2072
- // `ToPropertyKey` abstract operation
2073
- // https://tc39.es/ecma262/#sec-topropertykey
2074
- var toPropertyKey$2 = function (argument) {
2075
- var key = toPrimitive(argument, 'string');
2076
- return isSymbol(key) ? key : key + '';
2077
- };
2078
-
2079
- var global$4 = global$a;
2080
- var isObject$3 = isObject$6;
2081
-
2082
- var document$1 = global$4.document;
2083
- // typeof document.createElement is 'object' in old IE
2084
- var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
2085
-
2086
- var documentCreateElement$1 = function (it) {
2087
- return EXISTS$1 ? document$1.createElement(it) : {};
2088
- };
2089
-
2090
- var DESCRIPTORS$7 = descriptors;
2091
- var fails$4 = fails$9;
2092
- var createElement = documentCreateElement$1;
2093
-
2094
- // Thanks to IE8 for its funny defineProperty
2095
- var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
2096
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2097
- return Object.defineProperty(createElement('div'), 'a', {
2098
- get: function () { return 7; }
2099
- }).a != 7;
2100
- });
2101
-
2102
- var DESCRIPTORS$6 = descriptors;
2103
- var call = functionCall;
2104
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2105
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
2106
- var toIndexedObject$3 = toIndexedObject$4;
2107
- var toPropertyKey$1 = toPropertyKey$2;
2108
- var hasOwn$5 = hasOwnProperty_1;
2109
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
2110
-
2111
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2112
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
2113
-
2114
- // `Object.getOwnPropertyDescriptor` method
2115
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
2116
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
2117
- O = toIndexedObject$3(O);
2118
- P = toPropertyKey$1(P);
2119
- if (IE8_DOM_DEFINE$1) try {
2120
- return $getOwnPropertyDescriptor$1(O, P);
2121
- } catch (error) { /* empty */ }
2122
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
2123
- };
2124
-
2125
- var objectDefineProperty = {};
2126
-
2127
- var DESCRIPTORS$5 = descriptors;
2128
- var fails$3 = fails$9;
2129
-
2130
- // V8 ~ Chrome 36-
2131
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
2132
- var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
2133
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2134
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
2135
- value: 42,
2136
- writable: false
2137
- }).prototype != 42;
2138
- });
2139
-
2140
- var isObject$2 = isObject$6;
2141
-
2142
- var $String = String;
2143
- var $TypeError$1 = TypeError;
2144
-
2145
- // `Assert: Type(argument) is Object`
2146
- var anObject$4 = function (argument) {
2147
- if (isObject$2(argument)) return argument;
2148
- throw $TypeError$1($String(argument) + ' is not an object');
2149
- };
2150
-
2151
- var DESCRIPTORS$4 = descriptors;
2152
- var IE8_DOM_DEFINE = ie8DomDefine;
2153
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
2154
- var anObject$3 = anObject$4;
2155
- var toPropertyKey = toPropertyKey$2;
2156
-
2157
- var $TypeError = TypeError;
2158
- // eslint-disable-next-line es/no-object-defineproperty -- safe
2159
- var $defineProperty = Object.defineProperty;
2160
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2161
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
2162
- var ENUMERABLE = 'enumerable';
2163
- var CONFIGURABLE$1 = 'configurable';
2164
- var WRITABLE = 'writable';
2165
-
2166
- // `Object.defineProperty` method
2167
- // https://tc39.es/ecma262/#sec-object.defineproperty
2168
- objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
2169
- anObject$3(O);
2170
- P = toPropertyKey(P);
2171
- anObject$3(Attributes);
2172
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
2173
- var current = $getOwnPropertyDescriptor(O, P);
2174
- if (current && current[WRITABLE]) {
2175
- O[P] = Attributes.value;
2176
- Attributes = {
2177
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
2178
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
2179
- writable: false
2180
- };
2181
- }
2182
- } return $defineProperty(O, P, Attributes);
2183
- } : $defineProperty : function defineProperty(O, P, Attributes) {
2184
- anObject$3(O);
2185
- P = toPropertyKey(P);
2186
- anObject$3(Attributes);
2187
- if (IE8_DOM_DEFINE) try {
2188
- return $defineProperty(O, P, Attributes);
2189
- } catch (error) { /* empty */ }
2190
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
2191
- if ('value' in Attributes) O[P] = Attributes.value;
2192
- return O;
2193
- };
2194
-
2195
- var DESCRIPTORS$3 = descriptors;
2196
- var definePropertyModule$3 = objectDefineProperty;
2197
- var createPropertyDescriptor = createPropertyDescriptor$2;
2198
-
2199
- var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
2200
- return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
2201
- } : function (object, key, value) {
2202
- object[key] = value;
2203
- return object;
2204
- };
2205
-
2206
- var makeBuiltIn$2 = {exports: {}};
2207
-
2208
- var DESCRIPTORS$2 = descriptors;
2209
- var hasOwn$4 = hasOwnProperty_1;
2210
-
2211
- var FunctionPrototype = Function.prototype;
2212
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2213
- var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
2214
-
2215
- var EXISTS = hasOwn$4(FunctionPrototype, 'name');
2216
- // additional protection from minified / mangled / dropped function names
2217
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
2218
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
2219
-
2220
- var functionName = {
2221
- EXISTS: EXISTS,
2222
- PROPER: PROPER,
2223
- CONFIGURABLE: CONFIGURABLE
2224
- };
2225
-
2226
- var uncurryThis$5 = functionUncurryThis;
2227
- var isCallable$6 = isCallable$c;
2228
- var store$1 = sharedStore;
2229
-
2230
- var functionToString = uncurryThis$5(Function.toString);
2231
-
2232
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
2233
- if (!isCallable$6(store$1.inspectSource)) {
2234
- store$1.inspectSource = function (it) {
2235
- return functionToString(it);
2236
- };
2237
- }
2238
-
2239
- var inspectSource$2 = store$1.inspectSource;
2240
-
2241
- var global$3 = global$a;
2242
- var isCallable$5 = isCallable$c;
2243
-
2244
- var WeakMap$1 = global$3.WeakMap;
2245
-
2246
- var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
2247
-
2248
- var shared$1 = shared$3.exports;
2249
- var uid = uid$2;
2250
-
2251
- var keys = shared$1('keys');
2252
-
2253
- var sharedKey$2 = function (key) {
2254
- return keys[key] || (keys[key] = uid(key));
2255
- };
2256
-
2257
- var hiddenKeys$4 = {};
2258
-
2259
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
2260
- var global$2 = global$a;
2261
- var isObject$1 = isObject$6;
2262
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
2263
- var hasOwn$3 = hasOwnProperty_1;
2264
- var shared = sharedStore;
2265
- var sharedKey$1 = sharedKey$2;
2266
- var hiddenKeys$3 = hiddenKeys$4;
2267
-
2268
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
2269
- var TypeError$1 = global$2.TypeError;
2270
- var WeakMap = global$2.WeakMap;
2271
- var set, get, has;
2272
-
2273
- var enforce = function (it) {
2274
- return has(it) ? get(it) : set(it, {});
2275
- };
2276
-
2277
- var getterFor = function (TYPE) {
2278
- return function (it) {
2279
- var state;
2280
- if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
2281
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
2282
- } return state;
2283
- };
2284
- };
2285
-
2286
- if (NATIVE_WEAK_MAP || shared.state) {
2287
- var store = shared.state || (shared.state = new WeakMap());
2288
- /* eslint-disable no-self-assign -- prototype methods protection */
2289
- store.get = store.get;
2290
- store.has = store.has;
2291
- store.set = store.set;
2292
- /* eslint-enable no-self-assign -- prototype methods protection */
2293
- set = function (it, metadata) {
2294
- if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
2295
- metadata.facade = it;
2296
- store.set(it, metadata);
2297
- return metadata;
2298
- };
2299
- get = function (it) {
2300
- return store.get(it) || {};
2301
- };
2302
- has = function (it) {
2303
- return store.has(it);
2304
- };
2305
- } else {
2306
- var STATE = sharedKey$1('state');
2307
- hiddenKeys$3[STATE] = true;
2308
- set = function (it, metadata) {
2309
- if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
2310
- metadata.facade = it;
2311
- createNonEnumerableProperty$1(it, STATE, metadata);
2312
- return metadata;
2313
- };
2314
- get = function (it) {
2315
- return hasOwn$3(it, STATE) ? it[STATE] : {};
2316
- };
2317
- has = function (it) {
2318
- return hasOwn$3(it, STATE);
2319
- };
2320
- }
2321
-
2322
- var internalState = {
2323
- set: set,
2324
- get: get,
2325
- has: has,
2326
- enforce: enforce,
2327
- getterFor: getterFor
2328
- };
2329
-
2330
- var fails$2 = fails$9;
2331
- var isCallable$4 = isCallable$c;
2332
- var hasOwn$2 = hasOwnProperty_1;
2333
- var DESCRIPTORS$1 = descriptors;
2334
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
2335
- var inspectSource$1 = inspectSource$2;
2336
- var InternalStateModule = internalState;
2337
-
2338
- var enforceInternalState = InternalStateModule.enforce;
2339
- var getInternalState = InternalStateModule.get;
2340
- // eslint-disable-next-line es/no-object-defineproperty -- safe
2341
- var defineProperty$1 = Object.defineProperty;
2342
-
2343
- var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
2344
- return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
2345
- });
2346
-
2347
- var TEMPLATE = String(String).split('String');
2348
-
2349
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
2350
- if (String(name).slice(0, 7) === 'Symbol(') {
2351
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
2352
- }
2353
- if (options && options.getter) name = 'get ' + name;
2354
- if (options && options.setter) name = 'set ' + name;
2355
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
2356
- if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
2357
- else value.name = name;
2358
- }
2359
- if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
2360
- defineProperty$1(value, 'length', { value: options.arity });
2361
- }
2362
- try {
2363
- if (options && hasOwn$2(options, 'constructor') && options.constructor) {
2364
- if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
2365
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
2366
- } else if (value.prototype) value.prototype = undefined;
2367
- } catch (error) { /* empty */ }
2368
- var state = enforceInternalState(value);
2369
- if (!hasOwn$2(state, 'source')) {
2370
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
2371
- } return value;
2372
- };
2373
-
2374
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
2375
- // eslint-disable-next-line no-extend-native -- required
2376
- Function.prototype.toString = makeBuiltIn$1(function toString() {
2377
- return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
2378
- }, 'toString');
2379
-
2380
- var isCallable$3 = isCallable$c;
2381
- var definePropertyModule$2 = objectDefineProperty;
2382
- var makeBuiltIn = makeBuiltIn$2.exports;
2383
- var defineGlobalProperty$1 = defineGlobalProperty$3;
2384
-
2385
- var defineBuiltIn$1 = function (O, key, value, options) {
2386
- if (!options) options = {};
2387
- var simple = options.enumerable;
2388
- var name = options.name !== undefined ? options.name : key;
2389
- if (isCallable$3(value)) makeBuiltIn(value, name, options);
2390
- if (options.global) {
2391
- if (simple) O[key] = value;
2392
- else defineGlobalProperty$1(key, value);
2393
- } else {
2394
- try {
2395
- if (!options.unsafe) delete O[key];
2396
- else if (O[key]) simple = true;
2397
- } catch (error) { /* empty */ }
2398
- if (simple) O[key] = value;
2399
- else definePropertyModule$2.f(O, key, {
2400
- value: value,
2401
- enumerable: false,
2402
- configurable: !options.nonConfigurable,
2403
- writable: !options.nonWritable
2404
- });
2405
- } return O;
2406
- };
2407
-
2408
- var objectGetOwnPropertyNames = {};
2409
-
2410
- var ceil = Math.ceil;
2411
- var floor = Math.floor;
2412
-
2413
- // `Math.trunc` method
2414
- // https://tc39.es/ecma262/#sec-math.trunc
2415
- // eslint-disable-next-line es/no-math-trunc -- safe
2416
- var mathTrunc = Math.trunc || function trunc(x) {
2417
- var n = +x;
2418
- return (n > 0 ? floor : ceil)(n);
2419
- };
2420
-
2421
- var trunc = mathTrunc;
2422
-
2423
- // `ToIntegerOrInfinity` abstract operation
2424
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
2425
- var toIntegerOrInfinity$2 = function (argument) {
2426
- var number = +argument;
2427
- // eslint-disable-next-line no-self-compare -- NaN check
2428
- return number !== number || number === 0 ? 0 : trunc(number);
2429
- };
2430
-
2431
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
2432
-
2433
- var max = Math.max;
2434
- var min$1 = Math.min;
2435
-
2436
- // Helper for a popular repeating case of the spec:
2437
- // Let integer be ? ToInteger(index).
2438
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
2439
- var toAbsoluteIndex$1 = function (index, length) {
2440
- var integer = toIntegerOrInfinity$1(index);
2441
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
2442
- };
2443
-
2444
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
2445
-
2446
- var min = Math.min;
2447
-
2448
- // `ToLength` abstract operation
2449
- // https://tc39.es/ecma262/#sec-tolength
2450
- var toLength$1 = function (argument) {
2451
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
2452
- };
2453
-
2454
- var toLength = toLength$1;
2455
-
2456
- // `LengthOfArrayLike` abstract operation
2457
- // https://tc39.es/ecma262/#sec-lengthofarraylike
2458
- var lengthOfArrayLike$2 = function (obj) {
2459
- return toLength(obj.length);
2460
- };
2461
-
2462
- var toIndexedObject$2 = toIndexedObject$4;
2463
- var toAbsoluteIndex = toAbsoluteIndex$1;
2464
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
2465
-
2466
- // `Array.prototype.{ indexOf, includes }` methods implementation
2467
- var createMethod$1 = function (IS_INCLUDES) {
2468
- return function ($this, el, fromIndex) {
2469
- var O = toIndexedObject$2($this);
2470
- var length = lengthOfArrayLike$1(O);
2471
- var index = toAbsoluteIndex(fromIndex, length);
2472
- var value;
2473
- // Array#includes uses SameValueZero equality algorithm
2474
- // eslint-disable-next-line no-self-compare -- NaN check
2475
- if (IS_INCLUDES && el != el) while (length > index) {
2476
- value = O[index++];
2477
- // eslint-disable-next-line no-self-compare -- NaN check
2478
- if (value != value) return true;
2479
- // Array#indexOf ignores holes, Array#includes - not
2480
- } else for (;length > index; index++) {
2481
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
2482
- } return !IS_INCLUDES && -1;
2483
- };
2484
- };
2485
-
2486
- var arrayIncludes = {
2487
- // `Array.prototype.includes` method
2488
- // https://tc39.es/ecma262/#sec-array.prototype.includes
2489
- includes: createMethod$1(true),
2490
- // `Array.prototype.indexOf` method
2491
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
2492
- indexOf: createMethod$1(false)
2493
- };
2494
-
2495
- var uncurryThis$4 = functionUncurryThis;
2496
- var hasOwn$1 = hasOwnProperty_1;
2497
- var toIndexedObject$1 = toIndexedObject$4;
2498
- var indexOf = arrayIncludes.indexOf;
2499
- var hiddenKeys$2 = hiddenKeys$4;
2500
-
2501
- var push$1 = uncurryThis$4([].push);
2502
-
2503
- var objectKeysInternal = function (object, names) {
2504
- var O = toIndexedObject$1(object);
2505
- var i = 0;
2506
- var result = [];
2507
- var key;
2508
- for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
2509
- // Don't enum bug & hidden keys
2510
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
2511
- ~indexOf(result, key) || push$1(result, key);
2512
- }
2513
- return result;
2514
- };
2515
-
2516
- // IE8- don't enum bug keys
2517
- var enumBugKeys$3 = [
2518
- 'constructor',
2519
- 'hasOwnProperty',
2520
- 'isPrototypeOf',
2521
- 'propertyIsEnumerable',
2522
- 'toLocaleString',
2523
- 'toString',
2524
- 'valueOf'
2525
- ];
2526
-
2527
- var internalObjectKeys$1 = objectKeysInternal;
2528
- var enumBugKeys$2 = enumBugKeys$3;
2529
-
2530
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
2531
-
2532
- // `Object.getOwnPropertyNames` method
2533
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
2534
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
2535
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
2536
- return internalObjectKeys$1(O, hiddenKeys$1);
2537
- };
2538
-
2539
- var objectGetOwnPropertySymbols = {};
2540
-
2541
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
2542
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
2543
-
2544
- var getBuiltIn$2 = getBuiltIn$5;
2545
- var uncurryThis$3 = functionUncurryThis;
2546
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
2547
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2548
- var anObject$2 = anObject$4;
2549
-
2550
- var concat = uncurryThis$3([].concat);
2551
-
2552
- // all object keys, includes non-enumerable and symbols
2553
- var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
2554
- var keys = getOwnPropertyNamesModule.f(anObject$2(it));
2555
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2556
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
2557
- };
2558
-
2559
- var hasOwn = hasOwnProperty_1;
2560
- var ownKeys = ownKeys$1;
2561
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
2562
- var definePropertyModule$1 = objectDefineProperty;
2563
-
2564
- var copyConstructorProperties$1 = function (target, source, exceptions) {
2565
- var keys = ownKeys(source);
2566
- var defineProperty = definePropertyModule$1.f;
2567
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
2568
- for (var i = 0; i < keys.length; i++) {
2569
- var key = keys[i];
2570
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
2571
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
2572
- }
2573
- }
2574
- };
2575
-
2576
- var fails$1 = fails$9;
2577
- var isCallable$2 = isCallable$c;
2578
-
2579
- var replacement = /#|\.prototype\./;
2580
-
2581
- var isForced$1 = function (feature, detection) {
2582
- var value = data[normalize(feature)];
2583
- return value == POLYFILL ? true
2584
- : value == NATIVE ? false
2585
- : isCallable$2(detection) ? fails$1(detection)
2586
- : !!detection;
2587
- };
2588
-
2589
- var normalize = isForced$1.normalize = function (string) {
2590
- return String(string).replace(replacement, '.').toLowerCase();
2591
- };
2592
-
2593
- var data = isForced$1.data = {};
2594
- var NATIVE = isForced$1.NATIVE = 'N';
2595
- var POLYFILL = isForced$1.POLYFILL = 'P';
2596
-
2597
- var isForced_1 = isForced$1;
2598
-
2599
- var global$1 = global$a;
2600
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
2601
- var createNonEnumerableProperty = createNonEnumerableProperty$2;
2602
- var defineBuiltIn = defineBuiltIn$1;
2603
- var defineGlobalProperty = defineGlobalProperty$3;
2604
- var copyConstructorProperties = copyConstructorProperties$1;
2605
- var isForced = isForced_1;
2606
-
2607
- /*
2608
- options.target - name of the target object
2609
- options.global - target is the global object
2610
- options.stat - export as static methods of target
2611
- options.proto - export as prototype methods of target
2612
- options.real - real prototype method for the `pure` version
2613
- options.forced - export even if the native feature is available
2614
- options.bind - bind methods to the target, required for the `pure` version
2615
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
2616
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
2617
- options.sham - add a flag to not completely full polyfills
2618
- options.enumerable - export as enumerable property
2619
- options.dontCallGetSet - prevent calling a getter on target
2620
- options.name - the .name of the function if it does not match the key
2621
- */
2622
- var _export = function (options, source) {
2623
- var TARGET = options.target;
2624
- var GLOBAL = options.global;
2625
- var STATIC = options.stat;
2626
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
2627
- if (GLOBAL) {
2628
- target = global$1;
2629
- } else if (STATIC) {
2630
- target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
2631
- } else {
2632
- target = (global$1[TARGET] || {}).prototype;
2633
- }
2634
- if (target) for (key in source) {
2635
- sourceProperty = source[key];
2636
- if (options.dontCallGetSet) {
2637
- descriptor = getOwnPropertyDescriptor(target, key);
2638
- targetProperty = descriptor && descriptor.value;
2639
- } else targetProperty = target[key];
2640
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
2641
- // contained in target
2642
- if (!FORCED && targetProperty !== undefined) {
2643
- if (typeof sourceProperty == typeof targetProperty) continue;
2644
- copyConstructorProperties(sourceProperty, targetProperty);
2645
- }
2646
- // add a flag to not completely full polyfills
2647
- if (options.sham || (targetProperty && targetProperty.sham)) {
2648
- createNonEnumerableProperty(sourceProperty, 'sham', true);
2649
- }
2650
- defineBuiltIn(target, key, sourceProperty, options);
2651
- }
2652
- };
2653
-
2654
- var uncurryThis$2 = functionUncurryThis;
2655
- var aCallable = aCallable$2;
2656
- var NATIVE_BIND = functionBindNative;
2657
-
2658
- var bind$1 = uncurryThis$2(uncurryThis$2.bind);
2659
-
2660
- // optional / simple context binding
2661
- var functionBindContext = function (fn, that) {
2662
- aCallable(fn);
2663
- return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
2664
- return fn.apply(that, arguments);
2665
- };
2666
- };
2667
-
2668
- var classof$2 = classofRaw$2;
2669
-
2670
- // `IsArray` abstract operation
2671
- // https://tc39.es/ecma262/#sec-isarray
2672
- // eslint-disable-next-line es/no-array-isarray -- safe
2673
- var isArray$1 = Array.isArray || function isArray(argument) {
2674
- return classof$2(argument) == 'Array';
2675
- };
2676
-
2677
- var wellKnownSymbol$3 = wellKnownSymbol$5;
2678
-
2679
- var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
2680
- var test = {};
2681
-
2682
- test[TO_STRING_TAG$1] = 'z';
2683
-
2684
- var toStringTagSupport = String(test) === '[object z]';
2685
-
2686
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2687
- var isCallable$1 = isCallable$c;
2688
- var classofRaw = classofRaw$2;
2689
- var wellKnownSymbol$2 = wellKnownSymbol$5;
2690
-
2691
- var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
2692
- var $Object = Object;
2693
-
2694
- // ES3 wrong here
2695
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2696
-
2697
- // fallback for IE11 Script Access Denied error
2698
- var tryGet = function (it, key) {
2699
- try {
2700
- return it[key];
2701
- } catch (error) { /* empty */ }
2702
- };
2703
-
2704
- // getting tag from ES6+ `Object.prototype.toString`
2705
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2706
- var O, tag, result;
2707
- return it === undefined ? 'Undefined' : it === null ? 'Null'
2708
- // @@toStringTag case
2709
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2710
- // builtinTag case
2711
- : CORRECT_ARGUMENTS ? classofRaw(O)
2712
- // ES3 arguments fallback
2713
- : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2714
- };
2715
-
2716
- var uncurryThis$1 = functionUncurryThis;
2717
- var fails = fails$9;
2718
- var isCallable = isCallable$c;
2719
- var classof = classof$1;
2720
- var getBuiltIn$1 = getBuiltIn$5;
2721
- var inspectSource = inspectSource$2;
2722
-
2723
- var noop = function () { /* empty */ };
2724
- var empty = [];
2725
- var construct = getBuiltIn$1('Reflect', 'construct');
2726
- var constructorRegExp = /^\s*(?:class|function)\b/;
2727
- var exec = uncurryThis$1(constructorRegExp.exec);
2728
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
2729
-
2730
- var isConstructorModern = function isConstructor(argument) {
2731
- if (!isCallable(argument)) return false;
2732
- try {
2733
- construct(noop, empty, argument);
2734
- return true;
2735
- } catch (error) {
2736
- return false;
2737
- }
2738
- };
2739
-
2740
- var isConstructorLegacy = function isConstructor(argument) {
2741
- if (!isCallable(argument)) return false;
2742
- switch (classof(argument)) {
2743
- case 'AsyncFunction':
2744
- case 'GeneratorFunction':
2745
- case 'AsyncGeneratorFunction': return false;
2746
- }
2747
- try {
2748
- // we can't check .prototype since constructors produced by .bind haven't it
2749
- // `Function#toString` throws on some built-it function in some legacy engines
2750
- // (for example, `DOMQuad` and similar in FF41-)
2751
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
2752
- } catch (error) {
2753
- return true;
2754
- }
2755
- };
2756
-
2757
- isConstructorLegacy.sham = true;
2758
-
2759
- // `IsConstructor` abstract operation
2760
- // https://tc39.es/ecma262/#sec-isconstructor
2761
- var isConstructor$1 = !construct || fails(function () {
2762
- var called;
2763
- return isConstructorModern(isConstructorModern.call)
2764
- || !isConstructorModern(Object)
2765
- || !isConstructorModern(function () { called = true; })
2766
- || called;
2767
- }) ? isConstructorLegacy : isConstructorModern;
2768
-
2769
- var isArray = isArray$1;
2770
- var isConstructor = isConstructor$1;
2771
- var isObject = isObject$6;
2772
- var wellKnownSymbol$1 = wellKnownSymbol$5;
2773
-
2774
- var SPECIES = wellKnownSymbol$1('species');
2775
- var $Array = Array;
2776
-
2777
- // a part of `ArraySpeciesCreate` abstract operation
2778
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
2779
- var arraySpeciesConstructor$1 = function (originalArray) {
2780
- var C;
2781
- if (isArray(originalArray)) {
2782
- C = originalArray.constructor;
2783
- // cross-realm fallback
2784
- if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
2785
- else if (isObject(C)) {
2786
- C = C[SPECIES];
2787
- if (C === null) C = undefined;
2788
- }
2789
- } return C === undefined ? $Array : C;
2790
- };
2791
-
2792
- var arraySpeciesConstructor = arraySpeciesConstructor$1;
2793
-
2794
- // `ArraySpeciesCreate` abstract operation
2795
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
2796
- var arraySpeciesCreate$1 = function (originalArray, length) {
2797
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
2798
- };
2799
-
2800
- var bind = functionBindContext;
2801
- var uncurryThis = functionUncurryThis;
2802
- var IndexedObject = indexedObject;
2803
- var toObject = toObject$2;
2804
- var lengthOfArrayLike = lengthOfArrayLike$2;
2805
- var arraySpeciesCreate = arraySpeciesCreate$1;
2806
-
2807
- var push = uncurryThis([].push);
2808
-
2809
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
2810
- var createMethod = function (TYPE) {
2811
- var IS_MAP = TYPE == 1;
2812
- var IS_FILTER = TYPE == 2;
2813
- var IS_SOME = TYPE == 3;
2814
- var IS_EVERY = TYPE == 4;
2815
- var IS_FIND_INDEX = TYPE == 6;
2816
- var IS_FILTER_REJECT = TYPE == 7;
2817
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
2818
- return function ($this, callbackfn, that, specificCreate) {
2819
- var O = toObject($this);
2820
- var self = IndexedObject(O);
2821
- var boundFunction = bind(callbackfn, that);
2822
- var length = lengthOfArrayLike(self);
2823
- var index = 0;
2824
- var create = specificCreate || arraySpeciesCreate;
2825
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
2826
- var value, result;
2827
- for (;length > index; index++) if (NO_HOLES || index in self) {
2828
- value = self[index];
2829
- result = boundFunction(value, index, O);
2830
- if (TYPE) {
2831
- if (IS_MAP) target[index] = result; // map
2832
- else if (result) switch (TYPE) {
2833
- case 3: return true; // some
2834
- case 5: return value; // find
2835
- case 6: return index; // findIndex
2836
- case 2: push(target, value); // filter
2837
- } else switch (TYPE) {
2838
- case 4: return false; // every
2839
- case 7: push(target, value); // filterReject
2840
- }
2841
- }
2842
- }
2843
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
2844
- };
2845
- };
2846
-
2847
- var arrayIteration = {
2848
- // `Array.prototype.forEach` method
2849
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
2850
- forEach: createMethod(0),
2851
- // `Array.prototype.map` method
2852
- // https://tc39.es/ecma262/#sec-array.prototype.map
2853
- map: createMethod(1),
2854
- // `Array.prototype.filter` method
2855
- // https://tc39.es/ecma262/#sec-array.prototype.filter
2856
- filter: createMethod(2),
2857
- // `Array.prototype.some` method
2858
- // https://tc39.es/ecma262/#sec-array.prototype.some
2859
- some: createMethod(3),
2860
- // `Array.prototype.every` method
2861
- // https://tc39.es/ecma262/#sec-array.prototype.every
2862
- every: createMethod(4),
2863
- // `Array.prototype.find` method
2864
- // https://tc39.es/ecma262/#sec-array.prototype.find
2865
- find: createMethod(5),
2866
- // `Array.prototype.findIndex` method
2867
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
2868
- findIndex: createMethod(6),
2869
- // `Array.prototype.filterReject` method
2870
- // https://github.com/tc39/proposal-array-filtering
2871
- filterReject: createMethod(7)
2872
- };
2873
-
2874
- var objectDefineProperties = {};
2875
-
2876
- var internalObjectKeys = objectKeysInternal;
2877
- var enumBugKeys$1 = enumBugKeys$3;
2878
-
2879
- // `Object.keys` method
2880
- // https://tc39.es/ecma262/#sec-object.keys
2881
- // eslint-disable-next-line es/no-object-keys -- safe
2882
- var objectKeys$1 = Object.keys || function keys(O) {
2883
- return internalObjectKeys(O, enumBugKeys$1);
2884
- };
2885
-
2886
- var DESCRIPTORS = descriptors;
2887
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
2888
- var definePropertyModule = objectDefineProperty;
2889
- var anObject$1 = anObject$4;
2890
- var toIndexedObject = toIndexedObject$4;
2891
- var objectKeys = objectKeys$1;
2892
-
2893
- // `Object.defineProperties` method
2894
- // https://tc39.es/ecma262/#sec-object.defineproperties
2895
- // eslint-disable-next-line es/no-object-defineproperties -- safe
2896
- objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
2897
- anObject$1(O);
2898
- var props = toIndexedObject(Properties);
2899
- var keys = objectKeys(Properties);
2900
- var length = keys.length;
2901
- var index = 0;
2902
- var key;
2903
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
2904
- return O;
2905
- };
2906
-
2907
- var getBuiltIn = getBuiltIn$5;
2908
-
2909
- var html$1 = getBuiltIn('document', 'documentElement');
2910
-
2911
- /* global ActiveXObject -- old IE, WSH */
2912
-
2913
- var anObject = anObject$4;
2914
- var definePropertiesModule = objectDefineProperties;
2915
- var enumBugKeys = enumBugKeys$3;
2916
- var hiddenKeys = hiddenKeys$4;
2917
- var html = html$1;
2918
- var documentCreateElement = documentCreateElement$1;
2919
- var sharedKey = sharedKey$2;
2920
-
2921
- var GT = '>';
2922
- var LT = '<';
2923
- var PROTOTYPE = 'prototype';
2924
- var SCRIPT = 'script';
2925
- var IE_PROTO = sharedKey('IE_PROTO');
2926
-
2927
- var EmptyConstructor = function () { /* empty */ };
2928
-
2929
- var scriptTag = function (content) {
2930
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2931
- };
2932
-
2933
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2934
- var NullProtoObjectViaActiveX = function (activeXDocument) {
2935
- activeXDocument.write(scriptTag(''));
2936
- activeXDocument.close();
2937
- var temp = activeXDocument.parentWindow.Object;
2938
- activeXDocument = null; // avoid memory leak
2939
- return temp;
2940
- };
2941
-
2942
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
2943
- var NullProtoObjectViaIFrame = function () {
2944
- // Thrash, waste and sodomy: IE GC bug
2945
- var iframe = documentCreateElement('iframe');
2946
- var JS = 'java' + SCRIPT + ':';
2947
- var iframeDocument;
2948
- iframe.style.display = 'none';
2949
- html.appendChild(iframe);
2950
- // https://github.com/zloirock/core-js/issues/475
2951
- iframe.src = String(JS);
2952
- iframeDocument = iframe.contentWindow.document;
2953
- iframeDocument.open();
2954
- iframeDocument.write(scriptTag('document.F=Object'));
2955
- iframeDocument.close();
2956
- return iframeDocument.F;
2957
- };
2958
-
2959
- // Check for document.domain and active x support
2960
- // No need to use active x approach when document.domain is not set
2961
- // see https://github.com/es-shims/es5-shim/issues/150
2962
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2963
- // avoid IE GC bug
2964
- var activeXDocument;
2965
- var NullProtoObject = function () {
2966
- try {
2967
- activeXDocument = new ActiveXObject('htmlfile');
2968
- } catch (error) { /* ignore */ }
2969
- NullProtoObject = typeof document != 'undefined'
2970
- ? document.domain && activeXDocument
2971
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2972
- : NullProtoObjectViaIFrame()
2973
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
2974
- var length = enumBugKeys.length;
2975
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2976
- return NullProtoObject();
2977
- };
2978
-
2979
- hiddenKeys[IE_PROTO] = true;
2980
-
2981
- // `Object.create` method
2982
- // https://tc39.es/ecma262/#sec-object.create
2983
- // eslint-disable-next-line es/no-object-create -- safe
2984
- var objectCreate = Object.create || function create(O, Properties) {
2985
- var result;
2986
- if (O !== null) {
2987
- EmptyConstructor[PROTOTYPE] = anObject(O);
2988
- result = new EmptyConstructor();
2989
- EmptyConstructor[PROTOTYPE] = null;
2990
- // add "__proto__" for Object.getPrototypeOf polyfill
2991
- result[IE_PROTO] = O;
2992
- } else result = NullProtoObject();
2993
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2994
- };
2995
-
2996
- var wellKnownSymbol = wellKnownSymbol$5;
2997
- var create = objectCreate;
2998
- var defineProperty = objectDefineProperty.f;
2999
-
3000
- var UNSCOPABLES = wellKnownSymbol('unscopables');
3001
- var ArrayPrototype = Array.prototype;
3002
-
3003
- // Array.prototype[@@unscopables]
3004
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3005
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
3006
- defineProperty(ArrayPrototype, UNSCOPABLES, {
3007
- configurable: true,
3008
- value: create(null)
3009
- });
3010
- }
3011
-
3012
- // add a key to Array.prototype[@@unscopables]
3013
- var addToUnscopables$1 = function (key) {
3014
- ArrayPrototype[UNSCOPABLES][key] = true;
3015
- };
3016
-
3017
- var $ = _export;
3018
- var $find = arrayIteration.find;
3019
- var addToUnscopables = addToUnscopables$1;
3020
-
3021
- var FIND = 'find';
3022
- var SKIPS_HOLES = true;
3023
-
3024
- // Shouldn't skip holes
3025
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
3026
-
3027
- // `Array.prototype.find` method
3028
- // https://tc39.es/ecma262/#sec-array.prototype.find
3029
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
3030
- find: function find(callbackfn /* , that = undefined */) {
3031
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3032
- }
3033
- });
3034
-
3035
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3036
- addToUnscopables(FIND);
3037
-
3038
- var CONSTANT = {
3039
- GLOBAL: {
3040
- HIDE: '__react_tooltip_hide_event',
3041
- REBUILD: '__react_tooltip_rebuild_event',
3042
- SHOW: '__react_tooltip_show_event'
3043
- }
3044
- };
3045
-
3046
- /**
3047
- * Static methods for react-tooltip
3048
- */
3049
- var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
3050
- // Compatible with IE
3051
- // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
3052
- // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
3053
- var event;
3054
- if (typeof window.CustomEvent === 'function') {
3055
- event = new window.CustomEvent(eventName, {
3056
- detail: opts
3057
- });
3058
- } else {
3059
- event = document.createEvent('Event');
3060
- event.initEvent(eventName, false, true, opts);
3061
- }
3062
- window.dispatchEvent(event);
3063
- };
3064
- function staticMethods (target) {
3065
- /**
3066
- * Hide all tooltip
3067
- * @trigger ReactTooltip.hide()
3068
- */
3069
- target.hide = function (target) {
3070
- dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
3071
- target: target
3072
- });
3073
- };
3074
-
3075
- /**
3076
- * Rebuild all tooltip
3077
- * @trigger ReactTooltip.rebuild()
3078
- */
3079
- target.rebuild = function () {
3080
- dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
3081
- };
3082
-
3083
- /**
3084
- * Show specific tooltip
3085
- * @trigger ReactTooltip.show()
3086
- */
3087
- target.show = function (target) {
3088
- dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
3089
- target: target
3090
- });
3091
- };
3092
- target.prototype.globalRebuild = function () {
3093
- if (this.mount) {
3094
- this.unbindListener();
3095
- this.bindListener();
3096
- }
3097
- };
3098
- target.prototype.globalShow = function (event) {
3099
- if (this.mount) {
3100
- var hasTarget = event && event.detail && event.detail.target && true || false;
3101
- // Create a fake event, specific show will limit the type to `solid`
3102
- // only `float` type cares e.clientX e.clientY
3103
- this.showTooltip({
3104
- currentTarget: hasTarget && event.detail.target
3105
- }, true);
3106
- }
3107
- };
3108
- target.prototype.globalHide = function (event) {
3109
- if (this.mount) {
3110
- var hasTarget = event && event.detail && event.detail.target && true || false;
3111
- this.hideTooltip({
3112
- currentTarget: hasTarget && event.detail.target
3113
- }, hasTarget);
3114
- }
3115
- };
3116
- }
3117
-
3118
- /**
3119
- * Events that should be bound to the window
3120
- */
3121
- function windowListener (target) {
3122
- target.prototype.bindWindowEvents = function (resizeHide) {
3123
- // ReactTooltip.hide
3124
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
3125
- window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
3126
-
3127
- // ReactTooltip.rebuild
3128
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
3129
- window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
3130
-
3131
- // ReactTooltip.show
3132
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
3133
- window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
3134
-
3135
- // Resize
3136
- if (resizeHide) {
3137
- window.removeEventListener('resize', this.onWindowResize);
3138
- window.addEventListener('resize', this.onWindowResize, false);
3139
- }
3140
- };
3141
- target.prototype.unbindWindowEvents = function () {
3142
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
3143
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
3144
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
3145
- window.removeEventListener('resize', this.onWindowResize);
3146
- };
3147
-
3148
- /**
3149
- * invoked by resize event of window
3150
- */
3151
- target.prototype.onWindowResize = function () {
3152
- if (!this.mount) return;
3153
- this.hideTooltip();
3154
- };
3155
- }
3156
-
3157
- /**
3158
- * Custom events to control showing and hiding of tooltip
3159
- *
3160
- * @attributes
3161
- * - `event` {String}
3162
- * - `eventOff` {String}
3163
- */
3164
-
3165
- var checkStatus = function checkStatus(dataEventOff, e) {
3166
- var show = this.state.show;
3167
- var id = this.props.id;
3168
- var isCapture = this.isCapture(e.currentTarget);
3169
- var currentItem = e.currentTarget.getAttribute('currentItem');
3170
- if (!isCapture) e.stopPropagation();
3171
- if (show && currentItem === 'true') {
3172
- if (!dataEventOff) this.hideTooltip(e);
3173
- } else {
3174
- e.currentTarget.setAttribute('currentItem', 'true');
3175
- setUntargetItems(e.currentTarget, this.getTargetArray(id));
3176
- this.showTooltip(e);
3177
- }
3178
- };
3179
- var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
3180
- for (var i = 0; i < targetArray.length; i++) {
3181
- if (currentTarget !== targetArray[i]) {
3182
- targetArray[i].setAttribute('currentItem', 'false');
3183
- } else {
3184
- targetArray[i].setAttribute('currentItem', 'true');
3185
- }
3186
- }
3187
- };
3188
- var customListeners = {
3189
- id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
3190
- set: function set(target, event, listener) {
3191
- if (this.id in target) {
3192
- var map = target[this.id];
3193
- map[event] = listener;
3194
- } else {
3195
- // this is workaround for WeakMap, which is not supported in older browsers, such as IE
3196
- Object.defineProperty(target, this.id, {
3197
- configurable: true,
3198
- value: _defineProperty({}, event, listener)
3199
- });
3200
- }
3201
- },
3202
- get: function get(target, event) {
3203
- var map = target[this.id];
3204
- if (map !== undefined) {
3205
- return map[event];
3206
- }
3207
- }
3208
- };
3209
- function customEvent (target) {
3210
- target.prototype.isCustomEvent = function (ele) {
3211
- var event = this.state.event;
3212
- return event || !!ele.getAttribute('data-event');
3213
- };
3214
-
3215
- /* Bind listener for custom event */
3216
- target.prototype.customBindListener = function (ele) {
3217
- var _this = this;
3218
- var _this$state = this.state,
3219
- event = _this$state.event,
3220
- eventOff = _this$state.eventOff;
3221
- var dataEvent = ele.getAttribute('data-event') || event;
3222
- var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
3223
- dataEvent.split(' ').forEach(function (event) {
3224
- ele.removeEventListener(event, customListeners.get(ele, event));
3225
- var customListener = checkStatus.bind(_this, dataEventOff);
3226
- customListeners.set(ele, event, customListener);
3227
- ele.addEventListener(event, customListener, false);
3228
- });
3229
- if (dataEventOff) {
3230
- dataEventOff.split(' ').forEach(function (event) {
3231
- ele.removeEventListener(event, _this.hideTooltip);
3232
- ele.addEventListener(event, _this.hideTooltip, false);
3233
- });
3234
- }
3235
- };
3236
-
3237
- /* Unbind listener for custom event */
3238
- target.prototype.customUnbindListener = function (ele) {
3239
- var _this$state2 = this.state,
3240
- event = _this$state2.event,
3241
- eventOff = _this$state2.eventOff;
3242
- var dataEvent = event || ele.getAttribute('data-event');
3243
- var dataEventOff = eventOff || ele.getAttribute('data-event-off');
3244
- ele.removeEventListener(dataEvent, customListeners.get(ele, event));
3245
- if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
3246
- };
3247
- }
3248
-
3249
- /**
3250
- * Util method to judge if it should follow capture model
3251
- */
3252
-
3253
- function isCapture (target) {
3254
- target.prototype.isCapture = function (currentTarget) {
3255
- return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
3256
- };
3257
- }
3258
-
3259
- /**
3260
- * Util method to get effect
3261
- */
3262
-
3263
- function getEffect (target) {
3264
- target.prototype.getEffect = function (currentTarget) {
3265
- var dataEffect = currentTarget.getAttribute('data-effect');
3266
- return dataEffect || this.props.effect || 'float';
3267
- };
3268
- }
3269
-
3270
- /**
3271
- * Util method to get effect
3272
- */
3273
- var makeProxy = function makeProxy(e) {
3274
- var proxy = {};
3275
- for (var key in e) {
3276
- if (typeof e[key] === 'function') {
3277
- proxy[key] = e[key].bind(e);
3278
- } else {
3279
- proxy[key] = e[key];
3280
- }
3281
- }
3282
- return proxy;
3283
- };
3284
- var bodyListener = function bodyListener(callback, options, e) {
3285
- var _options$respectEffec = options.respectEffect,
3286
- respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
3287
- _options$customEvent = options.customEvent,
3288
- customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
3289
- var id = this.props.id;
3290
- var tip = null;
3291
- var forId;
3292
- var target = e.target;
3293
- var lastTarget;
3294
- // walk up parent chain until tip is found
3295
- // there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
3296
- while (tip === null && target !== null) {
3297
- lastTarget = target;
3298
- tip = target.getAttribute('data-tip') || null;
3299
- forId = target.getAttribute('data-for') || null;
3300
- target = target.parentElement;
3301
- }
3302
- target = lastTarget || e.target;
3303
- if (this.isCustomEvent(target) && !customEvent) {
3304
- return;
3305
- }
3306
- var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
3307
- if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
3308
- var proxy = makeProxy(e);
3309
- proxy.currentTarget = target;
3310
- callback(proxy);
3311
- }
3312
- };
3313
- var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
3314
- var events = {};
3315
- targetArray.forEach(function (target) {
3316
- var event = target.getAttribute(dataAttribute);
3317
- if (event) event.split(' ').forEach(function (event) {
3318
- return events[event] = true;
3319
- });
3320
- });
3321
- return events;
3322
- };
3323
- var getBody = function getBody() {
3324
- return document.getElementsByTagName('body')[0];
3325
- };
3326
- function bodyMode (target) {
3327
- target.prototype.isBodyMode = function () {
3328
- return !!this.props.bodyMode;
3329
- };
3330
- target.prototype.bindBodyListener = function (targetArray) {
3331
- var _this = this;
3332
- var _this$state = this.state,
3333
- event = _this$state.event,
3334
- eventOff = _this$state.eventOff,
3335
- possibleCustomEvents = _this$state.possibleCustomEvents,
3336
- possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
3337
- var body = getBody();
3338
- var customEvents = findCustomEvents(targetArray, 'data-event');
3339
- var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
3340
- if (event != null) customEvents[event] = true;
3341
- if (eventOff != null) customEventsOff[eventOff] = true;
3342
- possibleCustomEvents.split(' ').forEach(function (event) {
3343
- return customEvents[event] = true;
3344
- });
3345
- possibleCustomEventsOff.split(' ').forEach(function (event) {
3346
- return customEventsOff[event] = true;
3347
- });
3348
- this.unbindBodyListener(body);
3349
- var listeners = this.bodyModeListeners = {};
3350
- if (event == null) {
3351
- listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
3352
- listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
3353
- respectEffect: true
3354
- });
3355
- listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
3356
- }
3357
- for (var _event in customEvents) {
3358
- listeners[_event] = bodyListener.bind(this, function (e) {
3359
- var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
3360
- checkStatus.call(_this, targetEventOff, e);
3361
- }, {
3362
- customEvent: true
3363
- });
3364
- }
3365
- for (var _event2 in customEventsOff) {
3366
- listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
3367
- customEvent: true
3368
- });
3369
- }
3370
- for (var _event3 in listeners) {
3371
- body.addEventListener(_event3, listeners[_event3]);
3372
- }
3373
- };
3374
- target.prototype.unbindBodyListener = function (body) {
3375
- body = body || getBody();
3376
- var listeners = this.bodyModeListeners;
3377
- for (var event in listeners) {
3378
- body.removeEventListener(event, listeners[event]);
3379
- }
3380
- };
3381
- }
3382
-
3383
- /**
3384
- * Tracking target removing from DOM.
3385
- * It's necessary to hide tooltip when it's target disappears.
3386
- * Otherwise, the tooltip would be shown forever until another target
3387
- * is triggered.
3388
- *
3389
- * If MutationObserver is not available, this feature just doesn't work.
3390
- */
3391
-
3392
- // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
3393
- var getMutationObserverClass = function getMutationObserverClass() {
3394
- return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
3395
- };
3396
- function trackRemoval (target) {
3397
- target.prototype.bindRemovalTracker = function () {
3398
- var _this = this;
3399
- var MutationObserver = getMutationObserverClass();
3400
- if (MutationObserver == null) return;
3401
- var observer = new MutationObserver(function (mutations) {
3402
- for (var m1 = 0; m1 < mutations.length; m1++) {
3403
- var mutation = mutations[m1];
3404
- for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
3405
- var element = mutation.removedNodes[m2];
3406
- if (element === _this.state.currentTarget) {
3407
- _this.hideTooltip();
3408
- return;
3409
- }
3410
- }
3411
- }
3412
- });
3413
- observer.observe(window.document, {
3414
- childList: true,
3415
- subtree: true
3416
- });
3417
- this.removalTracker = observer;
3418
- };
3419
- target.prototype.unbindRemovalTracker = function () {
3420
- if (this.removalTracker) {
3421
- this.removalTracker.disconnect();
3422
- this.removalTracker = null;
3423
- }
3424
- };
3425
- }
3426
-
3427
- /**
3428
- * Calculate the position of tooltip
3429
- *
3430
- * @params
3431
- * - `e` {Event} the event of current mouse
3432
- * - `target` {Element} the currentTarget of the event
3433
- * - `node` {DOM} the react-tooltip object
3434
- * - `place` {String} top / right / bottom / left
3435
- * - `effect` {String} float / solid
3436
- * - `offset` {Object} the offset to default position
3437
- *
3438
- * @return {Object}
3439
- * - `isNewState` {Bool} required
3440
- * - `newState` {Object}
3441
- * - `position` {Object} {left: {Number}, top: {Number}}
3442
- */
3443
- function getPosition (e, target, node, place, desiredPlace, effect, offset) {
3444
- var _getDimensions = getDimensions(node),
3445
- tipWidth = _getDimensions.width,
3446
- tipHeight = _getDimensions.height;
3447
- var _getDimensions2 = getDimensions(target),
3448
- targetWidth = _getDimensions2.width,
3449
- targetHeight = _getDimensions2.height;
3450
- var _getCurrentOffset = getCurrentOffset(e, target, effect),
3451
- mouseX = _getCurrentOffset.mouseX,
3452
- mouseY = _getCurrentOffset.mouseY;
3453
- var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
3454
- var _calculateOffset = calculateOffset(offset),
3455
- extraOffsetX = _calculateOffset.extraOffsetX,
3456
- extraOffsetY = _calculateOffset.extraOffsetY;
3457
- var windowWidth = window.innerWidth;
3458
- var windowHeight = window.innerHeight;
3459
- var _getParent = getParent(node),
3460
- parentTop = _getParent.parentTop,
3461
- parentLeft = _getParent.parentLeft;
3462
-
3463
- // Get the edge offset of the tooltip
3464
- var getTipOffsetLeft = function getTipOffsetLeft(place) {
3465
- var offsetX = defaultOffset[place].l;
3466
- return mouseX + offsetX + extraOffsetX;
3467
- };
3468
- var getTipOffsetRight = function getTipOffsetRight(place) {
3469
- var offsetX = defaultOffset[place].r;
3470
- return mouseX + offsetX + extraOffsetX;
3471
- };
3472
- var getTipOffsetTop = function getTipOffsetTop(place) {
3473
- var offsetY = defaultOffset[place].t;
3474
- return mouseY + offsetY + extraOffsetY;
3475
- };
3476
- var getTipOffsetBottom = function getTipOffsetBottom(place) {
3477
- var offsetY = defaultOffset[place].b;
3478
- return mouseY + offsetY + extraOffsetY;
3479
- };
3480
-
3481
- //
3482
- // Functions to test whether the tooltip's sides are inside
3483
- // the client window for a given orientation p
3484
- //
3485
- // _____________
3486
- // | | <-- Right side
3487
- // | p = 'left' |\
3488
- // | |/ |\
3489
- // |_____________| |_\ <-- Mouse
3490
- // / \ |
3491
- // |
3492
- // |
3493
- // Bottom side
3494
- //
3495
- var outsideLeft = function outsideLeft(p) {
3496
- return getTipOffsetLeft(p) < 0;
3497
- };
3498
- var outsideRight = function outsideRight(p) {
3499
- return getTipOffsetRight(p) > windowWidth;
3500
- };
3501
- var outsideTop = function outsideTop(p) {
3502
- return getTipOffsetTop(p) < 0;
3503
- };
3504
- var outsideBottom = function outsideBottom(p) {
3505
- return getTipOffsetBottom(p) > windowHeight;
3506
- };
3507
-
3508
- // Check whether the tooltip with orientation p is completely inside the client window
3509
- var outside = function outside(p) {
3510
- return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
3511
- };
3512
- var inside = function inside(p) {
3513
- return !outside(p);
3514
- };
3515
- var placeIsInside = {
3516
- top: inside('top'),
3517
- bottom: inside('bottom'),
3518
- left: inside('left'),
3519
- right: inside('right')
3520
- };
3521
- function choose() {
3522
- var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
3523
- var _iterator = _createForOfIteratorHelper(allPlaces),
3524
- _step;
3525
- try {
3526
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
3527
- var d = _step.value;
3528
- if (placeIsInside[d]) return d;
3529
- }
3530
- // if nothing is inside, just use the old place.
3531
- } catch (err) {
3532
- _iterator.e(err);
3533
- } finally {
3534
- _iterator.f();
3535
- }
3536
- return place;
3537
- }
3538
- var chosen = choose();
3539
- var isNewState = false;
3540
- var newPlace;
3541
- if (chosen && chosen !== place) {
3542
- isNewState = true;
3543
- newPlace = chosen;
3544
- }
3545
- if (isNewState) {
3546
- return {
3547
- isNewState: true,
3548
- newState: {
3549
- place: newPlace
3550
- }
3551
- };
3552
- }
3553
- return {
3554
- isNewState: false,
3555
- position: {
3556
- left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
3557
- top: parseInt(getTipOffsetTop(place) - parentTop, 10)
3558
- }
3559
- };
3560
- }
3561
- var getDimensions = function getDimensions(node) {
3562
- var _node$getBoundingClie = node.getBoundingClientRect(),
3563
- height = _node$getBoundingClie.height,
3564
- width = _node$getBoundingClie.width;
3565
- return {
3566
- height: parseInt(height, 10),
3567
- width: parseInt(width, 10)
3568
- };
3569
- };
3570
-
3571
- // Get current mouse offset
3572
- var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
3573
- var boundingClientRect = currentTarget.getBoundingClientRect();
3574
- var targetTop = boundingClientRect.top;
3575
- var targetLeft = boundingClientRect.left;
3576
- var _getDimensions3 = getDimensions(currentTarget),
3577
- targetWidth = _getDimensions3.width,
3578
- targetHeight = _getDimensions3.height;
3579
- if (effect === 'float') {
3580
- return {
3581
- mouseX: e.clientX,
3582
- mouseY: e.clientY
3583
- };
3584
- }
3585
- return {
3586
- mouseX: targetLeft + targetWidth / 2,
3587
- mouseY: targetTop + targetHeight / 2
3588
- };
3589
- };
3590
-
3591
- // List all possibility of tooltip final offset
3592
- // This is useful in judging if it is necessary for tooltip to switch position when out of window
3593
- var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
3594
- var top;
3595
- var right;
3596
- var bottom;
3597
- var left;
3598
- var disToMouse = 3;
3599
- var triangleHeight = 2;
3600
- var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
3601
-
3602
- if (effect === 'float') {
3603
- top = {
3604
- l: -(tipWidth / 2),
3605
- r: tipWidth / 2,
3606
- t: -(tipHeight + disToMouse + triangleHeight),
3607
- b: -disToMouse
3608
- };
3609
- bottom = {
3610
- l: -(tipWidth / 2),
3611
- r: tipWidth / 2,
3612
- t: disToMouse + cursorHeight,
3613
- b: tipHeight + disToMouse + triangleHeight + cursorHeight
3614
- };
3615
- left = {
3616
- l: -(tipWidth + disToMouse + triangleHeight),
3617
- r: -disToMouse,
3618
- t: -(tipHeight / 2),
3619
- b: tipHeight / 2
3620
- };
3621
- right = {
3622
- l: disToMouse,
3623
- r: tipWidth + disToMouse + triangleHeight,
3624
- t: -(tipHeight / 2),
3625
- b: tipHeight / 2
3626
- };
3627
- } else if (effect === 'solid') {
3628
- top = {
3629
- l: -(tipWidth / 2),
3630
- r: tipWidth / 2,
3631
- t: -(targetHeight / 2 + tipHeight + triangleHeight),
3632
- b: -(targetHeight / 2)
3633
- };
3634
- bottom = {
3635
- l: -(tipWidth / 2),
3636
- r: tipWidth / 2,
3637
- t: targetHeight / 2,
3638
- b: targetHeight / 2 + tipHeight + triangleHeight
3639
- };
3640
- left = {
3641
- l: -(tipWidth + targetWidth / 2 + triangleHeight),
3642
- r: -(targetWidth / 2),
3643
- t: -(tipHeight / 2),
3644
- b: tipHeight / 2
3645
- };
3646
- right = {
3647
- l: targetWidth / 2,
3648
- r: tipWidth + targetWidth / 2 + triangleHeight,
3649
- t: -(tipHeight / 2),
3650
- b: tipHeight / 2
3651
- };
3652
- }
3653
- return {
3654
- top: top,
3655
- bottom: bottom,
3656
- left: left,
3657
- right: right
3658
- };
3659
- };
3660
-
3661
- // Consider additional offset into position calculation
3662
- var calculateOffset = function calculateOffset(offset) {
3663
- var extraOffsetX = 0;
3664
- var extraOffsetY = 0;
3665
- if (Object.prototype.toString.apply(offset) === '[object String]') {
3666
- offset = JSON.parse(offset.toString().replace(/'/g, '"'));
3667
- }
3668
- for (var key in offset) {
3669
- if (key === 'top') {
3670
- extraOffsetY -= parseInt(offset[key], 10);
3671
- } else if (key === 'bottom') {
3672
- extraOffsetY += parseInt(offset[key], 10);
3673
- } else if (key === 'left') {
3674
- extraOffsetX -= parseInt(offset[key], 10);
3675
- } else if (key === 'right') {
3676
- extraOffsetX += parseInt(offset[key], 10);
3677
- }
3678
- }
3679
- return {
3680
- extraOffsetX: extraOffsetX,
3681
- extraOffsetY: extraOffsetY
3682
- };
3683
- };
3684
-
3685
- // Get the offset of the parent elements
3686
- var getParent = function getParent(currentTarget) {
3687
- var currentParent = currentTarget;
3688
- while (currentParent) {
3689
- var computedStyle = window.getComputedStyle(currentParent);
3690
- // transform and will-change: transform change the containing block
3691
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
3692
- if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
3693
- currentParent = currentParent.parentElement;
3694
- }
3695
- var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
3696
- var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
3697
- return {
3698
- parentTop: parentTop,
3699
- parentLeft: parentLeft
3700
- };
3701
- };
3702
-
3703
- /**
3704
- * To get the tooltip content
3705
- * it may comes from data-tip or this.props.children
3706
- * it should support multiline
3707
- *
3708
- * @params
3709
- * - `tip` {String} value of data-tip
3710
- * - `children` {ReactElement} this.props.children
3711
- * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
3712
- *
3713
- * @return
3714
- * - String or react component
3715
- */
3716
- function TipContent(tip, children, getContent, multiline) {
3717
- if (children) return children;
3718
- if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
3719
- if (getContent === null) return null; // Tip not exist and children is null or undefined
3720
-
3721
- var regexp = /<br\s*\/?>/;
3722
- if (!multiline || multiline === 'false' || !regexp.test(tip)) {
3723
- // No trim(), so that user can keep their input
3724
- return tip;
3725
- }
3726
-
3727
- // Multiline tooltip content
3728
- return tip.split(regexp).map(function (d, i) {
3729
- return /*#__PURE__*/React.createElement("span", {
3730
- key: i,
3731
- className: "multi-line"
3732
- }, d);
3733
- });
3734
- }
3735
-
3736
- /**
3737
- * Support aria- and role in ReactTooltip
3738
- *
3739
- * @params props {Object}
3740
- * @return {Object}
3741
- */
3742
- function parseAria(props) {
3743
- var ariaObj = {};
3744
- Object.keys(props).filter(function (prop) {
3745
- // aria-xxx and role is acceptable
3746
- return /(^aria-\w+$|^role$)/.test(prop);
3747
- }).forEach(function (prop) {
3748
- ariaObj[prop] = props[prop];
3749
- });
3750
- return ariaObj;
3751
- }
3752
-
3753
- /**
3754
- * Convert nodelist to array
3755
- * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
3756
- * NodeLists are functions in Safari
3757
- */
3758
-
3759
- function nodeListToArray (nodeList) {
3760
- var length = nodeList.length;
3761
- if (nodeList.hasOwnProperty) {
3762
- return Array.prototype.slice.call(nodeList);
3763
- }
3764
- return new Array(length).fill().map(function (index) {
3765
- return nodeList[index];
3766
- });
3767
- }
3768
-
3769
- function generateUUID() {
3770
- return 't' + v4$1();
3771
- }
3772
-
3773
- var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: \"\";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n bottom: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-bottom::before {\n top: 0;\n left: 50%;\n margin-left: -11px;\n}\n.__react_component_tooltip.place-left::before {\n right: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip.place-right::before {\n left: 0;\n top: 50%;\n margin-top: -9px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
3774
-
3775
- /**
3776
- * Default pop-up style values (text color, background color).
3777
- */
3778
- var defaultColors = {
3779
- dark: {
3780
- text: '#fff',
3781
- background: '#222',
3782
- border: 'transparent',
3783
- arrow: '#222'
3784
- },
3785
- success: {
3786
- text: '#fff',
3787
- background: '#8DC572',
3788
- border: 'transparent',
3789
- arrow: '#8DC572'
3790
- },
3791
- warning: {
3792
- text: '#fff',
3793
- background: '#F0AD4E',
3794
- border: 'transparent',
3795
- arrow: '#F0AD4E'
3796
- },
3797
- error: {
3798
- text: '#fff',
3799
- background: '#BE6464',
3800
- border: 'transparent',
3801
- arrow: '#BE6464'
3802
- },
3803
- info: {
3804
- text: '#fff',
3805
- background: '#337AB7',
3806
- border: 'transparent',
3807
- arrow: '#337AB7'
3808
- },
3809
- light: {
3810
- text: '#222',
3811
- background: '#fff',
3812
- border: 'transparent',
3813
- arrow: '#fff'
3814
- }
3815
- };
3816
- function getDefaultPopupColors(type) {
3817
- return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
3818
- }
3819
- var DEFAULT_PADDING = '8px 21px';
3820
- var DEFAULT_RADIUS = {
3821
- tooltip: 3,
3822
- arrow: 0
3823
- };
3824
-
3825
- /**
3826
- * Generates the specific tooltip style for use on render.
3827
- */
3828
- function generateTooltipStyle(uuid, customColors, type, hasBorder, padding, radius) {
3829
- return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding, radius);
3830
- }
3831
-
3832
- /**
3833
- * Generates the tooltip style rules based on the element-specified "data-type" property.
3834
- */
3835
- function generateStyle(uuid, colors) {
3836
- var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
3837
- var radius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_RADIUS;
3838
- var textColor = colors.text;
3839
- var backgroundColor = colors.background;
3840
- var borderColor = colors.border;
3841
- var arrowColor = colors.arrow;
3842
- var arrowRadius = radius.arrow;
3843
- var tooltipRadius = radius.tooltip;
3844
- return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n\t border-radius: ").concat(tooltipRadius, "px;\n\t padding: ").concat(padding, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: 2;\n width: 20px;\n height: 12px;\n }\n .").concat(uuid, ".place-top::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n bottom: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(135deg);\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 18px;\n height: 10px;\n }\n .").concat(uuid, ".place-bottom::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n top: -6px;\n left: 50%;\n margin-left: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .").concat(uuid, ".place-left::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n right: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(45deg);\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n content: \"\";\n background-color: inherit;\n position: absolute;\n z-index: -1;\n width: 10px;\n height: 18px;\n }\n .").concat(uuid, ".place-right::after {\n content: \"\";\n position: absolute;\n width: 10px;\n height: 10px;\n border-top-right-radius: ").concat(arrowRadius, "px;\n border: 1px solid ").concat(borderColor, ";\n background-color: ").concat(arrowColor, ";\n z-index: -2;\n left: -6px;\n top: 50%;\n margin-top: -6px;\n transform: rotate(-135deg);\n }\n ");
3845
- }
3846
- function getPopupColors(customColors, type, hasBorder) {
3847
- var textColor = customColors.text;
3848
- var backgroundColor = customColors.background;
3849
- var borderColor = customColors.border;
3850
- var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
3851
- var colors = getDefaultPopupColors(type);
3852
- if (textColor) {
3853
- colors.text = textColor;
3854
- }
3855
- if (backgroundColor) {
3856
- colors.background = backgroundColor;
3857
- }
3858
- if (hasBorder) {
3859
- if (borderColor) {
3860
- colors.border = borderColor;
3861
- } else {
3862
- colors.border = type === 'light' ? 'black' : 'white';
3863
- }
3864
- }
3865
- if (arrowColor) {
3866
- colors.arrow = arrowColor;
3867
- }
3868
- return colors;
3869
- }
3870
-
3871
- var _class, _class2;
3872
-
3873
- /* Polyfill */
3874
- var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
3875
- _inherits(ReactTooltip, _React$Component);
3876
- var _super = _createSuper(ReactTooltip);
3877
- function ReactTooltip(props) {
3878
- var _this;
3879
- _classCallCheck(this, ReactTooltip);
3880
- _this = _super.call(this, props);
3881
- _this.state = {
3882
- uuid: props.uuid || generateUUID(),
3883
- place: props.place || 'top',
3884
- // Direction of tooltip
3885
- desiredPlace: props.place || 'top',
3886
- type: props.type || 'dark',
3887
- // Color theme of tooltip
3888
- effect: props.effect || 'float',
3889
- // float or fixed
3890
- show: false,
3891
- border: false,
3892
- borderClass: 'border',
3893
- customColors: {},
3894
- customRadius: {},
3895
- offset: {},
3896
- padding: props.padding,
3897
- extraClass: '',
3898
- html: false,
3899
- delayHide: 0,
3900
- delayShow: 0,
3901
- event: props.event || null,
3902
- eventOff: props.eventOff || null,
3903
- currentEvent: null,
3904
- // Current mouse event
3905
- currentTarget: null,
3906
- // Current target of mouse event
3907
- ariaProps: parseAria(props),
3908
- // aria- and role attributes
3909
- isEmptyTip: false,
3910
- disable: false,
3911
- possibleCustomEvents: props.possibleCustomEvents || '',
3912
- possibleCustomEventsOff: props.possibleCustomEventsOff || '',
3913
- originTooltip: null,
3914
- isMultiline: false
3915
- };
3916
- _this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);
3917
- _this.mount = true;
3918
- _this.delayShowLoop = null;
3919
- _this.delayHideLoop = null;
3920
- _this.delayReshow = null;
3921
- _this.intervalUpdateContent = null;
3922
- return _this;
3923
- }
3924
-
3925
- /**
3926
- * For unify the bind and unbind listener
3927
- */
3928
- _createClass(ReactTooltip, [{
3929
- key: "bind",
3930
- value: function bind(methodArray) {
3931
- var _this2 = this;
3932
- methodArray.forEach(function (method) {
3933
- _this2[method] = _this2[method].bind(_this2);
3934
- });
3935
- }
3936
- }, {
3937
- key: "componentDidMount",
3938
- value: function componentDidMount() {
3939
- var _this$props = this.props;
3940
- _this$props.insecure;
3941
- var resizeHide = _this$props.resizeHide,
3942
- disableInternalStyle = _this$props.disableInternalStyle;
3943
- this.mount = true;
3944
- this.bindListener(); // Bind listener for tooltip
3945
- this.bindWindowEvents(resizeHide); // Bind global event for static method
3946
-
3947
- if (!disableInternalStyle) {
3948
- this.injectStyles(); // Inject styles for each DOM root having tooltip.
3949
- }
3950
- }
3951
- }, {
3952
- key: "componentWillUnmount",
3953
- value: function componentWillUnmount() {
3954
- this.mount = false;
3955
- this.clearTimer();
3956
- this.unbindListener();
3957
- this.removeScrollListener(this.state.currentTarget);
3958
- this.unbindWindowEvents();
3959
- }
3960
-
3961
- /* Look for the closest DOM root having tooltip and inject styles. */
3962
- }, {
3963
- key: "injectStyles",
3964
- value: function injectStyles() {
3965
- var tooltipRef = this.tooltipRef;
3966
- if (!tooltipRef) {
3967
- return;
3968
- }
3969
- var parentNode = tooltipRef.parentNode;
3970
- while (parentNode.parentNode) {
3971
- parentNode = parentNode.parentNode;
3972
- }
3973
- var domRoot;
3974
- switch (parentNode.constructor.name) {
3975
- case 'Document':
3976
- case 'HTMLDocument':
3977
- case undefined:
3978
- domRoot = parentNode.head;
3979
- break;
3980
- case 'ShadowRoot':
3981
- default:
3982
- domRoot = parentNode;
3983
- break;
3984
- }
3985
-
3986
- // Prevent styles duplication.
3987
- if (!domRoot.querySelector('style[data-react-tooltip]')) {
3988
- var style = document.createElement('style');
3989
- style.textContent = baseCss;
3990
- style.setAttribute('data-react-tooltip', 'true');
3991
- domRoot.appendChild(style);
3992
- }
3993
- }
3994
-
3995
- /**
3996
- * Return if the mouse is on the tooltip.
3997
- * @returns {boolean} true - mouse is on the tooltip
3998
- */
3999
- }, {
4000
- key: "mouseOnToolTip",
4001
- value: function mouseOnToolTip() {
4002
- var show = this.state.show;
4003
- if (show && this.tooltipRef) {
4004
- /* old IE or Firefox work around */
4005
- if (!this.tooltipRef.matches) {
4006
- /* old IE work around */
4007
- if (this.tooltipRef.msMatchesSelector) {
4008
- this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;
4009
- } else {
4010
- /* old Firefox work around */
4011
- this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
4012
- }
4013
- }
4014
- return this.tooltipRef.matches(':hover');
4015
- }
4016
- return false;
4017
- }
4018
-
4019
- /**
4020
- * Pick out corresponded target elements
4021
- */
4022
- }, {
4023
- key: "getTargetArray",
4024
- value: function getTargetArray(id) {
4025
- var targetArray = [];
4026
- var selector;
4027
- if (!id) {
4028
- selector = '[data-tip]:not([data-for])';
4029
- } else {
4030
- var escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
4031
- selector = "[data-tip][data-for=\"".concat(escaped, "\"]");
4032
- }
4033
-
4034
- // Scan document for shadow DOM elements
4035
- nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {
4036
- return element.shadowRoot;
4037
- }).forEach(function (element) {
4038
- targetArray = targetArray.concat(nodeListToArray(element.shadowRoot.querySelectorAll(selector)));
4039
- });
4040
- return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));
4041
- }
4042
-
4043
- /**
4044
- * Bind listener to the target elements
4045
- * These listeners used to trigger showing or hiding the tooltip
4046
- */
4047
- }, {
4048
- key: "bindListener",
4049
- value: function bindListener() {
4050
- var _this3 = this;
4051
- var _this$props2 = this.props,
4052
- id = _this$props2.id,
4053
- globalEventOff = _this$props2.globalEventOff,
4054
- isCapture = _this$props2.isCapture;
4055
- var targetArray = this.getTargetArray(id);
4056
- targetArray.forEach(function (target) {
4057
- if (target.getAttribute('currentItem') === null) {
4058
- target.setAttribute('currentItem', 'false');
4059
- }
4060
- _this3.unbindBasicListener(target);
4061
- if (_this3.isCustomEvent(target)) {
4062
- _this3.customUnbindListener(target);
4063
- }
4064
- });
4065
- if (this.isBodyMode()) {
4066
- this.bindBodyListener(targetArray);
4067
- } else {
4068
- targetArray.forEach(function (target) {
4069
- var isCaptureMode = _this3.isCapture(target);
4070
- var effect = _this3.getEffect(target);
4071
- if (_this3.isCustomEvent(target)) {
4072
- _this3.customBindListener(target);
4073
- return;
4074
- }
4075
- target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
4076
- target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
4077
- if (effect === 'float') {
4078
- target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
4079
- }
4080
- target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
4081
- target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
4082
- });
4083
- }
4084
-
4085
- // Global event to hide tooltip
4086
- if (globalEventOff) {
4087
- window.removeEventListener(globalEventOff, this.hideTooltip);
4088
- window.addEventListener(globalEventOff, this.hideTooltip, isCapture);
4089
- }
4090
-
4091
- // Track removal of targetArray elements from DOM
4092
- this.bindRemovalTracker();
4093
- }
4094
-
4095
- /**
4096
- * Unbind listeners on target elements
4097
- */
4098
- }, {
4099
- key: "unbindListener",
4100
- value: function unbindListener() {
4101
- var _this4 = this;
4102
- var _this$props3 = this.props,
4103
- id = _this$props3.id,
4104
- globalEventOff = _this$props3.globalEventOff;
4105
- if (this.isBodyMode()) {
4106
- this.unbindBodyListener();
4107
- } else {
4108
- var targetArray = this.getTargetArray(id);
4109
- targetArray.forEach(function (target) {
4110
- _this4.unbindBasicListener(target);
4111
- if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);
4112
- });
4113
- }
4114
- if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);
4115
- this.unbindRemovalTracker();
4116
- }
4117
-
4118
- /**
4119
- * Invoke this before bind listener and unmount the component
4120
- * it is necessary to invoke this even when binding custom event
4121
- * so that the tooltip can switch between custom and default listener
4122
- */
4123
- }, {
4124
- key: "unbindBasicListener",
4125
- value: function unbindBasicListener(target) {
4126
- var isCaptureMode = this.isCapture(target);
4127
- target.removeEventListener('mouseenter', this.showTooltip, isCaptureMode);
4128
- target.removeEventListener('mousemove', this.updateTooltip, isCaptureMode);
4129
- target.removeEventListener('mouseleave', this.hideTooltip, isCaptureMode);
4130
- }
4131
- }, {
4132
- key: "getTooltipContent",
4133
- value: function getTooltipContent() {
4134
- var _this$props4 = this.props,
4135
- getContent = _this$props4.getContent,
4136
- children = _this$props4.children;
4137
-
4138
- // Generate tooltip content
4139
- var content;
4140
- if (getContent) {
4141
- if (Array.isArray(getContent)) {
4142
- content = getContent[0] && getContent[0](this.state.originTooltip);
4143
- } else {
4144
- content = getContent(this.state.originTooltip);
4145
- }
4146
- }
4147
- return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
4148
- }
4149
- }, {
4150
- key: "isEmptyTip",
4151
- value: function isEmptyTip(placeholder) {
4152
- return typeof placeholder === 'string' && placeholder === '' || placeholder === null;
4153
- }
4154
-
4155
- /**
4156
- * When mouse enter, show the tooltip
4157
- */
4158
- }, {
4159
- key: "showTooltip",
4160
- value: function showTooltip(e, isGlobalCall) {
4161
- if (!this.tooltipRef) {
4162
- return;
4163
- }
4164
- if (isGlobalCall) {
4165
- // Don't trigger other elements belongs to other ReactTooltip
4166
- var targetArray = this.getTargetArray(this.props.id);
4167
- var isMyElement = targetArray.some(function (ele) {
4168
- return ele === e.currentTarget;
4169
- });
4170
- if (!isMyElement) return;
4171
- }
4172
- // Get the tooltip content
4173
- // calculate in this phrase so that tip width height can be detected
4174
- var _this$props5 = this.props,
4175
- multiline = _this$props5.multiline,
4176
- getContent = _this$props5.getContent;
4177
- var originTooltip = e.currentTarget.getAttribute('data-tip');
4178
- var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
4179
-
4180
- // If it is focus event or called by ReactTooltip.show, switch to `solid` effect
4181
- var switchToSolid = e instanceof window.FocusEvent || isGlobalCall;
4182
-
4183
- // if it needs to skip adding hide listener to scroll
4184
- var scrollHide = true;
4185
- if (e.currentTarget.getAttribute('data-scroll-hide')) {
4186
- scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
4187
- } else if (this.props.scrollHide != null) {
4188
- scrollHide = this.props.scrollHide;
4189
- }
4190
-
4191
- // adding aria-describedby to target to make tooltips read by screen readers
4192
- if (e && e.currentTarget && e.currentTarget.setAttribute) {
4193
- e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
4194
- }
4195
-
4196
- // Make sure the correct place is set
4197
- var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
4198
- var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
4199
- var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
4200
- var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
4201
- if (result.position && this.props.overridePosition) {
4202
- result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
4203
- }
4204
- var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0];
4205
-
4206
- // To prevent previously created timers from triggering
4207
- this.clearTimer();
4208
- var target = e.currentTarget;
4209
- var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;
4210
- var self = this;
4211
- var updateState = function updateState() {
4212
- self.setState({
4213
- originTooltip: originTooltip,
4214
- isMultiline: isMultiline,
4215
- desiredPlace: desiredPlace,
4216
- place: place,
4217
- type: target.getAttribute('data-type') || self.props.type || 'dark',
4218
- customColors: {
4219
- text: target.getAttribute('data-text-color') || self.props.textColor || null,
4220
- background: target.getAttribute('data-background-color') || self.props.backgroundColor || null,
4221
- border: target.getAttribute('data-border-color') || self.props.borderColor || null,
4222
- arrow: target.getAttribute('data-arrow-color') || self.props.arrowColor || null
4223
- },
4224
- customRadius: {
4225
- tooltip: target.getAttribute('data-tooltip-radius') || self.props.tooltipRadius || '3',
4226
- arrow: target.getAttribute('data-arrow-radius') || self.props.arrowRadius || '0'
4227
- },
4228
- effect: effect,
4229
- offset: offset,
4230
- padding: target.getAttribute('data-padding') || self.props.padding,
4231
- html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
4232
- delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
4233
- delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
4234
- delayUpdate: target.getAttribute('data-delay-update') || self.props.delayUpdate || 0,
4235
- border: (target.getAttribute('data-border') ? target.getAttribute('data-border') === 'true' : self.props.border) || false,
4236
- borderClass: target.getAttribute('data-border-class') || self.props.borderClass || 'border',
4237
- extraClass: target.getAttribute('data-class') || self.props["class"] || self.props.className || '',
4238
- disable: (target.getAttribute('data-tip-disable') ? target.getAttribute('data-tip-disable') === 'true' : self.props.disable) || false,
4239
- currentTarget: target
4240
- }, function () {
4241
- if (scrollHide) {
4242
- self.addScrollListener(self.state.currentTarget);
4243
- }
4244
- self.updateTooltip(e);
4245
- if (getContent && Array.isArray(getContent)) {
4246
- self.intervalUpdateContent = setInterval(function () {
4247
- if (self.mount) {
4248
- var _getContent = self.props.getContent;
4249
- var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
4250
- var isEmptyTip = self.isEmptyTip(placeholder);
4251
- self.setState({
4252
- isEmptyTip: isEmptyTip
4253
- });
4254
- self.updatePosition();
4255
- }
4256
- }, getContent[1]);
4257
- }
4258
- });
4259
- };
4260
-
4261
- // If there is no delay call immediately, don't allow events to get in first.
4262
- if (reshowDelay) {
4263
- this.delayReshow = setTimeout(updateState, reshowDelay);
4264
- } else {
4265
- updateState();
4266
- }
4267
- }
4268
-
4269
- /**
4270
- * When mouse hover, update tool tip
4271
- */
4272
- }, {
4273
- key: "updateTooltip",
4274
- value: function updateTooltip(e) {
4275
- var _this5 = this;
4276
- var _this$state = this.state,
4277
- delayShow = _this$state.delayShow,
4278
- disable = _this$state.disable;
4279
- var _this$props6 = this.props,
4280
- afterShow = _this$props6.afterShow,
4281
- disableProp = _this$props6.disable;
4282
- var placeholder = this.getTooltipContent();
4283
- var eventTarget = e.currentTarget || e.target;
4284
-
4285
- // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
4286
- if (this.mouseOnToolTip()) {
4287
- return;
4288
- }
4289
-
4290
- // if the tooltip is empty, disable the tooltip
4291
- if (this.isEmptyTip(placeholder) || disable || disableProp) {
4292
- return;
4293
- }
4294
- var delayTime = !this.state.show ? parseInt(delayShow, 10) : 0;
4295
- var updateState = function updateState() {
4296
- if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {
4297
- var isInvisible = !_this5.state.show;
4298
- _this5.setState({
4299
- currentEvent: e,
4300
- currentTarget: eventTarget,
4301
- show: true
4302
- }, function () {
4303
- _this5.updatePosition(function () {
4304
- if (isInvisible && afterShow) {
4305
- afterShow(e);
4306
- }
4307
- });
4308
- });
4309
- }
4310
- };
4311
- if (this.delayShowLoop) {
4312
- clearTimeout(this.delayShowLoop);
4313
- }
4314
- if (delayTime) {
4315
- this.delayShowLoop = setTimeout(updateState, delayTime);
4316
- } else {
4317
- this.delayShowLoop = null;
4318
- updateState();
4319
- }
4320
- }
4321
-
4322
- /*
4323
- * If we're mousing over the tooltip remove it when we leave.
4324
- */
4325
- }, {
4326
- key: "listenForTooltipExit",
4327
- value: function listenForTooltipExit() {
4328
- var show = this.state.show;
4329
- if (show && this.tooltipRef) {
4330
- this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);
4331
- }
4332
- }
4333
- }, {
4334
- key: "removeListenerForTooltipExit",
4335
- value: function removeListenerForTooltipExit() {
4336
- var show = this.state.show;
4337
- if (show && this.tooltipRef) {
4338
- this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);
4339
- }
4340
- }
4341
-
4342
- /**
4343
- * When mouse leave, hide tooltip
4344
- */
4345
- }, {
4346
- key: "hideTooltip",
4347
- value: function hideTooltip(e, hasTarget) {
4348
- var _this6 = this;
4349
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
4350
- isScroll: false
4351
- };
4352
- var disable = this.state.disable;
4353
- var isScroll = options.isScroll;
4354
- var delayHide = isScroll ? 0 : this.state.delayHide;
4355
- var _this$props7 = this.props,
4356
- afterHide = _this$props7.afterHide,
4357
- disableProp = _this$props7.disable;
4358
- var placeholder = this.getTooltipContent();
4359
- if (!this.mount) return;
4360
- if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
4361
- if (hasTarget) {
4362
- // Don't trigger other elements belongs to other ReactTooltip
4363
- var targetArray = this.getTargetArray(this.props.id);
4364
- var isMyElement = targetArray.some(function (ele) {
4365
- return ele === e.currentTarget;
4366
- });
4367
- if (!isMyElement || !this.state.show) return;
4368
- }
4369
-
4370
- // clean up aria-describedby when hiding tooltip
4371
- if (e && e.currentTarget && e.currentTarget.removeAttribute) {
4372
- e.currentTarget.removeAttribute('aria-describedby');
4373
- }
4374
- var resetState = function resetState() {
4375
- var isVisible = _this6.state.show;
4376
- // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
4377
- if (_this6.mouseOnToolTip()) {
4378
- _this6.listenForTooltipExit();
4379
- return;
4380
- }
4381
- _this6.removeListenerForTooltipExit();
4382
- _this6.setState({
4383
- show: false
4384
- }, function () {
4385
- _this6.removeScrollListener(_this6.state.currentTarget);
4386
- if (isVisible && afterHide) {
4387
- afterHide(e);
4388
- }
4389
- });
4390
- };
4391
- this.clearTimer();
4392
- if (delayHide) {
4393
- this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));
4394
- } else {
4395
- resetState();
4396
- }
4397
- }
4398
-
4399
- /**
4400
- * When scroll, hide tooltip
4401
- */
4402
- }, {
4403
- key: "hideTooltipOnScroll",
4404
- value: function hideTooltipOnScroll(event, hasTarget) {
4405
- this.hideTooltip(event, hasTarget, {
4406
- isScroll: true
4407
- });
4408
- }
4409
-
4410
- /**
4411
- * Add scroll event listener when tooltip show
4412
- * automatically hide the tooltip when scrolling
4413
- */
4414
- }, {
4415
- key: "addScrollListener",
4416
- value: function addScrollListener(currentTarget) {
4417
- var isCaptureMode = this.isCapture(currentTarget);
4418
- window.addEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
4419
- }
4420
- }, {
4421
- key: "removeScrollListener",
4422
- value: function removeScrollListener(currentTarget) {
4423
- var isCaptureMode = this.isCapture(currentTarget);
4424
- window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
4425
- }
4426
-
4427
- // Calculation the position
4428
- }, {
4429
- key: "updatePosition",
4430
- value: function updatePosition(callbackAfter) {
4431
- var _this7 = this;
4432
- var _this$state2 = this.state,
4433
- currentEvent = _this$state2.currentEvent,
4434
- currentTarget = _this$state2.currentTarget,
4435
- place = _this$state2.place,
4436
- desiredPlace = _this$state2.desiredPlace,
4437
- effect = _this$state2.effect,
4438
- offset = _this$state2.offset;
4439
- var node = this.tooltipRef;
4440
- var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
4441
- if (result.position && this.props.overridePosition) {
4442
- result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
4443
- }
4444
- if (result.isNewState) {
4445
- // Switch to reverse placement
4446
- return this.setState(result.newState, function () {
4447
- _this7.updatePosition(callbackAfter);
4448
- });
4449
- }
4450
- if (callbackAfter && typeof callbackAfter === 'function') {
4451
- callbackAfter();
4452
- }
4453
-
4454
- // Set tooltip position
4455
- node.style.left = result.position.left + 'px';
4456
- node.style.top = result.position.top + 'px';
4457
- }
4458
-
4459
- /**
4460
- * CLear all kinds of timeout of interval
4461
- */
4462
- }, {
4463
- key: "clearTimer",
4464
- value: function clearTimer() {
4465
- if (this.delayShowLoop) {
4466
- clearTimeout(this.delayShowLoop);
4467
- this.delayShowLoop = null;
4468
- }
4469
- if (this.delayHideLoop) {
4470
- clearTimeout(this.delayHideLoop);
4471
- this.delayHideLoop = null;
4472
- }
4473
- if (this.delayReshow) {
4474
- clearTimeout(this.delayReshow);
4475
- this.delayReshow = null;
4476
- }
4477
- if (this.intervalUpdateContent) {
4478
- clearInterval(this.intervalUpdateContent);
4479
- this.intervalUpdateContent = null;
4480
- }
4481
- }
4482
- }, {
4483
- key: "hasCustomColors",
4484
- value: function hasCustomColors() {
4485
- var _this8 = this;
4486
- return Boolean(Object.keys(this.state.customColors).find(function (color) {
4487
- return color !== 'border' && _this8.state.customColors[color];
4488
- }) || this.state.border && this.state.customColors['border']);
4489
- }
4490
- }, {
4491
- key: "render",
4492
- value: function render() {
4493
- var _this9 = this;
4494
- var _this$state3 = this.state,
4495
- extraClass = _this$state3.extraClass,
4496
- html = _this$state3.html,
4497
- ariaProps = _this$state3.ariaProps,
4498
- disable = _this$state3.disable,
4499
- uuid = _this$state3.uuid;
4500
- var content = this.getTooltipContent();
4501
- var isEmptyTip = this.isEmptyTip(content);
4502
- var style = this.props.disableInternalStyle ? '' : generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding, this.state.customRadius);
4503
- var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' ' + this.state.borderClass : '') + " place-".concat(this.state.place) + // top, bottom, left, right
4504
- " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
4505
- // dark, success, warning, error, info, light, custom
4506
- this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
4507
- var Wrapper = this.props.wrapper;
4508
- if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {
4509
- Wrapper = ReactTooltip.defaultProps.wrapper;
4510
- }
4511
- var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
4512
- if (html) {
4513
- var htmlContent = "".concat(content).concat(style ? "\n<style aria-hidden=\"true\">".concat(style, "</style>") : '');
4514
- return /*#__PURE__*/React.createElement(Wrapper, _extends({
4515
- className: "".concat(wrapperClassName),
4516
- id: this.props.id || uuid,
4517
- ref: function ref(_ref) {
4518
- return _this9.tooltipRef = _ref;
4519
- }
4520
- }, ariaProps, {
4521
- "data-id": "tooltip",
4522
- dangerouslySetInnerHTML: {
4523
- __html: htmlContent
4524
- }
4525
- }));
4526
- } else {
4527
- return /*#__PURE__*/React.createElement(Wrapper, _extends({
4528
- className: "".concat(wrapperClassName),
4529
- id: this.props.id || uuid
4530
- }, ariaProps, {
4531
- ref: function ref(_ref2) {
4532
- return _this9.tooltipRef = _ref2;
4533
- },
4534
- "data-id": "tooltip"
4535
- }), style && /*#__PURE__*/React.createElement("style", {
4536
- dangerouslySetInnerHTML: {
4537
- __html: style
4538
- },
4539
- "aria-hidden": "true"
4540
- }), content);
4541
- }
4542
- }
4543
- }], [{
4544
- key: "propTypes",
4545
- get: function get() {
4546
- return {
4547
- uuid: PropTypes.string,
4548
- children: PropTypes.any,
4549
- place: PropTypes.string,
4550
- type: PropTypes.string,
4551
- effect: PropTypes.string,
4552
- offset: PropTypes.object,
4553
- padding: PropTypes.string,
4554
- multiline: PropTypes.bool,
4555
- border: PropTypes.bool,
4556
- borderClass: PropTypes.string,
4557
- textColor: PropTypes.string,
4558
- backgroundColor: PropTypes.string,
4559
- borderColor: PropTypes.string,
4560
- arrowColor: PropTypes.string,
4561
- arrowRadius: PropTypes.string,
4562
- tooltipRadius: PropTypes.string,
4563
- insecure: PropTypes.bool,
4564
- "class": PropTypes.string,
4565
- className: PropTypes.string,
4566
- id: PropTypes.string,
4567
- html: PropTypes.bool,
4568
- delayHide: PropTypes.number,
4569
- delayUpdate: PropTypes.number,
4570
- delayShow: PropTypes.number,
4571
- event: PropTypes.string,
4572
- eventOff: PropTypes.string,
4573
- isCapture: PropTypes.bool,
4574
- globalEventOff: PropTypes.string,
4575
- getContent: PropTypes.any,
4576
- afterShow: PropTypes.func,
4577
- afterHide: PropTypes.func,
4578
- overridePosition: PropTypes.func,
4579
- disable: PropTypes.bool,
4580
- scrollHide: PropTypes.bool,
4581
- resizeHide: PropTypes.bool,
4582
- wrapper: PropTypes.string,
4583
- bodyMode: PropTypes.bool,
4584
- possibleCustomEvents: PropTypes.string,
4585
- possibleCustomEventsOff: PropTypes.string,
4586
- clickable: PropTypes.bool,
4587
- disableInternalStyle: PropTypes.bool
4588
- };
4589
- }
4590
- }, {
4591
- key: "getDerivedStateFromProps",
4592
- value: function getDerivedStateFromProps(nextProps, prevState) {
4593
- var ariaProps = prevState.ariaProps;
4594
- var newAriaProps = parseAria(nextProps);
4595
- var isChanged = Object.keys(newAriaProps).some(function (props) {
4596
- return newAriaProps[props] !== ariaProps[props];
4597
- });
4598
- if (!isChanged) {
4599
- return null;
4600
- }
4601
- return _objectSpread2(_objectSpread2({}, prevState), {}, {
4602
- ariaProps: newAriaProps
4603
- });
4604
- }
4605
- }]);
4606
- return ReactTooltip;
4607
- }(React.Component), _defineProperty(_class2, "defaultProps", {
4608
- insecure: true,
4609
- resizeHide: true,
4610
- wrapper: 'div',
4611
- clickable: false
4612
- }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
4613
-
4614
- function Checkbox(_a) {
4615
- var children = _a.children, _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.tooltip, tooltip = _c === void 0 ? '' : _c, name = _a.name, value = _a.value, checked = _a.checked, forcedChecked = _a.forcedChecked, _d = _a.disabled, disabled = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.size, size = _e === void 0 ? "m" : _e, _f = _a.fullWidth, fullWidth = _f === void 0 ? false : _f;
4616
- var change = function (ev) {
4617
- if (typeof onChange === 'function') {
4618
- onChange(ev);
4619
- }
4620
- };
4621
- var cssClass = ['cb_label'];
4622
- if (disabled) {
4623
- cssClass.push('disabled');
4624
- }
4625
- if (size) {
4626
- cssClass.push(size);
4627
- }
4628
- var childrenClass = ['cb_label_text'];
4629
- var tooltipClass = [];
4630
- if (fullWidth) {
4631
- childrenClass.push('flex_item_full');
4632
- cssClass.push('flex');
4633
- }
4634
- else {
4635
- childrenClass.push('flex_item_auto');
4636
- cssClass.push('flex_inline');
4637
- }
4638
- if (tooltip) {
4639
- cssClass.push(fullWidth ? 'flex_item_full' : 'flex_item_auto');
4640
- tooltipClass.push(fullWidth ? 'flex' : 'flex_inline');
4641
- }
4642
- var inner = (React.createElement("label", { className: cssClass.join(' ') },
4643
- forcedChecked !== undefined ?
4644
- React.createElement("input", { type: "checkbox", name: name, value: value, checked: forcedChecked ? true : false, onChange: function (ev) { return change(ev); }, disabled: disabled, readOnly: true })
4645
- :
4646
- React.createElement("input", { type: "checkbox", name: name, value: value, onChange: function (ev) { return change(ev); }, defaultChecked: checked ? true : false, disabled: disabled }),
4647
- React.createElement("span", { className: "cb_label_icon flex_item_fix flex_item_align_start" }),
4648
- React.createElement("span", { className: childrenClass.join(' ') }, label || children)));
4649
- if (tooltip) {
4650
- return (React.createElement("span", { className: tooltipClass.join(' ') },
4651
- inner,
4652
- React.createElement("span", { className: "cb_label_tooltip flex_item_fix flex_item_align_start" },
4653
- React.createElement("a", { className: "icon_btn s v_al_bl", "data-tip": tooltip },
4654
- React.createElement("i", { className: "fas fa-info-circle" })),
4655
- React.createElement(ReactTooltip, { backgroundColor: "black", effect: "solid", place: "bottom", eventOff: "click", delayShow: 600 }))));
4656
- }
4657
- else {
4658
- return inner;
4659
- }
4660
- }
4661
-
4662
- function Spinner(_a) {
4663
- var _b = _a.overlay, overlay = _b === void 0 ? false : _b;
4664
- return (React.createElement(React.Fragment, null, overlay ?
4665
- React.createElement("div", { className: "spinner_overlay" },
4666
- React.createElement("div", { className: "spinner" },
4667
- React.createElement("div", { className: "rect1" }),
4668
- React.createElement("div", { className: "rect2" }),
4669
- React.createElement("div", { className: "rect3" }),
4670
- React.createElement("div", { className: "rect4" }),
4671
- React.createElement("div", { className: "rect5" })))
4672
- :
4673
- React.createElement("div", { className: "spinner" },
4674
- React.createElement("div", { className: "rect1" }),
4675
- React.createElement("div", { className: "rect2" }),
4676
- React.createElement("div", { className: "rect3" }),
4677
- React.createElement("div", { className: "rect4" }),
4678
- React.createElement("div", { className: "rect5" }))));
4679
- }
4680
-
4681
- function SpinnerWheel(_a) {
4682
- var _b = _a.wheelSize, wheelSize = _b === void 0 ? 'm' : _b, // xxs, xs, s, m, l
4683
- _c = _a.display, // xxs, xs, s, m, l
4684
- display = _c === void 0 ? 'overlay' : _c, // block | inline | overlay
4685
- _d = _a.verticalSize, // block | inline | overlay
4686
- verticalSize = _d === void 0 ? 'l' : _d;
4687
- var cssClass = ['wheel'];
4688
- // wheelSize
4689
- if (wheelSize) {
4690
- cssClass.push('size_' + wheelSize);
4691
- }
4692
- // Display
4693
- if (display == 'block') {
4694
- cssClass.push('full');
4695
- // verticalSize
4696
- if (verticalSize) {
4697
- cssClass.push('vertical_size_' + verticalSize);
4698
- }
4699
- }
4700
- var wheel = (React.createElement("div", { className: cssClass.join(' ') }));
4701
- if (display == 'overlay') {
4702
- return (React.createElement("div", { className: 'mask' }, wheel));
4703
- }
4704
- return wheel;
4705
- }
4706
-
4707
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
4708
- // require the crypto API and do not support built-in fallback to lower quality random number
4709
- // generators (like Math.random()).
4710
- let getRandomValues;
4711
- const rnds8 = new Uint8Array(16);
4712
- function rng() {
4713
- // lazy load so that environments that need to polyfill have a chance to do so
4714
- if (!getRandomValues) {
4715
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
4716
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
4717
-
4718
- if (!getRandomValues) {
4719
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
4720
- }
4721
- }
4722
-
4723
- return getRandomValues(rnds8);
4724
- }
4725
-
4726
- /**
4727
- * Convert array of 16 byte values to UUID string format of the form:
4728
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4729
- */
4730
-
4731
- const byteToHex = [];
4732
-
4733
- for (let i = 0; i < 256; ++i) {
4734
- byteToHex.push((i + 0x100).toString(16).slice(1));
4735
- }
4736
-
4737
- function unsafeStringify(arr, offset = 0) {
4738
- // Note: Be careful editing this code! It's been tuned for performance
4739
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
4740
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
4741
- }
4742
-
4743
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
4744
- var native = {
4745
- randomUUID
4746
- };
4747
-
4748
- function v4(options, buf, offset) {
4749
- if (native.randomUUID && !buf && !options) {
4750
- return native.randomUUID();
4751
- }
4752
-
4753
- options = options || {};
4754
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
4755
-
4756
- rnds[6] = rnds[6] & 0x0f | 0x40;
4757
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
4758
-
4759
- if (buf) {
4760
- offset = offset || 0;
4761
-
4762
- for (let i = 0; i < 16; ++i) {
4763
- buf[offset + i] = rnds[i];
4764
- }
4765
-
4766
- return buf;
4767
- }
4768
-
4769
- return unsafeStringify(rnds);
4770
- }
4771
-
4772
- // TODO : onChange return e.target.value
4773
- function InputCustom(_a) {
4774
- var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.type, type = _c === void 0 ? "text" : _c, onChange = _a.onChange, handleChangeForm = _a.handleChangeForm, // DEPRECATED : replace by onChange
4775
- _d = _a.placeholder, // DEPRECATED : replace by onChange
4776
- placeholder = _d === void 0 ? "" : _d, _e = _a.placeHolder, placeHolder = _e === void 0 ? "" : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.readonly, readonly = _g === void 0 ? false : _g, name = _a.name, min = _a.min, max = _a.max, _h = _a.label, label = _h === void 0 ? "" : _h, _j = _a.labelClassName, labelClassName = _j === void 0 ? "" : _j, _k = _a.description, description = _k === void 0 ? "" : _k, _l = _a.descriptionBottom, descriptionBottom = _l === void 0 ? "" : _l, _m = _a.labelTooltip, labelTooltip = _m === void 0 ? "" : _m, _o = _a.blockClassName, blockClassName = _o === void 0 ? "" : _o, _p = _a.size, size = _p === void 0 ? "m" : _p, _q = _a.color, color = _q === void 0 ? "grey" : _q, unit = _a.unit, isAnError = _a.isAnError, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, width = _a.width, // 'Full' || 's' || 'xs' || 'xxs'
4777
- _s = _a.className, // 'Full' || 's' || 'xs' || 'xxs'
4778
- className = _s === void 0 ? "" : _s, style = _a.style, _t = _a.selectOnFocus, selectOnFocus = _t === void 0 ? false : _t, _u = _a.autoFocus, autoFocus = _u === void 0 ? false : _u, _v = _a.spellCheck, spellCheck = _v === void 0 ? true : _v, onEnter = _a.onEnter, onFocus = _a.onFocus, onBlur = _a.onBlur, append = _a.append, prepend = _a.prepend, _w = _a.rows, rows = _w === void 0 ? 3 : _w, // For textarea
4779
- _x = _a.autogrow, // For textarea
4780
- autogrow = _x === void 0 ? false : _x, // Vertical for textarea, Horizontal for text
4781
- maxHeight = _a.maxHeight, // For textarea autogrow
4782
- maxWidth = _a.maxWidth // For text autogrow
4783
- ;
4784
- var inputEl = useRef(null);
4785
- var inputId = v4();
4786
- var inputClass = ['custom_input'];
4787
- var labelClass = ['form_block_label'];
4788
- var blockClass = ['form_block'];
4789
- if (autogrow && type == "text") {
4790
- inputClass.push('w_auto');
4791
- inputClass.push('is_autogrow');
4792
- fullWidth = null;
4793
- width = null;
4794
- }
4795
- if (fullWidth) {
4796
- width = 'full';
4797
- }
4798
- if (width) {
4799
- inputClass.push('w_' + width);
4800
- }
4801
- if (style === "ghost") {
4802
- inputClass.push('ghost');
4803
- }
4804
- if (color === "white") {
4805
- inputClass.push('bg_' + color);
4806
- }
4807
- if (className) {
4808
- inputClass.push(className);
4809
- }
4810
- if (disabled) {
4811
- inputClass.push('disabled');
4812
- }
4813
- if (readonly) {
4814
- inputClass.push('readonly');
4815
- }
4816
- if (labelClassName) {
4817
- labelClass.push(labelClassName);
4818
- }
4819
- if (isAnError) {
4820
- inputClass.push('error');
4821
- }
4822
- if (blockClassName) {
4823
- blockClass.push(blockClassName);
4824
- }
4825
- // Size : xs, s, default, l, xl, xxl
4826
- if (size) {
4827
- inputClass.push(size);
4828
- }
4829
- var change = function (e) {
4830
- if (typeof onChange === 'function') {
4831
- onChange(e);
4832
- }
4833
- if (typeof handleChangeForm === 'function') {
4834
- handleChangeForm(e);
4835
- }
4836
- };
4837
- var handleKeyPress = function (e) {
4838
- if (typeof onEnter === 'function') {
4839
- if (e.key === 'Enter') {
4840
- onEnter(e);
4841
- }
4842
- }
4843
- };
4844
- var handleFocus = function (e) {
4845
- if (selectOnFocus) {
4846
- e.target.select();
4847
- }
4848
- if (typeof onFocus === 'function') {
4849
- onFocus(e);
4850
- }
4851
- };
4852
- var handleBlur = function (e) {
4853
- if (typeof onBlur === 'function') {
4854
- onBlur(e);
4855
- }
4856
- };
4857
- var onInput = function () {
4858
- if (!autogrow)
4859
- return;
4860
- if (!inputEl.current)
4861
- return;
4862
- var c = inputEl.current;
4863
- // Autogrow
4864
- if (type == 'textarea') {
4865
- c.style.height = "auto";
4866
- var h = maxHeight ? Math.min(maxHeight, c.scrollHeight) : c.scrollHeight;
4867
- c.style.height = h + "px";
4868
- return;
4869
- }
4870
- if (type == 'text') {
4871
- c.style.width = "auto";
4872
- c.style.maxWidth = "80px";
4873
- var w = maxWidth ? Math.min(maxWidth, c.scrollWidth) : c.scrollWidth;
4874
- c.style.width = w + "px";
4875
- c.style.maxWidth = "";
4876
- return;
4877
- }
4878
- };
4879
- useEffect(function () {
4880
- onInput();
4881
- }, [value]);
4882
- var input = (React.createElement(React.Fragment, null,
4883
- React.createElement("label", { className: inputClass.join(' ') },
4884
- prepend && prepend,
4885
- type == 'textarea' ?
4886
- React.createElement("textarea", { ref: inputEl, id: inputId, name: name, onChange: function (e) { return change(e); }, value: value, placeholder: placeholder || placeHolder, onFocus: function (e) { return handleFocus(e); }, onBlur: function (e) { return handleBlur(e); }, autoFocus: autoFocus, rows: typeof rows === "string" ? parseInt(rows) : rows, onKeyPress: function (e) { return handleKeyPress(e); }, disabled: disabled, readOnly: readonly, spellCheck: spellCheck })
4887
- :
4888
- React.createElement("input", { ref: inputEl, id: inputId, type: type, name: name, min: min, max: max, onChange: function (e) { return change(e); }, value: value, placeholder: placeholder || placeHolder, onFocus: function (e) { return handleFocus(e); }, onBlur: function (e) { return handleBlur(e); }, autoFocus: autoFocus, onKeyPress: function (e) { return handleKeyPress(e); }, disabled: disabled, readOnly: readonly }),
4889
- unit &&
4890
- React.createElement("span", { className: "custom_input_unit" }, unit),
4891
- append && append),
4892
- isAnError &&
4893
- React.createElement("div", { className: "custom_input_sub_error" }, isAnError),
4894
- descriptionBottom &&
4895
- React.createElement("div", { className: "custom_input_sub_desc" }, descriptionBottom)));
4896
- if (label) {
4897
- return (React.createElement("div", { className: blockClass.join(' ') },
4898
- React.createElement("div", { className: labelClass.join(' ') },
4899
- React.createElement("label", { htmlFor: inputId }, label),
4900
- labelTooltip &&
4901
- React.createElement(React.Fragment, null,
4902
- React.createElement("a", { className: "icon_btn s v_al_bl", "data-tip": labelTooltip },
4903
- React.createElement("i", { className: "fas fa-info-circle" })),
4904
- React.createElement(ReactTooltip, { backgroundColor: "black", effect: "solid", place: "bottom", eventOff: "click", delayShow: 600 }))),
4905
- description &&
4906
- React.createElement("div", { className: "form_block_description" }, description),
4907
- input));
4908
- }
4909
- return input;
4910
- }
4911
-
4912
- export { Avatar, Breadcrumb, BYbtn as Btn, Checkbox, Collapse, InputCustom, Modal, Portal, Spinner, SpinnerWheel };
163
+ export { BYbtn as Btn, Collapse, Modal, Portal };
4913
164
  //# sourceMappingURL=index.js.map