/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(o){"use strict";o.fn.emulateTransitionEnd=function(t){var e=!1,i=this;o(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||o(i).trigger(o.support.transition.end)},t),this},o(function(){o.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}(),o.support.transition&&(o.event.special.bsTransitionEnd={bindType:o.support.transition.end,delegateType:o.support.transition.end,handle:function(t){if(o(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){"use strict";var e='[data-dismiss="alert"]',o=function(t){n(t).on("click",e,this.close)};o.VERSION="3.2.0",o.prototype.close=function(t){var e=n(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,""));var o=n(i);function s(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.hasClass("alert")?e:e.parent()),o.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),n.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",s).emulateTransitionEnd(150):s())};var t=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var t=n(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new o(this)),"string"==typeof i&&e[i].call(t)})},n.fn.alert.Constructor=o,n.fn.alert.noConflict=function(){return n.fn.alert=t,this},n(document).on("click.bs.alert.data-api",e,o.prototype.close)}(jQuery),function(n){"use strict";var s=function(t,e){this.$element=n(t),this.options=n.extend({},s.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=n(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new s(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}s.VERSION="3.2.0",s.DEFAULTS={loadingText:"loading..."},s.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",s=i.data();t+="Text",null==s.resetText&&i.data("resetText",i[o]()),i[o](null==s[t]?this.options[t]:s[t]),setTimeout(n.proxy(function(){"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e))},this),0)},s.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var t=n.fn.button;n.fn.button=i,n.fn.button.Constructor=s,n.fn.button.noConflict=function(){return n.fn.button=t,this},n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=n(t.target);e.hasClass("btn")||(e=e.closest(".btn")),i.call(e,"toggle"),t.preventDefault()})}(jQuery),function(d){"use strict";var n=function(t,e){this.$element=d(t).on("keydown.bs.carousel",d.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",d.proxy(this.pause,this)).on("mouseleave.bs.carousel",d.proxy(this.cycle,this))};function r(s){return this.each(function(){var t=d(this),e=t.data("bs.carousel"),i=d.extend({},n.DEFAULTS,t.data(),"object"==typeof s&&s),o="string"==typeof s?s:i.slide;e||t.data("bs.carousel",e=new n(this,i)),"number"==typeof s?e.to(s):o?e[o]():i.interval&&e.pause().cycle()})}n.VERSION="3.2.0",n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},n.prototype.keydown=function(t){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(d.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},n.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i .panel > .in");if(e&&e.length){var i=e.data("bs.collapse");if(i&&i.transitioning)return;p.call(e,"hide"),i||e.data("bs.collapse",null)}var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!h.support.transition)return s.call(this);var n=h.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",h.proxy(s,this)).emulateTransitionEnd(350)[o](this.$element[0][n])}}},s.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=h.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!h.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",h.proxy(i,this)).emulateTransitionEnd(350)}}},s.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var t=h.fn.collapse;h.fn.collapse=p,h.fn.collapse.Constructor=s,h.fn.collapse.noConflict=function(){return h.fn.collapse=t,this},h(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e,i=h(this),o=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),s=h(o),n=s.data("bs.collapse"),r=n?"toggle":i.data(),a=i.attr("data-parent"),l=a&&h(a);n&&n.transitioning||(l&&l.find('[data-toggle="collapse"][data-parent="'+a+'"]').not(i).addClass("collapsed"),i[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),p.call(s,r)})}(jQuery),function(a){"use strict";var l='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function n(i){i&&3===i.which||(a(".dropdown-backdrop").remove(),a(l).each(function(){var t=h(a(this)),e={relatedTarget:this};t.hasClass("open")&&(t.trigger(i=a.Event("hide.bs.dropdown",e)),i.isDefaultPrevented()||t.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function h(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&a(e);return i&&i.length?i:t.parent()}o.VERSION="3.2.0",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=h(e),o=i.hasClass("open");if(n(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a('').insertAfter(a(this)).on("click",n);var s={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",s)),t.isDefaultPrevented())return;e.trigger("focus"),i.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},o.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=h(e),o=i.hasClass("open");if(!o||o&&27==t.keyCode)return 27==t.which&&i.find(l).trigger("focus"),e.trigger("click");var s=" li:not(.divider):visible a",n=i.find('[role="menu"]'+s+', [role="listbox"]'+s);if(n.length){var r=n.index(n.filter(":focus"));38==t.keyCode&&0').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(150):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var s=function(){e.removeBackdrop(),t&&t()};n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}else t&&t()},r.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},r.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",t+this.scrollbarWidth)},r.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},r.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=n.fn.modal;n.fn.modal=a,n.fn.modal.Constructor=r,n.fn.modal.noConflict=function(){return n.fn.modal=t,this},n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=n(this),i=e.attr("href"),o=n(e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),s=o.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(i)&&i},o.data(),e.data());e.is("a")&&t.preventDefault(),o.one("show.bs.modal",function(t){t.isDefaultPrevented()||o.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),a.call(o,s,this)})}(jQuery),function(v){"use strict";var s=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};s.VERSION="3.2.0",s.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},s.prototype.init=function(t,e,i){this.enabled=!0,this.type=t,this.$element=v(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&v(this.options.viewport.selector||this.options.viewport);for(var o=this.options.trigger.split(" "),s=o.length;s--;){var n=o[s];if("click"==n)this.$element.on("click."+this.type,this.options.selector,v.proxy(this.toggle,this));else if("manual"!=n){var r="hover"==n?"mouseenter":"focusin",a="hover"==n?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,v.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,v.proxy(this.leave,this))}}this.options.selector?this._options=v.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},s.prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.getOptions=function(t){return(t=v.extend({},this.getDefaults(),this.$element.data(),t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},s.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&v.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},s.prototype.enter=function(t){var e=t instanceof this.constructor?t:v(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),v(t.currentTarget).data("bs."+this.type,e)),clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)},s.prototype.leave=function(t){var e=t instanceof this.constructor?t:v(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),v(t.currentTarget).data("bs."+this.type,e)),clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)},s.prototype.show=function(){var t=v.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=v.contains(document.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var n="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,r=/\s?auto?\s?/i,a=r.test(n);a&&(n=n.replace(r,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(n).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element);var l=this.getPosition(),h=o[0].offsetWidth,p=o[0].offsetHeight;if(a){var c=n,d=this.$element.parent(),f=this.getPosition(d);n="bottom"==n&&l.top+l.height+p-f.scroll>f.height?"top":"top"==n&&l.top-f.scroll-p<0?"bottom":"right"==n&&l.right+h>f.width?"left":"left"==n&&l.left-hr.top+r.height&&(s.top=r.top+r.height-l)}else{var h=e.left-n,p=e.left+n+i;hr.width&&(s.left=r.left+r.width-p)}return s},s.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},s.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},s.prototype.tip=function(){return this.$tip=this.$tip||v(this.options.template)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},s.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},s.prototype.enable=function(){this.enabled=!0},s.prototype.disable=function(){this.enabled=!1},s.prototype.toggleEnabled=function(){this.enabled=!this.enabled},s.prototype.toggle=function(t){var e=this;t&&((e=v(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),v(t.currentTarget).data("bs."+this.type,e))),e.tip().hasClass("in")?e.leave(e):e.enter(e)},s.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var t=v.fn.tooltip;v.fn.tooltip=function(o){return this.each(function(){var t=v(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;(e||"destroy"!=o)&&(e||t.data("bs.tooltip",e=new s(this,i)),"string"==typeof o&&e[o]())})},v.fn.tooltip.Constructor=s,v.fn.tooltip.noConflict=function(){return v.fn.tooltip=t,this}}(jQuery),function(s){"use strict";var n=function(t,e){this.init("popover",t,e)};if(!s.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.2.0",n.DEFAULTS=s.extend({},s.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),((n.prototype=s.extend({},s.fn.tooltip.Constructor.prototype)).constructor=n).prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").empty()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},n.prototype.tip=function(){return this.$tip||(this.$tip=s(this.options.template)),this.$tip};var t=s.fn.popover;s.fn.popover=function(o){return this.each(function(){var t=s(this),e=t.data("bs.popover"),i="object"==typeof o&&o;(e||"destroy"!=o)&&(e||t.data("bs.popover",e=new n(this,i)),"string"==typeof o&&e[o]())})},s.fn.popover.Constructor=n,s.fn.popover.noConflict=function(){return s.fn.popover=t,this}}(jQuery),function(n){"use strict";function s(t,e){var i=n.proxy(this.process,this);this.$body=n("body"),this.$scrollElement=n(t).is("body")?n(window):n(t),this.options=n.extend({},s.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",i),this.refresh(),this.process()}function e(o){return this.each(function(){var t=n(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new s(this,i)),"string"==typeof o&&e[o]()})}s.VERSION="3.2.0",s.DEFAULTS={offset:10},s.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},s.prototype.refresh=function(){var o="offset",s=0;n.isWindow(this.$scrollElement[0])||(o="position",s=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var t=this;this.$body.find(this.selector).map(function(){var t=n(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&n(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+s,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},s.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),s=this.offsets,n=this.targets,r=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return r!=(t=n[n.length-1])&&this.activate(t);if(r&&e<=s[0])return r!=(t=n[0])&&this.activate(t);for(t=s.length;t--;)r!=n[t]&&e>=s[t]&&(!s[t+1]||e<=s[t+1])&&this.activate(n[t])},s.prototype.activate=function(t){this.activeTarget=t,n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")};var t=n.fn.scrollspy;n.fn.scrollspy=e,n.fn.scrollspy.Constructor=s,n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=t,this},n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var o=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new o(this)),"string"==typeof i&&e[i]()})}o.VERSION="3.2.0",o.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a")[0],s=r.Event("show.bs.tab",{relatedTarget:o});if(t.trigger(s),!s.isDefaultPrevented()){var n=r(i);this.activate(t.closest("li"),e),this.activate(n,n.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:o})})}}},o.prototype.activate=function(t,e,i){var o=e.find("> .active"),s=i&&r.support.transition&&o.hasClass("fade");function n(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),i&&i()}s?o.one("bsTransitionEnd",n).emulateTransitionEnd(150):n(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=o,r.fn.tab.noConflict=function(){return r.fn.tab=t,this},r(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e.call(r(this),"show")})}(jQuery),function(h){"use strict";var p=function(t,e){this.options=h.extend({},p.DEFAULTS,e),this.$target=h(this.options.target).on("scroll.bs.affix.data-api",h.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",h.proxy(this.checkPositionWithEventLoop,this)),this.$element=h(t),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=h(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new p(this,i)),"string"==typeof o&&e[o]()})}p.VERSION="3.2.0",p.RESET="affix affix-top affix-bottom",p.DEFAULTS={offset:0,target:window},p.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(p.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},p.prototype.checkPositionWithEventLoop=function(){setTimeout(h.proxy(this.checkPosition,this),1)},p.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=h(document).height(),e=this.$target.scrollTop(),i=this.$element.offset(),o=this.options.offset,s=o.top,n=o.bottom;"object"!=typeof o&&(n=s=o),"function"==typeof s&&(s=o.top(this.$element)),"function"==typeof n&&(n=o.bottom(this.$element));var r=!(null!=this.unpin&&e+this.unpin<=i.top)&&(null!=n&&i.top+this.$element.height()>=t-n?"bottom":null!=s&&e<=s&&"top");if(this.affixed!==r){null!=this.unpin&&this.$element.css("top","");var a="affix"+(r?"-"+r:""),l=h.Event(a+".bs.affix");this.$element.trigger(l),l.isDefaultPrevented()||(this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(p.RESET).addClass(a).trigger(h.Event(a.replace("affix","affixed"))),"bottom"==r&&this.$element.offset({top:t-this.$element.height()-n}))}}};var t=h.fn.affix;h.fn.affix=i,h.fn.affix.Constructor=p,h.fn.affix.noConflict=function(){return h.fn.affix=t,this},h(window).on("load",function(){h('[data-spy="affix"]').each(function(){var t=h(this),e=t.data();e.offset=e.offset||{},e.offsetBottom&&(e.offset.bottom=e.offsetBottom),e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);