/* * bootstrap-select v1.12.13 (https://github.com/heimrichhannot/bootstrap-select) * * copyright 2013-2017 bootstrap-select * licensed under mit (https://github.com/heimrichhannot/bootstrap-select/license) */ (function(a,b){if(typeof define==="function"&&define.amd){define(["jquery"],function(c){return(b(c))})}else{if(typeof module==="object"&&module.exports){module.exports=b(require("jquery"))}else{b(a.jquery)}}}(this,function(a){(function(g){if(!string.prototype.includes){(function(){var q={}.tostring;var n=(function(){try{var u={};var t=object.defineproperty;var r=t(u,u,u)&&t}catch(s){}return r}());var p="".indexof;var o=function(w){if(this==null){throw new typeerror()}var u=string(this);if(w&&q.call(w)=="[object regexp]"){throw new typeerror()}var s=u.length;var t=string(w);var v=t.length;var r=arguments.length>1?arguments[1]:undefined;var y=r?number(r):0;if(y!=y){y=0}var x=math.min(math.max(y,0),s);if(v+x>s){return false}return p.call(u,t,y)!=-1};if(n){n(string.prototype,"includes",{value:o,configurable:true,writable:true,})}else{string.prototype.includes=o}}())}if(!string.prototype.startswith){(function(){var n=(function(){try{var t={};var s=object.defineproperty;var q=s(t,t,t)&&s}catch(r){}return q}());var p={}.tostring;var o=function(x){if(this==null){throw new typeerror()}var u=string(this);if(x&&p.call(x)=="[object regexp]"){throw new typeerror()}var q=u.length;var y=string(x);var s=y.length;var t=arguments.length>1?arguments[1]:undefined;var w=t?number(t):0;if(w!=w){w=0}var r=math.min(math.max(w,0),q);if(s+r>q){return false}var v=-1;while(++v":">",'"':""","'":"'","`":"`",};var b={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`",};var f=function(r){var o=function(s){return r[s]};var q="(?:"+object.keys(r).join("|")+")";var p=regexp(q);var n=regexp(q,"g");return function(s){s=s==null?"":""+s;return p.test(s)?s.replace(n,o):s}};var l=f(h);var i=f(b);var k=function(p,o){if(!e.usedefault){g.valhooks.select.set=e._set;e.usedefault=true}this.$element=g(p);this.$newelement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=o;if(this.options.title===null){this.options.title=this.$element.attr("title")}var n=this.options.windowpadding;if(typeof n==="number"){this.options.windowpadding=[n,n,n,n]}this.val=k.prototype.val;this.render=k.prototype.render;this.refresh=k.prototype.refresh;this.setstyle=k.prototype.setstyle;this.selectall=k.prototype.selectall;this.deselectall=k.prototype.deselectall;this.destroy=k.prototype.destroy;this.remove=k.prototype.remove;this.show=k.prototype.show;this.hide=k.prototype.hide;this.init()};k.version="1.12.2";k.defaults={noneselectedtext:"nothing selected",noneresultstext:"no results matched {0}",countselectedtext:function(o,n){return(o==1)?"{0} item selected":"{0} items selected"},maxoptionstext:function(n,o){return[(n==1)?"limit reached ({n} item max)":"limit reached ({n} items max)",(o==1)?"group limit reached ({n} item max)":"group limit reached ({n} items max)",]},selectalltext:"select all",deselectalltext:"deselect all",donebutton:false,donebuttontext:"close",multipleseparator:", ",stylebase:"btn",style:"btn-default btn-light",size:"auto",title:null,selectedtextformat:"values",width:false,container:false,hidedisabled:false,showsubtext:false,showicon:true,showcontent:true,dropupauto:true,header:false,livesearch:false,livesearchplaceholder:null,livesearchnormalize:false,livesearchstyle:"contains",actionsbox:false,iconbase:"fa",tickicon:"icon-line-check",showtick:false,template:{caret:'',},maxoptions:false,mobile:false,selectontab:false,dropdownalignright:false,windowpadding:0,};k.prototype={constructor:k,init:function(){var n=this,o=this.$element.attr("id");this.$element.addclass("bs-select-hidden");this.liobj={};this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newelement=this.createview();this.$element.after(this.$newelement).appendto(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");if(this.options.dropdownalignright===true){this.$menu.addclass("dropdown-menu-right")}if(typeof o!=="undefined"){this.$button.attr("data-id",o);g('label[for="'+o+'"]').click(function(p){p.preventdefault();n.$button.focus()})}this.checkdisabled();this.clicklistener();if(this.options.livesearch){this.livesearchlistener()}this.render();this.setstyle();this.setwidth();if(this.options.container){this.selectposition()}this.$menu.data("this",this);this.$newelement.data("this",this);if(this.options.mobile){this.mobile()}this.$newelement.on({"hide.bs.dropdown":function(p){n.$menuinner.attr("aria-expanded",false);n.$element.trigger("hide.bs.select",p)},"hidden.bs.dropdown":function(p){n.$element.trigger("hidden.bs.select",p)},"show.bs.dropdown":function(p){n.$menuinner.attr("aria-expanded",true);n.$element.trigger("show.bs.select",p)},"shown.bs.dropdown":function(p){n.$element.trigger("shown.bs.select",p)},});if(n.$element[0].hasattribute("required")){this.$element.on("invalid",function(){n.$button.addclass("bs-invalid").focus();n.$element.on({"focus.bs.select":function(){n.$button.focus();n.$element.off("focus.bs.select")},"shown.bs.select":function(){n.$element.val(n.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){if(this.validity.valid){n.$button.removeclass("bs-invalid")}n.$element.off("rendered.bs.select")},})})}settimeout(function(){n.$element.trigger("loaded.bs.select")})},createdropdown:function(){var s=(this.multiple||this.options.showtick)?" show-tick":"",o=this.$element.parent().hasclass("input-group")?" input-group-btn":"",u=this.autofocus?" autofocus":"";var t=this.options.header?'
'+this.options.header+"
":"";var r=this.options.livesearch?'':"";var q=this.multiple&&this.options.actionsbox?'
":"";var n=this.multiple&&this.options.donebutton?'
":"";var p='
";return g(p)},createview:function(){var o=this.createdropdown(),n=this.createli();o.find("div.inner")[0].innerhtml=n;return o},reloadli:function(){var n=this.createli();this.$menuinner[0].innerhtml=n},createli:function(){var u=this,t=[],x=0,n=document.createelement("option"),q=-1;var p=function(b,z,a,y){a="dropdown-item "+(a||"");return'"+b+""};var r=function(a,z,y){return""+a+""};var v=function(b,y,a,z){y="dropdown-item-inner "+(y||"");return"'+b+''};if(this.options.title&&!this.multiple){q--;if(!this.$element.find(".bs-title-option").length){var s=this.$element[0];n.classname="bs-title-option";n.innerhtml=this.options.title;n.value="";s.insertbefore(n,s.firstchild);var w=g(s.options[s.selectedindex]);if(w.attr("selected")===undefined&&this.$element.data("selected")===undefined){n.selected=true}}}var o=this.$element.find("option");o.each(function(c){var b=g(this);q++;if(b.hasclass("bs-title-option")){return}var e=this.classname||"",a=l(this.style.csstext),f=b.data("content")?b.data("content"):b.html(),h=b.data("tokens")?b.data("tokens"):null,r=typeof b.data("subtext")!=="undefined"?''+b.data("subtext")+"":"",o=typeof b.data("icon")!=="undefined"?' ':"",j=b.parent(),z=j[0].tagname==="optgroup",m=z&&j[0].disabled,g=this.disabled||m,y;if(o!==""&&g){o=""+o+""}if(u.options.hidedisabled&&(g&&!z||m)){y=b.data("prevhiddenindex");b.next().data("prevhiddenindex",(y!==undefined?y:c));q--;return}if(!b.data("content")){f=o+''+f+r+""}if(z&&b.data("divider")!==true){if(u.options.hidedisabled&&g){if(j.data("alloptionsdisabled")===undefined){var n=j.children();j.data("alloptionsdisabled",n.filter(":disabled").length===n.length)}if(j.data("alloptionsdisabled")){q--;return}}var p=" "+j[0].classname||"";if(b.index()===0){x+=1;var d=j[0].label,q=typeof j.data("subtext")!=="undefined"?''+j.data("subtext")+"":"",k=j.data("icon")?' ':"";d=k+''+l(d)+q+"";if(c!==0&&t.length>0){q++;t.push(r("","dropdown-divider",x+"div"))}q++;t.push(r(d,"dropdown-header"+p,x))}if(u.options.hidedisabled&&g){q--;return}t.push(p(v(f,"opt "+e+p,a,h),c,"",x))}else{if(b.data("divider")===true){t.push(r("","dropdown-divider",x+"div"))}else{if(b.data("hidden")===true){y=b.data("prevhiddenindex");b.next().data("prevhiddenindex",(y!==undefined?y:c));t.push(p(v(f,e,a,h),c,"hidden is-hidden"))}else{var i=this.previouselementsibling&&this.previouselementsibling.tagname==="optgroup";if(!i&&u.options.hidedisabled){y=b.data("prevhiddenindex");if(y!==undefined){var l=o.eq(y)[0].previouselementsibling;if(l&&l.tagname==="optgroup"&&!l.disabled){i=true}}}if(i){q++;t.push(r("","dropdown-divider",x+"div"))}t.push(p(v(f,e,a,h),c))}}}u.liobj[c]=q});if(!this.multiple&&this.$element.find("option:selected").length===0&&!this.options.title){this.$element.find("option").eq(0).prop("selected",true).attr("selected","selected")}return t.join("")},findlis:function(){if(this.$lis==null){this.$lis=this.$menu.find("a, .dropdown-header, .dropdown-divider")}return this.$lis},render:function(r){var q=this,n,o=this.$element.find("option");if(r!==false){o.each(function(w){var x=q.findlis().eq(q.liobj[w]);q.setdisabled(w,this.disabled||this.parentnode.tagname==="optgroup"&&this.parentnode.disabled,x);q.setselected(w,this.selected,x)})}this.toggleplaceholder();this.tabindex();var p=o.map(function(){if(this.selected){if(q.options.hidedisabled&&(this.disabled||this.parentnode.tagname==="optgroup"&&this.parentnode.disabled)){return}var y=g(this),x=y.data("icon")&&q.options.showicon?' ':"",w;if(q.options.showsubtext&&y.data("subtext")&&!q.multiple){w=' '+y.data("subtext")+""}else{w=""}if(typeof y.attr("title")!=="undefined"){return y.attr("title")}else{if(y.data("content")&&q.options.showcontent){return y.data("content").tostring()}else{return x+y.html()+w}}}}).toarray();var t=!this.multiple?p[0]:p.join(this.options.multipleseparator);if(this.multiple&&this.options.selectedtextformat.indexof("count")>-1){var s=this.options.selectedtextformat.split(">");if((s.length>1&&p.length>s[1])||(s.length==1&&p.length>=2)){n=this.options.hidedisabled?", [disabled]":"";var u=o.not('[data-divider="true"], [data-hidden="true"]'+n).length,v=(typeof this.options.countselectedtext==="function")?this.options.countselectedtext(p.length,u):this.options.countselectedtext;t=v.replace("{0}",p.length.tostring()).replace("{1}",u.tostring())}}if(this.options.title==undefined){this.options.title=this.$element.attr("title")}if(this.options.selectedtextformat=="static"){t=this.options.title}if(!t){t=typeof this.options.title!=="undefined"?this.options.title:this.options.noneselectedtext}this.$button.attr("title",i(g.trim(t.replace(/<[^>]*>?/g,""))));this.$button.children(".filter-option").html(t);this.$element.trigger("rendered.bs.select")},setstyle:function(p,o){if(this.$element.attr("class")){this.$newelement.addclass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""))}var n=p?p:this.options.style;if(o=="add"){this.$button.addclass(n)}else{if(o=="remove"){this.$button.removeclass(n)}else{this.$button.removeclass(this.options.style);this.$button.addclass(n)}}},updateposition:function(){var n=this.$menu.get(0).ownerdocument.createevent("htmlevents");n.initevent("resize",true,false);this.$menu.get(0).ownerdocument.dispatchevent(n)},liheight:function(t){if(!t&&(this.options.size===false||this.sizeinfo)){return}var r=document.createelement("div"),n=document.createelement("div"),x=document.createelement("ul"),f=document.createelement("a"),e=document.createelement("a"),j=document.createelement("span"),d=document.createelement("span"),i=this.options.header&&this.$menu.find(".popover-title").length>0?this.$menu.find(".popover-title")[0].clonenode(true):null,y=this.options.livesearch?document.createelement("div"):null,z=this.options.actionsbox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].clonenode(true):null,q=this.options.donebutton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].clonenode(true):null;d.classname="text";r.classname=this.$menu[0].parentnode.classname+" show open";n.classname="dropdown-menu open show";x.classname="dropdown-menu inner";f.classname="dropdown-divider";j.classname="dropdown-item-inner";d.appendchild(document.createtextnode("inner text"));j.appendchild(d);e.appendchild(j);x.appendchild(e);x.appendchild(f);if(i){n.appendchild(i)}if(y){var b=document.createelement("input");y.classname="bs-searchbox";b.classname="form-control";y.appendchild(b);n.appendchild(y)}if(z){n.appendchild(z)}n.appendchild(x);if(q){n.appendchild(q)}r.appendchild(n);document.body.appendchild(r);var p=j.offsetheight,h=i?i.offsetheight:0,a=y?y.offsetheight:0,w=z?z.offsetheight:0,s=q?q.offsetheight:0,c=g(f).outerheight(true),o=typeof getcomputedstyle==="function"?getcomputedstyle(n):false,u=o?null:g(n),g={vert:parseint(o?o.paddingtop:u.css("paddingtop"))+parseint(o?o.paddingbottom:u.css("paddingbottom"))+parseint(o?o.bordertopwidth:u.css("bordertopwidth"))+parseint(o?o.borderbottomwidth:u.css("borderbottomwidth")),horiz:parseint(o?o.paddingleft:u.css("paddingleft"))+parseint(o?o.paddingright:u.css("paddingright"))+parseint(o?o.borderleftwidth:u.css("borderleftwidth"))+parseint(o?o.borderrightwidth:u.css("borderrightwidth")),},v={vert:g.vert+parseint(o?o.margintop:u.css("margintop"))+parseint(o?o.marginbottom:u.css("marginbottom"))+2,horiz:g.horiz+parseint(o?o.marginleft:u.css("marginleft"))+parseint(o?o.marginright:u.css("marginright"))+2,};document.body.removechild(r);this.sizeinfo={liheight:p,headerheight:h,searchheight:a,actionsheight:w,donebuttonheight:s,dividerheight:c,menupadding:g,menuextras:v,}},setsize:function(){this.findlis();this.liheight();if(this.options.header){this.$menu.css("padding-top",0)}if(this.options.size===false){return}var y=this,v=this.$menu,r=this.$menuinner,d=g(window),l=this.$newelement[0].offsetheight,n=this.$newelement[0].offsetwidth,s=this.sizeinfo.liheight,h=this.sizeinfo.headerheight,a=this.sizeinfo.searchheight,x=this.sizeinfo.actionsheight,t=this.sizeinfo.donebuttonheight,z=this.sizeinfo.dividerheight,g=this.sizeinfo.menupadding,w=this.sizeinfo.menuextras,e=this.options.hidedisabled?".disabled":"",f,n,b,p,m,k,u,j,i=function(){var r=y.$newelement.offset(),p=g(y.options.container),q;if(y.options.container&&!p.is("body")){q=p.offset();q.top+=parseint(p.css("bordertopwidth"));q.left+=parseint(p.css("borderleftwidth"))}else{q={top:0,left:0}}var o=y.options.windowpadding;m=r.top-q.top-d.scrolltop();k=d.height()-m-l-q.top-o[2];u=r.left-q.left-d.scrollleft();j=d.width()-u-n-q.left-o[1];m-=o[0];u-=o[3]};i();if(this.options.size==="auto"){var q=function(){var r,q=function(u,t){return function(v){if(t){return(v.classlist?v.classlist.contains(u):g(v).hasclass(u))}else{return !(v.classlist?v.classlist.contains(u):g(v).hasclass(u))}}},p=y.$menuinner[0].getelementsbytagname("a"),o=array.prototype.filter?array.prototype.filter.call(p,q("d-none",false)):y.$lis.not(".d-none"),s=array.prototype.filter?array.prototype.filter.call(o,q("dropdown-header",true)):o.filter(".dropdown-header");i();f=k-w.vert;n=j-w.horiz;if(y.options.container){if(!v.data("height")){v.data("height",v.height())}b=v.data("height");if(!v.data("width")){v.data("width",v.width())}p=v.data("width")}else{b=v.height();p=v.width()}if(y.options.dropupauto){y.$newelement.toggleclass("dropup",m>k&&(f-w.vert)j&&(n-w.horiz)<(p-n))}if((o.length+s.length)>3){r=s*3+w.vert-2}else{r=0}v.css({"max-height":f+"px",overflow:"hidden","min-height":r+h+a+x+t+"px",});r.css({"max-height":f-h-a-x-t-g.vert+"px","overflow-y":"auto","min-height":math.max(r-g.vert,0)+"px",})};q();this.$searchbox.off("input.getsize propertychange.getsize").on("input.getsize propertychange.getsize",q);d.off("resize.getsize scroll.getsize").on("resize.getsize scroll.getsize",q)}else{if(this.options.size&&this.options.size!="auto"&&this.$lis.not(e).length>this.options.size){var c=this.$lis.not(".dropdown-divider").not(e).children().slice(0,this.options.size).last().parent().index(),o=this.$lis.slice(0,c+1).filter(".dropdown-divider").length;f=s*this.options.size+o*z+g.vert;if(y.options.container){if(!v.data("height")){v.data("height",v.height())}b=v.data("height")}else{b=v.height()}if(y.options.dropupauto){this.$newelement.toggleclass("dropup",m>k&&(f-w.vert)');var o=this,p=g(this.options.container),s,r,q,n=function(t){o.$bscontainer.addclass(t.attr("class").replace(/form-control|fit-width/gi,"")).toggleclass("dropup",t.hasclass("dropup"));s=t.offset();if(!p.is("body")){r=p.offset();r.top+=parseint(p.css("bordertopwidth"))-p.scrolltop();r.left+=parseint(p.css("borderleftwidth"))-p.scrollleft()}else{r={top:0,left:0}}q=t.hasclass("dropup")?0:t[0].offsetheight;o.$bscontainer.css({top:s.top-r.top+q,left:s.left-r.left,width:t[0].offsetwidth,})};this.$button.on("click",function(){var t=g(this);if(o.isdisabled()){return}n(o.$newelement);o.$bscontainer.appendto(o.options.container).toggleclass("open",!t.hasclass("open")).append(o.$menu)});g(window).on("resize scroll",function(){n(o.$newelement)});this.$element.on("hide.bs.select",function(){o.$menu.data("height",o.$menu.height());o.$bscontainer.detach()})},setselected:function(n,p,o){if(!o){this.toggleplaceholder();o=this.findlis().eq(this.liobj[n])}o.toggleclass("selected",p).find("span.dropdown-item-inner").attr("aria-selected",p)},setdisabled:function(n,p,o){if(!o){o=this.findlis().eq(this.liobj[n])}if(p){o.addclass("disabled").children("span.dropdown-item-inner").attr("href","#").attr("tabindex",-1).attr("aria-disabled",true)}else{o.removeclass("disabled").children("span.dropdown-item-inner").removeattr("href").attr("tabindex",0).attr("aria-disabled",false)}},isdisabled:function(){return this.$element[0].disabled},checkdisabled:function(){var n=this;if(this.isdisabled()){this.$newelement.addclass("disabled");this.$button.addclass("disabled").attr("tabindex",-1).attr("aria-disabled",true)}else{if(this.$button.hasclass("disabled")){this.$newelement.removeclass("disabled");this.$button.removeclass("disabled").attr("aria-disabled",false)}if(this.$button.attr("tabindex")==-1&&!this.$element.data("tabindex")){this.$button.removeattr("tabindex")}}this.$button.click(function(){return !n.isdisabled()})},toggleplaceholder:function(){var n=this.$element.val();this.$button.toggleclass("bs-placeholder",n===null||n===""||(n.constructor===array&&n.length===0))},tabindex:function(){if(this.$element.data("tabindex")!==this.$element.attr("tabindex")&&(this.$element.attr("tabindex")!==-98&&this.$element.attr("tabindex")!=="-98")){this.$element.data("tabindex",this.$element.attr("tabindex"));this.$button.attr("tabindex",this.$element.data("tabindex"))}this.$element.attr("tabindex",-98)},clicklistener:function(){var n=this,o=g(document);o.data("spaceselect",false);this.$button.on("keyup",function(p){if(/(32)/.test(p.keycode.tostring(10))&&o.data("spaceselect")){p.preventdefault();o.data("spaceselect",false)}});this.$button.on("click",function(){n.setsize()});this.$element.on("shown.bs.select",function(){if(!n.options.livesearch&&!n.multiple){n.$menuinner.find("a.selected").focus()}else{if(!n.multiple){var p=n.liobj[n.$element[0].selectedindex];if(typeof p!=="number"||n.options.size===false){return}var q=n.$lis.eq(p)[0].offsettop-n.$menuinner[0].offsettop;q=q-n.$menuinner[0].offsetheight/2+n.sizeinfo.liheight/2;n.$menuinner[0].scrolltop=q}}});this.$menuinner.on("click","a",function(g){var v=g(this).find("span.dropdown-item-inner"),q=v.parent().data("originalindex"),e=n.$element.val(),x=n.$element.prop("selectedindex"),y=true;if(n.multiple&&n.options.maxoptions!==1){g.stoppropagation()}g.preventdefault();if(!n.isdisabled()&&!v.parent().hasclass("disabled")){var c=n.$element.find("option"),d=c.eq(q),s=d.prop("selected"),b=d.parent("optgroup"),i=n.options.maxoptions,z=b.data("maxoptions")||false;if(!n.multiple){c.prop("selected",false);d.prop("selected",true);n.$menuinner.find(".selected").removeclass("selected").find("span.dropdown-item-inner").attr("aria-selected",false);n.setselected(q,true)}else{d.prop("selected",!s);n.setselected(q,!s);v.blur();if(i!==false||z!==false){var r=i');if(t[2]){h=h.replace("{var}",t[2][i>1?0:1]);w=w.replace("{var}",t[2][z>1?0:1])}d.prop("selected",false);n.$menu.append(a);if(i&&r){a.append(g("
"+h+"
"));y=false;n.$element.trigger("maxreached.bs.select")}if(z&&u){a.append(g("
"+w+"
"));y=false;n.$element.trigger("maxreachedgrp.bs.select")}settimeout(function(){n.setselected(q,false)},10);a.delay(750).fadeout(300,function(){g(this).remove()})}}}}}if(!n.multiple||(n.multiple&&n.options.maxoptions===1)){n.$button.focus()}else{if(n.options.livesearch){n.$searchbox.focus()}}if(y){if((e!=n.$element.val()&&n.multiple)||(x!=n.$element.prop("selectedindex")&&!n.multiple)){m=[q,d.prop("selected"),s];n.$element.triggernative("change")}}}});this.$menu.on("click","a.disabled span.dropdown-item-inner , .popover-title, .popover-title :not(.close)",function(p){if(p.currenttarget==this){p.preventdefault();p.stoppropagation();if(n.options.livesearch&&!g(p.target).hasclass("close")){n.$searchbox.focus()}else{n.$button.focus()}}});this.$menuinner.on("click",".dropdown-divider, .dropdown-header",function(p){p.preventdefault();p.stoppropagation();if(n.options.livesearch){n.$searchbox.focus()}else{n.$button.focus()}});this.$menu.on("click",".popover-title .close",function(){n.$button.click()});this.$searchbox.on("click",function(p){p.stoppropagation()});this.$menu.on("click",".actions-btn",function(p){if(n.options.livesearch){n.$searchbox.focus()}else{n.$button.focus()}p.preventdefault();p.stoppropagation();if(g(this).hasclass("bs-select-all")){n.selectall()}else{n.deselectall()}});this.$element.change(function(){n.render(false);n.$element.trigger("changed.bs.select",m);m=null})},livesearchlistener:function(){var o=this,n=g('
  • ');this.$button.on("click.dropdown.data-api",function(){o.$menuinner.find(".active").removeclass("active");if(!!o.$searchbox.val()){o.$searchbox.val("");o.$lis.not(".is-hidden").removeclass("d-none");if(!!n.parent().length){n.remove()}}if(!o.multiple){o.$menuinner.find(".selected").addclass("active")}settimeout(function(){o.$searchbox.focus()},10)});this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",function(p){p.stoppropagation()});this.$searchbox.on("input propertychange",function(){o.$lis.not(".is-hidden").removeclass("d-none");o.$lis.filter(".active").removeclass("active");n.remove();if(o.$searchbox.val()){var q=o.$lis.not(".is-hidden, .dropdown-divider, .dropdown-header"),p;if(o.options.livesearchnormalize){p=q.not(":a"+o._searchstyle()+'("'+c(o.$searchbox.val())+'")')}else{p=q.not(":"+o._searchstyle()+'("'+o.$searchbox.val()+'")')}if(p.length===q.length){n.html(o.options.noneresultstext.replace("{0}",'"'+l(o.$searchbox.val())+'"'));o.$menuinner.append(n);o.$lis.addclass("d-none")}else{p.addclass("d-none");var s=o.$lis.not(".d-none"),r;s.each(function(t){var u=g(this);if(u.hasclass("dropdown-divider")){if(r===undefined){u.addclass("d-none")}else{if(r){r.addclass("d-none")}r=u}}else{if(u.hasclass("dropdown-header")&&s.eq(t+1).data("optgroup")!==u.data("optgroup")){u.addclass("d-none")}else{r=null}}});if(r){r.addclass("d-none")}q.not(".d-none").first().addclass("active");o.$menuinner.scrolltop(0)}o.updateposition()}})},_searchstyle:function(){var n={begins:"ibegins",startswith:"ibegins",};return n[this.options.livesearchstyle]||"icontains"},val:function(n){if(typeof n!=="undefined"){this.$element.val(n);this.render();return this.$element}else{return this.$element.val()}},changeall:function(o){if(!this.multiple){return}if(typeof o==="undefined"){o=true}this.findlis();var n=this.$element.find("option"),t=this.$lis.not(".dropdown-divider, .dropdown-header, .disabled, .d-none"),p=t.length,s=[];if(o){if(t.filter(".selected").length===t.length){return}}else{if(t.filter(".selected").length===0){return}}t.toggleclass("selected",o);for(var q=0;q=48&&x.keycode<=57||x.keycode>=96&&x.keycode<=105||x.keycode>=65&&x.keycode<=90)){if(!u.options.container){u.setsize();u.$menu.parent().addclass("open show");z=true}else{u.$button.trigger("click")}u.$searchbox.focus();return}if(u.options.livesearch){if(/(^9$|27)/.test(x.keycode.tostring(10))&&z){x.preventdefault();x.stoppropagation();u.$menuinner.click();u.$button.focus()}}if(/(38|40)/.test(x.keycode.tostring(10))){w=u.$lis.filter(p);if(!w.length){return}if(!u.options.livesearch){v=w.index(w.filter(":focus"))}else{v=w.index(w.filter(".active"))}q=u.$menuinner.data("previndex");if(x.keycode==38){if((u.options.livesearch||v==q)&&v!=-1){v--}if(v<0){v+=w.length}}else{if(x.keycode==40){if(u.options.livesearch||v==q){v++}v=v%w.length}}u.$menuinner.data("previndex",v);if(!u.options.livesearch){w.eq(v).focus()}else{x.preventdefault();if(!y.hasclass("dropdown-toggle")){w.removeclass("active").eq(v).addclass("active").children("span.dropdown-item-inner").focus();y.focus()}}}else{if(!y.is("input")){var n=[],t,a;w=u.$lis.filter(p);w.each(function(b){if(g.trim(g(this).children("span.dropdown-item-inner").text().tolowercase()).substring(0,1)==r[x.keycode]){n.push(b)}});t=g(document).data("keycount");t++;g(document).data("keycount",t);a=g.trim(g(":focus").text().tolowercase()).substring(0,1);if(a!=r[x.keycode]){t=1;g(document).data("keycount",t)}else{if(t>=n.length){g(document).data("keycount",0);if(t>n.length){t=1}}}w.eq(n[t-1]).children("span.dropdown-item-inner").focus()}}if((/(13|32)/.test(x.keycode.tostring(10))||(/(^9$)/.test(x.keycode.tostring(10))&&u.options.selectontab))&&z){if(!/(32)/.test(x.keycode.tostring(10))){x.preventdefault()}if(!u.options.livesearch){var o=g(":focus");o.click();o.focus();x.preventdefault();g(document).data("spaceselect",true)}else{if(!/(32)/.test(x.keycode.tostring(10))){u.$menuinner.find("a.active").click();y.focus()}}g(document).data("keycount",0)}if((/(^9$|27)/.test(x.keycode.tostring(10))&&z&&(u.multiple||u.options.livesearch))||(/(27)/.test(x.keycode.tostring(10))&&!z)){u.$menu.parent().removeclass("open");if(u.options.container){u.$newelement.removeclass("open")}u.$button.focus()}},mobile:function(){this.$element.addclass("mobile-device")},refresh:function(){this.$lis=null;this.liobj={};this.reloadli();this.render();this.checkdisabled();this.liheight(true);this.setstyle();this.setwidth();if(this.$lis){this.$searchbox.trigger("propertychange")}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();if(this.$bscontainer){this.$bscontainer.remove()}else{this.$menu.remove()}this.$element.off(".bs.select").removedata("selectpicker").removeclass("bs-select-hidden selectpicker")},};function j(p){var n=arguments;var r=p;[].shift.apply(n);var q;var o=this.each(function(){var w=g(this);if(w.is("select")){var v=w.data("selectpicker"),t=typeof r=="object"&&r;if(!v){var s=g.extend({},k.defaults,g.fn.selectpicker.defaults||{},w.data(),t);s.template=g.extend({},k.defaults.template,(g.fn.selectpicker.defaults?g.fn.selectpicker.defaults.template:{}),w.data().template,t.template);w.data("selectpicker",(v=new k(this,s)))}else{if(t){for(var u in t){if(t.hasownproperty(u)){v.options[u]=t[u]}}}}if(typeof r=="string"){if(v[r] instanceof function){q=v[r].apply(v,n)}else{q=v.options[r]}}}});if(typeof q!=="undefined"){return q}else{return o}}var d=g.fn.selectpicker;g.fn.selectpicker=j;g.fn.selectpicker.constructor=k;g.fn.selectpicker.noconflict=function(){g.fn.selectpicker=d;return this};g(document).data("keycount",0).on("keydown.bs.select",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input',k.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input',function(n){n.stoppropagation()});g(window).on("load.bs.select.data-api",function(){g(".selectpicker").each(function(){var n=g(this);j.call(n,n.data())})})})(a)}));