(function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Popper=t()})(this,function(){"use strict";function et(n){return n&&"[object Function]"==={}.toString.call(n)}function r(n,t){if(1!==n.nodeType)return[];var i=getComputedStyle(n,null);return t?i[t]:i}function p(n){return"HTML"===n.nodeName?n:n.parentNode||n.host}function s(n){if(!n)return document.body;switch(n.nodeName){case"HTML":case"BODY":return n.ownerDocument.body;case"#document":return n.body}var t=r(n),i=t.overflow,u=t.overflowX,f=t.overflowY;return/(auto|scroll|overlay)/.test(i+f+u)?n:s(p(n))}function u(n){return 11===n?ui:10===n?fi:ui||fi}function f(n){var e,t,i;if(!n)return document.documentElement;for(e=u(10)?document.body:null,t=n.offsetParent;t===e&&n.nextElementSibling;)t=(n=n.nextElementSibling).offsetParent;return i=t&&t.nodeName,i&&"BODY"!==i&&"HTML"!==i?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===r(t,"position")?f(t):t:n?n.ownerDocument.documentElement:document.documentElement}function oi(n){var t=n.nodeName;return"BODY"!==t&&("HTML"===t||f(n.firstElementChild)===n)}function w(n){return null===n.parentNode?n:w(n.parentNode)}function c(n,t){var i,u;if(!n||!n.nodeType||!t||!t.nodeType)return document.documentElement;var e=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=e?n:t,s=e?t:n,r=document.createRange();return(r.setStart(o,0),r.setEnd(s,0),i=r.commonAncestorContainer,n!==i&&t!==i||o.contains(s))?oi(i)?i:f(i):(u=w(n),u.host?c(u.host,t):c(n,w(t).host))}function e(n){var f=1=r.clientWidth&&i>=r.clientHeight}),a=0s[n]&&!r.escapeWithReference&&(i=ti(u[t],s[n]-("right"===n?u.width:u.height))),o({},t,i)}};return y.forEach(function(t){var i=-1===["left","top"].indexOf(t)?"secondary":"primary";u=n({},u,p[i](t))}),i.offsets.popper=u,i},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(n){var o=n.offsets,u=o.popper,i=o.reference,s=n.placement.split("-")[0],r=a,f=-1!==["top","bottom"].indexOf(s),e=f?"right":"bottom",t=f?"left":"top",h=f?"width":"height";return u[e]r(i[e])&&(n.offsets.popper[t]=r(i[e])),n}},arrow:{order:500,enabled:!0,fn:function(n,u){var l,e;if(!gt(n.instance.modifiers,"arrow","keepTogether"))return n;if(e=u.element,"string"==typeof e){if(e=n.instance.popper.querySelector(e),!e)return n}else if(!n.instance.popper.contains(e))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),n;var d=n.placement.split("-")[0],b=n.offsets,c=b.popper,s=b.reference,a=-1!==["left","right"].indexOf(d),y=a?"height":"width",p=a?"Top":"Left",f=p.toLowerCase(),g=a?"left":"top",v=a?"bottom":"right",h=yt(e)[y];s[v]-hc[v]&&(n.offsets.popper[f]+=s[f]+h-c[v]);n.offsets.popper=i(n.offsets.popper);var nt=s[f]+s[y]/2-h/2,k=r(n.instance.popper),tt=parseFloat(k["margin"+p],10),rt=parseFloat(k["border"+p+"Width"],10),w=nt-n.offsets.popper[f]-tt-rt;return w=t(ti(c[y]-h,w),0),n.arrowElement=e,n.offsets.arrow=(l={},o(l,f,it(w)),o(l,g,""),l),n},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,i){if(bt(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var e=d(t.instance.popper,t.instance.reference,i.padding,i.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],o=l(r),u=t.placement.split("-")[1]||"",f=[];switch(i.behavior){case ft.FLIP:f=[r,o];break;case ft.CLOCKWISE:f=ni(r);break;case ft.COUNTERCLOCKWISE:f=ni(r,!0);break;default:f=i.behavior}return f.forEach(function(s,h){if(r!==s||f.length===h+1)return t;r=t.placement.split("-")[0];o=l(r);var v=t.offsets.popper,y=t.offsets.reference,c=a,w="left"===r&&c(v.right)>c(y.left)||"right"===r&&c(v.left)c(y.top)||"bottom"===r&&c(v.top)c(e.right),d=c(v.top)c(e.bottom),nt="left"===r&&b||"right"===r&&k||"top"===r&&d||"bottom"===r&&g,p=-1!==["top","bottom"].indexOf(r),tt=!!i.flipVariations&&(p&&"start"===u&&b||p&&"end"===u&&k||!p&&"start"===u&&d||!p&&"end"===u&&g);(w||nt||tt)&&(t.flipped=!0,(w||nt)&&(r=f[h+1]),tt&&(u=di(u)),t.placement=r+(u?"-"+u:""),t.offsets.popper=n({},t.offsets.popper,pt(t.instance.popper,t.offsets.reference,t.placement)),t=wt(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(n){var u=n.placement,t=u.split("-")[0],f=n.offsets,r=f.popper,o=f.reference,e=-1!==["left","right"].indexOf(t),s=-1===["top","left"].indexOf(t);return r[e?"left":"top"]=o[t]-(s?r[e?"width":"height"]:0),n.placement=l(u),n.offsets.popper=i(r),n}},hide:{order:800,enabled:!0,fn:function(n){if(!gt(n.instance.modifiers,"hide","preventOverflow"))return n;var t=n.offsets.reference,i=h(n.instance.modifiers,function(n){return"preventOverflow"===n.name}).boundaries;if(t.bottomi.right||t.top>i.bottom||t.right