/**! * tippy.js v5.2.1 * (c) 2017-2020 atomiks * MIT License */ var tippyv5 = (function (Popper) { 'use strict'; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; var css = ".tippy-tooltip[data-animation=fade][data-state=hidden]{opacity:0}.tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}"; /** * Injects a string of CSS styles to a style node in */ function injectCSS(css) { var style = document.createElement('style'); style.textContent = css; style.setAttribute('data-tippy-stylesheet', ''); var head = document.head; var firstStyleOrLinkTag = document.querySelector('head>style,head>link'); if (firstStyleOrLinkTag) { head.insertBefore(style, firstStyleOrLinkTag); } else { head.appendChild(style); } } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var PASSIVE = { passive: true }; var ROUND_ARROW = ''; var IOS_CLASS = "tippy-iOS"; var POPPER_CLASS = "tippy-popper"; var TOOLTIP_CLASS = "tippy-tooltip"; var CONTENT_CLASS = "tippy-content"; var BACKDROP_CLASS = "tippy-backdrop"; var ARROW_CLASS = "tippy-arrow"; var SVG_ARROW_CLASS = "tippy-svg-arrow"; var POPPER_SELECTOR = "." + POPPER_CLASS; var TOOLTIP_SELECTOR = "." + TOOLTIP_CLASS; var CONTENT_SELECTOR = "." + CONTENT_CLASS; var ARROW_SELECTOR = "." + ARROW_CLASS; var SVG_ARROW_SELECTOR = "." + SVG_ARROW_CLASS; /** * Triggers reflow */ function reflow(element) { void element.offsetHeight; } /** * Sets the innerHTML of an element */ function setInnerHTML(element, html) { element[innerHTML()] = html; } /** * Determines if the value is a reference element */ function isReferenceElement(value) { return !!(value && value._tippy && value._tippy.reference === value); } /** * Safe .hasOwnProperty check, for prototype-less objects */ function hasOwnProperty(obj, key) { return {}.hasOwnProperty.call(obj, key); } /** * Returns an array of elements based on the value */ function getArrayOfElements(value) { if (isElement(value)) { return [value]; } if (isNodeList(value)) { return arrayFrom(value); } if (Array.isArray(value)) { return value; } return arrayFrom(document.querySelectorAll(value)); } /** * Returns a value at a given index depending on if it's an array or number */ function getValueAtIndexOrReturn(value, index, defaultValue) { if (Array.isArray(value)) { var v = value[index]; return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v; } return value; } /** * Prevents errors from being thrown while accessing nested modifier objects * in `popperOptions` */ function getModifier(obj, key) { return obj && obj.modifiers && obj.modifiers[key]; } /** * Determines if the value is of type */ function isType(value, type) { var str = {}.toString.call(value); return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1; } /** * Determines if the value is of type Element */ function isElement(value) { return isType(value, 'Element'); } /** * Determines if the value is of type NodeList */ function isNodeList(value) { return isType(value, 'NodeList'); } /** * Determines if the value is of type MouseEvent */ function isMouseEvent(value) { return isType(value, 'MouseEvent'); } /** * Firefox extensions don't allow setting .innerHTML directly, this will trick * it */ function innerHTML() { return 'innerHTML'; } /** * Evaluates a function if one, or returns the value */ function invokeWithArgsOrReturn(value, args) { return typeof value === 'function' ? value.apply(void 0, args) : value; } /** * Sets a popperInstance modifier's property to a value */ function setModifierValue(modifiers, name, property, value) { modifiers.filter(function (m) { return m.name === name; })[0][property] = value; } /** * Returns a new `div` element */ function div() { return document.createElement('div'); } /** * Applies a transition duration to a list of elements */ function setTransitionDuration(els, value) { els.forEach(function (el) { if (el) { el.style.transitionDuration = value + "ms"; } }); } /** * Sets the visibility state to elements so they can begin to transition */ function setVisibilityState(els, state) { els.forEach(function (el) { if (el) { el.setAttribute('data-state', state); } }); } /** * Debounce utility. To avoid bloating bundle size, we're only passing 1 * argument here, a more generic function would pass all arguments. Only * `onMouseMove` uses this which takes the event object for now. */ function debounce(fn, ms) { // Avoid wrapping in `setTimeout` if ms is 0 anyway if (ms === 0) { return fn; } var timeout; return function (arg) { clearTimeout(timeout); timeout = setTimeout(function () { fn(arg); }, ms); }; } /** * Preserves the original function invocation when another function replaces it */ function preserveInvocation(originalFn, currentFn, args) { if (originalFn && originalFn !== currentFn) { originalFn.apply(void 0, args); } } /** * Deletes properties from an object (pure) */ function removeProperties(obj, keys) { var clone = _extends({}, obj); keys.forEach(function (key) { delete clone[key]; }); return clone; } /** * Ponyfill for Array.from - converts iterable values to an array */ function arrayFrom(value) { return [].slice.call(value); } /** * Works like Element.prototype.closest, but uses a callback instead */ function closestCallback(element, callback) { while (element) { if (callback(element)) { return element; } element = element.parentElement; } return null; } /** * Determines if an array or string includes a string */ function includes(a, b) { return a.indexOf(b) > -1; } /** * Creates an array from string of values separated by whitespace */ function splitBySpaces(value) { return value.split(/\s+/).filter(Boolean); } /** * Returns the `nextValue` if `nextValue` is not `undefined`, otherwise returns * `currentValue` */ function useIfDefined(nextValue, currentValue) { return nextValue !== undefined ? nextValue : currentValue; } /** * Converts a value that's an array or single value to an array */ function normalizeToArray(value) { return [].concat(value); } /** * Returns the ownerDocument of the first available element, otherwise global * document */ function getOwnerDocument(elementOrElements) { var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0]; return element ? element.ownerDocument || document : document; } /** * Adds item to array if array does not contain it */ function pushIfUnique(arr, value) { if (arr.indexOf(value) === -1) { arr.push(value); } } /** * Adds `px` if value is a number, or returns it directly */ function appendPxIfNumber(value) { return typeof value === 'number' ? value + "px" : value; } /** * Filters out duplicate elements in an array */ function unique(arr) { return arr.filter(function (item, index) { return arr.indexOf(item) === index; }); } /** * Returns number from number or CSS units string */ function getNumber(value) { return typeof value === 'number' ? value : parseFloat(value); } /** * Gets number or CSS string units in pixels (e.g. `1rem` -> 16) */ function getUnitsInPx(doc, value) { var isRem = typeof value === 'string' && includes(value, 'rem'); var html = doc.documentElement; var rootFontSize = 16; if (html && isRem) { return parseFloat(getComputedStyle(html).fontSize || String(rootFontSize)) * getNumber(value); } return getNumber(value); } /** * Adds the `distancePx` value to the placement of a Popper.Padding object */ function getComputedPadding(basePlacement, padding, distancePx) { if (padding === void 0) { padding = 0; } var freshPaddingObject = { top: 0, right: 0, bottom: 0, left: 0 }; var keys = Object.keys(freshPaddingObject); return keys.reduce(function (obj, key) { obj[key] = typeof padding === 'number' ? padding : padding[key]; if (basePlacement === key) { obj[key] = typeof padding === 'number' ? padding + distancePx : padding[basePlacement] + distancePx; } return obj; }, freshPaddingObject); } var currentInput = { isTouch: false }; var lastMouseMoveTime = 0; /** * When a `touchstart` event is fired, it's assumed the user is using touch * input. We'll bind a `mousemove` event listener to listen for mouse input in * the future. This way, the `isTouch` property is fully dynamic and will handle * hybrid devices that use a mix of touch + mouse input. */ function onDocumentTouchStart() { if (currentInput.isTouch) { return; } currentInput.isTouch = true; if (window.performance) { document.addEventListener('mousemove', onDocumentMouseMove); } } /** * When two `mousemove` event are fired consecutively within 20ms, it's assumed * the user is using mouse input again. `mousemove` can fire on touch devices as * well, but very rarely that quickly. */ function onDocumentMouseMove() { var now = performance.now(); if (now - lastMouseMoveTime < 20) { currentInput.isTouch = false; document.removeEventListener('mousemove', onDocumentMouseMove); } lastMouseMoveTime = now; } /** * When an element is in focus and has a tippy, leaving the tab/window and * returning causes it to show again. For mouse users this is unexpected, but * for keyboard use it makes sense. * TODO: find a better technique to solve this problem */ function onWindowBlur() { var activeElement = document.activeElement; if (isReferenceElement(activeElement)) { var instance = activeElement._tippy; if (activeElement.blur && !instance.state.isVisible) { activeElement.blur(); } } } /** * Adds the needed global event listeners */ function bindGlobalEventListeners() { document.addEventListener('touchstart', onDocumentTouchStart, _extends({}, PASSIVE, { capture: true })); window.addEventListener('blur', onWindowBlur); } var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; var ua = isBrowser ? navigator.userAgent : ''; var isIE = /MSIE |Trident\//.test(ua); var isIOS = isBrowser && /iPhone|iPad|iPod/.test(navigator.platform); function updateIOSClass(isAdd) { var shouldAdd = isAdd && isIOS && currentInput.isTouch; document.body.classList[shouldAdd ? 'add' : 'remove'](IOS_CLASS); } var version = "5.2.1"; function createMemoryLeakWarning(method) { var txt = method === 'destroy' ? 'n already-' : ' '; return "\n " + method + "() was called on a" + txt + "destroyed instance. This is a no-op but\n indicates a potential memory leak.\n "; } function clean(value) { var spacesAndTabs = /[ \t]{2,}/g; var lineStartWithSpaces = /^[ \t]*/gm; return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim(); } function getDevMessage(message) { 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 "); } function getFormattedMessage(message) { return [getDevMessage(message), // title 'color: #00C584; font-size: 1.3em; font-weight: bold;', // message 'line-height: 1.5', // footer 'color: #a6a095;']; } /** * Helpful wrapper around `console.warn()`. * TODO: Should we use a cache so it only warns a single time and not spam the * console? (Need to consider hot reloading and invalidation though). Chrome * already batches warnings as well. */ function warnWhen(condition, message) { } /** * Helpful wrapper around `console.error()` */ function errorWhen(condition, message) { } /** * Validates the `targets` value passed to `tippy()` */ function validateTargets(targets) { var didPassFalsyValue = !targets; 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 no longer supported as an argument.', 'See: https://atomiks.github.io/tippyjs/misc/#custom-position'].join(' ')); } var pluginProps = { animateFill: false, followCursor: false, inlinePositioning: false, sticky: false }; var defaultProps = _extends({ allowHTML: true, animation: 'fade', appendTo: function appendTo() { return document.body; }, aria: 'describedby', arrow: true, boundary: 'scrollParent', content: '', delay: 0, distance: 10, duration: [300, 250], flip: true, flipBehavior: 'flip', flipOnUpdate: false, hideOnClick: true, ignoreAttributes: false, inertia: false, interactive: false, interactiveBorder: 2, interactiveDebounce: 0, lazy: true, maxWidth: 350, multiple: false, offset: 0, 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() {}, placement: 'top', plugins: [], popperOptions: {}, role: 'tooltip', showOnCreate: false, theme: '', touch: true, trigger: 'mouseenter focus', triggerTarget: null, updateDuration: 0, zIndex: 9999 }, pluginProps); var defaultKeys = Object.keys(defaultProps); /** * If the setProps() method encounters one of these, the popperInstance must be * recreated */ var POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions']; /** * Mutates the defaultProps object by setting the props specified */ var setDefaultProps = function setDefaultProps(partialProps) { { validateProps(partialProps, []); } var keys = Object.keys(partialProps); keys.forEach(function (key) { defaultProps[key] = partialProps[key]; }); }; /** * Returns an extended props object including plugin props */ function getExtendedPassedProps(passedProps) { var plugins = passedProps.plugins || []; var pluginProps = plugins.reduce(function (acc, plugin) { var name = plugin.name, defaultValue = plugin.defaultValue; if (name) { acc[name] = passedProps[name] !== undefined ? passedProps[name] : defaultValue; } return acc; }, {}); return _extends({}, passedProps, {}, pluginProps); } /** * Returns an object of optional props from data-tippy-* attributes */ function getDataAttributeProps(reference, plugins) { var propKeys = plugins ? Object.keys(getExtendedPassedProps(_extends({}, defaultProps, { plugins: plugins }))) : defaultKeys; var props = propKeys.reduce(function (acc, key) { var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim(); if (!valueAsString) { return acc; } if (key === 'content') { acc[key] = valueAsString; } else { try { acc[key] = JSON.parse(valueAsString); } catch (e) { acc[key] = valueAsString; } } return acc; }, {}); return props; } /** * Evaluates the props object by merging data attributes and disabling * conflicting props where necessary */ function evaluateProps(reference, props) { var out = _extends({}, props, { content: invokeWithArgsOrReturn(props.content, [reference]) }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins)); if (out.interactive) { out.aria = null; } return out; } /** * Validates props with the valid `defaultProps` object */ function validateProps(partialProps, plugins) { if (partialProps === void 0) { partialProps = {}; } if (plugins === void 0) { plugins = []; } var keys = Object.keys(partialProps); keys.forEach(function (prop) { var value = partialProps[prop]; var didSpecifyPlacementInPopperOptions = prop === 'popperOptions' && value !== null && typeof value === 'object' && hasOwnProperty(value, 'placement'); var nonPluginProps = removeProperties(defaultProps, ['animateFill', 'followCursor', 'inlinePositioning', 'sticky']); // These props have custom warnings var customWarningProps = ['a11y', 'arrowType', 'showOnInit', 'size', 'target', 'touchHold']; var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop) && !includes(customWarningProps, prop); // Check if the prop exists in `plugins` if (didPassUnknownProp) { didPassUnknownProp = plugins.filter(function (plugin) { return plugin.name === prop; }).length === 0; } warnWhen(prop === 'target', ['The `target` prop was removed in v5 and replaced with the delegate() addon', 'in order to conserve bundle size.', 'See: https://atomiks.github.io/tippyjs/addons/#event-delegation'].join(' ')); warnWhen(prop === 'a11y', ['The `a11y` prop was removed in v5. Make sure the element you are giving a', 'tippy to is natively focusable, such as