(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.popper=b()})(this,function(){function an(a){return a&&"[object function]"==={}.tostring.call(a)}function a1(a,c){if(1!==a.nodetype){return[]}var b=getcomputedstyle(a,null);return c?b[c]:b}function an(a){return"html"===a.nodename?a:a.parentnode||a.host}function ak(a){if(!a){return document.body}switch(a.nodename){case"html":case"body":return a.ownerdocument.body;case"#document":return a.body}var b=a1(a),d=b.overflow,c=b.overflowx,f=b.overflowy;return/(auto|scroll)/.test(d+f+c)?a:ak(an(a))}function av(a){var c=a&&a.offsetparent,b=c&&c.nodename;return b&&"body"!==b&&"html"!==b?-1!==["td","table"].indexof(c.nodename)&&"static"===a1(c,"position")?av(c):c:a?a.ownerdocument.documentelement:document.documentelement}function aq(a){var b=a.nodename;return"body"!==b&&("html"===b||av(a.firstelementchild)===a)}function ay(a){return null===a.parentnode?a:ay(a.parentnode)}function ak(c,m){if(!c||!c.nodetype||!m||!m.nodetype){return document.documentelement}var k=c.comparedocumentposition(m)&node.document_position_following,g=k?c:m,j=k?m:c,b=document.createrange();b.setstart(g,0),b.setend(j,0);var h=b.commonancestorcontainer;if(c!==h&&m!==h||g.contains(j)){return aq(h)?h:av(h)}var d=ay(c);return d.host?ak(d.host,m):ak(c,ay(m).host)}function ac(a){var g=1=q.clientwidth&&d>=q.clientheight}),k=0b[i]&&!h.escapewithreference&&(j=ab(f[k],b[i]-("right"===i?f.width:f.height))),as({},k,j)}};return c.foreach(function(i){var j=-1===["left","top"].indexof(i)?"secondary":"primary";f=a0({},f,g[j](i))}),a.offsets.popper=f,a},priority:["left","right","top","bottom"],padding:5,boundarieselement:"scrollparent"},keeptogether:{order:400,enabled:!0,fn:function(f){var q=f.offsets,j=q.popper,g=q.reference,h=f.placement.split("-")[0],l=bb,k=-1!==["top","bottom"].indexof(h),m=k?"right":"bottom",c=k?"left":"top",b=k?"width":"height";return j[m]l(g[m])&&(f.offsets.popper[c]=l(g[m])),f}},arrow:{order:500,enabled:!0,fn:function(q,g){var b;if(!ar(q.instance.modifiers,"arrow","keeptogether")){return q}var f=g.element;if("string"==typeof f){if(f=q.instance.popper.queryselector(f),!f){return q}}else{if(!q.instance.popper.contains(f)){return console.warn("warning: `arrow.element` must be child of its popper element!"),q}}var i=q.placement.split("-")[0],h=q.offsets,j=h.popper,k=h.reference,c=-1!==["left","right"].indexof(i),c=c?"height":"width",x=c?"top":"left",d=x.tolowercase(),a=c?"left":"top",z=c?"bottom":"right",k=ag(f)[c];k[z]-kj[z]&&(q.offsets.popper[d]+=k[d]+k-j[z]),q.offsets.popper=ai(q.offsets.popper);var j=k[d]+k[c]/2-k/2,m=a1(q.instance.popper),n=parsefloat(m["margin"+x],10),t=parsefloat(m["border"+x+"width"],10),l=j-q.offsets.popper[d]-n-t;return l=ac(ab(j[c]-k,l),0),q.arrowelement=f,q.offsets.arrow=(b={},as(b,d,math.round(l)),as(b,a,""),b),q},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(a,h){if(ad(a.instance.modifiers,"inner")){return a}if(a.flipped&&a.placement===a.originalplacement){return a}var d=bc(a.instance.popper,a.instance.reference,h.padding,h.boundarieselement),b=a.placement.split("-")[0],c=ba(b),g=a.placement.split("-")[1]||"",f=[];switch(h.behavior){case ah.flip:f=[b,c];break;case ah.clockwise:f=at(b);break;case ah.counterclockwise:f=at(b,!0);break;default:f=h.behavior}return f.foreach(function(t,k){if(b!==t||f.length===k+1){return a}b=a.placement.split("-")[0],c=ba(b);var e=a.offsets.popper,q=a.offsets.reference,n=bb,r="left"===b&&n(e.right)>n(q.left)||"right"===b&&n(e.left)n(q.top)||"bottom"===b&&n(e.top)n(d.right),o=n(e.top)n(d.bottom),i="left"===b&&p||"right"===b&&j||"top"===b&&o||"bottom"===b&&v,x=-1!==["top","bottom"].indexof(b),z=!!h.flipvariations&&(x&&"start"===g&&p||x&&"end"===g&&j||!x&&"start"===g&&o||!x&&"end"===g&&v);(r||i||z)&&(a.flipped=!0,(r||i)&&(b=f[k+1]),z&&(g=ae(g)),a.placement=b+(g?"-"+g:""),a.offsets.popper=a0({},a.offsets.popper,az(a.instance.popper,a.offsets.reference,a.placement)),a=aj(a.instance.modifiers,a,"flip"))}),a},behavior:"flip",padding:5,boundarieselement:"viewport"},inner:{order:700,enabled:!1,fn:function(a){var j=a.placement,d=j.split("-")[0],b=a.offsets,c=b.popper,g=b.reference,f=-1!==["left","right"].indexof(d),h=-1===["top","left"].indexof(d);return c[f?"left":"top"]=g[d]-(h?c[f?"width":"height"]:0),a.placement=ba(j),a.offsets.popper=ai(c),a}},hide:{order:800,enabled:!0,fn:function(a){if(!ar(a.instance.modifiers,"hide","preventoverflow")){return a}var c=a.offsets.reference,b=a2(a.instance.modifiers,function(d){return"preventoverflow"===d.name}).boundaries;if(c.bottomb.right||c.top>b.bottom||c.right