react-tooltip 4.2.21 → 4.3.1

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,17 +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
+ if (Object.getOwnPropertySymbols) {
15
+ var symbols = Object.getOwnPropertySymbols(object);
16
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
17
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
18
+ })), keys.push.apply(keys, symbols);
19
+ }
20
+ return keys;
21
+ }
22
+ function _objectSpread2(target) {
23
+ for (var i = 1; i < arguments.length; i++) {
24
+ var source = null != arguments[i] ? arguments[i] : {};
25
+ i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
26
+ _defineProperty(target, key, source[key]);
27
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
28
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
29
+ });
30
+ }
31
+ return target;
32
+ }
9
33
  function _classCallCheck(instance, Constructor) {
10
34
  if (!(instance instanceof Constructor)) {
11
35
  throw new TypeError("Cannot call a class as a function");
12
36
  }
13
37
  }
14
-
15
38
  function _defineProperties(target, props) {
16
39
  for (var i = 0; i < props.length; i++) {
17
40
  var descriptor = props[i];
@@ -21,13 +44,14 @@ function _defineProperties(target, props) {
21
44
  Object.defineProperty(target, descriptor.key, descriptor);
22
45
  }
23
46
  }
24
-
25
47
  function _createClass(Constructor, protoProps, staticProps) {
26
48
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
49
  if (staticProps) _defineProperties(Constructor, staticProps);
50
+ Object.defineProperty(Constructor, "prototype", {
51
+ writable: false
52
+ });
28
53
  return Constructor;
29
54
  }
30
-
31
55
  function _defineProperty(obj, key, value) {
32
56
  if (key in obj) {
33
57
  Object.defineProperty(obj, key, {
@@ -39,67 +63,26 @@ function _defineProperty(obj, key, value) {
39
63
  } else {
40
64
  obj[key] = value;
41
65
  }
42
-
43
66
  return obj;
44
67
  }
45
-
46
68
  function _extends() {
47
- _extends = Object.assign || function (target) {
69
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
48
70
  for (var i = 1; i < arguments.length; i++) {
49
71
  var source = arguments[i];
50
-
51
72
  for (var key in source) {
52
73
  if (Object.prototype.hasOwnProperty.call(source, key)) {
53
74
  target[key] = source[key];
54
75
  }
55
76
  }
56
77
  }
57
-
58
78
  return target;
59
79
  };
60
-
61
80
  return _extends.apply(this, arguments);
62
81
  }
63
-
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
82
  function _inherits(subClass, superClass) {
99
83
  if (typeof superClass !== "function" && superClass !== null) {
100
84
  throw new TypeError("Super expression must either be null or a function");
101
85
  }
102
-
103
86
  subClass.prototype = Object.create(superClass && superClass.prototype, {
104
87
  constructor: {
105
88
  value: subClass,
@@ -107,1303 +90,961 @@ function _inherits(subClass, superClass) {
107
90
  configurable: true
108
91
  }
109
92
  });
93
+ Object.defineProperty(subClass, "prototype", {
94
+ writable: false
95
+ });
110
96
  if (superClass) _setPrototypeOf(subClass, superClass);
111
97
  }
112
-
113
98
  function _getPrototypeOf(o) {
114
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
99
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
115
100
  return o.__proto__ || Object.getPrototypeOf(o);
116
101
  };
117
102
  return _getPrototypeOf(o);
118
103
  }
119
-
120
104
  function _setPrototypeOf(o, p) {
121
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
105
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
122
106
  o.__proto__ = p;
123
107
  return o;
124
108
  };
125
-
126
109
  return _setPrototypeOf(o, p);
127
110
  }
128
-
111
+ function _isNativeReflectConstruct() {
112
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
113
+ if (Reflect.construct.sham) return false;
114
+ if (typeof Proxy === "function") return true;
115
+ try {
116
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
117
+ return true;
118
+ } catch (e) {
119
+ return false;
120
+ }
121
+ }
129
122
  function _assertThisInitialized(self) {
130
123
  if (self === void 0) {
131
124
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
132
125
  }
133
-
134
126
  return self;
135
127
  }
136
-
137
128
  function _possibleConstructorReturn(self, call) {
138
129
  if (call && (typeof call === "object" || typeof call === "function")) {
139
130
  return call;
131
+ } else if (call !== void 0) {
132
+ throw new TypeError("Derived constructors may only return object or undefined");
140
133
  }
141
-
142
134
  return _assertThisInitialized(self);
143
135
  }
144
-
145
- var CONSTANT = {
146
- GLOBAL: {
147
- HIDE: '__react_tooltip_hide_event',
148
- REBUILD: '__react_tooltip_rebuild_event',
149
- SHOW: '__react_tooltip_show_event'
136
+ function _createSuper(Derived) {
137
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
138
+ return function _createSuperInternal() {
139
+ var Super = _getPrototypeOf(Derived),
140
+ result;
141
+ if (hasNativeReflectConstruct) {
142
+ var NewTarget = _getPrototypeOf(this).constructor;
143
+ result = Reflect.construct(Super, arguments, NewTarget);
144
+ } else {
145
+ result = Super.apply(this, arguments);
146
+ }
147
+ return _possibleConstructorReturn(this, result);
148
+ };
149
+ }
150
+ function _unsupportedIterableToArray(o, minLen) {
151
+ if (!o) return;
152
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
153
+ var n = Object.prototype.toString.call(o).slice(8, -1);
154
+ if (n === "Object" && o.constructor) n = o.constructor.name;
155
+ if (n === "Map" || n === "Set") return Array.from(o);
156
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
157
+ }
158
+ function _arrayLikeToArray(arr, len) {
159
+ if (len == null || len > arr.length) len = arr.length;
160
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
161
+ return arr2;
162
+ }
163
+ function _createForOfIteratorHelper(o, allowArrayLike) {
164
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
165
+ if (!it) {
166
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
167
+ if (it) o = it;
168
+ var i = 0;
169
+ var F = function () {};
170
+ return {
171
+ s: F,
172
+ n: function () {
173
+ if (i >= o.length) return {
174
+ done: true
175
+ };
176
+ return {
177
+ done: false,
178
+ value: o[i++]
179
+ };
180
+ },
181
+ e: function (e) {
182
+ throw e;
183
+ },
184
+ f: F
185
+ };
186
+ }
187
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
150
188
  }
189
+ var normalCompletion = true,
190
+ didErr = false,
191
+ err;
192
+ return {
193
+ s: function () {
194
+ it = it.call(o);
195
+ },
196
+ n: function () {
197
+ var step = it.next();
198
+ normalCompletion = step.done;
199
+ return step;
200
+ },
201
+ e: function (e) {
202
+ didErr = true;
203
+ err = e;
204
+ },
205
+ f: function () {
206
+ try {
207
+ if (!normalCompletion && it.return != null) it.return();
208
+ } finally {
209
+ if (didErr) throw err;
210
+ }
211
+ }
212
+ };
213
+ }
214
+
215
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
216
+
217
+ var check = function (it) {
218
+ return it && it.Math == Math && it;
151
219
  };
152
220
 
153
- /**
154
- * Static methods for react-tooltip
155
- */
221
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
222
+ var global$a =
223
+ // eslint-disable-next-line es/no-global-this -- safe
224
+ check(typeof globalThis == 'object' && globalThis) ||
225
+ check(typeof window == 'object' && window) ||
226
+ // eslint-disable-next-line no-restricted-globals -- safe
227
+ check(typeof self == 'object' && self) ||
228
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
229
+ // eslint-disable-next-line no-new-func -- fallback
230
+ (function () { return this; })() || Function('return this')();
156
231
 
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;
232
+ var objectGetOwnPropertyDescriptor = {};
162
233
 
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);
234
+ var fails$9 = function (exec) {
235
+ try {
236
+ return !!exec();
237
+ } catch (error) {
238
+ return true;
170
239
  }
171
-
172
- window.dispatchEvent(event);
173
240
  };
174
241
 
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
- });
184
- };
185
- /**
186
- * Rebuild all tooltip
187
- * @trigger ReactTooltip.rebuild()
188
- */
189
-
242
+ var fails$8 = fails$9;
190
243
 
191
- target.rebuild = function () {
192
- dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
193
- };
194
- /**
195
- * Show specific tooltip
196
- * @trigger ReactTooltip.show()
197
- */
244
+ // Detect IE8's incomplete defineProperty implementation
245
+ var descriptors = !fails$8(function () {
246
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
247
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
248
+ });
198
249
 
250
+ var fails$7 = fails$9;
199
251
 
200
- target.show = function (target) {
201
- dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
202
- target: target
203
- });
204
- };
252
+ var functionBindNative = !fails$7(function () {
253
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
254
+ var test = (function () { /* empty */ }).bind();
255
+ // eslint-disable-next-line no-prototype-builtins -- safe
256
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
257
+ });
205
258
 
206
- target.prototype.globalRebuild = function () {
207
- if (this.mount) {
208
- this.unbindListener();
209
- this.bindListener();
210
- }
211
- };
259
+ var NATIVE_BIND$2 = functionBindNative;
212
260
 
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
261
+ var call$4 = Function.prototype.call;
217
262
 
218
- this.showTooltip({
219
- currentTarget: hasTarget && event.detail.target
220
- }, true);
221
- }
222
- };
263
+ var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
264
+ return call$4.apply(call$4, arguments);
265
+ };
223
266
 
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);
230
- }
231
- };
232
- }
267
+ var objectPropertyIsEnumerable = {};
233
268
 
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
269
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
270
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
271
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
242
272
 
243
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
244
- window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show
273
+ // Nashorn ~ JDK8 bug
274
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
245
275
 
246
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
247
- window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize
276
+ // `Object.prototype.propertyIsEnumerable` method implementation
277
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
278
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
279
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
280
+ return !!descriptor && descriptor.enumerable;
281
+ } : $propertyIsEnumerable;
248
282
 
249
- if (resizeHide) {
250
- window.removeEventListener('resize', this.onWindowResize);
251
- window.addEventListener('resize', this.onWindowResize, false);
252
- }
283
+ var createPropertyDescriptor$2 = function (bitmap, value) {
284
+ return {
285
+ enumerable: !(bitmap & 1),
286
+ configurable: !(bitmap & 2),
287
+ writable: !(bitmap & 4),
288
+ value: value
253
289
  };
290
+ };
254
291
 
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
- */
292
+ var NATIVE_BIND$1 = functionBindNative;
264
293
 
294
+ var FunctionPrototype$1 = Function.prototype;
295
+ var call$3 = FunctionPrototype$1.call;
296
+ var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$3, call$3);
265
297
 
266
- target.prototype.onWindowResize = function () {
267
- if (!this.mount) return;
268
- this.hideTooltip();
298
+ var functionUncurryThisRaw = function (fn) {
299
+ return NATIVE_BIND$1 ? uncurryThisWithBind(fn) : function () {
300
+ return call$3.apply(fn, arguments);
269
301
  };
270
- }
302
+ };
271
303
 
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();
304
+ var uncurryThisRaw$1 = functionUncurryThisRaw;
285
305
 
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
- }
306
+ var toString$1 = uncurryThisRaw$1({}.toString);
307
+ var stringSlice = uncurryThisRaw$1(''.slice);
308
+
309
+ var classofRaw$2 = function (it) {
310
+ return stringSlice(toString$1(it), 8, -1);
293
311
  };
294
312
 
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
- }
313
+ var classofRaw$1 = classofRaw$2;
314
+ var uncurryThisRaw = functionUncurryThisRaw;
315
+
316
+ var functionUncurryThis = function (fn) {
317
+ // Nashorn bug:
318
+ // https://github.com/zloirock/core-js/issues/1128
319
+ // https://github.com/zloirock/core-js/issues/1130
320
+ if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
303
321
  };
304
322
 
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];
323
+ var uncurryThis$9 = functionUncurryThis;
324
+ var fails$6 = fails$9;
325
+ var classof$3 = classofRaw$2;
321
326
 
322
- if (map !== undefined) {
323
- return map[event];
324
- }
325
- }
326
- };
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 */
327
+ var $Object$3 = Object;
328
+ var split = uncurryThis$9(''.split);
333
329
 
330
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
331
+ var indexedObject = fails$6(function () {
332
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
333
+ // eslint-disable-next-line no-prototype-builtins -- safe
334
+ return !$Object$3('z').propertyIsEnumerable(0);
335
+ }) ? function (it) {
336
+ return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
337
+ } : $Object$3;
334
338
 
335
- target.prototype.customBindListener = function (ele) {
336
- var _this = this;
339
+ // we can't use just `it == null` since of `document.all` special case
340
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
341
+ var isNullOrUndefined$2 = function (it) {
342
+ return it === null || it === undefined;
343
+ };
337
344
 
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
- });
345
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
349
346
 
350
- if (dataEventOff) {
351
- dataEventOff.split(' ').forEach(function (event) {
352
- ele.removeEventListener(event, _this.hideTooltip);
353
- ele.addEventListener(event, _this.hideTooltip, false);
354
- });
355
- }
356
- };
357
- /* Unbind listener for custom event */
347
+ var $TypeError$5 = TypeError;
358
348
 
349
+ // `RequireObjectCoercible` abstract operation
350
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
351
+ var requireObjectCoercible$2 = function (it) {
352
+ if (isNullOrUndefined$1(it)) throw $TypeError$5("Can't call method on " + it);
353
+ return it;
354
+ };
359
355
 
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
- }
356
+ // toObject with fallback for non-array-like ES3 strings
357
+ var IndexedObject$1 = indexedObject;
358
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
370
359
 
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;
377
- };
378
- }
360
+ var toIndexedObject$4 = function (it) {
361
+ return IndexedObject$1(requireObjectCoercible$1(it));
362
+ };
379
363
 
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
- }
364
+ var documentAll$2 = typeof document == 'object' && document.all;
389
365
 
390
- /**
391
- * Util method to get effect
392
- */
366
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
367
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
393
368
 
394
- var makeProxy = function makeProxy(e) {
395
- var proxy = {};
369
+ var documentAll_1 = {
370
+ all: documentAll$2,
371
+ IS_HTMLDDA: IS_HTMLDDA
372
+ };
396
373
 
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
- }
374
+ var $documentAll$1 = documentAll_1;
404
375
 
405
- return proxy;
406
- };
376
+ var documentAll$1 = $documentAll$1.all;
407
377
 
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;
378
+ // `IsCallable` abstract operation
379
+ // https://tc39.es/ecma262/#sec-iscallable
380
+ var isCallable$c = $documentAll$1.IS_HTMLDDA ? function (argument) {
381
+ return typeof argument == 'function' || argument === documentAll$1;
382
+ } : function (argument) {
383
+ return typeof argument == 'function';
384
+ };
417
385
 
418
- if (this.isCustomEvent(target) && !customEvent) {
419
- return;
420
- }
386
+ var isCallable$b = isCallable$c;
387
+ var $documentAll = documentAll_1;
421
388
 
422
- var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
389
+ var documentAll = $documentAll.all;
423
390
 
424
- if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
425
- var proxy = makeProxy(e);
426
- proxy.currentTarget = target;
427
- callback(proxy);
428
- }
391
+ var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
392
+ return typeof it == 'object' ? it !== null : isCallable$b(it) || it === documentAll;
393
+ } : function (it) {
394
+ return typeof it == 'object' ? it !== null : isCallable$b(it);
429
395
  };
430
396
 
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;
440
- };
397
+ var global$9 = global$a;
398
+ var isCallable$a = isCallable$c;
441
399
 
442
- var getBody = function getBody() {
443
- return document.getElementsByTagName('body')[0];
400
+ var aFunction = function (argument) {
401
+ return isCallable$a(argument) ? argument : undefined;
444
402
  };
445
403
 
446
- function bodyMode (target) {
447
- target.prototype.isBodyMode = function () {
448
- return !!this.props.bodyMode;
449
- };
404
+ var getBuiltIn$5 = function (namespace, method) {
405
+ return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
406
+ };
450
407
 
451
- target.prototype.bindBodyListener = function (targetArray) {
452
- var _this = this;
408
+ var uncurryThis$8 = functionUncurryThis;
453
409
 
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 = {};
410
+ var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
472
411
 
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
- }
412
+ var getBuiltIn$4 = getBuiltIn$5;
480
413
 
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
- }
414
+ var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
489
415
 
490
- for (var _event2 in customEventsOff) {
491
- listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
492
- customEvent: true
493
- });
494
- }
416
+ var global$8 = global$a;
417
+ var userAgent = engineUserAgent;
495
418
 
496
- for (var _event3 in listeners) {
497
- body.addEventListener(_event3, listeners[_event3]);
498
- }
499
- };
419
+ var process = global$8.process;
420
+ var Deno = global$8.Deno;
421
+ var versions = process && process.versions || Deno && Deno.version;
422
+ var v8 = versions && versions.v8;
423
+ var match, version;
500
424
 
501
- target.prototype.unbindBodyListener = function (body) {
502
- body = body || getBody();
503
- var listeners = this.bodyModeListeners;
425
+ if (v8) {
426
+ match = v8.split('.');
427
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
428
+ // but their correct versions are not interesting for us
429
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
430
+ }
504
431
 
505
- for (var event in listeners) {
506
- body.removeEventListener(event, listeners[event]);
507
- }
508
- };
432
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
433
+ // so check `userAgent` even if `.v8` exists, but 0
434
+ if (!version && userAgent) {
435
+ match = userAgent.match(/Edge\/(\d+)/);
436
+ if (!match || match[1] >= 74) {
437
+ match = userAgent.match(/Chrome\/(\d+)/);
438
+ if (match) version = +match[1];
439
+ }
509
440
  }
510
441
 
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
- };
442
+ var engineV8Version = version;
523
443
 
524
- function trackRemoval (target) {
525
- target.prototype.bindRemovalTracker = function () {
526
- var _this = this;
444
+ /* eslint-disable es/no-symbol -- required for testing */
527
445
 
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];
446
+ var V8_VERSION = engineV8Version;
447
+ var fails$5 = fails$9;
533
448
 
534
- for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
535
- var element = mutation.removedNodes[m2];
449
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
450
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
451
+ var symbol = Symbol();
452
+ // Chrome 38 Symbol has incorrect toString conversion
453
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
454
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
455
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
456
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
457
+ });
536
458
 
537
- if (element === _this.state.currentTarget) {
538
- _this.hideTooltip();
459
+ /* eslint-disable es/no-symbol -- required for testing */
539
460
 
540
- return;
541
- }
542
- }
543
- }
544
- });
545
- observer.observe(window.document, {
546
- childList: true,
547
- subtree: true
548
- });
549
- this.removalTracker = observer;
550
- };
461
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
551
462
 
552
- target.prototype.unbindRemovalTracker = function () {
553
- if (this.removalTracker) {
554
- this.removalTracker.disconnect();
555
- this.removalTracker = null;
556
- }
557
- };
558
- }
463
+ var useSymbolAsUid = NATIVE_SYMBOL$1
464
+ && !Symbol.sham
465
+ && typeof Symbol.iterator == 'symbol';
559
466
 
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;
467
+ var getBuiltIn$3 = getBuiltIn$5;
468
+ var isCallable$9 = isCallable$c;
469
+ var isPrototypeOf = objectIsPrototypeOf;
470
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
580
471
 
581
- var _getDimensions2 = getDimensions(target),
582
- targetWidth = _getDimensions2.width,
583
- targetHeight = _getDimensions2.height;
472
+ var $Object$2 = Object;
584
473
 
585
- var _getCurrentOffset = getCurrentOffset(e, target, effect),
586
- mouseX = _getCurrentOffset.mouseX,
587
- mouseY = _getCurrentOffset.mouseY;
474
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
475
+ return typeof it == 'symbol';
476
+ } : function (it) {
477
+ var $Symbol = getBuiltIn$3('Symbol');
478
+ return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
479
+ };
588
480
 
589
- var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
481
+ var $String$1 = String;
590
482
 
591
- var _calculateOffset = calculateOffset(offset),
592
- extraOffsetX = _calculateOffset.extraOffsetX,
593
- extraOffsetY = _calculateOffset.extraOffsetY;
483
+ var tryToString$1 = function (argument) {
484
+ try {
485
+ return $String$1(argument);
486
+ } catch (error) {
487
+ return 'Object';
488
+ }
489
+ };
594
490
 
595
- var windowWidth = window.innerWidth;
596
- var windowHeight = window.innerHeight;
491
+ var isCallable$8 = isCallable$c;
492
+ var tryToString = tryToString$1;
597
493
 
598
- var _getParent = getParent(node),
599
- parentTop = _getParent.parentTop,
600
- parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
494
+ var $TypeError$4 = TypeError;
601
495
 
496
+ // `Assert: IsCallable(argument) is true`
497
+ var aCallable$2 = function (argument) {
498
+ if (isCallable$8(argument)) return argument;
499
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
500
+ };
602
501
 
603
- var getTipOffsetLeft = function getTipOffsetLeft(place) {
604
- var offsetX = defaultOffset[place].l;
605
- return mouseX + offsetX + extraOffsetX;
606
- };
502
+ var aCallable$1 = aCallable$2;
503
+ var isNullOrUndefined = isNullOrUndefined$2;
607
504
 
608
- var getTipOffsetRight = function getTipOffsetRight(place) {
609
- var offsetX = defaultOffset[place].r;
610
- return mouseX + offsetX + extraOffsetX;
611
- };
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 isNullOrUndefined(func) ? undefined : aCallable$1(func);
510
+ };
612
511
 
613
- var getTipOffsetTop = function getTipOffsetTop(place) {
614
- var offsetY = defaultOffset[place].t;
615
- return mouseY + offsetY + extraOffsetY;
616
- };
512
+ var call$2 = functionCall;
513
+ var isCallable$7 = isCallable$c;
514
+ var isObject$5 = isObject$6;
617
515
 
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
- //
516
+ var $TypeError$3 = TypeError;
635
517
 
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
+ };
636
527
 
637
- var outsideLeft = function outsideLeft(p) {
638
- return getTipOffsetLeft(p) < 0;
639
- };
528
+ var shared$3 = {exports: {}};
640
529
 
641
- var outsideRight = function outsideRight(p) {
642
- return getTipOffsetRight(p) > windowWidth;
643
- };
530
+ var global$7 = global$a;
644
531
 
645
- var outsideTop = function outsideTop(p) {
646
- return getTipOffsetTop(p) < 0;
647
- };
532
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
533
+ var defineProperty$2 = Object.defineProperty;
648
534
 
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
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
+ };
652
542
 
543
+ var global$6 = global$a;
544
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
653
545
 
654
- var outside = function outside(p) {
655
- return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
656
- };
546
+ var SHARED = '__core-js_shared__';
547
+ var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
657
548
 
658
- var inside = function inside(p) {
659
- return !outside(p);
660
- };
549
+ var sharedStore = store$3;
661
550
 
662
- var placesList = ['top', 'bottom', 'left', 'right'];
663
- var insideList = [];
551
+ var store$2 = sharedStore;
664
552
 
665
- for (var i = 0; i < 4; i++) {
666
- var p = placesList[i];
553
+ (shared$3.exports = function (key, value) {
554
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
555
+ })('versions', []).push({
556
+ version: '3.25.5',
557
+ mode: 'global',
558
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
559
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
560
+ source: 'https://github.com/zloirock/core-js'
561
+ });
667
562
 
668
- if (inside(p)) {
669
- insideList.push(p);
670
- }
671
- }
563
+ var requireObjectCoercible = requireObjectCoercible$2;
672
564
 
673
- var isNewState = false;
674
- var newPlace;
675
- var shouldUpdatePlace = desiredPlace !== place;
565
+ var $Object$1 = Object;
676
566
 
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
- }
567
+ // `ToObject` abstract operation
568
+ // https://tc39.es/ecma262/#sec-toobject
569
+ var toObject$2 = function (argument) {
570
+ return $Object$1(requireObjectCoercible(argument));
571
+ };
684
572
 
685
- if (isNewState) {
686
- return {
687
- isNewState: true,
688
- newState: {
689
- place: newPlace
690
- }
691
- };
692
- }
573
+ var uncurryThis$7 = functionUncurryThis;
574
+ var toObject$1 = toObject$2;
693
575
 
694
- return {
695
- isNewState: false,
696
- position: {
697
- left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
698
- top: parseInt(getTipOffsetTop(place) - parentTop, 10)
699
- }
700
- };
701
- }
576
+ var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
702
577
 
703
- var getDimensions = function getDimensions(node) {
704
- var _node$getBoundingClie = node.getBoundingClientRect(),
705
- height = _node$getBoundingClie.height,
706
- width = _node$getBoundingClie.width;
578
+ // `HasOwnProperty` abstract operation
579
+ // https://tc39.es/ecma262/#sec-hasownproperty
580
+ // eslint-disable-next-line es/no-object-hasown -- safe
581
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
582
+ return hasOwnProperty(toObject$1(it), key);
583
+ };
707
584
 
708
- return {
709
- height: parseInt(height, 10),
710
- width: parseInt(width, 10)
711
- };
712
- }; // Get current mouse offset
585
+ var uncurryThis$6 = functionUncurryThis;
713
586
 
587
+ var id = 0;
588
+ var postfix = Math.random();
589
+ var toString = uncurryThis$6(1.0.toString);
714
590
 
715
- var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
716
- var boundingClientRect = currentTarget.getBoundingClientRect();
717
- var targetTop = boundingClientRect.top;
718
- var targetLeft = boundingClientRect.left;
591
+ var uid$2 = function (key) {
592
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
593
+ };
719
594
 
720
- var _getDimensions3 = getDimensions(currentTarget),
721
- targetWidth = _getDimensions3.width,
722
- targetHeight = _getDimensions3.height;
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 = symbolConstructorDetection;
600
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
723
601
 
724
- if (effect === 'float') {
725
- return {
726
- mouseX: e.clientX,
727
- mouseY: e.clientY
728
- };
729
- }
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;
730
606
 
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
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
+ };
737
619
 
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;
738
626
 
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
627
+ var $TypeError$2 = TypeError;
628
+ var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
747
629
 
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
- };
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");
798
641
  }
642
+ if (pref === undefined) pref = 'number';
643
+ return ordinaryToPrimitive(input, pref);
644
+ };
799
645
 
800
- return {
801
- top: top,
802
- bottom: bottom,
803
- left: left,
804
- right: right
805
- };
806
- }; // Consider additional offset into position calculation
807
-
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/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/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/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
717
+ var isObject$2 = isObject$6;
880
718
 
719
+ var $String = String;
720
+ var $TypeError$1 = TypeError;
881
721
 
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
- }
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
+ };
889
727
 
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
- }
906
-
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;
914
-
915
- if (nodeList.hasOwnProperty) {
916
- return Array.prototype.slice.call(nodeList);
917
- }
918
-
919
- return new Array(length).fill().map(function (index) {
920
- return nodeList[index];
921
- });
922
- }
923
-
924
- function generateUUID() {
925
- return 't' + uuid.v4();
926
- }
927
-
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}";
929
-
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
- }
970
- };
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
-
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
- */
985
-
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
- }
993
-
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);
1000
-
1001
- if (textColor) {
1002
- colors.text = textColor;
1003
- }
1004
-
1005
- if (backgroundColor) {
1006
- colors.background = backgroundColor;
1007
- }
1008
-
1009
- if (hasBorder) {
1010
- if (borderColor) {
1011
- colors.border = borderColor;
1012
- } else {
1013
- colors.border = type === 'light' ? 'black' : 'white';
1014
- }
1015
- }
1016
-
1017
- if (arrowColor) {
1018
- colors.arrow = arrowColor;
1019
- }
1020
-
1021
- return colors;
1022
- }
1023
-
1024
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1025
-
1026
- function createCommonjsModule(fn, module) {
1027
- return module = { exports: {} }, fn(module, module.exports), module.exports;
1028
- }
1029
-
1030
- var check = function (it) {
1031
- return it && it.Math == Math && it;
1032
- };
1033
-
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')();
1044
-
1045
- var fails = function (exec) {
1046
- try {
1047
- return !!exec();
1048
- } catch (error) {
1049
- return true;
1050
- }
1051
- };
1052
-
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
- });
1058
-
1059
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
1060
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1061
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1062
-
1063
- // Nashorn ~ JDK8 bug
1064
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
1065
-
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;
1072
-
1073
- var objectPropertyIsEnumerable = {
1074
- f: f
1075
- };
1076
-
1077
- var createPropertyDescriptor = function (bitmap, value) {
1078
- return {
1079
- enumerable: !(bitmap & 1),
1080
- configurable: !(bitmap & 2),
1081
- writable: !(bitmap & 4),
1082
- value: value
1083
- };
1084
- };
1085
-
1086
- var toString = {}.toString;
1087
-
1088
- var classofRaw = function (it) {
1089
- return toString.call(it).slice(8, -1);
1090
- };
1091
-
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
- };
1109
-
1110
- // toObject with fallback for non-array-like ES3 strings
1111
-
1112
-
1113
-
1114
- var toIndexedObject = function (it) {
1115
- return indexedObject(requireObjectCoercible(it));
1116
- };
1117
-
1118
- var isObject = function (it) {
1119
- return typeof it === 'object' ? it !== null : typeof it === 'function';
1120
- };
1121
-
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
- };
1134
-
1135
- // `ToObject` abstract operation
1136
- // https://tc39.es/ecma262/#sec-toobject
1137
- var toObject = function (argument) {
1138
- return Object(requireObjectCoercible(argument));
1139
- };
1140
-
1141
- var hasOwnProperty = {}.hasOwnProperty;
1142
-
1143
- var has = function hasOwn(it, key) {
1144
- return hasOwnProperty.call(toObject(it), key);
1145
- };
1146
-
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);
1150
-
1151
- var documentCreateElement = function (it) {
1152
- return EXISTS ? document$1.createElement(it) : {};
1153
- };
1154
-
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
- });
1162
-
1163
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1164
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1165
-
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]);
1175
- };
1176
-
1177
- var objectGetOwnPropertyDescriptor = {
1178
- f: f$1
1179
- };
1180
-
1181
- var anObject = function (it) {
1182
- if (!isObject(it)) {
1183
- throw TypeError(String(it) + ' is not an object');
1184
- } return it;
1185
- };
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;
1186
733
 
734
+ var $TypeError = TypeError;
1187
735
  // eslint-disable-next-line es/no-object-defineproperty -- safe
1188
736
  var $defineProperty = Object.defineProperty;
737
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
738
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
739
+ var ENUMERABLE = 'enumerable';
740
+ var CONFIGURABLE$1 = 'configurable';
741
+ var WRITABLE = 'writable';
1189
742
 
1190
743
  // `Object.defineProperty` method
1191
744
  // 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 {
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 {
1197
765
  return $defineProperty(O, P, Attributes);
1198
766
  } catch (error) { /* empty */ }
1199
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
767
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
1200
768
  if ('value' in Attributes) O[P] = Attributes.value;
1201
769
  return O;
1202
770
  };
1203
771
 
1204
- var objectDefineProperty = {
1205
- f: f$2
1206
- };
772
+ var DESCRIPTORS$3 = descriptors;
773
+ var definePropertyModule$3 = objectDefineProperty;
774
+ var createPropertyDescriptor = createPropertyDescriptor$2;
1207
775
 
1208
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
1209
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
776
+ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
777
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
1210
778
  } : function (object, key, value) {
1211
779
  object[key] = value;
1212
780
  return object;
1213
781
  };
1214
782
 
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
- };
783
+ var makeBuiltIn$2 = {exports: {}};
1222
784
 
1223
- var SHARED = '__core-js_shared__';
1224
- var store = global_1[SHARED] || setGlobal(SHARED, {});
785
+ var DESCRIPTORS$2 = descriptors;
786
+ var hasOwn$4 = hasOwnProperty_1;
787
+
788
+ var FunctionPrototype = Function.prototype;
789
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
790
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
791
+
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));
1225
796
 
1226
- var sharedStore = store;
797
+ var functionName = {
798
+ EXISTS: EXISTS,
799
+ PROPER: PROPER,
800
+ CONFIGURABLE: CONFIGURABLE
801
+ };
802
+
803
+ var uncurryThis$5 = functionUncurryThis;
804
+ var isCallable$6 = isCallable$c;
805
+ var store$1 = sharedStore;
1227
806
 
1228
- var functionToString = Function.toString;
807
+ var functionToString = uncurryThis$5(Function.toString);
1229
808
 
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);
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);
1234
813
  };
1235
814
  }
1236
815
 
1237
- var inspectSource = sharedStore.inspectSource;
816
+ var inspectSource$2 = store$1.inspectSource;
1238
817
 
1239
- var WeakMap = global_1.WeakMap;
818
+ var global$3 = global$a;
819
+ var isCallable$5 = isCallable$c;
1240
820
 
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
- });
821
+ var WeakMap$1 = global$3.WeakMap;
1252
822
 
1253
- var id = 0;
1254
- var postfix = Math.random();
823
+ var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
1255
824
 
1256
- var uid = function (key) {
1257
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
1258
- };
825
+ var shared$1 = shared$3.exports;
826
+ var uid = uid$2;
1259
827
 
1260
- var keys = shared('keys');
828
+ var keys = shared$1('keys');
1261
829
 
1262
- var sharedKey = function (key) {
830
+ var sharedKey$2 = function (key) {
1263
831
  return keys[key] || (keys[key] = uid(key));
1264
832
  };
1265
833
 
1266
- var hiddenKeys = {};
834
+ var hiddenKeys$4 = {};
835
+
836
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
837
+ var global$2 = global$a;
838
+ var isObject$1 = isObject$6;
839
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
840
+ var hasOwn$3 = hasOwnProperty_1;
841
+ var shared = sharedStore;
842
+ var sharedKey$1 = sharedKey$2;
843
+ var hiddenKeys$3 = hiddenKeys$4;
1267
844
 
1268
845
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1269
- var WeakMap$1 = global_1.WeakMap;
1270
- var set, get, has$1;
846
+ var TypeError$1 = global$2.TypeError;
847
+ var WeakMap = global$2.WeakMap;
848
+ var set, get, has;
1271
849
 
1272
850
  var enforce = function (it) {
1273
- return has$1(it) ? get(it) : set(it, {});
851
+ return has(it) ? get(it) : set(it, {});
1274
852
  };
1275
853
 
1276
854
  var getterFor = function (TYPE) {
1277
855
  return function (it) {
1278
856
  var state;
1279
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
1280
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
857
+ if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
858
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
1281
859
  } return state;
1282
860
  };
1283
861
  };
1284
862
 
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;
863
+ if (NATIVE_WEAK_MAP || shared.state) {
864
+ var store = shared.state || (shared.state = new WeakMap());
865
+ /* eslint-disable no-self-assign -- prototype methods protection */
866
+ store.get = store.get;
867
+ store.has = store.has;
868
+ store.set = store.set;
869
+ /* eslint-enable no-self-assign -- prototype methods protection */
1290
870
  set = function (it, metadata) {
1291
- if (wmhas.call(store$1, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
871
+ if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
1292
872
  metadata.facade = it;
1293
- wmset.call(store$1, it, metadata);
873
+ store.set(it, metadata);
1294
874
  return metadata;
1295
875
  };
1296
876
  get = function (it) {
1297
- return wmget.call(store$1, it) || {};
877
+ return store.get(it) || {};
1298
878
  };
1299
- has$1 = function (it) {
1300
- return wmhas.call(store$1, it);
879
+ has = function (it) {
880
+ return store.has(it);
1301
881
  };
1302
882
  } else {
1303
- var STATE = sharedKey('state');
1304
- hiddenKeys[STATE] = true;
883
+ var STATE = sharedKey$1('state');
884
+ hiddenKeys$3[STATE] = true;
1305
885
  set = function (it, metadata) {
1306
- if (has(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
886
+ if (hasOwn$3(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
1307
887
  metadata.facade = it;
1308
- createNonEnumerableProperty(it, STATE, metadata);
888
+ createNonEnumerableProperty$1(it, STATE, metadata);
1309
889
  return metadata;
1310
890
  };
1311
891
  get = function (it) {
1312
- return has(it, STATE) ? it[STATE] : {};
892
+ return hasOwn$3(it, STATE) ? it[STATE] : {};
1313
893
  };
1314
- has$1 = function (it) {
1315
- return has(it, STATE);
894
+ has = function (it) {
895
+ return hasOwn$3(it, STATE);
1316
896
  };
1317
897
  }
1318
898
 
1319
899
  var internalState = {
1320
900
  set: set,
1321
901
  get: get,
1322
- has: has$1,
902
+ has: has,
1323
903
  enforce: enforce,
1324
904
  getterFor: getterFor
1325
905
  };
1326
906
 
1327
- var redefine = createCommonjsModule(function (module) {
1328
- var getInternalState = internalState.get;
1329
- var enforceInternalState = internalState.enforce;
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$2;
913
+ var InternalStateModule = internalState;
914
+
915
+ var enforceInternalState = InternalStateModule.enforce;
916
+ var getInternalState = InternalStateModule.get;
917
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
918
+ var defineProperty$1 = Object.defineProperty;
919
+
920
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
921
+ return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
922
+ });
923
+
1330
924
  var TEMPLATE = String(String).split('String');
1331
925
 
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
- }
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') + ']';
1345
929
  }
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;
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;
1354
935
  }
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;
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;
1367
949
  };
1368
950
 
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];
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;
1372
983
  };
1373
984
 
985
+ var objectGetOwnPropertyNames = {};
986
+
1374
987
  var ceil = Math.ceil;
1375
988
  var floor = Math.floor;
1376
989
 
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);
990
+ // `Math.trunc` method
991
+ // https://tc39.es/ecma262/#sec-math.trunc
992
+ // eslint-disable-next-line es/no-math-trunc -- safe
993
+ var mathTrunc = Math.trunc || function trunc(x) {
994
+ var n = +x;
995
+ return (n > 0 ? floor : ceil)(n);
1381
996
  };
1382
997
 
1383
- var min = Math.min;
998
+ var trunc = mathTrunc;
1384
999
 
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
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);
1389
1006
  };
1390
1007
 
1008
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1009
+
1391
1010
  var max = Math.max;
1392
1011
  var min$1 = Math.min;
1393
1012
 
1394
1013
  // Helper for a popular repeating case of the spec:
1395
1014
  // Let integer be ? ToInteger(index).
1396
1015
  // 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);
1016
+ var toAbsoluteIndex$1 = function (index, length) {
1017
+ var integer = toIntegerOrInfinity$1(index);
1399
1018
  return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1400
1019
  };
1401
1020
 
1021
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
1022
+
1023
+ var min = Math.min;
1024
+
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
1029
+ };
1030
+
1031
+ var toLength = toLength$1;
1032
+
1033
+ // `LengthOfArrayLike` abstract operation
1034
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
1035
+ var lengthOfArrayLike$2 = function (obj) {
1036
+ return toLength(obj.length);
1037
+ };
1038
+
1039
+ var toIndexedObject$2 = toIndexedObject$4;
1040
+ var toAbsoluteIndex = toAbsoluteIndex$1;
1041
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
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
1111
  // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1463
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1464
- return objectKeysInternal(O, hiddenKeys$1);
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
1118
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1472
- var f$4 = Object.getOwnPropertySymbols;
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$2;
1246
+
1598
1247
  // `IsArray` abstract operation
1599
1248
  // https://tc39.es/ecma262/#sec-isarray
1600
1249
  // eslint-disable-next-line es/no-array-isarray -- safe
1601
- var isArray = Array.isArray || function isArray(arg) {
1602
- return classofRaw(arg) == 'Array';
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$2;
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$2;
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;
1673
1367
  };
1674
1368
 
1675
- var push = [].push;
1369
+ var arraySpeciesConstructor = arraySpeciesConstructor$1;
1676
1370
 
1677
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
1678
- var createMethod$1 = function (TYPE) {
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);
1375
+ };
1376
+
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;
1383
+
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,51 +1424,76 @@ 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)
1740
1449
  };
1741
1450
 
1451
+ var objectDefineProperties = {};
1452
+
1453
+ var internalObjectKeys = objectKeysInternal;
1454
+ var enumBugKeys$1 = enumBugKeys$3;
1455
+
1742
1456
  // `Object.keys` method
1743
1457
  // https://tc39.es/ecma262/#sec-object.keys
1744
1458
  // eslint-disable-next-line es/no-object-keys -- safe
1745
- var objectKeys = Object.keys || function keys(O) {
1746
- return objectKeysInternal(O, enumBugKeys);
1459
+ var objectKeys$1 = Object.keys || function keys(O) {
1460
+ return internalObjectKeys(O, enumBugKeys$1);
1747
1461
  };
1748
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
+
1749
1470
  // `Object.defineProperties` method
1750
1471
  // https://tc39.es/ecma262/#sec-object.defineproperties
1751
1472
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1752
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
1753
- anObject(O);
1473
+ objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1474
+ anObject$1(O);
1475
+ var props = toIndexedObject(Properties);
1754
1476
  var keys = objectKeys(Properties);
1755
1477
  var length = keys.length;
1756
1478
  var index = 0;
1757
1479
  var key;
1758
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
1480
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1759
1481
  return O;
1760
1482
  };
1761
1483
 
1762
- var html = getBuiltIn('document', 'documentElement');
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;
1763
1497
 
1764
1498
  var GT = '>';
1765
1499
  var LT = '<';
@@ -1807,10 +1541,13 @@ var NullProtoObjectViaIFrame = function () {
1807
1541
  var activeXDocument;
1808
1542
  var NullProtoObject = function () {
1809
1543
  try {
1810
- /* global ActiveXObject -- old IE */
1811
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
1544
+ activeXDocument = new ActiveXObject('htmlfile');
1812
1545
  } catch (error) { /* ignore */ }
1813
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
1546
+ NullProtoObject = typeof document != 'undefined'
1547
+ ? document.domain && activeXDocument
1548
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1549
+ : NullProtoObjectViaIFrame()
1550
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1814
1551
  var length = enumBugKeys.length;
1815
1552
  while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1816
1553
  return NullProtoObject();
@@ -1820,6 +1557,7 @@ hiddenKeys[IE_PROTO] = true;
1820
1557
 
1821
1558
  // `Object.create` method
1822
1559
  // https://tc39.es/ecma262/#sec-object.create
1560
+ // eslint-disable-next-line es/no-object-create -- safe
1823
1561
  var objectCreate = Object.create || function create(O, Properties) {
1824
1562
  var result;
1825
1563
  if (O !== null) {
@@ -1829,116 +1567,901 @@ var objectCreate = Object.create || function create(O, Properties) {
1829
1567
  // add "__proto__" for Object.getPrototypeOf polyfill
1830
1568
  result[IE_PROTO] = O;
1831
1569
  } else result = NullProtoObject();
1832
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
1570
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1833
1571
  };
1834
1572
 
1573
+ var wellKnownSymbol = wellKnownSymbol$5;
1574
+ var create = objectCreate;
1575
+ var defineProperty = objectDefineProperty.f;
1576
+
1835
1577
  var UNSCOPABLES = wellKnownSymbol('unscopables');
1836
1578
  var ArrayPrototype = Array.prototype;
1837
1579
 
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)
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
+ var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
1627
+ // Compatible with IE
1628
+ // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
1629
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
1630
+ var event;
1631
+ if (typeof window.CustomEvent === 'function') {
1632
+ event = new window.CustomEvent(eventName, {
1633
+ detail: opts
1634
+ });
1635
+ } else {
1636
+ event = document.createEvent('Event');
1637
+ event.initEvent(eventName, false, true, opts);
1638
+ }
1639
+ window.dispatchEvent(event);
1640
+ };
1641
+ function staticMethods (target) {
1642
+ /**
1643
+ * Hide all tooltip
1644
+ * @trigger ReactTooltip.hide()
1645
+ */
1646
+ target.hide = function (target) {
1647
+ dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
1648
+ target: target
1649
+ });
1650
+ };
1651
+
1652
+ /**
1653
+ * Rebuild all tooltip
1654
+ * @trigger ReactTooltip.rebuild()
1655
+ */
1656
+ target.rebuild = function () {
1657
+ dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
1658
+ };
1659
+
1660
+ /**
1661
+ * Show specific tooltip
1662
+ * @trigger ReactTooltip.show()
1663
+ */
1664
+ target.show = function (target) {
1665
+ dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
1666
+ target: target
1667
+ });
1668
+ };
1669
+ target.prototype.globalRebuild = function () {
1670
+ if (this.mount) {
1671
+ this.unbindListener();
1672
+ this.bindListener();
1673
+ }
1674
+ };
1675
+ target.prototype.globalShow = function (event) {
1676
+ if (this.mount) {
1677
+ var hasTarget = event && event.detail && event.detail.target && true || false;
1678
+ // Create a fake event, specific show will limit the type to `solid`
1679
+ // only `float` type cares e.clientX e.clientY
1680
+ this.showTooltip({
1681
+ currentTarget: hasTarget && event.detail.target
1682
+ }, true);
1683
+ }
1684
+ };
1685
+ target.prototype.globalHide = function (event) {
1686
+ if (this.mount) {
1687
+ var hasTarget = event && event.detail && event.detail.target && true || false;
1688
+ this.hideTooltip({
1689
+ currentTarget: hasTarget && event.detail.target
1690
+ }, hasTarget);
1691
+ }
1692
+ };
1693
+ }
1694
+
1695
+ /**
1696
+ * Events that should be bound to the window
1697
+ */
1698
+ function windowListener (target) {
1699
+ target.prototype.bindWindowEvents = function (resizeHide) {
1700
+ // ReactTooltip.hide
1701
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1702
+ window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false);
1703
+
1704
+ // ReactTooltip.rebuild
1705
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1706
+ window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false);
1707
+
1708
+ // ReactTooltip.show
1709
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1710
+ window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false);
1711
+
1712
+ // Resize
1713
+ if (resizeHide) {
1714
+ window.removeEventListener('resize', this.onWindowResize);
1715
+ window.addEventListener('resize', this.onWindowResize, false);
1716
+ }
1717
+ };
1718
+ target.prototype.unbindWindowEvents = function () {
1719
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1720
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1721
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1722
+ window.removeEventListener('resize', this.onWindowResize);
1723
+ };
1724
+
1725
+ /**
1726
+ * invoked by resize event of window
1727
+ */
1728
+ target.prototype.onWindowResize = function () {
1729
+ if (!this.mount) return;
1730
+ this.hideTooltip();
1731
+ };
1732
+ }
1733
+
1734
+ /**
1735
+ * Custom events to control showing and hiding of tooltip
1736
+ *
1737
+ * @attributes
1738
+ * - `event` {String}
1739
+ * - `eventOff` {String}
1740
+ */
1741
+
1742
+ var checkStatus = function checkStatus(dataEventOff, e) {
1743
+ var show = this.state.show;
1744
+ var id = this.props.id;
1745
+ var isCapture = this.isCapture(e.currentTarget);
1746
+ var currentItem = e.currentTarget.getAttribute('currentItem');
1747
+ if (!isCapture) e.stopPropagation();
1748
+ if (show && currentItem === 'true') {
1749
+ if (!dataEventOff) this.hideTooltip(e);
1750
+ } else {
1751
+ e.currentTarget.setAttribute('currentItem', 'true');
1752
+ setUntargetItems(e.currentTarget, this.getTargetArray(id));
1753
+ this.showTooltip(e);
1754
+ }
1755
+ };
1756
+ var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
1757
+ for (var i = 0; i < targetArray.length; i++) {
1758
+ if (currentTarget !== targetArray[i]) {
1759
+ targetArray[i].setAttribute('currentItem', 'false');
1760
+ } else {
1761
+ targetArray[i].setAttribute('currentItem', 'true');
1762
+ }
1763
+ }
1764
+ };
1765
+ var customListeners = {
1766
+ id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
1767
+ set: function set(target, event, listener) {
1768
+ if (this.id in target) {
1769
+ var map = target[this.id];
1770
+ map[event] = listener;
1771
+ } else {
1772
+ // this is workaround for WeakMap, which is not supported in older browsers, such as IE
1773
+ Object.defineProperty(target, this.id, {
1774
+ configurable: true,
1775
+ value: _defineProperty({}, event, listener)
1776
+ });
1777
+ }
1778
+ },
1779
+ get: function get(target, event) {
1780
+ var map = target[this.id];
1781
+ if (map !== undefined) {
1782
+ return map[event];
1783
+ }
1784
+ }
1785
+ };
1786
+ function customEvent (target) {
1787
+ target.prototype.isCustomEvent = function (ele) {
1788
+ var event = this.state.event;
1789
+ return event || !!ele.getAttribute('data-event');
1790
+ };
1791
+
1792
+ /* Bind listener for custom event */
1793
+ target.prototype.customBindListener = function (ele) {
1794
+ var _this = this;
1795
+ var _this$state = this.state,
1796
+ event = _this$state.event,
1797
+ eventOff = _this$state.eventOff;
1798
+ var dataEvent = ele.getAttribute('data-event') || event;
1799
+ var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
1800
+ dataEvent.split(' ').forEach(function (event) {
1801
+ ele.removeEventListener(event, customListeners.get(ele, event));
1802
+ var customListener = checkStatus.bind(_this, dataEventOff);
1803
+ customListeners.set(ele, event, customListener);
1804
+ ele.addEventListener(event, customListener, false);
1805
+ });
1806
+ if (dataEventOff) {
1807
+ dataEventOff.split(' ').forEach(function (event) {
1808
+ ele.removeEventListener(event, _this.hideTooltip);
1809
+ ele.addEventListener(event, _this.hideTooltip, false);
1810
+ });
1811
+ }
1812
+ };
1813
+
1814
+ /* Unbind listener for custom event */
1815
+ target.prototype.customUnbindListener = function (ele) {
1816
+ var _this$state2 = this.state,
1817
+ event = _this$state2.event,
1818
+ eventOff = _this$state2.eventOff;
1819
+ var dataEvent = event || ele.getAttribute('data-event');
1820
+ var dataEventOff = eventOff || ele.getAttribute('data-event-off');
1821
+ ele.removeEventListener(dataEvent, customListeners.get(ele, event));
1822
+ if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
1823
+ };
1824
+ }
1825
+
1826
+ /**
1827
+ * Util method to judge if it should follow capture model
1828
+ */
1829
+
1830
+ function isCapture (target) {
1831
+ target.prototype.isCapture = function (currentTarget) {
1832
+ return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
1833
+ };
1834
+ }
1835
+
1836
+ /**
1837
+ * Util method to get effect
1838
+ */
1839
+
1840
+ function getEffect (target) {
1841
+ target.prototype.getEffect = function (currentTarget) {
1842
+ var dataEffect = currentTarget.getAttribute('data-effect');
1843
+ return dataEffect || this.props.effect || 'float';
1844
+ };
1845
+ }
1846
+
1847
+ /**
1848
+ * Util method to get effect
1849
+ */
1850
+ var makeProxy = function makeProxy(e) {
1851
+ var proxy = {};
1852
+ for (var key in e) {
1853
+ if (typeof e[key] === 'function') {
1854
+ proxy[key] = e[key].bind(e);
1855
+ } else {
1856
+ proxy[key] = e[key];
1857
+ }
1858
+ }
1859
+ return proxy;
1860
+ };
1861
+ var bodyListener = function bodyListener(callback, options, e) {
1862
+ var _options$respectEffec = options.respectEffect,
1863
+ respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
1864
+ _options$customEvent = options.customEvent,
1865
+ customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
1866
+ var id = this.props.id;
1867
+ var tip = null;
1868
+ var forId;
1869
+ var target = e.target;
1870
+ var lastTarget;
1871
+ // walk up parent chain until tip is found
1872
+ // there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
1873
+ while (tip === null && target !== null) {
1874
+ lastTarget = target;
1875
+ tip = target.getAttribute('data-tip') || null;
1876
+ forId = target.getAttribute('data-for') || null;
1877
+ target = target.parentElement;
1878
+ }
1879
+ target = lastTarget || e.target;
1880
+ if (this.isCustomEvent(target) && !customEvent) {
1881
+ return;
1882
+ }
1883
+ var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
1884
+ if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
1885
+ var proxy = makeProxy(e);
1886
+ proxy.currentTarget = target;
1887
+ callback(proxy);
1888
+ }
1889
+ };
1890
+ var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
1891
+ var events = {};
1892
+ targetArray.forEach(function (target) {
1893
+ var event = target.getAttribute(dataAttribute);
1894
+ if (event) event.split(' ').forEach(function (event) {
1895
+ return events[event] = true;
1896
+ });
1897
+ });
1898
+ return events;
1899
+ };
1900
+ var getBody = function getBody() {
1901
+ return document.getElementsByTagName('body')[0];
1902
+ };
1903
+ function bodyMode (target) {
1904
+ target.prototype.isBodyMode = function () {
1905
+ return !!this.props.bodyMode;
1906
+ };
1907
+ target.prototype.bindBodyListener = function (targetArray) {
1908
+ var _this = this;
1909
+ var _this$state = this.state,
1910
+ event = _this$state.event,
1911
+ eventOff = _this$state.eventOff,
1912
+ possibleCustomEvents = _this$state.possibleCustomEvents,
1913
+ possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
1914
+ var body = getBody();
1915
+ var customEvents = findCustomEvents(targetArray, 'data-event');
1916
+ var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
1917
+ if (event != null) customEvents[event] = true;
1918
+ if (eventOff != null) customEventsOff[eventOff] = true;
1919
+ possibleCustomEvents.split(' ').forEach(function (event) {
1920
+ return customEvents[event] = true;
1921
+ });
1922
+ possibleCustomEventsOff.split(' ').forEach(function (event) {
1923
+ return customEventsOff[event] = true;
1924
+ });
1925
+ this.unbindBodyListener(body);
1926
+ var listeners = this.bodyModeListeners = {};
1927
+ if (event == null) {
1928
+ listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
1929
+ listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
1930
+ respectEffect: true
1931
+ });
1932
+ listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
1933
+ }
1934
+ for (var _event in customEvents) {
1935
+ listeners[_event] = bodyListener.bind(this, function (e) {
1936
+ var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
1937
+ checkStatus.call(_this, targetEventOff, e);
1938
+ }, {
1939
+ customEvent: true
1940
+ });
1941
+ }
1942
+ for (var _event2 in customEventsOff) {
1943
+ listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
1944
+ customEvent: true
1945
+ });
1946
+ }
1947
+ for (var _event3 in listeners) {
1948
+ body.addEventListener(_event3, listeners[_event3]);
1949
+ }
1950
+ };
1951
+ target.prototype.unbindBodyListener = function (body) {
1952
+ body = body || getBody();
1953
+ var listeners = this.bodyModeListeners;
1954
+ for (var event in listeners) {
1955
+ body.removeEventListener(event, listeners[event]);
1956
+ }
1957
+ };
1958
+ }
1959
+
1960
+ /**
1961
+ * Tracking target removing from DOM.
1962
+ * It's necessary to hide tooltip when it's target disappears.
1963
+ * Otherwise, the tooltip would be shown forever until another target
1964
+ * is triggered.
1965
+ *
1966
+ * If MutationObserver is not available, this feature just doesn't work.
1967
+ */
1968
+
1969
+ // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
1970
+ var getMutationObserverClass = function getMutationObserverClass() {
1971
+ return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
1972
+ };
1973
+ function trackRemoval (target) {
1974
+ target.prototype.bindRemovalTracker = function () {
1975
+ var _this = this;
1976
+ var MutationObserver = getMutationObserverClass();
1977
+ if (MutationObserver == null) return;
1978
+ var observer = new MutationObserver(function (mutations) {
1979
+ for (var m1 = 0; m1 < mutations.length; m1++) {
1980
+ var mutation = mutations[m1];
1981
+ for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
1982
+ var element = mutation.removedNodes[m2];
1983
+ if (element === _this.state.currentTarget) {
1984
+ _this.hideTooltip();
1985
+ return;
1986
+ }
1987
+ }
1988
+ }
1989
+ });
1990
+ observer.observe(window.document, {
1991
+ childList: true,
1992
+ subtree: true
1993
+ });
1994
+ this.removalTracker = observer;
1995
+ };
1996
+ target.prototype.unbindRemovalTracker = function () {
1997
+ if (this.removalTracker) {
1998
+ this.removalTracker.disconnect();
1999
+ this.removalTracker = null;
2000
+ }
2001
+ };
2002
+ }
2003
+
2004
+ /**
2005
+ * Calculate the position of tooltip
2006
+ *
2007
+ * @params
2008
+ * - `e` {Event} the event of current mouse
2009
+ * - `target` {Element} the currentTarget of the event
2010
+ * - `node` {DOM} the react-tooltip object
2011
+ * - `place` {String} top / right / bottom / left
2012
+ * - `effect` {String} float / solid
2013
+ * - `offset` {Object} the offset to default position
2014
+ *
2015
+ * @return {Object}
2016
+ * - `isNewState` {Bool} required
2017
+ * - `newState` {Object}
2018
+ * - `position` {Object} {left: {Number}, top: {Number}}
2019
+ */
2020
+ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
2021
+ var _getDimensions = getDimensions(node),
2022
+ tipWidth = _getDimensions.width,
2023
+ tipHeight = _getDimensions.height;
2024
+ var _getDimensions2 = getDimensions(target),
2025
+ targetWidth = _getDimensions2.width,
2026
+ targetHeight = _getDimensions2.height;
2027
+ var _getCurrentOffset = getCurrentOffset(e, target, effect),
2028
+ mouseX = _getCurrentOffset.mouseX,
2029
+ mouseY = _getCurrentOffset.mouseY;
2030
+ var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
2031
+ var _calculateOffset = calculateOffset(offset),
2032
+ extraOffsetX = _calculateOffset.extraOffsetX,
2033
+ extraOffsetY = _calculateOffset.extraOffsetY;
2034
+ var windowWidth = window.innerWidth;
2035
+ var windowHeight = window.innerHeight;
2036
+ var _getParent = getParent(node),
2037
+ parentTop = _getParent.parentTop,
2038
+ parentLeft = _getParent.parentLeft;
2039
+
2040
+ // Get the edge offset of the tooltip
2041
+ var getTipOffsetLeft = function getTipOffsetLeft(place) {
2042
+ var offsetX = defaultOffset[place].l;
2043
+ return mouseX + offsetX + extraOffsetX;
2044
+ };
2045
+ var getTipOffsetRight = function getTipOffsetRight(place) {
2046
+ var offsetX = defaultOffset[place].r;
2047
+ return mouseX + offsetX + extraOffsetX;
2048
+ };
2049
+ var getTipOffsetTop = function getTipOffsetTop(place) {
2050
+ var offsetY = defaultOffset[place].t;
2051
+ return mouseY + offsetY + extraOffsetY;
2052
+ };
2053
+ var getTipOffsetBottom = function getTipOffsetBottom(place) {
2054
+ var offsetY = defaultOffset[place].b;
2055
+ return mouseY + offsetY + extraOffsetY;
2056
+ };
2057
+
2058
+ //
2059
+ // Functions to test whether the tooltip's sides are inside
2060
+ // the client window for a given orientation p
2061
+ //
2062
+ // _____________
2063
+ // | | <-- Right side
2064
+ // | p = 'left' |\
2065
+ // | |/ |\
2066
+ // |_____________| |_\ <-- Mouse
2067
+ // / \ |
2068
+ // |
2069
+ // |
2070
+ // Bottom side
2071
+ //
2072
+ var outsideLeft = function outsideLeft(p) {
2073
+ return getTipOffsetLeft(p) < 0;
2074
+ };
2075
+ var outsideRight = function outsideRight(p) {
2076
+ return getTipOffsetRight(p) > windowWidth;
2077
+ };
2078
+ var outsideTop = function outsideTop(p) {
2079
+ return getTipOffsetTop(p) < 0;
2080
+ };
2081
+ var outsideBottom = function outsideBottom(p) {
2082
+ return getTipOffsetBottom(p) > windowHeight;
2083
+ };
2084
+
2085
+ // Check whether the tooltip with orientation p is completely inside the client window
2086
+ var outside = function outside(p) {
2087
+ return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
2088
+ };
2089
+ var inside = function inside(p) {
2090
+ return !outside(p);
2091
+ };
2092
+ var placeIsInside = {
2093
+ top: inside('top'),
2094
+ bottom: inside('bottom'),
2095
+ left: inside('left'),
2096
+ right: inside('right')
2097
+ };
2098
+ function choose() {
2099
+ var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
2100
+ var _iterator = _createForOfIteratorHelper(allPlaces),
2101
+ _step;
2102
+ try {
2103
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2104
+ var d = _step.value;
2105
+ if (placeIsInside[d]) return d;
2106
+ }
2107
+ // if nothing is inside, just use the old place.
2108
+ } catch (err) {
2109
+ _iterator.e(err);
2110
+ } finally {
2111
+ _iterator.f();
2112
+ }
2113
+ return place;
2114
+ }
2115
+ var chosen = choose();
2116
+ var isNewState = false;
2117
+ var newPlace;
2118
+ if (chosen && chosen !== place) {
2119
+ isNewState = true;
2120
+ newPlace = chosen;
2121
+ }
2122
+ if (isNewState) {
2123
+ return {
2124
+ isNewState: true,
2125
+ newState: {
2126
+ place: newPlace
2127
+ }
2128
+ };
2129
+ }
2130
+ return {
2131
+ isNewState: false,
2132
+ position: {
2133
+ left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
2134
+ top: parseInt(getTipOffsetTop(place) - parentTop, 10)
2135
+ }
2136
+ };
2137
+ }
2138
+ var getDimensions = function getDimensions(node) {
2139
+ var _node$getBoundingClie = node.getBoundingClientRect(),
2140
+ height = _node$getBoundingClie.height,
2141
+ width = _node$getBoundingClie.width;
2142
+ return {
2143
+ height: parseInt(height, 10),
2144
+ width: parseInt(width, 10)
2145
+ };
2146
+ };
2147
+
2148
+ // Get current mouse offset
2149
+ var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
2150
+ var boundingClientRect = currentTarget.getBoundingClientRect();
2151
+ var targetTop = boundingClientRect.top;
2152
+ var targetLeft = boundingClientRect.left;
2153
+ var _getDimensions3 = getDimensions(currentTarget),
2154
+ targetWidth = _getDimensions3.width,
2155
+ targetHeight = _getDimensions3.height;
2156
+ if (effect === 'float') {
2157
+ return {
2158
+ mouseX: e.clientX,
2159
+ mouseY: e.clientY
2160
+ };
2161
+ }
2162
+ return {
2163
+ mouseX: targetLeft + targetWidth / 2,
2164
+ mouseY: targetTop + targetHeight / 2
2165
+ };
2166
+ };
2167
+
2168
+ // List all possibility of tooltip final offset
2169
+ // This is useful in judging if it is necessary for tooltip to switch position when out of window
2170
+ var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
2171
+ var top;
2172
+ var right;
2173
+ var bottom;
2174
+ var left;
2175
+ var disToMouse = 3;
2176
+ var triangleHeight = 2;
2177
+ var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
2178
+
2179
+ if (effect === 'float') {
2180
+ top = {
2181
+ l: -(tipWidth / 2),
2182
+ r: tipWidth / 2,
2183
+ t: -(tipHeight + disToMouse + triangleHeight),
2184
+ b: -disToMouse
2185
+ };
2186
+ bottom = {
2187
+ l: -(tipWidth / 2),
2188
+ r: tipWidth / 2,
2189
+ t: disToMouse + cursorHeight,
2190
+ b: tipHeight + disToMouse + triangleHeight + cursorHeight
2191
+ };
2192
+ left = {
2193
+ l: -(tipWidth + disToMouse + triangleHeight),
2194
+ r: -disToMouse,
2195
+ t: -(tipHeight / 2),
2196
+ b: tipHeight / 2
2197
+ };
2198
+ right = {
2199
+ l: disToMouse,
2200
+ r: tipWidth + disToMouse + triangleHeight,
2201
+ t: -(tipHeight / 2),
2202
+ b: tipHeight / 2
2203
+ };
2204
+ } else if (effect === 'solid') {
2205
+ top = {
2206
+ l: -(tipWidth / 2),
2207
+ r: tipWidth / 2,
2208
+ t: -(targetHeight / 2 + tipHeight + triangleHeight),
2209
+ b: -(targetHeight / 2)
2210
+ };
2211
+ bottom = {
2212
+ l: -(tipWidth / 2),
2213
+ r: tipWidth / 2,
2214
+ t: targetHeight / 2,
2215
+ b: targetHeight / 2 + tipHeight + triangleHeight
2216
+ };
2217
+ left = {
2218
+ l: -(tipWidth + targetWidth / 2 + triangleHeight),
2219
+ r: -(targetWidth / 2),
2220
+ t: -(tipHeight / 2),
2221
+ b: tipHeight / 2
2222
+ };
2223
+ right = {
2224
+ l: targetWidth / 2,
2225
+ r: tipWidth + targetWidth / 2 + triangleHeight,
2226
+ t: -(tipHeight / 2),
2227
+ b: tipHeight / 2
2228
+ };
2229
+ }
2230
+ return {
2231
+ top: top,
2232
+ bottom: bottom,
2233
+ left: left,
2234
+ right: right
2235
+ };
2236
+ };
2237
+
2238
+ // Consider additional offset into position calculation
2239
+ var calculateOffset = function calculateOffset(offset) {
2240
+ var extraOffsetX = 0;
2241
+ var extraOffsetY = 0;
2242
+ if (Object.prototype.toString.apply(offset) === '[object String]') {
2243
+ offset = JSON.parse(offset.toString().replace(/'/g, '"'));
2244
+ }
2245
+ for (var key in offset) {
2246
+ if (key === 'top') {
2247
+ extraOffsetY -= parseInt(offset[key], 10);
2248
+ } else if (key === 'bottom') {
2249
+ extraOffsetY += parseInt(offset[key], 10);
2250
+ } else if (key === 'left') {
2251
+ extraOffsetX -= parseInt(offset[key], 10);
2252
+ } else if (key === 'right') {
2253
+ extraOffsetX += parseInt(offset[key], 10);
2254
+ }
2255
+ }
2256
+ return {
2257
+ extraOffsetX: extraOffsetX,
2258
+ extraOffsetY: extraOffsetY
2259
+ };
2260
+ };
2261
+
2262
+ // Get the offset of the parent elements
2263
+ var getParent = function getParent(currentTarget) {
2264
+ var currentParent = currentTarget;
2265
+ while (currentParent) {
2266
+ var computedStyle = window.getComputedStyle(currentParent);
2267
+ // transform and will-change: transform change the containing block
2268
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
2269
+ if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
2270
+ currentParent = currentParent.parentElement;
2271
+ }
2272
+ var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
2273
+ var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
2274
+ return {
2275
+ parentTop: parentTop,
2276
+ parentLeft: parentLeft
2277
+ };
2278
+ };
2279
+
2280
+ /**
2281
+ * To get the tooltip content
2282
+ * it may comes from data-tip or this.props.children
2283
+ * it should support multiline
2284
+ *
2285
+ * @params
2286
+ * - `tip` {String} value of data-tip
2287
+ * - `children` {ReactElement} this.props.children
2288
+ * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
2289
+ *
2290
+ * @return
2291
+ * - String or react component
2292
+ */
2293
+ function TipContent(tip, children, getContent, multiline) {
2294
+ if (children) return children;
2295
+ if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
2296
+ if (getContent === null) return null; // Tip not exist and children is null or undefined
2297
+
2298
+ var regexp = /<br\s*\/?>/;
2299
+ if (!multiline || multiline === 'false' || !regexp.test(tip)) {
2300
+ // No trim(), so that user can keep their input
2301
+ return tip;
2302
+ }
2303
+
2304
+ // Multiline tooltip content
2305
+ return tip.split(regexp).map(function (d, i) {
2306
+ return /*#__PURE__*/React__default["default"].createElement("span", {
2307
+ key: i,
2308
+ className: "multi-line"
2309
+ }, d);
2310
+ });
2311
+ }
2312
+
2313
+ /**
2314
+ * Support aria- and role in ReactTooltip
2315
+ *
2316
+ * @params props {Object}
2317
+ * @return {Object}
2318
+ */
2319
+ function parseAria(props) {
2320
+ var ariaObj = {};
2321
+ Object.keys(props).filter(function (prop) {
2322
+ // aria-xxx and role is acceptable
2323
+ return /(^aria-\w+$|^role$)/.test(prop);
2324
+ }).forEach(function (prop) {
2325
+ ariaObj[prop] = props[prop];
2326
+ });
2327
+ return ariaObj;
2328
+ }
2329
+
2330
+ /**
2331
+ * Convert nodelist to array
2332
+ * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
2333
+ * NodeLists are functions in Safari
2334
+ */
2335
+
2336
+ function nodeListToArray (nodeList) {
2337
+ var length = nodeList.length;
2338
+ if (nodeList.hasOwnProperty) {
2339
+ return Array.prototype.slice.call(nodeList);
2340
+ }
2341
+ return new Array(length).fill().map(function (index) {
2342
+ return nodeList[index];
1844
2343
  });
1845
2344
  }
1846
2345
 
1847
- // add a key to Array.prototype[@@unscopables]
1848
- var addToUnscopables = function (key) {
1849
- ArrayPrototype[UNSCOPABLES][key] = true;
1850
- };
1851
-
1852
- var $find = arrayIteration.find;
2346
+ function generateUUID() {
2347
+ return 't' + uuid.v4();
2348
+ }
1853
2349
 
2350
+ 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}";
1854
2351
 
1855
- var FIND = 'find';
1856
- var SKIPS_HOLES = true;
2352
+ /**
2353
+ * Default pop-up style values (text color, background color).
2354
+ */
2355
+ var defaultColors = {
2356
+ dark: {
2357
+ text: '#fff',
2358
+ background: '#222',
2359
+ border: 'transparent',
2360
+ arrow: '#222'
2361
+ },
2362
+ success: {
2363
+ text: '#fff',
2364
+ background: '#8DC572',
2365
+ border: 'transparent',
2366
+ arrow: '#8DC572'
2367
+ },
2368
+ warning: {
2369
+ text: '#fff',
2370
+ background: '#F0AD4E',
2371
+ border: 'transparent',
2372
+ arrow: '#F0AD4E'
2373
+ },
2374
+ error: {
2375
+ text: '#fff',
2376
+ background: '#BE6464',
2377
+ border: 'transparent',
2378
+ arrow: '#BE6464'
2379
+ },
2380
+ info: {
2381
+ text: '#fff',
2382
+ background: '#337AB7',
2383
+ border: 'transparent',
2384
+ arrow: '#337AB7'
2385
+ },
2386
+ light: {
2387
+ text: '#222',
2388
+ background: '#fff',
2389
+ border: 'transparent',
2390
+ arrow: '#fff'
2391
+ }
2392
+ };
2393
+ function getDefaultPopupColors(type) {
2394
+ return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
2395
+ }
2396
+ var DEFAULT_PADDING = '8px 21px';
1857
2397
 
1858
- // Shouldn't skip holes
1859
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
2398
+ /**
2399
+ * Generates the specific tooltip style for use on render.
2400
+ */
2401
+ function generateTooltipStyle(uuid, customColors, type, hasBorder, padding) {
2402
+ return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding);
2403
+ }
1860
2404
 
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);
2405
+ /**
2406
+ * Generates the tooltip style rules based on the element-specified "data-type" property.
2407
+ */
2408
+ function generateStyle(uuid, colors) {
2409
+ var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
2410
+ var textColor = colors.text;
2411
+ var backgroundColor = colors.background;
2412
+ var borderColor = colors.border;
2413
+ var arrowColor = colors.arrow;
2414
+ 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 ");
2415
+ }
2416
+ function getPopupColors(customColors, type, hasBorder) {
2417
+ var textColor = customColors.text;
2418
+ var backgroundColor = customColors.background;
2419
+ var borderColor = customColors.border;
2420
+ var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
2421
+ var colors = getDefaultPopupColors(type);
2422
+ if (textColor) {
2423
+ colors.text = textColor;
1866
2424
  }
1867
- });
1868
-
1869
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1870
- addToUnscopables(FIND);
2425
+ if (backgroundColor) {
2426
+ colors.background = backgroundColor;
2427
+ }
2428
+ if (hasBorder) {
2429
+ if (borderColor) {
2430
+ colors.border = borderColor;
2431
+ } else {
2432
+ colors.border = type === 'light' ? 'black' : 'white';
2433
+ }
2434
+ }
2435
+ if (arrowColor) {
2436
+ colors.arrow = arrowColor;
2437
+ }
2438
+ return colors;
2439
+ }
1871
2440
 
1872
- var _class, _class2, _temp;
2441
+ var _class, _class2;
1873
2442
 
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) {
2443
+ /* Polyfill */
2444
+ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
1877
2445
  _inherits(ReactTooltip, _React$Component);
1878
-
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
- }]);
1922
-
2446
+ var _super = _createSuper(ReactTooltip);
1923
2447
  function ReactTooltip(props) {
1924
2448
  var _this;
1925
-
1926
2449
  _classCallCheck(this, ReactTooltip);
1927
-
1928
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));
2450
+ _this = _super.call(this, props);
1929
2451
  _this.state = {
1930
2452
  uuid: props.uuid || generateUUID(),
1931
2453
  place: props.place || 'top',
1932
2454
  // Direction of tooltip
1933
2455
  desiredPlace: props.place || 'top',
1934
- type: 'dark',
2456
+ type: props.type || 'dark',
1935
2457
  // Color theme of tooltip
1936
- effect: 'float',
2458
+ effect: props.effect || 'float',
1937
2459
  // float or fixed
1938
2460
  show: false,
1939
2461
  border: false,
1940
2462
  customColors: {},
1941
2463
  offset: {},
2464
+ padding: props.padding,
1942
2465
  extraClass: '',
1943
2466
  html: false,
1944
2467
  delayHide: 0,
@@ -1958,9 +2481,7 @@ function (_React$Component) {
1958
2481
  originTooltip: null,
1959
2482
  isMultiline: false
1960
2483
  };
1961
-
1962
2484
  _this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'hideTooltipOnScroll', 'getTooltipContent', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize', 'mouseOnToolTip']);
1963
-
1964
2485
  _this.mount = true;
1965
2486
  _this.delayShowLoop = null;
1966
2487
  _this.delayHideLoop = null;
@@ -1968,16 +2489,14 @@ function (_React$Component) {
1968
2489
  _this.intervalUpdateContent = null;
1969
2490
  return _this;
1970
2491
  }
2492
+
1971
2493
  /**
1972
2494
  * For unify the bind and unbind listener
1973
2495
  */
1974
-
1975
-
1976
2496
  _createClass(ReactTooltip, [{
1977
2497
  key: "bind",
1978
2498
  value: function bind(methodArray) {
1979
2499
  var _this2 = this;
1980
-
1981
2500
  methodArray.forEach(function (method) {
1982
2501
  _this2[method] = _this2[method].bind(_this2);
1983
2502
  });
@@ -1985,13 +2504,12 @@ function (_React$Component) {
1985
2504
  }, {
1986
2505
  key: "componentDidMount",
1987
2506
  value: function componentDidMount() {
1988
- var _this$props = this.props,
1989
- insecure = _this$props.insecure,
1990
- resizeHide = _this$props.resizeHide;
2507
+ var _this$props = this.props;
2508
+ _this$props.insecure;
2509
+ var resizeHide = _this$props.resizeHide;
2510
+ this.mount = true;
1991
2511
  this.bindListener(); // Bind listener for tooltip
1992
-
1993
2512
  this.bindWindowEvents(resizeHide); // Bind global event for static method
1994
-
1995
2513
  this.injectStyles(); // Inject styles for each DOM root having tooltip.
1996
2514
  }
1997
2515
  }, {
@@ -2003,39 +2521,33 @@ function (_React$Component) {
2003
2521
  this.removeScrollListener(this.state.currentTarget);
2004
2522
  this.unbindWindowEvents();
2005
2523
  }
2006
- /* Look for the closest DOM root having tooltip and inject styles. */
2007
2524
 
2525
+ /* Look for the closest DOM root having tooltip and inject styles. */
2008
2526
  }, {
2009
2527
  key: "injectStyles",
2010
2528
  value: function injectStyles() {
2011
2529
  var tooltipRef = this.tooltipRef;
2012
-
2013
2530
  if (!tooltipRef) {
2014
2531
  return;
2015
2532
  }
2016
-
2017
2533
  var parentNode = tooltipRef.parentNode;
2018
-
2019
2534
  while (parentNode.parentNode) {
2020
2535
  parentNode = parentNode.parentNode;
2021
2536
  }
2022
-
2023
2537
  var domRoot;
2024
-
2025
2538
  switch (parentNode.constructor.name) {
2026
2539
  case 'Document':
2027
2540
  case 'HTMLDocument':
2028
2541
  case undefined:
2029
2542
  domRoot = parentNode.head;
2030
2543
  break;
2031
-
2032
2544
  case 'ShadowRoot':
2033
2545
  default:
2034
2546
  domRoot = parentNode;
2035
2547
  break;
2036
- } // Prevent styles duplication.
2037
-
2548
+ }
2038
2549
 
2550
+ // Prevent styles duplication.
2039
2551
  if (!domRoot.querySelector('style[data-react-tooltip]')) {
2040
2552
  var style = document.createElement('style');
2041
2553
  style.textContent = baseCss;
@@ -2043,16 +2555,15 @@ function (_React$Component) {
2043
2555
  domRoot.appendChild(style);
2044
2556
  }
2045
2557
  }
2558
+
2046
2559
  /**
2047
2560
  * Return if the mouse is on the tooltip.
2048
2561
  * @returns {boolean} true - mouse is on the tooltip
2049
2562
  */
2050
-
2051
2563
  }, {
2052
2564
  key: "mouseOnToolTip",
2053
2565
  value: function mouseOnToolTip() {
2054
2566
  var show = this.state.show;
2055
-
2056
2567
  if (show && this.tooltipRef) {
2057
2568
  /* old IE or Firefox work around */
2058
2569
  if (!this.tooltipRef.matches) {
@@ -2064,30 +2575,27 @@ function (_React$Component) {
2064
2575
  this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;
2065
2576
  }
2066
2577
  }
2067
-
2068
2578
  return this.tooltipRef.matches(':hover');
2069
2579
  }
2070
-
2071
2580
  return false;
2072
2581
  }
2582
+
2073
2583
  /**
2074
2584
  * Pick out corresponded target elements
2075
2585
  */
2076
-
2077
2586
  }, {
2078
2587
  key: "getTargetArray",
2079
2588
  value: function getTargetArray(id) {
2080
2589
  var targetArray = [];
2081
2590
  var selector;
2082
-
2083
2591
  if (!id) {
2084
2592
  selector = '[data-tip]:not([data-for])';
2085
2593
  } else {
2086
2594
  var escaped = id.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
2087
2595
  selector = "[data-tip][data-for=\"".concat(escaped, "\"]");
2088
- } // Scan document for shadow DOM elements
2089
-
2596
+ }
2090
2597
 
2598
+ // Scan document for shadow DOM elements
2091
2599
  nodeListToArray(document.getElementsByTagName('*')).filter(function (element) {
2092
2600
  return element.shadowRoot;
2093
2601
  }).forEach(function (element) {
@@ -2095,101 +2603,87 @@ function (_React$Component) {
2095
2603
  });
2096
2604
  return targetArray.concat(nodeListToArray(document.querySelectorAll(selector)));
2097
2605
  }
2606
+
2098
2607
  /**
2099
2608
  * Bind listener to the target elements
2100
2609
  * These listeners used to trigger showing or hiding the tooltip
2101
2610
  */
2102
-
2103
2611
  }, {
2104
2612
  key: "bindListener",
2105
2613
  value: function bindListener() {
2106
2614
  var _this3 = this;
2107
-
2108
2615
  var _this$props2 = this.props,
2109
- id = _this$props2.id,
2110
- globalEventOff = _this$props2.globalEventOff,
2111
- isCapture = _this$props2.isCapture;
2616
+ id = _this$props2.id,
2617
+ globalEventOff = _this$props2.globalEventOff,
2618
+ isCapture = _this$props2.isCapture;
2112
2619
  var targetArray = this.getTargetArray(id);
2113
2620
  targetArray.forEach(function (target) {
2114
2621
  if (target.getAttribute('currentItem') === null) {
2115
2622
  target.setAttribute('currentItem', 'false');
2116
2623
  }
2117
-
2118
2624
  _this3.unbindBasicListener(target);
2119
-
2120
2625
  if (_this3.isCustomEvent(target)) {
2121
2626
  _this3.customUnbindListener(target);
2122
2627
  }
2123
2628
  });
2124
-
2125
2629
  if (this.isBodyMode()) {
2126
2630
  this.bindBodyListener(targetArray);
2127
2631
  } else {
2128
2632
  targetArray.forEach(function (target) {
2129
2633
  var isCaptureMode = _this3.isCapture(target);
2130
-
2131
2634
  var effect = _this3.getEffect(target);
2132
-
2133
2635
  if (_this3.isCustomEvent(target)) {
2134
2636
  _this3.customBindListener(target);
2135
-
2136
2637
  return;
2137
2638
  }
2138
-
2139
2639
  target.addEventListener('mouseenter', _this3.showTooltip, isCaptureMode);
2140
2640
  target.addEventListener('focus', _this3.showTooltip, isCaptureMode);
2141
-
2142
2641
  if (effect === 'float') {
2143
2642
  target.addEventListener('mousemove', _this3.updateTooltip, isCaptureMode);
2144
2643
  }
2145
-
2146
2644
  target.addEventListener('mouseleave', _this3.hideTooltip, isCaptureMode);
2147
2645
  target.addEventListener('blur', _this3.hideTooltip, isCaptureMode);
2148
2646
  });
2149
- } // Global event to hide tooltip
2150
-
2647
+ }
2151
2648
 
2649
+ // Global event to hide tooltip
2152
2650
  if (globalEventOff) {
2153
2651
  window.removeEventListener(globalEventOff, this.hideTooltip);
2154
2652
  window.addEventListener(globalEventOff, this.hideTooltip, isCapture);
2155
- } // Track removal of targetArray elements from DOM
2156
-
2653
+ }
2157
2654
 
2655
+ // Track removal of targetArray elements from DOM
2158
2656
  this.bindRemovalTracker();
2159
2657
  }
2658
+
2160
2659
  /**
2161
2660
  * Unbind listeners on target elements
2162
2661
  */
2163
-
2164
2662
  }, {
2165
2663
  key: "unbindListener",
2166
2664
  value: function unbindListener() {
2167
2665
  var _this4 = this;
2168
-
2169
2666
  var _this$props3 = this.props,
2170
- id = _this$props3.id,
2171
- globalEventOff = _this$props3.globalEventOff;
2172
-
2667
+ id = _this$props3.id,
2668
+ globalEventOff = _this$props3.globalEventOff;
2173
2669
  if (this.isBodyMode()) {
2174
2670
  this.unbindBodyListener();
2175
2671
  } else {
2176
2672
  var targetArray = this.getTargetArray(id);
2177
2673
  targetArray.forEach(function (target) {
2178
2674
  _this4.unbindBasicListener(target);
2179
-
2180
2675
  if (_this4.isCustomEvent(target)) _this4.customUnbindListener(target);
2181
2676
  });
2182
2677
  }
2183
-
2184
2678
  if (globalEventOff) window.removeEventListener(globalEventOff, this.hideTooltip);
2185
2679
  this.unbindRemovalTracker();
2186
2680
  }
2681
+
2187
2682
  /**
2188
2683
  * Invoke this before bind listener and unmount the component
2189
2684
  * it is necessary to invoke this even when binding custom event
2190
2685
  * so that the tooltip can switch between custom and default listener
2191
2686
  */
2192
-
2193
2687
  }, {
2194
2688
  key: "unbindBasicListener",
2195
2689
  value: function unbindBasicListener(target) {
@@ -2202,11 +2696,11 @@ function (_React$Component) {
2202
2696
  key: "getTooltipContent",
2203
2697
  value: function getTooltipContent() {
2204
2698
  var _this$props4 = this.props,
2205
- getContent = _this$props4.getContent,
2206
- children = _this$props4.children; // Generate tooltip content
2699
+ getContent = _this$props4.getContent,
2700
+ children = _this$props4.children;
2207
2701
 
2702
+ // Generate tooltip content
2208
2703
  var content;
2209
-
2210
2704
  if (getContent) {
2211
2705
  if (Array.isArray(getContent)) {
2212
2706
  content = getContent[0] && getContent[0](this.state.originTooltip);
@@ -2214,25 +2708,23 @@ function (_React$Component) {
2214
2708
  content = getContent(this.state.originTooltip);
2215
2709
  }
2216
2710
  }
2217
-
2218
- return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2711
+ return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2219
2712
  }
2220
2713
  }, {
2221
2714
  key: "isEmptyTip",
2222
2715
  value: function isEmptyTip(placeholder) {
2223
2716
  return typeof placeholder === 'string' && placeholder === '' || placeholder === null;
2224
2717
  }
2718
+
2225
2719
  /**
2226
2720
  * When mouse enter, show the tooltip
2227
2721
  */
2228
-
2229
2722
  }, {
2230
2723
  key: "showTooltip",
2231
2724
  value: function showTooltip(e, isGlobalCall) {
2232
2725
  if (!this.tooltipRef) {
2233
2726
  return;
2234
2727
  }
2235
-
2236
2728
  if (isGlobalCall) {
2237
2729
  // Don't trigger other elements belongs to other ReactTooltip
2238
2730
  var targetArray = this.getTargetArray(this.props.id);
@@ -2240,48 +2732,46 @@ function (_React$Component) {
2240
2732
  return ele === e.currentTarget;
2241
2733
  });
2242
2734
  if (!isMyElement) return;
2243
- } // Get the tooltip content
2735
+ }
2736
+ // Get the tooltip content
2244
2737
  // calculate in this phrase so that tip width height can be detected
2245
-
2246
-
2247
2738
  var _this$props5 = this.props,
2248
- multiline = _this$props5.multiline,
2249
- getContent = _this$props5.getContent;
2739
+ multiline = _this$props5.multiline,
2740
+ getContent = _this$props5.getContent;
2250
2741
  var originTooltip = e.currentTarget.getAttribute('data-tip');
2251
- var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false; // If it is focus event or called by ReactTooltip.show, switch to `solid` effect
2742
+ var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
2252
2743
 
2253
- var switchToSolid = e instanceof window.FocusEvent || isGlobalCall; // if it needs to skip adding hide listener to scroll
2744
+ // If it is focus event or called by ReactTooltip.show, switch to `solid` effect
2745
+ var switchToSolid = e instanceof window.FocusEvent || isGlobalCall;
2254
2746
 
2747
+ // if it needs to skip adding hide listener to scroll
2255
2748
  var scrollHide = true;
2256
-
2257
2749
  if (e.currentTarget.getAttribute('data-scroll-hide')) {
2258
2750
  scrollHide = e.currentTarget.getAttribute('data-scroll-hide') === 'true';
2259
2751
  } else if (this.props.scrollHide != null) {
2260
2752
  scrollHide = this.props.scrollHide;
2261
- } // adding aria-describedby to target to make tooltips read by screen readers
2262
-
2753
+ }
2263
2754
 
2755
+ // adding aria-describedby to target to make tooltips read by screen readers
2264
2756
  if (e && e.currentTarget && e.currentTarget.setAttribute) {
2265
- e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
2266
- } // Make sure the correct place is set
2267
-
2757
+ e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
2758
+ }
2268
2759
 
2760
+ // Make sure the correct place is set
2269
2761
  var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
2270
2762
  var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
2271
2763
  var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
2272
- var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2273
-
2764
+ var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
2274
2765
  if (result.position && this.props.overridePosition) {
2275
2766
  result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2276
2767
  }
2768
+ var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0];
2277
2769
 
2278
- var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering
2279
-
2770
+ // To prevent previously created timers from triggering
2280
2771
  this.clearTimer();
2281
2772
  var target = e.currentTarget;
2282
2773
  var reshowDelay = this.state.show ? target.getAttribute('data-delay-update') || this.props.delayUpdate : 0;
2283
2774
  var self = this;
2284
-
2285
2775
  var updateState = function updateState() {
2286
2776
  self.setState({
2287
2777
  originTooltip: originTooltip,
@@ -2297,6 +2787,7 @@ function (_React$Component) {
2297
2787
  },
2298
2788
  effect: effect,
2299
2789
  offset: offset,
2790
+ padding: target.getAttribute('data-padding') || self.props.padding,
2300
2791
  html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
2301
2792
  delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
2302
2793
  delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
@@ -2309,14 +2800,12 @@ function (_React$Component) {
2309
2800
  if (scrollHide) {
2310
2801
  self.addScrollListener(self.state.currentTarget);
2311
2802
  }
2312
-
2313
2803
  self.updateTooltip(e);
2314
-
2315
2804
  if (getContent && Array.isArray(getContent)) {
2316
2805
  self.intervalUpdateContent = setInterval(function () {
2317
2806
  if (self.mount) {
2318
2807
  var _getContent = self.props.getContent;
2319
- var placeholder = getTipContent(originTooltip, '', _getContent[0](), isMultiline);
2808
+ var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
2320
2809
  var isEmptyTip = self.isEmptyTip(placeholder);
2321
2810
  self.setState({
2322
2811
  isEmptyTip: isEmptyTip
@@ -2326,77 +2815,76 @@ function (_React$Component) {
2326
2815
  }, getContent[1]);
2327
2816
  }
2328
2817
  });
2329
- }; // If there is no delay call immediately, don't allow events to get in first.
2330
-
2818
+ };
2331
2819
 
2820
+ // If there is no delay call immediately, don't allow events to get in first.
2332
2821
  if (reshowDelay) {
2333
2822
  this.delayReshow = setTimeout(updateState, reshowDelay);
2334
2823
  } else {
2335
2824
  updateState();
2336
2825
  }
2337
2826
  }
2827
+
2338
2828
  /**
2339
2829
  * When mouse hover, update tool tip
2340
2830
  */
2341
-
2342
2831
  }, {
2343
2832
  key: "updateTooltip",
2344
2833
  value: function updateTooltip(e) {
2345
2834
  var _this5 = this;
2346
-
2347
2835
  var _this$state = this.state,
2348
- delayShow = _this$state.delayShow,
2349
- disable = _this$state.disable;
2350
- var afterShow = this.props.afterShow;
2836
+ delayShow = _this$state.delayShow,
2837
+ disable = _this$state.disable;
2838
+ var _this$props6 = this.props,
2839
+ afterShow = _this$props6.afterShow,
2840
+ disableProp = _this$props6.disable;
2351
2841
  var placeholder = this.getTooltipContent();
2352
- var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2842
+ var eventTarget = e.currentTarget || e.target;
2353
2843
 
2844
+ // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2354
2845
  if (this.mouseOnToolTip()) {
2355
2846
  return;
2356
- } // if the tooltip is empty, disable the tooltip
2357
-
2847
+ }
2358
2848
 
2359
- if (this.isEmptyTip(placeholder) || disable) {
2849
+ // if the tooltip is empty, disable the tooltip
2850
+ if (this.isEmptyTip(placeholder) || disable || disableProp) {
2360
2851
  return;
2361
2852
  }
2362
-
2363
2853
  var delayTime = !this.state.show ? parseInt(delayShow, 10) : 0;
2364
-
2365
2854
  var updateState = function updateState() {
2366
2855
  if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) {
2367
2856
  var isInvisible = !_this5.state.show;
2368
-
2369
2857
  _this5.setState({
2370
2858
  currentEvent: e,
2371
2859
  currentTarget: eventTarget,
2372
2860
  show: true
2373
2861
  }, function () {
2374
- _this5.updatePosition();
2375
-
2376
- if (isInvisible && afterShow) {
2377
- afterShow(e);
2378
- }
2862
+ _this5.updatePosition(function () {
2863
+ if (isInvisible && afterShow) {
2864
+ afterShow(e);
2865
+ }
2866
+ });
2379
2867
  });
2380
2868
  }
2381
2869
  };
2382
-
2383
- clearTimeout(this.delayShowLoop);
2384
-
2870
+ if (this.delayShowLoop) {
2871
+ clearTimeout(this.delayShowLoop);
2872
+ }
2385
2873
  if (delayTime) {
2386
2874
  this.delayShowLoop = setTimeout(updateState, delayTime);
2387
2875
  } else {
2876
+ this.delayShowLoop = null;
2388
2877
  updateState();
2389
2878
  }
2390
2879
  }
2880
+
2391
2881
  /*
2392
2882
  * If we're mousing over the tooltip remove it when we leave.
2393
2883
  */
2394
-
2395
2884
  }, {
2396
2885
  key: "listenForTooltipExit",
2397
2886
  value: function listenForTooltipExit() {
2398
2887
  var show = this.state.show;
2399
-
2400
2888
  if (show && this.tooltipRef) {
2401
2889
  this.tooltipRef.addEventListener('mouseleave', this.hideTooltip);
2402
2890
  }
@@ -2405,31 +2893,30 @@ function (_React$Component) {
2405
2893
  key: "removeListenerForTooltipExit",
2406
2894
  value: function removeListenerForTooltipExit() {
2407
2895
  var show = this.state.show;
2408
-
2409
2896
  if (show && this.tooltipRef) {
2410
2897
  this.tooltipRef.removeEventListener('mouseleave', this.hideTooltip);
2411
2898
  }
2412
2899
  }
2900
+
2413
2901
  /**
2414
2902
  * When mouse leave, hide tooltip
2415
2903
  */
2416
-
2417
2904
  }, {
2418
2905
  key: "hideTooltip",
2419
2906
  value: function hideTooltip(e, hasTarget) {
2420
2907
  var _this6 = this;
2421
-
2422
2908
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2423
2909
  isScroll: false
2424
2910
  };
2425
2911
  var disable = this.state.disable;
2426
2912
  var isScroll = options.isScroll;
2427
2913
  var delayHide = isScroll ? 0 : this.state.delayHide;
2428
- var afterHide = this.props.afterHide;
2914
+ var _this$props7 = this.props,
2915
+ afterHide = _this$props7.afterHide,
2916
+ disableProp = _this$props7.disable;
2429
2917
  var placeholder = this.getTooltipContent();
2430
2918
  if (!this.mount) return;
2431
- if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip
2432
-
2919
+ if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
2433
2920
  if (hasTarget) {
2434
2921
  // Don't trigger other elements belongs to other ReactTooltip
2435
2922
  var targetArray = this.getTargetArray(this.props.id);
@@ -2437,47 +2924,40 @@ function (_React$Component) {
2437
2924
  return ele === e.currentTarget;
2438
2925
  });
2439
2926
  if (!isMyElement || !this.state.show) return;
2440
- } // clean up aria-describedby when hiding tooltip
2441
-
2927
+ }
2442
2928
 
2929
+ // clean up aria-describedby when hiding tooltip
2443
2930
  if (e && e.currentTarget && e.currentTarget.removeAttribute) {
2444
2931
  e.currentTarget.removeAttribute('aria-describedby');
2445
2932
  }
2446
-
2447
2933
  var resetState = function resetState() {
2448
- var isVisible = _this6.state.show; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2449
-
2934
+ var isVisible = _this6.state.show;
2935
+ // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2450
2936
  if (_this6.mouseOnToolTip()) {
2451
2937
  _this6.listenForTooltipExit();
2452
-
2453
2938
  return;
2454
2939
  }
2455
-
2456
2940
  _this6.removeListenerForTooltipExit();
2457
-
2458
2941
  _this6.setState({
2459
2942
  show: false
2460
2943
  }, function () {
2461
2944
  _this6.removeScrollListener(_this6.state.currentTarget);
2462
-
2463
2945
  if (isVisible && afterHide) {
2464
2946
  afterHide(e);
2465
2947
  }
2466
2948
  });
2467
2949
  };
2468
-
2469
2950
  this.clearTimer();
2470
-
2471
2951
  if (delayHide) {
2472
2952
  this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));
2473
2953
  } else {
2474
2954
  resetState();
2475
2955
  }
2476
2956
  }
2957
+
2477
2958
  /**
2478
2959
  * When scroll, hide tooltip
2479
2960
  */
2480
-
2481
2961
  }, {
2482
2962
  key: "hideTooltipOnScroll",
2483
2963
  value: function hideTooltipOnScroll(event, hasTarget) {
@@ -2485,11 +2965,11 @@ function (_React$Component) {
2485
2965
  isScroll: true
2486
2966
  });
2487
2967
  }
2968
+
2488
2969
  /**
2489
2970
  * Add scroll event listener when tooltip show
2490
2971
  * automatically hide the tooltip when scrolling
2491
2972
  */
2492
-
2493
2973
  }, {
2494
2974
  key: "addScrollListener",
2495
2975
  value: function addScrollListener(currentTarget) {
@@ -2501,55 +2981,67 @@ function (_React$Component) {
2501
2981
  value: function removeScrollListener(currentTarget) {
2502
2982
  var isCaptureMode = this.isCapture(currentTarget);
2503
2983
  window.removeEventListener('scroll', this.hideTooltipOnScroll, isCaptureMode);
2504
- } // Calculation the position
2984
+ }
2505
2985
 
2986
+ // Calculation the position
2506
2987
  }, {
2507
2988
  key: "updatePosition",
2508
- value: function updatePosition() {
2989
+ value: function updatePosition(callbackAfter) {
2509
2990
  var _this7 = this;
2510
-
2511
2991
  var _this$state2 = this.state,
2512
- currentEvent = _this$state2.currentEvent,
2513
- currentTarget = _this$state2.currentTarget,
2514
- place = _this$state2.place,
2515
- desiredPlace = _this$state2.desiredPlace,
2516
- effect = _this$state2.effect,
2517
- offset = _this$state2.offset;
2992
+ currentEvent = _this$state2.currentEvent,
2993
+ currentTarget = _this$state2.currentTarget,
2994
+ place = _this$state2.place,
2995
+ desiredPlace = _this$state2.desiredPlace,
2996
+ effect = _this$state2.effect,
2997
+ offset = _this$state2.offset;
2518
2998
  var node = this.tooltipRef;
2519
2999
  var result = getPosition(currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
2520
-
2521
3000
  if (result.position && this.props.overridePosition) {
2522
3001
  result.position = this.props.overridePosition(result.position, currentEvent, currentTarget, node, place, desiredPlace, effect, offset);
2523
3002
  }
2524
-
2525
3003
  if (result.isNewState) {
2526
3004
  // Switch to reverse placement
2527
3005
  return this.setState(result.newState, function () {
2528
- _this7.updatePosition();
3006
+ _this7.updatePosition(callbackAfter);
2529
3007
  });
2530
- } // Set tooltip position
2531
-
3008
+ }
3009
+ if (callbackAfter && typeof callbackAfter === 'function') {
3010
+ callbackAfter();
3011
+ }
2532
3012
 
3013
+ // Set tooltip position
2533
3014
  node.style.left = result.position.left + 'px';
2534
3015
  node.style.top = result.position.top + 'px';
2535
3016
  }
3017
+
2536
3018
  /**
2537
3019
  * CLear all kinds of timeout of interval
2538
3020
  */
2539
-
2540
3021
  }, {
2541
3022
  key: "clearTimer",
2542
3023
  value: function clearTimer() {
2543
- clearTimeout(this.delayShowLoop);
2544
- clearTimeout(this.delayHideLoop);
2545
- clearTimeout(this.delayReshow);
2546
- clearInterval(this.intervalUpdateContent);
3024
+ if (this.delayShowLoop) {
3025
+ clearTimeout(this.delayShowLoop);
3026
+ this.delayShowLoop = null;
3027
+ }
3028
+ if (this.delayHideLoop) {
3029
+ clearTimeout(this.delayHideLoop);
3030
+ this.delayHideLoop = null;
3031
+ }
3032
+ if (this.delayReshow) {
3033
+ clearTimeout(this.delayReshow);
3034
+ this.delayReshow = null;
3035
+ }
3036
+ if (this.intervalUpdateContent) {
3037
+ clearInterval(this.intervalUpdateContent);
3038
+ this.intervalUpdateContent = null;
3039
+ }
2547
3040
  }
2548
3041
  }, {
2549
3042
  key: "hasCustomColors",
2550
3043
  value: function hasCustomColors() {
2551
3044
  var _this8 = this;
2552
-
2553
3045
  return Boolean(Object.keys(this.state.customColors).find(function (color) {
2554
3046
  return color !== 'border' && _this8.state.customColors[color];
2555
3047
  }) || this.state.border && this.state.customColors['border']);
@@ -2558,30 +3050,27 @@ function (_React$Component) {
2558
3050
  key: "render",
2559
3051
  value: function render() {
2560
3052
  var _this9 = this;
2561
-
2562
3053
  var _this$state3 = this.state,
2563
- extraClass = _this$state3.extraClass,
2564
- html = _this$state3.html,
2565
- ariaProps = _this$state3.ariaProps,
2566
- disable = _this$state3.disable,
2567
- uuid = _this$state3.uuid;
3054
+ extraClass = _this$state3.extraClass,
3055
+ html = _this$state3.html,
3056
+ ariaProps = _this$state3.ariaProps,
3057
+ disable = _this$state3.disable,
3058
+ uuid = _this$state3.uuid;
2568
3059
  var content = this.getTooltipContent();
2569
3060
  var isEmptyTip = this.isEmptyTip(content);
2570
- var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);
3061
+ var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding);
2571
3062
  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
- " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + ( // dark, success, warning, error, info, light, custom
3063
+ " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + (
3064
+ // dark, success, warning, error, info, light, custom
2573
3065
  this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
2574
3066
  var Wrapper = this.props.wrapper;
2575
-
2576
3067
  if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {
2577
3068
  Wrapper = ReactTooltip.defaultProps.wrapper;
2578
3069
  }
2579
-
2580
3070
  var wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(' ');
2581
-
2582
3071
  if (html) {
2583
3072
  var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
2584
- return React.createElement(Wrapper, _extends({
3073
+ return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
2585
3074
  className: "".concat(wrapperClassName),
2586
3075
  id: this.props.id || uuid,
2587
3076
  ref: function ref(_ref) {
@@ -2594,7 +3083,7 @@ function (_React$Component) {
2594
3083
  }
2595
3084
  }));
2596
3085
  } else {
2597
- return React.createElement(Wrapper, _extends({
3086
+ return /*#__PURE__*/React__default["default"].createElement(Wrapper, _extends({
2598
3087
  className: "".concat(wrapperClassName),
2599
3088
  id: this.props.id || uuid
2600
3089
  }, ariaProps, {
@@ -2602,7 +3091,7 @@ function (_React$Component) {
2602
3091
  return _this9.tooltipRef = _ref2;
2603
3092
  },
2604
3093
  "data-id": "tooltip"
2605
- }), React.createElement("style", {
3094
+ }), /*#__PURE__*/React__default["default"].createElement("style", {
2606
3095
  dangerouslySetInnerHTML: {
2607
3096
  __html: style
2608
3097
  },
@@ -2611,6 +3100,49 @@ function (_React$Component) {
2611
3100
  }
2612
3101
  }
2613
3102
  }], [{
3103
+ key: "propTypes",
3104
+ get: function get() {
3105
+ return {
3106
+ uuid: PropTypes__default["default"].string,
3107
+ children: PropTypes__default["default"].any,
3108
+ place: PropTypes__default["default"].string,
3109
+ type: PropTypes__default["default"].string,
3110
+ effect: PropTypes__default["default"].string,
3111
+ offset: PropTypes__default["default"].object,
3112
+ padding: PropTypes__default["default"].string,
3113
+ multiline: PropTypes__default["default"].bool,
3114
+ border: PropTypes__default["default"].bool,
3115
+ textColor: PropTypes__default["default"].string,
3116
+ backgroundColor: PropTypes__default["default"].string,
3117
+ borderColor: PropTypes__default["default"].string,
3118
+ arrowColor: PropTypes__default["default"].string,
3119
+ insecure: PropTypes__default["default"].bool,
3120
+ "class": PropTypes__default["default"].string,
3121
+ className: PropTypes__default["default"].string,
3122
+ id: PropTypes__default["default"].string,
3123
+ html: PropTypes__default["default"].bool,
3124
+ delayHide: PropTypes__default["default"].number,
3125
+ delayUpdate: PropTypes__default["default"].number,
3126
+ delayShow: PropTypes__default["default"].number,
3127
+ event: PropTypes__default["default"].string,
3128
+ eventOff: PropTypes__default["default"].string,
3129
+ isCapture: PropTypes__default["default"].bool,
3130
+ globalEventOff: PropTypes__default["default"].string,
3131
+ getContent: PropTypes__default["default"].any,
3132
+ afterShow: PropTypes__default["default"].func,
3133
+ afterHide: PropTypes__default["default"].func,
3134
+ overridePosition: PropTypes__default["default"].func,
3135
+ disable: PropTypes__default["default"].bool,
3136
+ scrollHide: PropTypes__default["default"].bool,
3137
+ resizeHide: PropTypes__default["default"].bool,
3138
+ wrapper: PropTypes__default["default"].string,
3139
+ bodyMode: PropTypes__default["default"].bool,
3140
+ possibleCustomEvents: PropTypes__default["default"].string,
3141
+ possibleCustomEventsOff: PropTypes__default["default"].string,
3142
+ clickable: PropTypes__default["default"].bool
3143
+ };
3144
+ }
3145
+ }, {
2614
3146
  key: "getDerivedStateFromProps",
2615
3147
  value: function getDerivedStateFromProps(nextProps, prevState) {
2616
3148
  var ariaProps = prevState.ariaProps;
@@ -2618,24 +3150,21 @@ function (_React$Component) {
2618
3150
  var isChanged = Object.keys(newAriaProps).some(function (props) {
2619
3151
  return newAriaProps[props] !== ariaProps[props];
2620
3152
  });
2621
-
2622
3153
  if (!isChanged) {
2623
3154
  return null;
2624
3155
  }
2625
-
2626
- return _objectSpread2({}, prevState, {
3156
+ return _objectSpread2(_objectSpread2({}, prevState), {}, {
2627
3157
  ariaProps: newAriaProps
2628
3158
  });
2629
3159
  }
2630
3160
  }]);
2631
-
2632
3161
  return ReactTooltip;
2633
- }(React.Component), _defineProperty(_class2, "defaultProps", {
3162
+ }(React__default["default"].Component), _defineProperty(_class2, "defaultProps", {
2634
3163
  insecure: true,
2635
3164
  resizeHide: true,
2636
3165
  wrapper: 'div',
2637
3166
  clickable: false
2638
- }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
3167
+ }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
2639
3168
 
2640
3169
  module.exports = ReactTooltip;
2641
3170
  //# sourceMappingURL=index.js.map