/** * sticky-sidebar - a javascript plugin for making smart and high performance. * @version v3.3.1 * @link https://github.com/abouolia/sticky-sidebar * @author ahmed bouhuolia * @license the mit license (mit) **/ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.stickysidebar={})}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e,i,n=(function(t,e){(function(t){object.defineproperty(t,"__esmodule",{value:!0});var l,n,e=function(){function n(t,e){for(var i=0;i=t.containerbottom?(t.translatey=t.containerbottom-e,o="container-bottom"):i>=t.containertop&&(t.translatey=i-t.containertop,o="viewport-top"):t.containerbottom<=n?(t.translatey=t.containerbottom-e,o="container-bottom"):e+t.translatey<=n?(t.translatey=n-e,o="viewport-bottom"):t.containertop+t.translatey<=i&&0!==t.translatey&&t.maxtranslatey!==t.translatey&&(o="viewport-unbottom"),o}},{key:"_getaffixtypescrollingup",value:function(){var t=this.dimensions,e=t.sidebarheight+t.containertop,i=t.viewporttop+t.topspacing,n=t.viewportbottom-t.bottomspacing,o=this.affixedtype;return i<=t.translatey+t.containertop?(t.translatey=i-t.containertop,o="viewport-top"):t.containerbottom<=n?(t.translatey=t.containerbottom-e,o="container-bottom"):this.issidebarfitsviewport()||t.containertop<=i&&0!==t.translatey&&t.maxtranslatey!==t.translatey&&(o="viewport-unbottom"),o}},{key:"_getstyle",value:function(t){if(void 0!==t){var e={inner:{},outer:{}},i=this.dimensions;switch(t){case"viewport-top":e.inner={position:"fixed",top:i.topspacing,left:i.sidebarleft-i.viewportleft,width:i.sidebarwidth};break;case"viewport-bottom":e.inner={position:"fixed",top:"auto",left:i.sidebarleft,bottom:i.bottomspacing,width:i.sidebarwidth};break;case"container-bottom":case"viewport-unbottom":var n=this._gettranslate(0,i.translatey+"px");e.inner=n?{transform:n}:{position:"absolute",top:i.translatey,width:i.sidebarwidth}}switch(t){case"viewport-top":case"viewport-bottom":case"viewport-unbottom":case"container-bottom":e.outer={height:i.sidebarheight,position:"relative"}}return e.outer=c.extend({height:"",position:""},e.outer),e.inner=c.extend({position:"relative",top:"",left:"",bottom:"",width:"",transform:""},e.inner),e}}},{key:"stickyposition",value:function(t){if(!this._breakpoint){t=this._restyle||t||!1,this.options.topspacing,this.options.bottomspacing;var e=this.getaffixtype(),i=this._getstyle(e);if((this.affixedtype!=e||t)&&e){var n="affix."+e.tolowercase().replace("viewport-","")+l;for(var o in c.eventtrigger(this.sidebar,n),"static"===e?c.removeclass(this.sidebar,this.options.stickyclass):c.addclass(this.sidebar,this.options.stickyclass),i.outer){var s="number"==typeof i.outer[o]?"px":"";this.sidebar.style[o]=i.outer[o]+s}for(var r in i.inner){var a="number"==typeof i.inner[r]?"px":"";this.sidebarinner.style[r]=i.inner[r]+a}var p="affixed."+e.tolowercase().replace("viewport-","")+l;c.eventtrigger(this.sidebar,p)}else this._initialized&&(this.sidebarinner.style.left=i.inner.left);this.affixedtype=e}}},{key:"_widthbreakpoint",value:function(){window.innerwidth<=this.options.minwidth?(this._breakpoint=!0,this.affixedtype="static",this.sidebar.removeattribute("style"),c.removeclass(this.sidebar,this.options.stickyclass),this.sidebarinner.removeattribute("style")):this._breakpoint=!1}},{key:"updatesticky",value:function(){var t,e=this,i=0