From d6c21ca7128aacb582bff74f6f3e4a47b9227f32 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 5 May 2015 17:35:13 -0400 Subject: [PATCH] Rebuild dropdown dist #2213 --- dist/components/dropdown.js | 2 ++ dist/components/dropdown.min.js | 4 ++-- dist/semantic.js | 2 ++ dist/semantic.min.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/components/dropdown.js b/dist/components/dropdown.js index bae014cc4..585f18393 100644 --- a/dist/components/dropdown.js +++ b/dist/components/dropdown.js @@ -1981,6 +1981,7 @@ $.fn.dropdown = function(parameters) { if($addition.length > 0) { $addition .html(html) + .data(metadata.value, value) .removeClass(className.filtered) .addClass(className.selected) ; @@ -1988,6 +1989,7 @@ $.fn.dropdown = function(parameters) { else { $addition = $('
') .html(html) + .data(metadata.value, value) .addClass(className.addition) .addClass(className.item) .prependTo($menu) diff --git a/dist/components/dropdown.min.js b/dist/components/dropdown.min.js index 2887461db..dbe6ba93d 100644 --- a/dist/components/dropdown.min.js +++ b/dist/components/dropdown.min.js @@ -8,5 +8,5 @@ * http://opensource.org/licenses/MIT * */ -!function(e,t,n,i){"use strict";e.fn.dropdown=function(o){var a,s=e(this),l=e(n),r=s.selector||"",c="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],v=arguments[0],m="string"==typeof v,f=[].slice.call(arguments,1);return s.each(function(){var h,g,p,b,w,C=e.isPlainObject(o)?e.extend(!0,{},e.fn.dropdown.settings,o):e.extend({},e.fn.dropdown.settings),x=C.className,y=C.message,S=C.metadata,T=C.namespace,A=C.regExp,k=C.selector,L=C.error,D=C.templates,q="."+T,E="module-"+T,I=e(this),V=I.find(k.text),O=I.find(k.search),F=I.find(k.input),R=I.find(k.icon),M=I.prev().find(k.text).length>0?I.prev().find(k.text):I.prev(),z=I.children(k.menu),P=z.find(k.item),H=!1,j=!1,U=this,K=I.data(E);w={initialize:function(){w.debug("Initializing dropdown",C),w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),w.save.defaults(),w.set.selected(),w.is.multiple()&&(C.allowAdditions&&(C.useLabels||(w.error(L.labels),C.useLabels=!0),w.create.userLabels()),w.check.maxSelections()),w.create.id(),c&&w.bind.touchEvents(),w.bind.mouseEvents(),w.bind.keyboardEvents(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w),K=w,I.data(E,w)},destroy:function(){w.verbose("Destroying previous dropdown for",I),w.remove.tabbable(),I.off(q).removeData(E),z.off(q),l.off(h),p&&p.disconnect(),b&&b.disconnect()},observeChanges:function(){"MutationObserver"in t&&(p=new MutationObserver(function(e){w.debug("").addClass(x.search).insertBefore(V)),C.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t),I.is("select")&&(F=I),F.parent(k.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),I=F.closest(k.dropdown),z=I.children(k.menu),0===z.length&&(z=e("
").addClass(x.menu).appendTo(I)),z.html(D.menu(t))):(w.debug("Creating entire dropdown from select"),I=e("
").attr("class",F.attr("class")).addClass(x.selection).addClass(x.dropdown).html(D.dropdown(t)).insertBefore(F),F.removeAttr("class").detach().prependTo(I)),F.is("[multiple]")&&w.set.multiple(),w.refresh()},reference:function(){var e,t,n=s.index(I);w.debug("Dropdown behavior was called on select, replacing with closest dropdown"),I=I.parent(k.dropdown),w.refresh(),e=s.slice(0,n),t=s.slice(n+1),s=e.add(I).add(t),m&&(K=w,w.invoke(v))}},refresh:function(){w.verbose("Refreshing selector cache"),V=I.find(k.text),O=I.find(k.search),F=I.find(k.input),R=I.find(k.icon),M=I.prev().find(k.text).length>0?I.prev().find(k.text):I.prev(),z=I.children(k.menu),P=z.find(k.item)},toggle:function(){w.verbose("Toggling menu visibility"),w.is.active()?w.hide():w.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),w.is.multiple()&&!w.has.search()&&w.is.allFiltered())return!0;w.animate.show(function(){w.can.click()&&w.bind.intent(),w.set.visible(),t.call(U)}),C.onShow.call(U)}},hide:function(t){t=e.isFunction(t)?t:function(){},w.is.active()&&(w.debug("Hiding dropdown"),w.animate.hide(function(){w.remove.visible(),t.call(U)}),C.onHide.call(U))},hideOthers:function(){w.verbose("Finding other dropdowns to hide"),s.not(I).has(k.menu+"."+x.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu instantaneously"),w.remove.active(),w.remove.visible(),z.transition("hide")},hideSubMenus:function(){var e=z.children(k.item).find(k.menu);w.verbose("Hiding sub menus",e),e.transition("hide")},bind:{keyboardEvents:function(){w.debug("Binding keyboard events"),I.on("keydown"+q,w.event.keydown),w.has.search()&&I.on(w.get.inputEvent()+q,k.search,w.event.input),w.is.multiple()&&l.on("keydown"+h,w.event.document.keydown)},touchEvents:function(){w.debug("Touch device detected binding additional touch events"),w.is.searchSelection()||I.on("touchstart"+q,w.event.test.toggle),z.on("touchstart"+q,k.item,w.event.item.mouseenter)},mouseEvents:function(){w.debug("Mouse detected binding mouse events"),w.is.multiple()&&I.on("click"+q,k.label,w.event.label.click).on("click"+q,k.remove,w.event.remove.click),w.is.searchSelection()?(I.on("mousedown"+q,k.menu,w.event.menu.mousedown).on("mouseup"+q,k.menu,w.event.menu.mouseup).on("click"+q,k.search,w.show).on("focus"+q,k.search,w.event.search.focus).on("blur"+q,k.search,w.event.search.blur).on("click"+q,k.text,w.event.text.focus),w.is.multiple()&&I.on("click"+q,w.event.click)):("click"==C.on?I.on("click"+q,w.event.test.toggle):"hover"==C.on?I.on("mouseenter"+q,w.delay.show).on("mouseleave"+q,w.delay.hide):I.on(C.on+q,w.toggle),I.on("mousedown"+q,w.event.mousedown).on("mouseup"+q,w.event.mouseup).on("focus"+q,w.event.focus).on("blur"+q,w.event.blur)),z.on("mouseenter"+q,k.item,w.event.item.mouseenter).on("mouseleave"+q,k.item,w.event.item.mouseleave).on("click"+q,k.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document"),c&&l.on("touchstart"+h,w.event.test.touch).on("touchmove"+h,w.event.test.touch),l.on("click"+h,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document"),c&&l.off("touchstart"+h).off("touchmove"+h),l.off("click"+h)}},filter:function(t){var n,o,a=e();t=t!==i?t:w.get.query(),n=w.escape.regExp(t),o=new RegExp("^"+n,"igm"),w.has.maxSelections()||(""===t?a=P:(w.verbose("Searching for matching values",t),P.each(function(){var n,i,s=e(this);if("both"==C.match||"text"==C.match){if(n=String(w.get.choiceText(s,!1)),-1!==n.search(o))return a=a.add(s),!0;if(C.fullTextSearch&&w.fuzzySearch(t,n))return a=a.add(s),!0}if("both"==C.match||"value"==C.match){if(i=String(w.get.choiceValue(s,n)),-1!==i.search(o))return a=a.add(s),!0;if(C.fullTextSearch&&w.fuzzySearch(t,i))return a=a.add(s),!0}})),w.debug("Showing only matched items",t),w.remove.filteredItem(),P.not(a).addClass(x.filtered),w.is.multiple()&&w.filterActive(),w.select.firstUnfiltered(),w.has.allResultsFiltered()?C.onNoResults.call(U,t)?C.allowAdditions||(w.verbose("All items filtered, showing message",t),w.add.message(y.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):w.remove.message())},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var s=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===s)continue e;return!1}return!0},filterActive:function(){C.useLabels&&P.filter("."+x.active).addClass(x.filtered)},focusSearch:function(){w.is.search()&&!w.is.focusedOnSearch()&&O[0].focus()},forceSelection:function(){var e=P.not(x.filtered).filter("."+x.selected).eq(0),t=P.not(x.filtered).filter("."+x.active).eq(0),n=e.length>0?e:t,i=n.size()>0;i?(w.debug("Forcing partial selection to selected item",n),w.event.item.click.call(n),w.remove.filteredItem()):w.hide()},event:{focus:function(){C.showOnFocus&&!H&&w.is.hidden()&&w.show()},click:function(t){var n=e(t.target);!n.is(I)&&!n.is(R)||w.is.focusedOnSearch()||O.focus()},blur:function(e){var t=n.activeElement===this;H||t||(w.remove.activeLabel(),w.hide())},mousedown:function(){H=!0},mouseup:function(){H=!1},search:{focus:function(){H=!0,w.is.multiple()&&w.remove.activeLabel(),C.showOnFocus&&w.show()},blur:function(e){var t=n.activeElement===this;j||t||(w.is.multiple()?(w.remove.activeLabel(),w.hide()):C.forceSelection?w.forceSelection():w.hide())}},text:{focus:function(e){H=!0,O.focus()}},input:function(e){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered(),clearTimeout(w.timer),w.timer=setTimeout(w.search,C.delay.search)},label:{click:function(t){var n=e(this),i=I.find(k.label),o=i.filter("."+x.active),a=n.nextAll("."+x.active),s=n.prevAll("."+x.active),l=a.length>0?n.nextUntil(a).add(o).add(n):n.prevUntil(s).add(o).add(n);t.shiftKey?(o.removeClass(x.active),l.addClass(x.active)):t.ctrlKey?n.toggleClass(x.active):(o.removeClass(x.active),n.addClass(x.active)),C.onLabelSelect.apply(this,i.filter("."+x.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(x.active)?w.remove.labels():w.remove.labels(t)}},test:{toggle:function(e){var t=w.is.multiple()?w.show:w.toggle;w.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){w.determine.eventOnElement(e,function(){"touchstart"==e.type?w.timer=setTimeout(w.hide,C.delay.touch):"touchmove"==e.type&&clearTimeout(w.timer)}),e.stopPropagation()},hide:function(e){w.determine.eventInModule(e,w.hide)}},menu:{mousedown:function(){j=!0},mouseup:function(){j=!1}},item:{mouseenter:function(t){var n=e(this).children(k.menu),i=e(this).siblings(k.item).children(k.menu);n.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",n),e.each(i,function(){w.animate.hide(!1,e(this))}),w.animate.show(!1,n)},C.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(k.menu);n.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",n),w.animate.hide(!1,n)},C.delay.hide))},click:function(t){var n=e(this),i=e(t?t.target:""),o=n.find(k.menu),a=w.get.choiceText(n),s=w.get.choiceValue(n,a),l=o.length>0,r=o.find(i).length>0;r||l&&!C.allowCategorySelection||w.determine.selectAction.call(this,a,s)}},document:{keydown:function(e){var t=e.which,n=w.get.shortcutKeys(),i=w.is.inObject(t,n);if(i){var o=I.find(k.label),a=o.filter("."+x.active),s=(a.data("value"),o.index(a)),l=o.length,r=a.length>0,c=a.length>1,u=0===s,d=s+1==l,v=w.is.searchSelection(),m=w.is.focusedOnSearch(),f=w.is.focused(),h=m&&0===w.get.caretPosition();if(v&&!r&&!m)return;t==n.leftArrow?!f&&!h||r?r&&(e.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),o.removeClass(x.active)),u&&!c?a.addClass(x.active):a.prev(k.siblingLabel).addClass(x.active).end(),e.preventDefault()):(w.verbose("Selecting previous label"),o.last().addClass(x.active)):t==n.rightArrow?(f&&!r&&o.first().addClass(x.active),r&&(e.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),o.removeClass(x.active)),d?v?m?o.removeClass(x.active):w.focusSearch():c?a.next(k.siblingLabel).addClass(x.active):a.addClass(x.active):a.next(k.siblingLabel).addClass(x.active),e.preventDefault())):t==n.deleteKey||t==n.backspace?r?(w.verbose("Removing active labels"),d&&v&&!m&&w.focusSearch(),a.last().next(k.siblingLabel).addClass(x.active),w.remove.labels(a),e.preventDefault()):h&&!r&&t==n.backspace&&(w.verbose("Removing last label on input backspace"),a=o.last().addClass(x.active),w.remove.labels(a),e.preventDefault()):a.removeClass(x.active)}}},keydown:function(e){var t=e.which,n=w.get.shortcutKeys(),i=w.is.inObject(t,n);if(i){var o,a,s=P.not("."+x.filtered).filter("."+x.selected).eq(0),l=z.children("."+x.active).eq(0),r=s.length>0?s:l,c=r.length>0?r.siblings(":not(."+x.filtered+")").andSelf():z.children(":not(."+x.filtered+")"),u=r.children(k.menu),d=r.closest(k.menu),v=d.hasClass(x.visible)||d.hasClass(x.animating)||d.parent(k.menu).length>0,m=u.length>0,f=r.length>0,h=r.not("."+x.filtered).length>0;if(w.is.visible()){if((t==n.enter||t==n.delimiter)&&(t==n.enter&&f&&m&&!C.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=n.rightArrow):h&&(w.verbose("Selecting item from keyboard shortcut",r),w.event.item.click.call(r,e),C.useLabels&&w.is.searchSelection()?w.hideAndClear():w.remove.searchTerm()),e.preventDefault()),t==n.leftArrow&&(a=d[0]!==z[0],a&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,d),r.removeClass(x.selected),d.closest(k.item).addClass(x.selected),e.preventDefault())),t==n.rightArrow&&m&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,u),r.removeClass(x.selected),u.find(k.item).eq(0).addClass(x.selected),e.preventDefault()),t==n.upArrow){if(o=f&&v?r.prevAll(k.item+":not(."+x.filtered+")").eq(0):P.eq(0),c.index(o)<0)return w.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();w.verbose("Up key pressed, changing active item"),r.removeClass(x.selected),o.addClass(x.selected),w.set.scrollPosition(o),e.preventDefault()}if(t==n.downArrow){if(o=f&&v?o=r.nextAll(k.item+":not(."+x.filtered+")").eq(0):P.eq(0),0===o.length)return w.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();w.verbose("Down key pressed, changing active item"),P.removeClass(x.selected),o.addClass(x.selected),w.set.scrollPosition(o),e.preventDefault()}t==n.pageUp&&(w.scrollPage("up"),e.preventDefault()),t==n.pageDown&&(w.scrollPage("down"),e.preventDefault()),t==n.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else t==n.delimiter&&e.preventDefault(),t==n.downArrow&&(w.verbose("Down key pressed, showing dropdown"),w.show(),e.preventDefault())}else w.is.selection()&&!w.is.search()&&w.set.selectedLetter(String.fromCharCode(t))}},determine:{selectAction:function(t,n){w.verbose("Determining action",C.action),e.isFunction(w.action[C.action])?(w.verbose("Triggering preset action",C.action,t,n),w.action[C.action].call(this,t,n)):e.isFunction(C.action)?(w.verbose("Triggering user action",C.action,t,n),C.action.call(this,t,n)):w.error(L.action,C.action)},eventInModule:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(I).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,n){var i=e(t.target);return n=e.isFunction(n)?n:function(){},0===i.closest(z).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,n){n=n!==i?n:t,w.set.selected(n,e(this)),(!w.is.multiple()||w.is.allFiltered())&&w.hideAndClear()},select:function(e,t){w.action.activate.call(this)},combo:function(t,n){n=n!==i?n:t,w.set.selected(n,e(this)),w.hideAndClear()},hide:function(){w.hideAndClear()}},get:{id:function(){return g},text:function(){return V.text()},query:function(){return e.trim(O.val())},searchWidth:function(e){return e*C.glyphWidth+"em"},selectionCount:function(){var t=w.get.values();return w.is.multiple()&&e.isArray(t)?t.length:""!==w.get.value()?1:0},userValues:function(){var t=w.get.values();return t?e.grep(t,function(e){return w.get.item(e)===!1}):!1},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},caretPosition:function(){var e,t,i=O.get(0);return"selectionStart"in i?i.selectionStart:n.selection?(i.focus(),e=n.selection.createRange(),t=e.text.length,e.moveStart("character",-i.value.length),e.text.length-t):void 0},shortcutKeys:function(){return{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40}},value:function(){return F.length>0?F.val():I.data(S.value)},values:function(){var e=w.get.value();return""===e?"":!F.is("select")&&w.is.multiple()?"string"==typeof e?e.split(C.delimiter):"":e},choiceText:function(e,t){return t=t!==i?t:C.preserveHTML,e?(e.find(k.menu).length>0&&(w.verbose("Retreiving text of element with sub-menu"),e=e.clone(),e.find(k.menu).remove(),e.find(k.menuIcon).remove()),e.data(S.text)!==i?e.data(S.text):t?e.html().trim():e.text().trim()):void 0},choiceValue:function(e,t){return t=t||w.get.choiceText(e),e?e.data(S.value)!==i?e.data(S.value):"string"==typeof t?t.toLowerCase().trim():t:!1},inputEvent:function(){var e=O[0];return e?e.oninput!==i?"input":e.onpropertychange!==i?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],I.find("option").each(function(){var n=e(this).html(),o=e(this).attr("value")!==i?e(this).attr("value"):n;"auto"===C.placeholder&&""===o?t.placeholder=n:t.values.push({name:n,value:o})}),C.placeholder&&"auto"!==C.placeholder&&(w.debug("Setting placeholder value to",C.placeholder),t.placeholder=C.placeholder),C.sortSelect?(t.values.sort(function(e,t){return e.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retreived values from select",t),t},activeItem:function(){return P.filter("."+x.active)},selectedItem:function(){var e=P.not("."+x.filtered).filter("."+x.selected);return e.length>0?e:P.eq(0)},item:function(t,n){var o,a=!1;return t=t!==i?t:w.get.values()!==i?w.get.values():w.get.text(),o=w.is.multiple()&&e.isArray(t),n=""===t||0===t?!0:n||!1,t!==i&&P.each(function(){var i=e(this),s=w.get.choiceText(i),l=w.get.choiceValue(i,s);if(o)(-1!==e.inArray(l.toString(),t)||-1!==e.inArray(s,t))&&(a=a?a.add(i):i);else if(n){if(w.verbose("Ambiguous dropdown value using strict type check",i,t),l===t||s===t)return a=i,!0}else if(l==t||s==t)return w.verbose("Found select item by value",l,t),a=i,!0}),a}},check:{maxSelections:function(e){return C.maxSelections?(e=e!==i?e:w.get.selectionCount(),e>=C.maxSelections?(w.debug("Maximum selection count reached"),P.addClass(x.filtered),w.add.message(y.maxSelections),!0):(w.verbose("No longer maximum selection count, removing message"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filter(),!1)):!0}},restore:{defaults:function(){w.restore.defaultText(),w.restore.defaultValue()},defaultText:function(){var e=I.data(S.defaultText);w.debug("Restoring default text",e),w.set.text(e),V.addClass(x.placeholder)},defaultValue:function(){var e=I.data(S.defaultValue);e!==i&&(w.debug("Restoring default value",e),e.length?w.set.selected(e):(w.remove.activeItem(),w.remove.selectedItem()))}},save:{defaults:function(){w.save.defaultText(),w.save.placeholderText(),w.save.defaultValue()},defaultValue:function(){I.data(S.defaultValue,w.get.value())},defaultText:function(){I.data(S.defaultText,V.text())},placeholderText:function(){V.hasClass(x.placeholder)&&I.data(S.placeholderText,V.text())}},clear:function(){w.set.placeholderText(),w.clearValue(),w.remove.activeItem(),w.remove.selectedItem()},clearValue:function(){w.set.value("")},scrollPage:function(e,t){var n,i,o,a=z.outerHeight(),s=z.scrollTop(),l=P.eq(0).outerHeight(),r=Math.floor(a/l),c=(z.prop("scrollHeight"),"up"==e?s-l*r:s+l*r),u=P.not("."+x.filtered);t=t||w.get.selectedItem(),o="up"==e?u.index(t)-r:u.index(t)+r,n="up"==e?o>=0:o0&&(w.debug("Scrolling page",e,i),t.removeClass(x.selected),i.addClass(x.selected),z.scrollTop(c))},set:{filtered:function(){var e=w.is.multiple(),t=w.is.searchSelection(),n=e&&t,i=t?w.get.query():"",o="string"==typeof i&&i.length>0,a=w.get.searchWidth(i.length),s=""!==i;e&&o&&(w.verbose("Adjusting input width",a,C.glyphWidth),O.css("width",a)),o||n&&s?(w.verbose("Hiding placeholder text"),V.addClass(x.filtered)):(!e||n&&!s)&&(w.verbose("Showing placeholder text"),V.removeClass(x.filtered))},placeholderText:function(e){w.debug("Restoring placeholder text"),e=e||I.data(S.placeholderText),w.set.text(e),V.addClass(x.placeholder)},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),O.val("").attr("tabindex",0),z.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),I.attr("tabindex")||(I.attr("tabindex",0),z.attr("tabindex","-1")))},scrollPosition:function(e,t){var n,o,a,s,l,r,c,u,d,v=5;e=e||w.get.selectedItem(),n=e.closest(k.menu),o=e&&e.length>0,t=t!==i?t:!1,e&&n.length>0&&o&&(s=e.position().top,n.hasClass(x.visible)||n.addClass(x.loading),r=n.scrollTop(),l=n.offset().top,s=e.offset().top,a=r-l+s,t||(c=n.height(),d=a+v>r+c,u=r>a-v),w.debug("Scrolling to active item",a),(t||u||d)&&n.scrollTop(a).removeClass(x.loading))},text:function(e){"select"!==C.action&&("combo"==C.action?(w.debug("Changing combo button text",e,M),C.preserveHTML?M.html(e):M.text(e)):(w.debug("Changing text",e,V),V.removeClass(x.filtered).removeClass(x.placeholder),C.preserveHTML?V.html(e):V.text(e)))},selectedLetter:function(t){var n=P.filter("."+x.selected),i=!1;P.each(function(){var n=e(this),o=w.get.choiceText(n,!1),a=String(o).charAt(0).toLowerCase(),s=t.toLowerCase();return a==s?(i=n,!1):void 0}),i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),n.removeClass(x.selected),i.addClass(x.selected))},value:function(t,n,i){var o=(F.length>0,!w.has.value(t),w.get.values());if(F.length>0){if(w.is.multiple()){if(""===t)return void w.debug("Cannot select blank values from multiselect");t=[t],e.isArray(o)&&(t=o.concat(t),t=w.get.uniqueArray(t)),F.is("select")?(w.debug("Setting multiple removing selected"),F.find('option[value="'+e+'"]').prop("selected",!1)):(w.verbose("Input is csv removing value"),t=w.remove.delimitedValue(e,t),F.val(t).trigger("change")),w.check.maxSelections()},delimitedValue:function(t,n){return"string"!=typeof n?!1:(n=n.split(C.delimiter),n=e.grep(n,function(e){return t!=e}),n=n.join(C.delimiter),w.verbose("Removed value from delimited string",t,n),n)},label:function(e){var t=I.find(k.label),n=t.filter('[data-value="'+e+'"]'),i=t.length,o=t.index(n)+1==i,a=(!w.is.searchSelection()||!w.is.focusedOnSearch())&&o;a?(w.verbose("Animating and removing label",n),n.transition(C.label.transition,C.label.duration,function(){n.remove()})):(w.verbose("Removing label",n),n.remove())},labels:function(t){t=t||I.find(k.label).filter("."+x.active),w.verbose("Removing active label selections",t),t.each(function(){var t=e(this).data("value"),n=w.is.userValue(t);n?(w.remove.value(t),w.remove.label(t)):w.remove.selected(t)})},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),O.attr("tabindex","-1"),z.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),I.attr("tabindex","-1"),z.attr("tabindex","-1"))}},has:{search:function(){return O.length>0},input:function(){return F.length>0},menu:function(){return z.length>0},message:function(){return 0!==z.children(k.message).length},label:function(e){var t=I.find(k.label);return t.filter('[data-value="'+e+'"]').length>0},maxSelections:function(){return C.maxSelections&&w.get.selectionCount()>=C.maxSelections},allResultsFiltered:function(){return P.filter("."+x.filtered).length===P.length},value:function(t){var n=w.get.values(),i=e.isArray(n)?n&&-1!==e.inArray(t,n):n==t;return i?!0:!1}},is:{active:function(){return I.hasClass(x.active)},alreadySetup:function(){return I.is("select")&&I.parent(k.dropdown).length>0&&0===I.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):z.transition&&z.transition("is animating")},focused:function(){return n.activeElement===I[0]},focusedOnSearch:function(){return n.activeElement===O[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(e){return!w.is.visible(e)},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){return n==t?(i=!0,!0):void 0}),i},multiple:function(){return I.hasClass(x.multiple)},single:function(){return!w.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){return i.target&&e(i.target).is("select")?(n=!0,!0):void 0}),n},search:function(){return I.hasClass(x.search)},searchSelection:function(){return w.has.search()&&0===O.closest(k.menu).length},selection:function(){return I.hasClass(x.selection)},userValue:function(t){return-1!==e.inArray(t,w.get.userValues())},upward:function(){return I.hasClass(x.upward)},visible:function(e){return e?e.hasClass(x.visible):z.hasClass(x.visible)}},can:{click:function(){return c||"click"==C.on},show:function(){return!I.hasClass(x.disabled)}},animate:{show:function(t,n){var o=n||z,a=n?function(){}:function(){w.hideSubMenus(),w.hideOthers(),w.set.active()};t=e.isFunction(t)?t:function(){},w.set.scrollPosition(w.get.selectedItem(),!0),w.verbose("Doing menu show animation",o),(w.is.hidden(o)||w.is.animating(o))&&("auto"==C.transition&&(C.transition=w.is.upward()?"slide up":"slide down",w.verbose("Automatically determining animation based on animation direction",C.transition)),"none"==C.transition?(a(),o.transition("show"),t.call(U)):e.fn.transition!==i&&I.transition("is supported")?o.transition({animation:C.transition+" in",debug:C.debug,verbose:C.verbose,duration:C.duration,queue:!0,onStart:a,onComplete:function(){t.call(U)}}):w.error(L.noTransition,C.transition))},hide:function(t,n){var o=n||z,a=(n?.9*C.duration:C.duration,n?function(){}:function(){w.can.click()&&w.unbind.intent(),w.focusSearch(),w.remove.active()});t=e.isFunction(t)?t:function(){},(w.is.visible(o)||w.is.animating(o))&&(w.verbose("Doing menu hide animation",o),"auto"==C.transition&&(C.transition=w.is.upward()?"slide up":"slide down"),"none"==C.transition?(a(),o.transition("hide"),t.call(U)):e.fn.transition!==i&&I.transition("is supported")?o.transition({animation:C.transition+" out",duration:C.duration,debug:C.debug,verbose:C.verbose,queue:!0,onStart:a,onComplete:function(){t.call(U)}}):w.error(L.transition))}},hideAndClear:function(){w.is.searchSelection()?(w.remove.searchTerm(),w.hide(function(){w.remove.filteredItem()})):w.hide()},delay:{show:function(){w.verbose("Delaying show event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.show,C.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.hide,C.delay.hide)}},escape:{regExp:function(e){return e=String(e),e.replace(A.escape,"\\$&")}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){C.debug&&(C.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,C.name+":"),w.debug.apply(console,arguments)))},verbose:function(){C.verbose&&C.debug&&(C.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,C.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,C.name+":"),w.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;C.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:U,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=C.name+":",n=0;u=!1,clearTimeout(w.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var s,l,r,c=K;return n=n||f,o=U||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var a=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=s)c=c[a];else{if(c[a]!==i)return l=c[a],!1;if(!e.isPlainObject(c[o])||n==s)return c[o]!==i?(l=c[o], -!1):(w.error(L.method,t),!1);c=c[o]}})),e.isFunction(l)?r=l.apply(o,n):l!==i&&(r=l),e.isArray(a)?a.push(r):a!==i?a=[a,r]:r!==i&&(a=r),l}},m?(K===i&&w.initialize(),w.invoke(v)):(K!==i&&K.invoke("destroy"),w.initialize())}),a!==i?a:s},e.fn.dropdown.settings={debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowTab:!0,allowCategorySelection:!1,transition:"auto",duration:200,glyphWidth:1.0714,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:0,touch:50},onChange:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term}",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found."},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.",method:"The method you called is not defined.",noTransition:"This module requires ui transitions "},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholderText",text:"text",value:"value"},selector:{addition:".addition",dropdown:".ui.dropdown",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",text:"> .text:not(.icon)"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},e.fn.dropdown.settings.templates={dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+='',i+=t.placeholder?'
'+n+"
":'
',i+='"},menu:function(t){var n=(t.placeholder||!1,t.values||{},"");return e.each(t.values,function(e,t){n+='
'+t.name+"
"}),n},label:function(e,t){return t+''},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document); \ No newline at end of file +!function(e,t,n,i){"use strict";e.fn.dropdown=function(a){var o,s=e(this),l=e(n),r=s.selector||"",c="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],v=arguments[0],m="string"==typeof v,f=[].slice.call(arguments,1);return s.each(function(){var h,g,p,b,w,C=e.isPlainObject(a)?e.extend(!0,{},e.fn.dropdown.settings,a):e.extend({},e.fn.dropdown.settings),x=C.className,y=C.message,S=C.metadata,T=C.namespace,A=C.regExp,k=C.selector,L=C.error,D=C.templates,q="."+T,E="module-"+T,I=e(this),V=I.find(k.text),O=I.find(k.search),F=I.find(k.input),R=I.find(k.icon),M=I.prev().find(k.text).length>0?I.prev().find(k.text):I.prev(),z=I.children(k.menu),P=z.find(k.item),H=!1,j=!1,U=this,K=I.data(E);w={initialize:function(){w.debug("Initializing dropdown",C),w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),w.save.defaults(),w.set.selected(),w.is.multiple()&&(C.allowAdditions&&(C.useLabels||(w.error(L.labels),C.useLabels=!0),w.create.userLabels()),w.check.maxSelections()),w.create.id(),c&&w.bind.touchEvents(),w.bind.mouseEvents(),w.bind.keyboardEvents(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w),K=w,I.data(E,w)},destroy:function(){w.verbose("Destroying previous dropdown for",I),w.remove.tabbable(),I.off(q).removeData(E),z.off(q),l.off(h),p&&p.disconnect(),b&&b.disconnect()},observeChanges:function(){"MutationObserver"in t&&(p=new MutationObserver(function(e){w.debug("").addClass(x.search).insertBefore(V)),C.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t),I.is("select")&&(F=I),F.parent(k.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),I=F.closest(k.dropdown),z=I.children(k.menu),0===z.length&&(z=e("
").addClass(x.menu).appendTo(I)),z.html(D.menu(t))):(w.debug("Creating entire dropdown from select"),I=e("
").attr("class",F.attr("class")).addClass(x.selection).addClass(x.dropdown).html(D.dropdown(t)).insertBefore(F),F.removeAttr("class").detach().prependTo(I)),F.is("[multiple]")&&w.set.multiple(),w.refresh()},reference:function(){var e,t,n=s.index(I);w.debug("Dropdown behavior was called on select, replacing with closest dropdown"),I=I.parent(k.dropdown),w.refresh(),e=s.slice(0,n),t=s.slice(n+1),s=e.add(I).add(t),m&&(K=w,w.invoke(v))}},refresh:function(){w.verbose("Refreshing selector cache"),V=I.find(k.text),O=I.find(k.search),F=I.find(k.input),R=I.find(k.icon),M=I.prev().find(k.text).length>0?I.prev().find(k.text):I.prev(),z=I.children(k.menu),P=z.find(k.item)},toggle:function(){w.verbose("Toggling menu visibility"),w.is.active()?w.hide():w.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),w.is.multiple()&&!w.has.search()&&w.is.allFiltered())return!0;w.animate.show(function(){w.can.click()&&w.bind.intent(),w.set.visible(),t.call(U)}),C.onShow.call(U)}},hide:function(t){t=e.isFunction(t)?t:function(){},w.is.active()&&(w.debug("Hiding dropdown"),w.animate.hide(function(){w.remove.visible(),t.call(U)}),C.onHide.call(U))},hideOthers:function(){w.verbose("Finding other dropdowns to hide"),s.not(I).has(k.menu+"."+x.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu instantaneously"),w.remove.active(),w.remove.visible(),z.transition("hide")},hideSubMenus:function(){var e=z.children(k.item).find(k.menu);w.verbose("Hiding sub menus",e),e.transition("hide")},bind:{keyboardEvents:function(){w.debug("Binding keyboard events"),I.on("keydown"+q,w.event.keydown),w.has.search()&&I.on(w.get.inputEvent()+q,k.search,w.event.input),w.is.multiple()&&l.on("keydown"+h,w.event.document.keydown)},touchEvents:function(){w.debug("Touch device detected binding additional touch events"),w.is.searchSelection()||I.on("touchstart"+q,w.event.test.toggle),z.on("touchstart"+q,k.item,w.event.item.mouseenter)},mouseEvents:function(){w.debug("Mouse detected binding mouse events"),w.is.multiple()&&I.on("click"+q,k.label,w.event.label.click).on("click"+q,k.remove,w.event.remove.click),w.is.searchSelection()?(I.on("mousedown"+q,k.menu,w.event.menu.mousedown).on("mouseup"+q,k.menu,w.event.menu.mouseup).on("click"+q,k.search,w.show).on("focus"+q,k.search,w.event.search.focus).on("blur"+q,k.search,w.event.search.blur).on("click"+q,k.text,w.event.text.focus),w.is.multiple()&&I.on("click"+q,w.event.click)):("click"==C.on?I.on("click"+q,w.event.test.toggle):"hover"==C.on?I.on("mouseenter"+q,w.delay.show).on("mouseleave"+q,w.delay.hide):I.on(C.on+q,w.toggle),I.on("mousedown"+q,w.event.mousedown).on("mouseup"+q,w.event.mouseup).on("focus"+q,w.event.focus).on("blur"+q,w.event.blur)),z.on("mouseenter"+q,k.item,w.event.item.mouseenter).on("mouseleave"+q,k.item,w.event.item.mouseleave).on("click"+q,k.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document"),c&&l.on("touchstart"+h,w.event.test.touch).on("touchmove"+h,w.event.test.touch),l.on("click"+h,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document"),c&&l.off("touchstart"+h).off("touchmove"+h),l.off("click"+h)}},filter:function(t){var n,a,o=e();t=t!==i?t:w.get.query(),n=w.escape.regExp(t),a=new RegExp("^"+n,"igm"),w.has.maxSelections()||(""===t?o=P:(w.verbose("Searching for matching values",t),P.each(function(){var n,i,s=e(this);if("both"==C.match||"text"==C.match){if(n=String(w.get.choiceText(s,!1)),-1!==n.search(a))return o=o.add(s),!0;if(C.fullTextSearch&&w.fuzzySearch(t,n))return o=o.add(s),!0}if("both"==C.match||"value"==C.match){if(i=String(w.get.choiceValue(s,n)),-1!==i.search(a))return o=o.add(s),!0;if(C.fullTextSearch&&w.fuzzySearch(t,i))return o=o.add(s),!0}})),w.debug("Showing only matched items",t),w.remove.filteredItem(),P.not(o).addClass(x.filtered),w.is.multiple()&&w.filterActive(),w.select.firstUnfiltered(),w.has.allResultsFiltered()?C.onNoResults.call(U,t)?C.allowAdditions||(w.verbose("All items filtered, showing message",t),w.add.message(y.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):w.remove.message())},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var a=0,o=0;i>a;a++){for(var s=e.charCodeAt(a);n>o;)if(t.charCodeAt(o++)===s)continue e;return!1}return!0},filterActive:function(){C.useLabels&&P.filter("."+x.active).addClass(x.filtered)},focusSearch:function(){w.is.search()&&!w.is.focusedOnSearch()&&O[0].focus()},forceSelection:function(){var e=P.not(x.filtered).filter("."+x.selected).eq(0),t=P.not(x.filtered).filter("."+x.active).eq(0),n=e.length>0?e:t,i=n.size()>0;i?(w.debug("Forcing partial selection to selected item",n),w.event.item.click.call(n),w.remove.filteredItem()):w.hide()},event:{focus:function(){C.showOnFocus&&!H&&w.is.hidden()&&w.show()},click:function(t){var n=e(t.target);!n.is(I)&&!n.is(R)||w.is.focusedOnSearch()||O.focus()},blur:function(e){var t=n.activeElement===this;H||t||(w.remove.activeLabel(),w.hide())},mousedown:function(){H=!0},mouseup:function(){H=!1},search:{focus:function(){H=!0,w.is.multiple()&&w.remove.activeLabel(),C.showOnFocus&&w.show()},blur:function(e){var t=n.activeElement===this;j||t||(w.is.multiple()?(w.remove.activeLabel(),w.hide()):C.forceSelection?w.forceSelection():w.hide())}},text:{focus:function(e){H=!0,O.focus()}},input:function(e){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered(),clearTimeout(w.timer),w.timer=setTimeout(w.search,C.delay.search)},label:{click:function(t){var n=e(this),i=I.find(k.label),a=i.filter("."+x.active),o=n.nextAll("."+x.active),s=n.prevAll("."+x.active),l=o.length>0?n.nextUntil(o).add(a).add(n):n.prevUntil(s).add(a).add(n);t.shiftKey?(a.removeClass(x.active),l.addClass(x.active)):t.ctrlKey?n.toggleClass(x.active):(a.removeClass(x.active),n.addClass(x.active)),C.onLabelSelect.apply(this,i.filter("."+x.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(x.active)?w.remove.labels():w.remove.labels(t)}},test:{toggle:function(e){var t=w.is.multiple()?w.show:w.toggle;w.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){w.determine.eventOnElement(e,function(){"touchstart"==e.type?w.timer=setTimeout(w.hide,C.delay.touch):"touchmove"==e.type&&clearTimeout(w.timer)}),e.stopPropagation()},hide:function(e){w.determine.eventInModule(e,w.hide)}},menu:{mousedown:function(){j=!0},mouseup:function(){j=!1}},item:{mouseenter:function(t){var n=e(this).children(k.menu),i=e(this).siblings(k.item).children(k.menu);n.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",n),e.each(i,function(){w.animate.hide(!1,e(this))}),w.animate.show(!1,n)},C.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(k.menu);n.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",n),w.animate.hide(!1,n)},C.delay.hide))},click:function(t){var n=e(this),i=e(t?t.target:""),a=n.find(k.menu),o=w.get.choiceText(n),s=w.get.choiceValue(n,o),l=a.length>0,r=a.find(i).length>0;r||l&&!C.allowCategorySelection||w.determine.selectAction.call(this,o,s)}},document:{keydown:function(e){var t=e.which,n=w.get.shortcutKeys(),i=w.is.inObject(t,n);if(i){var a=I.find(k.label),o=a.filter("."+x.active),s=(o.data("value"),a.index(o)),l=a.length,r=o.length>0,c=o.length>1,u=0===s,d=s+1==l,v=w.is.searchSelection(),m=w.is.focusedOnSearch(),f=w.is.focused(),h=m&&0===w.get.caretPosition();if(v&&!r&&!m)return;t==n.leftArrow?!f&&!h||r?r&&(e.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),a.removeClass(x.active)),u&&!c?o.addClass(x.active):o.prev(k.siblingLabel).addClass(x.active).end(),e.preventDefault()):(w.verbose("Selecting previous label"),a.last().addClass(x.active)):t==n.rightArrow?(f&&!r&&a.first().addClass(x.active),r&&(e.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),a.removeClass(x.active)),d?v?m?a.removeClass(x.active):w.focusSearch():c?o.next(k.siblingLabel).addClass(x.active):o.addClass(x.active):o.next(k.siblingLabel).addClass(x.active),e.preventDefault())):t==n.deleteKey||t==n.backspace?r?(w.verbose("Removing active labels"),d&&v&&!m&&w.focusSearch(),o.last().next(k.siblingLabel).addClass(x.active),w.remove.labels(o),e.preventDefault()):h&&!r&&t==n.backspace&&(w.verbose("Removing last label on input backspace"),o=a.last().addClass(x.active),w.remove.labels(o),e.preventDefault()):o.removeClass(x.active)}}},keydown:function(e){var t=e.which,n=w.get.shortcutKeys(),i=w.is.inObject(t,n);if(i){var a,o,s=P.not("."+x.filtered).filter("."+x.selected).eq(0),l=z.children("."+x.active).eq(0),r=s.length>0?s:l,c=r.length>0?r.siblings(":not(."+x.filtered+")").andSelf():z.children(":not(."+x.filtered+")"),u=r.children(k.menu),d=r.closest(k.menu),v=d.hasClass(x.visible)||d.hasClass(x.animating)||d.parent(k.menu).length>0,m=u.length>0,f=r.length>0,h=r.not("."+x.filtered).length>0;if(w.is.visible()){if((t==n.enter||t==n.delimiter)&&(t==n.enter&&f&&m&&!C.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=n.rightArrow):h&&(w.verbose("Selecting item from keyboard shortcut",r),w.event.item.click.call(r,e),C.useLabels&&w.is.searchSelection()?w.hideAndClear():w.remove.searchTerm()),e.preventDefault()),t==n.leftArrow&&(o=d[0]!==z[0],o&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,d),r.removeClass(x.selected),d.closest(k.item).addClass(x.selected),e.preventDefault())),t==n.rightArrow&&m&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,u),r.removeClass(x.selected),u.find(k.item).eq(0).addClass(x.selected),e.preventDefault()),t==n.upArrow){if(a=f&&v?r.prevAll(k.item+":not(."+x.filtered+")").eq(0):P.eq(0),c.index(a)<0)return w.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();w.verbose("Up key pressed, changing active item"),r.removeClass(x.selected),a.addClass(x.selected),w.set.scrollPosition(a),e.preventDefault()}if(t==n.downArrow){if(a=f&&v?a=r.nextAll(k.item+":not(."+x.filtered+")").eq(0):P.eq(0),0===a.length)return w.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();w.verbose("Down key pressed, changing active item"),P.removeClass(x.selected),a.addClass(x.selected),w.set.scrollPosition(a),e.preventDefault()}t==n.pageUp&&(w.scrollPage("up"),e.preventDefault()),t==n.pageDown&&(w.scrollPage("down"),e.preventDefault()),t==n.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else t==n.delimiter&&e.preventDefault(),t==n.downArrow&&(w.verbose("Down key pressed, showing dropdown"),w.show(),e.preventDefault())}else w.is.selection()&&!w.is.search()&&w.set.selectedLetter(String.fromCharCode(t))}},determine:{selectAction:function(t,n){w.verbose("Determining action",C.action),e.isFunction(w.action[C.action])?(w.verbose("Triggering preset action",C.action,t,n),w.action[C.action].call(this,t,n)):e.isFunction(C.action)?(w.verbose("Triggering user action",C.action,t,n),C.action.call(this,t,n)):w.error(L.action,C.action)},eventInModule:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(I).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,n){var i=e(t.target);return n=e.isFunction(n)?n:function(){},0===i.closest(z).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,n){n=n!==i?n:t,w.set.selected(n,e(this)),(!w.is.multiple()||w.is.allFiltered())&&w.hideAndClear()},select:function(e,t){w.action.activate.call(this)},combo:function(t,n){n=n!==i?n:t,w.set.selected(n,e(this)),w.hideAndClear()},hide:function(){w.hideAndClear()}},get:{id:function(){return g},text:function(){return V.text()},query:function(){return e.trim(O.val())},searchWidth:function(e){return e*C.glyphWidth+"em"},selectionCount:function(){var t=w.get.values();return w.is.multiple()&&e.isArray(t)?t.length:""!==w.get.value()?1:0},userValues:function(){var t=w.get.values();return t?e.grep(t,function(e){return w.get.item(e)===!1}):!1},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},caretPosition:function(){var e,t,i=O.get(0);return"selectionStart"in i?i.selectionStart:n.selection?(i.focus(),e=n.selection.createRange(),t=e.text.length,e.moveStart("character",-i.value.length),e.text.length-t):void 0},shortcutKeys:function(){return{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40}},value:function(){return F.length>0?F.val():I.data(S.value)},values:function(){var e=w.get.value();return""===e?"":!F.is("select")&&w.is.multiple()?"string"==typeof e?e.split(C.delimiter):"":e},choiceText:function(e,t){return t=t!==i?t:C.preserveHTML,e?(e.find(k.menu).length>0&&(w.verbose("Retreiving text of element with sub-menu"),e=e.clone(),e.find(k.menu).remove(),e.find(k.menuIcon).remove()),e.data(S.text)!==i?e.data(S.text):t?e.html().trim():e.text().trim()):void 0},choiceValue:function(e,t){return t=t||w.get.choiceText(e),e?e.data(S.value)!==i?e.data(S.value):"string"==typeof t?t.toLowerCase().trim():t:!1},inputEvent:function(){var e=O[0];return e?e.oninput!==i?"input":e.onpropertychange!==i?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],I.find("option").each(function(){var n=e(this).html(),a=e(this).attr("value")!==i?e(this).attr("value"):n;"auto"===C.placeholder&&""===a?t.placeholder=n:t.values.push({name:n,value:a})}),C.placeholder&&"auto"!==C.placeholder&&(w.debug("Setting placeholder value to",C.placeholder),t.placeholder=C.placeholder),C.sortSelect?(t.values.sort(function(e,t){return e.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retreived values from select",t),t},activeItem:function(){return P.filter("."+x.active)},selectedItem:function(){var e=P.not("."+x.filtered).filter("."+x.selected);return e.length>0?e:P.eq(0)},item:function(t,n){var a,o=!1;return t=t!==i?t:w.get.values()!==i?w.get.values():w.get.text(),a=w.is.multiple()&&e.isArray(t),n=""===t||0===t?!0:n||!1,t!==i&&P.each(function(){var i=e(this),s=w.get.choiceText(i),l=w.get.choiceValue(i,s);if(a)(-1!==e.inArray(l.toString(),t)||-1!==e.inArray(s,t))&&(o=o?o.add(i):i);else if(n){if(w.verbose("Ambiguous dropdown value using strict type check",i,t),l===t||s===t)return o=i,!0}else if(l==t||s==t)return w.verbose("Found select item by value",l,t),o=i,!0}),o}},check:{maxSelections:function(e){return C.maxSelections?(e=e!==i?e:w.get.selectionCount(),e>=C.maxSelections?(w.debug("Maximum selection count reached"),P.addClass(x.filtered),w.add.message(y.maxSelections),!0):(w.verbose("No longer maximum selection count, removing message"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filter(),!1)):!0}},restore:{defaults:function(){w.restore.defaultText(),w.restore.defaultValue()},defaultText:function(){var e=I.data(S.defaultText);w.debug("Restoring default text",e),w.set.text(e),V.addClass(x.placeholder)},defaultValue:function(){var e=I.data(S.defaultValue);e!==i&&(w.debug("Restoring default value",e),e.length?w.set.selected(e):(w.remove.activeItem(),w.remove.selectedItem()))}},save:{defaults:function(){w.save.defaultText(),w.save.placeholderText(),w.save.defaultValue()},defaultValue:function(){I.data(S.defaultValue,w.get.value())},defaultText:function(){I.data(S.defaultText,V.text())},placeholderText:function(){V.hasClass(x.placeholder)&&I.data(S.placeholderText,V.text())}},clear:function(){w.set.placeholderText(),w.clearValue(),w.remove.activeItem(),w.remove.selectedItem()},clearValue:function(){w.set.value("")},scrollPage:function(e,t){var n,i,a,o=z.outerHeight(),s=z.scrollTop(),l=P.eq(0).outerHeight(),r=Math.floor(o/l),c=(z.prop("scrollHeight"),"up"==e?s-l*r:s+l*r),u=P.not("."+x.filtered);t=t||w.get.selectedItem(),a="up"==e?u.index(t)-r:u.index(t)+r,n="up"==e?a>=0:a0&&(w.debug("Scrolling page",e,i),t.removeClass(x.selected),i.addClass(x.selected),z.scrollTop(c))},set:{filtered:function(){var e=w.is.multiple(),t=w.is.searchSelection(),n=e&&t,i=t?w.get.query():"",a="string"==typeof i&&i.length>0,o=w.get.searchWidth(i.length),s=""!==i;e&&a&&(w.verbose("Adjusting input width",o,C.glyphWidth),O.css("width",o)),a||n&&s?(w.verbose("Hiding placeholder text"),V.addClass(x.filtered)):(!e||n&&!s)&&(w.verbose("Showing placeholder text"),V.removeClass(x.filtered))},placeholderText:function(e){w.debug("Restoring placeholder text"),e=e||I.data(S.placeholderText),w.set.text(e),V.addClass(x.placeholder)},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),O.val("").attr("tabindex",0),z.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),I.attr("tabindex")||(I.attr("tabindex",0),z.attr("tabindex","-1")))},scrollPosition:function(e,t){var n,a,o,s,l,r,c,u,d,v=5;e=e||w.get.selectedItem(),n=e.closest(k.menu),a=e&&e.length>0,t=t!==i?t:!1,e&&n.length>0&&a&&(s=e.position().top,n.hasClass(x.visible)||n.addClass(x.loading),r=n.scrollTop(),l=n.offset().top,s=e.offset().top,o=r-l+s,t||(c=n.height(),d=o+v>r+c,u=r>o-v),w.debug("Scrolling to active item",o),(t||u||d)&&n.scrollTop(o).removeClass(x.loading))},text:function(e){"select"!==C.action&&("combo"==C.action?(w.debug("Changing combo button text",e,M),C.preserveHTML?M.html(e):M.text(e)):(w.debug("Changing text",e,V),V.removeClass(x.filtered).removeClass(x.placeholder),C.preserveHTML?V.html(e):V.text(e)))},selectedLetter:function(t){var n=P.filter("."+x.selected),i=!1;P.each(function(){var n=e(this),a=w.get.choiceText(n,!1),o=String(a).charAt(0).toLowerCase(),s=t.toLowerCase();return o==s?(i=n,!1):void 0}),i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),n.removeClass(x.selected),i.addClass(x.selected))},value:function(t,n,i){var a=(F.length>0,!w.has.value(t),w.get.values());if(F.length>0){if(w.is.multiple()){if(""===t)return void w.debug("Cannot select blank values from multiselect");t=[t],e.isArray(a)&&(t=a.concat(t),t=w.get.uniqueArray(t)),F.is("select")?(w.debug("Setting multiple removing selected"),F.find('option[value="'+e+'"]').prop("selected",!1)):(w.verbose("Input is csv removing value"),t=w.remove.delimitedValue(e,t),F.val(t).trigger("change")),w.check.maxSelections()},delimitedValue:function(t,n){return"string"!=typeof n?!1:(n=n.split(C.delimiter),n=e.grep(n,function(e){return t!=e}),n=n.join(C.delimiter),w.verbose("Removed value from delimited string",t,n),n)},label:function(e){var t=I.find(k.label),n=t.filter('[data-value="'+e+'"]'),i=t.length,a=t.index(n)+1==i,o=(!w.is.searchSelection()||!w.is.focusedOnSearch())&&a;o?(w.verbose("Animating and removing label",n),n.transition(C.label.transition,C.label.duration,function(){n.remove()})):(w.verbose("Removing label",n),n.remove())},labels:function(t){t=t||I.find(k.label).filter("."+x.active),w.verbose("Removing active label selections",t),t.each(function(){var t=e(this).data("value"),n=w.is.userValue(t);n?(w.remove.value(t),w.remove.label(t)):w.remove.selected(t)})},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),O.attr("tabindex","-1"),z.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),I.attr("tabindex","-1"),z.attr("tabindex","-1"))}},has:{search:function(){return O.length>0},input:function(){return F.length>0},menu:function(){return z.length>0},message:function(){return 0!==z.children(k.message).length},label:function(e){var t=I.find(k.label);return t.filter('[data-value="'+e+'"]').length>0},maxSelections:function(){return C.maxSelections&&w.get.selectionCount()>=C.maxSelections},allResultsFiltered:function(){return P.filter("."+x.filtered).length===P.length},value:function(t){var n=w.get.values(),i=e.isArray(n)?n&&-1!==e.inArray(t,n):n==t;return i?!0:!1}},is:{active:function(){return I.hasClass(x.active)},alreadySetup:function(){return I.is("select")&&I.parent(k.dropdown).length>0&&0===I.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):z.transition&&z.transition("is animating")},focused:function(){return n.activeElement===I[0]},focusedOnSearch:function(){return n.activeElement===O[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(e){return!w.is.visible(e)},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){return n==t?(i=!0,!0):void 0}),i},multiple:function(){return I.hasClass(x.multiple)},single:function(){return!w.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){return i.target&&e(i.target).is("select")?(n=!0,!0):void 0}),n},search:function(){return I.hasClass(x.search)},searchSelection:function(){return w.has.search()&&0===O.closest(k.menu).length},selection:function(){return I.hasClass(x.selection)},userValue:function(t){return-1!==e.inArray(t,w.get.userValues())},upward:function(){return I.hasClass(x.upward)},visible:function(e){return e?e.hasClass(x.visible):z.hasClass(x.visible)}},can:{click:function(){return c||"click"==C.on},show:function(){return!I.hasClass(x.disabled)}},animate:{show:function(t,n){var a=n||z,o=n?function(){}:function(){w.hideSubMenus(),w.hideOthers(),w.set.active()};t=e.isFunction(t)?t:function(){},w.set.scrollPosition(w.get.selectedItem(),!0),w.verbose("Doing menu show animation",a),(w.is.hidden(a)||w.is.animating(a))&&("auto"==C.transition&&(C.transition=w.is.upward()?"slide up":"slide down",w.verbose("Automatically determining animation based on animation direction",C.transition)),"none"==C.transition?(o(),a.transition("show"),t.call(U)):e.fn.transition!==i&&I.transition("is supported")?a.transition({animation:C.transition+" in",debug:C.debug,verbose:C.verbose,duration:C.duration,queue:!0,onStart:o,onComplete:function(){t.call(U)}}):w.error(L.noTransition,C.transition))},hide:function(t,n){var a=n||z,o=(n?.9*C.duration:C.duration,n?function(){}:function(){w.can.click()&&w.unbind.intent(),w.focusSearch(),w.remove.active()});t=e.isFunction(t)?t:function(){},(w.is.visible(a)||w.is.animating(a))&&(w.verbose("Doing menu hide animation",a),"auto"==C.transition&&(C.transition=w.is.upward()?"slide up":"slide down"),"none"==C.transition?(o(),a.transition("hide"),t.call(U)):e.fn.transition!==i&&I.transition("is supported")?a.transition({animation:C.transition+" out",duration:C.duration,debug:C.debug,verbose:C.verbose,queue:!0,onStart:o,onComplete:function(){t.call(U)}}):w.error(L.transition))}},hideAndClear:function(){w.is.searchSelection()?(w.remove.searchTerm(),w.hide(function(){w.remove.filteredItem()})):w.hide()},delay:{show:function(){w.verbose("Delaying show event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.show,C.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.hide,C.delay.hide)}},escape:{regExp:function(e){return e=String(e),e.replace(A.escape,"\\$&")}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){C.debug&&(C.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,C.name+":"),w.debug.apply(console,arguments)))},verbose:function(){C.verbose&&C.debug&&(C.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,C.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,C.name+":"),w.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;C.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:U,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=C.name+":",n=0;u=!1,clearTimeout(w.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,a){var s,l,r,c=K;return n=n||f,a=U||a,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,a){var o=n!=s?a+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[o])&&n!=s)c=c[o];else{if(c[o]!==i)return l=c[o],!1;if(!e.isPlainObject(c[a])||n==s)return c[a]!==i?(l=c[a], +!1):(w.error(L.method,t),!1);c=c[a]}})),e.isFunction(l)?r=l.apply(a,n):l!==i&&(r=l),e.isArray(o)?o.push(r):o!==i?o=[o,r]:r!==i&&(o=r),l}},m?(K===i&&w.initialize(),w.invoke(v)):(K!==i&&K.invoke("destroy"),w.initialize())}),o!==i?o:s},e.fn.dropdown.settings={debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowTab:!0,allowCategorySelection:!1,transition:"auto",duration:200,glyphWidth:1.0714,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:0,touch:50},onChange:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term}",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found."},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.",method:"The method you called is not defined.",noTransition:"This module requires ui transitions "},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholderText",text:"text",value:"value"},selector:{addition:".addition",dropdown:".ui.dropdown",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",text:"> .text:not(.icon)"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},e.fn.dropdown.settings.templates={dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+='',i+=t.placeholder?'
'+n+"
":'
',i+='"},menu:function(t){var n=(t.placeholder||!1,t.values||{},"");return e.each(t.values,function(e,t){n+='
'+t.name+"
"}),n},label:function(e,t){return t+''},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document); \ No newline at end of file diff --git a/dist/semantic.js b/dist/semantic.js index a1ca627e9..5c7e585cb 100644 --- a/dist/semantic.js +++ b/dist/semantic.js @@ -5515,6 +5515,7 @@ $.fn.dropdown = function(parameters) { if($addition.length > 0) { $addition .html(html) + .data(metadata.value, value) .removeClass(className.filtered) .addClass(className.selected) ; @@ -5522,6 +5523,7 @@ $.fn.dropdown = function(parameters) { else { $addition = $('
') .html(html) + .data(metadata.value, value) .addClass(className.addition) .addClass(className.item) .prependTo($menu) diff --git a/dist/semantic.min.js b/dist/semantic.min.js index fd3b631a3..363748cb9 100644 --- a/dist/semantic.min.js +++ b/dist/semantic.min.js @@ -10,7 +10,7 @@ */ !function(e,t,n,i){e.site=e.fn.site=function(o){var a,r,s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),f=m.namespace,g=m.error,p="module-"+f,v=e(n),h=v,b=this,y=h.data(p);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),y=a,h.data(p,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),(console===i||console.log===i)&&(a.verbose("Console not available, normalizing events"),a.disable.console()),("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(a.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(a.debug("RequestAnimationFrame not available, normailizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,r){o="string"==typeof o?"all"===o?m.modules:[o]:o||m.modules,r=r!==i?r:!0,e.each(o,function(i,o){var s,c=a.moduleExists(o)?e.fn[o].settings.namespace||!1:!0;a.moduleExists(o)&&(a.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,r&&c&&(s=e(":data(module-"+c+")"),s.length>0&&(a.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||m.modules,o=o!==i?o:!0,e.each(n,function(n,i){var r;a.moduleExists(i)&&(a.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&f&&(r=e(":data(module-"+f+")"),r.length>0&&(a.verbose("Modifying existing settings",r),r[i]("setting",t))))})}},enable:{console:function(){a.console(!0)},debug:function(e,t){e=e||m.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,t)}},disable:{console:function(){a.console(!1)},debug:function(e,t){e=e||m.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void a.error(g.console);a.debug("Restoring console function"),t.console=y.cache.console}else a.debug("Disabling console function"),y.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){a.verbose("Destroying previous site for",h),h.removeData(p)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Element:b,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var s,c,l,u=y;return n=n||d,o=b||o,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(o,n):c!==i&&(l=c),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),c}},u?(y===i&&a.initialize(),a.invoke(l)):(y!==i&&a.destroy(),a.initialize()),r!==i?r:this},e.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","video","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.form=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u=arguments[1],d="string"==typeof l,m=[].slice.call(arguments,1);return a.each(function(){var f,g,p,v,h,b,y,x,C,w,k,T,S,A,P,E,R,F,O=e(this),D=this,q=[],z=!1;F={initialize:function(){F.get.settings(),d?(R===i&&F.instantiate(),F.invoke(l)):(F.verbose("Initializing form validation",O,x),F.bindEvents(),F.set.defaults(),F.instantiate())},instantiate:function(){F.verbose("Storing instance of module",F),R=F,O.data(P,F)},destroy:function(){F.verbose("Destroying previous module",R),F.removeEvents(),O.removeData(P)},refresh:function(){F.verbose("Refreshing selector cache"),f=O.find(k.field),g=O.find(k.group),p=O.find(k.message),v=O.find(k.prompt),h=O.find(k.submit),b=O.find(k.clear),y=O.find(k.reset)},submit:function(){F.verbose("Submitting form",O),O.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+E,function(e){F[n](),e.preventDefault()})},bindEvents:function(){F.verbose("Attaching form events"),O.on("submit"+E,F.validate.form).on("blur"+E,k.field,F.event.field.blur).on("click"+E,k.submit,F.submit).on("click"+E,k.reset,F.reset).on("click"+E,k.clear,F.clear),x.keyboardShortcuts&&O.on("keydown"+E,k.field,F.event.field.keydown),f.each(function(){var t=e(this),n=t.prop("type"),i=F.get.changeEvent(n,t);e(this).on(i+E,F.event.field.change)})},clear:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(g),o=i.find(k.prompt),a=t.data(w.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),c=i.hasClass(T.error);c&&(F.verbose("Resetting error on field",i),i.removeClass(T.error),o.remove()),s?(F.verbose("Resetting dropdown value",n,a),n.dropdown("clear")):r?n.checkbox("uncheck"):(F.verbose("Resetting field value",t,a),t.val(""))})},reset:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(g),o=i.find(k.prompt),a=t.data(w.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),c=i.hasClass(T.error);c&&(F.verbose("Resetting error on field",i),i.removeClass(T.error),o.remove()),s?(F.verbose("Resetting dropdown value",n,a),n.dropdown("restore defaults")):r?(F.verbose("Resetting checkbox value",n,a),n.checkbox(a===!0?"check":"uncheck")):(F.verbose("Resetting field value",t,a),t.val(a))})},removeEvents:function(){O.off(E),f.off(E),h.off(E),f.off(E)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o={enter:13,escape:27};i==o.escape&&(F.verbose("Escape key pressed blurring field"),n.blur()),!t.ctrlKey&&i==o.enter&&n.is(k.input)&&n.not(k.checkbox).length>0&&(h.addClass(T.pressed),z||(n.one("keyup"+E,F.event.field.keyup),F.submit(),F.debug("Enter pressed on input submitting form")),z=!0)},keyup:function(){z=!1,h.removeClass(T.pressed)},blur:function(){var t=e(this),n=t.closest(g);n.hasClass(T.error)?(F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))):("blur"==x.on||"change"==x.on)&&F.validate.field(F.get.validation(t))},change:function(){var t=e(this),n=t.closest(g);("change"==x.on||n.hasClass(T.error)&&x.revalidate)&&(clearTimeout(F.timer),F.timer=setTimeout(function(){F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))},x.delay))}}},get:{changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":F.get.inputEvent()},inputEvent:function(){return n.createElement("input").oninput!==i?"input":n.createElement("input").onpropertychange!==i?"propertychange":"keyup"},settings:function(){if(e.isPlainObject(t)){var n=Object.keys(t),o=n.length>0?t[n[0]].identifier!==i:!1;o?(x=e.extend(!0,{},e.fn.form.settings,u),C=e.extend({},e.fn.form.settings.defaults,t),F.error(x.error.oldSyntax,D),F.verbose("Extending settings from legacy parameters",C,x)):(x=e.extend(!0,{},e.fn.form.settings,t),C=e.extend({},e.fn.form.settings.defaults,x.fields),F.verbose("Extending settings",C,x))}else x=e.fn.form.settings,C=e.fn.form.settings.defaults,F.verbose("Using default form validation",C,x);A=x.namespace,w=x.metadata,k=x.selector,T=x.className,S=x.error,P="module-"+A,E="."+A,R=O.data(P),F.refresh()},field:function(t){return F.verbose("Finding field with identifier",t),f.filter("#"+t).length>0?f.filter("#"+t):f.filter('[name="'+t+'"]').length>0?f.filter('[name="'+t+'"]'):f.filter('[name="'+t+'[]"]').length>0?f.filter('[name="'+t+'[]"]'):f.filter("[data-"+w.validate+'="'+t+'"]').length>0?f.filter("[data-"+w.validate+'="'+t+'"]'):e("")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(F.get.field(t))}),n},validation:function(t){var n;return e.each(C,function(e,i){F.get.field(i.identifier).get(0)==t.get(0)&&(n=i)}),n||!1},value:function(e){var t,n=[];return n.push(e),t=F.get.values.call(D,n),t[e]},values:function(t){var n=e.isArray(t)?F.get.fields(t):f,i={};return n.each(function(t,n){var o=e(n),a=(o.prop("type"),o.prop("name")),r=o.val(),s=o.is(k.checkbox),c=o.is(k.radio),l=-1!==a.indexOf("[]"),u=s?o.is(":checked"):!1;if(a)if(l)if(a=a.replace("[]",""),i[a]||(i[a]=[]),s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a].push(r)}else i[a].push(r);else if(c)u&&(i[a]=r);else if(s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a]=!0}else i[a]=r}),i}},has:{field:function(e){return F.verbose("Checking for existence of a field with identifier",e),f.filter("#"+e).length>0?!0:f.filter('[name="'+e+'"]').length>0?!0:f.filter("[data-"+w.validate+'="'+e+'"]').length>0?!0:!1}},add:{prompt:function(t,n){var o=F.get.field(t),a=o.closest(g),r=a.children(k.prompt),s=0!==r.length;n="string"==typeof n?[n]:n,F.verbose("Adding field error state",t),a.addClass(T.error),x.inline&&(s||(r=x.templates.prompt(n),r.appendTo(a)),r.html(n[0]),s?F.verbose("Inline errors are disabled, no inline error added",t):x.transition&&e.fn.transition!==i&&O.transition("is supported")?(F.verbose("Displaying error with css transition",x.transition),r.transition(x.transition+" in",x.duration)):(F.verbose("Displaying error with fallback javascript animation"),r.fadeIn(x.duration)))},errors:function(e){F.debug("Adding form error messages",e),p.html(x.templates.error(e))}},remove:{prompt:function(t){var n=F.get.field(t.identifier),o=n.closest(g),a=o.children(k.prompt);o.removeClass(T.error),x.inline&&a.is(":visible")&&(F.verbose("Removing prompt for field",t),x.transition&&e.fn.transition!==i&&O.transition("is supported")?a.transition(x.transition+" out",x.duration,function(){a.remove()}):a.fadeOut(x.duration,function(){a.remove()}))}},set:{success:function(){O.removeClass(T.error).addClass(T.success)},defaults:function(){f.each(function(){var t=e(this),n=t.filter(k.checkbox).length>0,i=n?t.is(":checked"):t.val();t.data(w.defaultValue,i)})},error:function(){O.removeClass(T.success).addClass(T.error)},value:function(e,t){var n={};return n[e]=t,F.set.values.call(D,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=F.get.field(t),a=o.parent(),r=e.isArray(n),s=a.is(k.uiCheckbox),c=a.is(k.uiDropdown),l=o.is(k.radio)&&s,u=o.length>0;u&&(r&&s?(F.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):l?(F.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(k.uiCheckbox).checkbox("check")):s?(F.verbose("Setting checkbox value",n,a),a.checkbox(n===!0?"check":"uncheck")):c?(F.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):(F.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(t){var n=!0;return z?!1:(q=[],e.each(C,function(e,t){F.validate.field(t)||(n=!1)}),n?(F.debug("Form has no validation errors, submitting"),F.set.success(),x.onSuccess.call(D,t)):(F.debug("Form has errors"),F.set.error(),x.inline||F.add.errors(q),O.data("moduleApi")!==i&&t.stopImmediatePropagation(),x.onFailure.call(D,q)))},field:function(t){var n=F.get.field(t.identifier),o=!0,a=[];return n.prop("disabled")?(F.debug("Field is disabled. Skipping",t.identifier),o=!0):t.optional&&""===e.trim(n.val())?(F.debug("Field is optional and empty. Skipping",t.identifier),o=!0):t.rules!==i&&e.each(t.rules,function(e,n){F.has.field(t.identifier)&&!F.validate.rule(t,n)&&(F.debug("Field is invalid",t.identifier,n.type),a.push(n.prompt),o=!1)}),o?(F.remove.prompt(t,a),x.onValid.call(n),!0):(q=q.concat(a),F.add.prompt(t.identifier,a),x.onInvalid.call(n,a),!1)},rule:function(t,n){var i,o,a,r=F.get.field(t.identifier),s=n.type,c=r.val(),l=s.match(x.regExp.bracket),u=!0;if(c=e.trim(r.val()+""),l){if(o=""+l[1],a=s.replace(l[0],""),i=x.rules[a],!e.isFunction(i))return void F.error(S.noRule,a);u=i.call(r,c,o)}else{if(i=x.rules[s],!e.isFunction(i))return void F.error(S.noRule,s);u=i.call(r,c)}return u}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,F,t);else{if(n===i)return F[t];F[t]=n}},debug:function(){x.debug&&(x.performance?F.performance.log(arguments):(F.debug=Function.prototype.bind.call(console.info,console,x.name+":"),F.debug.apply(console,arguments)))},verbose:function(){x.verbose&&x.debug&&(x.performance?F.performance.log(arguments):(F.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),F.verbose.apply(console,arguments)))},error:function(){F.error=Function.prototype.bind.call(console.error,console,x.name+":"),F.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(F.performance.timer),F.performance.timer=setTimeout(F.performance.display,500)},display:function(){var t=x.name+":",n=0;s=!1,clearTimeout(F.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=R;return n=n||m,a=D||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},F.initialize()}),o!==i?o:this},e.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{bracket:/\[(.*)\]/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,email:"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",integer:/^\-?\d+$/,flags:/^\/(.*)\/(.*)?/,url:/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noRule:"There is no rule matching the one you specified",method:"The method you called is not defined."},templates:{error:function(t){var n='
    ';return e.each(t,function(e,t){n+="
  • "+t+"
  • "}),n+="
",e(n)},prompt:function(t){return e("
").addClass("ui red pointing prompt label").html(t[0])}},rules:{checked:function(){return e(this).filter(":checked").length>0},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},email:function(t){var n=new RegExp(e.fn.form.settings.regExp.email,"i");return n.test(t)},empty:function(t){return!(t===i||""===t||e.isArray(t)&&0===t.length)},integer:function(t,n){var o,a,r,s=e.fn.form.settings.regExp.integer;return n===i||""===n||".."===n||(-1==n.indexOf("..")?s.test(n)&&(o=a=n-0):(r=n.split("..",2),s.test(r[0])&&(o=r[0]-0),s.test(r[1])&&(a=r[1]-0))),s.test(t)&&(o===i||t>=o)&&(a===i||a>=t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,e==t},isExactly:function(e,t){return e==t},length:function(e,t){return e!==i?e.length>=t:!1},different:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0&&(o=e('[name="'+n+'"]').val()),o!==i?t.toString()!==o.toString():!1},match:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0&&(o=e('[name="'+n+'"]').val()),o!==i?t.toString()==o.toString():!1},maxCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length<=n},exactCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length==n},minCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length>=n},regExp:function(t,n){var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},maxLength:function(e,t){return e!==i?e.length<=t:!1},not:function(e,t){return e="string"==typeof e?e.toLowerCase():e,t="string"==typeof t?t.toLowerCase():t,e!=t},notExactly:function(e,t){return e!=t},url:function(t){return e.fn.form.settings.regExp.url.match(t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.accordion=function(n){{var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=a.selector||"",C=e(this),w=C.find(v.title),k=C.find(v.content),T=this,S=C.data(y);m={initialize:function(){m.debug("Initializing",C),m.bind.events(),m.observeChanges(),m.instantiate()},instantiate:function(){S=m,C.data(y,m)},destroy:function(){m.debug("Destroying previous instance",C),C.off(b).removeData(y)},refresh:function(){w=C.find(v.title),k=C.find(v.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),d.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",d))},bind:{events:function(){m.debug("Binding delegated events"),C.on(f.on+b,v.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r&&!a,c=!r&&a;m.debug("Toggling visibility of content",n),s||c?f.collapsible?m.close.call(n):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(n)},open:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r||a;return s?void m.debug("Accordion already open, skipping",o):(m.debug("Opening accordion content",n),f.onOpening.call(o),f.exclusive&&m.closeOthers.call(n),n.addClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:1},f.duration,m.resetOpacity)),void o.slideDown(f.duration,f.easing,function(){o.removeClass(g.animating).addClass(g.active),m.reset.display.call(this),f.onOpen.call(this),f.onChange.call(this)}))},close:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=!r&&a,c=r&&a;!r&&!s||c||(m.debug("Closing accordion content",o),f.onClosing.call(o),n.removeClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),o.slideUp(f.duration,f.easing,function(){o.removeClass(g.animating).removeClass(g.active),m.reset.display.call(this),f.onClose.call(this),f.onChange.call(this)}))},closeOthers:function(t){var n,o,a,r=t!==i?w.eq(t):e(this).closest(v.title),s=r.parents(v.content).prev(v.title),c=r.closest(v.accordion),l=v.title+"."+g.active+":visible",u=v.content+"."+g.active+":visible";f.closeNested?(n=c.find(l).not(s),a=n.next(k)):(n=c.find(l).not(s),o=c.find(u).find(l).not(s),n=n.not(o),a=n.next(k)),n.length>0&&(m.debug("Exclusive enabled, closing other content",n),n.removeClass(g.active),a.removeClass(g.animating).stop(!0,!0),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):a.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),a.slideUp(f.duration,f.easing,function(){e(this).removeClass(g.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){return m.debug("Changing internal",t,n),n===i?m[t]:void(e.isPlainObject(t)?e.extend(!0,m,t):m[t]=n)},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;r=!1,clearTimeout(m.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,c,l=S;return n=n||u,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},l?(S===i&&m.initialize(),m.invoke(c)):(S!==i&&S.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!1,performance:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",on:"click",onOpening:function(){},onOpen:function(){},onClosing:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.checkbox=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f=e.extend(!0,{},e.fn.checkbox.settings,n),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=e(this),C=e(this).find(v.label),w=e(this).find(v.input),k=x.data(y),T=this;m={initialize:function(){m.verbose("Initializing checkbox",f),m.create.label(),m.add.events(),m.setup(),m.observeChanges(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),k=m,x.data(y,m)},destroy:function(){m.verbose("Destroying module"),m.remove.events(),x.removeData(y)},setup:function(){m.is.checked()?(m.debug("Setting initial value to checked"),m.set.checked(),f.fireOnInit&&f.onChecked.call(w.get())):(m.debug("Setting initial value to unchecked"),m.remove.checked(),f.fireOnInit&&f.onUnchecked.call(w.get()))},refresh:function(){C=x.find(v.label),w=x.find(v.input)},observeChanges:function(){"MutationObserver"in t&&(a=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),a.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",a))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(m[n])?m[n]:m.toggle,i.length>0?(m.debug("Attaching checkbox events to element",t,n),i.on("click"+b,n)):m.error(h.notFound)},event:{keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape&&(m.verbose("Escape key pressed blurring field"),x.blur()),e.ctrlKey||t!=n.enter&&t!=n.space||(m.verbose("Enter key pressed, toggling checkbox"),m.toggle.call(this),e.preventDefault())}},get:{radios:function(){return e('input[name="'+m.get.name()+'"]').closest(v.checkbox)},name:function(){return w.attr("name")}},is:{radio:function(){return w.hasClass(g.radio)||"radio"==w.attr("type")},checked:function(){return w.prop("checked")!==i&&w.prop("checked")},unchecked:function(){return!m.is.checked()}},can:{change:function(){return!(x.hasClass(g.disabled)||x.hasClass(g.readOnly)||w.prop("disabled"))},uncheck:function(){return"boolean"==typeof f.uncheckable?f.uncheckable:!m.is.radio()}},set:{checked:function(){var e;m.is.radio()&&(e=m.get.radios(),m.debug("Unchecking other radios",e),e.removeClass(g.checked)),x.addClass(g.checked)},tab:function(){w.attr("tabindex")===i&&w.attr("tabindex",0)}},create:{label:function(){w.prevAll(v.label).length>0?(w.prev(v.label).detach().insertAfter(w),m.debug("Moving existing label",C)):m.has.label()||(C=e("