react-tooltip 4.2.21 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,40 @@
1
1
  'use strict';
2
2
 
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
-
5
- var React = _interopDefault(require('react'));
6
- var PropTypes = _interopDefault(require('prop-types'));
3
+ var React = require('react');
4
+ var PropTypes = require('prop-types');
7
5
  var uuid = require('uuid');
8
6
 
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
11
+
12
+ function ownKeys$2(object, enumerableOnly) {
13
+ var keys = Object.keys(object);
14
+
15
+ if (Object.getOwnPropertySymbols) {
16
+ var symbols = Object.getOwnPropertySymbols(object);
17
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
18
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
19
+ })), keys.push.apply(keys, symbols);
20
+ }
21
+
22
+ return keys;
23
+ }
24
+
25
+ function _objectSpread2(target) {
26
+ for (var i = 1; i < arguments.length; i++) {
27
+ var source = null != arguments[i] ? arguments[i] : {};
28
+ i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
29
+ _defineProperty(target, key, source[key]);
30
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
31
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
32
+ });
33
+ }
34
+
35
+ return target;
36
+ }
37
+
9
38
  function _classCallCheck(instance, Constructor) {
10
39
  if (!(instance instanceof Constructor)) {
11
40
  throw new TypeError("Cannot call a class as a function");
@@ -25,6 +54,9 @@ function _defineProperties(target, props) {
25
54
  function _createClass(Constructor, protoProps, staticProps) {
26
55
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
56
  if (staticProps) _defineProperties(Constructor, staticProps);
57
+ Object.defineProperty(Constructor, "prototype", {
58
+ writable: false
59
+ });
28
60
  return Constructor;
29
61
  }
30
62
 
@@ -44,7 +76,7 @@ function _defineProperty(obj, key, value) {
44
76
  }
45
77
 
46
78
  function _extends() {
47
- _extends = Object.assign || function (target) {
79
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
48
80
  for (var i = 1; i < arguments.length; i++) {
49
81
  var source = arguments[i];
50
82
 
@@ -57,44 +89,9 @@ function _extends() {
57
89
 
58
90
  return target;
59
91
  };
60
-
61
92
  return _extends.apply(this, arguments);
62
93
  }
63
94
 
64
- function ownKeys(object, enumerableOnly) {
65
- var keys = Object.keys(object);
66
-
67
- if (Object.getOwnPropertySymbols) {
68
- var symbols = Object.getOwnPropertySymbols(object);
69
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
70
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
71
- });
72
- keys.push.apply(keys, symbols);
73
- }
74
-
75
- return keys;
76
- }
77
-
78
- function _objectSpread2(target) {
79
- for (var i = 1; i < arguments.length; i++) {
80
- var source = arguments[i] != null ? arguments[i] : {};
81
-
82
- if (i % 2) {
83
- ownKeys(Object(source), true).forEach(function (key) {
84
- _defineProperty(target, key, source[key]);
85
- });
86
- } else if (Object.getOwnPropertyDescriptors) {
87
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
88
- } else {
89
- ownKeys(Object(source)).forEach(function (key) {
90
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
91
- });
92
- }
93
- }
94
-
95
- return target;
96
- }
97
-
98
95
  function _inherits(subClass, superClass) {
99
96
  if (typeof superClass !== "function" && superClass !== null) {
100
97
  throw new TypeError("Super expression must either be null or a function");
@@ -107,25 +104,40 @@ function _inherits(subClass, superClass) {
107
104
  configurable: true
108
105
  }
109
106
  });
107
+ Object.defineProperty(subClass, "prototype", {
108
+ writable: false
109
+ });
110
110
  if (superClass) _setPrototypeOf(subClass, superClass);
111
111
  }
112
112
 
113
113
  function _getPrototypeOf(o) {
114
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
114
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
115
115
  return o.__proto__ || Object.getPrototypeOf(o);
116
116
  };
117
117
  return _getPrototypeOf(o);
118
118
  }
119
119
 
120
120
  function _setPrototypeOf(o, p) {
121
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
121
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
122
122
  o.__proto__ = p;
123
123
  return o;
124
124
  };
125
-
126
125
  return _setPrototypeOf(o, p);
127
126
  }
128
127
 
128
+ function _isNativeReflectConstruct() {
129
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
130
+ if (Reflect.construct.sham) return false;
131
+ if (typeof Proxy === "function") return true;
132
+
133
+ try {
134
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
135
+ return true;
136
+ } catch (e) {
137
+ return false;
138
+ }
139
+ }
140
+
129
141
  function _assertThisInitialized(self) {
130
142
  if (self === void 0) {
131
143
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -137,1273 +149,902 @@ function _assertThisInitialized(self) {
137
149
  function _possibleConstructorReturn(self, call) {
138
150
  if (call && (typeof call === "object" || typeof call === "function")) {
139
151
  return call;
152
+ } else if (call !== void 0) {
153
+ throw new TypeError("Derived constructors may only return object or undefined");
140
154
  }
141
155
 
142
156
  return _assertThisInitialized(self);
143
157
  }
144
158
 
145
- var CONSTANT = {
146
- GLOBAL: {
147
- HIDE: '__react_tooltip_hide_event',
148
- REBUILD: '__react_tooltip_rebuild_event',
149
- SHOW: '__react_tooltip_show_event'
150
- }
151
- };
152
-
153
- /**
154
- * Static methods for react-tooltip
155
- */
159
+ function _createSuper(Derived) {
160
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
156
161
 
157
- var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
158
- // Compatible with IE
159
- // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
160
- // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
161
- var event;
162
+ return function _createSuperInternal() {
163
+ var Super = _getPrototypeOf(Derived),
164
+ result;
162
165
 
163
- if (typeof window.CustomEvent === 'function') {
164
- event = new window.CustomEvent(eventName, {
165
- detail: opts
166
- });
167
- } else {
168
- event = document.createEvent('Event');
169
- event.initEvent(eventName, false, true, opts);
170
- }
166
+ if (hasNativeReflectConstruct) {
167
+ var NewTarget = _getPrototypeOf(this).constructor;
171
168
 
172
- window.dispatchEvent(event);
173
- };
169
+ result = Reflect.construct(Super, arguments, NewTarget);
170
+ } else {
171
+ result = Super.apply(this, arguments);
172
+ }
174
173
 
175
- function staticMethods (target) {
176
- /**
177
- * Hide all tooltip
178
- * @trigger ReactTooltip.hide()
179
- */
180
- target.hide = function (target) {
181
- dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
182
- target: target
183
- });
174
+ return _possibleConstructorReturn(this, result);
184
175
  };
185
- /**
186
- * Rebuild all tooltip
187
- * @trigger ReactTooltip.rebuild()
188
- */
176
+ }
189
177
 
178
+ function _unsupportedIterableToArray(o, minLen) {
179
+ if (!o) return;
180
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
181
+ var n = Object.prototype.toString.call(o).slice(8, -1);
182
+ if (n === "Object" && o.constructor) n = o.constructor.name;
183
+ if (n === "Map" || n === "Set") return Array.from(o);
184
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
185
+ }
190
186
 
191
- target.rebuild = function () {
192
- dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
193
- };
194
- /**
195
- * Show specific tooltip
196
- * @trigger ReactTooltip.show()
197
- */
187
+ function _arrayLikeToArray(arr, len) {
188
+ if (len == null || len > arr.length) len = arr.length;
198
189
 
190
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
199
191
 
200
- target.show = function (target) {
201
- dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
202
- target: target
203
- });
204
- };
192
+ return arr2;
193
+ }
205
194
 
206
- target.prototype.globalRebuild = function () {
207
- if (this.mount) {
208
- this.unbindListener();
209
- this.bindListener();
210
- }
211
- };
195
+ function _createForOfIteratorHelper(o, allowArrayLike) {
196
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
212
197
 
213
- target.prototype.globalShow = function (event) {
214
- if (this.mount) {
215
- var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`
216
- // only `float` type cares e.clientX e.clientY
198
+ if (!it) {
199
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
200
+ if (it) o = it;
201
+ var i = 0;
217
202
 
218
- this.showTooltip({
219
- currentTarget: hasTarget && event.detail.target
220
- }, true);
203
+ var F = function () {};
204
+
205
+ return {
206
+ s: F,
207
+ n: function () {
208
+ if (i >= o.length) return {
209
+ done: true
210
+ };
211
+ return {
212
+ done: false,
213
+ value: o[i++]
214
+ };
215
+ },
216
+ e: function (e) {
217
+ throw e;
218
+ },
219
+ f: F
220
+ };
221
221
  }
222
- };
223
222
 
224
- target.prototype.globalHide = function (event) {
225
- if (this.mount) {
226
- var hasTarget = event && event.detail && event.detail.target && true || false;
227
- this.hideTooltip({
228
- currentTarget: hasTarget && event.detail.target
229
- }, hasTarget);
223
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
224
+ }
225
+
226
+ var normalCompletion = true,
227
+ didErr = false,
228
+ err;
229
+ return {
230
+ s: function () {
231
+ it = it.call(o);
232
+ },
233
+ n: function () {
234
+ var step = it.next();
235
+ normalCompletion = step.done;
236
+ return step;
237
+ },
238
+ e: function (e) {
239
+ didErr = true;
240
+ err = e;
241
+ },
242
+ f: function () {
243
+ try {
244
+ if (!normalCompletion && it.return != null) it.return();
245
+ } finally {
246
+ if (didErr) throw err;
247
+ }
230
248
  }
231
249
  };
232
250
  }
233
251
 
234
- /**
235
- * Events that should be bound to the window
236
- */
237
- function windowListener (target) {
238
- target.prototype.bindWindowEvents = function (resizeHide) {
239
- // ReactTooltip.hide
240
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
241
- window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild
252
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
242
253
 
243
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
244
- window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show
254
+ var check = function (it) {
255
+ return it && it.Math == Math && it;
256
+ };
245
257
 
246
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
247
- window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize
258
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
259
+ var global$a =
260
+ // eslint-disable-next-line es-x/no-global-this -- safe
261
+ check(typeof globalThis == 'object' && globalThis) ||
262
+ check(typeof window == 'object' && window) ||
263
+ // eslint-disable-next-line no-restricted-globals -- safe
264
+ check(typeof self == 'object' && self) ||
265
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
266
+ // eslint-disable-next-line no-new-func -- fallback
267
+ (function () { return this; })() || Function('return this')();
248
268
 
249
- if (resizeHide) {
250
- window.removeEventListener('resize', this.onWindowResize);
251
- window.addEventListener('resize', this.onWindowResize, false);
252
- }
253
- };
269
+ var objectGetOwnPropertyDescriptor = {};
254
270
 
255
- target.prototype.unbindWindowEvents = function () {
256
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
257
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
258
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
259
- window.removeEventListener('resize', this.onWindowResize);
260
- };
261
- /**
262
- * invoked by resize event of window
263
- */
271
+ var fails$9 = function (exec) {
272
+ try {
273
+ return !!exec();
274
+ } catch (error) {
275
+ return true;
276
+ }
277
+ };
264
278
 
279
+ var fails$8 = fails$9;
265
280
 
266
- target.prototype.onWindowResize = function () {
267
- if (!this.mount) return;
268
- this.hideTooltip();
269
- };
270
- }
281
+ // Detect IE8's incomplete defineProperty implementation
282
+ var descriptors = !fails$8(function () {
283
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
284
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
285
+ });
271
286
 
272
- /**
273
- * Custom events to control showing and hiding of tooltip
274
- *
275
- * @attributes
276
- * - `event` {String}
277
- * - `eventOff` {String}
278
- */
279
- var checkStatus = function checkStatus(dataEventOff, e) {
280
- var show = this.state.show;
281
- var id = this.props.id;
282
- var isCapture = this.isCapture(e.currentTarget);
283
- var currentItem = e.currentTarget.getAttribute('currentItem');
284
- if (!isCapture) e.stopPropagation();
287
+ var fails$7 = fails$9;
285
288
 
286
- if (show && currentItem === 'true') {
287
- if (!dataEventOff) this.hideTooltip(e);
288
- } else {
289
- e.currentTarget.setAttribute('currentItem', 'true');
290
- setUntargetItems(e.currentTarget, this.getTargetArray(id));
291
- this.showTooltip(e);
292
- }
293
- };
289
+ var functionBindNative = !fails$7(function () {
290
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
291
+ var test = (function () { /* empty */ }).bind();
292
+ // eslint-disable-next-line no-prototype-builtins -- safe
293
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
294
+ });
294
295
 
295
- var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
296
- for (var i = 0; i < targetArray.length; i++) {
297
- if (currentTarget !== targetArray[i]) {
298
- targetArray[i].setAttribute('currentItem', 'false');
299
- } else {
300
- targetArray[i].setAttribute('currentItem', 'true');
301
- }
302
- }
303
- };
296
+ var NATIVE_BIND$2 = functionBindNative;
304
297
 
305
- var customListeners = {
306
- id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
307
- set: function set(target, event, listener) {
308
- if (this.id in target) {
309
- var map = target[this.id];
310
- map[event] = listener;
311
- } else {
312
- // this is workaround for WeakMap, which is not supported in older browsers, such as IE
313
- Object.defineProperty(target, this.id, {
314
- configurable: true,
315
- value: _defineProperty({}, event, listener)
316
- });
317
- }
318
- },
319
- get: function get(target, event) {
320
- var map = target[this.id];
298
+ var call$4 = Function.prototype.call;
321
299
 
322
- if (map !== undefined) {
323
- return map[event];
324
- }
325
- }
300
+ var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
301
+ return call$4.apply(call$4, arguments);
326
302
  };
327
- function customEvent (target) {
328
- target.prototype.isCustomEvent = function (ele) {
329
- var event = this.state.event;
330
- return event || !!ele.getAttribute('data-event');
331
- };
332
- /* Bind listener for custom event */
333
303
 
304
+ var objectPropertyIsEnumerable = {};
334
305
 
335
- target.prototype.customBindListener = function (ele) {
336
- var _this = this;
306
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
307
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
308
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
337
309
 
338
- var _this$state = this.state,
339
- event = _this$state.event,
340
- eventOff = _this$state.eventOff;
341
- var dataEvent = ele.getAttribute('data-event') || event;
342
- var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
343
- dataEvent.split(' ').forEach(function (event) {
344
- ele.removeEventListener(event, customListeners.get(ele, event));
345
- var customListener = checkStatus.bind(_this, dataEventOff);
346
- customListeners.set(ele, event, customListener);
347
- ele.addEventListener(event, customListener, false);
348
- });
310
+ // Nashorn ~ JDK8 bug
311
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
349
312
 
350
- if (dataEventOff) {
351
- dataEventOff.split(' ').forEach(function (event) {
352
- ele.removeEventListener(event, _this.hideTooltip);
353
- ele.addEventListener(event, _this.hideTooltip, false);
354
- });
355
- }
313
+ // `Object.prototype.propertyIsEnumerable` method implementation
314
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
315
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
316
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
317
+ return !!descriptor && descriptor.enumerable;
318
+ } : $propertyIsEnumerable;
319
+
320
+ var createPropertyDescriptor$2 = function (bitmap, value) {
321
+ return {
322
+ enumerable: !(bitmap & 1),
323
+ configurable: !(bitmap & 2),
324
+ writable: !(bitmap & 4),
325
+ value: value
356
326
  };
357
- /* Unbind listener for custom event */
327
+ };
358
328
 
329
+ var NATIVE_BIND$1 = functionBindNative;
359
330
 
360
- target.prototype.customUnbindListener = function (ele) {
361
- var _this$state2 = this.state,
362
- event = _this$state2.event,
363
- eventOff = _this$state2.eventOff;
364
- var dataEvent = event || ele.getAttribute('data-event');
365
- var dataEventOff = eventOff || ele.getAttribute('data-event-off');
366
- ele.removeEventListener(dataEvent, customListeners.get(ele, event));
367
- if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
368
- };
369
- }
331
+ var FunctionPrototype$1 = Function.prototype;
332
+ var bind$2 = FunctionPrototype$1.bind;
333
+ var call$3 = FunctionPrototype$1.call;
334
+ var uncurryThis$c = NATIVE_BIND$1 && bind$2.bind(call$3, call$3);
370
335
 
371
- /**
372
- * Util method to judge if it should follow capture model
373
- */
374
- function isCapture (target) {
375
- target.prototype.isCapture = function (currentTarget) {
376
- return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
336
+ var functionUncurryThis = NATIVE_BIND$1 ? function (fn) {
337
+ return fn && uncurryThis$c(fn);
338
+ } : function (fn) {
339
+ return fn && function () {
340
+ return call$3.apply(fn, arguments);
377
341
  };
378
- }
342
+ };
379
343
 
380
- /**
381
- * Util method to get effect
382
- */
383
- function getEffect (target) {
384
- target.prototype.getEffect = function (currentTarget) {
385
- var dataEffect = currentTarget.getAttribute('data-effect');
386
- return dataEffect || this.props.effect || 'float';
387
- };
388
- }
344
+ var uncurryThis$b = functionUncurryThis;
389
345
 
390
- /**
391
- * Util method to get effect
392
- */
346
+ var toString$1 = uncurryThis$b({}.toString);
347
+ var stringSlice = uncurryThis$b(''.slice);
393
348
 
394
- var makeProxy = function makeProxy(e) {
395
- var proxy = {};
349
+ var classofRaw$1 = function (it) {
350
+ return stringSlice(toString$1(it), 8, -1);
351
+ };
396
352
 
397
- for (var key in e) {
398
- if (typeof e[key] === 'function') {
399
- proxy[key] = e[key].bind(e);
400
- } else {
401
- proxy[key] = e[key];
402
- }
403
- }
353
+ var uncurryThis$a = functionUncurryThis;
354
+ var fails$6 = fails$9;
355
+ var classof$3 = classofRaw$1;
404
356
 
405
- return proxy;
406
- };
357
+ var $Object$3 = Object;
358
+ var split = uncurryThis$a(''.split);
407
359
 
408
- var bodyListener = function bodyListener(callback, options, e) {
409
- var _options$respectEffec = options.respectEffect,
410
- respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
411
- _options$customEvent = options.customEvent,
412
- customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
413
- var id = this.props.id;
414
- var tip = e.target.getAttribute('data-tip') || null;
415
- var forId = e.target.getAttribute('data-for') || null;
416
- var target = e.target;
360
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
361
+ var indexedObject = fails$6(function () {
362
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
363
+ // eslint-disable-next-line no-prototype-builtins -- safe
364
+ return !$Object$3('z').propertyIsEnumerable(0);
365
+ }) ? function (it) {
366
+ return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
367
+ } : $Object$3;
417
368
 
418
- if (this.isCustomEvent(target) && !customEvent) {
419
- return;
420
- }
369
+ var $TypeError$5 = TypeError;
421
370
 
422
- var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
371
+ // `RequireObjectCoercible` abstract operation
372
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
373
+ var requireObjectCoercible$2 = function (it) {
374
+ if (it == undefined) throw $TypeError$5("Can't call method on " + it);
375
+ return it;
376
+ };
423
377
 
424
- if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
425
- var proxy = makeProxy(e);
426
- proxy.currentTarget = target;
427
- callback(proxy);
428
- }
378
+ // toObject with fallback for non-array-like ES3 strings
379
+ var IndexedObject$1 = indexedObject;
380
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
381
+
382
+ var toIndexedObject$4 = function (it) {
383
+ return IndexedObject$1(requireObjectCoercible$1(it));
429
384
  };
430
385
 
431
- var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
432
- var events = {};
433
- targetArray.forEach(function (target) {
434
- var event = target.getAttribute(dataAttribute);
435
- if (event) event.split(' ').forEach(function (event) {
436
- return events[event] = true;
437
- });
438
- });
439
- return events;
386
+ // `IsCallable` abstract operation
387
+ // https://tc39.es/ecma262/#sec-iscallable
388
+ var isCallable$c = function (argument) {
389
+ return typeof argument == 'function';
440
390
  };
441
391
 
442
- var getBody = function getBody() {
443
- return document.getElementsByTagName('body')[0];
392
+ var isCallable$b = isCallable$c;
393
+
394
+ var isObject$6 = function (it) {
395
+ return typeof it == 'object' ? it !== null : isCallable$b(it);
444
396
  };
445
397
 
446
- function bodyMode (target) {
447
- target.prototype.isBodyMode = function () {
448
- return !!this.props.bodyMode;
449
- };
398
+ var global$9 = global$a;
399
+ var isCallable$a = isCallable$c;
450
400
 
451
- target.prototype.bindBodyListener = function (targetArray) {
452
- var _this = this;
401
+ var aFunction = function (argument) {
402
+ return isCallable$a(argument) ? argument : undefined;
403
+ };
453
404
 
454
- var _this$state = this.state,
455
- event = _this$state.event,
456
- eventOff = _this$state.eventOff,
457
- possibleCustomEvents = _this$state.possibleCustomEvents,
458
- possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
459
- var body = getBody();
460
- var customEvents = findCustomEvents(targetArray, 'data-event');
461
- var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
462
- if (event != null) customEvents[event] = true;
463
- if (eventOff != null) customEventsOff[eventOff] = true;
464
- possibleCustomEvents.split(' ').forEach(function (event) {
465
- return customEvents[event] = true;
466
- });
467
- possibleCustomEventsOff.split(' ').forEach(function (event) {
468
- return customEventsOff[event] = true;
469
- });
470
- this.unbindBodyListener(body);
471
- var listeners = this.bodyModeListeners = {};
405
+ var getBuiltIn$5 = function (namespace, method) {
406
+ return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
407
+ };
472
408
 
473
- if (event == null) {
474
- listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
475
- listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
476
- respectEffect: true
477
- });
478
- listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
479
- }
409
+ var uncurryThis$9 = functionUncurryThis;
480
410
 
481
- for (var _event in customEvents) {
482
- listeners[_event] = bodyListener.bind(this, function (e) {
483
- var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
484
- checkStatus.call(_this, targetEventOff, e);
485
- }, {
486
- customEvent: true
487
- });
488
- }
411
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
489
412
 
490
- for (var _event2 in customEventsOff) {
491
- listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
492
- customEvent: true
493
- });
494
- }
413
+ var getBuiltIn$4 = getBuiltIn$5;
495
414
 
496
- for (var _event3 in listeners) {
497
- body.addEventListener(_event3, listeners[_event3]);
498
- }
499
- };
415
+ var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
500
416
 
501
- target.prototype.unbindBodyListener = function (body) {
502
- body = body || getBody();
503
- var listeners = this.bodyModeListeners;
417
+ var global$8 = global$a;
418
+ var userAgent = engineUserAgent;
504
419
 
505
- for (var event in listeners) {
506
- body.removeEventListener(event, listeners[event]);
507
- }
508
- };
420
+ var process = global$8.process;
421
+ var Deno = global$8.Deno;
422
+ var versions = process && process.versions || Deno && Deno.version;
423
+ var v8 = versions && versions.v8;
424
+ var match, version;
425
+
426
+ if (v8) {
427
+ match = v8.split('.');
428
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
429
+ // but their correct versions are not interesting for us
430
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
509
431
  }
510
432
 
511
- /**
512
- * Tracking target removing from DOM.
513
- * It's necessary to hide tooltip when it's target disappears.
514
- * Otherwise, the tooltip would be shown forever until another target
515
- * is triggered.
516
- *
517
- * If MutationObserver is not available, this feature just doesn't work.
518
- */
519
- // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
520
- var getMutationObserverClass = function getMutationObserverClass() {
521
- return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
522
- };
433
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
434
+ // so check `userAgent` even if `.v8` exists, but 0
435
+ if (!version && userAgent) {
436
+ match = userAgent.match(/Edge\/(\d+)/);
437
+ if (!match || match[1] >= 74) {
438
+ match = userAgent.match(/Chrome\/(\d+)/);
439
+ if (match) version = +match[1];
440
+ }
441
+ }
523
442
 
524
- function trackRemoval (target) {
525
- target.prototype.bindRemovalTracker = function () {
526
- var _this = this;
443
+ var engineV8Version = version;
527
444
 
528
- var MutationObserver = getMutationObserverClass();
529
- if (MutationObserver == null) return;
530
- var observer = new MutationObserver(function (mutations) {
531
- for (var m1 = 0; m1 < mutations.length; m1++) {
532
- var mutation = mutations[m1];
445
+ /* eslint-disable es-x/no-symbol -- required for testing */
533
446
 
534
- for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
535
- var element = mutation.removedNodes[m2];
447
+ var V8_VERSION = engineV8Version;
448
+ var fails$5 = fails$9;
536
449
 
537
- if (element === _this.state.currentTarget) {
538
- _this.hideTooltip();
450
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
451
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
452
+ var symbol = Symbol();
453
+ // Chrome 38 Symbol has incorrect toString conversion
454
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
455
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
456
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
457
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
458
+ });
539
459
 
540
- return;
541
- }
542
- }
543
- }
544
- });
545
- observer.observe(window.document, {
546
- childList: true,
547
- subtree: true
548
- });
549
- this.removalTracker = observer;
550
- };
460
+ /* eslint-disable es-x/no-symbol -- required for testing */
551
461
 
552
- target.prototype.unbindRemovalTracker = function () {
553
- if (this.removalTracker) {
554
- this.removalTracker.disconnect();
555
- this.removalTracker = null;
556
- }
557
- };
558
- }
462
+ var NATIVE_SYMBOL$1 = nativeSymbol;
559
463
 
560
- /**
561
- * Calculate the position of tooltip
562
- *
563
- * @params
564
- * - `e` {Event} the event of current mouse
565
- * - `target` {Element} the currentTarget of the event
566
- * - `node` {DOM} the react-tooltip object
567
- * - `place` {String} top / right / bottom / left
568
- * - `effect` {String} float / solid
569
- * - `offset` {Object} the offset to default position
570
- *
571
- * @return {Object}
572
- * - `isNewState` {Bool} required
573
- * - `newState` {Object}
574
- * - `position` {Object} {left: {Number}, top: {Number}}
575
- */
576
- function getPosition (e, target, node, place, desiredPlace, effect, offset) {
577
- var _getDimensions = getDimensions(node),
578
- tipWidth = _getDimensions.width,
579
- tipHeight = _getDimensions.height;
464
+ var useSymbolAsUid = NATIVE_SYMBOL$1
465
+ && !Symbol.sham
466
+ && typeof Symbol.iterator == 'symbol';
580
467
 
581
- var _getDimensions2 = getDimensions(target),
582
- targetWidth = _getDimensions2.width,
583
- targetHeight = _getDimensions2.height;
468
+ var getBuiltIn$3 = getBuiltIn$5;
469
+ var isCallable$9 = isCallable$c;
470
+ var isPrototypeOf = objectIsPrototypeOf;
471
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
584
472
 
585
- var _getCurrentOffset = getCurrentOffset(e, target, effect),
586
- mouseX = _getCurrentOffset.mouseX,
587
- mouseY = _getCurrentOffset.mouseY;
473
+ var $Object$2 = Object;
588
474
 
589
- var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
475
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
476
+ return typeof it == 'symbol';
477
+ } : function (it) {
478
+ var $Symbol = getBuiltIn$3('Symbol');
479
+ return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
480
+ };
590
481
 
591
- var _calculateOffset = calculateOffset(offset),
592
- extraOffsetX = _calculateOffset.extraOffsetX,
593
- extraOffsetY = _calculateOffset.extraOffsetY;
482
+ var $String$1 = String;
594
483
 
595
- var windowWidth = window.innerWidth;
596
- var windowHeight = window.innerHeight;
484
+ var tryToString$1 = function (argument) {
485
+ try {
486
+ return $String$1(argument);
487
+ } catch (error) {
488
+ return 'Object';
489
+ }
490
+ };
597
491
 
598
- var _getParent = getParent(node),
599
- parentTop = _getParent.parentTop,
600
- parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
492
+ var isCallable$8 = isCallable$c;
493
+ var tryToString = tryToString$1;
601
494
 
495
+ var $TypeError$4 = TypeError;
602
496
 
603
- var getTipOffsetLeft = function getTipOffsetLeft(place) {
604
- var offsetX = defaultOffset[place].l;
605
- return mouseX + offsetX + extraOffsetX;
606
- };
497
+ // `Assert: IsCallable(argument) is true`
498
+ var aCallable$2 = function (argument) {
499
+ if (isCallable$8(argument)) return argument;
500
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
501
+ };
607
502
 
608
- var getTipOffsetRight = function getTipOffsetRight(place) {
609
- var offsetX = defaultOffset[place].r;
610
- return mouseX + offsetX + extraOffsetX;
611
- };
503
+ var aCallable$1 = aCallable$2;
612
504
 
613
- var getTipOffsetTop = function getTipOffsetTop(place) {
614
- var offsetY = defaultOffset[place].t;
615
- return mouseY + offsetY + extraOffsetY;
616
- };
505
+ // `GetMethod` abstract operation
506
+ // https://tc39.es/ecma262/#sec-getmethod
507
+ var getMethod$1 = function (V, P) {
508
+ var func = V[P];
509
+ return func == null ? undefined : aCallable$1(func);
510
+ };
617
511
 
618
- var getTipOffsetBottom = function getTipOffsetBottom(place) {
619
- var offsetY = defaultOffset[place].b;
620
- return mouseY + offsetY + extraOffsetY;
621
- }; //
622
- // Functions to test whether the tooltip's sides are inside
623
- // the client window for a given orientation p
624
- //
625
- // _____________
626
- // | | <-- Right side
627
- // | p = 'left' |\
628
- // | |/ |\
629
- // |_____________| |_\ <-- Mouse
630
- // / \ |
631
- // |
632
- // |
633
- // Bottom side
634
- //
512
+ var call$2 = functionCall;
513
+ var isCallable$7 = isCallable$c;
514
+ var isObject$5 = isObject$6;
635
515
 
516
+ var $TypeError$3 = TypeError;
636
517
 
637
- var outsideLeft = function outsideLeft(p) {
638
- return getTipOffsetLeft(p) < 0;
639
- };
518
+ // `OrdinaryToPrimitive` abstract operation
519
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
520
+ var ordinaryToPrimitive$1 = function (input, pref) {
521
+ var fn, val;
522
+ if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
523
+ if (isCallable$7(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
524
+ if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
525
+ throw $TypeError$3("Can't convert object to primitive value");
526
+ };
640
527
 
641
- var outsideRight = function outsideRight(p) {
642
- return getTipOffsetRight(p) > windowWidth;
643
- };
528
+ var shared$3 = {exports: {}};
644
529
 
645
- var outsideTop = function outsideTop(p) {
646
- return getTipOffsetTop(p) < 0;
647
- };
530
+ var global$7 = global$a;
648
531
 
649
- var outsideBottom = function outsideBottom(p) {
650
- return getTipOffsetBottom(p) > windowHeight;
651
- }; // Check whether the tooltip with orientation p is completely inside the client window
532
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
533
+ var defineProperty$2 = Object.defineProperty;
652
534
 
535
+ var defineGlobalProperty$3 = function (key, value) {
536
+ try {
537
+ defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
538
+ } catch (error) {
539
+ global$7[key] = value;
540
+ } return value;
541
+ };
653
542
 
654
- var outside = function outside(p) {
655
- return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
656
- };
543
+ var global$6 = global$a;
544
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
657
545
 
658
- var inside = function inside(p) {
659
- return !outside(p);
660
- };
546
+ var SHARED = '__core-js_shared__';
547
+ var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
661
548
 
662
- var placesList = ['top', 'bottom', 'left', 'right'];
663
- var insideList = [];
549
+ var sharedStore = store$3;
664
550
 
665
- for (var i = 0; i < 4; i++) {
666
- var p = placesList[i];
551
+ var store$2 = sharedStore;
667
552
 
668
- if (inside(p)) {
669
- insideList.push(p);
670
- }
671
- }
553
+ (shared$3.exports = function (key, value) {
554
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
555
+ })('versions', []).push({
556
+ version: '3.24.1',
557
+ mode: 'global',
558
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
559
+ license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',
560
+ source: 'https://github.com/zloirock/core-js'
561
+ });
672
562
 
673
- var isNewState = false;
674
- var newPlace;
675
- var shouldUpdatePlace = desiredPlace !== place;
563
+ var requireObjectCoercible = requireObjectCoercible$2;
676
564
 
677
- if (inside(desiredPlace) && shouldUpdatePlace) {
678
- isNewState = true;
679
- newPlace = desiredPlace;
680
- } else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {
681
- isNewState = true;
682
- newPlace = insideList[0];
683
- }
565
+ var $Object$1 = Object;
684
566
 
685
- if (isNewState) {
686
- return {
687
- isNewState: true,
688
- newState: {
689
- place: newPlace
690
- }
691
- };
692
- }
567
+ // `ToObject` abstract operation
568
+ // https://tc39.es/ecma262/#sec-toobject
569
+ var toObject$2 = function (argument) {
570
+ return $Object$1(requireObjectCoercible(argument));
571
+ };
693
572
 
694
- return {
695
- isNewState: false,
696
- position: {
697
- left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
698
- top: parseInt(getTipOffsetTop(place) - parentTop, 10)
699
- }
700
- };
701
- }
573
+ var uncurryThis$8 = functionUncurryThis;
574
+ var toObject$1 = toObject$2;
702
575
 
703
- var getDimensions = function getDimensions(node) {
704
- var _node$getBoundingClie = node.getBoundingClientRect(),
705
- height = _node$getBoundingClie.height,
706
- width = _node$getBoundingClie.width;
576
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
707
577
 
708
- return {
709
- height: parseInt(height, 10),
710
- width: parseInt(width, 10)
711
- };
712
- }; // Get current mouse offset
578
+ // `HasOwnProperty` abstract operation
579
+ // https://tc39.es/ecma262/#sec-hasownproperty
580
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
581
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
582
+ return hasOwnProperty(toObject$1(it), key);
583
+ };
713
584
 
585
+ var uncurryThis$7 = functionUncurryThis;
714
586
 
715
- var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
716
- var boundingClientRect = currentTarget.getBoundingClientRect();
717
- var targetTop = boundingClientRect.top;
718
- var targetLeft = boundingClientRect.left;
587
+ var id = 0;
588
+ var postfix = Math.random();
589
+ var toString = uncurryThis$7(1.0.toString);
719
590
 
720
- var _getDimensions3 = getDimensions(currentTarget),
721
- targetWidth = _getDimensions3.width,
722
- targetHeight = _getDimensions3.height;
591
+ var uid$2 = function (key) {
592
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
593
+ };
723
594
 
724
- if (effect === 'float') {
725
- return {
726
- mouseX: e.clientX,
727
- mouseY: e.clientY
728
- };
729
- }
595
+ var global$5 = global$a;
596
+ var shared$2 = shared$3.exports;
597
+ var hasOwn$6 = hasOwnProperty_1;
598
+ var uid$1 = uid$2;
599
+ var NATIVE_SYMBOL = nativeSymbol;
600
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
730
601
 
731
- return {
732
- mouseX: targetLeft + targetWidth / 2,
733
- mouseY: targetTop + targetHeight / 2
734
- };
735
- }; // List all possibility of tooltip final offset
736
- // This is useful in judging if it is necessary for tooltip to switch position when out of window
602
+ var WellKnownSymbolsStore = shared$2('wks');
603
+ var Symbol$1 = global$5.Symbol;
604
+ var symbolFor = Symbol$1 && Symbol$1['for'];
605
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
737
606
 
607
+ var wellKnownSymbol$5 = function (name) {
608
+ if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
609
+ var description = 'Symbol.' + name;
610
+ if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
611
+ WellKnownSymbolsStore[name] = Symbol$1[name];
612
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
613
+ WellKnownSymbolsStore[name] = symbolFor(description);
614
+ } else {
615
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
616
+ }
617
+ } return WellKnownSymbolsStore[name];
618
+ };
738
619
 
739
- var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
740
- var top;
741
- var right;
742
- var bottom;
743
- var left;
744
- var disToMouse = 3;
745
- var triangleHeight = 2;
746
- var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
620
+ var call$1 = functionCall;
621
+ var isObject$4 = isObject$6;
622
+ var isSymbol$1 = isSymbol$2;
623
+ var getMethod = getMethod$1;
624
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
625
+ var wellKnownSymbol$4 = wellKnownSymbol$5;
747
626
 
748
- if (effect === 'float') {
749
- top = {
750
- l: -(tipWidth / 2),
751
- r: tipWidth / 2,
752
- t: -(tipHeight + disToMouse + triangleHeight),
753
- b: -disToMouse
754
- };
755
- bottom = {
756
- l: -(tipWidth / 2),
757
- r: tipWidth / 2,
758
- t: disToMouse + cursorHeight,
759
- b: tipHeight + disToMouse + triangleHeight + cursorHeight
760
- };
761
- left = {
762
- l: -(tipWidth + disToMouse + triangleHeight),
763
- r: -disToMouse,
764
- t: -(tipHeight / 2),
765
- b: tipHeight / 2
766
- };
767
- right = {
768
- l: disToMouse,
769
- r: tipWidth + disToMouse + triangleHeight,
770
- t: -(tipHeight / 2),
771
- b: tipHeight / 2
772
- };
773
- } else if (effect === 'solid') {
774
- top = {
775
- l: -(tipWidth / 2),
776
- r: tipWidth / 2,
777
- t: -(targetHeight / 2 + tipHeight + triangleHeight),
778
- b: -(targetHeight / 2)
779
- };
780
- bottom = {
781
- l: -(tipWidth / 2),
782
- r: tipWidth / 2,
783
- t: targetHeight / 2,
784
- b: targetHeight / 2 + tipHeight + triangleHeight
785
- };
786
- left = {
787
- l: -(tipWidth + targetWidth / 2 + triangleHeight),
788
- r: -(targetWidth / 2),
789
- t: -(tipHeight / 2),
790
- b: tipHeight / 2
791
- };
792
- right = {
793
- l: targetWidth / 2,
794
- r: tipWidth + targetWidth / 2 + triangleHeight,
795
- t: -(tipHeight / 2),
796
- b: tipHeight / 2
797
- };
798
- }
627
+ var $TypeError$2 = TypeError;
628
+ var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
799
629
 
800
- return {
801
- top: top,
802
- bottom: bottom,
803
- left: left,
804
- right: right
805
- };
806
- }; // Consider additional offset into position calculation
630
+ // `ToPrimitive` abstract operation
631
+ // https://tc39.es/ecma262/#sec-toprimitive
632
+ var toPrimitive$1 = function (input, pref) {
633
+ if (!isObject$4(input) || isSymbol$1(input)) return input;
634
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
635
+ var result;
636
+ if (exoticToPrim) {
637
+ if (pref === undefined) pref = 'default';
638
+ result = call$1(exoticToPrim, input, pref);
639
+ if (!isObject$4(result) || isSymbol$1(result)) return result;
640
+ throw $TypeError$2("Can't convert object to primitive value");
641
+ }
642
+ if (pref === undefined) pref = 'number';
643
+ return ordinaryToPrimitive(input, pref);
644
+ };
807
645
 
646
+ var toPrimitive = toPrimitive$1;
647
+ var isSymbol = isSymbol$2;
808
648
 
809
- var calculateOffset = function calculateOffset(offset) {
810
- var extraOffsetX = 0;
811
- var extraOffsetY = 0;
649
+ // `ToPropertyKey` abstract operation
650
+ // https://tc39.es/ecma262/#sec-topropertykey
651
+ var toPropertyKey$2 = function (argument) {
652
+ var key = toPrimitive(argument, 'string');
653
+ return isSymbol(key) ? key : key + '';
654
+ };
812
655
 
813
- if (Object.prototype.toString.apply(offset) === '[object String]') {
814
- offset = JSON.parse(offset.toString().replace(/'/g, '"'));
815
- }
656
+ var global$4 = global$a;
657
+ var isObject$3 = isObject$6;
816
658
 
817
- for (var key in offset) {
818
- if (key === 'top') {
819
- extraOffsetY -= parseInt(offset[key], 10);
820
- } else if (key === 'bottom') {
821
- extraOffsetY += parseInt(offset[key], 10);
822
- } else if (key === 'left') {
823
- extraOffsetX -= parseInt(offset[key], 10);
824
- } else if (key === 'right') {
825
- extraOffsetX += parseInt(offset[key], 10);
826
- }
827
- }
659
+ var document$1 = global$4.document;
660
+ // typeof document.createElement is 'object' in old IE
661
+ var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
828
662
 
829
- return {
830
- extraOffsetX: extraOffsetX,
831
- extraOffsetY: extraOffsetY
832
- };
833
- }; // Get the offset of the parent elements
663
+ var documentCreateElement$1 = function (it) {
664
+ return EXISTS$1 ? document$1.createElement(it) : {};
665
+ };
834
666
 
667
+ var DESCRIPTORS$7 = descriptors;
668
+ var fails$4 = fails$9;
669
+ var createElement = documentCreateElement$1;
835
670
 
836
- var getParent = function getParent(currentTarget) {
837
- var currentParent = currentTarget;
671
+ // Thanks to IE8 for its funny defineProperty
672
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
673
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
674
+ return Object.defineProperty(createElement('div'), 'a', {
675
+ get: function () { return 7; }
676
+ }).a != 7;
677
+ });
838
678
 
839
- while (currentParent) {
840
- var computedStyle = window.getComputedStyle(currentParent); // transform and will-change: transform change the containing block
841
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
679
+ var DESCRIPTORS$6 = descriptors;
680
+ var call = functionCall;
681
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
682
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
683
+ var toIndexedObject$3 = toIndexedObject$4;
684
+ var toPropertyKey$1 = toPropertyKey$2;
685
+ var hasOwn$5 = hasOwnProperty_1;
686
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
842
687
 
843
- if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
844
- currentParent = currentParent.parentElement;
845
- }
688
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
689
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
846
690
 
847
- var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
848
- var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
849
- return {
850
- parentTop: parentTop,
851
- parentLeft: parentLeft
852
- };
691
+ // `Object.getOwnPropertyDescriptor` method
692
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
693
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
694
+ O = toIndexedObject$3(O);
695
+ P = toPropertyKey$1(P);
696
+ if (IE8_DOM_DEFINE$1) try {
697
+ return $getOwnPropertyDescriptor$1(O, P);
698
+ } catch (error) { /* empty */ }
699
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
853
700
  };
854
701
 
855
- /**
856
- * To get the tooltip content
857
- * it may comes from data-tip or this.props.children
858
- * it should support multiline
859
- *
860
- * @params
861
- * - `tip` {String} value of data-tip
862
- * - `children` {ReactElement} this.props.children
863
- * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
864
- *
865
- * @return
866
- * - String or react component
867
- */
868
- function getTipContent (tip, children, getContent, multiline) {
869
- if (children) return children;
870
- if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
702
+ var objectDefineProperty = {};
871
703
 
872
- if (getContent === null) return null; // Tip not exist and children is null or undefined
704
+ var DESCRIPTORS$5 = descriptors;
705
+ var fails$3 = fails$9;
873
706
 
874
- var regexp = /<br\s*\/?>/;
707
+ // V8 ~ Chrome 36-
708
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
709
+ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
710
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
711
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
712
+ value: 42,
713
+ writable: false
714
+ }).prototype != 42;
715
+ });
875
716
 
876
- if (!multiline || multiline === 'false' || !regexp.test(tip)) {
877
- // No trim(), so that user can keep their input
878
- return tip;
879
- } // Multiline tooltip content
880
-
881
-
882
- return tip.split(regexp).map(function (d, i) {
883
- return React.createElement("span", {
884
- key: i,
885
- className: "multi-line"
886
- }, d);
887
- });
888
- }
717
+ var isObject$2 = isObject$6;
889
718
 
890
- /**
891
- * Support aria- and role in ReactTooltip
892
- *
893
- * @params props {Object}
894
- * @return {Object}
895
- */
896
- function parseAria(props) {
897
- var ariaObj = {};
898
- Object.keys(props).filter(function (prop) {
899
- // aria-xxx and role is acceptable
900
- return /(^aria-\w+$|^role$)/.test(prop);
901
- }).forEach(function (prop) {
902
- ariaObj[prop] = props[prop];
903
- });
904
- return ariaObj;
905
- }
719
+ var $String = String;
720
+ var $TypeError$1 = TypeError;
906
721
 
907
- /**
908
- * Convert nodelist to array
909
- * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
910
- * NodeLists are functions in Safari
911
- */
912
- function nodeListToArray (nodeList) {
913
- var length = nodeList.length;
722
+ // `Assert: Type(argument) is Object`
723
+ var anObject$4 = function (argument) {
724
+ if (isObject$2(argument)) return argument;
725
+ throw $TypeError$1($String(argument) + ' is not an object');
726
+ };
914
727
 
915
- if (nodeList.hasOwnProperty) {
916
- return Array.prototype.slice.call(nodeList);
917
- }
728
+ var DESCRIPTORS$4 = descriptors;
729
+ var IE8_DOM_DEFINE = ie8DomDefine;
730
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
731
+ var anObject$3 = anObject$4;
732
+ var toPropertyKey = toPropertyKey$2;
918
733
 
919
- return new Array(length).fill().map(function (index) {
920
- return nodeList[index];
921
- });
922
- }
734
+ var $TypeError = TypeError;
735
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
736
+ var $defineProperty = Object.defineProperty;
737
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
738
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
739
+ var ENUMERABLE = 'enumerable';
740
+ var CONFIGURABLE$1 = 'configurable';
741
+ var WRITABLE = 'writable';
923
742
 
924
- function generateUUID() {
925
- return 't' + uuid.v4();
926
- }
743
+ // `Object.defineProperty` method
744
+ // https://tc39.es/ecma262/#sec-object.defineproperty
745
+ objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
746
+ anObject$3(O);
747
+ P = toPropertyKey(P);
748
+ anObject$3(Attributes);
749
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
750
+ var current = $getOwnPropertyDescriptor(O, P);
751
+ if (current && current[WRITABLE]) {
752
+ O[P] = Attributes.value;
753
+ Attributes = {
754
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
755
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
756
+ writable: false
757
+ };
758
+ }
759
+ } return $defineProperty(O, P, Attributes);
760
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
761
+ anObject$3(O);
762
+ P = toPropertyKey(P);
763
+ anObject$3(Attributes);
764
+ if (IE8_DOM_DEFINE) try {
765
+ return $defineProperty(O, P, Attributes);
766
+ } catch (error) { /* empty */ }
767
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
768
+ if ('value' in Attributes) O[P] = Attributes.value;
769
+ return O;
770
+ };
927
771
 
928
- var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n padding: 8px 21px;\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 border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
772
+ var DESCRIPTORS$3 = descriptors;
773
+ var definePropertyModule$3 = objectDefineProperty;
774
+ var createPropertyDescriptor = createPropertyDescriptor$2;
929
775
 
930
- /**
931
- * Default pop-up style values (text color, background color).
932
- */
933
- var defaultColors = {
934
- dark: {
935
- text: '#fff',
936
- background: '#222',
937
- border: 'transparent',
938
- arrow: '#222'
939
- },
940
- success: {
941
- text: '#fff',
942
- background: '#8DC572',
943
- border: 'transparent',
944
- arrow: '#8DC572'
945
- },
946
- warning: {
947
- text: '#fff',
948
- background: '#F0AD4E',
949
- border: 'transparent',
950
- arrow: '#F0AD4E'
951
- },
952
- error: {
953
- text: '#fff',
954
- background: '#BE6464',
955
- border: 'transparent',
956
- arrow: '#BE6464'
957
- },
958
- info: {
959
- text: '#fff',
960
- background: '#337AB7',
961
- border: 'transparent',
962
- arrow: '#337AB7'
963
- },
964
- light: {
965
- text: '#222',
966
- background: '#fff',
967
- border: 'transparent',
968
- arrow: '#fff'
969
- }
776
+ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
777
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
778
+ } : function (object, key, value) {
779
+ object[key] = value;
780
+ return object;
970
781
  };
971
- function getDefaultPopupColors(type) {
972
- return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
973
- }
974
-
975
- /**
976
- * Generates the specific tooltip style for use on render.
977
- */
978
782
 
979
- function generateTooltipStyle(uuid, customColors, type, hasBorder) {
980
- return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));
981
- }
982
- /**
983
- * Generates the tooltip style rules based on the element-specified "data-type" property.
984
- */
783
+ var makeBuiltIn$2 = {exports: {}};
985
784
 
986
- function generateStyle(uuid, colors) {
987
- var textColor = colors.text;
988
- var backgroundColor = colors.background;
989
- var borderColor = colors.border;
990
- var arrowColor = colors.arrow;
991
- return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n border-top: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(arrowColor, ";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n border-bottom: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(arrowColor, ";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n border-left: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(arrowColor, ";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n border-right: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(arrowColor, ";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ");
992
- }
785
+ var DESCRIPTORS$2 = descriptors;
786
+ var hasOwn$4 = hasOwnProperty_1;
993
787
 
994
- function getPopupColors(customColors, type, hasBorder) {
995
- var textColor = customColors.text;
996
- var backgroundColor = customColors.background;
997
- var borderColor = customColors.border;
998
- var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
999
- var colors = getDefaultPopupColors(type);
788
+ var FunctionPrototype = Function.prototype;
789
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
790
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
1000
791
 
1001
- if (textColor) {
1002
- colors.text = textColor;
1003
- }
792
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
793
+ // additional protection from minified / mangled / dropped function names
794
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
795
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
1004
796
 
1005
- if (backgroundColor) {
1006
- colors.background = backgroundColor;
1007
- }
797
+ var functionName = {
798
+ EXISTS: EXISTS,
799
+ PROPER: PROPER,
800
+ CONFIGURABLE: CONFIGURABLE
801
+ };
1008
802
 
1009
- if (hasBorder) {
1010
- if (borderColor) {
1011
- colors.border = borderColor;
1012
- } else {
1013
- colors.border = type === 'light' ? 'black' : 'white';
1014
- }
1015
- }
803
+ var uncurryThis$6 = functionUncurryThis;
804
+ var isCallable$6 = isCallable$c;
805
+ var store$1 = sharedStore;
1016
806
 
1017
- if (arrowColor) {
1018
- colors.arrow = arrowColor;
1019
- }
807
+ var functionToString = uncurryThis$6(Function.toString);
1020
808
 
1021
- return colors;
809
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
810
+ if (!isCallable$6(store$1.inspectSource)) {
811
+ store$1.inspectSource = function (it) {
812
+ return functionToString(it);
813
+ };
1022
814
  }
1023
815
 
1024
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
816
+ var inspectSource$3 = store$1.inspectSource;
1025
817
 
1026
- function createCommonjsModule(fn, module) {
1027
- return module = { exports: {} }, fn(module, module.exports), module.exports;
1028
- }
818
+ var global$3 = global$a;
819
+ var isCallable$5 = isCallable$c;
820
+ var inspectSource$2 = inspectSource$3;
1029
821
 
1030
- var check = function (it) {
1031
- return it && it.Math == Math && it;
1032
- };
822
+ var WeakMap$1 = global$3.WeakMap;
1033
823
 
1034
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
1035
- var global_1 =
1036
- // eslint-disable-next-line es/no-global-this -- safe
1037
- check(typeof globalThis == 'object' && globalThis) ||
1038
- check(typeof window == 'object' && window) ||
1039
- // eslint-disable-next-line no-restricted-globals -- safe
1040
- check(typeof self == 'object' && self) ||
1041
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
1042
- // eslint-disable-next-line no-new-func -- fallback
1043
- (function () { return this; })() || Function('return this')();
824
+ var nativeWeakMap = isCallable$5(WeakMap$1) && /native code/.test(inspectSource$2(WeakMap$1));
1044
825
 
1045
- var fails = function (exec) {
1046
- try {
1047
- return !!exec();
1048
- } catch (error) {
1049
- return true;
1050
- }
1051
- };
826
+ var shared$1 = shared$3.exports;
827
+ var uid = uid$2;
1052
828
 
1053
- // Detect IE8's incomplete defineProperty implementation
1054
- var descriptors = !fails(function () {
1055
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1056
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
1057
- });
829
+ var keys = shared$1('keys');
1058
830
 
1059
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
1060
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1061
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
831
+ var sharedKey$2 = function (key) {
832
+ return keys[key] || (keys[key] = uid(key));
833
+ };
1062
834
 
1063
- // Nashorn ~ JDK8 bug
1064
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
835
+ var hiddenKeys$4 = {};
1065
836
 
1066
- // `Object.prototype.propertyIsEnumerable` method implementation
1067
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
1068
- var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
1069
- var descriptor = getOwnPropertyDescriptor(this, V);
1070
- return !!descriptor && descriptor.enumerable;
1071
- } : $propertyIsEnumerable;
837
+ var NATIVE_WEAK_MAP = nativeWeakMap;
838
+ var global$2 = global$a;
839
+ var uncurryThis$5 = functionUncurryThis;
840
+ var isObject$1 = isObject$6;
841
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
842
+ var hasOwn$3 = hasOwnProperty_1;
843
+ var shared = sharedStore;
844
+ var sharedKey$1 = sharedKey$2;
845
+ var hiddenKeys$3 = hiddenKeys$4;
846
+
847
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
848
+ var TypeError$1 = global$2.TypeError;
849
+ var WeakMap = global$2.WeakMap;
850
+ var set, get, has;
1072
851
 
1073
- var objectPropertyIsEnumerable = {
1074
- f: f
852
+ var enforce = function (it) {
853
+ return has(it) ? get(it) : set(it, {});
1075
854
  };
1076
855
 
1077
- var createPropertyDescriptor = function (bitmap, value) {
1078
- return {
1079
- enumerable: !(bitmap & 1),
1080
- configurable: !(bitmap & 2),
1081
- writable: !(bitmap & 4),
1082
- value: value
856
+ var getterFor = function (TYPE) {
857
+ return function (it) {
858
+ var state;
859
+ if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
860
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
861
+ } return state;
1083
862
  };
1084
863
  };
1085
864
 
1086
- var toString = {}.toString;
865
+ if (NATIVE_WEAK_MAP || shared.state) {
866
+ var store = shared.state || (shared.state = new WeakMap());
867
+ var wmget = uncurryThis$5(store.get);
868
+ var wmhas = uncurryThis$5(store.has);
869
+ var wmset = uncurryThis$5(store.set);
870
+ set = function (it, metadata) {
871
+ if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
872
+ metadata.facade = it;
873
+ wmset(store, it, metadata);
874
+ return metadata;
875
+ };
876
+ get = function (it) {
877
+ return wmget(store, it) || {};
878
+ };
879
+ has = function (it) {
880
+ return wmhas(store, it);
881
+ };
882
+ } else {
883
+ var STATE = sharedKey$1('state');
884
+ hiddenKeys$3[STATE] = true;
885
+ set = function (it, metadata) {
886
+ if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
887
+ metadata.facade = it;
888
+ createNonEnumerableProperty$1(it, STATE, metadata);
889
+ return metadata;
890
+ };
891
+ get = function (it) {
892
+ return hasOwn$3(it, STATE) ? it[STATE] : {};
893
+ };
894
+ has = function (it) {
895
+ return hasOwn$3(it, STATE);
896
+ };
897
+ }
1087
898
 
1088
- var classofRaw = function (it) {
1089
- return toString.call(it).slice(8, -1);
899
+ var internalState = {
900
+ set: set,
901
+ get: get,
902
+ has: has,
903
+ enforce: enforce,
904
+ getterFor: getterFor
1090
905
  };
1091
906
 
1092
- var split = ''.split;
1093
-
1094
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
1095
- var indexedObject = fails(function () {
1096
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
1097
- // eslint-disable-next-line no-prototype-builtins -- safe
1098
- return !Object('z').propertyIsEnumerable(0);
1099
- }) ? function (it) {
1100
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
1101
- } : Object;
1102
-
1103
- // `RequireObjectCoercible` abstract operation
1104
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
1105
- var requireObjectCoercible = function (it) {
1106
- if (it == undefined) throw TypeError("Can't call method on " + it);
1107
- return it;
1108
- };
907
+ var fails$2 = fails$9;
908
+ var isCallable$4 = isCallable$c;
909
+ var hasOwn$2 = hasOwnProperty_1;
910
+ var DESCRIPTORS$1 = descriptors;
911
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
912
+ var inspectSource$1 = inspectSource$3;
913
+ var InternalStateModule = internalState;
1109
914
 
1110
- // toObject with fallback for non-array-like ES3 strings
915
+ var enforceInternalState = InternalStateModule.enforce;
916
+ var getInternalState = InternalStateModule.get;
917
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
918
+ var defineProperty$1 = Object.defineProperty;
1111
919
 
920
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
921
+ return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
922
+ });
1112
923
 
924
+ var TEMPLATE = String(String).split('String');
1113
925
 
1114
- var toIndexedObject = function (it) {
1115
- return indexedObject(requireObjectCoercible(it));
926
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
927
+ if (String(name).slice(0, 7) === 'Symbol(') {
928
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
929
+ }
930
+ if (options && options.getter) name = 'get ' + name;
931
+ if (options && options.setter) name = 'set ' + name;
932
+ if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
933
+ if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
934
+ else value.name = name;
935
+ }
936
+ if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
937
+ defineProperty$1(value, 'length', { value: options.arity });
938
+ }
939
+ try {
940
+ if (options && hasOwn$2(options, 'constructor') && options.constructor) {
941
+ if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
942
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
943
+ } else if (value.prototype) value.prototype = undefined;
944
+ } catch (error) { /* empty */ }
945
+ var state = enforceInternalState(value);
946
+ if (!hasOwn$2(state, 'source')) {
947
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
948
+ } return value;
1116
949
  };
1117
950
 
1118
- var isObject = function (it) {
1119
- return typeof it === 'object' ? it !== null : typeof it === 'function';
951
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
952
+ // eslint-disable-next-line no-extend-native -- required
953
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
954
+ return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
955
+ }, 'toString');
956
+
957
+ var isCallable$3 = isCallable$c;
958
+ var definePropertyModule$2 = objectDefineProperty;
959
+ var makeBuiltIn = makeBuiltIn$2.exports;
960
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
961
+
962
+ var defineBuiltIn$1 = function (O, key, value, options) {
963
+ if (!options) options = {};
964
+ var simple = options.enumerable;
965
+ var name = options.name !== undefined ? options.name : key;
966
+ if (isCallable$3(value)) makeBuiltIn(value, name, options);
967
+ if (options.global) {
968
+ if (simple) O[key] = value;
969
+ else defineGlobalProperty$1(key, value);
970
+ } else {
971
+ try {
972
+ if (!options.unsafe) delete O[key];
973
+ else if (O[key]) simple = true;
974
+ } catch (error) { /* empty */ }
975
+ if (simple) O[key] = value;
976
+ else definePropertyModule$2.f(O, key, {
977
+ value: value,
978
+ enumerable: false,
979
+ configurable: !options.nonConfigurable,
980
+ writable: !options.nonWritable
981
+ });
982
+ } return O;
1120
983
  };
1121
984
 
1122
- // `ToPrimitive` abstract operation
1123
- // https://tc39.es/ecma262/#sec-toprimitive
1124
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
1125
- // and the second argument - flag - preferred type is a string
1126
- var toPrimitive = function (input, PREFERRED_STRING) {
1127
- if (!isObject(input)) return input;
1128
- var fn, val;
1129
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1130
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
1131
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1132
- throw TypeError("Can't convert object to primitive value");
1133
- };
985
+ var objectGetOwnPropertyNames = {};
1134
986
 
1135
- // `ToObject` abstract operation
1136
- // https://tc39.es/ecma262/#sec-toobject
1137
- var toObject = function (argument) {
1138
- return Object(requireObjectCoercible(argument));
987
+ var ceil = Math.ceil;
988
+ var floor = Math.floor;
989
+
990
+ // `Math.trunc` method
991
+ // https://tc39.es/ecma262/#sec-math.trunc
992
+ // eslint-disable-next-line es-x/no-math-trunc -- safe
993
+ var mathTrunc = Math.trunc || function trunc(x) {
994
+ var n = +x;
995
+ return (n > 0 ? floor : ceil)(n);
1139
996
  };
1140
997
 
1141
- var hasOwnProperty = {}.hasOwnProperty;
998
+ var trunc = mathTrunc;
1142
999
 
1143
- var has = function hasOwn(it, key) {
1144
- return hasOwnProperty.call(toObject(it), key);
1000
+ // `ToIntegerOrInfinity` abstract operation
1001
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
1002
+ var toIntegerOrInfinity$2 = function (argument) {
1003
+ var number = +argument;
1004
+ // eslint-disable-next-line no-self-compare -- NaN check
1005
+ return number !== number || number === 0 ? 0 : trunc(number);
1145
1006
  };
1146
1007
 
1147
- var document$1 = global_1.document;
1148
- // typeof document.createElement is 'object' in old IE
1149
- var EXISTS = isObject(document$1) && isObject(document$1.createElement);
1008
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1009
+
1010
+ var max = Math.max;
1011
+ var min$1 = Math.min;
1150
1012
 
1151
- var documentCreateElement = function (it) {
1152
- return EXISTS ? document$1.createElement(it) : {};
1013
+ // Helper for a popular repeating case of the spec:
1014
+ // Let integer be ? ToInteger(index).
1015
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1016
+ var toAbsoluteIndex$1 = function (index, length) {
1017
+ var integer = toIntegerOrInfinity$1(index);
1018
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1153
1019
  };
1154
1020
 
1155
- // Thank's IE8 for his funny defineProperty
1156
- var ie8DomDefine = !descriptors && !fails(function () {
1157
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
1158
- return Object.defineProperty(documentCreateElement('div'), 'a', {
1159
- get: function () { return 7; }
1160
- }).a != 7;
1161
- });
1021
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
1162
1022
 
1163
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1164
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1023
+ var min = Math.min;
1165
1024
 
1166
- // `Object.getOwnPropertyDescriptor` method
1167
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
1168
- var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
1169
- O = toIndexedObject(O);
1170
- P = toPrimitive(P, true);
1171
- if (ie8DomDefine) try {
1172
- return $getOwnPropertyDescriptor(O, P);
1173
- } catch (error) { /* empty */ }
1174
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
1025
+ // `ToLength` abstract operation
1026
+ // https://tc39.es/ecma262/#sec-tolength
1027
+ var toLength$1 = function (argument) {
1028
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1175
1029
  };
1176
1030
 
1177
- var objectGetOwnPropertyDescriptor = {
1178
- f: f$1
1179
- };
1031
+ var toLength = toLength$1;
1180
1032
 
1181
- var anObject = function (it) {
1182
- if (!isObject(it)) {
1183
- throw TypeError(String(it) + ' is not an object');
1184
- } return it;
1033
+ // `LengthOfArrayLike` abstract operation
1034
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
1035
+ var lengthOfArrayLike$2 = function (obj) {
1036
+ return toLength(obj.length);
1185
1037
  };
1186
1038
 
1187
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1188
- var $defineProperty = Object.defineProperty;
1189
-
1190
- // `Object.defineProperty` method
1191
- // https://tc39.es/ecma262/#sec-object.defineproperty
1192
- var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
1193
- anObject(O);
1194
- P = toPrimitive(P, true);
1195
- anObject(Attributes);
1196
- if (ie8DomDefine) try {
1197
- return $defineProperty(O, P, Attributes);
1198
- } catch (error) { /* empty */ }
1199
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
1200
- if ('value' in Attributes) O[P] = Attributes.value;
1201
- return O;
1202
- };
1203
-
1204
- var objectDefineProperty = {
1205
- f: f$2
1206
- };
1207
-
1208
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
1209
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
1210
- } : function (object, key, value) {
1211
- object[key] = value;
1212
- return object;
1213
- };
1214
-
1215
- var setGlobal = function (key, value) {
1216
- try {
1217
- createNonEnumerableProperty(global_1, key, value);
1218
- } catch (error) {
1219
- global_1[key] = value;
1220
- } return value;
1221
- };
1222
-
1223
- var SHARED = '__core-js_shared__';
1224
- var store = global_1[SHARED] || setGlobal(SHARED, {});
1225
-
1226
- var sharedStore = store;
1227
-
1228
- var functionToString = Function.toString;
1229
-
1230
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
1231
- if (typeof sharedStore.inspectSource != 'function') {
1232
- sharedStore.inspectSource = function (it) {
1233
- return functionToString.call(it);
1234
- };
1235
- }
1236
-
1237
- var inspectSource = sharedStore.inspectSource;
1238
-
1239
- var WeakMap = global_1.WeakMap;
1240
-
1241
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
1242
-
1243
- var shared = createCommonjsModule(function (module) {
1244
- (module.exports = function (key, value) {
1245
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
1246
- })('versions', []).push({
1247
- version: '3.12.1',
1248
- mode: 'global',
1249
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
1250
- });
1251
- });
1252
-
1253
- var id = 0;
1254
- var postfix = Math.random();
1255
-
1256
- var uid = function (key) {
1257
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
1258
- };
1259
-
1260
- var keys = shared('keys');
1261
-
1262
- var sharedKey = function (key) {
1263
- return keys[key] || (keys[key] = uid(key));
1264
- };
1265
-
1266
- var hiddenKeys = {};
1267
-
1268
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1269
- var WeakMap$1 = global_1.WeakMap;
1270
- var set, get, has$1;
1271
-
1272
- var enforce = function (it) {
1273
- return has$1(it) ? get(it) : set(it, {});
1274
- };
1275
-
1276
- var getterFor = function (TYPE) {
1277
- return function (it) {
1278
- var state;
1279
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
1280
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
1281
- } return state;
1282
- };
1283
- };
1284
-
1285
- if (nativeWeakMap || sharedStore.state) {
1286
- var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
1287
- var wmget = store$1.get;
1288
- var wmhas = store$1.has;
1289
- var wmset = store$1.set;
1290
- set = function (it, metadata) {
1291
- if (wmhas.call(store$1, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1292
- metadata.facade = it;
1293
- wmset.call(store$1, it, metadata);
1294
- return metadata;
1295
- };
1296
- get = function (it) {
1297
- return wmget.call(store$1, it) || {};
1298
- };
1299
- has$1 = function (it) {
1300
- return wmhas.call(store$1, it);
1301
- };
1302
- } else {
1303
- var STATE = sharedKey('state');
1304
- hiddenKeys[STATE] = true;
1305
- set = function (it, metadata) {
1306
- if (has(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1307
- metadata.facade = it;
1308
- createNonEnumerableProperty(it, STATE, metadata);
1309
- return metadata;
1310
- };
1311
- get = function (it) {
1312
- return has(it, STATE) ? it[STATE] : {};
1313
- };
1314
- has$1 = function (it) {
1315
- return has(it, STATE);
1316
- };
1317
- }
1318
-
1319
- var internalState = {
1320
- set: set,
1321
- get: get,
1322
- has: has$1,
1323
- enforce: enforce,
1324
- getterFor: getterFor
1325
- };
1326
-
1327
- var redefine = createCommonjsModule(function (module) {
1328
- var getInternalState = internalState.get;
1329
- var enforceInternalState = internalState.enforce;
1330
- var TEMPLATE = String(String).split('String');
1331
-
1332
- (module.exports = function (O, key, value, options) {
1333
- var unsafe = options ? !!options.unsafe : false;
1334
- var simple = options ? !!options.enumerable : false;
1335
- var noTargetGet = options ? !!options.noTargetGet : false;
1336
- var state;
1337
- if (typeof value == 'function') {
1338
- if (typeof key == 'string' && !has(value, 'name')) {
1339
- createNonEnumerableProperty(value, 'name', key);
1340
- }
1341
- state = enforceInternalState(value);
1342
- if (!state.source) {
1343
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
1344
- }
1345
- }
1346
- if (O === global_1) {
1347
- if (simple) O[key] = value;
1348
- else setGlobal(key, value);
1349
- return;
1350
- } else if (!unsafe) {
1351
- delete O[key];
1352
- } else if (!noTargetGet && O[key]) {
1353
- simple = true;
1354
- }
1355
- if (simple) O[key] = value;
1356
- else createNonEnumerableProperty(O, key, value);
1357
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1358
- })(Function.prototype, 'toString', function toString() {
1359
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
1360
- });
1361
- });
1362
-
1363
- var path = global_1;
1364
-
1365
- var aFunction = function (variable) {
1366
- return typeof variable == 'function' ? variable : undefined;
1367
- };
1368
-
1369
- var getBuiltIn = function (namespace, method) {
1370
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
1371
- : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
1372
- };
1373
-
1374
- var ceil = Math.ceil;
1375
- var floor = Math.floor;
1376
-
1377
- // `ToInteger` abstract operation
1378
- // https://tc39.es/ecma262/#sec-tointeger
1379
- var toInteger = function (argument) {
1380
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
1381
- };
1382
-
1383
- var min = Math.min;
1384
-
1385
- // `ToLength` abstract operation
1386
- // https://tc39.es/ecma262/#sec-tolength
1387
- var toLength = function (argument) {
1388
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1389
- };
1390
-
1391
- var max = Math.max;
1392
- var min$1 = Math.min;
1393
-
1394
- // Helper for a popular repeating case of the spec:
1395
- // Let integer be ? ToInteger(index).
1396
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1397
- var toAbsoluteIndex = function (index, length) {
1398
- var integer = toInteger(index);
1399
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1400
- };
1039
+ var toIndexedObject$2 = toIndexedObject$4;
1040
+ var toAbsoluteIndex = toAbsoluteIndex$1;
1041
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
1401
1042
 
1402
1043
  // `Array.prototype.{ indexOf, includes }` methods implementation
1403
- var createMethod = function (IS_INCLUDES) {
1044
+ var createMethod$1 = function (IS_INCLUDES) {
1404
1045
  return function ($this, el, fromIndex) {
1405
- var O = toIndexedObject($this);
1406
- var length = toLength(O.length);
1046
+ var O = toIndexedObject$2($this);
1047
+ var length = lengthOfArrayLike$1(O);
1407
1048
  var index = toAbsoluteIndex(fromIndex, length);
1408
1049
  var value;
1409
1050
  // Array#includes uses SameValueZero equality algorithm
@@ -1422,30 +1063,35 @@ var createMethod = function (IS_INCLUDES) {
1422
1063
  var arrayIncludes = {
1423
1064
  // `Array.prototype.includes` method
1424
1065
  // https://tc39.es/ecma262/#sec-array.prototype.includes
1425
- includes: createMethod(true),
1066
+ includes: createMethod$1(true),
1426
1067
  // `Array.prototype.indexOf` method
1427
1068
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
1428
- indexOf: createMethod(false)
1069
+ indexOf: createMethod$1(false)
1429
1070
  };
1430
1071
 
1072
+ var uncurryThis$4 = functionUncurryThis;
1073
+ var hasOwn$1 = hasOwnProperty_1;
1074
+ var toIndexedObject$1 = toIndexedObject$4;
1431
1075
  var indexOf = arrayIncludes.indexOf;
1076
+ var hiddenKeys$2 = hiddenKeys$4;
1432
1077
 
1078
+ var push$1 = uncurryThis$4([].push);
1433
1079
 
1434
1080
  var objectKeysInternal = function (object, names) {
1435
- var O = toIndexedObject(object);
1081
+ var O = toIndexedObject$1(object);
1436
1082
  var i = 0;
1437
1083
  var result = [];
1438
1084
  var key;
1439
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
1085
+ for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
1440
1086
  // Don't enum bug & hidden keys
1441
- while (names.length > i) if (has(O, key = names[i++])) {
1442
- ~indexOf(result, key) || result.push(key);
1087
+ while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
1088
+ ~indexOf(result, key) || push$1(result, key);
1443
1089
  }
1444
1090
  return result;
1445
1091
  };
1446
1092
 
1447
1093
  // IE8- don't enum bug keys
1448
- var enumBugKeys = [
1094
+ var enumBugKeys$3 = [
1449
1095
  'constructor',
1450
1096
  'hasOwnProperty',
1451
1097
  'isPrototypeOf',
@@ -1455,83 +1101,100 @@ var enumBugKeys = [
1455
1101
  'valueOf'
1456
1102
  ];
1457
1103
 
1458
- var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
1104
+ var internalObjectKeys$1 = objectKeysInternal;
1105
+ var enumBugKeys$2 = enumBugKeys$3;
1106
+
1107
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
1459
1108
 
1460
1109
  // `Object.getOwnPropertyNames` method
1461
1110
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
1462
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1463
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1464
- return objectKeysInternal(O, hiddenKeys$1);
1111
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
1112
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1113
+ return internalObjectKeys$1(O, hiddenKeys$1);
1465
1114
  };
1466
1115
 
1467
- var objectGetOwnPropertyNames = {
1468
- f: f$3
1469
- };
1116
+ var objectGetOwnPropertySymbols = {};
1470
1117
 
1471
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1472
- var f$4 = Object.getOwnPropertySymbols;
1118
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
1119
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1473
1120
 
1474
- var objectGetOwnPropertySymbols = {
1475
- f: f$4
1476
- };
1121
+ var getBuiltIn$2 = getBuiltIn$5;
1122
+ var uncurryThis$3 = functionUncurryThis;
1123
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1124
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1125
+ var anObject$2 = anObject$4;
1126
+
1127
+ var concat = uncurryThis$3([].concat);
1477
1128
 
1478
1129
  // all object keys, includes non-enumerable and symbols
1479
- var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1480
- var keys = objectGetOwnPropertyNames.f(anObject(it));
1481
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1482
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
1130
+ var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
1131
+ var keys = getOwnPropertyNamesModule.f(anObject$2(it));
1132
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1133
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1483
1134
  };
1484
1135
 
1485
- var copyConstructorProperties = function (target, source) {
1486
- var keys = ownKeys$1(source);
1487
- var defineProperty = objectDefineProperty.f;
1488
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1136
+ var hasOwn = hasOwnProperty_1;
1137
+ var ownKeys = ownKeys$1;
1138
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1139
+ var definePropertyModule$1 = objectDefineProperty;
1140
+
1141
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1142
+ var keys = ownKeys(source);
1143
+ var defineProperty = definePropertyModule$1.f;
1144
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1489
1145
  for (var i = 0; i < keys.length; i++) {
1490
1146
  var key = keys[i];
1491
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1147
+ if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
1148
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1149
+ }
1492
1150
  }
1493
1151
  };
1494
1152
 
1153
+ var fails$1 = fails$9;
1154
+ var isCallable$2 = isCallable$c;
1155
+
1495
1156
  var replacement = /#|\.prototype\./;
1496
1157
 
1497
- var isForced = function (feature, detection) {
1158
+ var isForced$1 = function (feature, detection) {
1498
1159
  var value = data[normalize(feature)];
1499
1160
  return value == POLYFILL ? true
1500
1161
  : value == NATIVE ? false
1501
- : typeof detection == 'function' ? fails(detection)
1162
+ : isCallable$2(detection) ? fails$1(detection)
1502
1163
  : !!detection;
1503
1164
  };
1504
1165
 
1505
- var normalize = isForced.normalize = function (string) {
1166
+ var normalize = isForced$1.normalize = function (string) {
1506
1167
  return String(string).replace(replacement, '.').toLowerCase();
1507
1168
  };
1508
1169
 
1509
- var data = isForced.data = {};
1510
- var NATIVE = isForced.NATIVE = 'N';
1511
- var POLYFILL = isForced.POLYFILL = 'P';
1512
-
1513
- var isForced_1 = isForced;
1514
-
1515
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1516
-
1517
-
1518
-
1170
+ var data = isForced$1.data = {};
1171
+ var NATIVE = isForced$1.NATIVE = 'N';
1172
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1519
1173
 
1174
+ var isForced_1 = isForced$1;
1520
1175
 
1176
+ var global$1 = global$a;
1177
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1178
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
1179
+ var defineBuiltIn = defineBuiltIn$1;
1180
+ var defineGlobalProperty = defineGlobalProperty$3;
1181
+ var copyConstructorProperties = copyConstructorProperties$1;
1182
+ var isForced = isForced_1;
1521
1183
 
1522
1184
  /*
1523
- options.target - name of the target object
1524
- options.global - target is the global object
1525
- options.stat - export as static methods of target
1526
- options.proto - export as prototype methods of target
1527
- options.real - real prototype method for the `pure` version
1528
- options.forced - export even if the native feature is available
1529
- options.bind - bind methods to the target, required for the `pure` version
1530
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1531
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1532
- options.sham - add a flag to not completely full polyfills
1533
- options.enumerable - export as enumerable property
1534
- options.noTargetGet - prevent calling a getter on target
1185
+ options.target - name of the target object
1186
+ options.global - target is the global object
1187
+ options.stat - export as static methods of target
1188
+ options.proto - export as prototype methods of target
1189
+ options.real - real prototype method for the `pure` version
1190
+ options.forced - export even if the native feature is available
1191
+ options.bind - bind methods to the target, required for the `pure` version
1192
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1193
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1194
+ options.sham - add a flag to not completely full polyfills
1195
+ options.enumerable - export as enumerable property
1196
+ options.dontCallGetSet - prevent calling a getter on target
1197
+ options.name - the .name of the function if it does not match the key
1535
1198
  */
1536
1199
  var _export = function (options, source) {
1537
1200
  var TARGET = options.target;
@@ -1539,158 +1202,204 @@ var _export = function (options, source) {
1539
1202
  var STATIC = options.stat;
1540
1203
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1541
1204
  if (GLOBAL) {
1542
- target = global_1;
1205
+ target = global$1;
1543
1206
  } else if (STATIC) {
1544
- target = global_1[TARGET] || setGlobal(TARGET, {});
1207
+ target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
1545
1208
  } else {
1546
- target = (global_1[TARGET] || {}).prototype;
1209
+ target = (global$1[TARGET] || {}).prototype;
1547
1210
  }
1548
1211
  if (target) for (key in source) {
1549
1212
  sourceProperty = source[key];
1550
- if (options.noTargetGet) {
1551
- descriptor = getOwnPropertyDescriptor$1(target, key);
1213
+ if (options.dontCallGetSet) {
1214
+ descriptor = getOwnPropertyDescriptor(target, key);
1552
1215
  targetProperty = descriptor && descriptor.value;
1553
1216
  } else targetProperty = target[key];
1554
- FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1217
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1555
1218
  // contained in target
1556
1219
  if (!FORCED && targetProperty !== undefined) {
1557
- if (typeof sourceProperty === typeof targetProperty) continue;
1220
+ if (typeof sourceProperty == typeof targetProperty) continue;
1558
1221
  copyConstructorProperties(sourceProperty, targetProperty);
1559
1222
  }
1560
1223
  // add a flag to not completely full polyfills
1561
1224
  if (options.sham || (targetProperty && targetProperty.sham)) {
1562
1225
  createNonEnumerableProperty(sourceProperty, 'sham', true);
1563
1226
  }
1564
- // extend global
1565
- redefine(target, key, sourceProperty, options);
1227
+ defineBuiltIn(target, key, sourceProperty, options);
1566
1228
  }
1567
1229
  };
1568
1230
 
1569
- var aFunction$1 = function (it) {
1570
- if (typeof it != 'function') {
1571
- throw TypeError(String(it) + ' is not a function');
1572
- } return it;
1573
- };
1231
+ var uncurryThis$2 = functionUncurryThis;
1232
+ var aCallable = aCallable$2;
1233
+ var NATIVE_BIND = functionBindNative;
1234
+
1235
+ var bind$1 = uncurryThis$2(uncurryThis$2.bind);
1574
1236
 
1575
1237
  // optional / simple context binding
1576
- var functionBindContext = function (fn, that, length) {
1577
- aFunction$1(fn);
1578
- if (that === undefined) return fn;
1579
- switch (length) {
1580
- case 0: return function () {
1581
- return fn.call(that);
1582
- };
1583
- case 1: return function (a) {
1584
- return fn.call(that, a);
1585
- };
1586
- case 2: return function (a, b) {
1587
- return fn.call(that, a, b);
1588
- };
1589
- case 3: return function (a, b, c) {
1590
- return fn.call(that, a, b, c);
1591
- };
1592
- }
1593
- return function (/* ...args */) {
1238
+ var functionBindContext = function (fn, that) {
1239
+ aCallable(fn);
1240
+ return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
1594
1241
  return fn.apply(that, arguments);
1595
1242
  };
1596
1243
  };
1597
1244
 
1245
+ var classof$2 = classofRaw$1;
1246
+
1598
1247
  // `IsArray` abstract operation
1599
1248
  // https://tc39.es/ecma262/#sec-isarray
1600
- // eslint-disable-next-line es/no-array-isarray -- safe
1601
- var isArray = Array.isArray || function isArray(arg) {
1602
- return classofRaw(arg) == 'Array';
1249
+ // eslint-disable-next-line es-x/no-array-isarray -- safe
1250
+ var isArray$1 = Array.isArray || function isArray(argument) {
1251
+ return classof$2(argument) == 'Array';
1603
1252
  };
1604
1253
 
1605
- var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
1254
+ var wellKnownSymbol$3 = wellKnownSymbol$5;
1606
1255
 
1607
- var process = global_1.process;
1608
- var versions = process && process.versions;
1609
- var v8 = versions && versions.v8;
1610
- var match, version;
1256
+ var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
1257
+ var test = {};
1611
1258
 
1612
- if (v8) {
1613
- match = v8.split('.');
1614
- version = match[0] < 4 ? 1 : match[0] + match[1];
1615
- } else if (engineUserAgent) {
1616
- match = engineUserAgent.match(/Edge\/(\d+)/);
1617
- if (!match || match[1] >= 74) {
1618
- match = engineUserAgent.match(/Chrome\/(\d+)/);
1619
- if (match) version = match[1];
1620
- }
1621
- }
1259
+ test[TO_STRING_TAG$1] = 'z';
1622
1260
 
1623
- var engineV8Version = version && +version;
1261
+ var toStringTagSupport = String(test) === '[object z]';
1624
1262
 
1625
- /* eslint-disable es/no-symbol -- required for testing */
1263
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1264
+ var isCallable$1 = isCallable$c;
1265
+ var classofRaw = classofRaw$1;
1266
+ var wellKnownSymbol$2 = wellKnownSymbol$5;
1626
1267
 
1268
+ var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
1269
+ var $Object = Object;
1627
1270
 
1271
+ // ES3 wrong here
1272
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1628
1273
 
1629
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
1630
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
1631
- return !String(Symbol()) ||
1632
- // Chrome 38 Symbol has incorrect toString conversion
1633
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1634
- !Symbol.sham && engineV8Version && engineV8Version < 41;
1635
- });
1274
+ // fallback for IE11 Script Access Denied error
1275
+ var tryGet = function (it, key) {
1276
+ try {
1277
+ return it[key];
1278
+ } catch (error) { /* empty */ }
1279
+ };
1636
1280
 
1637
- /* eslint-disable es/no-symbol -- required for testing */
1281
+ // getting tag from ES6+ `Object.prototype.toString`
1282
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1283
+ var O, tag, result;
1284
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1285
+ // @@toStringTag case
1286
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1287
+ // builtinTag case
1288
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1289
+ // ES3 arguments fallback
1290
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1291
+ };
1292
+
1293
+ var uncurryThis$1 = functionUncurryThis;
1294
+ var fails = fails$9;
1295
+ var isCallable = isCallable$c;
1296
+ var classof = classof$1;
1297
+ var getBuiltIn$1 = getBuiltIn$5;
1298
+ var inspectSource = inspectSource$3;
1299
+
1300
+ var noop = function () { /* empty */ };
1301
+ var empty = [];
1302
+ var construct = getBuiltIn$1('Reflect', 'construct');
1303
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1304
+ var exec = uncurryThis$1(constructorRegExp.exec);
1305
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1306
+
1307
+ var isConstructorModern = function isConstructor(argument) {
1308
+ if (!isCallable(argument)) return false;
1309
+ try {
1310
+ construct(noop, empty, argument);
1311
+ return true;
1312
+ } catch (error) {
1313
+ return false;
1314
+ }
1315
+ };
1638
1316
 
1317
+ var isConstructorLegacy = function isConstructor(argument) {
1318
+ if (!isCallable(argument)) return false;
1319
+ switch (classof(argument)) {
1320
+ case 'AsyncFunction':
1321
+ case 'GeneratorFunction':
1322
+ case 'AsyncGeneratorFunction': return false;
1323
+ }
1324
+ try {
1325
+ // we can't check .prototype since constructors produced by .bind haven't it
1326
+ // `Function#toString` throws on some built-it function in some legacy engines
1327
+ // (for example, `DOMQuad` and similar in FF41-)
1328
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1329
+ } catch (error) {
1330
+ return true;
1331
+ }
1332
+ };
1639
1333
 
1640
- var useSymbolAsUid = nativeSymbol
1641
- && !Symbol.sham
1642
- && typeof Symbol.iterator == 'symbol';
1334
+ isConstructorLegacy.sham = true;
1643
1335
 
1644
- var WellKnownSymbolsStore = shared('wks');
1645
- var Symbol$1 = global_1.Symbol;
1646
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
1336
+ // `IsConstructor` abstract operation
1337
+ // https://tc39.es/ecma262/#sec-isconstructor
1338
+ var isConstructor$1 = !construct || fails(function () {
1339
+ var called;
1340
+ return isConstructorModern(isConstructorModern.call)
1341
+ || !isConstructorModern(Object)
1342
+ || !isConstructorModern(function () { called = true; })
1343
+ || called;
1344
+ }) ? isConstructorLegacy : isConstructorModern;
1647
1345
 
1648
- var wellKnownSymbol = function (name) {
1649
- if (!has(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
1650
- if (nativeSymbol && has(Symbol$1, name)) {
1651
- WellKnownSymbolsStore[name] = Symbol$1[name];
1652
- } else {
1653
- WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
1654
- }
1655
- } return WellKnownSymbolsStore[name];
1656
- };
1346
+ var isArray = isArray$1;
1347
+ var isConstructor = isConstructor$1;
1348
+ var isObject = isObject$6;
1349
+ var wellKnownSymbol$1 = wellKnownSymbol$5;
1657
1350
 
1658
- var SPECIES = wellKnownSymbol('species');
1351
+ var SPECIES = wellKnownSymbol$1('species');
1352
+ var $Array = Array;
1659
1353
 
1660
- // `ArraySpeciesCreate` abstract operation
1354
+ // a part of `ArraySpeciesCreate` abstract operation
1661
1355
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
1662
- var arraySpeciesCreate = function (originalArray, length) {
1356
+ var arraySpeciesConstructor$1 = function (originalArray) {
1663
1357
  var C;
1664
1358
  if (isArray(originalArray)) {
1665
1359
  C = originalArray.constructor;
1666
1360
  // cross-realm fallback
1667
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1361
+ if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
1668
1362
  else if (isObject(C)) {
1669
1363
  C = C[SPECIES];
1670
1364
  if (C === null) C = undefined;
1671
1365
  }
1672
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
1366
+ } return C === undefined ? $Array : C;
1367
+ };
1368
+
1369
+ var arraySpeciesConstructor = arraySpeciesConstructor$1;
1370
+
1371
+ // `ArraySpeciesCreate` abstract operation
1372
+ // https://tc39.es/ecma262/#sec-arrayspeciescreate
1373
+ var arraySpeciesCreate$1 = function (originalArray, length) {
1374
+ return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1673
1375
  };
1674
1376
 
1675
- var push = [].push;
1377
+ var bind = functionBindContext;
1378
+ var uncurryThis = functionUncurryThis;
1379
+ var IndexedObject = indexedObject;
1380
+ var toObject = toObject$2;
1381
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1382
+ var arraySpeciesCreate = arraySpeciesCreate$1;
1676
1383
 
1677
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
1678
- var createMethod$1 = function (TYPE) {
1384
+ var push = uncurryThis([].push);
1385
+
1386
+ // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1387
+ var createMethod = function (TYPE) {
1679
1388
  var IS_MAP = TYPE == 1;
1680
1389
  var IS_FILTER = TYPE == 2;
1681
1390
  var IS_SOME = TYPE == 3;
1682
1391
  var IS_EVERY = TYPE == 4;
1683
1392
  var IS_FIND_INDEX = TYPE == 6;
1684
- var IS_FILTER_OUT = TYPE == 7;
1393
+ var IS_FILTER_REJECT = TYPE == 7;
1685
1394
  var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1686
1395
  return function ($this, callbackfn, that, specificCreate) {
1687
1396
  var O = toObject($this);
1688
- var self = indexedObject(O);
1689
- var boundFunction = functionBindContext(callbackfn, that, 3);
1690
- var length = toLength(self.length);
1397
+ var self = IndexedObject(O);
1398
+ var boundFunction = bind(callbackfn, that);
1399
+ var length = lengthOfArrayLike(self);
1691
1400
  var index = 0;
1692
1401
  var create = specificCreate || arraySpeciesCreate;
1693
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
1402
+ var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
1694
1403
  var value, result;
1695
1404
  for (;length > index; index++) if (NO_HOLES || index in self) {
1696
1405
  value = self[index];
@@ -1701,10 +1410,10 @@ var createMethod$1 = function (TYPE) {
1701
1410
  case 3: return true; // some
1702
1411
  case 5: return value; // find
1703
1412
  case 6: return index; // findIndex
1704
- case 2: push.call(target, value); // filter
1413
+ case 2: push(target, value); // filter
1705
1414
  } else switch (TYPE) {
1706
1415
  case 4: return false; // every
1707
- case 7: push.call(target, value); // filterOut
1416
+ case 7: push(target, value); // filterReject
1708
1417
  }
1709
1418
  }
1710
1419
  }
@@ -1715,230 +1424,1128 @@ var createMethod$1 = function (TYPE) {
1715
1424
  var arrayIteration = {
1716
1425
  // `Array.prototype.forEach` method
1717
1426
  // https://tc39.es/ecma262/#sec-array.prototype.foreach
1718
- forEach: createMethod$1(0),
1427
+ forEach: createMethod(0),
1719
1428
  // `Array.prototype.map` method
1720
1429
  // https://tc39.es/ecma262/#sec-array.prototype.map
1721
- map: createMethod$1(1),
1430
+ map: createMethod(1),
1722
1431
  // `Array.prototype.filter` method
1723
1432
  // https://tc39.es/ecma262/#sec-array.prototype.filter
1724
- filter: createMethod$1(2),
1433
+ filter: createMethod(2),
1725
1434
  // `Array.prototype.some` method
1726
1435
  // https://tc39.es/ecma262/#sec-array.prototype.some
1727
- some: createMethod$1(3),
1436
+ some: createMethod(3),
1728
1437
  // `Array.prototype.every` method
1729
1438
  // https://tc39.es/ecma262/#sec-array.prototype.every
1730
- every: createMethod$1(4),
1439
+ every: createMethod(4),
1731
1440
  // `Array.prototype.find` method
1732
1441
  // https://tc39.es/ecma262/#sec-array.prototype.find
1733
- find: createMethod$1(5),
1442
+ find: createMethod(5),
1734
1443
  // `Array.prototype.findIndex` method
1735
1444
  // https://tc39.es/ecma262/#sec-array.prototype.findIndex
1736
- findIndex: createMethod$1(6),
1737
- // `Array.prototype.filterOut` method
1445
+ findIndex: createMethod(6),
1446
+ // `Array.prototype.filterReject` method
1738
1447
  // https://github.com/tc39/proposal-array-filtering
1739
- filterOut: createMethod$1(7)
1448
+ filterReject: createMethod(7)
1449
+ };
1450
+
1451
+ var objectDefineProperties = {};
1452
+
1453
+ var internalObjectKeys = objectKeysInternal;
1454
+ var enumBugKeys$1 = enumBugKeys$3;
1455
+
1456
+ // `Object.keys` method
1457
+ // https://tc39.es/ecma262/#sec-object.keys
1458
+ // eslint-disable-next-line es-x/no-object-keys -- safe
1459
+ var objectKeys$1 = Object.keys || function keys(O) {
1460
+ return internalObjectKeys(O, enumBugKeys$1);
1461
+ };
1462
+
1463
+ var DESCRIPTORS = descriptors;
1464
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1465
+ var definePropertyModule = objectDefineProperty;
1466
+ var anObject$1 = anObject$4;
1467
+ var toIndexedObject = toIndexedObject$4;
1468
+ var objectKeys = objectKeys$1;
1469
+
1470
+ // `Object.defineProperties` method
1471
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1472
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1473
+ objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1474
+ anObject$1(O);
1475
+ var props = toIndexedObject(Properties);
1476
+ var keys = objectKeys(Properties);
1477
+ var length = keys.length;
1478
+ var index = 0;
1479
+ var key;
1480
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1481
+ return O;
1482
+ };
1483
+
1484
+ var getBuiltIn = getBuiltIn$5;
1485
+
1486
+ var html$1 = getBuiltIn('document', 'documentElement');
1487
+
1488
+ /* global ActiveXObject -- old IE, WSH */
1489
+
1490
+ var anObject = anObject$4;
1491
+ var definePropertiesModule = objectDefineProperties;
1492
+ var enumBugKeys = enumBugKeys$3;
1493
+ var hiddenKeys = hiddenKeys$4;
1494
+ var html = html$1;
1495
+ var documentCreateElement = documentCreateElement$1;
1496
+ var sharedKey = sharedKey$2;
1497
+
1498
+ var GT = '>';
1499
+ var LT = '<';
1500
+ var PROTOTYPE = 'prototype';
1501
+ var SCRIPT = 'script';
1502
+ var IE_PROTO = sharedKey('IE_PROTO');
1503
+
1504
+ var EmptyConstructor = function () { /* empty */ };
1505
+
1506
+ var scriptTag = function (content) {
1507
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1508
+ };
1509
+
1510
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1511
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1512
+ activeXDocument.write(scriptTag(''));
1513
+ activeXDocument.close();
1514
+ var temp = activeXDocument.parentWindow.Object;
1515
+ activeXDocument = null; // avoid memory leak
1516
+ return temp;
1517
+ };
1518
+
1519
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1520
+ var NullProtoObjectViaIFrame = function () {
1521
+ // Thrash, waste and sodomy: IE GC bug
1522
+ var iframe = documentCreateElement('iframe');
1523
+ var JS = 'java' + SCRIPT + ':';
1524
+ var iframeDocument;
1525
+ iframe.style.display = 'none';
1526
+ html.appendChild(iframe);
1527
+ // https://github.com/zloirock/core-js/issues/475
1528
+ iframe.src = String(JS);
1529
+ iframeDocument = iframe.contentWindow.document;
1530
+ iframeDocument.open();
1531
+ iframeDocument.write(scriptTag('document.F=Object'));
1532
+ iframeDocument.close();
1533
+ return iframeDocument.F;
1534
+ };
1535
+
1536
+ // Check for document.domain and active x support
1537
+ // No need to use active x approach when document.domain is not set
1538
+ // see https://github.com/es-shims/es5-shim/issues/150
1539
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1540
+ // avoid IE GC bug
1541
+ var activeXDocument;
1542
+ var NullProtoObject = function () {
1543
+ try {
1544
+ activeXDocument = new ActiveXObject('htmlfile');
1545
+ } catch (error) { /* ignore */ }
1546
+ NullProtoObject = typeof document != 'undefined'
1547
+ ? document.domain && activeXDocument
1548
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1549
+ : NullProtoObjectViaIFrame()
1550
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1551
+ var length = enumBugKeys.length;
1552
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1553
+ return NullProtoObject();
1554
+ };
1555
+
1556
+ hiddenKeys[IE_PROTO] = true;
1557
+
1558
+ // `Object.create` method
1559
+ // https://tc39.es/ecma262/#sec-object.create
1560
+ // eslint-disable-next-line es-x/no-object-create -- safe
1561
+ var objectCreate = Object.create || function create(O, Properties) {
1562
+ var result;
1563
+ if (O !== null) {
1564
+ EmptyConstructor[PROTOTYPE] = anObject(O);
1565
+ result = new EmptyConstructor();
1566
+ EmptyConstructor[PROTOTYPE] = null;
1567
+ // add "__proto__" for Object.getPrototypeOf polyfill
1568
+ result[IE_PROTO] = O;
1569
+ } else result = NullProtoObject();
1570
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1571
+ };
1572
+
1573
+ var wellKnownSymbol = wellKnownSymbol$5;
1574
+ var create = objectCreate;
1575
+ var defineProperty = objectDefineProperty.f;
1576
+
1577
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
1578
+ var ArrayPrototype = Array.prototype;
1579
+
1580
+ // Array.prototype[@@unscopables]
1581
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1582
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
1583
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
1584
+ configurable: true,
1585
+ value: create(null)
1586
+ });
1587
+ }
1588
+
1589
+ // add a key to Array.prototype[@@unscopables]
1590
+ var addToUnscopables$1 = function (key) {
1591
+ ArrayPrototype[UNSCOPABLES][key] = true;
1592
+ };
1593
+
1594
+ var $ = _export;
1595
+ var $find = arrayIteration.find;
1596
+ var addToUnscopables = addToUnscopables$1;
1597
+
1598
+ var FIND = 'find';
1599
+ var SKIPS_HOLES = true;
1600
+
1601
+ // Shouldn't skip holes
1602
+ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
1603
+
1604
+ // `Array.prototype.find` method
1605
+ // https://tc39.es/ecma262/#sec-array.prototype.find
1606
+ $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1607
+ find: function find(callbackfn /* , that = undefined */) {
1608
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1609
+ }
1610
+ });
1611
+
1612
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1613
+ addToUnscopables(FIND);
1614
+
1615
+ var CONSTANT = {
1616
+ GLOBAL: {
1617
+ HIDE: '__react_tooltip_hide_event',
1618
+ REBUILD: '__react_tooltip_rebuild_event',
1619
+ SHOW: '__react_tooltip_show_event'
1620
+ }
1621
+ };
1622
+
1623
+ /**
1624
+ * Static methods for react-tooltip
1625
+ */
1626
+
1627
+ var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
1628
+ // Compatible with IE
1629
+ // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
1630
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
1631
+ var event;
1632
+
1633
+ if (typeof window.CustomEvent === 'function') {
1634
+ event = new window.CustomEvent(eventName, {
1635
+ detail: opts
1636
+ });
1637
+ } else {
1638
+ event = document.createEvent('Event');
1639
+ event.initEvent(eventName, false, true, opts);
1640
+ }
1641
+
1642
+ window.dispatchEvent(event);
1643
+ };
1644
+
1645
+ function staticMethods (target) {
1646
+ /**
1647
+ * Hide all tooltip
1648
+ * @trigger ReactTooltip.hide()
1649
+ */
1650
+ target.hide = function (target) {
1651
+ dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
1652
+ target: target
1653
+ });
1654
+ };
1655
+ /**
1656
+ * Rebuild all tooltip
1657
+ * @trigger ReactTooltip.rebuild()
1658
+ */
1659
+
1660
+
1661
+ target.rebuild = function () {
1662
+ dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
1663
+ };
1664
+ /**
1665
+ * Show specific tooltip
1666
+ * @trigger ReactTooltip.show()
1667
+ */
1668
+
1669
+
1670
+ target.show = function (target) {
1671
+ dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
1672
+ target: target
1673
+ });
1674
+ };
1675
+
1676
+ target.prototype.globalRebuild = function () {
1677
+ if (this.mount) {
1678
+ this.unbindListener();
1679
+ this.bindListener();
1680
+ }
1681
+ };
1682
+
1683
+ target.prototype.globalShow = function (event) {
1684
+ if (this.mount) {
1685
+ var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`
1686
+ // only `float` type cares e.clientX e.clientY
1687
+
1688
+ this.showTooltip({
1689
+ currentTarget: hasTarget && event.detail.target
1690
+ }, true);
1691
+ }
1692
+ };
1693
+
1694
+ target.prototype.globalHide = function (event) {
1695
+ if (this.mount) {
1696
+ var hasTarget = event && event.detail && event.detail.target && true || false;
1697
+ this.hideTooltip({
1698
+ currentTarget: hasTarget && event.detail.target
1699
+ }, hasTarget);
1700
+ }
1701
+ };
1702
+ }
1703
+
1704
+ /**
1705
+ * Events that should be bound to the window
1706
+ */
1707
+ function windowListener (target) {
1708
+ target.prototype.bindWindowEvents = function (resizeHide) {
1709
+ // ReactTooltip.hide
1710
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1711
+ window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild
1712
+
1713
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1714
+ window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show
1715
+
1716
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1717
+ window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize
1718
+
1719
+ if (resizeHide) {
1720
+ window.removeEventListener('resize', this.onWindowResize);
1721
+ window.addEventListener('resize', this.onWindowResize, false);
1722
+ }
1723
+ };
1724
+
1725
+ target.prototype.unbindWindowEvents = function () {
1726
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1727
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1728
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1729
+ window.removeEventListener('resize', this.onWindowResize);
1730
+ };
1731
+ /**
1732
+ * invoked by resize event of window
1733
+ */
1734
+
1735
+
1736
+ target.prototype.onWindowResize = function () {
1737
+ if (!this.mount) return;
1738
+ this.hideTooltip();
1739
+ };
1740
+ }
1741
+
1742
+ /**
1743
+ * Custom events to control showing and hiding of tooltip
1744
+ *
1745
+ * @attributes
1746
+ * - `event` {String}
1747
+ * - `eventOff` {String}
1748
+ */
1749
+ var checkStatus = function checkStatus(dataEventOff, e) {
1750
+ var show = this.state.show;
1751
+ var id = this.props.id;
1752
+ var isCapture = this.isCapture(e.currentTarget);
1753
+ var currentItem = e.currentTarget.getAttribute('currentItem');
1754
+ if (!isCapture) e.stopPropagation();
1755
+
1756
+ if (show && currentItem === 'true') {
1757
+ if (!dataEventOff) this.hideTooltip(e);
1758
+ } else {
1759
+ e.currentTarget.setAttribute('currentItem', 'true');
1760
+ setUntargetItems(e.currentTarget, this.getTargetArray(id));
1761
+ this.showTooltip(e);
1762
+ }
1763
+ };
1764
+
1765
+ var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
1766
+ for (var i = 0; i < targetArray.length; i++) {
1767
+ if (currentTarget !== targetArray[i]) {
1768
+ targetArray[i].setAttribute('currentItem', 'false');
1769
+ } else {
1770
+ targetArray[i].setAttribute('currentItem', 'true');
1771
+ }
1772
+ }
1773
+ };
1774
+
1775
+ var customListeners = {
1776
+ id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
1777
+ set: function set(target, event, listener) {
1778
+ if (this.id in target) {
1779
+ var map = target[this.id];
1780
+ map[event] = listener;
1781
+ } else {
1782
+ // this is workaround for WeakMap, which is not supported in older browsers, such as IE
1783
+ Object.defineProperty(target, this.id, {
1784
+ configurable: true,
1785
+ value: _defineProperty({}, event, listener)
1786
+ });
1787
+ }
1788
+ },
1789
+ get: function get(target, event) {
1790
+ var map = target[this.id];
1791
+
1792
+ if (map !== undefined) {
1793
+ return map[event];
1794
+ }
1795
+ }
1796
+ };
1797
+ function customEvent (target) {
1798
+ target.prototype.isCustomEvent = function (ele) {
1799
+ var event = this.state.event;
1800
+ return event || !!ele.getAttribute('data-event');
1801
+ };
1802
+ /* Bind listener for custom event */
1803
+
1804
+
1805
+ target.prototype.customBindListener = function (ele) {
1806
+ var _this = this;
1807
+
1808
+ var _this$state = this.state,
1809
+ event = _this$state.event,
1810
+ eventOff = _this$state.eventOff;
1811
+ var dataEvent = ele.getAttribute('data-event') || event;
1812
+ var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
1813
+ dataEvent.split(' ').forEach(function (event) {
1814
+ ele.removeEventListener(event, customListeners.get(ele, event));
1815
+ var customListener = checkStatus.bind(_this, dataEventOff);
1816
+ customListeners.set(ele, event, customListener);
1817
+ ele.addEventListener(event, customListener, false);
1818
+ });
1819
+
1820
+ if (dataEventOff) {
1821
+ dataEventOff.split(' ').forEach(function (event) {
1822
+ ele.removeEventListener(event, _this.hideTooltip);
1823
+ ele.addEventListener(event, _this.hideTooltip, false);
1824
+ });
1825
+ }
1826
+ };
1827
+ /* Unbind listener for custom event */
1828
+
1829
+
1830
+ target.prototype.customUnbindListener = function (ele) {
1831
+ var _this$state2 = this.state,
1832
+ event = _this$state2.event,
1833
+ eventOff = _this$state2.eventOff;
1834
+ var dataEvent = event || ele.getAttribute('data-event');
1835
+ var dataEventOff = eventOff || ele.getAttribute('data-event-off');
1836
+ ele.removeEventListener(dataEvent, customListeners.get(ele, event));
1837
+ if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
1838
+ };
1839
+ }
1840
+
1841
+ /**
1842
+ * Util method to judge if it should follow capture model
1843
+ */
1844
+ function isCapture (target) {
1845
+ target.prototype.isCapture = function (currentTarget) {
1846
+ return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
1847
+ };
1848
+ }
1849
+
1850
+ /**
1851
+ * Util method to get effect
1852
+ */
1853
+ function getEffect (target) {
1854
+ target.prototype.getEffect = function (currentTarget) {
1855
+ var dataEffect = currentTarget.getAttribute('data-effect');
1856
+ return dataEffect || this.props.effect || 'float';
1857
+ };
1858
+ }
1859
+
1860
+ /**
1861
+ * Util method to get effect
1862
+ */
1863
+
1864
+ var makeProxy = function makeProxy(e) {
1865
+ var proxy = {};
1866
+
1867
+ for (var key in e) {
1868
+ if (typeof e[key] === 'function') {
1869
+ proxy[key] = e[key].bind(e);
1870
+ } else {
1871
+ proxy[key] = e[key];
1872
+ }
1873
+ }
1874
+
1875
+ return proxy;
1876
+ };
1877
+
1878
+ var bodyListener = function bodyListener(callback, options, e) {
1879
+ var _options$respectEffec = options.respectEffect,
1880
+ respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
1881
+ _options$customEvent = options.customEvent,
1882
+ customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
1883
+ var id = this.props.id;
1884
+ var tip = null;
1885
+ var forId;
1886
+ var target = e.target;
1887
+ var lastTarget; // walk up parent chain until tip is found
1888
+ // there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
1889
+
1890
+ while (tip === null && target !== null) {
1891
+ lastTarget = target;
1892
+ tip = target.getAttribute('data-tip') || null;
1893
+ forId = target.getAttribute('data-for') || null;
1894
+ target = target.parentElement;
1895
+ }
1896
+
1897
+ target = lastTarget || e.target;
1898
+
1899
+ if (this.isCustomEvent(target) && !customEvent) {
1900
+ return;
1901
+ }
1902
+
1903
+ var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
1904
+
1905
+ if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
1906
+ var proxy = makeProxy(e);
1907
+ proxy.currentTarget = target;
1908
+ callback(proxy);
1909
+ }
1910
+ };
1911
+
1912
+ var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
1913
+ var events = {};
1914
+ targetArray.forEach(function (target) {
1915
+ var event = target.getAttribute(dataAttribute);
1916
+ if (event) event.split(' ').forEach(function (event) {
1917
+ return events[event] = true;
1918
+ });
1919
+ });
1920
+ return events;
1921
+ };
1922
+
1923
+ var getBody = function getBody() {
1924
+ return document.getElementsByTagName('body')[0];
1925
+ };
1926
+
1927
+ function bodyMode (target) {
1928
+ target.prototype.isBodyMode = function () {
1929
+ return !!this.props.bodyMode;
1930
+ };
1931
+
1932
+ target.prototype.bindBodyListener = function (targetArray) {
1933
+ var _this = this;
1934
+
1935
+ var _this$state = this.state,
1936
+ event = _this$state.event,
1937
+ eventOff = _this$state.eventOff,
1938
+ possibleCustomEvents = _this$state.possibleCustomEvents,
1939
+ possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
1940
+ var body = getBody();
1941
+ var customEvents = findCustomEvents(targetArray, 'data-event');
1942
+ var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
1943
+ if (event != null) customEvents[event] = true;
1944
+ if (eventOff != null) customEventsOff[eventOff] = true;
1945
+ possibleCustomEvents.split(' ').forEach(function (event) {
1946
+ return customEvents[event] = true;
1947
+ });
1948
+ possibleCustomEventsOff.split(' ').forEach(function (event) {
1949
+ return customEventsOff[event] = true;
1950
+ });
1951
+ this.unbindBodyListener(body);
1952
+ var listeners = this.bodyModeListeners = {};
1953
+
1954
+ if (event == null) {
1955
+ listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
1956
+ listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
1957
+ respectEffect: true
1958
+ });
1959
+ listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
1960
+ }
1961
+
1962
+ for (var _event in customEvents) {
1963
+ listeners[_event] = bodyListener.bind(this, function (e) {
1964
+ var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
1965
+ checkStatus.call(_this, targetEventOff, e);
1966
+ }, {
1967
+ customEvent: true
1968
+ });
1969
+ }
1970
+
1971
+ for (var _event2 in customEventsOff) {
1972
+ listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
1973
+ customEvent: true
1974
+ });
1975
+ }
1976
+
1977
+ for (var _event3 in listeners) {
1978
+ body.addEventListener(_event3, listeners[_event3]);
1979
+ }
1980
+ };
1981
+
1982
+ target.prototype.unbindBodyListener = function (body) {
1983
+ body = body || getBody();
1984
+ var listeners = this.bodyModeListeners;
1985
+
1986
+ for (var event in listeners) {
1987
+ body.removeEventListener(event, listeners[event]);
1988
+ }
1989
+ };
1990
+ }
1991
+
1992
+ /**
1993
+ * Tracking target removing from DOM.
1994
+ * It's necessary to hide tooltip when it's target disappears.
1995
+ * Otherwise, the tooltip would be shown forever until another target
1996
+ * is triggered.
1997
+ *
1998
+ * If MutationObserver is not available, this feature just doesn't work.
1999
+ */
2000
+ // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
2001
+ var getMutationObserverClass = function getMutationObserverClass() {
2002
+ return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
2003
+ };
2004
+
2005
+ function trackRemoval (target) {
2006
+ target.prototype.bindRemovalTracker = function () {
2007
+ var _this = this;
2008
+
2009
+ var MutationObserver = getMutationObserverClass();
2010
+ if (MutationObserver == null) return;
2011
+ var observer = new MutationObserver(function (mutations) {
2012
+ for (var m1 = 0; m1 < mutations.length; m1++) {
2013
+ var mutation = mutations[m1];
2014
+
2015
+ for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
2016
+ var element = mutation.removedNodes[m2];
2017
+
2018
+ if (element === _this.state.currentTarget) {
2019
+ _this.hideTooltip();
2020
+
2021
+ return;
2022
+ }
2023
+ }
2024
+ }
2025
+ });
2026
+ observer.observe(window.document, {
2027
+ childList: true,
2028
+ subtree: true
2029
+ });
2030
+ this.removalTracker = observer;
2031
+ };
2032
+
2033
+ target.prototype.unbindRemovalTracker = function () {
2034
+ if (this.removalTracker) {
2035
+ this.removalTracker.disconnect();
2036
+ this.removalTracker = null;
2037
+ }
2038
+ };
2039
+ }
2040
+
2041
+ /**
2042
+ * Calculate the position of tooltip
2043
+ *
2044
+ * @params
2045
+ * - `e` {Event} the event of current mouse
2046
+ * - `target` {Element} the currentTarget of the event
2047
+ * - `node` {DOM} the react-tooltip object
2048
+ * - `place` {String} top / right / bottom / left
2049
+ * - `effect` {String} float / solid
2050
+ * - `offset` {Object} the offset to default position
2051
+ *
2052
+ * @return {Object}
2053
+ * - `isNewState` {Bool} required
2054
+ * - `newState` {Object}
2055
+ * - `position` {Object} {left: {Number}, top: {Number}}
2056
+ */
2057
+ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
2058
+ var _getDimensions = getDimensions(node),
2059
+ tipWidth = _getDimensions.width,
2060
+ tipHeight = _getDimensions.height;
2061
+
2062
+ var _getDimensions2 = getDimensions(target),
2063
+ targetWidth = _getDimensions2.width,
2064
+ targetHeight = _getDimensions2.height;
2065
+
2066
+ var _getCurrentOffset = getCurrentOffset(e, target, effect),
2067
+ mouseX = _getCurrentOffset.mouseX,
2068
+ mouseY = _getCurrentOffset.mouseY;
2069
+
2070
+ var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
2071
+
2072
+ var _calculateOffset = calculateOffset(offset),
2073
+ extraOffsetX = _calculateOffset.extraOffsetX,
2074
+ extraOffsetY = _calculateOffset.extraOffsetY;
2075
+
2076
+ var windowWidth = window.innerWidth;
2077
+ var windowHeight = window.innerHeight;
2078
+
2079
+ var _getParent = getParent(node),
2080
+ parentTop = _getParent.parentTop,
2081
+ parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
2082
+
2083
+
2084
+ var getTipOffsetLeft = function getTipOffsetLeft(place) {
2085
+ var offsetX = defaultOffset[place].l;
2086
+ return mouseX + offsetX + extraOffsetX;
2087
+ };
2088
+
2089
+ var getTipOffsetRight = function getTipOffsetRight(place) {
2090
+ var offsetX = defaultOffset[place].r;
2091
+ return mouseX + offsetX + extraOffsetX;
2092
+ };
2093
+
2094
+ var getTipOffsetTop = function getTipOffsetTop(place) {
2095
+ var offsetY = defaultOffset[place].t;
2096
+ return mouseY + offsetY + extraOffsetY;
2097
+ };
2098
+
2099
+ var getTipOffsetBottom = function getTipOffsetBottom(place) {
2100
+ var offsetY = defaultOffset[place].b;
2101
+ return mouseY + offsetY + extraOffsetY;
2102
+ }; //
2103
+ // Functions to test whether the tooltip's sides are inside
2104
+ // the client window for a given orientation p
2105
+ //
2106
+ // _____________
2107
+ // | | <-- Right side
2108
+ // | p = 'left' |\
2109
+ // | |/ |\
2110
+ // |_____________| |_\ <-- Mouse
2111
+ // / \ |
2112
+ // |
2113
+ // |
2114
+ // Bottom side
2115
+ //
2116
+
2117
+
2118
+ var outsideLeft = function outsideLeft(p) {
2119
+ return getTipOffsetLeft(p) < 0;
2120
+ };
2121
+
2122
+ var outsideRight = function outsideRight(p) {
2123
+ return getTipOffsetRight(p) > windowWidth;
2124
+ };
2125
+
2126
+ var outsideTop = function outsideTop(p) {
2127
+ return getTipOffsetTop(p) < 0;
2128
+ };
2129
+
2130
+ var outsideBottom = function outsideBottom(p) {
2131
+ return getTipOffsetBottom(p) > windowHeight;
2132
+ }; // Check whether the tooltip with orientation p is completely inside the client window
2133
+
2134
+
2135
+ var outside = function outside(p) {
2136
+ return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
2137
+ };
2138
+
2139
+ var inside = function inside(p) {
2140
+ return !outside(p);
2141
+ };
2142
+
2143
+ var placeIsInside = {
2144
+ top: inside('top'),
2145
+ bottom: inside('bottom'),
2146
+ left: inside('left'),
2147
+ right: inside('right')
2148
+ };
2149
+
2150
+ function choose() {
2151
+ var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
2152
+
2153
+ var _iterator = _createForOfIteratorHelper(allPlaces),
2154
+ _step;
2155
+
2156
+ try {
2157
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2158
+ var d = _step.value;
2159
+ if (placeIsInside[d]) return d;
2160
+ } // if nothing is inside, just use the old place.
2161
+
2162
+ } catch (err) {
2163
+ _iterator.e(err);
2164
+ } finally {
2165
+ _iterator.f();
2166
+ }
2167
+
2168
+ return place;
2169
+ }
2170
+
2171
+ var chosen = choose();
2172
+ var isNewState = false;
2173
+ var newPlace;
2174
+
2175
+ if (chosen && chosen !== place) {
2176
+ isNewState = true;
2177
+ newPlace = chosen;
2178
+ }
2179
+
2180
+ if (isNewState) {
2181
+ return {
2182
+ isNewState: true,
2183
+ newState: {
2184
+ place: newPlace
2185
+ }
2186
+ };
2187
+ }
2188
+
2189
+ return {
2190
+ isNewState: false,
2191
+ position: {
2192
+ left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
2193
+ top: parseInt(getTipOffsetTop(place) - parentTop, 10)
2194
+ }
2195
+ };
2196
+ }
2197
+
2198
+ var getDimensions = function getDimensions(node) {
2199
+ var _node$getBoundingClie = node.getBoundingClientRect(),
2200
+ height = _node$getBoundingClie.height,
2201
+ width = _node$getBoundingClie.width;
2202
+
2203
+ return {
2204
+ height: parseInt(height, 10),
2205
+ width: parseInt(width, 10)
2206
+ };
2207
+ }; // Get current mouse offset
2208
+
2209
+
2210
+ var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
2211
+ var boundingClientRect = currentTarget.getBoundingClientRect();
2212
+ var targetTop = boundingClientRect.top;
2213
+ var targetLeft = boundingClientRect.left;
2214
+
2215
+ var _getDimensions3 = getDimensions(currentTarget),
2216
+ targetWidth = _getDimensions3.width,
2217
+ targetHeight = _getDimensions3.height;
2218
+
2219
+ if (effect === 'float') {
2220
+ return {
2221
+ mouseX: e.clientX,
2222
+ mouseY: e.clientY
2223
+ };
2224
+ }
2225
+
2226
+ return {
2227
+ mouseX: targetLeft + targetWidth / 2,
2228
+ mouseY: targetTop + targetHeight / 2
2229
+ };
2230
+ }; // List all possibility of tooltip final offset
2231
+ // This is useful in judging if it is necessary for tooltip to switch position when out of window
2232
+
2233
+
2234
+ var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
2235
+ var top;
2236
+ var right;
2237
+ var bottom;
2238
+ var left;
2239
+ var disToMouse = 3;
2240
+ var triangleHeight = 2;
2241
+ var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
2242
+
2243
+ if (effect === 'float') {
2244
+ top = {
2245
+ l: -(tipWidth / 2),
2246
+ r: tipWidth / 2,
2247
+ t: -(tipHeight + disToMouse + triangleHeight),
2248
+ b: -disToMouse
2249
+ };
2250
+ bottom = {
2251
+ l: -(tipWidth / 2),
2252
+ r: tipWidth / 2,
2253
+ t: disToMouse + cursorHeight,
2254
+ b: tipHeight + disToMouse + triangleHeight + cursorHeight
2255
+ };
2256
+ left = {
2257
+ l: -(tipWidth + disToMouse + triangleHeight),
2258
+ r: -disToMouse,
2259
+ t: -(tipHeight / 2),
2260
+ b: tipHeight / 2
2261
+ };
2262
+ right = {
2263
+ l: disToMouse,
2264
+ r: tipWidth + disToMouse + triangleHeight,
2265
+ t: -(tipHeight / 2),
2266
+ b: tipHeight / 2
2267
+ };
2268
+ } else if (effect === 'solid') {
2269
+ top = {
2270
+ l: -(tipWidth / 2),
2271
+ r: tipWidth / 2,
2272
+ t: -(targetHeight / 2 + tipHeight + triangleHeight),
2273
+ b: -(targetHeight / 2)
2274
+ };
2275
+ bottom = {
2276
+ l: -(tipWidth / 2),
2277
+ r: tipWidth / 2,
2278
+ t: targetHeight / 2,
2279
+ b: targetHeight / 2 + tipHeight + triangleHeight
2280
+ };
2281
+ left = {
2282
+ l: -(tipWidth + targetWidth / 2 + triangleHeight),
2283
+ r: -(targetWidth / 2),
2284
+ t: -(tipHeight / 2),
2285
+ b: tipHeight / 2
2286
+ };
2287
+ right = {
2288
+ l: targetWidth / 2,
2289
+ r: tipWidth + targetWidth / 2 + triangleHeight,
2290
+ t: -(tipHeight / 2),
2291
+ b: tipHeight / 2
2292
+ };
2293
+ }
2294
+
2295
+ return {
2296
+ top: top,
2297
+ bottom: bottom,
2298
+ left: left,
2299
+ right: right
2300
+ };
2301
+ }; // Consider additional offset into position calculation
2302
+
2303
+
2304
+ var calculateOffset = function calculateOffset(offset) {
2305
+ var extraOffsetX = 0;
2306
+ var extraOffsetY = 0;
2307
+
2308
+ if (Object.prototype.toString.apply(offset) === '[object String]') {
2309
+ offset = JSON.parse(offset.toString().replace(/'/g, '"'));
2310
+ }
2311
+
2312
+ for (var key in offset) {
2313
+ if (key === 'top') {
2314
+ extraOffsetY -= parseInt(offset[key], 10);
2315
+ } else if (key === 'bottom') {
2316
+ extraOffsetY += parseInt(offset[key], 10);
2317
+ } else if (key === 'left') {
2318
+ extraOffsetX -= parseInt(offset[key], 10);
2319
+ } else if (key === 'right') {
2320
+ extraOffsetX += parseInt(offset[key], 10);
2321
+ }
2322
+ }
2323
+
2324
+ return {
2325
+ extraOffsetX: extraOffsetX,
2326
+ extraOffsetY: extraOffsetY
2327
+ };
2328
+ }; // Get the offset of the parent elements
2329
+
2330
+
2331
+ var getParent = function getParent(currentTarget) {
2332
+ var currentParent = currentTarget;
2333
+
2334
+ while (currentParent) {
2335
+ var computedStyle = window.getComputedStyle(currentParent); // transform and will-change: transform change the containing block
2336
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
2337
+
2338
+ if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
2339
+ currentParent = currentParent.parentElement;
2340
+ }
2341
+
2342
+ var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
2343
+ var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
2344
+ return {
2345
+ parentTop: parentTop,
2346
+ parentLeft: parentLeft
2347
+ };
1740
2348
  };
1741
2349
 
1742
- // `Object.keys` method
1743
- // https://tc39.es/ecma262/#sec-object.keys
1744
- // eslint-disable-next-line es/no-object-keys -- safe
1745
- var objectKeys = Object.keys || function keys(O) {
1746
- return objectKeysInternal(O, enumBugKeys);
1747
- };
2350
+ /**
2351
+ * To get the tooltip content
2352
+ * it may comes from data-tip or this.props.children
2353
+ * it should support multiline
2354
+ *
2355
+ * @params
2356
+ * - `tip` {String} value of data-tip
2357
+ * - `children` {ReactElement} this.props.children
2358
+ * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
2359
+ *
2360
+ * @return
2361
+ * - String or react component
2362
+ */
2363
+ function TipContent(tip, children, getContent, multiline) {
2364
+ if (children) return children;
2365
+ if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
1748
2366
 
1749
- // `Object.defineProperties` method
1750
- // https://tc39.es/ecma262/#sec-object.defineproperties
1751
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1752
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
1753
- anObject(O);
1754
- var keys = objectKeys(Properties);
1755
- var length = keys.length;
1756
- var index = 0;
1757
- var key;
1758
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
1759
- return O;
1760
- };
2367
+ if (getContent === null) return null; // Tip not exist and children is null or undefined
1761
2368
 
1762
- var html = getBuiltIn('document', 'documentElement');
2369
+ var regexp = /<br\s*\/?>/;
1763
2370
 
1764
- var GT = '>';
1765
- var LT = '<';
1766
- var PROTOTYPE = 'prototype';
1767
- var SCRIPT = 'script';
1768
- var IE_PROTO = sharedKey('IE_PROTO');
2371
+ if (!multiline || multiline === 'false' || !regexp.test(tip)) {
2372
+ // No trim(), so that user can keep their input
2373
+ return tip;
2374
+ } // Multiline tooltip content
1769
2375
 
1770
- var EmptyConstructor = function () { /* empty */ };
1771
2376
 
1772
- var scriptTag = function (content) {
1773
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1774
- };
2377
+ return tip.split(regexp).map(function (d, i) {
2378
+ return /*#__PURE__*/React__default["default"].createElement("span", {
2379
+ key: i,
2380
+ className: "multi-line"
2381
+ }, d);
2382
+ });
2383
+ }
1775
2384
 
1776
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1777
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1778
- activeXDocument.write(scriptTag(''));
1779
- activeXDocument.close();
1780
- var temp = activeXDocument.parentWindow.Object;
1781
- activeXDocument = null; // avoid memory leak
1782
- return temp;
1783
- };
2385
+ /**
2386
+ * Support aria- and role in ReactTooltip
2387
+ *
2388
+ * @params props {Object}
2389
+ * @return {Object}
2390
+ */
2391
+ function parseAria(props) {
2392
+ var ariaObj = {};
2393
+ Object.keys(props).filter(function (prop) {
2394
+ // aria-xxx and role is acceptable
2395
+ return /(^aria-\w+$|^role$)/.test(prop);
2396
+ }).forEach(function (prop) {
2397
+ ariaObj[prop] = props[prop];
2398
+ });
2399
+ return ariaObj;
2400
+ }
1784
2401
 
1785
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1786
- var NullProtoObjectViaIFrame = function () {
1787
- // Thrash, waste and sodomy: IE GC bug
1788
- var iframe = documentCreateElement('iframe');
1789
- var JS = 'java' + SCRIPT + ':';
1790
- var iframeDocument;
1791
- iframe.style.display = 'none';
1792
- html.appendChild(iframe);
1793
- // https://github.com/zloirock/core-js/issues/475
1794
- iframe.src = String(JS);
1795
- iframeDocument = iframe.contentWindow.document;
1796
- iframeDocument.open();
1797
- iframeDocument.write(scriptTag('document.F=Object'));
1798
- iframeDocument.close();
1799
- return iframeDocument.F;
1800
- };
2402
+ /**
2403
+ * Convert nodelist to array
2404
+ * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
2405
+ * NodeLists are functions in Safari
2406
+ */
2407
+ function nodeListToArray (nodeList) {
2408
+ var length = nodeList.length;
1801
2409
 
1802
- // Check for document.domain and active x support
1803
- // No need to use active x approach when document.domain is not set
1804
- // see https://github.com/es-shims/es5-shim/issues/150
1805
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1806
- // avoid IE GC bug
1807
- var activeXDocument;
1808
- var NullProtoObject = function () {
1809
- try {
1810
- /* global ActiveXObject -- old IE */
1811
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
1812
- } catch (error) { /* ignore */ }
1813
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
1814
- var length = enumBugKeys.length;
1815
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1816
- return NullProtoObject();
1817
- };
2410
+ if (nodeList.hasOwnProperty) {
2411
+ return Array.prototype.slice.call(nodeList);
2412
+ }
1818
2413
 
1819
- hiddenKeys[IE_PROTO] = true;
2414
+ return new Array(length).fill().map(function (index) {
2415
+ return nodeList[index];
2416
+ });
2417
+ }
1820
2418
 
1821
- // `Object.create` method
1822
- // https://tc39.es/ecma262/#sec-object.create
1823
- var objectCreate = Object.create || function create(O, Properties) {
1824
- var result;
1825
- if (O !== null) {
1826
- EmptyConstructor[PROTOTYPE] = anObject(O);
1827
- result = new EmptyConstructor();
1828
- EmptyConstructor[PROTOTYPE] = null;
1829
- // add "__proto__" for Object.getPrototypeOf polyfill
1830
- result[IE_PROTO] = O;
1831
- } else result = NullProtoObject();
1832
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
2419
+ function generateUUID() {
2420
+ return 't' + uuid.v4();
2421
+ }
2422
+
2423
+ 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 border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
2424
+
2425
+ /**
2426
+ * Default pop-up style values (text color, background color).
2427
+ */
2428
+ var defaultColors = {
2429
+ dark: {
2430
+ text: '#fff',
2431
+ background: '#222',
2432
+ border: 'transparent',
2433
+ arrow: '#222'
2434
+ },
2435
+ success: {
2436
+ text: '#fff',
2437
+ background: '#8DC572',
2438
+ border: 'transparent',
2439
+ arrow: '#8DC572'
2440
+ },
2441
+ warning: {
2442
+ text: '#fff',
2443
+ background: '#F0AD4E',
2444
+ border: 'transparent',
2445
+ arrow: '#F0AD4E'
2446
+ },
2447
+ error: {
2448
+ text: '#fff',
2449
+ background: '#BE6464',
2450
+ border: 'transparent',
2451
+ arrow: '#BE6464'
2452
+ },
2453
+ info: {
2454
+ text: '#fff',
2455
+ background: '#337AB7',
2456
+ border: 'transparent',
2457
+ arrow: '#337AB7'
2458
+ },
2459
+ light: {
2460
+ text: '#222',
2461
+ background: '#fff',
2462
+ border: 'transparent',
2463
+ arrow: '#fff'
2464
+ }
1833
2465
  };
2466
+ function getDefaultPopupColors(type) {
2467
+ return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
2468
+ }
2469
+ var DEFAULT_PADDING = '8px 21px';
1834
2470
 
1835
- var UNSCOPABLES = wellKnownSymbol('unscopables');
1836
- var ArrayPrototype = Array.prototype;
2471
+ /**
2472
+ * Generates the specific tooltip style for use on render.
2473
+ */
1837
2474
 
1838
- // Array.prototype[@@unscopables]
1839
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1840
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
1841
- objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
1842
- configurable: true,
1843
- value: objectCreate(null)
1844
- });
2475
+ function generateTooltipStyle(uuid, customColors, type, hasBorder, padding) {
2476
+ return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding);
1845
2477
  }
2478
+ /**
2479
+ * Generates the tooltip style rules based on the element-specified "data-type" property.
2480
+ */
1846
2481
 
1847
- // add a key to Array.prototype[@@unscopables]
1848
- var addToUnscopables = function (key) {
1849
- ArrayPrototype[UNSCOPABLES][key] = true;
1850
- };
2482
+ function generateStyle(uuid, colors) {
2483
+ var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
2484
+ var textColor = colors.text;
2485
+ var backgroundColor = colors.background;
2486
+ var borderColor = colors.border;
2487
+ var arrowColor = colors.arrow;
2488
+ return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\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 border-top: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(arrowColor, ";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n border-bottom: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(arrowColor, ";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n border-left: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(arrowColor, ";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n border-right: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(arrowColor, ";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ");
2489
+ }
1851
2490
 
1852
- var $find = arrayIteration.find;
2491
+ function getPopupColors(customColors, type, hasBorder) {
2492
+ var textColor = customColors.text;
2493
+ var backgroundColor = customColors.background;
2494
+ var borderColor = customColors.border;
2495
+ var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
2496
+ var colors = getDefaultPopupColors(type);
1853
2497
 
2498
+ if (textColor) {
2499
+ colors.text = textColor;
2500
+ }
1854
2501
 
1855
- var FIND = 'find';
1856
- var SKIPS_HOLES = true;
2502
+ if (backgroundColor) {
2503
+ colors.background = backgroundColor;
2504
+ }
1857
2505
 
1858
- // Shouldn't skip holes
1859
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
2506
+ if (hasBorder) {
2507
+ if (borderColor) {
2508
+ colors.border = borderColor;
2509
+ } else {
2510
+ colors.border = type === 'light' ? 'black' : 'white';
2511
+ }
2512
+ }
1860
2513
 
1861
- // `Array.prototype.find` method
1862
- // https://tc39.es/ecma262/#sec-array.prototype.find
1863
- _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1864
- find: function find(callbackfn /* , that = undefined */) {
1865
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2514
+ if (arrowColor) {
2515
+ colors.arrow = arrowColor;
1866
2516
  }
1867
- });
1868
2517
 
1869
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1870
- addToUnscopables(FIND);
2518
+ return colors;
2519
+ }
1871
2520
 
1872
- var _class, _class2, _temp;
2521
+ var _class, _class2;
2522
+ /* Polyfill */
1873
2523
 
1874
- var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =
1875
- /*#__PURE__*/
1876
- function (_React$Component) {
2524
+ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
1877
2525
  _inherits(ReactTooltip, _React$Component);
1878
2526
 
1879
- _createClass(ReactTooltip, null, [{
1880
- key: "propTypes",
1881
- get: function get() {
1882
- return {
1883
- uuid: PropTypes.string,
1884
- children: PropTypes.any,
1885
- place: PropTypes.string,
1886
- type: PropTypes.string,
1887
- effect: PropTypes.string,
1888
- offset: PropTypes.object,
1889
- multiline: PropTypes.bool,
1890
- border: PropTypes.bool,
1891
- textColor: PropTypes.string,
1892
- backgroundColor: PropTypes.string,
1893
- borderColor: PropTypes.string,
1894
- arrowColor: PropTypes.string,
1895
- insecure: PropTypes.bool,
1896
- "class": PropTypes.string,
1897
- className: PropTypes.string,
1898
- id: PropTypes.string,
1899
- html: PropTypes.bool,
1900
- delayHide: PropTypes.number,
1901
- delayUpdate: PropTypes.number,
1902
- delayShow: PropTypes.number,
1903
- event: PropTypes.string,
1904
- eventOff: PropTypes.string,
1905
- isCapture: PropTypes.bool,
1906
- globalEventOff: PropTypes.string,
1907
- getContent: PropTypes.any,
1908
- afterShow: PropTypes.func,
1909
- afterHide: PropTypes.func,
1910
- overridePosition: PropTypes.func,
1911
- disable: PropTypes.bool,
1912
- scrollHide: PropTypes.bool,
1913
- resizeHide: PropTypes.bool,
1914
- wrapper: PropTypes.string,
1915
- bodyMode: PropTypes.bool,
1916
- possibleCustomEvents: PropTypes.string,
1917
- possibleCustomEventsOff: PropTypes.string,
1918
- clickable: PropTypes.bool
1919
- };
1920
- }
1921
- }]);
2527
+ var _super = _createSuper(ReactTooltip);
1922
2528
 
1923
2529
  function ReactTooltip(props) {
1924
2530
  var _this;
1925
2531
 
1926
2532
  _classCallCheck(this, ReactTooltip);
1927
2533
 
1928
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));
2534
+ _this = _super.call(this, props);
1929
2535
  _this.state = {
1930
2536
  uuid: props.uuid || generateUUID(),
1931
2537
  place: props.place || 'top',
1932
2538
  // Direction of tooltip
1933
2539
  desiredPlace: props.place || 'top',
1934
- type: 'dark',
2540
+ type: props.type || 'dark',
1935
2541
  // Color theme of tooltip
1936
- effect: 'float',
2542
+ effect: props.effect || 'float',
1937
2543
  // float or fixed
1938
2544
  show: false,
1939
2545
  border: false,
1940
2546
  customColors: {},
1941
2547
  offset: {},
2548
+ padding: props.padding,
1942
2549
  extraClass: '',
1943
2550
  html: false,
1944
2551
  delayHide: 0,
@@ -1985,9 +2592,10 @@ function (_React$Component) {
1985
2592
  }, {
1986
2593
  key: "componentDidMount",
1987
2594
  value: function componentDidMount() {
1988
- var _this$props = this.props,
1989
- insecure = _this$props.insecure,
1990
- resizeHide = _this$props.resizeHide;
2595
+ var _this$props = this.props;
2596
+ _this$props.insecure;
2597
+ var resizeHide = _this$props.resizeHide;
2598
+ this.mount = true;
1991
2599
  this.bindListener(); // Bind listener for tooltip
1992
2600
 
1993
2601
  this.bindWindowEvents(resizeHide); // Bind global event for static method
@@ -2215,7 +2823,7 @@ function (_React$Component) {
2215
2823
  }
2216
2824
  }
2217
2825
 
2218
- return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2826
+ return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2219
2827
  }
2220
2828
  }, {
2221
2829
  key: "isEmptyTip",
@@ -2262,20 +2870,20 @@ function (_React$Component) {
2262
2870
 
2263
2871
 
2264
2872
  if (e && e.currentTarget && e.currentTarget.setAttribute) {
2265
- e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
2873
+ e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
2266
2874
  } // Make sure the correct place is set
2267
2875
 
2268
2876
 
2269
2877
  var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
2270
2878
  var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
2271
2879
  var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
2272
- var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2880
+ var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
2273
2881
 
2274
2882
  if (result.position && this.props.overridePosition) {
2275
2883
  result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2276
2884
  }
2277
2885
 
2278
- var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering
2886
+ var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0]; // To prevent previously created timers from triggering
2279
2887
 
2280
2888
  this.clearTimer();
2281
2889
  var target = e.currentTarget;
@@ -2297,6 +2905,7 @@ function (_React$Component) {
2297
2905
  },
2298
2906
  effect: effect,
2299
2907
  offset: offset,
2908
+ padding: target.getAttribute('data-padding') || self.props.padding,
2300
2909
  html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
2301
2910
  delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
2302
2911
  delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
@@ -2316,7 +2925,7 @@ function (_React$Component) {
2316
2925
  self.intervalUpdateContent = setInterval(function () {
2317
2926
  if (self.mount) {
2318
2927
  var _getContent = self.props.getContent;
2319
- var placeholder = getTipContent(originTooltip, '', _getContent[0](), isMultiline);
2928
+ var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
2320
2929
  var isEmptyTip = self.isEmptyTip(placeholder);
2321
2930
  self.setState({
2322
2931
  isEmptyTip: isEmptyTip
@@ -2347,7 +2956,9 @@ function (_React$Component) {
2347
2956
  var _this$state = this.state,
2348
2957
  delayShow = _this$state.delayShow,
2349
2958
  disable = _this$state.disable;
2350
- var afterShow = this.props.afterShow;
2959
+ var _this$props6 = this.props,
2960
+ afterShow = _this$props6.afterShow,
2961
+ disableProp = _this$props6.disable;
2351
2962
  var placeholder = this.getTooltipContent();
2352
2963
  var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2353
2964
 
@@ -2356,7 +2967,7 @@ function (_React$Component) {
2356
2967
  } // if the tooltip is empty, disable the tooltip
2357
2968
 
2358
2969
 
2359
- if (this.isEmptyTip(placeholder) || disable) {
2970
+ if (this.isEmptyTip(placeholder) || disable || disableProp) {
2360
2971
  return;
2361
2972
  }
2362
2973
 
@@ -2371,20 +2982,23 @@ function (_React$Component) {
2371
2982
  currentTarget: eventTarget,
2372
2983
  show: true
2373
2984
  }, function () {
2374
- _this5.updatePosition();
2375
-
2376
- if (isInvisible && afterShow) {
2377
- afterShow(e);
2378
- }
2985
+ _this5.updatePosition(function () {
2986
+ if (isInvisible && afterShow) {
2987
+ afterShow(e);
2988
+ }
2989
+ });
2379
2990
  });
2380
2991
  }
2381
2992
  };
2382
2993
 
2383
- clearTimeout(this.delayShowLoop);
2994
+ if (this.delayShowLoop) {
2995
+ clearTimeout(this.delayShowLoop);
2996
+ }
2384
2997
 
2385
2998
  if (delayTime) {
2386
2999
  this.delayShowLoop = setTimeout(updateState, delayTime);
2387
3000
  } else {
3001
+ this.delayShowLoop = null;
2388
3002
  updateState();
2389
3003
  }
2390
3004
  }
@@ -2425,10 +3039,12 @@ function (_React$Component) {
2425
3039
  var disable = this.state.disable;
2426
3040
  var isScroll = options.isScroll;
2427
3041
  var delayHide = isScroll ? 0 : this.state.delayHide;
2428
- var afterHide = this.props.afterHide;
3042
+ var _this$props7 = this.props,
3043
+ afterHide = _this$props7.afterHide,
3044
+ disableProp = _this$props7.disable;
2429
3045
  var placeholder = this.getTooltipContent();
2430
3046
  if (!this.mount) return;
2431
- if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip
3047
+ if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
2432
3048
 
2433
3049
  if (hasTarget) {
2434
3050
  // Don't trigger other elements belongs to other ReactTooltip
@@ -2505,7 +3121,7 @@ function (_React$Component) {
2505
3121
 
2506
3122
  }, {
2507
3123
  key: "updatePosition",
2508
- value: function updatePosition() {
3124
+ value: function updatePosition(callbackAfter) {
2509
3125
  var _this7 = this;
2510
3126
 
2511
3127
  var _this$state2 = this.state,
@@ -2525,10 +3141,11 @@ function (_React$Component) {
2525
3141
  if (result.isNewState) {
2526
3142
  // Switch to reverse placement
2527
3143
  return this.setState(result.newState, function () {
2528
- _this7.updatePosition();
3144
+ _this7.updatePosition(callbackAfter);
2529
3145
  });
2530
- } // Set tooltip position
3146
+ }
2531
3147
 
3148
+ callbackAfter(); // Set tooltip position
2532
3149
 
2533
3150
  node.style.left = result.position.left + 'px';
2534
3151
  node.style.top = result.position.top + 'px';
@@ -2540,10 +3157,25 @@ function (_React$Component) {
2540
3157
  }, {
2541
3158
  key: "clearTimer",
2542
3159
  value: function clearTimer() {
2543
- clearTimeout(this.delayShowLoop);
2544
- clearTimeout(this.delayHideLoop);
2545
- clearTimeout(this.delayReshow);
2546
- clearInterval(this.intervalUpdateContent);
3160
+ if (this.delayShowLoop) {
3161
+ clearTimeout(this.delayShowLoop);
3162
+ this.delayShowLoop = null;
3163
+ }
3164
+
3165
+ if (this.delayHideLoop) {
3166
+ clearTimeout(this.delayHideLoop);
3167
+ this.delayHideLoop = null;
3168
+ }
3169
+
3170
+ if (this.delayReshow) {
3171
+ clearTimeout(this.delayReshow);
3172
+ this.delayReshow = null;
3173
+ }
3174
+
3175
+ if (this.intervalUpdateContent) {
3176
+ clearInterval(this.intervalUpdateContent);
3177
+ this.intervalUpdateContent = null;
3178
+ }
2547
3179
  }
2548
3180
  }, {
2549
3181
  key: "hasCustomColors",
@@ -2567,7 +3199,7 @@ function (_React$Component) {
2567
3199
  uuid = _this$state3.uuid;
2568
3200
  var content = this.getTooltipContent();
2569
3201
  var isEmptyTip = this.isEmptyTip(content);
2570
- var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);
3202
+ var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding);
2571
3203
  var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' border' : '') + " place-".concat(this.state.place) + // top, bottom, left, right
2572
3204
  " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + ( // dark, success, warning, error, info, light, custom
2573
3205
  this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
@@ -2581,7 +3213,7 @@ function (_React$Component) {
2581
3213
 
2582
3214
  if (html) {
2583
3215
  var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
2584
- return React.createElement(Wrapper, _extends({
3216
+ return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
2585
3217
  className: "".concat(wrapperClassName),
2586
3218
  id: this.props.id || uuid,
2587
3219
  ref: function ref(_ref) {
@@ -2594,7 +3226,7 @@ function (_React$Component) {
2594
3226
  }
2595
3227
  }));
2596
3228
  } else {
2597
- return React.createElement(Wrapper, _extends({
3229
+ return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
2598
3230
  className: "".concat(wrapperClassName),
2599
3231
  id: this.props.id || uuid
2600
3232
  }, ariaProps, {
@@ -2602,7 +3234,7 @@ function (_React$Component) {
2602
3234
  return _this9.tooltipRef = _ref2;
2603
3235
  },
2604
3236
  "data-id": "tooltip"
2605
- }), React.createElement("style", {
3237
+ }), /*#__PURE__*/React__default["default"].createElement("style", {
2606
3238
  dangerouslySetInnerHTML: {
2607
3239
  __html: style
2608
3240
  },
@@ -2611,6 +3243,49 @@ function (_React$Component) {
2611
3243
  }
2612
3244
  }
2613
3245
  }], [{
3246
+ key: "propTypes",
3247
+ get: function get() {
3248
+ return {
3249
+ uuid: PropTypes__default["default"].string,
3250
+ children: PropTypes__default["default"].any,
3251
+ place: PropTypes__default["default"].string,
3252
+ type: PropTypes__default["default"].string,
3253
+ effect: PropTypes__default["default"].string,
3254
+ offset: PropTypes__default["default"].object,
3255
+ padding: PropTypes__default["default"].string,
3256
+ multiline: PropTypes__default["default"].bool,
3257
+ border: PropTypes__default["default"].bool,
3258
+ textColor: PropTypes__default["default"].string,
3259
+ backgroundColor: PropTypes__default["default"].string,
3260
+ borderColor: PropTypes__default["default"].string,
3261
+ arrowColor: PropTypes__default["default"].string,
3262
+ insecure: PropTypes__default["default"].bool,
3263
+ "class": PropTypes__default["default"].string,
3264
+ className: PropTypes__default["default"].string,
3265
+ id: PropTypes__default["default"].string,
3266
+ html: PropTypes__default["default"].bool,
3267
+ delayHide: PropTypes__default["default"].number,
3268
+ delayUpdate: PropTypes__default["default"].number,
3269
+ delayShow: PropTypes__default["default"].number,
3270
+ event: PropTypes__default["default"].string,
3271
+ eventOff: PropTypes__default["default"].string,
3272
+ isCapture: PropTypes__default["default"].bool,
3273
+ globalEventOff: PropTypes__default["default"].string,
3274
+ getContent: PropTypes__default["default"].any,
3275
+ afterShow: PropTypes__default["default"].func,
3276
+ afterHide: PropTypes__default["default"].func,
3277
+ overridePosition: PropTypes__default["default"].func,
3278
+ disable: PropTypes__default["default"].bool,
3279
+ scrollHide: PropTypes__default["default"].bool,
3280
+ resizeHide: PropTypes__default["default"].bool,
3281
+ wrapper: PropTypes__default["default"].string,
3282
+ bodyMode: PropTypes__default["default"].bool,
3283
+ possibleCustomEvents: PropTypes__default["default"].string,
3284
+ possibleCustomEventsOff: PropTypes__default["default"].string,
3285
+ clickable: PropTypes__default["default"].bool
3286
+ };
3287
+ }
3288
+ }, {
2614
3289
  key: "getDerivedStateFromProps",
2615
3290
  value: function getDerivedStateFromProps(nextProps, prevState) {
2616
3291
  var ariaProps = prevState.ariaProps;
@@ -2623,19 +3298,19 @@ function (_React$Component) {
2623
3298
  return null;
2624
3299
  }
2625
3300
 
2626
- return _objectSpread2({}, prevState, {
3301
+ return _objectSpread2(_objectSpread2({}, prevState), {}, {
2627
3302
  ariaProps: newAriaProps
2628
3303
  });
2629
3304
  }
2630
3305
  }]);
2631
3306
 
2632
3307
  return ReactTooltip;
2633
- }(React.Component), _defineProperty(_class2, "defaultProps", {
3308
+ }(React__default["default"].Component), _defineProperty(_class2, "defaultProps", {
2634
3309
  insecure: true,
2635
3310
  resizeHide: true,
2636
3311
  wrapper: 'div',
2637
3312
  clickable: false
2638
- }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
3313
+ }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
2639
3314
 
2640
3315
  module.exports = ReactTooltip;
2641
3316
  //# sourceMappingURL=index.js.map