(function(e){"use strict";function n(t){var n=t.data;if(!t.isDefaultPrevented()){t.preventDefault();e(this).ajaxSubmit(n)}}function r(t){var n=t.target;var r=e(n);if(!r.is(":submit,input:image")){var i=r.closest(":submit");if(i.length===0){return}n=i[0]}var s=this;s.clk=n;if(n.type=="image"){if(t.offsetX!==undefined){s.clk_x=t.offsetX;s.clk_y=t.offsetY}else if(typeof e.fn.offset=="function"){var o=r.offset();s.clk_x=t.pageX-o.left;s.clk_y=t.pageY-o.top}else{s.clk_x=t.pageX-n.offsetLeft;s.clk_y=t.pageY-n.offsetTop}}setTimeout(function(){s.clk=s.clk_x=s.clk_y=null},100)}function i(){if(!e.fn.ajaxSubmit.debug)return;var t="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(t)}else if(window.opera&&window.opera.postError){window.opera.postError(t)}}var t={};t.fileapi=e("").get(0).files!==undefined;t.formdata=window.FormData!==undefined;e.fn.ajaxSubmit=function(n){function x(t){var r=new FormData;for(var i=0;i').attr("value",f.extraData[l]).appendTo(s)[0])}}}if(!f.iframeTarget){p.appendTo("body");if(d.attachEvent)d.attachEvent("onload",M);else d.addEventListener("load",M,false)}setTimeout(o,15);s.submit()}finally{s.setAttribute("action",n);if(t){s.setAttribute("target",t)}else{u.removeAttr("target")}e(a).remove()}}function M(t){if(v.aborted||O){return}try{L=x(d)}catch(n){i("cannot access response document: ",n);t=S}if(t===E&&v){v.abort("timeout");return}else if(t==S&&v){v.abort("server abort");return}if(!L||L.location.href==f.iframeSrc){if(!y)return}if(d.detachEvent)d.detachEvent("onload",M);else d.removeEventListener("load",M,false);var r="success",s;try{if(y){throw"timeout"}var o=f.dataType=="xml"||L.XMLDocument||e.isXMLDoc(L);i("isXml="+o);if(!o&&window.opera&&(L.body===null||!L.body.innerHTML)){if(--A){i("requeing onLoad callback, DOM not available");setTimeout(M,250);return}}var u=L.body?L.body:L.documentElement;v.responseText=u?u.innerHTML:null;v.responseXML=L.XMLDocument?L.XMLDocument:L;if(o)f.dataType="xml";v.getResponseHeader=function(e){var t={"content-type":f.dataType};return t[e]};if(u){v.status=Number(u.getAttribute("status"))||v.status;v.statusText=u.getAttribute("statusText")||v.statusText}var a=(f.dataType||"").toLowerCase();var l=/(json|script|text)/.test(a);if(l||f.textarea){var h=L.getElementsByTagName("textarea")[0];if(h){v.responseText=h.value;v.status=Number(h.getAttribute("status"))||v.status;v.statusText=h.getAttribute("statusText")||v.statusText}else if(l){var m=L.getElementsByTagName("pre")[0];var g=L.getElementsByTagName("body")[0];if(m){v.responseText=m.textContent?m.textContent:m.innerText}else if(g){v.responseText=g.textContent?g.textContent:g.innerText}}}else if(a=="xml"&&!v.responseXML&&v.responseText){v.responseXML=_(v.responseText)}try{k=P(v,a,f)}catch(t){r="parsererror";v.error=s=t||r}}catch(t){i("error caught: ",t);r="error";v.error=s=t||r}if(v.aborted){i("upload aborted");r=null}if(v.status){r=v.status>=200&&v.status<300||v.status===304?"success":"error"}if(r==="success"){if(f.success)f.success.call(f.context,k,"success",v);if(c)e.event.trigger("ajaxSuccess",[v,f])}else if(r){if(s===undefined)s=v.statusText;if(f.error)f.error.call(f.context,v,r,s);if(c)e.event.trigger("ajaxError",[v,f,s])}if(c)e.event.trigger("ajaxComplete",[v,f]);if(c&&!--e.active){e.event.trigger("ajaxStop")}if(f.complete)f.complete.call(f.context,v,r);O=true;if(f.timeout)clearTimeout(b);setTimeout(function(){if(!f.iframeTarget)p.remove();v.responseXML=null},100)}var s=u[0],o,a,f,c,h,p,d,v,m,g,y,b;var w=!!e.fn.prop;if(e(":input[name=submit],:input[id=submit]",s).length){alert('Error: Form elements must not have name or id of "submit".');return}if(t){for(a=0;a');p.css({position:"absolute",top:"-1000px",left:"-1000px"})}d=p[0];v={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var n=t==="timeout"?"timeout":"aborted";i("aborting upload... "+n);this.aborted=1;p.attr("src",f.iframeSrc);v.error=n;if(f.error)f.error.call(f.context,v,n,t);if(c)e.event.trigger("ajaxError",[v,f,n]);if(f.complete)f.complete.call(f.context,v,n)}};c=f.global;if(c&&0===e.active++){e.event.trigger("ajaxStart")}if(c){e.event.trigger("ajaxSend",[v,f])}if(f.beforeSend&&f.beforeSend.call(f.context,v,f)===false){if(f.global){e.active--}return}if(v.aborted){return}m=s.clk;if(m){g=m.name;if(g&&!m.disabled){f.extraData=f.extraData||{};f.extraData[g]=m.value;if(m.type=="image"){f.extraData[g+".x"]=s.clk_x;f.extraData[g+".y"]=s.clk_y}}}var E=1;var S=2;var T=e("meta[name=csrf-token]").attr("content");var N=e("meta[name=csrf-param]").attr("content");if(N&&T){f.extraData=f.extraData||{};f.extraData[N]=T}if(f.forceSync){C()}else{setTimeout(C,10)}var k,L,A=50,O;var _=e.parseXML||function(e,t){if(window.ActiveXObject){t=new ActiveXObject("Microsoft.XMLDOM");t.async="false";t.loadXML(e)}else{t=(new DOMParser).parseFromString(e,"text/xml")}return t&&t.documentElement&&t.documentElement.nodeName!="parsererror"?t:null};var D=e.parseJSON||function(e){return window["eval"]("("+e+")")};var P=function(t,n,r){var i=t.getResponseHeader("content-type")||"",s=n==="xml"||!n&&i.indexOf("xml")>=0,o=s?t.responseXML:t.responseText;if(s&&o.documentElement.nodeName==="parsererror"){if(e.error)e.error("parsererror")}if(r&&r.dataFilter){o=r.dataFilter(o,n)}if(typeof o==="string"){if(n==="json"||!n&&i.indexOf("json")>=0){o=D(o)}else if(n==="script"||!n&&i.indexOf("javascript")>=0){e.globalEval(o)}}return o}}if(!this.length){i("ajaxSubmit: skipping submit process - no element selected");return this}var r,s,o,u=this;if(typeof n=="function"){n={success:n}}r=this.attr("method");s=this.attr("action");o=typeof s==="string"?e.trim(s):"";o=o||window.location.href||"";if(o){o=(o.match(/^([^#]+)/)||[])[1]}n=e.extend(true,{url:o,success:e.ajaxSettings.success,type:r||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},n);var a={};this.trigger("form-pre-serialize",[this,n,a]);if(a.veto){i("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(n.beforeSerialize&&n.beforeSerialize(this,n)===false){i("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f=n.traditional;if(f===undefined){f=e.ajaxSettings.traditional}var l=[];var c,h=this.formToArray(n.semantic,l);if(n.data){n.extraData=n.data;c=e.param(n.data,f)}if(n.beforeSubmit&&n.beforeSubmit(h,this,n)===false){i("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[h,this,n,a]);if(a.veto){i("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var p=e.param(h,f);if(c){p=p?p+"&"+c:c}if(n.type.toUpperCase()=="GET"){n.url+=(n.url.indexOf("?")>=0?"&":"?")+p;n.data=null}else{n.data=p}var d=[];if(n.resetForm){d.push(function(){u.resetForm()})}if(n.clearForm){d.push(function(){u.clearForm(n.includeHidden)})}if(!n.dataType&&n.target){var v=n.success||function(){};d.push(function(t){var r=n.replaceTarget?"replaceWith":"html";e(n.target)[r](t).each(v,arguments)})}else if(n.success){d.push(n.success)}n.success=function(e,t,r){var i=n.context||n;for(var s=0,o=d.length;s0;var y="multipart/form-data";var b=u.attr("enctype")==y||u.attr("encoding")==y;var w=t.fileapi&&t.formdata;i("fileAPI :"+w);var E=(g||b)&&!w;if(n.iframe!==false&&(n.iframe||E)){if(n.closeKeepAlive){e.get(n.closeKeepAlive,function(){T(h)})}else{T(h)}}else if((g||b)&&w){x(h)}else{e.ajax(n)}for(var S=0;S