!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 rt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function c(n){var f=n.getBoundingClientRect(),t={},r,u,i;for(r in f)t[r]=f[r];return n.ownerDocument!==document&&(u=n.ownerDocument.defaultView.frameElement,u&&(i=c(u),t.top+=i.top,t.bottom+=i.top,t.left+=i.left,t.right+=i.left)),t}function ut(n){var e=getComputedStyle(n)||{},f=e.position,i=[],t,r;if("fixed"===f)return[n];for(t=n;(t=t.parentNode)&&t&&1===t.nodeType;){r=void 0;try{r=getComputedStyle(t)}catch(c){}if("undefined"==typeof r||null===r)return i.push(t),i;var u=r,o=u.overflow,s=u.overflowX,h=u.overflowY;/(auto|scroll)/.test(o+h+s)&&("absolute"!==f||["relative","absolute","fixed"].indexOf(r.position)>=0)&&i.push(t)}return i.push(n.ownerDocument.body),n.ownerDocument!==document&&i.push(n.ownerDocument.defaultView),i}function ft(){s&&document.body.removeChild(s);s=null}function i(n){var i=void 0;n===document?(i=document,n=document.documentElement):i=n.ownerDocument;var r=i.documentElement,t=c(n),u=dt();return 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-r.clientTop,t.left=t.left-r.clientLeft,t.right=i.body.clientWidth-t.width-t.left,t.bottom=i.body.clientHeight-t.height-t.top,t}function l(n){return n.offsetParent||document.documentElement}function w(){var t,n,u,i,f;return g?g:(t=document.createElement("div"),t.style.width="100%",t.style.height="200px",n=document.createElement("div"),r(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),u=t.offsetWidth,n.style.overflow="scroll",i=t.offsetWidth,u===i&&(i=n.clientWidth),document.body.removeChild(n),f=u-i,g={width:f,height:f})}function r(){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 o(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=k(n).replace(i," ");et(n,r)}}function e(n,t){if("undefined"!=typeof n.classList)t.split(" ").forEach(function(t){t.trim()&&n.classList.add(t)});else{o(n,t);var i=k(n)+(" "+t);et(n,i)}}function b(n,t){if("undefined"!=typeof n.classList)return n.classList.contains(t);var i=k(n);return new RegExp("(^| )"+t+"( |$)","gi").test(i)}function k(n){return n.className instanceof n.ownerDocument.defaultView.SVGAnimatedString?n.className.baseVal:n.className}function et(n,t){n.setAttribute("class",t)}function u(n,t,i){i.forEach(function(i){t.indexOf(i)===-1&&b(n,i)&&o(n,i)});t.forEach(function(t){b(n,t)||e(n,t)})}function rt(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function wt(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}function bt(n,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return n+i>=t&&t>=n-i}function d(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function ot(){for(var t={top:0,left:0},i=arguments.length,r=Array(i),n=0;n<i;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 a(n,t){return"string"==typeof n.left&&n.left.indexOf("%")!==-1&&(n.left=parseFloat(n.left,10)/100*t.width),"string"==typeof n.top&&n.top.indexOf("%")!==-1&&(n.top=parseFloat(n.top,10)/100*t.height),n}function kt(n,t){return"scrollParent"===t?t=n.scrollParents[0]:"window"===t&&(t=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),t===document&&(t=t.documentElement),"undefined"!=typeof t.nodeType&&!function(){var f=t,u=i(t),r=u,e=getComputedStyle(t),n;(t=[r.left,r.top,u.width+r.left,u.height+r.top],f.ownerDocument!==document)&&(n=f.ownerDocument.defaultView,t[0]+=n.pageXOffset,t[1]+=n.pageYOffset,t[2]+=n.pageXOffset,t[3]+=n.pageYOffset);ui.forEach(function(n,i){n=n[0].toUpperCase()+n.substr(1);"Top"===n||"Left"===n?t[i]+=parseFloat(e["border"+n+"Width"]):t[i]-=parseFloat(e["border"+n+"Width"])})}(),t}var st=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}}(),t=void 0,y;"undefined"==typeof t&&(t={modules:[]});var s=null,ht=function(){var n=0;return function(){return++n}}(),v={},dt=function(){var n=s,t;return n&&document.body.contains(n)||(n=document.createElement("div"),n.setAttribute("data-tether-id",ht()),r(n.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(n),s=n),t=n.getAttribute("data-tether-id"),"undefined"==typeof v[t]&&(v[t]=c(n),f(function(){delete v[t]})),v[t]},g=null,ct=[],f=function(n){ct.push(n)},nt=function(){for(var n=void 0;n=ct.pop();)n()},lt=function(){function n(){rt(this,n)}return st(n,[{key:"on",value:function(n,t,i){var r=!(arguments.length<=3||void 0===arguments[3])&&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){if("undefined"!=typeof this.bindings&&this.bindings[n]){for(var t=0,r=arguments.length,e=Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];for(;t<this.bindings[n].length;){var u=this.bindings[n][t],o=u.handler,s=u.ctx,h=u.once,f=s;"undefined"==typeof f&&(f=this);o.apply(f,e);h?this.bindings[n].splice(t,1):++t}}}}]),n}();t.Utils={getActualBoundingClientRect:c,getScrollParents:ut,getBounds:i,getOffsetParent:l,extend:r,addClass:e,removeClass:o,hasClass:b,updateClasses:u,defer:f,flush:nt,uniqueId:ht,Evented:lt,getScrollBarSize:w,removeUtilElements:ft};var y=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");}}(),st=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}}(),gt=function(n,t,i){for(var r,o,e,u=!0;u;){var f=n,s=t,h=i;if(u=!1,null===f&&(f=Function.prototype),r=Object.getOwnPropertyDescriptor(f,s),void 0!==r)return"value"in r?r.value:(o=r.get,void 0===o)?void 0:o.call(h);if(e=Object.getPrototypeOf(f),null===e)return;n=e;t=s;i=h;u=!0;r=e=void 0}};if("undefined"==typeof t)throw new Error("You must include the utils.js file before tether.js");var n=t.Utils,ut=n.getScrollParents,i=n.getBounds,l=n.getOffsetParent,r=n.extend,e=n.addClass,o=n.removeClass,u=n.updateClasses,f=n.defer,nt=n.flush,w=n.getScrollBarSize,ft=n.removeUtilElements,tt=function(){var t;if("undefined"==typeof document)return"";for(var 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}(),h=[],at=function(){h.forEach(function(n){n.position(!1)});nt()};!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&&d()-t<10||(null!=i&&(clearTimeout(i),i=null),t=d(),at(),n=d()-t))};"undefined"!=typeof window&&"undefined"!=typeof addEventListener&&["resize","scroll","touchmove"].forEach(function(n){window.addEventListener(n,r)})}();var ni={center:"center",left:"right",right:"left"},ti={middle:"middle",top:"bottom",bottom:"top"},p={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},ii=function(n,t){var i=n.left,r=n.top;return"auto"===i&&(i=ni[t.left]),"auto"===r&&(r=ti[t.top]),{left:i,top:r}},vt=function(n){var t=n.left,i=n.top;return"undefined"!=typeof p[n.left]&&(t=p[n.left]),"undefined"!=typeof p[n.top]&&(i=p[n.top]),{left:t,top:i}},it=function(n){var i=n.split(" "),t=y(i,2),r=t[0],u=t[1];return{top:r,left:u}},yt=it,pt=function(n){function s(n){var i=this;rt(this,s);gt(Object.getPrototypeOf(s.prototype),"constructor",this).call(this);this.position=this.position.bind(this);h.push(this);this.history=[];this.setOptions(n,!1);t.modules.forEach(function(n){"undefined"!=typeof n.initialize&&n.initialize.call(i)});this.position()}return wt(s,n),st(s,[{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,u=arguments.length<=1||void 0===arguments[1]||arguments[1];this.options=r({offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},n);var i=this.options,f=i.element,o=i.target,s=i.targetModifier;if(this.element=f,this.target=o,this.targetModifier=s,"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]))}),e(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&e(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=yt(this.options.targetAttachment);this.attachment=yt(this.options.attachment);this.offset=it(this.options.offset);this.targetOffset=it(this.options.targetOffset);"undefined"!=typeof this.scrollParents&&this.disable();this.scrollParents="scroll-handle"===this.targetModifier?[this.target]:ut(this.target);this.options.enabled!==!1&&this.enable(u)}},{key:"getTargetBounds",value:function(){var n,t,r,s;if("undefined"==typeof this.targetModifier)return i(this.target);if("visible"===this.targetModifier)return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=i(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;r=this.target;r===document.body?(r=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=i(r);var f=getComputedStyle(r),h=r.scrollWidth>r.clientWidth||[f.overflow,f.overflowX].indexOf("scroll")>=0||this.target!==document.body,e=0;h&&(e=15);var u=t.height-parseFloat(f.borderTopWidth)-parseFloat(f.borderBottomWidth)-e,n={width:15,height:.975*u*(u/r.scrollHeight),left:t.left+t.width-parseFloat(f.borderLeftWidth)-15},o=0;return u<408&&this.target===document.body&&(o=-.00011*Math.pow(u,2)-.00727*u+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),s=this.target.scrollTop/(r.scrollHeight-u),n.top=s*(u-n.height-o)+t.top+parseFloat(f.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=this,t=arguments.length<=0||void 0===arguments[0]||arguments[0];this.options.addTargetClasses!==!1&&e(this.target,this.getClass("enabled"));e(this.element,this.getClass("enabled"));this.enabled=!0;this.scrollParents.forEach(function(t){t!==n.target.ownerDocument&&t.addEventListener("scroll",n.position)});t&&this.position()}},{key:"disable",value:function(){var n=this;o(this.target,this.getClass("enabled"));o(this.element,this.getClass("enabled"));this.enabled=!1;"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(t){t.removeEventListener("scroll",n.position)})}},{key:"destroy",value:function(){var n=this;this.disable();h.forEach(function(t,i){t===n&&h.splice(i,1)});0===h.length&&ft()}},{key:"updateAttachClasses",value:function(n,t){var i=this,o,r,e;n=n||this.attachment;t=t||this.targetAttachment;o=["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);e=[];o.forEach(function(n){e.push(i.getClass("element-attached")+"-"+n);e.push(i.getClass("target-attached")+"-"+n)});f(function(){"undefined"!=typeof i._addAttachClasses&&(u(i.element,i._addAttachClasses,e),i.options.addTargetClasses!==!1&&u(i.target,i._addAttachClasses,e),delete i._addAttachClasses)})}},{key:"position",value:function(){var h=this,et=arguments.length<=0||void 0===arguments[0]||arguments[0],p,d,ut,s;if(this.enabled){this.clearCache();p=ii(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,p);var k=this.cache("element-bounds",function(){return i(h.element)}),u=k.width,f=k.height;0===u&&0===f&&"undefined"!=typeof this.lastSize?(d=this.lastSize,u=d.width,f=d.height):this.lastSize={width:u,height:f};var b=this.cache("target-bounds",function(){return h.getTargetBounds()}),tt=b,c=a(vt(this.attachment),{width:u,height:f}),v=a(vt(p),tt),it=a(this.offset,{width:u,height:f}),rt=a(this.targetOffset,tt);c=ot(c,it);v=ot(v,rt);for(var e=b.left+v.left-c.left,o=b.top+v.top-c.top,g=0;g<t.modules.length;++g){if(ut=t.modules[g],s=ut.position.call(this,{left:e,top:o,targetAttachment:p,targetPos:b,elementPos:k,offset:c,targetOffset:v,manualOffset:it,manualTargetOffset:rt,scrollbarSize:y,attachment:this.attachment}),s===!1)return!1;"undefined"!=typeof s&&"object"==typeof s&&(o=s.top,e=s.left)}var n={page:{top:o,left:e},viewport:{top:o-pageYOffset,bottom:pageYOffset-o-f+innerHeight,left:e-pageXOffset,right:pageXOffset-e-u+innerWidth}},r=this.target.ownerDocument,ft=r.defaultView,y=void 0;return ft.innerHeight>r.documentElement.clientHeight&&(y=this.cache("scrollbar-size",w),n.viewport.bottom-=y.height),ft.innerWidth>r.documentElement.clientWidth&&(y=this.cache("scrollbar-size",w),n.viewport.right-=y.width),["","static"].indexOf(r.body.style.position)!==-1&&["","static"].indexOf(r.body.parentElement.style.position)!==-1||(n.page.bottom=r.body.scrollHeight-o-f,n.page.right=r.body.scrollWidth-e-u),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var f=h.cache("target-offsetparent",function(){return l(h.target)}),t=h.cache("target-offsetparent-bounds",function(){return i(f)}),c=getComputedStyle(f),e=t,u={},o,s;(["Top","Left","Bottom","Right"].forEach(function(n){u[n.toLowerCase()]=parseFloat(c["border"+n+"Width"])}),t.right=r.body.scrollWidth-t.left-e.width+u.right,t.bottom=r.body.scrollHeight-t.top-e.height+u.bottom,n.page.top>=t.top+u.top&&n.page.bottom>=t.bottom&&n.page.left>=t.left+u.left&&n.page.right>=t.right)&&(o=f.scrollTop,s=f.scrollLeft,n.offset={top:n.page.top-t.top+o-u.top,left:n.page.left-t.left+s-u.left})}(),this.move(n),this.history.unshift(n),this.history.length>3&&this.history.pop(),et&&nt(),!0}}},{key:"move",value:function(n){var u=this,t,o,a,h,v,y,s,p,w,e,b,d;if("undefined"!=typeof this.element.parentNode){t={};for(o in n){t[o]={};for(e in n[o]){for(a=!1,h=0;h<this.history.length;++h)if(v=this.history[h],"undefined"!=typeof v[o]&&!bt(v[o][e],n[o][e])){a=!0;break}a||(t[o][e]=!0)}}var i={top:"",left:"",right:"",bottom:""},c=function(n,t){var o="undefined"!=typeof u.options.optimizations,s=o?u.options.optimizations.gpu:null,r,f,e;s!==!1?(r=void 0,f=void 0,(n.top?(i.top=0,r=t.top):(i.bottom=0,r=-t.bottom),n.left?(i.left=0,f=t.left):(i.right=0,f=-t.right),window.matchMedia)&&(e=window.matchMedia("only screen and (min-resolution: 1.3dppx)").matches||window.matchMedia("only screen and (-webkit-min-device-pixel-ratio: 1.3)").matches,e||(f=Math.round(f),r=Math.round(r))),i[tt]="translateX("+f+"px) translateY("+r+"px)","msTransform"!==tt&&(i[tt]+=" 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")},k=!1;if((t.page.top||t.page.bottom)&&(t.page.left||t.page.right)?(i.position="absolute",c(t.page,n.page)):(t.viewport.top||t.viewport.bottom)&&(t.viewport.left||t.viewport.right)?(i.position="fixed",c(t.viewport,n.viewport)):"undefined"!=typeof t.offset&&t.offset.top&&t.offset.left?!function(){i.position="absolute";var r=u.cache("target-offsetparent",function(){return l(u.target)});l(u.element)!==r&&f(function(){u.element.parentNode.removeChild(u.element);r.appendChild(u.element)});c(t.offset,n.offset);k=!0}():(i.position="absolute",c({top:!0,left:!0},n.page)),!k)if(this.options.bodyElement)this.options.bodyElement.appendChild(this.element);else{for(y=!0,s=this.element.parentNode;s&&1===s.nodeType&&"BODY"!==s.tagName;){if("static"!==getComputedStyle(s).position){y=!1;break}s=s.parentNode}y||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}p={};w=!1;for(e in i)b=i[e],d=this.element.style[e],d!==b&&(w=!0,p[e]=b);w&&f(function(){r(u.element.style,p);u.trigger("repositioned")})}}}]),s}(lt);pt.modules=[];t.position=at;var ri=r(pt,t),y=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");}}(),n=t.Utils,i=n.getBounds,r=n.extend,u=n.updateClasses,f=n.defer,ui=["left","top","right","bottom"];t.modules.push({position:function(n){var l=this,e=n.top,o=n.left,b=n.targetAttachment,k;if(!this.options.constraints)return!0;var d=this.cache("element-bounds",function(){return i(l.element)}),h=d.height,c=d.width;0===c&&0===h&&"undefined"!=typeof this.lastSize&&(k=this.lastSize,c=k.width,h=k.height);var g=this.cache("target-bounds",function(){return l.getTargetBounds()}),a=g.height,v=g.width,p=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(n){var t=n.outOfBoundsClass,i=n.pinnedClass;t&&p.push(t);i&&p.push(i)});p.forEach(function(n){["left","top","right","bottom"].forEach(function(t){p.push(n+"-"+t)})});var w=[],s=r({},b),t=r({},this.attachment);return this.options.constraints.forEach(function(n){var tt=n.to,d=n.attachment,r=n.pin,f,p,nt,g,i,u,k;"undefined"==typeof d&&(d="");f=void 0;p=void 0;d.indexOf(" ")>=0?(nt=d.split(" "),g=y(nt,2),p=g[0],f=g[1]):f=p=d;i=kt(l,tt);"target"!==p&&"both"!==p||(e<i[1]&&"top"===s.top&&(e+=a,s.top="bottom"),e+h>i[3]&&"bottom"===s.top&&(e-=a,s.top="top"));"together"===p&&("top"===s.top&&("bottom"===t.top&&e<i[1]?(e+=a,s.top="bottom",e+=h,t.top="top"):"top"===t.top&&e+h>i[3]&&e-(h-a)>=i[1]&&(e-=h-a,s.top="bottom",t.top="bottom")),"bottom"===s.top&&("top"===t.top&&e+h>i[3]?(e-=a,s.top="top",e-=h,t.top="bottom"):"bottom"===t.top&&e<i[1]&&e+(2*h-a)<=i[3]&&(e+=h-a,s.top="top",t.top="top")),"middle"===s.top&&(e+h>i[3]&&"top"===t.top?(e-=h,t.top="bottom"):e<i[1]&&"bottom"===t.top&&(e+=h,t.top="top")));"target"!==f&&"both"!==f||(o<i[0]&&"left"===s.left&&(o+=v,s.left="right"),o+c>i[2]&&"right"===s.left&&(o-=v,s.left="left"));"together"===f&&(o<i[0]&&"left"===s.left?"right"===t.left?(o+=v,s.left="right",o+=c,t.left="left"):"left"===t.left&&(o+=v,s.left="right",o-=c,t.left="right"):o+c>i[2]&&"right"===s.left?"left"===t.left?(o-=v,s.left="left",o-=c,t.left="right"):"right"===t.left&&(o-=v,s.left="left",o+=c,t.left="left"):"center"===s.left&&(o+c>i[2]&&"left"===t.left?(o-=c,t.left="right"):o<i[0]&&"right"===t.left&&(o+=c,t.left="left")));"element"!==p&&"both"!==p||(e<i[1]&&"bottom"===t.top&&(e+=h,t.top="top"),e+h>i[3]&&"top"===t.top&&(e-=h,t.top="bottom"));"element"!==f&&"both"!==f||(o<i[0]&&("right"===t.left?(o+=c,t.left="left"):"center"===t.left&&(o+=c/2,t.left="left")),o+c>i[2]&&("left"===t.left?(o-=c,t.left="right"):"center"===t.left&&(o-=c/2,t.left="right")));"string"==typeof r?r=r.split(",").map(function(n){return n.trim()}):r===!0&&(r=["top","left","right","bottom"]);r=r||[];u=[];k=[];e<i[1]&&(r.indexOf("top")>=0?(e=i[1],u.push("top")):k.push("top"));e+h>i[3]&&(r.indexOf("bottom")>=0?(e=i[3]-h,u.push("bottom")):k.push("bottom"));o<i[0]&&(r.indexOf("left")>=0?(o=i[0],u.push("left")):k.push("left"));o+c>i[2]&&(r.indexOf("right")>=0?(o=i[2]-c,u.push("right")):k.push("right"));u.length&&!function(){var n=void 0;n="undefined"!=typeof l.options.pinnedClass?l.options.pinnedClass:l.getClass("pinned");w.push(n);u.forEach(function(t){w.push(n+"-"+t)})}();k.length&&!function(){var n=void 0;n="undefined"!=typeof l.options.outOfBoundsClass?l.options.outOfBoundsClass:l.getClass("out-of-bounds");w.push(n);k.forEach(function(t){w.push(n+"-"+t)})}();(u.indexOf("left")>=0||u.indexOf("right")>=0)&&(t.left=s.left=!1);(u.indexOf("top")>=0||u.indexOf("bottom")>=0)&&(t.top=s.top=!1);s.top===b.top&&s.left===b.left&&t.top===l.attachment.top&&t.left===l.attachment.left||(l.updateAttachClasses(t,s),l.trigger("update",{attachment:t,targetAttachment:s}))}),f(function(){l.options.addTargetClasses!==!1&&u(l.target,w,p);u(l.element,w,p)}),{top:e,left:o}}});var n=t.Utils,i=n.getBounds,u=n.updateClasses,f=n.defer;return t.modules.push({position:function(n){var t=this,h=n.top,c=n.left,l=this.cache("element-bounds",function(){return i(t.element)}),y=l.height,p=l.width,r=this.getTargetBounds(),a=h+y,v=c+p,e=[];h<=r.bottom&&a>=r.top&&["left","right"].forEach(function(n){var t=r[n];t!==c&&t!==v||e.push(n)});c<=r.right&&v>=r.left&&["top","bottom"].forEach(function(n){var t=r[n];t!==h&&t!==a||e.push(n)});var o=[],s=[];return o.push(this.getClass("abutted")),["left","top","right","bottom"].forEach(function(n){o.push(t.getClass("abutted")+"-"+n)}),e.length&&s.push(this.getClass("abutted")),e.forEach(function(n){s.push(t.getClass("abutted")+"-"+n)}),f(function(){t.options.addTargetClasses!==!1&&u(t.target,s,o);u(t.element,s,o)}),!0}}),y=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.modules.push({position:function(n){var u=n.top,f=n.left,t,i,r,o,e;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=t,e=y(o,2),i=e[0],r=e[1],i=parseFloat(i,10),r=parseFloat(r,10)):(i=t.top,r=t.left),u+=i,f+=r,{top:u,left:f}}}),ri})