%PDF- %PDF-
Direktori : /proc/1857783/root/var/www/pn/wp-content/plugins/ajax-search-pro/js/min/ |
Current File : //proc/1857783/root/var/www/pn/wp-content/plugins/ajax-search-pro/js/min/chosen.jquery.min.js |
/*! Chosen, a Select Box Enhancer for jQuery and Prototype by Patrick Filler for Harvest, http://getharvest.com Version 1.8.2 Full source at https://github.com/harvesthq/chosen Copyright (c) 2011-2017 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md This file is generated by `grunt build`, do not edit it by hand. */ (function(){var n,r,t,i,u=function(n,t){return function(){return n.apply(t,arguments)}},f=function(n,t){for(var i in t)e.call(t,i)&&(n[i]=t[i]);function r(){this.constructor=n}return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},e={}.hasOwnProperty;i=function(){function n(){this.options_index=0;this.parsed=[]}return n.prototype.add_node=function(n){return n.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(n):this.add_option(n)},n.prototype.add_group=function(n){var i,t,f,e,r,u;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:n.label,title:n.title?n.title:void 0,children:0,disabled:n.disabled,classes:n.className}),r=n.childNodes,u=[],t=0,f=r.length;t<f;t++)e=r[t],u.push(this.add_option(e,i,n.disabled));return u},n.prototype.add_option=function(n,t,i){if(n.nodeName.toUpperCase()==="OPTION")return n.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:n.value,text:n.text,html:n.innerHTML,title:n.title?n.title:void 0,selected:n.selected,disabled:i===!0?i:n.disabled,group_array_index:t,group_label:t!=null?this.parsed[t].label:null,classes:n.className,style:n.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},n}();i.select_to_array=function(n){var f,t,e,r,u;for(r=new i,u=n.childNodes,t=0,e=u.length;t<e;t++)f=u[t],r.add_node(f);return r.parsed};r=function(){function n(t,i){(this.form_field=t,this.options=i!=null?i:{},this.label_click_handler=u(this.label_click_handler,this),n.browser_is_supported())&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return n.prototype.set_default_values=function(){return this.click_test_action=function(n){return function(t){return n.test_active_click(t)}}(this),this.activate_action=function(n){return function(t){return n.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.group_search=this.options.group_search!=null?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:!0,this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=this.options.hide_results_on_select!=null?this.options.hide_results_on_select:!0},n.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||n.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||n.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||n.default_no_result_text},n.prototype.choice_label=function(n){return this.include_group_label_in_selected&&n.group_label!=null?"<b class='group-name'>"+n.group_label+"<\/b>"+n.html:n.html},n.prototype.mouse_enter=function(){return this.mouse_on_container=!0},n.prototype.mouse_leave=function(){return this.mouse_on_container=!1},n.prototype.input_focus=function(){if(this.is_multiple){if(!this.active_field)return setTimeout(function(n){return function(){return n.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},n.prototype.input_blur=function(){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(n){return function(){return n.blur_test()}}(this),100)},n.prototype.label_click_handler=function(n){return this.is_multiple?this.container_mousedown(n):this.activate_field()},n.prototype.results_option_build=function(n){var u,t,i,r,o,f,e;for(u="",e=0,f=this.results_data,r=0,o=f.length;r<o;r++)if(t=f[r],i="",i=t.group?this.result_add_group(t):this.result_add_option(t),i!==""&&(e++,u+=i),(n!=null?n.first:void 0)&&(t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(t))),e>=this.max_shown_results)break;return u},n.prototype.result_add_option=function(n){var t,i;return n.search_match?this.include_option_in_results(n)?(t=[],n.disabled||n.selected&&this.is_multiple||t.push("active-result"),!n.disabled||n.selected&&this.is_multiple||t.push("disabled-result"),n.selected&&t.push("result-selected"),n.group_array_index!=null&&t.push("group-option"),n.classes!==""&&t.push(n.classes),i=document.createElement("li"),i.className=t.join(" "),i.style.cssText=n.style,i.setAttribute("data-option-array-index",n.array_index),i.innerHTML=n.highlighted_html||n.html,n.title&&(i.title=n.title),this.outerHTML(i)):"":""},n.prototype.result_add_group=function(n){var i,t;return(n.search_match||n.group_match)?(n.active_options>0)?(i=[],i.push("group-result"),n.classes&&i.push(n.classes),t=document.createElement("li"),t.className=i.join(" "),t.innerHTML=n.highlighted_html||this.escape_html(n.label),n.title&&(t.title=n.title),this.outerHTML(t)):"":""},n.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},n.prototype.reset_single_select_options=function(){var n,u,i,r,t;for(i=this.results_data,t=[],n=0,u=i.length;n<u;n++)r=i[n],r.selected?t.push(r.selected=!1):t.push(void 0);return t},n.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},n.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},n.prototype.winnow_results=function(){var h,c,f,l,n,a,t,s,v,e,i,o,r,y,u;for(this.no_results_clear(),e=0,t=this.get_search_text(),h=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),v=this.get_search_regex(h),s=this.results_data,f=0,l=s.length;f<l;f++)n=s[f],n.search_match=!1,i=null,o=null,n.highlighted_html="",this.include_option_in_results(n)&&(n.group&&(n.group_match=!1,n.active_options=0),n.group_array_index!=null&&this.results_data[n.group_array_index]&&(i=this.results_data[n.group_array_index],i.active_options===0&&i.search_match&&(e+=1),i.active_options+=1),u=n.group?n.label:n.text,n.group&&!this.group_search||(o=this.search_string_match(u,v),n.search_match=o!=null,n.search_match&&!n.group&&(e+=1),n.search_match?(t.length&&(r=o.index,a=u.slice(0,r),c=u.slice(r,r+t.length),y=u.slice(r+t.length),n.highlighted_html=this.escape_html(a)+"<em>"+this.escape_html(c)+"<\/em>"+this.escape_html(y)),i!=null&&(i.group_match=!0)):n.group_array_index!=null&&this.results_data[n.group_array_index].search_match&&(n.search_match=!0)));return this.result_clear_highlight(),e<1&&t.length?(this.update_results_content(""),this.no_results(t)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},n.prototype.get_search_regex=function(n){var i,t;return t=this.search_contains?n:"(^|\\s|\\b)"+n+"[^\\s]*",this.enable_split_word_search||this.search_contains||(t="^"+t),i=this.case_sensitive_search?"":"i",new RegExp(t,i)},n.prototype.search_string_match=function(n,t){var i;return i=t.exec(n),!this.search_contains&&(i!=null?i[1]:void 0)&&(i.index+=1),i},n.prototype.choices_count=function(){var n,i,r,t;if(this.selected_option_count!=null)return this.selected_option_count;for(this.selected_option_count=0,t=this.form_field.options,n=0,i=t.length;n<i;n++)r=t[n],r.selected&&(this.selected_option_count+=1);return this.selected_option_count},n.prototype.choices_click=function(n){return n.preventDefault(),this.activate_field(),(this.results_showing||this.is_disabled)?void 0:this.results_show()},n.prototype.keydown_checker=function(n){var i,t;t=(i=n.which)!=null?i:n.keyCode;this.search_field_scale();t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(n);this.mouse_on_container=!1;break;case 13:this.results_showing&&n.preventDefault();break;case 27:this.results_showing&&n.preventDefault();break;case 32:this.disable_search&&n.preventDefault();break;case 38:n.preventDefault();this.keyup_arrow();break;case 40:n.preventDefault();this.keydown_arrow()}},n.prototype.keyup_checker=function(n){var t,i;i=(t=n.which)!=null?t:n.keyCode;this.search_field_scale();switch(i){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:n.preventDefault();this.results_showing&&this.result_select(n);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},n.prototype.clipboard_event_checker=function(){if(!this.is_disabled)return setTimeout(function(n){return function(){return n.results_search()}}(this),50)},n.prototype.container_width=function(){return this.options.width!=null?this.options.width:this.form_field.offsetWidth+"px"},n.prototype.include_option_in_results=function(n){return this.is_multiple&&!this.display_selected_options&&n.selected?!1:!this.display_disabled_options&&n.disabled?!1:n.empty?!1:!0},n.prototype.search_results_touchstart=function(n){return this.touch_started=!0,this.search_results_mouseover(n)},n.prototype.search_results_touchmove=function(n){return this.touch_started=!1,this.search_results_mouseout(n)},n.prototype.search_results_touchend=function(n){if(this.touch_started)return this.search_results_mouseup(n)},n.prototype.outerHTML=function(n){var t;return n.outerHTML?n.outerHTML:(t=document.createElement("div"),t.appendChild(n),t.innerHTML)},n.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'<\/span>\n <div><b><\/b><\/div>\n<\/a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n <\/div>\n <ul class="chosen-results"><\/ul>\n<\/div>'},n.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n <\/li>\n<\/ul>\n<div class="chosen-drop">\n <ul class="chosen-results"><\/ul>\n<\/div>'},n.prototype.get_no_results_html=function(n){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(n)+"<\/span>\n<\/li>"},n.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},n.default_multiple_text="Select Some Options",n.default_single_text="Select an Option",n.default_no_result_text="No results match",n}();n=jQuery;n.fn.extend({asp_chosen:function(i){return r.browser_is_supported()?this.each(function(){var u,r;if(u=n(this),r=u.data("chosen"),i==="destroy"){r instanceof t&&r.destroy();return}r instanceof t||u.data("chosen",new t(this,i))}):this}});t=function(t){f(r,t);function r(){return r.__super__.constructor.apply(this,arguments)}return r.prototype.setup=function(){return this.form_field_jq=n(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},r.prototype.set_up_html=function(){var t,i;return t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),i={"class":t.join(" "),title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=n("<div />",i),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},r.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},r.prototype.register_observers=function(){this.container.on("touchstart.chosen",function(n){return function(t){n.container_mousedown(t)}}(this));this.container.on("touchend.chosen",function(n){return function(t){n.container_mouseup(t)}}(this));this.container.on("mousedown.chosen",function(n){return function(t){n.container_mousedown(t)}}(this));this.container.on("mouseup.chosen",function(n){return function(t){n.container_mouseup(t)}}(this));this.container.on("mouseenter.chosen",function(n){return function(t){n.mouse_enter(t)}}(this));this.container.on("mouseleave.chosen",function(n){return function(t){n.mouse_leave(t)}}(this));this.search_results.on("mouseup.chosen",function(n){return function(t){n.search_results_mouseup(t)}}(this));this.search_results.on("mouseover.chosen",function(n){return function(t){n.search_results_mouseover(t)}}(this));this.search_results.on("mouseout.chosen",function(n){return function(t){n.search_results_mouseout(t)}}(this));this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(n){return function(t){n.search_results_mousewheel(t)}}(this));this.search_results.on("touchstart.chosen",function(n){return function(t){n.search_results_touchstart(t)}}(this));this.search_results.on("touchmove.chosen",function(n){return function(t){n.search_results_touchmove(t)}}(this));this.search_results.on("touchend.chosen",function(n){return function(t){n.search_results_touchend(t)}}(this));this.form_field_jq.on("chosen:updated.chosen",function(n){return function(t){n.results_update_field(t)}}(this));this.form_field_jq.on("chosen:activate.chosen",function(n){return function(t){n.activate_field(t)}}(this));this.form_field_jq.on("chosen:open.chosen",function(n){return function(t){n.container_mousedown(t)}}(this));this.form_field_jq.on("chosen:close.chosen",function(n){return function(t){n.close_field(t)}}(this));this.search_field.on("blur.chosen",function(n){return function(t){n.input_blur(t)}}(this));this.search_field.on("keyup.chosen",function(n){return function(t){n.keyup_checker(t)}}(this));this.search_field.on("keydown.chosen",function(n){return function(t){n.keydown_checker(t)}}(this));this.search_field.on("focus.chosen",function(n){return function(t){n.input_focus(t)}}(this));this.search_field.on("cut.chosen",function(n){return function(t){n.clipboard_event_checker(t)}}(this));this.search_field.on("paste.chosen",function(n){return function(t){n.clipboard_event_checker(t)}}(this));return this.is_multiple?this.search_choices.on("click.chosen",function(n){return function(t){n.choices_click(t)}}(this)):this.container.on("click.chosen",function(n){n.preventDefault()})},r.prototype.destroy=function(){return n(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},r.prototype.search_field_disabled=function(){if(this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled)return this.close_field();if(!this.is_multiple)return this.selected_item.on("focus.chosen",this.activate_field)},r.prototype.container_mousedown=function(t){var i;if(!this.is_disabled&&(t&&((i=t.type)==="mousedown"||i==="touchstart")&&!this.results_showing&&t.preventDefault(),!(t!=null&&n(t.target).hasClass("search-choice-close")))){if(this.active_field)!this.is_multiple&&t&&(n(t.target)[0]===this.selected_item[0]||n(t.target).parents("a.chosen-single").length)&&(t.preventDefault(),this.results_toggle());else{this.is_multiple&&this.search_field.val("");n(this.container[0].ownerDocument).on("click.chosen",this.click_test_action);this.results_show()}return this.activate_field()}},r.prototype.container_mouseup=function(n){if(n.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(n)},r.prototype.search_results_mousewheel=function(n){var t;return n.originalEvent&&(t=n.originalEvent.deltaY||-n.originalEvent.wheelDelta||n.originalEvent.detail),t!=null?(n.preventDefault(),n.type==="DOMMouseScroll"&&(t=t*40),this.search_results.scrollTop(t+this.search_results.scrollTop())):void 0},r.prototype.blur_test=function(){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},r.prototype.close_field=function(){return n(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},r.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},r.prototype.test_active_click=function(t){var i;return i=n(t.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},r.prototype.result_do_highlight=function(n){var t,i,r,f,u;if(n.length){if(this.result_clear_highlight(),this.result_highlight=n,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),u=this.search_results.scrollTop(),f=r+u,i=this.result_highlight.position().top+this.search_results.scrollTop(),t=i+this.result_highlight.outerHeight(),t>=f)return this.search_results.scrollTop(t-r>0?t-r:0);if(i<u)return this.search_results.scrollTop(i)}},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},r.prototype.update_results_content=function(n){return this.search_results.html(n)},r.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},r.prototype.set_tab_index=function(){var n;if(this.form_field.tabIndex)return n=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=n},r.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=n("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},r.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},r.prototype.search_results_mouseup=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i.length?(this.result_highlight=i,this.result_select(t),this.search_field.focus()):void 0},r.prototype.search_results_mouseover=function(t){var i;return i=n(t.target).hasClass("active-result")?n(t.target):n(t.target).parents(".active-result").first(),i?this.result_do_highlight(i):void 0},r.prototype.search_results_mouseout=function(t){if(n(t.target).hasClass("active-result")||n(t.target).parents(".active-result").first())return this.result_clear_highlight()},r.prototype.choice_build=function(t){var i,r;if(i=n("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(t)+"<\/span>"),t.disabled)i.addClass("search-choice-disabled");else{r=n("<a />",{"class":"search-choice-close","data-option-array-index":t.array_index});r.on("click.chosen",function(n){return function(t){return n.choice_destroy_link_click(t)}}(this));i.append(r)}return this.search_container.before(i)},r.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),t.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(n(t.target))},r.prototype.choice_destroy=function(n){if(this.result_deselect(n[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),n.parents("li").first().remove(),this.search_field_scale()},r.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field?this.results_hide():void 0},r.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},r.prototype.result_select=function(n){var i,t;if(this.result_highlight)return(i=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count())?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?i.removeClass("active-result"):this.reset_single_select_options(),i.addClass("result-selected"),t=this.results_data[i[0].getAttribute("data-option-array-index")],t.selected=!0,this.form_field.options[t.options_index].selected=!0,this.selected_option_count=null,this.search_field.val(""),this.is_multiple?this.choice_build(t):this.single_set_selected_text(this.choice_label(t)),this.is_multiple&&(!this.hide_results_on_select||n.metaKey||n.ctrlKey)?this.winnow_results():(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[t.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,n.preventDefault(),this.search_field_scale())},r.prototype.single_set_selected_text=function(n){return n==null&&(n=this.default_text),n===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(n)},r.prototype.result_deselect=function(n){var t;return t=this.results_data[n],this.form_field.options[t.options_index].disabled?!1:(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"><\/abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},r.prototype.get_search_field_value=function(){return this.search_field.val()},r.prototype.get_search_text=function(){return n.trim(this.get_search_field_value())},r.prototype.escape_html=function(t){return n("<div/>").text(t).html()},r.prototype.winnow_results_set_highlight=function(){var n,t;return t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),n=t.length?t.first():this.search_results.find(".active-result").first(),n!=null?this.result_do_highlight(n):void 0},r.prototype.no_results=function(n){var t;return t=this.get_no_results_html(n),this.search_results.append(t),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},r.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},r.prototype.keydown_arrow=function(){var n;if(this.results_showing&&this.result_highlight){if(n=this.result_highlight.nextAll("li.active-result").first(),n)return this.result_do_highlight(n)}else return this.results_show()},r.prototype.keyup_arrow=function(){var n;if(this.results_showing||this.is_multiple){if(this.result_highlight)return n=this.result_highlight.prevAll("li.active-result"),n.length?this.result_do_highlight(n.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())}else return this.results_show()},r.prototype.keydown_backstroke=function(){var n;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(n=this.search_container.siblings("li.search-choice").last(),n.length&&!n.hasClass("search-choice-disabled"))?(this.pending_backstroke=n,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},r.prototype.search_field_scale=function(){var t,i,o,u,f,e,r;if(this.is_multiple){for(f={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},e=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"],i=0,o=e.length;i<o;i++)u=e[i],f[u]=this.search_field.css(u);return t=n("<div />").css(f),t.text(this.get_search_field_value()),n("body").append(t),r=t.width()+25,t.remove(),this.container.is(":visible")&&(r=Math.min(this.container.outerWidth()-10,r)),this.search_field.width(r)}},r.prototype.trigger_form_field_change=function(n){return this.form_field_jq.trigger("input",n),this.form_field_jq.trigger("change",n)},r}(r)}).call(this);