text: /**
   * skylark-bootstrap4 - The skylark bootstrap4 component library
   * @author Hudaokeji, Inc.
   * @version v0.9.0
   * @link https://github.com/skylarkui/skylark-bootstrap4/
   * @license MIT
   */
  define(["skylark-utils-dom/query","skylark-utils-dom/plugins","./bs4","./util"],function(t,e,s,i){"use strict";const l="scrollspy",o="4.1.3",r="bs.scrollspy",n=`.${r}`,c=t.fn[l],h={offset:10,method:"auto",target:""},a={offset:"number",method:"string",target:"(string|element)"},_={ACTIVATE:`activate${n}`,SCROLL:`scroll${n}`,LOAD_DATA_API:`load${n}.data-api`},g={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active"},f={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"},d={OFFSET:"offset",POSITION:"position"};class u{constructor(e,s){this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(s),this._selector=`${this._config.target} ${f.NAV_LINKS},`+`${this._config.target} ${f.LIST_ITEMS},`+`${this._config.target} ${f.DROPDOWN_ITEMS}`,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(_.SCROLL,t=>this._process(t)),this.refresh(),this._process()}static get VERSION(){return o}static get Default(){return h}refresh(){const e=this._scrollElement===this._scrollElement.window?d.OFFSET:d.POSITION,s="auto"===this._config.method?e:this._config.method,l=s===d.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(e=>{let o;const r=i.getSelectorFromElement(e);if(r&&(o=document.querySelector(r)),o){const e=o.getBoundingClientRect();if(e.width||e.height)return[t(o)[s]().top+l,r]}return null}).filter(t=>t).sort((t,e)=>t[0]-e[0]).forEach(t=>{this._offsets.push(t[0]),this._targets.push(t[1])})}dispose(){t.removeData(this._element,r),t(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}_getConfig(e){if("string"!=typeof(e=langx.mixin({},h,"object"==typeof e&&e?e:{})).target){let s=t(e.target).attr("id");s||(s=i.getUID(l),t(e.target).attr("id",s)),e.target=`#${s}`}return i.typeCheckConfig(l,e,a),e}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),s=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=s){const t=this._targets[this._targets.length-1];this._activeTarget!==t&&this._activate(t)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(let e=this._offsets.length;e--;){this._activeTarget!==this._targets[e]&&t>=this._offsets[e]&&(void 0===this._offsets[e+1]||t<this._offsets[e+1])&&this._activate(this._targets[e])}}}_activate(e){this._activeTarget=e,this._clear();const s=this._selector.split(",").map(t=>`${t}[data-target="${e}"],${t}[href="${e}"]`),i=t([].slice.call(document.querySelectorAll(s.join(","))));i.hasClass(g.DROPDOWN_ITEM)?(i.closest(f.DROPDOWN).find(f.DROPDOWN_TOGGLE).addClass(g.ACTIVE),i.addClass(g.ACTIVE)):(i.addClass(g.ACTIVE),i.parents(f.NAV_LIST_GROUP).prev(`${f.NAV_LINKS}, ${f.LIST_ITEMS}`).addClass(g.ACTIVE),i.parents(f.NAV_LIST_GROUP).prev(f.NAV_ITEMS).children(f.NAV_LINKS).addClass(g.ACTIVE)),t(this._scrollElement).trigger(_.ACTIVATE,{relatedTarget:e})}_clear(){[].slice.call(document.querySelectorAll(this._selector)).filter(t=>t.classList.contains(g.ACTIVE)).forEach(t=>t.classList.remove(g.ACTIVE))}static _jqueryInterface(e){return this.each(function(){let s=t(this).data(r);if(s||(s=new u(this,"object"==typeof e&&e),t(this).data(r,s)),"string"==typeof e){if(void 0===s[e])throw new TypeError(`No method named "${e}"`);s[e]()}})}}return t(window).on(_.LOAD_DATA_API,()=>{const e=[].slice.call(document.querySelectorAll(f.DATA_SPY));for(let s=e.length;s--;){const i=t(e[s]);u._jqueryInterface.call(i,i.data())}}),t.fn[l]=u._jqueryInterface,t.fn[l].Constructor=u,t.fn[l].noConflict=(()=>(t.fn[l]=c,u._jqueryInterface)),u});
  //# sourceMappingURL=sourcemaps/scrollspy.js.map
  