text:  /*
   * # Fomantic UI - 2.8.7
   * https://github.com/fomantic/Fomantic-UI
   * http://fomantic-ui.com/
   *
   * Copyright 2014 Contributors
   * Released under the MIT license
   * http://opensource.org/licenses/MIT
   *
   */
  !function(ee,te,ne,ie){"use strict";ee.isFunction=ee.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},te=void 0!==te&&te.Math==Math?te:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),ee.fn.dropdown=function(U){var B,K=ee(this),W=ee(ne),Q=K.selector||"",Y="ontouchstart"in ne.documentElement,$=Y?"touchstart":"click",X=(new Date).getTime(),G=[],J=U,Z="string"==typeof J,_=[].slice.call(arguments,1);return K.each(function(n){var c,e,t,i,a,o,s,r,l,v=ee.isPlainObject(U)?ee.extend(!0,{},ee.fn.dropdown.settings,U):ee.extend({},ee.fn.dropdown.settings),m=v.className,u=v.message,d=v.fields,f=v.keys,h=v.metadata,g=v.namespace,p=v.regExp,b=v.selector,w=v.error,C=v.templates,x="."+g,y="module-"+g,S=ee(this),A=ee(v.context),T=S.find(b.text),L=S.find(b.search),I=S.find(b.sizer),D=S.find(b.input),k=S.find(b.icon),q=S.find(b.clearIcon),O=0<S.prev().find(b.text).length?S.prev().find(b.text):S.prev(),R=S.children(b.menu),E=R.find(b.item),V=v.hideDividers?E.parent().children(b.divider):ee(),M=!1,z=!1,F=!1,P=!1,N=this,H=S.data(y),j={initialize:function(){j.debug("Initializing dropdown",v),j.is.alreadySetup()?j.setup.reference():(v.ignoreDiacritics&&!String.prototype.normalize&&(v.ignoreDiacritics=!1,j.error(w.noNormalize,N)),j.setup.layout(),v.values&&(j.set.initialLoad(),j.change.values(v.values),j.remove.initialLoad()),j.refreshData(),j.save.defaults(),j.restore.selected(),j.create.id(),j.bind.events(),j.observeChanges(),j.instantiate())},instantiate:function(){j.verbose("Storing instance of dropdown",j),H=j,S.data(y,j)},destroy:function(){j.verbose("Destroying previous dropdown",S),j.remove.tabbable(),j.remove.active(),R.transition("stop all"),R.removeClass(m.visible).addClass(m.hidden),S.off(x).removeData(y),R.off(x),W.off(a),j.disconnect.menuObserver(),j.disconnect.selectObserver(),j.disconnect.classObserver()},observeChanges:function(){"MutationObserver"in te&&(s=new MutationObserver(j.event.select.mutation),r=new MutationObserver(j.event.menu.mutation),l=new MutationObserver(j.event.class.mutation),j.debug("Setting up mutation observer",s,r,l),j.observe.select(),j.observe.menu(),j.observe.class())},disconnect:{menuObserver:function(){r&&r.disconnect()},selectObserver:function(){s&&s.disconnect()},classObserver:function(){l&&l.disconnect()}},observe:{select:function(){j.has.input()&&s&&s.observe(S[0],{childList:!0,subtree:!0})},menu:function(){j.has.menu()&&r&&r.observe(R[0],{childList:!0,subtree:!0})},class:function(){j.has.search()&&l&&l.observe(S[0],{attributes:!0})}},create:{id:function(){o=(Math.random().toString(16)+"000000000").substr(2,8),a="."+o,j.verbose("Creating unique id for element",o)},userChoice:function(e){var n,i;return!!(e=e||j.get.userValues())&&(e=Array.isArray(e)?e:[e],ee.each(e,function(e,t){!1===j.get.item(t)&&(i=v.templates.addition(j.add.variables(u.addResult,t)),i=ee("<div />").html(i).attr("data-"+h.value,t).attr("data-"+h.text,t).addClass(m.addition).addClass(m.item),v.hideAdditions&&i.addClass(m.hidden),n=n===ie?i:n.add(i),j.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=j.get.userValues();t&&(j.debug("Adding user labels",t),ee.each(t,function(e,t){j.verbose("Adding custom user value"),j.add.label(t,t)}))},menu:function(){R=ee("<div />").addClass(m.menu).appendTo(S)},sizer:function(){I=ee("<span />").addClass(m.sizer).insertAfter(L)}},search:function(e){e=e!==ie?e:j.get.query(),j.verbose("Searching for query",e),j.has.minCharacters(e)?j.filter(e):j.hide(null,!0)},select:{firstUnfiltered:function(){j.verbose("Selecting first non-filtered element"),j.remove.selectedItem(),E.not(b.unselectable).not(b.addition+b.hidden).eq(0).addClass(m.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(b.item).not(b.unselectable).eq(0),e=e.prevAll(b.item).not(b.unselectable).eq(0);0<t.length?(j.verbose("Moving selection to",t),t.addClass(m.selected)):(j.verbose("Moving selection to",e),e.addClass(m.selected))}},setup:{api:function(){var e={debug:v.debug,urlData:{value:j.get.value(),query:j.get.query()},on:!1};j.verbose("First request, initializing API"),S.api(e)},layout:function(){S.is("select")&&(j.setup.select(),j.setup.returnedObject()),j.has.menu()||j.create.menu(),j.is.selection()&&j.is.clearable()&&!j.has.clearItem()&&(j.verbose("Adding clear icon"),q=ee("<i />").addClass("remove icon").insertBefore(T)),j.is.search()&&!j.has.search()&&(j.verbose("Adding search input"),L=ee("<input />").addClass(m.search).prop("autocomplete","off").insertBefore(T)),j.is.multiple()&&j.is.searchSelection()&&!j.has.sizer()&&j.create.sizer(),v.allowTab&&j.set.tabbable()},select:function(){var e=j.get.selectValues();j.debug("Dropdown initialized on a select",e),0<(D=S.is("select")?S:D).parent(b.dropdown).length?(j.debug("UI dropdown already exists. Creating dropdown menu only"),S=D.closest(b.dropdown),j.has.menu()||j.create.menu(),R=S.children(b.menu),j.setup.menu(e)):(j.debug("Creating entire dropdown from select"),S=ee("<div />").attr("class",D.attr("class")).addClass(m.selection).addClass(m.dropdown).html(C.dropdown(e,d,v.preserveHTML,v.className)).insertBefore(D),D.hasClass(m.multiple)&&!1===D.prop("multiple")&&(j.error(w.missingMultiple),D.prop("multiple",!0)),D.is("[multiple]")&&j.set.multiple(),D.prop("disabled")&&(j.debug("Disabling dropdown"),S.addClass(m.disabled)),D.removeAttr("required").removeAttr("class").detach().prependTo(S)),j.refresh()},menu:function(e){R.html(C.menu(e,d,v.preserveHTML,v.className)),E=R.find(b.item),V=v.hideDividers?E.parent().children(b.divider):ee()},reference:function(){j.debug("Dropdown behavior was called on select, replacing with closest dropdown"),S=S.parent(b.dropdown),H=S.data(y),N=S.get(0),j.refresh(),j.setup.returnedObject()},returnedObject:function(){var e=K.slice(0,n),t=K.slice(n+1);K=e.add(S).add(t)}},refresh:function(){j.refreshSelectors(),j.refreshData()},refreshItems:function(){E=R.find(b.item),V=v.hideDividers?E.parent().children(b.divider):ee()},refreshSelectors:function(){j.verbose("Refreshing selector cache"),T=S.find(b.text),L=S.find(b.search),D=S.find(b.input),k=S.find(b.icon),O=0<S.prev().find(b.text).length?S.prev().find(b.text):S.prev(),R=S.children(b.menu),E=R.find(b.item),V=v.hideDividers?E.parent().children(b.divider):ee()},refreshData:function(){j.verbose("Refreshing cached metadata"),E.removeData(h.text).removeData(h.value)},clearData:function(){j.verbose("Clearing metadata"),E.removeData(h.text).removeData(h.value),S.removeData(h.defaultText).removeData(h.defaultValue).removeData(h.placeholderText)},toggle:function(){j.verbose("Toggling menu visibility"),j.is.active()?j.hide():j.show()},show:function(e,t){if(e=ee.isFunction(e)?e:function(){},!j.can.show()&&j.is.remote()&&(j.debug("No API results retrieved, searching before show"),j.queryRemote(j.get.query(),j.show)),j.can.show()&&!j.is.active()){if(j.debug("Showing dropdown"),!j.has.message()||j.has.maxSelections()||j.has.allResultsFiltered()||j.remove.message(),j.is.allFiltered())return!0;!1!==v.onShow.call(N)&&j.animate.show(function(){j.can.click()&&j.bind.intent(),j.has.search()&&!t&&j.focusSearch(),j.set.visible(),e.call(N)})}},hide:function(e,t){e=ee.isFunction(e)?e:function(){},j.is.active()&&!j.is.animatingOutward()?(j.debug("Hiding dropdown"),!1!==v.onHide.call(N)&&j.animate.hide(function(){j.remove.visible(),j.is.focusedOnSearch()&&!0!==t&&L.blur(),e.call(N)})):j.can.click()&&j.unbind.intent(),P=!1},hideOthers:function(){j.verbose("Finding other dropdowns to hide"),K.not(S).has(b.menu+"."+m.visible).dropdown("hide")},hideMenu:function(){j.verbose("Hiding menu  instantaneously"),j.remove.active(),j.remove.visible(),R.transition("hide")},hideSubMenus:function(){var e=R.children(b.item).find(b.menu);j.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){j.bind.keyboardEvents(),j.bind.inputEvents(),j.bind.mouseEvents()},keyboardEvents:function(){j.verbose("Binding keyboard events"),S.on("keydown"+x,j.event.keydown),j.has.search()&&S.on(j.get.inputEvent()+x,b.search,j.event.input),j.is.multiple()&&W.on("keydown"+a,j.event.document.keydown)},inputEvents:function(){j.verbose("Binding input change events"),S.on("change"+x,b.input,j.event.change)},mouseEvents:function(){j.verbose("Binding mouse events"),j.is.multiple()&&S.on($+x,b.label,j.event.label.click).on($+x,b.remove,j.event.remove.click),j.is.searchSelection()?(S.on("mousedown"+x,j.event.mousedown).on("mouseup"+x,j.event.mouseup).on("mousedown"+x,b.menu,j.event.menu.mousedown).on("mouseup"+x,b.menu,j.event.menu.mouseup).on($+x,b.icon,j.event.icon.click).on($+x,b.clearIcon,j.event.clearIcon.click).on("focus"+x,b.search,j.event.search.focus).on($+x,b.search,j.event.search.focus).on("blur"+x,b.search,j.event.search.blur).on($+x,b.text,j.event.text.focus),j.is.multiple()&&S.on($+x,j.event.click)):("click"==v.on?S.on($+x,b.icon,j.event.icon.click).on($+x,j.event.test.toggle):"hover"==v.on?S.on("mouseenter"+x,j.delay.show).on("mouseleave"+x,j.delay.hide):S.on(v.on+x,j.toggle),S.on("mousedown"+x,j.event.mousedown).on("mouseup"+x,j.event.mouseup).on("focus"+x,j.event.focus).on($+x,b.clearIcon,j.event.clearIcon.click),j.has.menuSearch()?S.on("blur"+x,b.search,j.event.search.blur):S.on("blur"+x,j.event.blur)),R.on((Y?"touchstart":"mouseenter")+x,b.item,j.event.item.mouseenter).on("mouseleave"+x,b.item,j.event.item.mouseleave).on("click"+x,b.item,j.event.item.click)},intent:function(){j.verbose("Binding hide intent event to document"),Y&&W.on("touchstart"+a,j.event.test.touch).on("touchmove"+a,j.event.test.touch),W.on($+a,j.event.test.hide)}},unbind:{intent:function(){j.verbose("Removing hide intent event from document"),Y&&W.off("touchstart"+a).off("touchmove"+a),W.off($+a)}},filter:function(e){function t(){j.is.multiple()&&j.filterActive(),(e||!e&&0==j.get.activeItem().length)&&j.select.firstUnfiltered(),j.has.allResultsFiltered()?v.onNoResults.call(N,n)?v.allowAdditions?v.hideAdditions&&(j.verbose("User addition with no menu, setting empty style"),j.set.empty(),j.hideMenu()):(j.verbose("All items filtered, showing message",n),j.add.message(u.noResults)):(j.verbose("All items filtered, hiding dropdown",n),j.hideMenu()):(j.remove.empty(),j.remove.message()),v.allowAdditions&&j.add.userSuggestion(j.escape.htmlEntities(e)),j.is.searchSelection()&&j.can.show()&&j.is.focusedOnSearch()&&j.show()}var n=e!==ie?e:j.get.query();v.useLabels&&j.has.maxSelections()||(v.apiSettings?j.can.useAPI()?j.queryRemote(n,function(){v.filterRemoteData&&j.filterItems(n);var e=D.val();Array.isArray(e)||(e=e&&""!==e?e.split(v.delimiter):[]),ee.each(e,function(e,t){E.filter('[data-value="'+t+'"]').addClass(m.filtered)}),t()}):j.error(w.noAPI):(j.filterItems(n),t()))},queryRemote:function(e,n){e={errorDuration:!1,cache:"local",throttle:v.throttle,urlData:{query:e},onError:function(){j.add.message(u.serverError),n()},onFailure:function(){j.add.message(u.serverError),n()},onSuccess:function(e){var t=e[d.remoteValues];Array.isArray(t)||(t=[]),j.remove.message();e={};e[d.values]=t,j.setup.menu(e),0!==t.length||v.allowAdditions||j.add.message(u.noResults),n()}};S.api("get request")||j.setup.api(),e=ee.extend(!0,{},e,v.apiSettings),S.api("setting",e).api("query")},filterItems:function(e){var n=j.remove.diacritics(e!==ie?e:j.get.query()),i=null,t=j.escape.string(n),e=(v.ignoreSearchCase?"i":"")+"gm",a=new RegExp("^"+t,e);j.has.query()&&(i=[],j.verbose("Searching for matching values",n),E.each(function(){var e,t=ee(this);if(t.hasClass(m.unfilterable))return i.push(this),!0;if("both"===v.match||"text"===v.match){if(-1!==(e=j.remove.diacritics(String(j.get.choiceText(t,!1)))).search(a))return i.push(this),!0;if("exact"===v.fullTextSearch&&j.exactSearch(n,e))return i.push(this),!0;if(!0===v.fullTextSearch&&j.fuzzySearch(n,e))return i.push(this),!0}return("both"===v.match||"value"===v.match)&&(-1!==(e=j.remove.diacritics(String(j.get.choiceValue(t,e)))).search(a)||"exact"===v.fullTextSearch&&j.exactSearch(n,e)||!0===v.fullTextSearch&&j.fuzzySearch(n,e))?(i.push(this),!0):void 0})),j.debug("Showing only matched items",n),j.remove.filteredItem(),i&&E.not(i).addClass(m.filtered),j.has.query()?!0===v.hideDividers?V.addClass(m.hidden):"empty"===v.hideDividers&&V.removeClass(m.hidden).filter(function(){var e=ee(this).nextUntil(b.item);return 0===(e.length?e:ee(this)).nextUntil(b.divider).filter(b.item+":not(."+m.filtered+")").length}).addClass(m.hidden):V.removeClass(m.hidden)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=v.ignoreSearchCase?e.toLowerCase():e,t=v.ignoreSearchCase?t.toLowerCase():t,n<i)return!1;if(i===n)return e===t;e:for(var a=0,o=0;a<i;a++){for(var s=e.charCodeAt(a);o<n;)if(t.charCodeAt(o++)===s)continue e;return!1}return!0},exactSearch:function(e,t){return e=v.ignoreSearchCase?e.toLowerCase():e,-1<(t=v.ignoreSearchCase?t.toLowerCase():t).indexOf(e)},filterActive:function(){v.useLabels&&E.filter("."+m.active).addClass(m.filtered)},focusSearch:function(e){j.has.search()&&!j.is.focusedOnSearch()&&(e?(S.off("focus"+x,b.search),L.focus(),S.on("focus"+x,b.search,j.event.search.focus)):L.focus())},blurSearch:function(){j.has.search()&&L.blur()},forceSelection:function(){var e=E.not(m.filtered).filter("."+m.selected).eq(0),t=E.not(m.filtered).filter("."+m.active).eq(0),e=0<e.length?e:t,t=0<e.length;v.allowAdditions||t&&!j.is.multiple()?(j.debug("Forcing partial selection to selected item",e),j.event.item.click.call(e,{},!0)):j.remove.searchTerm()},change:{values:function(e){v.allowAdditions||j.clear(),j.debug("Creating dropdown with specified values",e);var t={};t[d.values]=e,j.setup.menu(t),ee.each(e,function(e,t){if(1==t.selected&&(j.debug("Setting initial selection to",t[d.value]),j.set.selected(t[d.value]),!j.is.multiple()))return!1}),j.has.selectInput()&&(j.disconnect.selectObserver(),D.html(""),D.append("<option disabled selected value></option>"),ee.each(e,function(e,t){var n=v.templates.deQuote(t[d.value]),t=v.templates.escape(t[d.name]||"",v.preserveHTML);D.append('<option value="'+n+'">'+t+"</option>")}),j.observe.select())}},event:{change:function(){F||(j.debug("Input changed, updating selection"),j.set.selected())},focus:function(){v.showOnFocus&&!M&&j.is.hidden()&&!t&&j.show()},blur:function(e){t=ne.activeElement===this,M||t||(j.remove.activeLabel(),j.hide())},mousedown:function(){j.is.searchSelection()?i=!0:M=!0},mouseup:function(){j.is.searchSelection()?i=!1:M=!1},click:function(e){ee(e.target).is(S)&&(j.is.focusedOnSearch()?j.show():j.focusSearch())},search:{focus:function(e){M=!0,j.is.multiple()&&j.remove.activeLabel(),(v.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)&&j.search()},blur:function(e){t=ne.activeElement===this,j.is.searchSelection()&&!i&&(z||t||(v.forceSelection?j.forceSelection():v.allowAdditions||j.remove.searchTerm(),j.hide())),i=!1}},clearIcon:{click:function(e){j.clear(),j.is.searchSelection()&&j.remove.searchTerm(),j.hide(),e.stopPropagation()}},icon:{click:function(e){P=!0,j.has.search()?j.is.active()?j.blurSearch():v.showOnFocus?j.focusSearch():j.toggle():j.toggle()}},text:{focus:function(e){M=!0,j.focusSearch()}},input:function(e){(j.is.multiple()||j.is.searchSelection())&&j.set.filtered(),clearTimeout(j.timer),j.timer=setTimeout(j.search,v.delay.search)},label:{click:function(e){var t=ee(this),n=S.find(b.label),i=n.filter("."+m.active),a=t.nextAll("."+m.active),o=t.prevAll("."+m.active),o=(0<a.length?t.nextUntil(a):t.prevUntil(o)).add(i).add(t);e.shiftKey?(i.removeClass(m.active),o.addClass(m.active)):e.ctrlKey?t.toggleClass(m.active):(i.removeClass(m.active),t.addClass(m.active)),v.onLabelSelect.apply(this,n.filter("."+m.active))}},remove:{click:function(){var e=ee(this).parent();e.hasClass(m.active)?j.remove.activeLabels():j.remove.activeLabels(e)}},test:{toggle:function(e){var t=j.is.multiple()?j.show:j.toggle;j.is.bubbledLabelClick(e)||j.is.bubbledIconClick(e)||j.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){j.determine.eventOnElement(e,function(){"touchstart"==e.type?j.timer=setTimeout(function(){j.hide()},v.delay.touch):"touchmove"==e.type&&clearTimeout(j.timer)}),e.stopPropagation()},hide:function(e){j.determine.eventInModule(e,j.hide)&&N.id&&ee(e.target).attr("for")===N.id&&e.preventDefault()}},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&j.check.disabled()})}},select:{mutation:function(e){j.debug("<select> modified, recreating menu"),j.is.selectMutation(e)&&(j.disconnect.selectObserver(),j.refresh(),j.setup.select(),j.set.selected(),j.observe.select())}},menu:{mutation:function(e){var t=e[0],e=t.addedNodes?ee(t.addedNodes[0]):ee(!1),t=t.removedNodes?ee(t.removedNodes[0]):ee(!1),e=e.add(t),t=e.is(b.addition)||0<e.closest(b.addition).length,e=e.is(b.message)||0<e.closest(b.message).length;t||e?(j.debug("Updating item selector cache"),j.refreshItems()):(j.debug("Menu modified, updating selector cache"),j.refresh())},mousedown:function(){z=!0},mouseup:function(){z=!1}},item:{mouseenter:function(e){var t=ee(e.target),n=ee(this),i=n.children(b.menu),a=n.siblings(b.item).children(b.menu),n=0<i.length;0<i.find(t).length||!n||(clearTimeout(j.itemTimer),j.itemTimer=setTimeout(function(){j.verbose("Showing sub-menu",i),ee.each(a,function(){j.animate.hide(!1,ee(this))}),j.animate.show(!1,i)},v.delay.show),e.preventDefault())},mouseleave:function(e){var t=ee(this).children(b.menu);0<t.length&&(clearTimeout(j.itemTimer),j.itemTimer=setTimeout(function(){j.verbose("Hiding sub-menu",t),j.animate.hide(!1,t)},v.delay.hide))},click:function(e,t){var n=ee(this),i=ee(e?e.target:""),a=n.find(b.menu),o=j.get.choiceText(n),s=j.get.choiceValue(n,o),e=0<a.length,i=0<a.find(i).length;"input"!==ne.activeElement.tagName.toLowerCase()&&ee(ne.activeElement).blur(),i||e&&!v.allowCategorySelection||(j.is.searchSelection()&&(v.allowAdditions&&j.remove.userAddition(),j.remove.searchTerm(),j.is.focusedOnSearch()||1==t||j.focusSearch(!0)),v.useLabels||(j.remove.filteredItem(),j.set.scrollPosition(n)),j.determine.selectAction.call(this,o,s))}},document:{keydown:function(e){var t,n,i,a,o,s,r,l,c,u,d,v=e.which;j.is.inObject(v,f)&&((n=(t=S.find(b.label)).filter("."+m.active)).data(h.value),u=t.index(n),d=t.length,i=0<n.length,a=1<n.length,o=0===u,s=u+1==d,r=j.is.searchSelection(),l=j.is.focusedOnSearch(),c=j.is.focused(),d=(u=l&&0===j.get.caretPosition(!1))&&0!==j.get.caretPosition(!0),r&&!i&&!l||(v==f.leftArrow?!c&&!u||i?i&&(e.shiftKey?j.verbose("Adding previous label to selection"):(j.verbose("Selecting previous label"),t.removeClass(m.active)),o&&!a?n.addClass(m.active):n.prev(b.siblingLabel).addClass(m.active).end(),e.preventDefault()):(j.verbose("Selecting previous label"),t.last().addClass(m.active)):v==f.rightArrow?(c&&!i&&t.first().addClass(m.active),i&&(e.shiftKey?j.verbose("Adding next label to selection"):(j.verbose("Selecting next label"),t.removeClass(m.active)),s?r?l?t.removeClass(m.active):j.focusSearch():(a?n.next(b.siblingLabel):n).addClass(m.active):n.next(b.siblingLabel).addClass(m.active),e.preventDefault())):v==f.deleteKey||v==f.backspace?i?(j.verbose("Removing active labels"),s&&r&&!l&&j.focusSearch(),n.last().next(b.siblingLabel).addClass(m.active),j.remove.activeLabels(n),e.preventDefault()):!u||d||i||v!=f.backspace||(j.verbose("Removing last label on input backspace"),n=t.last().addClass(m.active),j.remove.activeLabels(n)):n.removeClass(m.active)))}},keydown:function(e){var t=e.which;if(j.is.inObject(t,f)){var n,i=E.not(b.unselectable).filter("."+m.selected).eq(0),a=R.children("."+m.active).eq(0),o=0<i.length?i:a,s=0<o.length?o.siblings(":not(."+m.filtered+")").addBack():R.children(":not(."+m.filtered+")"),r=o.children(b.menu),l=o.closest(b.menu),c=l.hasClass(m.visible)||l.hasClass(m.animating)||0<l.parent(b.menu).length,u=0<r.length,d=0<o.length,i=0<o.not(b.unselectable).length,a=t==f.delimiter&&v.allowAdditions&&j.is.multiple();if(v.allowAdditions&&v.hideAdditions&&(t==f.enter||a)&&i&&(j.verbose("Selecting item from keyboard shortcut",o),j.event.item.click.call(o,e),j.is.searchSelection()&&j.remove.searchTerm(),j.is.multiple()&&e.preventDefault()),j.is.visible()){if(t!=f.enter&&!a||(t==f.enter&&d&&u&&!v.allowCategorySelection?(j.verbose("Pressed enter on unselectable category, opening sub menu"),t=f.rightArrow):i&&(j.verbose("Selecting item from keyboard shortcut",o),j.event.item.click.call(o,e),j.is.searchSelection()&&(j.remove.searchTerm(),j.is.multiple()&&L.focus())),e.preventDefault()),d&&(t==f.leftArrow&&l[0]!==R[0]&&(j.verbose("Left key pressed, closing sub-menu"),j.animate.hide(!1,l),o.removeClass(m.selected),l.closest(b.item).addClass(m.selected),e.preventDefault()),t==f.rightArrow&&u&&(j.verbose("Right key pressed, opening sub-menu"),j.animate.show(!1,r),o.removeClass(m.selected),r.find(b.item).eq(0).addClass(m.selected),e.preventDefault())),t==f.upArrow){if(n=(d&&c?o.prevAll(b.item+":not("+b.unselectable+")"):E).eq(0),s.index(n)<0)return j.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();j.verbose("Up key pressed, changing active item"),o.removeClass(m.selected),n.addClass(m.selected),j.set.scrollPosition(n),v.selectOnKeydown&&j.is.single()&&j.set.selectedItem(n),e.preventDefault()}if(t==f.downArrow){if(0===(n=(d&&c?o.nextAll(b.item+":not("+b.unselectable+")"):E).eq(0)).length)return j.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();j.verbose("Down key pressed, changing active item"),E.removeClass(m.selected),n.addClass(m.selected),j.set.scrollPosition(n),v.selectOnKeydown&&j.is.single()&&j.set.selectedItem(n),e.preventDefault()}t==f.pageUp&&(j.scrollPage("up"),e.preventDefault()),t==f.pageDown&&(j.scrollPage("down"),e.preventDefault()),t==f.escape&&(j.verbose("Escape key pressed, closing dropdown"),j.hide())}else a&&e.preventDefault(),t!=f.downArrow||j.is.visible()||(j.verbose("Down key pressed, showing dropdown"),j.show(),e.preventDefault())}else j.has.search()||j.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var e,t=D[0];t&&(e=ne.createEvent("HTMLEvents"),j.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},determine:{selectAction:function(e,t){c=!0,j.verbose("Determining action",v.action),ee.isFunction(j.action[v.action])?(j.verbose("Triggering preset action",v.action,e,t),j.action[v.action].call(N,e,t,this)):ee.isFunction(v.action)?(j.verbose("Triggering user action",v.action,e,t),v.action.call(N,e,t,this)):j.error(w.action,v.action),c=!1},eventInModule:function(e,t){var n=ee(e.target),e=0<n.closest(ne.documentElement).length,n=0<n.closest(S).length;return t=ee.isFunction(t)?t:function(){},e&&!n?(j.verbose("Triggering event",t),t(),!0):(j.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(e,t){var n=ee(e.target),i=n.closest(b.siblingLabel),e=ne.body.contains(e.target),i=0===S.find(i).length||!(j.is.multiple()&&v.useLabels),n=0===n.closest(R).length;return t=ee.isFunction(t)?t:function(){},e&&i&&n?(j.verbose("Triggering event",t),t(),!0):(j.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(e,t,n){t=t!==ie?t:e,j.can.activate(ee(n))&&(j.set.selected(t,ee(n)),j.is.multiple()||j.hideAndClear())},select:function(e,t,n){t=t!==ie?t:e,j.can.activate(ee(n))&&(j.set.value(t,e,ee(n)),j.is.multiple()||j.hideAndClear())},combo:function(e,t,n){t=t!==ie?t:e,j.set.selected(t,ee(n)),j.hideAndClear()},hide:function(e,t,n){j.set.value(t,e,ee(n)),j.hideAndClear()}},get:{id:function(){return o},defaultText:function(){return S.data(h.defaultText)},defaultValue:function(){return S.data(h.defaultValue)},placeholderText:function(){return"auto"!=v.placeholder&&"string"==typeof v.placeholder?v.placeholder:S.data(h.placeholderText)||""},text:function(){return v.preserveHTML?T.html():T.text()},query:function(){return String(L.val()).trim()},searchWidth:function(e){return e=e!==ie?e:L.val(),I.text(e),Math.ceil(I.width()+1)},selectionCount:function(){var e=j.get.values();return j.is.multiple()?Array.isArray(e)?e.length:0:""!==j.get.value()?1:0},transition:function(e){return"auto"==v.transition?j.is.upward(e)?"slide up":"slide down":v.transition},userValues:function(){var e=j.get.values();return!!e&&(e=Array.isArray(e)?e:[e],ee.grep(e,function(e){return!1===j.get.item(e)}))},uniqueArray:function(n){return ee.grep(n,function(e,t){return ee.inArray(e,n)===t})},caretPosition:function(e){var t,n,i=L.get(0);return e&&"selectionEnd"in i?i.selectionEnd:!e&&"selectionStart"in i?i.selectionStart:ne.selection?(i.focus(),n=(t=ne.selection.createRange()).text.length,e?n:(t.moveStart("character",-i.value.length),t.text.length-n)):void 0},value:function(){var e=0<D.length?D.val():S.data(h.value),t=Array.isArray(e)&&1===e.length&&""===e[0];return e===ie||t?"":e},values:function(){var e=j.get.value();return""===e?"":!j.has.selectInput()&&j.is.multiple()?"string"==typeof e?j.escape.htmlEntities(e).split(v.delimiter):"":e},remoteValues:function(){var e=j.get.values(),i=!1;return e&&("string"==typeof e&&(e=[e]),ee.each(e,function(e,t){var n=j.read.remoteData(t);j.verbose("Restoring value from session data",n,t),n&&((i=i||{})[t]=n)})),i},choiceText:function(e,t){if(t=t!==ie?t:v.preserveHTML,e)return 0<e.find(b.menu).length&&(j.verbose("Retrieving text of element with sub-menu"),(e=e.clone()).find(b.menu).remove(),e.find(b.menuIcon).remove()),e.data(h.text)!==ie?e.data(h.text):(t?e.html():e.text()).trim()},choiceValue:function(e,t){return t=t||j.get.choiceText(e),!!e&&(e.data(h.value)!==ie?String(e.data(h.value)):"string"==typeof t?String(v.ignoreSearchCase?t.toLowerCase():t).trim():String(t))},inputEvent:function(){var e=L[0];return!!e&&(e.oninput!==ie?"input":e.onpropertychange!==ie?"propertychange":"keyup")},selectValues:function(){var o={},s=[],r=[];return S.find("option").each(function(){var e=ee(this),t=e.html(),n=e.attr("disabled"),i=e.attr("value")!==ie?e.attr("value"):t,a=e.data(h.text)!==ie?e.data(h.text):t,e=e.parent("optgroup");"auto"===v.placeholder&&""===i?o.placeholder=t:(e.length===s.length&&e[0]===s[0]||(r.push({type:"header",divider:v.headerDivider,name:e.attr("label")||""}),s=e),r.push({name:t,value:i,text:a,disabled:n}))}),v.placeholder&&"auto"!==v.placeholder&&(j.debug("Setting placeholder value to",v.placeholder),o.placeholder=v.placeholder),v.sortSelect?(!0===v.sortSelect?r.sort(function(e,t){return e.name.localeCompare(t.name)}):"natural"===v.sortSelect?r.sort(function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}):ee.isFunction(v.sortSelect)&&r.sort(v.sortSelect),o[d.values]=r,j.debug("Retrieved and sorted values from select",o)):(o[d.values]=r,j.debug("Retrieved values from select",o)),o},activeItem:function(){return E.filter("."+m.active)},selectedItem:function(){var e=E.not(b.unselectable).filter("."+m.selected);return 0<e.length?e:E.eq(0)},itemWithAdditions:function(e){var t=j.get.item(e),e=j.create.userChoice(e);return t=e&&0<e.length?0<t.length?t.add(e):e:t},item:function(n,i){var e,a,o=!1;return n=n!==ie?n:j.get.values()!==ie?j.get.values():j.get.text(),e=(a=j.is.multiple()&&Array.isArray(n))?0<n.length:n!==ie&&null!==n,i=""===n||!1===n||!0===n||(i||!1),e&&E.each(function(){var e=ee(this),t=j.get.choiceText(e),t=j.get.choiceValue(e,t);if(null!==t&&t!==ie)if(a)-1!==ee.inArray(j.escape.htmlEntities(String(t)),n.map(function(e){return String(e)}))&&(o=o?o.add(e):e);else if(i){if(j.verbose("Ambiguous dropdown value using strict type check",e,n),t===n)return o=e,!0}else if(v.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase()),j.escape.htmlEntities(String(t))===j.escape.htmlEntities(String(n)))return j.verbose("Found select item by value",t,n),o=e,!0}),o}},check:{maxSelections:function(e){return!v.maxSelections||((e=e!==ie?e:j.get.selectionCount())>=v.maxSelections?(j.debug("Maximum selection count reached"),v.useLabels&&(E.addClass(m.filtered),j.add.message(u.maxSelections)),!0):(j.verbose("No longer at maximum selection count"),j.remove.message(),j.remove.filteredItem(),j.is.searchSelection()&&j.filterItems(),!1))},disabled:function(){L.attr("tabindex",j.is.disabled()?-1:0)}},restore:{defaults:function(e){j.clear(e),j.restore.defaultText(),j.restore.defaultValue()},defaultText:function(){var e=j.get.defaultText();e===j.get.placeholderText?(j.debug("Restoring default placeholder text",e),j.set.placeholderText(e)):(j.debug("Restoring default text",e),j.set.text(e))},placeholderText:function(){j.set.placeholderText()},defaultValue:function(){var e=j.get.defaultValue();e!==ie&&(j.debug("Restoring default value",e),""!==e?(j.set.value(e),j.set.selected()):(j.remove.activeItem(),j.remove.selectedItem()))},labels:function(){v.allowAdditions&&(v.useLabels||(j.error(w.labels),v.useLabels=!0),j.debug("Restoring selected values"),j.create.userLabels()),j.check.maxSelections()},selected:function(){j.restore.values(),j.is.multiple()?(j.debug("Restoring previously selected values and labels"),j.restore.labels()):j.debug("Restoring previously selected values")},values:function(){j.set.initialLoad(),v.apiSettings&&v.saveRemoteData&&j.get.remoteValues()?j.restore.remoteValues():j.set.selected();var e=j.get.value();!e||""===e||Array.isArray(e)&&0===e.length?D.addClass(m.noselection):D.removeClass(m.noselection),j.remove.initialLoad()},remoteValues:function(){var e=j.get.remoteValues();j.debug("Recreating selected from session data",e),e&&(j.is.single()?ee.each(e,function(e,t){j.set.text(t)}):ee.each(e,function(e,t){j.add.label(e,t)}))}},read:{remoteData:function(e){if(te.Storage!==ie)return(e=sessionStorage.getItem(e))!==ie&&e;j.error(w.noStorage)}},save:{defaults:function(){j.save.defaultText(),j.save.placeholderText(),j.save.defaultValue()},defaultValue:function(){var e=j.get.value();j.verbose("Saving default value as",e),S.data(h.defaultValue,e)},defaultText:function(){var e=j.get.text();j.verbose("Saving default text as",e),S.data(h.defaultText,e)},placeholderText:function(){var e;!1!==v.placeholder&&T.hasClass(m.placeholder)&&(e=j.get.text(),j.verbose("Saving placeholder text as",e),S.data(h.placeholderText,e))},remoteData:function(e,t){te.Storage!==ie?(j.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t,e)):j.error(w.noStorage)}},clear:function(e){j.is.multiple()&&v.useLabels?j.remove.labels():(j.remove.activeItem(),j.remove.selectedItem(),j.remove.filteredItem()),j.set.placeholderText(),j.clearValue(e)},clearValue:function(e){j.set.value("",null,null,e)},scrollPage:function(e,t){var n=t||j.get.selectedItem(),i=n.closest(b.menu),a=i.outerHeight(),o=i.scrollTop(),t=E.eq(0).outerHeight(),a=Math.floor(a/t),o=(i.prop("scrollHeight"),"up"==e?o-t*a:o+t*a),t=E.not(b.unselectable),a="up"==e?t.index(n)-a:t.index(n)+a,t=("up"==e?0<=a:a<t.length)?t.eq(a):"up"==e?t.first():t.last();0<t.length&&(j.debug("Scrolling page",e,t),n.removeClass(m.selected),t.addClass(m.selected),v.selectOnKeydown&&j.is.single()&&j.set.selectedItem(t),i.scrollTop(o))},set:{filtered:function(){var e=j.is.multiple(),t=j.is.searchSelection(),n=e&&t,i=t?j.get.query():"",a="string"==typeof i&&0<i.length,t=j.get.searchWidth(),i=""!==i;e&&a&&(j.verbose("Adjusting input width",t,v.glyphWidth),L.css("width",t)),a||n&&i?(j.verbose("Hiding placeholder text"),T.addClass(m.filtered)):e&&(!n||i)||(j.verbose("Showing placeholder text"),T.removeClass(m.filtered))},empty:function(){S.addClass(m.empty)},loading:function(){S.addClass(m.loading)},placeholderText:function(e){e=e||j.get.placeholderText(),j.debug("Setting placeholder text",e),j.set.text(e),T.addClass(m.placeholder)},tabbable:function(){j.is.searchSelection()?(j.debug("Added tabindex to searchable dropdown"),L.val(""),j.check.disabled(),R.attr("tabindex",-1)):(j.debug("Added tabindex to dropdown"),S.attr("tabindex")===ie&&(S.attr("tabindex",0),R.attr("tabindex",-1)))},initialLoad:function(){j.verbose("Setting initial load"),e=!0},activeItem:function(e){v.allowAdditions&&0<e.filter(b.addition).length?e.addClass(m.filtered):e.addClass(m.active)},partialSearch:function(e){var t=j.get.query().length;L.val(e.substr(0,t))},scrollPosition:function(e,t){var n,i,a=(e=e||j.get.selectedItem()).closest(b.menu),o=e&&0<e.length;t=t!==ie&&t,0===j.get.activeItem().length&&(t=!1),e&&0<a.length&&o&&(e.position().top,a.addClass(m.loading),e=(o=a.scrollTop())-a.offset().top+e.offset().top,t||(i=o+a.height()<e+5,n=e-5<o),j.debug("Scrolling to active item",e),(t||n||i)&&a.scrollTop(e),a.removeClass(m.loading))},text:function(e){"combo"===v.action?(j.debug("Changing combo button text",e,O),v.preserveHTML?O.html(e):O.text(e)):"activate"===v.action&&(e!==j.get.placeholderText()&&T.removeClass(m.placeholder),j.debug("Changing text",e,T),T.removeClass(m.filtered),v.preserveHTML?T.html(e):T.text(e))},selectedItem:function(e){var t=j.get.choiceValue(e),n=j.get.choiceText(e,!1),i=j.get.choiceText(e,!0);j.debug("Setting user selection to item",e),j.remove.activeItem(),j.set.partialSearch(n),j.set.activeItem(e),j.set.selected(t,e),j.set.text(i)},selectedLetter:function(e){var t=E.filter("."+m.selected),n=0<t.length&&j.has.firstLetter(t,e),i=!1;n&&(n=t.nextAll(E).eq(0),j.has.firstLetter(n,e)&&(i=n)),i||E.each(function(){if(j.has.firstLetter(ee(this),e))return i=ee(this),!1}),i&&(j.verbose("Scrolling to next value with letter",e),j.set.scrollPosition(i),t.removeClass(m.selected),i.addClass(m.selected),v.selectOnKeydown&&j.is.single()&&j.set.selectedItem(i))},direction:function(e){"auto"==v.direction?(e?j.is.upward(e)&&j.remove.upward(e):j.remove.upward(),(j.can.openDownward(e)?j.remove:j.set).upward(e),j.is.leftward(e)||j.can.openRightward(e)||j.set.leftward(e)):"upward"==v.direction&&j.set.upward(e)},upward:function(e){(e||S).addClass(m.upward)},leftward:function(e){(e||R).addClass(m.leftward)},value:function(e,t,n,i){e===ie||""===e||Array.isArray(e)&&0===e.length?D.addClass(m.noselection):D.removeClass(m.noselection);var a=j.escape.value(e),o=0<D.length,s=j.get.values(),r=e!==ie?String(e):e;if(o){if(!v.allowReselection&&r==s&&(j.verbose("Skipping value update already same value",e,s),!j.is.initialLoad()))return;j.is.single()&&j.has.selectInput()&&j.can.extendSelect()&&(j.debug("Adding user option",e),j.add.optionValue(e)),j.debug("Updating input value",a,s),F=!0,D.val(a),!1===v.fireOnInit&&j.is.initialLoad()?j.debug("Input native change event ignored on initial load"):!0!==i&&j.trigger.change(),F=!1}else j.verbose("Storing value in metadata",a,D),a!==s&&S.data(h.value,r);!1===v.fireOnInit&&j.is.initialLoad()?j.verbose("No callback on initial load",v.onChange):!0!==i&&v.onChange.call(N,e,t,n)},active:function(){S.addClass(m.active)},multiple:function(){S.addClass(m.multiple)},visible:function(){S.addClass(m.visible)},exactly:function(e,t){j.debug("Setting selected to exact values"),j.clear(),j.set.selected(e,t)},selected:function(e,r){var l=j.is.multiple();(r=v.allowAdditions?r||j.get.itemWithAdditions(e):r||j.get.item(e))&&(j.debug("Setting selected menu item to",r),j.is.multiple()&&j.remove.searchWidth(),j.is.single()?(j.remove.activeItem(),j.remove.selectedItem()):v.useLabels&&j.remove.selectedItem(),r.each(function(){var e=ee(this),t=j.get.choiceText(e),n=j.get.choiceValue(e,t),i=e.hasClass(m.filtered),a=e.hasClass(m.active),o=e.hasClass(m.addition),s=l&&1==r.length;l?!a||o?(v.apiSettings&&v.saveRemoteData&&j.save.remoteData(t,n),v.useLabels?(j.add.label(n,t,s),j.add.value(n,t,e),j.set.activeItem(e),j.filterActive(),j.select.nextAvailable(r)):(j.add.value(n,t,e),j.set.text(j.add.variables(u.count)),j.set.activeItem(e))):i||!v.useLabels&&!c||(j.debug("Selected active value, removing label"),j.remove.selected(n)):(v.apiSettings&&v.saveRemoteData&&j.save.remoteData(t,n),j.set.text(t),j.set.value(n,t,e),e.addClass(m.active).addClass(m.selected))}),j.remove.searchTerm())}},add:{label:function(e,t,n){var i,a=j.is.searchSelection()?L:T,o=j.escape.value(e);v.ignoreCase&&(o=o.toLowerCase()),i=ee("<a />").addClass(m.label).attr("data-"+h.value,o).html(C.label(o,t,v.preserveHTML,v.className)),i=v.onLabelCreate.call(i,o,t),j.has.label(e)?j.debug("User selection already exists, skipping",o):(v.label.variation&&i.addClass(v.label.variation),!0===n?(j.debug("Animating in label",i),i.addClass(m.hidden).insertBefore(a).transition({animation:v.label.transition,debug:v.debug,verbose:v.verbose,duration:v.label.duration})):(j.debug("Adding selection label",i),i.insertBefore(a)))},message:function(e){var t=R.children(b.message),e=v.templates.message(j.add.variables(e));0<t.length?t.html(e):t=ee("<div/>").html(e).addClass(m.message).appendTo(R)},optionValue:function(e){var t=j.escape.value(e);0<D.find('option[value="'+j.escape.string(t)+'"]').length||(j.disconnect.selectObserver(),j.is.single()&&(j.verbose("Removing previous user addition"),D.find("option."+m.addition).remove()),ee("<option/>").prop("value",t).addClass(m.addition).html(e).appendTo(D),j.verbose("Adding user addition as an <option>",e),j.observe.select())},userSuggestion:function(e){var t=R.children(b.addition),n=j.get.item(e),i=n&&n.not(b.addition).length,n=0<t.length;v.useLabels&&j.has.maxSelections()||(""===e||i?t.remove():(n?(t.data(h.value,e).data(h.text,e).attr("data-"+h.value,e).attr("data-"+h.text,e).removeClass(m.filtered),v.hideAdditions||(n=v.templates.addition(j.add.variables(u.addResult,e)),t.html(n)),j.verbose("Replacing user suggestion with new value",t)):((t=j.create.userChoice(e)).prependTo(R),j.verbose("Adding item choice to menu corresponding with user choice addition",t)),v.hideAdditions&&!j.is.allFiltered()||t.addClass(m.selected).siblings().removeClass(m.selected),j.refreshItems()))},variables:function(e,t){var n,i=-1!==e.search("{count}"),a=-1!==e.search("{maxCount}"),o=-1!==e.search("{term}");return j.verbose("Adding templated variables to message",e),i&&(n=j.get.selectionCount(),e=e.replace("{count}",n)),a&&(n=j.get.selectionCount(),e=e.replace("{maxCount}",v.maxSelections)),o&&(t=t||j.get.query(),e=e.replace("{term}",t)),e},value:function(e,t,n){var i,a=j.get.values();j.has.value(e)?j.debug("Value already selected"):""!==e?(i=Array.isArray(a)?(i=a.concat([e]),j.get.uniqueArray(i)):[e],j.has.selectInput()?j.can.extendSelect()&&(j.debug("Adding value to select",e,i,D),j.add.optionValue(e)):(i=i.join(v.delimiter),j.debug("Setting hidden input to delimited value",i,D)),!1===v.fireOnInit&&j.is.initialLoad()?j.verbose("Skipping onadd callback on initial load",v.onAdd):v.onAdd.call(N,e,t,n),j.set.value(i,t,n),j.check.maxSelections()):j.debug("Cannot select blank values from multiselect")}},remove:{active:function(){S.removeClass(m.active)},activeLabel:function(){S.find(b.label).removeClass(m.active)},empty:function(){S.removeClass(m.empty)},loading:function(){S.removeClass(m.loading)},initialLoad:function(){e=!1},upward:function(e){(e||S).removeClass(m.upward)},leftward:function(e){(e||R).removeClass(m.leftward)},visible:function(){S.removeClass(m.visible)},activeItem:function(){E.removeClass(m.active)},filteredItem:function(){v.useLabels&&j.has.maxSelections()||((v.useLabels&&j.is.multiple()?E.not("."+m.active):E).removeClass(m.filtered),v.hideDividers&&V.removeClass(m.hidden),j.remove.empty())},optionValue:function(e){var t=j.escape.value(e),e=D.find('option[value="'+j.escape.string(t)+'"]');0<e.length&&e.hasClass(m.addition)&&(s&&(s.disconnect(),j.verbose("Temporarily disconnecting mutation observer")),e.remove(),j.verbose("Removing user addition as an <option>",t),s&&s.observe(D[0],{childList:!0,subtree:!0}))},message:function(){R.children(b.message).remove()},searchWidth:function(){L.css("width","")},searchTerm:function(){j.verbose("Cleared search term"),L.val(""),j.set.filtered()},userAddition:function(){E.filter(b.addition).remove()},selected:function(e,t){if(!(t=v.allowAdditions?t||j.get.itemWithAdditions(e):t||j.get.item(e)))return!1;t.each(function(){var e=ee(this),t=j.get.choiceText(e),n=j.get.choiceValue(e,t);j.is.multiple()?v.useLabels?(j.remove.value(n,t,e),j.remove.label(n)):(j.remove.value(n,t,e),0===j.get.selectionCount()?j.set.placeholderText():j.set.text(j.add.variables(u.count))):j.remove.value(n,t,e),e.removeClass(m.filtered).removeClass(m.active),v.useLabels&&e.removeClass(m.selected)})},selectedItem:function(){E.removeClass(m.selected)},value:function(e,t,n){var i,a=j.get.values();e=j.escape.htmlEntities(e),j.has.selectInput()?(j.verbose("Input is <select> removing selected option",e),i=j.remove.arrayValue(e,a),j.remove.optionValue(e)):(j.verbose("Removing from delimited values",e),i=(i=j.remove.arrayValue(e,a)).join(v.delimiter)),!1===v.fireOnInit&&j.is.initialLoad()?j.verbose("No callback on initial load",v.onRemove):v.onRemove.call(N,e,t,n),j.set.value(i,t,n),j.check.maxSelections()},arrayValue:function(t,e){return Array.isArray(e)||(e=[e]),e=ee.grep(e,function(e){return t!=e}),j.verbose("Removed value from delimited string",t,e),e},label:function(e,t){e=S.find(b.label).filter("[data-"+h.value+'="'+j.escape.string(v.ignoreCase?e.toLowerCase():e)+'"]');j.verbose("Removing label",e),e.remove()},activeLabels:function(e){e=e||S.find(b.label).filter("."+m.active),j.verbose("Removing active label selections",e),j.remove.labels(e)},labels:function(e){e=e||S.find(b.label),j.verbose("Removing labels",e),e.each(function(){var e=ee(this),t=e.data(h.value),n=t!==ie?String(t):t,i=j.is.userValue(n);!1!==v.onLabelRemove.call(e,t)?(j.remove.message(),i?(j.remove.value(n),j.remove.label(n)):j.remove.selected(n)):j.debug("Label remove callback cancelled removal")})},tabbable:function(){j.is.searchSelection()?(j.debug("Searchable dropdown initialized"),L.removeAttr("tabindex")):(j.debug("Simple selection dropdown initialized"),S.removeAttr("tabindex")),R.removeAttr("tabindex")},diacritics:function(e){return v.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},has:{menuSearch:function(){return j.has.search()&&0<L.closest(R).length},clearItem:function(){return 0<q.length},search:function(){return 0<L.length},sizer:function(){return 0<I.length},selectInput:function(){return D.is("select")},minCharacters:function(e){return v.minCharacters&&!P?(e=e!==ie?String(e):String(j.get.query())).length>=v.minCharacters:!(P=!1)},firstLetter:function(e,t){return!(!e||0===e.length||"string"!=typeof t)&&(e=j.get.choiceText(e,!1),(t=t.toLowerCase())==String(e).charAt(0).toLowerCase())},input:function(){return 0<D.length},items:function(){return 0<E.length},menu:function(){return 0<R.length},message:function(){return 0!==R.children(b.message).length},label:function(e){var t=j.escape.value(e),e=S.find(b.label);return v.ignoreCase&&(t=t.toLowerCase()),0<e.filter("[data-"+h.value+'="'+j.escape.string(t)+'"]').length},maxSelections:function(){return v.maxSelections&&j.get.selectionCount()>=v.maxSelections},allResultsFiltered:function(){var e=E.not(b.addition);return e.filter(b.unselectable).length===e.length},userSuggestion:function(){return 0<R.children(b.addition).length},query:function(){return""!==j.get.query()},value:function(e){return v.ignoreCase?j.has.valueIgnoringCase(e):j.has.valueMatchingCase(e)},valueMatchingCase:function(e){var t=j.get.values();return!!(Array.isArray(t)?t&&-1!==ee.inArray(e,t):t==e)},valueIgnoringCase:function(n){var e=j.get.values(),i=!1;return Array.isArray(e)||(e=[e]),ee.each(e,function(e,t){if(String(n).toLowerCase()==String(t).toLowerCase())return!(i=!0)}),i}},is:{active:function(){return S.hasClass(m.active)},animatingInward:function(){return R.transition("is inward")},animatingOutward:function(){return R.transition("is outward")},bubbledLabelClick:function(e){return ee(e.target).is("select, input")&&0<S.closest("label").length},bubbledIconClick:function(e){return 0<ee(e.target).closest(k).length},alreadySetup:function(){return S.is("select")&&S.parent(b.dropdown).data(y)!==ie&&0===S.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):R.transition&&R.transition("is animating")},leftward:function(e){return(e||R).hasClass(m.leftward)},clearable:function(){return S.hasClass(m.clearable)||v.clearable},disabled:function(){return S.hasClass(m.disabled)},focused:function(){return ne.activeElement===S[0]},focusedOnSearch:function(){return ne.activeElement===L[0]},allFiltered:function(){return(j.is.multiple()||j.has.search())&&!(0==v.hideAdditions&&j.has.userSuggestion())&&!j.has.message()&&j.has.allResultsFiltered()},hidden:function(e){return!j.is.visible(e)},initialLoad:function(){return e},inObject:function(n,e){var i=!1;return ee.each(e,function(e,t){if(t==n)return i=!0}),i},multiple:function(){return S.hasClass(m.multiple)},remote:function(){return v.apiSettings&&j.can.useAPI()},single:function(){return!j.is.multiple()},selectMutation:function(e){var n=!1;return ee.each(e,function(e,t){if(ee(t.target).is("select")||ee(t.addedNodes).is("select"))return!(n=!0)}),n},search:function(){return S.hasClass(m.search)},searchSelection:function(){return j.has.search()&&1===L.parent(b.dropdown).length},selection:function(){return S.hasClass(m.selection)},userValue:function(e){return-1!==ee.inArray(e,j.get.userValues())},upward:function(e){return(e||S).hasClass(m.upward)},visible:function(e){return(e||R).hasClass(m.visible)},verticallyScrollableContext:function(){var e=A.get(0)!==te&&A.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=A.get(0)!==te&&A.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!v.useLabels||(!j.has.maxSelections()||!(!j.has.maxSelections()||!e.hasClass(m.active)))},openDownward:function(e){var t,n=e||R,i=!0;return n.addClass(m.loading),e={context:{offset:A.get(0)===te?{top:0,left:0}:A.offset(),scrollTop:A.scrollTop(),height:A.outerHeight()},menu:{offset:n.offset(),height:n.outerHeight()}},j.is.verticallyScrollableContext()&&(e.menu.offset.top+=e.context.scrollTop),i=(t={above:e.context.scrollTop<=e.menu.offset.top-e.context.offset.top-e.menu.height,below:e.context.scrollTop+e.context.height>=e.menu.offset.top-e.context.offset.top+e.menu.height}).below?(j.verbose("Dropdown can fit in context downward",t),!0):t.below||t.above?(j.verbose("Dropdown cannot fit below, opening upward",t),!1):(j.verbose("Dropdown cannot fit in either direction, favoring downward",t),!0),n.removeClass(m.loading),i},openRightward:function(e){var t,n=e||R,i=!0;return n.addClass(m.loading),e={context:{offset:A.get(0)===te?{top:0,left:0}:A.offset(),scrollLeft:A.scrollLeft(),width:A.outerWidth()},menu:{offset:n.offset(),width:n.outerWidth()}},j.is.horizontallyScrollableContext()&&(e.menu.offset.left+=e.context.scrollLeft),(t=e.menu.offset.left-e.context.offset.left+e.menu.width>=e.context.scrollLeft+e.context.width)&&(j.verbose("Dropdown cannot fit in context rightward",t),i=!1),n.removeClass(m.loading),i},click:function(){return Y||"click"==v.on},extendSelect:function(){return v.allowAdditions||v.apiSettings},show:function(){return!j.is.disabled()&&(j.has.items()||j.has.message())},useAPI:function(){return ee.fn.api!==ie}},animate:{show:function(e,t){var n,i=t||R,a=t?function(){}:function(){j.hideSubMenus(),j.hideOthers(),j.set.active()};e=ee.isFunction(e)?e:function(){},j.verbose("Doing menu show animation",i),j.set.direction(t),n=j.get.transition(t),j.is.selection()&&j.set.scrollPosition(j.get.selectedItem(),!0),(j.is.hidden(i)||j.is.animating(i))&&(t=!!S.hasClass("column")&&"flex","none"==n?(a(),i.transition({displayType:t}).transition("show"),e.call(N)):ee.fn.transition!==ie&&S.transition("is supported")?i.transition({animation:n+" in",debug:v.debug,verbose:v.verbose,duration:v.duration,queue:!0,onStart:a,displayType:t,onComplete:function(){e.call(N)}}):j.error(w.noTransition,n))},hide:function(e,t){var n=t||R,i=t?function(){}:function(){j.can.click()&&j.unbind.intent(),j.remove.active()},t=j.get.transition(t);e=ee.isFunction(e)?e:function(){},(j.is.visible(n)||j.is.animating(n))&&(j.verbose("Doing menu hide animation",n),"none"==t?(i(),n.transition("hide"),e.call(N)):ee.fn.transition!==ie&&S.transition("is supported")?n.transition({animation:t+" out",duration:v.duration,debug:v.debug,verbose:v.verbose,queue:!1,onStart:i,onComplete:function(){e.call(N)}}):j.error(w.transition))}},hideAndClear:function(){j.remove.searchTerm(),j.has.maxSelections()||(j.has.search()?j.hide(function(){j.remove.filteredItem()}):j.hide())},delay:{show:function(){j.verbose("Delaying show event to ensure user intent"),clearTimeout(j.timer),j.timer=setTimeout(j.show,v.delay.show)},hide:function(){j.verbose("Delaying hide event to ensure user intent"),clearTimeout(j.timer),j.timer=setTimeout(j.hide,v.delay.hide)}},escape:{value:function(e){var t=Array.isArray(e),n="string"==typeof e,i=!n&&!t,n=n&&-1!==e.search(p.quote),a=[];return i||!n?e:(j.debug("Encoding quote values for use in select",e),t?(ee.each(e,function(e,t){a.push(t.replace(p.quote,"&quot;"))}),a):e.replace(p.quote,"&quot;"))},string:function(e){return(e=String(e)).replace(p.escape,"\\$&")},htmlEntities:function(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return t[e]}):e}},setting:function(e,t){if(j.debug("Changing setting",e,t),ee.isPlainObject(e))ee.extend(!0,v,e);else{if(t===ie)return v[e];ee.isPlainObject(v[e])?ee.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(ee.isPlainObject(e))ee.extend(!0,j,e);else{if(t===ie)return j[e];j[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?j.performance.log(arguments):(j.debug=Function.prototype.bind.call(console.info,console,v.name+":"),j.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?j.performance.log(arguments):(j.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),j.verbose.apply(console,arguments)))},error:function(){v.silent||(j.error=Function.prototype.bind.call(console.error,console,v.name+":"),j.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(X||t),X=t,G.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:N,"Execution Time":n})),clearTimeout(j.performance.timer),j.performance.timer=setTimeout(j.performance.display,500)},display:function(){var e=v.name+":",n=0;X=!1,clearTimeout(j.performance.timer),ee.each(G,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",Q&&(e+=" '"+Q+"'"),(console.group!==ie||console.table!==ie)&&0<G.length&&(console.groupCollapsed(e),console.table?console.table(G):ee.each(G,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),G=[]}},invoke:function(i,e,t){var a,o,n,s=H;return e=e||_,t=N||t,"string"==typeof i&&s!==ie&&(i=i.split(/[\. ]/),a=i.length-1,ee.each(i,function(e,t){var n=e!=a?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(ee.isPlainObject(s[n])&&e!=a)s=s[n];else{if(s[n]!==ie)return o=s[n],!1;{if(!ee.isPlainObject(s[t])||e==a)return s[t]!==ie?o=s[t]:j.error(w.method,i),!1;s=s[t]}}})),ee.isFunction(o)?n=o.apply(t,e):o!==ie&&(n=o),Array.isArray(B)?B.push(n):B!==ie?B=[B,n]:n!==ie&&(B=n),o}};Z?(H===ie&&j.initialize(),j.invoke(J)):(H!==ie&&H.invoke("destroy"),j.initialize())}),B!==ie?B:K},ee.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:te,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,ignoreDiacritics:!1,hideDividers:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,ignoreSearchCase:!0,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,headerDivider:!0,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(e,t){return ee(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text",type:"type",image:"image",imageClass:"imageClass",icon:"icon",iconClass:"iconClass",class:"class",divider:"divider"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",divider:".divider, .header",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> span.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered",clearIcon:"> .remove.icon"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",icon:"icon",image:"image",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",leftward:"left",visible:"visible",clearable:"clearable",noselection:"noselection",delete:"delete",header:"header",divider:"divider",groupIcon:"",unfilterable:"unfilterable"}},ee.fn.dropdown.settings.templates={deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&amp;")).replace(/[<>"'`]/g,function(e){return n[e]}):e},dropdown:function(e,t,n,i){var a=e.placeholder||!1,o="",s=ee.fn.dropdown.settings.templates.escape;return o+='<i class="dropdown icon"></i>',o+=a?'<div class="default text">'+s(a,n)+"</div>":'<div class="text"></div>',o+='<div class="'+i.menu+'">',o+=ee.fn.dropdown.settings.templates.menu(e,t,n,i),o+="</div>"},menu:function(e,o,s,r){var e=e[o.values]||[],l="",c=ee.fn.dropdown.settings.templates.escape,u=ee.fn.dropdown.settings.templates.deQuote;return ee.each(e,function(e,t){var n,i,a=t[o.type]||"item";"item"===a?(i=t[o.text]?' data-text="'+u(t[o.text])+'"':"",n=t[o.disabled]?r.disabled+" ":"",l+='<div class="'+n+(t[o.class]?u(t[o.class]):r.item)+'" data-value="'+u(t[o.value])+'"'+i+">",t[o.image]&&(l+='<img class="'+(t[o.imageClass]?u(t[o.imageClass]):r.image)+'" src="'+u(t[o.image])+'">'),t[o.icon]&&(l+='<i class="'+u(t[o.icon])+" "+(t[o.iconClass]?u(t[o.iconClass]):r.icon)+'"></i>'),l+=c(t[o.name]||"",s),l+="</div>"):"header"===a&&(i=c(t[o.name]||"",s),a=t[o.icon]?u(t[o.icon]):r.groupIcon,""===i&&""===a||(l+='<div class="'+(t[o.class]?u(t[o.class]):r.header)+'">',""!==a&&(l+='<i class="'+a+" "+(t[o.iconClass]?u(t[o.iconClass]):r.icon)+'"></i>'),l+=i,l+="</div>"),t[o.divider]&&(l+='<div class="'+r.divider+'"></div>'))}),l},label:function(e,t,n,i){return(0,ee.fn.dropdown.settings.templates.escape)(t,n)+'<i class="'+i.delete+' icon"></i>'},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document);