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