(()=>{var t={11(t,e,o){const a=o(132),n=jQuery,i=function(){const t=this;this.params=[],this.modal=new a,this.modal.onStop=function(e){t.onStop(e)}};i.prototype.setParams=function(t){this.params=Ai1wm.Util.list(t)},i.prototype.start=function(t,e){const o=this;if(0===(e=e||0)&&this.stopExport(!1),this.isExportStopped())return;n(window).on("beforeunload",function(){return ai1wm_locale.stop_exporting_your_website}),this.setStatus({type:"info",message:ai1wm_locale.preparing_to_export});let a=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key});t&&(a=a.concat(Ai1wm.Util.list(t))),n.ajax({url:ai1wm_export.ajax.url,type:"POST",dataType:"json",data:a,dataFilter:function(t){return Ai1wm.Util.json(t)}}).done(function(){o.getStatus()}).done(function(t){t&&o.run(t)}).fail(function(n){const i=1e3*e;try{const t=Ai1wm.Util.json(n.responseText);if(t){const e=JSON.parse(t).errors.pop();if(e.message)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:e.message,nonce:Ai1wm.Util.findValueByName(a,"storage")})}}catch(t){}if(e>=5)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:ai1wm_locale.unable_to_start_the_export,nonce:Ai1wm.Util.findValueByName(a,"storage")});e++,setTimeout(o.start.bind(o,t,e),i)})},i.prototype.run=function(t,e){const o=this;e=e||0,this.isExportStopped()||n.ajax({url:ai1wm_export.ajax.url,type:"POST",dataType:"json",data:t,dataFilter:function(t){return Ai1wm.Util.json(t)}}).done(function(t){t&&o.run(t)}).fail(function(a){const n=1e3*e;try{const e=Ai1wm.Util.json(a.responseText);if(e){const a=JSON.parse(e).errors.pop();if(a.message)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:a.message,nonce:Ai1wm.Util.findValueByName(t,"storage")})}}catch(t){}if(e>=5)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:ai1wm_locale.unable_to_run_the_export,nonce:Ai1wm.Util.findValueByName(t,"storage")});e++,setTimeout(o.run.bind(o,t,e),n)})},i.prototype.clean=function(t,e){const o=this;0===(e=e||0)&&this.stopExport(!0),this.setStatus({type:"info",message:ai1wm_locale.please_wait_stopping_the_export});let a=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key}).concat({name:"priority",value:300}).concat({name:"ai1wm_export_cancel",value:1});t&&(a=a.concat(Ai1wm.Util.list(t))),n.ajax({url:ai1wm_export.ajax.url,type:"POST",dataType:"json",data:a,dataFilter:function(t){return Ai1wm.Util.json(t)}}).done(function(){n(window).off("beforeunload"),o.modal.destroy()}).fail(function(n){const i=1e3*e;try{const t=Ai1wm.Util.json(n.responseText);if(t){const e=JSON.parse(t).errors.pop();if(e.message)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:e.message,nonce:Ai1wm.Util.findValueByName(a,"storage")})}}catch(t){}if(e>=5)return o.stopExport(!0),void o.setStatus({type:"error",title:ai1wm_locale.unable_to_export,message:ai1wm_locale.unable_to_stop_the_export,nonce:Ai1wm.Util.findValueByName(a,"storage")});e++,setTimeout(o.clean.bind(o,t,e),i)})},i.prototype.getStatus=function(){const t=this;this.isExportStopped()||(this.statusXhr=n.ajax({url:ai1wm_export.status.url,type:"GET",dataType:"json",cache:!1,dataFilter:function(t){return Ai1wm.Util.json(t)}}).done(function(e){if(e)switch(t.setStatus(e),e.type){case"done":case"error":case"download":return void n(window).off("beforeunload")}setTimeout(t.getStatus.bind(t),3e3)}).fail(function(){setTimeout(t.getStatus.bind(t),3e3)}))},i.prototype.setStatus=function(t){this.modal.render(t)},i.prototype.onStop=function(t){this.clean(t)},i.prototype.stopExport=function(t){try{t&&this.statusXhr&&this.statusXhr.abort()}finally{this.isStopped=t}},i.prototype.isExportStopped=function(){return this.isStopped},t.exports=i},132(t){const e=jQuery,o=function(){const t=this;this.error=function(o){const a=e("
"),n=e(""),i=e(""),r=e("").html(o.message),s=e(""),p=e("").addClass("ai1wm-title-red").text(o.title),l=e('').on("click",function(){t.destroy()});if(l.append(ai1wm_locale.close_export),s.append(l),i.append(p),n.append(i).append(r),o.nonce){const t=e('');t.text(ai1wm_locale.view_error_log_button),t.prop("href",ai1wm_export.storage.url+"/"+ai1wm_export.error_log.pattern.replace("%s",o.nonce)),n.append(e("").append(t))}a.append(n).append(s),t.modal.html(a).show(),t.modal.trigger("focus"),t.overlay.show()},this.info=function(o){const a=e(""),n=e(""),i=e(""),r=e("").html(o.message),s=e(""),p=e(''),l=e('').on("click",function(){l.attr("disabled","disabled"),t.onStop()});l.append(' '+ai1wm_locale.stop_export),s.append(l),i.append(p),n.append(i).append(r),a.append(n).append(s),t.modal.html(a).show(),t.modal.trigger("focus"),t.overlay.show()},this.done=function(o){const a=e(""),n=e(""),i=e(""),r=e("").html(o.message),s=e(""),p=e("").addClass("ai1wm-title-green").text(o.title),l=e('').on("click",function(){t.destroy()});l.append(ai1wm_locale.close_export),s.append(l),i.append(p),n.append(i).append(r),a.append(n).append(s),t.modal.html(a).show(),t.modal.trigger("focus"),t.overlay.show()},this.download=function(o){const a=e(""),n=e(""),i=e("").html(o.message),r=e(""),s=e('').on("click",function(){t.destroy()}),p=e(".ai1wm-menu-count");p.text(+p.text()+1),p.text()>1?p.prop("title",ai1wm_locale.backups_count_plural.replace("%d",p.text())):(p.removeClass("ai1wm-menu-hide"),p.prop("title",ai1wm_locale.backups_count_singular.replace("%d",p.text()))),s.append(ai1wm_locale.close_export),r.append(s),n.append(i),a.append(n).append(r),t.modal.html(a).show(),t.modal.trigger("focus"),t.overlay.show()},this.overlay=e(''),this.modal=e(''),e("body").append(this.overlay).append(this.modal)};o.prototype.render=function(t){switch(e(document).trigger("ai1wm-export-status",t),t.type){case"error":this.error(t);break;case"info":this.info(t);break;case"done":this.done(t);break;case"download":this.download(t)}},o.prototype.destroy=function(){this.modal.hide(),this.overlay.hide()},t.exports=o},827(){var t;(t=jQuery).fn.ai1wm_find_replace=function(){return t(this).on("click",function(e){e.preventDefault();const o=t("#ai1wm-queries > li:first").clone();o.find("input").val(""),o.find(".ai1wm-query-find-text").html("<text>"),o.find(".ai1wm-query-replace-text").html("<another-text>"),t("#ai1wm-queries > li").removeClass("ai1wm-open"),t(o).addClass("ai1wm-open"),t("#ai1wm-queries").append(o),t(o).ai1wm_query(),t(o).find("p:first").on("click",function(){t(this).parent().toggleClass("ai1wm-open")})}),this}},157(){var t;(t=jQuery).fn.ai1wm_query=function(){const e=t(this).find("input.ai1wm-query-find-input"),o=t(this).find("input.ai1wm-query-replace-input"),a=t(this).find("small.ai1wm-query-find-text"),n=t(this).find("small.ai1wm-query-replace-text");return e.on("change paste input keypress keydown keyup",function(){const e=t(this).val().length>0?t(this).val():"