$.ajaxSetup({statusCode:{302:function(a){try{var b=$.parseJSON(a.responseText);window.location=b.redirect}catch(c){}}}}),$(document).ajaxSend(function(a,b,c){function d(a){var b=null;if(document.cookie&&document.cookie!=""){var c=document.cookie.split(";");for(var d=0;d<c.length;d++){var e=jQuery.trim(c[d]);if(e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}}return b}function e(a){var b=document.location.host,c=document.location.protocol,d="//"+b,e=c+d;return a==e||a.slice(0,e.length+1)==e+"/"||a==d||a.slice(0,d.length+1)==d+"/"||!/^(\/\/|http:|https:).*/.test(a)}function f(a){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(a)}!f(c.type)&&e(c.url)&&b.setRequestHeader("X-CSRFToken",App.csrftoken||"")})