From 10f61a3b197e4ad4f7e9207a54c207a0d4a192fc Mon Sep 17 00:00:00 2001 From: Alicia Date: Sat, 23 Feb 2019 13:59:41 +0000 Subject: [PATCH] add relax and autopilot leaderboards --- static/dist.min.js | 2 +- templates/leaderboard_auto.html | 0 templates/leaderboard_relax.html | 59 ++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 templates/leaderboard_auto.html create mode 100644 templates/leaderboard_relax.html diff --git a/static/dist.min.js b/static/dist.min.js index 52d21cb..e69c9e8 100644 --- a/static/dist.min.js +++ b/static/dist.min.js @@ -42,4 +42,4 @@ w.hide())},show:function(e){if(e=e||function(){},w.debug("Showing pop-up",C.tran e.each(n,function(n,i){if(e.isArray(i.results)&&(r=p.search.object(t,i.results,o)[0]))return!1})):(p.debug("Finding result in results object",t),r=p.search.object(t,n,o)[0]),r||!1}},select:{firstResult:function(){p.verbose("Selecting first result"),j.first().addClass(g.active)}},set:{focus:function(){T.addClass(g.focus)},loading:function(){T.addClass(g.loading)},value:function(e){p.verbose("Setting search input value",e),S.val(e)},type:function(e){e=e||h.type,"category"==h.type&&T.addClass(h.type)},buttonPressed:function(){A.addClass(g.pressed)}},remove:{loading:function(){T.removeClass(g.loading)},focus:function(){T.removeClass(g.focus)},buttonPressed:function(){A.removeClass(g.pressed)}},query:function(){var t=p.get.value(),n=p.read.cache(t);p.has.minimumCharacters()?(n?(p.debug("Reading result from cache",t),p.save.results(n.results),p.addResults(n.html),p.inject.id(n.results)):(p.debug("Querying for",t),e.isPlainObject(h.source)||e.isArray(h.source)?p.search.local(t):p.can.useAPI()?p.search.remote(t):p.error(x.source)),h.onSearchQuery.call(D,t)):p.hideResults()},search:{local:function(e){var t,n=p.search.object(e,h.content);p.set.loading(),p.save.results(n),p.debug("Returned local search results",n),t=p.generateResults({results:n}),p.remove.loading(),p.addResults(t),p.inject.id(n),p.write.cache(e,{html:t,results:n})},remote:function(e){T.api("is loading")&&T.api("abort"),p.setup.api(e),T.api("query")},object:function(t,n,o){var r=[],a=[],s=t.toString().replace(v.escape,"\\$&"),l=new RegExp(v.beginsWith+s,"i"),c=function(t,n){var i=e.inArray(n,r)==-1,o=e.inArray(n,a)==-1;i&&o&&t.push(n)};return n=n||h.source,o=o!==i?o:h.searchFields,e.isArray(o)||(o=[o]),n===i||n===!1?(p.error(x.source),[]):(e.each(o,function(i,o){e.each(n,function(e,n){var i="string"==typeof n[o];i&&(n[o].search(l)!==-1?c(r,n):h.searchFullText&&p.fuzzySearch(t,n[o])&&c(a,n))})}),e.merge(r,a))}},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,r=0;o=h.minCharacters}},clear:{cache:function(e){var t=T.data(m.cache);e?e&&t&&t[e]&&(p.debug("Removing value from cache",e),delete t[e],T.data(m.cache,t)):(p.debug("Clearing cache",e),T.removeData(m.cache))}},read:{cache:function(e){var t=T.data(m.cache);return!!h.cache&&(p.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==i&&t[e])}},create:{id:function(e,t){var n,o,r=e+1;return t!==i?(n=String.fromCharCode(97+t),o=n+r,p.verbose("Creating category result id",o)):(o=r,p.verbose("Creating result id",o)),o},results:function(){0===E.length&&(E=e("
").addClass(g.results).appendTo(T))}},inject:{result:function(e,t,n){p.verbose("Injecting result into results");var o=n!==i?E.children().eq(n).children(y.result).eq(t):E.children(y.result).eq(t);p.verbose("Injecting results metadata",o),o.data(m.result,e)},id:function(t){p.debug("Injecting unique ids into results");var n=0,o=0;return"category"===h.type?e.each(t,function(t,r){o=0,e.each(r.results,function(e,t){var a=r.results[e];a.id===i&&(a.id=p.create.id(o,n)),p.inject.result(a,o,n),o++}),n++}):e.each(t,function(e,n){var r=t[e];r.id===i&&(r.id=p.create.id(o)),p.inject.result(r,o),o++}),t}},save:{results:function(e){p.verbose("Saving current search results to metadata",e),T.data(m.results,e)}},write:{cache:function(e,t){var n=T.data(m.cache)!==i?T.data(m.cache):{};h.cache&&(p.verbose("Writing generated html to cache",e,t),n[e]=t,T.data(m.cache,n))}},addResults:function(t){return e.isFunction(h.onResultsAdd)&&h.onResultsAdd.call(E,t)===!1?(p.debug("onResultsAdd callback cancelled default action"),!1):void(t?(E.html(t),p.refreshResults(),h.selectFirstResult&&p.select.firstResult(),p.showResults()):p.hideResults())},showResults:function(){p.is.visible()||(p.can.transition()?(p.debug("Showing results with css animations"),E.transition({animation:h.transition+" in",debug:h.debug,verbose:h.verbose,duration:h.duration,queue:!0})):(p.debug("Showing results with javascript"),E.stop().fadeIn(h.duration,h.easing)),h.onResultsOpen.call(E))},hideResults:function(){p.is.visible()&&(p.can.transition()?(p.debug("Hiding results with css animations"),E.transition({animation:h.transition+" out",debug:h.debug,verbose:h.verbose,duration:h.duration,queue:!0})):(p.debug("Hiding results with javascript"),E.stop().fadeOut(h.duration,h.easing)),h.onResultsClose.call(E))},generateResults:function(t){p.debug("Generating html from response",t);var n=h.templates[h.type],i=e.isPlainObject(t[b.results])&&!e.isEmptyObject(t[b.results]),o=e.isArray(t[b.results])&&t[b.results].length>0,r="";return i||o?(h.maxResults>0&&(i?"standard"==h.type&&p.error(x.maxResults):t[b.results]=t[b.results].slice(0,h.maxResults)),e.isFunction(n)?r=n(t,b):p.error(x.noTemplate,!1)):h.showNoResults&&(r=p.displayMessage(x.noResults,"empty")),h.onResults.call(D,t),r},displayMessage:function(e,t){return t=t||"standard",p.debug("Displaying message",e,t),p.addResults(h.templates.message(e,t)),h.templates.message(e,t)},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];h[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,p,t);else{if(n===i)return p[t];p[t]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,h.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),p.verbose.apply(console,arguments)))},error:function(){h.silent||(p.error=Function.prototype.bind.call(console.error,console,h.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;h.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var t=h.name+":",n=0;l=!1,clearTimeout(p.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var a,s,l,c=O;return n=n||f,o=D||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i&&(s=c[o],!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),s}},d?(O===i&&p.initialize(),p.invoke(u)):(O!==i&&O.invoke("destroy"),p.initialize())}),r!==i?r:this},e.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchFields:["title","description"],displayField:"",searchFullText:!0,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},message:function(e,t){var n="";return e!==i&&t!==i&&(n+='
',n+="empty"==t?'
No Results
'+e+'
':'
'+e+"
",n+="
"),n},category:function(t,n){var o="";return e.fn.search.settings.templates.escape,t[n.categoryResults]!==i&&(e.each(t[n.categoryResults],function(t,r){r[n.results]!==i&&r.results.length>0&&(o+='")}),t[n.action]&&(o+=''+t[n.action][n.actionText]+""),o)},standard:function(t,n){var o="";return t[n.results]!==i&&(e.each(t[n.results],function(e,t){o+=t[n.url]?'':'',t[n.image]!==i&&(o+='
'),o+='
',t[n.price]!==i&&(o+='
'+t[n.price]+"
"),t[n.title]!==i&&(o+='
'+t[n.title]+"
"),t[n.description]!==i&&(o+='
'+t[n.description]+"
"),o+="
",o+="
"}),t[n.action]&&(o+=''+t[n.action][n.actionText]+""),o)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.sidebar=function(o){var r,a=e(this),s=e(t),l=e(n),c=e("html"),u=e("head"),d=a.selector||"",f=(new Date).getTime(),p=[],h=arguments[0],g="string"==typeof h,m=[].slice.call(arguments,1),v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return a.each(function(){var a,b,y,x,w,C,k=e.isPlainObject(o)?e.extend(!0,{},e.fn.sidebar.settings,o):e.extend({},e.fn.sidebar.settings),T=k.selector,S=k.className,A=k.namespace,E=k.regExp,j=k.error,R="."+A,D="module-"+A,O=e(this),P=e(k.context),F=O.children(T.sidebar),L=P.children(T.fixed),q=P.children(T.pusher),N=this,M=O.data(D);C={initialize:function(){C.debug("Initializing sidebar",o),C.create.id(),w=C.get.transitionEvent(),C.is.ios()&&C.set.ios(),k.delaySetup?v(C.setup.layout):C.setup.layout(),v(function(){C.setup.cache()}),C.instantiate()},instantiate:function(){C.verbose("Storing instance of module",C),M=C,O.data(D,C)},create:{id:function(){y=(Math.random().toString(16)+"000000000").substr(2,8),b="."+y,C.verbose("Creating unique id for element",y)}},destroy:function(){C.verbose("Destroying previous module for",O),O.off(R).removeData(D),C.is.ios()&&C.remove.ios(),P.off(b),s.off(b),l.off(b)},event:{clickaway:function(e){var t=q.find(e.target).length>0||q.is(e.target),n=P.is(e.target);t&&(C.verbose("User clicked on dimmed page"),C.hide()),n&&(C.verbose("User clicked on dimmable context (scaled out page)"),C.hide())},touch:function(e){},containScroll:function(e){N.scrollTop<=0&&(N.scrollTop=1),N.scrollTop+N.offsetHeight>=N.scrollHeight&&(N.scrollTop=N.scrollHeight-N.offsetHeight-1)},scroll:function(t){0===e(t.target).closest(T.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){C.verbose("Adding clickaway events to context",P),k.closable&&P.on("click"+b,C.event.clickaway).on("touchend"+b,C.event.clickaway)},scrollLock:function(){k.scrollLock&&(C.debug("Disabling page scroll"),s.on("DOMMouseScroll"+b,C.event.scroll)),C.verbose("Adding events to contain sidebar scroll"),l.on("touchmove"+b,C.event.touch),O.on("scroll"+R,C.event.containScroll)}},unbind:{clickaway:function(){C.verbose("Removing clickaway events from context",P),P.off(b)},scrollLock:function(){C.verbose("Removing scroll lock from page"),l.off(b),s.off(b),O.off("scroll"+R)}},add:{inlineCSS:function(){var t,n=C.cache.width||O.outerWidth(),i=C.cache.height||O.outerHeight(),o=C.is.rtl(),r=C.get.direction(),s={left:n,right:-n,top:i,bottom:-i};o&&(C.verbose("RTL detected, flipping widths"),s.left=-n,s.right=n),t="",a=e(t).appendTo(u),C.debug("Adding sizing css to head",a)}},refresh:function(){C.verbose("Refreshing selector cache"),P=e(k.context),F=P.children(T.sidebar),q=P.children(T.pusher),L=P.children(T.fixed),C.clear.cache()},refreshSidebars:function(){C.verbose("Refreshing other sidebars"),F=P.children(T.sidebar)},repaint:function(){C.verbose("Forcing repaint event"),N.style.display="none",N.offsetHeight,N.scrollTop=N.scrollTop,N.style.display=""},setup:{cache:function(){C.cache={width:O.outerWidth(),height:O.outerHeight(),rtl:"rtl"==O.css("direction")}},layout:function(){0===P.children(T.pusher).length&&(C.debug("Adding wrapper element for sidebar"),C.error(j.pusher),q=e('
'),P.children().not(T.omitted).not(F).wrapAll(q),C.refresh()),0!==O.nextAll(T.pusher).length&&O.nextAll(T.pusher)[0]===q[0]||(C.debug("Moved sidebar to correct parent element"),C.error(j.movedSidebar,N),O.detach().prependTo(P),C.refresh()),C.clear.cache(),C.set.pushable(),C.set.direction()}},attachEvents:function(t,n){var i=e(t);n=e.isFunction(C[n])?C[n]:C.toggle,i.length>0?(C.debug("Attaching sidebar events to element",t,n),i.on("click"+R,n)):C.error(j.notFound,t)},show:function(t){if(t=e.isFunction(t)?t:function(){},C.is.hidden()){if(C.refreshSidebars(),k.overlay&&(C.error(j.overlay),k.transition="overlay"),C.refresh(),C.othersActive())if(C.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void C.hideOthers(C.show);C.hideOthers()}else k.transition="overlay";C.pushPage(function(){t.call(N),k.onShow.call(N)}),k.onChange.call(N),k.onVisible.call(N)}else C.debug("Sidebar is already visible")},hide:function(t){t=e.isFunction(t)?t:function(){},(C.is.visible()||C.is.animating())&&(C.debug("Hiding sidebar",t),C.refreshSidebars(),C.pullPage(function(){t.call(N),k.onHidden.call(N)}),k.onChange.call(N),k.onHide.call(N))},othersAnimating:function(){return F.not(O).filter("."+S.animating).length>0},othersVisible:function(){return F.not(O).filter("."+S.visible).length>0},othersActive:function(){return C.othersVisible()||C.othersAnimating()},hideOthers:function(e){var t=F.not(O).filter("."+S.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){C.verbose("Determining toggled direction"),C.is.hidden()?C.show():C.hide()},pushPage:function(t){var n,i,o,r=C.get.transition(),a="overlay"===r||C.othersActive()?O:q;t=e.isFunction(t)?t:function(){},"scale down"==k.transition&&C.scrollToTop(),C.set.transition(r),C.repaint(),n=function(){C.bind.clickaway(),C.add.inlineCSS(),C.set.animating(),C.set.visible()},i=function(){C.set.dimmed()},o=function(e){e.target==a[0]&&(a.off(w+b,o),C.remove.animating(),C.bind.scrollLock(),t.call(N))},a.off(w+b),a.on(w+b,o),v(n),k.dimPage&&!C.othersVisible()&&v(i)},pullPage:function(t){var n,i,o=C.get.transition(),r="overlay"==o||C.othersActive()?O:q;t=e.isFunction(t)?t:function(){},C.verbose("Removing context push state",C.get.direction()),C.unbind.clickaway(),C.unbind.scrollLock(),n=function(){C.set.transition(o),C.set.animating(),C.remove.visible(),k.dimPage&&!C.othersVisible()&&q.removeClass(S.dimmed)},i=function(e){e.target==r[0]&&(r.off(w+b,i),C.remove.animating(),C.remove.transition(),C.remove.inlineCSS(),("scale down"==o||k.returnScroll&&C.is.mobile())&&C.scrollBack(),t.call(N))},r.off(w+b),r.on(w+b,i),v(n)},scrollToTop:function(){C.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),O.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){C.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},clear:{cache:function(){C.verbose("Clearing cached dimensions"),C.cache={}}},set:{ios:function(){c.addClass(S.ios)},pushed:function(){P.addClass(S.pushed)},pushable:function(){P.addClass(S.pushable)},dimmed:function(){q.addClass(S.dimmed)},active:function(){O.addClass(S.active)},animating:function(){O.addClass(S.animating)},transition:function(e){e=e||C.get.transition(),O.addClass(e)},direction:function(e){e=e||C.get.direction(),O.addClass(S[e])},visible:function(){O.addClass(S.visible)},overlay:function(){O.addClass(S.overlay)}},remove:{inlineCSS:function(){C.debug("Removing inline css styles",a),a&&a.length>0&&a.remove()},ios:function(){c.removeClass(S.ios)},pushed:function(){P.removeClass(S.pushed)},pushable:function(){P.removeClass(S.pushable)},active:function(){O.removeClass(S.active)},animating:function(){O.removeClass(S.animating)},transition:function(e){e=e||C.get.transition(),O.removeClass(e)},direction:function(e){e=e||C.get.direction(),O.removeClass(S[e])},visible:function(){O.removeClass(S.visible)},overlay:function(){O.removeClass(S.overlay)}},get:{direction:function(){return O.hasClass(S.top)?S.top:O.hasClass(S.right)?S.right:O.hasClass(S.bottom)?S.bottom:S.left},transition:function(){var e,t=C.get.direction();return e=C.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,C.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]}},is:{ie:function(){var e=!t.ActiveXObject&&"ActiveXObject"in t,n="ActiveXObject"in t;return e||n},ios:function(){var e=navigator.userAgent,t=e.match(E.ios),n=e.match(E.mobileChrome);return!(!t||n||(C.verbose("Browser was found to be iOS",e),0))},mobile:function(){var e=navigator.userAgent,t=e.match(E.mobile);return t?(C.verbose("Browser was found to be mobile",e),!0):(C.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!C.is.visible()},visible:function(){return O.hasClass(S.visible)},open:function(){return C.is.visible()},closed:function(){return C.is.hidden()},vertical:function(){return O.hasClass(S.top)},animating:function(){return P.hasClass(S.animating)},rtl:function(){return C.cache.rtl===i&&(C.cache.rtl="rtl"==O.css("direction")),C.cache.rtl}},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,k,t);else{if(n===i)return k[t];e.isPlainObject(k[t])?e.extend(!0,k[t],n):k[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){!k.silent&&k.debug&&(k.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,k.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),C.verbose.apply(console,arguments)))},error:function(){k.silent||(C.error=Function.prototype.bind.call(console.error,console,k.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;k.performance&&(t=(new Date).getTime(),i=f||t,n=t-i,f=t,p.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:N,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=k.name+":",n=0;f=!1,clearTimeout(C.performance.timer),e.each(p,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",d&&(t+=" '"+d+"'"),(console.group!==i||console.table!==i)&&p.length>0&&(console.groupCollapsed(t),console.table?console.table(p):e.each(p,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(t,n,o){var a,s,l,c=M;return n=n||m,o=N||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i?(s=c[o],!1):(C.error(j.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),s}},g?(M===i&&C.initialize(),C.invoke(h)):(M!==i&&C.invoke("destroy"),C.initialize())}),r!==i?r:this},e.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.tab=function(o){var r,a=e(e.isFunction(this)?t:this),s=a.selector||"",l=(new Date).getTime(),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1),p=!1;return a.each(function(){var h,g,m,v,b,y,x=e.isPlainObject(o)?e.extend(!0,{},e.fn.tab.settings,o):e.extend({},e.fn.tab.settings),w=x.className,C=x.metadata,k=x.selector,T=x.error,S="."+x.namespace,A="module-"+x.namespace,E=e(this),j={},R=!0,D=0,O=this,P=E.data(A);b={initialize:function(){b.debug("Initializing tab menu item",E),b.fix.callbacks(),b.determineTabs(),b.debug("Determining tabs",x.context,g),x.auto&&b.set.auto(),b.bind.events(),x.history&&!p&&(b.initializeHistory(),p=!0),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),P=b,E.data(A,b)},destroy:function(){b.debug("Destroying tabs",E),E.removeData(A).off(S)},bind:{events:function(){e.isWindow(O)||(b.debug("Attaching tab activation events to element",E),E.on("click"+S,b.event.click))}},determineTabs:function(){var t;"parent"===x.context?(E.closest(k.ui).length>0?(t=E.closest(k.ui),b.verbose("Using closest UI element as parent",t)):t=E,h=t.parent(),b.verbose("Determined parent element for creating context",h)):x.context?(h=e(x.context),b.verbose("Using selector for tab context",x.context,h)):h=e("body"),x.childrenOnly?(g=h.children(k.tabs),b.debug("Searching tab context children for tabs",h,g)):(g=h.find(k.tabs),b.debug("Searching tab context for tabs",h,g))},fix:{callbacks:function(){e.isPlainObject(o)&&(o.onTabLoad||o.onTabInit)&&(o.onTabLoad&&(o.onLoad=o.onTabLoad,delete o.onTabLoad,b.error(T.legacyLoad,o.onLoad)),o.onTabInit&&(o.onFirstLoad=o.onTabInit,delete o.onTabInit,b.error(T.legacyInit,o.onFirstLoad)),x=e.extend(!0,{},e.fn.tab.settings,o))}},initializeHistory:function(){if(b.debug("Initializing page state"),e.address===i)return b.error(T.state),!1;if("state"==x.historyType){if(b.debug("Using HTML5 to manage state"),x.path===!1)return b.error(T.path),!1;e.address.history(!0).state(x.path)}e.address.bind("change",b.event.history.change)},event:{click:function(t){var n=e(this).data(C.tab);n!==i?(x.history?(b.verbose("Updating page state",t),e.address.value(n)):(b.verbose("Changing tab",t),b.changeTab(n)),t.preventDefault()):b.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||b.get.initialPath(),o=x.templates.determineTitle(n)||!1;b.performance.display(),b.debug("History change event",n,t),y=t,n!==i&&b.changeTab(n),o&&e.address.title(o)}}},refresh:function(){m&&(b.debug("Refreshing tab",m),b.changeTab(m))},cache:{read:function(e){return e!==i&&j[e]},add:function(e,t){e=e||m,b.debug("Adding cached content for",e),j[e]=t},remove:function(e){e=e||m,b.debug("Removing cached content for",e),delete j[e]}},set:{auto:function(){var t="string"==typeof x.path?x.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";b.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(x.apiSettings)?x.apiSettings.url=t:x.apiSettings={url:t}},loading:function(e){var t=b.get.tabElement(e),n=t.hasClass(w.loading);n||(b.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(g).removeClass(w.active+" "+w.loading),t.length>0&&x.onRequest.call(t[0],e))},state:function(t){e.address.value(t)}},changeTab:function(n){var i=t.history&&t.history.pushState,o=i&&x.ignoreFirstLoad&&R,r=x.auto||e.isPlainObject(x.apiSettings),a=r&&!o?b.utilities.pathToArray(n):b.get.defaultPathArray(n);n=b.utilities.arrayToPath(a),e.each(a,function(t,i){var s,l,c,u,d=a.slice(0,t+1),f=b.utilities.arrayToPath(d),p=b.is.tab(f),g=t+1==a.length,k=b.get.tabElement(f);if(b.verbose("Looking for tab",i),p){if(b.verbose("Tab was found",i),m=f,v=b.utilities.filterArray(a,d),g?u=!0:(l=a.slice(0,t+2),c=b.utilities.arrayToPath(l),u=!b.is.tab(c),u&&b.verbose("Tab parameters found",l)),u&&r)return o?(b.debug("Ignoring remote content on first tab load",f),R=!1,b.cache.add(n,k.html()),b.activate.all(f),x.onFirstLoad.call(k[0],f,v,y),x.onLoad.call(k[0],f,v,y)):(b.activate.navigation(f),b.fetch.content(f,n)),!1;b.debug("Opened local tab",f),b.activate.all(f),b.cache.read(f)||(b.cache.add(f,!0),b.debug("First time tab loaded calling tab init"),x.onFirstLoad.call(k[0],f,v,y)),x.onLoad.call(k[0],f,v,y)}else{if(n.search("/")!=-1||""===n)return b.error(T.missingTab,E,h,f),!1;if(s=e("#"+n+', a[name="'+n+'"]'),f=s.closest("[data-tab]").data(C.tab),k=b.get.tabElement(f),s&&s.length>0&&f)return b.debug("Anchor link used, opening parent tab",k,s),k.hasClass(w.active)||setTimeout(function(){b.scrollTo(s)},0),b.activate.all(f),b.cache.read(f)||(b.cache.add(f,!0),b.debug("First time tab loaded calling tab init"),x.onFirstLoad.call(k[0],f,v,y)),x.onLoad.call(k[0],f,v,y),!1}})},scrollTo:function(t){var i=!!(t&&t.length>0)&&t.offset().top;i!==!1&&(b.debug("Forcing scroll to an in-page link in a hidden tab",i,t),e(n).scrollTop(i))},update:{content:function(t,n,o){var r=b.get.tabElement(t),a=r[0];o=o!==i?o:x.evaluateScripts,"string"==typeof x.cacheType&&"dom"==x.cacheType.toLowerCase()&&"string"!=typeof n?r.empty().append(e(n).clone(!0)):o?(b.debug("Updating HTML and evaluating inline scripts",t,n),r.html(n)):(b.debug("Updating HTML",t,n),a.innerHTML=n)}},fetch:{content:function(t,n){var o,r,a=b.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:x.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==x.cacheType&&b.cache.add(n,e),b.update.content(t,e),t==m?(b.debug("Content loaded",t),b.activate.tab(t)):b.debug("Content loaded in background",t),x.onFirstLoad.call(a[0],t,v,y),x.onLoad.call(a[0],t,v,y),"string"==typeof x.cacheType&&"dom"==x.cacheType.toLowerCase()&&a.children().length>0?setTimeout(function(){var e=a.children().clone(!0);e=e.not("script"),b.cache.add(n,e)},0):b.cache.add(n,a.html())},urlData:{tab:n}},l=a.api("get request")||!1,c=l&&"pending"===l.state();n=n||t,r=b.cache.read(n),x.cache&&r?(b.activate.tab(t),b.debug("Adding cached content",n),"once"==x.evaluateScripts?b.update.content(t,r,!1):b.update.content(t,r),x.onLoad.call(a[0],t,v,y)):c?(b.set.loading(t),b.debug("Content is already loading",n)):e.api!==i?(o=e.extend(!0,{},x.apiSettings,s),b.debug("Retrieving remote content",n,o),b.set.loading(t),a.api(o)):b.error(T.api)}},activate:{all:function(e){b.activate.tab(e),b.activate.navigation(e)},tab:function(e){var t=b.get.tabElement(e),n="siblings"==x.deactivate?t.siblings(g):g.not(t),i=t.hasClass(w.active);b.verbose("Showing tab content for",t),i||(t.addClass(w.active),n.removeClass(w.active+" "+w.loading),t.length>0&&x.onVisible.call(t[0],e))},navigation:function(e){var t=b.get.navElement(e),n="siblings"==x.deactivate?t.siblings(a):a.not(t),i=t.hasClass(w.active);b.verbose("Activating tab navigation for",t,e),i||(t.addClass(w.active),n.removeClass(w.active+" "+w.loading))}},deactivate:{all:function(){b.deactivate.navigation(),b.deactivate.tabs()},navigation:function(){a.removeClass(w.active)},tabs:function(){g.removeClass(w.active+" "+w.loading)}},is:{tab:function(e){return e!==i&&b.get.tabElement(e).length>0}},get:{initialPath:function(){return a.eq(0).data(C.tab)||g.eq(0).data(C.tab)},path:function(){return e.address.value()},defaultPathArray:function(e){return b.utilities.pathToArray(b.get.defaultPath(e))},defaultPath:function(e){ var t=a.filter("[data-"+C.tab+'^="'+e+'/"]').eq(0),n=t.data(C.tab)||!1;if(n){if(b.debug("Found default tab",n),D0?t:n},tab:function(){return m}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return e.inArray(t,n)==-1})},last:function(t){return!!e.isArray(t)&&t[t.length-1]},pathToArray:function(e){return e===i&&(e=m),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return!!e.isArray(t)&&t.join("/")}},setting:function(t,n){if(b.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];e.isPlainObject(x[t])?e.extend(!0,x[t],n):x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},debug:function(){!x.silent&&x.debug&&(x.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,x.name+":"),b.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),b.verbose.apply(console,arguments)))},error:function(){x.silent||(b.error=Function.prototype.bind.call(console.error,console,x.name+":"),b.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:O,"Execution Time":n})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,500)},display:function(){var t=x.name+":",n=0;l=!1,clearTimeout(b.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var a,s,l,c=P;return n=n||f,o=O||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i?(s=c[o],!1):(b.error(T.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),s}},d?(P===i&&b.initialize(),b.invoke(u)):(P!==i&&P.invoke("destroy"),b.initialize())}),r!==i?r:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library "},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.transition=function(){var o,r=e(this),a=r.selector||"",s=(new Date).getTime(),l=[],c=arguments,u=c[0],d=[].slice.call(arguments,1),f="string"==typeof u;return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},r.each(function(t){var p,h,g,m,v,b,y,x,w,C=e(this),k=this;w={initialize:function(){p=w.get.settings.apply(k,c),m=p.className,g=p.error,v=p.metadata,x="."+p.namespace,y="module-"+p.namespace,h=C.data(y)||w,b=w.get.animationEndEvent(),f&&(f=w.invoke(u)),f===!1&&(w.verbose("Converted arguments into settings object",p),p.interval?w.delay(p.animate):w.animate(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),h=w,C.data(y,h)},destroy:function(){w.verbose("Destroying previous module for",k),C.removeData(y)},refresh:function(){w.verbose("Refreshing display type on next animation"),delete w.displayType},forceRepaint:function(){w.verbose("Forcing element repaint");var e=C.parent(),t=C.next();0===t.length?C.detach().appendTo(e):C.detach().insertBefore(t)},repaint:function(){w.verbose("Repainting element"),k.offsetWidth},delay:function(e){var n,o,a=w.get.animationDirection();a||(a=w.can.transition()?w.get.direction():"static"),e=e!==i?e:p.interval,n="auto"==p.reverse&&a==m.outward,o=n||1==p.reverse?(r.length-t)*p.interval:t*p.interval,w.debug("Delaying animation by",o),setTimeout(w.animate,o)},animate:function(e){if(p=e||p,!w.is.supported())return w.error(g.support),!1;if(w.debug("Preparing animation",p.animation),w.is.animating()){if(p.queue)return!p.allowRepeats&&w.has.direction()&&w.is.occurring()&&w.queuing!==!0?w.debug("Animation is currently occurring, preventing queueing same animation",p.animation):w.queue(p.animation),!1;if(!p.allowRepeats&&w.is.occurring())return w.debug("Animation is already occurring, will not execute repeated animation",p.animation),!1;w.debug("New animation started, completing previous early",p.animation),h.complete()}w.can.animate()?w.set.animating(p.animation):w.error(g.noAnimation,p.animation,k)},reset:function(){w.debug("Resetting animation to beginning conditions"),w.remove.animationCallbacks(),w.restore.conditions(),w.remove.animating()},queue:function(e){w.debug("Queueing animation of",e),w.queuing=!0,C.one(b+".queue"+x,function(){w.queuing=!1,w.repaint(),w.animate.apply(this,p)})},complete:function(e){w.debug("Animation complete",p.animation),w.remove.completeCallback(),w.remove.failSafe(),w.is.looping()||(w.is.outward()?(w.verbose("Animation is outward, hiding element"),w.restore.conditions(),w.hide()):w.is.inward()?(w.verbose("Animation is outward, showing element"),w.restore.conditions(),w.show()):(w.verbose("Static animation completed"),w.restore.conditions(),p.onComplete.call(k)))},force:{visible:function(){var e=C.attr("style"),t=w.get.userStyle(),n=w.get.displayType(),o=t+"display: "+n+" !important;",r=C.css("display"),a=e===i||""===e;r!==n?(w.verbose("Overriding default display to show element",n),C.attr("style",o)):a&&C.removeAttr("style")},hidden:function(){var e=C.attr("style"),t=C.css("display"),n=e===i||""===e;"none"===t||w.is.hidden()?n&&C.removeAttr("style"):(w.verbose("Overriding default display to hide element"),C.css("display","none"))}},has:{direction:function(t){var n=!1;return t=t||p.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){t!==m.inward&&t!==m.outward||(n=!0)})),n},inlineDisplay:function(){var t=C.attr("style")||"";return e.isArray(t.match(/display.*?;/,""))}},set:{animating:function(e){var t;w.remove.completeCallback(),e=e||p.animation,t=w.get.animationClass(e),w.save.animation(t),w.force.visible(),w.remove.hidden(),w.remove.direction(),w.start.animation(t)},duration:function(e,t){t=t||p.duration,t="number"==typeof t?t+"ms":t,(t||0===t)&&(w.verbose("Setting animation duration",t),C.css({"animation-duration":t}))},direction:function(e){e=e||w.get.direction(),e==m.inward?w.set.inward():w.set.outward()},looping:function(){w.debug("Transition set to loop"),C.addClass(m.looping)},hidden:function(){C.addClass(m.transition).addClass(m.hidden)},inward:function(){w.debug("Setting direction to inward"),C.removeClass(m.outward).addClass(m.inward)},outward:function(){w.debug("Setting direction to outward"),C.removeClass(m.inward).addClass(m.outward)},visible:function(){C.addClass(m.transition).addClass(m.visible)}},start:{animation:function(e){e=e||w.get.animationClass(),w.debug("Starting tween",e),C.addClass(e).one(b+".complete"+x,w.complete),p.useFailSafe&&w.add.failSafe(),w.set.duration(p.duration),p.onStart.call(k)}},save:{animation:function(e){w.cache||(w.cache={}),w.cache.animation=e},displayType:function(e){"none"!==e&&C.data(v.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,w.verbose("Saving existence of transition",t,n)}},restore:{conditions:function(){var e=w.get.currentAnimation();e&&(C.removeClass(e),w.verbose("Removing animation class",w.cache)),w.remove.duration()}},add:{failSafe:function(){var e=w.get.duration();w.timer=setTimeout(function(){C.triggerHandler(b)},e+p.failSafeDelay),w.verbose("Adding fail safe timer",w.timer)}},remove:{animating:function(){C.removeClass(m.animating)},animationCallbacks:function(){w.remove.queueCallback(),w.remove.completeCallback()},queueCallback:function(){C.off(".queue"+x)},completeCallback:function(){C.off(".complete"+x)},display:function(){C.css("display","")},direction:function(){C.removeClass(m.inward).removeClass(m.outward)},duration:function(){C.css("animation-duration","")},failSafe:function(){w.verbose("Removing fail safe timer",w.timer),w.timer&&clearTimeout(w.timer)},hidden:function(){C.removeClass(m.hidden)},visible:function(){C.removeClass(m.visible)},looping:function(){w.debug("Transitions are no longer looping"),w.is.looping()&&(w.reset(),C.removeClass(m.looping))},transition:function(){C.removeClass(m.visible).removeClass(m.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},animationClass:function(e){var t=e||p.animation,n=w.can.transition()&&!w.has.direction()?w.get.direction()+" ":"";return m.animating+" "+m.transition+" "+n+t},currentAnimation:function(){return!(!w.cache||w.cache.animation===i)&&w.cache.animation},currentDirection:function(){return w.is.inward()?m.inward:m.outward},direction:function(){return w.is.hidden()||!w.is.visible()?m.inward:m.outward},animationDirection:function(t){var n;return t=t||p.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){t===m.inward?n=m.inward:t===m.outward&&(n=m.outward)})),!!n&&n},duration:function(e){return e=e||p.duration,e===!1&&(e=C.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(e){return e=e===i||e,p.displayType?p.displayType:(e&&C.data(v.displayType)===i&&w.can.transition(!0),C.data(v.displayType))},userStyle:function(e){return e=e||C.attr("style")||"",e.replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in o)if(t.style[e]!==i)return o[e];return!1},animationEndEvent:function(){var e,t=n.createElement("div"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in o)if(t.style[e]!==i)return o[e];return!1}},can:{transition:function(t){var n,o,r,a,s,l,c=p.animation,u=w.get.transitionExists(c),d=w.get.displayType(!1);if(u===i||t){if(w.verbose("Determining whether animation exists"),n=C.attr("class"),o=C.prop("tagName"),r=e("<"+o+" />").addClass(n).insertAfter(C),a=r.addClass(c).removeClass(m.inward).removeClass(m.outward).addClass(m.animating).addClass(m.transition).css("animationName"),s=r.addClass(m.inward).css("animationName"),d||(d=r.attr("class",n).removeAttr("style").removeClass(m.hidden).removeClass(m.visible).show().css("display"),w.verbose("Determining final display state",d),w.save.displayType(d)),r.remove(),a!=s)w.debug("Direction exists for animation",c),l=!0;else{if("none"==a||!a)return void w.debug("No animation defined in css",c);w.debug("Static animation found",c,d),l=!1}w.save.transitionExists(c,l)}return u!==i?u:l},animate:function(){return w.can.transition()!==i}},is:{animating:function(){return C.hasClass(m.animating)},inward:function(){return C.hasClass(m.inward)},outward:function(){return C.hasClass(m.outward)},looping:function(){return C.hasClass(m.looping)},occurring:function(e){return e=e||p.animation,e="."+e.replace(" ","."),C.filter(e).length>0},visible:function(){return C.is(":visible")},hidden:function(){return"hidden"===C.css("visibility")},supported:function(){return b!==!1}},hide:function(){w.verbose("Hiding element"),w.is.animating()&&w.reset(),k.blur(),w.remove.display(),w.remove.visible(),w.set.hidden(),w.force.hidden(),p.onHide.call(k),p.onComplete.call(k)},show:function(e){w.verbose("Showing element",e),w.remove.hidden(),w.set.visible(),w.force.visible(),p.onShow.call(k),p.onComplete.call(k)},toggle:function(){w.is.visible()?w.hide():w.show()},stop:function(){w.debug("Stopping current animation"),C.triggerHandler(b)},stopAll:function(){w.debug("Stopping all animation"),w.remove.queueCallback(),C.triggerHandler(b)},clear:{queue:function(){w.debug("Clearing animation queue"),w.remove.queueCallback()}},enable:function(){w.verbose("Starting animation"),C.removeClass(m.disabled)},disable:function(){w.debug("Stopping animation"),C.addClass(m.disabled)},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,p,t);else{if(n===i)return p[t];e.isPlainObject(p[t])?e.extend(!0,p[t],n):p[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){!p.silent&&p.debug&&(p.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,p.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),w.verbose.apply(console,arguments)))},error:function(){p.silent||(w.error=Function.prototype.bind.call(console.error,console,p.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;p.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=p.name+":",n=0;s=!1,clearTimeout(w.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,r){var a,s,l,c=h;return n=n||d,r=k||r,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i&&(s=c[o],!1);c=c[o]}})),e.isFunction(s)?l=s.apply(r,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s!==i&&s}},w.initialize()}),o!==i?o:this},e.fn.transition.exists={},e.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(e,t,n,i){"use strict";t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.state=function(t){var o,r=e(this),a=r.selector||"",s=("ontouchstart"in n.documentElement,(new Date).getTime()),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return r.each(function(){var n,f=e.isPlainObject(t)?e.extend(!0,{},e.fn.state.settings,t):e.extend({},e.fn.state.settings),p=f.error,h=f.metadata,g=f.className,m=f.namespace,v=f.states,b=f.text,y="."+m,x=m+"-module",w=e(this),C=this,k=w.data(x);n={initialize:function(){n.verbose("Initializing module"),f.automatic&&n.add.defaults(),f.context&&""!==a?e(f.context).on(a,"mouseenter"+y,n.change.text).on(a,"mouseleave"+y,n.reset.text).on(a,"click"+y,n.toggle.state):w.on("mouseenter"+y,n.change.text).on("mouseleave"+y,n.reset.text).on("click"+y,n.toggle.state),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),k=n,w.data(x,n)},destroy:function(){n.verbose("Destroying previous module",k),w.off(y).removeData(x)},refresh:function(){n.verbose("Refreshing selector cache"),w=e(C)},add:{defaults:function(){var o=t&&e.isPlainObject(t.states)?t.states:{};e.each(f.defaults,function(t,r){n.is[t]!==i&&n.is[t]()&&(n.verbose("Adding default states",t,C),e.extend(f.states,r,o))})}},is:{active:function(){return w.hasClass(g.active)},loading:function(){return w.hasClass(g.loading)},inactive:function(){return!w.hasClass(g.active)},state:function(e){return g[e]!==i&&w.hasClass(g[e])},enabled:function(){return!w.is(f.filter.active)},disabled:function(){return w.is(f.filter.active)},textEnabled:function(){return!w.is(f.filter.text)},button:function(){return w.is(".button:not(a, .submit)")},input:function(){return w.is("input")},progress:function(){return w.is(".ui.progress")}},allow:function(e){n.debug("Now allowing state",e),v[e]=!0},disallow:function(e){n.debug("No longer allowing",e),v[e]=!1},allows:function(e){return v[e]||!1},enable:function(){w.removeClass(g.disabled)},disable:function(){w.addClass(g.disabled)},setState:function(e){n.allows(e)&&w.addClass(g[e])},removeState:function(e){n.allows(e)&&w.removeClass(g[e])},toggle:{state:function(){var t,o;if(n.allows("active")&&n.is.enabled()){if(n.refresh(),e.fn.api!==i)if(t=w.api("get request"),o=w.api("was cancelled"))n.debug("API Request cancelled by beforesend"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1};else if(t)return void n.listenTo(t);n.change.state()}}},listenTo:function(t){n.debug("API request detected, waiting for state signal",t),t&&(b.loading&&n.update.text(b.loading),e.when(t).then(function(){"resolved"==t.state()?(n.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(n.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),n.change.state()}))},change:{state:function(){n.debug("Determining state change direction"),n.is.inactive()?n.activate():n.deactivate(),f.sync&&n.sync(),f.onChange.call(C)},text:function(){n.is.textEnabled()&&(n.is.disabled()?(n.verbose("Changing text to disabled text",b.hover),n.update.text(b.disabled)):n.is.active()?b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.deactivate&&(n.verbose("Changing text to deactivating text",b.deactivate),n.update.text(b.deactivate)):b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.activate&&(n.verbose("Changing text to activating text",b.activate),n.update.text(b.activate)))}},activate:function(){f.activateTest.call(C)&&(n.debug("Setting state to active"),w.addClass(g.active),n.update.text(b.active),f.onActivate.call(C))},deactivate:function(){f.deactivateTest.call(C)&&(n.debug("Setting state to inactive"),w.removeClass(g.active),n.update.text(b.inactive),f.onDeactivate.call(C))},sync:function(){n.verbose("Syncing other buttons to current state"),n.is.active()?r.not(w).state("activate"):r.not(w).state("deactivate")},get:{text:function(){return f.selector.text?w.find(f.selector.text).text():w.html()},textFor:function(e){return b[e]||!1}},flash:{text:function(e,t,i){var o=n.get.text();n.debug("Flashing text message",e,t),e=e||f.text.flash,t=t||f.flashDuration,i=i||function(){},n.update.text(e),setTimeout(function(){n.update.text(o),i.call(C)},t)}},reset:{text:function(){var e=b.active||w.data(h.storedText),t=b.inactive||w.data(h.storedText);n.is.textEnabled()&&(n.is.active()&&e?(n.verbose("Resetting active text",e),n.update.text(e)):t&&(n.verbose("Resetting inactive text",e),n.update.text(t)))}},update:{text:function(e){var t=n.get.text();e&&e!==t?(n.debug("Updating text",e),f.selector.text?w.data(h.storedText,e).find(f.selector.text).text(e):w.data(h.storedText,e).html(e)):n.debug("Text is already set, ignoring update",e)}},setting:function(t,o){if(n.debug("Changing setting",t,o),e.isPlainObject(t))e.extend(!0,f,t);else{if(o===i)return f[t];e.isPlainObject(f[t])?e.extend(!0,f[t],o):f[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,n,t);else{if(o===i)return n[t];n[t]=o}},debug:function(){!f.silent&&f.debug&&(f.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,f.name+":"),n.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),n.verbose.apply(console,arguments)))},error:function(){f.silent||(n.error=Function.prototype.bind.call(console.error,console,f.name+":"),n.error.apply(console,arguments))},performance:{log:function(e){var t,i,o;f.performance&&(t=(new Date).getTime(),o=s||t,i=t-o,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":i})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var t=f.name+":",o=0;s=!1,clearTimeout(n.performance.timer),e.each(l,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",a&&(t+=" '"+a+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,r,a){var s,l,c,u=k;return r=r||d,a=C||a,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(o,r){var a=o!=s?r+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(u[a])&&o!=s)u=u[a];else{if(u[a]!==i)return l=u[a],!1;if(!e.isPlainObject(u[r])||o==s)return u[r]!==i?(l=u[r],!1):(n.error(p.method,t),!1);u=u[r]}})),e.isFunction(l)?c=l.apply(a,r):l!==i&&(c=l),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),l}},u?(k===i&&n.initialize(),n.invoke(c)):(k!==i&&k.invoke("destroy"),n.initialize())}),o!==i?o:this},e.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(e,t,n,i){"use strict";var t="undefined"!=typeof t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();e.api=e.fn.api=function(n){var o,r=e(e.isFunction(this)?t:this),a=r.selector||"",s=(new Date).getTime(),l=[],c=arguments[0],u="string"==typeof c,d=[].slice.call(arguments,1);return r.each(function(){var r,f,p,h,g,m,v=e.isPlainObject(n)?e.extend(!0,{},e.fn.api.settings,n):e.extend({},e.fn.api.settings),b=v.namespace,y=v.metadata,x=v.selector,w=v.error,C=v.className,k="."+b,T="module-"+b,S=e(this),A=S.closest(x.form),E=v.stateContext?e(v.stateContext):S,j=this,R=E[0],D=S.data(T);m={initialize:function(){u||m.bind.events(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),D=m,S.data(T,D)},destroy:function(){m.verbose("Destroying previous module for",j),S.removeData(T).off(k)},bind:{events:function(){var e=m.get.event();e?(m.verbose("Attaching API events to element",e),S.on(e+k,m.event.trigger)):"now"==v.on&&(m.debug("Querying API endpoint immediately"),m.query())}},decode:{json:function(e){if(e!==i&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var n;return t.Storage===i?void m.error(w.noStorage):(n=sessionStorage.getItem(e),m.debug("Using cached response",e,n),n=m.decode.json(n))}},write:{cachedResponse:function(n,o){return o&&""===o?void m.debug("Response empty, not caching",o):t.Storage===i?void m.error(w.noStorage):(e.isPlainObject(o)&&(o=JSON.stringify(o)),sessionStorage.setItem(n,o),void m.verbose("Storing cached response for url",n,o))}},query:function(){if(m.is.disabled())return void m.debug("Element is disabled API request aborted");if(m.is.loading()){if(!v.interruptRequests)return void m.debug("Cancelling request, previous request is still pending");m.debug("Interrupting previous request"),m.abort()}return v.defaultData&&e.extend(!0,v.urlData,m.get.defaultData()),v.serializeForm&&(v.data=m.add.formData(v.data)),f=m.get.settings(),f===!1?(m.cancelled=!0,void m.error(w.beforeSend)):(m.cancelled=!1,p=m.get.templatedURL(),p||m.is.mocked()?(p=m.add.urlData(p),p||m.is.mocked()?(f.url=v.base+p,r=e.extend(!0,{},v,{type:v.method||v.type,data:h,url:v.base+p,beforeSend:v.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),m.debug("Querying URL",r.url),m.verbose("Using AJAX settings",r),"local"===v.cache&&m.read.cachedResponse(p)?(m.debug("Response returned from local cache"),m.request=m.create.request(),void m.request.resolveWith(R,[m.read.cachedResponse(p)])):void(v.throttle?v.throttleFirstRequest||m.timer?(m.debug("Throttling request",v.throttle),clearTimeout(m.timer),m.timer=setTimeout(function(){m.timer&&delete m.timer,m.debug("Sending throttled request",h,r.method),m.send.request()},v.throttle)):(m.debug("Sending request",h,r.method),m.send.request(),m.timer=setTimeout(function(){},v.throttle)):(m.debug("Sending request",h,r.method),m.send.request()))):void 0):void m.error(w.missingURL))},should:{removeError:function(){return v.hideError===!0||"auto"===v.hideError&&!m.is.form()}},is:{disabled:function(){return S.filter(x.disabled).length>0},expectingJSON:function(){return"json"===v.dataType||"jsonp"===v.dataType},form:function(){return S.is("form")||E.is("form")},mocked:function(){return v.mockResponse||v.mockResponseAsync||v.response||v.responseAsync},input:function(){return S.is("input")},loading:function(){return!!m.request&&"pending"==m.request.state()},abortedRequest:function(e){return e&&e.readyState!==i&&0===e.readyState?(m.verbose("XHR request determined to be aborted"),!0):(m.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return m.is.expectingJSON()&&e.isFunction(v.successTest)?(m.debug("Checking JSON returned success",v.successTest,t),v.successTest(t)?(m.debug("Response passed success test",t),!0):(m.debug("Response failed success test",t),!1)):(m.verbose("Response is not JSON, skipping validation",v.successTest,t),!0)}},was:{cancelled:function(){return m.cancelled||!1},succesful:function(){return m.request&&"resolved"==m.request.state()},failure:function(){return m.request&&"rejected"==m.request.state()},complete:function(){return m.request&&("resolved"==m.request.state()||"rejected"==m.request.state())}},add:{urlData:function(t,n){var o,r;return t&&(o=t.match(v.regExp.required),r=t.match(v.regExp.optional),n=n||v.urlData,o&&(m.debug("Looking for required URL variables",o),e.each(o,function(o,r){var a=r.indexOf("$")!==-1?r.substr(2,r.length-3):r.substr(1,r.length-2),s=e.isPlainObject(n)&&n[a]!==i?n[a]:S.data(a)!==i?S.data(a):E.data(a)!==i?E.data(a):n[a];return s===i?(m.error(w.requiredParameter,a,t),t=!1,!1):(m.verbose("Found required variable",a,s),s=v.encodeParameters?m.get.urlEncodedValue(s):s,void(t=t.replace(r,s)))})),r&&(m.debug("Looking for optional URL variables",o),e.each(r,function(o,r){var a=r.indexOf("$")!==-1?r.substr(3,r.length-4):r.substr(2,r.length-3),s=e.isPlainObject(n)&&n[a]!==i?n[a]:S.data(a)!==i?S.data(a):E.data(a)!==i?E.data(a):n[a];s!==i?(m.verbose("Optional variable Found",a,s),t=t.replace(r,s)):(m.verbose("Optional variable not found",a),t=t.indexOf("/"+r)!==-1?t.replace("/"+r,""):t.replace(r,""))}))),t},formData:function(t){var n,o=e.fn.serializeObject!==i,r=o?A.serializeObject():A.serialize();return t=t||v.data,n=e.isPlainObject(t),n?o?(m.debug("Extending existing data with form data",t,r),t=e.extend(!0,{},t,r)):(m.error(w.missingSerialize),m.debug("Cant extend data. Replacing data with form data",t,r),t=r):(m.debug("Adding form data",r),t=r),t}},send:{request:function(){m.set.loading(),m.request=m.create.request(),m.is.mocked()?m.mockedXHR=m.create.mockedXHR():m.xhr=m.create.xhr(),v.onRequest.call(R,m.request,m.xhr)}},event:{trigger:function(e){m.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(t,n,i){var o=this,r=(new Date).getTime()-g,a=v.loadingDuration-r,s=!!e.isFunction(v.onResponse)&&(m.is.expectingJSON()?v.onResponse.call(o,e.extend(!0,{},t)):v.onResponse.call(o,t));a=a>0?a:0,s&&(m.debug("Modified API response in onResponse callback",v.onResponse,s,t),t=s),a>0&&m.debug("Response completed early delaying state change by",a),setTimeout(function(){m.is.validResponse(t)?m.request.resolveWith(o,[t,i]):m.request.rejectWith(o,[i,"invalid"])},a)},fail:function(e,t,n){var i=this,o=(new Date).getTime()-g,r=v.loadingDuration-o;r=r>0?r:0,r>0&&m.debug("Response completed early delaying state change by",r),setTimeout(function(){m.is.abortedRequest(e)?m.request.rejectWith(i,[e,"aborted",n]):m.request.rejectWith(i,[e,"error",t,n])},r)}},request:{done:function(e,t){m.debug("Successful API Response",e),"local"===v.cache&&p&&(m.write.cachedResponse(p,e),m.debug("Saving server response locally",m.cache)),v.onSuccess.call(R,e,S,t)},complete:function(e,t){var n,i;m.was.succesful()?(i=e,n=t):(n=e,i=m.get.responseFromXHR(n)),m.remove.loading(),v.onComplete.call(R,i,S,n)},fail:function(e,t,n){var o=m.get.responseFromXHR(e),a=m.get.errorFromRequest(o,t,n); return"aborted"==t?(m.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),v.onAbort.call(R,t,S,e),!0):("invalid"==t?m.debug("JSON did not pass success test. A server-side error has most likely occurred",o):"error"==t&&e!==i&&(m.debug("XHR produced a server error",t,n),200!=e.status&&n!==i&&""!==n&&m.error(w.statusMessage+n,r.url),v.onError.call(R,a,S,e)),v.errorDuration&&"aborted"!==t&&(m.debug("Adding error state"),m.set.error(),m.should.removeError()&&setTimeout(m.remove.error,v.errorDuration)),m.debug("API Request failed",a,e),void v.onFailure.call(R,o,S,e))}}},create:{request:function(){return e.Deferred().always(m.event.request.complete).done(m.event.request.done).fail(m.event.request.fail)},mockedXHR:function(){var t,n,i,o=!1,r=!1,a=!1,s=v.mockResponse||v.response,l=v.mockResponseAsync||v.responseAsync;return i=e.Deferred().always(m.event.xhr.complete).done(m.event.xhr.done).fail(m.event.xhr.fail),s?(e.isFunction(s)?(m.debug("Using specified synchronous callback",s),n=s.call(R,f)):(m.debug("Using settings specified response",s),n=s),i.resolveWith(R,[n,o,{responseText:n}])):e.isFunction(l)&&(t=function(e){m.debug("Async callback returned response",e),e?i.resolveWith(R,[e,o,{responseText:e}]):i.rejectWith(R,[{responseText:e},r,a])},m.debug("Using specified async response callback",l),l.call(R,f,t)),i},xhr:function(){var t;return t=e.ajax(r).always(m.event.xhr.always).done(m.event.xhr.done).fail(m.event.xhr.fail),m.verbose("Created server request",t,r),t}},set:{error:function(){m.verbose("Adding error state to element",E),E.addClass(C.error)},loading:function(){m.verbose("Adding loading state to element",E),E.addClass(C.loading),g=(new Date).getTime()}},remove:{error:function(){m.verbose("Removing error state from element",E),E.removeClass(C.error)},loading:function(){m.verbose("Removing loading state from element",E),E.removeClass(C.loading)}},get:{responseFromXHR:function(t){return!!e.isPlainObject(t)&&(m.is.expectingJSON()?m.decode.json(t.responseText):t.responseText)},errorFromRequest:function(t,n,o){return e.isPlainObject(t)&&t.error!==i?t.error:v.error[n]!==i?v.error[n]:o},request:function(){return m.request||!1},xhr:function(){return m.xhr||!1},settings:function(){var t;return t=v.beforeSend.call(R,v),t&&(t.success!==i&&(m.debug("Legacy success callback detected",t),m.error(w.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==i&&(m.debug("Legacy failure callback detected",t),m.error(w.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==i&&(m.debug("Legacy complete callback detected",t),m.error(w.legacyParameters,t.complete),t.onComplete=t.complete)),t===i&&m.error(w.noReturnedValue),t===!1?t:t!==i?e.extend(!0,{},t):e.extend(!0,{},v)},urlEncodedValue:function(e){var n=t.decodeURIComponent(e),i=t.encodeURIComponent(e),o=n!==e;return o?(m.debug("URL value is already encoded, avoiding double encoding",e),e):(m.verbose("Encoding value using encodeURIComponent",e,i),i)},defaultData:function(){var t={};return e.isWindow(j)||(m.is.input()?t.value=S.val():m.is.form()||(t.text=S.text())),t},event:function(){return e.isWindow(j)||"now"==v.on?(m.debug("API called without element, no events attached"),!1):"auto"==v.on?S.is("input")?j.oninput!==i?"input":j.onpropertychange!==i?"propertychange":"keyup":S.is("form")?"submit":"click":v.on},templatedURL:function(e){if(e=e||S.data(y.action)||v.action||!1,p=S.data(y.url)||v.url||!1)return m.debug("Using specified url",p),p;if(e){if(m.debug("Looking up url for action",e,v.api),v.api[e]===i&&!m.is.mocked())return void m.error(w.missingAction,v.action,v.api);p=v.api[e]}else m.is.form()&&(p=S.attr("action")||E.attr("action")||!1,m.debug("No url or action specified, defaulting to form action",p));return p}},abort:function(){var e=m.get.xhr();e&&"resolved"!==e.state()&&(m.debug("Cancelling API request"),e.abort())},reset:function(){m.remove.error(),m.remove.loading()},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];e.isPlainObject(v[t])?e.extend(!0,v[t],n):v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){!v.silent&&v.debug&&(v.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,v.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),m.verbose.apply(console,arguments)))},error:function(){v.silent||(m.error=Function.prototype.bind.call(console.error,console,v.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,r){var a,s,l,c=D;return n=n||d,r=j||r,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),a=t.length-1,e.each(t,function(n,o){var r=n!=a?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[r])&&n!=a)c=c[r];else{if(c[r]!==i)return s=c[r],!1;if(!e.isPlainObject(c[o])||n==a)return c[o]!==i?(s=c[o],!1):(m.error(w.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(r,n):s!==i&&(l=s),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),s}},u?(D===i&&m.initialize(),m.invoke(c)):(D!==i&&D.invoke("destroy"),m.initialize())}),o!==i?o:this},e.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.i18next=t()}(this,function(){"use strict";function e(e){return null==e?"":""+e}function t(e,t,n){e.forEach(function(e){t[e]&&(n[e]=t[e])})}function n(e,t,n){function i(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(!e)return{};var r=i(o.shift());!e[r]&&n&&(e[r]=new n),e=e[r]}return e?{obj:e,k:i(o.shift())}:{}}function i(e,t,i){var o=n(e,t,Object),r=o.obj,a=o.k;r[a]=i}function o(e,t,i,o){var r=n(e,t,Object),a=r.obj,s=r.k;a[s]=a[s]||[],o&&(a[s]=a[s].concat(i)),o||a[s].push(i)}function r(e,t){var i=n(e,t),o=i.obj,r=i.k;if(o)return o[r]}function a(e,t,n){for(var i in t)i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof t[i]||t[i]instanceof String?n&&(e[i]=t[i]):a(e[i],t[i],n):e[i]=t[i];return e}function s(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function l(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return D[e]}):e}function c(e){return e.interpolation={unescapeSuffix:"HTML"},e.interpolation.prefix=e.interpolationPrefix||"__",e.interpolation.suffix=e.interpolationSuffix||"__",e.interpolation.escapeValue=e.escapeInterpolation||!1,e.interpolation.nestingPrefix=e.reusePrefix||"$t(",e.interpolation.nestingSuffix=e.reuseSuffix||")",e}function u(e){return e.resStore&&(e.resources=e.resStore),e.ns&&e.ns.defaultNs?(e.defaultNS=e.ns.defaultNs,e.ns=e.ns.namespaces):e.defaultNS=e.ns||"translation",e.fallbackToDefaultNS&&e.defaultNS&&(e.fallbackNS=e.defaultNS),e.saveMissing=e.sendMissing,e.saveMissingTo=e.sendMissingTo||"current",e.returnNull=!e.fallbackOnNull,e.returnEmptyString=!e.fallbackOnEmpty,e.returnObjects=e.returnObjectTrees,e.joinArrays="\n",e.returnedObjectHandler=e.objectTreeKeyHandler,e.parseMissingKeyHandler=e.parseMissingKey,e.appendNamespaceToMissingKey=!0,e.nsSeparator=e.nsseparator||":",e.keySeparator=e.keyseparator||".","sprintf"===e.shortcutFunction&&(e.overloadTranslationOptionHandler=function(e){for(var t=[],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.init(t,n)}return e.prototype.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||A,this.options=t,this.debug=t.debug!==!1},e.prototype.setDebug=function(e){this.debug=e},e.prototype.log=function(){this.forward(arguments,"log","",!0)},e.prototype.warn=function(){this.forward(arguments,"warn","",!0)},e.prototype.error=function(){this.forward(arguments,"error","")},e.prototype.deprecate=function(){this.forward(arguments,"warn","WARNING DEPRECATED: ",!0)},e.prototype.forward=function(e,t,n,i){i&&!this.debug||("string"==typeof e[0]&&(e[0]=n+this.prefix+" "+e[0]),this.logger[t](e))},e.prototype.create=function(t){var n=new e(this.logger,C({prefix:this.prefix+":"+t+":"},this.options));return n},e}(),j=new E,R=function(){function e(){w(this,e),this.observers={}}return e.prototype.on=function(e,t){var n=this;e.split(" ").forEach(function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})},e.prototype.off=function(e,t){var n=this;this.observers[e]&&this.observers[e].forEach(function(){if(t){var i=n.observers[e].indexOf(t);i>-1&&n.observers[e].splice(i,1)}else delete n.observers[e]})},e.prototype.emit=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i":">",'"':""","'":"'","/":"/"},O=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};w(this,t);var o=T(this,e.call(this));return o.data=n,o.options=i,o}return k(t,e),t.prototype.addNamespaces=function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)},t.prototype.removeNamespaces=function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)},t.prototype.getResource=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.keySeparator||this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];return n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split(".")),r(this.data,a)},t.prototype.addResource=function(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var s=[e,t];n&&(s=s.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(s=e.split("."),o=t,t=s[1]),this.addNamespaces(t),i(this.data,s,o),r.silent||this.emit("added",e,t,n,o)},t.prototype.addResources=function(e,t,n){for(var i in n)"string"==typeof n[i]&&this.addResource(e,t,i,n[i],{silent:!0});this.emit("added",e,t,n)},t.prototype.addResourceBundle=function(e,t,n,o,s){var l=[e,t];e.indexOf(".")>-1&&(l=e.split("."),o=n,n=t,t=l[1]),this.addNamespaces(t);var c=r(this.data,l)||{};o?a(c,n,s):c=C({},c,n),i(this.data,l,c),this.emit("added",e,t,n)},t.prototype.removeResourceBundle=function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)},t.prototype.hasResourceBundle=function(e,t){return void 0!==this.getResource(e,t)},t.prototype.getResourceBundle=function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?C({},this.getResource(e,t)):this.getResource(e,t)},t.prototype.toJSON=function(){return this.data},t}(R),P={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,o){var r=this;return e.forEach(function(e){r.processors[e]&&(t=r.processors[e].process(t,n,i,o))}),t}},F=function(e){function n(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,n);var r=T(this,e.call(this));return t(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector"],i,r),r.options=o,r.logger=j.create("translator"),r}return k(n,e),n.prototype.changeLanguage=function(e){e&&(this.language=e)},n.prototype.exists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};return"v1"===this.options.compatibilityAPI&&(t=f(t)),void 0!==this.resolve(e,t)},n.prototype.extractFromKey=function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var i=t.keySeparator||this.options.keySeparator||".",o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var r=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),e=r.join(i)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}},n.prototype.translate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==("undefined"==typeof t?"undefined":x(t))?t=this.options.overloadTranslationOptionHandler(arguments):"v1"===this.options.compatibilityAPI&&(t=f(t)),void 0===e||null===e||""===e)return"";"number"==typeof e&&(e=String(e)),"string"==typeof e&&(e=[e]);var n=t.keySeparator||this.options.keySeparator||".",i=this.extractFromKey(e[e.length-1],t),o=i.key,r=i.namespaces,a=r[r.length-1],s=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(l){var c=t.nsSeparator||this.options.nsSeparator;return a+c+o}return o}var u=this.resolve(e,t),d=Object.prototype.toString.apply(u),p=["[object Number]","[object Function]","[object RegExp]"],h=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays;if(u&&"string"!=typeof u&&p.indexOf(d)<0&&(!h||"[object Array]"!==d)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(o,u,t):"key '"+o+" ("+this.language+")' returned an object instead of string.";if(t.keySeparator||this.options.keySeparator){var g="[object Array]"===d?[]:{};for(var m in u)g[m]=this.translate(""+o+n+m,C({joinArrays:!1,ns:r},t));u=g}}else if(h&&"[object Array]"===d)u=u.join(h),u&&(u=this.extendTranslation(u,o,t));else{var v=!1,b=!1;if(this.isValidLookup(u)||void 0===t.defaultValue||(v=!0,u=t.defaultValue),this.isValidLookup(u)||(b=!0,u=o),b||v){this.logger.log("missingKey",s,a,o,u);var y=[],w=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&w&&w[0])for(var k=0;k1&&void 0!==arguments[1]?arguments[1]:{},i=void 0;return"string"==typeof e&&(e=[e]),e.forEach(function(e){if(!t.isValidLookup(i)){var o=t.extractFromKey(e,n),r=o.key,a=o.namespaces;t.options.fallbackNS&&(a=a.concat(t.options.fallbackNS));var s=void 0!==n.count&&"string"!=typeof n.count,l=void 0!==n.context&&"string"==typeof n.context&&""!==n.context,c=n.lngs?n.lngs:t.languageUtils.toResolveHierarchy(n.lng||t.language);a.forEach(function(e){t.isValidLookup(i)||c.forEach(function(o){if(!t.isValidLookup(i)){var a=r,c=[a],u=void 0;s&&(u=t.pluralResolver.getSuffix(o,n.count)),s&&l&&c.push(a+u),l&&c.push(a+=""+t.options.contextSeparator+n.context),s&&c.push(a+=u);for(var d=void 0;d=c.pop();)t.isValidLookup(i)||(i=t.getResource(o,e,d,n))}})})}}),i},n.prototype.isValidLookup=function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)},n.prototype.getResource=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.resourceStore.getResource(e,t,n,i)},n}(R),L=function(){function e(t){w(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=j.create("languageUtils")}return e.prototype.getScriptPartFromCode=function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))},e.prototype.getLanguagePartFromCode=function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])},e.prototype.formatLanguageCode=function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function(e){return e.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=h(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=h(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=h(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e},e.prototype.isWhitelisted=function(e,t){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist&&!t)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1},e.prototype.getFallbackCodes=function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]},e.prototype.toResolveHierarchy=function(e,t){var n=this,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(n.isWhitelisted(e,t)?o.push(e):n.logger.warn("rejecting non-whitelisted language code: "+e))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e),!0),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e),!0),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),i.forEach(function(e){o.indexOf(e)<0&&r(n.formatLanguageCode(e))}),o},e}(),q=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","es_ar","et","eu","fi","fo","fur","fy","gl","gu","ha","he","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt","pt_br","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21}],N={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)}},M=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.languageUtils=t,this.options=n,this.logger=j.create("pluralResolver"),this.rules=g()}return e.prototype.addRule=function(e,t){this.rules[e]=t},e.prototype.getRule=function(e){return this.rules[this.languageUtils.getLanguagePartFromCode(e)]},e.prototype.needsPlural=function(e){var t=this.getRule(e);return!(t&&t.numbers.length<=1)},e.prototype.getSuffix=function(e,t){var n=this,i=this.getRule(e);if(i){if(1===i.numbers.length)return"";var o=i.noAbs?i.plurals(t):i.plurals(Math.abs(t)),r=i.numbers[o];2===i.numbers.length&&1===i.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_"+r.toString():a():"v2"===this.options.compatibilityJSON||2===i.numbers.length&&1===i.numbers[0]?a():2===i.numbers.length&&1===i.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: "+e),""},e}(),I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w(this,t),this.logger=j.create("interpolator"),this.init(e,!0)}return t.prototype.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e},this.escape=e.interpolation&&e.interpolation.escape||l),e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.prefix=n.prefix?s(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?s(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?s(n.nestingPrefix):n.nestingPrefixEscaped||s("$t("),this.nestingSuffix=n.nestingSuffix?s(n.nestingSuffix):n.nestingSuffixEscaped||s(")"),this.resetRegExp()},t.prototype.reset=function(){this.options&&this.init(this.options)},t.prototype.resetRegExp=function(){var e=this.prefix+"(.+?)"+this.suffix;this.regexp=new RegExp(e,"g");var t=this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(t,"g");var n=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(n,"g")},t.prototype.interpolate=function(t,n,i){function o(e){return e.replace(/\$/g,"$$$$")}var a=this,s=void 0,l=void 0,c=function(e){if(e.indexOf(a.formatSeparator)<0)return r(n,e);var t=e.split(a.formatSeparator),o=t.shift().trim(),s=t.join(a.formatSeparator).trim();return a.format(r(n,o),s,i)};for(this.resetRegExp();s=this.regexpUnescape.exec(t);){var u=c(s[1].trim());t=t.replace(s[0],u),this.regexpUnescape.lastIndex=0}for(;s=this.regexp.exec(t);)l=c(s[1].trim()),"string"!=typeof l&&(l=e(l)),l||(this.logger.warn("missed to pass in variable "+s[1]+" for interpolating "+t),l=""),l=o(this.escapeValue?this.escape(l):l),t=t.replace(s[0],l),this.regexp.lastIndex=0;return t},t.prototype.nest=function(t,n){function i(e){if(e.indexOf(",")<0)return e;var t=e.split(",");e=t.shift();var n=t.join(",");n=this.interpolate(n,s),n=n.replace(/'/g,'"');try{s=JSON.parse(n)}catch(t){this.logger.error("failed parsing options string in nesting for key "+e,t)}return e}var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=void 0,a=void 0,s=C({},o);for(s.applyPostProcessor=!1;r=this.nestingRegexp.exec(t);)a=n(i.call(this,r[1].trim()),s), -"string"!=typeof a&&(a=e(a)),a||(this.logger.warn("missed to pass in variable "+r[1]+" for interpolating "+t),a=""),t=t.replace(r[0],a),this.regexp.lastIndex=0;return t},t}(),H=function(e){function t(n,i,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};w(this,t);var a=T(this,e.call(this));return a.backend=n,a.store=i,a.services=o,a.options=r,a.logger=j.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,r.backend,r),a}return k(t,e),t.prototype.queueLoad=function(e,t,n){var i=this,o=[],r=[],a=[],s=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var a=e+"|"+t;i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?r.indexOf(a)<0&&r.push(a):(i.state[a]=1,n=!1,r.indexOf(a)<0&&r.push(a),o.indexOf(a)<0&&o.push(a),s.indexOf(t)<0&&s.push(t)))}),n||a.push(e)}),(o.length||r.length)&&this.queue.push({pending:r,loaded:{},errors:[],callback:n}),{toLoad:o,pending:r,toLoadLanguages:a,toLoadNamespaces:s}},t.prototype.loaded=function(e,t,n){var i=this,r=e.split("|"),a=S(r,2),s=a[0],l=a[1];t&&this.emit("failedLoading",s,l,t),n&&this.store.addResourceBundle(s,l,n),this.state[e]=t?-1:2,this.queue.forEach(function(n){o(n.loaded,[s],l),m(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(i.emit("loaded",n.loaded),n.errors.length?n.callback(n.errors):n.callback(),n.done=!0)}),this.queue=this.queue.filter(function(e){return!e.done})},t.prototype.read=function(e,t,n,i,o,r){var a=this;return i||(i=0),o||(o=250),e.length?void this.backend[n](e,t,function(s,l){return s&&l&&i<5?void setTimeout(function(){a.read.call(a,e,t,n,++i,2*o,r)},o):void r(s,l)}):r(null,{})},t.prototype.load=function(e,t,n){var i=this;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();var o=C({},this.backend.options,this.options.backend);"string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,n);if(!a.toLoad.length)return void(a.pending.length||n());if(o.allowMultiLoading&&this.backend.readMulti)this.read(a.toLoadLanguages,a.toLoadNamespaces,"readMulti",null,null,function(e,t){e&&i.logger.warn("loading namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading failed",e),!e&&t&&i.logger.log("loaded namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading",t),a.toLoad.forEach(function(n){var o=n.split("|"),a=S(o,2),s=a[0],l=a[1],c=r(t,[s,l]);if(c)i.loaded(n,e,c);else{var u="loading namespace "+l+" for language "+s+" via multiloading failed";i.loaded(n,u),i.logger.error(u)}})});else{var s=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("loading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("loaded namespace "+r+" for language "+o,i),t.loaded(e,n,i)})};a.toLoad.forEach(function(e){s.call(i,e)})}},t.prototype.reload=function(e,t){var n=this;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");var i=C({},this.backend.options,this.options.backend);if("string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]),i.allowMultiLoading&&this.backend.readMulti)this.read(e,t,"readMulti",null,null,function(i,o){i&&n.logger.warn("reloading namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading failed",i),!i&&o&&n.logger.log("reloaded namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading",o),e.forEach(function(e){t.forEach(function(t){var a=r(o,[e,t]);if(a)n.loaded(e+"|"+t,i,a);else{var s="reloading namespace "+t+" for language "+e+" via multiloading failed";n.loaded(e+"|"+t,s),n.logger.error(s)}})})});else{var o=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("reloading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("reloaded namespace "+r+" for language "+o,i),t.loaded(e,n,i)})};e.forEach(function(e){t.forEach(function(t){o.call(n,e+"|"+t)})})}},t.prototype.saveMissing=function(e,t,n,i){this.backend&&this.backend.create&&this.backend.create(e,t,n,i),e&&e[0]&&this.store.addResource(e[0],t,n,i)},t}(R),$=function(e){function t(n,i,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};w(this,t);var a=T(this,e.call(this));return a.cache=n,a.store=i,a.services=o,a.options=r,a.logger=j.create("cacheConnector"),a.cache&&a.cache.init&&a.cache.init(o,r.cache,r),a}return k(t,e),t.prototype.load=function(e,t,n){var i=this;if(!this.cache)return n&&n();var o=C({},this.cache.options,this.options.cache);"string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]),o.enabled?this.cache.load(e,function(t,o){if(t&&i.logger.error("loading languages "+e.join(", ")+" from cache failed",t),o)for(var r in o)for(var a in o[r])if("i18nStamp"!==a){var s=o[r][a];s&&i.store.addResourceBundle(r,a,s)}n&&n()}):n&&n()},t.prototype.save=function(){this.cache&&this.options.cache&&this.options.cache.enabled&&this.cache.save(this.store.data)},t}(R),z=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1];w(this,t);var o=T(this,e.call(this));return o.options=b(n),o.services={},o.logger=j,o.modules={external:[]},!i||o.isInitialized||n.isClone||o.init(n,i),o}return k(t,e),t.prototype.init=function(e,t){function n(e){if(e)return"function"==typeof e?new e:e}var i=this;if("function"==typeof e&&(t=e,e={}),e||(e={}),"v1"===e.compatibilityAPI?this.options=C({},v(),b(u(e)),{}):"v1"===e.compatibilityJSON?this.options=C({},v(),b(d(e)),{}):this.options=C({},v(),this.options,b(e)),t||(t=y),!this.options.isClone){this.modules.logger?j.init(n(this.modules.logger),this.options):j.init(null,this.options);var o=new L(this.options);this.store=new O(this.options.resources,this.options);var r=this.services;r.logger=j,r.resourceStore=this.store,r.resourceStore.on("added removed",function(e,t){r.cacheConnector.save()}),r.languageUtils=o,r.pluralResolver=new M(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON}),r.interpolator=new I(this.options),r.backendConnector=new H(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o1?t-1:0),o=1;o1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:y;if(this.options.resources)t(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],i=function(t){if(t){var i=e.services.languageUtils.toResolveHierarchy(t);i.forEach(function(e){n.indexOf(e)<0&&n.push(e)})}};i(this.language),this.options.preload&&this.options.preload.forEach(function(e){i(e)}),this.services.cacheConnector.load(n,this.options.ns,function(){e.services.backendConnector.load(n,e.options.ns,t)})}},t.prototype.reloadResources=function(e,t){e||(e=this.languages),t||(t=this.options.ns),this.services.backendConnector.reload(e,t)},t.prototype.use=function(e){return"backend"===e.type&&(this.modules.backend=e),"cache"===e.type&&(this.modules.cache=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"postProcessor"===e.type&&P.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this},t.prototype.changeLanguage=function(e,t){var n=this,i=function(i){e&&(n.emit("languageChanged",e),n.logger.log("languageChanged",e)),t&&t(i,function(){for(var e=arguments.length,t=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},o=C({},i);return o.lng=o.lng||e.lng,o.ns=o.ns||e.ns,n.t(t,o)};return i.lng=e,i.ns=t,i},t.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},t.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},t.prototype.setDefaultNamespace=function(e){this.options.defaultNS=e},t.prototype.loadNamespaces=function(e,t){var n=this;return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)}),void this.loadResources(t)):t&&t()},t.prototype.loadLanguages=function(e,t){"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter(function(e){return n.indexOf(e)<0});return i.length?(this.options.preload=n.concat(i),void this.loadResources(t)):t()},t.prototype.dir=function(e){if(e||(e=this.language),!e)return"rtl";var t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"];return t.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"},t.prototype.createInstance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];return new t(e,n)},t.prototype.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y,o=C({},n,this.options,{isClone:!0}),r=new t(o,i),a=["store","services","language"];return a.forEach(function(t){r[t]=e[t]}),r.translator=new F(r.services,r.options),r.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i3&&i&&i(a.responseText,a)},a.send(o)}catch(e){console&&console.log(e)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:n}}var r=[],a=r.forEach,s=r.slice,l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.init(e,n),this.type="backend"}return c(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=t,this.options=e(n,this.options||{},o())}},{key:"readMulti",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath(e,t));var o=this.services.interpolator.interpolate(i,{lng:e.join("+"),ns:t.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath([e],[t]));var o=this.services.interpolator.interpolate(i,{lng:e,ns:t});this.loadUrl(o,n)}},{key:"loadUrl",value:function(e,t){var n=this;this.options.ajax(e,this.options,function(i,o){if(o.status>=500&&o.status<600)return t("failed loading "+e,!0);if(o.status>=400&&o.status<500)return t("failed loading "+e,!1);var r=void 0,a=void 0;try{r=n.options.parse(i,e)}catch(t){a="failed parsing "+e+" to json"}return a?t(a,!1):void t(null,r)})}},{key:"create",value:function(e,t,n,i){var o=this;"string"==typeof e&&(e=[e]);var r={};r[n]=i||"",e.forEach(function(e){var n=o.services.interpolator.interpolate(o.options.addPath,{lng:e,ns:t});o.options.ajax(n,o.options,function(e,t){},r)})}}]),t}();return u.type="backend",u});var keyPlurals={"{{ stars }} star":"{{ stars }} stars","{{ months }} month costs € {{ eur }}":"{{ months }} months cost € {{ eur }}"},singlePageSnippets={"/2fa_gateway":function(){$("#telegram-code").on("input",function(){$(this).val().length>=6?$.get("/2fa_gateway/verify",{token:$(this).val().trim().substr(0,8)},function(e){switch(e){case"0":$("#telegram-code").closest(".field").addClass("success"),redir=redir?redir:"/",window.location.href=redir;break;case"1":$("#telegram-code").closest(".field").addClass("error")}}):$("#telegram-code").closest(".field").removeClass("error")})},"/leaderboard":function(){function e(){var e=window.location;window.history.replaceState("",document.title,e.pathname+"?mode="+favouriteMode+"&p="+page+(""!=country?"&country="+encodeURI(country):"")+e.hash),api("leaderboard",{mode:favouriteMode,p:page,l:50,country:country},function(e){var n=$(".ui.table tbody");n.find("tr").remove(),null==e.users&&(disableSimplepagButtons(!0),e.users=[]);var i=0;e.users.forEach(function(e){n.append($("").append($("").text("#"+(50*(page-1)+ ++i)),$("").html(""+escapeHTML(e.username)+""),$("").html(t(e.chosen_mode.ranked_score,e.chosen_mode.pp)),$("").text(e.chosen_mode.accuracy.toFixed(2)+"%"),$("").html(addCommas(e.chosen_mode.playcount)+" (lv. "+e.chosen_mode.level.toFixed(0)+")")))}),disableSimplepagButtons(e.users.length<50)})}function t(e,t){return 0===t?""+addCommas(e)+"":""+addCommas(t)+"pp ("+addCommas(e)+")"}page=0===page?1:page,$("#country-chooser-modal").click(function(){$(".ui.modal").modal("show")}),$(".lb-country").click(function(){country=$(this).data("country"),page=1,$(".ui.modal").modal("hide"),e()}),e(),setupSimplepag(e),$("#mode-menu .item").click(function(t){t.preventDefault(),$("#mode-menu .active.item").removeClass("active"),$(this).addClass("active"),favouriteMode=$(this).data("mode"),country="",page=1,e()})},"/friends":function(){$(".smalltext.button").click(function(){var e=$(this),t="1"===e.data("deleted")?"add":"del";console.log(t),e.addClass("disabled"),api("friends/"+t,{user:+e.data("userid")},function(t){e.removeClass("disabled"),e.data("deleted",t.friend?"0":"1"),e.removeClass("green red blue"),e.addClass(t.friend?t.mutual?"red":"green":"blue"),e.find(".icon").removeClass("minus plus heart").addClass(t.friend?t.mutual?"heart":"minus":"plus"),e.find("span").text(t.friend?T(t.mutual?"Mutual":"Remove"):e("Add"))},!0)})},"/team":function(){$("#everyone").click(function(){$(".ui.modal").modal("show")})},"/register/verify":function(){var e=query("u");setInterval(function(){$.getJSON(hanayoConf.banchoAPI+"/api/v1/verifiedStatus?u="+e,function(t){t.result>=0&&(window.location.href="/register/welcome?u="+e)})},5e3)},"/settings":function(){$("input[name='custom_badge.icon']").on("input",function(){$("#badge-icon").attr("class","circular big icon "+escapeHTML($(this).val()))}),$("input[name='custom_badge.name']").on("input",function(){$("#badge-name").html(escapeHTML($(this).val()))}),$("input[name='custom_badge.show']").change(function(){$(this).is(":checked")?$("#custom-badge-fields").slideDown():$("#custom-badge-fields").slideUp()});var e=$("#dark-site").is(":checked");$("form").submit(function(t){t.preventDefault();var n=$("#dark-site").is(":checked");if(n!=e){var i=document.cookie.replace(/(?:(?:^|.*;\s*)cflags\s*\=\s*([^;]*).*$)|^.*$/,"$1");i=n?1|+i:+i&-2,document.cookie="cflags="+i+";path=/;max-age=31536000"}var o=formToObject($(this)),r=0;$(this).find("input[data-sv]").each(function(e,t){t=$(t),t.is(":checked")&&(r|=t.data("sv"))}),o.play_style=r;var a=$(this);return api("users/self/settings",o,function(t){return n!=e?void window.location.reload():(showMessage("success","Your new settings have been saved."),void a.removeClass("loading"))},!0),!1})},"/settings/userpage":function(){var e=null;$("textarea[name='data']").on("input",function(){null!==e&&clearTimeout(e);$(this).val();e=setTimeout(function(){$("#userpage-content").addClass("loading"),$.post("/settings/userpage/parse",$("textarea[name='data']").val(),function(e){var t=$("#userpage-content").removeClass("loading").html(e);"undefined"!=typeof twemoji&&twemoji.parse(t[0])},"text")},800)}),$("form").submit(function(e){e.preventDefault();var t=formToObject($(this)),n=$(this);return api("users/self/userpage",t,function(e){showMessage("success","Your userpage has been saved."),n.removeClass("loading")},!0),!1})},"/donate":function(){var e=$("#months-slider")[0];noUiSlider.create(e,{start:[1],step:1,connect:[!0,!1],range:{min:[1],max:[24]}});var t={},n=e.noUiSlider;$.getJSON("/donate/rates",function(e){t=e,n.on("update",function(){var e=n.get(),i=Math.pow(30*e*.2,.7),o=i/t.EUR,r=o*t.USD;$("#cost").html(T("{{ months }} month costs € {{ eur }}",{count:Math.round(+e),months:(+e).toFixed(0),eur:i.toFixed(2)})+"
"+T("($ {{ usd }} / BTC {{ btc }})",{usd:r.toFixed(2),btc:o.toFixed(10)})),$("input[name='os0']").attr("value",(+e).toFixed(0)+" month"+(1==e?"":"s")),$("#bitcoin-amt").text(o.toFixed(6)),$("#paypal-amt").val(i.toFixed(2))})}),$("#username-input").on("input",function(){$("#ipn-username").attr("value","username="+$(this).val())})},"/settings/avatar":function(){$("#file").change(function(e){var t=e.target.files;if(!(t.length<1)){var n=window.URL.createObjectURL(t[0]),i=$("#avatar-img")[0];i.src=n,i.onload=function(){window.URL.revokeObjectURL(this.src)}}})},"/beatmaps/rank_request":function(){function e(e){$("#queue-info").html(e.submitted+"/"+e.queue_size),0==e.submitted_by_user?$("#by-you").attr("hidden","hidden"):$("#by-you").removeAttr("hidden"),$("#submitted-by-user").text(e.submitted_by_user),$("#max-per-user").text(e.max_per_user);var t=(e.submitted/e.queue_size*100).toFixed(0);$("#progressbar .progress").text(t+"%"),$("#progressbar").progress({percent:t}),e.can_submit?$("#b-form .input, #b-form .button").removeClass("disabled"):$("#b-form .input, #b-form .button").addClass("disabled")}setInterval(function(){api("beatmaps/rank_requests/status",{},e)},1e4);var t=/^https?:\/\/osu.ppy.sh\/(s|b)\/(\d+)$/gi;$("#b-form").submit(function(n){n.preventDefault();var i=$("#beatmap").val().trim(),o=t.exec(i);if(t.exec(),console.log(i,o),null===o)return showMessage("error","Please provide a valid link, in the form of either https://osu.ppy.sh/s/<ID> or https://osu.ppy.sh/b/<ID>."),$(this).removeClass("loading"),!1;var r={};"s"==o[1]?r.set_id=+o[2]:r.id=+o[2];var a=$(this);return api("beatmaps/rank_requests",r,function(t){a.removeClass("loading"),showMessage("success","Beatmap rank request has been submitted."),e(t)},function(e){a.removeClass("loading"),406==e.code&&showMessage("warning","That beatmap is already ranked!")},!0),!1})},"/settings/profbackground":function(){$("#colorpicker").minicolors({inline:!0}),$("#background-type").change(function(){$("[data-type]:not([hidden])").attr("hidden","hidden"),$("[data-type="+$(this).val()+"]").removeAttr("hidden")}),$("#file").change(function(e){var t=e.target.files;if(!(t.length<1)){var n=window.URL.createObjectURL(t[0]),i=document.createElement("img");i.src=n,i.onload=function(){window.URL.revokeObjectURL(this.src)},$("#image-background").empty().append(i)}})},"/dev/tokens":function(){$("#privileges-number").on("input",function(){$("#privileges-text").text(privilegesToString($(this).val()))})}};$(document).ready(function(){$(".message .close").on("click",closeClosestMessage),$(".ui.checkbox").checkbox(),$(".ui.dropdown").dropdown(),$(".ui.progress").progress(),$(".ui.form").submit(function(e){var t=$(this);if(t.hasClass("loading")||t.hasClass("disabled"))return e.preventDefault(),!1;t.addClass("loading");var n=t.attr("id");$("[form='"+n+"']").addClass("loading")}),"undefined"!=typeof twemoji&&$(".twemoji").each(function(e,t){twemoji.parse(t)});var e=singlePageSnippets[window.location.pathname];"function"==typeof e&&e(),"function"==typeof deferredToPageLoad&&deferredToPageLoad(),$("#user-search").search({onSelect:function(e){return window.location.href=e.url,!1},apiSettings:{url:"/api/v1/users/lookup?name={query}",onResponse:function(e){var t={results:[]};return $.each(e.users,function(e,n){t.results.push({title:n.username,url:"/u/"+n.id,image:hanayoConf.avatars+"/"+n.id})}),t}}}),$("#user-search-input").keypress(function(e){13==e.which&&(window.location.pathname="/u/"+$(this).val())}),$(document).keydown(function(e){var t=$(document.activeElement),n=t.is(":input,[contenteditable]");83!==e.which&&115!==e.which||n||($("#user-search-input").focus(),e.preventDefault()),27===e.which&&n&&t.blur()}),$.timeago.settings.allowFuture=!0,$("time.timeago").timeago(),$("#language-selector .item").click(function(){var e=$(this).data("lang");document.cookie="language="+e+";path=/;max-age=31536000",window.location.reload()})});var modes={0:"osu! standard",1:"Taiko",2:"Catch the Beat",3:"osu!mania"},modesShort={0:"std",1:"taiko",2:"ctb",3:"mania"},entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};window.URL=window.URL||window.webkitURL;var modsString=["NF","EZ","NV","HD","HR","SD","DT","RX","HT","NC","FL","AU","SO","AP","PF","K4","K5","K6","K7","K8","K9","RN","LM","K9","K0","K1","K3","K2"],langWhitelist=["de","it","ko","es","ru","pl","fr","nl","sv","fi","ro","ko","vi"];i18next.use(i18nextXHRBackend).init({nsSeparator:!1,keySeparator:!1,fallbackLng:!1,lng:hanayoConf.language,whitelist:langWhitelist,load:"currentOnly",backend:{loadPath:"/static/locale/{{lng}}.json"}});var i18nLoaded=$.inArray(hanayoConf.language,langWhitelist)===-1;i18next.on("loaded",function(){i18nLoaded=!0});var apiPrivileges=["ReadConfidential","Write","ManageBadges","BetaKeys","ManageSettings","ViewUserAdvanced","ManageUser","ManageRoles","ManageAPIKeys","Blog","APIMeta","Beatmap"]; \ No newline at end of file +"string"!=typeof a&&(a=e(a)),a||(this.logger.warn("missed to pass in variable "+r[1]+" for interpolating "+t),a=""),t=t.replace(r[0],a),this.regexp.lastIndex=0;return t},t}(),H=function(e){function t(n,i,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};w(this,t);var a=T(this,e.call(this));return a.backend=n,a.store=i,a.services=o,a.options=r,a.logger=j.create("backendConnector"),a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,r.backend,r),a}return k(t,e),t.prototype.queueLoad=function(e,t,n){var i=this,o=[],r=[],a=[],s=[];return e.forEach(function(e){var n=!0;t.forEach(function(t){var a=e+"|"+t;i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?r.indexOf(a)<0&&r.push(a):(i.state[a]=1,n=!1,r.indexOf(a)<0&&r.push(a),o.indexOf(a)<0&&o.push(a),s.indexOf(t)<0&&s.push(t)))}),n||a.push(e)}),(o.length||r.length)&&this.queue.push({pending:r,loaded:{},errors:[],callback:n}),{toLoad:o,pending:r,toLoadLanguages:a,toLoadNamespaces:s}},t.prototype.loaded=function(e,t,n){var i=this,r=e.split("|"),a=S(r,2),s=a[0],l=a[1];t&&this.emit("failedLoading",s,l,t),n&&this.store.addResourceBundle(s,l,n),this.state[e]=t?-1:2,this.queue.forEach(function(n){o(n.loaded,[s],l),m(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(i.emit("loaded",n.loaded),n.errors.length?n.callback(n.errors):n.callback(),n.done=!0)}),this.queue=this.queue.filter(function(e){return!e.done})},t.prototype.read=function(e,t,n,i,o,r){var a=this;return i||(i=0),o||(o=250),e.length?void this.backend[n](e,t,function(s,l){return s&&l&&i<5?void setTimeout(function(){a.read.call(a,e,t,n,++i,2*o,r)},o):void r(s,l)}):r(null,{})},t.prototype.load=function(e,t,n){var i=this;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();var o=C({},this.backend.options,this.options.backend);"string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,n);if(!a.toLoad.length)return void(a.pending.length||n());if(o.allowMultiLoading&&this.backend.readMulti)this.read(a.toLoadLanguages,a.toLoadNamespaces,"readMulti",null,null,function(e,t){e&&i.logger.warn("loading namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading failed",e),!e&&t&&i.logger.log("loaded namespaces "+a.toLoadNamespaces.join(", ")+" for languages "+a.toLoadLanguages.join(", ")+" via multiloading",t),a.toLoad.forEach(function(n){var o=n.split("|"),a=S(o,2),s=a[0],l=a[1],c=r(t,[s,l]);if(c)i.loaded(n,e,c);else{var u="loading namespace "+l+" for language "+s+" via multiloading failed";i.loaded(n,u),i.logger.error(u)}})});else{var s=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("loading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("loaded namespace "+r+" for language "+o,i),t.loaded(e,n,i)})};a.toLoad.forEach(function(e){s.call(i,e)})}},t.prototype.reload=function(e,t){var n=this;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");var i=C({},this.backend.options,this.options.backend);if("string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]),i.allowMultiLoading&&this.backend.readMulti)this.read(e,t,"readMulti",null,null,function(i,o){i&&n.logger.warn("reloading namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading failed",i),!i&&o&&n.logger.log("reloaded namespaces "+t.join(", ")+" for languages "+e.join(", ")+" via multiloading",o),e.forEach(function(e){t.forEach(function(t){var a=r(o,[e,t]);if(a)n.loaded(e+"|"+t,i,a);else{var s="reloading namespace "+t+" for language "+e+" via multiloading failed";n.loaded(e+"|"+t,s),n.logger.error(s)}})})});else{var o=function(e){var t=this,n=e.split("|"),i=S(n,2),o=i[0],r=i[1];this.read(o,r,"read",null,null,function(n,i){n&&t.logger.warn("reloading namespace "+r+" for language "+o+" failed",n),!n&&i&&t.logger.log("reloaded namespace "+r+" for language "+o,i),t.loaded(e,n,i)})};e.forEach(function(e){t.forEach(function(t){o.call(n,e+"|"+t)})})}},t.prototype.saveMissing=function(e,t,n,i){this.backend&&this.backend.create&&this.backend.create(e,t,n,i),e&&e[0]&&this.store.addResource(e[0],t,n,i)},t}(R),$=function(e){function t(n,i,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};w(this,t);var a=T(this,e.call(this));return a.cache=n,a.store=i,a.services=o,a.options=r,a.logger=j.create("cacheConnector"),a.cache&&a.cache.init&&a.cache.init(o,r.cache,r),a}return k(t,e),t.prototype.load=function(e,t,n){var i=this;if(!this.cache)return n&&n();var o=C({},this.cache.options,this.options.cache);"string"==typeof e&&(e=this.services.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]),o.enabled?this.cache.load(e,function(t,o){if(t&&i.logger.error("loading languages "+e.join(", ")+" from cache failed",t),o)for(var r in o)for(var a in o[r])if("i18nStamp"!==a){var s=o[r][a];s&&i.store.addResourceBundle(r,a,s)}n&&n()}):n&&n()},t.prototype.save=function(){this.cache&&this.options.cache&&this.options.cache.enabled&&this.cache.save(this.store.data)},t}(R),z=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1];w(this,t);var o=T(this,e.call(this));return o.options=b(n),o.services={},o.logger=j,o.modules={external:[]},!i||o.isInitialized||n.isClone||o.init(n,i),o}return k(t,e),t.prototype.init=function(e,t){function n(e){if(e)return"function"==typeof e?new e:e}var i=this;if("function"==typeof e&&(t=e,e={}),e||(e={}),"v1"===e.compatibilityAPI?this.options=C({},v(),b(u(e)),{}):"v1"===e.compatibilityJSON?this.options=C({},v(),b(d(e)),{}):this.options=C({},v(),this.options,b(e)),t||(t=y),!this.options.isClone){this.modules.logger?j.init(n(this.modules.logger),this.options):j.init(null,this.options);var o=new L(this.options);this.store=new O(this.options.resources,this.options);var r=this.services;r.logger=j,r.resourceStore=this.store,r.resourceStore.on("added removed",function(e,t){r.cacheConnector.save()}),r.languageUtils=o,r.pluralResolver=new M(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON}),r.interpolator=new I(this.options),r.backendConnector=new H(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o1?t-1:0),o=1;o1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:y;if(this.options.resources)t(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],i=function(t){if(t){var i=e.services.languageUtils.toResolveHierarchy(t);i.forEach(function(e){n.indexOf(e)<0&&n.push(e)})}};i(this.language),this.options.preload&&this.options.preload.forEach(function(e){i(e)}),this.services.cacheConnector.load(n,this.options.ns,function(){e.services.backendConnector.load(n,e.options.ns,t)})}},t.prototype.reloadResources=function(e,t){e||(e=this.languages),t||(t=this.options.ns),this.services.backendConnector.reload(e,t)},t.prototype.use=function(e){return"backend"===e.type&&(this.modules.backend=e),"cache"===e.type&&(this.modules.cache=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"postProcessor"===e.type&&P.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this},t.prototype.changeLanguage=function(e,t){var n=this,i=function(i){e&&(n.emit("languageChanged",e),n.logger.log("languageChanged",e)),t&&t(i,function(){for(var e=arguments.length,t=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},o=C({},i);return o.lng=o.lng||e.lng,o.ns=o.ns||e.ns,n.t(t,o)};return i.lng=e,i.ns=t,i},t.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},t.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},t.prototype.setDefaultNamespace=function(e){this.options.defaultNS=e},t.prototype.loadNamespaces=function(e,t){var n=this;return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)}),void this.loadResources(t)):t&&t()},t.prototype.loadLanguages=function(e,t){"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter(function(e){return n.indexOf(e)<0});return i.length?(this.options.preload=n.concat(i),void this.loadResources(t)):t()},t.prototype.dir=function(e){if(e||(e=this.language),!e)return"rtl";var t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"];return t.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"},t.prototype.createInstance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];return new t(e,n)},t.prototype.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y,o=C({},n,this.options,{isClone:!0}),r=new t(o,i),a=["store","services","language"];return a.forEach(function(t){r[t]=e[t]}),r.translator=new F(r.services,r.options),r.translator.on("*",function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i3&&i&&i(a.responseText,a)},a.send(o)}catch(e){console&&console.log(e)}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:JSON.parse,crossDomain:!1,ajax:n}}var r=[],a=r.forEach,s=r.slice,l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.init(e,n),this.type="backend"}return c(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=t,this.options=e(n,this.options||{},o())}},{key:"readMulti",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath(e,t));var o=this.services.interpolator.interpolate(i,{lng:e.join("+"),ns:t.join("+")});this.loadUrl(o,n)}},{key:"read",value:function(e,t,n){var i=this.options.loadPath;"function"==typeof this.options.loadPath&&(i=this.options.loadPath([e],[t]));var o=this.services.interpolator.interpolate(i,{lng:e,ns:t});this.loadUrl(o,n)}},{key:"loadUrl",value:function(e,t){var n=this;this.options.ajax(e,this.options,function(i,o){if(o.status>=500&&o.status<600)return t("failed loading "+e,!0);if(o.status>=400&&o.status<500)return t("failed loading "+e,!1);var r=void 0,a=void 0;try{r=n.options.parse(i,e)}catch(t){a="failed parsing "+e+" to json"}return a?t(a,!1):void t(null,r)})}},{key:"create",value:function(e,t,n,i){var o=this;"string"==typeof e&&(e=[e]);var r={};r[n]=i||"",e.forEach(function(e){var n=o.services.interpolator.interpolate(o.options.addPath,{lng:e,ns:t});o.options.ajax(n,o.options,function(e,t){},r)})}}]),t}();return u.type="backend",u});var keyPlurals={"{{ stars }} star":"{{ stars }} stars","{{ months }} month costs € {{ eur }}":"{{ months }} months cost € {{ eur }}"},singlePageSnippets={"/2fa_gateway":function(){$("#telegram-code").on("input",function(){$(this).val().length>=6?$.get("/2fa_gateway/verify",{token:$(this).val().trim().substr(0,8)},function(e){switch(e){case"0":$("#telegram-code").closest(".field").addClass("success"),redir=redir?redir:"/",window.location.href=redir;break;case"1":$("#telegram-code").closest(".field").addClass("error")}}):$("#telegram-code").closest(".field").removeClass("error")})},"/leaderboard":function(){function e(){var e=window.location;window.history.replaceState("",document.title,e.pathname+"?mode="+favouriteMode+"&p="+page+(""!=country?"&country="+encodeURI(country):"")+e.hash),api("leaderboard",{mode:favouriteMode,p:page,l:50,country:country},function(e){var n=$(".ui.table tbody");n.find("tr").remove(),null==e.users&&(disableSimplepagButtons(!0),e.users=[]);var i=0;e.users.forEach(function(e){n.append($("").append($("").text("#"+(50*(page-1)+ ++i)),$("").html(""+escapeHTML(e.username)+""),$("").html(t(e.chosen_mode.ranked_score,e.chosen_mode.pp)),$("").text(e.chosen_mode.accuracy.toFixed(2)+"%"),$("").html(addCommas(e.chosen_mode.playcount)+" (lv. "+e.chosen_mode.level.toFixed(0)+")")))}),disableSimplepagButtons(e.users.length<50)})}function t(e,t){return 0===t?""+addCommas(e)+"":""+addCommas(t)+"pp ("+addCommas(e)+")"}page=0===page?1:page,$("#country-chooser-modal").click(function(){$(".ui.modal").modal("show")}),$(".lb-country").click(function(){country=$(this).data("country"),page=1,$(".ui.modal").modal("hide"),e()}),e(),setupSimplepag(e),$("#mode-menu .item").click(function(t){t.preventDefault(),$("#mode-menu .active.item").removeClass("active"),$(this).addClass("active"),favouriteMode=$(this).data("mode"),country="",page=1,e()})},"/relaxboard":function(){function e(){var e=window.location;window.history.replaceState("",document.title,e.pathname+"?mode="+favouriteMode+"&p="+page+(""!=country?"&country="+encodeURI(country):"")+e.hash),api("relaxboard",{mode:favouriteMode,p:page,l:50,country:country},function(e){var n=$(".ui.table tbody");n.find("tr").remove(),null==e.users&&(disableSimplepagButtons(!0),e.users=[]);var i=0;e.users.forEach(function(e){n.append($("").append($("").text("#"+(50*(page-1)+ ++i)),$("").html(""+escapeHTML(e.username)+""),$("").html(t(e.chosen_mode.ranked_score,e.chosen_mode.pp)),$("").text(e.chosen_mode.accuracy.toFixed(2)+"%"),$("").html(addCommas(e.chosen_mode.playcount)+" (lv. "+e.chosen_mode.level.toFixed(0)+")")))}),disableSimplepagButtons(e.users.length<50)})}function t(e,t){return 0===t?""+addCommas(e)+"":""+addCommas(t)+"pp ("+addCommas(e)+")"}page=0===page?1:page,$("#country-chooser-modal").click(function(){$(".ui.modal").modal("show")}),$(".lb-country").click(function(){country=$(this).data("country"),page=1,$(".ui.modal").modal("hide"),e()}),e(),setupSimplepag(e),$("#mode-menu .item").click(function(t){t.preventDefault(),$("#mode-menu .active.item").removeClass("active"),$(this).addClass("active"),favouriteMode=$(this).data("mode"),country="",page=1,e()})},"/autoboard":function(){function e(){var e=window.location;window.history.replaceState("",document.title,e.pathname+"?mode="+favouriteMode+"&p="+page+(""!=country?"&country="+encodeURI(country):"")+e.hash),api("autoboard",{mode:favouriteMode,p:page,l:50,country:country},function(e){var n=$(".ui.table tbody");n.find("tr").remove(),null==e.users&&(disableSimplepagButtons(!0),e.users=[]);var i=0;e.users.forEach(function(e){n.append($("").append($("").text("#"+(50*(page-1)+ ++i)),$("").html(""+escapeHTML(e.username)+""),$("").html(t(e.chosen_mode.ranked_score,e.chosen_mode.pp)),$("").text(e.chosen_mode.accuracy.toFixed(2)+"%"),$("").html(addCommas(e.chosen_mode.playcount)+" (lv. "+e.chosen_mode.level.toFixed(0)+")")))}),disableSimplepagButtons(e.users.length<50)})}function t(e,t){return 0===t?""+addCommas(e)+"":""+addCommas(t)+"pp ("+addCommas(e)+")"}page=0===page?1:page,$("#country-chooser-modal").click(function(){$(".ui.modal").modal("show")}),$(".lb-country").click(function(){country=$(this).data("country"),page=1,$(".ui.modal").modal("hide"),e()}),e(),setupSimplepag(e),$("#mode-menu .item").click(function(t){t.preventDefault(),$("#mode-menu .active.item").removeClass("active"),$(this).addClass("active"),favouriteMode=$(this).data("mode"),country="",page=1,e()})},"/friends":function(){$(".smalltext.button").click(function(){var e=$(this),t="1"===e.data("deleted")?"add":"del";console.log(t),e.addClass("disabled"),api("friends/"+t,{user:+e.data("userid")},function(t){e.removeClass("disabled"),e.data("deleted",t.friend?"0":"1"),e.removeClass("green red blue"),e.addClass(t.friend?t.mutual?"red":"green":"blue"),e.find(".icon").removeClass("minus plus heart").addClass(t.friend?t.mutual?"heart":"minus":"plus"),e.find("span").text(t.friend?T(t.mutual?"Mutual":"Remove"):e("Add"))},!0)})},"/team":function(){$("#everyone").click(function(){$(".ui.modal").modal("show")})},"/register/verify":function(){var e=query("u");setInterval(function(){$.getJSON(hanayoConf.banchoAPI+"/api/v1/verifiedStatus?u="+e,function(t){t.result>=0&&(window.location.href="/register/welcome?u="+e)})},5e3)},"/settings":function(){$("input[name='custom_badge.icon']").on("input",function(){$("#badge-icon").attr("class","circular big icon "+escapeHTML($(this).val()))}),$("input[name='custom_badge.name']").on("input",function(){$("#badge-name").html(escapeHTML($(this).val()))}),$("input[name='custom_badge.show']").change(function(){$(this).is(":checked")?$("#custom-badge-fields").slideDown():$("#custom-badge-fields").slideUp()});var e=$("#dark-site").is(":checked");$("form").submit(function(t){t.preventDefault();var n=$("#dark-site").is(":checked");if(n!=e){var i=document.cookie.replace(/(?:(?:^|.*;\s*)cflags\s*\=\s*([^;]*).*$)|^.*$/,"$1");i=n?1|+i:+i&-2,document.cookie="cflags="+i+";path=/;max-age=31536000"}var o=formToObject($(this)),r=0;$(this).find("input[data-sv]").each(function(e,t){t=$(t),t.is(":checked")&&(r|=t.data("sv"))}),o.play_style=r;var a=$(this);return api("users/self/settings",o,function(t){return n!=e?void window.location.reload():(showMessage("success","Your new settings have been saved."),void a.removeClass("loading"))},!0),!1})},"/settings/userpage":function(){var e=null;$("textarea[name='data']").on("input",function(){null!==e&&clearTimeout(e);$(this).val();e=setTimeout(function(){$("#userpage-content").addClass("loading"),$.post("/settings/userpage/parse",$("textarea[name='data']").val(),function(e){var t=$("#userpage-content").removeClass("loading").html(e);"undefined"!=typeof twemoji&&twemoji.parse(t[0])},"text")},800)}),$("form").submit(function(e){e.preventDefault();var t=formToObject($(this)),n=$(this);return api("users/self/userpage",t,function(e){showMessage("success","Your userpage has been saved."),n.removeClass("loading")},!0),!1})},"/donate":function(){var e=$("#months-slider")[0];noUiSlider.create(e,{start:[1],step:1,connect:[!0,!1],range:{min:[1],max:[24]}});var t={},n=e.noUiSlider;$.getJSON("/donate/rates",function(e){t=e,n.on("update",function(){var e=n.get(),i=Math.pow(30*e*.2,.7),o=i/t.EUR,r=o*t.USD;$("#cost").html(T("{{ months }} month costs € {{ eur }}",{count:Math.round(+e),months:(+e).toFixed(0),eur:i.toFixed(2)})+"
"+T("($ {{ usd }} / BTC {{ btc }})",{usd:r.toFixed(2),btc:o.toFixed(10)})),$("input[name='os0']").attr("value",(+e).toFixed(0)+" month"+(1==e?"":"s")),$("#bitcoin-amt").text(o.toFixed(6)),$("#paypal-amt").val(i.toFixed(2))})}),$("#username-input").on("input",function(){$("#ipn-username").attr("value","username="+$(this).val())})},"/settings/avatar":function(){$("#file").change(function(e){var t=e.target.files;if(!(t.length<1)){var n=window.URL.createObjectURL(t[0]),i=$("#avatar-img")[0];i.src=n,i.onload=function(){window.URL.revokeObjectURL(this.src)}}})},"/beatmaps/rank_request":function(){function e(e){$("#queue-info").html(e.submitted+"/"+e.queue_size),0==e.submitted_by_user?$("#by-you").attr("hidden","hidden"):$("#by-you").removeAttr("hidden"),$("#submitted-by-user").text(e.submitted_by_user),$("#max-per-user").text(e.max_per_user);var t=(e.submitted/e.queue_size*100).toFixed(0);$("#progressbar .progress").text(t+"%"),$("#progressbar").progress({percent:t}),e.can_submit?$("#b-form .input, #b-form .button").removeClass("disabled"):$("#b-form .input, #b-form .button").addClass("disabled")}setInterval(function(){api("beatmaps/rank_requests/status",{},e)},1e4);var t=/^https?:\/\/osu.ppy.sh\/(s|b)\/(\d+)$/gi;$("#b-form").submit(function(n){n.preventDefault();var i=$("#beatmap").val().trim(),o=t.exec(i);if(t.exec(),console.log(i,o),null===o)return showMessage("error","Please provide a valid link, in the form of either https://osu.ppy.sh/s/<ID> or https://osu.ppy.sh/b/<ID>."),$(this).removeClass("loading"),!1;var r={};"s"==o[1]?r.set_id=+o[2]:r.id=+o[2];var a=$(this);return api("beatmaps/rank_requests",r,function(t){a.removeClass("loading"),showMessage("success","Beatmap rank request has been submitted."),e(t)},function(e){a.removeClass("loading"),406==e.code&&showMessage("warning","That beatmap is already ranked!")},!0),!1})},"/settings/profbackground":function(){$("#colorpicker").minicolors({inline:!0}),$("#background-type").change(function(){$("[data-type]:not([hidden])").attr("hidden","hidden"),$("[data-type="+$(this).val()+"]").removeAttr("hidden")}),$("#file").change(function(e){var t=e.target.files;if(!(t.length<1)){var n=window.URL.createObjectURL(t[0]),i=document.createElement("img");i.src=n,i.onload=function(){window.URL.revokeObjectURL(this.src)},$("#image-background").empty().append(i)}})},"/dev/tokens":function(){$("#privileges-number").on("input",function(){$("#privileges-text").text(privilegesToString($(this).val()))})}};$(document).ready(function(){$(".message .close").on("click",closeClosestMessage),$(".ui.checkbox").checkbox(),$(".ui.dropdown").dropdown(),$(".ui.progress").progress(),$(".ui.form").submit(function(e){var t=$(this);if(t.hasClass("loading")||t.hasClass("disabled"))return e.preventDefault(),!1;t.addClass("loading");var n=t.attr("id");$("[form='"+n+"']").addClass("loading")}),"undefined"!=typeof twemoji&&$(".twemoji").each(function(e,t){twemoji.parse(t)});var e=singlePageSnippets[window.location.pathname];"function"==typeof e&&e(),"function"==typeof deferredToPageLoad&&deferredToPageLoad(),$("#user-search").search({onSelect:function(e){return window.location.href=e.url,!1},apiSettings:{url:"/api/v1/users/lookup?name={query}",onResponse:function(e){var t={results:[]};return $.each(e.users,function(e,n){t.results.push({title:n.username,url:"/u/"+n.id,image:hanayoConf.avatars+"/"+n.id})}),t}}}),$("#user-search-input").keypress(function(e){13==e.which&&(window.location.pathname="/u/"+$(this).val())}),$(document).keydown(function(e){var t=$(document.activeElement),n=t.is(":input,[contenteditable]");83!==e.which&&115!==e.which||n||($("#user-search-input").focus(),e.preventDefault()),27===e.which&&n&&t.blur()}),$.timeago.settings.allowFuture=!0,$("time.timeago").timeago(),$("#language-selector .item").click(function(){var e=$(this).data("lang");document.cookie="language="+e+";path=/;max-age=31536000",window.location.reload()})});var modes={0:"osu! standard",1:"Taiko",2:"Catch the Beat",3:"osu!mania"},modesShort={0:"std",1:"taiko",2:"ctb",3:"mania"},entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};window.URL=window.URL||window.webkitURL;var modsString=["NF","EZ","NV","HD","HR","SD","DT","RX","HT","NC","FL","AU","SO","AP","PF","K4","K5","K6","K7","K8","K9","RN","LM","K9","K0","K1","K3","K2"],langWhitelist=["de","it","ko","es","ru","pl","fr","nl","sv","fi","ro","ko","vi"];i18next.use(i18nextXHRBackend).init({nsSeparator:!1,keySeparator:!1,fallbackLng:!1,lng:hanayoConf.language,whitelist:langWhitelist,load:"currentOnly",backend:{loadPath:"/static/locale/{{lng}}.json"}});var i18nLoaded=$.inArray(hanayoConf.language,langWhitelist)===-1;i18next.on("loaded",function(){i18nLoaded=!0});var apiPrivileges=["ReadConfidential","Write","ManageBadges","BetaKeys","ManageSettings","ViewUserAdvanced","ManageUser","ManageRoles","ManageAPIKeys","Blog","APIMeta","Beatmap"]; \ No newline at end of file diff --git a/templates/leaderboard_auto.html b/templates/leaderboard_auto.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/leaderboard_relax.html b/templates/leaderboard_relax.html new file mode 100644 index 0000000..f5d27d1 --- /dev/null +++ b/templates/leaderboard_relax.html @@ -0,0 +1,59 @@ +{{/*### + Handler=/relaxboard + TitleBar=Leaderboard + KyutGrill=leaderboard2.jpg + */}} + {{ define "tpl" }} +
+ {{ $favModeRaw := .Get "users/self/favourite_mode" }} + {{ $favMode := _or (atoi (.Gin.Query "mode")) $favModeRaw.favourite_mode (float 0) }} + + + + + + {{ template "simplepag" 5 }} + + + + + + + + + + + + {{ template "simplepag" 5 }} + +
{{ .T "Rank" }} {{ .T "Player" }} {{ .T "PP/Score" }} {{ .T "Accuracy" }} {{ .T "Playcount" }}
+ +
+ {{ end }} + \ No newline at end of file