if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(){"use strict";var n=jQuery.fn.jquery.split(" ")[0].split(".");if(n[0]<2&&n[1]<9||1==n[0]&&9==n[1]&&n[2]<1||3<n[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var i=!1,r=this;n(this).one("bsTransitionEnd",function(){i=!0});return setTimeout(function(){i||n(r).trigger(n.support.transition.end)},t),this};n(function(){n.support.transition=function(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){u.detach().trigger("closed.bs.alert").remove()}var f=n(this),r=f.attr("data-target"),u;r||(r=(r=f.attr("href"))&&r.replace(/.*(?=#[^\s]*$)/,""));r="#"===r?[]:r;u=n(document).find(r);i&&i.preventDefault();u.length||(u=f.closest(".alert"));u.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.4.1";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var i="disabled",r=this.$element,f=r.is("input")?"val":"html",u=r.data();t+="Text";null==u.resetText&&r.data("resetText",r[f]());setTimeout(n.proxy(function(){r[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(this.isLoading=!0,r.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(i).removeAttr(i).prop(i,!1))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target).closest(".btn");i.call(r,"toggle");n(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.4.1";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),r;return("prev"==n&&0===i||"next"==n&&i==this.$items.length-1)&&!this.options.wrap?t:(r=(i+("prev"==n?-1:1))%this.$items.length,this.$items.eq(r))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1||n<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(t<n?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),"object"==typeof u&&u.length&&u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var u=n(this),f=u.attr("href"),s,r,o,e;f&&(f=f.replace(/.*(?=#[^\s]+$)/,""));s=u.attr("data-target")||f;r=n(document).find(s);r.hasClass("carousel")&&(o=n.extend({},r.data(),u.data()),e=u.attr("data-slide-to"),e&&(o.interval=!1),i.call(r,o),e&&r.data("bs.carousel").to(e),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery),function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(document).find(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.4.1";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"))&&f.transitioning)&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented())){if(i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},!n.support.transition)return u.call(this);this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this),f,e;u.attr("data-target")||t.preventDefault();f=r(u);e=f.data("bs.collapse")?"toggle":u.data();i.call(f,e)})}(jQuery),function(n){"use strict";function r(t){var i=t.attr("data-target"),r;return i||(i=(i=t.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r="#"!==i?n(document).find(i):null,r&&r.length?r:t.parent()}function u(t){t&&3===t.which||(n(".dropdown-backdrop").remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger(n.Event("hidden.bs.dropdown",f)))))}))}var i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.4.1";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(n.Event("shown.bs.dropdown",e))}return!1}};t.prototype.keydown=function(t){var e,o,s,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");f=o.find(".dropdown-menu li:not(.disabled):visible a");f.length&&(u=f.index(t.target),38==t.which&&0<u&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",t.prototype.keydown)}(jQuery),function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom";this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){document===n.target||this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var i=parseInt(this.$body.css("padding-right")||0,10),t;this.originalBodyPad=document.body.style.paddingRight||"";t=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",i+t),n(this.fixedContent).each(function(i,r){var u=r.style.paddingRight,f=n(r).css("padding-right");n(r).data("padding-right",u).css("padding-right",parseFloat(f)+t+"px")}))};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad);n(this.fixedContent).each(function(t,i){var r=n(i).data("padding-right");n(i).removeData("padding-right");i.style.paddingRight=r||""})};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),e=r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,""),u=n(document).find(e),o=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,o,this)})}(jQuery),function(n){"use strict";function s(t,i){var r=t.nodeName.toLowerCase();if(-1!==n.inArray(r,i))return-1===n.inArray(r,f)||Boolean(t.nodeValue.match(e)||t.nodeValue.match(o));for(var s=n(i).filter(function(n,t){return t instanceof RegExp}),u=0,h=s.length;u<h;u++)if(r.match(s[u]))return!0;return!1}function i(t,i,r){var f,u,h;if(0===t.length)return t;if(r&&"function"==typeof r)return r(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;f=document.implementation.createHTMLDocument("sanitization");f.body.innerHTML=t;for(var a=n.map(i,function(n,t){return t}),l=n(f.body).find("*"),o=0,v=l.length;o<v;o++)if(u=l[o],h=u.nodeName.toLowerCase(),-1!==n.inArray(h,a))for(var c=n.map(u.attributes,function(n){return n}),y=[].concat(i["*"]||[],i[h]||[]),e=0,p=c.length;e<p;e++)s(c[e],y)||u.removeAttribute(c[e].nodeName);else u.parentNode.removeChild(u);return f.body.innerHTML}var u=["sanitize","whiteList","sanitizeFn"],f=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],e=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i,t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},r;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(document).find(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){var r=this.$element.data();for(var f in r)r.hasOwnProperty(f)&&-1!==n.inArray(f,u)&&delete r[f];return(t=n.extend({},this.getDefaults(),r,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=i(t.template,t.whiteList,t.sanitizeFn)),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)}};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)}};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(n(document).find(this.options.container)):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var t=this.tip(),n=this.getTitle();this.options.html?(this.options.sanitize&&(n=i(n,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(n)):t.find(".tooltip-inner").text(n);t.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function e(){"in"!=r.hoverState&&u.detach();r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type);i&&i()}var r=this,u=n(this.$tip),f=n.Event("hide.bs."+this.type);if(this.$element.trigger(f),!f.isDefaultPrevented())return u.removeClass("in"),n.support.transition&&u.hasClass("fade")?u.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){var r=(t=t||this.$element)[0],u="BODY"==r.tagName,i=r.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=window.SVGElement&&r instanceof window.SVGElement,e=u?{top:0,left:0}:f?null:t.offset(),o={scroll:u?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=u?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,o,s,e)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){for(;n+=~~(1e6*Math.random()),document.getElementById(n););return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&((i=n(t.currentTarget).data("bs."+this.type))||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};t.prototype.sanitizeHtml=function(n){return i(n,this.options.whiteList,this.options.sanitizeFn)};r=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=r,this}}(jQuery),function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.4.1";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});((t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=t).prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent(),r;this.options.html?(r=typeof t,this.options.sanitize&&(i=this.sanitizeHtml(i),"string"===r&&(t=this.sanitizeHtml(t))),n.find(".popover-title").html(i),n.find(".popover-content").children().detach().end()["string"===r?"html":"append"](t)):(n.find(".popover-title").text(i),n.find(".popover-content").children().detach().end().text(t));n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;!r&&/destroy|hide/.test(i)||(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery),function(n){"use strict";function t(i,r){this.$body=n(document.body);this.$scrollElement=n(i).is(document.body)?n(window):n(i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.4.1";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),e<=i)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(t[n+1]===undefined||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery),function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.4.1";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(document).find(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function o(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);e?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),e=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&e?f.one("bsTransitionEnd",o).emulateTransitionEnd(t.TRANSITION_DURATION):o();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);var u=this.options.target===t.DEFAULTS.target?n(this.options.target):n(document).find(this.options.target);this.$target=u.on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.4.1";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),e=this.$element.offset(),o=this.$target.height(),f,s;return null!=i&&"top"==this.affixed?u<i&&"top":"bottom"==this.affixed?null!=i?!(u+this.unpin<=e.top)&&"bottom":!(u+o<=n-r)&&"bottom":(f=null==this.affixed,s=f?u:e.top,null!=i&&u<=i?"top":null!=r&&n-r<=s+(f?o:t)&&"bottom")};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-u})}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(n)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(n.jQuery)}(this,function(n){!function(n){"use strict";function b(n,t){return n.length===t.length&&n.every(function(n,i){return n===t[i]})}function h(n){var t,r=[],u=n&&n.options,i,f;if(n.multiple)for(i=0,f=u.length;i<f;i++)t=u[i],t.selected&&r.push(t.value||t.text);else r=n.value;return r}function c(n,t,i,r){for(var e,u,o=["content","subtext","tokens"],s=!1,f=0;f<o.length;f++)if(e=o[f],u=n[e],u&&(u=u.toString(),"content"===e&&(u=u.replace(/<[^>]+>/g,"")),r&&(u=k(u)),u=u.toUpperCase(),s="contains"===i?u.indexOf(t)>=0:u.startsWith(t)))break;return s}function f(n){return parseInt(n,10)||0}function k(t){return n.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){t=t?t.replace(this.re,this.ch):""}),t}function l(t){var f=arguments,r=t,u,e;return[].shift.apply(f),e=this.each(function(){var o=n(this),t,e,s,h;if(o.is("select")){if(t=o.data("selectpicker"),e="object"==typeof r&&r,t){if(e)for(s in e)e.hasOwnProperty(s)&&(t.options[s]=e[s])}else h=n.extend({},i.DEFAULTS,n.fn.selectpicker.defaults||{},o.data(),e),h.template=n.extend({},i.DEFAULTS.template,n.fn.selectpicker.defaults?n.fn.selectpicker.defaults.template:{},o.data().template,e.template),o.data("selectpicker",t=new i(this,h));"string"==typeof r&&(u=t[r]instanceof Function?t[r].apply(t,f):t.options[r])}}),void 0!==u?u:e}var a=document.createElement("_"),v,e,o,y,w;(a.classList.toggle("c3",!1),a.classList.contains("c3"))&&(v=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(n,t){return 1 in arguments&&!this.contains(n)==!t?t:v.call(this,n)});String.prototype.startsWith||function(){var n=function(){try{var n={},t=Object.defineProperty,i=t(n,n,n)&&t}catch(n){}return i}(),i={}.toString,t=function(n){var u,f,r;if(null==this)throw new TypeError;if(u=String(this),n&&"[object RegExp]"==i.call(n))throw new TypeError;var e=u.length,o=String(n),s=o.length,h=arguments.length>1?arguments[1]:void 0,t=h?Number(h):0;if(t!=t&&(t=0),f=Math.min(Math.max(t,0),e),s+f>e)return!1;for(r=-1;++r<s;)if(u.charCodeAt(f+r)!=o.charCodeAt(r))return!1;return!0};n?n(String.prototype,"startsWith",{value:t,configurable:!0,writable:!0}):String.prototype.startsWith=t}();Object.keys||(Object.keys=function(n,t,i){i=[];for(t in n)i.hasOwnProperty.call(n,t)&&i.push(t);return i});e={useDefault:!1,_set:n.valHooks.select.set};n.valHooks.select.set=function(t,i){return i&&!e.useDefault&&n(t).data("selected",!0),e._set.apply(this,arguments)};o=null;y=function(){try{return new Event("change"),!0}catch(n){return!1}}();n.fn.triggerNative=function(n){var t,i=this[0];i.dispatchEvent?(y?t=new Event(n,{bubbles:!0}):(t=document.createEvent("Event"),t.initEvent(n,!0,!1)),i.dispatchEvent(t)):i.fireEvent?(t=document.createEventObject(),t.eventType=n,i.fireEvent("on"+n,t)):this.trigger(n)};var p=function(n){var i=function(t){return n[t]},t="(?:"+Object.keys(n).join("|")+")",r=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,r.test(n)?n.replace(u,i):n}},s=p({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"}),d=p({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`"}),g={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40},u={};try{u.full=(n.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".");u.major=u.full[0]}catch(n){console.error("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision.",n);u.major="3"}var t={DISABLED:"disabled",DIVIDER:"4"===u.major?"dropdown-divider":"divider",SHOW:"4"===u.major?"show":"open",DROPUP:"dropup",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"4"===u.major?"btn-light":"btn-default",POPOVERHEADER:"4"===u.major?"popover-header":"popover-title"},nt=new RegExp(r.ARROW_UP+"|"+r.ARROW_DOWN),tt=new RegExp("^"+r.TAB+"$|"+r.ESCAPE),i=(new RegExp(r.ENTER+"|"+r.SPACE),function(t,r){var f=this,u;e.useDefault||(n.valHooks.select.set=e._set,e.useDefault=!0);this.$element=n(t);this.$newElement=null;this.$button=null;this.$menu=null;this.options=r;this.selectpicker={main:{map:{newIndex:{},originalIndex:{}}},current:{map:{}},search:{map:{}},view:{},keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout(function(){f.selectpicker.keydown.keyHistory=""},800)}}}};null===this.options.title&&(this.options.title=this.$element.attr("title"));u=this.options.windowPadding;"number"==typeof u&&(this.options.windowPadding=[u,u,u,u]);this.val=i.prototype.val;this.render=i.prototype.render;this.refresh=i.prototype.refresh;this.setStyle=i.prototype.setStyle;this.selectAll=i.prototype.selectAll;this.deselectAll=i.prototype.deselectAll;this.destroy=i.prototype.destroy;this.remove=i.prototype.remove;this.show=i.prototype.show;this.hide=i.prototype.hide;this.init()});i.VERSION="1.13.1";i.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(n){return 1==n?"{0} item selected":"{0} items selected"},maxOptionsText:function(n,t){return[1==n?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",showTick:!1,template:{caret:'<span class="caret"><\/span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600};"4"===u.major&&(i.DEFAULTS.style="btn-light",i.DEFAULTS.iconBase="",i.DEFAULTS.tickIcon="bs-ok-default");i.prototype={constructor:i,init:function(){var n=this,i=this.$element.attr("id");this.$element.addClass("bs-select-hidden");this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newElement=this.createDropdown();this.createLi();this.$element.after(this.$newElement).prependTo(this.$newElement);this.$button=this.$newElement.children("button");this.$menu=this.$newElement.children(".dropdown-menu");this.$menuInner=this.$menu.children(".inner");this.$searchbox=this.$menu.find("input");this.$element.removeClass("bs-select-hidden");!0===this.options.dropdownAlignRight&&this.$menu.addClass(t.MENURIGHT);void 0!==i&&this.$button.attr("data-id",i);this.checkDisabled();this.clickListener();this.options.liveSearch&&this.liveSearchListener();this.render();this.setStyle();this.setWidth();this.options.container?this.selectPosition():this.$element.on("hide.bs.select",function(){if(n.isVirtual()){var t=n.$menuInner[0],i=t.firstChild.cloneNode(!1);t.replaceChild(i,t.firstChild);t.scrollTop=0}});this.$menu.data("this",this);this.$newElement.data("this",this);this.options.mobile&&this.mobile();this.$newElement.on({"hide.bs.dropdown":function(t){n.$menuInner.attr("aria-expanded",!1);n.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){n.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){n.$menuInner.attr("aria-expanded",!0);n.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){n.$element.trigger("shown.bs.select",t)}});n.$element[0].hasAttribute("required")&&this.$element.on("invalid",function(){n.$button.addClass("bs-invalid");n.$element.on({"shown.bs.select":function(){n.$element.val(n.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){this.validity.valid&&n.$button.removeClass("bs-invalid");n.$element.off("rendered.bs.select")}});n.$button.on("blur.bs.select",function(){n.$element.focus().blur();n.$button.off("blur.bs.select")})});setTimeout(function(){n.$element.trigger("loaded.bs.select")})},createDropdown:function(){var i=this.multiple||this.options.showTick?" show-tick":"",r=this.autofocus?" autofocus":"",f=this.options.header?'<div class="'+t.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;<\/button>'+this.options.header+"<\/div>":"",e=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+s(this.options.liveSearchPlaceholder)+'"')+' role="textbox" aria-label="Search"><\/div>':"",o=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+t.BUTTONCLASS+'">'+this.options.selectAllText+'<\/button><button type="button" class="actions-btn bs-deselect-all btn '+t.BUTTONCLASS+'">'+this.options.deselectAllText+"<\/button><\/div><\/div>":"",h=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+t.BUTTONCLASS+'">'+this.options.doneButtonText+"<\/button><\/div><\/div>":"",c='<div class="dropdown bootstrap-select'+i+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+r+' role="button"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"><\/div><\/div> <\/div>'+("4"===u.major?"":'<span class="bs-caret">'+this.options.template.caret+"<\/span>")+'<\/button><div class="dropdown-menu '+("4"===u.major?"":t.SHOW)+'" role="combobox">'+f+e+o+'<div class="inner '+t.SHOW+'" role="listbox" aria-expanded="false" tabindex="-1"><ul class="dropdown-menu inner '+("4"===u.major?t.SHOW:"")+'"><\/ul><\/div>'+h+"<\/div><\/div>";return n(c)},setPositionData:function(){var t,n,i;for(this.selectpicker.view.canHighlight=[],t=0;t<this.selectpicker.current.data.length;t++)n=this.selectpicker.current.data[t],i=!0,"divider"===n.type?(i=!1,n.height=this.sizeInfo.dividerHeight):"optgroup-label"===n.type?(i=!1,n.height=this.sizeInfo.dropdownHeaderHeight):n.height=this.sizeInfo.liHeight,n.disabled&&(i=!1),this.selectpicker.view.canHighlight.push(i),n.position=(0===t?0:this.selectpicker.current.data[t-1].position)+n.height},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,i){function o(n,i){var y,p,g,nt,k,tt,it,s=r.selectpicker.current.elements.length,d=[],h=void 0,rt=!0,l=r.isVirtual(),w,o,st,a,v;for(r.selectpicker.view.scrollTop=n,!0===l&&r.sizeInfo.hasScrollBar&&r.$menu[0].offsetWidth>r.sizeInfo.totalMenuWidth&&(r.sizeInfo.menuWidth=r.$menu[0].offsetWidth,r.sizeInfo.totalMenuWidth=r.sizeInfo.menuWidth+r.sizeInfo.scrollBarWidth,r.$menu.css("min-width",r.sizeInfo.menuWidth)),y=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),p=Math.round(s/y)||1,o=0;o<p;o++){if(w=(o+1)*y,o===p-1&&(w=s),d[o]=[o*y+(o?1:0),w],!s)break;void 0===h&&n<=r.selectpicker.current.data[w-1].position-r.sizeInfo.menuInnerHeight&&(h=o)}if(void 0===h&&(h=0),k=[r.selectpicker.view.position0,r.selectpicker.view.position1],g=Math.max(0,h-1),nt=Math.min(p-1,h+1),r.selectpicker.view.position0=Math.max(0,d[g][0])||0,r.selectpicker.view.position1=Math.min(s,d[nt][1])||0,tt=k[0]!==r.selectpicker.view.position0||k[1]!==r.selectpicker.view.position1,void 0!==r.activeIndex&&(f=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.prevActiveIndex]],e=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.activeIndex]],u=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.selectedIndex]],i&&(r.activeIndex!==r.selectedIndex&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active")),r.activeIndex=void 0),r.activeIndex&&r.activeIndex!==r.selectedIndex&&u&&u.length&&(u.classList.remove("active"),u.firstChild&&u.firstChild.classList.remove("active"))),void 0!==r.prevActiveIndex&&r.prevActiveIndex!==r.activeIndex&&r.prevActiveIndex!==r.selectedIndex&&f&&f.length&&(f.classList.remove("active"),f.firstChild&&f.firstChild.classList.remove("active")),(i||tt)&&(it=r.selectpicker.view.visibleElements?r.selectpicker.view.visibleElements.slice():[],r.selectpicker.view.visibleElements=r.selectpicker.current.elements.slice(r.selectpicker.view.position0,r.selectpicker.view.position1),r.setOptionStatus(),(t||!1===l&&i)&&(rt=!b(it,r.selectpicker.view.visibleElements)),(i||!0===l)&&rt)){var ut,ft,c=r.$menuInner[0],et=document.createDocumentFragment(),ht=c.firstChild.cloneNode(!1),ot=!0===l?r.selectpicker.view.visibleElements:r.selectpicker.current.elements;for(c.replaceChild(ht,c.firstChild),o=0,st=ot.length;o<st;o++)et.appendChild(ot[o]);!0===l&&(ut=0===r.selectpicker.view.position0?0:r.selectpicker.current.data[r.selectpicker.view.position0-1].position,ft=r.selectpicker.view.position1>s-1?0:r.selectpicker.current.data[s-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,c.firstChild.style.marginTop=ut+"px",c.firstChild.style.marginBottom=ft+"px");c.firstChild.appendChild(et)}(r.prevActiveIndex=r.activeIndex,r.options.liveSearch)?t&&i&&(v=0,r.selectpicker.view.canHighlight[v]||(v=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),a=r.selectpicker.view.visibleElements[v],r.selectpicker.view.currentActive&&(r.selectpicker.view.currentActive.classList.remove("active"),r.selectpicker.view.currentActive.firstChild&&r.selectpicker.view.currentActive.firstChild.classList.remove("active")),a&&(a.classList.add("active"),a.firstChild&&a.firstChild.classList.add("active")),r.activeIndex=r.selectpicker.current.map.originalIndex[v]):r.$menuInner.focus()}var r,u,f,e;i=i||0;r=this;this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main;e=[];this.setPositionData();o(i,!0);this.$menuInner.off("scroll.createView").on("scroll.createView",function(n,t){r.noScroll||o(this.scrollTop,t);r.noScroll=!1});n(window).off("resize.createView").on("resize.createView",function(){o(r.$menuInner[0].scrollTop)})},createLi:function(){var w,h=this,e=[],y=0,b=0,r=[],o=0,p=0,f=-1,v;this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option"));var i={span:document.createElement("span"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" ")},k=i.span.cloneNode(!1),c=document.createDocumentFragment();k.className=h.options.iconBase+" "+h.options.tickIcon+" check-mark";i.a.appendChild(k);i.a.setAttribute("role","option");i.subtext.className="text-muted";i.text=i.span.cloneNode(!1);i.text.className="text";var l=function(n,t,r,u){var f=i.li.cloneNode(!1);return n&&(1===n.nodeType||11===n.nodeType?f.appendChild(n):f.innerHTML=n),void 0!==r&&""!==r&&(f.className=r),void 0!==u&&null!==u&&f.classList.add("optgroup-"+u),f},d=function(n,t,r){var f=i.a.cloneNode(!0);return n&&(11===n.nodeType?f.appendChild(n):f.insertAdjacentHTML("beforeend",n)),void 0!==t&""!==t&&(f.className=t),"4"===u.major&&f.classList.add("dropdown-item"),r&&f.setAttribute("style",r),f},g=function(n){var r,u,t=i.text.cloneNode(!1),f;return n.optionContent?t.innerHTML=n.optionContent:((t.textContent=n.text,n.optionIcon)&&(f=i.whitespace.cloneNode(!1),u=i.span.cloneNode(!1),u.className=h.options.iconBase+" "+n.optionIcon,c.appendChild(u),c.appendChild(f)),n.optionSubtext&&(r=i.subtext.cloneNode(!1),r.innerHTML=n.optionSubtext,t.appendChild(r))),c.appendChild(t),c},it=function(n){var t,r,u=i.text.cloneNode(!1),f;return(u.textContent=n.labelEscaped,n.labelIcon)&&(f=i.whitespace.cloneNode(!1),r=i.span.cloneNode(!1),r.className=h.options.iconBase+" "+n.labelIcon,c.appendChild(r),c.appendChild(f)),n.labelSubtext&&(t=i.subtext.cloneNode(!1),t.textContent=n.labelSubtext,u.appendChild(t)),c.appendChild(u),c};if(this.options.title&&!this.multiple){f--;var a=this.$element[0],nt=!1,tt=!this.selectpicker.view.titleOption.parentNode;tt&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",nt=void 0===n(a.options[a.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected"));(tt||0!==this.selectpicker.view.titleOption.index)&&a.insertBefore(this.selectpicker.view.titleOption,a.firstChild);nt&&(a.selectedIndex=0)}v=this.$element.find("option");v.each(function(i){var ft=n(this),yt,pt,ti,c,nt,tt;if(f++,!ft.hasClass("bs-title-option")){var a,et,u=ft.data(),wt=this.className||"",bt=s(this.style.cssText),ot=u.content,st=this.textContent,kt=u.tokens,ht=u.subtext,lt=u.icon,rt=ft.parent(),ut=rt[0],at="OPTGROUP"===ut.tagName,dt=at&&ut.disabled,ct=this.disabled||dt,k=this.previousElementSibling&&"OPTGROUP"===this.previousElementSibling.tagName,vt=rt.data();if(!0===u.hidden||h.options.hideDisabled&&(ct&&!at||dt))return(a=u.prevHiddenIndex,ft.next().data("prevHiddenIndex",void 0!==a?a:i),f--,k||void 0===a)||(c=v[a].previousElementSibling,c&&"OPTGROUP"===c.tagName&&!c.disabled&&(k=!0)),void(k&&"divider"!==r[r.length-1].type&&(f++,e.push(l(!1,0,t.DIVIDER,o+"div")),r.push({type:"divider",optID:o,originalIndex:i})));if(at&&!0!==u.divider){if(h.options.hideDisabled&&ct&&(void 0===vt.allOptionsDisabled&&(yt=rt.children(),rt.data("allOptionsDisabled",yt.filter(":disabled").length===yt.length)),rt.data("allOptionsDisabled")))return void f--;if(pt=" "+ut.className||"",!this.previousElementSibling){o+=1;var ii=ut.label,gt=s(ii),ni=vt.subtext,ri=vt.icon;0!==i&&e.length>0&&(f++,e.push(l(!1,0,t.DIVIDER,o+"div")),r.push({type:"divider",optID:o,originalIndex:i}));f++;ti=it({labelEscaped:gt,labelSubtext:ni,labelIcon:ri});e.push(l(ti,0,"dropdown-header"+pt,o));r.push({content:gt,subtext:ni,type:"optgroup-label",optID:o,originalIndex:i});p=f-1}if(h.options.hideDisabled&&ct||!0===u.hidden)return void f--;et=g({text:st,optionContent:ot,optionSubtext:ht,optionIcon:lt});e.push(l(d(et,"opt "+wt+pt,bt),0,"",o));r.push({content:ot||st,subtext:ht,tokens:kt,type:"option",optID:o,headerIndex:p,lastIndex:p+ut.childElementCount,originalIndex:i,data:u});y++}else!0===u.divider?(e.push(l(!1,0,"divider")),r.push({type:"divider",originalIndex:i})):(!k&&h.options.hideDisabled&&void 0!==(a=u.prevHiddenIndex)&&(c=v[a].previousElementSibling,c&&"OPTGROUP"===c.tagName&&!c.disabled&&(k=!0)),k&&"divider"!==r[r.length-1].type&&(f++,e.push(l(!1,0,t.DIVIDER,o+"div")),r.push({type:"divider",optID:o,originalIndex:i})),et=g({text:st,optionContent:ot,optionSubtext:ht,optionIcon:lt}),e.push(l(d(et,wt,bt))),r.push({content:ot||st,subtext:ht,tokens:kt,type:"option",originalIndex:i,data:u}),y++);h.selectpicker.main.map.newIndex[i]=f;h.selectpicker.main.map.originalIndex[f]=i;nt=r[r.length-1];nt.disabled=ct;tt=0;nt.content&&(tt+=nt.content.length);nt.subtext&&(tt+=nt.subtext.length);lt&&(tt+=1);tt>b&&(b=tt,w=e[e.length-1])}});this.selectpicker.main.elements=e;this.selectpicker.main.data=r;this.selectpicker.current=this.selectpicker.main;this.selectpicker.view.widestOption=w;this.selectpicker.view.availableOptionsCount=y},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var i=this,y=this.$element.find("option"),r=[],e=[],f,h,c,n,l,a,u,v,t,o,s;for(this.togglePlaceholder(),this.tabIndex(),f=0,h=this.selectpicker.main.elements.length;f<h;f++)if(c=this.selectpicker.main.map.originalIndex[f],n=y[c],n&&n.selected&&(r.push(n),e.length<100&&"count"!==i.options.selectedTextFormat||1===r.length)){if(i.options.hideDisabled&&(n.disabled||"OPTGROUP"===n.parentNode.tagName&&n.parentNode.disabled))return;u=this.selectpicker.main.data[f].data;v=u.icon&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+u.icon+'"><\/i> ':"";l=i.options.showSubtext&&u.subtext&&!i.multiple?' <small class="text-muted">'+u.subtext+"<\/small>":"";a=n.title?n.title:u.content&&i.options.showContent?u.content.toString():v+n.innerHTML.trim()+l;e.push(a)}t=this.multiple?e.join(this.options.multipleSeparator):e[0];(r.length>50&&(t+="..."),this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count"))&&(o=this.options.selectedTextFormat.split(">"),(o.length>1&&r.length>o[1]||1===o.length&&r.length>=2)&&(s=this.selectpicker.view.availableOptionsCount,t=("function"==typeof this.options.countSelectedText?this.options.countSelectedText(r.length,s):this.options.countSelectedText).replace("{0}",r.length.toString()).replace("{1}",s.toString())));void 0==this.options.title&&(this.options.title=this.$element.attr("title"));"static"==this.options.selectedTextFormat&&(t=this.options.title);t||(t=void 0!==this.options.title?this.options.title:this.options.noneSelectedText);this.$button[0].title=d(t.replace(/<[^>]*>?/g,"").trim());this.$button.find(".filter-option-inner-inner")[0].innerHTML=t;this.$element.trigger("rendered.bs.select")},setStyle:function(n,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var i=n||this.options.style;"add"==t?this.$button.addClass(i):"remove"==t?this.$button.removeClass(i):(this.$button.removeClass(this.options.style),this.$button.addClass(i))},liHeight:function(i){var d;if(i||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var c=document.createElement("div"),o=document.createElement("div"),a=document.createElement("div"),s=document.createElement("ul"),k=document.createElement("li"),l=document.createElement("li"),nt=document.createElement("li"),v=document.createElement("a"),y=document.createElement("span"),p=this.options.header&&this.$menu.find("."+t.POPOVERHEADER).length>0?this.$menu.find("."+t.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?document.createElement("div"):null,w=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,b=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,y.className="text",v.className="dropdown-item",c.className=this.$menu[0].parentNode.className+" "+t.SHOW,c.style.width=this.sizeInfo.selectWidth+"px",o.className="dropdown-menu "+t.SHOW,a.className="inner "+t.SHOW,s.className="dropdown-menu inner "+("4"===u.major?t.SHOW:""),k.className=t.DIVIDER,l.className="dropdown-header",y.appendChild(document.createTextNode("Inner text")),v.appendChild(y),nt.appendChild(v),l.appendChild(y.cloneNode(!0)),this.selectpicker.view.widestOption&&s.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),s.appendChild(nt),s.appendChild(k),s.appendChild(l),p&&o.appendChild(p),h)&&(d=document.createElement("input"),h.className="bs-searchbox",d.className="form-control",h.appendChild(d),o.appendChild(h));w&&o.appendChild(w);a.appendChild(s);o.appendChild(a);b&&o.appendChild(b);c.appendChild(o);document.body.appendChild(c);var tt,rt=v.offsetHeight,ut=l?l.offsetHeight:0,ft=p?p.offsetHeight:0,et=h?h.offsetHeight:0,ot=w?w.offsetHeight:0,st=b?b.offsetHeight:0,ht=n(k).outerHeight(!0),r=!!window.getComputedStyle&&window.getComputedStyle(o),it=o.offsetWidth,e=r?null:n(o),g={vert:f(r?r.paddingTop:e.css("paddingTop"))+f(r?r.paddingBottom:e.css("paddingBottom"))+f(r?r.borderTopWidth:e.css("borderTopWidth"))+f(r?r.borderBottomWidth:e.css("borderBottomWidth")),horiz:f(r?r.paddingLeft:e.css("paddingLeft"))+f(r?r.paddingRight:e.css("paddingRight"))+f(r?r.borderLeftWidth:e.css("borderLeftWidth"))+f(r?r.borderRightWidth:e.css("borderRightWidth"))},ct={vert:g.vert+f(r?r.marginTop:e.css("marginTop"))+f(r?r.marginBottom:e.css("marginBottom"))+2,horiz:g.horiz+f(r?r.marginLeft:e.css("marginLeft"))+f(r?r.marginRight:e.css("marginRight"))+2};a.style.overflowY="scroll";tt=o.offsetWidth-it;document.body.removeChild(c);this.sizeInfo.liHeight=rt;this.sizeInfo.dropdownHeaderHeight=ut;this.sizeInfo.headerHeight=ft;this.sizeInfo.searchHeight=et;this.sizeInfo.actionsHeight=ot;this.sizeInfo.doneButtonHeight=st;this.sizeInfo.dividerHeight=ht;this.sizeInfo.menuPadding=g;this.sizeInfo.menuExtras=ct;this.sizeInfo.menuWidth=it;this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth;this.sizeInfo.scrollBarWidth=tt;this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight;this.setPositionData()}},getSelectPosition:function(){var t,r=this,u=n(window),e=r.$newElement.offset(),f=n(r.options.container),i;r.options.container&&!f.is("body")?(t=f.offset(),t.top+=parseInt(f.css("borderTopWidth")),t.left+=parseInt(f.css("borderLeftWidth"))):t={top:0,left:0};i=r.options.windowPadding;this.sizeInfo.selectOffsetTop=e.top-t.top-u.scrollTop();this.sizeInfo.selectOffsetBot=u.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-i[2];this.sizeInfo.selectOffsetLeft=e.left-t.left-u.scrollLeft();this.sizeInfo.selectOffsetRight=u.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-i[1];this.sizeInfo.selectOffsetTop-=i[0];this.sizeInfo.selectOffsetLeft-=i[3]},setMenuSize:function(){var u;this.getSelectPosition();var r,n,f,e,o,s,v,w=this.sizeInfo.selectWidth,y=this.sizeInfo.liHeight,h=this.sizeInfo.headerHeight,c=this.sizeInfo.searchHeight,l=this.sizeInfo.actionsHeight,a=this.sizeInfo.doneButtonHeight,b=this.sizeInfo.dividerHeight,i=this.sizeInfo.menuPadding,p=0;if(this.options.dropupAuto&&(v=y*this.selectpicker.current.elements.length+i.vert,this.$newElement.toggleClass(t.DROPUP,this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&v+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)e=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,f=e+h+c+l+a,s=Math.max(e-i.vert,0),this.$newElement.hasClass(t.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=n,r=n-h-c-l-a-i.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(u=0;u<this.options.size;u++)"divider"===this.selectpicker.current.data[u].type&&p++;n=y*this.options.size+p*b+i.vert;r=n-i.vert;o=n+h+c+l+a;f=s=""}"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(t.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.$menu[0].offsetWidth-w);this.$menu.css({"max-height":o+"px",overflow:"hidden","min-height":f+"px"});this.$menuInner.css({"max-height":r+"px","overflow-y":"auto","min-height":s+"px"});this.sizeInfo.menuInnerHeight=r;this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth));this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(t){if(this.liHeight(t),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var u,i=this,f=n(window),r=0;this.setMenuSize();"auto"===this.options.size?(this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return i.setMenuSize()}),f.off("resize.setMenuSize scroll.setMenuSize").on("resize.setMenuSize scroll.setMenuSize",function(){return i.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&(this.$searchbox.off("input.setMenuSize propertychange.setMenuSize"),f.off("resize.setMenuSize scroll.setMenuSize"));t?r=this.$menuInner[0].scrollTop:i.multiple||"number"==typeof(u=i.selectpicker.main.map.newIndex[i.$element[0].selectedIndex])&&!1!==i.options.size&&(r=i.sizeInfo.liHeight*u,r=r-i.sizeInfo.menuInnerHeight/2+i.sizeInfo.liHeight/2);i.createView(!1,r)}},setWidth:function(){var n=this;"auto"===this.options.width?requestAnimationFrame(function(){n.$menu.css("min-width","0");n.liHeight();n.setMenuSize();var t=n.$newElement.clone().appendTo("body"),i=t.css("width","auto").children("button").outerWidth();t.remove();n.sizeInfo.selectWidth=Math.max(n.sizeInfo.totalMenuWidth,i);n.$newElement.css("width",n.sizeInfo.selectWidth+"px")}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement.removeClass("fit-width")},selectPosition:function(){this.$bsContainer=n('<div class="bs-container" />');var e,r,o,i=this,f=n(this.options.container),s=function(n){var s={};i.$bsContainer.addClass(n.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(t.DROPUP,n.hasClass(t.DROPUP));e=n.offset();f.is("body")?r={top:0,left:0}:(r=f.offset(),r.top+=parseInt(f.css("borderTopWidth"))-f.scrollTop(),r.left+=parseInt(f.css("borderLeftWidth"))-f.scrollLeft());o=n.hasClass(t.DROPUP)?0:n[0].offsetHeight;u.major<4&&(s.top=e.top-r.top+o,s.left=e.left-r.left);s.width=n[0].offsetWidth;i.$bsContainer.css(s)};this.$button.on("click.bs.dropdown.data-api",function(){i.isDisabled()||(s(i.$newElement),i.$bsContainer.appendTo(i.options.container).toggleClass(t.SHOW,!i.$button.hasClass(t.SHOW)).append(i.$menu))});n(window).on("resize scroll",function(){s(i.$newElement)});this.$element.on("hide.bs.select",function(){i.$menu.data("height",i.$menu.height());i.$bsContainer.detach()})},setOptionStatus:function(){var n=this,e=this.$element.find("option"),r,i,t,u,f;if(n.noScroll=!1,n.selectpicker.view.visibleElements&&n.selectpicker.view.visibleElements.length)for(r=0;r<n.selectpicker.view.visibleElements.length;r++)i=n.selectpicker.current.map.originalIndex[r+n.selectpicker.view.position0],t=e[i],t&&(u=this.selectpicker.main.map.newIndex[i],f=this.selectpicker.main.elements[u],n.setDisabled(i,t.disabled||"OPTGROUP"===t.parentNode.tagName&&t.parentNode.disabled,u,f),n.setSelected(i,t.selected,u,f))},setSelected:function(n,t,i,r){var o,u,f,s=void 0!==this.activeIndex,h=this.activeIndex===n,e=h||t&&!this.multiple&&!s;i||(i=this.selectpicker.main.map.newIndex[n]);r||(r=this.selectpicker.main.elements[i]);f=r.firstChild;t&&(this.selectedIndex=n);r.classList.toggle("selected",t);r.classList.toggle("active",e);e&&(this.selectpicker.view.currentActive=r,this.activeIndex=n);f&&(f.classList.toggle("selected",t),f.classList.toggle("active",e),f.setAttribute("aria-selected",t));e||!s&&t&&void 0!==this.prevActiveIndex&&(o=this.selectpicker.main.map.newIndex[this.prevActiveIndex],u=this.selectpicker.main.elements[o],u.classList.remove("selected"),u.classList.remove("active"),u.firstChild&&(u.firstChild.classList.remove("selected"),u.firstChild.classList.remove("active")))},setDisabled:function(n,i,r,f){var e;r||(r=this.selectpicker.main.map.newIndex[n]);f||(f=this.selectpicker.main.elements[r]);e=f.firstChild;f.classList.toggle(t.DISABLED,i);e&&("4"===u.major&&e.classList.toggle(t.DISABLED,i),e.setAttribute("aria-disabled",i),i?e.setAttribute("tabindex",-1):e.setAttribute("tabindex",0))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var n=this;this.isDisabled()?(this.$newElement.addClass(t.DISABLED),this.$button.addClass(t.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button.hasClass(t.DISABLED)&&(this.$newElement.removeClass(t.DISABLED),this.$button.removeClass(t.DISABLED).attr("aria-disabled",!1)),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"));this.$button.click(function(){return!n.isDisabled()})},togglePlaceholder:function(){var t=this.$element[0],i=t.selectedIndex,n=-1===i;n||t.options[i].value||(n=!0);this.$button.toggleClass("bs-placeholder",n)},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")));this.$element.attr("tabindex",-98)},clickListener:function(){var i=this,r=n(document);r.data("spaceSelect",!1);this.$button.on("keyup",function(n){/(32)/.test(n.keyCode.toString(10))&&r.data("spaceSelect")&&(n.preventDefault(),r.data("spaceSelect",!1))});this.$newElement.on("show.bs.dropdown",function(){u.major>3&&!i.dropdown&&(i.dropdown=i.$button.data("bs.dropdown"),i.dropdown._menu=i.$menu[0])});this.$button.on("click.bs.dropdown.data-api",function(){i.$newElement.hasClass(t.SHOW)||i.setSize()});this.$element.on("shown.bs.select",function(){i.$menuInner[0].scrollTop!==i.selectpicker.view.scrollTop&&(i.$menuInner[0].scrollTop=i.selectpicker.view.scrollTop);i.options.liveSearch?i.$searchbox.focus():i.$menuInner.focus()});this.$menuInner.on("click","li a",function(r,u){var a=n(this),ut=i.isVirtual()?i.selectpicker.view.position0:0,s=i.selectpicker.current.map.originalIndex[a.parent().index()+ut],tt=h(i.$element[0]),ft=i.$element.prop("selectedIndex"),p=!0,b,k,rt;if(i.multiple&&1!==i.options.maxOptions&&r.stopPropagation(),r.preventDefault(),!i.isDisabled()&&!a.parent().hasClass(t.DISABLED)){var v=i.$element.find("option"),c=v.eq(s),it=c.prop("selected"),w=c.parent("optgroup"),f=i.options.maxOptions,e=w.data("maxOptions")||!1;if(s===i.activeIndex&&(u=!0),u||(i.prevActiveIndex=i.activeIndex,i.activeIndex=void 0),i.multiple){if((c.prop("selected",!it),i.setSelected(s,!it),a.blur(),!1!==f||!1!==e)&&(b=f<v.filter(":selected").length,k=e<w.find("option:selected").length,f&&b||e&&k))if(f&&1==f)v.prop("selected",!1),c.prop("selected",!0),i.$menuInner.find(".selected").removeClass("selected"),i.setSelected(s,!0);else if(e&&1==e)w.find("option:selected").prop("selected",!1),c.prop("selected",!0),rt=i.selectpicker.current.data[a.parent().index()+i.selectpicker.view.position0].optID,i.$menuInner.find(".optgroup-"+rt).removeClass("selected"),i.setSelected(s,!0);else{var d="string"==typeof i.options.maxOptionsText?[i.options.maxOptionsText,i.options.maxOptionsText]:i.options.maxOptionsText,l="function"==typeof d?d(f,e):d,g=l[0].replace("{n}",f),nt=l[1].replace("{n}",e),y=n('<div class="notify"><\/div>');l[2]&&(g=g.replace("{var}",l[2][f>1?0:1]),nt=nt.replace("{var}",l[2][e>1?0:1]));c.prop("selected",!1);i.$menu.append(y);f&&b&&(y.append(n("<div>"+g+"<\/div>")),p=!1,i.$element.trigger("maxReached.bs.select"));e&&k&&(y.append(n("<div>"+nt+"<\/div>")),p=!1,i.$element.trigger("maxReachedGrp.bs.select"));setTimeout(function(){i.setSelected(s,!1)},10);y.delay(750).fadeOut(300,function(){n(this).remove()})}}else v.prop("selected",!1),c.prop("selected",!0),i.setSelected(s,!0);!i.multiple||i.multiple&&1===i.options.maxOptions?i.$button.focus():i.options.liveSearch&&i.$searchbox.focus();p&&(tt!=h(i.$element[0])&&i.multiple||ft!=i.$element.prop("selectedIndex")&&!i.multiple)&&(o=[s,c.prop("selected"),tt],i.$element.triggerNative("change"))}});this.$menu.on("click","li."+t.DISABLED+" a, ."+t.POPOVERHEADER+", ."+t.POPOVERHEADER+" :not(.close)",function(t){t.currentTarget==this&&(t.preventDefault(),t.stopPropagation(),i.options.liveSearch&&!n(t.target).hasClass("close")?i.$searchbox.focus():i.$button.focus())});this.$menuInner.on("click",".divider, .dropdown-header",function(n){n.preventDefault();n.stopPropagation();i.options.liveSearch?i.$searchbox.focus():i.$button.focus()});this.$menu.on("click","."+t.POPOVERHEADER+" .close",function(){i.$button.click()});this.$searchbox.on("click",function(n){n.stopPropagation()});this.$menu.on("click",".actions-btn",function(t){i.options.liveSearch?i.$searchbox.focus():i.$button.focus();t.preventDefault();t.stopPropagation();n(this).hasClass("bs-select-all")?i.selectAll():i.deselectAll()});this.$element.on({change:function(){i.render();i.$element.trigger("changed.bs.select",o);o=null},focus:function(){i.$button.focus()}})},liveSearchListener:function(){var n=this,t=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){n.$searchbox.val()&&n.$searchbox.val("")});this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(n){n.stopPropagation()});this.$searchbox.on("input propertychange",function(){var o=n.$searchbox.val(),i,r,h;if(n.selectpicker.search.map.newIndex={},n.selectpicker.search.map.originalIndex={},n.selectpicker.search.elements=[],n.selectpicker.search.data=[],o){var r,e=[],v=o.toUpperCase(),u={},f=[],y=n._searchStyle(),p=n.options.liveSearchNormalize;for(n._$lisSelected=n.$menuInner.find(".selected"),r=0;r<n.selectpicker.main.data.length;r++)i=n.selectpicker.main.data[r],u[r]||(u[r]=c(i,v,y,p)),u[r]&&void 0!==i.headerIndex&&-1===f.indexOf(i.headerIndex)&&(i.headerIndex>0&&(u[i.headerIndex-1]=!0,f.push(i.headerIndex-1)),u[i.headerIndex]=!0,f.push(i.headerIndex),u[i.lastIndex+1]=!0),u[r]&&"optgroup-label"!==i.type&&f.push(r);for(r=0,h=f.length;r<h;r++){var l=f[r],w=f[r-1],i=n.selectpicker.main.data[l],a=n.selectpicker.main.data[w];("divider"!==i.type||"divider"===i.type&&a&&"divider"!==a.type&&h-1!==r)&&(n.selectpicker.search.data.push(i),e.push(n.selectpicker.main.elements[l]),n.selectpicker.search.map.newIndex[i.originalIndex]=e.length-1,n.selectpicker.search.map.originalIndex[e.length-1]=i.originalIndex)}n.activeIndex=void 0;n.noScroll=!0;n.$menuInner.scrollTop(0);n.selectpicker.search.elements=e;n.createView(!0);e.length||(t.className="no-results",t.innerHTML=n.options.noneResultsText.replace("{0}",'"'+s(o)+'"'),n.$menuInner[0].firstChild.appendChild(t))}else n.$menuInner.scrollTop(0),n.createView(!1)})},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(n){return void 0!==n?(this.$element.val(n).triggerNative("change"),this.$element):this.$element.val()},changeAll:function(n){var i,f,t;if(this.multiple){void 0===n&&(n=!0);var e=this.$element.find("option"),r=0,u=0,s=h(this.$element[0]);for(this.$element.addClass("bs-select-hidden"),i=0;i<this.selectpicker.current.elements.length;i++)f=this.selectpicker.current.map.originalIndex[i],t=e[f],t&&(t.selected&&r++,t.selected=n,t.selected&&u++);this.$element.removeClass("bs-select-hidden");r!==u&&(this.setOptionStatus(),this.togglePlaceholder(),o=[null,null,s],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(n){n=n||window.event;n&&n.stopPropagation();this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(i){var f,d,e,o,h,l=n(this),ht=l.is("input")?l.parent().parent():l.parent(),u=ht.data("this"),v=u.findLis(),w=!1,ut=i.which===r.TAB&&!l.hasClass("dropdown-toggle")&&!u.options.selectOnTab,et=nt.test(i.which)||ut,it=u.$menuInner[0].scrollTop,ot=u.isVirtual(),s=!0===ot?u.selectpicker.view.position0:0,y,ft,b,p,k,st,rt,a;if(d=u.$newElement.hasClass(t.SHOW),!d&&(et||i.which>=48&&i.which<=57||i.which>=96&&i.which<=105||i.which>=65&&i.which<=90)&&u.$button.trigger("click.bs.dropdown.data-api"),i.which===r.ESCAPE&&d&&(i.preventDefault(),u.$button.trigger("click.bs.dropdown.data-api").focus()),et){if(!v.length)return;f=!0===ot?v.index(v.filter(".active")):u.selectpicker.current.map.newIndex[u.activeIndex];void 0===f&&(f=-1);-1!==f&&(e=u.selectpicker.current.elements[f+s],e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"));i.which===r.ARROW_UP?(-1!==f&&f--,f+s<0&&(f+=v.length),u.selectpicker.view.canHighlight[f+s]||-1==(f=u.selectpicker.view.canHighlight.slice(0,f+s).lastIndexOf(!0)-s)&&(f=v.length-1)):(i.which===r.ARROW_DOWN||ut)&&(f++,f+s>=u.selectpicker.view.canHighlight.length&&(f=0),u.selectpicker.view.canHighlight[f+s]||(f=f+1+u.selectpicker.view.canHighlight.slice(f+s+1).indexOf(!0)));i.preventDefault();y=s+f;i.which===r.ARROW_UP?0===s&&f===v.length-1?(u.$menuInner[0].scrollTop=u.$menuInner[0].scrollHeight,y=u.selectpicker.current.elements.length-1):(o=u.selectpicker.current.data[y],h=o.position-o.height,w=h<it):(i.which===r.ARROW_DOWN||ut)&&(0!==s&&0===f?(u.$menuInner[0].scrollTop=0,y=0):(o=u.selectpicker.current.data[y],h=o.position-u.sizeInfo.menuInnerHeight,w=h>it));e=u.selectpicker.current.elements[y];e.classList.add("active");e.firstChild&&e.firstChild.classList.add("active");u.activeIndex=u.selectpicker.current.map.originalIndex[y];u.selectpicker.view.currentActive=e;w&&(u.$menuInner[0].scrollTop=h);u.options.liveSearch?u.$searchbox.focus():l.focus()}else if(!l.is("input")&&!tt.test(i.which)||i.which===r.SPACE&&u.selectpicker.keydown.keyHistory){for(p=[],i.preventDefault(),u.selectpicker.keydown.keyHistory+=g[i.which],u.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(u.selectpicker.keydown.resetKeyHistory.cancel),u.selectpicker.keydown.resetKeyHistory.cancel=u.selectpicker.keydown.resetKeyHistory.start(),b=u.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0)),k=0;k<u.selectpicker.current.data.length;k++)rt=u.selectpicker.current.data[k],st=c(rt,b,"startsWith",!0),st&&u.selectpicker.view.canHighlight[k]&&(rt.index=k,p.push(rt.originalIndex));p.length&&(a=0,v.removeClass("active").find("a").removeClass("active"),1===b.length&&(a=p.indexOf(u.activeIndex),-1===a||a===p.length-1?a=0:a++),ft=u.selectpicker.current.map.newIndex[p[a]],o=u.selectpicker.current.data[ft],it-o.position>0?(h=o.position-o.height,w=!0):(h=o.position-u.sizeInfo.menuInnerHeight,w=o.position>it+u.sizeInfo.menuInnerHeight),e=u.selectpicker.current.elements[ft],e.classList.add("active"),e.firstChild&&e.firstChild.classList.add("active"),u.activeIndex=p[a],e.firstChild.focus(),w&&(u.$menuInner[0].scrollTop=h),l.focus())}d&&(i.which===r.SPACE&&!u.selectpicker.keydown.keyHistory||i.which===r.ENTER||i.which===r.TAB&&u.options.selectOnTab)&&(i.which!==r.SPACE&&i.preventDefault(),u.options.liveSearch&&i.which===r.SPACE||(u.$menuInner.find(".active a").trigger("click",!0),l.focus(),u.options.liveSearch||(i.preventDefault(),n(document).data("spaceSelect",!0))))},mobile:function(){this.$element.addClass("mobile-device")},refresh:function(){var t=n.extend({},this.options,this.$element.data());this.options=t;this.selectpicker.main.map.newIndex={};this.selectpicker.main.map.originalIndex={};this.createLi();this.checkDisabled();this.render();this.setStyle();this.setWidth();this.setSize(!0);this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove();this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove();this.$bsContainer?this.$bsContainer.remove():this.$menu.remove();this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")}};w=n.fn.selectpicker;n.fn.selectpicker=l;n.fn.selectpicker.Constructor=i;n.fn.selectpicker.noConflict=function(){return n.fn.selectpicker=w,this};n(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',i.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',function(n){n.stopPropagation()});n(window).on("load.bs.select.data-api",function(){n(".selectpicker").each(function(){var t=n(this);l.call(t,t.data())})})}(n)})