/* * # Semantic UI - 2.2.10 * https://github.com/Semantic-Org/Semantic-UI * http://www.semantic-ui.com/ * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(e,t,n,i){e.site=e.fn.site=function(i){var o,r,a=(new Date).getTime(),s=[],l=arguments[0],c="string"==typeof l,d=[].slice.call(arguments,1),u=e.isPlainObject(i)?e.extend(!0,{},e.site.settings,i):e.extend({},e.site.settings),f=u.namespace,m=u.error,g="module-"+f,v=e(n),h=v,p=this,b=h.data(g);return o={initialize:function(){o.instantiate()},instantiate:function(){o.verbose("Storing instance of site",o),b=o,h.data(g,o)},normalize:function(){o.fix.console(),o.fix.requestAnimationFrame()},fix:{console:function(){o.debug("Normalizing window.console"),void 0!==console&&void 0!==console.log||(o.verbose("Console not available, normalizing events"),o.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(o.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(o.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){o.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){o.debug("Normalizing requestAnimationFrame"),void 0===t.requestAnimationFrame&&(o.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return void 0!==e.fn[t]&&void 0!==e.fn[t].settings},enabled:{modules:function(t){var n=[];return t=t||u.modules,e.each(t,function(e,t){o.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||u.modules,e.each(t,function(e,t){o.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,i,r){i="string"==typeof i?"all"===i?u.modules:[i]:i||u.modules,r=void 0===r||r,e.each(i,function(i,a){var s,l=!o.moduleExists(a)||(e.fn[a].settings.namespace||!1);o.moduleExists(a)&&(o.verbose("Changing default setting",t,n,a),e.fn[a].settings[t]=n,r&&l&&(s=e(":data(module-"+l+")"),s.length>0&&(o.verbose("Modifying existing settings",s),s[a]("setting",t,n))))})},settings:function(t,n,i){n="string"==typeof n?[n]:n||u.modules,i=void 0===i||i,e.each(n,function(n,r){var a;o.moduleExists(r)&&(o.verbose("Changing default setting",t,r),e.extend(!0,e.fn[r].settings,t),i&&f&&(a=e(":data(module-"+f+")"),a.length>0&&(o.verbose("Modifying existing settings",a),a[r]("setting",t))))})}},enable:{console:function(){o.console(!0)},debug:function(e,t){e=e||u.modules,o.debug("Enabling debug for modules",e),o.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||u.modules,o.debug("Enabling verbose debug for modules",e),o.change.setting("verbose",!0,e,t)}},disable:{console:function(){o.console(!1)},debug:function(e,t){e=e||u.modules,o.debug("Disabling debug for modules",e),o.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||u.modules,o.debug("Disabling verbose debug for modules",e),o.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(void 0===b.cache.console)return void o.error(m.console);o.debug("Restoring console function"),t.console=b.cache.console}else o.debug("Disabling console function"),b.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(){o.verbose("Destroying previous site for",h),h.removeData(g)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,u,t);else{if(void 0===n)return u[t];u[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,o,t);else{if(void 0===n)return o[t];o[t]=n}},debug:function(){u.debug&&(u.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,u.name+":"),o.debug.apply(console,arguments)))},verbose:function(){u.verbose&&u.debug&&(u.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,u.name+":"),o.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;u.performance&&(t=(new Date).getTime(),i=a||t,n=t-i,a=t,s.push({Element:p,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=u.name+":",n=0;a=!1,clearTimeout(o.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,i){var a,s,l,c=b;return n=n||d,i=p||i,"string"==typeof t&&void 0!==c&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,i){var r=n!=a?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(void 0!==c[r])return s=c[r],!1;if(!e.isPlainObject(c[i])||n==a)return void 0!==c[i]?(s=c[i],!1):(o.error(m.method,t),!1);c=c[i]}})),e.isFunction(s)?l=s.apply(i,n):void 0!==s&&(l=s),e.isArray(r)?r.push(l):void 0!==r?r=[r,l]:void 0!==l&&(r=l),s}},c?(void 0===b&&o.initialize(),o.invoke(l)):(void 0!==b&&o.destroy(),o.initialize()),void 0!==r?r:this},e.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.form=function(t){var i,o=e(this),r=o.selector||"",a=(new Date).getTime(),s=[],l=arguments[0],c=arguments[1],d="string"==typeof l,u=[].slice.call(arguments,1);return o.each(function(){var f,m,g,v,h,p,b,x,y,C,w,k,S,T,A,R,E,P,O,q=e(this),D=this,F=[],I=!1;O={initialize:function(){O.get.settings(),d?(void 0===P&&O.instantiate(),O.invoke(l)):(void 0!==P&&P.invoke("destroy"),O.verbose("Initializing form validation",q,x),O.bindEvents(),O.set.defaults(),O.instantiate())},instantiate:function(){O.verbose("Storing instance of module",O),P=O,q.data(R,O)},destroy:function(){O.verbose("Destroying previous module",P),O.removeEvents(),q.removeData(R)},refresh:function(){O.verbose("Refreshing selector cache"),f=q.find(w.field),m=q.find(w.group),g=q.find(w.message),v=q.find(w.prompt),h=q.find(w.submit),p=q.find(w.clear),b=q.find(w.reset)},submit:function(){O.verbose("Submitting form",q),q.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+E,function(e){O[n](),e.preventDefault()})},bindEvents:function(){O.verbose("Attaching form events"),q.on("submit"+E,O.validate.form).on("blur"+E,w.field,O.event.field.blur).on("click"+E,w.submit,O.submit).on("click"+E,w.reset,O.reset).on("click"+E,w.clear,O.clear),x.keyboardShortcuts&&q.on("keydown"+E,w.field,O.event.field.keydown),f.each(function(){var t=e(this),n=t.prop("type"),i=O.get.changeEvent(n,t);e(this).on(i+E,O.event.field.change)})},clear:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(m),o=i.find(w.prompt),r=t.data(C.defaultValue)||"",a=n.is(w.uiCheckbox),s=n.is(w.uiDropdown);i.hasClass(k.error)&&(O.verbose("Resetting error on field",i),i.removeClass(k.error),o.remove()),s?(O.verbose("Resetting dropdown value",n,r),n.dropdown("clear")):a?t.prop("checked",!1):(O.verbose("Resetting field value",t,r),t.val(""))})},reset:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(m),o=i.find(w.prompt),r=t.data(C.defaultValue),a=n.is(w.uiCheckbox),s=n.is(w.uiDropdown),l=i.hasClass(k.error);void 0!==r&&(l&&(O.verbose("Resetting error on field",i),i.removeClass(k.error),o.remove()),s?(O.verbose("Resetting dropdown value",n,r),n.dropdown("restore defaults")):a?(O.verbose("Resetting checkbox value",n,r),t.prop("checked",r)):(O.verbose("Resetting field value",t,r),t.val(r)))})},determine:{isValid:function(){var t=!0;return e.each(y,function(e,n){O.validate.field(n,e,!0)||(t=!1)}),t}},is:{bracketedRule:function(e){return e.type&&e.type.match(x.regExp.bracket)},empty:function(e){return!e||0===e.length||(e.is('input[type="checkbox"]')?!e.is(":checked"):O.is.blank(e))},blank:function(t){return""===e.trim(t.val())},valid:function(t){var n=!0;return t?(O.verbose("Checking if field is valid",t),O.validate.field(y[t],t,!1)):(O.verbose("Checking if form is valid"),e.each(y,function(e,t){O.is.valid(e)||(n=!1)}),n)}},removeEvents:function(){q.off(E),f.off(E),h.off(E),f.off(E)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o=n.is(w.input),r=n.is(w.checkbox),a=n.closest(w.uiDropdown).length>0,s={enter:13,escape:27};i==s.escape&&(O.verbose("Escape key pressed blurring field"),n.blur()),t.ctrlKey||i!=s.enter||!o||a||r||(I||(n.one("keyup"+E,O.event.field.keyup),O.submit(),O.debug("Enter pressed on input submitting form")),I=!0)},keyup:function(){I=!1},blur:function(t){var n=e(this),i=n.closest(m),o=O.get.validation(n);i.hasClass(k.error)?(O.debug("Revalidating field",n,o),o&&O.validate.field(o)):"blur"!=x.on&&"change"!=x.on||o&&O.validate.field(o)},change:function(t){var n=e(this),i=n.closest(m),o=O.get.validation(n);o&&("change"==x.on||i.hasClass(k.error)&&x.revalidate)&&(clearTimeout(O.timer),O.timer=setTimeout(function(){O.debug("Revalidating field",n,O.get.validation(n)),O.validate.field(o)},x.delay))}}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!O.is.bracketedRule(e))&&(void 0!==e.value?e.value:e.type.match(x.regExp.bracket)[1]+"")},ruleName:function(e){return O.is.bracketedRule(e)?e.type.replace(e.type.match(x.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":O.get.inputEvent()},inputEvent:function(){return void 0!==n.createElement("input").oninput?"input":void 0!==n.createElement("input").onpropertychange?"propertychange":"keyup"},prompt:function(e,t){var n,i,o,r=O.get.ruleName(e),a=O.get.ancillaryValue(e),s=e.prompt||x.prompt[r]||x.text.unspecifiedRule,l=-1!==s.search("{value}"),c=-1!==s.search("{name}");return(c||l)&&(i=O.get.field(t.identifier)),l&&(s=s.replace("{value}",i.val())),c&&(n=i.closest(w.group).find("label").eq(0),o=1==n.length?n.text():i.prop("placeholder")||x.text.unspecifiedField,s=s.replace("{name}",o)),s=s.replace("{identifier}",t.identifier),s=s.replace("{ruleValue}",a),e.prompt||O.verbose("Using default validation prompt for type",s,r),s},settings:function(){if(e.isPlainObject(t)){var n,i=Object.keys(t),o=i.length>0&&(void 0!==t[i[0]].identifier&&void 0!==t[i[0]].rules);o?(x=e.extend(!0,{},e.fn.form.settings,c),y=e.extend({},e.fn.form.settings.defaults,t),O.error(x.error.oldSyntax,D),O.verbose("Extending settings from legacy parameters",y,x)):(t.fields&&(n=Object.keys(t.fields),("string"==typeof t.fields[n[0]]||e.isArray(t.fields[n[0]]))&&e.each(t.fields,function(n,i){"string"==typeof i&&(i=[i]),t.fields[n]={rules:[]},e.each(i,function(e,i){t.fields[n].rules.push({type:i})})})),x=e.extend(!0,{},e.fn.form.settings,t),y=e.extend({},e.fn.form.settings.defaults,x.fields),O.verbose("Extending settings",y,x))}else x=e.fn.form.settings,y=e.fn.form.settings.defaults,O.verbose("Using default form validation",y,x);A=x.namespace,C=x.metadata,w=x.selector,k=x.className,S=x.regExp,T=x.error,R="module-"+A,E="."+A,P=q.data(R),O.refresh()},field:function(t){return O.verbose("Finding field with identifier",t),t=O.escape.string(t),f.filter("#"+t).length>0?f.filter("#"+t):f.filter('[name="'+t+'"]').length>0?f.filter('[name="'+t+'"]'):f.filter('[name="'+t+'[]"]').length>0?f.filter('[name="'+t+'[]"]'):f.filter("[data-"+C.validate+'="'+t+'"]').length>0?f.filter("[data-"+C.validate+'="'+t+'"]'):e("")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(O.get.field(t))}),n},validation:function(t){var n,i;return!!y&&(e.each(y,function(e,o){i=o.identifier||e,O.get.field(i)[0]==t[0]&&(o.identifier=i,n=o)}),n||!1)},value:function(e){var t,n=[];return n.push(e),t=O.get.values.call(D,n),t[e]},values:function(t){var n=e.isArray(t)?O.get.fields(t):f,i={};return n.each(function(t,n){var o=e(n),r=(o.prop("type"),o.prop("name")),a=o.val(),s=o.is(w.checkbox),l=o.is(w.radio),c=-1!==r.indexOf("[]"),d=!!s&&o.is(":checked");r&&(c?(r=r.replace("[]",""),i[r]||(i[r]=[]),s?d?i[r].push(a||!0):i[r].push(!1):i[r].push(a)):l?d&&(i[r]=a):i[r]=s?!!d&&(a||!0):a)}),i}},has:{field:function(e){return O.verbose("Checking for existence of a field with identifier",e),e=O.escape.string(e),"string"!=typeof e&&O.error(T.identifier,e),f.filter("#"+e).length>0||(f.filter('[name="'+e+'"]').length>0||f.filter("[data-"+C.validate+'="'+e+'"]').length>0)}},escape:{string:function(e){return e=String(e),e.replace(S.escape,"\\$&")}},add:{prompt:function(t,n){var i=O.get.field(t),o=i.closest(m),r=o.children(w.prompt),a=0!==r.length;n="string"==typeof n?[n]:n,O.verbose("Adding field error state",t),o.addClass(k.error),x.inline&&(a||(r=x.templates.prompt(n),r.appendTo(o)),r.html(n[0]),a?O.verbose("Inline errors are disabled, no inline error added",t):x.transition&&void 0!==e.fn.transition&&q.transition("is supported")?(O.verbose("Displaying error with css transition",x.transition),r.transition(x.transition+" in",x.duration)):(O.verbose("Displaying error with fallback javascript animation"),r.fadeIn(x.duration)))},errors:function(e){O.debug("Adding form error messages",e),O.set.error(),g.html(x.templates.error(e))}},remove:{prompt:function(t){var n=O.get.field(t),i=n.closest(m),o=i.children(w.prompt);i.removeClass(k.error),x.inline&&o.is(":visible")&&(O.verbose("Removing prompt for field",t),x.transition&&void 0!==e.fn.transition&&q.transition("is supported")?o.transition(x.transition+" out",x.duration,function(){o.remove()}):o.fadeOut(x.duration,function(){o.remove()}))}},set:{success:function(){q.removeClass(k.error).addClass(k.success)},defaults:function(){f.each(function(){var t=e(this),n=t.filter(w.checkbox).length>0,i=n?t.is(":checked"):t.val();t.data(C.defaultValue,i)})},error:function(){q.removeClass(k.success).addClass(k.error)},value:function(e,t){var n={};return n[e]=t,O.set.values.call(D,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=O.get.field(t),r=o.parent(),a=e.isArray(n),s=r.is(w.uiCheckbox),l=r.is(w.uiDropdown),c=o.is(w.radio)&&s,d=o.length>0;d&&(a&&s?(O.verbose("Selecting multiple",n,o),r.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),r=i.parent(),i.length>0&&r.checkbox("check")})):c?(O.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(w.uiCheckbox).checkbox("check")):s?(O.verbose("Setting checkbox value",n,r),!0===n?r.checkbox("check"):r.checkbox("uncheck")):l?(O.verbose("Setting dropdown value",n,r),r.dropdown("set selected",n)):(O.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(e,t){var n=O.get.values();if(I)return!1;if(F=[],O.determine.isValid()){if(O.debug("Form has no validation errors, submitting"),O.set.success(),!0!==t)return x.onSuccess.call(D,e,n)}else if(O.debug("Form has errors"),O.set.error(),x.inline||O.add.errors(F),void 0!==q.data("moduleApi")&&e.stopImmediatePropagation(),!0!==t)return x.onFailure.call(D,F,n)},field:function(t,n,i){i=void 0===i||i,"string"==typeof t&&(O.verbose("Validating field",t),n=t,t=y[t]);var o=t.identifier||n,r=O.get.field(o),a=!!t.depends&&O.get.field(t.depends),s=!0,l=[];return t.identifier||(O.debug("Using field name as identifier",o),t.identifier=o),r.prop("disabled")?(O.debug("Field is disabled. Skipping",o),s=!0):t.optional&&O.is.blank(r)?(O.debug("Field is optional and blank. Skipping",o),s=!0):t.depends&&O.is.empty(a)?(O.debug("Field depends on another value that is not present or empty. Skipping",a),s=!0):void 0!==t.rules&&e.each(t.rules,function(e,n){O.has.field(o)&&!O.validate.rule(t,n)&&(O.debug("Field is invalid",o,n.type),l.push(O.get.prompt(n,t)),s=!1)}),s?(i&&(O.remove.prompt(o,l),x.onValid.call(r)),!0):(i&&(F=F.concat(l),O.add.prompt(o,l),x.onInvalid.call(r,l)),!1)},rule:function(t,n){var i=O.get.field(t.identifier),o=(n.type,i.val()),r=O.get.ancillaryValue(n),a=O.get.ruleName(n),s=x.rules[a];return e.isFunction(s)?(o=void 0===o||""===o||null===o?"":e.trim(o+""),s.call(i,o,r)):void O.error(T.noRule,a)}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(void 0===n)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,O,t);else{if(void 0===n)return O[t];O[t]=n}},debug:function(){!x.silent&&x.debug&&(x.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,x.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),O.verbose.apply(console,arguments)))},error:function(){x.silent||(O.error=Function.prototype.bind.call(console.error,console,x.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=a||t,n=t-i,a=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(O.performance.display,500)},display:function(){var t=x.name+":",n=0;a=!1,clearTimeout(O.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),o.length>1&&(t+=" ("+o.length+")"),(void 0!==console.group||void 0!==console.table)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,o){var r,a,s,l=P;return n=n||u,o=D||o,"string"==typeof t&&void 0!==l&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,i){var o=n!=r?i+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[o])&&n!=r)l=l[o];else{if(void 0!==l[o])return a=l[o],!1;if(!e.isPlainObject(l[i])||n==r)return void 0!==l[i]&&(a=l[i],!1);l=l[i]}})),e.isFunction(a)?s=a.apply(o,n):void 0!==a&&(s=a),e.isArray(i)?i.push(s):void 0!==i?i=[i,s]:void 0!==s&&(i=s),a}},O.initialize()}),void 0!==i?i:this},e.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{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} cannot contain "{ruleValue}"',containExactly:'{name} cannot contain exactly "{ruleValue}"',doesntContain:'{name} must contain "{ruleValue}"',doesntContainExactly:'{name} must 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 n='",e(n)},prompt:function(t){return e("
").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(void 0===t||""===t||e.isArray(t)&&0===t.length)},checked:function(){return e(this).filter(":checked").length>0},email:function(t){return e.fn.form.settings.regExp.email.test(t)},url:function(t){return e.fn.form.settings.regExp.url.test(t)},regExp:function(t,n){if(n instanceof RegExp)return t.match(n);var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},integer:function(t,n){var i,o,r,a=e.fn.form.settings.regExp.integer;return n&&-1===["",".."].indexOf(n)&&(-1==n.indexOf("..")?a.test(n)&&(i=o=n-0):(r=n.split("..",2),a.test(r[0])&&(i=r[0]-0),a.test(r[1])&&(o=r[1]-0))),a.test(t)&&(void 0===i||t>=i)&&(void 0===o||t<=o)},decimal:function(t){return e.fn.form.settings.regExp.decimal.test(t)},number:function(t){return e.fn.form.settings.regExp.number.test(t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return e="string"==typeof e?e.toLowerCase():e,t="string"==typeof t?t.toLowerCase():t,e!=t},notExactly:function(e,t){return e!=t},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},doesntContain:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n,"i"))},doesntContainExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1===t.search(new RegExp(n))},minLength:function(e,t){return void 0!==e&&e.length>=t},length:function(e,t){return void 0!==e&&e.length>=t},exactLength:function(e,t){return void 0!==e&&e.length==t},maxLength:function(e,t){return void 0!==e&&e.length<=t},match:function(t,n){var i;e(this);return e('[data-validate="'+n+'"]').length>0?i=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?i=e("#"+n).val():e('[name="'+n+'"]').length>0?i=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(i=e('[name="'+n+'[]"]')),void 0!==i&&t.toString()==i.toString()},different:function(t,n){var i;e(this);return e('[data-validate="'+n+'"]').length>0?i=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?i=e("#"+n).val():e('[name="'+n+'"]').length>0?i=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(i=e('[name="'+n+'[]"]')),void 0!==i&&t.toString()!==i.toString()},creditCard:function(t,n){var i,o,r={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]}},a={},s=!1,l="string"==typeof n&&n.split(",");if("string"==typeof t&&0!==t.length){if(t=t.replace(/[\-]/g,""),l&&(e.each(l,function(n,i){(o=r[i])&&(a={length:-1!==e.inArray(t.length,o.length),pattern:-1!==t.search(o.pattern)},a.length&&a.pattern&&(s=!0))}),!s))return!1;if(i={number:-1!==e.inArray(t.length,r.unionPay.length),pattern:-1!==t.search(r.unionPay.pattern)},i.number&&i.pattern)return!0;for(var c=t.length,d=0,u=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],f=0;c--;)f+=u[d][parseInt(t.charAt(c),10)],d^=1;return f%10==0&&f>0}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.checkbox=function(i){var o,r=e(this),a=r.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],d="string"==typeof c,u=[].slice.call(arguments,1);return r.each(function(){var r,f,m=e.extend(!0,{},e.fn.checkbox.settings,i),g=m.className,v=m.namespace,h=m.selector,p=m.error,b="."+v,x="module-"+v,y=e(this),C=e(this).children(h.label),w=e(this).children(h.input),k=w[0],S=!1,T=!1,A=y.data(x),R=this;f={initialize:function(){f.verbose("Initializing checkbox",m),f.create.label(),f.bind.events(),f.set.tabbable(),f.hide.input(),f.observeChanges(),f.instantiate(),f.setup()},instantiate:function(){f.verbose("Storing instance of module",f),A=f,y.data(x,f)},destroy:function(){f.verbose("Destroying module"),f.unbind.events(),f.show.input(),y.removeData(x)},fix:{reference:function(){y.is(h.input)&&(f.debug("Behavior called on adjusting invoked element"),y=y.closest(h.checkbox),f.refresh())}},setup:function(){f.set.initialLoad(),f.is.indeterminate()?(f.debug("Initial value is indeterminate"),f.indeterminate()):f.is.checked()?(f.debug("Initial value is checked"),f.check()):(f.debug("Initial value is unchecked"),f.uncheck()),f.remove.initialLoad()},refresh:function(){C=y.children(h.label),w=y.children(h.input),k=w[0]},hide:{input:function(){f.verbose("Modifying z-index to be unselectable"),w.addClass(g.hidden)}},show:{input:function(){f.verbose("Modifying z-index to be selectable"),w.removeClass(g.hidden)}},observeChanges:function(){"MutationObserver"in t&&(r=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()}),r.observe(R,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",r))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(f[n])?f[n]:f.toggle,i.length>0?(f.debug("Attaching checkbox events to element",t,n),i.on("click"+b,n)):f.error(p.notFound)},event:{click:function(t){var n=e(t.target);return n.is(h.input)?void f.verbose("Using default check action on initialized checkbox"):n.is(h.link)?void f.debug("Clicking link inside checkbox, skipping toggle"):(f.toggle(),w.focus(),void t.preventDefault())},keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape?(f.verbose("Escape key pressed blurring field"),w.blur(),T=!0):e.ctrlKey||t!=n.space&&t!=n.enter?T=!1:(f.verbose("Enter/space key pressed, toggling checkbox"),f.toggle(),T=!0)},keyup:function(e){T&&e.preventDefault()}},check:function(){f.should.allowCheck()&&(f.debug("Checking checkbox",w),f.set.checked(),f.should.ignoreCallbacks()||(m.onChecked.call(k),m.onChange.call(k)))},uncheck:function(){f.should.allowUncheck()&&(f.debug("Unchecking checkbox"),f.set.unchecked(),f.should.ignoreCallbacks()||(m.onUnchecked.call(k),m.onChange.call(k)))},indeterminate:function(){if(f.should.allowIndeterminate())return void f.debug("Checkbox is already indeterminate");f.debug("Making checkbox indeterminate"),f.set.indeterminate(),f.should.ignoreCallbacks()||(m.onIndeterminate.call(k),m.onChange.call(k))},determinate:function(){if(f.should.allowDeterminate())return void f.debug("Checkbox is already determinate");f.debug("Making checkbox determinate"),f.set.determinate(),f.should.ignoreCallbacks()||(m.onDeterminate.call(k),m.onChange.call(k))},enable:function(){if(f.is.enabled())return void f.debug("Checkbox is already enabled");f.debug("Enabling checkbox"),f.set.enabled(),m.onEnable.call(k),m.onEnabled.call(k)},disable:function(){if(f.is.disabled())return void f.debug("Checkbox is already disabled");f.debug("Disabling checkbox"),f.set.disabled(),m.onDisable.call(k),m.onDisabled.call(k)},get:{radios:function(){var t=f.get.name();return e('input[name="'+t+'"]').closest(h.checkbox)},otherRadios:function(){return f.get.radios().not(y)},name:function(){return w.attr("name")}},is:{initialLoad:function(){return S},radio:function(){return w.hasClass(g.radio)||"radio"==w.attr("type")},indeterminate:function(){return void 0!==w.prop("indeterminate")&&w.prop("indeterminate")},checked:function(){return void 0!==w.prop("checked")&&w.prop("checked")},disabled:function(){return void 0!==w.prop("disabled")&&w.prop("disabled")},enabled:function(){return!f.is.disabled()},determinate:function(){return!f.is.indeterminate()},unchecked:function(){return!f.is.checked()}},should:{allowCheck:function(){return f.is.determinate()&&f.is.checked()&&!f.should.forceCallbacks()?(f.debug("Should not allow check, checkbox is already checked"),!1):!1!==m.beforeChecked.apply(k)||(f.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return f.is.determinate()&&f.is.unchecked()&&!f.should.forceCallbacks()?(f.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!1!==m.beforeUnchecked.apply(k)||(f.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return f.is.indeterminate()&&!f.should.forceCallbacks()?(f.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!1!==m.beforeIndeterminate.apply(k)||(f.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return f.is.determinate()&&!f.should.forceCallbacks()?(f.debug("Should not allow determinate, checkbox is already determinate"),!1):!1!==m.beforeDeterminate.apply(k)||(f.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return f.is.initialLoad()&&m.fireOnInit},ignoreCallbacks:function(){return S&&!m.fireOnInit}},can:{change:function(){return!(y.hasClass(g.disabled)||y.hasClass(g.readOnly)||w.prop("disabled")||w.prop("readonly"))},uncheck:function(){return"boolean"==typeof m.uncheckable?m.uncheckable:!f.is.radio()}},set:{initialLoad:function(){S=!0},checked:function(){if(f.verbose("Setting class to checked"),y.removeClass(g.indeterminate).addClass(g.checked),f.is.radio()&&f.uncheckOthers(),!f.is.indeterminate()&&f.is.checked())return void f.debug("Input is already checked, skipping input property change") ;f.verbose("Setting state to checked",k),w.prop("indeterminate",!1).prop("checked",!0),f.trigger.change()},unchecked:function(){if(f.verbose("Removing checked class"),y.removeClass(g.indeterminate).removeClass(g.checked),!f.is.indeterminate()&&f.is.unchecked())return void f.debug("Input is already unchecked");f.debug("Setting state to unchecked"),w.prop("indeterminate",!1).prop("checked",!1),f.trigger.change()},indeterminate:function(){if(f.verbose("Setting class to indeterminate"),y.addClass(g.indeterminate),f.is.indeterminate())return void f.debug("Input is already indeterminate, skipping input property change");f.debug("Setting state to indeterminate"),w.prop("indeterminate",!0),f.trigger.change()},determinate:function(){if(f.verbose("Removing indeterminate class"),y.removeClass(g.indeterminate),f.is.determinate())return void f.debug("Input is already determinate, skipping input property change");f.debug("Setting state to determinate"),w.prop("indeterminate",!1)},disabled:function(){if(f.verbose("Setting class to disabled"),y.addClass(g.disabled),f.is.disabled())return void f.debug("Input is already disabled, skipping input property change");f.debug("Setting state to disabled"),w.prop("disabled","disabled"),f.trigger.change()},enabled:function(){if(f.verbose("Removing disabled class"),y.removeClass(g.disabled),f.is.enabled())return void f.debug("Input is already enabled, skipping input property change");f.debug("Setting state to enabled"),w.prop("disabled",!1),f.trigger.change()},tabbable:function(){f.verbose("Adding tabindex to checkbox"),void 0===w.attr("tabindex")&&w.attr("tabindex",0)}},remove:{initialLoad:function(){S=!1}},trigger:{change:function(){var e=n.createEvent("HTMLEvents"),t=w[0];t&&(f.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{label:function(){w.prevAll(h.label).length>0?(w.prev(h.label).detach().insertAfter(w),f.debug("Moving existing label",C)):f.has.label()||(C=e("