forked from select2/select2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect2.min.js
2 lines (2 loc) · 61.1 KB
/
select2.min.js
1
2
!function(t){"undefined"==typeof t.fn.each2&&t.extend(t.fn,{each2:function(e){for(var s=t([0]),i=-1,n=this.length;++i<n&&(s.context=s[0]=this[i])&&e.call(s[0],i,s)!==!1;);return this}})}(jQuery),function(t,e){"use strict";function s(e){var s=t(document.createTextNode(""));e.before(s),s.before(e),s.remove()}function i(t){function e(t){return K[t]||t}return t.replace(/[^\u0000-\u007E]/g,e)}function n(t,e){for(var s=0,i=e.length;i>s;s+=1)if(a(t,e[s]))return s;return-1}function o(){var e=t(W);e.appendTo(document.body);var s={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),s}function a(t,s){return t===s?!0:t===e||s===e?!1:null===t||null===s?!1:t.constructor===String?t+""==s+"":s.constructor===String?s+""==t+"":!1}function r(t,e,s){var i,n,o;if(null===t||t.length<1)return[];for(i=t.split(e),n=0,o=i.length;o>n;n+=1)i[n]=s(i[n]);return i}function c(t){return t.outerWidth(!1)-t.width()}function l(s){var i="keyup-change-value";s.on("keydown",function(){t.data(s,i)===e&&t.data(s,i,s.val())}),s.on("keyup",function(){var n=t.data(s,i);n!==e&&s.val()!==n&&(t.removeData(s,i),s.trigger("keyup-change"))})}function h(s){s.on("mousemove",function(s){var i=j;(i===e||i.x!==s.pageX||i.y!==s.pageY)&&t(s.target).trigger("mousemove-filtered",s)})}function u(t,s,i){i=i||e;var n;return function(){var e=arguments;window.clearTimeout(n),n=window.setTimeout(function(){s.apply(i,e)},t)}}function d(t,e){var s=u(t,function(t){e.trigger("scroll-debounced",t)});e.on("scroll",function(t){n(t.target,e.get())>=0&&s(t)})}function p(t){t[0]!==document.activeElement&&window.setTimeout(function(){var e,s=t[0],i=t.val().length;t.focus();var n=s.offsetWidth>0||s.offsetHeight>0;n&&s===document.activeElement&&(s.setSelectionRange?s.setSelectionRange(i,i):s.createTextRange&&(e=s.createTextRange(),e.collapse(!1),e.select()))},0)}function f(e){e=t(e)[0];var s=0,i=0;if("selectionStart"in e)s=e.selectionStart,i=e.selectionEnd-s;else if("selection"in document){e.focus();var n=document.selection.createRange();i=document.selection.createRange().text.length,n.moveStart("character",-e.value.length),s=n.text.length-i}return{offset:s,length:i}}function g(t){t.preventDefault(),t.stopPropagation()}function m(t){t.preventDefault(),t.stopImmediatePropagation()}function v(e){if(!N){var s=e[0].currentStyle||window.getComputedStyle(e[0],null);N=t(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:s.fontSize,fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,textTransform:s.textTransform,whiteSpace:"nowrap"}),N.attr("class","select2-sizer"),t(document.body).append(N)}return N.text(e.val()),N.width()}function w(e,s,i){var n,o,a=[];n=t.trim(e.attr("class")),n&&(n=""+n,t(n.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&a.push(this)})),n=t.trim(s.attr("class")),n&&(n=""+n,t(n.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(o=i(this),o&&a.push(o))})),e.attr("class",a.join(" "))}function b(t,e,s,n){var o=i(t.toUpperCase()).indexOf(i(e.toUpperCase())),a=e.length;return 0>o?void s.push(n(t)):(s.push(n(t.substring(0,o))),s.push("<span class='select2-match'>"),s.push(n(t.substring(o,o+a))),s.push("</span>"),void s.push(n(t.substring(o+a,t.length))))}function C(t){var e={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})}function S(s){var i,n=null,o=s.quietMillis||100,a=s.url,r=this;return function(c){window.clearTimeout(i),i=window.setTimeout(function(){var i=s.data,o=a,l=s.transport||t.fn.select2.ajaxDefaults.transport,h={type:s.type||"GET",cache:s.cache||!1,jsonpCallback:s.jsonpCallback||e,dataType:s.dataType||"json"},u=t.extend({},t.fn.select2.ajaxDefaults.params,h);i=i?i.call(r,c.term,c.page,c.context):null,o="function"==typeof o?o.call(r,c.term,c.page,c.context):o,n&&"function"==typeof n.abort&&n.abort(),s.params&&(t.isFunction(s.params)?t.extend(u,s.params.call(r)):t.extend(u,s.params)),t.extend(u,{url:o,dataType:s.dataType,data:i,success:function(t){var e=s.results(t,c.page,c);c.callback(e)},error:function(t,e,s){var i={hasError:!0,jqXHR:t,textStatus:e,errorThrown:s};c.callback(i)}}),n=l.call(r,u)},o)}}function y(e){var s,i,n=e,o=function(t){return""+t.text};t.isArray(n)&&(i=n,n={results:i}),t.isFunction(n)===!1&&(i=n,n=function(){return i});var a=n();return a.text&&(o=a.text,t.isFunction(o)||(s=a.text,o=function(t){return t[s]})),function(e){var s,i=e.term,a={results:[]};return""===i?void e.callback(n()):(s=function(n,a){var r,c;if(n=n[0],n.children){r={};for(c in n)n.hasOwnProperty(c)&&(r[c]=n[c]);r.children=[],t(n.children).each2(function(t,e){s(e,r.children)}),(r.children.length||e.matcher(i,o(r),n))&&a.push(r)}else e.matcher(i,o(n),n)&&a.push(n)},t(n().results).each2(function(t,e){s(e,a.results)}),void e.callback(a))}}function E(s){var i=t.isFunction(s);return function(n){var o=n.term,a={results:[]},r=i?s(n):s;t.isArray(r)&&(t(r).each(function(){var t=this.text!==e,s=t?this.text:this;(""===o||n.matcher(o,s))&&a.results.push(t?this:{id:this,text:this})}),n.callback(a))}}function x(e,s){if(t.isFunction(e))return!0;if(!e)return!1;if("string"==typeof e)return!0;throw new Error(s+" must be a string, function, or falsy value")}function T(e,s){if(t.isFunction(e)){var i=Array.prototype.slice.call(arguments,2);return e.apply(s,i)}return e}function O(e){var s=0;return t.each(e,function(t,e){e.children?s+=O(e.children):s++}),s}function P(t,s,i,n){var o,r,c,l,h,u=t,d=!1;if(!n.createSearchChoice||!n.tokenSeparators||n.tokenSeparators.length<1)return e;for(;;){for(r=-1,c=0,l=n.tokenSeparators.length;l>c&&(h=n.tokenSeparators[c],r=t.indexOf(h),!(r>=0));c++);if(0>r)break;if(o=t.substring(0,r),t=t.substring(r+h.length),o.length>0&&(o=n.createSearchChoice.call(this,o,s),o!==e&&null!==o&&n.id(o)!==e&&null!==n.id(o))){for(d=!1,c=0,l=s.length;l>c;c++)if(a(n.id(o),n.id(s[c]))){d=!0;break}d||i(o)}}return u!==t?t:void 0}function I(){var e=this;t.each(arguments,function(t,s){e[s].remove(),e[s]=null})}function k(e,s){var i=function(){};return i.prototype=new e,i.prototype.constructor=i,i.prototype.parent=e.prototype,i.prototype=t.extend(i.prototype,s),i}if(window.Select2===e){var A,R,D,H,N,L,M,U="ontouchstart"in window||navigator.msMaxTouchPoints>0,F=(new Date).getTime(),j={x:0,y:0},z={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(t){switch(t=t.which?t.which:t){case z.LEFT:case z.RIGHT:case z.UP:case z.DOWN:return!0}return!1},isControl:function(t){var e=t.which;switch(e){case z.SHIFT:case z.CTRL:case z.ALT:return!0}return t.metaKey?!0:!1},isFunctionKey:function(t){return t=t.which?t.which:t,t>=112&&123>=t}},W="<div class='select2-measure-scrollbar'></div>",K={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};L=t(document),H=function(){var t=1;return function(){return t++}}(),A=k(Object,{bind:function(t){var e=this;return function(){t.apply(e,arguments)}},init:function(s){var i,n,a=".select2-results";this.opts=s=this.prepareOpts(s),this.id=s.id,s.element.data("select2")!==e&&null!==s.element.data("select2")&&s.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(s.element.attr("id")||"autogen"+H()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",s.element.attr("title")),this.body=t(document.body),w(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",s.element.attr("style")),this.container.css(T(s.containerCss,this.opts.element)),this.container.addClass(T(s.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",g),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),w(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(s.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",g),this.results=i=this.container.find(a),this.search=n=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",g),h(this.results),this.dropdown.on("mousemove-filtered",a,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",a,this.bind(function(t){this._touchEvent=!0,this.highlightUnderEvent(t)})),this.dropdown.on("touchmove",a,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",a,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(t){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),d(80,this.results),this.dropdown.on("scroll-debounced",a,this.bind(this.loadMoreIfNeeded)),t(this.container).on("change",".select2-input",function(t){t.stopPropagation()}),t(this.dropdown).on("change",".select2-input",function(t){t.stopPropagation()}),t.fn.mousewheel&&i.mousewheel(function(t,e,s,n){var o=i.scrollTop();n>0&&0>=o-n?(i.scrollTop(0),g(t)):0>n&&i.get(0).scrollHeight-i.scrollTop()+n<=i.height()&&(i.scrollTop(i.get(0).scrollHeight-i.height()),g(t))}),l(n),n.on("keyup-change input paste",this.bind(this.updateResults)),n.on("focus",function(){n.addClass("select2-focused")}),n.on("blur",function(){n.removeClass("select2-focused")}),this.dropdown.on("mouseup",a,this.bind(function(e){t(e.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(t){t.stopPropagation()}),this.lastSearchTerm=e,t.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==s.maximumInputLength&&this.search.attr("maxlength",s.maximumInputLength);var r=s.element.prop("disabled");r===e&&(r=!1),this.enable(!r);var c=s.element.prop("readonly");c===e&&(c=!1),this.readonly(c),M=M||o(),this.autofocus=s.element.prop("autofocus"),s.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",s.searchInputPlaceholder)},destroy:function(){var t=this.opts.element,s=t.data("select2"),i=this;this.close(),t.length&&t[0].detachEvent&&i._sync&&t.each(function(){i._sync&&this.detachEvent("onpropertychange",i._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,s!==e&&(s.container.remove(),s.dropdown.remove(),t.removeData("select2").off(".select2"),t.is("input[type='hidden']")?t.css("display",""):(t.show().prop("autofocus",this.autofocus||!1),this.elementTabIndex?t.attr({tabindex:this.elementTabIndex}):t.removeAttr("tabindex"),t.show())),I.call(this,"container","dropdown","results","search")},optionToData:function(t){return t.is("option")?{id:t.prop("value"),text:t.text(),element:t.get(),css:this.stripRestrictedClasses(t.attr("class")),disabled:t.prop("disabled"),locked:a(t.attr("locked"),"locked")||a(t.data("locked"),!0)}:t.is("optgroup")?{text:t.attr("label"),children:[],element:t.get(),css:this.stripRestrictedClasses(t.attr("class"))}:void 0},prepareOpts:function(s){var i,n,o,c,l=this;if(i=s.element,"select"===i.get(0).tagName.toLowerCase()&&(this.select=n=s.element),n&&t.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in s)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),s=t.extend({},{populateResults:function(i,n,o){var a,r=this.opts.id;(a=function(i,n,c){var h,u,d,p,f,g,m,v,w,b,C;i=s.sortResults(i,n,o);var S=[];for(h=0,u=i.length;u>h;h+=1)d=i[h],f=d.disabled===!0,p=!f&&r(d)!==e,g=d.children&&d.children.length>0,m='<li class="',m+="select2-results-dept-"+c,m+=" select2-result",m+=p?" select2-result-selectable":" select2-result-unselectable",f&&(m+=" select2-disabled"),g&&(m+=" select2-result-with-children"),C=l.opts.formatResultCssClass(d),C!=e&&(m+=" "+C),m+='" role="presentation">',v='<div class="select2-result-label"',v+=' id="select2-result-label-'+H()+'"',v+=' role="option"',v+=">",b=s.formatResult(d,v,o,l.opts.escapeMarkup),b!==e&&(v+=b),v+="</div>",m+=v,m+="</li>",m=t(m),g&&(w=t("<ul></ul>"),w.addClass("select2-result-sub"),a(d.children,w,c+1),m.append(w)),m.data("select2-data",d),S.push(m[0]);n.append(S)})(n,i,0)}},t.fn.select2.defaults,s),"function"!=typeof s.id&&(o=s.id,s.id=function(t){return t[o]}),t.isArray(s.element.data("select2Tags"))){if("tags"in s)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+s.element.attr("id");s.tags=s.element.data("select2Tags")}if(n?(s.query=this.bind(function(t){var s,n,o,a={results:[],more:!1},r=t.term;o=function(e,s){var i;e.is("option")?t.matcher(r,e.text(),e)&&s.push(l.optionToData(e)):e.is("optgroup")&&(i=l.optionToData(e),e.children().each2(function(t,e){o(e,i.children)}),i.children.length>0&&s.push(i))},s=i.children(),this.getPlaceholder()!==e&&s.length>0&&(n=this.getPlaceholderOption(),n&&(s=s.not(n))),s.each2(function(t,e){o(e,a.results)}),t.callback(a)}),s.id=function(t){return t.id}):"query"in s||("ajax"in s?(c=s.element.data("ajax-url"),c&&c.length>0&&(s.ajax.url=c),s.query=S.call(s.element,s.ajax)):"data"in s?s.query=y(s.data):"tags"in s&&(s.query=E(s.tags),s.createSearchChoice===e&&(s.createSearchChoice=function(e){return{id:t.trim(e),text:t.trim(e)}}),s.initSelection===e&&(s.initSelection=function(e,i){var n=[];t(r(e.val(),s.separator,s.transformVal)).each(function(){var e={id:this,text:this},i=s.tags;t.isFunction(i)&&(i=i()),t(i).each(function(){return a(this.id,e.id)?(e=this,!1):void 0}),n.push(e)}),i(n)}))),"function"!=typeof s.query)throw"query function not defined for Select2 "+s.element.attr("id");if("top"===s.createSearchChoicePosition)s.createSearchChoicePosition=function(t,e){t.unshift(e)};else if("bottom"===s.createSearchChoicePosition)s.createSearchChoicePosition=function(t,e){t.push(e)};else if("function"!=typeof s.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return s},monitorSource:function(){var s,i=this.opts.element,n=this;i.on("change.select2",this.bind(function(t){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var t=i.prop("disabled");t===e&&(t=!1),this.enable(!t);var s=i.prop("readonly");s===e&&(s=!1),this.readonly(s),this.container&&(w(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(T(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(w(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(this.opts.dropdownCssClass,this.opts.element)))}),i.length&&i[0].attachEvent&&i.each(function(){this.attachEvent("onpropertychange",n._sync)}),s=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,s!==e&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new s(function(e){t.each(e,n._sync)}),this.propertyObserver.observe(i.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(e){var s=t.Event("select2-selecting",{val:this.id(e),object:e,choice:e});return this.opts.element.trigger(s),!s.isDefaultPrevented()},triggerChange:function(e){e=e||{},e=t.extend({},e,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(e),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var t=this._enabled&&!this._readonly,e=!t;return t===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",e),this.close(),this.enabledInterface=t,!0)},enable:function(t){t===e&&(t=!0),this._enabled!==t&&(this._enabled=t,this.opts.element.prop("disabled",!t),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(t){t===e&&(t=!1),this._readonly!==t&&(this._readonly=t,this.opts.element.prop("readonly",t),this.enableInterface())},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var e,s,i,n,o,a=this.dropdown,r=this.container,c=r.offset(),l=r.outerHeight(!1),h=r.outerWidth(!1),u=a.outerHeight(!1),d=t(window),p=d.width(),f=d.height(),g=d.scrollLeft()+p,m=d.scrollTop()+f,v=c.top+l,w=c.left,b=m>=v+u,C=c.top-u>=d.scrollTop(),S=a.outerWidth(!1),y=function(){return g>=w+S},E=function(){return c.left+g+r.outerWidth(!1)>S},x=a.hasClass("select2-drop-above");x?(s=!0,!C&&b&&(i=!0,s=!1)):(s=!1,!b&&C&&(i=!0,s=!0)),i&&(a.hide(),c=this.container.offset(),l=this.container.outerHeight(!1),h=this.container.outerWidth(!1),u=a.outerHeight(!1),g=d.scrollLeft()+p,m=d.scrollTop()+f,v=c.top+l,w=c.left,S=a.outerWidth(!1),a.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(o=t(".select2-results",a)[0],a.addClass("select2-drop-auto-width"),a.css("width",""),S=a.outerWidth(!1)+(o.scrollHeight===o.clientHeight?0:M.width),S>h?h=S:S=h,u=a.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(e=this.body.offset(),v-=e.top,w-=e.left),!y()&&E()&&(w=c.left+this.container.outerWidth(!1)-S),n={left:w,width:h},s?(this.container.addClass("select2-drop-above"),a.addClass("select2-drop-above"),u=a.outerHeight(!1),n.top=c.top-u,n.bottom="auto"):(n.top=v,n.bottom="auto",this.container.removeClass("select2-drop-above"),a.removeClass("select2-drop-above")),n=t.extend(n,T(this.opts.dropdownCss,this.opts.element)),a.css(n)},shouldOpen:function(){var e;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(e=t.Event("select2-opening"),this.opts.element.trigger(e),!e.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),L.on("mousemove.select2Event",function(t){j.x=t.pageX,j.y=t.pageY}),!0):!1},opening:function(){var e,i=this.containerEventName,n="scroll."+i,o="resize."+i,a="orientationchange."+i;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),e=t("#select2-drop-mask"),0===e.length&&(e=t(document.createElement("div")),e.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),e.hide(),e.appendTo(this.body),e.on("mousedown touchstart click",function(i){s(e);var n,o=t("#select2-drop");o.length>0&&(n=o.data("select2"),n.opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),n.close(),i.preventDefault(),i.stopPropagation())})),this.dropdown.prev()[0]!==e[0]&&this.dropdown.before(e),t("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),e.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var r=this;this.container.parents().add(window).each(function(){t(this).on(o+" "+n+" "+a,function(t){r.opened()&&r.positionDropdown()})}),F=(new Date).getTime()},close:function(){if(this.opened()&&!(F>(new Date).getTime()-500)){var e=this.containerEventName,s="scroll."+e,i="resize."+e,n="orientationchange."+e;this.container.parents().add(window).each(function(){t(this).off(s).off(i).off(n)}),this.clearDropdownAlignmentPreference(),t("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),L.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.search.removeAttr("aria-activedescendant"),this.opts.element.trigger(t.Event("select2-close"))}},externalSearch:function(t){this.open(),this.search.val(t),this.updateResults(!1)},clearSearch:function(){},prefillNextSearchTerm:function(){if(""!==this.search.val())return!1;var t=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);return t!==e?(this.search.val(t),this.search.select(),!0):!1},getMaximumSelectionSize:function(){return T(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var e,s,i,n,o,a,r,c,l=this.results;if(s=this.highlight(),!(0>s)){if(0==s)return void l.scrollTop(0);e=this.findHighlightableChoices().find(".select2-result-label"),i=t(e[s]),c=(i.offset()||{}).top||0,n=c+i.outerHeight(!0),s===e.length-1&&(r=l.find("li.select2-more-results"),r.length>0&&(n=r.offset().top+r.outerHeight(!0))),o=l.offset().top+l.outerHeight(!1),n>o&&l.scrollTop(l.scrollTop()+(n-o)),a=c-l.offset().top,0>a&&"none"!=i.css("display")&&l.scrollTop(l.scrollTop()+a)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(e){for(var s=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<s.length;){i+=e;var n=t(s[i]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(e){var s,i,o=this.findHighlightableChoices();return 0===arguments.length?n(o.filter(".select2-highlighted")[0],o.get()):(e>=o.length&&(e=o.length-1),0>e&&(e=0),this.removeHighlight(),s=t(o[e]),s.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",s.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),i=s.data("select2-data"),void(i&&this.opts.element.trigger({type:"select2-highlight",val:this.id(i),choice:i})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(e){var s=t(e.target).closest(".select2-result-selectable");if(s.length>0&&!s.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(s))}else 0==s.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var t,e=this.results,s=e.find("li.select2-more-results"),i=this.resultsPage+1,n=this,o=this.search.val(),a=this.context;0!==s.length&&(t=s.offset().top-e.offset().top-e.height(),t<=this.opts.loadMorePadding&&(s.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:a,matcher:this.opts.matcher,callback:this.bind(function(t){n.opened()&&(n.opts.populateResults.call(this,e,t.results,{term:o,page:i,context:a}),n.postprocessResults(t,!1,!1),t.more===!0?(s.detach().appendTo(e).html(n.opts.escapeMarkup(T(n.opts.formatLoadMore,n.opts.element,i+1))),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):s.remove(),n.positionDropdown(),n.resultsPage=i,n.context=t.context,this.opts.element.trigger({type:"select2-loaded",items:t}))})})))},tokenize:function(){},updateResults:function(s){function i(){l.removeClass("select2-active"),d.positionDropdown()}function n(t){h.html(t),i()}var o,r,c,l=this.search,h=this.results,u=this.opts,d=this,p=l.val(),f=t.data(this.container,"select2-last-term");if((s===!0||!f||!a(p,f))&&(t.data(this.container,"select2-last-term",p),s===!0||this.showSearchInput!==!1&&this.opened())){c=++this.queryCount;var g=this.getMaximumSelectionSize();if(g>=1&&(o=this.data(),t.isArray(o)&&o.length>=g&&x(u.formatSelectionTooBig,"formatSelectionTooBig")))return void n("<li class='select2-selection-limit'>"+T(u.formatSelectionTooBig,u.element,g)+"</li>");if(l.val().length<u.minimumInputLength)return n(x(u.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+T(u.formatInputTooShort,u.element,l.val(),u.minimumInputLength)+"</li>":""),void(s&&this.showSearch&&this.showSearch(!0));if(u.maximumInputLength&&l.val().length>u.maximumInputLength)return void n(x(u.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+T(u.formatInputTooLong,u.element,l.val(),u.maximumInputLength)+"</li>":"");u.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+T(u.formatSearching,u.element)+"</li>"),l.addClass("select2-active"),this.removeHighlight(),r=this.tokenize(),r!=e&&null!=r&&l.val(r),this.resultsPage=1,u.query({element:u.element,term:l.val(),page:this.resultsPage,context:null,matcher:u.matcher,callback:this.bind(function(o){var r;if(c==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(o.hasError!==e&&x(u.formatAjaxError,"formatAjaxError"))return void n("<li class='select2-ajax-error'>"+T(u.formatAjaxError,u.element,o.jqXHR,o.textStatus,o.errorThrown)+"</li>");if(this.context=o.context===e?null:o.context,this.opts.createSearchChoice&&""!==l.val()&&(r=this.opts.createSearchChoice.call(d,l.val(),o.results),r!==e&&null!==r&&d.id(r)!==e&&null!==d.id(r)&&0===t(o.results).filter(function(){
return a(d.id(this),d.id(r))}).length&&this.opts.createSearchChoicePosition(o.results,r)),0===o.results.length&&x(u.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+T(u.formatNoMatches,u.element,l.val())+"</li>"),void this.showSearch(l.val());h.empty(),d.opts.populateResults.call(this,h,o.results,{term:l.val(),page:this.resultsPage,context:null}),o.more===!0&&x(u.formatLoadMore,"formatLoadMore")&&(h.append("<li class='select2-more-results'>"+u.escapeMarkup(T(u.formatLoadMore,u.element,this.resultsPage))+"</li>"),window.setTimeout(function(){d.loadMoreIfNeeded()},10)),this.postprocessResults(o,s),i(),this.opts.element.trigger({type:"select2-loaded",items:o})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.opts.shouldFocusInput(this)&&p(this.search)},selectHighlighted:function(t){if(this._touchMoved)return void this.clearTouchMoved();var e=this.highlight(),s=this.results.find(".select2-highlighted"),i=s.closest(".select2-result").data("select2-data");i?(this.highlight(e),this.onSelect(i,t)):t&&t.noFocus&&this.close()},getPlaceholder:function(){var t;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((t=this.getPlaceholderOption())!==e?t.text():e)},getPlaceholderOption:function(){if(this.select){var s=this.select.children("option").first();if(this.opts.placeholderOption!==e)return"first"===this.opts.placeholderOption&&s||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===t.trim(s.text())&&""===s.val())return s}},initContainerWidth:function(){function e(){var e,s,i,n,o,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(e=this.opts.element.attr("style"),"string"==typeof e)for(s=e.split(";"),n=0,o=s.length;o>n;n+=1)if(a=s[n].replace(/\s/g,""),i=a.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==i&&i.length>=1)return i[1];return"resolve"===this.opts.width?(e=this.opts.element.css("width"),e.indexOf("%")>0?e:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return t.isFunction(this.opts.width)?this.opts.width():this.opts.width}var s=e.call(this);null!==s&&this.container.css("width",s)},stripRestrictedClasses:function(t){return"undefined"!=typeof t?t.replace(this.opts.restrictedClasses,""):t}}),R=k(A,{createContainer:function(){var e=t(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return e},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var e,s,i;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),e=this.search.get(0),e.createTextRange?(s=e.createTextRange(),s.collapse(!1),s.select()):e.setSelectionRange&&(i=this.search.val().length,e.setSelectionRange(i,i))),this.prefillNextSearchTerm(),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(t.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){t("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),I.call(this,"selection","focusser")},initContainer:function(){var e,i,n=this.container,o=this.dropdown,a=H();this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=e=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),e.find(".select2-chosen").attr("id","select2-chosen-"+a),this.focusser.attr("aria-labelledby","select2-chosen-"+a),this.results.attr("id","select2-results-"+a),this.search.attr("aria-owns","select2-results-"+a),this.focusser.attr("id","s2id_autogen"+a),i=t("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.focusser.prev().text(i.text()).attr("for",this.focusser.attr("id"));var r=this.opts.element.attr("title");this.opts.element.attr("title",r||i.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(t("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()&&229!=t.keyCode){if(t.which===z.PAGE_UP||t.which===z.PAGE_DOWN)return void g(t);switch(t.which){case z.UP:case z.DOWN:return this.moveHighlight(t.which===z.UP?-1:1),void g(t);case z.ENTER:return this.selectHighlighted(),void g(t);case z.TAB:return void this.selectHighlighted({noFocus:!0});case z.ESC:return this.cancel(t),void g(t)}}})),this.search.on("blur",this.bind(function(t){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.results&&this.results.length>1&&this.focusSearch()}),0)})),this.focusser.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()&&t.which!==z.TAB&&!z.isControl(t)&&!z.isFunctionKey(t)&&t.which!==z.ESC){if(this.opts.openOnEnter===!1&&t.which===z.ENTER)return void g(t);if(t.which==z.DOWN||t.which==z.UP||t.which==z.ENTER&&this.opts.openOnEnter){if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey)return;return this.open(),void g(t)}return t.which==z.DELETE||t.which==z.BACKSPACE?(this.opts.allowClear&&this.clear(),void g(t)):void 0}})),l(this.focusser),this.focusser.on("keyup-change input",this.bind(function(t){if(this.opts.minimumResultsForSearch>=0){if(t.stopPropagation(),this.opened())return;this.open()}})),e.on("mousedown touchstart","abbr",this.bind(function(t){this.isInterfaceEnabled()&&(this.clear(),m(t),this.close(),this.selection&&this.selection.focus())})),e.on("mousedown touchstart",this.bind(function(i){s(e),this.container.hasClass("select2-container-active")||this.opts.element.trigger(t.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),g(i)})),o.on("mousedown touchstart",this.bind(function(){this.focusSearch()})),e.on("focus",this.bind(function(t){g(t)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(t.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(t.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(t.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(e){var s=this.selection.data("select2-data");if(s){var i=t.Event("select2-clearing");if(this.opts.element.trigger(i),i.isDefaultPrevented())return;var n=this.getPlaceholderOption();this.opts.element.val(n?n.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),e!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(s),choice:s}),this.triggerChange({removed:s}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var t=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==e&&null!==s&&(t.updateSelection(s),t.close(),t.setPlaceholder(),t.lastSearchTerm=t.search.val())})}},isPlaceholderOptionSelected:function(){var t;return this.getPlaceholder()===e?!1:(t=this.getPlaceholderOption())!==e&&t.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===e||null===this.opts.element.val()},prepareOpts:function(){var e=this.parent.prepareOpts.apply(this,arguments),s=this;return"select"===e.element.get(0).tagName.toLowerCase()?e.initSelection=function(t,e){var i=t.find("option").filter(function(){return this.selected&&!this.disabled});e(s.optionToData(i))}:"data"in e&&(e.initSelection=e.initSelection||function(s,i){var n=s.val(),o=null;e.query({matcher:function(t,s,i){var r=a(n,e.id(i));return r&&(o=i),r},callback:t.isFunction(i)?function(){i(o)}:t.noop})}),e},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===e?e:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var t=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&t!==e){if(this.select&&this.getPlaceholderOption()===e)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(t)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(t,e,s){var i=0,n=this;if(this.findHighlightableChoices().each2(function(t,e){return a(n.id(e.data("select2-data")),n.opts.element.val())?(i=t,!1):void 0}),s!==!1&&this.highlight(e===!0&&i>=0?i:0),e===!0){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(O(t.results)>=o)}},showSearch:function(e){this.showSearchInput!==e&&(this.showSearchInput=e,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!e),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!e),t(this.dropdown,this.container).toggleClass("select2-with-searchbox",e))},onSelect:function(t,e){if(this.triggerSelect(t)){var s=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(t)),this.updateSelection(t),this.opts.element.trigger({type:"select2-selected",val:this.id(t),choice:t}),this.lastSearchTerm=this.search.val(),this.close(),e&&e.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),a(s,this.id(t))||this.triggerChange({added:t,removed:i})}},updateSelection:function(t){var s,i,n=this.selection.find(".select2-chosen");this.selection.data("select2-data",t),n.empty(),null!==t&&(s=this.opts.formatSelection(t,n,this.opts.escapeMarkup)),s!==e&&n.append(s),i=this.opts.formatSelectionCssClass(t,n),i!==e&&n.addClass(i),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==e&&this.container.addClass("select2-allowclear")},val:function(){var t,s=!1,i=null,n=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(t=arguments[0],arguments.length>1&&(s=arguments[1]),this.select)this.select.val(t).find("option").filter(function(){return this.selected}).each2(function(t,e){return i=n.optionToData(e),!1}),this.updateSelection(i),this.setPlaceholder(),s&&this.triggerChange({added:i,removed:o});else{if(!t&&0!==t)return void this.clear(s);if(this.opts.initSelection===e)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(t),this.opts.initSelection(this.opts.element,function(t){n.opts.element.val(t?n.id(t):""),n.updateSelection(t),n.setPlaceholder(),s&&n.triggerChange({added:t,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(t){var s,i=!1;return 0===arguments.length?(s=this.selection.data("select2-data"),s==e&&(s=null),s):(arguments.length>1&&(i=arguments[1]),void(t?(s=this.data(),this.opts.element.val(t?this.id(t):""),this.updateSelection(t),i&&this.triggerChange({added:t,removed:s})):this.clear(i)))}}),D=k(A,{createContainer:function(){var e=t(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return e},prepareOpts:function(){var e=this.parent.prepareOpts.apply(this,arguments),s=this;return"select"===e.element.get(0).tagName.toLowerCase()?e.initSelection=function(t,e){var i=[];t.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(t,e){i.push(s.optionToData(e))}),e(i)}:"data"in e&&(e.initSelection=e.initSelection||function(s,i){var n=r(s.val(),e.separator,e.transformVal),o=[];e.query({matcher:function(s,i,r){var c=t.grep(n,function(t){return a(t,e.id(r))}).length;return c&&o.push(r),c},callback:t.isFunction(i)?function(){for(var t=[],s=0;s<n.length;s++)for(var r=n[s],c=0;c<o.length;c++){var l=o[c];if(a(r,e.id(l))){t.push(l),o.splice(c,1);break}}i(t)}:t.noop})}),e},selectChoice:function(t){var e=this.container.find(".select2-search-choice-focus");e.length&&t&&t[0]==e[0]||(e.length&&this.opts.element.trigger("choice-deselected",e),e.removeClass("select2-search-choice-focus"),t&&t.length&&(this.close(),t.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",t)))},destroy:function(){t("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),I.call(this,"searchContainer","selection")},initContainer:function(){var e,s=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=e=this.container.find(s);var i=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(e){i.search[0].focus(),i.selectChoice(t(this))}),this.search.attr("id","s2id_autogen"+H()),this.search.prev().text(t("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()){++this.keydowns;var s=e.find(".select2-search-choice-focus"),i=s.prev(".select2-search-choice:not(.select2-locked)"),n=s.next(".select2-search-choice:not(.select2-locked)"),o=f(this.search);if(s.length&&(t.which==z.LEFT||t.which==z.RIGHT||t.which==z.BACKSPACE||t.which==z.DELETE||t.which==z.ENTER)){var a=s;return t.which==z.LEFT&&i.length?a=i:t.which==z.RIGHT?a=n.length?n:null:t.which===z.BACKSPACE?this.unselect(s.first())&&(this.search.width(10),a=i.length?i:n):t.which==z.DELETE?this.unselect(s.first())&&(this.search.width(10),a=n.length?n:null):t.which==z.ENTER&&(a=null),this.selectChoice(a),g(t),void(a&&a.length||this.open())}if((t.which===z.BACKSPACE&&1==this.keydowns||t.which==z.LEFT)&&0==o.offset&&!o.length)return this.selectChoice(e.find(".select2-search-choice:not(.select2-locked)").last()),void g(t);if(this.selectChoice(null),this.opened())switch(t.which){case z.UP:case z.DOWN:return this.moveHighlight(t.which===z.UP?-1:1),void g(t);case z.ENTER:return this.selectHighlighted(),void g(t);case z.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case z.ESC:return this.cancel(t),void g(t)}if(t.which!==z.TAB&&!z.isControl(t)&&!z.isFunctionKey(t)&&t.which!==z.BACKSPACE&&t.which!==z.ESC){if(t.which===z.ENTER){if(this.opts.openOnEnter===!1)return;if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey)return}this.open(),(t.which===z.PAGE_UP||t.which===z.PAGE_DOWN)&&g(t),t.which===z.ENTER&&g(t)}}})),this.search.on("keyup",this.bind(function(t){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger(t.Event("select2-blur"))})),this.container.on("click",s,this.bind(function(e){this.isInterfaceEnabled()&&(t(e.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(t.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",s,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(t.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var t=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==e&&null!==s&&(t.updateSelection(s),t.close(),t.clearSearch())})}},clearSearch:function(){var t=this.getPlaceholder(),s=this.getMaxSearchWidth();t!==e&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(t).addClass("select2-default"),this.search.width(s>0?s:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.prefillNextSearchTerm(),this.updateResults(!0),this.focusSearch(),this.opts.element.trigger(t.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.focusSearch()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(e){var s={},i=[],n=this;t(e).each(function(){n.id(this)in s||(s[n.id(this)]=0,i.push(this))}),this.selection.find(".select2-search-choice").remove(),this.addSelectedChoice(i),n.postprocessResults()},tokenize:function(){var t=this.search.val();t=this.opts.tokenizer.call(this,t,this.data(),this.bind(this.onSelect),this.opts),null!=t&&t!=e&&(this.search.val(t),t.length>0&&this.open())},onSelect:function(t,e){this.triggerSelect(t)&&""!==t.text&&(this.addSelectedChoice(t),this.opts.element.trigger({type:"selected",val:this.id(t),choice:t}),this.lastSearchTerm=this.search.val(),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(t,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.prefillNextSearchTerm()&&this.updateResults(),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:t}),e&&e.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(e){var s=this.getVal(),i=this;t(e).each(function(){s.push(i.createChoice(this))}),this.setVal(s)},createChoice:function(s){var i,n,o=!s.locked,a=t("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),r=t("<li class='select2-search-choice select2-locked'><div></div></li>"),c=o?a:r,l=this.id(s);return i=this.opts.formatSelection(s,c.find("div"),this.opts.escapeMarkup),i!=e&&c.find("div").replaceWith(t("<div></div>").html(i)),n=this.opts.formatSelectionCssClass(s,c.find("div")),n!=e&&c.addClass(n),o&&c.find(".select2-search-choice-close").on("mousedown",g).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect(t(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),g(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),c.data("select2-data",s),c.insertBefore(this.searchContainer),l},unselect:function(e){var s,i,o=this.getVal();if(e=e.closest(".select2-search-choice"),0===e.length)throw"Invalid argument: "+e+". Must be .select2-search-choice";if(s=e.data("select2-data")){var a=t.Event("select2-removing");if(a.val=this.id(s),a.choice=s,this.opts.element.trigger(a),a.isDefaultPrevented())return!1;for(;(i=n(this.id(s),o))>=0;)o.splice(i,1),this.setVal(o),this.select&&this.postprocessResults();return e.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(s),choice:s}),this.triggerChange({removed:s}),!0}},postprocessResults:function(t,e,s){var i=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),r=this;o.each2(function(t,e){var s=r.id(e.data("select2-data"));n(s,i)>=0&&(e.addClass("select2-selected"),e.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(t,e){e.is(".select2-result-selectable")||0!==e.find(".select2-result-selectable:not(.select2-selected)").length||e.addClass("select2-selected")}),-1==this.highlight()&&s!==!1&&this.opts.closeOnSelect===!0&&r.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&(!t||t&&!t.more&&0===this.results.find(".select2-no-results").length)&&x(r.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+T(r.opts.formatNoMatches,r.opts.element,r.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-c(this.search)},resizeSearch:function(){var t,e,s,i,n,o=c(this.search);t=v(this.search)+10,e=this.search.offset().left,s=this.selection.width(),i=this.selection.offset().left,n=s-(e-i)-o,t>n&&(n=s-o),40>n&&(n=s-o),0>=n&&(n=t),this.search.width(Math.floor(n))},getVal:function(){var t;return this.select?(t=this.select.val(),null===t?[]:t):(t=this.opts.element.val(),r(t,this.opts.separator,this.opts.transformVal))},setVal:function(e){if(this.select)this.select.val(e);else{var s=[],i={};t(e).each(function(){this in i||(s.push(this),i[this]=0)}),this.opts.element.val(0===s.length?"":s.join(this.opts.separator))}this.opts.element.val(0===distinct.length?"":distinct.join(this.opts.separator))},buildChangeDetails:function(t,e){for(var e=e.slice(0),t=t.slice(0),s=0;s<e.length;s++)for(var i=0;i<t.length;i++)if(a(this.opts.id(e[s]),this.opts.id(t[i]))){e.splice(s,1),s--,t.splice(i,1);break}return{added:e,removed:t}},val:function(s,i){var n,o=this;if(0===arguments.length)return this.getVal();if(n=this.data(),n.length||(n=[]),!s&&0!==s)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:n}));if(this.setVal(s),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(n,this.data()));else{if(this.opts.initSelection===e)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(e){var s=t.map(e,o.id);o.setVal(s),o.updateSelection(e),o.clearSearch(),i&&o.triggerChange(o.buildChangeDetails(n,o.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var e=[],s=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){e.push(s.opts.id(t(this).data("select2-data")))}),this.setVal(e),this.triggerChange()},data:function(e,s){var i,n,o=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return t(this).data("select2-data")}).get():(n=this.data(),e||(e=[]),i=t.map(e,function(t){return o.opts.id(t)}),this.setVal(i),this.updateSelection(e),this.clearSearch(),s&&this.triggerChange(this.buildChangeDetails(n,this.data())),void 0)}}),t.fn.select2=function(){var s,i,o,a,r,c=Array.prototype.slice.call(arguments,0),l=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],h=["opened","isFocused","container","dropdown"],u=["val","data"],d={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])s=0===c.length?{}:t.extend({},c[0]),s.element=t(this),"select"===s.element.get(0).tagName.toLowerCase()?r=s.element.prop("multiple"):(r=s.multiple||!1,"tags"in s&&(s.multiple=r=!0)),i=r?new window.Select2["class"].multi:new window.Select2["class"].single,i.init(s);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(n(c[0],l)<0)throw"Unknown method: "+c[0];if(a=e,i=t(this).data("select2"),i===e)return;if(o=c[0],"container"===o?a=i.container:"dropdown"===o?a=i.dropdown:(d[o]&&(o=d[o]),a=i[o].apply(i,c.slice(1))),n(c[0],h)>=0||n(c[0],u)>=0&&1==c.length)return!1}}),a===e?this:a},t.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,restrictedClasses:/ng-binding|ng-scope/gi,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(t,e,s,i){var n=[];return b(this.text(t),s.term,n,i),n.join("")},transformVal:function(e){return t.trim(e)},formatSelection:function(t,s,i){return t?i(this.text(t)):e},sortResults:function(t,e,s){return t},formatResultCssClass:function(t){return t.css},formatSelectionCssClass:function(t,s){return e},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(t){return t==e?null:t.id},text:function(e){return e&&this.data&&this.data.text?t.isFunction(this.data.text)?this.data.text(e):e[this.data.text]:e.text},matcher:function(t,e){return i(""+e).toUpperCase().indexOf(i(""+t).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:P,escapeMarkup:C,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(t){return t},adaptDropdownCssClass:function(t){return null},nextSearchTerm:function(t,s){return e},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(t){return U?!1:!0}},t.fn.select2.locales=[],t.fn.select2.locales.en={formatMatches:function(t){return 1===t?"One result is available, press enter to select it.":t+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(t,e,s){return"Loading failed"},formatInputTooShort:function(t,e){var s=e-t.length;return"Please enter "+s+" or more character"+(1==s?"":"s")},formatInputTooLong:function(t,e){var s=t.length-e;return"Please delete "+s+" character"+(1==s?"":"s")},formatSelectionTooBig:function(t){return"You can only select "+t+" item"+(1==t?"":"s")},formatLoadMore:function(t){return"Loading more results…"},formatSearching:function(){return"Searching…"}},t.extend(t.fn.select2.defaults,t.fn.select2.locales.en),t.fn.select2.ajaxDefaults={transport:t.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:S,local:y,tags:E},util:{debounce:u,markMatch:b,escapeMarkup:C,stripDiacritics:i},"class":{"abstract":A,single:R,multi:D}}}}(jQuery);