!function(n,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t(require,exports,module):n.Tether=t()}(this,function(){"use strict";function it(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function n(n){var u=getComputedStyle(n),r=u.position,i,t;if("fixed"===r)return n;for(i=n;i=i.parentNode;){t=void 0;try{t=getComputedStyle(i)}catch(s){}if("undefined"==typeof t||null===t)return i;var f=t.overflow,e=t.overflowX,o=t.overflowY;if(/(auto|scroll)/.test(f+o+e)&&("absolute"!==r||["relative","absolute","fixed"].indexOf(t.position)>=0))return i}return document.body}function r(n){var i=void 0,r,u;n===document?(i=document,n=document.documentElement):i=n.ownerDocument;var f=i.documentElement,t={},e=n.getBoundingClientRect();for(r in e)t[r]=e[r];return u=vt(i),t.top-=u.top,t.left-=u.left,"undefined"==typeof t.width&&(t.width=document.body.scrollWidth-t.left-t.right),"undefined"==typeof t.height&&(t.height=document.body.scrollHeight-t.top-t.bottom),t.top=t.top-f.clientTop,t.left=t.left-f.clientLeft,t.right=i.body.clientWidth-t.width-t.left,t.bottom=i.body.clientHeight-t.height-t.top,t}function s(n){return n.offsetParent||document.documentElement}function a(){var t=document.createElement("div"),n,r,i,u;return t.style.width="100%",t.style.height="200px",n=document.createElement("div"),f(n.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),n.appendChild(t),document.body.appendChild(n),r=t.offsetWidth,n.style.overflow="scroll",i=t.offsetWidth,r===i&&(i=n.clientWidth),document.body.removeChild(n),u=r-i,{width:u,height:u}}function f(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=[];return Array.prototype.push.apply(t,arguments),t.slice(1).forEach(function(t){if(t)for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}),n}function h(n,t){if("undefined"!=typeof n.classList)t.split(" ").forEach(function(t){t.trim()&&n.classList.remove(t)});else{var i=new RegExp("(^| )"+t.split(" ").join("|")+"( |$)","gi"),r=d(n).replace(i," ");rt(n,r)}}function l(n,t){if("undefined"!=typeof n.classList)t.split(" ").forEach(function(t){t.trim()&&n.classList.add(t)});else{h(n,t);var i=d(n)+(" "+t);rt(n,i)}}function k(n,t){if("undefined"!=typeof n.classList)return n.classList.contains(t);var i=d(n);return new RegExp("(^| )"+t+"( |$)","gi").test(i)}function d(n){return n.className instanceof SVGAnimatedString?n.className.baseVal:n.className}function rt(n,t){n.setAttribute("class",t)}function c(n,t,i){i.forEach(function(i){-1===t.indexOf(i)&&k(n,i)&&h(n,i)});t.forEach(function(t){k(n,t)||l(n,t)})}function it(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function lt(n,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return n+i>=t&&t>=n-i}function g(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function ut(){for(var t={top:0,left:0},i=arguments.length,r=Array(i),n=0;i>n;n++)r[n]=arguments[n];return r.forEach(function(n){var i=n.top,r=n.left;"string"==typeof i&&(i=parseFloat(i,10));"string"==typeof r&&(r=parseFloat(r,10));t.top+=i;t.left+=r}),t}function v(n,t){return"string"==typeof n.left&&-1!==n.left.indexOf("%")&&(n.left=parseFloat(n.left,10)/100*t.width),"string"==typeof n.top&&-1!==n.top.indexOf("%")&&(n.top=parseFloat(n.top,10)/100*t.height),n}function at(n,t){return"scrollParent"===t?t=n.scrollParent:"window"===t&&(t=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),t===document&&(t=t.documentElement),"undefined"!=typeof t.nodeType&&!function(){var i=r(t),n=i,r=getComputedStyle(t);t=[n.left,n.top,i.width+n.left,i.height+n.top];dt.forEach(function(n,i){n=n[0].toUpperCase()+n.substr(1);"Top"===n||"Left"===n?t[i]+=parseFloat(r["border"+n+"Width"]):t[i]-=parseFloat(r["border"+n+"Width"])})}(),t}var y=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),i=void 0,e;"undefined"==typeof i&&(i={modules:[]});var ft=function(){var n=0;return function(){return++n}}(),o={},vt=function(n){var t=n._tetherZeroElement,i,r,f;if("undefined"==typeof t&&(t=n.createElement("div"),t.setAttribute("data-tether-id",ft()),f(t.style,{top:0,left:0,position:"absolute"}),n.body.appendChild(t),n._tetherZeroElement=t),i=t.getAttribute("data-tether-id"),"undefined"==typeof o[i]){o[i]={};r=t.getBoundingClientRect();for(f in r)o[i][f]=r[f];u(function(){delete o[i]})}return o[i]},et=[],u=function(n){et.push(n)},p=function(){for(var n=void 0;n=et.pop();)n()},yt=function(){function n(){it(this,n)}return y(n,[{key:"on",value:function(n,t,i){var r=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];"undefined"==typeof this.bindings&&(this.bindings={});"undefined"==typeof this.bindings[n]&&(this.bindings[n]=[]);this.bindings[n].push({handler:t,ctx:i,once:r})}},{key:"once",value:function(n,t,i){this.on(n,t,i,!0)}},{key:"off",value:function(n,t){if("undefined"==typeof this.bindings||"undefined"==typeof this.bindings[n])if("undefined"==typeof t)delete this.bindings[n];else for(var i=0;i<this.bindings[n].length;)this.bindings[n][i].handler===t?this.bindings[n].splice(i,1):++i}},{key:"trigger",value:function(n){var t;if("undefined"!=typeof this.bindings&&this.bindings[n])for(t=0;t<this.bindings[n].length;){var r=this.bindings[n][t],o=r.handler,s=r.ctx,h=r.once,u=s;"undefined"==typeof u&&(u=this);for(var f=arguments.length,e=Array(f>1?f-1:0),i=1;f>i;i++)e[i-1]=arguments[i];o.apply(u,e);h?this.bindings[n].splice(t,1):++t}}}]),n}();if(i.Utils={getScrollParent:n,getBounds:r,getOffsetParent:s,extend:f,addClass:l,removeClass:h,hasClass:k,updateClasses:c,defer:u,flush:p,uniqueId:ft,Evented:yt,getScrollBarSize:a},e=function(){function n(n,t){var r=[],u=!0,f=!1,e=void 0,o,i;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done)&&(r.push(o.value),!t||r.length!==t);u=!0);}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),y=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),"undefined"==typeof i)throw new Error("You must include the utils.js file before tether.js");var t=i.Utils,n=t.getScrollParent,r=t.getBounds,s=t.getOffsetParent,f=t.extend,l=t.addClass,h=t.removeClass,c=t.updateClasses,u=t.defer,p=t.flush,a=t.getScrollBarSize,nt=function(){for(var t,r=document.createElement("div"),i=["transform","webkitTransform","OTransform","MozTransform","msTransform"],n=0;n<i.length;++n)if(t=i[n],void 0!==r.style[t])return t}(),w=[],ot=function(){w.forEach(function(n){n.position(!1)});p()};!function(){var t=null,n=null,i=null,r=function u(){return"undefined"!=typeof n&&n>16?(n=Math.min(n-16,250),void(i=setTimeout(u,250))):void("undefined"!=typeof t&&g()-t<10||("undefined"!=typeof i&&(clearTimeout(i),i=null),t=g(),ot(),n=g()-t))};["resize","scroll","touchmove"].forEach(function(n){window.addEventListener(n,r)})}();var pt={center:"center",left:"right",right:"left"},wt={middle:"middle",top:"bottom",bottom:"top"},b={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},bt=function(n,t){var i=n.left,r=n.top;return"auto"===i&&(i=pt[t.left]),"auto"===r&&(r=wt[t.top]),{left:i,top:r}},st=function(n){var t=n.left,i=n.top;return"undefined"!=typeof b[n.left]&&(t=b[n.left]),"undefined"!=typeof b[n.top]&&(i=b[n.top]),{left:t,top:i}},tt=function(n){var i=n.split(" "),t=e(i,2),r=t[0],u=t[1];return{top:r,left:u}},ht=tt,ct=function(){function n(t){var r=this;it(this,n);this.position=this.position.bind(this);w.push(this);this.history=[];this.setOptions(t,!1);i.modules.forEach(function(n){"undefined"!=typeof n.initialize&&n.initialize.call(r)});this.position()}return y(n,[{key:"getClass",value:function(){var n=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=this.options.classes;return"undefined"!=typeof t&&t[n]?this.options.classes[n]:this.options.classPrefix?this.options.classPrefix+"-"+n:n}},{key:"setOptions",value:function(n){var t=this,r=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.options=f({offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},n);var i=this.options,u=i.element,f=i.target,e=i.targetModifier;if(this.element=u,this.target=f,this.targetModifier=e,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(n){if("undefined"==typeof t[n])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof t[n].jquery?t[n]=t[n][0]:"string"==typeof t[n]&&(t[n]=document.querySelector(t[n]))}),l(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&l(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=ht(this.options.targetAttachment);this.attachment=ht(this.options.attachment);this.offset=tt(this.options.offset);this.targetOffset=tt(this.options.targetOffset);"undefined"!=typeof this.scrollParent&&this.disable();this.scrollParent="scroll-handle"===this.targetModifier?this.target:n(this.target);this.options.enabled!==!1&&this.enable(r)}},{key:"getTargetBounds",value:function(){var n,t,i,o;if("undefined"==typeof this.targetModifier)return r(this.target);if("visible"===this.targetModifier)return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=r(this.target),n={height:t.height,width:t.width,top:t.top,left:t.left},n.height=Math.min(n.height,t.height-(pageYOffset-t.top)),n.height=Math.min(n.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),n.height=Math.min(innerHeight,n.height),n.height-=2,n.width=Math.min(n.width,t.width-(pageXOffset-t.left)),n.width=Math.min(n.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),n.width=Math.min(innerWidth,n.width),n.width-=2,n.top<pageYOffset&&(n.top=pageYOffset),n.left<pageXOffset&&(n.left=pageXOffset),n);if("scroll-handle"===this.targetModifier){t=void 0;i=this.target;i===document.body?(i=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=r(i);var u=getComputedStyle(i),s=i.scrollWidth>i.clientWidth||[u.overflow,u.overflowX].indexOf("scroll")>=0||this.target!==document.body,f=0;s&&(f=15);var r=t.height-parseFloat(u.borderTopWidth)-parseFloat(u.borderBottomWidth)-f,n={width:15,height:.975*r*(r/i.scrollHeight),left:t.left+t.width-parseFloat(u.borderLeftWidth)-15},e=0;return 408>r&&this.target===document.body&&(e=-.00011*Math.pow(r,2)-.00727*r+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),o=this.target.scrollTop/(i.scrollHeight-r),n.top=o*(r-n.height-e)+t.top+parseFloat(u.borderTopWidth),this.target===document.body&&(n.height=Math.max(n.height,24)),n}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(n,t){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[n]&&(this._cache[n]=t.call(this)),this._cache[n]}},{key:"enable",value:function(){var n=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];this.options.addTargetClasses!==!1&&l(this.target,this.getClass("enabled"));l(this.element,this.getClass("enabled"));this.enabled=!0;this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position);n&&this.position()}},{key:"disable",value:function(){h(this.target,this.getClass("enabled"));h(this.element,this.getClass("enabled"));this.enabled=!1;"undefined"!=typeof this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.position)}},{key:"destroy",value:function(){var n=this;this.disable();w.forEach(function(t,i){t===n})}},{key:"updateAttachClasses",value:function(n,t){var i=this,e,r,f;n=n||this.attachment;t=t||this.targetAttachment;e=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length);"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);r=this._addAttachClasses;n.top&&r.push(this.getClass("element-attached")+"-"+n.top);n.left&&r.push(this.getClass("element-attached")+"-"+n.left);t.top&&r.push(this.getClass("target-attached")+"-"+t.top);t.left&&r.push(this.getClass("target-attached")+"-"+t.left);f=[];e.forEach(function(n){f.push(i.getClass("element-attached")+"-"+n);f.push(i.getClass("target-attached")+"-"+n)});u(function(){"undefined"!=typeof i._addAttachClasses&&(c(i.element,i._addAttachClasses,f),i.options.addTargetClasses!==!1&&c(i.target,i._addAttachClasses,f),delete i._addAttachClasses)})}},{key:"position",value:function(){var s=this,tt=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],l,w,nt,e,n,o;if(this.enabled){this.clearCache();l=bt(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,l);var y=this.cache("element-bounds",function(){return r(s.element)}),t=y.width,r=y.height;0===t&&0===r&&"undefined"!=typeof this.lastSize?(w=this.lastSize,t=w.width,r=w.height):this.lastSize={width:t,height:r};var a=this.cache("target-bounds",function(){return s.getTargetBounds()}),k=a,h=v(st(this.attachment),{width:t,height:r}),c=v(st(l),k),d=v(this.offset,{width:t,height:r}),g=v(this.targetOffset,k);h=ut(h,d);c=ut(c,g);for(var u=a.left+c.left-h.left,f=a.top+c.top-h.top,b=0;b<i.modules.length;++b){if(nt=i.modules[b],e=nt.position.call(this,{left:u,top:f,targetAttachment:l,targetPos:a,elementPos:y,offset:h,targetOffset:c,manualOffset:d,manualTargetOffset:g,scrollbarSize:o,attachment:this.attachment}),e===!1)return!1;"undefined"!=typeof e&&"object"==typeof e&&(f=e.top,u=e.left)}return n={page:{top:f,left:u},viewport:{top:f-pageYOffset,bottom:pageYOffset-f-r+innerHeight,left:u-pageXOffset,right:pageXOffset-u-t+innerWidth}},o=void 0,document.body.scrollWidth>window.innerWidth&&(o=this.cache("scrollbar-size",a),n.viewport.bottom-=o.height),document.body.scrollHeight>window.innerHeight&&(o=this.cache("scrollbar-size",a),n.viewport.right-=o.width),(-1===["","static"].indexOf(document.body.style.position)||-1===["","static"].indexOf(document.body.parentElement.style.position))&&(n.page.bottom=document.body.scrollHeight-f-r,n.page.right=document.body.scrollWidth-u-t),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var r=s.cache("target-offsetparent",function(){return s(s.target)}),t=s.cache("target-offsetparent-bounds",function(){return r(r)}),o=getComputedStyle(r),u=t,i={},f,e;(["Top","Left","Bottom","Right"].forEach(function(n){i[n.toLowerCase()]=parseFloat(o["border"+n+"Width"])}),t.right=document.body.scrollWidth-t.left-u.width+i.right,t.bottom=document.body.scrollHeight-t.top-u.height+i.bottom,n.page.top>=t.top+i.top&&n.page.bottom>=t.bottom&&n.page.left>=t.left+i.left&&n.page.right>=t.right)&&(f=r.scrollTop,e=r.scrollLeft,n.offset={top:n.page.top-t.top+f-i.top,left:n.page.left-t.left+e-i.left})}(),this.move(n),this.history.unshift(n),this.history.length>3&&this.history.pop(),tt&&p(),!0}}},{key:"move",value:function(n){var r=this,t,e,a,c,v,y,o,p,w,f,s,h;if("undefined"!=typeof this.element.parentNode){t={};for(e in n){t[e]={};for(f in n[e]){for(a=!1,c=0;c<this.history.length;++c)if(v=this.history[c],"undefined"!=typeof v[e]&&!lt(v[e][f],n[e][f])){a=!0;break}a||(t[e][f]=!0)}}var i={top:"",left:"",right:"",bottom:""},l=function(n,t){var e="undefined"!=typeof r.options.optimizations,o=e?r.options.optimizations.gpu:null,u,f;o!==!1?(u=void 0,f=void 0,n.top?(i.top=0,u=t.top):(i.bottom=0,u=-t.bottom),n.left?(i.left=0,f=t.left):(i.right=0,f=-t.right),i[nt]="translateX("+Math.round(f)+"px) translateY("+Math.round(u)+"px)","msTransform"!==nt&&(i[nt]+=" translateZ(0)")):(n.top?i.top=t.top+"px":i.bottom=t.bottom+"px",n.left?i.left=t.left+"px":i.right=t.right+"px")},b=!1;if((t.page.top||t.page.bottom)&&(t.page.left||t.page.right)?(i.position="absolute",l(t.page,n.page)):(t.viewport.top||t.viewport.bottom)&&(t.viewport.left||t.viewport.right)?(i.position="fixed",l(t.viewport,n.viewport)):"undefined"!=typeof t.offset&&t.offset.top&&t.offset.left?!function(){i.position="absolute";var f=r.cache("target-offsetparent",function(){return s(r.target)});s(r.element)!==f&&u(function(){r.element.parentNode.removeChild(r.element);f.appendChild(r.element)});l(t.offset,n.offset);b=!0}():(i.position="absolute",l({top:!0,left:!0},n.page)),!b){for(y=!0,o=this.element.parentNode;o&&"BODY"!==o.tagName;){if("static"!==getComputedStyle(o).position){y=!1;break}o=o.parentNode}y||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element))}p={};w=!1;for(f in i)s=i[f],h=this.element.style[f],""!==h&&""!==s&&["top","left","bottom","right"].indexOf(f)>=0&&(h=parseFloat(h),s=parseFloat(s)),h!==s&&(w=!0,p[f]=s);w&&u(function(){f(r.element.style,p)})}}}]),n}();ct.modules=[];i.position=ot;var kt=f(ct,i),e=function(){function n(n,t){var r=[],u=!0,f=!1,e=void 0,o,i;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done)&&(r.push(o.value),!t||r.length!==t);u=!0);}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),t=i.Utils,r=t.getBounds,f=t.extend,c=t.updateClasses,u=t.defer,dt=["left","top","right","bottom"];i.modules.push({position:function(n){var h=this,i=n.top,r=n.left,y=n.targetAttachment,p;if(!this.options.constraints)return!0;var w=this.cache("element-bounds",function(){return r(h.element)}),o=w.height,s=w.width;0===s&&0===o&&"undefined"!=typeof this.lastSize&&(p=this.lastSize,s=p.width,o=p.height);var b=this.cache("target-bounds",function(){return h.getTargetBounds()}),c=b.height,l=b.width,a=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(n){var t=n.outOfBoundsClass,i=n.pinnedClass;t&&a.push(t);i&&a.push(i)});a.forEach(function(n){["left","top","right","bottom"].forEach(function(t){a.push(n+"-"+t)})});var v=[],f=f({},y),t=f({},this.attachment);return this.options.constraints.forEach(function(n){var tt=n.to,d=n.attachment,a=n.pin,w,b,nt,g,u,p,k;"undefined"==typeof d&&(d="");w=void 0;b=void 0;d.indexOf(" ")>=0?(nt=d.split(" "),g=e(nt,2),b=g[0],w=g[1]):w=b=d;u=at(h,tt);("target"===b||"both"===b)&&(i<u[1]&&"top"===f.top&&(i+=c,f.top="bottom"),i+o>u[3]&&"bottom"===f.top&&(i-=c,f.top="top"));"together"===b&&(i<u[1]&&"top"===f.top&&("bottom"===t.top?(i+=c,f.top="bottom",i+=o,t.top="top"):"top"===t.top&&(i+=c,f.top="bottom",i-=o,t.top="bottom")),i+o>u[3]&&"bottom"===f.top&&("top"===t.top?(i-=c,f.top="top",i-=o,t.top="bottom"):"bottom"===t.top&&(i-=c,f.top="top",i+=o,t.top="top")),"middle"===f.top&&(i+o>u[3]&&"top"===t.top?(i-=o,t.top="bottom"):i<u[1]&&"bottom"===t.top&&(i+=o,t.top="top")));("target"===w||"both"===w)&&(r<u[0]&&"left"===f.left&&(r+=l,f.left="right"),r+s>u[2]&&"right"===f.left&&(r-=l,f.left="left"));"together"===w&&(r<u[0]&&"left"===f.left?"right"===t.left?(r+=l,f.left="right",r+=s,t.left="left"):"left"===t.left&&(r+=l,f.left="right",r-=s,t.left="right"):r+s>u[2]&&"right"===f.left?"left"===t.left?(r-=l,f.left="left",r-=s,t.left="right"):"right"===t.left&&(r-=l,f.left="left",r+=s,t.left="left"):"center"===f.left&&(r+s>u[2]&&"left"===t.left?(r-=s,t.left="right"):r<u[0]&&"right"===t.left&&(r+=s,t.left="left")));("element"===b||"both"===b)&&(i<u[1]&&"bottom"===t.top&&(i+=o,t.top="top"),i+o>u[3]&&"top"===t.top&&(i-=o,t.top="bottom"));("element"===w||"both"===w)&&(r<u[0]&&"right"===t.left&&(r+=s,t.left="left"),r+s>u[2]&&"left"===t.left&&(r-=s,t.left="right"));"string"==typeof a?a=a.split(",").map(function(n){return n.trim()}):a===!0&&(a=["top","left","right","bottom"]);a=a||[];p=[];k=[];i<u[1]&&(a.indexOf("top")>=0?(i=u[1],p.push("top")):k.push("top"));i+o>u[3]&&(a.indexOf("bottom")>=0?(i=u[3]-o,p.push("bottom")):k.push("bottom"));r<u[0]&&(a.indexOf("left")>=0?(r=u[0],p.push("left")):k.push("left"));r+s>u[2]&&(a.indexOf("right")>=0?(r=u[2]-s,p.push("right")):k.push("right"));p.length&&!function(){var n=void 0;n="undefined"!=typeof h.options.pinnedClass?h.options.pinnedClass:h.getClass("pinned");v.push(n);p.forEach(function(t){v.push(n+"-"+t)})}();k.length&&!function(){var n=void 0;n="undefined"!=typeof h.options.outOfBoundsClass?h.options.outOfBoundsClass:h.getClass("out-of-bounds");v.push(n);k.forEach(function(t){v.push(n+"-"+t)})}();(p.indexOf("left")>=0||p.indexOf("right")>=0)&&(t.left=f.left=!1);(p.indexOf("top")>=0||p.indexOf("bottom")>=0)&&(t.top=f.top=!1);(f.top!==y.top||f.left!==y.left||t.top!==h.attachment.top||t.left!==h.attachment.left)&&h.updateAttachClasses(t,f)}),u(function(){h.options.addTargetClasses!==!1&&c(h.target,v,a);c(h.element,v,a)}),{top:i,left:r}}});var t=i.Utils,r=t.getBounds,c=t.updateClasses,u=t.defer;return i.modules.push({position:function(n){var t=this,o=n.top,s=n.left,h=this.cache("element-bounds",function(){return r(t.element)}),a=h.height,v=h.width,i=this.getTargetBounds(),c=o+a,l=s+v,r=[];o<=i.bottom&&c>=i.top&&["left","right"].forEach(function(n){var t=i[n];(t===s||t===l)&&r.push(n)});s<=i.right&&l>=i.left&&["top","bottom"].forEach(function(n){var t=i[n];(t===o||t===c)&&r.push(n)});var f=[],e=[];return f.push(this.getClass("abutted")),["left","top","right","bottom"].forEach(function(n){f.push(t.getClass("abutted")+"-"+n)}),r.length&&e.push(this.getClass("abutted")),r.forEach(function(n){e.push(t.getClass("abutted")+"-"+n)}),u(function(){t.options.addTargetClasses!==!1&&c(t.target,e,f);c(t.element,e,f)}),!0}}),e=function(){function n(n,t){var r=[],u=!0,f=!1,e=void 0,o,i;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done)&&(r.push(o.value),!t||r.length!==t);u=!0);}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),i.modules.push({position:function(n){var u=n.top,f=n.left,t,i,r,o;if(this.options.shift)return t=this.options.shift,"function"==typeof this.options.shift&&(t=this.options.shift.call(this,{top:u,left:f})),i=void 0,r=void 0,"string"==typeof t?(t=t.split(" "),t[1]=t[1]||t[0],o=e(t,2),i=o[0],r=o[1],i=parseFloat(i,10),r=parseFloat(r,10)):(i=t.top,r=t.left),u+=i,f+=r,{top:u,left:f}}}),kt})