!function(n,t,i,r){n.site=n.fn.site=function(u){var f,o,l=(new Date).getTime(),h=[],y=arguments[0],b="string"==typeof y,k=[].slice.call(arguments,1),e=n.isPlainObject(u)?n.extend(!0,{},n.site.settings,u):n.extend({},n.site.settings),a=e.namespace,p=e.error,v="module-"+a,c=n(i),w=this,s=c.data(v);return f={initialize:function(){f.instantiate()},instantiate:function(){f.verbose("Storing instance of site",f);s=f;c.data(v,f)},normalize:function(){f.fix.console();f.fix.requestAnimationFrame()},fix:{console:function(){f.debug("Normalizing window.console");console!==r&&console.log!==r||(f.verbose("Console not available, normalizing events"),f.disable.console());void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(f.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){});void 0===console.markTimeline&&(f.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){f.debug("Disabling programmatic console clearing");t.console.clear=function(){}},requestAnimationFrame:function(){f.debug("Normalizing requestAnimationFrame");t.requestAnimationFrame===r&&(f.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)})}},moduleExists:function(t){return n.fn[t]!==r&&n.fn[t].settings!==r},enabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)&&i.push(t)}),i}},disabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)||i.push(t)}),i}},change:{setting:function(t,i,u,o){u="string"==typeof u?"all"===u?e.modules:[u]:u||e.modules;o=o===r||o;n.each(u,function(r,u){var e,s=!f.moduleExists(u)||n.fn[u].settings.namespace||!1;f.moduleExists(u)&&(f.verbose("Changing default setting",t,i,u),n.fn[u].settings[t]=i,o&&s&&(e=n(":data(module-"+s+")")).length>0&&(f.verbose("Modifying existing settings",e),e[u]("setting",t,i)))})},settings:function(t,i,u){i="string"==typeof i?[i]:i||e.modules;u=u===r||u;n.each(i,function(i,r){var e;f.moduleExists(r)&&(f.verbose("Changing default setting",t,r),n.extend(!0,n.fn[r].settings,t),u&&a&&(e=n(":data(module-"+a+")")).length>0&&(f.verbose("Modifying existing settings",e),e[r]("setting",t)))})}},enable:{console:function(){f.console(!0)},debug:function(n,t){n=n||e.modules;f.debug("Enabling debug for modules",n);f.change.setting("debug",!0,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Enabling verbose debug for modules",n);f.change.setting("verbose",!0,n,t)}},disable:{console:function(){f.console(!1)},debug:function(n,t){n=n||e.modules;f.debug("Disabling debug for modules",n);f.change.setting("debug",!1,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Disabling verbose debug for modules",n);f.change.setting("verbose",!1,n,t)}},console:function(n){if(n){if(s.cache.console===r)return void f.error(p.console);f.debug("Restoring console function");t.console=s.cache.console}else f.debug("Disabling console function"),s.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(){f.verbose("Destroying previous site for",c);c.removeData(v)},cache:{},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,e,t);else{if(i===r)return e[t];e[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,f,t);else{if(i===r)return f[t];f[t]=i}},debug:function(){e.debug&&(e.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,e.name+":"),f.debug.apply(console,arguments)))},verbose:function(){e.verbose&&e.debug&&(e.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,e.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,e.name+":");f.error.apply(console,arguments)},performance:{log:function(n){var t,i;e.performance&&(i=(t=(new Date).getTime())-(l||t),l=t,h.push({Element:w,Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(f.performance.timer);f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=e.name+":",i=0;l=!1;clearTimeout(f.performance.timer);n.each(h,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";(console.group!==r||console.table!==r)&&h.length>0&&(console.groupCollapsed(t),console.table?console.table(h):n.each(h,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());h=[]}},invoke:function(t,i,u){var l,h,c,e=s;return i=i||k,u=w||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),l=t.length-1,n.each(t,function(i,u){var o=i!=l?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[o])&&i!=l)e=e[o];else{if(e[o]!==r)return h=e[o],!1;if(!n.isPlainObject(e[u])||i==l)return e[u]!==r?(h=e[u],!1):(f.error(p.method,t),!1);e=e[u]}})),n.isFunction(h)?c=h.apply(u,i):h!==r&&(c=h),n.isArray(o)?o.push(c):o!==r?o=[o,c]:c!==r&&(o=c),h}},b?(s===r&&f.initialize(),f.invoke(y)):(s!==r&&f.destroy(),f.initialize()),o!==r?o:this};n.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","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}};n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])}})}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.form=function(t){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c=arguments[1],l="string"==typeof h,a=[].slice.call(arguments,1);return e.each(function(){var k,nt,ht,ct,y,w,tt,p,g,lt,ot,st,ft,d,it,v,b=n(this),rt=this,ut=[],et=!1;(v={initialize:function(){v.get.settings();l?(it===r&&v.instantiate(),v.invoke(h)):(it!==r&&it.invoke("destroy"),v.verbose("Initializing form validation",b,y),v.bindEvents(),v.set.defaults(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);it=v;b.data(ft,v)},destroy:function(){v.verbose("Destroying previous module",it);v.removeEvents();b.removeData(ft)},refresh:function(){v.verbose("Refreshing selector cache");k=b.find(p.field);nt=b.find(p.group);ht=b.find(p.message);b.find(p.prompt);ct=b.find(p.submit);b.find(p.clear);b.find(p.reset)},submit:function(){v.verbose("Submitting form",b);b.submit()},attachEvents:function(t,i){i=i||"submit";n(t).on("click"+d,function(n){v[i]();n.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events");b.on("submit"+d,v.validate.form).on("blur"+d,p.field,v.event.field.blur).on("click"+d,p.submit,v.submit).on("click"+d,p.reset,v.reset).on("click"+d,p.clear,v.clear);y.keyboardShortcuts&&b.on("keydown"+d,p.field,v.event.field.keydown);k.each(function(){var t=n(this),i=t.prop("type"),r=v.get.changeEvent(i,t);n(this).on(r+d,v.event.field.change)})},clear:function(){k.each(function(){var t=n(this),i=t.parent(),r=t.closest(nt),f=r.find(p.prompt),u=t.data(tt.defaultValue)||"",e=i.is(p.uiCheckbox),o=i.is(p.uiDropdown);r.hasClass(g.error)&&(v.verbose("Resetting error on field",r),r.removeClass(g.error),f.remove());o?(v.verbose("Resetting dropdown value",i,u),i.dropdown("clear")):e?t.prop("checked",!1):(v.verbose("Resetting field value",t,u),t.val(""))})},reset:function(){k.each(function(){var t=n(this),u=t.parent(),f=t.closest(nt),e=f.find(p.prompt),i=t.data(tt.defaultValue),o=u.is(p.uiCheckbox),s=u.is(p.uiDropdown),h=f.hasClass(g.error);i!==r&&(h&&(v.verbose("Resetting error on field",f),f.removeClass(g.error),e.remove()),s?(v.verbose("Resetting dropdown value",u,i),u.dropdown("restore defaults")):o?(v.verbose("Resetting checkbox value",u,i),t.prop("checked",i)):(v.verbose("Resetting field value",t,i),t.val(i)))})},determine:{isValid:function(){var t=!0;return n.each(w,function(n,i){v.validate.field(i,n,!0)||(t=!1)}),t}},is:{bracketedRule:function(n){return n.type&&n.type.match(y.regExp.bracket)},shorthandFields:function(n){var t=n[Object.keys(n)[0]];return v.is.shorthandRules(t)},shorthandRules:function(t){return"string"==typeof t||n.isArray(t)},empty:function(n){return!n||0===n.length||(n.is('input[type="checkbox"]')?!n.is(":checked"):v.is.blank(n))},blank:function(t){return""===n.trim(t.val())},valid:function(t){var i=!0;return t?(v.verbose("Checking if field is valid",t),v.validate.field(w[t],t,!1)):(v.verbose("Checking if form is valid"),n.each(w,function(n){v.is.valid(n)||(i=!1)}),i)}},removeEvents:function(){b.off(d);k.off(d);ct.off(d);k.off(d)},event:{field:{keydown:function(t){var i=n(this),r=t.which,u=i.is(p.input),f=i.is(p.checkbox),e=i.closest(p.uiDropdown).length>0;r==27&&(v.verbose("Escape key pressed blurring field"),i.blur());t.ctrlKey||r!=13||!u||e||f||(et||(i.one("keyup"+d,v.event.field.keyup),v.submit(),v.debug("Enter pressed on input submitting form")),et=!0)},keyup:function(){et=!1},blur:function(){var i=n(this),r=i.closest(nt),t=v.get.validation(i);r.hasClass(g.error)?(v.debug("Revalidating field",i,t),t&&v.validate.field(t)):"blur"==y.on&&t&&v.validate.field(t)},change:function(){var t=n(this),r=t.closest(nt),i=v.get.validation(t);i&&("change"==y.on||r.hasClass(g.error)&&y.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,v.get.validation(t));v.validate.field(i)},y.delay))}}},get:{ancillaryValue:function(n){return!(!n.type||!n.value&&!v.is.bracketedRule(n))&&(n.value!==r?n.value:n.type.match(y.regExp.bracket)[1]+"")},ruleName:function(n){return v.is.bracketedRule(n)?n.type.replace(n.type.match(y.regExp.bracket)[0],""):n.type},changeEvent:function(n,t){return"checkbox"==n||"radio"==n||"hidden"==n||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return i.createElement("input").oninput!==r?"input":i.createElement("input").onpropertychange!==r?"propertychange":"keyup"},fieldsFromShorthand:function(t){var i={};return n.each(t,function(t,r){"string"==typeof r&&(r=[r]);i[t]={rules:[]};n.each(r,function(n,r){i[t].rules.push({type:r})})}),i},prompt:function(t,i){var f,e,o=v.get.ruleName(t),s=v.get.ancillaryValue(t),u=v.get.field(i.identifier),h=u.val(),r=n.isFunction(t.prompt)?t.prompt(h):t.prompt||y.prompt[o]||y.text.unspecifiedRule,c=-1!==r.search("{value}"),l=-1!==r.search("{name}");return c&&(r=r.replace("{value}",u.val())),l&&(e=1==(f=u.closest(p.group).find("label").eq(0)).length?f.text():u.prop("placeholder")||y.text.unspecifiedField,r=r.replace("{name}",e)),r=(r=r.replace("{identifier}",i.identifier)).replace("{ruleValue}",s),t.prompt||v.verbose("Using default validation prompt for type",r,o),r},settings:function(){if(n.isPlainObject(t)){var i=Object.keys(t);i.length>0&&t[i[0]].identifier!==r&&t[i[0]].rules!==r?(y=n.extend(!0,{},n.fn.form.settings,c),w=n.extend({},n.fn.form.settings.defaults,t),v.error(y.error.oldSyntax,rt),v.verbose("Extending settings from legacy parameters",w,y)):(t.fields&&v.is.shorthandFields(t.fields)&&(t.fields=v.get.fieldsFromShorthand(t.fields)),y=n.extend(!0,{},n.fn.form.settings,t),w=n.extend({},n.fn.form.settings.defaults,y.fields),v.verbose("Extending settings",w,y))}else y=n.fn.form.settings,w=n.fn.form.settings.defaults,v.verbose("Using default form validation",w,y);st=y.namespace;tt=y.metadata;p=y.selector;g=y.className;lt=y.regExp;ot=y.error;ft="module-"+st;d="."+st;it=b.data(ft);v.refresh()},field:function(t){return v.verbose("Finding field with identifier",t),t=v.escape.string(t),k.filter("#"+t).length>0?k.filter("#"+t):k.filter('[name="'+t+'"]').length>0?k.filter('[name="'+t+'"]'):k.filter('[name="'+t+'[]"]').length>0?k.filter('[name="'+t+'[]"]'):k.filter("[data-"+tt.validate+'="'+t+'"]').length>0?k.filter("[data-"+tt.validate+'="'+t+'"]'):n("<input/>")},fields:function(t){var i=n();return n.each(t,function(n,t){i=i.add(v.get.field(t))}),i},validation:function(t){var r,i;return!!w&&(n.each(w,function(n,u){i=u.identifier||n;v.get.field(i)[0]==t[0]&&(u.identifier=i,r=u)}),r||!1)},value:function(n){var t=[];return t.push(n),v.get.values.call(rt,t)[n]},values:function(t){var i={};return(n.isArray(t)?v.get.fields(t):k).each(function(t,u){var e=n(u),f=(e.prop("type"),e.prop("name")),o=e.val(),s=e.is(p.checkbox),c=e.is(p.radio),l=-1!==f.indexOf("[]"),h=!!s&&e.is(":checked");f&&(l?(f=f.replace("[]",""),i[f]||(i[f]=[]),s?h?i[f].push(o||!0):i[f].push(!1):i[f].push(o)):c?i[f]!==r&&0!=i[f]||(i[f]=!!h&&(o||!0)):i[f]=s?!!h&&(o||!0):o)}),i}},has:{field:function(n){return v.verbose("Checking for existence of a field with identifier",n),"string"!=typeof(n=v.escape.string(n))&&v.error(ot.identifier,n),k.filter("#"+n).length>0||k.filter('[name="'+n+'"]').length>0||k.filter("[data-"+tt.validate+'="'+n+'"]').length>0}},escape:{string:function(n){return(n=String(n)).replace(lt.escape,"\\$&")}},add:{rule:function(n,t){v.add.field(n,t)},field:function(t,i){var r={};v.is.shorthandRules(i)?(i=n.isArray(i)?i:[i],r[t]={rules:[]},n.each(i,function(n,i){r[t].rules.push({type:i})})):r[t]=i;w=n.extend({},w,r);v.debug("Adding rules",r,w)},fields:function(t){var i;i=t&&v.is.shorthandFields(t)?v.get.fieldsFromShorthand(t):t;w=n.extend({},w,i)},prompt:function(t,i){var f=v.get.field(t).closest(nt),u=f.children(p.prompt),e=0!==u.length;i="string"==typeof i?[i]:i;v.verbose("Adding field error state",t);f.addClass(g.error);y.inline&&(e||(u=y.templates.prompt(i)).appendTo(f),u.html(i[0]),e?v.verbose("Inline errors are disabled, no inline error added",t):y.transition&&n.fn.transition!==r&&b.transition("is supported")?(v.verbose("Displaying error with css transition",y.transition),u.transition(y.transition+" in",y.duration)):(v.verbose("Displaying error with fallback javascript animation"),u.fadeIn(y.duration)))},errors:function(n){v.debug("Adding form error messages",n);v.set.error();ht.html(y.templates.error(n))}},remove:{rule:function(t,i){var u=n.isArray(i)?i:[i];if(i==r)return v.debug("Removed all rules"),void(w[t].rules=[]);w[t]!=r&&n.isArray(w[t].rules)&&n.each(w[t].rules,function(n,i){-1!==u.indexOf(i.type)&&(v.debug("Removed rule",i.type),w[t].rules.splice(n,1))})},field:function(t){var i=n.isArray(t)?t:[t];n.each(i,function(n,t){v.remove.rule(t)})},rules:function(t,i){n.isArray(t)?n.each(fields,function(n,t){v.remove.rule(t,i)}):v.remove.rule(t,i)},fields:function(n){v.remove.field(n)},prompt:function(t){var u=v.get.field(t).closest(nt),i=u.children(p.prompt);u.removeClass(g.error);y.inline&&i.is(":visible")&&(v.verbose("Removing prompt for field",t),y.transition&&n.fn.transition!==r&&b.transition("is supported")?i.transition(y.transition+" out",y.duration,function(){i.remove()}):i.fadeOut(y.duration,function(){i.remove()}))}},set:{success:function(){b.removeClass(g.error).addClass(g.success)},defaults:function(){k.each(function(){var t=n(this),i=t.filter(p.checkbox).length>0?t.is(":checked"):t.val();t.data(tt.defaultValue,i)})},error:function(){b.removeClass(g.success).addClass(g.error)},value:function(n,t){var i={};return i[n]=t,v.set.values.call(rt,i)},values:function(t){n.isEmptyObject(t)||n.each(t,function(t,i){var f,u=v.get.field(t),r=u.parent(),o=n.isArray(i),e=r.is(p.uiCheckbox),s=r.is(p.uiDropdown),h=u.is(p.radio)&&e;u.length>0&&(o&&e?(v.verbose("Selecting multiple",i,u),r.checkbox("uncheck"),n.each(i,function(n,t){f=u.filter('[value="'+t+'"]');r=f.parent();f.length>0&&r.checkbox("check")})):h?(v.verbose("Selecting radio value",i,u),u.filter('[value="'+i+'"]').parent(p.uiCheckbox).checkbox("check")):e?(v.verbose("Setting checkbox value",i,r),!0===i?r.checkbox("check"):r.checkbox("uncheck")):s?(v.verbose("Setting dropdown value",i,r),r.dropdown("set selected",i)):(v.verbose("Setting field value",i,u),u.val(i)))})}},validate:{form:function(n,t){var i=v.get.values();if(et)return!1;if(ut=[],v.determine.isValid()){if(v.debug("Form has no validation errors, submitting"),v.set.success(),!0!==t)return y.onSuccess.call(rt,n,i)}else if(v.debug("Form has errors"),v.set.error(),y.inline||v.add.errors(ut),b.data("moduleApi")!==r&&n.stopImmediatePropagation(),!0!==t)return y.onFailure.call(rt,ut,i)},field:function(t,i,u){u=u===r||u;"string"==typeof t&&(v.verbose("Validating field",t),i=t,t=w[t]);var f=t.identifier||i,s=v.get.field(f),h=!!t.depends&&v.get.field(t.depends),e=!0,o=[];return t.identifier||(v.debug("Using field name as identifier",f),t.identifier=f),s.prop("disabled")?(v.debug("Field is disabled. Skipping",f),e=!0):t.optional&&v.is.blank(s)?(v.debug("Field is optional and blank. Skipping",f),e=!0):t.depends&&v.is.empty(h)?(v.debug("Field depends on another value that is not present or empty. Skipping",h),e=!0):t.rules!==r&&n.each(t.rules,function(n,i){v.has.field(f)&&!v.validate.rule(t,i)&&(v.debug("Field is invalid",f,i.type),o.push(v.get.prompt(i,t)),e=!1)}),e?(u&&(v.remove.prompt(f,o),y.onValid.call(s)),!0):(u&&(ut=ut.concat(o),v.add.prompt(f,o),y.onInvalid.call(s,o)),!1)},rule:function(t,i){var f=v.get.field(t.identifier),u=(i.type,f.val()),s=v.get.ancillaryValue(i),e=v.get.ruleName(i),o=y.rules[e];if(n.isFunction(o))return u=u===r||""===u||null===u?"":n.trim(u+""),o.call(f,u,s);v.error(ot.noRule,e)}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:rt,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=it;return i=i||a,f=rt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}}).initialize()}),u!==r?u:this};n.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:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain  "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},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:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(t){var i='<ul class="list">';return n.each(t,function(n,t){i+="<li>"+t+"<\/li>"}),n(i+="<\/ul>")},prompt:function(t){return n("<div/>").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(t===r||""===t||n.isArray(t)&&0===t.length)},checked:function(){return n(this).filter(":checked").length>0},email:function(t){return n.fn.form.settings.regExp.email.test(t)},url:function(t){return n.fn.form.settings.regExp.url.test(t)},regExp:function(t,i){if(i instanceof RegExp)return t.match(i);var u,r=i.match(n.fn.form.settings.regExp.flags);return r&&(i=r.length>=2?r[1]:i,u=r.length>=3?r[2]:""),t.match(new RegExp(i,u))},integer:function(t,i){var f,e,u,o=n.fn.form.settings.regExp.integer;return i&&-1===["",".."].indexOf(i)&&(-1==i.indexOf("..")?o.test(i)&&(f=e=+i):(u=i.split("..",2),o.test(u[0])&&(f=u[0]-0),o.test(u[1])&&(e=u[1]-0))),o.test(t)&&(f===r||t>=f)&&(e===r||t<=e)},decimal:function(t){return n.fn.form.settings.regExp.decimal.test(t)},number:function(t){return n.fn.form.settings.regExp.number.test(t)},is:function(n,t){return t="string"==typeof t?t.toLowerCase():t,(n="string"==typeof n?n.toLowerCase():n)==t},isExactly:function(n,t){return n==t},not:function(n,t){return(n="string"==typeof n?n.toLowerCase():n)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(n,t){return n!=t},contains:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i,"i"))},containsExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i))},doesntContain:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i,"i"))},doesntContainExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i))},minLength:function(n,t){return n!==r&&n.length>=t},length:function(n,t){return n!==r&&n.length>=t},exactLength:function(n,t){return n!==r&&n.length==t},maxLength:function(n,t){return n!==r&&n.length<=t},match:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r&&t.toString()==u.toString()},different:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r&&t.toString()!==u.toString()},creditCard:function(t,i){var e,r,u={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},o={},s=!1,h="string"==typeof i&&i.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),h&&(n.each(h,function(i,f){(r=u[f])&&(o={length:-1!==n.inArray(t.length,r.length),pattern:-1!==t.search(r.pattern)}).length&&o.pattern&&(s=!0)}),!s))return!1;if((e={number:-1!==n.inArray(t.length,u.unionPay.length),pattern:-1!==t.search(u.unionPay.pattern)}).number&&e.pattern)return!0;for(var c=t.length,l=0,a=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=a[l][parseInt(t.charAt(c),10)],l^=1;return f%10==0&&f>0}},minCount:function(n,t){return 0==t||(1==t?""!==n:n.split(",").length>=t)},exactCount:function(n,t){return 0==t?""===n:1==t?""!==n&&-1===n.search(","):n.split(",").length==t},maxCount:function(n,t){return 0!=t&&(1==t?-1===n.search(","):n.split(",").length<=t)}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.accordion=function(i){var u,o=n(this),e=(new Date).getTime(),f=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame,o.each(function(){var nt,a,l=n.isPlainObject(i)?n.extend(!0,{},n.fn.accordion.settings,i):n.extend({},n.fn.accordion.settings),v=l.className,tt=l.namespace,y=l.selector,ut=l.error,it="."+tt,d="module-"+tt,rt=o.selector||"",p=n(this),b=p.find(y.title),w=p.find(y.content),g=this,k=p.data(d);a={initialize:function(){a.debug("Initializing",p);a.bind.events();l.observeChanges&&a.observeChanges();a.instantiate()},instantiate:function(){k=a;p.data(d,a)},destroy:function(){a.debug("Destroying previous instance",p);p.off(it).removeData(d)},refresh:function(){b=p.find(y.title);w=p.find(y.content)},observeChanges:function(){"MutationObserver"in t&&((nt=new MutationObserver(function(){a.debug("DOM tree modified, updating selector cache");a.refresh()})).observe(g,{childList:!0,subtree:!0}),a.debug("Setting up mutation observer",nt))},bind:{events:function(){a.debug("Binding delegated events");p.on(l.on+it,y.trigger,a.event.click)}},event:{click:function(){a.toggle.call(this)}},toggle:function(t){var i=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),u=i.next(w),f=u.hasClass(v.animating),e=u.hasClass(v.active),o=e&&!f,s=!e&&f;a.debug("Toggling visibility of content",i);o||s?l.collapsible?a.close.call(i):a.debug("Cannot close accordion content collapsing is disabled"):a.open.call(i)},open:function(t){var u=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=u.next(w),f=i.hasClass(v.animating);i.hasClass(v.active)||f?a.debug("Accordion already open, skipping",i):(a.debug("Opening accordion content",u),l.onOpening.call(i),l.onChanging.call(i),l.exclusive&&a.closeOthers.call(u),u.addClass(v.active),i.stop(!0,!0).addClass(v.animating),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):i.children().stop(!0,!0).animate({opacity:1},l.duration,a.resetOpacity)),i.slideDown(l.duration,l.easing,function(){i.removeClass(v.animating).addClass(v.active);a.reset.display.call(this);l.onOpen.call(this);l.onChange.call(this)}))},close:function(t){var f=t!==r?"number"==typeof t?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=f.next(w),e=i.hasClass(v.animating),u=i.hasClass(v.active);(u||!u&&e)&&(!u||!e)&&(a.debug("Closing accordion content",i),l.onClosing.call(i),l.onChanging.call(i),f.removeClass(v.active),i.stop(!0,!0).addClass(v.animating),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):i.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),i.slideUp(l.duration,l.easing,function(){i.removeClass(v.animating).removeClass(v.active);a.reset.display.call(this);l.onClose.call(this);l.onChange.call(this)}))},closeOthers:function(t){var i,s,u,h=t!==r?b.eq(t):n(this).closest(y.title),f=h.parents(y.content).prev(y.title),e=h.closest(y.accordion),o=y.title+"."+v.active+":visible",c=y.content+"."+v.active+":visible";l.closeNested?u=(i=e.find(o).not(f)).next(w):(i=e.find(o).not(f),s=e.find(c).find(o).not(f),u=(i=i.not(s)).next(w));i.length>0&&(a.debug("Exclusive enabled, closing other content",i),i.removeClass(v.active),u.removeClass(v.animating).stop(!0,!0),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?u.children().transition({animation:"fade out",useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):u.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),u.slideUp(l.duration,l.easing,function(){n(this).removeClass(v.active);a.reset.display.call(this)}))},reset:{display:function(){a.verbose("Removing inline display from element",this);n(this).css("display","");""===n(this).attr("style")&&n(this).attr("style","").removeAttr("style")},opacity:function(){a.verbose("Removing inline opacity from element",this);n(this).css("opacity","");""===n(this).attr("style")&&n(this).attr("style","").removeAttr("style")}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];n.isPlainObject(l[t])?n.extend(!0,l[t],i):l[t]=i}},internal:function(t,i){if(a.debug("Changing internal",t,i),i===r)return a[t];n.isPlainObject(t)?n.extend(!0,a,t):a[t]=i},debug:function(){!l.silent&&l.debug&&(l.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,l.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),a.verbose.apply(console,arguments)))},error:function(){l.silent||(a.error=Function.prototype.bind.call(console.error,console,l.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;l.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=l.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";rt&&(t+=" '"+rt+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=k;return i=i||c,f=g||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(a.error(ut.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};h?(k===r&&a.initialize(),a.invoke(s)):(k!==r&&k.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen: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"}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.checkbox=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var ft,s,v=n.extend(!0,{},n.fn.checkbox.settings,u),b=v.className,et=v.namespace,k=v.selector,ot=v.error,d="."+et,rt="module-"+et,p=n(this),g=n(this).children(k.label),y=n(this).children(k.input),w=y[0],tt=!1,it=!1,nt=p.data(rt),ut=this;s={initialize:function(){s.verbose("Initializing checkbox",v);s.create.label();s.bind.events();s.set.tabbable();s.hide.input();s.observeChanges();s.instantiate();s.setup()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;p.data(rt,s)},destroy:function(){s.verbose("Destroying module");s.unbind.events();s.show.input();p.removeData(rt)},fix:{reference:function(){p.is(k.input)&&(s.debug("Behavior called on <input> adjusting invoked element"),p=p.closest(k.checkbox),s.refresh())}},setup:function(){s.set.initialLoad();s.is.indeterminate()?(s.debug("Initial value is indeterminate"),s.indeterminate()):s.is.checked()?(s.debug("Initial value is checked"),s.check()):(s.debug("Initial value is unchecked"),s.uncheck());s.remove.initialLoad()},refresh:function(){g=p.children(k.label);y=p.children(k.input);w=y[0]},hide:{input:function(){s.verbose("Modifying <input> z-index to be unselectable");y.addClass(b.hidden)}},show:{input:function(){s.verbose("Modifying <input> z-index to be selectable");y.removeClass(b.hidden)}},observeChanges:function(){"MutationObserver"in t&&((ft=new MutationObserver(function(){s.debug("DOM tree modified, updating selector cache");s.refresh()})).observe(ut,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",ft))},attachEvents:function(t,i){var r=n(t);i=n.isFunction(s[i])?s[i]:s.toggle;r.length>0?(s.debug("Attaching checkbox events to element",t,i),r.on("click"+d,i)):s.error(ot.notFound)},event:{click:function(t){var i=n(t.target);i.is(k.input)?s.verbose("Using default check action on initialized checkbox"):i.is(k.link)?s.debug("Clicking link inside checkbox, skipping toggle"):(s.toggle(),y.focus(),t.preventDefault())},keydown:function(n){var t=n.which;t==27?(s.verbose("Escape key pressed blurring field"),y.blur(),it=!0):n.ctrlKey||t!=32&&t!=13?it=!1:(s.verbose("Enter/space key pressed, toggling checkbox"),s.toggle(),it=!0)},keyup:function(n){it&&n.preventDefault()}},check:function(){s.should.allowCheck()&&(s.debug("Checking checkbox",y),s.set.checked(),s.should.ignoreCallbacks()||(v.onChecked.call(w),v.onChange.call(w)))},uncheck:function(){s.should.allowUncheck()&&(s.debug("Unchecking checkbox"),s.set.unchecked(),s.should.ignoreCallbacks()||(v.onUnchecked.call(w),v.onChange.call(w)))},indeterminate:function(){s.should.allowIndeterminate()?s.debug("Checkbox is already indeterminate"):(s.debug("Making checkbox indeterminate"),s.set.indeterminate(),s.should.ignoreCallbacks()||(v.onIndeterminate.call(w),v.onChange.call(w)))},determinate:function(){s.should.allowDeterminate()?s.debug("Checkbox is already determinate"):(s.debug("Making checkbox determinate"),s.set.determinate(),s.should.ignoreCallbacks()||(v.onDeterminate.call(w),v.onChange.call(w)))},enable:function(){s.is.enabled()?s.debug("Checkbox is already enabled"):(s.debug("Enabling checkbox"),s.set.enabled(),v.onEnable.call(w),v.onEnabled.call(w))},disable:function(){s.is.disabled()?s.debug("Checkbox is already disabled"):(s.debug("Disabling checkbox"),s.set.disabled(),v.onDisable.call(w),v.onDisabled.call(w))},get:{radios:function(){var t=s.get.name();return n('input[name="'+t+'"]').closest(k.checkbox)},otherRadios:function(){return s.get.radios().not(p)},name:function(){return y.attr("name")}},is:{initialLoad:function(){return tt},radio:function(){return y.hasClass(b.radio)||"radio"==y.attr("type")},indeterminate:function(){return y.prop("indeterminate")!==r&&y.prop("indeterminate")},checked:function(){return y.prop("checked")!==r&&y.prop("checked")},disabled:function(){return y.prop("disabled")!==r&&y.prop("disabled")},enabled:function(){return!s.is.disabled()},determinate:function(){return!s.is.indeterminate()},unchecked:function(){return!s.is.checked()}},should:{allowCheck:function(){return s.is.determinate()&&s.is.checked()&&!s.should.forceCallbacks()?(s.debug("Should not allow check, checkbox is already checked"),!1):!1!==v.beforeChecked.apply(w)||(s.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return s.is.determinate()&&s.is.unchecked()&&!s.should.forceCallbacks()?(s.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!1!==v.beforeUnchecked.apply(w)||(s.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return s.is.indeterminate()&&!s.should.forceCallbacks()?(s.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!1!==v.beforeIndeterminate.apply(w)||(s.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return s.is.determinate()&&!s.should.forceCallbacks()?(s.debug("Should not allow determinate, checkbox is already determinate"),!1):!1!==v.beforeDeterminate.apply(w)||(s.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return s.is.initialLoad()&&v.fireOnInit},ignoreCallbacks:function(){return tt&&!v.fireOnInit}},can:{change:function(){return!(p.hasClass(b.disabled)||p.hasClass(b.readOnly)||y.prop("disabled")||y.prop("readonly"))},uncheck:function(){return"boolean"==typeof v.uncheckable?v.uncheckable:!s.is.radio()}},set:{initialLoad:function(){tt=!0},checked:function(){s.verbose("Setting class to checked");p.removeClass(b.indeterminate).addClass(b.checked);s.is.radio()&&s.uncheckOthers();s.is.indeterminate()||!s.is.checked()?(s.verbose("Setting state to checked",w),y.prop("indeterminate",!1).prop("checked",!0),s.trigger.change()):s.debug("Input is already checked, skipping input property change")},unchecked:function(){s.verbose("Removing checked class");p.removeClass(b.indeterminate).removeClass(b.checked);s.is.indeterminate()||!s.is.unchecked()?(s.debug("Setting state to unchecked"),y.prop("indeterminate",!1).prop("checked",!1),s.trigger.change()):s.debug("Input is already unchecked")},indeterminate:function(){s.verbose("Setting class to indeterminate");p.addClass(b.indeterminate);s.is.indeterminate()?s.debug("Input is already indeterminate, skipping input property change"):(s.debug("Setting state to indeterminate"),y.prop("indeterminate",!0),s.trigger.change())},determinate:function(){s.verbose("Removing indeterminate class");p.removeClass(b.indeterminate);s.is.determinate()?s.debug("Input is already determinate, skipping input property change"):(s.debug("Setting state to determinate"),y.prop("indeterminate",!1))},disabled:function(){s.verbose("Setting class to disabled");p.addClass(b.disabled);s.is.disabled()?s.debug("Input is already disabled, skipping input property change"):(s.debug("Setting state to disabled"),y.prop("disabled","disabled"),s.trigger.change())},enabled:function(){s.verbose("Removing disabled class");p.removeClass(b.disabled);s.is.enabled()?s.debug("Input is already enabled, skipping input property change"):(s.debug("Setting state to enabled"),y.prop("disabled",!1),s.trigger.change())},tabbable:function(){s.verbose("Adding tabindex to checkbox");y.attr("tabindex")===r&&y.attr("tabindex",0)}},remove:{initialLoad:function(){tt=!1}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=y[0];t&&(s.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},create:{label:function(){y.prevAll(k.label).length>0?(y.prev(k.label).detach().insertAfter(y),s.debug("Moving existing label",g)):s.has.label()||(g=n("<label>").insertAfter(y),s.debug("Creating label",g))}},has:{label:function(){return g.length>0}},bind:{events:function(){s.verbose("Attaching checkbox events");p.on("click"+d,s.event.click).on("keydown"+d,k.input,s.event.keydown).on("keyup"+d,k.input,s.event.keyup)}},unbind:{events:function(){s.debug("Removing events");p.off(d)}},uncheckOthers:function(){var n=s.get.otherRadios();s.debug("Unchecking other radios",n);n.removeClass(b.checked)},toggle:function(){s.can.change()?s.is.indeterminate()||s.is.unchecked()?(s.debug("Currently unchecked"),s.check()):s.is.checked()&&s.can.uncheck()&&(s.debug("Currently checked"),s.uncheck()):s.is.radio()||s.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(t,i){if(s.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else{if(i===r)return s[t];s[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ut,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var c,o,h,e=nt;return i=i||a,u=ut||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?(o=e[u],!1):(s.error(ot.method,t),!1);e=e[u]}})),n.isFunction(o)?h=o.apply(u,i):o!==r&&(h=o),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dimmer=function(t){var u,e=n(this),o=(new Date).getTime(),f=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var v,y,l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.dimmer.settings,t):n.extend({},n.fn.dimmer.settings),b=a.selector,tt=a.namespace,p=a.className,ut=a.error,k="."+tt,nt="module-"+tt,it=e.selector||"",rt="ontouchstart"in i.documentElement?"touchstart":"click",w=n(this),d=this,g=w.data(nt);(l={preinitialize:function(){l.is.dimmer()?(y=w.parent(),v=w):(y=w,v=l.has.dimmer()?a.dimmerName?y.find(b.dimmer).filter("."+a.dimmerName):y.find(b.dimmer):l.create(),l.set.variation())},initialize:function(){l.debug("Initializing dimmer",a);l.bind.events();l.set.dimmable();l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);g=l;w.data(nt,g)},destroy:function(){l.verbose("Destroying previous module",v);l.unbind.events();l.remove.variation();y.off(k)},bind:{events:function(){l.is.page()&&y.get(0).addEventListener("touchmove",l.event.preventScroll,{passive:!1});"hover"==a.on?y.on("mouseenter"+k,l.show).on("mouseleave"+k,l.hide):"click"==a.on&&y.on(rt+k,l.toggle);l.is.page()&&(l.debug("Setting as a page dimmer",y),l.set.pageDimmer());l.is.closable()&&(l.verbose("Adding dimmer close event",v),y.on(rt+k,b.dimmer,l.event.click))}},unbind:{events:function(){l.is.page()&&y.get(0).removeEventListener("touchmove",l.event.preventScroll,{passive:!1});w.removeData(nt);y.off(k)}},event:{click:function(t){l.verbose("Determining if event occured on dimmer",t);(0===v.find(t.target).length||n(t.target).is(b.content))&&(l.hide(),t.stopImmediatePropagation())},preventScroll:function(n){n.preventDefault()}},addContent:function(t){var i=n(t);l.debug("Add content to dimmer",i);i.parent()[0]!==v[0]&&i.detach().appendTo(v)},create:function(){var t=n(a.template.dimmer());return a.dimmerName&&(l.debug("Creating named dimmer",a.dimmerName),t.addClass(a.dimmerName)),t.appendTo(y),t},show:function(t){t=n.isFunction(t)?t:function(){};l.debug("Showing dimmer",v,a);l.is.dimmed()&&!l.is.animating()||!l.is.enabled()?l.debug("Dimmer is already shown or disabled"):(l.animate.show(t),a.onShow.call(d),a.onChange.call(d))},hide:function(t){t=n.isFunction(t)?t:function(){};l.is.dimmed()||l.is.animating()?(l.debug("Hiding dimmer",v),l.animate.hide(t),a.onHide.call(d),a.onChange.call(d)):l.debug("Dimmer is not visible")},toggle:function(){l.verbose("Toggling dimmer visibility",v);l.is.dimmed()?l.hide():l.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?("auto"!==a.opacity&&l.set.opacity(),v.transition({displayType:"flex",animation:a.transition+" in",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.set.dimmed()},onComplete:function(){l.set.active();t()}})):(l.verbose("Showing dimmer animation with javascript"),l.set.dimmed(),"auto"==a.opacity&&(a.opacity=.8),v.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(l.get.duration(),a.opacity,function(){v.removeAttr("style");l.set.active();t()}))},hide:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(l.verbose("Hiding dimmer with css"),v.transition({displayType:"flex",animation:a.transition+" out",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.remove.dimmed()},onComplete:function(){l.remove.active();t()}})):(l.verbose("Hiding dimmer with javascript"),l.remove.dimmed(),v.stop().fadeOut(l.get.duration(),function(){l.remove.active();v.removeAttr("style");t()}))}},get:{dimmer:function(){return v},duration:function(){return"object"==typeof a.duration?l.is.active()?a.duration.hide:a.duration.show:a.duration}},has:{dimmer:function(){return a.dimmerName?w.find(b.dimmer).filter("."+a.dimmerName).length>0:w.find(b.dimmer).length>0}},is:{active:function(){return v.hasClass(p.active)},animating:function(){return v.is(":animated")||v.hasClass(p.animating)},closable:function(){return"auto"==a.closable?"hover"!=a.on:a.closable},dimmer:function(){return w.hasClass(p.dimmer)},dimmable:function(){return w.hasClass(p.dimmable)},dimmed:function(){return y.hasClass(p.dimmed)},disabled:function(){return y.hasClass(p.disabled)},enabled:function(){return!l.is.disabled()},page:function(){return y.is("body")},pageDimmer:function(){return v.hasClass(p.pageDimmer)}},can:{show:function(){return!v.hasClass(p.disabled)}},set:{opacity:function(n){var i=v.css("background-color"),t=i.split(","),r=t&&3==t.length,u=t&&4==t.length;n=0===a.opacity?0:a.opacity||n;r||u?(t[3]=n+")",i=t.join(",")):i="rgba(0, 0, 0, "+n+")";l.debug("Setting opacity to",n);v.css("background-color",i)},active:function(){v.addClass(p.active)},dimmable:function(){y.addClass(p.dimmable)},dimmed:function(){y.addClass(p.dimmed)},pageDimmer:function(){v.addClass(p.pageDimmer)},disabled:function(){v.addClass(p.disabled)},variation:function(n){(n=n||a.variation)&&v.addClass(n)}},remove:{active:function(){v.removeClass(p.active)},dimmed:function(){y.removeClass(p.dimmed)},disabled:function(){v.removeClass(p.disabled)},variation:function(n){(n=n||a.variation)&&v.removeClass(n)}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";it&&(t+=" '"+it+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=g;return i=i||c,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(l.error(ut.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}}).preinitialize();h?(g===r&&l.initialize(),l.invoke(s)):(g!==r&&g.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return n("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dropdown=function(u){var f,e=n(this),o=n(i),l=e.selector||"",h="ontouchstart"in i.documentElement,c=(new Date).getTime(),s=[],a=arguments[0],v="string"==typeof a,y=[].slice.call(arguments,1);return e.each(function(p){var ri,wt,dt,ct,gt,lt,bt,w,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.dropdown.settings,u):n.extend({},n.fn.dropdown.settings),k=b.className,at=b.message,ui=b.fields,ft=b.keys,rt=b.metadata,si=b.namespace,ni=b.regExp,d=b.selector,vt=b.error,fi=b.templates,tt="."+si,kt="module-"+si,g=n(this),ht=n(b.context),st=g.find(d.text),et=g.find(d.search),ti=g.find(d.sizer),ut=g.find(d.input),hi=g.find(d.icon),ii=g.prev().find(d.text).length>0?g.prev().find(d.text):g.prev(),nt=g.children(d.menu),it=nt.find(d.item),yt=!1,ei=!1,oi=!1,ot=this,pt=g.data(kt);w={initialize:function(){w.debug("Initializing dropdown",b);w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),b.values&&w.change.values(b.values),w.refreshData(),w.save.defaults(),w.restore.selected(),w.create.id(),w.bind.events(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w);pt=w;g.data(kt,w)},destroy:function(){w.verbose("Destroying previous dropdown",g);w.remove.tabbable();g.off(tt).removeData(kt);nt.off(tt);o.off(ct);w.disconnect.menuObserver();w.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(lt=new MutationObserver(w.event.select.mutation),bt=new MutationObserver(w.event.menu.mutation),w.debug("Setting up mutation observer",lt,bt),w.observe.select(),w.observe.menu())},disconnect:{menuObserver:function(){bt&&bt.disconnect()},selectObserver:function(){lt&&lt.disconnect()}},observe:{select:function(){w.has.input()&&lt.observe(g[0],{childList:!0,subtree:!0})},menu:function(){w.has.menu()&&bt.observe(nt[0],{childList:!0,subtree:!0})}},create:{id:function(){gt=(Math.random().toString(16)+"000000000").substr(2,8);ct="."+gt;w.verbose("Creating unique id for element",gt)},userChoice:function(t){var u,i,f;return!!(t=t||w.get.userValues())&&(t=n.isArray(t)?t:[t],n.each(t,function(t,e){!1===w.get.item(e)&&(f=b.templates.addition(w.add.variables(at.addResult,e)),i=n("<div />").html(f).attr("data-"+rt.value,e).attr("data-"+rt.text,e).addClass(k.addition).addClass(k.item),b.hideAdditions&&i.addClass(k.hidden),u=u===r?i:u.add(i),w.verbose("Creating user choices for value",e,i))}),u)},userLabels:function(){var t=w.get.userValues();t&&(w.debug("Adding user labels",t),n.each(t,function(n,t){w.verbose("Adding custom user value");w.add.label(t,t)}))},menu:function(){nt=n("<div />").addClass(k.menu).appendTo(g)},sizer:function(){ti=n("<span />").addClass(k.sizer).insertAfter(et)}},search:function(n){n=n!==r?n:w.get.query();w.verbose("Searching for query",n);w.has.minCharacters(n)?w.filter(n):w.hide()},select:{firstUnfiltered:function(){w.verbose("Selecting first non-filtered element");w.remove.selectedItem();it.not(d.unselectable).not(d.addition+d.hidden).eq(0).addClass(k.selected)},nextAvailable:function(n){var t=(n=n.eq(0)).nextAll(d.item).not(d.unselectable).eq(0),i=n.prevAll(d.item).not(d.unselectable).eq(0);t.length>0?(w.verbose("Moving selection to",t),t.addClass(k.selected)):(w.verbose("Moving selection to",i),i.addClass(k.selected))}},setup:{api:function(){var n={debug:b.debug,urlData:{value:w.get.value(),query:w.get.query()},on:!1};w.verbose("First request, initializing API");g.api(n)},layout:function(){g.is("select")&&(w.setup.select(),w.setup.returnedObject());w.has.menu()||w.create.menu();w.is.search()&&!w.has.search()&&(w.verbose("Adding search input"),et=n("<input />").addClass(k.search).prop("autocomplete","off").insertBefore(st));w.is.multiple()&&w.is.searchSelection()&&!w.has.sizer()&&w.create.sizer();b.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t);g.is("select")&&(ut=g);ut.parent(d.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),g=ut.closest(d.dropdown),w.has.menu()||w.create.menu(),nt=g.children(d.menu),w.setup.menu(t)):(w.debug("Creating entire dropdown from select"),g=n("<div />").attr("class",ut.attr("class")).addClass(k.selection).addClass(k.dropdown).html(fi.dropdown(t)).insertBefore(ut),ut.hasClass(k.multiple)&&!1===ut.prop("multiple")&&(w.error(vt.missingMultiple),ut.prop("multiple",!0)),ut.is("[multiple]")&&w.set.multiple(),ut.prop("disabled")&&(w.debug("Disabling dropdown"),g.addClass(k.disabled)),ut.removeAttr("class").detach().prependTo(g));w.refresh()},menu:function(n){nt.html(fi.menu(n,ui));it=nt.find(d.item)},reference:function(){w.debug("Dropdown behavior was called on select, replacing with closest dropdown");g=g.parent(d.dropdown);pt=g.data(kt);ot=g.get(0);w.refresh();w.setup.returnedObject()},returnedObject:function(){var n=e.slice(0,p),t=e.slice(p+1);e=n.add(g).add(t)}},refresh:function(){w.refreshSelectors();w.refreshData()},refreshItems:function(){it=nt.find(d.item)},refreshSelectors:function(){w.verbose("Refreshing selector cache");st=g.find(d.text);et=g.find(d.search);ut=g.find(d.input);hi=g.find(d.icon);ii=g.prev().find(d.text).length>0?g.prev().find(d.text):g.prev();nt=g.children(d.menu);it=nt.find(d.item)},refreshData:function(){w.verbose("Refreshing cached metadata");it.removeData(rt.text).removeData(rt.value)},clearData:function(){w.verbose("Clearing metadata");it.removeData(rt.text).removeData(rt.value);g.removeData(rt.defaultText).removeData(rt.defaultValue).removeData(rt.placeholderText)},toggle:function(){w.verbose("Toggling menu visibility");w.is.active()?w.hide():w.show()},show:function(t){if(t=n.isFunction(t)?t:function(){},!w.can.show()&&w.is.remote()&&(w.debug("No API results retrieved, searching before show"),w.queryRemote(w.get.query(),w.show)),w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),!w.has.message()||w.has.maxSelections()||w.has.allResultsFiltered()||w.remove.message(),w.is.allFiltered())return!0;!1!==b.onShow.call(ot)&&w.animate.show(function(){w.can.click()&&w.bind.intent();w.has.menuSearch()&&w.focusSearch();w.set.visible();t.call(ot)})}},hide:function(t){t=n.isFunction(t)?t:function(){};w.is.active()&&!w.is.animatingOutward()&&(w.debug("Hiding dropdown"),!1!==b.onHide.call(ot)&&w.animate.hide(function(){w.remove.visible();t.call(ot)}))},hideOthers:function(){w.verbose("Finding other dropdowns to hide");e.not(g).has(d.menu+"."+k.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu  instantaneously");w.remove.active();w.remove.visible();nt.transition("hide")},hideSubMenus:function(){var n=nt.children(d.item).find(d.menu);w.verbose("Hiding sub menus",n);n.transition("hide")},bind:{events:function(){h&&w.bind.touchEvents();w.bind.keyboardEvents();w.bind.inputEvents();w.bind.mouseEvents()},touchEvents:function(){w.debug("Touch device detected binding additional touch events");w.is.searchSelection()||w.is.single()&&g.on("touchstart"+tt,w.event.test.toggle);nt.on("touchstart"+tt,d.item,w.event.item.mouseenter)},keyboardEvents:function(){w.verbose("Binding keyboard events");g.on("keydown"+tt,w.event.keydown);w.has.search()&&g.on(w.get.inputEvent()+tt,d.search,w.event.input);w.is.multiple()&&o.on("keydown"+ct,w.event.document.keydown)},inputEvents:function(){w.verbose("Binding input change events");g.on("change"+tt,d.input,w.event.change)},mouseEvents:function(){w.verbose("Binding mouse events");w.is.multiple()&&g.on("click"+tt,d.label,w.event.label.click).on("click"+tt,d.remove,w.event.remove.click);w.is.searchSelection()?(g.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("mousedown"+tt,d.menu,w.event.menu.mousedown).on("mouseup"+tt,d.menu,w.event.menu.mouseup).on("click"+tt,d.icon,w.event.icon.click).on("focus"+tt,d.search,w.event.search.focus).on("click"+tt,d.search,w.event.search.focus).on("blur"+tt,d.search,w.event.search.blur).on("click"+tt,d.text,w.event.text.focus),w.is.multiple()&&g.on("click"+tt,w.event.click)):("click"==b.on?g.on("click"+tt,d.icon,w.event.icon.click).on("click"+tt,w.event.test.toggle):"hover"==b.on?g.on("mouseenter"+tt,w.delay.show).on("mouseleave"+tt,w.delay.hide):g.on(b.on+tt,w.toggle),g.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("focus"+tt,w.event.focus),w.has.menuSearch()?g.on("blur"+tt,d.search,w.event.search.blur):g.on("blur"+tt,w.event.blur));nt.on("mouseenter"+tt,d.item,w.event.item.mouseenter).on("mouseleave"+tt,d.item,w.event.item.mouseleave).on("click"+tt,d.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document");h&&o.on("touchstart"+ct,w.event.test.touch).on("touchmove"+ct,w.event.test.touch);o.on("click"+ct,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document");h&&o.off("touchstart"+ct).off("touchmove"+ct);o.off("click"+ct)}},filter:function(n){var t=n!==r?n:w.get.query(),i=function(){w.is.multiple()&&w.filterActive();(n||!n&&0==w.get.activeItem().length)&&w.select.firstUnfiltered();w.has.allResultsFiltered()?b.onNoResults.call(ot,t)?b.allowAdditions?b.hideAdditions&&(w.verbose("User addition with no menu, setting empty style"),w.set.empty(),w.hideMenu()):(w.verbose("All items filtered, showing message",t),w.add.message(at.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):(w.remove.empty(),w.remove.message());b.allowAdditions&&w.add.userSuggestion(n);w.is.searchSelection()&&w.can.show()&&w.is.focusedOnSearch()&&w.show()};b.useLabels&&w.has.maxSelections()||(b.apiSettings?w.can.useAPI()?w.queryRemote(t,function(){b.filterRemoteData&&w.filterItems(t);i()}):w.error(vt.noAPI):(w.filterItems(t),i()))},queryRemote:function(t,i){var r={errorDuration:!1,cache:"local",throttle:b.throttle,urlData:{query:t},onError:function(){w.add.message(at.serverError);i()},onFailure:function(){w.add.message(at.serverError);i()},onSuccess:function(t){var r=t[ui.remoteValues];n.isArray(r)&&r.length>0?(w.remove.message(),w.setup.menu({values:t[ui.remoteValues]})):w.add.message(at.noResults);i()}};g.api("get request")||w.setup.api();r=n.extend(!0,{},r,b.apiSettings);g.api("setting",r).api("query")},filterItems:function(t){var u=t!==r?t:w.get.query(),i=null,e=w.escape.string(u),f=new RegExp("^"+e,"igm");w.has.query()&&(i=[],w.verbose("Searching for matching values",u),it.each(function(){var t,r,e=n(this);return("both"==b.match||"text"==b.match)&&(-1!==(t=String(w.get.choiceText(e,!1))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,t)||!0===b.fullTextSearch&&w.fuzzySearch(u,t))?(i.push(this),!0):("both"==b.match||"value"==b.match)&&(-1!==(r=String(w.get.choiceValue(e,t))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,r)||!0===b.fullTextSearch&&w.fuzzySearch(u,r))?(i.push(this),!0):void 0}));w.debug("Showing only matched items",u);w.remove.filteredItem();i&&it.not(i).addClass(k.filtered)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),u>r)return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},exactSearch:function(n,t){return n=n.toLowerCase(),(t=t.toLowerCase()).indexOf(n)>-1},filterActive:function(){b.useLabels&&it.filter("."+k.active).addClass(k.filtered)},focusSearch:function(n){w.has.search()&&!w.is.focusedOnSearch()&&(n?(g.off("focus"+tt,d.search),et.focus(),g.on("focus"+tt,d.search,w.event.search.focus)):et.focus())},forceSelection:function(){var t=it.not(k.filtered).filter("."+k.selected).eq(0),i=it.not(k.filtered).filter("."+k.active).eq(0),n=t.length>0?t:i;if(n.length>0&&!w.is.multiple())return w.debug("Forcing partial selection to selected item",n),void w.event.item.click.call(n,{},!0);b.allowAdditions?(w.set.selected(w.get.query()),w.remove.searchTerm()):w.remove.searchTerm()},change:{values:function(t){b.allowAdditions||w.clear();w.debug("Creating dropdown with specified values",t);w.setup.menu({values:t});n.each(t,function(n,t){if(1==t.selected)return w.debug("Setting initial selection to",t.value),w.set.selected(t.value),!0})}},event:{change:function(){oi||(w.debug("Input changed, updating selection"),w.set.selected())},focus:function(){b.showOnFocus&&!yt&&w.is.hidden()&&!wt&&w.show()},blur:function(){wt=i.activeElement===this;yt||wt||(w.remove.activeLabel(),w.hide())},mousedown:function(){w.is.searchSelection()?dt=!0:yt=!0},mouseup:function(){w.is.searchSelection()?dt=!1:yt=!1},click:function(t){n(t.target).is(g)&&(w.is.focusedOnSearch()?w.show():w.focusSearch())},search:{focus:function(){yt=!0;w.is.multiple()&&w.remove.activeLabel();b.showOnFocus&&w.search()},blur:function(){wt=i.activeElement===this;w.is.searchSelection()&&!dt&&(ei||wt||(b.forceSelection&&w.forceSelection(),w.hide()));dt=!1}},icon:{click:function(){w.toggle()}},text:{focus:function(){yt=!0;w.focusSearch()}},input:function(){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered();clearTimeout(w.timer);w.timer=setTimeout(w.search,b.delay.search)},label:{click:function(t){var i=n(this),u=g.find(d.label),r=u.filter("."+k.active),f=i.nextAll("."+k.active),e=i.prevAll("."+k.active),o=f.length>0?i.nextUntil(f).add(r).add(i):i.prevUntil(e).add(r).add(i);t.shiftKey?(r.removeClass(k.active),o.addClass(k.active)):t.ctrlKey?i.toggleClass(k.active):(r.removeClass(k.active),i.addClass(k.active));b.onLabelSelect.apply(this,u.filter("."+k.active))}},remove:{click:function(){var t=n(this).parent();t.hasClass(k.active)?w.remove.activeLabels():w.remove.activeLabels(t)}},test:{toggle:function(n){var t=w.is.multiple()?w.show:w.toggle;w.is.bubbledLabelClick(n)||w.is.bubbledIconClick(n)||w.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){w.determine.eventOnElement(n,function(){"touchstart"==n.type?w.timer=setTimeout(function(){w.hide()},b.delay.touch):"touchmove"==n.type&&clearTimeout(w.timer)});n.stopPropagation()},hide:function(n){w.determine.eventInModule(n,w.hide)}},select:{mutation:function(t){w.debug("<select> modified, recreating menu");var i=!1;n.each(t,function(t,r){if(n(r.target).is("select")||n(r.addedNodes).is("select"))return i=!0,!0});i&&(w.disconnect.selectObserver(),w.refresh(),w.setup.select(),w.set.selected(),w.observe.select())}},menu:{mutation:function(t){var i=t[0],u=i.addedNodes?n(i.addedNodes[0]):n(!1),f=i.removedNodes?n(i.removedNodes[0]):n(!1),r=u.add(f),e=r.is(d.addition)||r.closest(d.addition).length>0,o=r.is(d.message)||r.closest(d.message).length>0;e||o?(w.debug("Updating item selector cache"),w.refreshItems()):(w.debug("Menu modified, updating selector cache"),w.refresh())},mousedown:function(){ei=!0},mouseup:function(){ei=!1}},item:{mouseenter:function(t){var u=n(t.target),r=n(this),i=r.children(d.menu),f=r.siblings(d.item).children(d.menu),e=i.length>0;i.find(u).length>0||!e||(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",i);n.each(f,function(){w.animate.hide(!1,n(this))});w.animate.show(!1,i)},b.delay.show),t.preventDefault())},mouseleave:function(){var t=n(this).children(d.menu);t.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t);w.animate.hide(!1,t)},b.delay.hide))},click:function(t,r){var u=n(this),o=n(t?t.target:""),f=u.find(d.menu),e=w.get.choiceText(u),s=w.get.choiceValue(u,e),h=f.length>0,c=f.find(o).length>0;w.has.menuSearch()&&n(i.activeElement).blur();c||h&&!b.allowCategorySelection||(w.is.searchSelection()&&(b.allowAdditions&&w.remove.userAddition(),w.remove.searchTerm(),w.is.focusedOnSearch()||1==r||w.focusSearch(!0)),b.useLabels||(w.remove.filteredItem(),w.set.scrollPosition(u)),w.determine.selectAction.call(this,e,s))}},document:{keydown:function(n){var u=n.which;if(w.is.inObject(u,ft)){var i=g.find(d.label),t=i.filter("."+k.active),o=(t.data(rt.value),i.index(t)),a=i.length,r=t.length>0,s=t.length>1,v=0===o,h=o+1==a,e=w.is.searchSelection(),f=w.is.focusedOnSearch(),c=w.is.focused(),l=f&&0===w.get.caretPosition();if(e&&!r&&!f)return;u==ft.leftArrow?!c&&!l||r?r&&(n.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),i.removeClass(k.active)),v&&!s?t.addClass(k.active):t.prev(d.siblingLabel).addClass(k.active).end(),n.preventDefault()):(w.verbose("Selecting previous label"),i.last().addClass(k.active)):u==ft.rightArrow?(c&&!r&&i.first().addClass(k.active),r&&(n.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),i.removeClass(k.active)),h?e?f?i.removeClass(k.active):w.focusSearch():s?t.next(d.siblingLabel).addClass(k.active):t.addClass(k.active):t.next(d.siblingLabel).addClass(k.active),n.preventDefault())):u==ft.deleteKey||u==ft.backspace?r?(w.verbose("Removing active labels"),h&&e&&!f&&w.focusSearch(),t.last().next(d.siblingLabel).addClass(k.active),w.remove.activeLabels(t),n.preventDefault()):l&&!r&&u==ft.backspace&&(w.verbose("Removing last label on input backspace"),t=i.last().addClass(k.active),w.remove.activeLabels(t)):t.removeClass(k.active)}}},keydown:function(n){var t=n.which;if(w.is.inObject(t,ft)){var r,s=it.not(d.unselectable).filter("."+k.selected).eq(0),a=nt.children("."+k.active).eq(0),i=s.length>0?s:a,v=i.length>0?i.siblings(":not(."+k.filtered+")").addBack():nt.children(":not(."+k.filtered+")"),e=i.children(d.menu),u=i.closest(d.menu),h=u.hasClass(k.visible)||u.hasClass(k.animating)||u.parent(d.menu).length>0,c=e.length>0,f=i.length>0,l=i.not(d.unselectable).length>0,o=t==ft.delimiter&&b.allowAdditions&&w.is.multiple();if(b.allowAdditions&&b.hideAdditions&&(t==ft.enter||o)&&l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),w.is.visible()){if((t==ft.enter||o)&&(t==ft.enter&&f&&c&&!b.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=ft.rightArrow):l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),n.preventDefault()),f&&(t==ft.leftArrow&&u[0]!==nt[0]&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,u),i.removeClass(k.selected),u.closest(d.item).addClass(k.selected),n.preventDefault()),t==ft.rightArrow&&c&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,e),i.removeClass(k.selected),e.find(d.item).eq(0).addClass(k.selected),n.preventDefault())),t==ft.upArrow){if(r=f&&h?i.prevAll(d.item+":not("+d.unselectable+")").eq(0):it.eq(0),v.index(r)<0)return w.verbose("Up key pressed but reached top of current menu"),void n.preventDefault();w.verbose("Up key pressed, changing active item");i.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}if(t==ft.downArrow){if(0===(r=f&&h?r=i.nextAll(d.item+":not("+d.unselectable+")").eq(0):it.eq(0)).length)return w.verbose("Down key pressed but reached bottom of current menu"),void n.preventDefault();w.verbose("Down key pressed, changing active item");it.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}t==ft.pageUp&&(w.scrollPage("up"),n.preventDefault());t==ft.pageDown&&(w.scrollPage("down"),n.preventDefault());t==ft.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else o&&n.preventDefault(),t!=ft.downArrow||w.is.visible()||(w.verbose("Down key pressed, showing dropdown"),w.show(),n.preventDefault())}else w.has.search()||w.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=ut[0];t&&(w.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},determine:{selectAction:function(t,i){w.verbose("Determining action",b.action);n.isFunction(w.action[b.action])?(w.verbose("Triggering preset action",b.action,t,i),w.action[b.action].call(ot,t,i,this)):n.isFunction(b.action)?(w.verbose("Triggering user action",b.action,t,i),b.action.call(ot,t,i,this)):w.error(vt.action,b.action)},eventInModule:function(t,r){var u=n(t.target),f=u.closest(i.documentElement).length>0,e=u.closest(g).length>0;return r=n.isFunction(r)?r:function(){},f&&!e?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,r){var u=n(t.target),f=u.closest(d.siblingLabel),e=i.body.contains(t.target),o=0===g.find(f).length,s=0===u.closest(nt).length;return r=n.isFunction(r)?r:function(){},e&&o&&s?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.selected(i,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},select:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.value(i,t,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},combo:function(t,i,u){i=i!==r?i:t;w.set.selected(i,n(u));w.hideAndClear()},hide:function(n,t){w.set.value(t,n);w.hideAndClear()}},get:{id:function(){return gt},defaultText:function(){return g.data(rt.defaultText)},defaultValue:function(){return g.data(rt.defaultValue)},placeholderText:function(){return"auto"!=b.placeholder&&"string"==typeof b.placeholder?b.placeholder:g.data(rt.placeholderText)||""},text:function(){return st.text()},query:function(){return n.trim(et.val())},searchWidth:function(n){return n=n!==r?n:et.val(),ti.text(n),Math.ceil(ti.width()+1)},selectionCount:function(){var t=w.get.values();return w.is.multiple()?n.isArray(t)?t.length:0:""!==w.get.value()?1:0},transition:function(n){return"auto"==b.transition?w.is.upward(n)?"slide up":"slide down":b.transition},userValues:function(){var t=w.get.values();return!!t&&(t=n.isArray(t)?t:[t],n.grep(t,function(n){return!1===w.get.item(n)}))},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(){var t,r,n=et.get(0);return"selectionStart"in n?n.selectionStart:i.selection?(n.focus(),r=(t=i.selection.createRange()).text.length,t.moveStart("character",-n.value.length),t.text.length-r):void 0},value:function(){var t=ut.length>0?ut.val():g.data(rt.value),i=n.isArray(t)&&1===t.length&&""===t[0];return t===r||i?"":t},values:function(){var n=w.get.value();return""===n?"":!w.has.selectInput()&&w.is.multiple()?"string"==typeof n?n.split(b.delimiter):"":n},remoteValues:function(){var t=w.get.values(),i=!1;return t&&("string"==typeof t&&(t=[t]),n.each(t,function(n,t){var r=w.read.remoteData(t);w.verbose("Restoring value from session data",r,t);r&&(i||(i={}),i[t]=r)})),i},choiceText:function(t,i){if(i=i!==r?i:b.preserveHTML,t)return t.find(d.menu).length>0&&(w.verbose("Retrieving text of element with sub-menu"),(t=t.clone()).find(d.menu).remove(),t.find(d.menuIcon).remove()),t.data(rt.text)!==r?t.data(rt.text):i?n.trim(t.html()):n.trim(t.text())},choiceValue:function(t,i){return i=i||w.get.choiceText(t),!!t&&(t.data(rt.value)!==r?String(t.data(rt.value)):"string"==typeof i?n.trim(i.toLowerCase()):String(i))},inputEvent:function(){var n=et[0];return!!n&&(n.oninput!==r?"input":n.onpropertychange!==r?"propertychange":"keyup")},selectValues:function(){var t={values:[]};return g.find("option").each(function(){var i=n(this),u=i.html(),e=i.attr("disabled"),f=i.attr("value")!==r?i.attr("value"):u;"auto"===b.placeholder&&""===f?t.placeholder=u:t.values.push({name:u,value:f,disabled:e})}),b.placeholder&&"auto"!==b.placeholder&&(w.debug("Setting placeholder value to",b.placeholder),t.placeholder=b.placeholder),b.sortSelect?(t.values.sort(function(n,t){return n.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retrieved values from select",t),t},activeItem:function(){return it.filter("."+k.active)},selectedItem:function(){var n=it.not(d.unselectable).filter("."+k.selected);return n.length>0?n:it.eq(0)},itemWithAdditions:function(n){var t=w.get.item(n),i=w.create.userChoice(n);return i&&i.length>0&&(t=t.length>0?t.add(i):i),t},item:function(t,i){var e,f,u=!1;return t=t!==r?t:w.get.values()!==r?w.get.values():w.get.text(),e=f?t.length>0:t!==r&&null!==t,f=w.is.multiple()&&n.isArray(t),i=""===t||0===t||i||!1,e&&it.each(function(){var e=n(this),s=w.get.choiceText(e),o=w.get.choiceValue(e,s);if(null!==o&&o!==r)if(f)-1===n.inArray(String(o),t)&&-1===n.inArray(s,t)||(u=u?u.add(e):e);else if(i){if(w.verbose("Ambiguous dropdown value using strict type check",e,t),o===t||s===t)return u=e,!0}else if(String(o)==String(t)||s==t)return w.verbose("Found select item by value",o,t),u=e,!0}),u}},check:{maxSelections:function(n){return!b.maxSelections||((n=n!==r?n:w.get.selectionCount())>=b.maxSelections?(w.debug("Maximum selection count reached"),b.useLabels&&(it.addClass(k.filtered),w.add.message(at.maxSelections)),!0):(w.verbose("No longer at maximum selection count"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filterItems(),!1))}},restore:{defaults:function(){w.clear();w.restore.defaultText();w.restore.defaultValue()},defaultText:function(){var n=w.get.defaultText();n===w.get.placeholderText?(w.debug("Restoring default placeholder text",n),w.set.placeholderText(n)):(w.debug("Restoring default text",n),w.set.text(n))},placeholderText:function(){w.set.placeholderText()},defaultValue:function(){var n=w.get.defaultValue();n!==r&&(w.debug("Restoring default value",n),""!==n?(w.set.value(n),w.set.selected()):(w.remove.activeItem(),w.remove.selectedItem()))},labels:function(){b.allowAdditions&&(b.useLabels||(w.error(vt.labels),b.useLabels=!0),w.debug("Restoring selected values"),w.create.userLabels());w.check.maxSelections()},selected:function(){w.restore.values();w.is.multiple()?(w.debug("Restoring previously selected values and labels"),w.restore.labels()):w.debug("Restoring previously selected values")},values:function(){w.set.initialLoad();b.apiSettings&&b.saveRemoteData&&w.get.remoteValues()?w.restore.remoteValues():w.set.selected();w.remove.initialLoad()},remoteValues:function(){var t=w.get.remoteValues();w.debug("Recreating selected from session data",t);t&&(w.is.single()?n.each(t,function(n,t){w.set.text(t)}):n.each(t,function(n,t){w.add.label(n,t)}))}},read:{remoteData:function(n){var i;if(t.Storage!==r)return(i=sessionStorage.getItem(n))!==r&&i;w.error(vt.noStorage)}},save:{defaults:function(){w.save.defaultText();w.save.placeholderText();w.save.defaultValue()},defaultValue:function(){var n=w.get.value();w.verbose("Saving default value as",n);g.data(rt.defaultValue,n)},defaultText:function(){var n=w.get.text();w.verbose("Saving default text as",n);g.data(rt.defaultText,n)},placeholderText:function(){var n;!1!==b.placeholder&&st.hasClass(k.placeholder)&&(n=w.get.text(),w.verbose("Saving placeholder text as",n),g.data(rt.placeholderText,n))},remoteData:function(n,i){t.Storage!==r?(w.verbose("Saving remote data to session storage",i,n),sessionStorage.setItem(i,n)):w.error(vt.noStorage)}},clear:function(){w.is.multiple()&&b.useLabels?w.remove.labels():(w.remove.activeItem(),w.remove.selectedItem());w.set.placeholderText();w.clearValue()},clearValue:function(){w.set.value("")},scrollPage:function(n,t){var r,u,f=t||w.get.selectedItem(),e=f.closest(d.menu),c=e.outerHeight(),h=e.scrollTop(),s=it.eq(0).outerHeight(),o=Math.floor(c/s),l=(e.prop("scrollHeight"),"up"==n?h-s*o:h+s*o),i=it.not(d.unselectable);u="up"==n?i.index(f)-o:i.index(f)+o;(r=("up"==n?u>=0:u<i.length)?i.eq(u):"up"==n?i.first():i.last()).length>0&&(w.debug("Scrolling page",n,r),f.removeClass(k.selected),r.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r),e.scrollTop(l))},set:{filtered:function(){var n=w.is.multiple(),i=w.is.searchSelection(),r=n&&i,t=i?w.get.query():"",u="string"==typeof t&&t.length>0,f=w.get.searchWidth(),e=""!==t;n&&u&&(w.verbose("Adjusting input width",f,b.glyphWidth),et.css("width",f));u||r&&e?(w.verbose("Hiding placeholder text"),st.addClass(k.filtered)):(!n||r&&!e)&&(w.verbose("Showing placeholder text"),st.removeClass(k.filtered))},empty:function(){g.addClass(k.empty)},loading:function(){g.addClass(k.loading)},placeholderText:function(n){n=n||w.get.placeholderText();w.debug("Setting placeholder text",n);w.set.text(n);st.addClass(k.placeholder)},tabbable:function(){w.is.searchSelection()?(w.debug("Added tabindex to searchable dropdown"),et.val("").attr("tabindex",0),nt.attr("tabindex",-1)):(w.debug("Added tabindex to dropdown"),g.attr("tabindex")===r&&(g.attr("tabindex",0),nt.attr("tabindex",-1)))},initialLoad:function(){w.verbose("Setting initial load");ri=!0},activeItem:function(n){b.allowAdditions&&n.filter(d.addition).length>0?n.addClass(k.filtered):n.addClass(k.active)},partialSearch:function(n){var t=w.get.query().length;et.val(n.substr(0,t))},scrollPosition:function(n,t){var i,e,u,f,o,s;i=(n=n||w.get.selectedItem()).closest(d.menu);e=n&&n.length>0;t=t!==r&&t;n&&i.length>0&&e&&(n.position().top,i.addClass(k.loading),u=(f=i.scrollTop())-i.offset().top+n.offset().top,t||(s=f+i.height()<u+5,o=u-5<f),w.debug("Scrolling to active item",u),(t||o||s)&&i.scrollTop(u),i.removeClass(k.loading))},text:function(n){"select"!==b.action&&("combo"==b.action?(w.debug("Changing combo button text",n,ii),b.preserveHTML?ii.html(n):ii.text(n)):(n!==w.get.placeholderText()&&st.removeClass(k.placeholder),w.debug("Changing text",n,st),st.removeClass(k.filtered),b.preserveHTML?st.html(n):st.text(n)))},selectedItem:function(n){var t=w.get.choiceValue(n),i=w.get.choiceText(n,!1),r=w.get.choiceText(n,!0);w.debug("Setting user selection to item",n);w.remove.activeItem();w.set.partialSearch(i);w.set.activeItem(n);w.set.selected(t,n);w.set.text(r)},selectedLetter:function(t){var u,r=it.filter("."+k.selected),i=!1;r.length>0&&w.has.firstLetter(r,t)&&(u=r.nextAll(it).eq(0),w.has.firstLetter(u,t)&&(i=u));i||it.each(function(){if(w.has.firstLetter(n(this),t))return i=n(this),!1});i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),r.removeClass(k.selected),i.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(i))},direction:function(n){"auto"==b.direction?(w.remove.upward(),w.can.openDownward(n)?w.remove.upward(n):w.set.upward(n),w.is.leftward(n)||w.can.openRightward(n)||w.set.leftward(n)):"upward"==b.direction&&w.set.upward(n)},upward:function(n){(n||g).addClass(k.upward)},leftward:function(n){(n||nt).addClass(k.leftward)},value:function(n,t,i){var u=w.escape.value(n),o=ut.length>0,f=w.get.values(),e=n!==r?String(n):n;if(o){if(!b.allowReselection&&e==f&&(w.verbose("Skipping value update already same value",n,f),!w.is.initialLoad()))return;w.is.single()&&w.has.selectInput()&&w.can.extendSelect()&&(w.debug("Adding user option",n),w.add.optionValue(n));w.debug("Updating input value",u,f);oi=!0;ut.val(u);!1===b.fireOnInit&&w.is.initialLoad()?w.debug("Input native change event ignored on initial load"):w.trigger.change();oi=!1}else w.verbose("Storing value in metadata",u,ut),u!==f&&g.data(rt.value,e);!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onChange):b.onChange.call(ot,n,t,i)},active:function(){g.addClass(k.active)},multiple:function(){g.addClass(k.multiple)},visible:function(){g.addClass(k.visible)},exactly:function(n,t){w.debug("Setting selected to exact values");w.clear();w.set.selected(n,t)},selected:function(t,i){var r=w.is.multiple();(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t))&&(w.debug("Setting selected menu item to",i),w.is.multiple()&&w.remove.searchWidth(),w.is.single()?(w.remove.activeItem(),w.remove.selectedItem()):b.useLabels&&w.remove.selectedItem(),i.each(function(){var t=n(this),u=w.get.choiceText(t),f=w.get.choiceValue(t,u),e=t.hasClass(k.filtered),o=t.hasClass(k.active),s=t.hasClass(k.addition),h=r&&1==i.length;r?!o||s?(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),b.useLabels?(w.add.label(f,u,h),w.add.value(f,u,t),w.set.activeItem(t),w.filterActive(),w.select.nextAvailable(i)):(w.add.value(f,u,t),w.set.text(w.add.variables(at.count)),w.set.activeItem(t))):e||(w.debug("Selected active value, removing label"),w.remove.selected(f)):(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),w.set.text(u),w.set.value(f,u,t),t.addClass(k.active).addClass(k.selected))}))}},add:{label:function(t,i,r){var u,e=w.is.searchSelection()?et:st,f=w.escape.value(t);b.ignoreCase&&(f=f.toLowerCase());u=n("<a />").addClass(k.label).attr("data-"+rt.value,f).html(fi.label(f,i));u=b.onLabelCreate.call(u,f,i);w.has.label(t)?w.debug("User selection already exists, skipping",f):(b.label.variation&&u.addClass(b.label.variation),!0===r?(w.debug("Animating in label",u),u.addClass(k.hidden).insertBefore(e).transition(b.label.transition,b.label.duration)):(w.debug("Adding selection label",u),u.insertBefore(e)))},message:function(t){var i=nt.children(d.message),r=b.templates.message(w.add.variables(t));i.length>0?i.html(r):i=n("<div/>").html(r).addClass(k.message).appendTo(nt)},optionValue:function(t){var i=w.escape.value(t);ut.find('option[value="'+w.escape.string(i)+'"]').length>0||(w.disconnect.selectObserver(),w.is.single()&&(w.verbose("Removing previous user addition"),ut.find("option."+k.addition).remove()),n("<option/>").prop("value",i).addClass(k.addition).html(t).appendTo(ut),w.verbose("Adding user addition as an <option>",t),w.observe.select())},userSuggestion:function(n){var i,t=nt.children(d.addition),r=w.get.item(n),u=r&&r.not(d.addition).length,f=t.length>0;b.useLabels&&w.has.maxSelections()||(""===n||u?t.remove():(f?(t.data(rt.value,n).data(rt.text,n).attr("data-"+rt.value,n).attr("data-"+rt.text,n).removeClass(k.filtered),b.hideAdditions||(i=b.templates.addition(w.add.variables(at.addResult,n)),t.html(i)),w.verbose("Replacing user suggestion with new value",t)):((t=w.create.userChoice(n)).prependTo(nt),w.verbose("Adding item choice to menu corresponding with user choice addition",t)),b.hideAdditions&&!w.is.allFiltered()||t.addClass(k.selected).siblings().removeClass(k.selected),w.refreshItems()))},variables:function(n,t){var i,r,u=-1!==n.search("{count}"),f=-1!==n.search("{maxCount}"),e=-1!==n.search("{term}");return w.verbose("Adding templated variables to message",n),u&&(i=w.get.selectionCount(),n=n.replace("{count}",i)),f&&(i=w.get.selectionCount(),n=n.replace("{maxCount}",b.maxSelections)),e&&(r=t||w.get.query(),n=n.replace("{term}",r)),n},value:function(t,i,r){var u,f=w.get.values();w.has.value(t)?w.debug("Value already selected"):""!==t?(n.isArray(f)?(u=f.concat([t]),u=w.get.uniqueArray(u)):u=[t],w.has.selectInput()?w.can.extendSelect()&&(w.debug("Adding value to select",t,u,ut),w.add.optionValue(t)):(u=u.join(b.delimiter),w.debug("Setting hidden input to delimited value",u,ut)),!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("Skipping onadd callback on initial load",b.onAdd):b.onAdd.call(ot,t,i,r),w.set.value(u,t,i,r),w.check.maxSelections()):w.debug("Cannot select blank values from multiselect")}},remove:{active:function(){g.removeClass(k.active)},activeLabel:function(){g.find(d.label).removeClass(k.active)},empty:function(){g.removeClass(k.empty)},loading:function(){g.removeClass(k.loading)},initialLoad:function(){ri=!1},upward:function(n){(n||g).removeClass(k.upward)},leftward:function(n){(n||nt).removeClass(k.leftward)},visible:function(){g.removeClass(k.visible)},activeItem:function(){it.removeClass(k.active)},filteredItem:function(){b.useLabels&&w.has.maxSelections()||(b.useLabels&&w.is.multiple()?it.not("."+k.active).removeClass(k.filtered):it.removeClass(k.filtered),w.remove.empty())},optionValue:function(n){var i=w.escape.value(n),t=ut.find('option[value="'+w.escape.string(i)+'"]');t.length>0&&t.hasClass(k.addition)&&(lt&&(lt.disconnect(),w.verbose("Temporarily disconnecting mutation observer")),t.remove(),w.verbose("Removing user addition as an <option>",i),lt&&lt.observe(ut[0],{childList:!0,subtree:!0}))},message:function(){nt.children(d.message).remove()},searchWidth:function(){et.css("width","")},searchTerm:function(){w.verbose("Cleared search term");et.val("");w.set.filtered()},userAddition:function(){it.filter(d.addition).remove()},selected:function(t,i){if(!(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t)))return!1;i.each(function(){var t=n(this),i=w.get.choiceText(t),r=w.get.choiceValue(t,i);w.is.multiple()?b.useLabels?(w.remove.value(r,i,t),w.remove.label(r)):(w.remove.value(r,i,t),0===w.get.selectionCount()?w.set.placeholderText():w.set.text(w.add.variables(at.count))):w.remove.value(r,i,t);t.removeClass(k.filtered).removeClass(k.active);b.useLabels&&t.removeClass(k.selected)})},selectedItem:function(){it.removeClass(k.selected)},value:function(n,t,i){var r,u=w.get.values();w.has.selectInput()?(w.verbose("Input is <select> removing selected option",n),r=w.remove.arrayValue(n,u),w.remove.optionValue(n)):(w.verbose("Removing from delimited values",n),r=(r=w.remove.arrayValue(n,u)).join(b.delimiter));!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onRemove):b.onRemove.call(ot,n,t,i);w.set.value(r,t,i);w.check.maxSelections()},arrayValue:function(t,i){return n.isArray(i)||(i=[i]),i=n.grep(i,function(n){return t!=n}),w.verbose("Removed value from delimited string",t,i),i},label:function(n){var t=g.find(d.label).filter("[data-"+rt.value+'="'+w.escape.string(n)+'"]');w.verbose("Removing label",t);t.remove()},activeLabels:function(n){n=n||g.find(d.label).filter("."+k.active);w.verbose("Removing active label selections",n);w.remove.labels(n)},labels:function(t){t=t||g.find(d.label);w.verbose("Removing labels",t);t.each(function(){var u=n(this),t=u.data(rt.value),i=t!==r?String(t):t,f=w.is.userValue(i);!1!==b.onLabelRemove.call(u,t)?(w.remove.message(),f?(w.remove.value(i),w.remove.label(i)):w.remove.selected(i)):w.debug("Label remove callback cancelled removal")})},tabbable:function(){w.is.searchSelection()?(w.debug("Searchable dropdown initialized"),et.removeAttr("tabindex"),nt.removeAttr("tabindex")):(w.debug("Simple selection dropdown initialized"),g.removeAttr("tabindex"),nt.removeAttr("tabindex"))}},has:{menuSearch:function(){return w.has.search()&&et.closest(nt).length>0},search:function(){return et.length>0},sizer:function(){return ti.length>0},selectInput:function(){return ut.is("select")},minCharacters:function(n){return!b.minCharacters||(n=n!==r?String(n):String(w.get.query())).length>=b.minCharacters},firstLetter:function(n,t){var i;return!(!n||0===n.length||"string"!=typeof t)&&(i=w.get.choiceText(n,!1),(t=t.toLowerCase())==String(i).charAt(0).toLowerCase())},input:function(){return ut.length>0},items:function(){return it.length>0},menu:function(){return nt.length>0},message:function(){return 0!==nt.children(d.message).length},label:function(n){var t=w.escape.value(n),i=g.find(d.label);return b.ignoreCase&&(t=t.toLowerCase()),i.filter("[data-"+rt.value+'="'+w.escape.string(t)+'"]').length>0},maxSelections:function(){return b.maxSelections&&w.get.selectionCount()>=b.maxSelections},allResultsFiltered:function(){var n=it.not(d.addition);return n.filter(d.unselectable).length===n.length},userSuggestion:function(){return nt.children(d.addition).length>0},query:function(){return""!==w.get.query()},value:function(n){return b.ignoreCase?w.has.valueIgnoringCase(n):w.has.valueMatchingCase(n)},valueMatchingCase:function(t){var i=w.get.values();return!!(n.isArray(i)?i&&-1!==n.inArray(t,i):i==t)},valueIgnoringCase:function(t){var i=w.get.values(),r=!1;return n.isArray(i)||(i=[i]),n.each(i,function(n,i){if(String(t).toLowerCase()==String(i).toLowerCase())return r=!0,!1}),r}},is:{active:function(){return g.hasClass(k.active)},animatingInward:function(){return nt.transition("is inward")},animatingOutward:function(){return nt.transition("is outward")},bubbledLabelClick:function(t){return n(t.target).is("select, input")&&g.closest("label").length>0},bubbledIconClick:function(t){return n(t.target).closest(hi).length>0},alreadySetup:function(){return g.is("select")&&g.parent(d.dropdown).data(kt)!==r&&0===g.prev().length},animating:function(n){return n?n.transition&&n.transition("is animating"):nt.transition&&nt.transition("is animating")},leftward:function(n){return(n||nt).hasClass(k.leftward)},disabled:function(){return g.hasClass(k.disabled)},focused:function(){return i.activeElement===g[0]},focusedOnSearch:function(){return i.activeElement===et[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!(0==b.hideAdditions&&w.has.userSuggestion())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(n){return!w.is.visible(n)},initialLoad:function(){return ri},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return r=!0,!0}),r},multiple:function(){return g.hasClass(k.multiple)},remote:function(){return b.apiSettings&&w.can.useAPI()},single:function(){return!w.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(r.target&&n(r.target).is("select"))return i=!0,!0}),i},search:function(){return g.hasClass(k.search)},searchSelection:function(){return w.has.search()&&1===et.parent(d.dropdown).length},selection:function(){return g.hasClass(k.selection)},userValue:function(t){return-1!==n.inArray(t,w.get.userValues())},upward:function(n){return(n||g).hasClass(k.upward)},visible:function(n){return n?n.hasClass(k.visible):nt.hasClass(k.visible)},verticallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-y");return"auto"==n||"scroll"==n},horizontallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-X");return"auto"==n||"scroll"==n}},can:{activate:function(n){return!!b.useLabels||!w.has.maxSelections()||!(!w.has.maxSelections()||!n.hasClass(k.active))},openDownward:function(n){var r,i,u=n||nt,f=!0;return u.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollTop:ht.scrollTop(),height:ht.outerHeight()},menu:{offset:u.offset(),height:u.outerHeight()}},w.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),(r={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(w.verbose("Dropdown can fit in context downward",r),f=!0):r.below||r.above?(w.verbose("Dropdown cannot fit below, opening upward",r),f=!1):(w.verbose("Dropdown cannot fit in either direction, favoring downward",r),f=!0),u.removeClass(k.loading),f},openRightward:function(n){var u,i,r=n||nt,f=!0;return r.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollLeft:ht.scrollLeft(),width:ht.outerWidth()},menu:{offset:r.offset(),width:r.outerWidth()}},w.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(u=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(w.verbose("Dropdown cannot fit in context rightward",u),f=!1),r.removeClass(k.loading),f},click:function(){return h||"click"==b.on},extendSelect:function(){return b.allowAdditions||b.apiSettings},show:function(){return!w.is.disabled()&&(w.has.items()||w.has.message())},useAPI:function(){return n.fn.api!==r}},animate:{show:function(t,i){var f,u=i||nt,e=i?function(){}:function(){w.hideSubMenus();w.hideOthers();w.set.active()};t=n.isFunction(t)?t:function(){};w.verbose("Doing menu show animation",u);w.set.direction(i);f=w.get.transition(i);w.is.selection()&&w.set.scrollPosition(w.get.selectedItem(),!0);(w.is.hidden(u)||w.is.animating(u))&&("none"==f?(e(),u.transition("show"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:f+" in",debug:b.debug,verbose:b.verbose,duration:b.duration,queue:!0,onStart:e,onComplete:function(){t.call(ot)}}):w.error(vt.noTransition,f))},hide:function(t,i){var u=i||nt,f=(i?b.duration:b.duration,i?function(){}:function(){w.can.click()&&w.unbind.intent();w.remove.active()}),e=w.get.transition(i);t=n.isFunction(t)?t:function(){};(w.is.visible(u)||w.is.animating(u))&&(w.verbose("Doing menu hide animation",u),"none"==e?(f(),u.transition("hide"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:e+" out",duration:b.duration,debug:b.debug,verbose:b.verbose,queue:!1,onStart:f,onComplete:function(){t.call(ot)}}):w.error(vt.transition))}},hideAndClear:function(){w.remove.searchTerm();w.has.maxSelections()||(w.has.search()?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,b.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.hide,b.delay.hide)}},escape:{value:function(t){var i=n.isArray(t),r="string"==typeof t,f=!r&&!i,e=r&&-1!==t.search(ni.quote),u=[];return f||!e?t:(w.debug("Encoding quote values for use in select",t),i?(n.each(t,function(n,t){u.push(t.replace(ni.quote,"&quot;"))}),u):t.replace(ni.quote,"&quot;"))},string:function(n){return(n=String(n)).replace(ni.escape,"\\$&")}},setting:function(t,i){if(w.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else{if(i===r)return w[t];w[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,b.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),w.verbose.apply(console,arguments)))},error:function(){b.silent||(w.error=Function.prototype.bind.call(console.error,console,b.name+":"),w.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ot,"Execution Time":i}));clearTimeout(w.performance.timer);w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(w.performance.timer);n.each(s,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";l&&(t+=" '"+l+"'");(console.group!==r||console.table!==r)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):n.each(s,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());s=[]}},invoke:function(t,i,u){var h,o,s,e=pt;return i=i||y,u=ot||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(w.error(vt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};v?(pt===r&&w.initialize(),w.invoke(a)):(pt!==r&&pt.invoke("destroy"),w.initialize())}),f!==r?f:e};n.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(){},onAdd:function(){},onRemove:function(){},onLabelSelect:function(){},onLabelCreate:function(){return n(this)},onLabelRemove:function(){return!0},onNoResults:function(){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>"},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"},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",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:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",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"}};n.fn.dropdown.settings.templates={dropdown:function(t){var r=t.placeholder||!1,i=(t.values,"");return i+='<i class="dropdown icon"><\/i>',i+=t.placeholder?'<div class="default text">'+r+"<\/div>":'<div class="text"><\/div>',i+='<div class="menu">',n.each(t.values,function(n,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"<\/div>":'<div class="item" data-value="'+t.value+'">'+t.name+"<\/div>"}),i+="<\/div>"},menu:function(t,i){var u=t[i.values]||{},r="";return n.each(u,function(n,t){var u=t[i.text]?'data-text="'+t[i.text]+'"':"",f=t[i.disabled]?"disabled ":"";r+='<div class="'+f+'item" data-value="'+t[i.value]+'"'+u+">";r+=t[i.name];r+="<\/div>"}),r},label:function(n,t){return t+'<i class="delete icon"><\/i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.embed=function(i){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return e.each(function(){var a,v=n.isPlainObject(i)?n.extend(!0,{},n.fn.embed.settings,i):n.extend({},n.fn.embed.settings),b=v.selector,nt=v.className,w=v.sources,rt=v.error,p=v.metadata,ut=v.namespace,ft=v.templates,tt="."+ut,it="module-"+ut,y=(n(t),n(this)),k=(y.find(b.placeholder),y.find(b.icon),y.find(b.embed)),d=this,g=y.data(it);a={initialize:function(){a.debug("Initializing embed");a.determine.autoplay();a.create();a.bind.events();a.instantiate()},instantiate:function(){a.verbose("Storing instance of module",a);g=a;y.data(it,a)},destroy:function(){a.verbose("Destroying previous instance of embed");a.reset();y.removeData(it).off(tt)},refresh:function(){a.verbose("Refreshing selector cache");y.find(b.placeholder);y.find(b.icon);k=y.find(b.embed)},bind:{events:function(){a.has.placeholder()&&(a.debug("Adding placeholder events"),y.on("click"+tt,b.placeholder,a.createAndShow).on("click"+tt,b.icon,a.createAndShow))}},create:function(){a.get.placeholder()?a.createPlaceholder():a.createAndShow()},createPlaceholder:function(n){var t=a.get.icon(),i=a.get.url();a.generate.embed(i);n=n||a.get.placeholder();y.html(ft.placeholder(n,t));a.debug("Creating placeholder for embed",n,t)},createEmbed:function(t){a.refresh();t=t||a.get.url();k=n("<div/>").addClass(nt.embed).html(a.generate.embed(t)).appendTo(y);v.onCreate.call(d,t);a.debug("Creating embed object",k)},changeEmbed:function(n){k.html(a.generate.embed(n))},createAndShow:function(){a.createEmbed();a.show()},change:function(n,t,i){a.debug("Changing video to ",n,t,i);y.data(p.source,n).data(p.id,t);i?y.data(p.url,i):y.removeData(p.url);a.has.embed()?a.changeEmbed():a.create()},reset:function(){a.debug("Clearing embed and showing placeholder");a.remove.active();a.remove.embed();a.showPlaceholder();v.onReset.call(d)},show:function(){a.debug("Showing embed");a.set.active();v.onDisplay.call(d)},hide:function(){a.debug("Hiding embed");a.showPlaceholder()},showPlaceholder:function(){a.debug("Showing placeholder image");a.remove.active();v.onPlaceholderDisplay.call(d)},get:{id:function(){return v.id||y.data(p.id)},placeholder:function(){return v.placeholder||y.data(p.placeholder)},icon:function(){return v.icon?v.icon:y.data(p.icon)!==r?y.data(p.icon):a.determine.icon()},source:function(){return v.source?v.source:y.data(p.source)!==r?y.data(p.source):a.determine.source()},type:function(){var n=a.get.source();return w[n]!==r&&w[n].type},url:function(){return v.url?v.url:y.data(p.url)!==r?y.data(p.url):a.determine.url()}},determine:{autoplay:function(){a.should.autoplay()&&(v.autoplay=!0)},source:function(t){var i=!1;return(t=t||a.get.url())&&n.each(w,function(n,r){if(-1!==t.search(r.domain))return i=n,!1}),i},icon:function(){var n=a.get.source();return w[n]!==r&&w[n].icon},url:function(){var n,i=v.id||y.data(p.id),t=v.source||y.data(p.source);return(n=w[t]!==r&&w[t].url.replace("{id}",i))&&y.data(p.url,n),n}},set:{active:function(){y.addClass(nt.active)}},remove:{active:function(){y.removeClass(nt.active)},embed:function(){k.empty()}},encode:{parameters:function(n){var t,i=[];for(t in n)i.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return i.join("&amp;")}},generate:{embed:function(n){a.debug("Generating embed html");var t,i,r=a.get.source();return(n=a.get.url(n))?(i=a.generate.parameters(r),t=ft.iframe(n,i)):a.error(rt.noURL,y),t},parameters:function(t,i){var u=w[t]&&w[t].parameters!==r?w[t].parameters(v):{};return(i=i||v.parameters)&&(u=n.extend({},u,i)),u=v.onEmbed(u),a.encode.parameters(u)}},has:{embed:function(){return k.length>0},placeholder:function(){return v.placeholder||y.data(p.placeholder)}},should:{autoplay:function(){return"auto"===v.autoplay?v.placeholder||y.data(p.placeholder)!==r:v.autoplay}},is:{video:function(){return"video"==a.get.type()}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];a[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,v.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),a.verbose.apply(console,arguments)))},error:function(){v.silent||(a.error=Function.prototype.bind.call(console.error,console,v.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=g;return i=i||l,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(a.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(g===r&&a.initialize(),a.invoke(h)):(g!==r&&g.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(){},onEmbed:function(n){return n},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(n){return{autohide:!n.brandedUI,autoplay:n.autoplay,color:n.color||r,hq:n.hd,jsapi:n.api,modestbranding:!n.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(n){return{api:n.api,autoplay:n.autoplay,byline:n.brandedUI,color:n.color||r,portrait:n.brandedUI,title:n.brandedUI}}}},templates:{iframe:function(n,t){var i=n;return t&&(i+="?"+t),'<iframe src="'+i+'" width="100%" height="100%" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>'},placeholder:function(n,t){var i="";return t&&(i+='<i class="'+t+' icon"><\/i>'),n&&(i+='<img class="placeholder" src="'+n+'">'),i}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.modal=function(u){var f,h=n(this),c=n(t),l=n(i),o=n("body"),a=h.selector||"",s=(new Date).getTime(),e=[],v=arguments[0],y="string"==typeof v,p=[].slice.call(arguments,1),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return h.each(function(){var vt,rt,ht,g,it,ut,lt,yt,h,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.modal.settings,u):n.extend({},n.fn.modal.settings),ft=b.selector,d=b.className,pt=b.namespace,st=b.error,nt="."+pt,at="module-"+pt,k=n(this),ct=n(b.context),wt=k.find(ft.close),tt=this,et=k.data(at),ot=!1;h={initialize:function(){h.verbose("Initializing dimmer",ct);h.create.id();h.create.dimmer();h.refreshModals();h.bind.events();b.observeChanges&&h.observeChanges();h.instantiate()},instantiate:function(){h.verbose("Storing instance of modal");et=h;k.data(at,et)},create:{dimmer:function(){var t={debug:b.debug,variation:!b.centered&&"top aligned",dimmerName:"modals"},i=n.extend(!0,t,b.dimmerSettings);n.fn.dimmer!==r?(h.debug("Creating dimmer"),g=ct.dimmer(i),b.detachable?(h.verbose("Modal is detachable, moving content into dimmer"),g.dimmer("add content",k)):h.set.undetached(),it=g.dimmer("get dimmer")):h.error(st.dimmer)},id:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);ut="."+lt;h.verbose("Creating unique id for element",lt)}},destroy:function(){h.verbose("Destroying previous modal");k.removeData(at).off(nt);c.off(ut);it.off(ut);wt.off(nt);ct.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&((yt=new MutationObserver(function(){h.debug("DOM tree modified, refreshing");h.refresh()})).observe(tt,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",yt))},refresh:function(){h.remove.scrolling();h.cacheSizes();h.set.screenHeight();h.set.type()},refreshModals:function(){rt=k.siblings(ft.modal);vt=rt.add(k)},attachEvents:function(t,i){var r=n(t);i=n.isFunction(h[i])?h[i]:h.toggle;r.length>0?(h.debug("Attaching modal events to element",t,i),r.off(nt).on("click"+nt,i)):h.error(st.notFound,t)},bind:{events:function(){h.verbose("Attaching events");k.on("click"+nt,ft.close,h.event.close).on("click"+nt,ft.approve,h.event.approve).on("click"+nt,ft.deny,h.event.deny);c.on("resize"+ut,h.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){ot||!1===b.onApprove.call(tt,n(this))?h.verbose("Approve callback returned false cancelling hide"):(ot=!0,h.hide(function(){ot=!1}))},deny:function(){ot||!1===b.onDeny.call(tt,n(this))?h.verbose("Deny callback returned false cancelling hide"):(ot=!0,h.hide(function(){ot=!1}))},close:function(){h.hide()},click:function(t){if(b.closable){var r=n(t.target).closest(ft.modal).length>0,u=n.contains(i.documentElement,t.target);!r&&u&&h.is.active()&&(h.debug("Dimmer clicked, hiding all modals"),h.remove.clickaway(),b.allowMultiple?h.hide():h.hideAll())}else h.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(n,t){clearTimeout(h.timer);h.timer=setTimeout(n,t)},keyboard:function(n){27==n.which&&(b.closable?(h.debug("Escape key pressed hiding modal"),h.hide()):h.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){g.dimmer("is active")&&(h.is.animating()||h.is.active())&&w(h.refresh)}},toggle:function(){h.is.active()||h.is.animating()?h.hide():h.show()},show:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.set.dimmerSettings();h.showModal(t)},hide:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){};h.is.animating()||!h.is.active()?(h.showDimmer(),h.cacheSizes(),h.set.screenHeight(),h.set.type(),h.set.clickaway(),!b.allowMultiple&&h.others.active()?h.hideOthers(h.showModal):(b.allowMultiple&&b.detachable&&k.detach().appendTo(it),b.onShow.call(tt),b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.debug("Showing modal with css animations"),k.transition({debug:b.debug,animation:b.transition+" in",queue:b.queue,duration:b.duration,useFailSafe:!0,onComplete:function(){b.onVisible.apply(tt);b.keyboardShortcuts&&h.add.keyboardShortcuts();h.save.focus();h.set.active();b.autofocus&&h.set.autofocus();t()}})):h.error(st.noTransition))):h.debug("Modal is already visible")},hideModal:function(t,i){t=n.isFunction(t)?t:function(){};h.debug("Hiding modal");!1!==b.onHide.call(tt,n(this))?(h.is.animating()||h.is.active())&&(b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.remove.active(),k.transition({debug:b.debug,animation:b.transition+" out",queue:b.queue,duration:b.duration,useFailSafe:!0,onStart:function(){h.others.active()||i||h.hideDimmer();b.keyboardShortcuts&&h.remove.keyboardShortcuts()},onComplete:function(){b.onHidden.call(tt);h.restore.focus();t()}})):h.error(st.noTransition)):h.verbose("Hide callback returned false cancelling hide")},showDimmer:function(){g.dimmer("is animating")||!g.dimmer("is active")?(h.debug("Showing dimmer"),g.dimmer("show")):h.debug("Dimmer already visible")},hideDimmer:function(){g.dimmer("is animating")||g.dimmer("is active")?g.dimmer("hide",function(){h.remove.clickaway();h.remove.screenHeight()}):h.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var i=vt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding all visible modals"),h.hideDimmer(),i.modal("hide modal",t))},hideOthers:function(t){var i=rt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding other modals",rt),i.modal("hide modal",t,!0))},others:{active:function(){return rt.filter("."+d.active).length>0},animating:function(){return rt.filter("."+d.animating).length>0}},add:{keyboardShortcuts:function(){h.verbose("Adding keyboard shortcuts");l.on("keyup"+nt,h.event.keyboard)}},save:{focus:function(){n(i.activeElement).closest(k).length>0||(ht=n(i.activeElement).blur())}},restore:{focus:function(){ht&&ht.length>0&&ht.focus()}},remove:{active:function(){k.removeClass(d.active)},clickaway:function(){it.off("click"+ut)},bodyStyle:function(){""===o.attr("style")&&(h.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){h.debug("Removing page height");o.css("height","")},keyboardShortcuts:function(){h.verbose("Removing keyboard shortcuts");l.off("keyup"+nt)},scrolling:function(){g.removeClass(d.scrolling);k.removeClass(d.scrolling)}},cacheSizes:function(){k.addClass(d.loading);var f=k.prop("scrollHeight"),u=k.outerHeight();h.cache!==r&&0===u||(h.cache={pageHeight:n(i).outerHeight(),height:u+b.offset,scrollHeight:f+b.offset,contextHeight:"body"==b.context?n(t).height():g.height()},h.cache.topOffset=-h.cache.height/2);k.removeClass(d.loading);h.debug("Caching modal and container sizes",h.cache)},can:{fit:function(){var n=h.cache.contextHeight,u=h.cache.contextHeight/2,f=h.cache.topOffset,t=h.cache.scrollHeight,i=h.cache.height,r=b.padding;return t>i?u+f+t+r<n:i+2*r<n}},is:{active:function(){return k.hasClass(d.active)},animating:function(){return k.transition("is supported")?k.transition("is animating"):k.is(":visible")},scrolling:function(){return g.hasClass(d.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){var n=k.find("[tabindex], :input").filter(":visible"),t=n.filter("[autofocus]"),i=t.length>0?t.first():n.first();i.length>0&&i.focus()},clickaway:function(){it.on("click"+ut,h.event.click)},dimmerSettings:function(){if(n.fn.dimmer!==r){var i={debug:b.debug,dimmerName:"modals",closable:"auto",variation:!b.centered&&"top aligned",duration:{show:b.duration,hide:b.duration}},t=n.extend(!0,i,b.dimmerSettings);b.inverted?(t.variation=t.variation!==r?t.variation+" inverted":"inverted",it.addClass(d.inverted)):it.removeClass(d.inverted);b.blurring?g.addClass(d.blurring):g.removeClass(d.blurring);ct.dimmer("setting",t)}else h.error(st.dimmer)},screenHeight:function(){h.can.fit()?o.css("height",""):(h.debug("Modal is taller than page content, resizing page height"),o.css("height",h.cache.height+2*b.padding))},active:function(){k.addClass(d.active)},scrolling:function(){g.addClass(d.scrolling);k.addClass(d.scrolling)},type:function(){h.can.fit()?(h.verbose("Modal fits on screen"),h.others.active()||h.others.animating()||h.remove.scrolling()):(h.verbose("Modal cannot fit on screen setting to scrolling"),h.set.scrolling())},undetached:function(){g.addClass(d.undetached)}},setting:function(t,i){if(h.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,h,t);else{if(i===r)return h[t];h[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,b.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),h.verbose.apply(console,arguments)))},error:function(){b.silent||(h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(h.performance.timer);h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",i=0;s=!1;clearTimeout(h.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=et;return i=i||p,u=tt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(et===r&&h.initialize(),h.invoke(v)):(et!==r&&et.invoke("destroy"),h.initialize())}),f!==r?f:this};n.fn.modal.settings={name:"Modal",namespace:"modal",silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",loading:"loading",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.nag=function(i){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var a,o=n.isPlainObject(i)?n.extend(!0,{},n.fn.nag.settings,i):n.extend({},n.fn.nag.settings),b=(o.className,o.selector),y=o.error,k=o.namespace,d="."+k,w=k+"-module",v=n(this),g=(v.find(b.close),o.context?n(o.context):n("body")),nt=this,p=v.data(w);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame;a={initialize:function(){a.verbose("Initializing element");v.on("click"+d,b.close,a.dismiss).data(w,a);o.detachable&&v.parent()[0]!==g[0]&&v.detach().prependTo(g);o.displayTime>0&&setTimeout(a.hide,o.displayTime);a.show()},destroy:function(){a.verbose("Destroying instance");v.removeData(w).off(d)},show:function(){a.should.show()&&!v.is(":visible")&&(a.debug("Showing nag",o.animation.show),"fade"==o.animation.show?v.fadeIn(o.duration,o.easing):v.slideDown(o.duration,o.easing))},hide:function(){a.debug("Showing nag",o.animation.hide);"fade"==o.animation.show?v.fadeIn(o.duration,o.easing):v.slideUp(o.duration,o.easing)},onHide:function(){a.debug("Removing nag",o.animation.hide);v.remove();o.onHide&&o.onHide()},dismiss:function(n){o.storageMethod&&a.storage.set(o.key,o.value);a.hide();n.stopImmediatePropagation();n.preventDefault()},should:{show:function(){return o.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(o.key)!=o.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(o.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(o.key)),!1)}},get:{storageOptions:function(){var n={};return o.expires&&(n.expires=o.expires),o.domain&&(n.domain=o.domain),o.path&&(n.path=o.path),n}},clear:function(){a.storage.remove(o.key)},storage:{set:function(i,u){var f=a.get.storageOptions();if("localstorage"==o.storageMethod&&t.localStorage!==r)t.localStorage.setItem(i,u),a.debug("Value stored using local storage",i,u);else if("sessionstorage"==o.storageMethod&&t.sessionStorage!==r)t.sessionStorage.setItem(i,u),a.debug("Value stored using session storage",i,u);else{if(n.cookie===r)return void a.error(y.noCookieStorage);n.cookie(i,u,f);a.debug("Value stored using cookie",i,u,f)}},get:function(i){var u;return"localstorage"==o.storageMethod&&t.localStorage!==r?u=t.localStorage.getItem(i):"sessionstorage"==o.storageMethod&&t.sessionStorage!==r?u=t.sessionStorage.getItem(i):n.cookie!==r?u=n.cookie(i):a.error(y.noCookieStorage),"undefined"!=u&&"null"!=u&&u!==r&&null!==u||(u=r),u},remove:function(i){var u=a.get.storageOptions();"localstorage"==o.storageMethod&&t.localStorage!==r?t.localStorage.removeItem(i):"sessionstorage"==o.storageMethod&&t.sessionStorage!==r?t.sessionStorage.removeItem(i):n.cookie!==r?n.removeCookie(i,u):a.error(y.noStorage)}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];n.isPlainObject(o[t])?n.extend(!0,o[t],i):o[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];a[t]=i}},debug:function(){!o.silent&&o.debug&&(o.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,o.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),a.verbose.apply(console,arguments)))},error:function(){o.silent||(a.error=Function.prototype.bind.call(console.error,console,o.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;o.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=o.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=p;return i=i||l,f=nt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(a.error(y.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(p===r&&a.initialize(),a.invoke(h)):(p!==r&&p.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.popup=function(u){var f,l=n(this),s=n(i),o=n(t),h=n("body"),a=l.selector||"",c=(new Date).getTime(),e=[],v=arguments[0],y="string"==typeof v,p=[].slice.call(arguments,1);return l.each(function(){var b,it,ht,rt,ct,l,w=n.isPlainObject(u)?n.extend(!0,{},n.fn.popup.settings,u):n.extend({},n.fn.popup.settings),ot=w.selector,g=w.className,st=w.error,nt=w.metadata,bt=w.namespace,ut="."+w.namespace,vt="module-"+bt,k=n(this),pt=n(w.context),wt=n(w.scrollContext),lt=n(w.boundary),tt=w.target?n(w.target):k,at=0,ft=!1,yt=!1,d=this,et=k.data(vt);l={initialize:function(){l.debug("Initializing",k);l.createID();l.bind.events();!l.exists()&&w.preserve&&l.create();w.observeChanges&&l.observeChanges();l.instantiate()},instantiate:function(){l.verbose("Storing instance",l);et=l;k.data(vt,et)},observeChanges:function(){"MutationObserver"in t&&((ht=new MutationObserver(l.event.documentChanged)).observe(i,{childList:!0,subtree:!0}),l.debug("Setting up mutation observer",ht))},refresh:function(){w.popup?b=n(w.popup).eq(0):w.inline&&(b=tt.nextAll(ot.popup).eq(0),w.popup=b);w.popup?(b.addClass(g.loading),it=l.get.offsetParent(),b.removeClass(g.loading),w.movePopup&&l.has.popup()&&l.get.offsetParent(b)[0]!==it[0]&&(l.debug("Moving popup to the same offset parent as target"),b.detach().appendTo(it))):it=w.inline?l.get.offsetParent(tt):l.has.popup()?l.get.offsetParent(b):h;it.is("html")&&it[0]!==h[0]&&(l.debug("Setting page as offset parent"),it=h);l.get.variation()&&l.set.variation()},reposition:function(){l.refresh();l.set.position()},destroy:function(){l.debug("Destroying previous module");ht&&ht.disconnect();b&&!w.preserve&&l.removePopup();clearTimeout(l.hideTimer);clearTimeout(l.showTimer);l.unbind.close();l.unbind.events();k.removeData(vt)},event:{start:function(){var t=n.isPlainObject(w.delay)?w.delay.show:w.delay;clearTimeout(l.hideTimer);yt||(l.showTimer=setTimeout(l.show,t))},end:function(){var t=n.isPlainObject(w.delay)?w.delay.hide:w.delay;clearTimeout(l.showTimer);l.hideTimer=setTimeout(l.hide,t)},touchstart:function(){yt=!0;l.show()},resize:function(){l.is.visible()&&l.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==d||n(t).find(d).length>0)&&(l.debug("Element removed from DOM, tearing down events"),l.destroy())})})},hideGracefully:function(t){var r=n(t.target),u=n.contains(i.documentElement,t.target),f=r.closest(ot.popup).length>0;t&&!f&&u?(l.debug("Click occurred outside popup hiding popup"),l.hide()):l.debug("Click was inside popup, keeping popup open")}},create:function(){var t=l.get.html(),i=l.get.title(),r=l.get.content();t||r||i?(l.debug("Creating pop-up html"),t||(t=w.templates.popup({title:i,content:r})),b=n("<div/>").addClass(g.popup).data(nt.activator,k).html(t),w.inline?(l.verbose("Inserting popup element inline",b),b.insertAfter(k)):(l.verbose("Appending popup element to body",b),b.appendTo(pt)),l.refresh(),l.set.variation(),w.hoverable&&l.bind.popup(),w.onCreate.call(b,d)):0!==tt.next(ot.popup).length?(l.verbose("Pre-existing popup found"),w.inline=!0,w.popup=tt.next(ot.popup).data(nt.activator,k),l.refresh(),w.hoverable&&l.bind.popup()):w.popup?(n(w.popup).data(nt.activator,k),l.verbose("Used popup specified in settings"),l.refresh(),w.hoverable&&l.bind.popup()):l.debug("No content specified skipping display",d)},createID:function(){ct=(Math.random().toString(16)+"000000000").substr(2,8);rt="."+ct;l.verbose("Creating unique id for element",ct)},toggle:function(){l.debug("Toggling pop-up");l.is.hidden()?(l.debug("Popup is hidden, showing pop-up"),l.unbind.close(),l.show()):(l.debug("Popup is visible, hiding pop-up"),l.hide())},show:function(n){if(n=n||function(){},l.debug("Showing pop-up",w.transition),l.is.hidden()&&(!l.is.active()||!l.is.dropdown())){if(l.exists()||l.create(),!1===w.onShow.call(b,d))return void l.debug("onShow callback returned false, cancelling popup animation");w.preserve||w.popup||l.refresh();b&&l.set.position()&&(l.save.conditions(),w.exclusive&&l.hideAll(),l.animate.show(n))}},hide:function(n){if(n=n||function(){},l.is.visible()||l.is.animating()){if(!1===w.onHide.call(b,d))return void l.debug("onHide callback returned false, cancelling popup animation");l.remove.visible();l.unbind.close();l.restore.conditions();l.animate.hide(n)}},hideAll:function(){n(ot.popup).filter("."+g.popupVisible).each(function(){n(this).data(nt.activator).popup("hide")})},exists:function(){return!!b&&(w.inline||w.popup?l.has.popup():b.closest(pt).length>=1)},removePopup:function(){l.has.popup()&&!w.popup&&(l.debug("Removing popup",b),b.remove(),b=r,w.onRemove.call(b,d))},save:{conditions:function(){l.cache={title:k.attr("title")};l.cache.title&&k.removeAttr("title");l.verbose("Saving original attributes",l.cache.title)}},restore:{conditions:function(){return l.cache&&l.cache.title&&(k.attr("title",l.cache.title),l.verbose("Restoring original attributes",l.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};w.transition&&n.fn.transition!==r&&k.transition("is supported")?(l.set.visible(),b.transition({animation:w.transition+" in",queue:!1,debug:w.debug,verbose:w.verbose,duration:w.duration,onComplete:function(){l.bind.close();t.call(b,d);w.onVisible.call(b,d)}})):l.error(st.noTransition)},hide:function(t){t=n.isFunction(t)?t:function(){};l.debug("Hiding pop-up");!1!==w.onHide.call(b,d)?w.transition&&n.fn.transition!==r&&k.transition("is supported")?b.transition({animation:w.transition+" out",queue:!1,duration:w.duration,debug:w.debug,verbose:w.verbose,onComplete:function(){l.reset();t.call(b,d);w.onHidden.call(b,d)}}):l.error(st.noTransition):l.debug("onHide callback returned false, cancelling popup animation")}},change:{content:function(n){b.html(n)}},get:{html:function(){return k.removeData(nt.html),k.data(nt.html)||w.html},title:function(){return k.removeData(nt.title),k.data(nt.title)||w.title},content:function(){return k.removeData(nt.content),k.data(nt.content)||w.content||k.attr("title")},variation:function(){return k.removeData(nt.variation),k.data(nt.variation)||w.variation},popup:function(){return b},popupOffset:function(){return b.offset()},calculations:function(){var i,r=l.get.offsetParent(b),u=tt[0],e=lt[0]==t,s=w.inline||w.popup&&w.movePopup?tt.position():tt.offset(),h=e?{top:0,left:0}:lt.offset(),n={},c=e?{top:o.scrollTop(),left:o.scrollLeft()}:{top:0,left:0},f;return(n={target:{element:tt[0],width:tt.outerWidth(),height:tt.outerHeight(),top:s.top,left:s.left,margin:{}},popup:{width:b.outerWidth(),height:b.outerHeight()},parent:{width:it.outerWidth(),height:it.outerHeight()},screen:{top:h.top,left:h.left,scroll:{top:c.top,left:c.left},width:lt.width(),height:lt.height()}},r.get(0)!==it.get(0))&&(f=r.offset(),n.target.top-=f.top,n.target.left-=f.left,n.parent.width=r.outerWidth(),n.parent.height=r.outerHeight()),w.setFluidWidth&&l.is.fluid()&&(n.container={width:b.parent().outerWidth()},n.popup.width=n.container.width),n.target.margin.top=w.inline?parseInt(t.getComputedStyle(u).getPropertyValue("margin-top"),10):0,n.target.margin.left=w.inline?l.is.rtl()?parseInt(t.getComputedStyle(u).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(u).getPropertyValue("margin-left"),10):0,i=n.screen,n.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},n},id:function(){return ct},startEvent:function(){return"hover"==w.on?"mouseenter":"focus"==w.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==w.on?"mouseleave":"focus"==w.on&&"blur"},distanceFromBoundary:function(n,t){var r,i,u={};return r=(t=t||l.get.calculations()).popup,i=t.boundary,n&&(u={top:n.top-i.top,left:n.left-i.left,right:i.right-(n.left+r.width),bottom:i.bottom-(n.top+r.height)},l.verbose("Distance from boundaries determined",n,u)),u},offsetParent:function(t){var u=(t!==r?t[0]:tt[0]).parentNode,i=n(u);if(u)for(var f="none"===i.css("transform"),e="static"===i.css("position"),o=i.is("body");u&&!o&&e&&f;)u=u.parentNode,f="none"===(i=n(u)).css("transform"),e="static"===i.css("position"),o=i.is("body");return i&&i.length>0?i:n()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(n){var r=n.split(" "),i=r[0],u=r[1],o="top"==i||"bottom"==i,f=!1,e=!1,t=!1;return ft||(l.verbose("All available positions available"),ft=l.get.positions()),l.debug("Recording last position tried",n),ft[n]=!0,"opposite"===w.prefer&&(t=(t=[{top:"bottom",bottom:"top",left:"right",right:"left"}[i],u]).join(" "),f=!0===ft[t],l.debug("Trying opposite strategy",t)),"adjacent"===w.prefer&&o&&(t=(t=[i,{left:"center",center:"right",right:"left"}[u]]).join(" "),e=!0===ft[t],l.debug("Trying adjacent strategy",t)),(e||f)&&(l.debug("Using backup position",t),t={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[n]),t}},set:{position:function(n,t){if(0!==tt.length&&0!==b.length){var u,f,i,s,o,e,h,c;if(t=t||l.get.calculations(),n=n||k.data(nt.position)||w.position,u=k.data(nt.offset)||w.offset,f=w.distanceAway,i=t.target,s=t.popup,o=t.parent,l.should.centerArrow(t)&&(l.verbose("Adjusting offset to center arrow on small target element"),"top left"!=n&&"bottom left"!=n||(u+=i.width/2,u-=w.arrowPixelsFromEdge),"top right"!=n&&"bottom right"!=n||(u-=i.width/2,u+=w.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!l.is.svg(i.element))return l.debug("Popup target is hidden, no action taken"),!1;switch(w.inline&&(l.debug("Adding margin to calculation",i.margin),"left center"==n||"right center"==n?(u+=i.margin.top,f+=-i.margin.left):"top left"==n||"top center"==n||"top right"==n?(u+=i.margin.left,f-=i.margin.top):(u+=i.margin.left,f+=i.margin.top)),l.debug("Determining popup position from calculations",n,t),l.is.rtl()&&(n=n.replace(/left|right/g,function(n){return"left"==n?"right":"left"}),l.debug("RTL: Popup position updated",n)),at==w.maxSearchDepth&&"string"==typeof w.lastResort&&(n=w.lastResort),n){case"top left":e={top:"auto",bottom:o.height-i.top+f,left:i.left+u,right:"auto"};break;case"top center":e={bottom:o.height-i.top+f,left:i.left+i.width/2-s.width/2+u,top:"auto",right:"auto"};break;case"top right":e={bottom:o.height-i.top+f,right:o.width-i.left-i.width-u,top:"auto",left:"auto"};break;case"left center":e={top:i.top+i.height/2-s.height/2+u,right:o.width-i.left+f,left:"auto",bottom:"auto"};break;case"right center":e={top:i.top+i.height/2-s.height/2+u,left:i.left+i.width+f,bottom:"auto",right:"auto"};break;case"bottom left":e={top:i.top+i.height+f,left:i.left+u,bottom:"auto",right:"auto"};break;case"bottom center":e={top:i.top+i.height+f,left:i.left+i.width/2-s.width/2+u,bottom:"auto",right:"auto"};break;case"bottom right":e={top:i.top+i.height+f,right:o.width-i.left-i.width-u,left:"auto",bottom:"auto"}}if(e===r&&l.error(st.invalidPosition,n),l.debug("Calculated popup positioning values",e),b.css(e).removeClass(g.position).addClass(n).addClass(g.loading),h=l.get.popupOffset(),c=l.get.distanceFromBoundary(h,t),l.is.offstage(c,n)){if(l.debug("Position is outside viewport",n),at<w.maxSearchDepth)return at++,n=l.get.nextPosition(n),l.debug("Trying new position",n),!!b&&l.set.position(n,t);if(!w.lastResort)return l.debug("Popup could not find a position to display",b),l.error(st.cannotPlace,d),l.remove.attempts(),l.remove.loading(),l.reset(),w.onUnplaceable.call(b,d),!1;l.debug("No position found, showing with last position")}return l.debug("Position is on stage",n),l.remove.attempts(),l.remove.loading(),w.setFluidWidth&&l.is.fluid()&&l.set.fluidWidth(t),!0}l.error(st.notFound)},fluidWidth:function(n){n=n||l.get.calculations();l.debug("Automatically setting element width to parent width",n.parent.width);b.css("width",n.container.width)},variation:function(n){(n=n||l.get.variation())&&l.has.popup()&&(l.verbose("Adding variation to popup",n),b.addClass(n))},visible:function(){k.addClass(g.visible)}},remove:{loading:function(){b.removeClass(g.loading)},variation:function(n){(n=n||l.get.variation())&&(l.verbose("Removing variation",n),b.removeClass(n))},visible:function(){k.removeClass(g.visible)},attempts:function(){l.verbose("Resetting all searched positions");at=0;ft=!1}},bind:{events:function(){l.debug("Binding popup events to module");"click"==w.on&&k.on("click"+ut,l.toggle);"hover"==w.on&&k.on("touchstart"+ut,l.event.touchstart);l.get.startEvent()&&k.on(l.get.startEvent()+ut,l.event.start).on(l.get.endEvent()+ut,l.event.end);w.target&&l.debug("Target set to element",tt);o.on("resize"+rt,l.event.resize)},popup:function(){l.verbose("Allowing hover events on popup to prevent closing");b&&l.has.popup()&&b.on("mouseenter"+ut,l.event.start).on("mouseleave"+ut,l.event.end)},close:function(){(!0===w.hideOnScroll||"auto"==w.hideOnScroll&&"click"!=w.on)&&l.bind.closeOnScroll();"hover"==w.on&&yt&&l.bind.touchClose();"click"==w.on&&w.closable&&l.bind.clickaway()},closeOnScroll:function(){l.verbose("Binding scroll close event to document");wt.one(l.get.scrollEvent()+rt,l.event.hideGracefully)},touchClose:function(){l.verbose("Binding popup touchclose event to document");s.on("touchstart"+rt,function(n){l.verbose("Touched away from popup");l.event.hideGracefully.call(d,n)})},clickaway:function(){l.verbose("Binding popup close event to document");s.on("click"+rt,function(n){l.verbose("Clicked away from popup");l.event.hideGracefully.call(d,n)})}},unbind:{events:function(){o.off(rt);k.off(ut)},close:function(){s.off(rt);wt.off(rt)}},has:{popup:function(){return b&&b.length>0}},should:{centerArrow:function(n){return!l.is.basic()&&n.target.width<=2*w.arrowPixelsFromEdge}},is:{offstage:function(t,i){var r=[];return n.each(t,function(n,t){t<-w.jitter&&(l.debug("Position exceeds allowable distance from edge",n,t,i),r.push(n))}),r.length>0},svg:function(n){return l.supports.svg()&&n instanceof SVGGraphicsElement},basic:function(){return k.hasClass(g.basic)},active:function(){return k.hasClass(g.active)},animating:function(){return b!==r&&b.hasClass(g.animating)},fluid:function(){return b!==r&&b.hasClass(g.fluid)},visible:function(){return b!==r&&b.hasClass(g.popupVisible)},dropdown:function(){return k.hasClass(g.dropdown)},hidden:function(){return!l.is.visible()},rtl:function(){return"rtl"==k.css("direction")}},reset:function(){l.remove.visible();w.preserve?n.fn.transition!==r&&b.transition("remove transition"):l.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else{if(i===r)return w[t];w[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!w.silent&&w.debug&&(w.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,w.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),l.verbose.apply(console,arguments)))},error:function(){w.silent||(l.error=Function.prototype.bind.call(console.error,console,w.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;w.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=w.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=et;return i=i||p,u=d||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(et===r&&l.initialize(),l.invoke(v)):(et!==r&&et.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return t[n]}):n},popup:function(t){var i="",u=n.fn.popup.settings.templates.escape;return typeof t!==r&&(typeof t.title!==r&&t.title&&(t.title=u(t.title),i+='<div class="header">'+t.title+"<\/div>"),typeof t.content!==r&&t.content&&(t.content=u(t.content),i+='<div class="content">'+t.content+"<\/div>")),i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";void 0!==(t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")())&&t.Math==Math||("undefined"!=typeof self&&self.Math==Math?self:Function("return this")());n.fn.progress=function(t){var u,o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var o,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.progress.settings,t):n.extend({},n.fn.progress.settings),y=a.className,g=a.metadata,rt=a.namespace,nt=a.selector,k=a.error,ut="."+rt,tt="module-"+rt,v=n(this),b=n(this).find(nt.bar),it=n(this).find(nt.progress),ft=n(this).find(nt.label),p=this,w=v.data(tt),d=!1;o={initialize:function(){o.debug("Initializing progress bar",a);o.set.duration();o.set.transitionEvent();o.read.metadata();o.read.settings();o.instantiate()},instantiate:function(){o.verbose("Storing instance of progress",o);w=o;v.data(tt,o)},destroy:function(){o.verbose("Destroying previous progress for",v);clearInterval(w.interval);o.remove.state();v.removeData(tt);w=r},reset:function(){o.remove.nextValue();o.update.progress(0)},complete:function(){(o.percent===r||o.percent<100)&&(o.remove.progressPoll(),o.set.percent(100))},read:{metadata:function(){var n={percent:v.data(g.percent),total:v.data(g.total),value:v.data(g.value)};n.percent&&(o.debug("Current percent value set from metadata",n.percent),o.set.percent(n.percent));n.total&&(o.debug("Total value set from metadata",n.total),o.set.total(n.total));n.value&&(o.debug("Current value set from metadata",n.value),o.set.value(n.value),o.set.progress(n.value))},settings:function(){!1!==a.total&&(o.debug("Current total set in settings",a.total),o.set.total(a.total));!1!==a.value&&(o.debug("Current value set in settings",a.value),o.set.value(a.value),o.set.progress(o.value));!1!==a.percent&&(o.debug("Current percent set in settings",a.percent),o.set.percent(a.percent))}},bind:{transitionEnd:function(n){var t=o.get.transitionEnd();b.one(t+ut,function(t){clearTimeout(o.failSafeTimer);n.call(this,t)});o.failSafeTimer=setTimeout(function(){b.triggerHandler(t)},a.duration+a.failSafeDelay);o.verbose("Adding fail safe timer",o.timer)}},increment:function(n){var i,t;o.has.total()?t=(i=o.get.value())+(n=n||1):(t=(i=o.get.percent())+(n=n||o.get.randomValue()),o.debug("Incrementing percentage by",i,t));t=o.get.normalizedValue(t);o.set.progress(t)},decrement:function(n){var i,t;o.get.total()?(t=(i=o.get.value())-(n=n||1),o.debug("Decrementing value by",n,i)):(t=(i=o.get.percent())-(n=n||o.get.randomValue()),o.debug("Decrementing percentage by",n,i));t=o.get.normalizedValue(t);o.set.progress(t)},has:{progressPoll:function(){return o.progressPoll},total:function(){return!1!==o.get.total()}},get:{text:function(n){var t=o.value||0,i=o.total||0,r=d?o.get.displayPercent():o.percent||0,u=o.total>0?i-t:100-r;return n=(n=n||"").replace("{value}",t).replace("{total}",i).replace("{left}",u).replace("{percent}",r),o.verbose("Adding variables to progress bar text",n),n},normalizedValue:function(n){if(n<0)return o.debug("Value cannot decrement below 0"),0;if(o.has.total()){if(n>o.total)return o.debug("Value cannot increment above total",o.total),o.total}else if(n>100)return o.debug("Value cannot increment above 100 percent"),100;return n},updateInterval:function(){return"auto"==a.updateInterval?a.duration:a.updateInterval},randomValue:function(){return o.debug("Generating random increment percentage"),Math.floor(Math.random()*a.random.max+a.random.min)},numericValue:function(n){return"string"==typeof n?""!==n.replace(/[^\d.]/g,"")&&+n.replace(/[^\d.]/g,""):n},transitionEnd:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]},displayPercent:function(){var n=b.width(),i=v.width(),t=n>parseInt(b.css("min-width"),10)?n/i*100:o.percent;return a.precision>0?Math.round(t*10*a.precision)/(10*a.precision):Math.round(t)},percent:function(){return o.percent||0},value:function(){return o.nextValue||o.value||0},total:function(){return o.total||!1}},create:{progressPoll:function(){o.progressPoll=setTimeout(function(){o.update.toNextValue();o.remove.progressPoll()},o.get.updateInterval())}},is:{complete:function(){return o.is.success()||o.is.warning()||o.is.error()},success:function(){return v.hasClass(y.success)},warning:function(){return v.hasClass(y.warning)},error:function(){return v.hasClass(y.error)},active:function(){return v.hasClass(y.active)},visible:function(){return v.is(":visible")}},remove:{progressPoll:function(){o.verbose("Removing progress poll timer");o.progressPoll&&(clearTimeout(o.progressPoll),delete o.progressPoll)},nextValue:function(){o.verbose("Removing progress value stored for next update");delete o.nextValue},state:function(){o.verbose("Removing stored state");delete o.total;delete o.percent;delete o.value},active:function(){o.verbose("Removing active state");v.removeClass(y.active)},success:function(){o.verbose("Removing success state");v.removeClass(y.success)},warning:function(){o.verbose("Removing warning state");v.removeClass(y.warning)},error:function(){o.verbose("Removing error state");v.removeClass(y.error)}},set:{barWidth:function(n){n>100?o.error(k.tooHigh,n):n<0?o.error(k.tooLow,n):(b.css("width",n+"%"),v.attr("data-percent",parseInt(n,10)))},duration:function(n){n="number"==typeof(n=n||a.duration)?n+"ms":n;o.verbose("Setting progress bar transition duration",n);b.css({"transition-duration":n})},percent:function(n){n="string"==typeof n?+n.replace("%",""):n;n=a.precision>0?Math.round(n*10*a.precision)/(10*a.precision):Math.round(n);o.percent=n;o.has.total()||(o.value=a.precision>0?Math.round(n/100*o.total*10*a.precision)/(10*a.precision):Math.round(n/100*o.total*10)/10,a.limitValues&&(o.value=o.value>100?100:o.value<0?0:o.value));o.set.barWidth(n);o.set.labelInterval();o.set.labels();a.onChange.call(p,n,o.value,o.total)},labelInterval:function(){clearInterval(o.interval);o.bind.transitionEnd(function(){o.verbose("Bar finished animating, removing continuous label updates");clearInterval(o.interval);d=!1;o.set.labels()});d=!0;o.interval=setInterval(function(){n.contains(i.documentElement,p)||(clearInterval(o.interval),d=!1);o.set.labels()},a.framerate)},labels:function(){o.verbose("Setting both bar progress and outer label text");o.set.barLabel();o.set.state()},label:function(n){(n=n||"")&&(n=o.get.text(n),o.verbose("Setting label to text",n),ft.text(n))},state:function(n){100===(n=n!==r?n:o.percent)?a.autoSuccess&&!(o.is.warning()||o.is.error()||o.is.success())?(o.set.success(),o.debug("Automatically triggering success at 100%")):(o.verbose("Reached 100% removing active state"),o.remove.active(),o.remove.progressPoll()):n>0?(o.verbose("Adjusting active progress bar label",n),o.set.active()):(o.remove.active(),o.set.label(a.text.active))},barLabel:function(n){n!==r?it.text(o.get.text(n)):"ratio"==a.label&&o.total?(o.verbose("Adding ratio to bar label"),it.text(o.get.text(a.text.ratio))):"percent"==a.label&&(o.verbose("Adding percentage to bar label"),it.text(o.get.text(a.text.percent)))},active:function(n){n=n||a.text.active;o.debug("Setting active state");a.showActivity&&!o.is.active()&&v.addClass(y.active);o.remove.warning();o.remove.error();o.remove.success();(n=a.onLabelUpdate("active",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onActive.call(p,o.value,o.total)})},success:function(n){n=n||a.text.success||a.text.active;o.debug("Setting success state");v.addClass(y.success);o.remove.active();o.remove.warning();o.remove.error();o.complete();a.text.success?(n=a.onLabelUpdate("success",n,o.value,o.total),o.set.label(n)):(n=a.onLabelUpdate("active",n,o.value,o.total),o.set.label(n));o.bind.transitionEnd(function(){a.onSuccess.call(p,o.total)})},warning:function(n){n=n||a.text.warning;o.debug("Setting warning state");v.addClass(y.warning);o.remove.active();o.remove.success();o.remove.error();o.complete();(n=a.onLabelUpdate("warning",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onWarning.call(p,o.value,o.total)})},error:function(n){n=n||a.text.error;o.debug("Setting error state");v.addClass(y.error);o.remove.active();o.remove.success();o.remove.warning();o.complete();(n=a.onLabelUpdate("error",n,o.value,o.total))&&o.set.label(n);o.bind.transitionEnd(function(){a.onError.call(p,o.value,o.total)})},transitionEvent:function(){o.get.transitionEnd()},total:function(n){o.total=n},value:function(n){o.value=n},progress:function(n){o.has.progressPoll()?(o.debug("Updated within interval, setting next update to use new value",n),o.set.nextValue(n)):(o.debug("First update in progress update interval, immediately updating",n),o.update.progress(n),o.create.progressPoll())},nextValue:function(n){o.nextValue=n}},update:{toNextValue:function(){var n=o.nextValue;n&&(o.debug("Update interval complete using last updated value",n),o.update.progress(n),o.remove.nextValue())},progress:function(n){var t;!1===(n=o.get.numericValue(n))&&o.error(k.nonNumeric,n);n=o.get.normalizedValue(n);o.has.total()?(o.set.value(n),t=n/o.total*100,o.debug("Calculating percent complete from total",t),o.set.percent(t)):(t=n,o.debug("Setting value to exact percentage value",t),o.set.percent(t))}},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:p,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=w;return i=i||l,f=p||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?(s=e[u],!1):(o.error(k.method,t),!1);e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(w===r&&o.initialize(),o.invoke(h)):(w!==r&&w.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(n,t){return t},onChange:function(){},onSuccess:function(){},onActive:function(){},onError:function(){},onWarning:function(){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.rating=function(t){var i,f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return f.each(function(){var g,l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.rating.settings,t):n.extend({},n.fn.rating.settings),it=a.namespace,y=a.className,w=a.metadata,k=a.selector,d=(a.error,"."+it),nt="module-"+it,tt=this,b=n(this).data(nt),v=n(this),p=v.find(k.icon);l={initialize:function(){l.verbose("Initializing rating module",a);0===p.length&&l.setup.layout();a.interactive?l.enable():l.disable();l.set.initialLoad();l.set.rating(l.get.initialRating());l.remove.initialLoad();l.instantiate()},instantiate:function(){l.verbose("Instantiating module",a);b=l;v.data(nt,l)},destroy:function(){l.verbose("Destroying previous instance",b);l.remove.events();v.removeData(nt)},refresh:function(){p=v.find(k.icon)},setup:{layout:function(){var t=l.get.maxRating(),i=n.fn.rating.settings.templates.icon(t);l.debug("Generating icon html dynamically");v.html(i);l.refresh()}},event:{mouseenter:function(){var t=n(this);t.nextAll().removeClass(y.selected);v.addClass(y.selected);t.addClass(y.selected).prevAll().addClass(y.selected)},mouseleave:function(){v.removeClass(y.selected);p.removeClass(y.selected)},click:function(){var i=n(this),r=l.get.rating(),t=p.index(i)+1;("auto"==a.clearable?1===p.length:a.clearable)&&r==t?l.clearRating():l.set.rating(t)}},clearRating:function(){l.debug("Clearing current rating");l.set.rating(0)},bind:{events:function(){l.verbose("Binding events");v.on("mouseenter"+d,k.icon,l.event.mouseenter).on("mouseleave"+d,k.icon,l.event.mouseleave).on("click"+d,k.icon,l.event.click)}},remove:{events:function(){l.verbose("Removing events");v.off(d)},initialLoad:function(){g=!1}},enable:function(){l.debug("Setting rating to interactive mode");l.bind.events();v.removeClass(y.disabled)},disable:function(){l.debug("Setting rating to read-only mode");l.remove.events();v.addClass(y.disabled)},is:{initialLoad:function(){return g}},get:{initialRating:function(){return v.data(w.rating)!==r?(v.removeData(w.rating),v.data(w.rating)):a.initialRating},maxRating:function(){return v.data(w.maxRating)!==r?(v.removeData(w.maxRating),v.data(w.maxRating)):a.maxRating},rating:function(){var n=p.filter("."+y.active).length;return l.verbose("Current rating retrieved",n),n}},set:{rating:function(n){var t=n-1>=0?n-1:0,i=p.eq(t);v.removeClass(y.selected);p.removeClass(y.selected).removeClass(y.active);n>0&&(l.verbose("Setting current rating to",n),i.prevAll().addBack().addClass(y.active));l.is.initialLoad()||a.onRate.call(tt,n)},initialLoad:function(){g=!0}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(l.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");f.length>1&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(t,u,f){var h,o,s,e=b;return u=u||c,f=tt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),n.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(b===r&&l.initialize(),l.invoke(s)):(b!==r&&b.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.rating.settings={name:"Rating",namespace:"rating",slent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(n){for(var t=1,i="";t<=n;)i+='<i class="icon"><\/i>',t++;return i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.search=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1);return n(this).each(function(){var v,y=n.isPlainObject(u)?n.extend(!0,{},n.fn.search.settings,u):n.extend({},n.fn.search.settings),b=y.className,d=y.metadata,ct=y.regExp,g=y.fields,w=y.selector,rt=y.error,lt=y.namespace,nt="."+lt,ft=lt+"-module",p=n(this),tt=p.find(w.prompt),et=p.find(w.searchButton),k=p.find(w.results),ot=p.find(w.result),it=(p.find(w.category),this),ut=p.data(ft),st=!1,ht=!1;v={initialize:function(){v.verbose("Initializing module");v.get.settings();v.determine.searchFields();v.bind.events();v.set.type();v.create.results();v.instantiate()},instantiate:function(){v.verbose("Storing instance of module",v);ut=v;p.data(ft,v)},destroy:function(){v.verbose("Destroying instance");p.off(nt).removeData(ft)},refresh:function(){v.debug("Refreshing selector cache");tt=p.find(w.prompt);et=p.find(w.searchButton);p.find(w.category);k=p.find(w.results);ot=p.find(w.result)},refreshResults:function(){k=p.find(w.results);ot=p.find(w.result)},bind:{events:function(){v.verbose("Binding events to search");y.automatic&&(p.on(v.get.inputEvent()+nt,w.prompt,v.event.input),tt.attr("autocomplete","off"));p.on("focus"+nt,w.prompt,v.event.focus).on("blur"+nt,w.prompt,v.event.blur).on("keydown"+nt,w.prompt,v.handleKeyboard).on("click"+nt,w.searchButton,v.query).on("mousedown"+nt,w.results,v.event.result.mousedown).on("mouseup"+nt,w.results,v.event.result.mouseup).on("click"+nt,w.result,v.event.result.click)}},determine:{searchFields:function(){u&&u.searchFields!==r&&(y.searchFields=u.searchFields)}},event:{input:function(){y.searchDelay?(clearTimeout(v.timer),v.timer=setTimeout(function(){v.is.focused()&&v.query()},y.searchDelay)):v.query()},focus:function(){v.set.focus();y.searchOnFocus&&v.has.minimumCharacters()&&v.query(function(){v.can.show()&&v.showResults()})},blur:function(){var n=function(){v.cancel.query();v.remove.focus();v.timer=setTimeout(v.hideResults,y.hideDelay)};i.activeElement===this||(ht=!1,v.resultsClicked?(v.debug("Determining if user action caused search to close"),p.one("click.close"+nt,w.results,function(t){v.is.inMessage(t)||st?tt.focus():(st=!1,v.is.animating()||v.is.hidden()||n())})):(v.debug("Input blurred without user action, closing results"),n()))},result:{mousedown:function(){v.resultsClicked=!0},mouseup:function(){v.resultsClicked=!1},click:function(i){v.debug("Search result selected");var r=n(this),u=r.find(w.title).eq(0),f=r.is("a[href]")?r:r.find("a[href]").eq(0),e=f.attr("href")||!1,h=f.attr("target")||!1,o=(u.html(),u.length>0&&u.text()),s=v.get.results(),c=r.data(d.result)||v.get.result(o,s);if(n.isFunction(y.onSelect)&&!1===y.onSelect.call(it,c,s))return v.debug("Custom onSelect callback cancelled default select action"),void(st=!0);v.hideResults();o&&v.set.value(o);e&&(v.verbose("Opening search link found in result",f),"_blank"==h||i.ctrlKey?t.open(e):t.location.href=e)}}},handleKeyboard:function(n){var u,t=p.find(w.result),f=p.find(w.category),e=t.filter("."+b.active),i=t.index(e),s=t.length,h=e.length>0,r=n.which,o=13;if(r==27&&(v.verbose("Escape key pressed, blurring search field"),v.hideResults(),ht=!0),v.is.visible())if(r==o){if(v.verbose("Enter key pressed, selecting active result"),t.filter("."+b.active).length>0)return v.event.result.click.call(t.filter("."+b.active),n),n.preventDefault(),!1}else r==38&&h?(v.verbose("Up key pressed, changing active result"),u=i-1<0?i:i-1,f.removeClass(b.active),t.removeClass(b.active).eq(u).addClass(b.active).closest(f).addClass(b.active),n.preventDefault()):r==40&&(v.verbose("Down key pressed, changing active result"),u=i+1>=s?i:i+1,f.removeClass(b.active),t.removeClass(b.active).eq(u).addClass(b.active).closest(f).addClass(b.active),n.preventDefault());else r==o&&(v.verbose("Enter key pressed, executing query"),v.query(),v.set.buttonPressed(),tt.one("keyup",v.remove.buttonFocus))},setup:{api:function(t,i){var r={debug:y.debug,on:!1,cache:y.cache,action:"search",urlData:{query:t},onSuccess:function(n){v.parse.response.call(it,n,t);i()},onFailure:function(){v.displayMessage(rt.serverError);i()},onAbort:function(){},onError:v.error};n.extend(!0,r,y.apiSettings);v.verbose("Setting up API request",r);p.api(r)}},can:{useAPI:function(){return n.fn.api!==r},show:function(){return v.is.focused()&&!v.is.visible()&&!v.is.empty()},transition:function(){return y.transition&&n.fn.transition!==r&&p.transition("is supported")}},is:{animating:function(){return k.hasClass(b.animating)},hidden:function(){return k.hasClass(b.hidden)},inMessage:function(t){if(t.target){var r=n(t.target);return n.contains(i.documentElement,t.target)&&r.closest(w.message).length>0}},empty:function(){return""===k.html()},visible:function(){return k.filter(":visible").length>0},focused:function(){return tt.filter(":focus").length>0}},get:{settings:function(){n.isPlainObject(u)&&u.searchFullText&&(y.fullTextSearch=u.searchFullText,v.error(y.error.oldSearchSyntax,it))},inputEvent:function(){var n=tt[0];return n!==r&&n.oninput!==r?"input":n!==r&&n.onpropertychange!==r?"propertychange":"keyup"},value:function(){return tt.val()},results:function(){return p.data(d.results)},result:function(t,i){var f=["title","id"],u=!1;return t=t!==r?t:v.get.value(),i=i!==r?i:v.get.results(),"category"===y.type?(v.debug("Finding result that matches",t),n.each(i,function(i,r){if(n.isArray(r.results)&&(u=v.search.object(t,r.results,f)[0]))return!1})):(v.debug("Finding result in results object",t),u=v.search.object(t,i,f)[0]),u||!1}},select:{firstResult:function(){v.verbose("Selecting first result");ot.first().addClass(b.active)}},set:{focus:function(){p.addClass(b.focus)},loading:function(){p.addClass(b.loading)},value:function(n){v.verbose("Setting search input value",n);tt.val(n)},type:function(n){n=n||y.type;"category"==y.type&&p.addClass(y.type)},buttonPressed:function(){et.addClass(b.pressed)}},remove:{loading:function(){p.removeClass(b.loading)},focus:function(){p.removeClass(b.focus)},buttonPressed:function(){et.removeClass(b.pressed)}},query:function(t){t=n.isFunction(t)?t:function(){};var i=v.get.value(),r=v.read.cache(i);t=t||function(){};v.has.minimumCharacters()?(r?(v.debug("Reading result from cache",i),v.save.results(r.results),v.addResults(r.html),v.inject.id(r.results),t()):(v.debug("Querying for",i),n.isPlainObject(y.source)||n.isArray(y.source)?(v.search.local(i),t()):v.can.useAPI()?v.search.remote(i,t):(v.error(rt.source),t())),y.onSearchQuery.call(it,i)):v.hideResults()},search:{local:function(n){var i,t=v.search.object(n,y.content);v.set.loading();v.save.results(t);v.debug("Returned full local search results",t);y.maxResults>0&&(v.debug("Using specified max results",t),t=t.slice(0,y.maxResults));"category"==y.type&&(t=v.create.categoryResults(t));i=v.generateResults({results:t});v.remove.loading();v.addResults(i);v.inject.id(t);v.write.cache(n,{html:i,results:t})},remote:function(t,i){i=n.isFunction(i)?i:function(){};p.api("is loading")&&p.api("abort");v.setup.api(t,i);p.api("query")},object:function(t,i,u){var f=[],e=[],o=[],h=t.toString().replace(ct.escape,"\\$&"),c=new RegExp(ct.beginsWith+h,"i"),s=function(t,i){var r=-1==n.inArray(i,f),u=-1==n.inArray(i,o),s=-1==n.inArray(i,e);r&&u&&s&&t.push(i)};return i=i||y.source,u=u!==r?u:y.searchFields,n.isArray(u)||(u=[u]),i===r||!1===i?(v.error(rt.source),[]):(n.each(u,function(r,u){n.each(i,function(n,i){"string"==typeof i[u]&&(-1!==i[u].search(c)?s(f,i):"exact"===y.fullTextSearch&&v.exactSearch(t,i[u])?s(e,i):1==y.fullTextSearch&&v.fuzzySearch(t,i[u])&&s(o,i))})}),n.merge(e,o),n.merge(f,e),f)}},exactSearch:function(n,t){return n=n.toLowerCase(),(t=t.toLowerCase()).indexOf(n)>-1},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if("string"!=typeof n||(n=n.toLowerCase(),t=t.toLowerCase(),u>r))return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},parse:{response:function(n,t){var i=v.generateResults(n);v.verbose("Parsing server response",n);n!==r&&t!==r&&n[g.results]!==r&&(v.addResults(i),v.inject.id(n[g.results]),v.write.cache(t,{html:i,results:n[g.results]}),v.save.results(n[g.results]))}},cancel:{query:function(){v.can.useAPI()&&p.api("abort")}},has:{minimumCharacters:function(){return v.get.value().length>=y.minCharacters},results:function(){return 0!==k.length&&""!=k.html()}},clear:{cache:function(n){var t=p.data(d.cache);n?n&&t&&t[n]&&(v.debug("Removing value from cache",n),delete t[n],p.data(d.cache,t)):(v.debug("Clearing cache",n),p.removeData(d.cache))}},read:{cache:function(n){var t=p.data(d.cache);return!!y.cache&&(v.verbose("Checking cache for generated html for query",n),"object"==typeof t&&t[n]!==r&&t[n])}},create:{categoryResults:function(t){var i={};return n.each(t,function(n,t){t.category&&(i[t.category]===r?(v.verbose("Creating new category of results",t.category),i[t.category]={name:t.category,results:[t]}):i[t.category].results.push(t))}),i},id:function(n,t){var i,u=n+1;return t!==r?(i=String.fromCharCode(97+t)+u,v.verbose("Creating category result id",i)):(i=u,v.verbose("Creating result id",i)),i},results:function(){0===k.length&&(k=n("<div />").addClass(b.results).appendTo(p))}},inject:{result:function(n,t,i){v.verbose("Injecting result into results");var u=i!==r?k.children().eq(i).children(w.results).first().children(w.result).eq(t):k.children(w.result).eq(t);v.verbose("Injecting results metadata",u);u.data(d.result,n)},id:function(t){v.debug("Injecting unique ids into results");var u=0,i=0;return"category"===y.type?n.each(t,function(t,f){i=0;n.each(f.results,function(n){var t=f.results[n];t.id===r&&(t.id=v.create.id(i,u));v.inject.result(t,i,u);i++});u++}):n.each(t,function(n){var u=t[n];u.id===r&&(u.id=v.create.id(i));v.inject.result(u,i);i++}),t}},save:{results:function(n){v.verbose("Saving current search results to metadata",n);p.data(d.results,n)}},write:{cache:function(n,t){var i=p.data(d.cache)!==r?p.data(d.cache):{};y.cache&&(v.verbose("Writing generated html to cache",n,t),i[n]=t,p.data(d.cache,i))}},addResults:function(t){if(n.isFunction(y.onResultsAdd)&&!1===y.onResultsAdd.call(k,t))return v.debug("onResultsAdd callback cancelled default action"),!1;t?(k.html(t),v.refreshResults(),y.selectFirstResult&&v.select.firstResult(),v.showResults()):v.hideResults(function(){k.empty()})},showResults:function(t){t=n.isFunction(t)?t:function(){};ht||!v.is.visible()&&v.has.results()&&(v.can.transition()?(v.debug("Showing results with css animations"),k.transition({animation:y.transition+" in",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Showing results with javascript"),k.stop().fadeIn(y.duration,y.easing)),y.onResultsOpen.call(k))},hideResults:function(t){t=n.isFunction(t)?t:function(){};v.is.visible()&&(v.can.transition()?(v.debug("Hiding results with css animations"),k.transition({animation:y.transition+" out",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Hiding results with javascript"),k.stop().fadeOut(y.duration,y.easing)),y.onResultsClose.call(k))},generateResults:function(t){v.debug("Generating html from response",t);var r=y.templates[y.type],u=n.isPlainObject(t[g.results])&&!n.isEmptyObject(t[g.results]),f=n.isArray(t[g.results])&&t[g.results].length>0,i="";return u||f?(y.maxResults>0&&(u?"standard"==y.type&&v.error(rt.maxResults):t[g.results]=t[g.results].slice(0,y.maxResults)),n.isFunction(r)?i=r(t,g):v.error(rt.noTemplate,!1)):y.showNoResults&&(i=v.displayMessage(rt.noResults,"empty")),y.onResults.call(it,t),i},displayMessage:function(n,t){return t=t||"standard",v.debug("Displaying message",n,t),v.addResults(y.templates.message(n,t)),y.templates.message(n,t)},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:it,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;s=!1;clearTimeout(v.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");o.length>1&&(t+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||a,u=it||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(ut===r&&v.initialize(),v.invoke(c)):(ut!==r&&ut.invoke("destroy"),v.initialize())}),f!==r?f:this};n.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["title","description"],displayField:"",fullTextSearch:"exact",automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return t[n]}):n},message:function(n,t){var i="";return n!==r&&t!==r&&(i+='<div class="message '+t+'">',i+="empty"==t?'<div class="header">No Results<\/div class="header"><div class="description">'+n+'<\/div class="description">':' <div class="description">'+n+"<\/div>",i+="<\/div>"),i},category:function(t,i){var u="";return n.fn.search.settings.templates.escape,t[i.categoryResults]!==r&&(n.each(t[i.categoryResults],function(t,f){f[i.results]!==r&&f.results.length>0&&(u+='<div class="category">',f[i.categoryName]!==r&&(u+='<div class="name">'+f[i.categoryName]+"<\/div>"),u+='<div class="results">',n.each(f.results,function(n,t){u+=t[i.url]?'<a class="result" href="'+t[i.url]+'">':'<a class="result">';t[i.image]!==r&&(u+='<div class="image"> <img src="'+t[i.image]+'"><\/div>');u+='<div class="content">';t[i.price]!==r&&(u+='<div class="price">'+t[i.price]+"<\/div>");t[i.title]!==r&&(u+='<div class="title">'+t[i.title]+"<\/div>");t[i.description]!==r&&(u+='<div class="description">'+t[i.description]+"<\/div>");u+="<\/div>";u+="<\/a>"}),u+="<\/div>",u+="<\/div>")}),t[i.action]&&(u+='<a href="'+t[i.action][i.actionURL]+'" class="action">'+t[i.action][i.actionText]+"<\/a>"),u)},standard:function(t,i){var u="";return t[i.results]!==r&&(n.each(t[i.results],function(n,t){u+=t[i.url]?'<a class="result" href="'+t[i.url]+'">':'<a class="result">';t[i.image]!==r&&(u+='<div class="image"> <img src="'+t[i.image]+'"><\/div>');u+='<div class="content">';t[i.price]!==r&&(u+='<div class="price">'+t[i.price]+"<\/div>");t[i.title]!==r&&(u+='<div class="title">'+t[i.title]+"<\/div>");t[i.description]!==r&&(u+='<div class="description">'+t[i.description]+"<\/div>");u+="<\/div>";u+="<\/a>"}),t[i.action]&&(u+='<a href="'+t[i.action][i.actionURL]+'" class="action">'+t[i.action][i.actionText]+"<\/a>"),u)}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.shape=function(u){var f,o=n(this),s=(n("body"),(new Date).getTime()),e=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1),a=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return o.each(function(){var p,v,t,ut=o.selector||"",y=n.isPlainObject(u)?n.extend(!0,{},n.fn.shape.settings,u):n.extend({},n.fn.shape.settings),ft=y.namespace,k=y.selector,et=y.error,b=y.className,ot="."+ft,rt="module-"+ft,w=n(this),d=w.find(k.sides),g=w.find(k.side),it=!1,nt=this,tt=w.data(rt);t={initialize:function(){t.verbose("Initializing module for",nt);t.set.defaultSide();t.instantiate()},instantiate:function(){t.verbose("Storing instance of module",t);tt=t;w.data(rt,tt)},destroy:function(){t.verbose("Destroying previous module for",nt);w.removeData(rt).off(ot)},refresh:function(){t.verbose("Refreshing selector cache for",nt);w=n(nt);d=n(this).find(k.shape);g=n(this).find(k.side)},repaint:function(){t.verbose("Forcing repaint event");(d[0]||i.createElement("div")).offsetWidth},animate:function(n,i){t.verbose("Animating box with properties",n);i=i||function(n){t.verbose("Executing animation callback");n!==r&&n.stopPropagation();t.reset();t.set.active()};y.beforeChange.call(v[0]);t.get.transitionEvent()?(t.verbose("Starting CSS animation"),w.addClass(b.animating),d.css(n).one(t.get.transitionEvent(),i),t.set.duration(y.duration),a(function(){w.addClass(b.animating);p.addClass(b.hidden)})):i()},queue:function(n){t.debug("Queueing animation of",n);d.one(t.get.transitionEvent(),function(){t.debug("Executing queued animation");setTimeout(function(){w.shape(n)},0)})},reset:function(){t.verbose("Animating states reset");w.removeClass(b.animating).attr("style","").removeAttr("style");d.attr("style","").removeAttr("style");g.attr("style","").removeAttr("style").removeClass(b.hidden);v.removeClass(b.animating).attr("style","").removeAttr("style")},is:{complete:function(){return g.filter("."+b.active)[0]==v[0]},animating:function(){return w.hasClass(b.animating)}},set:{defaultSide:function(){p=w.find("."+y.className.active);v=p.next(k.side).length>0?p.next(k.side):w.find(k.side).first();it=!1;t.verbose("Active side set to",p);t.verbose("Next side set to",v)},duration:function(n){n="number"==typeof(n=n||y.duration)?n+"ms":n;t.verbose("Setting animation duration",n);(y.duration||0===y.duration)&&d.add(g).css({"-webkit-transition-duration":n,"-moz-transition-duration":n,"-ms-transition-duration":n,"-o-transition-duration":n,"transition-duration":n})},currentStageSize:function(){var n=w.find("."+y.className.active),t=n.outerWidth(!0),i=n.outerHeight(!0);w.css({width:t,height:i})},stageSize:function(){var n=w.clone().addClass(b.loading),i=n.find("."+y.className.active),r=it?n.find(k.side).eq(it):i.next(k.side).length>0?i.next(k.side):n.find(k.side).first(),u="next"==y.width?r.outerWidth(!0):"initial"==y.width?w.width():y.width,f="next"==y.height?r.outerHeight(!0):"initial"==y.height?w.height():y.height;i.removeClass(b.active);r.addClass(b.active);n.insertAfter(w);n.remove();"auto"!=y.width&&(w.css("width",u+y.jitter),t.verbose("Specifying width during animation",u));"auto"!=y.height&&(w.css("height",f+y.jitter),t.verbose("Specifying height during animation",f))},nextSide:function(n){it=n;v=g.filter(n);it=g.index(v);0===v.length&&(t.set.defaultSide(),t.error(et.side));t.verbose("Next side manually set to",v)},active:function(){t.verbose("Setting new side to active",v);g.removeClass(b.active);v.addClass(b.active);y.onChange.call(v[0]);t.set.defaultSide()}},flip:{up:function(){if(!t.is.complete()||t.is.animating()||y.allowRepeats)if(t.is.animating())t.queue("flip up");else{t.debug("Flipping up",v);var n=t.get.transform.up();t.set.stageSize();t.stage.above();t.animate(n)}else t.debug("Side already visible",v)},down:function(){if(!t.is.complete()||t.is.animating()||y.allowRepeats)if(t.is.animating())t.queue("flip down");else{t.debug("Flipping down",v);var n=t.get.transform.down();t.set.stageSize();t.stage.below();t.animate(n)}else t.debug("Side already visible",v)},left:function(){if(!t.is.complete()||t.is.animating()||y.allowRepeats)if(t.is.animating())t.queue("flip left");else{t.debug("Flipping left",v);var n=t.get.transform.left();t.set.stageSize();t.stage.left();t.animate(n)}else t.debug("Side already visible",v)},right:function(){if(!t.is.complete()||t.is.animating()||y.allowRepeats)if(t.is.animating())t.queue("flip right");else{t.debug("Flipping right",v);var n=t.get.transform.right();t.set.stageSize();t.stage.right();t.animate(n)}else t.debug("Side already visible",v)},over:function(){!t.is.complete()||t.is.animating()||y.allowRepeats?t.is.animating()?t.queue("flip over"):(t.debug("Flipping over",v),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.over())):t.debug("Side already visible",v)},back:function(){!t.is.complete()||t.is.animating()||y.allowRepeats?t.is.animating()?t.queue("flip back"):(t.debug("Flipping back",v),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.back())):t.debug("Side already visible",v)}},get:{transform:{up:function(){return{transform:"translateY("+-(p.outerHeight(!0)-v.outerHeight(!0))/2+"px) translateZ("+-p.outerHeight(!0)/2+"px) rotateX(-90deg)"}},down:function(){return{transform:"translateY("+-(p.outerHeight(!0)-v.outerHeight(!0))/2+"px) translateZ("+-p.outerHeight(!0)/2+"px) rotateX(90deg)"}},left:function(){return{transform:"translateX("+-(p.outerWidth(!0)-v.outerWidth(!0))/2+"px) translateZ("+-p.outerWidth(!0)/2+"px) rotateY(90deg)"}},right:function(){return{transform:"translateX("+-(p.outerWidth(!0)-v.outerWidth(!0))/2+"px) translateZ("+-p.outerWidth(!0)/2+"px) rotateY(-90deg)"}},over:function(){return{transform:"translateX("+-(p.outerWidth(!0)-v.outerWidth(!0))/2+"px) rotateY(180deg)"}},back:function(){return{transform:"translateX("+-(p.outerWidth(!0)-v.outerWidth(!0))/2+"px) rotateY(-180deg)"}}},transitionEvent:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]},nextSide:function(){return p.next(k.side).length>0?p.next(k.side):w.find(k.side).first()}},stage:{above:function(){var n={origin:(p.outerHeight(!0)-v.outerHeight(!0))/2,depth:{active:v.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as above",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(90deg) translateZ("+n.depth.next+"px)"})},below:function(){var n={origin:(p.outerHeight(!0)-v.outerHeight(!0))/2,depth:{active:v.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as below",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(-90deg) translateZ("+n.depth.next+"px)"})},left:function(){var i=p.outerWidth(!0),r=v.outerWidth(!0),n={origin:(i-r)/2,depth:{active:r/2,next:i/2}};t.verbose("Setting the initial animation position as left",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px)"})},right:function(){var i=p.outerWidth(!0),r=v.outerWidth(!0),n={origin:(i-r)/2,depth:{active:r/2,next:i/2}};t.verbose("Setting the initial animation position as left",v,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});v.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px)"})},behind:function(){var n=p.outerWidth(!0),i=v.outerWidth(!0),r={origin:(n-i)/2,depth:{active:i/2,next:n/2}};t.verbose("Setting the initial animation position as behind",v,r);p.css({transform:"rotateY(0deg)"});v.addClass(b.animating).css({left:r.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(i,u){if(t.debug("Changing setting",i,u),n.isPlainObject(i))n.extend(!0,y,i);else{if(u===r)return y[i];n.isPlainObject(y[i])?n.extend(!0,y[i],u):y[i]=u}},internal:function(i,u){if(n.isPlainObject(i))n.extend(!0,t,i);else{if(u===r)return t[i];t[i]=u}},debug:function(){!y.silent&&y.debug&&(y.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,y.name+":"),t.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),t.verbose.apply(console,arguments)))},error:function(){y.silent||(t.error=Function.prototype.bind.call(console.error,console,y.name+":"),t.error.apply(console,arguments))},performance:{log:function(n){var i,r;y.performance&&(r=(i=(new Date).getTime())-(s||i),s=i,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":r}));clearTimeout(t.performance.timer);t.performance.timer=setTimeout(t.performance.display,500)},display:function(){var i=y.name+":",u=0;s=!1;clearTimeout(t.performance.timer);n.each(e,function(n,t){u+=t["Execution Time"]});i+=" "+u+"ms";ut&&(i+=" '"+ut+"'");o.length>1&&(i+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(i),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=tt;return i=i||l,u=nt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};c?(tt===r&&t.initialize(),t.invoke(h)):(tt!==r&&tt.invoke("destroy"),t.initialize())}),f!==r?f:this};n.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.sidebar=function(u){var f,l=n(this),s=n(t),h=n(i),a=n("html"),p=n("head"),v=l.selector||"",c=(new Date).getTime(),e=[],y=arguments[0],w="string"==typeof y,b=[].slice.call(arguments,1),o=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return l.each(function(){var et,it,lt,yt,ft,l,k=n.isPlainObject(u)?n.extend(!0,{},n.fn.sidebar.settings,u):n.extend({},n.fn.sidebar.settings),rt=k.selector,g=k.className,pt=k.namespace,at=k.regExp,st=k.error,ht="."+pt,vt="module-"+pt,d=n(this),tt=n(k.context),ot=d.children(rt.sidebar),ut=(tt.children(rt.fixed),tt.children(rt.pusher)),nt=this,ct=d.data(vt);l={initialize:function(){l.debug("Initializing sidebar",u);l.create.id();ft=l.get.transitionEvent();k.delaySetup?o(l.setup.layout):l.setup.layout();o(function(){l.setup.cache()});l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);ct=l;d.data(vt,l)},create:{id:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);it="."+lt;l.verbose("Creating unique id for element",lt)}},destroy:function(){l.verbose("Destroying previous module for",d);d.off(ht).removeData(vt);l.is.ios()&&l.remove.ios();tt.off(it);s.off(it);h.off(it)},event:{clickaway:function(n){var t=ut.find(n.target).length>0||ut.is(n.target),i=tt.is(n.target);t&&(l.verbose("User clicked on dimmed page"),l.hide());i&&(l.verbose("User clicked on dimmable context (scaled out page)"),l.hide())},touch:function(){},containScroll:function(){nt.scrollTop<=0&&(nt.scrollTop=1);nt.scrollTop+nt.offsetHeight>=nt.scrollHeight&&(nt.scrollTop=nt.scrollHeight-nt.offsetHeight-1)},scroll:function(t){0===n(t.target).closest(rt.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){l.verbose("Adding clickaway events to context",tt);k.closable&&tt.on("click"+it,l.event.clickaway).on("touchend"+it,l.event.clickaway)},scrollLock:function(){k.scrollLock&&(l.debug("Disabling page scroll"),s.on("DOMMouseScroll"+it,l.event.scroll));l.verbose("Adding events to contain sidebar scroll");h.on("touchmove"+it,l.event.touch);d.on("scroll"+ht,l.event.containScroll)}},unbind:{clickaway:function(){l.verbose("Removing clickaway events from context",tt);tt.off(it)},scrollLock:function(){l.verbose("Removing scroll lock from page");h.off(it);s.off(it);d.off("scroll"+ht)}},add:{inlineCSS:function(){var r,u=l.cache.width||d.outerWidth(),f=l.cache.height||d.outerHeight(),e=l.is.rtl(),t=l.get.direction(),i={left:u,right:-u,top:f,bottom:-f};e&&(l.verbose("RTL detected, flipping widths"),i.left=-u,i.right=u);r="<style>";"left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }");l.is.ie()&&("left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }"),r+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {   -webkit-transform: translate3d(0px, 0, 0);           transform: translate3d(0px, 0, 0); }");et=n(r+="<\/style>").appendTo(p);l.debug("Adding sizing css to head",et)}},refresh:function(){l.verbose("Refreshing selector cache");tt=n(k.context);ot=tt.children(rt.sidebar);ut=tt.children(rt.pusher);tt.children(rt.fixed);l.clear.cache()},refreshSidebars:function(){l.verbose("Refreshing other sidebars");ot=tt.children(rt.sidebar)},repaint:function(){l.verbose("Forcing repaint event");nt.style.display="none";nt.offsetHeight;nt.scrollTop=nt.scrollTop;nt.style.display=""},setup:{cache:function(){l.cache={width:d.outerWidth(),height:d.outerHeight(),rtl:"rtl"==d.css("direction")}},layout:function(){0===tt.children(rt.pusher).length&&(l.debug("Adding wrapper element for sidebar"),l.error(st.pusher),ut=n('<div class="pusher" />'),tt.children().not(rt.omitted).not(ot).wrapAll(ut),l.refresh());0!==d.nextAll(rt.pusher).length&&d.nextAll(rt.pusher)[0]===ut[0]||(l.debug("Moved sidebar to correct parent element"),l.error(st.movedSidebar,nt),d.detach().prependTo(tt),l.refresh());l.clear.cache();l.set.pushable();l.set.direction()}},attachEvents:function(t,i){var r=n(t);i=n.isFunction(l[i])?l[i]:l.toggle;r.length>0?(l.debug("Attaching sidebar events to element",t,i),r.on("click"+ht,i)):l.error(st.notFound,t)},show:function(t){if(t=n.isFunction(t)?t:function(){},l.is.hidden()){if(l.refreshSidebars(),k.overlay&&(l.error(st.overlay),k.transition="overlay"),l.refresh(),l.othersActive())if(l.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void l.hideOthers(l.show);l.hideOthers()}else k.transition="overlay";l.pushPage(function(){t.call(nt);k.onShow.call(nt)});k.onChange.call(nt);k.onVisible.call(nt)}else l.debug("Sidebar is already visible")},hide:function(t){t=n.isFunction(t)?t:function(){};(l.is.visible()||l.is.animating())&&(l.debug("Hiding sidebar",t),l.refreshSidebars(),l.pullPage(function(){t.call(nt);k.onHidden.call(nt)}),k.onChange.call(nt),k.onHide.call(nt))},othersAnimating:function(){return ot.not(d).filter("."+g.animating).length>0},othersVisible:function(){return ot.not(d).filter("."+g.visible).length>0},othersActive:function(){return l.othersVisible()||l.othersAnimating()},hideOthers:function(n){var t=ot.not(d).filter("."+g.visible),i=t.length,r=0;n=n||function(){};t.sidebar("hide",function(){++r==i&&n()})},toggle:function(){l.verbose("Determining toggled direction");l.is.hidden()?l.show():l.hide()},pushPage:function(t){var u,f,r,e=l.get.transition(),i="overlay"===e||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};"scale down"==k.transition&&l.scrollToTop();l.set.transition(e);l.repaint();u=function(){l.bind.clickaway();l.add.inlineCSS();l.set.animating();l.set.visible()};f=function(){l.set.dimmed()};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.bind.scrollLock(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(u);k.dimPage&&!l.othersVisible()&&o(f)},pullPage:function(t){var f,r,u=l.get.transition(),i="overlay"==u||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};l.verbose("Removing context push state",l.get.direction());l.unbind.clickaway();l.unbind.scrollLock();f=function(){l.set.transition(u);l.set.animating();l.remove.visible();k.dimPage&&!l.othersVisible()&&ut.removeClass(g.dimmed)};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.remove.transition(),l.remove.inlineCSS(),("scale down"==u||k.returnScroll&&l.is.mobile())&&l.scrollBack(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(f)},scrollToTop:function(){l.verbose("Scrolling to top of page to avoid animation issues");yt=n(t).scrollTop();d.scrollTop(0);t.scrollTo(0,0)},scrollBack:function(){l.verbose("Scrolling back to original page position");t.scrollTo(0,yt)},clear:{cache:function(){l.verbose("Clearing cached dimensions");l.cache={}}},set:{ios:function(){a.addClass(g.ios)},pushed:function(){tt.addClass(g.pushed)},pushable:function(){tt.addClass(g.pushable)},dimmed:function(){ut.addClass(g.dimmed)},active:function(){d.addClass(g.active)},animating:function(){d.addClass(g.animating)},transition:function(n){n=n||l.get.transition();d.addClass(n)},direction:function(n){n=n||l.get.direction();d.addClass(g[n])},visible:function(){d.addClass(g.visible)},overlay:function(){d.addClass(g.overlay)}},remove:{inlineCSS:function(){l.debug("Removing inline css styles",et);et&&et.length>0&&et.remove()},ios:function(){a.removeClass(g.ios)},pushed:function(){tt.removeClass(g.pushed)},pushable:function(){tt.removeClass(g.pushable)},active:function(){d.removeClass(g.active)},animating:function(){d.removeClass(g.animating)},transition:function(n){n=n||l.get.transition();d.removeClass(n)},direction:function(n){n=n||l.get.direction();d.removeClass(g[n])},visible:function(){d.removeClass(g.visible)},overlay:function(){d.removeClass(g.overlay)}},get:{direction:function(){return d.hasClass(g.top)?g.top:d.hasClass(g.right)?g.right:d.hasClass(g.bottom)?g.bottom:g.left},transition:function(){var n,t=l.get.direction();return n=l.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,l.verbose("Determined transition",n),n},transitionEvent:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]}},is:{ie:function(){return!t.ActiveXObject&&"ActiveXObject"in t||"ActiveXObject"in t},ios:function(){var n=navigator.userAgent,t=n.match(at.ios),i=n.match(at.mobileChrome);return!(!t||i)&&(l.verbose("Browser was found to be iOS",n),!0)},mobile:function(){var n=navigator.userAgent;return n.match(at.mobile)?(l.verbose("Browser was found to be mobile",n),!0):(l.verbose("Browser is not mobile, using regular transition",n),!1)},hidden:function(){return!l.is.visible()},visible:function(){return d.hasClass(g.visible)},open:function(){return l.is.visible()},closed:function(){return l.is.hidden()},vertical:function(){return d.hasClass(g.top)},animating:function(){return tt.hasClass(g.animating)},rtl:function(){return l.cache.rtl===r&&(l.cache.rtl="rtl"==d.css("direction")),l.cache.rtl}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,k,t);else{if(i===r)return k[t];n.isPlainObject(k[t])?n.extend(!0,k[t],i):k[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!k.silent&&k.debug&&(k.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,k.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),l.verbose.apply(console,arguments)))},error:function(){k.silent||(l.error=Function.prototype.bind.call(console.error,console,k.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;k.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=k.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";v&&(t+=" '"+v+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ct;return i=i||b,u=nt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(l.error(st.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};w?(ct===r&&l.initialize(),l.invoke(y)):(ct!==r&&l.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.sticky=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var k,tt,it,g,s,v=n.isPlainObject(u)?n.extend(!0,{},n.fn.sticky.settings,u):n.extend({},n.fn.sticky.settings),p=v.className,et=v.namespace,rt=v.error,d="."+et,ut="module-"+et,y=n(this),ot=n(t),b=n(v.scrollContext),nt=(y.selector,y.data(ut)),ft=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},w=this;s={initialize:function(){s.determineContainer();s.determineContext();s.verbose("Initializing sticky",v,k);s.save.positions();s.checkErrors();s.bind.events();v.observeChanges&&s.observeChanges();s.instantiate()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;y.data(ut,s)},destroy:function(){s.verbose("Destroying previous instance");s.reset();it&&it.disconnect();g&&g.disconnect();ot.off("load"+d,s.event.load).off("resize"+d,s.event.resize);b.off("scrollchange"+d,s.event.scrollchange);y.removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(s.event.documentChanged),g=new MutationObserver(s.event.changed),it.observe(i,{childList:!0,subtree:!0}),g.observe(w,{childList:!0,subtree:!0}),g.observe(tt[0],{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",g))},determineContainer:function(){k=v.container?n(v.container):y.offsetParent()},determineContext:function(){0!==(tt=v.context?n(v.context):k).length||s.error(rt.invalidContext,v.context,y)},checkErrors:function(){if(s.is.hidden()&&s.error(rt.visible,y),s.cache.element.height>s.cache.context.height)return s.reset(),void s.error(rt.elementSize,y)},bind:{events:function(){ot.on("load"+d,s.event.load).on("resize"+d,s.event.resize);b.off("scroll"+d).on("scroll"+d,s.event.scroll).on("scrollchange"+d,s.event.scrollchange)}},event:{changed:function(n){clearTimeout(s.timer);s.timer=setTimeout(function(){s.verbose("DOM tree modified, updating sticky menu",n);s.refresh()},100)},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==w||n(t).find(w).length>0)&&(s.debug("Element removed from DOM, tearing down events"),s.destroy())})})},load:function(){s.verbose("Page contents finished loading");ft(s.refresh)},resize:function(){s.verbose("Window resized");ft(s.refresh)},scroll:function(){ft(function(){b.triggerHandler("scrollchange"+d,b.scrollTop())})},scrollchange:function(n,t){s.stick(t);v.onScroll.call(w)}},refresh:function(n){s.reset();v.context||s.determineContext();n&&s.determineContainer();s.save.positions();s.stick();v.onReposition.call(w)},supports:{sticky:function(){var t=n("<div/>");return t[0],t.addClass(p.supported),t.css("position").match("sticky")}},save:{lastScroll:function(n){s.lastScroll=n},elementScroll:function(n){s.elementScroll=n},positions:function(){var t={height:b.height()},n={margin:{top:parseInt(y.css("margin-top"),10),bottom:parseInt(y.css("margin-bottom"),10)},offset:y.offset(),width:y.outerWidth(),height:y.outerHeight()},i={offset:tt.offset(),height:tt.outerHeight()};k.outerHeight();s.is.standardScroll()||(s.debug("Non-standard scroll. Removing scroll offset from element offset"),t.top=b.scrollTop(),t.left=b.scrollLeft(),n.offset.top+=t.top,i.offset.top+=t.top,n.offset.left+=t.left,i.offset.left+=t.left);s.cache={fits:n.height+v.offset<=t.height,sameHeight:n.height==i.height,scrollContext:{height:t.height},element:{margin:n.margin,top:n.offset.top-n.margin.top,left:n.offset.left,width:n.width,height:n.height,bottom:n.offset.top+n.height},context:{top:i.offset.top,height:i.height,bottom:i.offset.top+i.height}};s.set.containerSize();s.stick();s.debug("Caching element positions",s.cache)}},get:{direction:function(n){var t="down";return n=n||b.scrollTop(),s.lastScroll!==r&&(s.lastScroll<n?t="down":s.lastScroll>n&&(t="up")),t},scrollChange:function(n){return n=n||b.scrollTop(),s.lastScroll?n-s.lastScroll:0},currentElementScroll:function(){return s.elementScroll?s.elementScroll:s.is.top()?Math.abs(parseInt(y.css("top"),10))||0:Math.abs(parseInt(y.css("bottom"),10))||0},elementScroll:function(n){n=n||b.scrollTop();var r=s.cache.element,u=s.cache.scrollContext,f=s.get.scrollChange(n),i=r.height-u.height+v.offset,e=s.get.currentElementScroll(),t=e+f;return s.cache.fits||t<0?0:t>i?i:t}},remove:{lastScroll:function(){delete s.lastScroll},elementScroll:function(){delete s.elementScroll},minimumSize:function(){k.css("min-height","")},offset:function(){y.css("margin-top","")}},set:{offset:function(){s.verbose("Setting offset on element",v.offset);y.css("margin-top",v.offset)},containerSize:function(){var n=k.get(0).tagName;"HTML"===n||"body"==n?s.determineContainer():Math.abs(k.outerHeight()-s.cache.context.height)>v.jitter&&(s.debug("Context has padding, specifying exact height for container",s.cache.context.height),k.css({height:s.cache.context.height}))},minimumSize:function(){var n=s.cache.element;k.css("min-height",n.height)},scroll:function(n){s.debug("Setting scroll on element",n);s.elementScroll!=n&&(s.is.top()&&y.css("bottom","").css("top",-n),s.is.bottom()&&y.css("top","").css("bottom",n))},size:function(){0!==s.cache.element.height&&0!==s.cache.element.width&&(w.style.setProperty("width",s.cache.element.width+"px","important"),w.style.setProperty("height",s.cache.element.height+"px","important"))}},is:{standardScroll:function(){return b[0]==t},top:function(){return y.hasClass(p.top)},bottom:function(){return y.hasClass(p.bottom)},initialPosition:function(){return!s.is.fixed()&&!s.is.bound()},hidden:function(){return!y.is(":visible")},bound:function(){return y.hasClass(p.bound)},fixed:function(){return y.hasClass(p.fixed)}},stick:function(n){var f=n||b.scrollTop(),u=s.cache,e=u.fits,c=u.sameHeight,t=u.element,l=u.scrollContext,i=u.context,o=s.is.bottom()&&v.pushing?v.bottomOffset:v.offset,r=(n={top:f+o,bottom:f+o+l.height},s.get.direction(n.top),e?0:s.get.elementScroll(n.top)),h=!e;0===t.height||c||(s.is.initialPosition()?n.top>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):n.top>t.top&&(t.height+n.top-r>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):(s.debug("Initial element position is fixed"),s.fixTop())):s.is.fixed()?s.is.top()?n.top<=t.top?(s.debug("Fixed element reached top of container"),s.setInitialPosition()):t.height+n.top-r>=i.bottom?(s.debug("Fixed element reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r)):s.is.bottom()&&(n.bottom-t.height<=t.top?(s.debug("Bottom fixed rail has reached top of container"),s.setInitialPosition()):n.bottom>=i.bottom?(s.debug("Bottom fixed rail has reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r))):s.is.bottom()&&(n.top<=t.top?(s.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),s.setInitialPosition()):v.pushing?s.is.bound()&&n.bottom<=i.bottom&&(s.debug("Fixing bottom attached element to bottom of browser."),s.fixBottom()):s.is.bound()&&n.top<=i.bottom-t.height&&(s.debug("Fixing bottom attached element to top of browser."),s.fixTop())))},bindTop:function(){s.debug("Binding element to top of parent container");s.remove.offset();y.css({left:"",top:"",marginBottom:""}).removeClass(p.fixed).removeClass(p.bottom).addClass(p.bound).addClass(p.top);v.onTop.call(w);v.onUnstick.call(w)},bindBottom:function(){s.debug("Binding element to bottom of parent container");s.remove.offset();y.css({left:"",top:""}).removeClass(p.fixed).removeClass(p.top).addClass(p.bound).addClass(p.bottom);v.onBottom.call(w);v.onUnstick.call(w)},setInitialPosition:function(){s.debug("Returning to initial position");s.unfix();s.unbind()},fixTop:function(){s.debug("Fixing element to top of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.bottom).addClass(p.fixed).addClass(p.top);v.onStick.call(w)},fixBottom:function(){s.debug("Sticking element to bottom of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.top).addClass(p.fixed).addClass(p.bottom);v.onStick.call(w)},unbind:function(){s.is.bound()&&(s.debug("Removing container bound position on element"),s.remove.offset(),y.removeClass(p.bound).removeClass(p.top).removeClass(p.bottom))},unfix:function(){s.is.fixed()&&(s.debug("Removing fixed position on element"),s.remove.minimumSize(),s.remove.offset(),y.removeClass(p.fixed).removeClass(p.top).removeClass(p.bottom),v.onUnstick.call(w))},reset:function(){s.debug("Resetting elements position");s.unbind();s.unfix();s.resetCSS();s.remove.offset();s.remove.lastScroll()},resetCSS:function(){y.css({width:"",height:""});k.css({height:""})},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else{if(i===r)return s[t];s[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,0)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=nt;return i=i||a,u=w||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.tab=function(u){var f,e=n.isFunction(this)?n(t):n(this),h=e.selector||"",s=(new Date).getTime(),o=[],c=arguments[0],a="string"==typeof c,v=[].slice.call(arguments,1),l=!1;return e.each(function(){var g,b,k,nt,y,tt,p=n.isPlainObject(u)?n.extend(!0,{},n.fn.tab.settings,u):n.extend({},n.fn.tab.settings),w=p.className,it=p.metadata,ft=p.selector,rt=p.error,ct="."+p.namespace,et="module-"+p.namespace,d=n(this),ot={},lt=!0,st=0,ht=this,ut=d.data(et);y={initialize:function(){y.debug("Initializing tab menu item",d);y.fix.callbacks();y.determineTabs();y.debug("Determining tabs",p.context,b);p.auto&&y.set.auto();y.bind.events();p.history&&!l&&(y.initializeHistory(),l=!0);y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y);ut=y;d.data(et,y)},destroy:function(){y.debug("Destroying tabs",d);d.removeData(et).off(ct)},bind:{events:function(){n.isWindow(ht)||(y.debug("Attaching tab activation events to element",d),d.on("click"+ct,y.event.click))}},determineTabs:function(){var t;"parent"===p.context?(d.closest(ft.ui).length>0?(t=d.closest(ft.ui),y.verbose("Using closest UI element as parent",t)):t=d,g=t.parent(),y.verbose("Determined parent element for creating context",g)):p.context?(g=n(p.context),y.verbose("Using selector for tab context",p.context,g)):g=n("body");p.childrenOnly?(b=g.children(ft.tabs),y.debug("Searching tab context children for tabs",g,b)):(b=g.find(ft.tabs),y.debug("Searching tab context for tabs",g,b))},fix:{callbacks:function(){n.isPlainObject(u)&&(u.onTabLoad||u.onTabInit)&&(u.onTabLoad&&(u.onLoad=u.onTabLoad,delete u.onTabLoad,y.error(rt.legacyLoad,u.onLoad)),u.onTabInit&&(u.onFirstLoad=u.onTabInit,delete u.onTabInit,y.error(rt.legacyInit,u.onFirstLoad)),p=n.extend(!0,{},n.fn.tab.settings,u))}},initializeHistory:function(){if(y.debug("Initializing page state"),n.address===r)return y.error(rt.state),!1;if("state"==p.historyType){if(y.debug("Using HTML5 to manage state"),!1===p.path)return y.error(rt.path),!1;n.address.history(!0).state(p.path)}n.address.bind("change",y.event.history.change)},event:{click:function(t){var i=n(this).data(it.tab);i!==r?(p.history?(y.verbose("Updating page state",t),n.address.value(i)):(y.verbose("Changing tab",t),y.changeTab(i)),t.preventDefault()):y.debug("No tab specified")},history:{change:function(t){var i=t.pathNames.join("/")||y.get.initialPath(),u=p.templates.determineTitle(i)||!1;y.performance.display();y.debug("History change event",i,t);tt=t;i!==r&&y.changeTab(i);u&&n.address.title(u)}}},refresh:function(){k&&(y.debug("Refreshing tab",k),y.changeTab(k))},cache:{read:function(n){return n!==r&&ot[n]},add:function(n,t){n=n||k;y.debug("Adding cached content for",n);ot[n]=t},remove:function(n){n=n||k;y.debug("Removing cached content for",n);delete ot[n]}},set:{auto:function(){var t="string"==typeof p.path?p.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";y.verbose("Setting up automatic tab retrieval from server",t);n.isPlainObject(p.apiSettings)?p.apiSettings.url=t:p.apiSettings={url:t}},loading:function(n){var t=y.get.tabElement(n);t.hasClass(w.loading)||(y.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(b).removeClass(w.active+" "+w.loading),t.length>0&&p.onRequest.call(t[0],n))},state:function(t){n.address.value(t)}},changeTab:function(i){var u=t.history&&t.history.pushState&&p.ignoreFirstLoad&&lt,f=p.auto||n.isPlainObject(p.apiSettings),r=f&&!u?y.utilities.pathToArray(i):y.get.defaultPathArray(i);i=y.utilities.arrayToPath(r);n.each(r,function(t,e){var h,c,a,l,v=r.slice(0,t+1),o=y.utilities.arrayToPath(v),b=y.is.tab(o),ut=t+1==r.length,s=y.get.tabElement(o);if(y.verbose("Looking for tab",e),b){if(y.verbose("Tab was found",e),k=o,nt=y.utilities.filterArray(r,v),ut?l=!0:(c=r.slice(0,t+2),a=y.utilities.arrayToPath(c),(l=!y.is.tab(a))&&y.verbose("Tab parameters found",c)),l&&f)return u?(y.debug("Ignoring remote content on first tab load",o),lt=!1,y.cache.add(i,s.html()),y.activate.all(o),p.onFirstLoad.call(s[0],o,nt,tt),p.onLoad.call(s[0],o,nt,tt)):(y.activate.navigation(o),y.fetch.content(o,i)),!1;y.debug("Opened local tab",o);y.activate.all(o);y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt));p.onLoad.call(s[0],o,nt,tt)}else{if(-1!=i.search("/")||""===i)return y.error(rt.missingTab,d,g,o),!1;if(o=(h=n("#"+i+', a[name="'+i+'"]')).closest("[data-tab]").data(it.tab),s=y.get.tabElement(o),h&&h.length>0&&o)return y.debug("Anchor link used, opening parent tab",s,h),s.hasClass(w.active)||setTimeout(function(){y.scrollTo(h)},0),y.activate.all(o),y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt)),p.onLoad.call(s[0],o,nt,tt),!1}})},scrollTo:function(t){var r=!!(t&&t.length>0)&&t.offset().top;!1!==r&&(y.debug("Forcing scroll to an in-page link in a hidden tab",r,t),n(i).scrollTop(r))},update:{content:function(t,i,u){var f=y.get.tabElement(t),e=f[0];u=u!==r?u:p.evaluateScripts;"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&"string"!=typeof i?f.empty().append(n(i).clone(!0)):u?(y.debug("Updating HTML and evaluating inline scripts",t,i),f.html(i)):(y.debug("Updating HTML",t,i),e.innerHTML=i)}},fetch:{content:function(t,i){var e,f,u=y.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:p.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(n){"response"==p.cacheType&&y.cache.add(i,n);y.update.content(t,n);t==k?(y.debug("Content loaded",t),y.activate.tab(t)):y.debug("Content loaded in background",t);p.onFirstLoad.call(u[0],t,nt,tt);p.onLoad.call(u[0],t,nt,tt);p.loadOnce?y.cache.add(i,!0):"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&u.children().length>0?setTimeout(function(){var n=u.children().clone(!0);n=n.not("script");y.cache.add(i,n)},0):y.cache.add(i,u.html())},urlData:{tab:i}},o=u.api("get request")||!1,h=o&&"pending"===o.state();i=i||t;f=y.cache.read(i);p.cache&&f?(y.activate.tab(t),y.debug("Adding cached content",i),p.loadOnce||("once"==p.evaluateScripts?y.update.content(t,f,!1):y.update.content(t,f)),p.onLoad.call(u[0],t,nt,tt)):h?(y.set.loading(t),y.debug("Content is already loading",i)):n.api!==r?(e=n.extend(!0,{},p.apiSettings,s),y.debug("Retrieving remote content",i,e),y.set.loading(t),u.api(e)):y.error(rt.api)}},activate:{all:function(n){y.activate.tab(n);y.activate.navigation(n)},tab:function(n){var t=y.get.tabElement(n),i="siblings"==p.deactivate?t.siblings(b):b.not(t),r=t.hasClass(w.active);y.verbose("Showing tab content for",t);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading),t.length>0&&p.onVisible.call(t[0],n))},navigation:function(n){var t=y.get.navElement(n),i="siblings"==p.deactivate?t.siblings(e):e.not(t),r=t.hasClass(w.active);y.verbose("Activating tab navigation for",t,n);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading))}},deactivate:{all:function(){y.deactivate.navigation();y.deactivate.tabs()},navigation:function(){e.removeClass(w.active)},tabs:function(){b.removeClass(w.active+" "+w.loading)}},is:{tab:function(n){return n!==r&&y.get.tabElement(n).length>0}},get:{initialPath:function(){return e.eq(0).data(it.tab)||b.eq(0).data(it.tab)},path:function(){return n.address.value()},defaultPathArray:function(n){return y.utilities.pathToArray(y.get.defaultPath(n))},defaultPath:function(n){var t=e.filter("[data-"+it.tab+'^="'+n+'/"]').eq(0).data(it.tab)||!1;if(t){if(y.debug("Found default tab",t),st<p.maxDepth)return st++,y.get.defaultPath(t);y.error(rt.recursion)}else y.debug("No default tabs found for",n,b);return st=0,n},navElement:function(n){return n=n||k,e.filter("[data-"+it.tab+'="'+n+'"]')},tabElement:function(n){var t,i,r,u;return n=n||k,r=y.utilities.pathToArray(n),u=y.utilities.last(r),t=b.filter("[data-"+it.tab+'="'+n+'"]'),i=b.filter("[data-"+it.tab+'="'+u+'"]'),t.length>0?t:i},tab:function(){return k}},utilities:{filterArray:function(t,i){return n.grep(t,function(t){return-1==n.inArray(t,i)})},last:function(t){return!!n.isArray(t)&&t[t.length-1]},pathToArray:function(n){return n===r&&(n=k),"string"==typeof n?n.split("/"):[n]},arrayToPath:function(t){return!!n.isArray(t)&&t.join("/")}},setting:function(t,i){if(y.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];n.isPlainObject(p[t])?n.extend(!0,p[t],i):p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ht,"Execution Time":i}));clearTimeout(y.performance.timer);y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(y.performance.timer);n.each(o,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&o.length>0&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());o=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||v,u=ht||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(y.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};a?(ut===r&&y.initialize(),y.invoke(c)):(ut!==r&&ut.invoke("destroy"),y.initialize())}),f!==r?f:this};n.tab=function(){n(t).tab.apply(this,arguments)};n.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(){},onLoad:function(){},onVisible:function(){},onRequest:function(){},templates:{determineTitle:function(){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.transition=function(){var u,e=n(this),h=e.selector||"",o=(new Date).getTime(),f=[],c=arguments,l=c[0],a=[].slice.call(arguments,1),s="string"==typeof l;return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame,e.each(function(t){var y,d,it,w,nt,k,tt,g,v,p=n(this),b=this;(v={initialize:function(){y=v.get.settings.apply(b,c);w=y.className;it=y.error;nt=y.metadata;g="."+y.namespace;tt="module-"+y.namespace;d=p.data(tt)||v;k=v.get.animationEndEvent();s&&(s=v.invoke(l));!1===s&&(v.verbose("Converted arguments into settings object",y),y.interval?v.delay(y.animate):v.animate(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);d=v;p.data(tt,d)},destroy:function(){v.verbose("Destroying previous module for",b);p.removeData(tt)},refresh:function(){v.verbose("Refreshing display type on next animation");delete v.displayType},forceRepaint:function(){v.verbose("Forcing element repaint");var t=p.parent(),n=p.next();0===n.length?p.detach().appendTo(t):p.detach().insertBefore(n)},repaint:function(){v.verbose("Repainting element");b.offsetWidth},delay:function(n){var i,u=v.get.animationDirection();u||(u=v.can.transition()?v.get.direction():"static");n=n!==r?n:y.interval;i="auto"==y.reverse&&u==w.outward||1==y.reverse?(e.length-t)*y.interval:t*y.interval;v.debug("Delaying animation by",i);setTimeout(v.animate,i)},animate:function(n){if(y=n||y,!v.is.supported())return v.error(it.support),!1;if(v.debug("Preparing animation",y.animation),v.is.animating()){if(y.queue)return!y.allowRepeats&&v.has.direction()&&v.is.occurring()&&!0!==v.queuing?v.debug("Animation is currently occurring, preventing queueing same animation",y.animation):v.queue(y.animation),!1;if(!y.allowRepeats&&v.is.occurring())return v.debug("Animation is already occurring, will not execute repeated animation",y.animation),!1;v.debug("New animation started, completing previous early",y.animation);d.complete()}v.can.animate()?v.set.animating(y.animation):v.error(it.noAnimation,y.animation,b)},reset:function(){v.debug("Resetting animation to beginning conditions");v.remove.animationCallbacks();v.restore.conditions();v.remove.animating()},queue:function(n){v.debug("Queueing animation of",n);v.queuing=!0;p.one(k+".queue"+g,function(){v.queuing=!1;v.repaint();v.animate.apply(this,y)})},complete:function(){v.debug("Animation complete",y.animation);v.remove.completeCallback();v.remove.failSafe();v.is.looping()||(v.is.outward()?(v.verbose("Animation is outward, hiding element"),v.restore.conditions(),v.hide()):v.is.inward()?(v.verbose("Animation is outward, showing element"),v.restore.conditions(),v.show()):(v.verbose("Static animation completed"),v.restore.conditions(),y.onComplete.call(b)))},force:{visible:function(){var t=p.attr("style"),i=v.get.userStyle(),n=v.get.displayType(),u=i+"display: "+n+" !important;",f=p.css("display"),e=t===r||""===t;f!==n?(v.verbose("Overriding default display to show element",n),p.attr("style",u)):e&&p.removeAttr("style")},hidden:function(){var n=p.attr("style"),t=p.css("display"),i=n===r||""===n;"none"===t||v.is.hidden()?i&&p.removeAttr("style"):(v.verbose("Overriding default display to hide element"),p.css("display","none"))}},has:{direction:function(t){var i=!1;return"string"==typeof(t=t||y.animation)&&(t=t.split(" "),n.each(t,function(n,t){t!==w.inward&&t!==w.outward||(i=!0)})),i},inlineDisplay:function(){var t=p.attr("style")||"";return n.isArray(t.match(/display.*?;/,""))}},set:{animating:function(n){var t;v.remove.completeCallback();n=n||y.animation;t=v.get.animationClass(n);v.save.animation(t);v.force.visible();v.remove.hidden();v.remove.direction();v.start.animation(t)},duration:function(n,t){((t="number"==typeof(t=t||y.duration)?t+"ms":t)||0===t)&&(v.verbose("Setting animation duration",t),p.css({"animation-duration":t}))},direction:function(n){(n=n||v.get.direction())==w.inward?v.set.inward():v.set.outward()},looping:function(){v.debug("Transition set to loop");p.addClass(w.looping)},hidden:function(){p.addClass(w.transition).addClass(w.hidden)},inward:function(){v.debug("Setting direction to inward");p.removeClass(w.outward).addClass(w.inward)},outward:function(){v.debug("Setting direction to outward");p.removeClass(w.inward).addClass(w.outward)},visible:function(){p.addClass(w.transition).addClass(w.visible)}},start:{animation:function(n){n=n||v.get.animationClass();v.debug("Starting tween",n);p.addClass(n).one(k+".complete"+g,v.complete);y.useFailSafe&&v.add.failSafe();v.set.duration(y.duration);y.onStart.call(b)}},save:{animation:function(n){v.cache||(v.cache={});v.cache.animation=n},displayType:function(n){"none"!==n&&p.data(nt.displayType,n)},transitionExists:function(t,i){n.fn.transition.exists[t]=i;v.verbose("Saving existence of transition",t,i)}},restore:{conditions:function(){var n=v.get.currentAnimation();n&&(p.removeClass(n),v.verbose("Removing animation class",v.cache));v.remove.duration()}},add:{failSafe:function(){var n=v.get.duration();v.timer=setTimeout(function(){p.triggerHandler(k)},n+y.failSafeDelay);v.verbose("Adding fail safe timer",v.timer)}},remove:{animating:function(){p.removeClass(w.animating)},animationCallbacks:function(){v.remove.queueCallback();v.remove.completeCallback()},queueCallback:function(){p.off(".queue"+g)},completeCallback:function(){p.off(".complete"+g)},display:function(){p.css("display","")},direction:function(){p.removeClass(w.inward).removeClass(w.outward)},duration:function(){p.css("animation-duration","")},failSafe:function(){v.verbose("Removing fail safe timer",v.timer);v.timer&&clearTimeout(v.timer)},hidden:function(){p.removeClass(w.hidden)},visible:function(){p.removeClass(w.visible)},looping:function(){v.debug("Transitions are no longer looping");v.is.looping()&&(v.reset(),p.removeClass(w.looping))},transition:function(){p.removeClass(w.visible).removeClass(w.hidden)}},get:{settings:function(t,i,r){return"object"==typeof t?n.extend(!0,{},n.fn.transition.settings,t):"function"==typeof r?n.extend({},n.fn.transition.settings,{animation:t,onComplete:r,duration:i}):"string"==typeof i||"number"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,duration:i}):"object"==typeof i?n.extend({},n.fn.transition.settings,i,{animation:t}):"function"==typeof i?n.extend({},n.fn.transition.settings,{animation:t,onComplete:i}):n.extend({},n.fn.transition.settings,{animation:t})},animationClass:function(n){var t=n||y.animation,i=v.can.transition()&&!v.has.direction()?v.get.direction()+" ":"";return w.animating+" "+w.transition+" "+i+t},currentAnimation:function(){return!(!v.cache||v.cache.animation===r)&&v.cache.animation},currentDirection:function(){return v.is.inward()?w.inward:w.outward},direction:function(){return v.is.hidden()||!v.is.visible()?w.inward:w.outward},animationDirection:function(t){var i;return"string"==typeof(t=t||y.animation)&&(t=t.split(" "),n.each(t,function(n,t){t===w.inward?i=w.inward:t===w.outward&&(i=w.outward)})),i||!1},duration:function(n){return!1===(n=n||y.duration)&&(n=p.css("animation-duration")||0),"string"==typeof n?n.indexOf("ms")>-1?parseFloat(n):1e3*parseFloat(n):n},displayType:function(n){return n=n===r||n,y.displayType?y.displayType:(n&&p.data(nt.displayType)===r&&v.can.transition(!0),p.data(nt.displayType))},userStyle:function(n){return(n=n||p.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(t){return n.fn.transition.exists[t]},animationStartEvent:function(){var n,u=i.createElement("div"),t={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(n in t)if(u.style[n]!==r)return t[n];return!1},animationEndEvent:function(){var n,u=i.createElement("div"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(n in t)if(u.style[n]!==r)return t[n];return!1}},can:{transition:function(t){var s,c,f,e,l,o,i=y.animation,h=v.get.transitionExists(i),u=v.get.displayType(!1);if(h===r||t){if(v.verbose("Determining whether animation exists"),s=p.attr("class"),c=p.prop("tagName"),e=(f=n("<"+c+" />").addClass(s).insertAfter(p)).addClass(i).removeClass(w.inward).removeClass(w.outward).addClass(w.animating).addClass(w.transition).css("animationName"),l=f.addClass(w.inward).css("animationName"),u||(u=f.attr("class",s).removeAttr("style").removeClass(w.hidden).removeClass(w.visible).show().css("display"),v.verbose("Determining final display state",u),v.save.displayType(u)),f.remove(),e!=l)v.debug("Direction exists for animation",i),o=!0;else{if("none"==e||!e)return void v.debug("No animation defined in css",i);v.debug("Static animation found",i,u);o=!1}v.save.transitionExists(i,o)}return h!==r?h:o},animate:function(){return v.can.transition()!==r}},is:{animating:function(){return p.hasClass(w.animating)},inward:function(){return p.hasClass(w.inward)},outward:function(){return p.hasClass(w.outward)},looping:function(){return p.hasClass(w.looping)},occurring:function(n){return n="."+(n=n||y.animation).replace(" ","."),p.filter(n).length>0},visible:function(){return p.is(":visible")},hidden:function(){return"hidden"===p.css("visibility")},supported:function(){return!1!==k}},hide:function(){v.verbose("Hiding element");v.is.animating()&&v.reset();b.blur();v.remove.display();v.remove.visible();v.set.hidden();v.force.hidden();y.onHide.call(b);y.onComplete.call(b)},show:function(n){v.verbose("Showing element",n);v.remove.hidden();v.set.visible();v.force.visible();y.onShow.call(b);y.onComplete.call(b)},toggle:function(){v.is.visible()?v.hide():v.show()},stop:function(){v.debug("Stopping current animation");p.triggerHandler(k)},stopAll:function(){v.debug("Stopping all animation");v.remove.queueCallback();p.triggerHandler(k)},clear:{queue:function(){v.debug("Clearing animation queue");v.remove.queueCallback()}},enable:function(){v.verbose("Starting animation");p.removeClass(w.disabled)},disable:function(){v.debug("Stopping animation");p.addClass(w.disabled)},setting:function(t,i){if(v.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];n.isPlainObject(y[t])?n.extend(!0,y[t],i):y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:b,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=d;return i=i||a,f=b||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o!==r&&o}}).initialize()}),u!==r?u:this};n.fn.transition.exists={};n.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.api=n.fn.api=function(i){var u,o=n.isFunction(this)?n(t):n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return o.each(function(){var k,nt,y,tt,rt,o,a=n.isPlainObject(i)?n.extend(!0,{},n.fn.api.settings,i):n.extend({},n.fn.api.settings),ft=a.namespace,et=a.metadata,ot=a.selector,w=a.error,it=a.className,st="."+ft,ut="module-"+ft,v=n(this),ht=v.closest(ot.form),p=a.stateContext?n(a.stateContext):v,d=this,b=p[0],g=v.data(ut);o={initialize:function(){c||o.bind.events();o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o);g=o;v.data(ut,g)},destroy:function(){o.verbose("Destroying previous module for",d);v.removeData(ut).off(st)},bind:{events:function(){var n=o.get.event();n?(o.verbose("Attaching API events to element",n),v.on(n+st,o.event.trigger)):"now"==a.on&&(o.debug("Querying API endpoint immediately"),o.query())}},decode:{json:function(n){if(n!==r&&"string"==typeof n)try{n=JSON.parse(n)}catch(n){}return n}},read:{cachedResponse:function(n){var i;if(t.Storage!==r)return i=sessionStorage.getItem(n),o.debug("Using cached response",n,i),i=o.decode.json(i);o.error(w.noStorage)}},write:{cachedResponse:function(i,u){u&&""===u?o.debug("Response empty, not caching",u):t.Storage!==r?(n.isPlainObject(u)&&(u=JSON.stringify(u)),sessionStorage.setItem(i,u),o.verbose("Storing cached response for url",i,u)):o.error(w.noStorage)}},query:function(){if(o.is.disabled())o.debug("Element is disabled API request aborted");else{if(o.is.loading()){if(!a.interruptRequests)return void o.debug("Cancelling request, previous request is still pending");o.debug("Interrupting previous request");o.abort()}if(a.defaultData&&n.extend(!0,a.urlData,o.get.defaultData()),a.serializeForm&&(a.data=o.add.formData(a.data)),!1===(nt=o.get.settings()))return o.cancelled=!0,void o.error(w.beforeSend);if(o.cancelled=!1,(y=o.get.templatedURL())||o.is.mocked()){if((y=o.add.urlData(y))||o.is.mocked()){if(nt.url=a.base+y,k=n.extend(!0,{},a,{type:a.method||a.type,data:tt,url:a.base+y,beforeSend:a.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),o.debug("Querying URL",k.url),o.verbose("Using AJAX settings",k),"local"===a.cache&&o.read.cachedResponse(y))return o.debug("Response returned from local cache"),o.request=o.create.request(),void o.request.resolveWith(b,[o.read.cachedResponse(y)]);a.throttle?a.throttleFirstRequest||o.timer?(o.debug("Throttling request",a.throttle),clearTimeout(o.timer),o.timer=setTimeout(function(){o.timer&&delete o.timer;o.debug("Sending throttled request",tt,k.method);o.send.request()},a.throttle)):(o.debug("Sending request",tt,k.method),o.send.request(),o.timer=setTimeout(function(){},a.throttle)):(o.debug("Sending request",tt,k.method),o.send.request())}}else o.error(w.missingURL)}},should:{removeError:function(){return!0===a.hideError||"auto"===a.hideError&&!o.is.form()}},is:{disabled:function(){return v.filter(ot.disabled).length>0},expectingJSON:function(){return"json"===a.dataType||"jsonp"===a.dataType},form:function(){return v.is("form")||p.is("form")},mocked:function(){return a.mockResponse||a.mockResponseAsync||a.response||a.responseAsync},input:function(){return v.is("input")},loading:function(){return!!o.request&&"pending"==o.request.state()},abortedRequest:function(n){return n&&n.readyState!==r&&0===n.readyState?(o.verbose("XHR request determined to be aborted"),!0):(o.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return o.is.expectingJSON()&&n.isFunction(a.successTest)?(o.debug("Checking JSON returned success",a.successTest,t),a.successTest(t)?(o.debug("Response passed success test",t),!0):(o.debug("Response failed success test",t),!1)):(o.verbose("Response is not JSON, skipping validation",a.successTest,t),!0)}},was:{cancelled:function(){return o.cancelled||!1},succesful:function(){return o.request&&"resolved"==o.request.state()},failure:function(){return o.request&&"rejected"==o.request.state()},complete:function(){return o.request&&("resolved"==o.request.state()||"rejected"==o.request.state())}},add:{urlData:function(t,i){var u,f;return t&&(u=t.match(a.regExp.required),f=t.match(a.regExp.optional),i=i||a.urlData,u&&(o.debug("Looking for required URL variables",u),n.each(u,function(u,f){var e=-1!==f.indexOf("$")?f.substr(2,f.length-3):f.substr(1,f.length-2),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];if(s===r)return o.error(w.requiredParameter,e,t),t=!1,!1;o.verbose("Found required variable",e,s);s=a.encodeParameters?o.get.urlEncodedValue(s):s;t=t.replace(f,s)})),f&&(o.debug("Looking for optional URL variables",u),n.each(f,function(u,f){var e=-1!==f.indexOf("$")?f.substr(3,f.length-4):f.substr(2,f.length-3),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];s!==r?(o.verbose("Optional variable Found",e,s),t=t.replace(f,s)):(o.verbose("Optional variable not found",e),t=-1!==t.indexOf("/"+f)?t.replace("/"+f,""):t.replace(f,""))}))),t},formData:function(t){var u=n.fn.serializeObject!==r,i=u?ht.serializeObject():ht.serialize();return t=t||a.data,n.isPlainObject(t)?u?(o.debug("Extending existing data with form data",t,i),t=n.extend(!0,{},t,i)):(o.error(w.missingSerialize),o.debug("Cant extend data. Replacing data with form data",t,i),t=i):(o.debug("Adding form data",i),t=i),t}},send:{request:function(){o.set.loading();o.request=o.create.request();o.is.mocked()?o.mockedXHR=o.create.mockedXHR():o.xhr=o.create.xhr();a.onRequest.call(b,o.request,o.xhr)}},event:{trigger:function(n){o.query();"submit"!=n.type&&"click"!=n.type||n.preventDefault()},xhr:{always:function(){},done:function(t,i,r){var f=this,s=(new Date).getTime()-rt,u=a.loadingDuration-s,e=!!n.isFunction(a.onResponse)&&(o.is.expectingJSON()?a.onResponse.call(f,n.extend(!0,{},t)):a.onResponse.call(f,t));u=u>0?u:0;e&&(o.debug("Modified API response in onResponse callback",a.onResponse,e,t),t=e);u>0&&o.debug("Response completed early delaying state change by",u);setTimeout(function(){o.is.validResponse(t)?o.request.resolveWith(f,[t,r]):o.request.rejectWith(f,[r,"invalid"])},u)},fail:function(n,t,i){var u=this,f=(new Date).getTime()-rt,r=a.loadingDuration-f;(r=r>0?r:0)>0&&o.debug("Response completed early delaying state change by",r);setTimeout(function(){o.is.abortedRequest(n)?o.request.rejectWith(u,[n,"aborted",i]):o.request.rejectWith(u,[n,"error",t,i])},r)}},request:{done:function(n,t){o.debug("Successful API Response",n);"local"===a.cache&&y&&(o.write.cachedResponse(y,n),o.debug("Saving server response locally",o.cache));a.onSuccess.call(b,n,v,t)},complete:function(n,t){var i,r;o.was.succesful()?(r=n,i=t):(i=n,r=o.get.responseFromXHR(i));o.remove.loading();a.onComplete.call(b,r,v,i)},fail:function(n,t,i){var u=o.get.responseFromXHR(n),f=o.get.errorFromRequest(u,t,i);if("aborted"==t)return o.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,i),a.onAbort.call(b,t,v,n),!0;"invalid"==t?o.debug("JSON did not pass success test. A server-side error has most likely occurred",u):"error"==t&&n!==r&&(o.debug("XHR produced a server error",t,i),200!=n.status&&i!==r&&""!==i&&o.error(w.statusMessage+i,k.url),a.onError.call(b,f,v,n));a.errorDuration&&"aborted"!==t&&(o.debug("Adding error state"),o.set.error(),o.should.removeError()&&setTimeout(o.remove.error,a.errorDuration));o.debug("API Request failed",f,n);a.onFailure.call(b,u,v,n)}}},create:{request:function(){return n.Deferred().always(o.event.request.complete).done(o.event.request.done).fail(o.event.request.fail)},mockedXHR:function(){var f,r,i,t=a.mockResponse||a.response,u=a.mockResponseAsync||a.responseAsync;return i=n.Deferred().always(o.event.xhr.complete).done(o.event.xhr.done).fail(o.event.xhr.fail),t?(n.isFunction(t)?(o.debug("Using specified synchronous callback",t),r=t.call(b,nt)):(o.debug("Using settings specified response",t),r=t),i.resolveWith(b,[r,!1,{responseText:r}])):n.isFunction(u)&&(f=function(n){o.debug("Async callback returned response",n);n?i.resolveWith(b,[n,!1,{responseText:n}]):i.rejectWith(b,[{responseText:n},!1,!1])},o.debug("Using specified async response callback",u),u.call(b,nt,f)),i},xhr:function(){var t;return t=n.ajax(k).always(o.event.xhr.always).done(o.event.xhr.done).fail(o.event.xhr.fail),o.verbose("Created server request",t,k),t}},set:{error:function(){o.verbose("Adding error state to element",p);p.addClass(it.error)},loading:function(){o.verbose("Adding loading state to element",p);p.addClass(it.loading);rt=(new Date).getTime()}},remove:{error:function(){o.verbose("Removing error state from element",p);p.removeClass(it.error)},loading:function(){o.verbose("Removing loading state from element",p);p.removeClass(it.loading)}},get:{responseFromXHR:function(t){return!!n.isPlainObject(t)&&(o.is.expectingJSON()?o.decode.json(t.responseText):t.responseText)},errorFromRequest:function(t,i,u){return n.isPlainObject(t)&&t.error!==r?t.error:a.error[i]!==r?a.error[i]:u},request:function(){return o.request||!1},xhr:function(){return o.xhr||!1},settings:function(){var t;return(t=a.beforeSend.call(b,a))&&(t.success!==r&&(o.debug("Legacy success callback detected",t),o.error(w.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==r&&(o.debug("Legacy failure callback detected",t),o.error(w.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==r&&(o.debug("Legacy complete callback detected",t),o.error(w.legacyParameters,t.complete),t.onComplete=t.complete)),t===r&&o.error(w.noReturnedValue),!1===t?t:t!==r?n.extend(!0,{},t):n.extend(!0,{},a)},urlEncodedValue:function(n){var r=t.decodeURIComponent(n),i=t.encodeURIComponent(n);return r!==n?(o.debug("URL value is already encoded, avoiding double encoding",n),n):(o.verbose("Encoding value using encodeURIComponent",n,i),i)},defaultData:function(){var t={};return n.isWindow(d)||(o.is.input()?t.value=v.val():o.is.form()||(t.text=v.text())),t},event:function(){return n.isWindow(d)||"now"==a.on?(o.debug("API called without element, no events attached"),!1):"auto"==a.on?v.is("input")?d.oninput!==r?"input":d.onpropertychange!==r?"propertychange":"keyup":v.is("form")?"submit":"click":a.on},templatedURL:function(n){if(n=n||v.data(et.action)||a.action||!1,y=v.data(et.url)||a.url||!1)return o.debug("Using specified url",y),y;if(n){if(o.debug("Looking up url for action",n,a.api),a.api[n]===r&&!o.is.mocked())return void o.error(w.missingAction,a.action,a.api);y=a.api[n]}else o.is.form()&&(y=v.attr("action")||p.attr("action")||!1,o.debug("No url or action specified, defaulting to form action",y));return y}},abort:function(){var n=o.get.xhr();n&&"resolved"!==n.state()&&(o.debug("Cancelling API request"),n.abort())},reset:function(){o.remove.error();o.remove.loading()},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(e||t),e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var c,s,h,e=g;return i=i||l,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?(s=e[u],!1):(o.error(w.method,t),!1);e=e[u]}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(g===r&&o.initialize(),o.invoke(h)):(g!==r&&g.invoke("destroy"),o.initialize())}),u!==r?u:this};n.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,beforeSend:function(n){return n},beforeXHR:function(){},onRequest:function(){},onResponse:!1,onSuccess:function(){},onComplete:function(){},onFailure:function(){},onError:function(){},onAbort:function(){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.visibility=function(u){var f,o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1),v=o.length,y=0;return o.each(function(){var nt,it,tt,o,p=n.isPlainObject(u)?n.extend(!0,{},n.fn.visibility.settings,u):n.extend({},n.fn.visibility.settings),rt=p.className,st=p.namespace,ht=p.error,ct=p.metadata,k="."+st,ut="module-"+st,ft=n(t),w=n(this),b=n(p.context),g=(w.selector,w.data(ut)),et=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},d=this,ot=!1;o={initialize:function(){o.debug("Initializing",p);o.setup.cache();o.should.trackChanges()&&("image"==p.type&&o.setup.image(),"fixed"==p.type&&o.setup.fixed(),p.observeChanges&&o.observeChanges(),o.bind.events());o.save.position();o.is.visible()||o.error(ht.visible,w);p.initialCheck&&o.checkVisibility();o.instantiate()},instantiate:function(){o.debug("Storing instance",o);w.data(ut,o);g=o},destroy:function(){o.verbose("Destroying previous module");tt&&tt.disconnect();it&&it.disconnect();ft.off("load"+k,o.event.load).off("resize"+k,o.event.resize);b.off("scroll"+k,o.event.scroll).off("scrollchange"+k,o.event.scrollchange);"fixed"==p.type&&(o.resetFixed(),o.remove.placeholder());w.off(k).removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(o.event.contextChanged),tt=new MutationObserver(o.event.changed),it.observe(i,{childList:!0,subtree:!0}),tt.observe(d,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",tt))},bind:{events:function(){o.verbose("Binding visibility events to scroll and resize");p.refreshOnLoad&&ft.on("load"+k,o.event.load);ft.on("resize"+k,o.event.resize);b.off("scroll"+k).on("scroll"+k,o.event.scroll).on("scrollchange"+k,o.event.scrollchange)}},event:{changed:function(){o.verbose("DOM tree modified, updating visibility calculations");o.timer=setTimeout(function(){o.verbose("DOM tree modified, updating sticky menu");o.refresh()},100)},contextChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==d||n(t).find(d).length>0)&&(o.debug("Element removed from DOM, tearing down events"),o.destroy())})})},resize:function(){o.debug("Window resized");p.refreshOnResize&&et(o.refresh)},load:function(){o.debug("Page finished loading");et(o.refresh)},scroll:function(){p.throttle?(clearTimeout(o.timer),o.timer=setTimeout(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])},p.throttle)):et(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])})},scrollchange:function(n,t){o.checkVisibility(t)}},precache:function(t,r){t instanceof Array||(t=[t]);for(var f=t.length,o=0,s=[],u=i.createElement("img"),e=function(){++o>=t.length&&n.isFunction(r)&&r()};f--;)(u=i.createElement("img")).onload=e,u.onerror=e,u.src=t[f],s.push(u)},enableCallbacks:function(){o.debug("Allowing callbacks to occur");ot=!1},disableCallbacks:function(){o.debug("Disabling all callbacks temporarily");ot=!0},should:{trackChanges:function(){return l?(o.debug("One time query, no need to bind events"),!1):(o.debug("Callbacks being attached"),!0)}},setup:{cache:function(){o.cache={occurred:{},screen:{},element:{}}},image:function(){var n=w.data(ct.src);n&&(o.verbose("Lazy loading image",n),p.once=!0,p.observeChanges=!1,p.onOnScreen=function(){o.debug("Image on screen",d);o.precache(n,function(){o.set.image(n,function(){++y==v&&p.onAllLoaded.call(this);p.onLoad.call(this)})})})},fixed:function(){o.debug("Setting up fixed");p.once=!1;p.observeChanges=!1;p.initialCheck=!0;p.refreshOnLoad=!0;u.transition||(p.transition=!1);o.create.placeholder();o.debug("Added placeholder",nt);p.onTopPassed=function(){o.debug("Element passed, adding fixed position",w);o.show.placeholder();o.set.fixed();p.transition&&n.fn.transition!==r&&w.transition(p.transition,p.duration)};p.onTopPassedReverse=function(){o.debug("Element returned to position, removing fixed",w);o.hide.placeholder();o.remove.fixed()}}},create:{placeholder:function(){o.verbose("Creating fixed position placeholder");nt=w.clone(!1).css("display","none").addClass(rt.placeholder).insertAfter(w)}},show:{placeholder:function(){o.verbose("Showing placeholder");nt.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){o.verbose("Hiding placeholder");nt.css("display","none").css("visibility","")}},set:{fixed:function(){o.verbose("Setting element to fixed position");w.addClass(rt.fixed).css({position:"fixed",top:p.offset+"px",left:"auto",zIndex:p.zIndex});p.onFixed.call(d)},image:function(t,i){if(w.attr("src",t),p.transition)if(n.fn.transition!==r){if(w.hasClass(rt.visible))return void o.debug("Transition already occurred on this image, skipping animation");w.transition(p.transition,p.duration,i)}else w.fadeIn(p.duration,i);else w.show()}},is:{onScreen:function(){return o.get.elementCalculations().onScreen},offScreen:function(){return o.get.elementCalculations().offScreen},visible:function(){return!(!o.cache||!o.cache.element)&&!(0===o.cache.element.width&&0===o.cache.element.offset.top)},verticallyScrollableContext:function(){var n=b.get(0)!==t&&b.css("overflow-y");return"auto"==n||"scroll"==n},horizontallyScrollableContext:function(){var n=b.get(0)!==t&&b.css("overflow-x");return"auto"==n||"scroll"==n}},refresh:function(){o.debug("Refreshing constants (width/height)");"fixed"==p.type&&o.resetFixed();o.reset();o.save.position();p.checkOnRefresh&&o.checkVisibility();p.onRefresh.call(d)},resetFixed:function(){o.remove.fixed();o.remove.occurred()},reset:function(){o.verbose("Resetting all cached values");n.isPlainObject(o.cache)&&(o.cache.screen={},o.cache.element={})},checkVisibility:function(n){o.verbose("Checking visibility of element",o.cache.element);!ot&&o.is.visible()&&(o.save.scroll(n),o.save.calculations(),o.passed(),o.passingReverse(),o.topVisibleReverse(),o.bottomVisibleReverse(),o.topPassedReverse(),o.bottomPassedReverse(),o.onScreen(),o.offScreen(),o.passing(),o.topVisible(),o.bottomVisible(),o.topPassed(),o.bottomPassed(),p.onUpdate&&p.onUpdate.call(d,o.get.elementCalculations()))},passed:function(t,i){var u=o.get.elementCalculations();if(t&&i)p.onPassed[t]=i;else{if(t!==r)return o.get.pixelsPassed(t)>u.pixelsPassed;u.passing&&n.each(p.onPassed,function(n,t){u.bottomVisible||u.pixelsPassed>o.get.pixelsPassed(n)?o.execute(t,n):p.once||o.remove.occurred(t)})}},onScreen:function(n){var t=o.get.elementCalculations(),u=n||p.onOnScreen,i="onScreen";if(n&&(o.debug("Adding callback for onScreen",n),p.onOnScreen=n),t.onScreen?o.execute(u,i):p.once||o.remove.occurred(i),n!==r)return t.onOnScreen},offScreen:function(n){var t=o.get.elementCalculations(),u=n||p.onOffScreen,i="offScreen";if(n&&(o.debug("Adding callback for offScreen",n),p.onOffScreen=n),t.offScreen?o.execute(u,i):p.once||o.remove.occurred(i),n!==r)return t.onOffScreen},passing:function(n){var t=o.get.elementCalculations(),u=n||p.onPassing,i="passing";if(n&&(o.debug("Adding callback for passing",n),p.onPassing=n),t.passing?o.execute(u,i):p.once||o.remove.occurred(i),n!==r)return t.passing},topVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisible,i="topVisible";if(n&&(o.debug("Adding callback for top visible",n),p.onTopVisible=n),t.topVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.topVisible},bottomVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisible,i="bottomVisible";if(n&&(o.debug("Adding callback for bottom visible",n),p.onBottomVisible=n),t.bottomVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.bottomVisible},topPassed:function(n){var t=o.get.elementCalculations(),u=n||p.onTopPassed,i="topPassed";if(n&&(o.debug("Adding callback for top passed",n),p.onTopPassed=n),t.topPassed?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.topPassed},bottomPassed:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassed,i="bottomPassed";if(n&&(o.debug("Adding callback for bottom passed",n),p.onBottomPassed=n),t.bottomPassed?o.execute(u,i):p.once||o.remove.occurred(i),n===r)return t.bottomPassed},passingReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onPassingReverse,i="passingReverse";if(n&&(o.debug("Adding callback for passing reverse",n),p.onPassingReverse=n),t.passing?p.once||o.remove.occurred(i):o.get.occurred("passing")&&o.execute(u,i),n!==r)return!t.passing},topVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisibleReverse,i="topVisibleReverse";if(n&&(o.debug("Adding callback for top visible reverse",n),p.onTopVisibleReverse=n),t.topVisible?p.once||o.remove.occurred(i):o.get.occurred("topVisible")&&o.execute(u,i),n===r)return!t.topVisible},bottomVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisibleReverse,i="bottomVisibleReverse";if(n&&(o.debug("Adding callback for bottom visible reverse",n),p.onBottomVisibleReverse=n),t.bottomVisible?p.once||o.remove.occurred(i):o.get.occurred("bottomVisible")&&o.execute(u,i),n===r)return!t.bottomVisible},topPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopPassedReverse,i="topPassedReverse";if(n&&(o.debug("Adding callback for top passed reverse",n),p.onTopPassedReverse=n),t.topPassed?p.once||o.remove.occurred(i):o.get.occurred("topPassed")&&o.execute(u,i),n===r)return!t.onTopPassed},bottomPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassedReverse,i="bottomPassedReverse";if(n&&(o.debug("Adding callback for bottom passed reverse",n),p.onBottomPassedReverse=n),t.bottomPassed?p.once||o.remove.occurred(i):o.get.occurred("bottomPassed")&&o.execute(u,i),n===r)return!t.bottomPassed},execute:function(n,t){var i=o.get.elementCalculations(),r=o.get.screenCalculations();(n=n||!1)&&(p.continuous?(o.debug("Callback being called continuously",t,i),n.call(d,i,r)):o.get.occurred(t)||(o.debug("Conditions met",t,i),n.call(d,i,r)));o.save.occurred(t)},remove:{fixed:function(){o.debug("Removing fixed position");w.removeClass(rt.fixed).css({position:"",top:"",left:"",zIndex:""});p.onUnfixed.call(d)},placeholder:function(){o.debug("Removing placeholder content");nt&&nt.remove()},occurred:function(n){if(n){var t=o.cache.occurred;t[n]!==r&&!0===t[n]&&(o.debug("Callback can now be called again",n),o.cache.occurred[n]=!1)}else o.cache.occurred={}}},save:{calculations:function(){o.verbose("Saving all calculations necessary to determine positioning");o.save.direction();o.save.screenCalculations();o.save.elementCalculations()},occurred:function(n){n&&(o.cache.occurred[n]!==r&&!0===o.cache.occurred[n]||(o.verbose("Saving callback occurred",n),o.cache.occurred[n]=!0))},scroll:function(n){n=n+p.offset||b.scrollTop()+p.offset;o.cache.scroll=n},direction:function(){var t,i=o.get.scroll(),n=o.get.lastScroll();return t=i>n&&n?"down":i<n&&n?"up":"static",o.cache.direction=t,o.cache.direction},elementPosition:function(){var n=o.cache.element,t=o.get.screenSize();return o.verbose("Saving element position"),n.fits=n.height<t.height,n.offset=w.offset(),n.width=w.outerWidth(),n.height=w.outerHeight(),o.is.verticallyScrollableContext()&&(n.offset.top+=b.scrollTop()-b.offset().top),o.is.horizontallyScrollableContext()&&(n.offset.left+=b.scrollLeft-b.offset().left),o.cache.element=n,n},elementCalculations:function(){var t=o.get.screenCalculations(),n=o.get.elementPosition();return p.includeMargin?(n.margin={},n.margin.top=parseInt(w.css("margin-top"),10),n.margin.bottom=parseInt(w.css("margin-bottom"),10),n.top=n.offset.top-n.margin.top,n.bottom=n.offset.top+n.height+n.margin.bottom):(n.top=n.offset.top,n.bottom=n.offset.top+n.height),n.topPassed=t.top>=n.top,n.bottomPassed=t.top>=n.bottom,n.topVisible=t.bottom>=n.top&&!n.topPassed,n.bottomVisible=t.bottom>=n.bottom&&!n.bottomPassed,n.pixelsPassed=0,n.percentagePassed=0,n.onScreen=(n.topVisible||n.passing)&&!n.bottomPassed,n.passing=n.topPassed&&!n.bottomPassed,n.offScreen=!n.onScreen,n.passing&&(n.pixelsPassed=t.top-n.top,n.percentagePassed=(t.top-n.top)/n.height),o.cache.element=n,o.verbose("Updated element calculations",n),n},screenCalculations:function(){var n=o.get.scroll();return o.save.direction(),o.cache.screen.top=n,o.cache.screen.bottom=n+o.cache.screen.height,o.cache.screen},screenSize:function(){o.verbose("Saving window position");o.cache.screen={height:b.height()}},position:function(){o.save.screenSize();o.save.elementPosition()}},get:{pixelsPassed:function(n){var t=o.get.elementCalculations();return n.search("%")>-1?t.height*(parseInt(n,10)/100):parseInt(n,10)},occurred:function(n){return o.cache.occurred!==r&&o.cache.occurred[n]||!1},direction:function(){return o.cache.direction===r&&o.save.direction(),o.cache.direction},elementPosition:function(){return o.cache.element===r&&o.save.elementPosition(),o.cache.element},elementCalculations:function(){return o.cache.element===r&&o.save.elementCalculations(),o.cache.element},screenCalculations:function(){return o.cache.screen===r&&o.save.screenCalculations(),o.cache.screen},screenSize:function(){return o.cache.screen===r&&o.save.screenSize(),o.cache.screen},scroll:function(){return o.cache.scroll===r&&o.save.scroll(),o.cache.scroll},lastScroll:function(){return o.cache.screen===r?(o.debug("First scroll event, no last scroll could be found"),!1):o.cache.screen.top}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else{if(i===r)return o[t];o[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){p.silent||(o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(o.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var c,s,h,e=g;return i=i||a,u=d||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?(s=e[u],!1):(o.error(ht.method,t),!1);e=e[u]}})),n.isFunction(s)?h=s.apply(u,i):s!==r&&(h=s),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),s}};l?(g===r&&o.initialize(),g.save.scroll(),g.save.calculations(),o.invoke(c)):(g!==r&&g.invoke("destroy"),o.initialize())}),f!==r?f:this};n.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.checkbox=function(u){var f,s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l="string"==typeof c,a=[].slice.call(arguments,1);return s.each(function(){var ft,s,v=n.extend(!0,{},n.fn.checkbox.settings,u),b=v.className,et=v.namespace,k=v.selector,ot=v.error,d="."+et,rt="module-"+et,p=n(this),g=n(this).children(k.label),y=n(this).children(k.input),w=y[0],tt=!1,it=!1,nt=p.data(rt),ut=this;s={initialize:function(){s.verbose("Initializing checkbox",v);s.create.label();s.bind.events();s.set.tabbable();s.hide.input();s.observeChanges();s.instantiate();s.setup()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;p.data(rt,s)},destroy:function(){s.verbose("Destroying module");s.unbind.events();s.show.input();p.removeData(rt)},fix:{reference:function(){p.is(k.input)&&(s.debug("Behavior called on <input> adjusting invoked element"),p=p.closest(k.checkbox),s.refresh())}},setup:function(){s.set.initialLoad();s.is.indeterminate()?(s.debug("Initial value is indeterminate"),s.indeterminate()):s.is.checked()?(s.debug("Initial value is checked"),s.check()):(s.debug("Initial value is unchecked"),s.uncheck());s.remove.initialLoad()},refresh:function(){g=p.children(k.label);y=p.children(k.input);w=y[0]},hide:{input:function(){s.verbose("Modifying <input> z-index to be unselectable");y.addClass(b.hidden)}},show:{input:function(){s.verbose("Modifying <input> z-index to be selectable");y.removeClass(b.hidden)}},observeChanges:function(){"MutationObserver"in t&&((ft=new MutationObserver(function(){s.debug("DOM tree modified, updating selector cache");s.refresh()})).observe(ut,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",ft))},attachEvents:function(t,i){var r=n(t);i=n.isFunction(s[i])?s[i]:s.toggle;r.length>0?(s.debug("Attaching checkbox events to element",t,i),r.on("click"+d,i)):s.error(ot.notFound)},event:{click:function(t){var i=n(t.target);i.is(k.input)?s.verbose("Using default check action on initialized checkbox"):i.is(k.link)?s.debug("Clicking link inside checkbox, skipping toggle"):(s.toggle(),y.focus(),t.preventDefault())},keydown:function(n){var t=n.which;t==27?(s.verbose("Escape key pressed blurring field"),y.blur(),it=!0):n.ctrlKey||t!=32&&t!=13?it=!1:(s.verbose("Enter/space key pressed, toggling checkbox"),s.toggle(),it=!0)},keyup:function(n){it&&n.preventDefault()}},check:function(){s.should.allowCheck()&&(s.debug("Checking checkbox",y),s.set.checked(),s.should.ignoreCallbacks()||(v.onChecked.call(w),v.onChange.call(w)))},uncheck:function(){s.should.allowUncheck()&&(s.debug("Unchecking checkbox"),s.set.unchecked(),s.should.ignoreCallbacks()||(v.onUnchecked.call(w),v.onChange.call(w)))},indeterminate:function(){s.should.allowIndeterminate()?s.debug("Checkbox is already indeterminate"):(s.debug("Making checkbox indeterminate"),s.set.indeterminate(),s.should.ignoreCallbacks()||(v.onIndeterminate.call(w),v.onChange.call(w)))},determinate:function(){s.should.allowDeterminate()?s.debug("Checkbox is already determinate"):(s.debug("Making checkbox determinate"),s.set.determinate(),s.should.ignoreCallbacks()||(v.onDeterminate.call(w),v.onChange.call(w)))},enable:function(){s.is.enabled()?s.debug("Checkbox is already enabled"):(s.debug("Enabling checkbox"),s.set.enabled(),v.onEnable.call(w),v.onEnabled.call(w))},disable:function(){s.is.disabled()?s.debug("Checkbox is already disabled"):(s.debug("Disabling checkbox"),s.set.disabled(),v.onDisable.call(w),v.onDisabled.call(w))},get:{radios:function(){var t=s.get.name();return n('input[name="'+t+'"]').closest(k.checkbox)},otherRadios:function(){return s.get.radios().not(p)},name:function(){return y.attr("name")}},is:{initialLoad:function(){return tt},radio:function(){return y.hasClass(b.radio)||"radio"==y.attr("type")},indeterminate:function(){return y.prop("indeterminate")!==r&&y.prop("indeterminate")},checked:function(){return y.prop("checked")!==r&&y.prop("checked")},disabled:function(){return y.prop("disabled")!==r&&y.prop("disabled")},enabled:function(){return!s.is.disabled()},determinate:function(){return!s.is.indeterminate()},unchecked:function(){return!s.is.checked()}},should:{allowCheck:function(){return s.is.determinate()&&s.is.checked()&&!s.should.forceCallbacks()?(s.debug("Should not allow check, checkbox is already checked"),!1):!1!==v.beforeChecked.apply(w)||(s.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return s.is.determinate()&&s.is.unchecked()&&!s.should.forceCallbacks()?(s.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!1!==v.beforeUnchecked.apply(w)||(s.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return s.is.indeterminate()&&!s.should.forceCallbacks()?(s.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!1!==v.beforeIndeterminate.apply(w)||(s.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return s.is.determinate()&&!s.should.forceCallbacks()?(s.debug("Should not allow determinate, checkbox is already determinate"),!1):!1!==v.beforeDeterminate.apply(w)||(s.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return s.is.initialLoad()&&v.fireOnInit},ignoreCallbacks:function(){return tt&&!v.fireOnInit}},can:{change:function(){return!(p.hasClass(b.disabled)||p.hasClass(b.readOnly)||y.prop("disabled")||y.prop("readonly"))},uncheck:function(){return"boolean"==typeof v.uncheckable?v.uncheckable:!s.is.radio()}},set:{initialLoad:function(){tt=!0},checked:function(){s.verbose("Setting class to checked");p.removeClass(b.indeterminate).addClass(b.checked);s.is.radio()&&s.uncheckOthers();s.is.indeterminate()||!s.is.checked()?(s.verbose("Setting state to checked",w),y.prop("indeterminate",!1).prop("checked",!0),s.trigger.change()):s.debug("Input is already checked, skipping input property change")},unchecked:function(){s.verbose("Removing checked class");p.removeClass(b.indeterminate).removeClass(b.checked);s.is.indeterminate()||!s.is.unchecked()?(s.debug("Setting state to unchecked"),y.prop("indeterminate",!1).prop("checked",!1),s.trigger.change()):s.debug("Input is already unchecked")},indeterminate:function(){s.verbose("Setting class to indeterminate");p.addClass(b.indeterminate);s.is.indeterminate()?s.debug("Input is already indeterminate, skipping input property change"):(s.debug("Setting state to indeterminate"),y.prop("indeterminate",!0),s.trigger.change())},determinate:function(){s.verbose("Removing indeterminate class");p.removeClass(b.indeterminate);s.is.determinate()?s.debug("Input is already determinate, skipping input property change"):(s.debug("Setting state to determinate"),y.prop("indeterminate",!1))},disabled:function(){s.verbose("Setting class to disabled");p.addClass(b.disabled);s.is.disabled()?s.debug("Input is already disabled, skipping input property change"):(s.debug("Setting state to disabled"),y.prop("disabled","disabled"),s.trigger.change())},enabled:function(){s.verbose("Removing disabled class");p.removeClass(b.disabled);s.is.enabled()?s.debug("Input is already enabled, skipping input property change"):(s.debug("Setting state to enabled"),y.prop("disabled",!1),s.trigger.change())},tabbable:function(){s.verbose("Adding tabindex to checkbox");y.attr("tabindex")===r&&y.attr("tabindex",0)}},remove:{initialLoad:function(){tt=!1}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=y[0];t&&(s.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},create:{label:function(){y.prevAll(k.label).length>0?(y.prev(k.label).detach().insertAfter(y),s.debug("Moving existing label",g)):s.has.label()||(g=n("<label>").insertAfter(y),s.debug("Creating label",g))}},has:{label:function(){return g.length>0}},bind:{events:function(){s.verbose("Attaching checkbox events");p.on("click"+d,s.event.click).on("keydown"+d,k.input,s.event.keydown).on("keyup"+d,k.input,s.event.keyup)}},unbind:{events:function(){s.debug("Removing events");p.off(d)}},uncheckOthers:function(){var n=s.get.otherRadios();s.debug("Unchecking other radios",n);n.removeClass(b.checked)},toggle:function(){s.can.change()?s.is.indeterminate()||s.is.unchecked()?(s.debug("Currently unchecked"),s.check()):s.is.checked()&&s.can.uncheck()&&(s.debug("Currently checked"),s.uncheck()):s.is.radio()||s.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(t,i){if(s.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else{if(i===r)return s[t];s[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ut,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var c,o,h,e=nt;return i=i||a,u=ut||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==c)return e[u]!==r?(o=e[u],!1):(s.error(ot.method,t),!1);e=e[u]}})),n.isFunction(o)?h=o.apply(u,i):o!==r&&(h=o),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dimmer=function(t){var u,e=n(this),o=(new Date).getTime(),f=[],s=arguments[0],h="string"==typeof s,c=[].slice.call(arguments,1);return e.each(function(){var v,y,l,a=n.isPlainObject(t)?n.extend(!0,{},n.fn.dimmer.settings,t):n.extend({},n.fn.dimmer.settings),b=a.selector,tt=a.namespace,p=a.className,ut=a.error,k="."+tt,nt="module-"+tt,it=e.selector||"",rt="ontouchstart"in i.documentElement?"touchstart":"click",w=n(this),d=this,g=w.data(nt);(l={preinitialize:function(){l.is.dimmer()?(y=w.parent(),v=w):(y=w,v=l.has.dimmer()?a.dimmerName?y.find(b.dimmer).filter("."+a.dimmerName):y.find(b.dimmer):l.create(),l.set.variation())},initialize:function(){l.debug("Initializing dimmer",a);l.bind.events();l.set.dimmable();l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);g=l;w.data(nt,g)},destroy:function(){l.verbose("Destroying previous module",v);l.unbind.events();l.remove.variation();y.off(k)},bind:{events:function(){l.is.page()&&y.get(0).addEventListener("touchmove",l.event.preventScroll,{passive:!1});"hover"==a.on?y.on("mouseenter"+k,l.show).on("mouseleave"+k,l.hide):"click"==a.on&&y.on(rt+k,l.toggle);l.is.page()&&(l.debug("Setting as a page dimmer",y),l.set.pageDimmer());l.is.closable()&&(l.verbose("Adding dimmer close event",v),y.on(rt+k,b.dimmer,l.event.click))}},unbind:{events:function(){l.is.page()&&y.get(0).removeEventListener("touchmove",l.event.preventScroll,{passive:!1});w.removeData(nt);y.off(k)}},event:{click:function(t){l.verbose("Determining if event occured on dimmer",t);(0===v.find(t.target).length||n(t.target).is(b.content))&&(l.hide(),t.stopImmediatePropagation())},preventScroll:function(n){n.preventDefault()}},addContent:function(t){var i=n(t);l.debug("Add content to dimmer",i);i.parent()[0]!==v[0]&&i.detach().appendTo(v)},create:function(){var t=n(a.template.dimmer());return a.dimmerName&&(l.debug("Creating named dimmer",a.dimmerName),t.addClass(a.dimmerName)),t.appendTo(y),t},show:function(t){t=n.isFunction(t)?t:function(){};l.debug("Showing dimmer",v,a);l.is.dimmed()&&!l.is.animating()||!l.is.enabled()?l.debug("Dimmer is already shown or disabled"):(l.animate.show(t),a.onShow.call(d),a.onChange.call(d))},hide:function(t){t=n.isFunction(t)?t:function(){};l.is.dimmed()||l.is.animating()?(l.debug("Hiding dimmer",v),l.animate.hide(t),a.onHide.call(d),a.onChange.call(d)):l.debug("Dimmer is not visible")},toggle:function(){l.verbose("Toggling dimmer visibility",v);l.is.dimmed()?l.hide():l.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?("auto"!==a.opacity&&l.set.opacity(),v.transition({displayType:"flex",animation:a.transition+" in",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.set.dimmed()},onComplete:function(){l.set.active();t()}})):(l.verbose("Showing dimmer animation with javascript"),l.set.dimmed(),"auto"==a.opacity&&(a.opacity=.8),v.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(l.get.duration(),a.opacity,function(){v.removeAttr("style");l.set.active();t()}))},hide:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(l.verbose("Hiding dimmer with css"),v.transition({displayType:"flex",animation:a.transition+" out",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.remove.dimmed()},onComplete:function(){l.remove.active();t()}})):(l.verbose("Hiding dimmer with javascript"),l.remove.dimmed(),v.stop().fadeOut(l.get.duration(),function(){l.remove.active();v.removeAttr("style");t()}))}},get:{dimmer:function(){return v},duration:function(){return"object"==typeof a.duration?l.is.active()?a.duration.hide:a.duration.show:a.duration}},has:{dimmer:function(){return a.dimmerName?w.find(b.dimmer).filter("."+a.dimmerName).length>0:w.find(b.dimmer).length>0}},is:{active:function(){return v.hasClass(p.active)},animating:function(){return v.is(":animated")||v.hasClass(p.animating)},closable:function(){return"auto"==a.closable?"hover"!=a.on:a.closable},dimmer:function(){return w.hasClass(p.dimmer)},dimmable:function(){return w.hasClass(p.dimmable)},dimmed:function(){return y.hasClass(p.dimmed)},disabled:function(){return y.hasClass(p.disabled)},enabled:function(){return!l.is.disabled()},page:function(){return y.is("body")},pageDimmer:function(){return v.hasClass(p.pageDimmer)}},can:{show:function(){return!v.hasClass(p.disabled)}},set:{opacity:function(n){var i=v.css("background-color"),t=i.split(","),r=t&&3==t.length,u=t&&4==t.length;n=0===a.opacity?0:a.opacity||n;r||u?(t[3]=n+")",i=t.join(",")):i="rgba(0, 0, 0, "+n+")";l.debug("Setting opacity to",n);v.css("background-color",i)},active:function(){v.addClass(p.active)},dimmable:function(){y.addClass(p.dimmable)},dimmed:function(){y.addClass(p.dimmed)},pageDimmer:function(){v.addClass(p.pageDimmer)},disabled:function(){v.addClass(p.disabled)},variation:function(n){(n=n||a.variation)&&v.addClass(n)}},remove:{active:function(){v.removeClass(p.active)},dimmed:function(){y.removeClass(p.dimmed)},disabled:function(){v.removeClass(p.disabled)},variation:function(n){(n=n||a.variation)&&v.removeClass(n)}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;a.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";it&&(t+=" '"+it+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=g;return i=i||c,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(l.error(ut.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}}).preinitialize();h?(g===r&&l.initialize(),l.invoke(s)):(g!==r&&g.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return n("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.dropdown=function(u){var f,e=n(this),o=n(i),l=e.selector||"",h="ontouchstart"in i.documentElement,c=(new Date).getTime(),s=[],a=arguments[0],v="string"==typeof a,y=[].slice.call(arguments,1);return e.each(function(p){var ri,wt,dt,ct,gt,lt,bt,w,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.dropdown.settings,u):n.extend({},n.fn.dropdown.settings),k=b.className,at=b.message,ui=b.fields,ft=b.keys,rt=b.metadata,si=b.namespace,ni=b.regExp,d=b.selector,vt=b.error,fi=b.templates,tt="."+si,kt="module-"+si,g=n(this),ht=n(b.context),st=g.find(d.text),et=g.find(d.search),ti=g.find(d.sizer),ut=g.find(d.input),hi=g.find(d.icon),ii=g.prev().find(d.text).length>0?g.prev().find(d.text):g.prev(),nt=g.children(d.menu),it=nt.find(d.item),yt=!1,ei=!1,oi=!1,ot=this,pt=g.data(kt);w={initialize:function(){w.debug("Initializing dropdown",b);w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),b.values&&w.change.values(b.values),w.refreshData(),w.save.defaults(),w.restore.selected(),w.create.id(),w.bind.events(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w);pt=w;g.data(kt,w)},destroy:function(){w.verbose("Destroying previous dropdown",g);w.remove.tabbable();g.off(tt).removeData(kt);nt.off(tt);o.off(ct);w.disconnect.menuObserver();w.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(lt=new MutationObserver(w.event.select.mutation),bt=new MutationObserver(w.event.menu.mutation),w.debug("Setting up mutation observer",lt,bt),w.observe.select(),w.observe.menu())},disconnect:{menuObserver:function(){bt&&bt.disconnect()},selectObserver:function(){lt&&lt.disconnect()}},observe:{select:function(){w.has.input()&&lt.observe(g[0],{childList:!0,subtree:!0})},menu:function(){w.has.menu()&&bt.observe(nt[0],{childList:!0,subtree:!0})}},create:{id:function(){gt=(Math.random().toString(16)+"000000000").substr(2,8);ct="."+gt;w.verbose("Creating unique id for element",gt)},userChoice:function(t){var u,i,f;return!!(t=t||w.get.userValues())&&(t=n.isArray(t)?t:[t],n.each(t,function(t,e){!1===w.get.item(e)&&(f=b.templates.addition(w.add.variables(at.addResult,e)),i=n("<div />").html(f).attr("data-"+rt.value,e).attr("data-"+rt.text,e).addClass(k.addition).addClass(k.item),b.hideAdditions&&i.addClass(k.hidden),u=u===r?i:u.add(i),w.verbose("Creating user choices for value",e,i))}),u)},userLabels:function(){var t=w.get.userValues();t&&(w.debug("Adding user labels",t),n.each(t,function(n,t){w.verbose("Adding custom user value");w.add.label(t,t)}))},menu:function(){nt=n("<div />").addClass(k.menu).appendTo(g)},sizer:function(){ti=n("<span />").addClass(k.sizer).insertAfter(et)}},search:function(n){n=n!==r?n:w.get.query();w.verbose("Searching for query",n);w.has.minCharacters(n)?w.filter(n):w.hide()},select:{firstUnfiltered:function(){w.verbose("Selecting first non-filtered element");w.remove.selectedItem();it.not(d.unselectable).not(d.addition+d.hidden).eq(0).addClass(k.selected)},nextAvailable:function(n){var t=(n=n.eq(0)).nextAll(d.item).not(d.unselectable).eq(0),i=n.prevAll(d.item).not(d.unselectable).eq(0);t.length>0?(w.verbose("Moving selection to",t),t.addClass(k.selected)):(w.verbose("Moving selection to",i),i.addClass(k.selected))}},setup:{api:function(){var n={debug:b.debug,urlData:{value:w.get.value(),query:w.get.query()},on:!1};w.verbose("First request, initializing API");g.api(n)},layout:function(){g.is("select")&&(w.setup.select(),w.setup.returnedObject());w.has.menu()||w.create.menu();w.is.search()&&!w.has.search()&&(w.verbose("Adding search input"),et=n("<input />").addClass(k.search).prop("autocomplete","off").insertBefore(st));w.is.multiple()&&w.is.searchSelection()&&!w.has.sizer()&&w.create.sizer();b.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t);g.is("select")&&(ut=g);ut.parent(d.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),g=ut.closest(d.dropdown),w.has.menu()||w.create.menu(),nt=g.children(d.menu),w.setup.menu(t)):(w.debug("Creating entire dropdown from select"),g=n("<div />").attr("class",ut.attr("class")).addClass(k.selection).addClass(k.dropdown).html(fi.dropdown(t)).insertBefore(ut),ut.hasClass(k.multiple)&&!1===ut.prop("multiple")&&(w.error(vt.missingMultiple),ut.prop("multiple",!0)),ut.is("[multiple]")&&w.set.multiple(),ut.prop("disabled")&&(w.debug("Disabling dropdown"),g.addClass(k.disabled)),ut.removeAttr("class").detach().prependTo(g));w.refresh()},menu:function(n){nt.html(fi.menu(n,ui));it=nt.find(d.item)},reference:function(){w.debug("Dropdown behavior was called on select, replacing with closest dropdown");g=g.parent(d.dropdown);pt=g.data(kt);ot=g.get(0);w.refresh();w.setup.returnedObject()},returnedObject:function(){var n=e.slice(0,p),t=e.slice(p+1);e=n.add(g).add(t)}},refresh:function(){w.refreshSelectors();w.refreshData()},refreshItems:function(){it=nt.find(d.item)},refreshSelectors:function(){w.verbose("Refreshing selector cache");st=g.find(d.text);et=g.find(d.search);ut=g.find(d.input);hi=g.find(d.icon);ii=g.prev().find(d.text).length>0?g.prev().find(d.text):g.prev();nt=g.children(d.menu);it=nt.find(d.item)},refreshData:function(){w.verbose("Refreshing cached metadata");it.removeData(rt.text).removeData(rt.value)},clearData:function(){w.verbose("Clearing metadata");it.removeData(rt.text).removeData(rt.value);g.removeData(rt.defaultText).removeData(rt.defaultValue).removeData(rt.placeholderText)},toggle:function(){w.verbose("Toggling menu visibility");w.is.active()?w.hide():w.show()},show:function(t){if(t=n.isFunction(t)?t:function(){},!w.can.show()&&w.is.remote()&&(w.debug("No API results retrieved, searching before show"),w.queryRemote(w.get.query(),w.show)),w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),!w.has.message()||w.has.maxSelections()||w.has.allResultsFiltered()||w.remove.message(),w.is.allFiltered())return!0;!1!==b.onShow.call(ot)&&w.animate.show(function(){w.can.click()&&w.bind.intent();w.has.menuSearch()&&w.focusSearch();w.set.visible();t.call(ot)})}},hide:function(t){t=n.isFunction(t)?t:function(){};w.is.active()&&!w.is.animatingOutward()&&(w.debug("Hiding dropdown"),!1!==b.onHide.call(ot)&&w.animate.hide(function(){w.remove.visible();t.call(ot)}))},hideOthers:function(){w.verbose("Finding other dropdowns to hide");e.not(g).has(d.menu+"."+k.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu  instantaneously");w.remove.active();w.remove.visible();nt.transition("hide")},hideSubMenus:function(){var n=nt.children(d.item).find(d.menu);w.verbose("Hiding sub menus",n);n.transition("hide")},bind:{events:function(){h&&w.bind.touchEvents();w.bind.keyboardEvents();w.bind.inputEvents();w.bind.mouseEvents()},touchEvents:function(){w.debug("Touch device detected binding additional touch events");w.is.searchSelection()||w.is.single()&&g.on("touchstart"+tt,w.event.test.toggle);nt.on("touchstart"+tt,d.item,w.event.item.mouseenter)},keyboardEvents:function(){w.verbose("Binding keyboard events");g.on("keydown"+tt,w.event.keydown);w.has.search()&&g.on(w.get.inputEvent()+tt,d.search,w.event.input);w.is.multiple()&&o.on("keydown"+ct,w.event.document.keydown)},inputEvents:function(){w.verbose("Binding input change events");g.on("change"+tt,d.input,w.event.change)},mouseEvents:function(){w.verbose("Binding mouse events");w.is.multiple()&&g.on("click"+tt,d.label,w.event.label.click).on("click"+tt,d.remove,w.event.remove.click);w.is.searchSelection()?(g.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("mousedown"+tt,d.menu,w.event.menu.mousedown).on("mouseup"+tt,d.menu,w.event.menu.mouseup).on("click"+tt,d.icon,w.event.icon.click).on("focus"+tt,d.search,w.event.search.focus).on("click"+tt,d.search,w.event.search.focus).on("blur"+tt,d.search,w.event.search.blur).on("click"+tt,d.text,w.event.text.focus),w.is.multiple()&&g.on("click"+tt,w.event.click)):("click"==b.on?g.on("click"+tt,d.icon,w.event.icon.click).on("click"+tt,w.event.test.toggle):"hover"==b.on?g.on("mouseenter"+tt,w.delay.show).on("mouseleave"+tt,w.delay.hide):g.on(b.on+tt,w.toggle),g.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("focus"+tt,w.event.focus),w.has.menuSearch()?g.on("blur"+tt,d.search,w.event.search.blur):g.on("blur"+tt,w.event.blur));nt.on("mouseenter"+tt,d.item,w.event.item.mouseenter).on("mouseleave"+tt,d.item,w.event.item.mouseleave).on("click"+tt,d.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document");h&&o.on("touchstart"+ct,w.event.test.touch).on("touchmove"+ct,w.event.test.touch);o.on("click"+ct,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document");h&&o.off("touchstart"+ct).off("touchmove"+ct);o.off("click"+ct)}},filter:function(n){var t=n!==r?n:w.get.query(),i=function(){w.is.multiple()&&w.filterActive();(n||!n&&0==w.get.activeItem().length)&&w.select.firstUnfiltered();w.has.allResultsFiltered()?b.onNoResults.call(ot,t)?b.allowAdditions?b.hideAdditions&&(w.verbose("User addition with no menu, setting empty style"),w.set.empty(),w.hideMenu()):(w.verbose("All items filtered, showing message",t),w.add.message(at.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):(w.remove.empty(),w.remove.message());b.allowAdditions&&w.add.userSuggestion(n);w.is.searchSelection()&&w.can.show()&&w.is.focusedOnSearch()&&w.show()};b.useLabels&&w.has.maxSelections()||(b.apiSettings?w.can.useAPI()?w.queryRemote(t,function(){b.filterRemoteData&&w.filterItems(t);i()}):w.error(vt.noAPI):(w.filterItems(t),i()))},queryRemote:function(t,i){var r={errorDuration:!1,cache:"local",throttle:b.throttle,urlData:{query:t},onError:function(){w.add.message(at.serverError);i()},onFailure:function(){w.add.message(at.serverError);i()},onSuccess:function(t){var r=t[ui.remoteValues];n.isArray(r)&&r.length>0?(w.remove.message(),w.setup.menu({values:t[ui.remoteValues]})):w.add.message(at.noResults);i()}};g.api("get request")||w.setup.api();r=n.extend(!0,{},r,b.apiSettings);g.api("setting",r).api("query")},filterItems:function(t){var u=t!==r?t:w.get.query(),i=null,e=w.escape.string(u),f=new RegExp("^"+e,"igm");w.has.query()&&(i=[],w.verbose("Searching for matching values",u),it.each(function(){var t,r,e=n(this);return("both"==b.match||"text"==b.match)&&(-1!==(t=String(w.get.choiceText(e,!1))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,t)||!0===b.fullTextSearch&&w.fuzzySearch(u,t))?(i.push(this),!0):("both"==b.match||"value"==b.match)&&(-1!==(r=String(w.get.choiceValue(e,t))).search(f)||"exact"===b.fullTextSearch&&w.exactSearch(u,r)||!0===b.fullTextSearch&&w.fuzzySearch(u,r))?(i.push(this),!0):void 0}));w.debug("Showing only matched items",u);w.remove.filteredItem();i&&it.not(i).addClass(k.filtered)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),u>r)return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},exactSearch:function(n,t){return n=n.toLowerCase(),(t=t.toLowerCase()).indexOf(n)>-1},filterActive:function(){b.useLabels&&it.filter("."+k.active).addClass(k.filtered)},focusSearch:function(n){w.has.search()&&!w.is.focusedOnSearch()&&(n?(g.off("focus"+tt,d.search),et.focus(),g.on("focus"+tt,d.search,w.event.search.focus)):et.focus())},forceSelection:function(){var t=it.not(k.filtered).filter("."+k.selected).eq(0),i=it.not(k.filtered).filter("."+k.active).eq(0),n=t.length>0?t:i;if(n.length>0&&!w.is.multiple())return w.debug("Forcing partial selection to selected item",n),void w.event.item.click.call(n,{},!0);b.allowAdditions?(w.set.selected(w.get.query()),w.remove.searchTerm()):w.remove.searchTerm()},change:{values:function(t){b.allowAdditions||w.clear();w.debug("Creating dropdown with specified values",t);w.setup.menu({values:t});n.each(t,function(n,t){if(1==t.selected)return w.debug("Setting initial selection to",t.value),w.set.selected(t.value),!0})}},event:{change:function(){oi||(w.debug("Input changed, updating selection"),w.set.selected())},focus:function(){b.showOnFocus&&!yt&&w.is.hidden()&&!wt&&w.show()},blur:function(){wt=i.activeElement===this;yt||wt||(w.remove.activeLabel(),w.hide())},mousedown:function(){w.is.searchSelection()?dt=!0:yt=!0},mouseup:function(){w.is.searchSelection()?dt=!1:yt=!1},click:function(t){n(t.target).is(g)&&(w.is.focusedOnSearch()?w.show():w.focusSearch())},search:{focus:function(){yt=!0;w.is.multiple()&&w.remove.activeLabel();b.showOnFocus&&w.search()},blur:function(){wt=i.activeElement===this;w.is.searchSelection()&&!dt&&(ei||wt||(b.forceSelection&&w.forceSelection(),w.hide()));dt=!1}},icon:{click:function(){w.toggle()}},text:{focus:function(){yt=!0;w.focusSearch()}},input:function(){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered();clearTimeout(w.timer);w.timer=setTimeout(w.search,b.delay.search)},label:{click:function(t){var i=n(this),u=g.find(d.label),r=u.filter("."+k.active),f=i.nextAll("."+k.active),e=i.prevAll("."+k.active),o=f.length>0?i.nextUntil(f).add(r).add(i):i.prevUntil(e).add(r).add(i);t.shiftKey?(r.removeClass(k.active),o.addClass(k.active)):t.ctrlKey?i.toggleClass(k.active):(r.removeClass(k.active),i.addClass(k.active));b.onLabelSelect.apply(this,u.filter("."+k.active))}},remove:{click:function(){var t=n(this).parent();t.hasClass(k.active)?w.remove.activeLabels():w.remove.activeLabels(t)}},test:{toggle:function(n){var t=w.is.multiple()?w.show:w.toggle;w.is.bubbledLabelClick(n)||w.is.bubbledIconClick(n)||w.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){w.determine.eventOnElement(n,function(){"touchstart"==n.type?w.timer=setTimeout(function(){w.hide()},b.delay.touch):"touchmove"==n.type&&clearTimeout(w.timer)});n.stopPropagation()},hide:function(n){w.determine.eventInModule(n,w.hide)}},select:{mutation:function(t){w.debug("<select> modified, recreating menu");var i=!1;n.each(t,function(t,r){if(n(r.target).is("select")||n(r.addedNodes).is("select"))return i=!0,!0});i&&(w.disconnect.selectObserver(),w.refresh(),w.setup.select(),w.set.selected(),w.observe.select())}},menu:{mutation:function(t){var i=t[0],u=i.addedNodes?n(i.addedNodes[0]):n(!1),f=i.removedNodes?n(i.removedNodes[0]):n(!1),r=u.add(f),e=r.is(d.addition)||r.closest(d.addition).length>0,o=r.is(d.message)||r.closest(d.message).length>0;e||o?(w.debug("Updating item selector cache"),w.refreshItems()):(w.debug("Menu modified, updating selector cache"),w.refresh())},mousedown:function(){ei=!0},mouseup:function(){ei=!1}},item:{mouseenter:function(t){var u=n(t.target),r=n(this),i=r.children(d.menu),f=r.siblings(d.item).children(d.menu),e=i.length>0;i.find(u).length>0||!e||(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",i);n.each(f,function(){w.animate.hide(!1,n(this))});w.animate.show(!1,i)},b.delay.show),t.preventDefault())},mouseleave:function(){var t=n(this).children(d.menu);t.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t);w.animate.hide(!1,t)},b.delay.hide))},click:function(t,r){var u=n(this),o=n(t?t.target:""),f=u.find(d.menu),e=w.get.choiceText(u),s=w.get.choiceValue(u,e),h=f.length>0,c=f.find(o).length>0;w.has.menuSearch()&&n(i.activeElement).blur();c||h&&!b.allowCategorySelection||(w.is.searchSelection()&&(b.allowAdditions&&w.remove.userAddition(),w.remove.searchTerm(),w.is.focusedOnSearch()||1==r||w.focusSearch(!0)),b.useLabels||(w.remove.filteredItem(),w.set.scrollPosition(u)),w.determine.selectAction.call(this,e,s))}},document:{keydown:function(n){var u=n.which;if(w.is.inObject(u,ft)){var i=g.find(d.label),t=i.filter("."+k.active),o=(t.data(rt.value),i.index(t)),a=i.length,r=t.length>0,s=t.length>1,v=0===o,h=o+1==a,e=w.is.searchSelection(),f=w.is.focusedOnSearch(),c=w.is.focused(),l=f&&0===w.get.caretPosition();if(e&&!r&&!f)return;u==ft.leftArrow?!c&&!l||r?r&&(n.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),i.removeClass(k.active)),v&&!s?t.addClass(k.active):t.prev(d.siblingLabel).addClass(k.active).end(),n.preventDefault()):(w.verbose("Selecting previous label"),i.last().addClass(k.active)):u==ft.rightArrow?(c&&!r&&i.first().addClass(k.active),r&&(n.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),i.removeClass(k.active)),h?e?f?i.removeClass(k.active):w.focusSearch():s?t.next(d.siblingLabel).addClass(k.active):t.addClass(k.active):t.next(d.siblingLabel).addClass(k.active),n.preventDefault())):u==ft.deleteKey||u==ft.backspace?r?(w.verbose("Removing active labels"),h&&e&&!f&&w.focusSearch(),t.last().next(d.siblingLabel).addClass(k.active),w.remove.activeLabels(t),n.preventDefault()):l&&!r&&u==ft.backspace&&(w.verbose("Removing last label on input backspace"),t=i.last().addClass(k.active),w.remove.activeLabels(t)):t.removeClass(k.active)}}},keydown:function(n){var t=n.which;if(w.is.inObject(t,ft)){var r,s=it.not(d.unselectable).filter("."+k.selected).eq(0),a=nt.children("."+k.active).eq(0),i=s.length>0?s:a,v=i.length>0?i.siblings(":not(."+k.filtered+")").addBack():nt.children(":not(."+k.filtered+")"),e=i.children(d.menu),u=i.closest(d.menu),h=u.hasClass(k.visible)||u.hasClass(k.animating)||u.parent(d.menu).length>0,c=e.length>0,f=i.length>0,l=i.not(d.unselectable).length>0,o=t==ft.delimiter&&b.allowAdditions&&w.is.multiple();if(b.allowAdditions&&b.hideAdditions&&(t==ft.enter||o)&&l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),w.is.visible()){if((t==ft.enter||o)&&(t==ft.enter&&f&&c&&!b.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=ft.rightArrow):l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),n.preventDefault()),f&&(t==ft.leftArrow&&u[0]!==nt[0]&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,u),i.removeClass(k.selected),u.closest(d.item).addClass(k.selected),n.preventDefault()),t==ft.rightArrow&&c&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,e),i.removeClass(k.selected),e.find(d.item).eq(0).addClass(k.selected),n.preventDefault())),t==ft.upArrow){if(r=f&&h?i.prevAll(d.item+":not("+d.unselectable+")").eq(0):it.eq(0),v.index(r)<0)return w.verbose("Up key pressed but reached top of current menu"),void n.preventDefault();w.verbose("Up key pressed, changing active item");i.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}if(t==ft.downArrow){if(0===(r=f&&h?r=i.nextAll(d.item+":not("+d.unselectable+")").eq(0):it.eq(0)).length)return w.verbose("Down key pressed but reached bottom of current menu"),void n.preventDefault();w.verbose("Down key pressed, changing active item");it.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}t==ft.pageUp&&(w.scrollPage("up"),n.preventDefault());t==ft.pageDown&&(w.scrollPage("down"),n.preventDefault());t==ft.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else o&&n.preventDefault(),t!=ft.downArrow||w.is.visible()||(w.verbose("Down key pressed, showing dropdown"),w.show(),n.preventDefault())}else w.has.search()||w.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=ut[0];t&&(w.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},determine:{selectAction:function(t,i){w.verbose("Determining action",b.action);n.isFunction(w.action[b.action])?(w.verbose("Triggering preset action",b.action,t,i),w.action[b.action].call(ot,t,i,this)):n.isFunction(b.action)?(w.verbose("Triggering user action",b.action,t,i),b.action.call(ot,t,i,this)):w.error(vt.action,b.action)},eventInModule:function(t,r){var u=n(t.target),f=u.closest(i.documentElement).length>0,e=u.closest(g).length>0;return r=n.isFunction(r)?r:function(){},f&&!e?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,r){var u=n(t.target),f=u.closest(d.siblingLabel),e=i.body.contains(t.target),o=0===g.find(f).length,s=0===u.closest(nt).length;return r=n.isFunction(r)?r:function(){},e&&o&&s?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.selected(i,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},select:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.value(i,t,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},combo:function(t,i,u){i=i!==r?i:t;w.set.selected(i,n(u));w.hideAndClear()},hide:function(n,t){w.set.value(t,n);w.hideAndClear()}},get:{id:function(){return gt},defaultText:function(){return g.data(rt.defaultText)},defaultValue:function(){return g.data(rt.defaultValue)},placeholderText:function(){return"auto"!=b.placeholder&&"string"==typeof b.placeholder?b.placeholder:g.data(rt.placeholderText)||""},text:function(){return st.text()},query:function(){return n.trim(et.val())},searchWidth:function(n){return n=n!==r?n:et.val(),ti.text(n),Math.ceil(ti.width()+1)},selectionCount:function(){var t=w.get.values();return w.is.multiple()?n.isArray(t)?t.length:0:""!==w.get.value()?1:0},transition:function(n){return"auto"==b.transition?w.is.upward(n)?"slide up":"slide down":b.transition},userValues:function(){var t=w.get.values();return!!t&&(t=n.isArray(t)?t:[t],n.grep(t,function(n){return!1===w.get.item(n)}))},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(){var t,r,n=et.get(0);return"selectionStart"in n?n.selectionStart:i.selection?(n.focus(),r=(t=i.selection.createRange()).text.length,t.moveStart("character",-n.value.length),t.text.length-r):void 0},value:function(){var t=ut.length>0?ut.val():g.data(rt.value),i=n.isArray(t)&&1===t.length&&""===t[0];return t===r||i?"":t},values:function(){var n=w.get.value();return""===n?"":!w.has.selectInput()&&w.is.multiple()?"string"==typeof n?n.split(b.delimiter):"":n},remoteValues:function(){var t=w.get.values(),i=!1;return t&&("string"==typeof t&&(t=[t]),n.each(t,function(n,t){var r=w.read.remoteData(t);w.verbose("Restoring value from session data",r,t);r&&(i||(i={}),i[t]=r)})),i},choiceText:function(t,i){if(i=i!==r?i:b.preserveHTML,t)return t.find(d.menu).length>0&&(w.verbose("Retrieving text of element with sub-menu"),(t=t.clone()).find(d.menu).remove(),t.find(d.menuIcon).remove()),t.data(rt.text)!==r?t.data(rt.text):i?n.trim(t.html()):n.trim(t.text())},choiceValue:function(t,i){return i=i||w.get.choiceText(t),!!t&&(t.data(rt.value)!==r?String(t.data(rt.value)):"string"==typeof i?n.trim(i.toLowerCase()):String(i))},inputEvent:function(){var n=et[0];return!!n&&(n.oninput!==r?"input":n.onpropertychange!==r?"propertychange":"keyup")},selectValues:function(){var t={values:[]};return g.find("option").each(function(){var i=n(this),u=i.html(),e=i.attr("disabled"),f=i.attr("value")!==r?i.attr("value"):u;"auto"===b.placeholder&&""===f?t.placeholder=u:t.values.push({name:u,value:f,disabled:e})}),b.placeholder&&"auto"!==b.placeholder&&(w.debug("Setting placeholder value to",b.placeholder),t.placeholder=b.placeholder),b.sortSelect?(t.values.sort(function(n,t){return n.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retrieved values from select",t),t},activeItem:function(){return it.filter("."+k.active)},selectedItem:function(){var n=it.not(d.unselectable).filter("."+k.selected);return n.length>0?n:it.eq(0)},itemWithAdditions:function(n){var t=w.get.item(n),i=w.create.userChoice(n);return i&&i.length>0&&(t=t.length>0?t.add(i):i),t},item:function(t,i){var e,f,u=!1;return t=t!==r?t:w.get.values()!==r?w.get.values():w.get.text(),e=f?t.length>0:t!==r&&null!==t,f=w.is.multiple()&&n.isArray(t),i=""===t||0===t||i||!1,e&&it.each(function(){var e=n(this),s=w.get.choiceText(e),o=w.get.choiceValue(e,s);if(null!==o&&o!==r)if(f)-1===n.inArray(String(o),t)&&-1===n.inArray(s,t)||(u=u?u.add(e):e);else if(i){if(w.verbose("Ambiguous dropdown value using strict type check",e,t),o===t||s===t)return u=e,!0}else if(String(o)==String(t)||s==t)return w.verbose("Found select item by value",o,t),u=e,!0}),u}},check:{maxSelections:function(n){return!b.maxSelections||((n=n!==r?n:w.get.selectionCount())>=b.maxSelections?(w.debug("Maximum selection count reached"),b.useLabels&&(it.addClass(k.filtered),w.add.message(at.maxSelections)),!0):(w.verbose("No longer at maximum selection count"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filterItems(),!1))}},restore:{defaults:function(){w.clear();w.restore.defaultText();w.restore.defaultValue()},defaultText:function(){var n=w.get.defaultText();n===w.get.placeholderText?(w.debug("Restoring default placeholder text",n),w.set.placeholderText(n)):(w.debug("Restoring default text",n),w.set.text(n))},placeholderText:function(){w.set.placeholderText()},defaultValue:function(){var n=w.get.defaultValue();n!==r&&(w.debug("Restoring default value",n),""!==n?(w.set.value(n),w.set.selected()):(w.remove.activeItem(),w.remove.selectedItem()))},labels:function(){b.allowAdditions&&(b.useLabels||(w.error(vt.labels),b.useLabels=!0),w.debug("Restoring selected values"),w.create.userLabels());w.check.maxSelections()},selected:function(){w.restore.values();w.is.multiple()?(w.debug("Restoring previously selected values and labels"),w.restore.labels()):w.debug("Restoring previously selected values")},values:function(){w.set.initialLoad();b.apiSettings&&b.saveRemoteData&&w.get.remoteValues()?w.restore.remoteValues():w.set.selected();w.remove.initialLoad()},remoteValues:function(){var t=w.get.remoteValues();w.debug("Recreating selected from session data",t);t&&(w.is.single()?n.each(t,function(n,t){w.set.text(t)}):n.each(t,function(n,t){w.add.label(n,t)}))}},read:{remoteData:function(n){var i;if(t.Storage!==r)return(i=sessionStorage.getItem(n))!==r&&i;w.error(vt.noStorage)}},save:{defaults:function(){w.save.defaultText();w.save.placeholderText();w.save.defaultValue()},defaultValue:function(){var n=w.get.value();w.verbose("Saving default value as",n);g.data(rt.defaultValue,n)},defaultText:function(){var n=w.get.text();w.verbose("Saving default text as",n);g.data(rt.defaultText,n)},placeholderText:function(){var n;!1!==b.placeholder&&st.hasClass(k.placeholder)&&(n=w.get.text(),w.verbose("Saving placeholder text as",n),g.data(rt.placeholderText,n))},remoteData:function(n,i){t.Storage!==r?(w.verbose("Saving remote data to session storage",i,n),sessionStorage.setItem(i,n)):w.error(vt.noStorage)}},clear:function(){w.is.multiple()&&b.useLabels?w.remove.labels():(w.remove.activeItem(),w.remove.selectedItem());w.set.placeholderText();w.clearValue()},clearValue:function(){w.set.value("")},scrollPage:function(n,t){var r,u,f=t||w.get.selectedItem(),e=f.closest(d.menu),c=e.outerHeight(),h=e.scrollTop(),s=it.eq(0).outerHeight(),o=Math.floor(c/s),l=(e.prop("scrollHeight"),"up"==n?h-s*o:h+s*o),i=it.not(d.unselectable);u="up"==n?i.index(f)-o:i.index(f)+o;(r=("up"==n?u>=0:u<i.length)?i.eq(u):"up"==n?i.first():i.last()).length>0&&(w.debug("Scrolling page",n,r),f.removeClass(k.selected),r.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r),e.scrollTop(l))},set:{filtered:function(){var n=w.is.multiple(),i=w.is.searchSelection(),r=n&&i,t=i?w.get.query():"",u="string"==typeof t&&t.length>0,f=w.get.searchWidth(),e=""!==t;n&&u&&(w.verbose("Adjusting input width",f,b.glyphWidth),et.css("width",f));u||r&&e?(w.verbose("Hiding placeholder text"),st.addClass(k.filtered)):(!n||r&&!e)&&(w.verbose("Showing placeholder text"),st.removeClass(k.filtered))},empty:function(){g.addClass(k.empty)},loading:function(){g.addClass(k.loading)},placeholderText:function(n){n=n||w.get.placeholderText();w.debug("Setting placeholder text",n);w.set.text(n);st.addClass(k.placeholder)},tabbable:function(){w.is.searchSelection()?(w.debug("Added tabindex to searchable dropdown"),et.val("").attr("tabindex",0),nt.attr("tabindex",-1)):(w.debug("Added tabindex to dropdown"),g.attr("tabindex")===r&&(g.attr("tabindex",0),nt.attr("tabindex",-1)))},initialLoad:function(){w.verbose("Setting initial load");ri=!0},activeItem:function(n){b.allowAdditions&&n.filter(d.addition).length>0?n.addClass(k.filtered):n.addClass(k.active)},partialSearch:function(n){var t=w.get.query().length;et.val(n.substr(0,t))},scrollPosition:function(n,t){var i,e,u,f,o,s;i=(n=n||w.get.selectedItem()).closest(d.menu);e=n&&n.length>0;t=t!==r&&t;n&&i.length>0&&e&&(n.position().top,i.addClass(k.loading),u=(f=i.scrollTop())-i.offset().top+n.offset().top,t||(s=f+i.height()<u+5,o=u-5<f),w.debug("Scrolling to active item",u),(t||o||s)&&i.scrollTop(u),i.removeClass(k.loading))},text:function(n){"select"!==b.action&&("combo"==b.action?(w.debug("Changing combo button text",n,ii),b.preserveHTML?ii.html(n):ii.text(n)):(n!==w.get.placeholderText()&&st.removeClass(k.placeholder),w.debug("Changing text",n,st),st.removeClass(k.filtered),b.preserveHTML?st.html(n):st.text(n)))},selectedItem:function(n){var t=w.get.choiceValue(n),i=w.get.choiceText(n,!1),r=w.get.choiceText(n,!0);w.debug("Setting user selection to item",n);w.remove.activeItem();w.set.partialSearch(i);w.set.activeItem(n);w.set.selected(t,n);w.set.text(r)},selectedLetter:function(t){var u,r=it.filter("."+k.selected),i=!1;r.length>0&&w.has.firstLetter(r,t)&&(u=r.nextAll(it).eq(0),w.has.firstLetter(u,t)&&(i=u));i||it.each(function(){if(w.has.firstLetter(n(this),t))return i=n(this),!1});i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),r.removeClass(k.selected),i.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(i))},direction:function(n){"auto"==b.direction?(w.remove.upward(),w.can.openDownward(n)?w.remove.upward(n):w.set.upward(n),w.is.leftward(n)||w.can.openRightward(n)||w.set.leftward(n)):"upward"==b.direction&&w.set.upward(n)},upward:function(n){(n||g).addClass(k.upward)},leftward:function(n){(n||nt).addClass(k.leftward)},value:function(n,t,i){var u=w.escape.value(n),o=ut.length>0,f=w.get.values(),e=n!==r?String(n):n;if(o){if(!b.allowReselection&&e==f&&(w.verbose("Skipping value update already same value",n,f),!w.is.initialLoad()))return;w.is.single()&&w.has.selectInput()&&w.can.extendSelect()&&(w.debug("Adding user option",n),w.add.optionValue(n));w.debug("Updating input value",u,f);oi=!0;ut.val(u);!1===b.fireOnInit&&w.is.initialLoad()?w.debug("Input native change event ignored on initial load"):w.trigger.change();oi=!1}else w.verbose("Storing value in metadata",u,ut),u!==f&&g.data(rt.value,e);!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onChange):b.onChange.call(ot,n,t,i)},active:function(){g.addClass(k.active)},multiple:function(){g.addClass(k.multiple)},visible:function(){g.addClass(k.visible)},exactly:function(n,t){w.debug("Setting selected to exact values");w.clear();w.set.selected(n,t)},selected:function(t,i){var r=w.is.multiple();(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t))&&(w.debug("Setting selected menu item to",i),w.is.multiple()&&w.remove.searchWidth(),w.is.single()?(w.remove.activeItem(),w.remove.selectedItem()):b.useLabels&&w.remove.selectedItem(),i.each(function(){var t=n(this),u=w.get.choiceText(t),f=w.get.choiceValue(t,u),e=t.hasClass(k.filtered),o=t.hasClass(k.active),s=t.hasClass(k.addition),h=r&&1==i.length;r?!o||s?(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),b.useLabels?(w.add.label(f,u,h),w.add.value(f,u,t),w.set.activeItem(t),w.filterActive(),w.select.nextAvailable(i)):(w.add.value(f,u,t),w.set.text(w.add.variables(at.count)),w.set.activeItem(t))):e||(w.debug("Selected active value, removing label"),w.remove.selected(f)):(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),w.set.text(u),w.set.value(f,u,t),t.addClass(k.active).addClass(k.selected))}))}},add:{label:function(t,i,r){var u,e=w.is.searchSelection()?et:st,f=w.escape.value(t);b.ignoreCase&&(f=f.toLowerCase());u=n("<a />").addClass(k.label).attr("data-"+rt.value,f).html(fi.label(f,i));u=b.onLabelCreate.call(u,f,i);w.has.label(t)?w.debug("User selection already exists, skipping",f):(b.label.variation&&u.addClass(b.label.variation),!0===r?(w.debug("Animating in label",u),u.addClass(k.hidden).insertBefore(e).transition(b.label.transition,b.label.duration)):(w.debug("Adding selection label",u),u.insertBefore(e)))},message:function(t){var i=nt.children(d.message),r=b.templates.message(w.add.variables(t));i.length>0?i.html(r):i=n("<div/>").html(r).addClass(k.message).appendTo(nt)},optionValue:function(t){var i=w.escape.value(t);ut.find('option[value="'+w.escape.string(i)+'"]').length>0||(w.disconnect.selectObserver(),w.is.single()&&(w.verbose("Removing previous user addition"),ut.find("option."+k.addition).remove()),n("<option/>").prop("value",i).addClass(k.addition).html(t).appendTo(ut),w.verbose("Adding user addition as an <option>",t),w.observe.select())},userSuggestion:function(n){var i,t=nt.children(d.addition),r=w.get.item(n),u=r&&r.not(d.addition).length,f=t.length>0;b.useLabels&&w.has.maxSelections()||(""===n||u?t.remove():(f?(t.data(rt.value,n).data(rt.text,n).attr("data-"+rt.value,n).attr("data-"+rt.text,n).removeClass(k.filtered),b.hideAdditions||(i=b.templates.addition(w.add.variables(at.addResult,n)),t.html(i)),w.verbose("Replacing user suggestion with new value",t)):((t=w.create.userChoice(n)).prependTo(nt),w.verbose("Adding item choice to menu corresponding with user choice addition",t)),b.hideAdditions&&!w.is.allFiltered()||t.addClass(k.selected).siblings().removeClass(k.selected),w.refreshItems()))},variables:function(n,t){var i,r,u=-1!==n.search("{count}"),f=-1!==n.search("{maxCount}"),e=-1!==n.search("{term}");return w.verbose("Adding templated variables to message",n),u&&(i=w.get.selectionCount(),n=n.replace("{count}",i)),f&&(i=w.get.selectionCount(),n=n.replace("{maxCount}",b.maxSelections)),e&&(r=t||w.get.query(),n=n.replace("{term}",r)),n},value:function(t,i,r){var u,f=w.get.values();w.has.value(t)?w.debug("Value already selected"):""!==t?(n.isArray(f)?(u=f.concat([t]),u=w.get.uniqueArray(u)):u=[t],w.has.selectInput()?w.can.extendSelect()&&(w.debug("Adding value to select",t,u,ut),w.add.optionValue(t)):(u=u.join(b.delimiter),w.debug("Setting hidden input to delimited value",u,ut)),!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("Skipping onadd callback on initial load",b.onAdd):b.onAdd.call(ot,t,i,r),w.set.value(u,t,i,r),w.check.maxSelections()):w.debug("Cannot select blank values from multiselect")}},remove:{active:function(){g.removeClass(k.active)},activeLabel:function(){g.find(d.label).removeClass(k.active)},empty:function(){g.removeClass(k.empty)},loading:function(){g.removeClass(k.loading)},initialLoad:function(){ri=!1},upward:function(n){(n||g).removeClass(k.upward)},leftward:function(n){(n||nt).removeClass(k.leftward)},visible:function(){g.removeClass(k.visible)},activeItem:function(){it.removeClass(k.active)},filteredItem:function(){b.useLabels&&w.has.maxSelections()||(b.useLabels&&w.is.multiple()?it.not("."+k.active).removeClass(k.filtered):it.removeClass(k.filtered),w.remove.empty())},optionValue:function(n){var i=w.escape.value(n),t=ut.find('option[value="'+w.escape.string(i)+'"]');t.length>0&&t.hasClass(k.addition)&&(lt&&(lt.disconnect(),w.verbose("Temporarily disconnecting mutation observer")),t.remove(),w.verbose("Removing user addition as an <option>",i),lt&&lt.observe(ut[0],{childList:!0,subtree:!0}))},message:function(){nt.children(d.message).remove()},searchWidth:function(){et.css("width","")},searchTerm:function(){w.verbose("Cleared search term");et.val("");w.set.filtered()},userAddition:function(){it.filter(d.addition).remove()},selected:function(t,i){if(!(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t)))return!1;i.each(function(){var t=n(this),i=w.get.choiceText(t),r=w.get.choiceValue(t,i);w.is.multiple()?b.useLabels?(w.remove.value(r,i,t),w.remove.label(r)):(w.remove.value(r,i,t),0===w.get.selectionCount()?w.set.placeholderText():w.set.text(w.add.variables(at.count))):w.remove.value(r,i,t);t.removeClass(k.filtered).removeClass(k.active);b.useLabels&&t.removeClass(k.selected)})},selectedItem:function(){it.removeClass(k.selected)},value:function(n,t,i){var r,u=w.get.values();w.has.selectInput()?(w.verbose("Input is <select> removing selected option",n),r=w.remove.arrayValue(n,u),w.remove.optionValue(n)):(w.verbose("Removing from delimited values",n),r=(r=w.remove.arrayValue(n,u)).join(b.delimiter));!1===b.fireOnInit&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onRemove):b.onRemove.call(ot,n,t,i);w.set.value(r,t,i);w.check.maxSelections()},arrayValue:function(t,i){return n.isArray(i)||(i=[i]),i=n.grep(i,function(n){return t!=n}),w.verbose("Removed value from delimited string",t,i),i},label:function(n){var t=g.find(d.label).filter("[data-"+rt.value+'="'+w.escape.string(n)+'"]');w.verbose("Removing label",t);t.remove()},activeLabels:function(n){n=n||g.find(d.label).filter("."+k.active);w.verbose("Removing active label selections",n);w.remove.labels(n)},labels:function(t){t=t||g.find(d.label);w.verbose("Removing labels",t);t.each(function(){var u=n(this),t=u.data(rt.value),i=t!==r?String(t):t,f=w.is.userValue(i);!1!==b.onLabelRemove.call(u,t)?(w.remove.message(),f?(w.remove.value(i),w.remove.label(i)):w.remove.selected(i)):w.debug("Label remove callback cancelled removal")})},tabbable:function(){w.is.searchSelection()?(w.debug("Searchable dropdown initialized"),et.removeAttr("tabindex"),nt.removeAttr("tabindex")):(w.debug("Simple selection dropdown initialized"),g.removeAttr("tabindex"),nt.removeAttr("tabindex"))}},has:{menuSearch:function(){return w.has.search()&&et.closest(nt).length>0},search:function(){return et.length>0},sizer:function(){return ti.length>0},selectInput:function(){return ut.is("select")},minCharacters:function(n){return!b.minCharacters||(n=n!==r?String(n):String(w.get.query())).length>=b.minCharacters},firstLetter:function(n,t){var i;return!(!n||0===n.length||"string"!=typeof t)&&(i=w.get.choiceText(n,!1),(t=t.toLowerCase())==String(i).charAt(0).toLowerCase())},input:function(){return ut.length>0},items:function(){return it.length>0},menu:function(){return nt.length>0},message:function(){return 0!==nt.children(d.message).length},label:function(n){var t=w.escape.value(n),i=g.find(d.label);return b.ignoreCase&&(t=t.toLowerCase()),i.filter("[data-"+rt.value+'="'+w.escape.string(t)+'"]').length>0},maxSelections:function(){return b.maxSelections&&w.get.selectionCount()>=b.maxSelections},allResultsFiltered:function(){var n=it.not(d.addition);return n.filter(d.unselectable).length===n.length},userSuggestion:function(){return nt.children(d.addition).length>0},query:function(){return""!==w.get.query()},value:function(n){return b.ignoreCase?w.has.valueIgnoringCase(n):w.has.valueMatchingCase(n)},valueMatchingCase:function(t){var i=w.get.values();return!!(n.isArray(i)?i&&-1!==n.inArray(t,i):i==t)},valueIgnoringCase:function(t){var i=w.get.values(),r=!1;return n.isArray(i)||(i=[i]),n.each(i,function(n,i){if(String(t).toLowerCase()==String(i).toLowerCase())return r=!0,!1}),r}},is:{active:function(){return g.hasClass(k.active)},animatingInward:function(){return nt.transition("is inward")},animatingOutward:function(){return nt.transition("is outward")},bubbledLabelClick:function(t){return n(t.target).is("select, input")&&g.closest("label").length>0},bubbledIconClick:function(t){return n(t.target).closest(hi).length>0},alreadySetup:function(){return g.is("select")&&g.parent(d.dropdown).data(kt)!==r&&0===g.prev().length},animating:function(n){return n?n.transition&&n.transition("is animating"):nt.transition&&nt.transition("is animating")},leftward:function(n){return(n||nt).hasClass(k.leftward)},disabled:function(){return g.hasClass(k.disabled)},focused:function(){return i.activeElement===g[0]},focusedOnSearch:function(){return i.activeElement===et[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!(0==b.hideAdditions&&w.has.userSuggestion())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(n){return!w.is.visible(n)},initialLoad:function(){return ri},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return r=!0,!0}),r},multiple:function(){return g.hasClass(k.multiple)},remote:function(){return b.apiSettings&&w.can.useAPI()},single:function(){return!w.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(r.target&&n(r.target).is("select"))return i=!0,!0}),i},search:function(){return g.hasClass(k.search)},searchSelection:function(){return w.has.search()&&1===et.parent(d.dropdown).length},selection:function(){return g.hasClass(k.selection)},userValue:function(t){return-1!==n.inArray(t,w.get.userValues())},upward:function(n){return(n||g).hasClass(k.upward)},visible:function(n){return n?n.hasClass(k.visible):nt.hasClass(k.visible)},verticallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-y");return"auto"==n||"scroll"==n},horizontallyScrollableContext:function(){var n=ht.get(0)!==t&&ht.css("overflow-X");return"auto"==n||"scroll"==n}},can:{activate:function(n){return!!b.useLabels||!w.has.maxSelections()||!(!w.has.maxSelections()||!n.hasClass(k.active))},openDownward:function(n){var r,i,u=n||nt,f=!0;return u.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollTop:ht.scrollTop(),height:ht.outerHeight()},menu:{offset:u.offset(),height:u.outerHeight()}},w.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),(r={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height}).below?(w.verbose("Dropdown can fit in context downward",r),f=!0):r.below||r.above?(w.verbose("Dropdown cannot fit below, opening upward",r),f=!1):(w.verbose("Dropdown cannot fit in either direction, favoring downward",r),f=!0),u.removeClass(k.loading),f},openRightward:function(n){var u,i,r=n||nt,f=!0;return r.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollLeft:ht.scrollLeft(),width:ht.outerWidth()},menu:{offset:r.offset(),width:r.outerWidth()}},w.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),(u=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width)&&(w.verbose("Dropdown cannot fit in context rightward",u),f=!1),r.removeClass(k.loading),f},click:function(){return h||"click"==b.on},extendSelect:function(){return b.allowAdditions||b.apiSettings},show:function(){return!w.is.disabled()&&(w.has.items()||w.has.message())},useAPI:function(){return n.fn.api!==r}},animate:{show:function(t,i){var f,u=i||nt,e=i?function(){}:function(){w.hideSubMenus();w.hideOthers();w.set.active()};t=n.isFunction(t)?t:function(){};w.verbose("Doing menu show animation",u);w.set.direction(i);f=w.get.transition(i);w.is.selection()&&w.set.scrollPosition(w.get.selectedItem(),!0);(w.is.hidden(u)||w.is.animating(u))&&("none"==f?(e(),u.transition("show"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:f+" in",debug:b.debug,verbose:b.verbose,duration:b.duration,queue:!0,onStart:e,onComplete:function(){t.call(ot)}}):w.error(vt.noTransition,f))},hide:function(t,i){var u=i||nt,f=(i?b.duration:b.duration,i?function(){}:function(){w.can.click()&&w.unbind.intent();w.remove.active()}),e=w.get.transition(i);t=n.isFunction(t)?t:function(){};(w.is.visible(u)||w.is.animating(u))&&(w.verbose("Doing menu hide animation",u),"none"==e?(f(),u.transition("hide"),t.call(ot)):n.fn.transition!==r&&g.transition("is supported")?u.transition({animation:e+" out",duration:b.duration,debug:b.debug,verbose:b.verbose,queue:!1,onStart:f,onComplete:function(){t.call(ot)}}):w.error(vt.transition))}},hideAndClear:function(){w.remove.searchTerm();w.has.maxSelections()||(w.has.search()?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,b.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.hide,b.delay.hide)}},escape:{value:function(t){var i=n.isArray(t),r="string"==typeof t,f=!r&&!i,e=r&&-1!==t.search(ni.quote),u=[];return f||!e?t:(w.debug("Encoding quote values for use in select",t),i?(n.each(t,function(n,t){u.push(t.replace(ni.quote,"&quot;"))}),u):t.replace(ni.quote,"&quot;"))},string:function(n){return(n=String(n)).replace(ni.escape,"\\$&")}},setting:function(t,i){if(w.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else{if(i===r)return w[t];w[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,b.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),w.verbose.apply(console,arguments)))},error:function(){b.silent||(w.error=Function.prototype.bind.call(console.error,console,b.name+":"),w.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ot,"Execution Time":i}));clearTimeout(w.performance.timer);w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(w.performance.timer);n.each(s,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";l&&(t+=" '"+l+"'");(console.group!==r||console.table!==r)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):n.each(s,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());s=[]}},invoke:function(t,i,u){var h,o,s,e=pt;return i=i||y,u=ot||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(w.error(vt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};v?(pt===r&&w.initialize(),w.invoke(a)):(pt!==r&&pt.invoke("destroy"),w.initialize())}),f!==r?f:e};n.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(){},onAdd:function(){},onRemove:function(){},onLabelSelect:function(){},onLabelCreate:function(){return n(this)},onLabelRemove:function(){return!0},onNoResults:function(){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>"},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"},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",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:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",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"}};n.fn.dropdown.settings.templates={dropdown:function(t){var r=t.placeholder||!1,i=(t.values,"");return i+='<i class="dropdown icon"><\/i>',i+=t.placeholder?'<div class="default text">'+r+"<\/div>":'<div class="text"><\/div>',i+='<div class="menu">',n.each(t.values,function(n,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"<\/div>":'<div class="item" data-value="'+t.value+'">'+t.name+"<\/div>"}),i+="<\/div>"},menu:function(t,i){var u=t[i.values]||{},r="";return n.each(u,function(n,t){var u=t[i.text]?'data-text="'+t[i.text]+'"':"",f=t[i.disabled]?"disabled ":"";r+='<div class="'+f+'item" data-value="'+t[i.value]+'"'+u+">";r+=t[i.name];r+="<\/div>"}),r},label:function(n,t){return t+'<i class="delete icon"><\/i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.embed=function(i){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c="string"==typeof h,l=[].slice.call(arguments,1);return e.each(function(){var a,v=n.isPlainObject(i)?n.extend(!0,{},n.fn.embed.settings,i):n.extend({},n.fn.embed.settings),b=v.selector,nt=v.className,w=v.sources,rt=v.error,p=v.metadata,ut=v.namespace,ft=v.templates,tt="."+ut,it="module-"+ut,y=(n(t),n(this)),k=(y.find(b.placeholder),y.find(b.icon),y.find(b.embed)),d=this,g=y.data(it);a={initialize:function(){a.debug("Initializing embed");a.determine.autoplay();a.create();a.bind.events();a.instantiate()},instantiate:function(){a.verbose("Storing instance of module",a);g=a;y.data(it,a)},destroy:function(){a.verbose("Destroying previous instance of embed");a.reset();y.removeData(it).off(tt)},refresh:function(){a.verbose("Refreshing selector cache");y.find(b.placeholder);y.find(b.icon);k=y.find(b.embed)},bind:{events:function(){a.has.placeholder()&&(a.debug("Adding placeholder events"),y.on("click"+tt,b.placeholder,a.createAndShow).on("click"+tt,b.icon,a.createAndShow))}},create:function(){a.get.placeholder()?a.createPlaceholder():a.createAndShow()},createPlaceholder:function(n){var t=a.get.icon(),i=a.get.url();a.generate.embed(i);n=n||a.get.placeholder();y.html(ft.placeholder(n,t));a.debug("Creating placeholder for embed",n,t)},createEmbed:function(t){a.refresh();t=t||a.get.url();k=n("<div/>").addClass(nt.embed).html(a.generate.embed(t)).appendTo(y);v.onCreate.call(d,t);a.debug("Creating embed object",k)},changeEmbed:function(n){k.html(a.generate.embed(n))},createAndShow:function(){a.createEmbed();a.show()},change:function(n,t,i){a.debug("Changing video to ",n,t,i);y.data(p.source,n).data(p.id,t);i?y.data(p.url,i):y.removeData(p.url);a.has.embed()?a.changeEmbed():a.create()},reset:function(){a.debug("Clearing embed and showing placeholder");a.remove.active();a.remove.embed();a.showPlaceholder();v.onReset.call(d)},show:function(){a.debug("Showing embed");a.set.active();v.onDisplay.call(d)},hide:function(){a.debug("Hiding embed");a.showPlaceholder()},showPlaceholder:function(){a.debug("Showing placeholder image");a.remove.active();v.onPlaceholderDisplay.call(d)},get:{id:function(){return v.id||y.data(p.id)},placeholder:function(){return v.placeholder||y.data(p.placeholder)},icon:function(){return v.icon?v.icon:y.data(p.icon)!==r?y.data(p.icon):a.determine.icon()},source:function(){return v.source?v.source:y.data(p.source)!==r?y.data(p.source):a.determine.source()},type:function(){var n=a.get.source();return w[n]!==r&&w[n].type},url:function(){return v.url?v.url:y.data(p.url)!==r?y.data(p.url):a.determine.url()}},determine:{autoplay:function(){a.should.autoplay()&&(v.autoplay=!0)},source:function(t){var i=!1;return(t=t||a.get.url())&&n.each(w,function(n,r){if(-1!==t.search(r.domain))return i=n,!1}),i},icon:function(){var n=a.get.source();return w[n]!==r&&w[n].icon},url:function(){var n,i=v.id||y.data(p.id),t=v.source||y.data(p.source);return(n=w[t]!==r&&w[t].url.replace("{id}",i))&&y.data(p.url,n),n}},set:{active:function(){y.addClass(nt.active)}},remove:{active:function(){y.removeClass(nt.active)},embed:function(){k.empty()}},encode:{parameters:function(n){var t,i=[];for(t in n)i.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return i.join("&amp;")}},generate:{embed:function(n){a.debug("Generating embed html");var t,i,r=a.get.source();return(n=a.get.url(n))?(i=a.generate.parameters(r),t=ft.iframe(n,i)):a.error(rt.noURL,y),t},parameters:function(t,i){var u=w[t]&&w[t].parameters!==r?w[t].parameters(v):{};return(i=i||v.parameters)&&(u=n.extend({},u,i)),u=v.onEmbed(u),a.encode.parameters(u)}},has:{embed:function(){return k.length>0},placeholder:function(){return v.placeholder||y.data(p.placeholder)}},should:{autoplay:function(){return"auto"===v.autoplay?v.placeholder||y.data(p.placeholder)!==r:v.autoplay}},is:{video:function(){return"video"==a.get.type()}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else{if(i===r)return a[t];a[t]=i}},debug:function(){!v.silent&&v.debug&&(v.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,v.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),a.verbose.apply(console,arguments)))},error:function(){v.silent||(a.error=Function.prototype.bind.call(console.error,console,v.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i;v.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=g;return i=i||l,f=d||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(a.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(g===r&&a.initialize(),a.invoke(h)):(g!==r&&g.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(){},onEmbed:function(n){return n},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(n){return{autohide:!n.brandedUI,autoplay:n.autoplay,color:n.color||r,hq:n.hd,jsapi:n.api,modestbranding:!n.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(n){return{api:n.api,autoplay:n.autoplay,byline:n.brandedUI,color:n.color||r,portrait:n.brandedUI,title:n.brandedUI}}}},templates:{iframe:function(n,t){var i=n;return t&&(i+="?"+t),'<iframe src="'+i+'" width="100%" height="100%" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>'},placeholder:function(n,t){var i="";return t&&(i+='<i class="'+t+' icon"><\/i>'),n&&(i+='<img class="placeholder" src="'+n+'">'),i}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.form=function(t){var u,e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c=arguments[1],l="string"==typeof h,a=[].slice.call(arguments,1);return e.each(function(){var k,nt,ht,ct,y,w,tt,p,g,lt,ot,st,ft,d,it,v,b=n(this),rt=this,ut=[],et=!1;(v={initialize:function(){v.get.settings();l?(it===r&&v.instantiate(),v.invoke(h)):(it!==r&&it.invoke("destroy"),v.verbose("Initializing form validation",b,y),v.bindEvents(),v.set.defaults(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);it=v;b.data(ft,v)},destroy:function(){v.verbose("Destroying previous module",it);v.removeEvents();b.removeData(ft)},refresh:function(){v.verbose("Refreshing selector cache");k=b.find(p.field);nt=b.find(p.group);ht=b.find(p.message);b.find(p.prompt);ct=b.find(p.submit);b.find(p.clear);b.find(p.reset)},submit:function(){v.verbose("Submitting form",b);b.submit()},attachEvents:function(t,i){i=i||"submit";n(t).on("click"+d,function(n){v[i]();n.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events");b.on("submit"+d,v.validate.form).on("blur"+d,p.field,v.event.field.blur).on("click"+d,p.submit,v.submit).on("click"+d,p.reset,v.reset).on("click"+d,p.clear,v.clear);y.keyboardShortcuts&&b.on("keydown"+d,p.field,v.event.field.keydown);k.each(function(){var t=n(this),i=t.prop("type"),r=v.get.changeEvent(i,t);n(this).on(r+d,v.event.field.change)})},clear:function(){k.each(function(){var t=n(this),i=t.parent(),r=t.closest(nt),f=r.find(p.prompt),u=t.data(tt.defaultValue)||"",e=i.is(p.uiCheckbox),o=i.is(p.uiDropdown);r.hasClass(g.error)&&(v.verbose("Resetting error on field",r),r.removeClass(g.error),f.remove());o?(v.verbose("Resetting dropdown value",i,u),i.dropdown("clear")):e?t.prop("checked",!1):(v.verbose("Resetting field value",t,u),t.val(""))})},reset:function(){k.each(function(){var t=n(this),u=t.parent(),f=t.closest(nt),e=f.find(p.prompt),i=t.data(tt.defaultValue),o=u.is(p.uiCheckbox),s=u.is(p.uiDropdown),h=f.hasClass(g.error);i!==r&&(h&&(v.verbose("Resetting error on field",f),f.removeClass(g.error),e.remove()),s?(v.verbose("Resetting dropdown value",u,i),u.dropdown("restore defaults")):o?(v.verbose("Resetting checkbox value",u,i),t.prop("checked",i)):(v.verbose("Resetting field value",t,i),t.val(i)))})},determine:{isValid:function(){var t=!0;return n.each(w,function(n,i){v.validate.field(i,n,!0)||(t=!1)}),t}},is:{bracketedRule:function(n){return n.type&&n.type.match(y.regExp.bracket)},shorthandFields:function(n){var t=n[Object.keys(n)[0]];return v.is.shorthandRules(t)},shorthandRules:function(t){return"string"==typeof t||n.isArray(t)},empty:function(n){return!n||0===n.length||(n.is('input[type="checkbox"]')?!n.is(":checked"):v.is.blank(n))},blank:function(t){return""===n.trim(t.val())},valid:function(t){var i=!0;return t?(v.verbose("Checking if field is valid",t),v.validate.field(w[t],t,!1)):(v.verbose("Checking if form is valid"),n.each(w,function(n){v.is.valid(n)||(i=!1)}),i)}},removeEvents:function(){b.off(d);k.off(d);ct.off(d);k.off(d)},event:{field:{keydown:function(t){var i=n(this),r=t.which,u=i.is(p.input),f=i.is(p.checkbox),e=i.closest(p.uiDropdown).length>0;r==27&&(v.verbose("Escape key pressed blurring field"),i.blur());t.ctrlKey||r!=13||!u||e||f||(et||(i.one("keyup"+d,v.event.field.keyup),v.submit(),v.debug("Enter pressed on input submitting form")),et=!0)},keyup:function(){et=!1},blur:function(){var i=n(this),r=i.closest(nt),t=v.get.validation(i);r.hasClass(g.error)?(v.debug("Revalidating field",i,t),t&&v.validate.field(t)):"blur"==y.on&&t&&v.validate.field(t)},change:function(){var t=n(this),r=t.closest(nt),i=v.get.validation(t);i&&("change"==y.on||r.hasClass(g.error)&&y.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,v.get.validation(t));v.validate.field(i)},y.delay))}}},get:{ancillaryValue:function(n){return!(!n.type||!n.value&&!v.is.bracketedRule(n))&&(n.value!==r?n.value:n.type.match(y.regExp.bracket)[1]+"")},ruleName:function(n){return v.is.bracketedRule(n)?n.type.replace(n.type.match(y.regExp.bracket)[0],""):n.type},changeEvent:function(n,t){return"checkbox"==n||"radio"==n||"hidden"==n||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return i.createElement("input").oninput!==r?"input":i.createElement("input").onpropertychange!==r?"propertychange":"keyup"},fieldsFromShorthand:function(t){var i={};return n.each(t,function(t,r){"string"==typeof r&&(r=[r]);i[t]={rules:[]};n.each(r,function(n,r){i[t].rules.push({type:r})})}),i},prompt:function(t,i){var f,e,o=v.get.ruleName(t),s=v.get.ancillaryValue(t),u=v.get.field(i.identifier),h=u.val(),r=n.isFunction(t.prompt)?t.prompt(h):t.prompt||y.prompt[o]||y.text.unspecifiedRule,c=-1!==r.search("{value}"),l=-1!==r.search("{name}");return c&&(r=r.replace("{value}",u.val())),l&&(e=1==(f=u.closest(p.group).find("label").eq(0)).length?f.text():u.prop("placeholder")||y.text.unspecifiedField,r=r.replace("{name}",e)),r=(r=r.replace("{identifier}",i.identifier)).replace("{ruleValue}",s),t.prompt||v.verbose("Using default validation prompt for type",r,o),r},settings:function(){if(n.isPlainObject(t)){var i=Object.keys(t);i.length>0&&t[i[0]].identifier!==r&&t[i[0]].rules!==r?(y=n.extend(!0,{},n.fn.form.settings,c),w=n.extend({},n.fn.form.settings.defaults,t),v.error(y.error.oldSyntax,rt),v.verbose("Extending settings from legacy parameters",w,y)):(t.fields&&v.is.shorthandFields(t.fields)&&(t.fields=v.get.fieldsFromShorthand(t.fields)),y=n.extend(!0,{},n.fn.form.settings,t),w=n.extend({},n.fn.form.settings.defaults,y.fields),v.verbose("Extending settings",w,y))}else y=n.fn.form.settings,w=n.fn.form.settings.defaults,v.verbose("Using default form validation",w,y);st=y.namespace;tt=y.metadata;p=y.selector;g=y.className;lt=y.regExp;ot=y.error;ft="module-"+st;d="."+st;it=b.data(ft);v.refresh()},field:function(t){return v.verbose("Finding field with identifier",t),t=v.escape.string(t),k.filter("#"+t).length>0?k.filter("#"+t):k.filter('[name="'+t+'"]').length>0?k.filter('[name="'+t+'"]'):k.filter('[name="'+t+'[]"]').length>0?k.filter('[name="'+t+'[]"]'):k.filter("[data-"+tt.validate+'="'+t+'"]').length>0?k.filter("[data-"+tt.validate+'="'+t+'"]'):n("<input/>")},fields:function(t){var i=n();return n.each(t,function(n,t){i=i.add(v.get.field(t))}),i},validation:function(t){var r,i;return!!w&&(n.each(w,function(n,u){i=u.identifier||n;v.get.field(i)[0]==t[0]&&(u.identifier=i,r=u)}),r||!1)},value:function(n){var t=[];return t.push(n),v.get.values.call(rt,t)[n]},values:function(t){var i={};return(n.isArray(t)?v.get.fields(t):k).each(function(t,u){var e=n(u),f=(e.prop("type"),e.prop("name")),o=e.val(),s=e.is(p.checkbox),c=e.is(p.radio),l=-1!==f.indexOf("[]"),h=!!s&&e.is(":checked");f&&(l?(f=f.replace("[]",""),i[f]||(i[f]=[]),s?h?i[f].push(o||!0):i[f].push(!1):i[f].push(o)):c?i[f]!==r&&0!=i[f]||(i[f]=!!h&&(o||!0)):i[f]=s?!!h&&(o||!0):o)}),i}},has:{field:function(n){return v.verbose("Checking for existence of a field with identifier",n),"string"!=typeof(n=v.escape.string(n))&&v.error(ot.identifier,n),k.filter("#"+n).length>0||k.filter('[name="'+n+'"]').length>0||k.filter("[data-"+tt.validate+'="'+n+'"]').length>0}},escape:{string:function(n){return(n=String(n)).replace(lt.escape,"\\$&")}},add:{rule:function(n,t){v.add.field(n,t)},field:function(t,i){var r={};v.is.shorthandRules(i)?(i=n.isArray(i)?i:[i],r[t]={rules:[]},n.each(i,function(n,i){r[t].rules.push({type:i})})):r[t]=i;w=n.extend({},w,r);v.debug("Adding rules",r,w)},fields:function(t){var i;i=t&&v.is.shorthandFields(t)?v.get.fieldsFromShorthand(t):t;w=n.extend({},w,i)},prompt:function(t,i){var f=v.get.field(t).closest(nt),u=f.children(p.prompt),e=0!==u.length;i="string"==typeof i?[i]:i;v.verbose("Adding field error state",t);f.addClass(g.error);y.inline&&(e||(u=y.templates.prompt(i)).appendTo(f),u.html(i[0]),e?v.verbose("Inline errors are disabled, no inline error added",t):y.transition&&n.fn.transition!==r&&b.transition("is supported")?(v.verbose("Displaying error with css transition",y.transition),u.transition(y.transition+" in",y.duration)):(v.verbose("Displaying error with fallback javascript animation"),u.fadeIn(y.duration)))},errors:function(n){v.debug("Adding form error messages",n);v.set.error();ht.html(y.templates.error(n))}},remove:{rule:function(t,i){var u=n.isArray(i)?i:[i];if(i==r)return v.debug("Removed all rules"),void(w[t].rules=[]);w[t]!=r&&n.isArray(w[t].rules)&&n.each(w[t].rules,function(n,i){-1!==u.indexOf(i.type)&&(v.debug("Removed rule",i.type),w[t].rules.splice(n,1))})},field:function(t){var i=n.isArray(t)?t:[t];n.each(i,function(n,t){v.remove.rule(t)})},rules:function(t,i){n.isArray(t)?n.each(fields,function(n,t){v.remove.rule(t,i)}):v.remove.rule(t,i)},fields:function(n){v.remove.field(n)},prompt:function(t){var u=v.get.field(t).closest(nt),i=u.children(p.prompt);u.removeClass(g.error);y.inline&&i.is(":visible")&&(v.verbose("Removing prompt for field",t),y.transition&&n.fn.transition!==r&&b.transition("is supported")?i.transition(y.transition+" out",y.duration,function(){i.remove()}):i.fadeOut(y.duration,function(){i.remove()}))}},set:{success:function(){b.removeClass(g.error).addClass(g.success)},defaults:function(){k.each(function(){var t=n(this),i=t.filter(p.checkbox).length>0?t.is(":checked"):t.val();t.data(tt.defaultValue,i)})},error:function(){b.removeClass(g.success).addClass(g.error)},value:function(n,t){var i={};return i[n]=t,v.set.values.call(rt,i)},values:function(t){n.isEmptyObject(t)||n.each(t,function(t,i){var f,u=v.get.field(t),r=u.parent(),o=n.isArray(i),e=r.is(p.uiCheckbox),s=r.is(p.uiDropdown),h=u.is(p.radio)&&e;u.length>0&&(o&&e?(v.verbose("Selecting multiple",i,u),r.checkbox("uncheck"),n.each(i,function(n,t){f=u.filter('[value="'+t+'"]');r=f.parent();f.length>0&&r.checkbox("check")})):h?(v.verbose("Selecting radio value",i,u),u.filter('[value="'+i+'"]').parent(p.uiCheckbox).checkbox("check")):e?(v.verbose("Setting checkbox value",i,r),!0===i?r.checkbox("check"):r.checkbox("uncheck")):s?(v.verbose("Setting dropdown value",i,r),r.dropdown("set selected",i)):(v.verbose("Setting field value",i,u),u.val(i)))})}},validate:{form:function(n,t){var i=v.get.values();if(et)return!1;if(ut=[],v.determine.isValid()){if(v.debug("Form has no validation errors, submitting"),v.set.success(),!0!==t)return y.onSuccess.call(rt,n,i)}else if(v.debug("Form has errors"),v.set.error(),y.inline||v.add.errors(ut),b.data("moduleApi")!==r&&n.stopImmediatePropagation(),!0!==t)return y.onFailure.call(rt,ut,i)},field:function(t,i,u){u=u===r||u;"string"==typeof t&&(v.verbose("Validating field",t),i=t,t=w[t]);var f=t.identifier||i,s=v.get.field(f),h=!!t.depends&&v.get.field(t.depends),e=!0,o=[];return t.identifier||(v.debug("Using field name as identifier",f),t.identifier=f),s.prop("disabled")?(v.debug("Field is disabled. Skipping",f),e=!0):t.optional&&v.is.blank(s)?(v.debug("Field is optional and blank. Skipping",f),e=!0):t.depends&&v.is.empty(h)?(v.debug("Field depends on another value that is not present or empty. Skipping",h),e=!0):t.rules!==r&&n.each(t.rules,function(n,i){v.has.field(f)&&!v.validate.rule(t,i)&&(v.debug("Field is invalid",f,i.type),o.push(v.get.prompt(i,t)),e=!1)}),e?(u&&(v.remove.prompt(f,o),y.onValid.call(s)),!0):(u&&(ut=ut.concat(o),v.add.prompt(f,o),y.onInvalid.call(s,o)),!1)},rule:function(t,i){var f=v.get.field(t.identifier),u=(i.type,f.val()),s=v.get.ancillaryValue(i),e=v.get.ruleName(i),o=y.rules[e];if(n.isFunction(o))return u=u===r||""===u||null===u?"":n.trim(u+""),o.call(f,u,s);v.error(ot.noRule,e)}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else{if(i===r)return v[t];v[t]=i}},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i;y.performance&&(i=(t=(new Date).getTime())-(o||t),o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:rt,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var h,o,s,e=it;return i=i||a,f=rt||f,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}}).initialize()}),u!==r?u:this};n.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:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain  "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},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:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(t){var i='<ul class="list">';return n.each(t,function(n,t){i+="<li>"+t+"<\/li>"}),n(i+="<\/ul>")},prompt:function(t){return n("<div/>").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(t===r||""===t||n.isArray(t)&&0===t.length)},checked:function(){return n(this).filter(":checked").length>0},email:function(t){return n.fn.form.settings.regExp.email.test(t)},url:function(t){return n.fn.form.settings.regExp.url.test(t)},regExp:function(t,i){if(i instanceof RegExp)return t.match(i);var u,r=i.match(n.fn.form.settings.regExp.flags);return r&&(i=r.length>=2?r[1]:i,u=r.length>=3?r[2]:""),t.match(new RegExp(i,u))},integer:function(t,i){var f,e,u,o=n.fn.form.settings.regExp.integer;return i&&-1===["",".."].indexOf(i)&&(-1==i.indexOf("..")?o.test(i)&&(f=e=+i):(u=i.split("..",2),o.test(u[0])&&(f=u[0]-0),o.test(u[1])&&(e=u[1]-0))),o.test(t)&&(f===r||t>=f)&&(e===r||t<=e)},decimal:function(t){return n.fn.form.settings.regExp.decimal.test(t)},number:function(t){return n.fn.form.settings.regExp.number.test(t)},is:function(n,t){return t="string"==typeof t?t.toLowerCase():t,(n="string"==typeof n?n.toLowerCase():n)==t},isExactly:function(n,t){return n==t},not:function(n,t){return(n="string"==typeof n?n.toLowerCase():n)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(n,t){return n!=t},contains:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i,"i"))},containsExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(i))},doesntContain:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i,"i"))},doesntContainExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(i))},minLength:function(n,t){return n!==r&&n.length>=t},length:function(n,t){return n!==r&&n.length>=t},exactLength:function(n,t){return n!==r&&n.length==t},maxLength:function(n,t){return n!==r&&n.length<=t},match:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r&&t.toString()==u.toString()},different:function(t,i){var u;return n(this),n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r&&t.toString()!==u.toString()},creditCard:function(t,i){var e,r,u={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},o={},s=!1,h="string"==typeof i&&i.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),h&&(n.each(h,function(i,f){(r=u[f])&&(o={length:-1!==n.inArray(t.length,r.length),pattern:-1!==t.search(r.pattern)}).length&&o.pattern&&(s=!0)}),!s))return!1;if((e={number:-1!==n.inArray(t.length,u.unionPay.length),pattern:-1!==t.search(u.unionPay.pattern)}).number&&e.pattern)return!0;for(var c=t.length,l=0,a=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=a[l][parseInt(t.charAt(c),10)],l^=1;return f%10==0&&f>0}},minCount:function(n,t){return 0==t||(1==t?""!==n:n.split(",").length>=t)},exactCount:function(n,t){return 0==t?""===n:1==t?""!==n&&-1===n.search(","):n.split(",").length==t},maxCount:function(n,t){return 0!=t&&(1==t?-1===n.search(","):n.split(",").length<=t)}}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.modal=function(u){var f,h=n(this),c=n(t),l=n(i),o=n("body"),a=h.selector||"",s=(new Date).getTime(),e=[],v=arguments[0],y="string"==typeof v,p=[].slice.call(arguments,1),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return h.each(function(){var vt,rt,ht,g,it,ut,lt,yt,h,b=n.isPlainObject(u)?n.extend(!0,{},n.fn.modal.settings,u):n.extend({},n.fn.modal.settings),ft=b.selector,d=b.className,pt=b.namespace,st=b.error,nt="."+pt,at="module-"+pt,k=n(this),ct=n(b.context),wt=k.find(ft.close),tt=this,et=k.data(at),ot=!1;h={initialize:function(){h.verbose("Initializing dimmer",ct);h.create.id();h.create.dimmer();h.refreshModals();h.bind.events();b.observeChanges&&h.observeChanges();h.instantiate()},instantiate:function(){h.verbose("Storing instance of modal");et=h;k.data(at,et)},create:{dimmer:function(){var t={debug:b.debug,variation:!b.centered&&"top aligned",dimmerName:"modals"},i=n.extend(!0,t,b.dimmerSettings);n.fn.dimmer!==r?(h.debug("Creating dimmer"),g=ct.dimmer(i),b.detachable?(h.verbose("Modal is detachable, moving content into dimmer"),g.dimmer("add content",k)):h.set.undetached(),it=g.dimmer("get dimmer")):h.error(st.dimmer)},id:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);ut="."+lt;h.verbose("Creating unique id for element",lt)}},destroy:function(){h.verbose("Destroying previous modal");k.removeData(at).off(nt);c.off(ut);it.off(ut);wt.off(nt);ct.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&((yt=new MutationObserver(function(){h.debug("DOM tree modified, refreshing");h.refresh()})).observe(tt,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",yt))},refresh:function(){h.remove.scrolling();h.cacheSizes();h.set.screenHeight();h.set.type()},refreshModals:function(){rt=k.siblings(ft.modal);vt=rt.add(k)},attachEvents:function(t,i){var r=n(t);i=n.isFunction(h[i])?h[i]:h.toggle;r.length>0?(h.debug("Attaching modal events to element",t,i),r.off(nt).on("click"+nt,i)):h.error(st.notFound,t)},bind:{events:function(){h.verbose("Attaching events");k.on("click"+nt,ft.close,h.event.close).on("click"+nt,ft.approve,h.event.approve).on("click"+nt,ft.deny,h.event.deny);c.on("resize"+ut,h.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){ot||!1===b.onApprove.call(tt,n(this))?h.verbose("Approve callback returned false cancelling hide"):(ot=!0,h.hide(function(){ot=!1}))},deny:function(){ot||!1===b.onDeny.call(tt,n(this))?h.verbose("Deny callback returned false cancelling hide"):(ot=!0,h.hide(function(){ot=!1}))},close:function(){h.hide()},click:function(t){if(b.closable){var r=n(t.target).closest(ft.modal).length>0,u=n.contains(i.documentElement,t.target);!r&&u&&h.is.active()&&(h.debug("Dimmer clicked, hiding all modals"),h.remove.clickaway(),b.allowMultiple?h.hide():h.hideAll())}else h.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(n,t){clearTimeout(h.timer);h.timer=setTimeout(n,t)},keyboard:function(n){27==n.which&&(b.closable?(h.debug("Escape key pressed hiding modal"),h.hide()):h.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){g.dimmer("is active")&&(h.is.animating()||h.is.active())&&w(h.refresh)}},toggle:function(){h.is.active()||h.is.animating()?h.hide():h.show()},show:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.set.dimmerSettings();h.showModal(t)},hide:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){};h.is.animating()||!h.is.active()?(h.showDimmer(),h.cacheSizes(),h.set.screenHeight(),h.set.type(),h.set.clickaway(),!b.allowMultiple&&h.others.active()?h.hideOthers(h.showModal):(b.allowMultiple&&b.detachable&&k.detach().appendTo(it),b.onShow.call(tt),b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.debug("Showing modal with css animations"),k.transition({debug:b.debug,animation:b.transition+" in",queue:b.queue,duration:b.duration,useFailSafe:!0,onComplete:function(){b.onVisible.apply(tt);b.keyboardShortcuts&&h.add.keyboardShortcuts();h.save.focus();h.set.active();b.autofocus&&h.set.autofocus();t()}})):h.error(st.noTransition))):h.debug("Modal is already visible")},hideModal:function(t,i){t=n.isFunction(t)?t:function(){};h.debug("Hiding modal");!1!==b.onHide.call(tt,n(this))?(h.is.animating()||h.is.active())&&(b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.remove.active(),k.transition({debug:b.debug,animation:b.transition+" out",queue:b.queue,duration:b.duration,useFailSafe:!0,onStart:function(){h.others.active()||i||h.hideDimmer();b.keyboardShortcuts&&h.remove.keyboardShortcuts()},onComplete:function(){b.onHidden.call(tt);h.restore.focus();t()}})):h.error(st.noTransition)):h.verbose("Hide callback returned false cancelling hide")},showDimmer:function(){g.dimmer("is animating")||!g.dimmer("is active")?(h.debug("Showing dimmer"),g.dimmer("show")):h.debug("Dimmer already visible")},hideDimmer:function(){g.dimmer("is animating")||g.dimmer("is active")?g.dimmer("hide",function(){h.remove.clickaway();h.remove.screenHeight()}):h.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var i=vt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding all visible modals"),h.hideDimmer(),i.modal("hide modal",t))},hideOthers:function(t){var i=rt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding other modals",rt),i.modal("hide modal",t,!0))},others:{active:function(){return rt.filter("."+d.active).length>0},animating:function(){return rt.filter("."+d.animating).length>0}},add:{keyboardShortcuts:function(){h.verbose("Adding keyboard shortcuts");l.on("keyup"+nt,h.event.keyboard)}},save:{focus:function(){n(i.activeElement).closest(k).length>0||(ht=n(i.activeElement).blur())}},restore:{focus:function(){ht&&ht.length>0&&ht.focus()}},remove:{active:function(){k.removeClass(d.active)},clickaway:function(){it.off("click"+ut)},bodyStyle:function(){""===o.attr("style")&&(h.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){h.debug("Removing page height");o.css("height","")},keyboardShortcuts:function(){h.verbose("Removing keyboard shortcuts");l.off("keyup"+nt)},scrolling:function(){g.removeClass(d.scrolling);k.removeClass(d.scrolling)}},cacheSizes:function(){k.addClass(d.loading);var f=k.prop("scrollHeight"),u=k.outerHeight();h.cache!==r&&0===u||(h.cache={pageHeight:n(i).outerHeight(),height:u+b.offset,scrollHeight:f+b.offset,contextHeight:"body"==b.context?n(t).height():g.height()},h.cache.topOffset=-h.cache.height/2);k.removeClass(d.loading);h.debug("Caching modal and container sizes",h.cache)},can:{fit:function(){var n=h.cache.contextHeight,u=h.cache.contextHeight/2,f=h.cache.topOffset,t=h.cache.scrollHeight,i=h.cache.height,r=b.padding;return t>i?u+f+t+r<n:i+2*r<n}},is:{active:function(){return k.hasClass(d.active)},animating:function(){return k.transition("is supported")?k.transition("is animating"):k.is(":visible")},scrolling:function(){return g.hasClass(d.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){var n=k.find("[tabindex], :input").filter(":visible"),t=n.filter("[autofocus]"),i=t.length>0?t.first():n.first();i.length>0&&i.focus()},clickaway:function(){it.on("click"+ut,h.event.click)},dimmerSettings:function(){if(n.fn.dimmer!==r){var i={debug:b.debug,dimmerName:"modals",closable:"auto",variation:!b.centered&&"top aligned",duration:{show:b.duration,hide:b.duration}},t=n.extend(!0,i,b.dimmerSettings);b.inverted?(t.variation=t.variation!==r?t.variation+" inverted":"inverted",it.addClass(d.inverted)):it.removeClass(d.inverted);b.blurring?g.addClass(d.blurring):g.removeClass(d.blurring);ct.dimmer("setting",t)}else h.error(st.dimmer)},screenHeight:function(){h.can.fit()?o.css("height",""):(h.debug("Modal is taller than page content, resizing page height"),o.css("height",h.cache.height+2*b.padding))},active:function(){k.addClass(d.active)},scrolling:function(){g.addClass(d.scrolling);k.addClass(d.scrolling)},type:function(){h.can.fit()?(h.verbose("Modal fits on screen"),h.others.active()||h.others.animating()||h.remove.scrolling()):(h.verbose("Modal cannot fit on screen setting to scrolling"),h.set.scrolling())},undetached:function(){g.addClass(d.undetached)}},setting:function(t,i){if(h.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else{if(i===r)return b[t];n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,h,t);else{if(i===r)return h[t];h[t]=i}},debug:function(){!b.silent&&b.debug&&(b.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,b.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),h.verbose.apply(console,arguments)))},error:function(){b.silent||(h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments))},performance:{log:function(n){var t,i;b.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(h.performance.timer);h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",i=0;s=!1;clearTimeout(h.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=et;return i=i||p,u=tt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(et===r&&h.initialize(),h.invoke(v)):(et!==r&&et.invoke("destroy"),h.initialize())}),f!==r?f:this};n.fn.modal.settings={name:"Modal",namespace:"modal",silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",loading:"loading",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.popup=function(u){var f,l=n(this),s=n(i),o=n(t),h=n("body"),a=l.selector||"",c=(new Date).getTime(),e=[],v=arguments[0],y="string"==typeof v,p=[].slice.call(arguments,1);return l.each(function(){var b,it,ht,rt,ct,l,w=n.isPlainObject(u)?n.extend(!0,{},n.fn.popup.settings,u):n.extend({},n.fn.popup.settings),ot=w.selector,g=w.className,st=w.error,nt=w.metadata,bt=w.namespace,ut="."+w.namespace,vt="module-"+bt,k=n(this),pt=n(w.context),wt=n(w.scrollContext),lt=n(w.boundary),tt=w.target?n(w.target):k,at=0,ft=!1,yt=!1,d=this,et=k.data(vt);l={initialize:function(){l.debug("Initializing",k);l.createID();l.bind.events();!l.exists()&&w.preserve&&l.create();w.observeChanges&&l.observeChanges();l.instantiate()},instantiate:function(){l.verbose("Storing instance",l);et=l;k.data(vt,et)},observeChanges:function(){"MutationObserver"in t&&((ht=new MutationObserver(l.event.documentChanged)).observe(i,{childList:!0,subtree:!0}),l.debug("Setting up mutation observer",ht))},refresh:function(){w.popup?b=n(w.popup).eq(0):w.inline&&(b=tt.nextAll(ot.popup).eq(0),w.popup=b);w.popup?(b.addClass(g.loading),it=l.get.offsetParent(),b.removeClass(g.loading),w.movePopup&&l.has.popup()&&l.get.offsetParent(b)[0]!==it[0]&&(l.debug("Moving popup to the same offset parent as target"),b.detach().appendTo(it))):it=w.inline?l.get.offsetParent(tt):l.has.popup()?l.get.offsetParent(b):h;it.is("html")&&it[0]!==h[0]&&(l.debug("Setting page as offset parent"),it=h);l.get.variation()&&l.set.variation()},reposition:function(){l.refresh();l.set.position()},destroy:function(){l.debug("Destroying previous module");ht&&ht.disconnect();b&&!w.preserve&&l.removePopup();clearTimeout(l.hideTimer);clearTimeout(l.showTimer);l.unbind.close();l.unbind.events();k.removeData(vt)},event:{start:function(){var t=n.isPlainObject(w.delay)?w.delay.show:w.delay;clearTimeout(l.hideTimer);yt||(l.showTimer=setTimeout(l.show,t))},end:function(){var t=n.isPlainObject(w.delay)?w.delay.hide:w.delay;clearTimeout(l.showTimer);l.hideTimer=setTimeout(l.hide,t)},touchstart:function(){yt=!0;l.show()},resize:function(){l.is.visible()&&l.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==d||n(t).find(d).length>0)&&(l.debug("Element removed from DOM, tearing down events"),l.destroy())})})},hideGracefully:function(t){var r=n(t.target),u=n.contains(i.documentElement,t.target),f=r.closest(ot.popup).length>0;t&&!f&&u?(l.debug("Click occurred outside popup hiding popup"),l.hide()):l.debug("Click was inside popup, keeping popup open")}},create:function(){var t=l.get.html(),i=l.get.title(),r=l.get.content();t||r||i?(l.debug("Creating pop-up html"),t||(t=w.templates.popup({title:i,content:r})),b=n("<div/>").addClass(g.popup).data(nt.activator,k).html(t),w.inline?(l.verbose("Inserting popup element inline",b),b.insertAfter(k)):(l.verbose("Appending popup element to body",b),b.appendTo(pt)),l.refresh(),l.set.variation(),w.hoverable&&l.bind.popup(),w.onCreate.call(b,d)):0!==tt.next(ot.popup).length?(l.verbose("Pre-existing popup found"),w.inline=!0,w.popup=tt.next(ot.popup).data(nt.activator,k),l.refresh(),w.hoverable&&l.bind.popup()):w.popup?(n(w.popup).data(nt.activator,k),l.verbose("Used popup specified in settings"),l.refresh(),w.hoverable&&l.bind.popup()):l.debug("No content specified skipping display",d)},createID:function(){ct=(Math.random().toString(16)+"000000000").substr(2,8);rt="."+ct;l.verbose("Creating unique id for element",ct)},toggle:function(){l.debug("Toggling pop-up");l.is.hidden()?(l.debug("Popup is hidden, showing pop-up"),l.unbind.close(),l.show()):(l.debug("Popup is visible, hiding pop-up"),l.hide())},show:function(n){if(n=n||function(){},l.debug("Showing pop-up",w.transition),l.is.hidden()&&(!l.is.active()||!l.is.dropdown())){if(l.exists()||l.create(),!1===w.onShow.call(b,d))return void l.debug("onShow callback returned false, cancelling popup animation");w.preserve||w.popup||l.refresh();b&&l.set.position()&&(l.save.conditions(),w.exclusive&&l.hideAll(),l.animate.show(n))}},hide:function(n){if(n=n||function(){},l.is.visible()||l.is.animating()){if(!1===w.onHide.call(b,d))return void l.debug("onHide callback returned false, cancelling popup animation");l.remove.visible();l.unbind.close();l.restore.conditions();l.animate.hide(n)}},hideAll:function(){n(ot.popup).filter("."+g.popupVisible).each(function(){n(this).data(nt.activator).popup("hide")})},exists:function(){return!!b&&(w.inline||w.popup?l.has.popup():b.closest(pt).length>=1)},removePopup:function(){l.has.popup()&&!w.popup&&(l.debug("Removing popup",b),b.remove(),b=r,w.onRemove.call(b,d))},save:{conditions:function(){l.cache={title:k.attr("title")};l.cache.title&&k.removeAttr("title");l.verbose("Saving original attributes",l.cache.title)}},restore:{conditions:function(){return l.cache&&l.cache.title&&(k.attr("title",l.cache.title),l.verbose("Restoring original attributes",l.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};w.transition&&n.fn.transition!==r&&k.transition("is supported")?(l.set.visible(),b.transition({animation:w.transition+" in",queue:!1,debug:w.debug,verbose:w.verbose,duration:w.duration,onComplete:function(){l.bind.close();t.call(b,d);w.onVisible.call(b,d)}})):l.error(st.noTransition)},hide:function(t){t=n.isFunction(t)?t:function(){};l.debug("Hiding pop-up");!1!==w.onHide.call(b,d)?w.transition&&n.fn.transition!==r&&k.transition("is supported")?b.transition({animation:w.transition+" out",queue:!1,duration:w.duration,debug:w.debug,verbose:w.verbose,onComplete:function(){l.reset();t.call(b,d);w.onHidden.call(b,d)}}):l.error(st.noTransition):l.debug("onHide callback returned false, cancelling popup animation")}},change:{content:function(n){b.html(n)}},get:{html:function(){return k.removeData(nt.html),k.data(nt.html)||w.html},title:function(){return k.removeData(nt.title),k.data(nt.title)||w.title},content:function(){return k.removeData(nt.content),k.data(nt.content)||w.content||k.attr("title")},variation:function(){return k.removeData(nt.variation),k.data(nt.variation)||w.variation},popup:function(){return b},popupOffset:function(){return b.offset()},calculations:function(){var i,r=l.get.offsetParent(b),u=tt[0],e=lt[0]==t,s=w.inline||w.popup&&w.movePopup?tt.position():tt.offset(),h=e?{top:0,left:0}:lt.offset(),n={},c=e?{top:o.scrollTop(),left:o.scrollLeft()}:{top:0,left:0},f;return(n={target:{element:tt[0],width:tt.outerWidth(),height:tt.outerHeight(),top:s.top,left:s.left,margin:{}},popup:{width:b.outerWidth(),height:b.outerHeight()},parent:{width:it.outerWidth(),height:it.outerHeight()},screen:{top:h.top,left:h.left,scroll:{top:c.top,left:c.left},width:lt.width(),height:lt.height()}},r.get(0)!==it.get(0))&&(f=r.offset(),n.target.top-=f.top,n.target.left-=f.left,n.parent.width=r.outerWidth(),n.parent.height=r.outerHeight()),w.setFluidWidth&&l.is.fluid()&&(n.container={width:b.parent().outerWidth()},n.popup.width=n.container.width),n.target.margin.top=w.inline?parseInt(t.getComputedStyle(u).getPropertyValue("margin-top"),10):0,n.target.margin.left=w.inline?l.is.rtl()?parseInt(t.getComputedStyle(u).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(u).getPropertyValue("margin-left"),10):0,i=n.screen,n.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},n},id:function(){return ct},startEvent:function(){return"hover"==w.on?"mouseenter":"focus"==w.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==w.on?"mouseleave":"focus"==w.on&&"blur"},distanceFromBoundary:function(n,t){var r,i,u={};return r=(t=t||l.get.calculations()).popup,i=t.boundary,n&&(u={top:n.top-i.top,left:n.left-i.left,right:i.right-(n.left+r.width),bottom:i.bottom-(n.top+r.height)},l.verbose("Distance from boundaries determined",n,u)),u},offsetParent:function(t){var u=(t!==r?t[0]:tt[0]).parentNode,i=n(u);if(u)for(var f="none"===i.css("transform"),e="static"===i.css("position"),o=i.is("body");u&&!o&&e&&f;)u=u.parentNode,f="none"===(i=n(u)).css("transform"),e="static"===i.css("position"),o=i.is("body");return i&&i.length>0?i:n()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(n){var r=n.split(" "),i=r[0],u=r[1],o="top"==i||"bottom"==i,f=!1,e=!1,t=!1;return ft||(l.verbose("All available positions available"),ft=l.get.positions()),l.debug("Recording last position tried",n),ft[n]=!0,"opposite"===w.prefer&&(t=(t=[{top:"bottom",bottom:"top",left:"right",right:"left"}[i],u]).join(" "),f=!0===ft[t],l.debug("Trying opposite strategy",t)),"adjacent"===w.prefer&&o&&(t=(t=[i,{left:"center",center:"right",right:"left"}[u]]).join(" "),e=!0===ft[t],l.debug("Trying adjacent strategy",t)),(e||f)&&(l.debug("Using backup position",t),t={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[n]),t}},set:{position:function(n,t){if(0!==tt.length&&0!==b.length){var u,f,i,s,o,e,h,c;if(t=t||l.get.calculations(),n=n||k.data(nt.position)||w.position,u=k.data(nt.offset)||w.offset,f=w.distanceAway,i=t.target,s=t.popup,o=t.parent,l.should.centerArrow(t)&&(l.verbose("Adjusting offset to center arrow on small target element"),"top left"!=n&&"bottom left"!=n||(u+=i.width/2,u-=w.arrowPixelsFromEdge),"top right"!=n&&"bottom right"!=n||(u-=i.width/2,u+=w.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!l.is.svg(i.element))return l.debug("Popup target is hidden, no action taken"),!1;switch(w.inline&&(l.debug("Adding margin to calculation",i.margin),"left center"==n||"right center"==n?(u+=i.margin.top,f+=-i.margin.left):"top left"==n||"top center"==n||"top right"==n?(u+=i.margin.left,f-=i.margin.top):(u+=i.margin.left,f+=i.margin.top)),l.debug("Determining popup position from calculations",n,t),l.is.rtl()&&(n=n.replace(/left|right/g,function(n){return"left"==n?"right":"left"}),l.debug("RTL: Popup position updated",n)),at==w.maxSearchDepth&&"string"==typeof w.lastResort&&(n=w.lastResort),n){case"top left":e={top:"auto",bottom:o.height-i.top+f,left:i.left+u,right:"auto"};break;case"top center":e={bottom:o.height-i.top+f,left:i.left+i.width/2-s.width/2+u,top:"auto",right:"auto"};break;case"top right":e={bottom:o.height-i.top+f,right:o.width-i.left-i.width-u,top:"auto",left:"auto"};break;case"left center":e={top:i.top+i.height/2-s.height/2+u,right:o.width-i.left+f,left:"auto",bottom:"auto"};break;case"right center":e={top:i.top+i.height/2-s.height/2+u,left:i.left+i.width+f,bottom:"auto",right:"auto"};break;case"bottom left":e={top:i.top+i.height+f,left:i.left+u,bottom:"auto",right:"auto"};break;case"bottom center":e={top:i.top+i.height+f,left:i.left+i.width/2-s.width/2+u,bottom:"auto",right:"auto"};break;case"bottom right":e={top:i.top+i.height+f,right:o.width-i.left-i.width-u,left:"auto",bottom:"auto"}}if(e===r&&l.error(st.invalidPosition,n),l.debug("Calculated popup positioning values",e),b.css(e).removeClass(g.position).addClass(n).addClass(g.loading),h=l.get.popupOffset(),c=l.get.distanceFromBoundary(h,t),l.is.offstage(c,n)){if(l.debug("Position is outside viewport",n),at<w.maxSearchDepth)return at++,n=l.get.nextPosition(n),l.debug("Trying new position",n),!!b&&l.set.position(n,t);if(!w.lastResort)return l.debug("Popup could not find a position to display",b),l.error(st.cannotPlace,d),l.remove.attempts(),l.remove.loading(),l.reset(),w.onUnplaceable.call(b,d),!1;l.debug("No position found, showing with last position")}return l.debug("Position is on stage",n),l.remove.attempts(),l.remove.loading(),w.setFluidWidth&&l.is.fluid()&&l.set.fluidWidth(t),!0}l.error(st.notFound)},fluidWidth:function(n){n=n||l.get.calculations();l.debug("Automatically setting element width to parent width",n.parent.width);b.css("width",n.container.width)},variation:function(n){(n=n||l.get.variation())&&l.has.popup()&&(l.verbose("Adding variation to popup",n),b.addClass(n))},visible:function(){k.addClass(g.visible)}},remove:{loading:function(){b.removeClass(g.loading)},variation:function(n){(n=n||l.get.variation())&&(l.verbose("Removing variation",n),b.removeClass(n))},visible:function(){k.removeClass(g.visible)},attempts:function(){l.verbose("Resetting all searched positions");at=0;ft=!1}},bind:{events:function(){l.debug("Binding popup events to module");"click"==w.on&&k.on("click"+ut,l.toggle);"hover"==w.on&&k.on("touchstart"+ut,l.event.touchstart);l.get.startEvent()&&k.on(l.get.startEvent()+ut,l.event.start).on(l.get.endEvent()+ut,l.event.end);w.target&&l.debug("Target set to element",tt);o.on("resize"+rt,l.event.resize)},popup:function(){l.verbose("Allowing hover events on popup to prevent closing");b&&l.has.popup()&&b.on("mouseenter"+ut,l.event.start).on("mouseleave"+ut,l.event.end)},close:function(){(!0===w.hideOnScroll||"auto"==w.hideOnScroll&&"click"!=w.on)&&l.bind.closeOnScroll();"hover"==w.on&&yt&&l.bind.touchClose();"click"==w.on&&w.closable&&l.bind.clickaway()},closeOnScroll:function(){l.verbose("Binding scroll close event to document");wt.one(l.get.scrollEvent()+rt,l.event.hideGracefully)},touchClose:function(){l.verbose("Binding popup touchclose event to document");s.on("touchstart"+rt,function(n){l.verbose("Touched away from popup");l.event.hideGracefully.call(d,n)})},clickaway:function(){l.verbose("Binding popup close event to document");s.on("click"+rt,function(n){l.verbose("Clicked away from popup");l.event.hideGracefully.call(d,n)})}},unbind:{events:function(){o.off(rt);k.off(ut)},close:function(){s.off(rt);wt.off(rt)}},has:{popup:function(){return b&&b.length>0}},should:{centerArrow:function(n){return!l.is.basic()&&n.target.width<=2*w.arrowPixelsFromEdge}},is:{offstage:function(t,i){var r=[];return n.each(t,function(n,t){t<-w.jitter&&(l.debug("Position exceeds allowable distance from edge",n,t,i),r.push(n))}),r.length>0},svg:function(n){return l.supports.svg()&&n instanceof SVGGraphicsElement},basic:function(){return k.hasClass(g.basic)},active:function(){return k.hasClass(g.active)},animating:function(){return b!==r&&b.hasClass(g.animating)},fluid:function(){return b!==r&&b.hasClass(g.fluid)},visible:function(){return b!==r&&b.hasClass(g.popupVisible)},dropdown:function(){return k.hasClass(g.dropdown)},hidden:function(){return!l.is.visible()},rtl:function(){return"rtl"==k.css("direction")}},reset:function(){l.remove.visible();w.preserve?n.fn.transition!==r&&b.transition("remove transition"):l.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else{if(i===r)return w[t];w[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!w.silent&&w.debug&&(w.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,w.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!w.silent&&w.verbose&&w.debug&&(w.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),l.verbose.apply(console,arguments)))},error:function(){w.silent||(l.error=Function.prototype.bind.call(console.error,console,w.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;w.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=w.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=et;return i=i||p,u=d||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r&&(o=e[u],!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(et===r&&l.initialize(),l.invoke(v)):(et!==r&&et.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:t,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:t,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,function(n){return t[n]}):n},popup:function(t){var i="",u=n.fn.popup.settings.templates.escape;return typeof t!==r&&(typeof t.title!==r&&t.title&&(t.title=u(t.title),i+='<div class="header">'+t.title+"<\/div>"),typeof t.content!==r&&t.content&&(t.content=u(t.content),i+='<div class="content">'+t.content+"<\/div>")),i}}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.sidebar=function(u){var f,l=n(this),s=n(t),h=n(i),a=n("html"),p=n("head"),v=l.selector||"",c=(new Date).getTime(),e=[],y=arguments[0],w="string"==typeof y,b=[].slice.call(arguments,1),o=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};return l.each(function(){var et,it,lt,yt,ft,l,k=n.isPlainObject(u)?n.extend(!0,{},n.fn.sidebar.settings,u):n.extend({},n.fn.sidebar.settings),rt=k.selector,g=k.className,pt=k.namespace,at=k.regExp,st=k.error,ht="."+pt,vt="module-"+pt,d=n(this),tt=n(k.context),ot=d.children(rt.sidebar),ut=(tt.children(rt.fixed),tt.children(rt.pusher)),nt=this,ct=d.data(vt);l={initialize:function(){l.debug("Initializing sidebar",u);l.create.id();ft=l.get.transitionEvent();k.delaySetup?o(l.setup.layout):l.setup.layout();o(function(){l.setup.cache()});l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);ct=l;d.data(vt,l)},create:{id:function(){lt=(Math.random().toString(16)+"000000000").substr(2,8);it="."+lt;l.verbose("Creating unique id for element",lt)}},destroy:function(){l.verbose("Destroying previous module for",d);d.off(ht).removeData(vt);l.is.ios()&&l.remove.ios();tt.off(it);s.off(it);h.off(it)},event:{clickaway:function(n){var t=ut.find(n.target).length>0||ut.is(n.target),i=tt.is(n.target);t&&(l.verbose("User clicked on dimmed page"),l.hide());i&&(l.verbose("User clicked on dimmable context (scaled out page)"),l.hide())},touch:function(){},containScroll:function(){nt.scrollTop<=0&&(nt.scrollTop=1);nt.scrollTop+nt.offsetHeight>=nt.scrollHeight&&(nt.scrollTop=nt.scrollHeight-nt.offsetHeight-1)},scroll:function(t){0===n(t.target).closest(rt.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){l.verbose("Adding clickaway events to context",tt);k.closable&&tt.on("click"+it,l.event.clickaway).on("touchend"+it,l.event.clickaway)},scrollLock:function(){k.scrollLock&&(l.debug("Disabling page scroll"),s.on("DOMMouseScroll"+it,l.event.scroll));l.verbose("Adding events to contain sidebar scroll");h.on("touchmove"+it,l.event.touch);d.on("scroll"+ht,l.event.containScroll)}},unbind:{clickaway:function(){l.verbose("Removing clickaway events from context",tt);tt.off(it)},scrollLock:function(){l.verbose("Removing scroll lock from page");h.off(it);s.off(it);d.off("scroll"+ht)}},add:{inlineCSS:function(){var r,u=l.cache.width||d.outerWidth(),f=l.cache.height||d.outerHeight(),e=l.is.rtl(),t=l.get.direction(),i={left:u,right:-u,top:f,bottom:-f};e&&(l.verbose("RTL detected, flipping widths"),i.left=-u,i.right=u);r="<style>";"left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }");l.is.ie()&&("left"===t||"right"===t?(l.debug("Adding CSS rules for animation distance",u),r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!=t||(r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }"),r+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {   -webkit-transform: translate3d(0px, 0, 0);           transform: translate3d(0px, 0, 0); }");et=n(r+="<\/style>").appendTo(p);l.debug("Adding sizing css to head",et)}},refresh:function(){l.verbose("Refreshing selector cache");tt=n(k.context);ot=tt.children(rt.sidebar);ut=tt.children(rt.pusher);tt.children(rt.fixed);l.clear.cache()},refreshSidebars:function(){l.verbose("Refreshing other sidebars");ot=tt.children(rt.sidebar)},repaint:function(){l.verbose("Forcing repaint event");nt.style.display="none";nt.offsetHeight;nt.scrollTop=nt.scrollTop;nt.style.display=""},setup:{cache:function(){l.cache={width:d.outerWidth(),height:d.outerHeight(),rtl:"rtl"==d.css("direction")}},layout:function(){0===tt.children(rt.pusher).length&&(l.debug("Adding wrapper element for sidebar"),l.error(st.pusher),ut=n('<div class="pusher" />'),tt.children().not(rt.omitted).not(ot).wrapAll(ut),l.refresh());0!==d.nextAll(rt.pusher).length&&d.nextAll(rt.pusher)[0]===ut[0]||(l.debug("Moved sidebar to correct parent element"),l.error(st.movedSidebar,nt),d.detach().prependTo(tt),l.refresh());l.clear.cache();l.set.pushable();l.set.direction()}},attachEvents:function(t,i){var r=n(t);i=n.isFunction(l[i])?l[i]:l.toggle;r.length>0?(l.debug("Attaching sidebar events to element",t,i),r.on("click"+ht,i)):l.error(st.notFound,t)},show:function(t){if(t=n.isFunction(t)?t:function(){},l.is.hidden()){if(l.refreshSidebars(),k.overlay&&(l.error(st.overlay),k.transition="overlay"),l.refresh(),l.othersActive())if(l.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void l.hideOthers(l.show);l.hideOthers()}else k.transition="overlay";l.pushPage(function(){t.call(nt);k.onShow.call(nt)});k.onChange.call(nt);k.onVisible.call(nt)}else l.debug("Sidebar is already visible")},hide:function(t){t=n.isFunction(t)?t:function(){};(l.is.visible()||l.is.animating())&&(l.debug("Hiding sidebar",t),l.refreshSidebars(),l.pullPage(function(){t.call(nt);k.onHidden.call(nt)}),k.onChange.call(nt),k.onHide.call(nt))},othersAnimating:function(){return ot.not(d).filter("."+g.animating).length>0},othersVisible:function(){return ot.not(d).filter("."+g.visible).length>0},othersActive:function(){return l.othersVisible()||l.othersAnimating()},hideOthers:function(n){var t=ot.not(d).filter("."+g.visible),i=t.length,r=0;n=n||function(){};t.sidebar("hide",function(){++r==i&&n()})},toggle:function(){l.verbose("Determining toggled direction");l.is.hidden()?l.show():l.hide()},pushPage:function(t){var u,f,r,e=l.get.transition(),i="overlay"===e||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};"scale down"==k.transition&&l.scrollToTop();l.set.transition(e);l.repaint();u=function(){l.bind.clickaway();l.add.inlineCSS();l.set.animating();l.set.visible()};f=function(){l.set.dimmed()};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.bind.scrollLock(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(u);k.dimPage&&!l.othersVisible()&&o(f)},pullPage:function(t){var f,r,u=l.get.transition(),i="overlay"==u||l.othersActive()?d:ut;t=n.isFunction(t)?t:function(){};l.verbose("Removing context push state",l.get.direction());l.unbind.clickaway();l.unbind.scrollLock();f=function(){l.set.transition(u);l.set.animating();l.remove.visible();k.dimPage&&!l.othersVisible()&&ut.removeClass(g.dimmed)};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.remove.transition(),l.remove.inlineCSS(),("scale down"==u||k.returnScroll&&l.is.mobile())&&l.scrollBack(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(f)},scrollToTop:function(){l.verbose("Scrolling to top of page to avoid animation issues");yt=n(t).scrollTop();d.scrollTop(0);t.scrollTo(0,0)},scrollBack:function(){l.verbose("Scrolling back to original page position");t.scrollTo(0,yt)},clear:{cache:function(){l.verbose("Clearing cached dimensions");l.cache={}}},set:{ios:function(){a.addClass(g.ios)},pushed:function(){tt.addClass(g.pushed)},pushable:function(){tt.addClass(g.pushable)},dimmed:function(){ut.addClass(g.dimmed)},active:function(){d.addClass(g.active)},animating:function(){d.addClass(g.animating)},transition:function(n){n=n||l.get.transition();d.addClass(n)},direction:function(n){n=n||l.get.direction();d.addClass(g[n])},visible:function(){d.addClass(g.visible)},overlay:function(){d.addClass(g.overlay)}},remove:{inlineCSS:function(){l.debug("Removing inline css styles",et);et&&et.length>0&&et.remove()},ios:function(){a.removeClass(g.ios)},pushed:function(){tt.removeClass(g.pushed)},pushable:function(){tt.removeClass(g.pushable)},active:function(){d.removeClass(g.active)},animating:function(){d.removeClass(g.animating)},transition:function(n){n=n||l.get.transition();d.removeClass(n)},direction:function(n){n=n||l.get.direction();d.removeClass(g[n])},visible:function(){d.removeClass(g.visible)},overlay:function(){d.removeClass(g.overlay)}},get:{direction:function(){return d.hasClass(g.top)?g.top:d.hasClass(g.right)?g.right:d.hasClass(g.bottom)?g.bottom:g.left},transition:function(){var n,t=l.get.direction();return n=l.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,l.verbose("Determined transition",n),n},transitionEvent:function(){var n,u=i.createElement("element"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(u.style[n]!==r)return t[n]}},is:{ie:function(){return!t.ActiveXObject&&"ActiveXObject"in t||"ActiveXObject"in t},ios:function(){var n=navigator.userAgent,t=n.match(at.ios),i=n.match(at.mobileChrome);return!(!t||i)&&(l.verbose("Browser was found to be iOS",n),!0)},mobile:function(){var n=navigator.userAgent;return n.match(at.mobile)?(l.verbose("Browser was found to be mobile",n),!0):(l.verbose("Browser is not mobile, using regular transition",n),!1)},hidden:function(){return!l.is.visible()},visible:function(){return d.hasClass(g.visible)},open:function(){return l.is.visible()},closed:function(){return l.is.hidden()},vertical:function(){return d.hasClass(g.top)},animating:function(){return tt.hasClass(g.animating)},rtl:function(){return l.cache.rtl===r&&(l.cache.rtl="rtl"==d.css("direction")),l.cache.rtl}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,k,t);else{if(i===r)return k[t];n.isPlainObject(k[t])?n.extend(!0,k[t],i):k[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else{if(i===r)return l[t];l[t]=i}},debug:function(){!k.silent&&k.debug&&(k.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,k.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),l.verbose.apply(console,arguments)))},error:function(){k.silent||(l.error=Function.prototype.bind.call(console.error,console,k.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i;k.performance&&(i=(t=(new Date).getTime())-(c||t),c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=k.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";v&&(t+=" '"+v+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var h,o,s,e=ct;return i=i||b,u=nt||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(l.error(st.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};w?(ct===r&&l.initialize(),l.invoke(y)):(ct!==r&&l.invoke("destroy"),l.initialize())}),f!==r?f:this};n.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);!function(n,t,i,r){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();n.fn.tab=function(u){var f,e=n.isFunction(this)?n(t):n(this),h=e.selector||"",s=(new Date).getTime(),o=[],c=arguments[0],a="string"==typeof c,v=[].slice.call(arguments,1),l=!1;return e.each(function(){var g,b,k,nt,y,tt,p=n.isPlainObject(u)?n.extend(!0,{},n.fn.tab.settings,u):n.extend({},n.fn.tab.settings),w=p.className,it=p.metadata,ft=p.selector,rt=p.error,ct="."+p.namespace,et="module-"+p.namespace,d=n(this),ot={},lt=!0,st=0,ht=this,ut=d.data(et);y={initialize:function(){y.debug("Initializing tab menu item",d);y.fix.callbacks();y.determineTabs();y.debug("Determining tabs",p.context,b);p.auto&&y.set.auto();y.bind.events();p.history&&!l&&(y.initializeHistory(),l=!0);y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y);ut=y;d.data(et,y)},destroy:function(){y.debug("Destroying tabs",d);d.removeData(et).off(ct)},bind:{events:function(){n.isWindow(ht)||(y.debug("Attaching tab activation events to element",d),d.on("click"+ct,y.event.click))}},determineTabs:function(){var t;"parent"===p.context?(d.closest(ft.ui).length>0?(t=d.closest(ft.ui),y.verbose("Using closest UI element as parent",t)):t=d,g=t.parent(),y.verbose("Determined parent element for creating context",g)):p.context?(g=n(p.context),y.verbose("Using selector for tab context",p.context,g)):g=n("body");p.childrenOnly?(b=g.children(ft.tabs),y.debug("Searching tab context children for tabs",g,b)):(b=g.find(ft.tabs),y.debug("Searching tab context for tabs",g,b))},fix:{callbacks:function(){n.isPlainObject(u)&&(u.onTabLoad||u.onTabInit)&&(u.onTabLoad&&(u.onLoad=u.onTabLoad,delete u.onTabLoad,y.error(rt.legacyLoad,u.onLoad)),u.onTabInit&&(u.onFirstLoad=u.onTabInit,delete u.onTabInit,y.error(rt.legacyInit,u.onFirstLoad)),p=n.extend(!0,{},n.fn.tab.settings,u))}},initializeHistory:function(){if(y.debug("Initializing page state"),n.address===r)return y.error(rt.state),!1;if("state"==p.historyType){if(y.debug("Using HTML5 to manage state"),!1===p.path)return y.error(rt.path),!1;n.address.history(!0).state(p.path)}n.address.bind("change",y.event.history.change)},event:{click:function(t){var i=n(this).data(it.tab);i!==r?(p.history?(y.verbose("Updating page state",t),n.address.value(i)):(y.verbose("Changing tab",t),y.changeTab(i)),t.preventDefault()):y.debug("No tab specified")},history:{change:function(t){var i=t.pathNames.join("/")||y.get.initialPath(),u=p.templates.determineTitle(i)||!1;y.performance.display();y.debug("History change event",i,t);tt=t;i!==r&&y.changeTab(i);u&&n.address.title(u)}}},refresh:function(){k&&(y.debug("Refreshing tab",k),y.changeTab(k))},cache:{read:function(n){return n!==r&&ot[n]},add:function(n,t){n=n||k;y.debug("Adding cached content for",n);ot[n]=t},remove:function(n){n=n||k;y.debug("Removing cached content for",n);delete ot[n]}},set:{auto:function(){var t="string"==typeof p.path?p.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";y.verbose("Setting up automatic tab retrieval from server",t);n.isPlainObject(p.apiSettings)?p.apiSettings.url=t:p.apiSettings={url:t}},loading:function(n){var t=y.get.tabElement(n);t.hasClass(w.loading)||(y.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(b).removeClass(w.active+" "+w.loading),t.length>0&&p.onRequest.call(t[0],n))},state:function(t){n.address.value(t)}},changeTab:function(i){var u=t.history&&t.history.pushState&&p.ignoreFirstLoad&&lt,f=p.auto||n.isPlainObject(p.apiSettings),r=f&&!u?y.utilities.pathToArray(i):y.get.defaultPathArray(i);i=y.utilities.arrayToPath(r);n.each(r,function(t,e){var h,c,a,l,v=r.slice(0,t+1),o=y.utilities.arrayToPath(v),b=y.is.tab(o),ut=t+1==r.length,s=y.get.tabElement(o);if(y.verbose("Looking for tab",e),b){if(y.verbose("Tab was found",e),k=o,nt=y.utilities.filterArray(r,v),ut?l=!0:(c=r.slice(0,t+2),a=y.utilities.arrayToPath(c),(l=!y.is.tab(a))&&y.verbose("Tab parameters found",c)),l&&f)return u?(y.debug("Ignoring remote content on first tab load",o),lt=!1,y.cache.add(i,s.html()),y.activate.all(o),p.onFirstLoad.call(s[0],o,nt,tt),p.onLoad.call(s[0],o,nt,tt)):(y.activate.navigation(o),y.fetch.content(o,i)),!1;y.debug("Opened local tab",o);y.activate.all(o);y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt));p.onLoad.call(s[0],o,nt,tt)}else{if(-1!=i.search("/")||""===i)return y.error(rt.missingTab,d,g,o),!1;if(o=(h=n("#"+i+', a[name="'+i+'"]')).closest("[data-tab]").data(it.tab),s=y.get.tabElement(o),h&&h.length>0&&o)return y.debug("Anchor link used, opening parent tab",s,h),s.hasClass(w.active)||setTimeout(function(){y.scrollTo(h)},0),y.activate.all(o),y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt)),p.onLoad.call(s[0],o,nt,tt),!1}})},scrollTo:function(t){var r=!!(t&&t.length>0)&&t.offset().top;!1!==r&&(y.debug("Forcing scroll to an in-page link in a hidden tab",r,t),n(i).scrollTop(r))},update:{content:function(t,i,u){var f=y.get.tabElement(t),e=f[0];u=u!==r?u:p.evaluateScripts;"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&"string"!=typeof i?f.empty().append(n(i).clone(!0)):u?(y.debug("Updating HTML and evaluating inline scripts",t,i),f.html(i)):(y.debug("Updating HTML",t,i),e.innerHTML=i)}},fetch:{content:function(t,i){var e,f,u=y.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:p.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(n){"response"==p.cacheType&&y.cache.add(i,n);y.update.content(t,n);t==k?(y.debug("Content loaded",t),y.activate.tab(t)):y.debug("Content loaded in background",t);p.onFirstLoad.call(u[0],t,nt,tt);p.onLoad.call(u[0],t,nt,tt);p.loadOnce?y.cache.add(i,!0):"string"==typeof p.cacheType&&"dom"==p.cacheType.toLowerCase()&&u.children().length>0?setTimeout(function(){var n=u.children().clone(!0);n=n.not("script");y.cache.add(i,n)},0):y.cache.add(i,u.html())},urlData:{tab:i}},o=u.api("get request")||!1,h=o&&"pending"===o.state();i=i||t;f=y.cache.read(i);p.cache&&f?(y.activate.tab(t),y.debug("Adding cached content",i),p.loadOnce||("once"==p.evaluateScripts?y.update.content(t,f,!1):y.update.content(t,f)),p.onLoad.call(u[0],t,nt,tt)):h?(y.set.loading(t),y.debug("Content is already loading",i)):n.api!==r?(e=n.extend(!0,{},p.apiSettings,s),y.debug("Retrieving remote content",i,e),y.set.loading(t),u.api(e)):y.error(rt.api)}},activate:{all:function(n){y.activate.tab(n);y.activate.navigation(n)},tab:function(n){var t=y.get.tabElement(n),i="siblings"==p.deactivate?t.siblings(b):b.not(t),r=t.hasClass(w.active);y.verbose("Showing tab content for",t);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading),t.length>0&&p.onVisible.call(t[0],n))},navigation:function(n){var t=y.get.navElement(n),i="siblings"==p.deactivate?t.siblings(e):e.not(t),r=t.hasClass(w.active);y.verbose("Activating tab navigation for",t,n);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading))}},deactivate:{all:function(){y.deactivate.navigation();y.deactivate.tabs()},navigation:function(){e.removeClass(w.active)},tabs:function(){b.removeClass(w.active+" "+w.loading)}},is:{tab:function(n){return n!==r&&y.get.tabElement(n).length>0}},get:{initialPath:function(){return e.eq(0).data(it.tab)||b.eq(0).data(it.tab)},path:function(){return n.address.value()},defaultPathArray:function(n){return y.utilities.pathToArray(y.get.defaultPath(n))},defaultPath:function(n){var t=e.filter("[data-"+it.tab+'^="'+n+'/"]').eq(0).data(it.tab)||!1;if(t){if(y.debug("Found default tab",t),st<p.maxDepth)return st++,y.get.defaultPath(t);y.error(rt.recursion)}else y.debug("No default tabs found for",n,b);return st=0,n},navElement:function(n){return n=n||k,e.filter("[data-"+it.tab+'="'+n+'"]')},tabElement:function(n){var t,i,r,u;return n=n||k,r=y.utilities.pathToArray(n),u=y.utilities.last(r),t=b.filter("[data-"+it.tab+'="'+n+'"]'),i=b.filter("[data-"+it.tab+'="'+u+'"]'),t.length>0?t:i},tab:function(){return k}},utilities:{filterArray:function(t,i){return n.grep(t,function(t){return-1==n.inArray(t,i)})},last:function(t){return!!n.isArray(t)&&t[t.length-1]},pathToArray:function(n){return n===r&&(n=k),"string"==typeof n?n.split("/"):[n]},arrayToPath:function(t){return!!n.isArray(t)&&t.join("/")}},setting:function(t,i){if(y.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,p,t);else{if(i===r)return p[t];n.isPlainObject(p[t])?n.extend(!0,p[t],i):p[t]=i}},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else{if(i===r)return y[t];y[t]=i}},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(n){var t,i;p.performance&&(i=(t=(new Date).getTime())-(s||t),s=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ht,"Execution Time":i}));clearTimeout(y.performance.timer);y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(y.performance.timer);n.each(o,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&o.length>0&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());o=[]}},invoke:function(t,i,u){var h,o,s,e=ut;return i=i||v,u=ht||u,"string"==typeof t&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(!n.isPlainObject(e[u])||i==h)return e[u]!==r?(o=e[u],!1):(y.error(rt.method,t),!1);e=e[u]}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};a?(ut===r&&y.initialize(),y.invoke(c)):(ut!==r&&ut.invoke("destroy"),y.initialize())}),f!==r?f:this};n.tab=function(){n(t).tab.apply(this,arguments)};n.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(){},onLoad:function(){},onVisible:function(){},onRequest:function(){},templates:{determineTitle:function(){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document)