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