return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n ");
var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
}
var pluginProps = {
animateFill: false,
followCursor: false,
inlinePositioning: false,
sticky: false
};
var renderProps = {
allowHTML: false,
animation: 'fade',
arrow: true,
content: '',
inertia: false,
maxWidth: 350,
role: 'tooltip',
theme: '',
zIndex: 9999
};
var defaultProps = Object.assign({
appendTo: TIPPY_DEFAULT_APPEND_TO,
aria: {
content: 'auto',
expanded: 'auto'
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: true,
ignoreAttributes: false,
interactive: false,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: '',
offset: [0, 10],
onAfterUpdate: function onAfterUpdate() {},
onBeforeUpdate: function onBeforeUpdate() {},
onCreate: function onCreate() {},
onDestroy: function onDestroy() {},
onHidden: function onHidden() {},
onHide: function onHide() {},
onMount: function onMount() {},
onShow: function onShow() {},
onShown: function onShown() {},
onTrigger: function onTrigger() {},
onUntrigger: function onUntrigger() {},
onClickOutside: function onClickOutside() {},
placement: 'top',
plugins: [],
popperOptions: {},
render: null,
showOnCreate: false,
touch: true,
trigger: 'mouseenter focus',
triggerTarget: null
}, pluginProps, renderProps);
var defaultKeys = Object.keys(defaultProps);
var setDefaultProps = function setDefaultProps(partialProps) {
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
validateProps(partialProps, []);
}
var keys = Object.keys(partialProps);
keys.forEach(function (key) {
defaultProps[key] = partialProps[key];
});
};
function getExtendedPassedProps(passedProps) {
var plugins = passedProps.plugins || [];
var pluginProps = plugins.reduce(function (acc, plugin) {
warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));
} // The popper element needs to exist on the DOM before its position can be
// updated as Popper needs to read its dimensions
if (!parentNode.contains(popper)) {
parentNode.appendChild(popper);
}
instance.state.isMounted = true;
createPopperInstance();
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
// Accessibility check
warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\n\n', 'Using a wrapper <div> or <span> tag around the reference element', 'solves this by creating a new parentNode context.', '\n\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\n\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
validateTargets(targets);
validateProps(optionalProps, plugins);
}
bindGlobalEventListeners();
var passedProps = Object.assign({}, optionalProps, {
plugins: plugins
});
var elements = getArrayOfElements(targets);
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
var isSingleContentElement = isElement(passedProps.content);
var isMoreThanOneReferenceElement = elements.length > 1;
warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\n\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\n\n', '1) content: element.innerHTML\n', '2) content: () => element.cloneNode(true)'].join(' '));
}
var instances = elements.reduce(function (acc, reference) {
var instance = reference && createTippy(reference, passedProps);
var createSingleton = function createSingleton(tippyInstances, optionalProps) {
var _optionalProps$popper;
if (optionalProps === void 0) {
optionalProps = {};
}
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));
* Creates a delegate instance that controls the creation of tippy instances
* for child elements (`target` CSS selector).
*/
function delegate(targets, props) {
/* istanbul ignore else */
if (process.env.NODE_ENV !== "production") {
errorWhen(!(props && props.target), ['You must specity a `target` prop indicating a CSS selector string matching', 'the target elements that should receive a tippy.'].join(' '));
}
var listeners = [];
var childTippyInstances = [];
var disabled = false;
var target = props.target;
var nativeProps = removeProperties(props, ['target']);
var parentProps = Object.assign({}, nativeProps, {
trigger: 'manual',
touch: false
});
var childProps = Object.assign({
touch: defaultProps.touch
}, nativeProps, {
showOnCreate: true
});
var returnValue = tippy(targets, parentProps);
var normalizedReturnValue = normalizeToArray(returnValue);
function onTrigger(event) {
if (!event.target || disabled) {
return;
}
var targetNode = event.target.closest(target);
if (!targetNode) {
return;
} // Get relevant trigger with fallbacks:
// 1. Check `data-tippy-trigger` attribute on target node
// 2. Fallback to `trigger` passed to `delegate()`
// 3. Fallback to `defaultProps.trigger`
var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // @ts-ignore
if (targetNode._tippy) {
return;
}
if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') {
return;
}
if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) {