!function(t){function e(e,a,r){return r=g(a,r),this.on("click.pjax",e,function(e){var a=r;a.container||((a=t.extend({},r)).container=t(this).attr("data-pjax")),n(e,a)})}function n(e,n,a){a=g(n,a);var o=e.currentTarget,i=t(o);if("A"!==o.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";if(!(e.which>1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||location.protocol!==o.protocol||location.hostname!==o.hostname||o.href.indexOf("#")>-1&&x(o)==x(location)||e.isDefaultPrevented())){var c={url:o.href,container:i.attr("data-pjax"),target:o},s=t.extend({},c,a),u=t.Event("pjax:click");i.trigger(u,[s]),u.isDefaultPrevented()||(r(s),e.preventDefault(),i.trigger("pjax:clicked",[s]))}}function a(e,n,a){a=g(n,a);var o=e.currentTarget,i=t(o);if("FORM"!==o.tagName.toUpperCase())throw"$.pjax.submit requires a form element";var c={type:(i.attr("method")||"GET").toUpperCase(),url:i.attr("action"),container:i.attr("data-pjax"),target:o};if("GET"!==c.type&&void 0!==window.FormData)c.data=new FormData(o),c.processData=!1,c.contentType=!1;else{if(i.find(":file").length)return;c.data=i.serializeArray()}r(t.extend({},c,a)),e.preventDefault()}function r(e){"function"==typeof(e=t.extend(!0,{},t.ajaxSettings,r.defaults,e)).url&&(e.url=e.url());var n=v(e.url).hash,a=typeof e.container;if("string"!==a)throw"expected string value for 'container' option; got "+a;var o,c=e.context=t(e.container);if(!c.length)throw"the container selector '"+e.container+"' did not match anything";function s(n,a,r){r||(r={}),r.relatedTarget=e.target;var o=t.Event(n,r);return c.trigger(o,a),!o.isDefaultPrevented()}e.data||(e.data={}),Array.isArray(e.data)?e.data.push({name:"_pjax",value:e.container}):e.data._pjax=e.container,e.beforeSend=function(t,a){if("GET"!==a.type&&(a.timeout=0),t.setRequestHeader("X-PJAX","true"),t.setRequestHeader("X-PJAX-Container",e.container),!s("pjax:beforeSend",[t,a]))return!1;a.timeout>0&&(o=setTimeout(function(){s("pjax:timeout",[t,e])&&t.abort("timeout")},a.timeout),a.timeout=0);var r=v(a.url);n&&(r.hash=n),e.requestUrl=m(r)},e.complete=function(t,n){o&&clearTimeout(o),s("pjax:complete",[t,n,e]),s("pjax:end",[t,e])},e.error=function(t,n,a){var r=w("",t,e),o=s("pjax:error",[t,n,a,e]);"GET"==e.type&&"abort"!==n&&o&&i(r.url)},e.success=function(a,o,u){var l=r.state,p="function"==typeof t.pjax.defaults.version?t.pjax.defaults.version():t.pjax.defaults.version,f=u.getResponseHeader("X-PJAX-Version"),h=w(a,u,e),m=v(h.url);if(n&&(m.hash=n,h.url=m.href),p&&f&&p!==f)i(h.url);else if(h.contents){if(r.state={id:e.id||d(),url:h.url,title:h.title,container:e.container,fragment:e.fragment,timeout:e.timeout},(e.push||e.replace)&&window.history.replaceState(r.state,h.title,h.url),t.contains(c,document.activeElement))try{document.activeElement.blur()}catch(g){}h.title&&(document.title=h.title),s("pjax:beforeReplace",[h.contents,e],{state:r.state,previousState:l}),"function"==typeof e.renderCallback?e.renderCallback(c,h.contents,x):(c.html(h.contents),x())}else i(h.url);function x(){var r=c.find("input[autofocus], textarea[autofocus]").last()[0];r&&document.activeElement!==r&&r.trigger("focus"),function(e){if(e){var n=t("script[src]");e.each(function(){var e=this.src;if(!n.filter(function(){return this.src===e}).length){var a=document.createElement("script"),r=t(this).attr("type");r&&(a.type=r),a.src=t(this).attr("src"),document.head.appendChild(a)}})}}(h.scripts);var i=e.scrollTo;if(n){var l=decodeURIComponent(n.slice(1)),p=document.getElementById(l)||document.getElementsByName(l)[0];p&&(i=t(p).offset().top)}"number"==typeof i&&t(window).scrollTop(i),s("pjax:success",[a,o,u,e])}},r.state||(r.state={id:d(),url:window.location.href,title:document.title,container:e.container,fragment:e.fragment,timeout:e.timeout},window.history.replaceState(r.state,document.title)),f(r.xhr),r.options=e;var u,l,p=r.xhr=t.ajax(e);return p.readyState>0&&(e.push&&!e.replace&&(u=r.state.id,l=[e.container,h(c)],b[u]=l,E.push(u),S(T,0),S(E,r.defaults.maxCacheLength),window.history.pushState(null,"",e.requestUrl)),s("pjax:start",[p,e]),s("pjax:send",[p,e])),r.xhr}function o(e,n){var a={url:window.location.href,push:!1,replace:!0,scrollTo:!1};return r(t.extend(a,g(e,n)))}function i(t){window.history.replaceState(null,"",r.state.url),window.location.replace(t)}var c=!0,s=window.location.href,u=window.history.state;function l(e){c||f(r.xhr);var n,a=r.state,o=e.state;if(o&&o.container){if(c&&s==o.url)return;if(a){if(a.id===o.id)return;n=a.id<o.id?"forward":"back"}var u=b[o.id]||[],l=u[0]||o.container,p=t(l),d=u[1];if(p.length){a&&function(t,e,n){var a,o;b[e]=n,"forward"===t?(a=E,o=T):(a=T,o=E),a.push(e),(e=o.pop())&&delete b[e],S(a,r.defaults.maxCacheLength)}(n,a.id,[l,h(p)]);var m=t.Event("pjax:popstate",{state:o,direction:n});p.trigger(m);var v={id:o.id,url:o.url,container:l,push:!1,fragment:o.fragment,timeout:o.timeout,scrollTo:!1};if(d){p.trigger("pjax:start",[null,v]),r.state=o,o.title&&(document.title=o.title);var x=t.Event("pjax:beforeReplace",{state:o,previousState:a});p.trigger(x,[d,v]),p.html(d),p.trigger("pjax:end",[null,v])}else r(v);p[0].offsetHeight}else i(location.href)}c=!1}function p(e){var n="function"==typeof e.url?e.url():e.url,a=e.type?e.type.toUpperCase():"GET",r=t("<form>",{method:"GET"===a?"GET":"POST",action:n,style:"display:none"});"GET"!==a&&"POST"!==a&&r.append(t("<input>",{type:"hidden",name:"_method",value:a.toLowerCase()}));var o=e.data;if("string"==typeof o)t.each(o.split("&"),function(e,n){var a=n.split("=");r.append(t("<input>",{type:"hidden",name:a[0],value:a[1]}))});else if(Array.isArray(o))t.each(o,function(e,n){r.append(t("<input>",{type:"hidden",name:n.name,value:n.value}))});else if("object"==typeof o){var i;for(i in o)r.append(t("<input>",{type:"hidden",name:i,value:o[i]}))}t(document.body).append(r),r.submit()}function f(e){e&&e.readyState<4&&(e.onreadystatechange=t.noop,e.abort())}function d(){return(new Date).getTime()}function h(t){var e=t.clone();return e.find("script").each(function(){this.src||jQuery._data(this,"globalEval",!1)}),e.contents()}function m(t){return t.search=t.search.replace(/([?&])(_pjax|_)=[^&]*/g,"").replace(/^&/,""),t.href.replace(/\?($|#)/,"$1")}function v(t){var e=document.createElement("a");return e.href=t,e}function x(t){return t.href.replace(/#.*/,"")}function g(e,n){return e&&n?((n=t.extend({},n)).container=e,n):t.isPlainObject(e)?e:{container:e}}function y(t,e){return t.filter(e).add(t.find(e))}function j(e){return t.parseHTML(e,document,!0)}function w(e,n,a){var r,o,i={},c=/<html/i.test(e),s=n.getResponseHeader("X-PJAX-URL");if(i.url=s?m(v(s)):a.requestUrl,c){o=t(j(e.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]));var u=e.match(/<head[^>]*>([\s\S.]*)<\/head>/i);r=null!=u?t(j(u[0])):o}else r=o=t(j(e));if(0===o.length)return i;if(i.title=y(r,"title").last().text(),a.fragment){var l=o;"body"!==a.fragment&&(l=y(l,a.fragment).first()),l.length&&(i.contents="body"===a.fragment?l:l.contents(),i.title||(i.title=l.attr("title")||l.data("title")))}else c||(i.contents=o);return i.contents&&(i.contents=i.contents.not(function(){return t(this).is("title")}),i.contents.find("title").remove(),i.scripts=y(i.contents,"script[src]").remove(),i.contents=i.contents.not(i.scripts)),i.title&&(i.title=function(t){return null==t?"":"string"==typeof t?t.trim():(t+"").replace("/^[\\s\ufeff ]+|[\\s\ufeff ]+$/g","")}(i.title)),i}u&&u.container&&(r.state=u),"state"in window.history&&(c=!1);var b={},T=[],E=[];function S(t,e){for(;t.length>e;)delete b[t.shift()]}function C(){return t("meta").filter(function(){var e=t(this).attr("http-equiv");return e&&"X-PJAX-VERSION"===e.toUpperCase()}).attr("content")}function P(){t.fn.pjax=e,t.pjax=r,t.pjax.enable=t.noop,t.pjax.disable=A,t.pjax.click=n,t.pjax.submit=a,t.pjax.reload=o,t.pjax.defaults={timeout:650,push:!0,replace:!1,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20,version:C},t(window).on("popstate.pjax",l)}function A(){t.fn.pjax=function(){return this},t.pjax=p,t.pjax.enable=P,t.pjax.disable=t.noop,t.pjax.click=t.noop,t.pjax.submit=t.noop,t.pjax.reload=function(){window.location.reload()},t(window).off("popstate.pjax",l)}"state"in t.Event.prototype||t.event.addProp("state"),t.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),t.support.pjax?P():A()}(jQuery);