{"version":3,"file":"index.min.js","sources":["../src/browser.ts","../src/props.ts","../src/ponyfills.ts","../src/constants.ts","../src/bindGlobalEventListeners.ts","../src/reference.ts","../src/utils.ts","../src/popper.ts","../src/createTippy.ts","../src/index.ts","../src/group.ts"],"sourcesContent":["export const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined'\n\nconst ua = isBrowser ? navigator.userAgent : ''\n\nexport const isIE = /MSIE |Trident\\//.test(ua)\nexport const isUCBrowser = /UCBrowser\\//.test(ua)\nexport const isIOS =\n isBrowser &&\n /iPhone|iPad|iPod/.test(navigator.platform) &&\n !(window as any).MSStream\n","import { Props } from './types'\n\nexport const defaultProps: Props = {\n a11y: true,\n allowHTML: true,\n animateFill: true,\n animation: 'shift-away',\n appendTo: () => document.body,\n aria: 'describedby',\n arrow: false,\n arrowType: 'sharp',\n boundary: 'scrollParent',\n content: '',\n delay: 0,\n distance: 10,\n duration: [325, 275],\n flip: true,\n flipBehavior: 'flip',\n flipOnUpdate: false,\n followCursor: false,\n hideOnClick: true,\n ignoreAttributes: false,\n inertia: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n lazy: true,\n maxWidth: 350,\n multiple: false,\n offset: 0,\n onHidden() {},\n onHide() {},\n onMount() {},\n onShow() {},\n onShown() {},\n onTrigger() {},\n placement: 'top',\n popperOptions: {},\n role: 'tooltip',\n showOnInit: false,\n size: 'regular',\n sticky: false,\n target: '',\n theme: 'dark',\n touch: true,\n touchHold: false,\n trigger: 'mouseenter focus',\n triggerTarget: null,\n updateDuration: 0,\n wait: null,\n zIndex: 9999,\n}\n\n/**\n * If the set() method encounters one of these, the popperInstance must be\n * recreated\n */\nexport const POPPER_INSTANCE_DEPENDENCIES: Array = [\n 'arrow',\n 'arrowType',\n 'boundary',\n 'distance',\n 'flip',\n 'flipBehavior',\n 'flipOnUpdate',\n 'offset',\n 'placement',\n 'popperOptions',\n]\n","import { isBrowser } from './browser'\n\nconst elementProto: Record = isBrowser ? Element.prototype : {}\n\nexport const matches =\n elementProto.matches ||\n elementProto.matchesSelector ||\n elementProto.webkitMatchesSelector ||\n elementProto.mozMatchesSelector ||\n elementProto.msMatchesSelector\n\n/**\n * Ponyfill for Array.from - converts iterable values to an array\n */\nexport function arrayFrom(value: ArrayLike): any[] {\n return [].slice.call(value)\n}\n\n/**\n * Ponyfill for Element.prototype.closest\n */\nexport function closest(element: Element, selector: string): Element | null {\n return closestCallback(element, (el: Element) => matches.call(el, selector))\n}\n\n/**\n * Works like Element.prototype.closest, but uses a callback instead\n */\nexport function closestCallback(\n element: Element | null,\n callback: Function,\n): Element | null {\n while (element) {\n if (callback(element)) {\n return element\n }\n\n element = element.parentElement\n }\n\n return null\n}\n","// Passive event listener config\nexport const PASSIVE = { passive: true }\n\n// Popper `preventOverflow` padding\nexport const PADDING = 4\n\n// Popper attributes\n// In Popper v2 these will be `data-*` instead of `x-*` to adhere to HTML5 spec\nexport const PLACEMENT_ATTRIBUTE = 'x-placement'\nexport const OUT_OF_BOUNDARIES_ATTRIBUTE = 'x-out-of-boundaries'\n\n// Classes\nexport const IOS_CLASS = `__NAMESPACE_PREFIX__-iOS`\nexport const ACTIVE_CLASS = `__NAMESPACE_PREFIX__-active`\nexport const POPPER_CLASS = `__NAMESPACE_PREFIX__-popper`\nexport const TOOLTIP_CLASS = `__NAMESPACE_PREFIX__-tooltip`\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`\nexport const ROUND_ARROW_CLASS = `__NAMESPACE_PREFIX__-roundarrow`\n\n// Selectors\nexport const POPPER_SELECTOR = `.${POPPER_CLASS}`\nexport const TOOLTIP_SELECTOR = `.${TOOLTIP_CLASS}`\nexport const CONTENT_SELECTOR = `.${CONTENT_CLASS}`\nexport const BACKDROP_SELECTOR = `.${BACKDROP_CLASS}`\nexport const ARROW_SELECTOR = `.${ARROW_CLASS}`\nexport const ROUND_ARROW_SELECTOR = `.${ROUND_ARROW_CLASS}`\n","import { isIOS } from './browser'\nimport { PASSIVE, IOS_CLASS } from './constants'\n\nexport let isUsingTouch = false\n\nexport function onDocumentTouch(): void {\n if (isUsingTouch) {\n return\n }\n\n isUsingTouch = true\n\n if (isIOS) {\n document.body.classList.add(IOS_CLASS)\n }\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove)\n }\n}\n\nlet lastMouseMoveTime = 0\nexport function onDocumentMouseMove(): void {\n const now = performance.now()\n\n // Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference\n if (now - lastMouseMoveTime < 20) {\n isUsingTouch = false\n\n document.removeEventListener('mousemove', onDocumentMouseMove)\n\n if (!isIOS) {\n document.body.classList.remove(IOS_CLASS)\n }\n }\n\n lastMouseMoveTime = now\n}\n\nexport function onWindowBlur(): void {\n const { activeElement }: { activeElement: any } = document\n\n if (activeElement && activeElement.blur && activeElement._tippy) {\n activeElement.blur()\n }\n}\n\n/**\n * Adds the needed global event listeners\n */\nexport default function bindGlobalEventListeners(): void {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE)\n window.addEventListener('blur', onWindowBlur)\n}\n","import { Props, VirtualReference, ReferenceElement } from './types'\nimport { defaultProps } from './props'\n\nconst keys = Object.keys(defaultProps)\n\n/**\n * Returns an object of optional props from data-tippy-* attributes\n */\nexport function getDataAttributeOptions(\n reference: ReferenceElement | VirtualReference,\n): Props {\n return keys.reduce((acc: any, key) => {\n const valueAsString = (\n reference.getAttribute(`data-tippy-${key}`) || ''\n ).trim()\n\n if (!valueAsString) {\n return acc\n }\n\n if (key === 'content') {\n acc[key] = valueAsString\n } else {\n try {\n acc[key] = JSON.parse(valueAsString)\n } catch (e) {\n acc[key] = valueAsString\n }\n }\n\n return acc\n }, {})\n}\n\n/**\n * Polyfills the virtual reference (plain object) with Element.prototype props\n * Mutating because DOM elements are mutated, adds `_tippy` property\n */\nexport function polyfillElementPrototypeProperties(\n virtualReference: VirtualReference & Record,\n): void {\n const polyfills: Record = {\n isVirtual: true,\n attributes: virtualReference.attributes || {},\n contains() {},\n setAttribute(key: string, value: any) {\n virtualReference.attributes[key] = value\n },\n getAttribute(key: string) {\n return virtualReference.attributes[key]\n },\n removeAttribute(key: string) {\n delete virtualReference.attributes[key]\n },\n hasAttribute(key: string) {\n return key in virtualReference.attributes\n },\n addEventListener() {},\n removeEventListener() {},\n classList: {\n classNames: {},\n add(key: string) {\n virtualReference.classList.classNames[key] = true\n },\n remove(key: string) {\n delete virtualReference.classList.classNames[key]\n },\n contains(key: string) {\n return key in virtualReference.classList.classNames\n },\n },\n }\n\n for (const key in polyfills) {\n virtualReference[key] = polyfills[key]\n }\n}\n","import {\n Options,\n Props,\n ReferenceElement,\n Targets,\n VirtualReference,\n} from './types'\nimport { arrayFrom, matches } from './ponyfills'\nimport { isUCBrowser } from './browser'\nimport { getDataAttributeOptions } from './reference'\nimport { POPPER_SELECTOR } from './constants'\n\n/**\n * Determines if a value is a \"bare\" virtual element (before mutations done\n * by `polyfillElementPrototypeProperties()`). JSDOM elements show up as\n * [object Object], we can check if the value is \"element-like\" if it has\n * `addEventListener`\n */\nexport function isBareVirtualElement(value: any): boolean {\n return (\n {}.toString.call(value) === '[object Object]' && !value.addEventListener\n )\n}\n\n/**\n * Determines if the value is a reference element\n */\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!value._tippy && !matches.call(value, POPPER_SELECTOR)\n}\n\n/**\n * Safe .hasOwnProperty check, for prototype-less objects\n */\nexport function hasOwnProperty(obj: object, key: string): boolean {\n return {}.hasOwnProperty.call(obj, key)\n}\n\n/**\n * Returns an array of elements based on the value\n */\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isSingular(value)) {\n // TODO: VirtualReference is not compatible to type Element\n return [value as Element]\n }\n\n if (value instanceof NodeList) {\n return arrayFrom(value)\n }\n\n if (Array.isArray(value)) {\n return value\n }\n\n try {\n return arrayFrom(document.querySelectorAll(value))\n } catch (e) {\n return []\n }\n}\n\n/**\n * Returns a value at a given index depending on if it's an array or number\n */\nexport function getValue(value: any, index: number, defaultValue: any): any {\n if (Array.isArray(value)) {\n const v = value[index]\n return v == null ? defaultValue : v\n }\n\n return value\n}\n\n/**\n * Debounce utility. To avoid bloating bundle size, we're only passing 1\n * argument here, a more generic function would pass all arguments. Only\n * `onMouseMove` uses this which takes the event object for now.\n */\nexport function debounce(\n fn: (arg: T) => void,\n ms: number,\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn\n }\n\n let timeout: any\n\n return (arg): void => {\n clearTimeout(timeout)\n timeout = setTimeout((): void => {\n fn(arg)\n }, ms)\n }\n}\n\n/**\n * Prevents errors from being thrown while accessing nested modifier objects\n * in `popperOptions`\n */\nexport function getModifier(obj: any, key: string): any {\n return obj && obj.modifiers && obj.modifiers[key]\n}\n\n/**\n * Determines if an array or string includes a value\n */\nexport function includes(a: any[] | string, b: any): boolean {\n return a.indexOf(b) > -1\n}\n\n/**\n * Determines if the value is a real element\n */\nexport function isRealElement(value: any): value is Element {\n return value instanceof Element\n}\n\n/**\n * Determines if the value is singular-like\n */\nexport function isSingular(value: any): value is VirtualReference | Element {\n return !!(value && hasOwnProperty(value, 'isVirtual')) || isRealElement(value)\n}\n\n/**\n * Firefox extensions don't allow setting .innerHTML directly, this will trick it\n */\nexport function innerHTML(): 'innerHTML' {\n return 'innerHTML'\n}\n\n/**\n * Evaluates a function if one, or returns the value\n */\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value.apply(null, args) : value\n}\n\n/**\n * Sets a popperInstance `flip` modifier's enabled state\n */\nexport function setFlipModifierEnabled(modifiers: any[], value: any): void {\n modifiers.filter(m => m.name === 'flip')[0].enabled = value\n}\n\n/**\n * Determines if an element can receive focus\n * Always returns true for virtual objects\n */\nexport function canReceiveFocus(element: Element | VirtualReference): boolean {\n return isRealElement(element)\n ? matches.call(\n element,\n 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]',\n ) && !element.hasAttribute('disabled')\n : true\n}\n\n/**\n * Returns a new `div` element\n */\nexport function div(): HTMLDivElement {\n return document.createElement('div')\n}\n\n/**\n * Applies a transition duration to a list of elements\n */\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number,\n): void {\n els.forEach(el => {\n if (el) {\n el.style.transitionDuration = `${value}ms`\n }\n })\n}\n\n/**\n * Sets the visibility state to elements so they can begin to transition\n */\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden',\n): void {\n els.forEach(el => {\n if (el) {\n el.setAttribute('data-state', state)\n }\n })\n}\n\n/**\n * Evaluates the props object by merging data attributes and\n * disabling conflicting options where necessary\n */\nexport function evaluateProps(\n reference: ReferenceElement | VirtualReference,\n props: Props,\n): Props {\n const out = {\n ...props,\n content: invokeWithArgsOrReturn(props.content, [reference]),\n ...(props.ignoreAttributes ? {} : getDataAttributeOptions(reference)),\n }\n\n if (out.arrow || isUCBrowser) {\n out.animateFill = false\n }\n\n return out\n}\n\n/**\n * Validates an object of options with the valid default props object\n */\nexport function validateOptions(options: Options, defaultProps: Props): void {\n Object.keys(options).forEach(option => {\n if (!hasOwnProperty(defaultProps, option)) {\n throw new Error(`[tippy]: \\`${option}\\` is not a valid option`)\n }\n })\n}\n","import {\n PopperElement,\n Props,\n PopperChildren,\n HideAllOptions,\n BasicPlacement,\n} from './types'\nimport { arrayFrom } from './ponyfills'\nimport { innerHTML, div, isReferenceElement, isRealElement } from './utils'\nimport { isUCBrowser } from './browser'\nimport {\n POPPER_CLASS,\n TOOLTIP_CLASS,\n BACKDROP_CLASS,\n CONTENT_CLASS,\n ARROW_CLASS,\n ROUND_ARROW_CLASS,\n POPPER_SELECTOR,\n TOOLTIP_SELECTOR,\n BACKDROP_SELECTOR,\n CONTENT_SELECTOR,\n ARROW_SELECTOR,\n ROUND_ARROW_SELECTOR,\n PLACEMENT_ATTRIBUTE,\n} from './constants'\n\n/**\n * Sets the innerHTML of an element\n */\nexport function setInnerHTML(element: Element, html: string | Element): void {\n element[innerHTML()] = isRealElement(html) ? html[innerHTML()] : html\n}\n\n/**\n * Sets the content of a tooltip\n */\nexport function setContent(\n contentEl: PopperChildren['content'],\n props: Props,\n): void {\n if (isRealElement(props.content)) {\n setInnerHTML(contentEl, '')\n contentEl.appendChild(props.content)\n } else if (typeof props.content !== 'function') {\n const key: 'innerHTML' | 'textContent' = props.allowHTML\n ? 'innerHTML'\n : 'textContent'\n contentEl[key] = props.content\n }\n}\n\n/**\n * Returns the child elements of a popper element\n */\nexport function getChildren(popper: PopperElement): PopperChildren {\n return {\n tooltip: popper.querySelector(TOOLTIP_SELECTOR) as HTMLDivElement,\n backdrop: popper.querySelector(BACKDROP_SELECTOR),\n content: popper.querySelector(CONTENT_SELECTOR) as HTMLDivElement,\n arrow:\n popper.querySelector(ARROW_SELECTOR) ||\n popper.querySelector(ROUND_ARROW_SELECTOR),\n }\n}\n\n/**\n * Adds `data-inertia` attribute\n */\nexport function addInertia(tooltip: PopperChildren['tooltip']): void {\n tooltip.setAttribute('data-inertia', '')\n}\n\n/**\n * Removes `data-inertia` attribute\n */\nexport function removeInertia(tooltip: PopperChildren['tooltip']): void {\n tooltip.removeAttribute('data-inertia')\n}\n\n/**\n * Creates an arrow element and returns it\n */\nexport function createArrowElement(\n arrowType: Props['arrowType'],\n): HTMLDivElement {\n const arrow = div()\n if (arrowType === 'round') {\n arrow.className = ROUND_ARROW_CLASS\n setInnerHTML(\n arrow,\n '',\n )\n } else {\n arrow.className = ARROW_CLASS\n }\n return arrow\n}\n\n/**\n * Creates a backdrop element and returns it\n */\nexport function createBackdropElement(): HTMLDivElement {\n const backdrop = div()\n backdrop.className = BACKDROP_CLASS\n backdrop.setAttribute('data-state', 'hidden')\n return backdrop\n}\n\n/**\n * Adds interactive-related attributes\n */\nexport function addInteractive(\n popper: PopperElement,\n tooltip: PopperChildren['tooltip'],\n): void {\n popper.setAttribute('tabindex', '-1')\n tooltip.setAttribute('data-interactive', '')\n}\n\n/**\n * Removes interactive-related attributes\n */\nexport function removeInteractive(\n popper: PopperElement,\n tooltip: PopperChildren['tooltip'],\n): void {\n popper.removeAttribute('tabindex')\n tooltip.removeAttribute('data-interactive')\n}\n\n/**\n * Add/remove transitionend listener from tooltip\n */\nexport function updateTransitionEndListener(\n tooltip: PopperChildren['tooltip'],\n action: 'add' | 'remove',\n listener: (event: TransitionEvent) => void,\n): void {\n // UC Browser hasn't adopted the `transitionend` event despite supporting\n // unprefixed transitions...\n const eventName =\n isUCBrowser && document.body.style.webkitTransition !== undefined\n ? 'webkitTransitionEnd'\n : 'transitionend'\n tooltip[\n (action + 'EventListener') as 'addEventListener' | 'removeEventListener'\n ](eventName, listener as EventListener)\n}\n\n/**\n * Returns the popper's placement, ignoring shifting (top-start, etc)\n */\nexport function getBasicPlacement(popper: PopperElement): BasicPlacement {\n const fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE)\n return (fullPlacement ? fullPlacement.split('-')[0] : '') as BasicPlacement\n}\n\n/**\n * Triggers reflow\n */\nexport function reflow(popper: PopperElement): void {\n void popper.offsetHeight\n}\n\n/**\n * Adds/removes theme from tooltip's classList\n */\nexport function updateTheme(\n tooltip: PopperChildren['tooltip'],\n action: 'add' | 'remove',\n theme: Props['theme'],\n): void {\n theme.split(' ').forEach(themeName => {\n tooltip.classList[action](themeName + '-theme')\n })\n}\n\n/**\n * Constructs the popper element and returns it\n */\nexport function createPopperElement(id: number, props: Props): PopperElement {\n const popper = div()\n popper.className = POPPER_CLASS\n popper.id = `__NAMESPACE_PREFIX__-${id}`\n popper.style.zIndex = '' + props.zIndex\n popper.style.position = 'absolute'\n popper.style.top = '0'\n popper.style.left = '0'\n\n if (props.role) {\n popper.setAttribute('role', props.role)\n }\n\n const tooltip = div()\n tooltip.className = TOOLTIP_CLASS\n tooltip.style.maxWidth =\n props.maxWidth + (typeof props.maxWidth === 'number' ? 'px' : '')\n tooltip.setAttribute('data-size', props.size)\n tooltip.setAttribute('data-animation', props.animation)\n tooltip.setAttribute('data-state', 'hidden')\n updateTheme(tooltip, 'add', props.theme)\n\n const content = div()\n content.className = CONTENT_CLASS\n content.setAttribute('data-state', 'hidden')\n\n if (props.interactive) {\n addInteractive(popper, tooltip)\n }\n\n if (props.arrow) {\n tooltip.appendChild(createArrowElement(props.arrowType))\n }\n\n if (props.animateFill) {\n tooltip.appendChild(createBackdropElement())\n tooltip.setAttribute('data-animatefill', '')\n }\n\n if (props.inertia) {\n addInertia(tooltip)\n }\n\n setContent(content, props)\n\n tooltip.appendChild(content)\n popper.appendChild(tooltip)\n\n return popper\n}\n\n/**\n * Updates the popper element based on the new props\n */\nexport function updatePopperElement(\n popper: PopperElement,\n prevProps: Props,\n nextProps: Props,\n): void {\n const { tooltip, content, backdrop, arrow } = getChildren(popper)\n\n popper.style.zIndex = '' + nextProps.zIndex\n tooltip.setAttribute('data-size', nextProps.size)\n tooltip.setAttribute('data-animation', nextProps.animation)\n tooltip.style.maxWidth =\n nextProps.maxWidth + (typeof nextProps.maxWidth === 'number' ? 'px' : '')\n\n if (nextProps.role) {\n popper.setAttribute('role', nextProps.role)\n } else {\n popper.removeAttribute('role')\n }\n\n if (prevProps.content !== nextProps.content) {\n setContent(content, nextProps)\n }\n\n // animateFill\n if (!prevProps.animateFill && nextProps.animateFill) {\n tooltip.appendChild(createBackdropElement())\n tooltip.setAttribute('data-animatefill', '')\n } else if (prevProps.animateFill && !nextProps.animateFill) {\n tooltip.removeChild(backdrop!)\n tooltip.removeAttribute('data-animatefill')\n }\n\n // arrow\n if (!prevProps.arrow && nextProps.arrow) {\n tooltip.appendChild(createArrowElement(nextProps.arrowType))\n } else if (prevProps.arrow && !nextProps.arrow) {\n tooltip.removeChild(arrow!)\n }\n\n // arrowType\n if (\n prevProps.arrow &&\n nextProps.arrow &&\n prevProps.arrowType !== nextProps.arrowType\n ) {\n tooltip.replaceChild(createArrowElement(nextProps.arrowType), arrow!)\n }\n\n // interactive\n if (!prevProps.interactive && nextProps.interactive) {\n addInteractive(popper, tooltip)\n } else if (prevProps.interactive && !nextProps.interactive) {\n removeInteractive(popper, tooltip)\n }\n\n // inertia\n if (!prevProps.inertia && nextProps.inertia) {\n addInertia(tooltip)\n } else if (prevProps.inertia && !nextProps.inertia) {\n removeInertia(tooltip)\n }\n\n // theme\n if (prevProps.theme !== nextProps.theme) {\n updateTheme(tooltip, 'remove', prevProps.theme)\n updateTheme(tooltip, 'add', nextProps.theme)\n }\n}\n\n/**\n * Hides all visible poppers on the document\n */\nexport function hideAll({\n exclude: excludedReferenceOrInstance,\n duration,\n}: HideAllOptions = {}): void {\n arrayFrom(document.querySelectorAll(POPPER_SELECTOR)).forEach(\n (popper: PopperElement) => {\n const instance = popper._tippy\n\n if (instance) {\n let isExcluded = false\n if (excludedReferenceOrInstance) {\n isExcluded = isReferenceElement(excludedReferenceOrInstance)\n ? instance.reference === excludedReferenceOrInstance\n : popper === excludedReferenceOrInstance.popper\n }\n\n if (!isExcluded) {\n instance.hide(duration)\n }\n }\n },\n )\n}\n\n/**\n * Determines if the mouse cursor is outside of the popper's interactive border\n * region\n */\nexport function isCursorOutsideInteractiveBorder(\n popperPlacement: BasicPlacement,\n popperRect: ClientRect,\n event: MouseEvent,\n props: Props,\n): boolean {\n if (!popperPlacement) {\n return true\n }\n\n const { clientX: x, clientY: y } = event\n const { interactiveBorder, distance } = props\n\n const exceedsTop =\n popperRect.top - y >\n (popperPlacement === 'top'\n ? interactiveBorder + distance\n : interactiveBorder)\n\n const exceedsBottom =\n y - popperRect.bottom >\n (popperPlacement === 'bottom'\n ? interactiveBorder + distance\n : interactiveBorder)\n\n const exceedsLeft =\n popperRect.left - x >\n (popperPlacement === 'left'\n ? interactiveBorder + distance\n : interactiveBorder)\n\n const exceedsRight =\n x - popperRect.right >\n (popperPlacement === 'right'\n ? interactiveBorder + distance\n : interactiveBorder)\n\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight\n}\n\n/**\n * Returns the distance offset, taking into account the default offset due to\n * the transform: translate() rule (10px) in CSS\n */\nexport function getOffsetDistanceInPx(distance: number): string {\n return -(distance - 10) + 'px'\n}\n","import Popper from 'popper.js'\nimport {\n ReferenceElement,\n PopperInstance,\n Props,\n Options,\n Instance,\n Content,\n Listener,\n VirtualReference,\n} from './types'\nimport { isIE } from './browser'\nimport { closest, closestCallback, arrayFrom } from './ponyfills'\nimport {\n PASSIVE,\n PADDING,\n PLACEMENT_ATTRIBUTE,\n OUT_OF_BOUNDARIES_ATTRIBUTE,\n ACTIVE_CLASS,\n POPPER_SELECTOR,\n} from './constants'\nimport { isUsingTouch } from './bindGlobalEventListeners'\nimport { defaultProps, POPPER_INSTANCE_DEPENDENCIES } from './props'\nimport {\n createPopperElement,\n updatePopperElement,\n getChildren,\n getBasicPlacement,\n updateTransitionEndListener,\n isCursorOutsideInteractiveBorder,\n getOffsetDistanceInPx,\n reflow,\n} from './popper'\nimport {\n hasOwnProperty,\n debounce,\n getValue,\n getModifier,\n includes,\n invokeWithArgsOrReturn,\n setFlipModifierEnabled,\n canReceiveFocus,\n validateOptions,\n evaluateProps,\n setTransitionDuration,\n setVisibilityState,\n isRealElement,\n} from './utils'\n\nlet idCounter = 1\n// Workaround for IE11's lack of new MouseEvent constructor\nlet mouseMoveListeners: ((event: MouseEvent) => void)[] = []\n\n/**\n * Creates and returns a Tippy object. We're using a closure pattern instead of\n * a class so that the exposed object API is clean without private members\n * prefixed with `_`.\n */\nexport default function createTippy(\n reference: ReferenceElement | VirtualReference,\n collectionProps: Props,\n): Instance | null {\n const props = evaluateProps(reference, collectionProps)\n\n // If the reference shouldn't have multiple tippys, return null early\n if (!props.multiple && reference._tippy) {\n return null\n }\n\n /* ======================= 🔒 Private members 🔒 ======================= */\n let lastTriggerEventType: string\n let lastMouseMoveEvent: MouseEvent\n let showTimeoutId: number\n let hideTimeoutId: number\n let scheduleHideAnimationFrameId: number\n let isScheduledToShow = false\n let isBeingDestroyed = false\n let previousPlacement: string\n let wasVisibleDuringPreviousUpdate = false\n let hasMountCallbackRun = false\n let currentMountCallback: () => void\n let currentTransitionEndListener: (event: TransitionEvent) => void\n let listeners: Listener[] = []\n let currentComputedPadding: {\n top: number\n bottom: number\n left: number\n right: number\n [key: string]: number\n }\n let debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce)\n\n /* ======================= 🔑 Public members 🔑 ======================= */\n const id = idCounter++\n const popper = createPopperElement(id, props)\n const popperChildren = getChildren(popper)\n const popperInstance: PopperInstance | null = null\n\n const state = {\n // Is the instance currently enabled?\n isEnabled: true,\n // Is the tippy currently showing and not transitioning out?\n isVisible: false,\n // Has the instance been destroyed?\n isDestroyed: false,\n // Is the tippy currently mounted to the DOM?\n isMounted: false,\n // Has the tippy finished transitioning in?\n isShown: false,\n }\n\n const instance: Instance = {\n // properties\n id,\n reference,\n popper,\n popperChildren,\n popperInstance,\n props,\n state,\n // methods\n clearDelayTimeouts,\n set,\n setContent,\n show,\n hide,\n enable,\n disable,\n destroy,\n }\n\n /* ==================== Initial instance mutations =================== */\n reference._tippy = instance\n popper._tippy = instance\n\n addTriggersToReference()\n\n if (!props.lazy) {\n createPopperInstance()\n }\n\n if (props.showOnInit) {\n scheduleShow()\n }\n\n // Ensure the event listeners target can receive focus\n if (\n props.a11y &&\n !props.target &&\n !canReceiveFocus(getEventListenersTarget())\n ) {\n getEventListenersTarget().setAttribute('tabindex', '0')\n }\n\n // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n popper.addEventListener('mouseenter', (event: MouseEvent) => {\n if (\n instance.props.interactive &&\n instance.state.isVisible &&\n lastTriggerEventType === 'mouseenter'\n ) {\n // We don't want props.onTrigger() to be called here, since the `event`\n // object is not related to the reference element\n scheduleShow(event, true)\n }\n })\n popper.addEventListener('mouseleave', () => {\n if (instance.props.interactive && lastTriggerEventType === 'mouseenter') {\n document.addEventListener('mousemove', debouncedOnMouseMove)\n }\n })\n\n return instance\n\n /* ======================= 🔒 Private methods 🔒 ======================= */\n /**\n * Removes the follow cursor listener\n */\n function removeFollowCursorListener(): void {\n document.removeEventListener(\n 'mousemove',\n positionVirtualReferenceNearCursor,\n )\n }\n\n /**\n * Cleans up interactive mouse listeners\n */\n function cleanupInteractiveMouseListeners(): void {\n document.body.removeEventListener('mouseleave', scheduleHide)\n document.removeEventListener('mousemove', debouncedOnMouseMove)\n mouseMoveListeners = mouseMoveListeners.filter(\n (listener): boolean => listener !== debouncedOnMouseMove,\n )\n }\n\n /**\n * Returns correct target used for event listeners\n */\n function getEventListenersTarget(): ReferenceElement | VirtualReference {\n return instance.props.triggerTarget || reference\n }\n\n /**\n * Adds the document click event listener for the instance\n */\n function addDocumentClickListener(): void {\n document.addEventListener('click', onDocumentClick, true)\n }\n\n /**\n * Removes the document click event listener for the instance\n */\n function removeDocumentClickListener(): void {\n document.removeEventListener('click', onDocumentClick, true)\n }\n\n /**\n * Returns transitionable inner elements used in show/hide methods\n */\n function getTransitionableElements(): (HTMLDivElement | null)[] {\n return [\n instance.popperChildren.tooltip,\n instance.popperChildren.backdrop,\n instance.popperChildren.content,\n ]\n }\n\n /**\n * Determines if the instance is in `followCursor` mode.\n * NOTE: in v5, touch devices will use `initial` behavior no matter the value.\n */\n function getIsInLooseFollowCursorMode(): boolean {\n const { followCursor } = instance.props\n return (\n (followCursor && lastTriggerEventType !== 'focus') ||\n (isUsingTouch && followCursor === 'initial')\n )\n }\n\n /**\n * Updates the tooltip's position on each animation frame\n */\n function makeSticky(): void {\n setTransitionDuration([popper], isIE ? 0 : instance.props.updateDuration)\n\n let prevRefRect = reference.getBoundingClientRect()\n\n function updatePosition(): void {\n const currentRefRect = reference.getBoundingClientRect()\n\n // Only schedule an update if the reference rect has changed\n if (\n prevRefRect.top !== currentRefRect.top ||\n prevRefRect.right !== currentRefRect.right ||\n prevRefRect.bottom !== currentRefRect.bottom ||\n prevRefRect.left !== currentRefRect.left\n ) {\n instance.popperInstance!.scheduleUpdate()\n }\n\n prevRefRect = currentRefRect\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition)\n }\n }\n\n updatePosition()\n }\n\n /**\n * Invokes a callback once the tooltip has fully transitioned out\n */\n function onTransitionedOut(duration: number, callback: () => void): void {\n onTransitionEnd(duration, () => {\n if (\n !instance.state.isVisible &&\n popper.parentNode &&\n popper.parentNode.contains(popper)\n ) {\n callback()\n }\n })\n }\n\n /**\n * Invokes a callback once the tooltip has fully transitioned in\n */\n function onTransitionedIn(duration: number, callback: () => void): void {\n onTransitionEnd(duration, callback)\n }\n\n /**\n * Invokes a callback once the tooltip's CSS transition ends\n */\n function onTransitionEnd(duration: number, callback: () => void): void {\n const { tooltip } = instance.popperChildren\n\n /**\n * Listener added as the `transitionend` handler\n */\n function listener(event: TransitionEvent): void {\n if (event.target === tooltip) {\n updateTransitionEndListener(tooltip, 'remove', listener)\n callback()\n }\n }\n\n // Make callback synchronous if duration is 0\n // `transitionend` won't fire otherwise\n if (duration === 0) {\n return callback()\n }\n\n updateTransitionEndListener(tooltip, 'remove', currentTransitionEndListener)\n updateTransitionEndListener(tooltip, 'add', listener)\n\n currentTransitionEndListener = listener\n }\n\n /**\n * Adds an event listener to the reference and stores it in `listeners`\n */\n function on(\n eventType: string,\n handler: EventListener,\n options: boolean | object = false,\n ): void {\n getEventListenersTarget().addEventListener(eventType, handler, options)\n listeners.push({ eventType, handler, options })\n }\n\n /**\n * Adds event listeners to the reference based on the `trigger` prop\n */\n function addTriggersToReference(): void {\n if (instance.props.touchHold && !instance.props.target) {\n on('touchstart', onTrigger, PASSIVE)\n on('touchend', onMouseLeave as EventListener, PASSIVE)\n }\n\n instance.props.trigger\n .trim()\n .split(' ')\n .forEach(eventType => {\n if (eventType === 'manual') {\n return\n }\n\n // Non-delegates\n if (!instance.props.target) {\n on(eventType, onTrigger)\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave as EventListener)\n break\n case 'focus':\n on(isIE ? 'focusout' : 'blur', onBlur as EventListener)\n break\n }\n } else {\n // Delegates\n switch (eventType) {\n case 'mouseenter':\n on('mouseover', onDelegateShow)\n on('mouseout', onDelegateHide)\n break\n case 'focus':\n on('focusin', onDelegateShow)\n on('focusout', onDelegateHide)\n break\n case 'click':\n on(eventType, onDelegateShow)\n break\n }\n }\n })\n }\n\n /**\n * Removes event listeners from the reference\n */\n function removeTriggersFromReference(): void {\n listeners.forEach(({ eventType, handler, options }: Listener) => {\n getEventListenersTarget().removeEventListener(eventType, handler, options)\n })\n listeners = []\n }\n\n /**\n * Positions the virtual reference near the cursor\n */\n function positionVirtualReferenceNearCursor(event: MouseEvent): void {\n const { clientX: x, clientY: y } = (lastMouseMoveEvent = event)\n\n // Gets set once popperInstance `onCreate` has been called\n if (!currentComputedPadding) {\n return\n }\n\n // If the instance is interactive, avoid updating the position unless it's\n // over the reference element\n const isCursorOverReference = closestCallback(\n event.target as Element,\n (el: Element): boolean => el === reference,\n )\n\n const rect = reference.getBoundingClientRect()\n const { followCursor } = instance.props\n const isHorizontal = followCursor === 'horizontal'\n const isVertical = followCursor === 'vertical'\n\n // The virtual reference needs some size to prevent itself from overflowing\n const isVerticalPlacement = includes(\n ['top', 'bottom'],\n getBasicPlacement(popper),\n )\n const fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE)\n const isVariation = fullPlacement ? !!fullPlacement.split('-')[1] : false\n const size = isVerticalPlacement ? popper.offsetWidth : popper.offsetHeight\n const halfSize = size / 2\n const verticalIncrease = isVerticalPlacement\n ? 0\n : isVariation\n ? size\n : halfSize\n const horizontalIncrease = isVerticalPlacement\n ? isVariation\n ? size\n : halfSize\n : 0\n\n if (isCursorOverReference || !instance.props.interactive) {\n instance.popperInstance!.reference = {\n ...instance.popperInstance!.reference,\n // This will exist in next Popper.js feature release to fix #532\n // @ts-ignore\n referenceNode: reference,\n // These `client` values don't get used by Popper.js if they are 0\n clientWidth: 0,\n clientHeight: 0,\n getBoundingClientRect: (): DOMRect | ClientRect => ({\n width: isVerticalPlacement ? size : 0,\n height: isVerticalPlacement ? 0 : size,\n top: (isHorizontal ? rect.top : y) - verticalIncrease,\n bottom: (isHorizontal ? rect.bottom : y) + verticalIncrease,\n left: (isVertical ? rect.left : x) - horizontalIncrease,\n right: (isVertical ? rect.right : x) + horizontalIncrease,\n }),\n }\n\n instance.popperInstance!.update()\n }\n\n if (followCursor === 'initial' && instance.state.isVisible) {\n removeFollowCursorListener()\n }\n }\n\n /**\n * Creates the tippy instance for a delegate when it's been triggered\n */\n function createDelegateChildTippy(event?: Event): void {\n if (event) {\n const targetEl: ReferenceElement | null = closest(\n event.target as Element,\n instance.props.target,\n )\n\n if (targetEl && !targetEl._tippy) {\n createTippy(targetEl, {\n ...instance.props,\n content: invokeWithArgsOrReturn(collectionProps.content, [targetEl]),\n appendTo: collectionProps.appendTo,\n target: '',\n showOnInit: true,\n })\n }\n }\n }\n\n /**\n * Event listener invoked upon trigger\n */\n function onTrigger(event: Event): void {\n if (!instance.state.isEnabled || isEventListenerStopped(event)) {\n return\n }\n\n if (!instance.state.isVisible) {\n lastTriggerEventType = event.type\n\n if (event instanceof MouseEvent) {\n lastMouseMoveEvent = event\n\n // If scrolling, `mouseenter` events can be fired if the cursor lands\n // over a new target, but `mousemove` events don't get fired. This\n // causes interactive tooltips to get stuck open until the cursor is\n // moved\n mouseMoveListeners.forEach((listener): void => listener(event))\n }\n }\n\n // Toggle show/hide when clicking click-triggered tooltips\n if (\n event.type === 'click' &&\n instance.props.hideOnClick !== false &&\n instance.state.isVisible\n ) {\n scheduleHide()\n } else {\n scheduleShow(event)\n }\n }\n\n /**\n * Event listener used for interactive tooltips to detect when they should\n * hide\n */\n function onMouseMove(event: MouseEvent): void {\n const isCursorOverPopper =\n closest(event.target as Element, POPPER_SELECTOR) === popper\n const isCursorOverReference = closestCallback(\n event.target as Element,\n (el: Element) => el === reference,\n )\n\n if (isCursorOverPopper || isCursorOverReference) {\n return\n }\n\n if (\n isCursorOutsideInteractiveBorder(\n getBasicPlacement(popper),\n popper.getBoundingClientRect(),\n event,\n instance.props,\n )\n ) {\n cleanupInteractiveMouseListeners()\n scheduleHide()\n }\n }\n\n /**\n * Event listener invoked upon mouseleave\n */\n function onMouseLeave(event: MouseEvent): void {\n if (isEventListenerStopped(event)) {\n return\n }\n\n if (instance.props.interactive) {\n document.body.addEventListener('mouseleave', scheduleHide)\n document.addEventListener('mousemove', debouncedOnMouseMove)\n mouseMoveListeners.push(debouncedOnMouseMove)\n\n return\n }\n\n scheduleHide()\n }\n\n /**\n * Event listener invoked upon blur\n */\n function onBlur(event: FocusEvent): void {\n if (event.target !== getEventListenersTarget()) {\n return\n }\n\n if (\n instance.props.interactive &&\n event.relatedTarget &&\n popper.contains(event.relatedTarget as Element)\n ) {\n return\n }\n\n scheduleHide()\n }\n\n /**\n * Event listener invoked when a child target is triggered\n */\n function onDelegateShow(event: Event): void {\n if (closest(event.target as Element, instance.props.target)) {\n scheduleShow(event)\n }\n }\n\n /**\n * Event listener invoked when a child target should hide\n */\n function onDelegateHide(event: Event): void {\n if (closest(event.target as Element, instance.props.target)) {\n scheduleHide()\n }\n }\n\n /**\n * Determines if an event listener should stop further execution due to the\n * `touchHold` option\n */\n function isEventListenerStopped(event: Event): boolean {\n const supportsTouch = 'ontouchstart' in window\n const isTouchEvent = includes(event.type, 'touch')\n const { touchHold } = instance.props\n\n return (\n (supportsTouch && isUsingTouch && touchHold && !isTouchEvent) ||\n (isUsingTouch && !touchHold && isTouchEvent)\n )\n }\n\n /**\n * Runs the mount callback\n */\n function runMountCallback(): void {\n if (!hasMountCallbackRun && currentMountCallback) {\n hasMountCallbackRun = true\n reflow(popper)\n currentMountCallback()\n }\n }\n\n /**\n * Creates the popper instance for the instance\n */\n function createPopperInstance(): void {\n const { popperOptions } = instance.props\n const { tooltip, arrow } = instance.popperChildren\n const preventOverflowModifier = getModifier(\n popperOptions,\n 'preventOverflow',\n )\n\n function applyMutations(data: Popper.Data): void {\n if (instance.props.flip && !instance.props.flipOnUpdate) {\n if (data.flipped) {\n instance.popperInstance!.options.placement = data.placement\n }\n\n setFlipModifierEnabled(instance.popperInstance!.modifiers, false)\n }\n\n // Apply all of the popper's attributes to the tootip node as well.\n // Allows users to avoid using the .tippy-popper selector for themes.\n tooltip.setAttribute(PLACEMENT_ATTRIBUTE, data.placement)\n\n if (data.attributes[OUT_OF_BOUNDARIES_ATTRIBUTE] !== false) {\n tooltip.setAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE, '')\n } else {\n tooltip.removeAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE)\n }\n\n // Prevents a transition when changing placements (while tippy is visible)\n // for scroll/resize updates\n if (\n previousPlacement &&\n previousPlacement !== data.placement &&\n wasVisibleDuringPreviousUpdate\n ) {\n tooltip.style.transition = 'none'\n requestAnimationFrame(() => {\n tooltip.style.transition = ''\n })\n }\n previousPlacement = data.placement\n wasVisibleDuringPreviousUpdate = instance.state.isVisible\n\n const basicPlacement = getBasicPlacement(popper)\n const styles = tooltip.style\n\n // Account for the `distance` offset\n styles.top = styles.bottom = styles.left = styles.right = ''\n styles[basicPlacement] = getOffsetDistanceInPx(instance.props.distance)\n\n const padding =\n preventOverflowModifier && preventOverflowModifier.padding !== undefined\n ? preventOverflowModifier.padding\n : PADDING\n const isPaddingNumber = typeof padding === 'number'\n\n const computedPadding = {\n top: isPaddingNumber ? padding : padding.top,\n bottom: isPaddingNumber ? padding : padding.bottom,\n left: isPaddingNumber ? padding : padding.left,\n right: isPaddingNumber ? padding : padding.right,\n ...(!isPaddingNumber && padding),\n }\n\n computedPadding[basicPlacement] = isPaddingNumber\n ? padding + instance.props.distance\n : (padding[basicPlacement] || 0) + instance.props.distance\n\n instance.popperInstance!.modifiers.filter(\n m => m.name === 'preventOverflow',\n )[0].padding = computedPadding\n\n currentComputedPadding = computedPadding\n }\n\n const config = {\n eventsEnabled: false,\n placement: instance.props.placement,\n ...popperOptions,\n modifiers: {\n ...(popperOptions ? popperOptions.modifiers : {}),\n preventOverflow: {\n boundariesElement: instance.props.boundary,\n padding: PADDING,\n ...preventOverflowModifier,\n },\n arrow: {\n element: arrow,\n enabled: !!arrow,\n ...getModifier(popperOptions, 'arrow'),\n },\n flip: {\n enabled: instance.props.flip,\n // The tooltip is offset by 10px from the popper in CSS,\n // we need to account for its distance\n padding: instance.props.distance + PADDING,\n behavior: instance.props.flipBehavior,\n ...getModifier(popperOptions, 'flip'),\n },\n offset: {\n offset: instance.props.offset,\n ...getModifier(popperOptions, 'offset'),\n },\n },\n onCreate(data: Popper.Data) {\n applyMutations(data)\n runMountCallback()\n\n if (popperOptions && popperOptions.onCreate) {\n popperOptions.onCreate(data)\n }\n },\n onUpdate(data: Popper.Data) {\n applyMutations(data)\n runMountCallback()\n\n if (popperOptions && popperOptions.onUpdate) {\n popperOptions.onUpdate(data)\n }\n },\n }\n\n instance.popperInstance = new Popper(\n reference,\n popper,\n config,\n ) as PopperInstance\n }\n\n /**\n * Mounts the tooltip to the DOM\n */\n function mount(): void {\n hasMountCallbackRun = false\n\n const isInLooseFollowCursorMode = getIsInLooseFollowCursorMode()\n\n if (instance.popperInstance) {\n setFlipModifierEnabled(\n instance.popperInstance.modifiers,\n instance.props.flip,\n )\n\n if (!isInLooseFollowCursorMode) {\n instance.popperInstance.reference = reference\n instance.popperInstance.enableEventListeners()\n }\n\n instance.popperInstance.scheduleUpdate()\n } else {\n createPopperInstance()\n\n if (!isInLooseFollowCursorMode) {\n instance.popperInstance!.enableEventListeners()\n }\n }\n\n const { appendTo } = instance.props\n const parentNode =\n appendTo === 'parent'\n ? reference.parentNode\n : invokeWithArgsOrReturn(appendTo, [reference])\n\n if (!parentNode.contains(popper)) {\n parentNode.appendChild(popper)\n instance.props.onMount(instance)\n instance.state.isMounted = true\n }\n }\n\n /**\n * Setup before show() is invoked (delays, etc.)\n */\n function scheduleShow(\n event?: Event,\n shouldAvoidCallingOnTrigger?: boolean,\n ): void {\n clearDelayTimeouts()\n\n if (instance.state.isVisible) {\n return\n }\n\n // Is a delegate, create an instance for the child target\n if (instance.props.target) {\n return createDelegateChildTippy(event)\n }\n\n isScheduledToShow = true\n\n if (event && !shouldAvoidCallingOnTrigger) {\n instance.props.onTrigger(instance, event)\n }\n\n if (instance.props.wait) {\n return instance.props.wait(instance, event)\n }\n\n // If the tooltip has a delay, we need to be listening to the mousemove as\n // soon as the trigger event is fired, so that it's in the correct position\n // upon mount.\n // Edge case: if the tooltip is still mounted, but then scheduleShow() is\n // called, it causes a jump.\n if (getIsInLooseFollowCursorMode() && !instance.state.isMounted) {\n if (!instance.popperInstance) {\n createPopperInstance()\n }\n\n document.addEventListener('mousemove', positionVirtualReferenceNearCursor)\n }\n\n addDocumentClickListener()\n\n const delay = getValue(instance.props.delay, 0, defaultProps.delay)\n\n if (delay) {\n showTimeoutId = setTimeout(() => {\n show()\n }, delay)\n } else {\n show()\n }\n }\n\n /**\n * Setup before hide() is invoked (delays, etc.)\n */\n function scheduleHide(): void {\n clearDelayTimeouts()\n\n if (!instance.state.isVisible) {\n removeFollowCursorListener()\n removeDocumentClickListener()\n return\n }\n\n isScheduledToShow = false\n\n const delay = getValue(instance.props.delay, 1, defaultProps.delay)\n\n if (delay) {\n hideTimeoutId = setTimeout(() => {\n if (instance.state.isVisible) {\n hide()\n }\n }, delay)\n } else {\n // Fixes a `transitionend` problem when it fires 1 frame too\n // late sometimes, we don't want hide() to be called.\n scheduleHideAnimationFrameId = requestAnimationFrame(() => {\n hide()\n })\n }\n }\n\n /**\n * Listener to handle clicks on the document to determine if the\n * instance should hide\n */\n function onDocumentClick(event: MouseEvent): void {\n // Clicked on interactive popper\n if (\n instance.props.interactive &&\n popper.contains(event.target as Element)\n ) {\n return\n }\n\n // Clicked on the event listeners target\n if (getEventListenersTarget().contains(event.target as Element)) {\n if (isUsingTouch) {\n return\n }\n\n if (\n instance.state.isVisible &&\n includes(instance.props.trigger, 'click')\n ) {\n return\n }\n }\n\n if (instance.props.hideOnClick === true) {\n clearDelayTimeouts()\n hide()\n }\n }\n\n /* ======================= 🔑 Public methods 🔑 ======================= */\n /**\n * Enables the instance to allow it to show or hide\n */\n function enable(): void {\n instance.state.isEnabled = true\n }\n\n /**\n * Disables the instance to disallow it to show or hide\n */\n function disable(): void {\n instance.state.isEnabled = false\n }\n\n /**\n * Clears pending timeouts related to the `delay` prop if any\n */\n function clearDelayTimeouts(): void {\n clearTimeout(showTimeoutId)\n clearTimeout(hideTimeoutId)\n cancelAnimationFrame(scheduleHideAnimationFrameId)\n }\n\n /**\n * Sets new props for the instance and redraws the tooltip\n */\n function set(options: Options): void {\n // Backwards-compatible after TypeScript change\n options = options || {}\n\n validateOptions(options, defaultProps)\n\n removeTriggersFromReference()\n\n const prevProps = instance.props\n const nextProps = evaluateProps(reference, {\n ...instance.props,\n ...options,\n ignoreAttributes: true,\n })\n nextProps.ignoreAttributes = hasOwnProperty(options, 'ignoreAttributes')\n ? options.ignoreAttributes || false\n : prevProps.ignoreAttributes\n instance.props = nextProps\n\n addTriggersToReference()\n\n cleanupInteractiveMouseListeners()\n debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce)\n\n updatePopperElement(popper, prevProps, nextProps)\n instance.popperChildren = getChildren(popper)\n\n if (instance.popperInstance) {\n if (\n POPPER_INSTANCE_DEPENDENCIES.some(prop => {\n return (\n hasOwnProperty(options, prop) && options[prop] !== prevProps[prop]\n )\n })\n ) {\n instance.popperInstance.destroy()\n createPopperInstance()\n\n if (instance.state.isVisible) {\n instance.popperInstance.enableEventListeners()\n }\n\n if (instance.props.followCursor && lastMouseMoveEvent) {\n positionVirtualReferenceNearCursor(lastMouseMoveEvent)\n }\n } else {\n instance.popperInstance.update()\n }\n }\n }\n\n /**\n * Shortcut for .set({ content: newContent })\n */\n function setContent(content: Content): void {\n set({ content })\n }\n\n /**\n * Shows the tooltip\n */\n function show(\n duration: number = getValue(\n instance.props.duration,\n 0,\n (defaultProps.duration as [number, number])[1],\n ),\n ): void {\n if (\n instance.state.isDestroyed ||\n !instance.state.isEnabled ||\n (isUsingTouch && !instance.props.touch)\n ) {\n return\n }\n\n // Standardize `disabled` behavior across browsers.\n // Firefox allows events on disabled elements, but Chrome doesn't.\n // Using a wrapper element (i.e. ) is recommended.\n if (getEventListenersTarget().hasAttribute('disabled')) {\n return\n }\n\n if (instance.props.onShow(instance) === false) {\n return\n }\n\n addDocumentClickListener()\n\n popper.style.visibility = 'visible'\n instance.state.isVisible = true\n\n if (instance.props.interactive) {\n getEventListenersTarget().classList.add(ACTIVE_CLASS)\n }\n\n // Prevent a transition if the popper is at the opposite placement\n const transitionableElements = getTransitionableElements()\n setTransitionDuration(transitionableElements.concat(popper), 0)\n\n currentMountCallback = (): void => {\n if (!instance.state.isVisible) {\n return\n }\n\n const isInLooseFollowCursorMode = getIsInLooseFollowCursorMode()\n\n if (isInLooseFollowCursorMode && lastMouseMoveEvent) {\n positionVirtualReferenceNearCursor(lastMouseMoveEvent)\n } else if (!isInLooseFollowCursorMode) {\n // Double update will apply correct mutations\n instance.popperInstance!.update()\n }\n\n if (instance.popperChildren.backdrop) {\n instance.popperChildren.content.style.transitionDelay =\n Math.round(duration / 12) + 'ms'\n }\n\n if (instance.props.sticky) {\n makeSticky()\n }\n\n setTransitionDuration([popper], instance.props.updateDuration)\n setTransitionDuration(transitionableElements, duration)\n setVisibilityState(transitionableElements, 'visible')\n\n onTransitionedIn(\n duration,\n (): void => {\n if (instance.props.aria) {\n getEventListenersTarget().setAttribute(\n `aria-${instance.props.aria}`,\n popper.id,\n )\n }\n\n instance.props.onShown(instance)\n instance.state.isShown = true\n },\n )\n }\n\n mount()\n }\n\n /**\n * Hides the tooltip\n */\n function hide(\n duration: number = getValue(\n instance.props.duration,\n 1,\n (defaultProps.duration as [number, number])[1],\n ),\n ): void {\n if (\n instance.state.isDestroyed ||\n (!instance.state.isEnabled && !isBeingDestroyed)\n ) {\n return\n }\n\n if (instance.props.onHide(instance) === false && !isBeingDestroyed) {\n return\n }\n\n removeDocumentClickListener()\n\n popper.style.visibility = 'hidden'\n instance.state.isVisible = false\n instance.state.isShown = false\n wasVisibleDuringPreviousUpdate = false\n\n if (instance.props.interactive) {\n getEventListenersTarget().classList.remove(ACTIVE_CLASS)\n }\n\n const transitionableElements = getTransitionableElements()\n setTransitionDuration(transitionableElements, duration)\n setVisibilityState(transitionableElements, 'hidden')\n\n onTransitionedOut(duration, () => {\n if (!isScheduledToShow) {\n removeFollowCursorListener()\n }\n\n if (instance.props.aria) {\n getEventListenersTarget().removeAttribute(`aria-${instance.props.aria}`)\n }\n\n instance.popperInstance!.disableEventListeners()\n instance.popperInstance!.options.placement = instance.props.placement\n\n popper.parentNode!.removeChild(popper)\n instance.props.onHidden(instance)\n instance.state.isMounted = false\n })\n }\n\n /**\n * Destroys the tooltip\n */\n function destroy(destroyTargetInstances?: boolean): void {\n if (instance.state.isDestroyed) {\n return\n }\n\n isBeingDestroyed = true\n\n // If the popper is currently mounted to the DOM, we want to ensure it gets\n // hidden and unmounted instantly upon destruction\n if (instance.state.isMounted) {\n hide(0)\n }\n\n removeTriggersFromReference()\n\n delete reference._tippy\n\n const { target } = instance.props\n if (target && destroyTargetInstances && isRealElement(reference)) {\n arrayFrom(reference.querySelectorAll(target)).forEach(\n (child: ReferenceElement) => {\n if (child._tippy) {\n child._tippy.destroy()\n }\n },\n )\n }\n\n if (instance.popperInstance) {\n instance.popperInstance.destroy()\n }\n\n isBeingDestroyed = false\n instance.state.isDestroyed = true\n }\n}\n","import { version } from '../package.json'\nimport { isBrowser } from './browser'\nimport { defaultProps } from './props'\nimport createTippy from './createTippy'\nimport bindGlobalEventListeners from './bindGlobalEventListeners'\nimport group from './group'\nimport { polyfillElementPrototypeProperties } from './reference'\nimport { arrayFrom } from './ponyfills'\nimport { hideAll } from './popper'\nimport {\n isSingular,\n isBareVirtualElement,\n getArrayOfElements,\n validateOptions,\n} from './utils'\nimport { Options, Props, Instance, Targets, VirtualReference } from './types'\n\nlet globalEventListenersBound = false\n\n/**\n * Exported module\n */\nfunction tippy(targets: Targets, options?: Options): Instance | Instance[] {\n validateOptions(options || {}, defaultProps)\n\n if (!globalEventListenersBound) {\n bindGlobalEventListeners()\n globalEventListenersBound = true\n }\n\n const props: Props = { ...defaultProps, ...options }\n\n // If they are specifying a virtual positioning reference, we need to polyfill\n // some native DOM props\n if (isBareVirtualElement(targets)) {\n polyfillElementPrototypeProperties(targets as VirtualReference)\n }\n\n const instances = getArrayOfElements(targets).reduce(\n (acc, reference) => {\n const instance = reference && createTippy(reference, props)\n\n if (instance) {\n acc.push(instance)\n }\n\n return acc\n },\n [],\n )\n\n return isSingular(targets) ? instances[0] : instances\n}\n\n/**\n * Static props\n */\ntippy.version = version\ntippy.defaults = defaultProps\n\n/**\n * Static methods\n */\ntippy.setDefaults = (partialDefaults: Options) => {\n Object.keys(partialDefaults).forEach(key => {\n // @ts-ignore\n defaultProps[key] = partialDefaults[key]\n })\n}\ntippy.hideAll = hideAll\ntippy.group = group\n\n/**\n * Auto-init tooltips for elements with a `data-tippy=\"...\"` attribute\n */\nexport function autoInit(): void {\n arrayFrom(document.querySelectorAll('[data-tippy]')).forEach(el => {\n const content = el.getAttribute('data-tippy')\n\n if (content) {\n tippy(el, { content })\n }\n })\n}\n\nif (isBrowser) {\n setTimeout(autoInit)\n}\n\nexport default tippy\n","import { GroupedInstance, GroupOptions } from './types'\n\n/**\n * Groups an array of instances by taking control of their props during\n * certain lifecycles.\n */\nexport default function group(\n instances: GroupedInstance[],\n { delay = instances[0].props.delay, duration = 0 }: GroupOptions = {},\n): void {\n let isAnyTippyOpen = false\n\n instances.forEach(instance => {\n if (instance._originalProps) {\n instance.set(instance._originalProps)\n } else {\n instance._originalProps = { ...instance.props }\n }\n })\n\n function setIsAnyTippyOpen(value: boolean): void {\n isAnyTippyOpen = value\n updateInstances()\n }\n\n function onShow(instance: GroupedInstance): void {\n instance._originalProps.onShow(instance)\n\n instances.forEach(instance => {\n instance.set({ duration })\n\n if (instance.state.isVisible) {\n instance.hide()\n }\n })\n\n setIsAnyTippyOpen(true)\n }\n\n function onHide(instance: GroupedInstance): void {\n instance._originalProps.onHide(instance)\n setIsAnyTippyOpen(false)\n }\n\n function onShown(instance: GroupedInstance): void {\n instance._originalProps.onShown(instance)\n instance.set({ duration: instance._originalProps.duration })\n }\n\n function updateInstances(): void {\n instances.forEach(instance => {\n instance.set({\n onShow,\n onShown,\n onHide,\n delay: isAnyTippyOpen\n ? [0, Array.isArray(delay) ? delay[1] : delay]\n : delay,\n duration: isAnyTippyOpen ? duration : instance._originalProps.duration,\n })\n })\n }\n\n updateInstances()\n}\n"],"names":["isBrowser","window","document","ua","navigator","userAgent","isIE","test","isUCBrowser","isIOS","platform","MSStream","defaultProps","a11y","allowHTML","animateFill","animation","appendTo","body","aria","arrow","arrowType","boundary","content","delay","distance","duration","flip","flipBehavior","flipOnUpdate","followCursor","hideOnClick","ignoreAttributes","inertia","interactive","interactiveBorder","interactiveDebounce","lazy","maxWidth","multiple","offset","onHidden","onHide","onMount","onShow","onShown","onTrigger","placement","popperOptions","role","showOnInit","size","sticky","target","theme","touch","touchHold","trigger","triggerTarget","updateDuration","wait","zIndex","POPPER_INSTANCE_DEPENDENCIES","elementProto","Element","prototype","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","arrayFrom","value","slice","call","closest","element","selector","closestCallback","el","callback","parentElement","PASSIVE","passive","PADDING","PLACEMENT_ATTRIBUTE","OUT_OF_BOUNDARIES_ATTRIBUTE","IOS_CLASS","ACTIVE_CLASS","POPPER_CLASS","TOOLTIP_CLASS","CONTENT_CLASS","BACKDROP_CLASS","ARROW_CLASS","ROUND_ARROW_CLASS","POPPER_SELECTOR","TOOLTIP_SELECTOR","CONTENT_SELECTOR","BACKDROP_SELECTOR","ARROW_SELECTOR","ROUND_ARROW_SELECTOR","isUsingTouch","onDocumentTouch","classList","add","performance","addEventListener","onDocumentMouseMove","lastMouseMoveTime","now","removeEventListener","remove","onWindowBlur","activeElement","blur","_tippy","keys","Object","hasOwnProperty","obj","key","getValue","index","defaultValue","Array","isArray","v","debounce","fn","ms","arg","clearTimeout","timeout","setTimeout","getModifier","modifiers","includes","a","b","indexOf","isRealElement","isSingular","invokeWithArgsOrReturn","args","apply","setFlipModifierEnabled","filter","m","name","enabled","div","createElement","setTransitionDuration","els","forEach","style","transitionDuration","setVisibilityState","state","setAttribute","evaluateProps","reference","props","out","reduce","acc","valueAsString","getAttribute","trim","JSON","parse","e","getDataAttributeOptions","validateOptions","options","option","Error","setInnerHTML","html","setContent","contentEl","appendChild","getChildren","popper","tooltip","querySelector","backdrop","addInertia","createArrowElement","className","createBackdropElement","addInteractive","updateTransitionEndListener","action","listener","eventName","undefined","webkitTransition","getBasicPlacement","fullPlacement","split","updateTheme","themeName","createPopperElement","id","position","top","left","updatePopperElement","prevProps","nextProps","removeAttribute","removeChild","replaceChild","removeInteractive","removeInertia","idCounter","mouseMoveListeners","createTippy","collectionProps","lastTriggerEventType","lastMouseMoveEvent","showTimeoutId","hideTimeoutId","scheduleHideAnimationFrameId","previousPlacement","currentMountCallback","currentTransitionEndListener","currentComputedPadding","isScheduledToShow","isBeingDestroyed","wasVisibleDuringPreviousUpdate","hasMountCallbackRun","listeners","debouncedOnMouseMove","onMouseMove","popperChildren","instance","popperInstance","isEnabled","isVisible","isDestroyed","isMounted","isShown","clearDelayTimeouts","set","show","hide","enable","disable","destroy","destroyTargetInstances","removeTriggersFromReference","querySelectorAll","child","addTriggersToReference","createPopperInstance","scheduleShow","getEventListenersTarget","hasAttribute","event","removeFollowCursorListener","positionVirtualReferenceNearCursor","cleanupInteractiveMouseListeners","scheduleHide","addDocumentClickListener","onDocumentClick","removeDocumentClickListener","getTransitionableElements","getIsInLooseFollowCursorMode","onTransitionEnd","on","eventType","handler","push","onMouseLeave","onDelegateShow","onDelegateHide","onBlur","x","clientX","y","clientY","isCursorOverReference","rect","getBoundingClientRect","isHorizontal","isVertical","isVerticalPlacement","isVariation","offsetWidth","offsetHeight","halfSize","verticalIncrease","horizontalIncrease","referenceNode","clientWidth","clientHeight","width","height","bottom","right","update","isEventListenerStopped","type","MouseEvent","isCursorOverPopper","popperPlacement","popperRect","exceedsTop","exceedsBottom","exceedsLeft","exceedsRight","isCursorOutsideInteractiveBorder","relatedTarget","contains","supportsTouch","isTouchEvent","runMountCallback","reflow","preventOverflowModifier","applyMutations","data","flipped","attributes","transition","requestAnimationFrame","basicPlacement","styles","padding","isPaddingNumber","computedPadding","config","eventsEnabled","preventOverflow","boundariesElement","behavior","onCreate","onUpdate","Popper","shouldAvoidCallingOnTrigger","targetEl","createDelegateChildTippy","cancelAnimationFrame","some","prop","enableEventListeners","visibility","transitionableElements","concat","isInLooseFollowCursorMode","transitionDelay","Math","round","prevRefRect","updatePosition","currentRefRect","scheduleUpdate","makeSticky","onTransitionedIn","parentNode","mount","onTransitionedOut","disableEventListeners","globalEventListenersBound","tippy","targets","toString","virtualReference","polyfills","isVirtual","classNames","polyfillElementPrototypeProperties","instances","NodeList","getArrayOfElements","version","defaults","setDefaults","partialDefaults","hideAll","excludedReferenceOrInstance","exclude","isExcluded","group","isAnyTippyOpen","setIsAnyTippyOpen","updateInstances","_originalProps"],"mappings":"4OAAaA,EACO,oBAAXC,QAA8C,oBAAbC,SAEpCC,EAAKH,EAAYI,UAAUC,UAAY,GAEhCC,EAAO,kBAAkBC,KAAKJ,GAC9BK,EAAc,cAAcD,KAAKJ,GACjCM,EACXT,GACA,mBAAmBO,KAAKH,UAAUM,YAChCT,OAAeU,SCRNC,EAAsB,CACjCC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,UAAW,aACXC,SAAU,kBAAMf,SAASgB,MACzBC,KAAM,cACNC,OAAO,EACPC,UAAW,QACXC,SAAU,eACVC,QAAS,GACTC,MAAO,EACPC,SAAU,GACVC,SAAU,CAAC,IAAK,KAChBC,MAAM,EACNC,aAAc,OACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,SAAS,EACTC,aAAa,EACbC,kBAAmB,EACnBC,oBAAqB,EACrBC,MAAM,EACNC,SAAU,IACVC,UA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