SUSTC-SZ-B 2013iGEM/JS/wiki-all.min.js

From 2013.igem.org

Revision as of 16:32, 27 October 2013 by Carrol (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
!function(a,b,c,d){a.fn.accordion=function(b){var c,e=a(this),f=a.isPlainObject(b)?a.extend(!0,{},a.fn.accordion.settings,b):a.fn.accordion.settings,g=f.className,h=f.namespace,i=f.selector,j=f.error,k="."+h,l="module-"+h,m=e.selector||"",n=(new Date).getTime(),o=[],p=arguments[0],q="string"==typeof p,r=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),s=h.find(i.title),t=h.find(i.content),u=this,v=h.data(l);b={initialize:function(){b.debug("Initializing accordion with bound events",h),s.on("click"+k,b.event.click),b.instantiate()},instantiate:function(){h.data(l,b)},destroy:function(){b.debug("Destroying previous accordion for",h),h.removeData(l),s.off(k)},event:{click:function(){b.verbose("Title clicked",this);var c=a(this),d=s.index(c);b.toggle(d)},resetStyle:function(){b.verbose("Resetting styles on element",this),a(this).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")}},toggle:function(a){b.debug("Toggling content content at index",a);var c=s.eq(a),d=c.next(t),e=d.is(":visible");e?f.collapsible?b.close(a):b.debug("Cannot close accordion content collapsing is disabled"):b.open(a)},open:function(c){var d=s.eq(c),e=d.next(t),h=s.filter("."+g.active),i=h.next(s),j=h.size()>0;e.is(":animated")||(b.debug("Opening accordion content",d),f.exclusive&&j&&(h.removeClass(g.active),i.stop().children().animate({opacity:0},f.duration,b.event.resetStyle).end().slideUp(f.duration,f.easing,function(){i.removeClass(g.active).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")})),d.addClass(g.active),e.stop().children().attr("style","").removeAttr("style").end().slideDown(f.duration,f.easing,function(){e.addClass(g.active).attr("style","").removeAttr("style"),a.proxy(f.onOpen,e)(),a.proxy(f.onChange,e)()}))},close:function(c){var d=s.eq(c),e=d.next(t);b.debug("Closing accordion content",d),d.removeClass(g.active),e.removeClass(g.active).show().stop().children().animate({opacity:0},f.duration,b.event.resetStyle).end().slideUp(f.duration,f.easing,function(){e.attr("style","").removeAttr("style"),a.proxy(f.onClose,e)(),a.proxy(f.onChange,e)()})},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?f[c]:(a.isPlainObject(c)?a.extend(!0,f,c):f[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=n||c,d=c-e,n=c,o.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;n=!1,clearTimeout(b.performance.timer),a.each(o,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",m&&(c+=" '"+m+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&o.length>0&&(console.groupCollapsed(c),console.table?console.table(o):a.each(o,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),o=[]}},invoke:function(e,f,g){var h,i,k;return f=f||r,g=u||g,"string"==typeof e&&v!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(v[f])&&c!=h)v=v[f];else{if(!a.isPlainObject(v[g])||c==h)return v[f]!==d?(i=v[f],!1):v[g]!==d?(i=v[g],!1):(b.error(j.method),!1);v=v[g]}})),a.isFunction(i)?k=i.apply(g,f):i!==d&&(k=i),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),i}},q?(v===d&&b.initialize(),b.invoke(p)):(v!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!0,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,duration:300,easing:"linear",onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active"},selector:{title:".title",content:".content"}}}(jQuery,window,document),function(a,b,c,d){a.api=a.fn.api=function(c){var e,f,g=a.extend(!0,{},a.api.settings,c),h="function"!=typeof this?this:a("<div/>"),i=g.stateContext?a(g.stateContext):a(h),j="object"==typeof this?a(h):i,k=this,l=(new Date).getTime(),m=[],n=j.selector||"",o=g.namespace+"-module",p=g.className,q=g.metadata,r=g.error,s=j.data(o),t=arguments[0],u=s!==d&&"string"==typeof t,v=[].slice.call(arguments,1);return e={initialize:function(){var c,f,h,k,l,m,n=(new Date).getTime(),o={},s={};return g.serializeForm&&a(this).toJSON()!==d&&(o=e.get.formData(),e.debug("Adding form data to API Request",o),a.extend(!0,g.data,o)),c=a.proxy(g.beforeSend,j)(g),c===d||c?(k=e.get.url(e.get.templateURL()))?(h=a.Deferred().always(function(){g.stateContext&&i.removeClass(p.loading),a.proxy(g.complete,j)()}).done(function(b){e.debug("API request successful"),"json"==g.dataType?b.error!==d?a.proxy(g.failure,i)(b.error,g,j):a.isArray(b.errors)?a.proxy(g.failure,i)(b.errors[0],g,j):a.proxy(g.success,i)(b,g,j):a.proxy(g.success,i)(b,g,j)}).fail(function(b,c,f){var h,j=g.error[c]!==d?g.error[c]:f;if(b!==d)if(b.readyState!==d&&4==b.readyState){if(200!=b.status&&f!==d&&""!==f)e.error(k.statusMessage+f);else if("error"==c&&"json"==g.dataType)try{h=a.parseJSON(b.responseText),h&&h.error!==d&&(j=h.error)}catch(k){e.error(k.JSONParse)}i.removeClass(p.loading).addClass(p.error),g.errorLength>0&&setTimeout(function(){i.removeClass(p.error)},g.errorLength),e.debug("API Request error:",j),a.proxy(g.failure,i)(j,g,this)}else e.debug("Request Aborted (Most likely caused by page change)")}),a.extend(!0,s,g,{success:function(){},failure:function(){},complete:function(){},type:g.method||g.type,data:l,url:k,beforeSend:g.beforeXHR}),g.stateContext&&i.addClass(p.loading),g.progress&&(e.verbose("Adding progress events"),a.extend(!0,s,{xhr:function(){var c=new b.XMLHttpRequest;return c.upload.addEventListener("progress",function(b){var c;b.lengthComputable&&(c=Math.round(1e4*(b.loaded/b.total))/100+"%",a.proxy(g.progress,i)(c,b))},!1),c.addEventListener("progress",function(b){var c;b.lengthComputable&&(c=Math.round(1e4*(b.loaded/b.total))/100+"%",a.proxy(g.progress,i)(c,b))},!1),c}})),e.verbose("Creating AJAX request with settings: ",s),m=a.ajax(s).always(function(){f=g.loadingLength-((new Date).getTime()-n),g.loadingDelay=0>f?0:f}).done(function(a){var b=this;setTimeout(function(){h.resolveWith(b,[a])},g.loadingDelay)}).fail(function(a,b,c){var d=this;"abort"!=b?setTimeout(function(){h.rejectWith(d,[a,b,c])},g.loadingDelay):i.removeClass(p.error).removeClass(p.loading)}),g.stateContext&&j.data(q.promise,h).data(q.xhr,m),void 0):(e.error(r.missingURL),e.reset(),void 0):(e.error(r.beforeSend),e.reset(),void 0)},get:{formData:function(){return j.closest("form").toJSON()},templateURL:function(){var a,b=j.data(g.metadata.action)||g.action||!1;return b&&(e.debug("Creating url for: ",b),g.api[b]!==d?a=g.api[b]:e.error(r.missingAction)),g.url&&(a=g.url,e.debug("Getting url",a)),a},url:function(b,c){var f;return b&&(f=b.match(g.regExpTemplate),c=c||g.urlData,f&&(e.debug("Looking for URL variables",f),a.each(f,function(g,h){var i=h.substr(2,h.length-3),k=a.isPlainObject(c)&&c[i]!==d?c[i]:j.data(i)!==d?j.data(i):c[i];if(e.verbose("Looking for variable",i,j,j.data(i),c[i]),k===!1)e.debug("Removing variable from URL",f),b=b.replace("/"+h,"");else{if(k===d||!k)return e.error(r.missingParameter+i),b=!1,!1;b=b.replace(h,k)}}))),b}},reset:function(){j.data(q.promise,!1).data(q.xhr,!1),i.removeClass(p.error).removeClass(p.loading)},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,c){return c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},debug:function(){g.debug&&(g.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,g.name+":"),e.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,g.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;g.performance&&(b=(new Date).getTime(),d=l||b,c=b-d,l=b,m.push({Element:k,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=g.name+":",c=0;l=!1,clearTimeout(e.performance.timer),a.each(m,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",n&&(b+=" '"+n+"'"),(console.group!==d||console.table!==d)&&m.length>0&&(console.groupCollapsed(b),console.table?console.table(m):a.each(m,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(b,c,g){var h,i,j;return c=c||v,g=k||g,"string"==typeof b&&s!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(s[f])&&c!=h)s=s[f];else{if(!a.isPlainObject(s[g])||c==h)return s[f]!==d?(i=s[f],!1):s[g]!==d?(i=s[g],!1):(e.error(r.method),!1);s=s[g]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},u?(s===d&&e.initialize(),e.invoke(t)):(s!==d&&e.destroy(),e.initialize()),f!==d?f:this},a.fn.apiButton=function(b){return a(this).each(function(){var c,d=a(this),e=a(this).selector||"",f=a.isFunction(b)?a.extend(!0,{},a.api.settings,a.fn.apiButton.settings,{stateContext:this,success:b}):a.extend(!0,{},a.api.settings,a.fn.apiButton.settings,{stateContext:this},b);c={initialize:function(){f.context&&""!==e?a(f.context).on(e,"click."+f.namespace,c.click):d.on("click."+f.namespace,c.click)},click:function(){f.filter&&0!==a(this).filter(f.filter).size()||a.proxy(a.api,this)(f)}},c.initialize()}),this},a.api.settings={name:"API",namespace:"api",debug:!0,verbose:!0,performance:!0,api:{},beforeSend:function(a){return a},beforeXHR:function(){},success:function(){},complete:function(){},failure:function(){},progress:!1,error:{missingAction:"API action used but no url was defined",missingURL:"URL not specified for the API action",missingParameter:"Missing an essential URL parameter: ",timeout:"Your request timed out",error:"There was an error with your request",parseError:"There was an error parsing your request",JSONParse:"JSON could not be parsed during error handling",statusMessage:"Server gave an error: ",beforeSend:"The before send function has aborted the request",exitConditions:"API Request Aborted. Exit conditions met"},className:{loading:"loading",error:"error"},metadata:{action:"action",promise:"promise",xhr:"xhr"},regExpTemplate:/\{\$([A-z]+)\}/g,action:!1,url:!1,urlData:!1,serializeForm:!1,stateContext:!1,method:"get",data:{},dataType:"json",cache:!0,loadingLength:200,errorLength:2e3},a.fn.apiButton.settings={filter:".disabled, .loading",context:!1,stateContext:!1}}(jQuery,window,document),function(a,b,c,d){a.fn.colorize=function(b){var c=a.extend(!0,{},a.fn.colorize.settings,b),e=arguments||!1;return a(this).each(function(b){var f,g,h,i,j,k,l,m,n=a(this),o=a("<canvas />")[0],p=a("<canvas />")[0],q=a("<canvas />")[0],r=new Image,s=c.colors,t=(c.paths,c.namespace),u=c.error,v=n.data("module-"+t);return m={checkPreconditions:function(){return m.debug("Checking pre-conditions"),!a.isPlainObject(s)||a.isEmptyObject(s)?(m.error(u.undefinedColors),!1):!0},async:function(a){c.async?setTimeout(a,0):a()},getMetadata:function(){m.debug("Grabbing metadata"),i=n.data("image")||c.image||d,j=n.data("name")||c.name||b,k=c.width||n.width(),l=c.height||n.height(),(0===k||0===l)&&m.error(u.undefinedSize)},initialize:function(){m.debug("Initializing with colors",s),m.checkPreconditions()&&m.async(function(){m.getMetadata(),m.canvas.create(),m.draw.image(function(){m.draw.colors(),m.canvas.merge()}),n.data("module-"+t,m)})},redraw:function(){m.debug("Redrawing image"),m.async(function(){m.canvas.clear(),m.draw.colors(),m.canvas.merge()})},change:{color:function(a,b){return m.debug("Changing color",a),s[a]===d?(m.error(u.missingColor),!1):(s[a]=b,m.redraw(),void 0)}},canvas:{create:function(){m.debug("Creating canvases"),o.width=k,o.height=l,p.width=k,p.height=l,q.width=k,q.height=l,f=o.getContext("2d"),g=p.getContext("2d"),h=q.getContext("2d"),n.append(o),f=n.children("canvas")[0].getContext("2d")},clear:function(){m.debug("Clearing canvas"),h.fillStyle="#FFFFFF",h.fillRect(0,0,k,l)},merge:function(){return a.isFunction(f.blendOnto)?(f.putImageData(g.getImageData(0,0,k,l),0,0),h.blendOnto(f,"multiply"),void 0):(m.error(u.missingPlugin),void 0)}},draw:{image:function(a){m.debug("Drawing image"),a=a||function(){},i?(r.src=i,r.onload=function(){g.drawImage(r,0,0),a()}):(m.error(u.noImage),a())},colors:function(){m.debug("Drawing color overlays",s),a.each(s,function(a,b){c.onDraw(h,j,a,b)})}},debug:function(a,b){c.debug&&(b!==d?console.info(c.name+": "+a,b):console.info(c.name+": "+a))},error:function(a){console.warn(c.name+": "+a)},invoke:function(b,e,f){var g;return f=f||Array.prototype.slice.call(arguments,2),"string"==typeof b&&v!==d&&(b=b.split("."),a.each(b,function(b,d){return a.isPlainObject(v[d])?(v=v[d],!0):a.isFunction(v[d])?(g=v[d],!0):(m.error(c.error.method),!1)})),a.isFunction(g)?g.apply(e,f):!1}},v!==d&&e?("invoke"==e[0]&&(e=Array.prototype.slice.call(e,1)),m.invoke(e[0],this,Array.prototype.slice.call(e,1))):(m.initialize(),void 0)}),this},a.fn.colorize.settings={name:"Image Colorizer",debug:!0,namespace:"colorize",onDraw:function(){},async:!0,colors:{},metadata:{image:"image",name:"name"},error:{noImage:"No tracing image specified",undefinedColors:"No default colors specified.",missingColor:"Attempted to change color that does not exist",missingPlugin:"Blend onto plug-in must be included",undefinedHeight:"The width or height of image canvas could not be automatically determined. Please specify a height."}}}(jQuery,window,document),function(a,b,c,d){a.fn.form=function(b,e){var f,g=a(this),h=a.extend(!0,{},a.fn.form.settings,e),i=a.extend({},a.fn.form.settings.defaults,b),j=h.namespace,k=h.metadata,l=h.selector,m=h.className,n=h.error,o="."+j,p="module-"+j,q=g.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return g.each(function(){var b,e=a(this),j=a(this).find(l.field),w=a(this).find(l.group),x=a(this).find(l.message),y=(a(this).find(l.prompt),a(this).find(l.submit)),z=[],A=this,B=e.data(p);b={initialize:function(){b.verbose("Initializing form validation",e,i,h),h.keyboardShortcuts&&j.on("keydown"+o,b.event.field.keydown),e.on("submit"+o,b.validate.form),j.on("blur"+o,b.event.field.blur),y.on("click"+o,b.submit),j.on(b.get.changeEvent()+o,b.event.field.change),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),B=b,e.data(p,b)},destroy:function(){b.verbose("Destroying previous module",B),e.off(o).removeData(p)},refresh:function(){b.verbose("Refreshing selector cache"),j=e.find(l.field)},submit:function(){b.verbose("Submitting form",e),e.submit()},event:{field:{keydown:function(c){var d=a(this),e=c.which,f={enter:13,escape:27};return e==f.escape&&(b.verbose("Escape key pressed blurring field"),d.blur()),!c.ctrlKey&&e==f.enter&&d.is(l.input)?(b.debug("Enter key pressed, submitting form"),y.addClass(m.down),d.one("keyup"+o,b.event.field.keyup),c.preventDefault(),!1):void 0},keyup:function(){b.verbose("Doing keyboard shortcut form submit"),y.removeClass(m.down),b.submit()},blur:function(){var c=a(this),d=c.closest(w);d.hasClass(m.error)?(b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))):("blur"==h.on||"change"==h.on)&&b.validate.field(b.get.validation(c))},change:function(){var c=a(this),d=c.closest(w);d.hasClass(m.error)?(b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))):"change"==h.on&&b.validate.field(b.get.validation(c))}}},get:{changeEvent:function(){return c.createElement("input").oninput!==d?"input":c.createElement("input").onpropertychange!==d?"propertychange":"keyup"},field:function(c){return b.verbose("Finding field with identifier",c),j.filter("#"+c).size()>0?j.filter("#"+c):j.filter('[name="'+c+'"]').size()>0?j.filter('[name="'+c+'"]'):j.filter("[data-"+k.validate+'="'+c+'"]').size()>0?j.filter("[data-"+k.validate+'="'+c+'"]'):a("<input/>")},validation:function(c){var d;return a.each(i,function(a,e){b.get.field(e.identifier).get(0)==c.get(0)&&(d=e)}),d||!1}},has:{field:function(a){return b.verbose("Checking for existence of a field with identifier",a),j.filter("#"+a).size()>0?!0:j.filter('[name="'+a+'"]').size()>0?!0:j.filter("[data-"+k.validate+'="'+a+'"]').size()>0?!0:!1}},add:{prompt:function(c,e){var f=b.get.field(c.identifier),g=f.closest(w),i=g.find(l.prompt),j=0!==i.size();b.verbose("Adding inline error",c),g.addClass(m.error),h.inline&&(j||(i=h.templates.prompt(e),i.appendTo(g)),i.html(e[0]),j||(h.transition&&a.fn.transition!==d?(b.verbose("Displaying error with css transition",h.transition),i.transition(h.transition+" in",h.duration)):(b.verbose("Displaying error with fallback javascript animation"),i.fadeIn(h.duration))))},errors:function(a){b.debug("Adding form error messages",a),x.html(h.templates.error(a))}},remove:{prompt:function(c){var e=b.get.field(c.identifier),f=e.closest(w),g=f.find(l.prompt);f.removeClass(m.error),h.inline&&g.is(":visible")&&(b.verbose("Removing prompt for field",c),h.transition&&a.fn.transition!==d?g.transition(h.transition+" out",h.duration,function(){g.remove()}):g.fadeOut(h.duration,function(){g.remove()}))}},validate:{form:function(c){var d=!0;return z=[],a.each(i,function(a,c){b.validate.field(c)||(d=!1)}),d?(b.debug("Form has no validation errors, submitting"),e.removeClass(m.error).addClass(m.success),a.proxy(h.onSuccess,this)(c),void 0):(b.debug("Form has errors"),e.addClass(m.error),h.inline||b.add.errors(z),a.proxy(h.onFailure,this)(z))},field:function(c){var e=b.get.field(c.identifier),f=!0,g=[];return c.rules!==d&&a.each(c.rules,function(a,d){b.has.field(c.identifier)&&!b.validate.rule(c,d)&&(b.debug("Field is invalid",c.identifier,d.type),g.push(d.prompt),f=!1)}),f?(b.remove.prompt(c,g),a.proxy(h.onValid,e)(),!0):(z=z.concat(g),b.add.prompt(c,g),a.proxy(h.onInvalid,e)(g),!1)},rule:function(c,f){var g,i,j=b.get.field(c.identifier),k=f.type,l=j.val(),m=/\[(.*?)\]/i,n=m.exec(k),o=!0;return n!==d&&null!==n?(g=n[1],i=k.replace(n[0],""),o=a.proxy(h.rules[i],e)(l,g)):o=a.proxy(h.rules[k],j)(l),o}},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?h[c]:(a.isPlainObject(c)?a.extend(!0,h,c):h[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=r||c,d=c-e,r=c,s.push({Element:A,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;r=!1,clearTimeout(b.performance.timer),a.each(s,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",q&&(c+=" '"+q+"'"),g.size()>1&&(c+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(c),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(c,e,g){var h,i,j;return e=e||v,g=A||g,"string"==typeof c&&B!==d&&(c=c.split(/[\. ]/),h=c.length-1,a.each(c,function(e,f){var g=e!=h?f+c[e+1].charAt(0).toUpperCase()+c[e+1].slice(1):c;if(a.isPlainObject(B[f])&&e!=h)B=B[f];else{if(!a.isPlainObject(B[g])||e==h)return B[f]!==d?(i=B[f],!1):B[g]!==d?(i=B[g],!1):(b.error(n.method),!1);B=B[g]}})),a.isFunction(i)?j=i.apply(g,e):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},u?(B===d&&b.initialize(),b.invoke(t)):(B!==d&&b.destroy(),b.initialize())}),f!==d?f:this},a.fn.form.settings={name:"Form",namespace:"form",debug:!0,verbose:!0,performance:!0,keyboardShortcuts:!0,on:"submit",inline:!1,transition:"scale",duration:150,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},selector:{message:".error.message",field:"input, textarea, select",group:".field",input:"input",prompt:".prompt",submit:".submit"},className:{error:"error",success:"success",down:"down",label:"ui label prompt"},error:{method:"The method you called is not defined."},templates:{error:function(b){var c='
    ';return a.each(b,function(a,b){c+="
  • "+b+"
  • "}),c+="
",a(c)},prompt:function(b){return a("<div/>").addClass("ui red pointing prompt label").html(b[0])}},rules:{checked:function(){return a(this).filter(":checked").size()>0},empty:function(a){return!(a===d||""===a)},email:function(a){var b=RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return b.test(a)},length:function(a,b){return a!==d?a.length>=b:!1},not:function(a,b){return a!=b},contains:function(a,b){return-1!==a.search(b)},is:function(a,b){return a==b},maxLength:function(a,b){return a!==d?b>=a.length:!1},match:function(b,c){var e,f=a(this);return f.find("#"+c).size()>0?e=f.find("#"+c).val():f.find("[name="+c+"]").size()>0?e=f.find("[name="+c+"]").val():f.find('[data-validate="'+c+'"]').size()>0&&(e=f.find('[data-validate="'+c+'"]').val()),e!==d?""+b==""+e:!1},url:function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)}}}}(jQuery,window,document),function(a,b,c,d){a.fn.state=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.state.settings,b),g=e.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=f.error,n=f.metadata,o=f.className,p=f.namespace,q=f.states,r=f.text,s="."+p,t=p+"-module";return e.each(function(){var p,u=a(this),v=this,w=u.data(t);p={initialize:function(){p.verbose("Initializing module"),f.automatic&&p.add.defaults(),f.context&&""!==g?(p.allows("hover")&&a(v,f.context).on(g,"mouseenter"+s,p.enable.hover).on(g,"mouseleave"+s,p.disable.hover),p.allows("down")&&a(v,f.context).on(g,"mousedown"+s,p.enable.down).on(g,"mouseup"+s,p.disable.down),p.allows("focus")&&a(v,f.context).on(g,"focus"+s,p.enable.focus).on(g,"blur"+s,p.disable.focus),a(f.context).on(g,"mouseenter"+s,p.change.text).on(g,"mouseleave"+s,p.reset.text).on(g,"click"+s,p.toggle.state)):(p.allows("hover")&&u.on("mouseenter"+s,p.enable.hover).on("mouseleave"+s,p.disable.hover),p.allows("down")&&u.on("mousedown"+s,p.enable.down).on("mouseup"+s,p.disable.down),p.allows("focus")&&u.on("focus"+s,p.enable.focus).on("blur"+s,p.disable.focus),u.on("mouseenter"+s,p.change.text).on("mouseleave"+s,p.reset.text).on("click"+s,p.toggle.state)),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),w=p,u.data(t,p)},destroy:function(){p.verbose("Destroying previous module",w),u.off(s).removeData(t)},refresh:function(){p.verbose("Refreshing selector cache"),u=a(v)},add:{defaults:function(){var c=b&&a.isPlainObject(b.states)?b.states:{};a.each(f.defaults,function(b,e){p.is[b]!==d&&p.is[b]()&&(p.verbose("Adding default states",b,v),a.extend(f.states,e,c))})}},is:{active:function(){return u.hasClass(o.active)},loading:function(){return u.hasClass(o.loading)},inactive:function(){return!u.hasClass(o.active)},enabled:function(){return!u.is(f.filter.active)},disabled:function(){return u.is(f.filter.active)},textEnabled:function(){return!u.is(f.filter.text)},button:function(){return u.is(".button:not(a, .submit)")},input:function(){return u.is("input")}},allow:function(a){p.debug("Now allowing state",a),q[a]=!0},disallow:function(a){p.debug("No longer allowing",a),q[a]=!1},allows:function(a){return q[a]||!1},enable:{state:function(a){p.allows(a)&&u.addClass(o[a])},focus:function(){u.addClass(o.focus)},hover:function(){u.addClass(o.hover)},down:function(){u.addClass(o.down)}},disable:{state:function(a){p.allows(a)&&u.removeClass(o[a])},focus:function(){u.removeClass(o.focus)},hover:function(){u.removeClass(o.hover)},down:function(){u.removeClass(o.down)}},toggle:{state:function(){var a=u.data(n.promise);p.allows("active")&&p.is.enabled()&&(p.refresh(),a!==d?p.listenTo(a):p.change.state())}},listenTo:function(b){p.debug("API request detected, waiting for state signal",b),b?(r.loading&&p.update.text(r.loading),a.when(b).then(function(){"resolved"==b.state()?(p.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(p.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),p.change.state()})):(f.activateTest=function(){return!1},f.deactivateTest=function(){return!1})},change:{state:function(){p.debug("Determining state change direction"),p.is.inactive()?p.activate():p.deactivate(),f.sync&&p.sync(),a.proxy(f.onChange,v)()},text:function(){p.is.textEnabled()&&(p.is.active()?r.hover?(p.verbose("Changing text to hover text",r.hover),p.update.text(r.hover)):r.disable&&(p.verbose("Changing text to disable text",r.disable),p.update.text(r.disable)):r.hover?(p.verbose("Changing text to hover text",r.disable),p.update.text(r.hover)):r.enable&&(p.verbose("Changing text to enable text",r.enable),p.update.text(r.enable)))}},activate:function(){a.proxy(f.activateTest,v)()&&(p.debug("Setting state to active"),u.addClass(o.active),p.update.text(r.active)),a.proxy(f.onActivate,v)()},deactivate:function(){a.proxy(f.deactivateTest,v)()&&(p.debug("Setting state to inactive"),u.removeClass(o.active),p.update.text(r.inactive)),a.proxy(f.onDeactivate,v)()},sync:function(){p.verbose("Syncing other buttons to current state"),p.is.active()?e.not(u).state("activate"):e.not(u).state("deactivate")},get:{text:function(){return f.selector.text?u.find(f.selector.text).text():u.html()},textFor:function(a){return r[a]||!1}},flash:{text:function(a,b){var c=p.get.text();p.debug("Flashing text message",a,b),a=a||f.text.flash,b=b||f.flashDuration,p.update.text(a),setTimeout(function(){p.update.text(c)},b)}},reset:{text:function(){var a=r.active||u.data(n.storedText),b=r.inactive||u.data(n.storedText);p.is.textEnabled()&&(p.is.active()&&a?(p.verbose("Resetting active text",a),p.update.text(a)):b&&(p.verbose("Resetting inactive text",a),p.update.text(b)))}},update:{text:function(a){var b=p.get.text();a&&a!==b?(p.debug("Updating text",a),f.selector.text?u.data(n.storedText,a).find(f.selector.text).text(a):u.data(n.storedText,a).html(a)):p.debug("Text is already sane, ignoring update",a)}},setting:function(b,c){return p.debug("Changing setting",b,c),c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(b,c){return p.debug("Changing internal",b,c),c===d?p[b]:(a.isPlainObject(b)?a.extend(!0,p,b):p[b]=c,void 0)},debug:function(){f.debug&&(f.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,f.name+":"),p.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),p.verbose.apply(console,arguments)))},error:function(){p.error=Function.prototype.bind.call(console.error,console,f.name+":"),p.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;f.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,100)},display:function(){var b=f.name+":",c=0;h=!1,clearTimeout(p.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),e.size()>1&&(b+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,e,f){var g,h,i;return e=e||l,f=v||f,"string"==typeof b&&w!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(w[e])&&c!=g)w=w[e];else{if(!a.isPlainObject(w[f])||c==g)return w[e]!==d?(h=w[e],!1):w[f]!==d?(h=w[f],!1):(p.error(m.method),!1);w=w[f]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):"string"==typeof c?c=[c,i]:i!==d&&(c=i),h}},k?(w===d&&p.initialize(),p.invoke(j)):(w!==d&&p.destroy(),p.initialize())}),c!==d?c:this},a.fn.state.settings={name:"State",debug:!0,verbose:!0,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:3e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{focus:"focus",hover:"hover",down:"down",active:"active",loading:"loading"},selector:{text:!1},defaults:{input:{hover:!0,focus:!0,down:!0,loading:!1,active:!1},button:{hover:!0,focus:!1,down:!0,active:!0,loading:!0}},states:{hover:!0,focus:!0,down:!0,loading:!1,active:!1},text:{flash:!1,hover:!1,active:!1,inactive:!1,enable:!1,disable:!1}}}(jQuery,window,document),function(a,b,c,d){a.fn.chatroom=function(b){var c=a.extend(!0,{},a.fn.chatroom.settings,b),e=c.className,f=c.namespace,g=c.selector,h=c.error;return a(this).each(function(){var b,i,j,k,l,m,n,o=a(this),p=o.find(g.expandButton),q=o.find(g.userListButton),r=o.find(g.userList),s=(o.find(g.room),o.find(g.userCount)),t=o.find(g.log),u=(o.find(g.message),o.find(g.messageInput)),v=o.find(g.messageButton),w=o.data("module"),x="",y={};n={width:{log:t.width(),userList:r.outerWidth()},initialize:function(){return Pusher===d&&n.error(h.pusher),c.key===d||c.channelName===d?(n.error(h.key),!1):c.endpoint.message||c.endpoint.authentication?(m=new Pusher(c.key),Pusher.channel_auth_endpoint=c.endpoint.authentication,b=m.subscribe(c.channelName),b.bind("pusher:subscription_succeeded",n.user.list.create),b.bind("pusher:subscription_error",n.error),b.bind("pusher:member_added",n.user.joined),b.bind("pusher:member_removed",n.user.left),b.bind("update_messages",n.message.receive),a.each(c.customEvents,function(a,c){b.bind(a,c)}),q.on("click."+f,n.event.toggleUserList),p.on("click."+f,n.event.toggleExpand),u.on("keydown."+f,n.event.input.keydown).on("keyup."+f,n.event.input.keyup),v.on("mouseenter."+f,n.event.hover).on("mouseleave."+f,n.event.hover).on("click."+f,n.event.submit),t.animate({scrollTop:t.prop("scrollHeight")},400),o.data("module",n).addClass(e.loading),void 0):(n.error(h.endpoint),!1) },refresh:function(){q.removeClass(e.active),n.width={log:t.width(),userList:r.outerWidth()},q.hasClass(e.active)&&n.user.list.hide(),o.data("module",n)},user:{updateCount:function(){c.userCount&&(y=o.data("users"),k=0,a.each(y,function(){k++}),s.html(c.templates.userCount(k)))},joined:function(b){y=o.data("users"),"anonymous"!=b.id&&y[b.id]===d&&(y[b.id]=b.info,c.randomColor&&b.info.color===d&&(b.info.color=c.templates.color(b.id)),x=c.templates.userList(b.info),b.info.isAdmin?a(x).prependTo(r):a(x).appendTo(r),c.partingMessages&&(t.append(c.templates.joined(b.info)),n.message.scroll.test()),n.user.updateCount())},left:function(a){y=o.data("users"),a!==d&&"anonymous"!==a.id&&(delete y[a.id],o.data("users",y),r.find("[data-id="+a.id+"]").remove(),c.partingMessages&&(t.append(c.templates.left(a.info)),n.message.scroll.test()),n.user.updateCount())},list:{create:function(b){y={},b.each(function(a){"anonymous"!==a.id&&"undefined"!==a.id&&(c.randomColor&&a.info.color===d&&(a.info.color=c.templates.color(a.id)),x=a.info.isAdmin?c.templates.userList(a.info)+x:x+c.templates.userList(a.info),y[a.id]=a.info)}),o.data("users",y).data("user",y[b.me.id]).removeClass(e.loading),r.html(x),n.user.updateCount(),a.proxy(c.onJoin,r.children())()},show:function(){t.animate({width:n.width.log-n.width.userList},{duration:c.speed,easing:c.easing,complete:n.message.scroll.move})},hide:function(){t.stop().animate({width:n.width.log},{duration:c.speed,easing:c.easing,complete:n.message.scroll.move})}}},message:{scroll:{test:function(){l=t.prop("scrollHeight")-t.height(),c.scrollArea>Math.abs(t.scrollTop()-l)&&n.message.scroll.move()},move:function(){l=t.prop("scrollHeight")-t.height(),t.scrollTop(l)}},send:function(b){n.utils.emptyString(b)||a.api({url:c.endpoint.message,method:"POST",data:{message:{content:b,timestamp:(new Date).getTime()}}})},receive:function(a){j=a.data,y=o.data("users"),i=o.data("user"),y[j.userID]!==d&&(i===d||i.id!=j.userID)&&(j.user=y[j.userID],n.message.display(j))},display:function(b){t.append(c.templates.message(b)),n.message.scroll.test(),a.proxy(c.onMessage,t.children().last())()}},expand:function(){o.addClass(e.expand),a.proxy(c.onExpand,o)(),n.refresh()},contract:function(){o.removeClass(e.expand),a.proxy(c.onContract,o)(),n.refresh()},event:{input:{keydown:function(a){13==a.which&&v.addClass(e.down)},keyup:function(a){13==a.which&&(v.removeClass(e.down),n.event.submit())}},submit:function(){var a=u.val(),b=o.data("user");b===d||n.utils.emptyString(a)||(n.message.send(a),n.message.display({user:b,text:a}),n.message.scroll.move(),u.val(""))},toggleExpand:function(){o.hasClass(e.expand)?(p.removeClass(e.active),n.contract()):(p.addClass(e.active),n.expand())},toggleUserList:function(){t.is(":animated")||(q.hasClass(e.active)?(q.removeClass("active"),n.user.list.hide()):(q.addClass(e.active),n.user.list.show()))}},utils:{emptyString:function(a){return"string"==typeof a?-1==a.search(/\S/):!1}},setting:function(b,e){return e===d?c[b]:(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e,void 0)},internal:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){c.debug&&(c.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,c.name+":"),n.debug.apply(console,arguments)))},verbose:function(){c.verbose&&c.debug&&(c.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,c.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;c.performance&&(b=(new Date).getTime(),e=time||b,d=b-e,time=b,performance.push({Element:element,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=c.name+":",e=0;time=!1,clearTimeout(n.performance.timer),a.each(performance,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",moduleSelector&&(b+=" '"+moduleSelector+"'"),b+=" ("+$allDropdowns.size()+")",(console.group!==d||console.table!==d)&&performance.length>0&&(console.groupCollapsed(b),console.table?console.table(performance):a.each(performance,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(b,c,e){var f,g;return c=c||queryArguments,e=element||e,"string"==typeof b&&w!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(b,c){a.isPlainObject(w[c])&&b!=f?w=w[c]:w[c]!==d?g=w[c]:n.error(h.method)})),a.isFunction(g)?g.apply(e,c):g||!1}},methodInvoked?(w===d&&n.initialize(),n.invoke(query)):(w!==d&&n.destroy(),n.initialize())}),invokedResponse?invokedResponse:this},a.fn.chatroom.settings={name:"Chat",debug:!1,namespace:"chat",channel:"present-chat",onJoin:function(){},onMessage:function(){},onExpand:function(){},onContract:function(){},customEvents:{},partingMessages:!1,userCount:!0,randomColor:!0,speed:300,easing:"easeOutQuint",scrollArea:9999,endpoint:{message:!1,authentication:!1},error:{method:"The method you called is not defined",endpoint:"Please define a message and authentication endpoint.",key:"You must specify a pusher key and channel.",pusher:"You must include the Pusher library."},className:{expand:"expand",active:"active",hover:"hover",down:"down",loading:"loading"},selector:{userCount:".actions .message",userListButton:".actions .list.button",expandButton:".actions .expand.button",room:".room",userList:".room .list",log:".room .log",message:".room .log .message",author:".room log .message .author",messageInput:".talk input",messageButton:".talk .send.button"},templates:{userCount:function(a){return a+" users in chat"},color:function(){var a=["#000000","#333333","#666666","#999999","#CC9999","#CC6666","#CC3333","#993333","#663333","#CC6633","#CC9966","#CC9933","#999966","#CCCC66","#99CC66","#669933","#669966","#33A3CC","#336633","#33CCCC","#339999","#336666","#336699","#6666CC","#9966CC","#333399","#663366","#996699","#993366","#CC6699"];return a[Math.floor(Math.random()*a.length)]},message:function(a){var b="";return a.user.isAdmin?(a.user.color="#55356A",b+='
',b+=''):b+='
',b+="

",b+=a.user.color!==d?''+a.user.name+": ":''+a.user.name+": ",b+=""+a.text+"

"+"
"},joined:function(a){return typeof a.name!==d?'
'+a.name+" has joined the chat.
":!1},left:function(a){return typeof a.name!==d?'
'+a.name+" has left the chat.
":!1},userList:function(a){var b="";return a.isAdmin&&(a.color="#55356A"),b+='
'+'
'+' <img src="'+a.avatarURL+'">'+"
",b+=a.color!==d?'

<a href="/users/'+a.id+'" target="_blank" style="color: '+a.color+';">'+a.name+"</a>

":'

<a href="/users/'+a.id+'" target="_blank">'+a.name+"</a>

",b+="
"}}}}(jQuery,window,document),function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.checkbox.settings,b),g=f.className,h=f.namespace,i=f.error,j="."+h,k="module-"+h,l=e.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return e.each(function(){var b,e=a(this),h=a(this).next(f.selector.label).first(),r=a(this).find(f.selector.input),s=e.selector||"",t=e.data(k),u=this;b={initialize:function(){b.verbose("Initializing checkbox",f),f.context&&""!==s?(b.verbose("Adding delegated events"),a(u,f.context).on(s,"click"+j,b.toggle).on(s+" + "+f.selector.label,"click"+j,b.toggle)):(e.on("click"+j,b.toggle).data(k,b),h.on("click"+j,b.toggle)),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),t=b,e.data(k,b)},destroy:function(){b.verbose("Destroying previous module"),e.off(j).removeData(k)},is:{radio:function(){return e.hasClass(g.radio)}},can:{disable:function(){return"boolean"==typeof f.required?f.required:!b.is.radio()}},enable:function(){b.debug("Enabling checkbox",r),r.prop("checked",!0),a.proxy(f.onChange,r.get())(),a.proxy(f.onEnable,r.get())()},disable:function(){b.debug("Disabling checkbox"),r.prop("checked",!1),a.proxy(f.onChange,r.get())(),a.proxy(f.onDisable,r.get())()},toggle:function(){b.verbose("Determining new checkbox state"),r.prop("checked")!==d&&r.prop("checked")?b.can.disable()&&b.disable():b.enable()},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=m||c,d=c-e,m=c,n.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",e=0;m=!1,clearTimeout(b.performance.timer),a.each(n,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",l&&(c+=" '"+l+"'"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(c),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(e,f,g){var h,j,k;return f=f||q,g=u||g,"string"==typeof e&&t!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(t[f])&&c!=h)t=t[f];else{if(!a.isPlainObject(t[g])||c==h)return t[f]!==d?(j=t[f],!1):t[g]!==d?(j=t[g],!1):(b.error(i.method),!1);t=t[g]}})),a.isFunction(j)?k=j.apply(g,f):j!==d&&(k=j),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),j}},p?(t===d&&b.initialize(),b.invoke(o)):(t!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox], input[type=radio]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dimmer=function(b){var e,f=a(this),g=a.isPlainObject(b)?a.extend(!0,{},a.fn.dimmer.settings,b):a.fn.dimmer.settings,h=g.selector,i=g.namespace,j=g.className,k=g.error,l="."+i,m="module-"+i,n=f.selector||"",o=(new Date).getTime(),p=[],q=arguments[0],r="string"==typeof q,s=[].slice.call(arguments,1),t="ontouchstart"in c.documentElement?"touchstart":"click";return f.each(function(){var b,c,i,u=a(this),v=this,w=u.data(m);i={preinitialize:function(){i.is.dimmer()?(c=u.parent(),b=u):(c=u,i.has.dimmer()?b=c.children(h.dimmer).first():i.create())},initialize:function(){i.debug("Initializing dimmer",g),"hover"==g.on?c.on("mouseenter"+l,i.show).on("mouseleave"+l,i.hide):"click"==g.on&&c.on(t+l,i.toggle),i.is.page()&&(i.debug("Setting as a page dimmer",c),i.set.pageDimmer()),g.closable&&(i.verbose("Adding dimmer close event",b),b.on(t+l,i.event.click)),i.set.dimmable(),i.instantiate()},instantiate:function(){i.verbose("Storing instance of module",i),w=i,u.data(m,w)},destroy:function(){i.verbose("Destroying previous module",b),c.off(l),b.off(l)},event:{click:function(c){i.verbose("Determining if event occured on dimmer",c),(0===b.find(c.target).size()||a(c.target).is(h.content))&&(i.hide(),c.stopImmediatePropagation())}},addContent:function(c){var d=a(c).detach();i.debug("Add content to dimmer",d),d.parent()[0]!==b[0]&&b.append(d)},create:function(){return b=a(g.template.dimmer()),b.appendTo(c)},animate:{show:function(c){c=c||function(){},i.set.dimmed(),a.fn.transition!==d?b.transition(g.transition+" in",i.get.duration(),function(){i.set.active(),c()}):(i.verbose("Showing dimmer animation with javascript"),b.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(i.get.duration(),1,function(){b.removeAttr("style"),i.set.active(),c()}))},hide:function(c){c=c||function(){},i.remove.dimmed(),a.fn.transition!==d?(i.verbose("Hiding dimmer with css"),b.transition(g.transition+" out",i.get.duration(),function(){i.remove.active(),c()})):(i.verbose("Hiding dimmer with javascript"),b.stop().fadeOut(i.get.duration(),function(){b.removeAttr("style"),i.remove.active(),c()}))}},get:{dimmer:function(){return b},duration:function(){return"object"==typeof g.duration?i.is.active()?g.duration.hide:g.duration.show:g.duration}},has:{dimmer:function(){return u.children(h.dimmer).size()>0}},is:{dimmer:function(){return u.is(h.dimmer)},dimmable:function(){return u.is(h.dimmable)},active:function(){return b.hasClass(j.active)},animating:function(){return b.is(":animated")||b.hasClass(j.transition)},page:function(){return c.is("body")},enabled:function(){return!c.hasClass(j.disabled)},disabled:function(){return c.hasClass(j.disabled)},pageDimmer:function(){return b.hasClass(j.pageDimmer)}},can:{show:function(){return!b.hasClass(j.disabled)}},set:{active:function(){b.removeClass(j.transition).addClass(j.active)},dimmable:function(){c.addClass(j.dimmable)},dimmed:function(){c.addClass(j.dimmed)},pageDimmer:function(){b.addClass(j.pageDimmer)},disabled:function(){b.addClass(j.disabled)}},remove:{active:function(){b.removeClass(j.transition).removeClass(j.active)},dimmed:function(){c.removeClass(j.dimmed)},disabled:function(){b.removeClass(j.disabled)}},show:function(c){i.debug("Showing dimmer",b,g),i.is.active()||i.is.animating()||!i.is.enabled()?i.debug("Dimmer is already shown or disabled"):(i.animate.show(c),a.proxy(g.onShow,v)(),a.proxy(g.onChange,v)())},hide:function(c){i.is.active()&&!i.is.animating()?(i.debug("Hiding dimmer",b),i.animate.hide(c),a.proxy(g.onHide,v)(),a.proxy(g.onChange,v)()):i.debug("Dimmer is not visible")},toggle:function(){i.verbose("Toggling dimmer visibility",b),i.is.active()?i.hide():i.show()},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,c){return c===d?i[b]:(a.isPlainObject(b)?a.extend(!0,i,b):i[b]=c,void 0)},debug:function(){g.debug&&(g.performance?i.performance.log(arguments):(i.debug=Function.prototype.bind.call(console.info,console,g.name+":"),i.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?i.performance.log(arguments):(i.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),i.verbose.apply(console,arguments)))},error:function(){i.error=Function.prototype.bind.call(console.error,console,g.name+":"),i.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;g.performance&&(b=(new Date).getTime(),d=o||b,c=b-d,o=b,p.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(i.performance.timer),i.performance.timer=setTimeout(i.performance.display,100)},display:function(){var b=g.name+":",c=0;o=!1,clearTimeout(i.performance.timer),a.each(p,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",n&&(b+=" '"+n+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(b),console.table?console.table(p):a.each(p,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(b,c,f){var g,h,j;return c=c||s,f=v||f,"string"==typeof b&&w!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(w[e])&&c!=g)w=w[e];else{if(!a.isPlainObject(w[f])||c==g)return w[e]!==d?(h=w[e],!1):w[f]!==d?(h=w[f],!1):(i.error(k.method),!1);w=w[f]}})),a.isFunction(h)?j=h.apply(f,c):h!==d&&(j=h),a.isArray(e)?e.push(j):"string"==typeof e?e=[e,j]:j!==d&&(e=j),h}},i.preinitialize(),r?(w===d&&i.initialize(),i.invoke(q)):(w!==d&&i.destroy(),i.initialize())}),e!==d?e:this},a.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",verbose:!0,debug:!0,performance:!0,transition:"fade",on:!1,closable:!0,duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},selector:{dimmable:".ui.dimmable",dimmer:".ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return a("<div />").attr("class","ui dimmer")}},className:{active:"active",dimmable:"ui dimmable",dimmed:"dimmed",disabled:"disabled",pageDimmer:"page",hide:"hide",show:"show",transition:"transition"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=f.selector||"",i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1);return f.each(function(){var n,o=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,p=o.className,q=o.metadata,r=o.namespace,s=o.selector,t=o.error,u="."+r,v="module-"+r,w="ontouchstart"in c.documentElement,x=a(this),y=x.find(s.item),z=x.find(s.text),A=x.find(s.input),B=x.children(s.menu),C=this,D=x.data(v);n={initialize:function(){n.debug("Initializing dropdown",o),w?x.on("touchstart"+u,n.event.test.toggle):"click"==o.on?x.on("click"+u,n.event.test.toggle):"hover"==o.on?x.on("mouseenter"+u,n.delay.show).on("mouseleave"+u,n.delay.hide):x.on(o.on+u,n.toggle),"updateForm"==o.action&&n.set.selected(),y.on("mouseenter"+u,n.event.item.mouseenter).on("mouseleave"+u,n.event.item.mouseleave).on(n.get.selectEvent()+u,n.event.item.click),n.instantiate()},instantiate:function(){n.verbose("Storing instance of dropdown",n),x.data(v,n)},destroy:function(){n.verbose("Destroying previous dropdown for",x),y.off(u),x.off(u).removeData(v)},event:{test:{toggle:function(a){n.determine.intent(a,n.toggle),a.stopImmediatePropagation()},hide:function(a){n.determine.intent(a,n.hide),a.stopPropagation()}},item:{mouseenter:function(){var b=a(this).find(s.menu),c=a(this).siblings(s.item).children(s.menu);b.size()>0&&(clearTimeout(n.itemTimer),n.itemTimer=setTimeout(function(){n.animate.hide(!1,c),n.verbose("Showing sub-menu",b),n.animate.show(!1,b)},2*o.delay.show))},mouseleave:function(){var b=a(this).find(s.menu);b.size()>0&&(clearTimeout(n.itemTimer),n.itemTimer=setTimeout(function(){n.verbose("Hiding sub-menu",b),n.animate.hide(!1,b)},o.delay.hide))},click:function(){var b=a(this),c=b.data(q.text)||b.text(),d=b.data(q.value)||c.toLowerCase();0===b.find(s.menu).size()&&(n.verbose("Adding active state to selected item"),y.removeClass(p.active),b.addClass(p.active),n.determine.selectAction(c,d),a.proxy(o.onChange,C)(d,c))}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(b,c){n.verbose("Determining action",o.action),"auto"==o.action?n.is.selection()?(n.debug("Selection dropdown used updating form",b,c),n.updateForm(b,c)):(n.debug("No action specified hiding dropdown",b,c),n.hide()):a.isFunction(n[o.action])?(n.verbose("Triggering preset action",o.action,b,c),n[o.action](b,c)):a.isFunction(o.action)?(n.verbose("Triggering user action",o.action,b,c),o.action(b,c)):n.error(t.action)},intent:function(b,c){n.debug("Determining whether event occurred in dropdown",b.target),c=c||function(){},0===a(b.target).closest(B).size()?(n.verbose("Triggering event",c),c()):n.verbose("Event occurred in dropdown, canceling callback")}},bind:{intent:function(){n.verbose("Binding hide intent event to document"),g.on(n.get.selectEvent(),n.event.test.hide)}},unbind:{intent:function(){n.verbose("Removing hide intent event from document"),g.off(n.get.selectEvent())}},nothing:function(){},changeText:function(a){n.set.text(a),n.hide()},updateForm:function(a,b){n.set.text(a),n.set.value(b),n.hide()},get:{selectEvent:function(){return w?"touchstart":"click"},text:function(){return z.text()},value:function(){return A.val()},item:function(b){var c;return b=b||A.val(),y.each(function(){a(this).data(q.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){n.debug("Changing text",a,z),z.removeClass(p.placeholder),z.text(a)},value:function(a){n.debug("Adding selected value to hidden input",a,A),A.val(a)},active:function(){x.addClass(p.active)},visible:function(){x.addClass(p.visible)},selected:function(a){var b,c=n.get.item(a);c&&(n.debug("Setting selected menu item to",c),b=c.data(q.text)||c.text(),y.removeClass(p.active),c.addClass(p.active),n.set.text(b))}},remove:{active:function(){x.removeClass(p.active)},visible:function(){x.removeClass(p.visible)}},is:{selection:function(){return x.hasClass(p.selection)},visible:function(a){return a?a.is(":animated, :visible"):B.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):B.is(":not(:animated, :visible)")}},can:{click:function(){return w||"click"==o.on},show:function(){return!x.hasClass(p.disabled)}},animate:{show:function(b,c){var e=c||B;b=b||function(){},n.is.hidden(e)&&(n.verbose("Doing menu show animation",e),"none"==o.transition?b():a.fn.transition!==d?e.transition({animation:o.transition+" in",duration:o.duration,complete:b,queue:!1}):"slide down"==o.transition?e.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},o.duration,"easeOutQuad",n.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(n.event.resetStyle,this)(),b()}):"fade"==o.transition?e.hide().clearQueue().fadeIn(o.duration,function(){a.proxy(n.event.resetStyle,this)(),b()}):n.error(t.transition))},hide:function(b,c){var e=c||B;b=b||function(){},n.is.visible(e)&&(n.verbose("Doing menu hide animation",e),a.fn.transition!==d?e.transition({animation:o.transition+" out",duration:o.duration,complete:b,queue:!1}):"none"==o.transition?b():"slide down"==o.transition?e.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",n.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(n.event.resetStyle,this)(),b()}):"fade"==o.transition?e.show().clearQueue().fadeOut(150,function(){a.proxy(n.event.resetStyle,this)(),b()}):n.error(t.transition))}},show:function(){n.debug("Checking if dropdown can show"),n.is.hidden()&&(n.hideOthers(),n.set.active(),n.animate.show(n.set.visible),n.can.click()&&n.bind.intent(),a.proxy(o.onShow,C)())},hide:function(){n.is.visible()&&(n.debug("Hiding dropdown"),n.can.click()&&n.unbind.intent(),n.remove.active(),n.animate.hide(n.remove.visible),a.proxy(o.onHide,C)())},delay:{show:function(){n.verbose("Delaying show event to ensure user intent"),clearTimeout(n.timer),n.timer=setTimeout(n.show,o.delay.show)},hide:function(){n.verbose("Delaying hide event to ensure user intent"),clearTimeout(n.timer),n.timer=setTimeout(n.hide,o.delay.hide)}},hideOthers:function(){n.verbose("Finding other dropdowns to hide"),f.not(x).has(s.menu+":visible").dropdown("hide")},toggle:function(){n.verbose("Toggling menu visibility"),n.is.hidden()?n.show():n.hide()},setting:function(b,c){return c===d?o[b]:(a.isPlainObject(b)?a.extend(!0,o,b):o[b]=c,void 0)},internal:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){o.debug&&(o.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,o.name+":"),n.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,o.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;o.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Element:C,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=o.name+":",c=0;i=!1,clearTimeout(n.performance.timer),a.each(j,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",h&&(b+=" '"+h+"'"),(console.group!==d||console.table!==d)&&j.length>0&&(console.groupCollapsed(b),console.table?console.table(j):a.each(j,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(b,c,f){var g,h,i;return c=c||m,f=C||f,"string"==typeof b&&D!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(D[e])&&c!=g)D=D[e];else{if(!a.isPlainObject(D[f])||c==g)return D[e]!==d?(h=D[e],!1):D[f]!==d?(h=D[f],!1):(n.error(t.method),!1);D=D[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},l?(D===d&&n.initialize(),n.invoke(k)):(D!==d&&n.destroy(),n.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"auto",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible",selection:"selection"}}}(jQuery,window,document),function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.fn.modal.settings,k=j.selector,l=j.className,m=j.namespace,n=j.error,o="."+m,p="module-"+m,q=g.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return g.each(function(){var e,m,w,x=a(this),y=a(j.context),z=g.not(x),A=x.find(k.close),B=this,C=x.data(p);w={initialize:function(){w.verbose("Initializing dimmer",y),m=y.dimmer("add content",x).dimmer("get dimmer"),w.verbose("Attaching close events",A),A.on("click"+o,w.event.close),h.on("resize",function(){w.event.debounce(w.refresh,50)}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of modal"),C=w,x.data(p,C)},destroy:function(){w.verbose("Destroying previous modal"),x.off(o)},refresh:function(){w.remove.scrolling(),w.cacheSizes(),w.set.type(),w.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(w[c])?w[c]:w.show,d.size()>0?(w.debug("Attaching modal events to element",b,c),d.off(o).on("click"+o,c)):w.error(n.notFound)},event:{close:function(){w.verbose("Close button pressed"),y.dimmer("hide")},debounce:function(a,b){clearTimeout(w.timer),w.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(w.debug("Escape key pressed hiding modal"),y.dimmer("hide"),a.preventDefault())},resize:function(){y.dimmer("is active")&&w.refresh()}},toggle:function(){w.is.active()?w.hide():w.show()},show:function(){w.showDimmer(),w.cacheSizes(),w.set.position(),w.hideAll(),j.transition&&a.fn.transition!==d?x.transition(j.transition+" in",j.duration,function(){w.set.active(),w.save.focus(),w.set.type()}):x.fadeIn(j.duration,j.easing,function(){w.set.active(),w.save.focus(),w.set.type()}),w.debug("Triggering dimmer"),a.proxy(j.onShow,B)()},showDimmer:function(){w.debug("Showing modal"),w.set.dimmerSettings(),y.dimmer("show")},hideDimmer:function(){y.dimmer("hide")},hide:function(){w.debug("Hiding modal"),i.off("keyup."+o),j.transition&&a.fn.transition!==d?x.transition(j.transition+" out",j.duration,function(){w.remove.active(),w.restore.focus()}):x.fadeOut(j.duration,j.easing,function(){w.remove.active(),w.restore.focus()}),a.proxy(j.onHide,B)()},hideAll:function(){z.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){w.verbose("Adding keyboard shortcuts"),i.on("keyup"+o,w.event.keyboard)}},save:{focus:function(){e=a(c.activeElement).blur()}},restore:{focus:function(){e.focus()}},remove:{active:function(){x.removeClass(l.active)},keyboardShortcuts:function(){w.verbose("Removing keyboard shortcuts"),i.off("keyup"+o)},scrolling:function(){m.removeClass(l.scrolling),x.removeClass(l.scrolling)}},cacheSizes:function(){w.cache={height:x.outerHeight()+j.offset,contextHeight:"body"==j.context?a(b).height():y.height()},w.debug("Caching modal and container sizes",w.cache)},can:{fit:function(){return w.cache.contextHeight>w.cache.height}},is:{active:function(){return x.hasClass(l.active)}},set:{active:function(){x.addClass(l.active)},dimmerSettings:function(){w.debug("Setting dimmer settings",j.closable),y.dimmer("setting","closable",j.closable).dimmer("setting","duration",{show:.95*j.duration,hide:1.05*j.duration}).dimmer("setting","onShow",w.add.keyboardShortcuts).dimmer("setting","onHide",function(){w.hide(),w.remove.keyboardShortcuts()}).dimmer("destroy").dimmer("initialize")},scrolling:function(){m.addClass(l.scrolling),x.addClass(l.scrolling)},type:function(){w.can.fit()?(w.verbose("Modal fits on screen"),w.remove.scrolling()):(w.verbose("Modal cannot fit on screen setting to scrolling"),w.set.scrolling())},position:function(){w.verbose("Centering modal on page",w.cache,w.cache.height/2),w.can.fit()?x.css({top:"",marginTop:-(w.cache.height/2)}):x.css({marginTop:"1em",top:i.scrollTop()})}},setting:function(b,c){return c===d?j[b]:(a.isPlainObject(b)?a.extend(!0,j,b):j[b]=c,void 0)},internal:function(b,c){return c===d?w[b]:(a.isPlainObject(b)?a.extend(!0,w,b):w[b]=c,void 0)},debug:function(){j.debug&&(j.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,j.name+":"),w.debug.apply(console,arguments)))},verbose:function(){j.verbose&&j.debug&&(j.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,j.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,j.name+":"),w.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;j.performance&&(b=(new Date).getTime(),d=r||b,c=b-d,r=b,s.push({Element:B,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,100)},display:function(){var b=j.name+":",c=0;r=!1,clearTimeout(w.performance.timer),a.each(s,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",q&&(b+=" '"+q+"'"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(b),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(b,c,e){var g,h,i;return c=c||v,e=B||e,"string"==typeof b&&C!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(C[e])&&c!=g)C=C[e];else{if(!a.isPlainObject(C[f])||c==g)return C[e]!==d?(h=C[e],!1):C[f]!==d?(h=C[f],!1):(w.error(n.method),!1);C=C[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):"string"==typeof f?f=[f,i]:i!==d&&(f=i),h}},u?(C===d&&w.initialize(),w.invoke(t)):(C!==d&&w.destroy(),w.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",verbose:!0,debug:!0,performance:!0,closable:!0,context:"body",duration:500,easing:"easeOutExpo",offset:0,transition:"scale",onShow:function(){},onHide:function(){},selector:{close:".close, .actions .button"},error:{method:"The method you called is not defined."},className:{active:"active",scrolling:"scrolling"}} }(jQuery,window,document),function(a,b,c,d){a.fn.nag=function(c){var e,f=a(this),g=a.extend(!0,{},a.fn.nag.settings,c),h=g.className,i=g.selector,j=g.error,k=g.namespace,l="."+k,m=k+"-module",n=f.selector||"",o=(new Date).getTime(),p=[],q=arguments[0],r="string"==typeof q,s=[].slice.call(arguments,1);return a(this).each(function(){var c,k,t,u,v,w,x,y,z,A=a(this),B=A.find(i.close),C=a(g.context),D=this,E=A.data(m),F=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};z={initialize:function(){z.verbose("Initializing element"),c=A.offset(),k=A.outerHeight(),t=C.outerWidth(),u=C.outerHeight(),v=C.offset(),A.data(m,z),B.on("click"+l,z.dismiss),g.context==b&&"fixed"==g.position&&A.addClass(h.fixed),g.sticky&&(z.verbose("Adding scroll events"),"absolute"==g.position?C.on("scroll"+l,z.event.scroll).on("resize"+l,z.event.scroll):a(b).on("scroll"+l,z.event.scroll).on("resize"+l,z.event.scroll),a.proxy(z.event.scroll,this)()),g.displayTime>0&&setTimeout(z.hide,g.displayTime),z.should.show()?A.is(":visible")||z.show():z.hide()},destroy:function(){z.verbose("Destroying instance"),A.removeData(m).off(l),g.sticky&&C.off(l)},refresh:function(){z.debug("Refreshing cached calculations"),c=A.offset(),k=A.outerHeight(),t=C.outerWidth(),u=C.outerHeight(),v=C.offset()},show:function(){z.debug("Showing nag",g.animation.show),"fade"==g.animation.show?A.fadeIn(g.duration,g.easing):A.slideDown(g.duration,g.easing)},hide:function(){z.debug("Showing nag",g.animation.hide),"fade"==g.animation.show?A.fadeIn(g.duration,g.easing):A.slideUp(g.duration,g.easing)},onHide:function(){z.debug("Removing nag",g.animation.hide),A.remove(),g.onHide&&g.onHide()},stick:function(){if(z.refresh(),"fixed"==g.position){var c=a(b).prop("pageYOffset")||a(b).scrollTop(),d=A.hasClass(h.bottom)?v.top+(u-k)-c:v.top-c;A.css({position:"fixed",top:d,left:v.left,width:t-g.scrollBarWidth})}else A.css({top:x})},unStick:function(){A.css({top:""})},dismiss:function(a){g.storageMethod&&z.storage.set(g.storedKey,g.storedValue),z.hide(),a.stopImmediatePropagation(),a.preventDefault()},should:{show:function(){return g.persist?(z.debug("Persistent nag is set, can show nag"),!0):z.storage.get(g.storedKey)!=g.storedValue?(z.debug("Stored value is not set, can show nag",z.storage.get(g.storedKey)),!0):(z.debug("Stored value is set, cannot show nag",z.storage.get(g.storedKey)),!1)},stick:function(){return w=C.prop("pageYOffset")||C.scrollTop(),x=A.hasClass(h.bottom)?u-A.outerHeight()+w:w,x>c.top?!0:"fixed"==g.position?!0:!1}},storage:{set:function(c,e){z.debug("Setting stored value",c,e,g.storageMethod),"local"==g.storageMethod&&b.store!==d?b.store.set(c,e):a.cookie!==d?a.cookie(c,e):z.error(j.noStorage)},get:function(c){return z.debug("Getting stored value",c,g.storageMethod),"local"==g.storageMethod&&b.store!==d?b.store.get(c):a.cookie!==d?a.cookie(c):(z.error(j.noStorage),void 0)}},event:{scroll:function(){y!==d&&clearTimeout(y),y=setTimeout(function(){z.should.stick()?F(z.stick):z.unStick()},g.lag)}},setting:function(b,c){return z.debug("Changing setting",b,c),c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,c){return z.debug("Changing internal",b,c),c===d?z[b]:(a.isPlainObject(b)?a.extend(!0,z,b):z[b]=c,void 0)},debug:function(){g.debug&&(g.performance?z.performance.log(arguments):(z.debug=Function.prototype.bind.call(console.info,console,g.name+":"),z.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?z.performance.log(arguments):(z.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),z.verbose.apply(console,arguments)))},error:function(){z.error=Function.prototype.bind.call(console.error,console,g.name+":"),z.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;g.performance&&(b=(new Date).getTime(),d=o||b,c=b-d,o=b,p.push({Element:D,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(z.performance.timer),z.performance.timer=setTimeout(z.performance.display,100)},display:function(){var b=g.name+":",c=0;o=!1,clearTimeout(z.performance.timer),a.each(p,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",n&&(b+=" '"+n+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(b),console.table?console.table(p):a.each(p,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(b,c,f){var g,h,i;return c=c||s,f=D||f,"string"==typeof b&&E!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(E[e])&&c!=g)E=E[e];else{if(!a.isPlainObject(E[f])||c==g)return E[e]!==d?(h=E[e],!1):E[f]!==d?(h=E[f],!1):(z.error(j.method),!1);E=E[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},r?(E===d&&z.initialize(),z.invoke(q)):(E!==d&&z.destroy(),z.initialize())}),e!==d?e:this},a.fn.nag.settings={name:"Nag",verbose:!0,debug:!0,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!1,lag:0,context:b,error:{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:".icon.close"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document),function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a(c),i=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.fn.popup.settings,j=g.selector||"",k=(new Date).getTime(),l=[],m=arguments[0],n="string"==typeof m,o=[].slice.call(arguments,1);return g.each(function(){var c,e=a(this),g=a(b),p=e.offsetParent(),q=i.inline?e.next(i.selector.popup):g.children(i.selector.popup).last(),r=0,s="."+i.namespace,t=i.namespace+"-module",u=i.selector,v=i.className,w=i.error,x=i.metadata,y=i.namespace,z=this,A=e.data(t);c={initialize:function(){c.debug("Initializing module",e),"hover"==i.on?e.on("mouseenter"+s,c.event.mouseenter).on("mouseleave"+s,c.event.mouseleave):e.on(i.on+""+s,c.event[i.on]),g.on("resize"+s,c.event.resize),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),A=c,e.data(t,A)},refresh:function(){q=i.inline?e.next(u.popup):g.children(u.popup).last(),p=e.offsetParent()},destroy:function(){c.debug("Destroying previous module"),e.off(s).removeData(t)},event:{mouseenter:function(b){var d=this;c.timer=setTimeout(function(){a.proxy(c.toggle,d)(),a(d).hasClass(v.visible)&&b.stopPropagation()},i.delay)},mouseleave:function(){clearTimeout(c.timer),e.is(":visible")&&c.hide()},click:function(b){a.proxy(c.toggle,this)(),a(this).hasClass(v.visible)&&b.stopPropagation()},resize:function(){q.is(":visible")&&c.position()}},create:function(){c.debug("Creating pop-up html");var b=e.data(x.html)||i.html,d=e.data(x.variation)||i.variation,f=e.data(x.title)||i.title,g=e.data(x.content)||e.attr("title")||i.content;b||g||f?(b||(b=i.template({title:f,content:g})),q=a("<div/>").addClass(v.popup).addClass(d).html(b),i.inline?(c.verbose("Inserting popup element inline"),q.insertAfter(e)):(c.verbose("Appending popup element to body"),q.appendTo(a("body"))),a.proxy(i.onInit,q)()):c.error(w.content)},remove:function(){c.debug("Removing popup"),q.remove()},get:{offstagePosition:function(){var d={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},e={width:q.width(),height:q.outerHeight(),position:q.offset()},f={},g=[];return e.position&&(f={top:d.top>e.position.top,bottom:e.position.top+e.height>d.bottom,right:e.position.left+e.width>d.right,left:d.left>e.position.left}),c.verbose("Checking if outside viewable area",e.position),a.each(f,function(a,b){b&&g.push(a)}),g.length>0?g.join(" "):!1},nextPosition:function(a){switch(a){case"top left":a="bottom left";break;case"bottom left":a="top right";break;case"top right":a="bottom right";break;case"bottom right":a="top center";break;case"top center":a="bottom center";break;case"bottom center":a="right center";break;case"right center":a="left center";break;case"left center":a="top center"}return a}},toggle:function(){e=a(this),c.debug("Toggling pop-up"),c.refresh(),e.hasClass(v.visible)||("click"==i.on&&c.hideAll(),c.show())},position:function(d,f){var h,j,k=(a(b).width(),a(b).height(),e.outerWidth()),l=e.outerHeight(),m=q.width(),n=q.outerHeight(),o=i.inline?e.position():e.offset(),s=i.inline?p.outerWidth():g.outerWidth(),t=i.inline?p.outerHeight():g.outerHeight();switch(d=d||e.data(x.position)||i.position,f=f||e.data(x.arrowOffset)||i.arrowOffset,c.debug("Calculating offset for position",d),d){case"top left":h={bottom:t-o.top+i.distanceAway,right:s-o.left-k-f,top:"auto",left:"auto"};break;case"top center":h={bottom:t-o.top+i.distanceAway,left:o.left+k/2-m/2+f,top:"auto",right:"auto"};break;case"top right":h={top:"auto",bottom:t-o.top+i.distanceAway,left:o.left+f};break;case"left center":h={top:o.top+l/2-n/2,right:s-o.left+i.distanceAway-f,left:"auto",bottom:"auto"};break;case"right center":h={top:o.top+l/2-n/2,left:o.left+k+i.distanceAway+f,bottom:"auto",right:"auto"};break;case"bottom left":h={top:o.top+l+i.distanceAway,right:s-o.left-k-f,left:"auto",bottom:"auto"};break;case"bottom center":h={top:o.top+l+i.distanceAway,left:o.left+k/2-m/2+f,bottom:"auto",right:"auto"};break;case"bottom right":h={top:o.top+l+i.distanceAway,left:o.left+f,bottom:"auto",right:"auto"}}return a.extend(h,{width:q.width()+1}),q.attr("class",d+" "+v.popup+" "+v.loading).css(h),j=c.get.offstagePosition(),j?(c.debug("Element is outside boundaries ",j),i.maxSearchDepth>r?(d=c.get.nextPosition(d),r++,c.debug("Trying new position: ",d),c.position(d)):(c.error(w.recursion),r=0,!1)):(c.debug("Position is on stage",d),r=0,!0)},show:function(){c.debug("Showing pop-up",i.transition),0===q.size()&&c.create(),c.position(),e.addClass(v.visible),q.removeClass(v.loading),i.transition&&a.fn.transition!==d?q.transition(i.transition+" in",i.duration):q.stop().fadeIn(i.duration,i.easing),"click"==i.on&&i.clicktoClose&&(c.debug("Binding popup close event"),h.on("click."+y,c.gracefully.hide)),a.proxy(i.onShow,q)()},hideAll:function(){a(u.popup).filter(":visible").popup("hide")},hide:function(){e.removeClass(v.visible),q.is(":visible")&&(c.debug("Hiding pop-up"),i.transition&&a.fn.transition!==d?q.transition(i.transition+" out",i.duration,c.reset):q.stop().fadeOut(i.duration,i.easing,c.reset)),"click"==i.on&&i.clicktoClose&&h.off("click."+y),a.proxy(i.onHide,q)(),i.inline||c.remove()},reset:function(){c.verbose("Resetting inline styles"),q.attr("style","").removeAttr("style")},gracefully:{hide:function(b){0===a(b.target).closest(u.popup).size()&&c.hide()}},setting:function(b,c){return c===d?i[b]:(a.isPlainObject(b)?a.extend(!0,i,b):i[b]=c,void 0)},internal:function(b,e){return e===d?c[b]:(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e,void 0)},debug:function(){i.debug&&(i.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,i.name+":"),c.debug.apply(console,arguments)))},verbose:function(){i.verbose&&i.debug&&(i.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,i.name+":"),c.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;i.performance&&(b=(new Date).getTime(),e=k||b,d=b-e,k=b,l.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,100)},display:function(){var b=i.name+":",e=0;k=!1,clearTimeout(c.performance.timer),a.each(l,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",j&&(b+=" '"+j+"'"),(console.group!==d||console.table!==d)&&l.length>0&&(console.groupCollapsed(b),console.table?console.table(l):a.each(l,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(b,e,g){var h,i,j;return e=e||o,g=z||g,"string"==typeof b&&A!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(e,f){var g=e!=h?f+b[e+1].charAt(0).toUpperCase()+b[e+1].slice(1):b;if(a.isPlainObject(A[f])&&e!=h)A=A[f];else{if(!a.isPlainObject(A[g])||e==h)return A[f]!==d?(i=A[f],!1):A[g]!==d?(i=A[g],!1):(c.error(w.method),!1);A=A[g]}})),a.isFunction(i)?j=i.apply(g,e):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},n?(A===d&&c.initialize(),c.invoke(m)):(A!==d&&c.destroy(),c.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",debug:!0,verbose:!0,performance:!0,namespace:"popup",onInit:function(){},onShow:function(){},onHide:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",clicktoClose:!0,position:"top center",delay:150,inline:!0,duration:150,easing:"easeOutQuint",transition:"scale",distanceAway:0,arrowOffset:0,maxSearchDepth:10,error:{content:"Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{arrowOffset:"arrowOffset",content:"content",html:"html",position:"position",title:"title",variation:"variation"},className:{popup:"ui popup",visible:"visible",loading:"loading"},selector:{popup:".ui.popup"},template:function(a){var b="";return typeof a!==d&&(typeof a.title!==d&&a.title&&(b+='
'+a.title+'
'),typeof a.content!==d&&a.content&&(b+='
'+a.content+"
")),b}}}(jQuery,window,document),function(a,b,c,d){a.fn.rating=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var e,l=a.extend(!0,{},a.fn.rating.settings,b),m=l.namespace,n=l.className,o=l.metadata,p=l.selector,q=l.error,r="."+m,s="module-"+m,t=a(this),u=t.find(p.icon),v=this,w=t.data(s);e={initialize:function(){e.verbose("Initializing rating module",l),l.interactive?e.enable():e.disable(),l.initialRating&&(e.debug("Setting initial rating"),e.setRating(l.initialRating)),t.data(o.rating)&&(e.debug("Rating found in metadata"),e.setRating(t.data(o.rating))),e.instantiate()},instantiate:function(){e.verbose("Instantiating module",l),t.data(s,e)},destroy:function(){t.removeData(s),u.off(r)},event:{mouseenter:function(){var b=a(this);b.nextAll().removeClass(n.hover),t.addClass(n.hover),b.addClass(n.hover).prevAll().addClass(n.hover)},mouseleave:function(){t.removeClass(n.hover),u.removeClass(n.hover)},click:function(){var b=a(this),c=e.getRating(),d=u.index(b)+1;l.clearable&&c==d?e.clearRating():e.setRating(d)}},clearRating:function(){e.debug("Clearing current rating"),e.setRating(0)},getRating:function(){var a=u.filter("."+n.active).size();return e.verbose("Current rating retrieved",a),a},enable:function(){e.debug("Setting rating to interactive mode"),u.on("mouseenter"+r,e.event.mouseenter).on("mouseleave"+r,e.event.mouseleave).on("click"+r,e.event.click),t.addClass(n.active)},disable:function(){e.debug("Setting rating to read-only mode"),u.off(r),t.removeClass(n.active)},setRating:function(b){var c=b-1>=0?b-1:0,d=u.eq(c);t.removeClass(n.hover),u.removeClass(n.hover).removeClass(n.active),b>0&&(e.verbose("Setting current rating to",b),d.addClass(n.active).prevAll().addClass(n.active)),a.proxy(l.onRate,v)(b)},setting:function(b,c){return c===d?l[b]:(a.isPlainObject(b)?a.extend(!0,l,b):l[b]=c,void 0)},internal:function(b,c){return c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},debug:function(){l.debug&&(l.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,l.name+":"),e.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,l.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;l.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=l.name+":",c=0;g=!1,clearTimeout(e.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,f,g){var h,i,j;return f=f||k,g=v||g,"string"==typeof b&&w!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(w[f])&&c!=h)w=w[f];else{if(!a.isPlainObject(w[g])||c==h)return w[f]!==d?(i=w[f],!1):w[g]!==d?(i=w[g],!1):(e.error(q.method),!1);w=w[g]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(c)?c.push(j):"string"==typeof c?c=[c,j]:j!==d&&(c=j),i}},j?(w===d&&e.initialize(),e.invoke(i)):(w!==d&&e.destroy(),e.initialize())}),c!==d?c:this},a.fn.rating.settings={name:"Rating",namespace:"rating",verbose:!0,debug:!0,performance:!0,initialRating:0,interactive:!0,clearable:!1,onRate:function(){},error:{method:"The method you called is not defined"},metadata:{rating:"rating"},className:{active:"active",hover:"hover",loading:"loading"},selector:{icon:".icon"}}}(jQuery,window,document),function(a,b,c,d){a.fn.search=function(c,e){var f,g=a(this),h=a.extend(!0,{},a.fn.search.settings,e),i=h.className,j=h.selector,k=h.error,l=h.namespace,m="."+l,n=l+"-module",o=g.selector||"",p=(new Date).getTime(),q=[],r=arguments[0],s="string"==typeof r,t=[].slice.call(arguments,1);return a(this).each(function(){var e,l=a(this),u=l.find(j.prompt),v=l.find(j.searchButton),w=l.find(j.results),x=(l.find(j.result),l.find(j.category),this),y=l.data(n);e={initialize:function(){e.verbose("Initializing module");var a=u[0],b=a.oninput!==d?"input":a.onpropertychange!==d?"propertychange":"keyup";u.on("focus"+m,e.event.focus).on("blur"+m,e.event.blur).on("keydown"+m,e.handleKeyboard),h.automatic&&u.on(b+m,e.search.throttle),v.on("click"+m,e.search.query),w.on("click"+m,j.result,e.results.select),e.instantiate()},instantiate:function(){e.verbose("Storing instance of module",e),y=e,l.data(n,e)},destroy:function(){e.verbose("Destroying instance"),l.removeData(n)},event:{focus:function(){l.addClass(i.focus),e.results.show()},blur:function(){e.search.cancel(),l.removeClass(i.focus),e.results.hide()}},handleKeyboard:function(b){var c,d=l.find(j.result),f=l.find(j.category),g=b.which,h={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},k=i.active,m=d.index(d.filter("."+k)),n=d.size();if(g==h.escape&&(e.verbose("Escape key pressed, blurring search field"),u.trigger("blur")),w.filter(":visible").size()>0)if(g==h.enter){if(e.verbose("Enter key pressed, selecting active result"),d.filter("."+k).exists())return a.proxy(e.results.select,d.filter("."+k))(),b.preventDefault(),!1}else g==h.upArrow?(e.verbose("Up key pressed, changing active result"),c=0>m-1?m:m-1,f.removeClass(k),d.removeClass(k).eq(c).addClass(k).closest(f).addClass(k),b.preventDefault()):g==h.downArrow&&(e.verbose("Down key pressed, changing active result"),c=m+1>=n?m:m+1,f.removeClass(k),d.removeClass(k).eq(c).addClass(k).closest(f).addClass(k),b.preventDefault());else g==h.enter&&(e.verbose("Enter key pressed, executing query"),e.search.query(),v.addClass(i.down),u.one("keyup",function(){v.removeClass(i.down)}))},search:{cancel:function(){var a=l.data("xhr")||!1;a&&"resolved"!=a.state()&&(e.debug("Cancelling last search"),a.abort())},throttle:function(){var a=u.val(),b=a.length;clearTimeout(e.timer),b>=h.minCharacters?e.timer=setTimeout(e.search.query,h.searchThrottle):e.results.hide()},query:function(){var b=u.val(),d=e.search.cache.read(b);d?(e.debug("Reading result for '"+b+"' from cache"),e.results.add(d)):(e.debug("Querying for '"+b+"'"),"object"==typeof c?e.search.local(b):e.search.remote(b),a.proxy(h.onSearchQuery,l)(b))},local:function(b){var d,f=[],g=[],j=a.isArray(h.searchFields)?h.searchFields:[h.searchFields],k=RegExp("(?:s|^)"+b,"i"),m=RegExp(b,"i");l.addClass(i.loading),a.each(j,function(b,d){a.each(c,function(b,c){"string"==typeof c[d]&&-1==a.inArray(c,f)&&-1==a.inArray(c,g)&&(k.test(c[d])?f.push(c):m.test(c[d])&&g.push(c))})}),d=e.results.generate({results:a.merge(f,g)}),l.removeClass(i.loading),e.search.cache.write(b,d),e.results.add(d)},remote:function(b){var d,f={stateContext:l,url:c,urlData:{query:b},success:function(a){d=e.results.generate(a),e.search.cache.write(b,d),e.results.add(d)},failure:e.error};e.search.cancel(),e.debug("Executing search"),a.extend(!0,f,h.apiSettings),a.api(f)},cache:{read:function(a){var b=l.data("cache");return h.cache&&"object"==typeof b&&b[a]!==d?b[a]:!1},write:function(a,b){var c=l.data("cache")!==d?l.data("cache"):{};c[a]=b,l.data("cache",c)}}},results:{generate:function(b){e.debug("Generating html from response",b);var c=h.templates[h.type],d="";return a.isPlainObject(b.results)&&!a.isEmptyObject(b.results)||a.isArray(b.results)&&b.results.length>0?(h.maxResults>0&&(b.results=a.makeArray(b.results).slice(0,h.maxResults)),b.results.length>0&&(a.isFunction(c)?d=c(b):e.error(k.noTemplate,!1))):d=e.message(k.noResults,"empty"),a.proxy(h.onResults,l)(b),d},add:function(b){("default"==h.onResultsAdd||"default"==a.proxy(h.onResultsAdd,w)(b))&&w.html(b),e.results.show()},show:function(){0===w.filter(":visible").size()&&u.filter(":focus").size()>0&&""!==w.html()&&(w.stop().fadeIn(200),a.proxy(h.onResultsOpen,w)())},hide:function(){w.filter(":visible").size()>0&&(w.stop().fadeOut(200),a.proxy(h.onResultsClose,w)())},select:function(c){e.debug("Search result selected");var d=a(this),f=d.find(".title"),g=f.html();if("default"==h.onSelect||"default"==a.proxy(h.onSelect,this)(c)){var i=d.find("a[href]").eq(0),j=i.attr("href")||!1,k=i.attr("target")||!1;e.results.hide(),u.val(g),j&&("_blank"==k||c.ctrlKey?b.open(j):b.location.href=j)}}},setting:function(b,c){return e.debug("Changing setting",b,c),c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(b,c){return e.debug("Changing internal",b,c),c===d?e[b]:(a.isPlainObject(b)?a.extend(!0,e,b):e[b]=c,void 0)},debug:function(){h.debug&&(h.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,h.name+":"),e.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,h.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;h.performance&&(b=(new Date).getTime(),d=p||b,c=b-d,p=b,q.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=h.name+":",c=0;p=!1,clearTimeout(e.performance.timer),a.each(q,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",o&&(b+=" '"+o+"'"),g.size()>1&&(b+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&q.length>0&&(console.groupCollapsed(b),console.table?console.table(q):a.each(q,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),q=[]}},invoke:function(b,c,g){var h,i,j;return c=c||t,g=x||g,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[f])&&c!=h)y=y[f];else{if(!a.isPlainObject(y[g])||c==h)return y[f]!==d?(i=y[f],!1):y[g]!==d?(i=y[g],!1):(e.error(k.method),!1);y=y[g]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},s?(y===d&&e.initialize(),e.invoke(r)):(y!==d&&e.destroy(),e.initialize())}),f!==d?f:this},a.fn.search.settings={name:"Search Module",namespace:"search",debug:!0,verbose:!0,performance:!0,onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},automatic:"true",type:"simple",minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],apiSettings:{},className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},error:{noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{prompt:".prompt",searchButton:".search.button",results:".results",category:".category",result:".result"},templates:{message:function(a,b){var c="";return a!==d&&b!==d&&(c+='
',c+="empty"==b?'
No Results
'+a+'
':'
'+a+"
",c+="
"),c},categories:function(b){var c="";return b.results!==d?(a.each(b.results,function(b,e){e.results!==d&&e.results.length>0&&(c+='
'+e.name+"
",a.each(e.results,function(a,b){c+='
',c+='<a href="'+b.url+'"></a>',b.image!==d&&(c+='
<img src="'+b.image+'">'+"
"),c+='
',b.price!==d&&(c+='
'+b.price+"
"),b.title!==d&&(c+='
'+b.title+"
"),b.description!==d&&(c+='
'+b.description+"
"),c+="
"}),c+="
")}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1},simple:function(b){var c="";return b.results!==d?(a.each(b.results,function(a,b){c+='<a class="result" href="'+b.url+'">',b.image!==d&&(c+='
<img src="'+b.image+'">'+"
"),c+='
',b.price!==d&&(c+='
'+b.price+"
"),b.title!==d&&(c+='
'+b.title+"
"),b.description!==d&&(c+='
'+b.description+"
"),c+="
</a>"}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1}}}}(jQuery,window,document),function(a,b,c,d){a.fn.shape=function(b){var e,f=a(this),g=f.selector||"",h=a.extend(!0,{},a.fn.shape.settings,b),i=h.namespace,j=h.selector,k=h.error,l=h.className,m="."+i,n="module-"+i,o=(new Date).getTime(),p=[],q=arguments[0],r="string"==typeof q,s=[].slice.call(arguments,1);return f.each(function(){var b,i,t,u=a(this),v=u.find(j.sides),w=u.find(j.side),x=this,y=u.data(n);t={initialize:function(){t.verbose("Initializing module for",x),t.set.defaultSide(),t.instantiate()},instantiate:function(){t.verbose("Storing instance of module",t),y=t,u.data(n,y)},destroy:function(){t.verbose("Destroying previous module for",x),u.removeData(n).off(m)},refresh:function(){t.verbose("Refreshing selector cache for",x),u=a(x),v=a(this).find(j.shape),w=a(this).find(j.side)},repaint:function(){t.verbose("Forcing repaint event");var a=v.get(0)||c.createElement("div");a.offsetWidth},animate:function(a,c){t.verbose("Animating box with properties",a),c=c||function(a){t.verbose("Executing animation callback"),a!==d&&a.stopPropagation(),t.reset(),t.set.active()},h.useCSS?t.get.transitionEvent()?(t.verbose("Starting CSS animation"),u.addClass(l.animating),t.set.stageSize(),t.repaint(),u.addClass(l.css),b.addClass(l.hidden),v.css(a).one(t.get.transitionEvent(),c)):c():(t.verbose("Starting javascript animation"),u.addClass(l.animating).removeClass(l.css),t.set.stageSize(),t.repaint(),b.animate({opacity:0},h.duration,h.easing),v.animate(a,h.duration,h.easing,c))},queue:function(a){t.debug("Queueing animation of",a),v.one(t.get.transitionEvent(),function(){t.debug("Executing queued animation"),setTimeout(function(){u.shape(a)},0)})},reset:function(){t.verbose("Animating states reset"),u.removeClass(l.css).removeClass(l.animating).attr("style","").removeAttr("style"),v.attr("style","").removeAttr("style"),w.attr("style","").removeAttr("style").removeClass(l.hidden),i.removeClass(l.animating).attr("style","").removeAttr("style")},is:{animating:function(){return u.hasClass(l.animating)}},get:{transform:{up:function(){var a={y:-((b.outerHeight()-i.outerHeight())/2),z:-(b.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(-90deg)"}},down:function(){var a={y:-((b.outerHeight()-i.outerHeight())/2),z:-(b.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(90deg)"}},left:function(){var a={x:-((b.outerWidth()-i.outerWidth())/2),z:-(b.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(90deg)"}},right:function(){var a={x:-((b.outerWidth()-i.outerWidth())/2),z:-(b.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(-90deg)"}},over:function(){var a={x:-((b.outerWidth()-i.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(180deg)"}},back:function(){var a={x:-((b.outerWidth()-i.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]},nextSide:function(){return b.next(j.side).size()>0?b.next(j.side):u.find(j.side).first()}},set:{defaultSide:function(){b=u.find("."+h.className.active),i=b.next(j.side).size()>0?b.next(j.side):u.find(j.side).first(),t.verbose("Active side set to",b),t.verbose("Next side set to",i)},stageSize:function(){var a={width:i.outerWidth(),height:i.outerHeight()};t.verbose("Resizing stage to fit new content",a),u.css({width:a.width,height:a.height})},nextSide:function(a){i=u.find(a),0===i.size()&&t.error(k.side),t.verbose("Next side manually set to",i)},active:function(){t.verbose("Setting new side to active",i),w.removeClass(l.active),i.addClass(l.active),a.proxy(h.onChange,i)(),t.set.defaultSide()}},flip:{up:function(){t.debug("Flipping up",i),t.is.animating()?t.queue("flip up"):(t.stage.above(),t.animate(t.get.transform.up()))},down:function(){t.debug("Flipping down",i),t.is.animating()?t.queue("flip down"):(t.stage.below(),t.animate(t.get.transform.down()))},left:function(){t.debug("Flipping left",i),t.is.animating()?t.queue("flip left"):(t.stage.left(),t.animate(t.get.transform.left()))},right:function(){t.debug("Flipping right",i),t.is.animating()?t.queue("flip right"):(t.stage.right(),t.animate(t.get.transform.right()))},over:function(){t.debug("Flipping over",i),t.is.animating()?t.queue("flip over"):(t.stage.behind(),t.animate(t.get.transform.over()))},back:function(){t.debug("Flipping back",i),t.is.animating()?t.queue("flip back"):(t.stage.behind(),t.animate(t.get.transform.back()))}},stage:{above:function(){var a={origin:(b.outerHeight()-i.outerHeight())/2,depth:{active:i.outerHeight()/2,next:b.outerHeight()/2}};t.verbose("Setting the initial animation position as above",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(90deg) translateZ("+a.depth.next+"px)"})},below:function(){var a={origin:(b.outerHeight()-i.outerHeight())/2,depth:{active:i.outerHeight()/2,next:b.outerHeight()/2}}; t.verbose("Setting the initial animation position as below",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(-90deg) translateZ("+a.depth.next+"px)"})},left:function(){var a={origin:(b.outerWidth()-i.outerWidth())/2,depth:{active:i.outerWidth()/2,next:b.outerWidth()/2}};t.verbose("Setting the initial animation position as left",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-90deg) translateZ("+a.depth.next+"px)"})},right:function(){var a={origin:(b.outerWidth()-i.outerWidth())/2,depth:{active:i.outerWidth()/2,next:b.outerWidth()/2}};t.verbose("Setting the initial animation position as left",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(90deg) translateZ("+a.depth.next+"px)"})},behind:function(){var a={origin:(b.outerWidth()-i.outerWidth())/2,depth:{active:i.outerWidth()/2,next:b.outerWidth()/2}};t.verbose("Setting the initial animation position as behind",i,a),b.css({transform:"rotateY(0deg)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(b,c){return c===d?t[b]:(a.isPlainObject(b)?a.extend(!0,t,b):t[b]=c,void 0)},debug:function(){h.debug&&(h.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,h.name+":"),t.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),t.verbose.apply(console,arguments)))},error:function(){t.error=Function.prototype.bind.call(console.error,console,h.name+":"),t.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;h.performance&&(b=(new Date).getTime(),d=o||b,c=b-d,o=b,p.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100)},display:function(){var b=h.name+":",c=0;o=!1,clearTimeout(t.performance.timer),a.each(p,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(b),console.table?console.table(p):a.each(p,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(b,c,f){var g,h,i;return c=c||s,f=x||f,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[e])&&c!=g)y=y[e];else{if(!a.isPlainObject(y[f])||c==g)return y[e]!==d?(h=y[e],!1):y[f]!==d?(h=y[f],!1):(t.error(k.method),!1);y=y[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},r?(y===d&&t.initialize(),t.invoke(q)):(y!==d&&t.destroy(),t.initialize())}),e!==d?e:this},a.fn.shape.settings={name:"Shape",debug:!0,verbose:!0,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},useCSS:!0,duration:1e3,easing:"easeInOutQuad",error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{css:"css",animating:"animating",hidden:"hidden",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(a,b,c,d){a.fn.sidebar=function(b){var e,f=a(this),g=a.isPlainObject(b)?a.extend(!0,{},a.fn.sidebar.settings,b):a.fn.sidebar.settings,h=(g.selector,g.className),i=g.namespace,j=g.error,k="."+i,l="module-"+i,m=f.selector||"",n=(new Date).getTime(),o=[],p=arguments[0],q="string"==typeof p,r=[].slice.call(arguments,1);return f.each(function(){var b,s=a(this),t=a("body"),u=a("head"),v=a("style[title="+i+"]"),w=this,x=s.data(l);b={initialize:function(){b.debug("Initializing sidebar",s),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),x=b,s.data(l,b)},destroy:function(){b.verbose("Destroying previous module for",s),s.off(k).removeData(l)},refresh:function(){b.verbose("Refreshing selector cache"),v=a("style[title="+i+"]")},attachEvents:function(c,d){var e=a(c);d=a.isFunction(b[d])?b[d]:b.toggle,e.size()>0?(b.debug("Attaching sidebar events to element",c,d),e.off(k).on("click"+k,d)):b.error(j.notFound)},show:function(){b.debug("Showing sidebar"),b.is.closed()?(g.overlay||b.pushPage(),b.set.active()):b.debug("Sidebar is already visible")},hide:function(){b.is.open()&&(g.overlay||(b.pullPage(),b.remove.pushed()),b.remove.active())},toggle:function(){b.is.closed()?b.show():b.hide()},pushPage:function(){var a=b.get.direction(),c=b.is.vertical()?s.outerHeight():s.outerWidth();g.useCSS?(b.debug("Using CSS to animate body"),b.add.bodyCSS(a,c),b.set.pushed()):b.animatePage(a,c,b.set.pushed)},pullPage:function(){var a=b.get.direction();g.useCSS?(b.debug("Resetting body position css"),b.remove.bodyCSS()):(b.debug("Resetting body position using javascript"),b.animatePage(a,0)),b.remove.pushed()},animatePage:function(a,c){var d={};d["padding-"+a]=c,b.debug("Using javascript to animate body",d),t.animate(d,g.duration,b.set.pushed)},add:{bodyCSS:function(a,c){var d;a!==h.bottom&&(d='<style title="'+i+'">'+"body.pushed {"+" margin-"+a+": "+c+"px !important;"+"}"+"</style>"),u.append(d),b.debug("Adding body css to head",v)}},remove:{bodyCSS:function(){b.debug("Removing body css styles",v),b.refresh(),v.remove()},active:function(){s.removeClass(h.active)},pushed:function(){b.verbose("Removing body push state",b.get.direction()),t.removeClass(h[b.get.direction()]).removeClass(h.pushed)}},set:{active:function(){s.addClass(h.active)},pushed:function(){b.verbose("Adding body push state",b.get.direction()),t.addClass(h[b.get.direction()]).addClass(h.pushed)}},get:{direction:function(){return s.hasClass(h.top)?h.top:s.hasClass(h.right)?h.right:s.hasClass(h.bottom)?h.bottom:h.left},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]}},is:{open:function(){return s.is(":animated")||s.hasClass(h.active)},closed:function(){return!b.is.open()},vertical:function(){return s.hasClass(h.top)}},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){g.debug&&(g.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,g.name+":"),b.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,g.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;g.performance&&(c=(new Date).getTime(),e=n||c,d=c-e,n=c,o.push({Element:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=g.name+":",e=0;n=!1,clearTimeout(b.performance.timer),a.each(o,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",m&&(c+=" '"+m+"'"),f.size()>1&&(c+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&o.length>0&&(console.groupCollapsed(c),console.table?console.table(o):a.each(o,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),o=[]}},invoke:function(c,f,g){var h,i,k;return f=f||r,g=w||g,"string"==typeof c&&x!==d&&(c=c.split(/[\. ]/),h=c.length-1,a.each(c,function(e,f){var g=e!=h?f+c[e+1].charAt(0).toUpperCase()+c[e+1].slice(1):c;if(a.isPlainObject(x[f])&&e!=h)x=x[f];else{if(!a.isPlainObject(x[g])||e==h)return x[f]!==d?(i=x[f],!1):x[g]!==d?(i=x[g],!1):(b.error(j.method),!1);x=x[g]}})),a.isFunction(i)?k=i.apply(g,f):i!==d&&(k=i),a.isArray(e)?e.push(k):"string"==typeof e?e=[e,k]:k!==d&&(e=k),i}},q?(x===d&&b.initialize(),b.invoke(p)):(x!==d&&b.destroy(),b.initialize())}),e!==d?e:this},a.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",verbose:!0,debug:!0,performance:!0,useCSS:!0,overlay:!1,duration:300,side:"left",onChange:function(){},onShow:function(){},onHide:function(){},className:{active:"active",pushed:"pushed",top:"top",left:"left",right:"right",bottom:"bottom"},error:{method:"The method you called is not defined.",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(a,b,c,d){a.fn.tab=function(c){var e,f,g,h,i,j=a.extend(!0,{},a.fn.tab.settings,c),k=a(this),l=a(j.context).find(j.selector.tabs),m=k.selector||"",n={},o=!0,p=0,q=this,r=(new Date).getTime(),s=[],t=j.className,u=j.metadata,v=j.error,w="."+j.namespace,x=j.namespace+"-module",y=k.data(x),z=arguments[0],A=y!==d&&"string"==typeof z,B=[].slice.call(arguments,1);return h={initialize:function(){if(h.debug("Initializing Tabs",k),j.auto&&(h.verbose("Setting up automatic tab retrieval from server"),j.apiSettings={url:j.path+"/{$tab}"}),j.history){if(a.address===d)return h.error(v.state),!1;if(j.path===!1)return h.error(v.path),!1;h.verbose("Address library found adding state change event"),a.address.state(j.path).unbind("change").bind("change",h.event.history.change)}a.isWindow(q)||(h.debug("Attaching tab activation events to element",k),k.on("click"+w,h.event.click)),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),k.data(x,h)},destroy:function(){h.debug("Destroying tabs",k),k.off(w)},event:{click:function(b){h.debug("Navigation clicked");var c=a(this).data(u.tab);c!==d?(j.history?a.address.value(c):h.changeTab(c),b.preventDefault()):h.debug("No tab specified")},history:{change:function(b){var c=b.pathNames.join("/")||h.get.initialPath(),e=j.templates.determineTitle(c)||!1;h.debug("History change event",c,b),g=b,c!==d&&h.changeTab(c),e&&a.address.title(e)}}},refresh:function(){e&&(h.debug("Refreshing tab",e),h.changeTab(e))},cache:{read:function(a){return a!==d?n[a]:!1},add:function(a,b){a=a||e,h.debug("Adding cached content for",a),n[a]=b},remove:function(a){a=a||e,h.debug("Removing cached content for",a),delete n[a]}},changeTab:function(c){var d=b.history&&b.history.pushState,i=d&&j.ignoreFirstLoad&&o,k=j.auto||a.isPlainObject(j.apiSettings),l=k&&!i?h.utilities.pathToArray(c):h.get.defaultPathArray(c);c=h.utilities.arrayToPath(l),h.deactivate.all(),a.each(l,function(b,d){var m,n,p,q=l.slice(0,b+1),r=h.utilities.arrayToPath(q),s=h.is.tab(r),t=b+1==l.length,u=h.get.tabElement(r);return h.verbose("Looking for tab",d),s?(h.verbose("Tab was found",d),e=r,f=h.utilities.filterArray(l,q),t?p=!0:(m=l.slice(0,b+2),n=h.utilities.arrayToPath(m),p=!h.is.tab(n),p&&h.verbose("Tab parameters found",m)),p&&k?(i?(h.debug("Ignoring remote content on first tab load",r),o=!1,h.cache.add(c,u.html()),h.activate.all(r),a.proxy(j.onTabInit,u)(r,f,g),a.proxy(j.onTabLoad,u)(r,f,g)):(h.activate.navigation(r),h.content.fetch(r,c)),!1):(h.debug("Opened local tab",r),h.activate.all(r),a.proxy(j.onTabLoad,u)(r,f,g),void 0)):(h.error(v.missingTab,d),!1)})},content:{fetch:function(b,c){var i,k,l=h.get.tabElement(b),m={dataType:"html",stateContext:l,success:function(d){h.cache.add(c,d),h.content.update(b,d),b==e?(h.debug("Content loaded",b),h.activate.tab(b)):h.debug("Content loaded in background",b),a.proxy(j.onTabInit,l)(b,f,g),a.proxy(j.onTabLoad,l)(b,f,g)},urlData:{tab:c}},n=l.data(u.promise)||!1,o=n&&"pending"===n.state();c=c||b,k=h.cache.read(c),j.cache&&k?(h.debug("Showing existing content",c),h.content.update(b,k),h.activate.tab(b),a.proxy(j.onTabLoad,l)(b,f,g)):o?(h.debug("Content is already loading",c),l.addClass(t.loading)):a.api!==d?(console.log(j.apiSettings),i=a.extend(!0,{headers:{"X-Remote":!0}},j.apiSettings,m),h.debug("Retrieving remote content",c,i),a.api(i)):h.error(v.api)},update:function(a,b){h.debug("Updating html for",a);var c=h.get.tabElement(a);c.html(b)}},activate:{all:function(a){h.activate.tab(a),h.activate.navigation(a)},tab:function(a){var b=h.get.tabElement(a);h.verbose("Showing tab content for",b),b.addClass(t.active)},navigation:function(a){var b=h.get.navElement(a);h.verbose("Activating tab navigation for",b,a),b.addClass(t.active)}},deactivate:{all:function(){h.deactivate.navigation(),h.deactivate.tabs()},navigation:function(){k.removeClass(t.active)},tabs:function(){l.removeClass(t.active+" "+t.loading)}},is:{tab:function(a){return a!==d?h.get.tabElement(a).size()>0:!1}},get:{initialPath:function(){return k.eq(0).data(u.tab)||l.eq(0).data(u.tab)},path:function(){return a.address.value()},defaultPathArray:function(a){return h.utilities.pathToArray(h.get.defaultPath(a))},defaultPath:function(a){var b=k.filter("[data-"+u.tab+'^="'+a+'/"]').eq(0),c=b.data(u.tab)||!1;if(c){if(h.debug("Found default tab",c),j.maxDepth>p)return p++,h.get.defaultPath(c);h.error(v.recursion)}else h.debug("No default tabs found for",a,l);return p=0,a},navElement:function(a){return a=a||e,k.filter("[data-"+u.tab+'="'+a+'"]')},tabElement:function(a){var b,c,d,f;return a=a||e,d=h.utilities.pathToArray(a),f=h.utilities.last(d),b=l.filter("[data-"+u.tab+'="'+f+'"]'),c=l.filter("[data-"+u.tab+'="'+a+'"]'),b.size()>0?b:c},tab:function(){return e}},utilities:{filterArray:function(b,c){return a.grep(b,function(b){return-1==a.inArray(b,c)})},last:function(b){return a.isArray(b)?b[b.length-1]:!1},pathToArray:function(a){return a===d&&(a=e),"string"==typeof a?a.split("/"):[a]},arrayToPath:function(b){return a.isArray(b)?b.join("/"):!1}},setting:function(b,c){return c===d?j[b]:(a.isPlainObject(b)?a.extend(!0,j,b):j[b]=c,void 0)},internal:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},debug:function(){j.debug&&(j.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,j.name+":"),h.debug.apply(console,arguments)))},verbose:function(){j.verbose&&j.debug&&(j.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,j.name+":"),h.verbose.apply(console,arguments)))},error:function(){h.error=Function.prototype.bind.call(console.error,console,j.name+":"),h.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;j.performance&&(b=(new Date).getTime(),d=r||b,c=b-d,r=b,s.push({Element:q,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,100)},display:function(){var b=j.name+":",c=0;r=!1,clearTimeout(h.performance.timer),a.each(s,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",m&&(b+=" '"+m+"'"),(console.group!==d||console.table!==d)&&s.length>0&&(console.groupCollapsed(b),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(b,c,e){var f,g,j;return c=c||B,e=q||e,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(c,e){var i=c!=f?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[e])&&c!=f)y=y[e];else{if(!a.isPlainObject(y[i])||c==f)return y[e]!==d?(g=y[e],!1):y[i]!==d?(g=y[i],!1):(h.error(v.method),!1);y=y[i]}})),a.isFunction(g)?j=g.apply(e,c):g!==d&&(j=g),a.isArray(i)?i.push(j):"string"==typeof i?i=[i,j]:j!==d&&(i=j),g}},A?(y===d&&h.initialize(),h.invoke(z)):(y!==d&&h.destroy(),h.initialize()),i!==d?i:this},a.tab=function(c){a(b).tab(c)},a.fn.tab.settings={name:"Tab",verbose:!0,debug:!0,performance:!0,namespace:"tab",onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},auto:!1,history:!1,path:!1,context:"body",maxDepth:25,ignoreFirstLoad:!1,alwaysRefresh:!1,cache:!0,apiSettings:!1,error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Tab cannot be found",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"The state library has not been initialized"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab"}}}(jQuery,window,document),function(a,b,c,d){a.fn.transition=function(){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments,k=j[0],l=[].slice.call(arguments,1),m="string"==typeof k;return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var b,n,o,p,q,r,s,t,u,v,w=a(this),x=this;v={initialize:function(){b=v.get.settings.apply(x,j),v.verbose("Converted arguments into settings object",b),o=b.error,p=b.className,t=b.namespace,q=b.metadata,u="module-"+t,r=v.get.animationEvent(),s=v.get.animationName(),n=w.data(u),n===d&&v.instantiate(),m&&(m=v.invoke(k)),m===!1&&v.animate()},instantiate:function(){v.verbose("Storing instance of module",v),n=v,w.data(u,n)},destroy:function(){v.verbose("Destroying previous module for",x),w.removeData(u)},animate:function(a){return b=a||b,v.debug("Preparing animation",b.animation),v.is.animating()?(b.queue&&v.queue(b.animation),!1):(v.save.conditions(),v.set.duration(b.duration),v.set.animating(),v.repaint(),w.addClass(p.transition).addClass(b.animation).one(r,v.complete),!v.has.direction()&&v.can.transition()&&v.set.direction(),v.can.animate()?(v.show(),v.debug("Starting tween",b.animation,w.attr("class")),void 0):(v.restore.conditions(),v.error(o.noAnimation),!1))},queue:function(a){v.debug("Queueing animation of",a),n.queuing=!0,w.one(r,function(){n.queuing=!1,v.animate.apply(this,b)})},complete:function(){v.verbose("CSS animation complete",b.animation),v.is.looping()||(w.hasClass(p.outward)?(v.restore.conditions(),v.hide()):w.hasClass(p.inward)?(v.restore.conditions(),v.show()):v.restore.conditions(),v.remove.animating()),a.proxy(b.complete,this)()},repaint:function(a){v.verbose("Forcing repaint event"),a=x.offsetWidth},has:{direction:function(a){return a=a||b.animation,w.hasClass(p.inward)||w.hasClass(p.outward)?!0:void 0}},set:{animating:function(){w.addClass(p.animating)},direction:function(){w.is(":visible")?(v.debug("Automatically determining the direction of animation","Outward"),w.addClass(p.outward).removeClass(p.inward)):(v.debug("Automatically determining the direction of animation","Inward"),w.addClass(p.inward).removeClass(p.outward))},looping:function(){v.debug("Transition set to loop"),w.addClass(p.looping)},duration:function(a){a=a||b.duration,a="number"==typeof a?a+"ms":a,v.verbose("Setting animation duration",a),w.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})}},save:{conditions:function(){v.cache={className:w.attr("class"),style:w.attr("style")},v.verbose("Saving original attributes",v.cache)}},restore:{conditions:function(){return typeof v.cache===d?(v.error(o.cache),!1):(v.cache.className?w.attr("class",v.cache.className):w.removeAttr("class"),v.cache.style?w.attr("style",v.cache.style):w.removeAttr("style"),v.is.looping()&&v.remove.looping(),v.verbose("Restoring original attributes",v.cache),void 0)}},remove:{animating:function(){w.removeClass(p.animating)},looping:function(){v.debug("Transitions are no longer looping"),w.removeClass(p.looping),v.repaint()}},get:{settings:function(b,c,d){return a.isPlainObject(b)?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof d?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:d,duration:c}):"string"==typeof c||"number"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend(!0,{},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend(!0,{},a.fn.transition.settings,{animation:b,complete:c}):a.extend(!0,{},a.fn.transition.settings,{animation:b})},animationName:function(){var a,b=c.createElement("div"),e={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(a in e)if(b.style[a]!==d)return v.verbose("Determining animation vendor name property",e[a]),e[a];return!1},animationEvent:function(){var a,b=c.createElement("div"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return v.verbose("Determining animation vendor end event",e[a]),e[a];return!1}},can:{animate:function(){return"none"!==w.css(s)?(v.debug("CSS definition found"),!0):(v.debug("Unable to find css definition"),!1)},transition:function(){var b=a("
").addClass(w.attr("class")).appendTo(a("body")),c=b.css(s),d=b.addClass(p.inward).css(s);return c!=d?(v.debug("In/out transitions exist"),b.remove(),!0):(v.debug("Static animation found"),b.remove(),!1)}},is:{animating:function(){return w.hasClass(p.animating)},looping:function(){return w.hasClass(p.looping)},visible:function(){return w.is(":visible")}},hide:function(){v.verbose("Hiding element"),w.removeClass(p.visible).addClass(p.transition).addClass(p.hidden),v.repaint()},show:function(){v.verbose("Showing element"),w.removeClass(p.hidden).addClass(p.transition).addClass(p.visible),v.repaint()},start:function(){v.verbose("Starting animation"),w.removeClass(p.disabled)},stop:function(){v.debug("Stopping animation"),w.addClass(p.disabled)},toggle:function(){v.debug("Toggling play status"),w.toggleClass(p.disabled)},setting:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},internal:function(b,c){return c===d?v[b]:(a.isPlainObject(b)?a.extend(!0,v,b):v[b]=c,void 0)},debug:function(){b.debug&&(b.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,b.name+":"),v.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),v.verbose.apply(console,arguments)))},error:function(){v.error=Function.prototype.bind.call(console.error,console,b.name+":"),v.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;b.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,100)},display:function(){var c=b.name+":",e=0;h=!1,clearTimeout(v.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",g&&(c+=" '"+g+"'"),f.size()>1&&(c+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i;return c=c||l,f=x||f,"string"==typeof b&&n!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(n[e])&&c!=g)n=n[e];else{if(!a.isPlainObject(n[f])||c==g)return n[e]!==d?(h=n[e],!1):n[f]!==d?(h=n[f],!1):!1;n=n[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h||!1}},v.initialize()}),e!==d?e:this},a.fn.transition.settings={name:"Transition",debug:!0,verbose:!0,performance:!0,namespace:"transition",complete:function(){},animation:"fade",duration:"700ms",queue:!0,className:{transition:"ui transition",animating:"animating",looping:"looping",loading:"loading",disabled:"disabled",hidden:"hidden",visible:"visible",inward:"in",outward:"out"},error:{noAnimation:"There is no css animation matching the one you specified.",method:"The method you called is not defined"}}}(jQuery,window,document),function(a,b,c,d){a.fn.video=function(b){var c,e=a(this),f=a.isPlainObject(b)?a.extend(!0,{},a.fn.video.settings,b):a.fn.video.settings,g=e.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=f.selector,n=f.className,o=f.error,p=f.metadata,q=f.namespace,r="."+q,s=q+"-module";return e.each(function(){var b,q=a(this),t=q.find(m.placeholder),u=q.find(m.playButton),v=q.find(m.embed),w=this,x=q.data(s);b={initialize:function(){b.debug("Initializing video"),t.on("click"+r,b.play),u.on("click"+r,b.play),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),x=b,q.data(s,b)},destroy:function(){b.verbose("Destroying previous instance of video"),q.removeData(s).off(r)},change:function(a,c,d){b.debug("Changing video to ",a,c,d),q.data(p.source,a).data(p.id,c).data(p.url,d),f.onChange()},reset:function(){b.debug("Clearing video embed and showing placeholder"),q.removeClass(n.active),v.html(" "),t.show(),f.onReset()},play:function(){b.debug("Playing video");var a=q.data(p.source)||!1,c=q.data(p.url)||!1,d=q.data(p.id)||!1;v.html(b.generate.html(a,d,c)),q.addClass(n.active),f.onPlay()},generate:{html:function(a,c,d){b.debug("Generating embed html");var e,g="auto"==f.width?q.width():f.width,h="auto"==f.height?q.height():f.height;return a&&c?"vimeo"==a?e='<iframe src="http://player.vimeo.com/video/'+c+"?="+b.generate.url(a)+'"'+' width="'+g+'" height="'+h+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':"youtube"==a&&(e='<iframe src="http://www.youtube.com/embed/'+c+"?="+b.generate.url(a)+'"'+' width="'+g+'" height="'+h+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'):d?e='<iframe src="'+d+'"'+' width="'+g+'" height="'+h+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':b.error(o.noVideo),e},url:function(a){var b=f.api?1:0,c=f.autoplay?1:0,d=f.hd?1:0,e=f.showUI?1:0,g=f.showUI?0:1,h="";return"vimeo"==a&&(h="api="+b+"&title="+e+"&byline="+e+"&portrait="+e+"&autoplay="+c,f.color&&(h+="&color="+f.color)),"ustream"==a?(h="autoplay="+c,f.color&&(h+="&color="+f.color)):"youtube"==a&&(h="enablejsapi="+b+"&autoplay="+c+"&autohide="+g+"&hq="+d+"&modestbranding=1",f.color&&(h+="&color="+f.color)),h}},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",j=0;h=!1,clearTimeout(b.performance.timer),a.each(i,function(a,b){j+=b["Execution Time"]}),c+=" "+j+"ms",g&&(c+=" '"+g+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(e,f,g){var h,i,j;return f=f||l,g=w||g,"string"==typeof e&&x!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(x[f])&&c!=h)x=x[f];else{if(!a.isPlainObject(x[g])||c==h)return x[f]!==d?(i=x[f],!1):x[g]!==d?(i=x[g],!1):(b.error(o.method),!1);x=x[g]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(c)?c.push(j):"string"==typeof c?c=[c,j]:j!==d&&(c=j),i}},k?(x===d&&b.initialize(),b.invoke(j)):(x!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.video.settings={name:"Video",namespace:"video",debug:!0,verbose:!0,performance:!0,metadata:{source:"source",id:"id",url:"url"},onPlay:function(){},onReset:function(){},onChange:function(){},onPause:function(){},onStop:function(){},width:"auto",height:"auto",autoplay:!1,color:"#442359",hd:!0,showUI:!1,api:!0,error:{noVideo:"No video specified",method:"The method you called is not defined"},className:{active:"active"},selector:{embed:".embed",placeholder:".placeholder",playButton:".play"}}}(jQuery,window,document),$(function(){var a=window.jQuery;a.tablesort=function(d,c){var e=this;this.$table=d,this.$thead=this.$table.find("thead"),this.settings=a.extend({},a.tablesort.defaults,c),this.$table.find("th").bind("click.tablesort",function(){e.sort(a(this))}),this.direction=this.$th=this.index=null},a.tablesort.prototype={sort:function(d,c){var e=new Date,b=this,g=this.$table,n=this.$thead.length>0?g.find("tbody tr"):g.find("tr").has("td"),m=g.find("tr td:nth-of-type("+(d.index()+1)+")"),h=d.data().sortBy,k=[],l=m.map(function(c,e){return h?"function"==typeof h?h(a(d),a(e),b):h:null!=a(this).data().sortValue?a(this).data().sortValue:a(this).text()});if(0!==l.length){b.$table.find("th").removeClass(b.settings.asc+" "+b.settings.desc),this.direction="asc"!==c&&"desc"!==c?"asc"===this.direction?"desc":"asc":c,c="asc"==this.direction?1:-1,b.$table.trigger("tablesort:start",[b]),b.log("Sorting by "+this.index+" "+this.direction);for(var f=0,p=l.length;p>f;f++)k.push({index:f,cell:m[f],row:n[f],value:l[f]});k.sort(function(a,b){return a.value>b.value?1*c:b.value>a.value?-1*c:0}),a.each(k,function(a,b){g.append(b.row)}),d.addClass(b.settings[b.direction]),b.log("Sort finished in "+((new Date).getTime()-e.getTime())+"ms"),b.$table.trigger("tablesort:complete",[b])}},log:function(d){(a.tablesort.DEBUG||this.settings.debug)&&console&&console.log&&console.log("[tablesort] "+d)},destroy:function(){return this.$table.find("th").unbind("click.tablesort"),this.$table.data("tablesort",null),null}},a.tablesort.DEBUG=!1,a.tablesort.defaults={debug:a.tablesort.DEBUG,asc:"sorted ascending",desc:"sorted descending"},a.fn.tablesort=function(d){var c,e;return this.each(function(){c=a(this),(e=c.data("tablesort"))&&e.destroy(),c.data("tablesort",new a.tablesort(c,d))})}}),function(){var __indexOf=[].indexOf||function(item){for(var i=0,l=this.length;l>i;i++)if(i in this&&this[i]===item)return i;return-1},__slice=[].slice;(function(root,factory){return"function"==typeof define&&define.amd?define("waypoints",["jquery"],function($){return factory($,root)}):factory(root.jQuery,root)})(this,function($,window){var $w,Context,Waypoint,allWaypoints,contextCounter,contextKey,contexts,isTouch,jQMethods,methods,resizeEvent,scrollEvent,waypointCounter,waypointKey,wp,wps;return $w=$(window),isTouch=__indexOf.call(window,"ontouchstart")>=0,allWaypoints={horizontal:{},vertical:{}},contextCounter=1,contexts={},contextKey="waypoints-context-id",resizeEvent="resize.waypoints",scrollEvent="scroll.waypoints",waypointCounter=1,waypointKey="waypoints-waypoint-ids",wp="waypoint",wps="waypoints",Context=function(){function Context($element){var _this=this;this.$element=$element,this.element=$element[0],this.didResize=!1,this.didScroll=!1,this.id="context"+contextCounter++,this.oldScroll={x:$element.scrollLeft(),y:$element.scrollTop()},this.waypoints={horizontal:{},vertical:{}},$element.data(contextKey,this.id),contexts[this.id]=this,$element.bind(scrollEvent,function(){var scrollHandler; return _this.didScroll||isTouch?void 0:(_this.didScroll=!0,scrollHandler=function(){return _this.doScroll(),_this.didScroll=!1},window.setTimeout(scrollHandler,$[wps].settings.scrollThrottle))}),$element.bind(resizeEvent,function(){var resizeHandler;return _this.didResize?void 0:(_this.didResize=!0,resizeHandler=function(){return $[wps]("refresh"),_this.didResize=!1},window.setTimeout(resizeHandler,$[wps].settings.resizeThrottle))})}return Context.prototype.doScroll=function(){var axes,_this=this;return axes={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!isTouch||axes.vertical.oldScroll&&axes.vertical.newScroll||$[wps]("refresh"),$.each(axes,function(aKey,axis){var direction,isForward,triggered;return triggered=[],isForward=axis.newScroll>axis.oldScroll,direction=isForward?axis.forward:axis.backward,$.each(_this.waypoints[aKey],function(wKey,waypoint){var _ref,_ref1;return(_ref=waypoint.offset)>axis.oldScroll&&axis.newScroll>=_ref?triggered.push(waypoint):(_ref1=waypoint.offset)>axis.newScroll&&axis.oldScroll>=_ref1?triggered.push(waypoint):void 0}),triggered.sort(function(a,b){return a.offset-b.offset}),isForward||triggered.reverse(),$.each(triggered,function(i,waypoint){return waypoint.options.continuous||i===triggered.length-1?waypoint.trigger([direction]):void 0})}),this.oldScroll={x:axes.horizontal.newScroll,y:axes.vertical.newScroll}},Context.prototype.refresh=function(){var axes,cOffset,isWin,_this=this;return isWin=$.isWindow(this.element),cOffset=this.$element.offset(),this.doScroll(),axes={horizontal:{contextOffset:isWin?0:cOffset.left,contextScroll:isWin?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:isWin?0:cOffset.top,contextScroll:isWin?0:this.oldScroll.y,contextDimension:isWin?$[wps]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},$.each(axes,function(aKey,axis){return $.each(_this.waypoints[aKey],function(i,waypoint){var adjustment,elementOffset,oldOffset,_ref,_ref1;return adjustment=waypoint.options.offset,oldOffset=waypoint.offset,elementOffset=$.isWindow(waypoint.element)?0:waypoint.$element.offset()[axis.offsetProp],$.isFunction(adjustment)?adjustment=adjustment.apply(waypoint.element):"string"==typeof adjustment&&(adjustment=parseFloat(adjustment),waypoint.options.offset.indexOf("%")>-1&&(adjustment=Math.ceil(axis.contextDimension*adjustment/100))),waypoint.offset=elementOffset-axis.contextOffset+axis.contextScroll-adjustment,waypoint.options.onlyOnScroll&&null!=oldOffset||!waypoint.enabled?void 0:null!==oldOffset&&(_ref=axis.oldScroll)>oldOffset&&waypoint.offset>=_ref?waypoint.trigger([axis.backward]):null!==oldOffset&&oldOffset>(_ref1=axis.oldScroll)&&_ref1>=waypoint.offset?waypoint.trigger([axis.forward]):null===oldOffset&&axis.oldScroll>=waypoint.offset?waypoint.trigger([axis.forward]):void 0})})},Context.prototype.checkEmpty=function(){return $.isEmptyObject(this.waypoints.horizontal)&&$.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([resizeEvent,scrollEvent].join(" ")),delete contexts[this.id]):void 0},Context}(),Waypoint=function(){function Waypoint($element,context,options){var idList,_ref;options=$.extend({},$.fn[wp].defaults,options),"bottom-in-view"===options.offset&&(options.offset=function(){var contextHeight;return contextHeight=$[wps]("viewportHeight"),$.isWindow(context.element)||(contextHeight=context.$element.height()),contextHeight-$(this).outerHeight()}),this.$element=$element,this.element=$element[0],this.axis=options.horizontal?"horizontal":"vertical",this.callback=options.handler,this.context=context,this.enabled=options.enabled,this.id="waypoints"+waypointCounter++,this.offset=null,this.options=options,context.waypoints[this.axis][this.id]=this,allWaypoints[this.axis][this.id]=this,idList=null!=(_ref=$element.data(waypointKey))?_ref:[],idList.push(this.id),$element.data(waypointKey,idList)}return Waypoint.prototype.trigger=function(args){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,args),this.options.triggerOnce?this.destroy():void 0):void 0},Waypoint.prototype.disable=function(){return this.enabled=!1},Waypoint.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},Waypoint.prototype.destroy=function(){return delete allWaypoints[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},Waypoint.getWaypointsByElement=function(element){var all,ids;return(ids=$(element).data(waypointKey))?(all=$.extend({},allWaypoints.horizontal,allWaypoints.vertical),$.map(ids,function(id){return all[id]})):[]},Waypoint}(),methods={init:function(f,options){var _ref;return null==options&&(options={}),null==(_ref=options.handler)&&(options.handler=f),this.each(function(){var $this,context,contextElement,_ref1;return $this=$(this),contextElement=null!=(_ref1=options.context)?_ref1:$.fn[wp].defaults.context,$.isWindow(contextElement)||(contextElement=$this.closest(contextElement)),contextElement=$(contextElement),context=contexts[contextElement.data(contextKey)],context||(context=new Context(contextElement)),new Waypoint($this,context,options)}),$[wps]("refresh"),this},disable:function(){return methods._invoke(this,"disable")},enable:function(){return methods._invoke(this,"enable")},destroy:function(){return methods._invoke(this,"destroy")},prev:function(axis,selector){return methods._traverse.call(this,axis,selector,function(stack,index,waypoints){return index>0?stack.push(waypoints[index-1]):void 0})},next:function(axis,selector){return methods._traverse.call(this,axis,selector,function(stack,index,waypoints){return waypoints.length-1>index?stack.push(waypoints[index+1]):void 0})},_traverse:function(axis,selector,push){var stack,waypoints;return null==axis&&(axis="vertical"),null==selector&&(selector=window),waypoints=jQMethods.aggregate(selector),stack=[],this.each(function(){var index;return index=$.inArray(this,waypoints[axis]),push(stack,index,waypoints[axis])}),this.pushStack(stack)},_invoke:function($elements,method){return $elements.each(function(){var waypoints;return waypoints=Waypoint.getWaypointsByElement(this),$.each(waypoints,function(i,waypoint){return waypoint[method](),!0})}),this}},$.fn[wp]=function(){var args,method;return method=arguments[0],args=arguments.length>=2?__slice.call(arguments,1):[],methods[method]?methods[method].apply(this,args):$.isFunction(method)?methods.init.apply(this,arguments):$.isPlainObject(method)?methods.init.apply(this,[null,method]):method?$.error("The "+method+" method does not exist in jQuery Waypoints."):$.error("jQuery Waypoints needs a callback function or handler option.")},$.fn[wp].defaults={context:window,continuous:!0,enabled:!0,horizontal:!1,offset:0,triggerOnce:!1},jQMethods={refresh:function(){return $.each(contexts,function(i,context){return context.refresh()})},viewportHeight:function(){var _ref;return null!=(_ref=window.innerHeight)?_ref:$w.height()},aggregate:function(contextSelector){var collection,waypoints,_ref;return collection=allWaypoints,contextSelector&&(collection=null!=(_ref=contexts[$(contextSelector).data(contextKey)])?_ref.waypoints:void 0),collection?(waypoints={horizontal:[],vertical:[]},$.each(waypoints,function(axis,arr){return $.each(collection[axis],function(key,waypoint){return arr.push(waypoint)}),arr.sort(function(a,b){return a.offset-b.offset}),waypoints[axis]=$.map(arr,function(waypoint){return waypoint.element}),waypoints[axis]=$.unique(waypoints[axis])}),waypoints):[]},above:function(contextSelector){return null==contextSelector&&(contextSelector=window),jQMethods._filter(contextSelector,"vertical",function(context,waypoint){return context.oldScroll.y>=waypoint.offset})},below:function(contextSelector){return null==contextSelector&&(contextSelector=window),jQMethods._filter(contextSelector,"vertical",function(context,waypoint){return waypoint.offset>context.oldScroll.y})},left:function(contextSelector){return null==contextSelector&&(contextSelector=window),jQMethods._filter(contextSelector,"horizontal",function(context,waypoint){return context.oldScroll.x>=waypoint.offset})},right:function(contextSelector){return null==contextSelector&&(contextSelector=window),jQMethods._filter(contextSelector,"horizontal",function(context,waypoint){return waypoint.offset>context.oldScroll.x})},enable:function(){return jQMethods._invoke("enable")},disable:function(){return jQMethods._invoke("disable")},destroy:function(){return jQMethods._invoke("destroy")},extendFn:function(methodName,f){return methods[methodName]=f},_invoke:function(method){var waypoints;return waypoints=$.extend({},allWaypoints.vertical,allWaypoints.horizontal),$.each(waypoints,function(key,waypoint){return waypoint[method](),!0})},_filter:function(selector,axis,test){var context,waypoints;return(context=contexts[$(selector).data(contextKey)])?(waypoints=[],$.each(context.waypoints[axis],function(i,waypoint){return test(context,waypoint)?waypoints.push(waypoint):void 0}),waypoints.sort(function(a,b){return a.offset-b.offset}),$.map(waypoints,function(waypoint){return waypoint.element})):[]}},$[wps]=function(){var args,method;return method=arguments[0],args=arguments.length>=2?__slice.call(arguments,1):[],jQMethods[method]?jQMethods[method].apply(null,args):jQMethods.aggregate.call(null,method)},$[wps].settings={resizeThrottle:100,scrollThrottle:30},$w.load(function(){return $[wps]("refresh")})})}.call(this),function(){(function(root,factory){return"function"==typeof define&&define.amd?define(["jquery","waypoints"],factory):factory(root.jQuery)})(this,function($){var defaults,wrap;return defaults={wrapper:'<div class="sticky-wrapper" />',stuckClass:"stuck"},wrap=function($elements,options){return $elements.wrap(options.wrapper),$elements.parent()},$.waypoints("extendFn","sticky",function(opt){var $wrap,options,originalHandler;return options=$.extend({},$.fn.waypoint.defaults,defaults,opt),$wrap=wrap(this,options),originalHandler=options.handler,options.handler=function(direction){var $sticky,shouldBeStuck;return $sticky=$(this).children(":first"),shouldBeStuck="down"===direction||"right"===direction,$(this).toggleClass(options.stuckClass,shouldBeStuck),$wrap.height(shouldBeStuck?$sticky.outerHeight():""),null!=originalHandler?originalHandler.call(this,direction):void 0},$wrap.waypoint(options),this.data("stuckClass",options.stuckClass)}),$.waypoints("extendFn","unsticky",function(){return this.parent().waypoint("destroy"),this.unwrap(),this.removeClass(this.data("stuckClass"))})})}.call(this),window.semantic={handler:{}},(window.console===void 0||window.console.log===void 0)&&(window.console={log:function(){},info:function(){},warn:function(){}}),(window.console.group===void 0||window.console.groupEnd===void 0||window.console.groupCollapsed===void 0)&&(window.console.group=function(){},window.console.groupEnd=function(){},window.console.groupCollapsed=function(){}),window.console.markTimeline===void 0&&(window.console.markTimeline=function(){}),window.console.clear=function(){},semantic.ready=function(){var $ui=$(".ui").not(".hover, .down"),$swap=$(".theme.menu .item"),$menu=$("#menu"),$hideMenu=$("#menu .hide.item"),$sortTable=$(".sortable.table"),$demo=$(".demo"),$waypoints=$(".main.container").find("h2").first().siblings("h2").addBack(),$menuPopup=$(".ui.main.menu .popup.item"),$menuDropdown=$(".ui.main.menu .dropdown"),$pageTabMenu=$(".tab.segment .tabular.menu"),$pageTabs=$(".tab.segment .menu .item"),$downloadDropdown=$(".download.buttons .dropdown"),$helpPopup=$(".header .help.icon"),$example=$(".example"),$shownExample=$example.filter(".shown"),$developer=$(".developer.item"),$overview=$(".overview.item, .overview.button"),$designer=$(".designer.item"),$sidebarButton=$(".attached.launch.button"),$increaseFont=$(".font .increase"),$decreaseFont=$(".font .decrease"),$peek=$(".peek"),$peekItem=$peek.children(".menu").children("a.item"),$peekSubItem=$peek.find(".item .menu .item"),$code=$("div.code").not(".existing"),$existingCode=$(".existing.code"),handler;$.fn.accordion.settings.duration=500,$.fn.accordion.settings.easing="easeInOutQuint",handler={createIcon:function(){$example.each(function(){$("<i/>").addClass("icon code").prependTo($(this))})},getSpecification:function(callback){var url=$(this).data("url")||!1;callback=callback||function(){},url&&$.ajax({method:"get",url:url,type:"json",complete:callback})},create:{tick:function(){},examples:function(json){var $element,html,types=json.Types,text=json.Text,variations=(json.States,json.Variations);$.each(types,function(name,type){html+='

'+name+"</h2",$.isPlainObject(type)?$.each(type,function(name,subType){$element=$.zc(subType),$element=handler.create.text($element,text),html+='

'+name+"</h3",html+=handler.create.variations($element,variations)}):($element=$.zc(type),$element=handler.create.text($element),html+=handler.create.variations($element,variations))})},element:function(){},variations:function($element,variations){$.each(variations,function(){})},text:function($element,text){return $.each(text,function(selector,text){$element.find(selector).text(text)}),$element}},font:{increase:function(){var $container=$(this).parent().prev(".ui.segment"),fontSize=parseInt($container.css("font-size"),10);$container.css("font-size",fontSize+1)},decrease:function(){var $container=$(this).parent().prev(".ui.segment"),fontSize=parseInt($container.css("font-size"),10);$container.css("font-size",fontSize-1)}},overviewMode:function(){var $button=$(this),$body=$("body"),$example=$(".example");$body.toggleClass("overview"),$button.toggleClass("active"),$body.hasClass("overview")?($developer.addClass("disabled").popup("destroy"),$designer.addClass("disabled").popup("destroy"),$example.each(function(){$(this).children().not(".ui.header:eq(0), .example p:eq(0), .annotation").hide()}),$example.filter(".another").hide()):($developer.removeClass("disabled").popup(),$designer.removeClass("disabled").popup(),$example.each(function(){$(this).children().not(".ui.header:eq(0), .example p:eq(0), .annotation").show()}),$example.filter(".another").show())},developerMode:function(){var $example=$(".example").not(".no");$developer.addClass("active"),$designer.removeClass("active"),$example.each(function(){$.proxy(handler.createCode,$(this))("developer")})},designerMode:function(){var $example=$(".example").not(".no");$designer.addClass("active"),$developer.removeClass("active"),$example.each(function(){$.proxy(handler.createCode,$(this))("designer")})},generateCode:function(){var $example=$(this).closest(".example"),$annotation=$example.find(".annotation"),$code=$annotation.find(".code"),$header=$example.children(".ui.header:first-of-type").eq(0).add("p:first-of-type"),$demo=$example.children().not($header).not("i.code:first-child, .code, .instructive, .language.label, .annotation, br, .ignore, .ignored"),code=(RegExp("\\n\\s{4}","g"),"");return 0===$code.size()&&$demo.each(function(){var $this=$(this).clone(!1);$this.not("br")&&(code+=$this.removeAttr("style").get(0).outerHTML+"\n")}),$example.data("code",code),code},createCode:function(type){var $example=$(this).closest(".example"),$header=$example.children(".ui.header:first-of-type").eq(0).add("p:first-of-type"),$annotation=$example.find(".annotation"),$code=$annotation.find(".code"),$demo=$example.children().not($header).not("i.code:first-child, .code, .instructive, .language.label, .annotation, br, .ignore, .ignored"),code=$example.data("code")||$.proxy(handler.generateCode,this)();$code.hasClass("existing")&&($annotation.show(),$code.removeClass("existing"),$.proxy(handler.initializeCode,$code)()),0===$annotation.size()&&($annotation=$("<div/>").addClass("annotation").appendTo($example)),0===$example.find(".ace_editor").size()&&($code=$("<div/>").data("type","html").addClass("code").html(code).hide().appendTo($annotation),$.proxy(handler.initializeCode,$code)()),!$demo.first().is(":visible")&&"developer"!=type||"designer"==type?($annotation.hide(),$demo.size()>1?$demo.show():$demo.fadeIn(500)):($demo.hide(),$header.show(),$annotation.fadeIn(500))},createAnnotation:function(){$(this).data("type")||$(this).data("type","html"),$(this).wrap('
').parent().hide()},resizeCode:function(){$(".ace_editor").each(function(){var editor,editorSession,codeHeight,$code=$(this),padding=20;$code.css("height","auto"),editor=ace.edit($code[0]),editorSession=editor.getSession(),codeHeight=editorSession.getScreenLength()*editor.renderer.lineHeight+padding,$code.css("height",codeHeight),editor.resize()})},initializeCode:function(){var $code=$(this).show(),code=$code.html(),existingCode=$code.hasClass("existing"),contentType=$code.data("type")||"javascript",title=$code.data("title")||!1,demo=$code.data("demo")||!1,preview=$code.data("preview")||!1,label=$code.data("label")||!1,displayType={html:"HTML",javascript:"Javascript",css:"CSS",text:"Command Line",sh:"Command Line"},whiteSpace=RegExp("\\n\\s{4}","g"),$label,padding=20,editor,editorSession,codeHeight;code=$.trim(code.replace(whiteSpace,"\n")),"html"==contentType?$code.text(code):$code.html(code),$code.hasClass("evaluated")&&eval(code),editor=ace.edit($code[0]),editorSession=editor.getSession(),editor.setTheme("ace/theme/github"),editor.setShowPrintMargin(!1),editor.setReadOnly(!0),editor.renderer.setShowGutter(!1),editor.setHighlightActiveLine(!1),editorSession.setMode("ace/mode/"+contentType),editorSession.setUseWrapMode(!0),editorSession.setTabSize(2),editorSession.setUseSoftTabs(!0),codeHeight=editorSession.getScreenLength()*editor.renderer.lineHeight+padding,$(this).height(codeHeight+"px").wrap('
'),title&&$("
").addClass("ui attached top label").html(''+title+""+""+(displayType[contentType]||contentType)+"").prependTo($(this).parent()),label&&$("
").addClass("ui pointing below label").html(displayType[contentType]||contentType).insertBefore($(this).parent()),demo&&$("<a>").addClass("ui pointing below black label").html("Run Code").on("click",function(){eval(code)}).insertBefore($(this).parent()),preview&&$(code).insertAfter($(this).parent()),editor.resize()},movePeek:function(){$(".stuck .peek").size()>0?$(".peek").toggleClass("pushed"):$(".peek").removeClass("pushed")},menu:{mouseenter:function(){$(this).stop().animate({width:"155px"},300,function(){$(this).find(".text").show()})},mouseleave:function(){$(this).find(".text").hide(),$(this).stop().animate({width:"70px"},300)}},peek:function(){var offset,$body=$("html, body"),$header=$(this),$menu=$header.parent(),$group=$menu.children(),$headers=$group.add($group.find(".menu .item")),$waypoint=$waypoints.eq($group.index($header));offset=$waypoint.offset().top-70,console.log(offset),$header.hasClass("active")||($menu.addClass("animating"),$headers.removeClass("active"),$body.stop().one("scroll",function(){$body.stop()}).animate({scrollTop:offset},500).promise().done(function(){$menu.removeClass("animating"),$headers.removeClass("active"),$header.addClass("active"),$waypoint.css("color",$header.css("border-right-color")),$waypoints.removeAttr("style")}))},peekSub:function(){var $body=$("html, body"),$subHeader=$(this),$header=$subHeader.parents(".item"),$menu=$header.parent(),$subHeaderGroup=$header.find(".item"),$headerGroup=$menu.children(),$waypoint=$("h2").eq($headerGroup.index($header));$subWaypoint=$waypoint.nextAll("h3").eq($subHeaderGroup.index($subHeader)),offset=$subWaypoint.offset().top-80,$menu.addClass("animating"),$headerGroup.removeClass("active"),$subHeaderGroup.removeClass("active"),$body.stop().animate({scrollTop:offset},500,function(){$menu.removeClass("animating"),$subHeader.addClass("active")}).one("scroll",function(){$body.stop()})},swapStyle:function(){var theme=$(this).data("theme");$(this).addClass("active").siblings().removeClass("active"),$("head link.ui").each(function(){var href=$(this).attr("href"),subDirectory=href.split("/")[3],newLink=href.replace(subDirectory,theme);$(this).attr("href",newLink)})}},$(window).on("resize",function(){clearTimeout(handler.timer),handler.timer=setTimeout(handler.resizeCode,100)}),$downloadDropdown.dropdown({on:"click",transition:"scale"}),void 0!==$.fn.tablesort&&$sortTable.tablesort(),void 0!==window.ace&&($code.each(handler.initializeCode),$existingCode.each(handler.createAnnotation)),$pageTabs.size()>0&&$pageTabs.tab({onTabLoad:function(){$.waypoints("refresh"),$peekItem.removeClass("active").first().addClass("active")}}),$helpPopup.popup(),$swap.on("click",handler.swapStyle),$increaseFont.on("click",handler.font.increase),$decreaseFont.on("click",handler.font.decrease),$developer.on("click",handler.developerMode),$designer.on("click",handler.designerMode),$overview.on("click",handler.overviewMode),$menuPopup.popup({position:"bottom center",className:{popup:"ui popup"}}),$menuDropdown.dropdown({on:"hover",action:"none"}),$sidebarButton.on("mouseenter",handler.menu.mouseenter).on("mouseleave",handler.menu.mouseleave),$menu.sidebar("attach events",".launch.button, .launch.item").sidebar("attach events",$hideMenu,"hide"),$waypoints.waypoint({continuous:!1,offset:100,handler:function(direction){var index="down"==direction?$waypoints.index(this):$waypoints.index(this)-1>=0?$waypoints.index(this)-1:0;$peekItem.removeClass("active").eq(index).addClass("active")}}),$("body").waypoint({handler:function(direction){"down"==direction&&($("body").is(":animated")||$peekItem.removeClass("active").eq($peekItem.size()-1).addClass("active"))},offset:"bottom-in-view"}),$peek.waypoint("sticky",{offset:85,stuckClass:"stuck"}),$peekItem.on("click",handler.peek),$peekSubItem.on("click",handler.peekSub)},$(document).ready(semantic.ready),semantic.table={},semantic.table.ready=function(){var $sortTable=$(".sortable.table");$sortTable.tablesort()},$(document).ready(semantic.table.ready);