/
var
/
www
/
html
/
lgpd
/
theme
/
boost
/
amd
/
build
/
Upload File
HOME
"use strict";function _typeof2(a){if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof2=function(a){return typeof a}}else{_typeof2=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof2(a)}define ("theme_boost/scrollspy",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var k=d(b),l=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){if("function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)){e=function(a){return _typeof2(a)}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":_typeof2(a)}}return e(a)}function f(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{},d=Object.keys(c);if("function"==typeof Object.getOwnPropertySymbols){d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))}d.forEach(function(b){g(a,b,c[b])})}return a}function g(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function h(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function i(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function j(a,b,c){if(b)i(a.prototype,b);if(c)i(a,c);return a}var m="bs.scrollspy",n=".".concat(m),o=k.default.fn.scrollspy,p={offset:10,method:"auto",target:""},q={offset:"number",method:"string",target:"(string|element)"},r={ACTIVATE:"activate".concat(n),SCROLL:"scroll".concat(n),LOAD_DATA_API:"load".concat(n).concat(".data-api")},s={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active"},t={DATA_SPY:"[data-spy=\"scroll\"]",ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},u={OFFSET:"offset",POSITION:"position"},v=function(){function a(b,c){var d=this;h(this,a);this._element=b;this._scrollElement="BODY"===b.tagName?window:b;this._config=this._getConfig(c);this._selector="".concat(this._config.target," ").concat(t.NAV_LINKS,",")+"".concat(this._config.target," ").concat(t.LIST_ITEMS,",")+"".concat(this._config.target," ").concat(t.DROPDOWN_ITEMS);this._offsets=[];this._targets=[];this._activeTarget=null;this._scrollHeight=0;(0,k.default)(this._scrollElement).on(r.SCROLL,function(a){return d._process(a)});this.refresh();this._process()}j(a,[{key:"refresh",value:function(){var a=this,b=this._scrollElement===this._scrollElement.window?u.OFFSET:u.POSITION,c="auto"===this._config.method?b:this._config.method,d=c===u.POSITION?this._getScrollTop():0;this._offsets=[];this._targets=[];this._scrollHeight=this._getScrollHeight();var e=[].slice.call(document.querySelectorAll(this._selector));e.map(function(a){var b,e=l.default.getSelectorFromElement(a);if(e){b=document.querySelector(e)}if(b){var f=b.getBoundingClientRect();if(f.width||f.height){return[(0,k.default)(b)[c]().top+d,e]}}return null}).filter(function(a){return a}).sort(function(c,a){return c[0]-a[0]}).forEach(function(b){a._offsets.push(b[0]);a._targets.push(b[1])})}},{key:"dispose",value:function(){k.default.removeData(this._element,m);(0,k.default)(this._scrollElement).off(n);this._element=null;this._scrollElement=null;this._config=null;this._selector=null;this._offsets=null;this._targets=null;this._activeTarget=null;this._scrollHeight=null}},{key:"_getConfig",value:function(a){a=f({},p,"object"===e(a)&&a?a:{});if("string"!=typeof a.target){var b=(0,k.default)(a.target).attr("id");if(!b){b=l.default.getUID("scrollspy");(0,k.default)(a.target).attr("id",b)}a.target="#".concat(b)}l.default.typeCheckConfig("scrollspy",a,q);return a}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_getOffsetHeight",value:function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._getOffsetHeight();if(this._scrollHeight!==b){this.refresh()}if(a>=c){var d=this._targets[this._targets.length-1];if(this._activeTarget!==d){this._activate(d)}return}if(this._activeTarget&&a<this._offsets[0]&&0<this._offsets[0]){this._activeTarget=null;this._clear();return}for(var e=this._offsets.length,f=e,g;f--;){g=this._activeTarget!==this._targets[f]&&a>=this._offsets[f]&&("undefined"==typeof this._offsets[f+1]||a<this._offsets[f+1]);if(g){this._activate(this._targets[f])}}}},{key:"_activate",value:function(a){this._activeTarget=a;this._clear();var b=this._selector.split(",").map(function(b){return"".concat(b,"[data-target=\"").concat(a,"\"],").concat(b,"[href=\"").concat(a,"\"]")}),c=(0,k.default)([].slice.call(document.querySelectorAll(b.join(","))));if(c.hasClass(s.DROPDOWN_ITEM)){c.closest(t.DROPDOWN).find(t.DROPDOWN_TOGGLE).addClass(s.ACTIVE);c.addClass(s.ACTIVE)}else{c.addClass(s.ACTIVE);c.parents(t.NAV_LIST_GROUP).prev("".concat(t.NAV_LINKS,", ").concat(t.LIST_ITEMS)).addClass(s.ACTIVE);c.parents(t.NAV_LIST_GROUP).prev(t.NAV_ITEMS).children(t.NAV_LINKS).addClass(s.ACTIVE)}(0,k.default)(this._scrollElement).trigger(r.ACTIVATE,{relatedTarget:a})}},{key:"_clear",value:function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(a){return a.classList.contains(s.ACTIVE)}).forEach(function(a){return a.classList.remove(s.ACTIVE)})}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=(0,k.default)(this).data(m),d="object"===e(b)&&b;if(!c){c=new a(this,d);(0,k.default)(this).data(m,c)}if("string"==typeof b){if("undefined"==typeof c[b]){throw new TypeError("No method named \"".concat(b,"\""))}c[b]()}})}},{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return p}}]);return a}();(0,k.default)(window).on(r.LOAD_DATA_API,function(){for(var a=[].slice.call(document.querySelectorAll(t.DATA_SPY)),b=a.length,c=b,d;c--;){d=(0,k.default)(a[c]);v._jQueryInterface.call(d,d.data())}});k.default.fn.scrollspy=v._jQueryInterface;k.default.fn.scrollspy.Constructor=v;k.default.fn.scrollspy.noConflict=function(){k.default.fn.scrollspy=o;return v._jQueryInterface};a.default=v;return a.default}); //# sourceMappingURL=scrollspy.min.js.map