/*!
  * DashboardCode BsMultiSelect v0.5.23 (https://dashboardcode.github.io/BsMultiSelect/)
  * Copyright 2017-2020 Roman Pokrovskij (github user rpokrovskij)
  * Licensed under APACHE 2 (https://github.com/DashboardCode/BsMultiSelect/blob/master/LICENSE)
  */
 !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["jquery","popper.js"],t):t((e=e||self).jQuery,e.Popper)}(this,(function(e,t){"use strict";function n(e){var t={};for(var n in e){var i=e[n];null!=i&&(t[n]=i)}for(var o=arguments.length,s=new Array(o>1?o-1:0),r=1;r<o;r++)s[r-1]=arguments[r];return s&&s.forEach((function(e){for(var n in e){var i=e[n];null!=i?t[n]=i:t.hasOwnProperty(n)&&delete t[n]}})),t}function i(){var e=null,t=0;return{add:function(n){e?(e.next={value:n,prev:e},e=e.next):e={value:n},t++;var i=e;return function(){i.prev&&(i.prev.next=i.next),i.next&&(i.next.prev=i.prev),e==i&&(e=i.prev),t--}},forEach:function(t){!function e(t,n){n&&(t(n.value),e(t,n.prev))}(t,e)},getTail:function(){return e?e.value:null},getCount:function(){return t},isEmpty:function(){return 0==t},reset:function(){e=null,t=0}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return s.apply(void 0,t)}}function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach((function(e){e&&e()}))}function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s)return s}}function c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s)return s instanceof Function?s():s}}function l(e){var t=i(),n=e();return{getValue:function(){return n},call:function(){n=e(),t.forEach((function(e){return e(n)}))},attach:function(e){return t.add(e)},detachAll:function(){t.reset()}}}function a(e,t,n,i,o,s,r){var c=null,l=null,a=null;function u(){a&&a.resetCandidateToHoveredMultiSelectData()}var d=function(e){l=e,(c=i()[e]).hoverIn(!0)};function f(){c&&(c.hoverIn(!1),c=null,l=null)}var p=function(){c!=a&&(f(),d(a.visibleIndex)),u()};return{adoptChoice:function(i,o){var s=e(),l=s.choiceElement,h=s.attach,v=function(){return function(e,n){t().isSkippable()?(u(),a=e,n.addEventListener("mousemove",p),n.addEventListener("mousedown",p),a.resetCandidateToHoveredMultiSelectData=function(){n.removeEventListener("mousemove",p),n.removeEventListener("mousedown",p),a.resetCandidateToHoveredMultiSelectData=null,a=null}):c!=e&&(f(),d(e.visibleIndex))}(i,l)};l.addEventListener("mouseover",v);var m=function(){t().isSkippable()||f()};l.addEventListener("mouseleave",m),h();var g=n(l);g.setData(i.option),i.hoverIn=function(e){g.hoverIn(e)},i.select=function(e){g.select(e)},i.disable=function(e,t){g.disable(e,t)},i.dispose=function(){l.removeEventListener("mouseover",v),l.removeEventListener("mouseleave",m),g.dispose(),i.hoverIn=null,i.select=null,i.disable=null,i.dispose=null,i.toggle=null,i.setVisible=null,i.createPick=null},i.isOptionDisabled&&g.disable(!0,o),g.onSelected((function(){i.toggle&&i.toggle(),r()})),i.setVisible=function(e){l.style.display=e?"block":"none"}},hoverInInternal:d,stopAndResetChoicesHover:function(){t().setSkippable(),f()},resetCandidateToHoveredMultiSelectData:u,toggleHovered:function(){c&&(c.toggle&&c.toggle(),f(),o())},keyDownArrow:function(e){var t=i(),n=t.length,o=null;if(n>0)if(e)for(var r=null===l?0:l+1;r<n;){if(t[r].visible){o=r;break}r++}else for(var a=null===l?n-1:l-1;a>=0;){if(t[a].visible){o=a;break}a--}null!==o&&(c&&c.hoverIn(!1),s(),d(o))}}}function u(e,t){for(var n=null,i=0;i<e.children.length;i++){var o=e.children[i];if(o.tagName==t){n=o;break}}return n}function d(e,t){return h(e,(function(e){return e.tagName===t}))}function f(e,t){return h(e,(function(e){return e.classList.contains(t)}))}function p(e,t,n){var i=e.getAttribute("data-"+t+"-"+n);if(i)return i;var o=e.getAttribute("data-"+n);return o||null}function h(e,t){return e&&e instanceof Element?t(e)?e:h(e.parentNode,t):null}function v(e){var t=!1;return function(e,t,n){return h(e,(function(e){return e.getAttribute(t)===n}))}(e,"dir","rtl")&&(t=!0),t}function m(){var e=[];return{bind:function(t,n,i){t.addEventListener(n,i),e.push({element:t,eventName:n,handler:i})},unbind:function(){e.forEach((function(e){var t=e.element,n=e.eventName,i=e.handler;t.removeEventListener(n,i)}))}}}function g(e,t,n,i,o,s,r,c,l,a,u,d,f){t();var p=e.document,h=function(e){var t=!1;return{isSkippable:function(){return t},setSkippable:function(){t=!0,e.setTimeout((function(){t=!1}),0)}}}(e),v=!1,g=function(){v=!0},b=function(e){o===e.target||i===e.target||o.contains(e.target)||i.contains(e.target)||l()},C=null;C=new f(n,o,{placement:d?"bottom-end":"bottom-start",modifiers:{preventOverflow:{enabled:!1},hide:{enabled:!1},flip:{enabled:!1}}});var y=null,k=null;function L(e){var t=n.offsetLeft;(e||y!=t)&&(C.update(),y=t)}var E=m();function I(){s()||(h.setSkippable(),r(!0),i.addEventListener("mousedown",g),o.addEventListener("mousedown",g),p.addEventListener("mouseup",b))}function P(){c(),s()&&(r(!1),i.removeEventListener("mousedown",g),o.addEventListener("mousedown",g),p.removeEventListener("mouseup",b))}return{dispose:function(){C.destroy(),E.unbind()},alignToFilterInputItemLocation:L,getSkipFocusout:function(){return v},resetSkipFocusout:function(){v=!1},disable:function(e){e?E.unbind():E.bind(i,"click",(function(e){u(e),function(e){k!=e&&(a()||(L(!0),I())),k=null}(e)}))},eventSkipper:h,hideChoices:P,showChoices:I,processRemoveButtonClick:function(t,n){!function(t,n){e.setTimeout((function(){return t()}),0),k=n}(t,n),P()}}}function b(e,t){var n={classes:[],styles:{}};if(t){var i=t.classes,o=t.styles;for(var s in i.forEach((function(t){return e.classList.add(t)})),n.classes=i.slice(),o)n.styles[s]=e.style[s],e.style[s]=o[s]}return n}function C(e,t){var n={classes:[],styles:{}},i=!1;return function(o){o?!1===i&&(n=b(e,t),i=!0):!0===i&&(!function(e,t){if(t){var n=t.classes,i=t.styles;for(var o in n.forEach((function(t){return e.classList.remove(t)})),i)e.style[o]=i[o]}}(e,n),i=!1)}}function y(e,t,n,i,o){if((r=t)instanceof String||"string"==typeof r){if(""===t)o&&(e.classes=[]);else{var s=t.split(" ");e.classes=n(s)}return!0}return t instanceof Array&&(0==t.length?o&&(e.classes=[]):e.classes=i(t),!0);var r}function k(e,t,n,i,o,s){if(!1===y(e,t,n,i,s)&&t instanceof Object){var r=t.classes,c=t.styles;y(e,r,n,i,s),c?e.styles=o(c):r||(e.styles=o(t))}}function L(e){var t={classes:[],styles:{}};return e&&k(t,e,(function(e){return e}),(function(e){return e.slice()}),(function(e){return n(e)}),!0),Object.freeze(t)}function E(e,t){var i={classes:[],styles:{}};if(t){k(i,t,(function(e){return e}),(function(e){return e.slice()}),(function(e){return n(e)}),!0);for(var o=arguments.length,s=new Array(o>2?o-2:0),r=2;r<o;r++)s[r-2]=arguments[r];if(s){var c=i.classes,l=i.styles,a=e?function(e){return k(i,e,(function(e){return e}),(function(e){return e.slice()}),(function(e){return n(l,e)}),!0)}:function(e){return k(i,e,(function(e){return c.concat(e)}),(function(e){return c.concat(e)}),(function(e){return n(l,e)}),!1)};s.forEach((function(e){return a(e)}))}}return L(i)}function I(e,t){var n={};for(var i in e){var o=e[i],s=t?t[i]:void 0;n[i]=void 0===s?L(o):E(!0,o,s)}if(t)for(var r in t)e[r]||(n[r]=L(t[r]));return n}function P(e,t,n){e.visible=t,e.visibleIndex=n,e.setVisible(t)}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t;var S=function(){function e(e,t,n,i,o,s,r,c,l,a,u,d,f,p,h,v){this.isRtl=d,this.common=t,this.getOptions=e,this.getIsOptionDisabled=o,this.getIsOptionHidden=s,this.staticContent=r,this.pickContentGenerator=c,this.choiceContentGenerator=l,this.labelAdapter=a,this.placeholderText=u,this.setSelected=i,this.css=p,this.popper=h,this.window=v,this.visibleCount=10,this.choicesPanel=null,this.stylingComposite=null,this.onChange=f,this.getIsComponentDisabled=n,this.resetChoicesList()}var t=e.prototype;return t.resetChoicesList=function(){this.choicesList=[],this.filteredChoicesList=null},t.getVisibleChoicesList=function(){return this.filteredChoicesList?this.filteredChoicesList:this.choicesList},t.resetFilter=function(){this.filterPanel.isEmpty()||(this.filterPanel.setEmpty(),this.placeholderAspect.updateEmptyInputWidth(),this.processEmptyInput(),this.placeholderAspect.updatePlacehodlerVisibility())},t.processEmptyInput=function(){this.placeholderAspect.updateEmptyInputWidth(),function(e){for(var t=0;t<e.length;t++){var n=e[t];n.isOptionHidden||P(n,!0,t)}}(this.choicesList),this.filteredChoicesList=null},t.GetContainer=function(){return this.staticContent.containerElement},t.GetChoices=function(){return this.staticContent.choicesElement},t.GetFilterInput=function(){return this.staticContent.filterInputElement},t.Update=function(){this.UpdateAppearance(),this.UpdateData()},t.DeselectAll=function(){this.aspect.hideChoices(),this.picksList.removeAll(),this.resetFilter()},t.PicksCount=function(){return this.picksList.getCount()},t.SelectAll=function(){this.aspect.hideChoices();for(var e=0;e<this.choicesList.length;e++){var t=this.choicesList[e];t.excludedFromSearch||t.toggle&&t.toggle()}this.resetFilter()},t.empty=function(){this.aspect.hideChoices(),this.resetFilter(),this.staticContent.choicesElement.innerHTML="",this.resetChoicesList(),this.picksList.clear(),this.placeholderAspect.updatePlacehodlerVisibility()},t.UpdateData=function(){this.empty(),this.updateDataImpl()},t.UpdateSelected=function(){for(var e=this.getOptions(),t=0;t<e.length;t++){var n=e[t].selected,i=this.choicesList[t];n!=i.isOptionSelected&&i.toggle&&i.toggle()}},t.createChoice=function(e,t){var n=this,i=e.selected,o=this.getIsOptionDisabled(e),s=this.getIsOptionHidden(e),r={option:e,isOptionDisabled:o,isOptionHidden:s,isOptionSelected:i,searchText:e.text.toLowerCase().trim(),excludedFromSearch:i||o||s,hoverIn:null,select:null,disable:null,dispose:null,toggle:null,setVisible:null,createPick:null,resetCandidateToHoveredMultiSelectData:null,visible:!1,visibleIndex:null};return r.createPick=function(){var e=n.createPick(r.option,(function(){return n.getIsOptionDisabled(r.option)}),(function(e){return n.requestPickRemove(r,e)})),t=e.pick,i=(0,e.adoptRemoveFromList)(n.picksList.addPick(t));n.requestPickCreate(r,i,n.picksList.getCount())},s||(r.visible=!0,r.visibleIndex=t,this.choicesPanel.adoptChoice(r,i),i?r.createPick():(r.excludedFromSearch=r.isOptionDisabled,r.isOptionDisabled?r.toggle=null:r.toggle=function(){!1!==n.setSelected(r.option,!0)&&(r.createPick(),n.onChange())})),r},t.updateDataImpl=function(){var e=this,t=function(){for(var t=e.getOptions(),n=0;n<t.length;n++){var i=t[n],o=e.createChoice(i,n);e.choicesList.push(o)}e.aspect.alignToFilterInputItemLocation(!1)};if("loading"!=document.readyState)t();else{document.addEventListener("DOMContentLoaded",(function e(){t(),document.removeEventListener("DOMContentLoaded",e)}))}},t.Dispose=function(){s(this.aspect.hideChoices,this.picksList.dispose,this.filterPanel.dispose,this.labelAdapter.dispose,this.aspect.dispose,this.staticContent.dispose);for(var e=0;e<this.choicesList.length;e++){var t=this.choicesList[e];t.toggle=null,t.dispose&&t.dispose()}},t.UpdateAppearance=function(){this.UpdateDisabled()},t.UpdateDisabled=function(){var e=this.getIsComponentDisabled();this.isComponentDisabled!==e&&(this.picksList.disableRemoveAll(e),this.aspect.disable(e),this.placeholderAspect.setDisabled(e),this.staticContent.disable(e),this.isComponentDisabled=e)},t.input=function(e,t){var n=e.trim().toLowerCase(),i=!1;if(""==n)i=!0;else if(this.filteredChoicesList=function(e,t){for(var n=[],i=0,o=0;o<e.length;o++){var s=e[o];s.isOptionHidden||(s.excludedFromSearch||s.searchText.indexOf(t)<0?P(s,!1,null):(P(s,!0,i++),n.push(s)))}return n}(this.choicesList,n),1==this.filteredChoicesList.length){var o=this.filteredChoicesList[0];o.searchText==n&&(o.toggle&&o.toggle(),this.filterPanel.setEmpty(),this.placeholderAspect.updateEmptyInputWidth(),i=!0)}i?this.processEmptyInput():t(),this.choicesPanel.stopAndResetChoicesHover(),1==this.getVisibleChoicesList().length&&this.choicesPanel.hoverInInternal(0),this.getVisibleChoicesList().length>0?(this.aspect.alignToFilterInputItemLocation(!0),this.aspect.showChoices()):this.aspect.hideChoices()},t.requestPickCreate=function(e,t,n){e.isOptionSelected=!0,e.excludedFromSearch=!0,e.toggle=function(){return t()},e.select(!0),1==n&&this.placeholderAspect.updatePlacehodlerVisibility()},t.createPick=function(e,t,n){var i=this,o=this.staticContent.createPickElement(),s=this.pickContentGenerator(o),r={disableRemove:function(){return s.disableRemove(i.getIsComponentDisabled())},setData:function(){return s.setData(e)},disable:function(){return s.disable(t())},removePick:null,dispose:function(){var e;(e=o).parentNode.removeChild(e),s.dispose()}};return r.setData(),r.disable(),r.disableRemove(),i.staticContent.picksElement.insertBefore(o,i.staticContent.pickFilterElement),{pick:r,adoptRemoveFromList:function(e){var t=function(){e(),r.dispose()},o=function(){return n(t)};return r.removePick=o,s.onRemove((function(e){!function(e,t){i.aspect.processRemoveButtonClick(e,t),i.resetFilter()}(o,e)})),o}}},t.requestPickRemove=function(e,t){var n=this;!1!==this.setSelected(e.option,!1)&&(t(),e.isOptionSelected=!1,e.excludedFromSearch=e.isOptionDisabled,e.isOptionDisabled?(e.disable(!0,!1),e.toggle=null):e.toggle=function(){!1!==n.setSelected(e.option,!0)&&(e.createPick(),n.onChange())},e.select(!1),0==this.picksList.getCount()&&this.placeholderAspect.updatePlacehodlerVisibility(),this.onChange())},t.init=function(){var e,t=this;this.filterPanel=function(e,t,n,i,o,s,r,c,l,a,u,d){e.setAttribute("type","search"),e.setAttribute("autocomplete","off"),t();var f=function(t){([38,40,13,27].indexOf(t.which)>=0||9==t.which&&e.value)&&t.preventDefault(),27==t.which?a(!e.value,t):38==t.which?o():40==t.which?s():9==t.which?e.value||r():8==t.which&&(e.value||c())},p=function(e){13==e.which||9==e.which?l():27==e.which&&u()},h=function(){var t=e.value;d(t,(function(){e.style.width=1.3*t.length+2+"ch"}))};return e.addEventListener("focusin",n),e.addEventListener("focusout",i),e.addEventListener("keydown",f),e.addEventListener("keyup",p),e.addEventListener("input",h),{isEmpty:function(){return!e.value},setEmpty:function(){e.value=""},setFocus:function(){e.focus()},isEventTarget:function(t){return t.target==e},dispose:function(){e.removeEventListener("focusin",n),e.removeEventListener("focusout",i),e.removeEventListener("keydown",f),e.removeEventListener("keyup",p),e.removeEventListener("input",h)}}}(this.staticContent.filterInputElement,(function(){t.staticContent.pickFilterElement.appendChild(t.staticContent.filterInputElement),t.labelAdapter.init(t.staticContent.filterInputElement),t.staticContent.picksElement.appendChild(t.staticContent.pickFilterElement)}),(function(){t.staticContent.setIsFocusIn(!0),t.staticContent.toggleFocusStyling()}),(function(){t.aspect.getSkipFocusout()||(t.resetFilter(),t.staticContent.setIsFocusIn(!1),t.staticContent.toggleFocusStyling()),t.aspect.resetSkipFocusout()}),(function(){return t.choicesPanel.keyDownArrow(!1)}),(function(){return t.choicesPanel.keyDownArrow(!0)}),(function(){return t.aspect.hideChoices()}),(function(){t.picksList.removePicksTail(),t.aspect.alignToFilterInputItemLocation(!1)}),(function(){t.staticContent.isChoicesVisible()&&t.choicesPanel.toggleHovered()}),(function(e,n){e&&!t.staticContent.isChoicesVisible()||n.stopPropagation()}),(function(){t.aspect.hideChoices(),t.resetFilter()}),(function(e,n){t.placeholderAspect.updatePlacehodlerVisibility(),t.input(e,n)})),this.picksList={addPick:function(t){return e.add(t)},removePicksTail:function(){var t=e.getTail();t&&t.removePick()},isEmpty:(e=i()).isEmpty,getCount:e.getCount,disableRemoveAll:function(){e.forEach((function(e){return e.disableRemove()}))},removeAll:function(){e.forEach((function(e){return e.removePick()}))},clear:function(){e.forEach((function(e){return e.dispose()})),e.reset()},dispose:function(){e.forEach((function(e){return e.dispose()}))}},this.choicesPanel=a((function(){return t.staticContent.createChoiceElement()}),(function(){return t.aspect.eventSkipper}),this.choiceContentGenerator,(function(){return t.getVisibleChoicesList()}),(function(){t.aspect.hideChoices(),t.resetFilter()}),(function(){t.aspect.alignToFilterInputItemLocation(!0),t.aspect.showChoices()}),(function(){return t.filterPanel.setFocus()})),this.placeholderAspect=function(e,t,n,i,o){function s(e){i.style.width=e?"100%":"2ch"}var r=C(i,o.filterInput_empty);function c(t){t?(i.placeholder=e||"",n.style.display="block"):(i.placeholder="",n.style.display="flex"),r(t),s(t)}return c(!0),{updatePlacehodlerVisibility:function(){c(t())},updateEmptyInputWidth:function(){s(t())},setDisabled:function(e){i.disabled=e}}}(this.placeholderText,(function(){return t.picksList.isEmpty()&&t.filterPanel.isEmpty()}),this.staticContent.picksElement,this.staticContent.filterInputElement,this.css),this.placeholderAspect.updateEmptyInputWidth(),this.aspect=g(this.window,(function(){return t.staticContent.appendToContainer()}),this.staticContent.filterInputElement,this.staticContent.picksElement,this.staticContent.choicesElement,(function(){return t.staticContent.isChoicesVisible()}),(function(e){return t.staticContent.setChoicesVisible(e)}),(function(){return t.choicesPanel.resetCandidateToHoveredMultiSelectData()}),(function(){t.aspect.hideChoices(),t.resetFilter()}),(function(){return 0==t.getVisibleChoicesList().length}),(function(e){t.filterPanel.isEventTarget(e)||t.filterPanel.setFocus()}),this.isRtl,this.popper),this.staticContent.attachContainer(),this.updateDataImpl(),this.UpdateAppearance()},e}();function w(e,t){"lg"==t?(e.classList.add("form-control-lg"),e.classList.remove("form-control-sm")):"sm"==t?(e.classList.remove("form-control-lg"),e.classList.add("form-control-sm")):(e.classList.remove("form-control-lg"),e.classList.remove("form-control-sm"))}function D(e,t){w(e,t())}function F(e,t,n,i,o){!function(e,t,n,i,o){w(e,o),b(e,"lg"==o?t:"sm"==o?n:i)}(e,t,n,i,o())}function x(e,t,n,i,s,r,c){var a;if(r){var u=c.picks_lg,d=c.picks_sm,p=c.picks_def;a=function(){return F(t.picksElement,u,d,p,i)}}else a=function(){return D(t.picksElement,i)};if(e.UpdateSize=a,r){var h=t.toggleFocusStyling;t.toggleFocusStyling=function(){var e=g.getValue(),n=t.getIsFocusIn();h(n),n&&(!1===e?(t.setIsFocusIn(n),b(t.picksElement,c.picks_focus_invalid)):!0===e&&(t.setIsFocusIn(n),b(t.picksElement,c.picks_focus_valid)))}}var v=l((function(){return!!f(t.initialElement,"was-validated")})),m=l((function(){return n()})),g=l((function(){return v.getValue()?s.getValue():m.getValue()}));g.attach((function(e){var n=function(e){var t=function(e){var t=[];if(e.parentNode){var n=e.parentNode.children,i=e.parentNode.children.length;if(n.length>1)for(var o=0;o<i;++o){var s=n[o];s!=e&&t.push(s)}}return t}(e),n=t.filter((function(e){return e.classList.contains("invalid-feedback")||e.classList.contains("invalid-tooltip")}));return{validMessages:t.filter((function(e){return e.classList.contains("valid-feedback")||e.classList.contains("valid-tooltip")})),invalidMessages:n}}(t.containerElement),i=n.validMessages,o=n.invalidMessages;!function(e,t,n,i){!1===i?(e.classList.add("is-invalid"),e.classList.remove("is-valid"),n.map((function(e){return e.style.display="block"})),t.map((function(e){return e.style.display="none"}))):!0===i?(e.classList.remove("is-invalid"),e.classList.add("is-valid"),n.map((function(e){return e.style.display="none"})),t.map((function(e){return e.style.display="block"}))):(e.classList.remove("is-invalid"),e.classList.remove("is-valid"),n.map((function(e){return e.style.display=""})),t.map((function(e){return e.style.display=""})))}(t.picksElement,i,o,e),t.toggleFocusStyling()})),v.attach((function(){return g.call()})),s.attach((function(){return g.call()})),m.attach((function(){return g.call()})),e.UpdateValidity=function(){return m.call()},e.UpdateWasValidated=function(){return v.call()},e.UpdateAppearance=o(e.UpdateAppearance.bind(e),a,g.call,m.call),e.Dispose=o(v.detachAll,g.detachAll,m.detachAll,e.Dispose.bind(e))}function A(e,t,n,i){var o="",s="",r=null;function c(t,c){r=function(e,t){return Object.freeze({valueMissing:e,customError:t,valid:!(e||t)})}(t,c),s=c?o:t?n:"",e.setCustomValidity(s),i(r.valid)}return c(t.getValue(),!1),t.attach((function(e){c(e,r.customError)})),{validationMessage:s,willValidate:!0,validity:r,setCustomValidity:function(e){o=e,c(r.valueMissing,!!o)},checkValidity:function(){return r.valid||trigger("dashboardcode.multiselect:invalid"),r.valid},reportValidity:function(){return staticContent.filterInputElement.reportValidity(),checkValidity()}}}var V=[{old:"selectedPanelDisabledBackgroundColor",opt:"picks_disabled",style:"backgroundColor"},{old:"selectedPanelFocusValidBoxShadow",opt:"picks_focus_valid",style:"boxShadow"},{old:"selectedPanelFocusInvalidBoxShadow",opt:"picks_focus_invalid",style:"boxShadow"},{old:"selectedPanelDefMinHeight",opt:"picks_def",style:"minHeight"},{old:"selectedPanelLgMinHeight",opt:"picks_lg",style:"minHeight"},{old:"selectedPanelSmMinHeight",opt:"picks_sm",style:"minHeight"},{old:"selectedItemContentDisabledOpacity",opt:"choiceLabel_disabled",style:"opacity"}],_=[{old:"dropDownMenuClass",opt:"choices"},{old:"dropDownItemClass",opt:"choice"},{old:"dropDownItemHoverClass",opt:"choice_hover"},{old:"selectedPanelClass",opt:"picks"},{old:"selectedItemClass",opt:"pick"},{old:"removeSelectedItemButtonClass",opt:"pickButton"},{old:"filterInputItemClass",opt:"pickFilter"},{old:"filterInputClass",opt:"filterInput"},{old:"selectedPanelFocusClass",opt:"picks_focus"},{old:"selectedPanelDisabledClass",opt:"picks_disabled"},{old:"selectedItemContentDisabledClass",opt:"pick_disabled"}];function B(e,t,n){e.innerHTML='<span></span><button aria-label="Remove" tabIndex="-1" type="button"><span aria-hidden="true">&times;</span></button>';var i=e.querySelector("SPAN"),o=e.querySelector("BUTTON");b(i,n.pickContent),b(o,n.pickButton);var s=m(),r=C(i,n.pickContent_disabled);return{setData:function(e){i.textContent=e.text},disable:function(e){return r(e)},disableRemove:function(e){o.disabled=e},onRemove:function(e){s.bind(o,"click",(function(t){return e(t)}))},dispose:function(){s.unbind()}}}function T(e,t,n){e.innerHTML='<div><input formnovalidate type="checkbox"><label></label></div>';var i=e.querySelector("DIV"),o=i.querySelector("INPUT"),s=i.querySelector("LABEL");b(i,n.choiceContent),b(o,n.choiceCheckBox),b(s,n.choiceLabel);var r=C(e,n.choice_selected),c=C(e,n.choice_disabled),l=C(o,n.choiceCheckBox_disabled),a=C(s,n.choiceLabel_disabled),u=C(e,n.choice_hover),d=m();return{setData:function(e){s.textContent=e.text},select:function(e){r(e),o.checked=e},disable:function(e,t){c(e),l(e),a(e),o.disabled=e&&!t},hoverIn:function(e){u(e)},onSelected:function(t){d.bind(o,"change",t),d.bind(e,"click",(function(n){(e===n.target||e.contains(n.target))&&t()}))},dispose:function(){d.unbind()}}}function M(e,t,n,i,o){var s=null,r=null,c=null,l=!1;if("SELECT"==e.tagName)s=e,n&&(r=f(s,n));else{if("DIV"!=e.tagName&&"UL"!=e.tagName)throw e.style.backgroundColor="red",e.style.color="white",new Error("BsMultiSelect: Only DIV and SELECT supported");if("DIV"==e.tagName)r=e,s=u(e,"SELECT");else if(c=e,!(r=f(e,n)))throw e.style.backgroundColor="red",e.style.color="white",new Error("BsMultiSelect: definde on UL but container parent not found")}r&&(c=u(r,"UL")),c||(c=t("UL"),l=!0);var a=!1;r||(r=t("DIV"),a=!0),r.classList.add(n);var d,p=(d=[],{set:function(e,t,n){var i=e.getAttribute(t);d.push({element:e,currentAtribute:i,attribute:n}),e.setAttribute(t,n)},restore:function(){d.forEach((function(e){var t=e.element,n=e.attributeName,i=e.attribute;n?t.setAttribute(n,i):t.removeAttribute(n)}))}});if(i)p.set(r,"dir","rtl");else if(s){var h=s.getAttribute("dir");h&&p.set(r,"dir",h)}var v=t("UL");v.style.display="none";var m=null;s&&(m=s.style.display,s.style.display="none");var g=t("LI"),y=t("INPUT"),k=!1;if(s){var L=s.required;!0===s.required&&(k=!0,s.required=!1)}b(c,o.picks),b(v,o.choices),b(g,o.pickFilter),b(y,o.filterInput);var E=null;E=s?function(){return n+"-generated-input-"+(s.id?s.id:s.name).toLowerCase()+"-id"}:function(){return n+"-generated-filter-"+r.id};var I=!1,P=C(c,o.picks_disabled),S=C(c,o.picks_focus);return{initialElement:e,selectElement:s,containerElement:r,picksElement:c,createPickElement:function(){var e=t("LI");return b(e,o.pick),e},choicesElement:v,createChoiceElement:function(){var e=t("LI");return b(e,o.choice),{choiceElement:e,attach:function(){return v.appendChild(e)}}},pickFilterElement:g,filterInputElement:y,createInputId:E,required:k,attachContainer:function(){a&&s&&s.parentNode.insertBefore(r,s.nextSibling)},appendToContainer:function(){a||!s?(l&&r.appendChild(c),r.appendChild(v)):s&&(s.parentNode.insertBefore(v,s.nextSibling),l&&s.parentNode.insertBefore(c,v))},disable:function(e){P(e)},getIsFocusIn:function(){return I},setIsFocusIn:function(e){I=e},toggleFocusStyling:function(){S(I)},isChoicesVisible:function(){return"none"!=v.style.display},setChoicesVisible:function(e){v.style.display=e?"block":"none"},dispose:function(){a?r.parentNode.removeChild(r):p.restore(),l?c.parentNode.removeChild(c):(P(!1),S(!1)),v.parentNode.removeChild(v),g.parentNode&&g.parentNode.removeChild(g),y.parentNode&&y.parentNode.removeChild(y),s&&(s.required=L,s.style.display=m)}}}var O={useCssPatch:!0,containerClass:"dashboardcode-bsmultiselect",css:{choices:"dropdown-menu",choice_hover:"hover",choice_selected:"",choice_disabled:"",picks:"form-control",picks_focus:"focus",picks_disabled:"disabled",pick_disabled:"",pickFilter:"",filterInput:"",pick:"badge",pickContent:"",pickContent_disabled:"disabled",pickButton:"close",choiceCheckBox_disabled:"disabled",choiceContent:"custom-control custom-checkbox d-flex",choiceCheckBox:"custom-control-input",choiceLabel:"custom-control-label justify-content-start",choiceLabel_disabled:""},cssPatch:{choices:{listStyleType:"none"},picks:{listStyleType:"none",display:"flex",flexWrap:"wrap",height:"auto",marginBottom:"0"},choice:"px-md-2 px-1",choice_hover:"text-primary bg-light",filterInput:{border:"0px",height:"auto",boxShadow:"none",padding:"0",margin:"0",outline:"none",backgroundColor:"transparent",backgroundImage:"none"},filterInput_empty:"form-control",picks_disabled:{backgroundColor:"#e9ecef"},picks_focus:{borderColor:"#80bdff",boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"},picks_focus_valid:{borderColor:"",boxShadow:"0 0 0 0.2rem rgba(40, 167, 69, 0.25)"},picks_focus_invalid:{borderColor:"",boxShadow:"0 0 0 0.2rem rgba(220, 53, 69, 0.25)"},picks_def:{minHeight:"calc(2.25rem + 2px)"},picks_lg:{minHeight:"calc(2.875rem + 2px)"},picks_sm:{minHeight:"calc(1.8125rem + 2px)"},pick:{paddingLeft:"0px",lineHeight:"1.5em"},pickButton:{fontSize:"1.5em",lineHeight:".9em",float:"none"},pickContent_disabled:{opacity:".65"},choiceContent:{justifyContent:"initial"},choiceLabel:{color:"inherit"},choiceCheckBox:{color:"inherit"},choiceLabel_disabled:{opacity:".65"}},label:null,placeholder:"",staticContentGenerator:null,pickContentGenerator:null,choiceContentGenerator:null,buildConfiguration:null,isRtl:null,setSelected:null,required:null,common:null,options:null,getIsOptionDisabled:null,getIsOptionHidden:null,getDisabled:null,getSize:null,getValidity:null,valueMissingMessage:"",getIsValueMissing:null};function H(e,t){var n=e.css,i=e.cssPatch;e.css=null,e.cssPatch=null,function(e,t){for(var n in t)void 0===e[n]&&(e[n]=t[n])}(e,t);var o=I(t.css,n);if(t.cssPatch instanceof Boolean||"boolean"==typeof t.cssPatch||i instanceof Boolean||"boolean"==typeof i)throw new Error("BsMultiSelect: 'cssPatch' was used instead of 'useCssPatch'");var s=I(t.cssPatch,i);e.css=o,e.cssPatch=s}function N(e,t,n){var s=t.Popper,a=t.window,u=function(n){return t.trigger(e,n)};if("undefined"==typeof s)throw new Error("BsMultiSelect: Popper.js (https://popper.js.org) is required");var h={},g=null;n instanceof Function?(H(h,O),g=n(e,h)):(n&&(function(e){e.css||(e.css={});var t=e.css;e.cssPatch||(e.cssPatch={});var n=e.cssPatch;if((e.selectedPanelFocusBorderColor||e.selectedPanelFocusBoxShadow)&&(console.log("DashboarCode.BsMultiSelect: selectedPanelFocusBorderColor and selectedPanelFocusBoxShadow are depricated, use - cssPatch:{picks_focus:{borderColor:'myValue', boxShadow:'myValue'}}"),n.picks_focus||(n.picks_focus={boxShadow:e.selectedPanelFocusBoxShadow,borderColor:e.selectedPanelFocusBorderColor}),delete e.selectedPanelFocusBorderColor,delete e.selectedPanelFocusBoxShadow),V.forEach((function(t){if(e[t.old]){if(console.log("DashboarCode.BsMultiSelect: "+t.old+" is depricated, use - cssPatch:{"+t.opt+":{"+t.style+":'myValue'}}"),!e[t.opt]){var n={};n[t.style]=e[t.old],e.cssPatch[t.opt]=n}delete e[t.old]}})),_.forEach((function(n){e[n.old]&&(console.log("DashboarCode.BsMultiSelect: "+n.old+" is depricated, use - css:{"+n.opt+":'myValue'}"),t[n.opt]||(t[n.opt]=e[n.old]),delete e[n.old])})),e.inputColor&&(console.log("DashboarCode.BsMultiSelect: inputColor is depricated, remove parameter"),delete e.inputColor),e.useCss&&(console.log("DashboarCode.BsMultiSelect: useCss(=true) is depricated, use - 'useCssPatch: false'"),t.pick_disabled||(e.useCssPatch=!e.useCss),delete e.useCss),e.getIsValid||e.getIsInValid)throw"DashboarCode.BsMultiSelect: parameters getIsValid and getIsInValid are depricated and removed, use - getValidity that should return (true|false|null) "}(n),function(e,t){for(var n in t)e[n]=t[n]}(h,n)),H(h,O)),h.buildConfiguration&&(g=h.buildConfiguration(e,h));var b=h.css,C=h.cssPatch,y=h.useCssPatch,k=h.containerClass,I=h.label,P=h.isRtl,w=h.required,D=h.getIsValueMissing,F=h.setSelected,N=h.placeholder,U=h.common,q=h.options,R=h.getDisabled,j=h.getValidity,G=h.getSize,z=h.getIsOptionDisabled,W=h.getIsOptionHidden;y&&function(e,t){for(var n in t){var i=t[n],o=e[n];e[n]=void 0===o?L(i):E(!1,o,i)}}(b,C);var Q,J=r(h.staticContentGenerator,M),K=r(h.pickContentGenerator,B),X=r(h.choiceContentGenerator,T),Y=c(h.valueMissingMessage,(function(){return p(e,"bsmultiselect","value-missing-message")}),"Please select an item in the list"),Z=!1;!0===(Q=P)||!1===Q?Z=!0:P=v(e);var $,ee,te,ne=J(e,(function(e){return a.document.createElement(e)}),k,Z,b);if(w=r(w,ne.required),q)j||(j=function(){return null}),R||(R=function(){return!1}),G||(G=function(){return null}),te=function(){return q},ee=function(){$(),u("dashboardcode.multiselect:change")},z||(z=function(e){return void 0!==e.disabled&&e.disabled}),W||(W=function(e){return void 0!==e.hidden&&e.hidden});else{var ie=ne.selectElement;j||(j=function(e){return function(){return!e.classList.contains("is-invalid")&&(!!e.classList.contains("is-valid")||null)}}(ie)),R||(R=function(e){var t=d(e,"FIELDSET");return t?function(){return e.disabled||t.disabled}:function(){return e.disabled}}(ie)),G||(G=function(e){var t=f(e,"input-group");return t?function(){var e=null;return t.classList.contains("input-group-lg")?e="lg":t.classList.contains("input-group-sm")&&(e="sm"),e}:function(){var t=null;return e.classList.contains("custom-select-lg")||e.classList.contains("form-control-lg")?t="lg":(e.classList.contains("custom-select-sm")||e.classList.contains("form-control-sm"))&&(t="sm"),t}}(ie)),te=function(){return ie.options},ee=function(){$(),u("change"),u("dashboardcode.multiselect:change")},z||(z=function(e){return e.disabled}),W||(W=function(e){return e.hidden})}D||(D=function(){for(var e=0,t=te(),n=0;n<t.length;n++)t[n].selected&&e++;return 0===e});var oe=l((function(){return w&&D()})),se=function(e){var t=i();return{getValue:function(){return e},setValue:function(n){e=n,t.forEach((function(e){return e(n)}))},attach:function(e){return t.add(e)},detachAll:function(){t.reset()}}}(!oe.getValue());$=function(){return oe.call()};var re=c(I);re||(re=function(e){var t=null,n=f(e,"form-group");return n&&(t=n.querySelector('label[for="'+e.id+'"]')),t}(ne.selectElement));var ce=function(e,t){var n=null;return{init:function(i){if(e){n=e.getAttribute("for");var o=t();i.setAttribute("id",o),e.setAttribute("for",o)}},dispose:function(){n&&e.setAttribute("for",n)}}}(re,ne.createInputId);N||(N=p(e,"bsmultiselect","placeholder")),F||(F=function(e,t){e.selected=t});var le=A(ne.filterInputElement,oe,Y,(function(e){return se.setValue(e)}));U||(U={getDisabled:R,getValidity:j,getSize:G});var ae=new S(te,U,R,F,z,W,ne,(function(e){return K(e,U,b)}),(function(e){return X(e,U,b)}),ce,N,P,ee,b,s,a),ue=null;if(ne.selectElement){var de=d(ne.selectElement,"FORM");if(de){var fe=m();fe.bind(de,"reset",(function(){return a.setTimeout((function(){return ae.UpdateData()}))})),ue=function(){return fe.unbind()}}}return ae.Dispose=o(ae.Dispose.bind(ae),oe.detachAll,se.detachAll,ue),ae.validationApi=le,x(ae,ne,j,G,se,y,b),g&&g instanceof Function&&g(ae),ae.init(),ne.selectElement&&"complete"!=a.document.readyState&&a.setTimeout((function(){ae.UpdateSelected()})),ae}!function(e,t,n){!function(e,t,n,i){var o=e.charAt(0),s=o.toLowerCase();if(s==o)throw new Error("Plugin name '"+e+"' should be started from upper case char");var r=s+e.slice(1),c=i.fn[r],l=i.fn[e],a="DashboardCode."+e;function u(e,n,i){var o=t(n,"object"==typeof e||e instanceof Function?e:null,(function(){i.removeData(a)}));return i.data(a,o),o}function d(e){return this.each((function(t,n){var o=i(n),s=o.data(a),r="string"==typeof e;if(!s){if(r&&/Dispose/.test(e))return;s=u(e,n,o)}if(r){var c=e;if("undefined"==typeof s[c])throw new Error("No method named '"+c+"'");s[c]()}}))}function f(e){var t=this.data(a);if(t)return t;if(1===this.length)return u(e,this.get(0),this);if(this.length>1){var n=[];return this.each((function(t,o){n.push(u(e,o,i(o)))})),n}}i.fn[r]=d,i.fn[r].noConflict=function(){return i.fn[r]=c,d},i.fn[e]=f,i.fn[e].noConflict=function(){return i.fn[e]=l,f},i.fn[r].defaults=n}("BsMultiSelect",(function(i,s,r){var c=N(i,{trigger:function(e,n){return t(e).trigger(n)},window:e,Popper:n},s);return c.Dispose=o(c.Dispose,r),c}),O,t)}(window,e,t)}));
 //# sourceMappingURL=BsMultiSelect.min.js.map