"use strict";!function(t,i,e,n){var r=function(i,e){this.elem=i,this.$elem=t(i),this.options=e,this.currentData=[]};r.prototype={defaults:{containerClass:"",containerWidth:!1,width:!1,search:!1,searchAutofocus:!1,autofocusScrollOffset:0,coloring:{},limit:n,texts:{trigger:"Select value",noResult:"No results",search:"Search"}},config:{},init:function(){return this.config=t.extend({},this.defaults,this.options),this.$elem.is("select")?(this.config.multiple=this.$elem.is("select[multiple='multiple']")||this.$elem.is("select[multiple]"),this.config.width===!1||Math.floor(this.config.width)==this.config.width&&t.isNumeric(this.config.width)?this.config.containerWidth===!1||Math.floor(this.config.containerWidth)==this.config.containerWidth&&t.isNumeric(this.config.containerWidth)?0==this.$elem.find("option:not([hidden])").length?void console.log("Picker - Select has no options. Can not proceed!"):(!this.config.multiple&&this.config.limit>0&&console.log("Picker - You are applying limit parameter on single-seleciton mode Picker!"),this.config.limit<0?void console.log("Picker - Limit has to be greater then 0!"):(this._build(),this.$elem.hide(),this._fillList(),this.$container.find(".pc-trigger").click(function(){var i=this.$container.find(".pc-list");i.toggle(),this.$elem.trigger(i.is(":visible")?"sp-open":"sp-close"),this.config.search&&this.config.searchAutofocus&&i.is(":visible")&&(i.find("input").focus(),t("html, body").animate({scrollTop:i.find("input").offset().top-this.config.autofocusScrollOffset},800))}.bind(this)),t(e).mouseup(function(t){var i=this.$container.find(".pc-list");i.is(t.target)||0!==i.has(t.target).length||this.$container.find(".pc-trigger").is(t.target)||(i.hide(),this.$elem.trigger("sp-close"),this.config.search&&(this.$container.find(".pc-list input").val(""),this._updateList(this.currentData)))}.bind(this)),this)):void console.log("Picker - Container width is not a integer."):void console.log("Picker - Width is not a integer.")):void console.log("Picker - Element is not Selectbox")},pc_selected:function(i){var e=t(i.target),n=e.data("id");this._selectElement(n,e),this.$container.find(".pc-list").hide(),this.config.search&&(this.$container.find(".pc-list input").val(""),this._updateList(this.currentData)),this.$elem.trigger("sp-change")},pc_remove:function(i){var e=t(i.target),n=e.parent().data("id"),r=e.parent().data("order"),s=t("