cryptpad/www/common/tippy.min.js
2017-08-08 16:19:44 +02:00

1 line
34 KiB
JavaScript

(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function t(e){Pe.forEach(function(t){var i=t.popper,o=t.tippyInstance,n=t.settings,r=n.appendTo,s=n.hideOnClick,a=n.trigger;if(r.contains(i)){var p=!0===s||-1!==a.indexOf('focus'),d=!e||i!==e.popper;p&&d&&o.hide(i)}})}function o(t,i){var o=Element.prototype.closest||function(t){for(var i=this;i;){if(e.call(i,t))return i;i=i.parentElement}};return o.call(t,i)}function n(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function r(){var i=function(){Ae.touch=!0,Ae.iOS()&&document.body.classList.add('tippy-touch'),Ae.dynamicInputDetection&&window.performance&&document.addEventListener('mousemove',r)},r=function(){var e;return function(){var t=performance.now();20>t-e&&(Ae.touch=!1,document.removeEventListener('mousemove',r),!Ae.iOS()&&document.body.classList.remove('tippy-touch')),e=t}}();document.addEventListener('click',function(e){if(!(e.target instanceof Element))return t();var i=o(e.target,Ce.TOOLTIPPED_EL),r=o(e.target,Ce.POPPER);if(r){var s=n(Pe,function(e){return e.popper===r}),a=s.settings.interactive;if(a)return}if(i){var p=n(Pe,function(e){return e.el===i}),d=p.settings,l=d.hideOnClick,c=d.multiple,f=d.trigger;if(!c&&Ae.touch||!c&&-1!==f.indexOf('click'))return t(p);if(!0!==l||-1!==f.indexOf('click'))return}o(e.target,Ce.CONTROLLER)||!document.querySelector(Ce.POPPER)||t()}),document.addEventListener('touchstart',i),window.addEventListener('blur',function(){var t=document,i=t.activeElement;i&&i.blur&&e.call(i,Ce.TOOLTIPPED_EL)&&i.blur()}),!Ae.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',i)}function s(){return!s.done&&(s.done=!0,ke.appendTo=document.body,r(),!0)}function a(e){window.requestAnimationFrame(function(){setTimeout(e,0)})}function p(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function d(e,t){return Array.prototype.findIndex?e.findIndex(t):e.indexOf(n(e,t))}function l(e){var t=e.getAttribute('title');e.setAttribute('data-original-title',t||'html'),e.removeAttribute('title')}function c(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function f(e,t){t?window.getComputedStyle(t)[p('transform')]:window.getComputedStyle(e).opacity}function m(e,t){e.forEach(function(e){e&&t(e.classList)})}function h(t,i){t.forEach(function(t){if(t){var o=e.call(t,Ce.CONTENT),n=o?xe(i/1.3):i;t.style[p('transitionDuration')]=n+'ms'}})}function u(e){return'visible'===e.style.visibility}function g(){}function b(e){return e.replace(/-.+/,'')}function y(t){var e,i,o=this,r=n(Pe,function(e){return e.el===o}),s=r.popper,a=r.settings.offset,d=b(s.getAttribute('x-placement')),l=xe(s.offsetWidth/2),c=xe(s.offsetHeight/2),f=5,m=document.documentElement.offsetWidth||document.body.offsetWidth,h=t.pageX,u=t.pageY;'top'===d?(e=h-l+a,i=u-2.25*c):'left'===d?(e=h-2*l-10,i=u-c+a):'right'===d?(e=h+c,i=u-c+a):'bottom'===d?(e=h-l+a,i=u+c/1.5):void 0;('top'===d||'bottom'===d)&&(h+f+l+a>m&&(e=m-f-2*l),0>h-f-l+a&&(e=f)),s.style[p('transform')]='translate3d('+e+'px, '+i+'px, 0)'}function v(e){return e instanceof Element||/Element/.test(Object.prototype.toString.call(e))?[e]:Array.isArray(e)?e:[].slice.call(document.querySelectorAll(e))}function E(e,t,i){if(!t)return i();var o=e.popper.querySelector(Ce.TOOLTIP),n=!1,r=function t(r){r.target!==o||(n=!0,o.removeEventListener('webkitTransitionEnd',t),o.removeEventListener('transitionend',t),i())};o.addEventListener('webkitTransitionEnd',r),o.addEventListener('transitionend',r),clearTimeout(e._transitionendTimeout),e._transitionendTimeout=setTimeout(function(){n||i()},t)}function O(e){return e&&'[object Function]'==={}.toString.call(e)}function w(e,t){if(1!==e.nodeType)return[];var i=window.getComputedStyle(e,null);return t?i[t]:i}function T(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function L(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var t=w(e),i=t.overflow,o=t.overflowX,n=t.overflowY;return /(auto|scroll)/.test(i+n+o)?e:L(T(e))}function S(e){var t=e&&e.offsetParent,i=t&&t.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(t.nodeName)&&'static'===w(t,'position')?S(t):t:window.document.documentElement}function x(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||S(e.firstElementChild)===e)}function A(e){return null===e.parentNode?e:A(e.parentNode)}function P(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var i=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=i?e:t,n=i?t:e,r=document.createRange();r.setStart(o,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!==s&&t!==s||o.contains(n))return x(s)?s:S(s);var a=A(e);return a.host?P(a.host,t):P(e,A(t).host)}function C(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',i='top'===t?'scrollTop':'scrollLeft',o=e.nodeName;if('BODY'===o||'HTML'===o){var n=window.document.documentElement,r=window.document.scrollingElement||n;return r[i]}return e[i]}function k(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=C(t,'top'),n=C(t,'left'),r=i?-1:1;return e.top+=o*r,e.bottom+=o*r,e.left+=n*r,e.right+=n*r,e}function I(e,t){var i='x'===t?'Left':'Top',o='Left'==i?'Right':'Bottom';return+e['border'+i+'Width'].split('px')[0]+ +e['border'+o+'Width'].split('px')[0]}function D(e,t,i,o){return Se(t['offset'+e],i['client'+e],i['offset'+e],_e()?i['offset'+e]+o['margin'+('Height'===e?'Top':'Left')]+o['margin'+('Height'===e?'Bottom':'Right')]:0)}function R(){var e=window.document.body,t=window.document.documentElement,i=_e()&&window.getComputedStyle(t);return{height:D('Height',e,t,i),width:D('Width',e,t,i)}}function H(e){return je({},e,{right:e.left+e.width,bottom:e.top+e.height})}function N(e){var t={};if(_e())try{t=e.getBoundingClientRect();var i=C(e,'top'),o=C(e,'left');t.top+=i,t.left+=o,t.bottom+=i,t.right+=o}catch(e){}else t=e.getBoundingClientRect();var n={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},r='HTML'===e.nodeName?R():{},s=r.width||e.clientWidth||n.right-n.left,a=r.height||e.clientHeight||n.bottom-n.top,p=e.offsetWidth-s,d=e.offsetHeight-a;if(p||d){var l=w(e);p-=I(l,'x'),d-=I(l,'y'),n.width-=p,n.height-=d}return H(n)}function M(e,t){var i=_e(),o='HTML'===t.nodeName,n=N(e),r=N(t),s=L(e),a=w(t),p=+a.borderTopWidth.split('px')[0],d=+a.borderLeftWidth.split('px')[0],l=H({top:n.top-r.top-p,left:n.left-r.left-d,width:n.width,height:n.height});if(l.marginTop=0,l.marginLeft=0,!i&&o){var c=+a.marginTop.split('px')[0],f=+a.marginLeft.split('px')[0];l.top-=p-c,l.bottom-=p-c,l.left-=d-f,l.right-=d-f,l.marginTop=c,l.marginLeft=f}return(i?t.contains(s):t===s&&'BODY'!==s.nodeName)&&(l=k(l,t)),l}function B(e){var t=window.document.documentElement,i=M(e,t),o=Se(t.clientWidth,window.innerWidth||0),n=Se(t.clientHeight,window.innerHeight||0),r=C(t),s=C(t,'left'),a={top:r-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:o,height:n};return H(a)}function W(e){var t=e.nodeName;return'BODY'===t||'HTML'===t?!1:'fixed'===w(e,'position')||W(T(e))}function U(e,t,i,o){var n={top:0,left:0},r=P(e,t);if('viewport'===o)n=B(r);else{var s;'scrollParent'===o?(s=L(T(e)),'BODY'===s.nodeName&&(s=window.document.documentElement)):'window'===o?s=window.document.documentElement:s=o;var a=M(s,r);if('HTML'===s.nodeName&&!W(r)){var p=R(),d=p.height,l=p.width;n.top+=a.top-a.marginTop,n.bottom=d+a.top,n.left+=a.left-a.marginLeft,n.right=l+a.left}else n=a}return n.left+=i,n.top+=i,n.right-=i,n.bottom-=i,n}function q(e){var t=e.width,i=e.height;return t*i}function _(e,t,i,o,n){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var s=U(i,o,r,n),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return je({key:e},a[e],{area:q(a[e])})}).sort(function(e,t){return t.area-e.area}),d=p.filter(function(e){var t=e.width,o=e.height;return t>=i.clientWidth&&o>=i.clientHeight}),l=0<d.length?d[0].key:p[0].key,c=e.split('-')[1];return l+(c?'-'+c:'')}function F(e,t,i){var o=P(t,i);return M(i,o)}function Y(e){var t=window.getComputedStyle(e),i=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+o,height:e.offsetHeight+i};return n}function z(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function j(e,t,i){i=i.split('-')[0];var o=Y(e),n={width:o.width,height:o.height},r=-1!==['right','left'].indexOf(i),s=r?'top':'left',a=r?'left':'top',p=r?'height':'width',d=r?'width':'height';return n[s]=t[s]+t[p]/2-o[p]/2,n[a]=i===a?t[a]-o[d]:t[z(a)],n}function K(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function X(e,t,i){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===i});var o=K(e,function(e){return e[t]===i});return e.indexOf(o)}function G(e,t,i){var o=void 0===i?e:e.slice(0,X(e,'name',i));return o.forEach(function(e){e.function&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var i=e.function||e.fn;e.enabled&&O(i)&&(t.offsets.popper=H(t.offsets.popper),t.offsets.reference=H(t.offsets.reference),t=i(t,e))}),t}function V(){if(!this.state.isDestroyed){var e={instance:this,styles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=F(this.state,this.popper,this.reference),e.placement=_(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=j(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=G(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function J(e,t){return e.some(function(e){var i=e.name,o=e.enabled;return o&&i===t})}function Z(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function $(){return this.state.isDestroyed=!0,J(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[Z('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Q(e,t,i,o){var n='BODY'===e.nodeName,r=n?window:e;r.addEventListener(t,i,{passive:!0}),n||Q(L(r.parentNode),t,i,o),o.push(r)}function ee(e,t,i,o){i.updateBound=o,window.addEventListener('resize',i.updateBound,{passive:!0});var n=L(e);return Q(n,'scroll',i.updateBound,i.scrollParents),i.scrollElement=n,i.eventsEnabled=!0,i}function te(){this.state.eventsEnabled||(this.state=ee(this.reference,this.options,this.state,this.scheduleUpdate))}function ie(e,t){return window.removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function oe(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=ie(this.reference,this.state))}function ne(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function re(e,t){Object.keys(t).forEach(function(i){var o='';-1!==['width','height','top','right','bottom','left'].indexOf(i)&&ne(t[i])&&(o='px'),e.style[i]=t[i]+o})}function se(e,t){Object.keys(t).forEach(function(i){var o=t[i];!1===o?e.removeAttribute(i):e.setAttribute(i,t[i])})}function ae(e,t,i){var o=K(e,function(e){var i=e.name;return i===t}),n=!!o&&e.some(function(e){return e.name===i&&e.enabled&&e.order<o.order});if(!n){var r='`'+t+'`';console.warn('`'+i+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return n}function pe(e){return'end'===e?'start':'start'===e?'end':e}function de(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=Xe.indexOf(e),o=Xe.slice(i+1).concat(Xe.slice(0,i));return t?o.reverse():o}function le(e,t,i,o){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],s=n[2];if(!r)return e;if(0===s.indexOf('%')){var a;switch(s){case'%p':a=i;break;case'%':case'%r':default:a=o;}var p=H(a);return p[t]/100*r}if('vh'===s||'vw'===s){var d;return d='vh'===s?Se(document.documentElement.clientHeight,window.innerHeight||0):Se(document.documentElement.clientWidth,window.innerWidth||0),d/100*r}return r}function ce(e,t,i,o){var n=[0,0],r=-1!==['right','left'].indexOf(o),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(K(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var p=/\s*,\s*|\s+/,d=-1===a?[s]:[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1]].concat(s.slice(a+1))];return d=d.map(function(e,o){var n=(1===o?!r:r)?'height':'width',s=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return le(e,n,t,i)})}),d.forEach(function(e,t){e.forEach(function(i,o){ne(i)&&(n[t]+=i*('-'===e[o-1]?-1:1))})}),n}function fe(e){return-(e-ke.distance)+'px'}function me(e){var t=e.el,i=e.popper,o=e.settings,n=o.position,r=o.popperOptions,s=o.offset,a=o.distance,p=o.flipDuration,d=i.querySelector(Ce.TOOLTIP),l=$e({placement:n},r||{},{modifiers:$e({},r?r.modifiers:{},{flip:$e({padding:a+5},r&&r.modifiers?r.modifiers.flip:{}),offset:$e({offset:s},r&&r.modifiers?r.modifiers.offset:{})}),onUpdate:function(){var e=d.style;e.top='',e.bottom='',e.left='',e.right='',e[b(i.getAttribute('x-placement'))]=fe(a)}});return new Ve(t,i,l)}function he(e){var t=e.el,i=e.popper,o=e.settings,n=o.appendTo,r=o.followCursor,s=o.flipDuration;if(!n.contains(i)){if(n.appendChild(i),!!e.popperInstance)e.popperInstance.update(),(!r||Ae.touch)&&e.popperInstance.enableEventListeners();else if(e.popperInstance=me(e),window.MutationObserver){var d=i.style,l=new MutationObserver(function(){d[p('transitionDuration')]='0ms',e.popperInstance.update(),a(function(){d[p('transitionDuration')]=s+'ms'})});l.observe(i,{childList:!0,subtree:!0,characterData:!0}),e._mutationObserver=l}r&&!Ae.touch&&(t.addEventListener('mousemove',y),e.popperInstance.disableEventListeners())}}function ue(e){var t=e.popper,i=e.popperInstance,o=e.settings.stickyDuration,n=function(){return t.style[p('transitionDuration')]=o+'ms'},r=function(){return t.style[p('transitionDuration')]=''};a(function e(){i&&i.scheduleUpdate(),n(),u(t)?window.requestAnimationFrame(e):r()})}function ge(e,t){var i=Ie.reduce(function(i,o){var n=e.getAttribute('data-'+o.toLowerCase())||t[o];return'false'===n&&(n=!1),'true'===n&&(n=!0),isFinite(n)&&!isNaN(parseFloat(n))&&(n=parseFloat(n)),'string'==typeof n&&'['===n.trim().charAt(0)&&(n=JSON.parse(n)),i[o]=n,i},{});return $e({},t,i)}function be(e,t,i){var o=i.position,n=i.distance,r=i.arrow,s=i.animateFill,a=i.inertia,p=i.animation,d=i.arrowSize,l=i.size,c=i.theme,f=i.html,m=i.zIndex,h=i.interactive,u=document.createElement('div');u.setAttribute('class','tippy-popper'),u.setAttribute('role','tooltip'),u.setAttribute('aria-hidden','true'),u.setAttribute('id','tippy-tooltip-'+e),u.style.zIndex=m;var g=document.createElement('div');if(g.setAttribute('class','tippy-tooltip tippy-tooltip--'+l+' leave'),g.setAttribute('data-animation',p),c.split(' ').forEach(function(e){g.classList.add(e+'-theme')}),r){var y=document.createElement('div');y.setAttribute('class','arrow-'+d),y.setAttribute('x-arrow',''),g.appendChild(y)}if(s){g.setAttribute('data-animatefill','');var v=document.createElement('div');v.setAttribute('class','leave'),v.setAttribute('x-circle',''),g.appendChild(v)}a&&g.setAttribute('data-inertia',''),h&&g.setAttribute('data-interactive','');var E=document.createElement('div');if(E.setAttribute('class','tippy-tooltip-content'),f){var O;f instanceof Element?(E.appendChild(f),O='#'+f.id||'tippy-html-template'):(E.innerHTML=document.getElementById(f.replace('#','')).innerHTML,O=f),u.classList.add('html-template'),h&&u.setAttribute('tabindex','-1'),g.setAttribute('data-template-id',O)}else E.innerHTML=t;return g.style[b(o)]=fe(n),g.appendChild(E),u.appendChild(g),u}function ye(e,t,i,o){var n=[];return'manual'===e?n:(t.addEventListener(e,i.handleTrigger),n.push({event:e,handler:i.handleTrigger}),'mouseenter'===e&&(Ae.SUPPORTS_TOUCH&&o&&(t.addEventListener('touchstart',i.handleTrigger),n.push({event:'touchstart',handler:i.handleTrigger}),t.addEventListener('touchend',i.handleMouseleave),n.push({event:'touchend',handler:i.handleMouseleave})),t.addEventListener('mouseleave',i.handleMouseleave),n.push({event:'mouseleave',handler:i.handleMouseleave})),'focus'===e&&(t.addEventListener('blur',i.handleBlur),n.push({event:'blur',handler:i.handleBlur})),n)}function ve(e,t,i){if(!t.getAttribute('x-placement'))return!0;var o=e.clientX,n=e.clientY,r=i.interactiveBorder,s=i.distance,a=t.getBoundingClientRect(),p=b(t.getAttribute('x-placement')),d=r+s,l={top:a.top-n>r,bottom:n-a.bottom>r,left:a.left-o>r,right:o-a.right>r};return'top'===p?l.top=a.top-n>d:'bottom'===p?l.bottom=n-a.bottom>d:'left'===p?l.left=a.left-o>d:'right'===p?l.right=o-a.right>d:void 0,l.top||l.bottom||l.left||l.right}function Ee(e,t,i){var n,r,s=this,a=i.position,p=i.delay,d=i.duration,l=i.interactive,c=i.interactiveBorder,f=i.distance,m=i.hideOnClick,h=i.trigger,g=i.touchHold,b=i.touchWait,y=function(){clearTimeout(n),clearTimeout(r)},v=function(){if(y(),!u(t)){var e=Array.isArray(p)?p[0]:p;p?n=setTimeout(function(){return s.show(t)},e):s.show(t)}},E=function(e){return s.callbacks.wait?s.callbacks.wait.call(t,v,e):v()},O=function(){y();var e=Array.isArray(p)?p[1]:p;p?r=setTimeout(function(){return s.hide(t)},e):s.hide(t)};return{handleTrigger:function(i){var o='mouseenter'===i.type&&Ae.SUPPORTS_TOUCH&&Ae.touch;if(!(o&&g)){var n='click'===i.type;n&&u(t)&&'persistent'!==m?O():E(i),o&&Ae.iOS()&&e.click&&e.click()}},handleMouseleave:function(n){if(!('mouseleave'===n.type&&Ae.SUPPORTS_TOUCH&&Ae.touch&&g)){if(l){var r=function n(r){var s=function(){document.body.removeEventListener('mouseleave',O),document.removeEventListener('mousemove',n),O()},a=o(r.target,Ce.TOOLTIPPED_EL),p=o(r.target,Ce.POPPER)===t,d=-1!==h.indexOf('click');return a&&a!==e?s():void(p||a===e||d||ve(r,t,i)&&s())};return document.body.addEventListener('mouseleave',O),void document.addEventListener('mousemove',r)}O()}},handleBlur:function(e){!e.relatedTarget||Ae.touch||o(e.relatedTarget,Ce.POPPER)||O()}}}function Oe(e){var t=this;return e.reduce(function(e,i){var o=Qe,n=t.settings.performance?t.settings:ge(i,t.settings);n.arrow&&(n.animateFill=!1);var r=n.html,s=n.trigger,a=n.touchHold,p=i.getAttribute('title');if(!p&&!r)return e;i.setAttribute('data-tooltipped',''),i.setAttribute('aria-describedby','tippy-tooltip-'+o),l(i);var d=be(o,p,n),c=Ee.call(t,i,d,n),f=[];return s.trim().split(' ').forEach(function(e){return f=f.concat(ye(e,i,c,a))}),e.push({id:o,el:i,popper:d,settings:n,listeners:f,tippyInstance:t}),Qe++,e},[])}function we(e,t){return new et(e,t)}var Te=Math.min,Le=Math.floor,Se=Math.max,xe=Math.round,Ae={};'undefined'!=typeof window&&(Ae.SUPPORTED='requestAnimationFrame'in window,Ae.SUPPORTS_TOUCH='ontouchstart'in window,Ae.touch=!1,Ae.dynamicInputDetection=!0,Ae.iOS=function(){return /iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream});for(var Pe=[],Ce={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-tooltip-content',CIRCLE:'[x-circle]',ARROW:'[x-arrow]',TOOLTIPPED_EL:'[data-tooltipped]',CONTROLLER:'[data-tippy-controller]'},ke={html:!1,position:'top',animation:'shift',animateFill:!0,arrow:!1,arrowSize:'regular',delay:0,trigger:'mouseenter focus',duration:350,interactive:!1,interactiveBorder:2,theme:'dark',size:'regular',distance:10,offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,flipDuration:350,sticky:!1,stickyDuration:200,appendTo:null,zIndex:9999,touchHold:!1,performance:!1,dynamicTitle:!1,popperOptions:{}},Ie=Ae.SUPPORTED&&Object.keys(ke),De=Element.prototype,e=De.matches||De.matchesSelector||De.webkitMatchesSelector||De.mozMatchesSelector||De.msMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=t.length;0<=--o&&t.item(o)!==this;);return-1<o},Re=['native code','[object MutationObserverConstructor]'],He=function(e){return Re.some(function(t){return-1<(e||'').toString().indexOf(t)})},Ne='undefined'!=typeof window,Me=['Edge','Trident','Firefox'],Be=0,We=0;We<Me.length;We+=1)if(Ne&&0<=navigator.userAgent.indexOf(Me[We])){Be=1;break}var i,Ue=Ne&&He(window.MutationObserver),qe=Ue?function(e){var t=!1,o=0,i=document.createElement('span'),n=new MutationObserver(function(){e(),t=!1});return n.observe(i,{attributes:!0}),function(){t||(t=!0,i.setAttribute('x-index',o),++o)}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Be))}},_e=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},Fe=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},Ye=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),ze=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},je=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ke=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],Xe=Ke.slice(3),Ge={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},Ve=function(){function e(t,i){var o=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};Fe(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=qe(this.update.bind(this)),this.options=je({},e.Defaults,n),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t.jquery?t[0]:t,this.popper=i.jquery?i[0]:i,this.options.modifiers={},Object.keys(je({},e.Defaults.modifiers,n.modifiers)).forEach(function(t){o.options.modifiers[t]=je({},e.Defaults.modifiers[t]||{},n.modifiers?n.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return je({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&O(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return Ye(e,[{key:'update',value:function(){return V.call(this)}},{key:'destroy',value:function(){return $.call(this)}},{key:'enableEventListeners',value:function(){return te.call(this)}},{key:'disableEventListeners',value:function(){return oe.call(this)}}]),e}();Ve.Utils=('undefined'==typeof window?global:window).PopperUtils,Ve.placements=Ke,Ve.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,i=t.split('-')[0],o=t.split('-')[1];if(o){var n=e.offsets,r=n.reference,s=n.popper,a=-1!==['bottom','top'].indexOf(i),p=a?'left':'top',d=a?'width':'height',l={start:ze({},p,r[p]),end:ze({},p,r[p]+r[d]-s[d])};e.offsets.popper=je({},s,l[o])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var i,o=t.offset,n=e.placement,r=e.offsets,s=r.popper,a=r.reference,p=n.split('-')[0];return i=ne(+o)?[+o,0]:ce(o,s,a,p),'left'===p?(s.top+=i[0],s.left-=i[1]):'right'===p?(s.top+=i[0],s.left+=i[1]):'top'===p?(s.left+=i[0],s.top-=i[1]):'bottom'===p&&(s.left+=i[0],s.top+=i[1]),e.popper=s,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var i=t.boundariesElement||S(e.instance.popper);e.instance.reference===i&&(i=S(i));var o=U(e.instance.popper,e.instance.reference,t.padding,i);t.boundaries=o;var n=t.priority,r=e.offsets.popper,s={primary:function(e){var i=r[e];return r[e]<o[e]&&!t.escapeWithReference&&(i=Se(r[e],o[e])),ze({},e,i)},secondary:function(e){var i='right'===e?'left':'top',n=r[i];return r[e]>o[e]&&!t.escapeWithReference&&(n=Te(r[i],o[e]-('right'===e?r.width:r.height))),ze({},i,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';r=je({},r,s[t](e))}),e.offsets.popper=r,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,i=t.popper,o=t.reference,n=e.placement.split('-')[0],r=Le,s=-1!==['top','bottom'].indexOf(n),a=s?'right':'bottom',p=s?'left':'top',d=s?'width':'height';return i[a]<r(o[p])&&(e.offsets.popper[p]=r(o[p])-i[d]),i[p]>r(o[a])&&(e.offsets.popper[p]=r(o[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!ae(e.instance.modifiers,'arrow','keepTogether'))return e;var i=t.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var o=e.placement.split('-')[0],n=e.offsets,r=n.popper,s=n.reference,a=-1!==['left','right'].indexOf(o),p=a?'height':'width',d=a?'top':'left',l=a?'left':'top',c=a?'bottom':'right',f=Y(i)[p];s[c]-f<r[d]&&(e.offsets.popper[d]-=r[d]-(s[c]-f)),s[d]+f>r[c]&&(e.offsets.popper[d]+=s[d]+f-r[c]);var m=s[d]+s[p]/2-f/2,h=m-H(e.offsets.popper)[d];return h=Se(Te(r[p]-f,h),0),e.arrowElement=i,e.offsets.arrow={},e.offsets.arrow[d]=xe(h),e.offsets.arrow[l]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(J(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var i=U(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),o=e.placement.split('-')[0],n=z(o),r=e.placement.split('-')[1]||'',s=[];switch(t.behavior){case Ge.FLIP:s=[o,n];break;case Ge.CLOCKWISE:s=de(o);break;case Ge.COUNTERCLOCKWISE:s=de(o,!0);break;default:s=t.behavior;}return s.forEach(function(a,p){if(o!==a||s.length===p+1)return e;o=e.placement.split('-')[0],n=z(o);var d=e.offsets.popper,l=e.offsets.reference,c=Le,f='left'===o&&c(d.right)>c(l.left)||'right'===o&&c(d.left)<c(l.right)||'top'===o&&c(d.bottom)>c(l.top)||'bottom'===o&&c(d.top)<c(l.bottom),m=c(d.left)<c(i.left),h=c(d.right)>c(i.right),u=c(d.top)<c(i.top),g=c(d.bottom)>c(i.bottom),b='left'===o&&m||'right'===o&&h||'top'===o&&u||'bottom'===o&&g,y=-1!==['top','bottom'].indexOf(o),v=!!t.flipVariations&&(y&&'start'===r&&m||y&&'end'===r&&h||!y&&'start'===r&&u||!y&&'end'===r&&g);(f||b||v)&&(e.flipped=!0,(f||b)&&(o=s[p+1]),v&&(r=pe(r)),e.placement=o+(r?'-'+r:''),e.offsets.popper=je({},e.offsets.popper,j(e.instance.popper,e.offsets.reference,e.placement)),e=G(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,i=t.split('-')[0],o=e.offsets,n=o.popper,r=o.reference,s=-1!==['left','right'].indexOf(i),a=-1===['top','left'].indexOf(i);return n[s?'left':'top']=r[t]-(a?n[s?'width':'height']:0),e.placement=z(t),e.offsets.popper=H(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!ae(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,i=K(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<i.top||t.left>i.right||t.top>i.bottom||t.right<i.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var i=t.x,o=t.y,n=e.offsets.popper,r=K(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,a,p=void 0===r?t.gpuAcceleration:r,d=S(e.instance.popper),l=N(d),c={position:n.position},f={left:Le(n.left),top:Le(n.top),bottom:Le(n.bottom),right:Le(n.right)},m='bottom'===i?'top':'bottom',h='right'===o?'left':'right',u=Z('transform');if(a='bottom'==m?-l.height+f.bottom:f.top,s='right'==h?-l.width+f.right:f.left,p&&u)c[u]='translate3d('+s+'px, '+a+'px, 0)',c[m]=0,c[h]=0,c.willChange='transform';else{var g='bottom'==m?-1:1,b='right'==h?-1:1;c[m]=a*g,c[h]=s*b,c.willChange=m+', '+h}var y={"x-placement":e.placement};return e.attributes=je({},y,e.attributes),e.styles=je({},c,e.styles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return re(e.instance.popper,e.styles),se(e.instance.popper,e.attributes),e.offsets.arrow&&re(e.arrowElement,e.offsets.arrow),e},onLoad:function(e,t,i,o,n){var r=F(n,t,e),s=_(i.placement,r,t,e,i.modifiers.flip.boundariesElement,i.modifiers.flip.padding);return t.setAttribute('x-placement',s),re(t,{position:'absolute'}),i},gpuAcceleration:void 0}}};var Je=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},Ze=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),$e=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qe=1,et=function(){function e(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};Je(this,e),Ae.SUPPORTED&&(s(),this.state={destroyed:!1},this.selector=t,this.settings=$e({},ke,i),this.callbacks={wait:i.wait,show:i.onShow||i.show||g,shown:i.onShown||i.shown||g,hide:i.onHide||i.hide||g,hidden:i.onHidden||i.hidden||g},this.store=Oe.call(this,v(t)),Pe.push.apply(Pe,this.store))}return Ze(e,[{key:'getPopperElement',value:function(e){try{return n(this.store,function(t){return t.el===e}).popper}catch(t){console.error('[getPopperElement]: Element passed as the argument does not exist in the instance')}}},{key:'getReferenceElement',value:function(e){try{return n(this.store,function(t){return t.popper===e}).el}catch(t){console.error('[getReferenceElement]: Popper passed as the argument does not exist in the instance')}}},{key:'getReferenceData',value:function(e){return n(this.store,function(t){return t.el===e||t.popper===e})}},{key:'show',value:function(e,t){var i=this;if(!this.state.destroyed){this.callbacks.show.call(e);var o=n(this.store,function(t){return t.popper===e}),r=e.querySelector(Ce.TOOLTIP),s=e.querySelector(Ce.CIRCLE),p=e.querySelector(Ce.CONTENT),d=o.el,c=o.settings,g=c.appendTo,b=c.sticky,y=c.interactive,v=c.followCursor,O=c.flipDuration,w=c.duration,T=c.dynamicTitle;if(T){var L=d.getAttribute('title');L&&(p.innerHTML=L,l(d))}var S=void 0===t?Array.isArray(w)?w[0]:w:t;h([e,r,s],0),he(o),e.style.visibility='visible',e.setAttribute('aria-hidden','false'),a(function(){u(e)&&((!v||Ae.touch)&&o.popperInstance.update(),h([r,s],S),(!v||Ae.touch)&&h([e],O),s&&(p.style.opacity=1),y&&d.classList.add('active'),b&&ue(o),f(r,s),m([r,s],function(e){e.contains('tippy-notransition')&&e.remove('tippy-notransition'),e.remove('leave'),e.add('enter')}),E(o,S,function(){!u(e)||o._onShownFired||(y&&e.focus(),r.classList.add('tippy-notransition'),o._onShownFired=!0,i.callbacks.shown.call(e))}))})}}},{key:'hide',value:function(e,t){var i=this;if(!this.state.destroyed){this.callbacks.hide.call(e);var o=n(this.store,function(t){return t.popper===e}),r=e.querySelector(Ce.TOOLTIP),s=e.querySelector(Ce.CIRCLE),a=e.querySelector(Ce.CONTENT),p=o.el,d=o.settings,l=d.appendTo,f=d.sticky,g=d.interactive,b=d.followCursor,v=d.html,O=d.trigger,w=d.duration,T=void 0===t?Array.isArray(w)?w[1]:w:t;o._onShownFired=!1,g&&p.classList.remove('active'),e.style.visibility='hidden',e.setAttribute('aria-hidden','true'),h([r,s,s?a:null],T),s&&(a.style.opacity=0),m([r,s],function(e){e.contains('tippy-tooltip')&&e.remove('tippy-notransition'),e.remove('enter'),e.add('leave')}),v&&-1!==O.indexOf('click')&&c(p)&&p.focus(),E(o,T,function(){u(e)||!l.contains(e)||(p.removeEventListener('mousemove',y),o.popperInstance.disableEventListeners(),l.removeChild(e),i.callbacks.hidden.call(e))})}}},{key:'update',value:function(e){if(!this.state.destroyed){var t=n(this.store,function(t){return t.popper===e}),i=e.querySelector(Ce.CONTENT),o=t.el,r=t.settings.html;return r instanceof Element?void console.warn('Aborted: update() should not be used if `html` is a DOM element'):void(i.innerHTML=r?document.getElementById(r.replace('#','')).innerHTML:o.getAttribute('title')||o.getAttribute('data-original-title'),!r&&l(o))}}},{key:'destroy',value:function(e,t){var i=this;if(!this.state.destroyed){var o=n(this.store,function(t){return t.popper===e}),r=o.el,s=o.popperInstance,a=o.listeners,p=o._mutationObserver;u(e)&&this.hide(e,0),a.forEach(function(e){return r.removeEventListener(e.event,e.handler)}),r.setAttribute('title',r.getAttribute('data-original-title')),r.removeAttribute('data-original-title'),r.removeAttribute('data-tooltipped'),r.removeAttribute('aria-describedby'),s&&s.destroy(),p&&p.disconnect(),Pe.splice(d(Pe,function(t){return t.popper===e}),1),(void 0===t||t)&&(this.store=Pe.filter(function(e){return e.tippyInstance===i}))}}},{key:'destroyAll',value:function(){var e=this;if(!this.state.destroyed){var t=this.store.length;this.store.forEach(function(i,o){var n=i.popper;e.destroy(n,o===t-1)}),this.store=null,this.state.destroyed=!0}}}]),e}();return we.Browser=Ae,we.Defaults=ke,we.disableDynamicInputDetection=function(){return Ae.dynamicInputDetection=!1},we.enableDynamicInputDetection=function(){return Ae.dynamicInputDetection=!0},we});