!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,o,a,h,r,i,g,f,m,y,v,w,s,l,C;return e&&e.requirejs||(e?o=e:e={},m={},y={},v={},w={},s=Object.prototype.hasOwnProperty,l=[].slice,C=/\.js$/,g=function(e,t){var n,o=u(e),a=o[0],r=t[1];return e=o[1],a&&(n=b(a=c(a,r))),a?e=n&&n.normalize?n.normalize(e,function(t){return function(e){return c(e,t)}}(r)):c(e,r):(a=(o=u(e=c(e,r)))[0],e=o[1],a&&(n=b(a))),{f:a?a+"!"+e:e,n:e,pr:a,p:n}},f={require:function(e){return x(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function(e){return function(){return v&&v.config&&v.config[e]||{}}}(e)}}},r=function(e,t,n,o){var a,r,i,s,l,c,u,d=[],p=typeof n;if(c=A(o=o||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},a.appendMany=function(e,t){if("1.7"===r.fn.jquery.substr(0,3)){var n=r();r.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},a.__cache={};var n=0;return a.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},a.StoreData=function(e,t,n){var o=a.GetUniqueElementId(e);a.__cache[o]||(a.__cache[o]={}),a.__cache[o][t]=n},a.GetData=function(e,t){var n=a.GetUniqueElementId(e);return t?a.__cache[n]&&null!=a.__cache[n][t]?a.__cache[n][t]:r(e).data(t):a.__cache[n]},a.RemoveData=function(e){var t=a.GetUniqueElementId(e);null!=a.__cache[t]&&delete a.__cache[t]},a}),e.define("select2/results",["jquery","./utils"],function(p,h){function o(e,t,n){this.$element=e,this.data=n,this.options=t,o.__super__.constructor.call(this)}return h.Extend(o,h.Observable),o.prototype.render=function(){var e=p('');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},o.prototype.clear=function(){this.$results.empty()},o.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=p('
  • '),o=this.options.get("translations").get(e.message);n.append(t(o(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},o.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},o.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});d.append(s),r.append(i),r.append(d)}else this.template(e,t);return h.StoreData(t,"data",e),t},o.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=h.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var o=n-1;0===e.length&&(o=0);var a=t.eq(o);a.trigger("mouseenter");var r=l.$results.offset().top,i=a.offset().top,s=l.$results.scrollTop()+(i-r);0===o?l.$results.scrollTop(0):i-r<0&&l.$results.scrollTop(s)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var o=t.eq(n);o.trigger("mouseenter");var a=l.$results.offset().top+l.$results.outerHeight(!1),r=o.offset().top+o.outerHeight(!1),i=l.$results.scrollTop()+r-a;0===n?l.$results.scrollTop(0):athis.$results.outerHeight()||r<0)&&this.$results.scrollTop(a)}},o.prototype.template=function(e,t){var n=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),a=n(e,t);null==a?t.style.display="none":"string"==typeof a?t.innerHTML=o(a):p(t).append(a)},o}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,o,a){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return o.Extend(r,o.Observable),r.prototype.render=function(){var e=n('');return this._tabindex=0,null!=o.GetData(this.$element[0],"old-tabindex")?this._tabindex=o.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e},r.prototype.bind=function(e,t){var n=this,o=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===a.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",o),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.focus(),window.setTimeout(function(){n.$selection.focus()},0),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){n(this),this!=t[0]&&o.GetData(this,"element").select2("close")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,o){function a(){a.__super__.constructor.apply(this,arguments)}return n.Extend(a,t),a.prototype.render=function(){var e=a.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},a.prototype.bind=function(t,e){var n=this;a.__super__.bind.apply(this,arguments);var o=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",o).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",o),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()})},a.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},a.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},a.prototype.selectionContainer=function(){return e("")},a.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),o=this.display(t,n);n.empty().append(o),n.attr("title",t.title||t.text)}else this.clear()},a}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,e,s){function n(e,t){n.__super__.constructor.apply(this,arguments)}return s.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
      '),e},n.prototype.bind=function(e,t){var o=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!o.options.get("disabled")){var t=a(this).parent(),n=s.GetData(t[0],"data");o.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return a('
    • ×
    • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');s.StoreData(n[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(n)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(o,i,s){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=o('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===s.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,o,a){var r=this;this.current(function(e){var t=null!=e?e.length:0;0=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n.call(r,o,a)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(a,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=a('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){a(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),t.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),t.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val(""),o.$search.blur()}),t.on("focus",function(){t.isOpen()||o.$search.focus()}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(o.showSearch(e)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,o){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,o)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),o=t.length-1;0<=o;o--){var a=t[o];this.placeholder.id===a.id&&n.splice(o,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function e(e,t,n,o){this.lastParams={},e.call(this,t,n,o),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("query",function(e){o.lastParams=e,o.loading=!0}),t.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var e=a.contains(document.documentElement,o.$loadingMore[0]);!o.loading&&e&&o.$results.offset().top+o.$results.outerHeight(!1)+50>=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1)&&o.loadMore()})},e.prototype.loadMore=function(){this.loading=!0;var e=a.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=a('
    • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(g,s){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||g(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var o=this,a=!1;e.call(this,t,n),t.on("open",function(){o._showDropdown(),o._attachPositioningHandler(t),a||(a=!0,t.on("results:all",function(){o._positionDropdown(),o._resizeDropdown()}),t.on("results:append",function(){o._positionDropdown(),o._resizeDropdown()}))}),t.on("close",function(){o._hideDropdown(),o._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=g(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,o="scroll.select2."+t.id,a="resize.select2."+t.id,r="orientationchange.select2."+t.id,i=this.$container.parents().filter(s.hasScroll);i.each(function(){s.StoreData(this,"select2-scroll-position",{x:g(this).scrollLeft(),y:g(this).scrollTop()})}),i.on(o,function(e){var t=s.GetData(this,"select2-scroll-position");g(this).scrollTop(t.y)}),g(window).on(o+" "+a+" "+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,o="resize.select2."+t.id,a="orientationchange.select2."+t.id;this.$container.parents().filter(s.hasScroll).off(n),g(window).off(n+" "+o+" "+a)},e.prototype._positionDropdown=function(){var e=g(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),o=null,a=this.$container.offset();a.bottom=a.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=a.top,r.bottom=a.top+r.height;var i=this.$dropdown.outerHeight(!1),s=e.scrollTop(),l=e.scrollTop()+e.height(),c=sa.bottom+i,d={left:a.left,top:r.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(o="below"),u||!c||t?!c&&u&&t&&(o="below"):o="above",("above"==o||t&&"below"!==o)&&(d.top=r.top-h.top-i),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,o){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,o)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,o=0;o');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(i){return{syncCssClasses:function(e,t,n){var o,a,r=[];(o=i.trim(e.attr("class")))&&i((o=""+o).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&r.push(this)}),(o=i.trim(t.attr("class")))&&i((o=""+o).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(a=n(this))&&r.push(a)}),e.attr("class",r.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(i,s){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";i.isFunction(n)&&(n=n(this.$element));var o=this.options.get("adaptContainerCssClass");if(o=o||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var a=o;o=function(e){var t=a(e);return null!=t?t+" "+e:e}}var r=this.options.get("containerCss")||{};return i.isFunction(r)&&(r=r(this.$element)),s.syncCssClasses(t,this.$element,o),t.css(r),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(i,s){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";i.isFunction(n)&&(n=n(this.$element));var o=this.options.get("adaptDropdownCssClass");if(o=o||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var a=o;o=function(e){var t=a(e);return null!=t?t+" "+e:e}}var r=this.options.get("dropdownCss")||{};return i.isFunction(r)&&(r=r(this.$element)),s.syncCssClasses(t,this.$element,o),t.css(r),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(o){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,o.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(i,o){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `