/*
 * Copyright (c) 2020 aureliancnx
 *
 * MIT LICENSE
 *
 * This project is part of aureliancnx.
 * See https://github.com/aureliancnx/Bubulle-Norminette for further info.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE. */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Popper=t()}(this,function(){"use strict";for(var e="undefined"!=typeof window&&void 0!==window.document,t=["Edge","Trident","Firefox"],n=0,o=0;o<t.length;o+=1)if(e&&0<=navigator.userAgent.indexOf(t[o])){n=1;break}var i=e&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},n))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function b(e,t){if(1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n}function w(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function y(e){if(!e)return window.document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=b(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/(auto|scroll)/.test(n+r+o)?e:y(w(e))}function E(e){var t=e&&e.offsetParent,n=t&&t.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(t.nodeName)&&"static"===b(t,"position")?E(t):t:e?e.ownerDocument.documentElement:window.document.documentElement}function l(e){return null!==e.parentNode?l(e.parentNode):e}function x(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return window.document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?e:t,r=n?t:e,i=document.createRange();i.setStart(o,0),i.setEnd(r,0);var a,s,f=i.commonAncestorContainer;if(e!==f&&t!==f||o.contains(r))return"BODY"===(s=(a=f).nodeName)||"HTML"!==s&&E(a.firstElementChild)!==a?E(f):f;var p=l(e);return p.host?x(p.host,t):x(e,l(t).host)}function O(e,t){var n="top"===(1<arguments.length&&void 0!==t?t:"top")?"scrollTop":"scrollLeft",o=e.nodeName;if("BODY"!==o&&"HTML"!==o)return e[n];var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}function d(e,t){var n="x"===t?"Left":"Top",o="Left"==n?"Right":"Bottom";return+e["border"+n+"Width"].split("px")[0]+ +e["border"+o+"Width"].split("px")[0]}var r=void 0,u=function(){return void 0===r&&(r=-1!==navigator.appVersion.indexOf("MSIE 10")),r};function s(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],u()?n["offset"+e]+o["margin"+("Height"===e?"Top":"Left")]+o["margin"+("Height"===e?"Bottom":"Right")]:0)}function L(){var e=window.document.body,t=window.document.documentElement,n=u()&&window.getComputedStyle(t);return{height:s("Height",e,t,n),width:s("Width",e,t,n)}}var f=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},p=function(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e};function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};function D(e){return T({},e,{right:e.left+e.width,bottom:e.top+e.height})}function M(e){var t={};if(u())try{t=e.getBoundingClientRect();var n=O(e,"top"),o=O(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}catch(e){}else t=e.getBoundingClientRect();var r,i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},a="HTML"===e.nodeName?L():{},s=a.width||e.clientWidth||i.right-i.left,f=a.height||e.clientHeight||i.bottom-i.top,p=e.offsetWidth-s,l=e.offsetHeight-f;return(p||l)&&(p-=d(r=b(e),"x"),l-=d(r,"y"),i.width-=p,i.height-=l),D(i)}function N(e,t){var n,o,r=u(),i="HTML"===t.nodeName,a=M(e),s=M(t),f=y(e),p=b(t),l=+p.borderTopWidth.split("px")[0],d=+p.borderLeftWidth.split("px")[0],c=D({top:a.top-s.top-l,left:a.left-s.left-d,width:a.width,height:a.height});return c.marginTop=0,c.marginLeft=0,!r&&i&&(n=+p.marginTop.split("px")[0],o=+p.marginLeft.split("px")[0],c.top-=l-n,c.bottom-=l-n,c.left-=d-o,c.right-=d-o,c.marginTop=n,c.marginLeft=o),(r?t.contains(f):t===f&&"BODY"!==f.nodeName)&&(c=function(e,t,n){var o=2<arguments.length&&void 0!==n&&n,r=O(t,"top"),i=O(t,"left"),a=o?-1:1;return e.top+=r*a,e.bottom+=r*a,e.left+=i*a,e.right+=i*a,e}(c,t)),c}function k(e,t,n,o){var r,i,a,s,f,p,l,d,c,u,h,m,g={top:0,left:0},v=x(e,t);return"viewport"===o?(l=(p=v).ownerDocument.documentElement,d=N(p,l),c=Math.max(l.clientWidth,window.innerWidth||0),u=Math.max(l.clientHeight,window.innerHeight||0),h=O(l),m=O(l,"left"),g=D({top:h-d.top+d.marginTop,left:m-d.left+d.marginLeft,width:c,height:u})):(r=void 0,"scrollParent"===o?"BODY"===(r=y(w(e))).nodeName&&(r=e.ownerDocument.documentElement):r="window"===o?e.ownerDocument.documentElement:o,i=N(r,v),"HTML"!==r.nodeName||function e(t){var n=t.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===b(t,"position")||e(w(t)))}(v)?g=i:(s=(a=L()).height,f=a.width,g.top+=i.top-i.marginTop,g.bottom=s+i.top,g.left+=i.left-i.marginLeft,g.right=f+i.left)),g.left+=n,g.top+=n,g.right-=n,g.bottom-=n,g}function m(e,t,o,n,r,i){var a=5<arguments.length&&void 0!==i?i:0;if(-1===e.indexOf("auto"))return e;var s=k(o,n,a,r),f={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(f).map(function(e){return T({key:e},f[e],{area:(t=f[e]).width*t.height});var t}).sort(function(e,t){return t.area-e.area}),l=p.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),d=0<l.length?l[0].key:p[0].key,c=e.split("-")[1];return d+(c?"-"+c:"")}function g(e,t,n){return N(n,x(t,n))}function v(e){var t=window.getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function B(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 H(e,t,n){n=n.split("-")[0];var o=v(e),r={width:o.width,height:o.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",p=i?"width":"height";return r[a]=t[a]+t[f]/2-o[f]/2,r[s]=n===s?t[s]-o[p]:t[B(s)],r}function A(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function C(e,n,t){return(void 0===t?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=A(e,function(e){return e[t]===n});return e.indexOf(o)}(e,"name",t))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var t=e.function||e.fn;e.enabled&&a(t)&&(n.offsets.popper=D(n.offsets.popper),n.offsets.reference=D(n.offsets.reference),n=t(n,e))}),n}function P(e,n){return e.some(function(e){var t=e.name;return e.enabled&&t===n})}function W(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<t.length-1;o++){var r=t[o],i=r?""+r+n:e;if(void 0!==window.document.body.style[i])return i}return null}function S(e){var t=e.ownerDocument;return t?t.defaultView:window}function j(e,t,n,o){n.updateBound=o,S(e).addEventListener("resize",n.updateBound,{passive:!0});var r=y(e);return function e(t,n,o,r){var i="BODY"===t.nodeName,a=i?t.ownerDocument.defaultView:t;a.addEventListener(n,o,{passive:!0}),i||e(y(a.parentNode),n,o,r),r.push(a)}(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function F(){var e,t;this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,S(e).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 R(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function U(n,o){Object.keys(o).forEach(function(e){var t="";-1!==["width","height","top","right","bottom","left"].indexOf(e)&&R(o[e])&&(t="px"),n.style[e]=o[e]+t})}function Y(e,t,n){var o,r,i=A(e,function(e){return e.name===t}),a=!!i&&e.some(function(e){return e.name===n&&e.enabled&&e.order<i.order});return a||(o="`"+t+"`",r="`"+n+"`",console.warn(r+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")),a}var I=["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"],q=I.slice(3);function V(e,t){var n=1<arguments.length&&void 0!==t&&t,o=q.indexOf(e),r=q.slice(o+1).concat(q.slice(0,o));return n?r.reverse():r}var z="flip",G="clockwise",_="counterclockwise";function X(e,r,i,t){var a=[0,0],s=-1!==["right","left"].indexOf(t),n=e.split(/(\+|\-)/).map(function(e){return e.trim()}),o=n.indexOf(A(n,function(e){return-1!==e.search(/,|\s/)}));n[o]&&-1===n[o].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/;return(-1!==o?[n.slice(0,o).concat([n[o].split(f)[0]]),[n[o].split(f)[1]].concat(n.slice(o+1))]:[n]).map(function(e,t){var n=(1===t?!s:s)?"height":"width",o=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,o){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+r[1],a=r[2];if(!i)return e;if(0!==a.indexOf("%"))return"vh"!==a&&"vw"!==a?i:("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=o}return D(s)[t]/100*i}(e,n,r,i)})}).forEach(function(n,o){n.forEach(function(e,t){R(e)&&(a[o]+=e*("-"===n[t-1]?-1:1))})}),a}var J={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t,n,o,r,i,a,s,f=e.placement,p=f.split("-")[0],l=f.split("-")[1];return l&&(n=(t=e.offsets).reference,o=t.popper,a=(r=-1!==["bottom","top"].indexOf(p))?"width":"height",s={start:h({},i=r?"left":"top",n[i]),end:h({},i,n[i]+n[a]-o[a])},e.offsets.popper=T({},o,s[l])),e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,o=e.placement,r=e.offsets,i=r.popper,a=r.reference,s=o.split("-")[0],f=void 0,f=R(+n)?[+n,0]:X(n,i,a,s);return"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,o){var t=o.boundariesElement||E(e.instance.popper);e.instance.reference===t&&(t=E(t));var r=k(e.instance.popper,e.instance.reference,o.padding,t);o.boundaries=r;var n=o.priority,i=e.offsets.popper,a={primary:function(e){var t=i[e];return i[e]<r[e]&&!o.escapeWithReference&&(t=Math.max(i[e],r[e])),h({},e,t)},secondary:function(e){var t="right"===e?"left":"top",n=i[t];return i[e]>r[e]&&!o.escapeWithReference&&(n=Math.min(i[t],r[e]-("right"===e?i.width:i.height))),h({},t,n)}};return n.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";i=T({},i,a[t](e))}),e.offsets.popper=i,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,o=t.reference,r=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(r),s=a?"right":"bottom",f=a?"left":"top",p=a?"width":"height";return n[s]<i(o[f])&&(e.offsets.popper[f]=i(o[f])-n[p]),n[f]>i(o[s])&&(e.offsets.popper[f]=i(o[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!Y(e.instance.modifiers,"arrow","keepTogether"))return e;var n=t.element;if("string"==typeof n){if(!(n=e.instance.popper.querySelector(n)))return e}else if(!e.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],r=e.offsets,i=r.popper,a=r.reference,s=-1!==["left","right"].indexOf(o),f=s?"height":"width",p=s?"Top":"Left",l=p.toLowerCase(),d=s?"left":"top",c=s?"bottom":"right",u=v(n)[f];a[c]-u<i[l]&&(e.offsets.popper[l]-=i[l]-(a[c]-u)),a[l]+u>i[c]&&(e.offsets.popper[l]+=a[l]+u-i[c]);var h=a[l]+a[f]/2-u/2,m=b(e.instance.popper,"margin"+p).replace("px",""),g=h-D(e.offsets.popper)[l]-m,g=Math.max(Math.min(i[f]-u,g),0);return e.arrowElement=n,e.offsets.arrow={},e.offsets.arrow[l]=Math.round(g),e.offsets.arrow[d]="",e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(h,m){if(P(h.instance.modifiers,"inner"))return h;if(h.flipped&&h.placement===h.originalPlacement)return h;var g=k(h.instance.popper,h.instance.reference,m.padding,m.boundariesElement),v=h.placement.split("-")[0],b=B(v),w=h.placement.split("-")[1]||"",y=[];switch(m.behavior){case z:y=[v,b];break;case G:y=V(v);break;case _:y=V(v,!0);break;default:y=m.behavior}return y.forEach(function(e,t){if(v!==e||y.length===t+1)return h;v=h.placement.split("-")[0],b=B(v);var n,o=h.offsets.popper,r=h.offsets.reference,i=Math.floor,a="left"===v&&i(o.right)>i(r.left)||"right"===v&&i(o.left)<i(r.right)||"top"===v&&i(o.bottom)>i(r.top)||"bottom"===v&&i(o.top)<i(r.bottom),s=i(o.left)<i(g.left),f=i(o.right)>i(g.right),p=i(o.top)<i(g.top),l=i(o.bottom)>i(g.bottom),d="left"===v&&s||"right"===v&&f||"top"===v&&p||"bottom"===v&&l,c=-1!==["top","bottom"].indexOf(v),u=!!m.flipVariations&&(c&&"start"===w&&s||c&&"end"===w&&f||!c&&"start"===w&&p||!c&&"end"===w&&l);(a||d||u)&&(h.flipped=!0,(a||d)&&(v=y[t+1]),u&&(w="end"===(n=w)?"start":"start"===n?"end":n),h.placement=v+(w?"-"+w:""),h.offsets.popper=T({},h.offsets.popper,H(h.instance.popper,h.offsets.reference,h.placement)),h=C(h.instance.modifiers,h,"flip"))}),h},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,r=o.popper,i=o.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=i[n]-(s?r[a?"width":"height"]:0),e.placement=B(t),e.offsets.popper=D(r),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Y(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=A(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.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 n=t.x,o=t.y,r=e.offsets.popper,i=A(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a,s,f=void 0!==i?i:t.gpuAcceleration,p=M(E(e.instance.popper)),l={position:r.position},d={left:Math.floor(r.left),top:Math.floor(r.top),bottom:Math.floor(r.bottom),right:Math.floor(r.right)},c="bottom"===n?"top":"bottom",u="right"===o?"left":"right",h=W("transform"),m=void 0,g=void 0,g="bottom"==c?-p.height+d.bottom:d.top,m="right"==u?-p.width+d.right:d.left;f&&h?(l[h]="translate3d("+m+"px, "+g+"px, 0)",l[c]=0,l[u]=0,l.willChange="transform"):(a="bottom"==c?-1:1,s="right"==u?-1:1,l[c]=g*a,l[u]=m*s,l.willChange=c+", "+u);var v={"x-placement":e.placement};return e.attributes=T({},v,e.attributes),e.styles=T({},l,e.styles),e.arrowStyles=T({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return U(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach(function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)}),e.arrowElement&&Object.keys(e.arrowStyles).length&&U(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,o,r){var i=g(0,t,e),a=m(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),U(t,{position:"absolute"}),n},gpuAcceleration:void 0}}},K=(p(Q,[{key:"update",value:function(){return function(){var e;this.state.isDestroyed||((e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}}).offsets.reference=g(this.state,this.popper,this.reference),e.placement=m(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=H(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position="absolute",e=C(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e)))}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,P(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[W("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=j(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),Q);function Q(e,t){var n=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};f(this,Q),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=i(this.update.bind(this)),this.options=T({},Q.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=t&&t.jquery?t[0]:t,this.options.modifiers={},Object.keys(T({},Q.Defaults.modifiers,o.modifiers)).forEach(function(e){n.options.modifiers[e]=T({},Q.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return T({name:e},n.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&a(e.onLoad)&&e.onLoad(n.reference,n.popper,n.options,e,n.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return K.Utils=("undefined"!=typeof window?window:global).PopperUtils,K.placements=I,K.Defaults=J,K});