text: !function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=58)}([function(e,t){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,t,i){var n=i(29)("wks"),o=i(21),a=i(0).Symbol,s="function"==typeof a;(e.exports=function(e){return n[e]||(n[e]=s&&a[e]||(s?a:o)("Symbol."+e))}).store=n},function(e,t){var i=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=i)},function(e,t,i){"use strict";t.__esModule=!0;var n=s(i(68)),o=s(i(81)),a="function"==typeof o.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};function s(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof o.default&&"symbol"===a(n.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":a(e)}},function(e,t,i){var n=i(5),o=i(35),a=i(24),s=Object.defineProperty;t.f=i(6)?Object.defineProperty:function(e,t,i){if(n(e),t=a(t,!0),n(i),o)try{return s(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){var n=i(8);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){e.exports=!i(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,i){var n=i(4),o=i(19);e.exports=i(6)?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},function(e,t,i){var n=i(0),o=i(2),a=i(16),s=i(7),r=function(e,t,i){var c,l,p,d=e&r.F,m=e&r.G,u=e&r.S,_=e&r.P,h=e&r.B,g=e&r.W,f=m?o:o[t]||(o[t]={}),b=f.prototype,w=m?n:u?n[t]:(n[t]||{}).prototype;for(c in m&&(i=t),i)(l=!d&&w&&void 0!==w[c])&&c in f||(p=l?w[c]:i[c],f[c]=m&&"function"!=typeof w[c]?i[c]:h&&l?a(p,n):g&&w[c]==p?function(e){var t=function(t,i,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(p):_&&"function"==typeof p?a(Function.call,p):p,_&&((f.virtual||(f.virtual={}))[c]=p,e&r.R&&b&&!b[c]&&s(b,c,p)))};r.F=1,r.G=2,r.S=4,r.P=8,r.B=16,r.W=32,r.U=64,r.R=128,e.exports=r},function(e,t,i){var n=i(73),o=i(26);e.exports=function(e){return n(o(e))}},function(e,t,i){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,i){"use strict";t.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(60));t.default=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,n.default)(e,o.key,o)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}()},function(e,t){e.exports={}},function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,i){var n=i(17);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!0},function(e,t){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},function(e,t,i){var n=i(4).f,o=i(9),a=i(1)("toStringTag");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,i){var n=i(8),o=i(0).document,a=n(o)&&n(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,i){var n=i(8);e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,i){var n=i(40),o=i(30);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t,i){var n=i(29)("keys"),o=i(21);e.exports=function(e){return n[e]||(n[e]=o(e))}},function(e,t,i){var n=i(0),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,i){t.f=i(1)},function(e,t,i){var n=i(0),o=i(2),a=i(20),s=i(31),r=i(4).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=a?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||r(t,e,{value:s.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,i){"use strict";var n=i(17);e.exports.f=function(e){return new function(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}(e)}},function(e,t,i){e.exports=!i(6)&&!i(18)(function(){return 7!=Object.defineProperty(i(23)("div"),"a",{get:function(){return 7}}).a})},function(e,t,i){"use strict";var n=i(70)(!0);i(37)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,i=this._i;return i>=t.length?{value:void 0,done:!0}:(e=n(t,i),this._i+=e.length,{value:e,done:!1})})},function(e,t,i){"use strict";var n=i(20),o=i(10),a=i(38),s=i(7),r=i(9),c=i(14),l=i(71),p=i(22),d=i(76),m=i(1)("iterator"),u=!([].keys&&"next"in[].keys()),_=function(){return this};e.exports=function(e,t,i,h,g,f,b){l(i,t,h);var w,v,y,x=function(e){if(!u&&e in T)return T[e];switch(e){case"keys":case"values":return function(){return new i(this,e)}}return function(){return new i(this,e)}},k=t+" Iterator",j="values"==g,S=!1,T=e.prototype,$=T[m]||T["@@iterator"]||g&&T[g],C=!u&&$||x(g),F=g?j?x("entries"):C:void 0,E="Array"==t&&T.entries||$;if(E&&(y=d(E.call(new e)))!==Object.prototype&&y.next&&(p(y,k,!0),n||r(y,m)||s(y,m,_)),j&&$&&"values"!==$.name&&(S=!0,C=function(){return $.call(this)}),n&&!b||!u&&!S&&T[m]||s(T,m,C),c[t]=C,c[k]=_,g)if(w={values:j?C:x("values"),keys:f?C:x("keys"),entries:F},b)for(v in w)v in T||a(T,v,w[v]);else o(o.P+o.F*(u||S),t,w);return w}},function(e,t,i){e.exports=i(7)},function(e,t,i){var n=i(5),o=i(72),a=i(30),s=i(28)("IE_PROTO"),r=function(){},c=function(){var e,t=i(23)("iframe"),n=a.length;for(t.style.display="none",i(42).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;n--;)delete c.prototype[a[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(r.prototype=n(e),i=new r,r.prototype=null,i[s]=e):i=c(),void 0===t?i:o(i,t)}},function(e,t,i){var n=i(9),o=i(11),a=i(74)(!1),s=i(28)("IE_PROTO");e.exports=function(e,t){var i,r=o(e),c=0,l=[];for(i in r)i!=s&&n(r,i)&&l.push(i);for(;t.length>c;)n(r,i=t[c++])&&(~a(l,i)||l.push(i));return l}},function(e,t,i){var n=i(25),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,i){var n=i(0).document;e.exports=n&&n.documentElement},function(e,t,i){i(78);for(var n=i(0),o=i(7),a=i(14),s=i(1)("toStringTag"),r="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<r.length;c++){var l=r[c],p=n[l],d=p&&p.prototype;d&&!d[s]&&o(d,s,l),a[l]=a.Array}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,i){var n=i(40),o=i(30).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},function(e,t){},function(e,t,i){var n=i(15),o=i(1)("toStringTag"),a="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?i:a?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,i){var n=i(5),o=i(17),a=i(1)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[a])?t:o(i)}},function(e,t,i){var n,o,a,s=i(16),r=i(100),c=i(42),l=i(23),p=i(0),d=p.process,m=p.setImmediate,u=p.clearImmediate,_=p.MessageChannel,h=p.Dispatch,g=0,f={},b=function(){var e=+this;if(f.hasOwnProperty(e)){var t=f[e];delete f[e],t()}},w=function(e){b.call(e.data)};m&&u||(m=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return f[++g]=function(){r("function"==typeof e?e:Function(e),t)},n(g),g},u=function(e){delete f[e]},"process"==i(15)(d)?n=function(e){d.nextTick(s(b,e,1))}:h&&h.now?n=function(e){h.now(s(b,e,1))}:_?(a=(o=new _).port2,o.port1.onmessage=w,n=s(a.postMessage,a,1)):p.addEventListener&&"function"==typeof postMessage&&!p.importScripts?(n=function(e){p.postMessage(e+"","*")},p.addEventListener("message",w,!1)):n="onreadystatechange"in l("script")?function(e){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),b.call(e)}}:function(e){setTimeout(s(b,e,1),0)}),e.exports={set:m,clear:u}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,i){var n=i(5),o=i(8),a=i(34);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var i=a.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.handleAjaxError=function(e,t){var i="\n\t\t\t<p>"+wpmdb_strings.ajax_php_errors+":</p>\n\t\t\t<p>"+t.message+"</p>\n\t";wpmdb.current_migration.setState(e,i,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),console.error("🚨 🚒",t)},t.throwMDBError=function(e){var t=void 0;throw void 0!==e.body&&(wpmdb.common.non_fatal_errors+=e.body,t=e.body),void 0!==e.msg&&(t=e.msg),new Error(t)},t.jQueryAjaxError=function(e,t){return void 0!==t.responseText&&""!==t.responseText?e=t.responseText:void 0!==t.statusText&&(e=t.statusText),console.error(t),wpmdb.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),e},t.doNextStep=function(e,t,i){return wpmdb.common.next_step_in_migration={fn:e,args:t},wpmdb.functions.execute_next_step(i)}},function(e,t,i){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(i(3));var o=i(54),a=jQuery,s=Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(e,t,i){this.addStage(e.name,t,i)},this)},addStage:function(e,t,i,o){var s,r=[];return _.each(t,function(e){var t,n;"remote"===i?(t=this.get("remoteTableSizes")[e],n=this.get("remoteTableRows")[e]):(t=this.get("localTableSizes")[e],n=this.get("localTableRows")[e]),r.push({name:e,size:t,rows:n})},this),s={name:e,items:r,dataType:i},"object"===(void 0===o?"undefined":(0,n.default)(o))&&(s=a.extend(s,o)),this.addStageModel(s),this.trigger("stage:added",this.get("stageModels")[e]),this.get("stageModels")[e].on("change",function(){this.trigger("change")},this),this.getStageModel(s.name)},addStageItem:function(e,t,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.getStageModel(e).addItem(t,i,n,o)},addStageModel:function(e){var t=this.get("stages"),i=this.get("stageModels"),n=new o(e);t.push(e),i[e.name]=n,this.set("stages",t),this.set("stageModels",i)},getStageModel:function(e){return this.get("stageModels")[e]},getStageItems:function(e,t){var i=this.getStageModel(e).get("items");return void 0===t?i:i.map(function(e){return e[t]})},setActiveStage:function(e){this.setStageComplete(),this.set("activeStageName",e),this.getStageModel(e).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(e){e||(e=this.get("activeStageName")),null!==e&&this.getStageModel(e).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var e=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),e.activateTab()}});e.exports=s},function(e,t,i){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(i(3));var o=jQuery,a=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,names:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("names",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(e){this.addItem(e.name,e.size,e.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var e={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},t=this.get("strings");t="object"===(void 0===t?"undefined":(0,n.default)(t))?t:{},(t=o.extend(e,t)).items_migrated=t.itemsName+" "+t.migrated,t.hide_items=t.hide+" "+t.itemsName,t.show_items=t.show+" "+t.itemsName,this.set("strings",t)},addItem:function(e,t,i,n){var a=this.get("items"),s=this.get("names");if(!~s.indexOf(e)){s.push(e);var r={name:e,size:t,rows:i||t,stageName:this.get("name"),transferred:0,rowsTransferred:0,complete:!1,title:null,get $title(){return this.title||this.createTitleElem()},set $title(e){this.title=e},createTitleElem:function(){return this.title=o("<p>").addClass("item-info").append(o('<span class="name" />').text(this.displayName||this.name)).append(" ").append(o('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(r.size)+")")),this.title},progress:null,get $progress(){return this.progress||this.createProgElem()},set $progress(e){this.progress=e},createProgElem:function(){return this.progress=o('<div class="progress-bar"/>').css("width","0%"),this.progress},el:null,get $el(){return this.el||this.createMainElem()},set $el(e){this.el=e},createMainElem:function(){return this.el=o('<div class="item-progress" />'),this.el.append(this.$title),this.el.append(this.$progress),this.el.append('<span class="dashicons dashicons-yes"/>'),this.el.attr("id","item-"+this.name),this.el.attr("data-stage",this.stageName),this.el},updateProgress:function(e){var t=this.$progress;window.requestAnimationFrame(function(){t.css("width",e+"%")}.bind(this))}};void 0!==n&&n.length&&(r.displayName=n),a.push(r),this.get("lookupItems")[e]=a.length-1,this.set("totalSize",parseFloat(this.get("totalSize"))+parseFloat(t)),this.trigger("item:added",r)}},triggerItemViewInit:function(){var e=this.get("items"),t=this;_.each(e,function(e){t.trigger("item:added",e)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var e=this.getTotalSizeTransferred(),t=this.get("totalSize");return 0>=e||0>=t?0:Math.min(100,Math.round(e/t*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(e){var t=this.get("itemsCompleteArr");if(!~t.indexOf(e)){t.push(e);var i=this.getItemByName(e),n=this.get("totalTransferred"),o=this.get("itemsComplete");this.set("itemsComplete",++o),n+=i.size-i.transferred,this.set("totalTransferred",n),i.transferred=i.size,i.complete=!0,i.rowsTransferred=i.rows,this.trigger("change change:items",i)}},setItemPercentTransferred:function(e,t,i,n){var o=this.getItemByName(e),a=i/1e3;if(1===t){o.complete=!0,o.transferred=a;var s=this.get("itemsComplete");this.set("itemsComplete",++s),this.trigger("change change:items",o)}o.transferred=n/1e3,o.exactPercent=t;var r=this.get("totalTransferred");r+=a,this.set("totalTransferred",r),this.trigger("change change:items",o)},setItemRowsTransferred:function(e,t){var i,n,o=this.getItemByName(e),a=this.get("totalTransferred");1!==(i=-1===parseInt(t)?1:Math.min(1,t/o.rows))?(a+=(n=o.size*i)-o.transferred,this.set("totalTransferred",a),o.transferred=n,o.rowsTransferred=t,this.trigger("change change:items",o)):this.setItemComplete(e)},getItemByName:function(e){var t=this.get("items")[this.get("lookupItems")[e]]||{};return e===t.name?t:this.determineItemByName(e)},determineItemByName:function(e){for(var t=this.get("items"),i=0;i<t.length;i++){var n=t[i];if(e===n.name)return this.get("lookupItems").itemName=i,n}}});e.exports=a},function(e,t,i){"use strict";var n=i(56),o=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:void 0,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(e){this.addStageView(e)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(e){var t=new n({model:e});e.trigger("view:initialized",t),this.$el.append(t.$el),this.$el.parent().find(".stage-tabs").append(t.$tabElem)}}));e.exports=o},function(e,t,i){"use strict";var n=jQuery,o=Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:140,visibleDomNodes:0,itemCount:0,percentDone:0,sizeDone:0,tablesDone:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,shouldHideItemProgress:!1,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=n("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(e){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(e){e.name&&this.setItemProgress(e)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=n('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> '+this.model.get("strings").items_migrated+"</span>").append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=n("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var e=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var t;e.$el.hasClass("hide-tables")?(t=!1,e.$el.add(e.$el.siblings()).removeClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").hide_items)):(t=!0,e.$el.add(e.$el.siblings()).addClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").show_items)),Boolean(t)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=t)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?e.$showHideTablesElem.text(e.model.get("strings").show_items):e.$showHideTablesElem.text(e.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=n(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var e=this,t=!1,i=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(t=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",t),-1!==n.inArray(i,["push","pull","find_replace","import"])?("find_replace"===i&&n("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){-1!==n.inArray(wpmdb.current_migration.model.get("activeStageName"),["media","themes","plugins"])&&e.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var t=Boolean(e.$pauseBeforeFinalizeCheckbox.is(":checked"));t!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=t)})},initTabElem:function(){var e=this;this.$tabElem=n("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){e.model.activateTab()})},updateProgressElem:function(){var e=Math.max(0,this.model.getTotalProgressPercent()),t=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),i=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(e=100,this.$showHideTablesElem.fadeOut()),e!==this.percentDone&&(this.percentDone=e,this.$totalProgressElem.find(".percent-complete").text(e),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:e+"%"})),t!=this.sizeDone&&(this.sizeDone=t,this.$totalProgressElem.find(".size-complete").text(t)),i!=this.tablesDone&&(this.tablesDone=i,this.$totalProgressElem.find(".items-complete").text(wpmdb.functions.wpmdb_add_commas(i)))},updateStageTotals:function(e){if((e=e||this.model.get("items").length)!==this.itemCount&&(this.itemCount=e,this.$totalProgressElem.find(".items-total").text(wpmdb.functions.wpmdb_add_commas(e)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get("totalSize"))),!this.shouldHideItemProgress&&500<e)){var t=this.model.get("name").toLowerCase();"themes"!=t&&"plugins"!==t||this.hideItemProgress()}},hideItemProgress:function(){this.shouldHideItemProgress||(this.shouldHideItemProgress=!0,this.$itemsContainer.empty(),this.$showHideTablesElem&&this.$showHideTablesElem.hide())},maybeAddElementToView:function(e){var t=this.shouldHideItemProgress?0:this.maxDomNodes;this.visibleDomNodes<t?(++this.visibleDomNodes,this.$itemsContainer.append(e.$el)):(this.queuedElements.push(e),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){if(!this.$truncationNotice){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNotice=n('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb.functions.wpmdb_add_commas(e)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice)}},updateTruncationNotice:function(){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(e))},getNextElementForView:function(e){var t;return!this.shouldHideItemProgress&&(this.queuedElements.length&&(e&&this.queuedElements.push(e),e=(t=this.queuedElements.shift())instanceof n?t:t.$el),e)},setItemProgress:function(e){var t=Math.min(100,Math.ceil(e.transferred/e.size*100));e.hasOwnProperty("exactPercent")&&(t=100*e.exactPercent),0===e.size&&(t=100),e.updateProgress(t),(100<=t||0===e.size)&&this.elemComplete(e)},elemComplete:function(e){if(!this.shouldHideItemProgress){var t=e.$el.addClass("complete");if(1!==this.model.get("items").length){var i=this.getNextElementForView(t),n=t.height(),o=t.css("margin-bottom"),a=!1;i===t&&(a=i.clone().css({height:0,marginBottom:0,display:"block"}).addClass("clone complete")).appendTo(this.$itemsContainer),t.css({height:n,marginBottom:o}),setTimeout(function(){t.css({height:0,marginBottom:0});var e=0;a&&(e=250,a.css({height:n,marginBottom:o}),a.find(".progress-bar").addClass("progress-bar-no-transition").css({width:"100%"})),setTimeout(function(){t.css({display:"none"}),t.remove(),a&&a.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(i.css({height:"auto",marginBottom:o,display:"block"}))}.bind(this),e)}.bind(this),1e3)}}}});e.exports=o},function(e,t,i){"use strict";var n=jQuery;e.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,n.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(e,t,i){console.log("Could not save progress item visibility setting",i)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,n.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(e,t,i){console.log("Could not save pause before finalize setting",i)}}))}}},function(e,t,i){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(i(59));window.wpmdb={functions:{},common:{hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1}},wpmdb.functions=new n.default,function(e){e.keys().forEach(function(t){t.includes("wpmdbCommon.js")||-1!==t.indexOf("./js/modules/")||e(t)})}(i(63))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(i(12)),o=a(i(13));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(){(0,n.default)(this,e)}return(0,o.default)(e,[{key:"wpmdb_toggle_migration_action_text",value:function(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}},{key:"wpmdb_migration_type",value:function(){var e=jQuery("input[name=action]:checked");return 0===e.length?"":e.val()}},{key:"wpmdb_call_next_hook",value:function(){var e=window.wpmdb;e.common.call_stack.length||(e.common.call_stack=e.common.hooks);var t=e.common.call_stack[0];e.common.call_stack.shift(),t.call(this)}},{key:"wpmdb_add_commas",value:function(e){for(var t=(e+="").split("."),i=t[0],n=1<t.length?"."+t[1]:"",o=/(\d+)(\d{3})/;o.test(i);)i=i.replace(o,"$1,$2");return i+n}},{key:"wpmdb_parse_json",value:function(e){var t={};try{t=jQuery.parseJSON(e)}catch(e){return!1}return t}},{key:"wpmdbGetAjaxErrors",value:function(e,t,i,n){var o=!1,a="";if(!1===this.wpmdb_parse_json(i)){o=!0,e=wpmdb_strings.ajax_json_message,t="(#144)";var s=i;i=wpmdb_strings.ajax_json_errors+" "+t,i+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",i+='<div class="migration-php-errors">'+s+"</div>"}return(o||"undefined"!==n)&&(a+="<strong>"+e+"</strong> &mdash; "),o||"undefined"===n||(a+=wpmdb_strings.status+": "+n.status+" "+n.statusText,a+="<br /><br />"+wpmdb_strings.response+":<br />"),o||(i+=" "+t),a+=i}},{key:"preg_quote",value:function(e,t){return String(e).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(t||"")+"-]","g"),"\\$&")}},{key:"table_is",value:function(e,t,i){if((e+t).toLowerCase()===i.toLowerCase())return!0;var n=this.preg_quote(i);return null!==new RegExp(e+"([0-9]+)_"+t,"i").exec(n)}},{key:"subsite_for_table",value:function(e,t){var i=this.preg_quote(t),n=new RegExp(e+"([0-9]+)_","i").exec(i);return null===n?1:n[1]}},{key:"convertKBSizeToHR",value:function(e,t,i,n){var o,a;if(i=i||1e3,t=t||2,(e=parseFloat(e))<1&&e>0)o=[(e*i).toFixed(0),"B"];else if(i>Math.abs(e))o=[e.toFixed(0),"KB"];else{a=["MB","GB","TB","PB","EB","ZB","YB"];var s=-1;do{e/=i,++s}while(Math.abs(e)>=i&&s<a.length-1);o=[Math.round(e*Math.pow(10,t))/Math.pow(10,t),a[s]]}return n||(o=o[0]+" "+o[1]),o}},{key:"convertKBSizeToHRFixed",value:function(e,t,i){t=t||2;var n=this.convertKBSizeToHR(e,t,i,!0);return"MB"==n[1]?n[0].toFixed(2)+" "+n[1]:n[0]+" "+n[1]}},{key:"ajax_handle_dismissible_notice",value:function(e,t,i){jQuery.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:e,notice:jQuery(i).data("notice"),type:jQuery(i).data("type"),reminder:jQuery(i).data("reminder")},beforeSend:t(i)})}},{key:"get_spinner_url",value:function(){var e=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";return 2<window.devicePixelRatio&&(e+="-2x"),e+=".gif"}},{key:"exclude_post_types_warning",value:function(){var e=$("#select-post-types").val(),t="",i=$(".exclude-post-types-warning");e?(t="<code>"+e.join("</code>, <code>")+"</code>",$(".excluded-post-types").html(t),"0"===i.css("opacity")&&i.css({opacity:0}).slideDown(200).animate({opacity:1})):i.css({opacity:0}).slideUp(200).animate({opacity:0})}}]),e}();t.default=s},function(e,t,i){e.exports={default:i(61),__esModule:!0}},function(e,t,i){i(62);var n=i(2).Object;e.exports=function(e,t,i){return n.defineProperty(e,t,i)}},function(e,t,i){var n=i(10);n(n.S+n.F*!i(6),"Object",{defineProperty:i(4).f})},function(e,t,i){var n={"./js/backups.js":64,"./js/dismissable-notices.js":107,"./js/helpers/events.js":108,"./js/helpers/utils.js":109,"./js/helpers/wpmdbCommon.js":110,"./js/helpers/wpmdbGlobals.js":111,"./js/hook.js":112,"./js/import.js":113,"./js/localStorage.js":114,"./js/modules/MigrationProgress-controller.js":115,"./js/modules/MigrationProgress-model.js":116,"./js/modules/MigrationProgress-utils.js":117,"./js/modules/MigrationProgress-view.js":118,"./js/modules/MigrationProgressStage-model.js":119,"./js/modules/MigrationProgressStage-view.js":120,"./js/multisite.js":121,"./js/plugin-update.js":122,"./js/script.js":123,"./js/usage-tracking-notice.js":126,"./sass/_migration-progress.scss":127,"./sass/_progress-upgrade.scss":128,"./sass/backups.scss":129,"./sass/plugin-update-styles.scss":130,"./sass/styles.scss":131};function o(e){return i(a(e))}function a(e){var t=n[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}o.keys=function(){return Object.keys(n)},o.resolve=a,e.exports=o,o.id=63},function(e,t,i){var n=window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});var o=l(i(65)),a=l(i(3)),s=l(i(91)),r=l(i(12)),c=l(i(13));i(52);function l(e){return e&&e.__esModule?e:{default:e}}n=window.jQuery;var p=window.wpmdb,d=window.ajaxurl,m=window._,u=function(){function e(){var t=this;(0,r.default)(this,e),this.ajax_spinner='<img src="'+p.functions.get_spinner_url()+'" alt="" class="ajax-spinner general-spinner" />',this.locationHashChanged=(0,s.default)(o.default.mark(function e(){var i;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("#backups"!==window.location.hash){e.next=6;break}return m.isEmpty(t.backups_list)&&(document.getElementById("wpmdb-backups-container").innerHTML=wpmdb_strings.loading_backups+t.ajax_spinner),e.next=4,t.getBackups();case 4:(i=e.sent)&&"object"===(void 0===i?"undefined":(0,a.default)(i))&&t.displayBackups(i);case 6:case"end":return e.stop()}},e,t)})),this.backups_list={},this.backups_rendered=!1}return(0,c.default)(e,[{key:"setup",value:function(){var e=this;if("false"===wpmdb_data.is_pro)return!1;document.addEventListener("DOMContentLoaded",function(){"#backups"===window.location.hash&&e.locationHashChanged()}),navigator.userAgent.match(/Trident.*rv:11\./)&&n("body").addClass("ie11"),window.onhashchange=this.locationHashChanged}},{key:"doAJAX",value:function(){var e=(0,s.default)(o.default.mark(function e(t){var i,a;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.ajax({url:d,type:"POST",cache:!1,data:t});case 2:return i=e.sent,a=JSON.parse(i),e.abrupt("return",a);case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getBackups",value:function(){var e=(0,s.default)(o.default.mark(function e(){var t,i;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t={action:"wpmdb_get_backups",nonce:wpmdb_data.nonces.get_backups},e.prev=1,m.isEmpty(this.backups_list)){e.next=4;break}return e.abrupt("return",this.backups_list);case 4:return e.next=6,this.doAJAX(t);case 6:if(void 0===(i=e.sent).status){e.next=11;break}return document.getElementById("wpmdb-backups-container").innerHTML=i.status,this.backups_list=i.status,e.abrupt("return");case 11:if(void 0===i.wpmdb_error){e.next=13;break}throw new Error(i.error_msg);case 13:return this.backups_list=i,e.abrupt("return",i);case 17:e.prev=17,e.t0=e.catch(1),document.getElementById("wpmdb-backups-container").innerHTML="",this.ajaxError(wpmdb_strings.error_getting_backups,e.t0);case 21:case"end":return e.stop()}},e,this,[[1,17]])}));return function(){return e.apply(this,arguments)}}()},{key:"ajaxError",value:function(e,t){var i=document.getElementById("wpmdb-backups-messages"),n="\n\t\t\t<p><strong>"+e+"</strong></p>\n\t\t\t<p>"+t+"</p>\n\t\t";i.classList.contains("visible")||i.classList.add("visible"),i.innerHTML=n,console.error(t)}},{key:"render",value:function(e){return'\n\t\t<ul class="backups-row" id="'+e.raw_name.replace(/\.sql/,"")+'">\n\t\t\t<li>'+e.modified+"</li>\n\t\t\t<li>"+e.name+'</li>\n\t\t\t<li><a href="#backups" class="download-backup">'+wpmdb_strings.download+'</a> <a href="#backups" class="delete-backup"></a></li>\n\t\t</ul>'}},{key:"displayBackups",value:function(e){if(!this.backups_rendered){var t=""+e.map(this.render).join("");document.getElementById("wpmdb-backups-container").innerHTML=t,this.addListener(".download-backup",this.ajaxGetDownloadFile),this.addListener(".delete-backup",this.ajaxDeleteBackup),this.backups_rendered=!0}}},{key:"addListener",value:function(){var e=(0,s.default)(o.default.mark(function e(t,i){var n=this;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:document.querySelectorAll(t).forEach(function(e){e.addEventListener("click",function(){var e=(0,s.default)(o.default.mark(function e(t){var a;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),a=t.target.parentNode.parentNode.id,e.next=4,i.call(n,a);case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}())});case 1:case"end":return e.stop()}},e,this)}));return function(t,i){return e.apply(this,arguments)}}()},{key:"ajaxGetDownloadFile",value:function(){var e=(0,s.default)(o.default.mark(function e(t,i){var n,a;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={action:"wpmdb_get_backup",path:t,nonce:wpmdb_data.nonces.get_backup},e.prev=1,e.next=4,this.doAJAX(n);case 4:if(void 0===(a=e.sent).wpmdb_error){e.next=7;break}throw new Error(a.error_msg);case 7:return"success"===a.status&&(location.href=a.redirect),e.abrupt("return",a);case 11:e.prev=11,e.t0=e.catch(1),this.ajaxError(wpmdb_strings.error_downloading_backup,e.t0);case 14:case"end":return e.stop()}},e,this,[[1,11]])}));return function(t,i){return e.apply(this,arguments)}}()},{key:"ajaxDeleteBackup",value:function(){var e=(0,s.default)(o.default.mark(function e(t,i){var n,a,s;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm(wpmdb_strings.confirm_delete_backup)){e.next=2;break}return e.abrupt("return");case 2:return n={action:"wpmdb_delete_backup",path:t,nonce:wpmdb_data.nonces.delete_backup},e.prev=3,e.next=6,this.doAJAX(n);case 6:if(void 0===(a=e.sent).wpmdb_error){e.next=9;break}throw new Error(a.error_msg);case 9:return"deleted"===a.status&&((s=document.querySelector("#"+t)).classList.add("wpmdb-backup-deleted"),setTimeout(function(){s.parentNode.removeChild(s)},1100)),e.abrupt("return",a);case 13:e.prev=13,e.t0=e.catch(3),this.ajaxError(wpmdb_strings.error_deleting_backup,e.t0);case 16:case"end":return e.stop()}},e,this,[[3,13]])}));return function(t,i){return e.apply(this,arguments)}}()}]),e}();t.default=u,(new u).setup()},function(e,t,i){e.exports=i(66)},function(e,t,i){var n=function(){return this}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,a=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,e.exports=i(67),o)n.regeneratorRuntime=a;else try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var i,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",r=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",l="object"==typeof e,p=t.regeneratorRuntime;if(p)l&&(e.exports=p);else{(p=t.regeneratorRuntime=l?e.exports:{}).wrap=v;var d="suspendedStart",m="suspendedYield",u="executing",_="completed",h={},g={};g[s]=function(){return this};var f=Object.getPrototypeOf,b=f&&f(f(z([])));b&&b!==n&&o.call(b,s)&&(g=b);var w=j.prototype=x.prototype=Object.create(g);k.prototype=w.constructor=j,j.constructor=k,j[c]=k.displayName="GeneratorFunction",p.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},p.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(w),e},p.awrap=function(e){return{__await:e}},S(T.prototype),T.prototype[r]=function(){return this},p.AsyncIterator=T,p.async=function(e,t,i,n){var o=new T(v(e,t,i,n));return p.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},S(w),w[c]="Generator",w[s]=function(){return this},w.toString=function(){return"[object Generator]"},p.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},p.values=z,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(F),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=i)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return r.type="throw",r.arg=e,t.next=n,o&&(t.method="next",t.arg=i),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var c=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),F(i),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var o=n.arg;F(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:z(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=i),h}}}function v(e,t,i,n){var o=t&&t.prototype instanceof x?t:x,a=Object.create(o.prototype),s=new E(n||[]);return a._invoke=function(e,t,i){var n=d;return function(o,a){if(n===u)throw new Error("Generator is already running");if(n===_){if("throw"===o)throw a;return P()}for(i.method=o,i.arg=a;;){var s=i.delegate;if(s){var r=$(s,i);if(r){if(r===h)continue;return r}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===d)throw n=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=u;var c=y(e,t,i);if("normal"===c.type){if(n=i.done?_:m,c.arg===h)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n=_,i.method="throw",i.arg=c.arg)}}}(e,i,s),a}function y(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}function x(){}function k(){}function j(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function T(e){var t;this._invoke=function(i,n){function a(){return new Promise(function(t,a){!function t(i,n,a,s){var r=y(e[i],e,n);if("throw"!==r.type){var c=r.arg,l=c.value;return l&&"object"==typeof l&&o.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,a,s)},function(e){t("throw",e,a,s)}):Promise.resolve(l).then(function(e){c.value=e,a(c)},s)}s(r.arg)}(i,n,t,a)})}return t=t?t.then(a,a):a()}}function $(e,t){var n=e.iterator[t.method];if(n===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=i,$(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=y(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=i),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function z(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=i,t.done=!0,t};return a.next=a}}return{next:P}}function P(){return{value:i,done:!0}}}(function(){return this}()||Function("return this")())},function(e,t,i){e.exports={default:i(69),__esModule:!0}},function(e,t,i){i(36),i(43),e.exports=i(31).f("iterator")},function(e,t,i){var n=i(25),o=i(26);e.exports=function(e){return function(t,i){var a,s,r=String(o(t)),c=n(i),l=r.length;return c<0||c>=l?e?"":void 0:(a=r.charCodeAt(c))<55296||a>56319||c+1===l||(s=r.charCodeAt(c+1))<56320||s>57343?e?r.charAt(c):a:e?r.slice(c,c+2):s-56320+(a-55296<<10)+65536}}},function(e,t,i){"use strict";var n=i(39),o=i(19),a=i(22),s={};i(7)(s,i(1)("iterator"),function(){return this}),e.exports=function(e,t,i){e.prototype=n(s,{next:o(1,i)}),a(e,t+" Iterator")}},function(e,t,i){var n=i(4),o=i(5),a=i(27);e.exports=i(6)?Object.defineProperties:function(e,t){o(e);for(var i,s=a(t),r=s.length,c=0;r>c;)n.f(e,i=s[c++],t[i]);return e}},function(e,t,i){var n=i(15);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,i){var n=i(11),o=i(41),a=i(75);e.exports=function(e){return function(t,i,s){var r,c=n(t),l=o(c.length),p=a(s,l);if(e&&i!=i){for(;l>p;)if((r=c[p++])!=r)return!0}else for(;l>p;p++)if((e||p in c)&&c[p]===i)return e||p||0;return!e&&-1}}},function(e,t,i){var n=i(25),o=Math.max,a=Math.min;e.exports=function(e,t){return(e=n(e))<0?o(e+t,0):a(e,t)}},function(e,t,i){var n=i(9),o=i(77),a=i(28)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,i){var n=i(26);e.exports=function(e){return Object(n(e))}},function(e,t,i){"use strict";var n=i(79),o=i(80),a=i(14),s=i(11);e.exports=i(37)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])},"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,i){e.exports={default:i(82),__esModule:!0}},function(e,t,i){i(83),i(46),i(89),i(90),e.exports=i(2).Symbol},function(e,t,i){"use strict";var n=i(0),o=i(9),a=i(6),s=i(10),r=i(38),c=i(84).KEY,l=i(18),p=i(29),d=i(22),m=i(21),u=i(1),_=i(31),h=i(32),g=i(85),f=i(86),b=i(5),w=i(8),v=i(11),y=i(24),x=i(19),k=i(39),j=i(87),S=i(88),T=i(4),$=i(27),C=S.f,F=T.f,E=j.f,z=n.Symbol,P=n.JSON,I=P&&P.stringify,O=u("_hidden"),M=u("toPrimitive"),A={}.propertyIsEnumerable,D=p("symbol-registry"),N=p("symbols"),q=p("op-symbols"),B=Object.prototype,Q="function"==typeof z,L=n.QObject,R=!L||!L.prototype||!L.prototype.findChild,H=a&&l(function(){return 7!=k(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,i){var n=C(B,t);n&&delete B[t],F(e,t,i),n&&e!==B&&F(B,t,n)}:F,V=function(e){var t=N[e]=k(z.prototype);return t._k=e,t},U=Q&&"symbol"==typeof z.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof z},G=function(e,t,i){return e===B&&G(q,t,i),b(e),t=y(t,!0),b(i),o(N,t)?(i.enumerable?(o(e,O)&&e[O][t]&&(e[O][t]=!1),i=k(i,{enumerable:x(0,!1)})):(o(e,O)||F(e,O,x(1,{})),e[O][t]=!0),H(e,t,i)):F(e,t,i)},W=function(e,t){b(e);for(var i,n=g(t=v(t)),o=0,a=n.length;a>o;)G(e,i=n[o++],t[i]);return e},K=function(e){var t=A.call(this,e=y(e,!0));return!(this===B&&o(N,e)&&!o(q,e))&&(!(t||!o(this,e)||!o(N,e)||o(this,O)&&this[O][e])||t)},J=function(e,t){if(e=v(e),t=y(t,!0),e!==B||!o(N,t)||o(q,t)){var i=C(e,t);return!i||!o(N,t)||o(e,O)&&e[O][t]||(i.enumerable=!0),i}},Y=function(e){for(var t,i=E(v(e)),n=[],a=0;i.length>a;)o(N,t=i[a++])||t==O||t==c||n.push(t);return n},X=function(e){for(var t,i=e===B,n=E(i?q:v(e)),a=[],s=0;n.length>s;)!o(N,t=n[s++])||i&&!o(B,t)||a.push(N[t]);return a};Q||(r((z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var e=m(arguments.length>0?arguments[0]:void 0),t=function(i){this===B&&t.call(q,i),o(this,O)&&o(this[O],e)&&(this[O][e]=!1),H(this,e,x(1,i))};return a&&R&&H(B,e,{configurable:!0,set:t}),V(e)}).prototype,"toString",function(){return this._k}),S.f=J,T.f=G,i(45).f=j.f=Y,i(33).f=K,i(44).f=X,a&&!i(20)&&r(B,"propertyIsEnumerable",K,!0),_.f=function(e){return V(u(e))}),s(s.G+s.W+s.F*!Q,{Symbol:z});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Z.length>ee;)u(Z[ee++]);for(var te=$(u.store),ie=0;te.length>ie;)h(te[ie++]);s(s.S+s.F*!Q,"Symbol",{for:function(e){return o(D,e+="")?D[e]:D[e]=z(e)},keyFor:function(e){if(!U(e))throw TypeError(e+" is not a symbol!");for(var t in D)if(D[t]===e)return t},useSetter:function(){R=!0},useSimple:function(){R=!1}}),s(s.S+s.F*!Q,"Object",{create:function(e,t){return void 0===t?k(e):W(k(e),t)},defineProperty:G,defineProperties:W,getOwnPropertyDescriptor:J,getOwnPropertyNames:Y,getOwnPropertySymbols:X}),P&&s(s.S+s.F*(!Q||l(function(){var e=z();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var t,i,n=[e],o=1;arguments.length>o;)n.push(arguments[o++]);if(i=t=n[1],(w(t)||void 0!==e)&&!U(e))return f(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!U(t))return t}),n[1]=t,I.apply(P,n)}}),z.prototype[M]||i(7)(z.prototype,M,z.prototype.valueOf),d(z,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},function(e,t,i){var n=i(21)("meta"),o=i(8),a=i(9),s=i(4).f,r=0,c=Object.isExtensible||function(){return!0},l=!i(18)(function(){return c(Object.preventExtensions({}))}),p=function(e){s(e,n,{value:{i:"O"+ ++r,w:{}}})},d=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,n)){if(!c(e))return"F";if(!t)return"E";p(e)}return e[n].i},getWeak:function(e,t){if(!a(e,n)){if(!c(e))return!0;if(!t)return!1;p(e)}return e[n].w},onFreeze:function(e){return l&&d.NEED&&c(e)&&!a(e,n)&&p(e),e}}},function(e,t,i){var n=i(27),o=i(44),a=i(33);e.exports=function(e){var t=n(e),i=o.f;if(i)for(var s,r=i(e),c=a.f,l=0;r.length>l;)c.call(e,s=r[l++])&&t.push(s);return t}},function(e,t,i){var n=i(15);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,i){var n=i(11),o=i(45).f,a={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==a.call(e)?function(e){try{return o(e)}catch(e){return s.slice()}}(e):o(n(e))}},function(e,t,i){var n=i(33),o=i(19),a=i(11),s=i(24),r=i(9),c=i(35),l=Object.getOwnPropertyDescriptor;t.f=i(6)?l:function(e,t){if(e=a(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(r(e,t))return o(!n.f.call(e,t),e[t])}},function(e,t,i){i(32)("asyncIterator")},function(e,t,i){i(32)("observable")},function(e,t,i){"use strict";t.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(92));t.default=function(e){return function(){var t=e.apply(this,arguments);return new n.default(function(e,i){return function o(a,s){try{var r=t[a](s),c=r.value}catch(e){return void i(e)}if(!r.done)return n.default.resolve(c).then(function(e){o("next",e)},function(e){o("throw",e)});e(c)}("next")})}}},function(e,t,i){e.exports={default:i(93),__esModule:!0}},function(e,t,i){i(46),i(36),i(43),i(94),i(105),i(106),e.exports=i(2).Promise},function(e,t,i){"use strict";var n,o,a,s,r=i(20),c=i(0),l=i(16),p=i(47),d=i(10),m=i(8),u=i(17),_=i(95),h=i(96),g=i(48),f=i(49).set,b=i(101)(),w=i(34),v=i(50),y=i(51),x=c.TypeError,k=c.process,j=c.Promise,S="process"==p(k),T=function(){},$=o=w.f,C=!!function(){try{var e=j.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(T,T)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t}catch(e){}}(),F=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},E=function(e,t){if(!e._n){e._n=!0;var i=e._c;b(function(){for(var n=e._v,o=1==e._s,a=0,s=function(t){var i,a,s=o?t.ok:t.fail,r=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&I(e),e._h=1),!0===s?i=n:(l&&l.enter(),i=s(n),l&&l.exit()),i===t.promise?c(x("Promise-chain cycle")):(a=F(i))?a.call(i,r,c):r(i)):c(n)}catch(e){c(e)}};i.length>a;)s(i[a++]);e._c=[],e._n=!1,t&&!e._h&&z(e)})}},z=function(e){f.call(c,function(){var t,i,n,o=e._v,a=P(e);if(a&&(t=v(function(){S?k.emit("unhandledRejection",o,e):(i=c.onunhandledrejection)?i({promise:e,reason:o}):(n=c.console)&&n.error&&n.error("Unhandled promise rejection",o)}),e._h=S||P(e)?2:1),e._a=void 0,a&&t.e)throw t.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){f.call(c,function(){var t;S?k.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})})},O=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),E(t,!0))},M=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw x("Promise can't be resolved itself");(t=F(e))?b(function(){var n={_w:i,_d:!1};try{t.call(e,l(M,n,1),l(O,n,1))}catch(e){O.call(n,e)}}):(i._v=e,i._s=1,E(i,!1))}catch(e){O.call({_w:i,_d:!1},e)}}};C||(j=function(e){_(this,j,"Promise","_h"),u(e),n.call(this);try{e(l(M,this,1),l(O,this,1))}catch(e){O.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(102)(j.prototype,{then:function(e,t){var i=$(g(this,j));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=S?k.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&E(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n;this.promise=e,this.resolve=l(M,e,1),this.reject=l(O,e,1)},w.f=$=function(e){return e===j||e===s?new a(e):o(e)}),d(d.G+d.W+d.F*!C,{Promise:j}),i(22)(j,"Promise"),i(103)("Promise"),s=i(2).Promise,d(d.S+d.F*!C,"Promise",{reject:function(e){var t=$(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(r||!C),"Promise",{resolve:function(e){return y(r&&this===s?j:this,e)}}),d(d.S+d.F*!(C&&i(104)(function(e){j.all(e).catch(T)})),"Promise",{all:function(e){var t=this,i=$(t),n=i.resolve,o=i.reject,a=v(function(){var i=[],a=0,s=1;h(e,!1,function(e){var r=a++,c=!1;i.push(void 0),s++,t.resolve(e).then(function(e){c||(c=!0,i[r]=e,--s||n(i))},o)}),--s||n(i)});return a.e&&o(a.v),i.promise},race:function(e){var t=this,i=$(t),n=i.reject,o=v(function(){h(e,!1,function(e){t.resolve(e).then(i.resolve,n)})});return o.e&&n(o.v),i.promise}})},function(e,t){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(16),o=i(97),a=i(98),s=i(5),r=i(41),c=i(99),l={},p={};(t=e.exports=function(e,t,i,d,m){var u,_,h,g,f=m?function(){return e}:c(e),b=n(i,d,t?2:1),w=0;if("function"!=typeof f)throw TypeError(e+" is not iterable!");if(a(f)){for(u=r(e.length);u>w;w++)if((g=t?b(s(_=e[w])[0],_[1]):b(e[w]))===l||g===p)return g}else for(h=f.call(e);!(_=h.next()).done;)if((g=o(h,b,_.value,t))===l||g===p)return g}).BREAK=l,t.RETURN=p},function(e,t,i){var n=i(5);e.exports=function(e,t,i,o){try{return o?t(n(i)[0],i[1]):t(i)}catch(t){var a=e.return;throw void 0!==a&&n(a.call(e)),t}}},function(e,t,i){var n=i(14),o=i(1)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||a[o]===e)}},function(e,t,i){var n=i(47),o=i(1)("iterator"),a=i(14);e.exports=i(2).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||a[n(e)]}},function(e,t){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var n=i(0),o=i(49).set,a=n.MutationObserver||n.WebKitMutationObserver,s=n.process,r=n.Promise,c="process"==i(15)(s);e.exports=function(){var e,t,i,l=function(){var n,o;for(c&&(n=s.domain)&&n.exit();e;){o=e.fn,e=e.next;try{o()}catch(n){throw e?i():t=void 0,n}}t=void 0,n&&n.enter()};if(c)i=function(){s.nextTick(l)};else if(!a||n.navigator&&n.navigator.standalone)if(r&&r.resolve){var p=r.resolve();i=function(){p.then(l)}}else i=function(){o.call(n,l)};else{var d=!0,m=document.createTextNode("");new a(l).observe(m,{characterData:!0}),i=function(){m.data=d=!d}}return function(n){var o={fn:n,next:void 0};t&&(t.next=o),e||(e=o,i()),t=o}}},function(e,t,i){var n=i(7);e.exports=function(e,t,i){for(var o in t)i&&e[o]?e[o]=t[o]:n(e,o,t[o]);return e}},function(e,t,i){"use strict";var n=i(0),o=i(2),a=i(4),s=i(6),r=i(1)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:n[e];s&&t&&!t[r]&&a.f(t,r,{configurable:!0,get:function(){return this}})}},function(e,t,i){var n=i(1)("iterator"),o=!1;try{var a=[7][n]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var i=!1;try{var a=[7],s=a[n]();s.next=function(){return{done:i=!0}},a[n]=function(){return s},e(a)}catch(e){}return i}},function(e,t,i){"use strict";var n=i(10),o=i(2),a=i(0),s=i(48),r=i(51);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,o.Promise||a.Promise),i="function"==typeof e;return this.then(i?function(i){return r(t,e()).then(function(){return i})}:e,i?function(i){return r(t,e()).then(function(){throw i})}:e)}})},function(e,t,i){"use strict";var n=i(10),o=i(34),a=i(50);n(n.S,"Promise",{try:function(e){var t=o.f(this),i=a(e);return(i.e?t.reject:t.resolve)(i.v),t.promise}})},function(e,t){window.jQuery;!function(e){0<e(".wpmdb-compat-plugin-row-error").length&&e('[data-slug="wp-migrate-db-pro"]').addClass("wpmdbpro-has-message"),e(".wpmdbpro-custom").prev().addClass("update"),e(".notice-link-plugins-page").click(function(t){t.preventDefault();var i=jQuery(this);wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link,function(t){e(t).closest(".wpmdbpro-custom").hide(),e(t).closest("tr").siblings("tr.wpmdbpro-has-message").removeClass("wpmdbpro-has-message")},i),e(".wpmdbpro-custom").prev().removeClass("update")})}(jQuery)},function(e,t){var i=window.jQuery;i.fn.bindFirst=function(e,t){this.bindNth(e,t,0)},i.fn.bindNth=function(e,t,i){this.bind(e,t),this.changeEventOrder(e,i)},i.fn.changeEventOrder=function(e,t){var n=this;i.each(e.split(" "),function(e,o){n.each(function(){var e=i._data(this,"events")[o.split(".")[0]];t=Math.min(t,e.length-1),e.splice(t,0,e.pop())})})}},function(e,t){window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});t.handleAjaxError=function(e,t){var i="\n\t\t\t<p>"+wpmdb_strings.ajax_php_errors+":</p>\n\t\t\t<p>"+t.message+"</p>\n\t";wpmdb.current_migration.setState(e,i,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),console.error("🚨 🚒",t)},t.throwMDBError=function(e){var t=void 0;throw void 0!==e.body&&(wpmdb.common.non_fatal_errors+=e.body,t=e.body),void 0!==e.msg&&(t=e.msg),new Error(t)},t.jQueryAjaxError=function(e,t){return void 0!==t.responseText&&""!==t.responseText?e=t.responseText:void 0!==t.statusText&&(e=t.statusText),console.error(t),wpmdb.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),e},t.doNextStep=function(e,t,i){return wpmdb.common.next_step_in_migration={fn:e,args:t},wpmdb.functions.execute_next_step(i)}},function(e,t,i){var n=window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});var o=s(i(12)),a=s(i(13));function s(e){return e&&e.__esModule?e:{default:e}}var r=function(){function e(){(0,o.default)(this,e)}return(0,a.default)(e,[{key:"wpmdb_toggle_migration_action_text",value:function(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}},{key:"wpmdb_migration_type",value:function(){var e=jQuery("input[name=action]:checked");return 0===e.length?"":e.val()}},{key:"wpmdb_call_next_hook",value:function(){var e=window.wpmdb;e.common.call_stack.length||(e.common.call_stack=e.common.hooks);var t=e.common.call_stack[0];e.common.call_stack.shift(),t.call(this)}},{key:"wpmdb_add_commas",value:function(e){for(var t=(e+="").split("."),i=t[0],n=1<t.length?"."+t[1]:"",o=/(\d+)(\d{3})/;o.test(i);)i=i.replace(o,"$1,$2");return i+n}},{key:"wpmdb_parse_json",value:function(e){var t={};try{t=jQuery.parseJSON(e)}catch(e){return!1}return t}},{key:"wpmdbGetAjaxErrors",value:function(e,t,i,n){var o=!1,a="";if(!1===this.wpmdb_parse_json(i)){o=!0,e=wpmdb_strings.ajax_json_message,t="(#144)";var s=i;i=wpmdb_strings.ajax_json_errors+" "+t,i+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",i+='<div class="migration-php-errors">'+s+"</div>"}return(o||"undefined"!==n)&&(a+="<strong>"+e+"</strong> &mdash; "),o||"undefined"===n||(a+=wpmdb_strings.status+": "+n.status+" "+n.statusText,a+="<br /><br />"+wpmdb_strings.response+":<br />"),o||(i+=" "+t),a+=i}},{key:"preg_quote",value:function(e,t){return String(e).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(t||"")+"-]","g"),"\\$&")}},{key:"table_is",value:function(e,t,i){if((e+t).toLowerCase()===i.toLowerCase())return!0;var n=this.preg_quote(i);return null!==new RegExp(e+"([0-9]+)_"+t,"i").exec(n)}},{key:"subsite_for_table",value:function(e,t){var i=this.preg_quote(t),n=new RegExp(e+"([0-9]+)_","i").exec(i);return null===n?1:n[1]}},{key:"convertKBSizeToHR",value:function(e,t,i,n){var o,a;if(i=i||1e3,t=t||2,(e=parseFloat(e))<1&&e>0)o=[(e*i).toFixed(0),"B"];else if(i>Math.abs(e))o=[e.toFixed(0),"KB"];else{a=["MB","GB","TB","PB","EB","ZB","YB"];var s=-1;do{e/=i,++s}while(Math.abs(e)>=i&&s<a.length-1);o=[Math.round(e*Math.pow(10,t))/Math.pow(10,t),a[s]]}return n||(o=o[0]+" "+o[1]),o}},{key:"convertKBSizeToHRFixed",value:function(e,t,i){t=t||2;var n=this.convertKBSizeToHR(e,t,i,!0);return"MB"==n[1]?n[0].toFixed(2)+" "+n[1]:n[0]+" "+n[1]}},{key:"ajax_handle_dismissible_notice",value:function(e,t,i){jQuery.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:e,notice:jQuery(i).data("notice"),type:jQuery(i).data("type"),reminder:jQuery(i).data("reminder")},beforeSend:t(i)})}},{key:"get_spinner_url",value:function(){var e=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";return 2<window.devicePixelRatio&&(e+="-2x"),e+=".gif"}},{key:"exclude_post_types_warning",value:function(){var e=n("#select-post-types").val(),t="",i=n(".exclude-post-types-warning");e?(t="<code>"+e.join("</code>, <code>")+"</code>",n(".excluded-post-types").html(t),"0"===i.css("opacity")&&i.css({opacity:0}).slideDown(200).animate({opacity:1})):i.css({opacity:0}).slideUp(200).animate({opacity:0})}}]),e}();t.default=r},function(e,t,i){var n=window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});var o=r(i(3)),a=r(i(12)),s=r(i(13));function r(e){return e&&e.__esModule?e:{default:e}}n=window.jQuery;var c=window.ajaxurl,l=window.wpmdb_strings,p=window.wpmdb_data,d=function(){function e(){(0,a.default)(this,e),this.show_ssl_notice=!1,this.doing_save_profile=!1,this.doing_ajax=!1,this.profile_name_edited=!1,this.migration_intent=null,this.doing_licence_registration_ajax=!1,this.migration_paused=!1,this.last_replace_switch=wpmdb.functions.wpmdb_migration_type(),this.connection_established=!1,this.profile_name_edited=!1,this.checked_licence=!1,this.show_prefix_notice=!1,this.show_ssl_notice=!1,this.force_reconnect=!1,this.migration_selection="",this.show_version_notice=!1,this.migration_completed=!1,this.currently_migrating=!1,this.dump_filename="",this.dump_path="",this.migration_intent="",this.remote_site=null,this.secret_key=null,this.form_data=null,this.stage=null,this.elapsed_interval=null,this.completed_msg=null,this.tables_to_migrate=[],this.migration_paused=!1,this.previous_progress_title="",this.previous_progress_text_primary="",this.previous_progress_text_secondary="",this.cancelling_text="",this.paused_text="",this.migration_cancelled=!1,this.flag_skip_delay=!1,this.delay_between_requests=0,this.fade_duration=400,this.pause_before_finalize=!1,this.is_auto_pause_before_finalize=!1,this.$connection_info_box=n(".connection-info-wrapper"),this.$push_select=window.wpmdb.$push_select=n("#select-tables").clone(),this.$pull_select=window.wpmdb.$pull_select=n("#select-tables").clone(),this.$push_post_type_select=n("#select-post-types").clone(),this.$pull_post_type_select=n("#select-post-types").clone(),this.$push_select_backup=n("#select-backup").clone(),this.$pull_select_backup=n("#select-backup").clone(),this.spinner_url=window.spinner_url=wpmdb.functions.get_spinner_url(),this.ajax_spinner=window.ajax_spinner='<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" />'}return(0,s.default)(e,[{key:"pad",value:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e}},{key:"is_int",value:function(e){return"number"==typeof(e=parseInt(e))&&0==e%1}},{key:"get_intersect",value:function(e,t){var i,n,o=[],a={},s=t.length;for(i=0;i<s;i++)a[t[i]]=!0;for(s=e.length,i=0;i<s;i++)(n=e[i])in a&&o.push(n);return o}},{key:"pin_replace_url",value:function(e){!0===e&&1>n(".replace-row.pin").length&&1===n("#old-url").length&&n("#old-url").parents(".replace-row").addClass("pin"),!1===e&&0<n(".replace-row.pin").length&&n(".replace-row.pin").removeClass("pin")}},{key:"get_ajax_errors",value:function(e,t,i){return wpmdb.functions.wpmdbGetAjaxErrors(l.connection_local_server_problem,t,e,i)}},{key:"refresh_debug_log",value:function(){n.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:p.nonces.get_log},error:function(e,t,i){alert(l.update_log_problem)},success:function(e){n(".debug-log-textarea").val(e)}})}},{key:"get_query_var",value:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"maybe_show_ssl_warning",value:function(e,t,i){var o=e.substr(0,e.indexOf(":")),a=n(".ssl-notice");if(this.show_ssl_notice||a.hide(),i!==o&&-1!==e.indexOf("https"))return a.show(),this.show_ssl_notice=!0,e=e.replace("https","http"),void n(".pull-push-connection-info").val(e+"\n"+t);this.show_ssl_notice=!1}},{key:"validate_url",value:function(e){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)}},{key:"refresh_table_selects",value:function(){void 0!==p&&void 0!==p.this_tables&&void 0!==p.this_table_sizes_hr&&(this.$push_select=this.create_table_select(p.this_tables,p.this_table_sizes_hr,n(wpmdb.$push_select).val())),void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.tables&&void 0!==wpmdb.common.connection_data.table_sizes_hr&&(this.$pull_select=this.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,n(wpmdb.$pull_select).val()))}},{key:"save_active_profile",value:function(){var e,t=this;if(n(".save-settings-button").blur(),!this.doing_save_profile&&!0!==this.maybe_show_select_table_notice()){var i=!1;n("#create_new").is(":checked")&&(i=!0);var o=n(".create-new-profile").val();this.doing_save_profile=!0,e=n(n("#migrate-form")[0].elements).not(".auth-credentials").serialize(),n(".save-settings-button").attr("disabled","disabled").after('<img src="'+this.spinner_url+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),this.doing_ajax=!0,n.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:e,nonce:p.nonces.save_profile},error:function(e,i,o){t.doing_ajax=!1,alert(l.save_profile_problem),n(".save-settings-button").removeAttr("disabled"),n(".save-profile-ajax-spinner").remove(),n(".save-settings-button").after('<span class="ajax-success-msg">'+l.saved+"</span>"),n(".ajax-success-msg").fadeOut(2e3,function(){n(this).remove()}),t.doing_save_profile=!1},success:function(e){var a=parseInt(n("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(t.doing_ajax=!1,n(".save-settings-button").removeAttr("disabled"),n(".save-profile-ajax-spinner").remove(),n(".save-settings-button").after('<span class="ajax-success-msg">'+l.saved+"</span>"),n(".ajax-success-msg").fadeOut(2e3,function(){n(this).remove()}),t.doing_save_profile=!1,n(".create-new-profile").val(""),i){var s=parseInt(e,10),r=s+1,c=n('<li><span class="delete-profile" data-profile-id="'+r+'"></span><label for="profile-'+r+'"><input id="profile-'+r+'" value="'+s+'" name="save_migration_profile_option" type="radio"></label></li>');c.find("label").append(document.createTextNode(" "+o)),a=r,n("#create_new").parents("li").before(c),n("#profile-"+r).attr("checked","checked")}var d=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+a,m=n("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(n("#migrate-form .crumbs").length)n("#migrate-form .crumbs .crumb:last").text(m);else{var u=n('<div class="crumbs" />').append('<a class="crumb" href="'+p.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+m+"</span>");n("#migrate-form").prepend(u)}window.history.pushState({updated_profile_id:a},null,d)}}})}}},{key:"cancel_migration",value:function(e){this.migration_cancelled=!0,this.cancelling_text=l.cancelling_migration,n(".migration-controls").css({visibility:"hidden"}),"find_replace"===this.migration_intent&&(this.cancelling_text=l.cancelling_find_replace),wpmdb.current_migration.setState(this.cancelling_text,l.completing_current_request,"cancelling"),!0===this.migration_paused&&(this.migration_paused=!1,wpmdb.functions.execute_next_step())}},{key:"set_checkbox",value:function(e){var t=n("#"+e),i=t.find("input[type=checkbox]");t.toggleClass("on").find("span").toggleClass("checked");var o=t.find("span.on").hasClass("checked");i.attr("checked",o).trigger("change")}},{key:"move_connection_info_box",value:function(){var e,t,i,o,a,s,r=n(".connection-status"),c=n(".directory-permission-notice"),l=n(".compatibility-older-mysql"),d=n(".mst-required"),m=n(".keep-active-plugins"),u=n(".step-two"),_=n(".backup-options"),h=wpmdb.functions.wpmdb_migration_type();if(r.hide(),c.hide(),u.show(),_.show(),m.show(),l.hide(),d.hide(),wpmdb.functions.wpmdb_toggle_migration_action_text(),n(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb.functions.wpmdb_migration_type()),n.wpmdb.do_action("move_connection_info_box",{migration_type:h,last_migration_type:this.last_replace_switch}),-1!==n.inArray(h,["push","pull"])){var g=n(".pull-push-connection-info"),f=n.trim(g.val()).split("\n"),b=n("."+h+"-list li");if(b.append(this.$connection_info_box),this.$connection_info_box.show(function(){var e=n(this).find(".pull-push-connection-info");e.val()||e.focus()}),h!==this.last_replace_switch&&2===f.length)return wpmdb.force_reconnect=!0,b.append(this.$connection_info_box),g.removeClass("temp-disabled").attr("readonly","readonly"),n(".connect-button").hide(),void wpmdb.functions.connection_box_changed();this.connection_established?(r.hide(),u.show(),wpmdb.functions.wpmdb_toggle_migration_action_text(),"pull"===h?(t=wpmdb.common.connection_data.prefix,i=p.site_details.prefix,o=p.this_uploads_dir,a=p.this_upload_dir_long,s=p.write_permission):(t=p.this_prefix,i=wpmdb.common.connection_data.prefix,o=wpmdb.common.connection_data.uploads_dir,a=wpmdb.common.connection_data.upload_dir_long,s=wpmdb.common.connection_data.write_permissions),n(".table_prefix").html(t),n(".backup-table-prefix").html(i),n(".uploads-dir").html(o),this.maybe_show_backup_disabled_msg(a,s),!1===this.profile_name_edited&&(e=this.get_domain_name(wpmdb.common.connection_data.url),n(".create-new-profile").val(e))):(r.show(),u.hide())}else if(-1!==n.inArray(h,["find_replace","savefile"]))if(r.hide(),u.show(),n(".table-prefix").html(p.this_prefix),!1===this.profile_name_edited&&n(".create-new-profile").val(""),m.hide(),"savefile"===h)_.hide(),l.show(),"false"===p.write_permission&&(c.show(),u.hide());else{if("true"===p.is_multisite){var w=n(".old-replace-col").eq(1);w.parent().removeClass("pin").find(".replace-remove-row").show(),w.find("input").removeAttr("readonly")}this.maybe_show_backup_disabled_msg(p.this_upload_dir_long,p.write_permission)}this.maybe_show_mixed_cased_table_name_warning()}},{key:"maybe_show_backup_disabled_msg",value:function(e,t){var i=n("#create-backup"),o=n("#create-backup-label"),a=n(".backup-option-disabled");i.removeAttr("disabled"),o.removeClass("disabled"),a.hide(),"false"===t&&(i.prop("checked",!1),i.attr("disabled","disabled"),o.addClass("disabled"),a.show(),n(".upload-directory-location").html(e))}},{key:"change_replace_values",value:function(){var e=null,t=null;null!==wpmdb.common.previous_connection_data&&"object"===(0,o.default)(wpmdb.common.previous_connection_data)&&wpmdb.common.previous_connection_data.url!==wpmdb.common.connection_data.url&&(e=this.remove_protocol(wpmdb.common.previous_connection_data.url),t=wpmdb.common.previous_connection_data.path),"push"===wpmdb.functions.wpmdb_migration_type()||"savefile"===wpmdb.functions.wpmdb_migration_type()?("pull"===this.last_replace_switch?n(".replace-row").each(function(){var e=n(".old-replace-col input",this).val();n(".old-replace-col input",this).val(n(".replace-right-col input",this).val()),n(".replace-right-col input",this).val(e)}):"push"===this.last_replace_switch&&"push"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&n(".replace-row").each(function(){var i=n(".replace-right-col input",this).val();i===t&&n(".replace-right-col input",this).val(wpmdb.common.connection_data.path),i===e&&n(".replace-right-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),n.wpmdb.do_action("wpmdb_update_push_table_select"),n("#select-post-types").remove(),n(".exclude-post-types-warning").after(this.$push_post_type_select),wpmdb.functions.exclude_post_types_warning(),n("#select-backup").remove(),n(".backup-tables-wrap").prepend(this.$push_select_backup)):"pull"===wpmdb.functions.wpmdb_migration_type()&&(""===this.last_replace_switch||"push"===this.last_replace_switch||"savefile"===this.last_replace_switch?n(".replace-row").each(function(){var e=n(".old-replace-col input",this).val();n(".old-replace-col input",this).val(n(".replace-right-col input",this).val()),n(".replace-right-col input",this).val(e)}):"pull"===this.last_replace_switch&&"pull"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&n(".replace-row").each(function(){var i=n(".old-replace-col input",this).val();i===t&&n(".old-replace-col input",this).val(wpmdb.common.connection_data.path),i===e&&n(".old-replace-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),n.wpmdb.do_action("wpmdb_update_pull_table_select"),n("#select-post-types").remove(),n(".exclude-post-types-warning").after(this.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),n("#select-backup").remove(),n(".backup-tables-wrap").prepend(this.$pull_select_backup)),this.last_replace_switch=wpmdb.functions.wpmdb_migration_type()}},{key:"switch_to_plugin_tab",value:function(e,t){n(".nav-tab").removeClass("nav-tab-active"),n(".nav-tab."+e).addClass("nav-tab-active"),n(".content-tab").hide(),n("."+e+"-tab").show(),"settings"===e&&!0===this.should_check_licence()&&(n("p.licence-status").append("Checking License... ").append(this.ajax_spinner),this.check_licence()),"help"===e&&(this.refresh_debug_log(),!0===this.should_check_licence()&&(n(".support-content p").append(this.ajax_spinner),this.check_licence())),"addons"===e&&!0!==t&&!0===this.should_check_licence()&&(n(".addons-content p").append(this.ajax_spinner),this.check_licence())}},{key:"hide_overlay",value:function(){n("#overlay").removeClass("show").addClass("hide"),n("#overlay > div").removeClass("show").addClass("hide"),wpmdb.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){n("#overlay").remove()},500),this.migration_completed=!1}},{key:"check_licence",value:function(e){var t=!this.doing_licence_registration_ajax;this.checked_licence=!0;var i=this;n.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:e,context:"all",nonce:p.nonces.check_licence},error:function(e,t,i){alert(l.license_check_problem)},success:function(e){var o,a,s,r=n(".support-content"),c=n(".addons-content"),l=n(".licence-status:not(.notification-message)");if(void 0!==e.dbrains_api_down)a=e.dbrains_api_down+e.message,s=e.dbrains_api_down;else if(void 0!==e.errors){if(void 0!==e.errors.subscription_expired)o=e.errors.subscription_expired.licence,a=e.errors.subscription_expired.support,s=e.errors.subscription_expired.addons;else{var p="";for(var d in e.errors)p+=e.errors[d];a=p,s=p}void 0!==e.addon_content&&(s+="\n"+e.addon_content)}else a=e.message,s=e.addon_content;t&&l.stop().fadeOut(i.fade_duration,function(){void 0===o&&(n(this).css({visibility:"hidden",display:"block"}).slideUp(),o=""),n(this).empty().html(o).stop().fadeIn(i.fade_duration)}),r.stop().fadeOut(i.fade_duration,function(){n(this).empty().html(a).stop().fadeIn(i.fade_duration)}),c.stop().fadeOut(i.fade_duration,function(){n(this).empty().html(s).stop().fadeIn(i.fade_duration)}),n("#plugin-compatibility").is(":not(:checked)")&&n("#compatibility-header").click()}})}},{key:"should_check_licence",value:function(){return!1===this.checked_licence&&"1"===p.has_licence&&"true"===p.is_pro}},{key:"maybe_show_mixed_cased_table_name_warning",value:function(){if(void 0!==wpmdb.common.connection_data&&!1!==wpmdb.common.connection_data){var e=wpmdb.functions.wpmdb_migration_type(),t=wpmdb.functions.get_tables_to_migrate(null,null);n(".mixed-case-table-name-notice").hide(),null!==t&&(t=t.join(""))!==t.toLowerCase()&&("1"===wpmdb.common.connection_data.lower_case_table_names||"push"!==e&&"savefile"!==e)&&("1"!==p.lower_case_table_names&&"pull"===e||("push"===e||"savefile"===e?n(".mixed-case-table-name-notice.push").show():n(".mixed-case-table-name-notice.pull").show()))}}},{key:"enable_pro_licence",value:function(e,t){n(".licence-input, .register-licence").remove(),n(".licence-not-entered").prepend(e.masked_licence),n(".support-content").empty().html("<p>"+l.fetching_license+'<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" /></p>'),this.check_licence(t),n(".migrate-selection label").removeClass("disabled"),n(".migrate-selection input").removeAttr("disabled")}},{key:"get_domain_name",value:function(e){return e.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","")}},{key:"update_domain_placeholder",value:function(e,t,i){var n=this.get_domain_name(t);return"completed"===i?e.replace(/\%s\s?/,"<span class=domain-label>"+n+"</span>&nbsp;"):e.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+n+"$1</span>&nbsp;")}},{key:"get_migration_status_label",value:function(e,t,i){var o="",a="";switch(t){case"push":o=l.push_migration_label_migrating,a=l.push_migration_label_completed;break;case"pull":o=l.pull_migration_label_migrating,a=l.pull_migration_label_completed;break;case"find_replace":o=l.find_replace_label_migrating,a=l.find_replace_label_completed;break;case"savefile":o=l.exporting_please_wait,a=l.exporting_complete}var s=o;return"completed"===i&&(s=a),"push"!==t&&"pull"!==t||(s=this.update_domain_placeholder(s,e,i)),s=n.wpmdb.apply_filters("wpmdb_get_migration_status_label",s,{intent:t,stage:i})}},{key:"disable_export_type_controls",value:function(){n(".option-group").each(function(e){n("input",this).attr("disabled","disabled"),n("label",this).css("cursor","default")})}},{key:"enable_export_type_controls",value:function(){n(".option-group").each(function(e){n("input",this).removeAttr("disabled"),n("label",this).css("cursor","pointer")})}},{key:"set_slider_value",value:function(e,t,i,o){var a=t;void 0!==o&&(a=o),n(".slider",e).slider("value",parseInt(t)),n(".amount",e).html(wpmdb.functions.wpmdb_add_commas(a)+" "+i)}},{key:"set_pause_resume_button",value:function(e,t){!0===this.migration_paused?(this.migration_paused=!1,this.doing_ajax=!0,wpmdb.current_migration.setState(this.previous_progress_title,this.previous_progress_text_primary,"active"),n(".pause-resume").html(l.pause),wpmdb.current_migration.resumeTimer(),wpmdb.functions.execute_next_step(t)):(this.migration_paused=!0,this.doing_ajax=!1,this.paused_text=l.migration_paused,this.previous_progress_title=n(".progress-title").html(),this.previous_progress_text_primary=n(".progress-text",".progress-wrapper-primary").html(),this.previous_progress_text_secondary=n(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===this.migration_intent&&(this.paused_text=l.find_replace_paused),wpmdb.current_migration.setState(this.paused_text,l.completing_current_request,null),n("body").off("click",".pause-resume"),n("body").off("click",".cancel"))}},{key:"filter_temp_tables",value:function(e,t){var i=p.this_temp_prefix;return"pull"===wpmdb.functions.wpmdb_migration_type()&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.temp_prefix&&(i=wpmdb.common.connection_data.temp_prefix),i===t.substring(0,i.length)||e}},{key:"get_table_prefix",value:function(e,t){return n(".table-select-wrap .table-prefix").text()}},{key:"lock_replace_url",value:function(e){!0===e?(n('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),n(".replace-row.pin .arrow-col").addClass("disabled")):(n('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),n(".replace-row.pin .arrow-col").removeClass("disabled"))}},{key:"set_connection_data",value:function(e){window.wpmdb.common.previous_connection_data=wpmdb.common.connection_data,window.wpmdb.common.connection_data=e,n.wpmdb.do_action("wpmdb_connection_data_updated",e)}},{key:"get_max_request_display_info",value:function(e){var t={unit:"MB"};return t.amount=(e/1024).toFixed(2),t}},{key:"establish_remote_connection_from_saved_profile",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=n.trim(n(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==e&&"find_replace"!==e&&"import"!==e&&!this.doing_ajax&&p.is_pro){this.doing_ajax=!0,this.disable_export_type_controls(),n(".connection-status").html(l.establishing_remote_connection),n(".connection-status").removeClass("notification-message error-notice migration-error"),n(".connection-status").append(this.ajax_spinner);var i=wpmdb.functions.wpmdb_migration_type(),o=this;n.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:t[0],key:t[1],intent:i,nonce:p.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:p.profile},error:function(e,t,i){n(".connection-status").html(o.get_ajax_errors(e.responseText,"(#102)",e)),n(".connection-status").addClass("notification-message error-notice migration-error"),n(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls()},success:function(e){if(n(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return n(".connection-status").html(e.body),n(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&n(".basic-access-auth-wrapper").show());if(!0!==o.maybe_show_mst_warning(e)){o.maybe_show_ssl_warning(t[0],t[1],e.scheme),wpmdb.functions.maybe_show_prefix_notice(e.prefix),n(".pull-push-connection-info").addClass("temp-disabled"),n(".pull-push-connection-info").attr("readonly","readonly"),n(".connect-button").hide(),n(".connection-status").hide(),n(".step-two").show(),o.connection_established=!0,o.set_connection_data(e),o.move_connection_info_box(),o.maybe_show_mixed_cased_table_name_warning();var i="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(i=wpmdb_loaded_tables),o.$pull_select=wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,i);var a="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&(void 0!==e.select_post_types?(n("#exclude-post-types").attr("checked","checked"),n(".post-type-select-wrap").show(),a=e.select_post_types):a=wpmdb_loaded_post_types);var s=document.createElement("select");n(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),n.each(wpmdb.common.connection_data.post_types,function(e,t){var i=n.inArray(t,a);i=-1!==i||!0===wpmdb_convert_exclude_revisions&&"revision"!==t?' selected="selected" ':" ",n(s).append("<option"+i+'value="'+t+'">'+t+"</option>")}),o.$pull_post_type_select=s;var r="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(r=wpmdb_loaded_tables_backup);var c=document.createElement("select");n(c).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup",class:"multiselect"}),n.each(wpmdb.common.connection_data.tables,function(e,t){var i=n.inArray(t,r);i=-1!==i?' selected="selected" ':" ",n(c).append("<option"+i+'value="'+t+'">'+t+" ("+wpmdb.common.connection_data.table_sizes_hr[t]+")</option>")}),o.$push_select_backup=c,"pull"===wpmdb.functions.wpmdb_migration_type()?(n.wpmdb.do_action("wpmdb_update_pull_table_select"),n("#select-post-types").remove(),n(".exclude-post-types-warning").after(o.$pull_post_type_select),n("#select-backup").remove(),n(".backup-tables-wrap").prepend(o.$pull_select_backup),n(".table-prefix").html(e.prefix),n(".uploads-dir").html(p.this_uploads_dir)):(n("#select-backup").remove(),n(".backup-tables-wrap").prepend(o.$push_select_backup)),n.wpmdb.do_action("verify_connection_to_remote_site",wpmdb.common.connection_data)}else n(".connection-status").hide()}})}}},{key:"migrate_table_recursive",value:function(e,t,i){var o=this,a=i||0;if(a>=this.tables_to_migrate.length)if("upload"===this.stage&&wpmdb.current_migration.model.getStageItems("find_replace").length)this.stage="find_replace",this.tables_to_migrate=wpmdb.current_migration.model.getStageItems("find_replace","name"),this.tables_to_migrate=this.tables_to_migrate.map(function(e){return"_mig_"+e}),a=0;else{if("backup"!==this.stage)return n(".progress-label").removeClass("label-visible"),wpmdb.common.hooks=n.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete),wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush),wpmdb.common.hooks=n.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},void wpmdb.functions.execute_next_step();if(-1!==n.inArray(this.migration_intent,["push","pull"])?this.stage="migrate":"import"===this.migration_intent?this.stage="upload":this.stage=this.migration_intent,wpmdb.current_migration.model.setActiveStage(this.stage),"find_replace"!==this.stage&&"migrate"!==this.stage)return void wpmdb.functions.wpmdb_call_next_hook();a=0,this.tables_to_migrate=wpmdb.functions.get_tables_to_migrate(null,null)}var s=0;a===this.tables_to_migrate.length-1&&(s=1);var r=0;-1!==n.inArray(this.migration_intent,["push","pull"])&&1===parseInt(wpmdb.common.connection_data.gzip)&&(r=1);var d={action:"wpmdb_migrate_table",migration_state_id:wpmdb.migration_state_id,table:this.tables_to_migrate[a],stage:this.stage,current_row:e,last_table:s,primary_keys:t,gzip:r,nonce:p.nonces.migrate_table};-1!==n.inArray(this.migration_intent,["push","pull"])&&(d.bottleneck=wpmdb.common.connection_data.bottleneck,d.prefix=wpmdb.common.connection_data.prefix),wpmdb.common.connection_data&&wpmdb.common.connection_data.path_current_site&&wpmdb.common.connection_data.domain&&(d.path_current_site=wpmdb.common.connection_data.path_current_site,d.domain_current_site=wpmdb.common.connection_data.domain),this.doing_ajax=!0,n.ajax({url:c,type:"POST",dataType:"text",cache:!1,timeout:0,data:d,error:function(e,t,i){var n=l.table_process_problem+" "+o.tables_to_migrate[a]+"<br /><br />"+l.status+": "+e.status+" "+e.statusText+"<br /><br />"+l.response+":<br />"+e.responseText;wpmdb.current_migration.setState(l.migration_failed,n,"error"),o.doing_ajax=!1,console.log(e),console.log(t),console.log(i),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(e){o.doing_ajax=!1,e=n.trim(e);var t=wpmdb.functions.wpmdb_parse_json(e),i="";if(!1===t||null===t)return i=""===e||null===e?l.table_process_problem_empty_response+" "+o.tables_to_migrate[a]:o.get_ajax_errors(e,null,null),wpmdb.current_migration.setState(l.migration_failed,i,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();if(void 0!==t.wpmdb_error&&1===t.wpmdb_error)return wpmdb.current_migration.setState(l.migration_failed,t.body,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();var r=o.tables_to_migrate[a];"import"===o.migration_intent&&"find_replace"===o.stage&&(r=r.replace(p.this_temp_prefix,"")),wpmdb.current_migration.setText(),wpmdb.current_migration.model.getStageModel(o.stage).setItemRowsTransferred(r,t.current_row),1===s&&"savefile"===o.migration_intent&&(void 0!==t.dump_filename&&(o.dump_filename=t.dump_filename),void 0!==t.dump_path&&(o.dump_path=t.dump_path)),-1===parseInt(t.current_row)&&(a++,t.current_row="",t.primary_keys=""),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.migrate_table_recursive,args:[t.current_row,t.primary_keys,a]},wpmdb.functions.execute_next_step()}})}},{key:"migration_complete_events",value:function(){if(!1===wpmdb.common.migration_error)if(""===wpmdb.common.non_fatal_errors)if("savefile"!==this.migration_intent&&!0===n("#save_computer").is(":checked")&&wpmdb.current_migration.setText(),this.completed_msg=this.completed_msg+'&nbsp;<div class="dashicons dashicons-yes"></div>',!0===this.migration_cancelled){var e=l.migration_cancelled_success;"find_replace"===this.migration_intent&&(e=l.find_replace_cancelled_success),wpmdb.current_migration.setState(this.completed_msg,e,"cancelled")}else wpmdb.current_migration.setState(this.completed_msg,"","complete");else wpmdb.current_migration.setState(l.completed_with_some_errors,wpmdb.common.non_fatal_errors,"error");n(".migration-controls").addClass("hidden"),wpmdb.common.hooks=[],wpmdb.common.call_stack=[],wpmdb.common.migration_error=!1,this.currently_migrating=!1,this.migration_completed=!0,this.migration_paused=!1,this.migration_cancelled=!1,this.doing_ajax=!1,wpmdb.common.non_fatal_errors="",this.tables_to_migrate=[],n(".progress-label").remove(),n(".migration-progress-ajax-spinner").remove(),n(".close-progress-content").show(),n("#overlay").css("cursor","pointer"),wpmdb.current_migration.model.setMigrationComplete()}},{key:"migration_complete",value:function(){var e=this;if(n(".migration-controls").addClass("hidden"),"savefile"===this.migration_intent){this.currently_migrating=!1;var t=l.migration_complete;if(n("#save_computer").is(":checked")){var i=p.this_download_url+encodeURIComponent(this.dump_filename);n("#gzip_file").is(":checked")&&(i+="&gzip=1"),window.location=i}else t=l.completed_dump_located_at+" "+this.dump_path;!1===wpmdb.common.migration_error&&(wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setState(this.completed_msg,t,"complete"))}else{wpmdb.current_migration.setState(null,l.finalizing_migration,"finalizing");var o={action:"wpmdb_finalize_migration",migration_state_id:wpmdb.migration_state_id,tables:this.tables_to_migrate.join(","),nonce:p.nonces.finalize_migration};-1!==n.inArray(this.migration_intent,["push","pull"])&&(o.prefix=wpmdb.common.connection_data.prefix),this.doing_ajax=!0,n.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:o,error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(l.migration_failed,l.finalize_tables_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==n.trim(t))return wpmdb.current_migration.setState(l.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}})}}},{key:"wpmdb_flush",value:function(){var e=this;"savefile"!==this.migration_intent&&(wpmdb.current_migration.setText(l.flushing),this.doing_ajax=!0,n.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:wpmdb.migration_state_id,nonce:p.nonces.flush},error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(l.migration_failed,l.flush_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==n.trim(t))return wpmdb.current_migration.setState(l.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}}))}},{key:"execute_next_step",value:function(){var e=this;if(0<this.delay_between_requests&&!1===this.flag_skip_delay)setTimeout(function(){this.flag_skip_delay=!0,wpmdb.functions.execute_next_step()},this.delay_between_requests);else if(this.flag_skip_delay=!1,!0===this.migration_paused){n(".migration-progress-ajax-spinner").hide(),wpmdb.current_migration.pauseTimer();var t="";!0===this.is_auto_pause_before_finalize?(t=l.paused_before_finalize,this.is_auto_pause_before_finalize=!1,"find_replace"===wpmdb.functions.wpmdb_migration_type()&&(t=l.find_replace_paused_before_finalize)):t=l.paused,wpmdb.current_migration.setState(null,t,"paused"),n("body").on("click",".pause-resume",function(e){this.set_pause_resume_button(e)}),n("body").on("click",".cancel",function(e){this.cancel_migration(e)}),n(".pause-resume").html(l.resume)}else if(!0===this.migration_cancelled){var i;this.migration_intent=wpmdb.functions.wpmdb_migration_type(),"savefile"===this.migration_intent?i=l.removing_local_sql:"pull"===this.migration_intent?i="backup"===this.stage?l.removing_local_backup:l.removing_local_temp_tables:"push"===this.migration_intent&&(i="backup"===this.stage?l.removing_remote_sql:l.removing_remote_temp_tables),wpmdb.current_migration.setText(i);var o={action:"wpmdb_cancel_migration",migration_state_id:wpmdb.migration_state_id,nonce:p.nonces.cancel_migration};this.doing_ajax=!0,n.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:o,error:function(t,i,n){wpmdb.current_migration.setState(l.migration_cancellation_failed,l.manually_remove_temp_files+"<br /><br />"+l.status+": "+t.status+" "+t.statusText+"<br /><br />"+l.response+":<br />"+t.responseText,"error"),console.log(t),console.log(i),console.log(n),e.doing_ajax=!1,wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,t=n.trim(t),"push"===e.migration_intent&&"1"!==t||"push"!==e.migration_intent&&""!==t)return void 0!==t&&void 0!==t.wpmdb_error&&1===t.wpmdb_error&&(t=t.wpmdb_error),wpmdb.current_migration.setState(l.migration_cancellation_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();e.completed_msg=l.migration_cancelled,"find_replace"===e.migration_intent&&(e.completed_msg=l.find_replace_cancelled),wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setStatus("cancelled")}})}else wpmdb.common.next_step_in_migration.fn.apply(null,wpmdb.common.next_step_in_migration.args)}},{key:"maybe_show_prefix_notice",value:function(e){var t=n(".prefix-notice");t.hide(),e!==p.this_prefix&&(n(".remote-prefix").html(e),this.show_prefix_notice=!0,t.show())}},{key:"maybe_show_mst_warning",value:function(e){var t=wpmdb.functions.wpmdb_migration_type(),i=!1;return-1!==n.inArray(t,["push","pull"])&&void 0!==e.site_details?p.site_details.is_multisite!==e.site_details.is_multisite&&(void 0!==wpmdb.mst&&void 0!==e.mst_available&&"1"===e.mst_available||(i=!0)):"import"===t&&void 0!==e.multisite&&void 0!==e.subsite_export&&("false"===p.site_details.is_multisite&&"true"===e.multisite&&"true"!==e.subsite_export||"true"===p.site_details.is_multisite&&"false"===e.multisite)&&(i=!0),(i=n.wpmdb.apply_filters("wpmdb_show_mst_warning",i))&&n(".mst-required").show(),i}},{key:"maybe_show_select_table_notice",value:function(){if(n("#migrate-selected").is(":checked")&&null===n("#select-tables").val()){if("import"!==wpmdb.functions.wpmdb_migration_type())return alert(l.please_select_one_table),!0;if(n("#import-find-replace").is(":checked")&&n("#select-tables").is(":visible"))return alert(l.please_select_one_table_import),!0}return!("savefile"===wpmdb.functions.wpmdb_migration_type()||!n("#backup-manual-select").is(":checked")||null!==n("#select-backup").val())&&(alert(l.please_select_one_table_backup),!0)}},{key:"remove_protocol",value:function(e){return e.replace(/^https?:/i,"")}},{key:"create_table_select",value:function(e,t,i){var o=document.createElement("select");return n(o).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<e.length&&n.each(e,function(e,a){if(!n.wpmdb.apply_filters("wpmdb_exclude_table",!1,a)){var s=" ";void 0!==i&&null!==i&&0<i.length&&-1!==n.inArray(a,i)&&(s=' selected="selected" ');var r="";0!==t.length&&(r=" ("+t[a]+")"),n(o).append("<option"+s+'value="'+a+'">'+a+r+"</option>")}}),o}},{key:"get_tables_to_migrate",value:function(){var e=[],t=wpmdb.functions.wpmdb_migration_type();return"migrate_select"===n("input[name=table_migrate_option]:checked").val()?e=n("#select-tables").val():"pull"!==t&&void 0!==p.this_prefixed_tables?e=p.this_prefixed_tables:"pull"===t&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.prefixed_tables&&(e=wpmdb.common.connection_data.prefixed_tables),e}},{key:"update_migrate_button_text",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=n("#save-migration-profile").is(":checked")?"_save":"",i="migrate_button_"+("savefile"===e?"export":e)+t;n(".migrate-db .button-primary").val(l[i])}},{key:"connection_box_changed",value:function(){var e=this,t=n(".pull-push-connection-info");if(-1!==n.inArray(wpmdb.functions.wpmdb_migration_type(),["push","pull"])&&(!this.doing_ajax&&!n(t).hasClass("temp-disabled")||!1!==wpmdb.force_reconnect)){wpmdb.force_reconnect=!1;var i=n(".pull-push-connection-info").val(),o=n.trim(i).split("\n"),a=!1,s="";if(""===o&&(a=!0,s=l.connection_info_missing),1===o.length&&!a){var r=n.trim(i).split(" ");2===r.length&&(o=r)}2===o.length||a||(a=!0,s=l.connection_info_incorrect),a||this.validate_url(o[0])||(a=!0,s=l.connection_info_url_invalid);var d=0;if(void 0!==o[1]&&(d=o[1].length),a||32===d||40===d||(a=!0,s=l.connection_info_key_invalid),a||o[0]!==p.connection_info[0]||(a=!0,s=l.connection_info_local_url),a||o[1]!==p.connection_info[1]||(a=!0,s=l.connection_info_local_key),a)return n(".connection-status").html(s),void n(".connection-status").addClass("notification-message error-notice migration-error");var m=o[0]+"\n"+o[1];1===n.trim(i).split("\n").length&&n(".pull-push-connection-info").val(m),!1===p.openssl_available&&(o[0]=o[0].replace("https://","http://"),m=o[0]+"\n"+o[1],n(".pull-push-connection-info").val(m)),this.show_prefix_notice=!1,this.doing_ajax=!0,this.disable_export_type_controls(),n(".basic-access-auth-wrapper").is(":visible")&&(o[0]=o[0].replace(/\/\/(.*)@/,"//"),o[0]=o[0].replace("//","//"+encodeURIComponent(n.trim(n(".auth-username").val()))+":"+encodeURIComponent(n.trim(n(".auth-password").val()))+"@"),m=o[0]+"\n"+o[1],n(".pull-push-connection-info").val(m),n(".basic-access-auth-wrapper").hide()),n(".step-two").hide(),n(".ssl-notice").hide(),n(".prefix-notice").hide(),n(".connection-status").show(),n(".connection-status").html(l.establishing_remote_connection),n(".connection-status").removeClass("notification-message error-notice migration-error"),n(".connection-status").append(this.ajax_spinner);var u=wpmdb.functions.wpmdb_migration_type();return this.profile_name_edited=!1,n.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:o[0],key:o[1],intent:u,nonce:p.nonces.verify_connection_to_remote_site},error:function(t,i,o){n(".connection-status").html(e.get_ajax_errors(t.responseText,"(#100)",t)),n(".connection-status").addClass("notification-message error-notice migration-error"),n(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls()},success:function(t){if(n(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls(),void 0!==t.wpmdb_error&&1===t.wpmdb_error)return n(".connection-status").html(t.body),n(".connection-status").addClass("notification-message error-notice migration-error"),t.body.indexOf("401 Unauthorized")>-1&&n(".basic-access-auth-wrapper").show(),void(n(".pull-push-connection-info").hasClass("temp-disabled")||n(".connect-button").is(":visible")||(n(".pull-push-connection-info").removeAttr("readonly"),n(".connect-button").show()));if(!0!==e.maybe_show_mst_warning(t)){e.maybe_show_ssl_warning(o[0],o[1],t.scheme);var i=e.get_domain_name(t.url);n(".create-new-profile").val(i),n(".pull-push-connection-info").addClass("temp-disabled"),n(".pull-push-connection-info").attr("readonly","readonly"),n(".connect-button").hide(),n(".connection-status").hide(),n(".step-two").show(),wpmdb.functions.maybe_show_prefix_notice(t.prefix),e.connection_established=!0,e.set_connection_data(t),e.move_connection_info_box(),e.change_replace_values(),e.maybe_show_mixed_cased_table_name_warning(),e.refresh_table_selects(null,null,e),e.$push_select_backup=n(e.$pull_select).clone(),n(e.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var a=document.createElement("select");n(a).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),n.each(wpmdb.common.connection_data.post_types,function(e,t){n(a).append('<option value="'+t+'">'+t+"</option>")}),e.$pull_post_type_select=a,n("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb.functions.wpmdb_migration_type()?(n("#new-url").val(e.remove_protocol(p.this_url)),n("#new-path").val(p.this_path),"true"===p.is_multisite&&(n("#new-domain").val(p.this_domain),n('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(t.url))),n("#old-url").val(e.remove_protocol(t.url)),n("#old-path").val(t.path),n.wpmdb.do_action("wpmdb_update_pull_table_select"),n("#select-post-types").remove(),n(".exclude-post-types-warning").after(e.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),n(".table-prefix").html(t.prefix),n(".backup-table-prefix").html(p.site_details.prefix),n(".uploads-dir").html(p.this_uploads_dir)):(n("#new-url").val(e.remove_protocol(t.url)),n("#new-path").val(t.path),"true"===p.is_multisite&&n('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(p.this_url)),n.wpmdb.do_action("wpmdb_update_push_table_select"),n("#select-backup").remove(),n(".backup-tables-wrap").prepend(e.$push_select_backup)),wpmdb.common.next_step_in_migration={fn:n.wpmdb.do_action,args:["verify_connection_to_remote_site",wpmdb.common.connection_data]},wpmdb.functions.execute_next_step()}else n(".connection-status").hide()}})}}}]),e}();t.default=d},function(e,t){window.jQuery;jQuery.wpmdb={hooks:{action:{},filter:{}},add_action:function(e,t,i,n){jQuery.wpmdb.add_hook("action",e,t,i,n)},add_filter:function(e,t,i,n){jQuery.wpmdb.add_hook("filter",e,t,i,n)},do_action:function(e,t){jQuery.wpmdb.do_hook("action",e,null,t)},apply_filters:function(e,t,i){return jQuery.wpmdb.do_hook("filter",e,t,i)},remove_action:function(e,t){jQuery.wpmdb.remove_hook("action",e,t)},remove_filter:function(e,t){jQuery.wpmdb.remove_hook("filter",e,t)},add_hook:function(e,t,i,n,o){void 0===jQuery.wpmdb.hooks[e][t]&&(jQuery.wpmdb.hooks[e][t]=[]);var a=jQuery.wpmdb.hooks[e][t];void 0===n&&(n=t+"_"+a.length),jQuery.wpmdb.hooks[e][t].push({tag:n,callable:i,instance:o})},do_hook:function(e,t,i,n){if(void 0!==jQuery.wpmdb.hooks[e][t])for(var o=jQuery.wpmdb.hooks[e][t],a=0;a<o.length;a++)"action"===e?o[a].callable.call(o[a].instance,n,o[a].instance):i=o[a].callable.call(o[a].instance,i,n,o[a].instance);if("filter"===e)return i},remove_hook:function(e,t,i){if(void 0!==jQuery.wpmdb.hooks[e][t])for(var n=jQuery.wpmdb.hooks[e][t],o=n.length-1;0<o;o--)void 0!==i&&i!==n[o].tag||n.splice(o,1)}}},function(e,t){window.jQuery;!function(e,t){var i=!1,n=e("#select-tables").clone(),o=[],a=[],s=!1,r="",c={},l='<img src="'+t.functions.get_spinner_url()+'" alt="" class="ajax-spinner general-spinner" />';function p(){var t=e(".find-replace-rows");return e("#import-find-replace").is(":checked")?t.show():t.hide()}e.wpmdb.add_filter("wpmdb_get_migration_status_label",function(e,t){return"import"===t.intent&&(e="completed"===t.stage?wpmdb_strings.import_label_completed:wpmdb_strings.import_label_migrating),e}),e.wpmdb.add_action("move_connection_info_box",function(t){var n=e(".import-file-status");"import"===t.migration_type?(i?s&&e(".unrecognized-import-file-notice").show():(e(".step-two").hide(),n.hasClass("profile-loaded")?(n.attr("class","import-file-status profile-loaded notification-message success-notice"),n.html(wpmdb_strings.import_profile_loaded)):n.html(wpmdb_strings.please_select_sql_file),n.show()),p(),e(".mst-options").hide(),e(".import-find-replace-option, .import-active-plugin-option").show()):(e('.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]').show(),e(".import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice").hide(),"search_all_imported"===e("input[name=table_migrate_option]:checked").val()&&e("input[name=table_migrate_option][value=migrate_only_with_prefix]").prop("checked",!0))}),e.wpmdb.add_action("wpmdb_migration_initiated",function(e){"import"===t.functions.wpmdb_migration_type()&&("backup"===e&&t.common.hooks.push(t.functions.migrate_table_recursive),t.common.hooks.push(t.functions.upload_file_recursive),t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step())}),e.wpmdb.add_action("wpmdb_update_import_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(n),e("#select-tables").change()}),e.wpmdb.add_filter("wpmdb_backup_selected_tables",function(e){return"import"===t.functions.wpmdb_migration_type()&&(e=a),e}),e.wpmdb.add_action("wpmdb_add_migration_stages",function(i){"import"===t.functions.wpmdb_migration_type()&&(t.current_migration.model.addStage("upload",[],"local",{strings:{stage_title:wpmdb_strings.upload}}),t.current_migration.model.addStage("import",[],"local",{strings:{stage_title:wpmdb_strings.migrate_button_import}}),e("#import-find-replace").is(":checked")&&(o=i.tables_to_migrate,t.current_migration.model.addStage("find_replace",[],"local",{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}})))}),e.wpmdb.add_filter("wpmdb_initiate_migration_request_data",function(e){return"import"===t.functions.wpmdb_migration_type()&&(e.import_info=c),e}),e("#import-file").on("change",function(o){var d=o.target.files,m=d[0],u=new FileReader,_=e(".import-file-status"),h=e('label[for="backup-selected"]'),g=e(".prefix-notice"),f=e(".unrecognized-import-file-notice"),b=e(".step-two"),w=e("#old-url"),v=e("#old-path"),y=e("#new-url"),x=e("#new-path");if(_.hide().attr("class","import-file-status"),g.hide(),f.hide(),b.hide(),e(".mst-required ").hide(),d.length){if(".sql"!==m.name.slice(-4)&&".sql.gz"!==m.name.slice(-7))return _.addClass("notification-message error-notice migration-error").text(wpmdb_strings.invalid_sql_file).show(),void b.hide();i=!0,r="",_.text(wpmdb_strings.parsing_sql_file).append(l).show(),u.onloadend=function(i){i.target.readyState===FileReader.DONE&&e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_get_import_info",file_data:i.target.result,nonce:wpmdb_data.nonces.import_file},error:function(e,t,i){console.log(e,t,i)},success:function(i){if(e(".ajax-spinner").remove(),_.hide(),!0!==t.functions.maybe_show_mst_warning(i))if(b.show(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)_.text(i.body).addClass("notification-message error-notice migration-error").show(),b.hide();else{var o=t.functions.get_localStorage_form_data();if(c=i,void 0!==i.prefix&&(r=i.prefix,e(".table-prefix").text(i.prefix),t.functions.maybe_show_prefix_notice(i.prefix)),void 0!==i.tables){a=i.tables,h.show(),o||(w.val(t.functions.remove_protocol(i.URL)),v.val(i.path),y.val(t.functions.remove_protocol(wpmdb_data.this_url)),x.val(wpmdb_data.this_path));var l=[],d=[];if(o?(l=o.select_tables,d=o.select_post_types,t.functions.remove_localStorage_form_data()):"migrate_only_with_prefix"!==e("input[name=table_migrate_option]:checked").val()||_.hasClass("profile-loaded")||e("input[name=table_migrate_option][value=search_all_imported]").prop("checked",!0),!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(l=wpmdb_loaded_tables,d=wpmdb_loaded_post_types),n=t.functions.create_table_select(i.tables,[],l),e.wpmdb.do_action("wpmdb_update_import_table_select"),void 0!==i.post_types){var m=document.createElement("select");e(m).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),e.each(i.post_types,function(t,i){var n=e.inArray(i,d);n=-1!==n||!0===wpmdb_convert_exclude_revisions&&"revision"!==i;var o=document.createElement("option");o.value=i,o.text=i,o.selected=n,m.add(o,null)}),e("#select-post-types").remove(),e(".exclude-post-types-warning").after(m)}s&&(s=!1,p())}else f.show(),h.hide(),e(".table-options").hide(),s=!0,y.val(w.val()),x.val(v.val()),w.val(""),v.val("")}}})};var k=m.slice(0,1024e3);u.readAsDataURL(k)}else i&&(b.hide(),_.text(wpmdb_strings.please_select_sql_file).show(),i=!1)}),e("#import-find-replace").on("click",p),e(".find-replace-options-toggle").on("click",function(){s&&setTimeout(function(){e(".find-replace-options-toggle .expand-collapse-arrow").hasClass("collapsed")||e(".table-options").hide()},1)}),e("input[name=keep_active_plugins]").on("click",function(){e("input[name=keep_active_plugins]").prop("checked",e(this).is(":checked"))}),t.functions.upload_file_recursive=function(i){i=void 0===i?0:i;var n=document.getElementById("import-file").files[0],o=i+1024e3+1,a=new FileReader;0===i&&t.current_migration.model.addStageItem("upload",n.name,n.size/1e3,Math.ceil(n.size/1024e3)),a.onloadend=function(a){a.target.readyState===FileReader.DONE&&e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_upload_file",file_data:a.target.result,file:n.name,file_type:n.type,migration_state_id:t.migration_state_id,stage:"import",import_info:c,nonce:wpmdb_data.nonces.import_file},error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(e){if(t.current_migration.setText(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error");var a=i+1024e3;t.current_migration.setText(wpmdb_strings.uploading_file_to_server),t.current_migration.model.getStageModel("upload").setItemRowsTransferred(n.name,Math.ceil(a/1024e3)),o<n.size?t.common.next_step_in_migration={fn:t.functions.upload_file_recursive,args:[o]}:t.common.next_step_in_migration={fn:t.functions.upload_import_successful,args:[n]},t.functions.execute_next_step()}})};var s=n.slice(i,o);a.readAsDataURL(s)},t.functions.upload_import_successful=function(i){e.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_prepare_import_file",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(e){var n=i.name,o=wpmdb_strings.importing_file_to_db;".gz"===n.slice(-3)&&(n=i.name.slice(0,-3)),o=o.replace(/\%s\s?/,n),t.current_migration.setText(o),t.current_migration.model.addStageItem("import",n,e.import_size/1e3,e.num_chunks),t.current_migration.model.setActiveStage("import"),t.common.next_step_in_migration={fn:t.functions.import_file_recursive,args:[{import_filename:e.import_file,item_name:n,chunk:0,current_query:""}]},t.functions.execute_next_step()}})},t.functions.import_file_recursive=function(i){e.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_import_file",migration_state_id:t.migration_state_id,chunk:i.chunk,current_query:i.current_query,import_file:i.import_filename,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(n){if(void 0!==n.wpmdb_error&&1===n.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,n.body,"error");if(t.current_migration.model.getStageModel("import").setItemRowsTransferred(i.item_name,n.chunk),n.chunk>=n.num_chunks){if(t.current_migration.model.getStageModel("import").setItemRowsTransferred(i.item_name,++n.chunk),e("#import-find-replace").is(":checked")){if(s)e.each(n.table_sizes,function(e,i){if(e.startsWith(wpmdb_data.this_temp_prefix)&&wpmdb_data.alter_table_name!==e){var o=e.replace(wpmdb_data.this_temp_prefix,"");t.current_migration.model.addStageItem("find_replace",o,n.table_sizes[e],n.table_rows[e])}});else{var c=e("input[name=table_migrate_option]:checked").val();"migrate_only_with_prefix"===c?o=a.filter(function(e){return r===e.substring(0,r.length)}):"search_all_imported"===c&&(o=a),e.each(o,function(e,i){var o=wpmdb_data.this_temp_prefix+i;n.table_sizes.hasOwnProperty(o)&&t.current_migration.model.addStageItem("find_replace",i,n.table_sizes[o],n.table_rows[o])})}o=[],t.current_migration.model.setActiveStage("find_replace");var l=t.functions.get_tables_to_migrate();return t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:["-1","",l.length]},void t.functions.execute_next_step()}e(".progress-label").removeClass("label-visible"),t.common.hooks=e.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete),t.common.hooks.push(t.functions.wpmdb_flush),t.common.hooks=e.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete_events),t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook}}else t.common.next_step_in_migration={fn:t.functions.import_file_recursive,args:[{import_filename:i.import_filename,item_name:i.item_name,chunk:n.chunk,current_query:n.current_query}]};t.functions.execute_next_step()}})},t.functions.get_tables_to_import=function(){return a}}(jQuery,wpmdb)},function(e,t){window.jQuery;!function(e,t){e(document).ready(function(){t.functions.localStorage_available=function(){try{return localStorage.setItem("wpmdb_test","wpmdb_test"),localStorage.removeItem("wpmdb_test","wpmdb_test"),!0}catch(e){return!1}},t.functions.maybe_reload_page=function(){var i=t.functions.wpmdb_migration_type();if(t.functions.localStorage_available()&&"cancelled"!==t.current_migration.status&&!0!==t.common.migration_error&&!e(".progress-overlay-container").hasClass("wpmdb-error")&&-1!==e.inArray(i,["pull","import","find_replace"])&&("true"!==wpmdb_data.is_multisite||!e("#mst-select-subsite").is(":checked")||wpmdb_data.this_domain===e("#mst-selected-subsite option:selected").text())){var n=t.functions.get_tables_to_migrate();"import"===i&&(n=t.functions.get_tables_to_import()),-1===e.inArray(wpmdb_data.this_prefix+"options",n)&&-1===e.inArray(wpmdb_data.this_prefix+"usermeta",n)||(t.functions.set_localStorage_form_data(),location.reload())}},t.functions.set_localStorage_form_data=function(){var t={};e.each(e("#migrate-form").serializeArray(),function(e,i){if("[]"===i.name.substr(-2)){var n=i.name.slice(0,-2);void 0===t[n]&&(t[n]=[]),t[n].push(i.value)}else t[i.name]=i.value}),localStorage.setItem("wpmdb_migrate_form",JSON.stringify(t))},t.functions.get_localStorage_form_data=function(){var e=localStorage.getItem("wpmdb_migrate_form");if(null===e)return!1;try{e=JSON.parse(e)}catch(e){return!1}return e},t.functions.remove_localStorage_form_data=function(){localStorage.removeItem("wpmdb_migrate_form")},t.functions.load_data_from_localStorage=function(){var i=t.functions.get_localStorage_form_data();i&&(e.each(i,function(i,n){var o=e('[name="'+i+'"]'),a=o.attr("type");"action"===i?(t.migration_selection=n,e("#"+n).prop("checked",!0)):"radio"===a?e('[name="'+i+'"][value="'+n+'"]').prop("checked",!0):"checkbox"===a?(o.prop("checked",!0),o.parent().hasClass("checkbox-label")&&o.parent().next().show()):o.val(n)}),e(".option-group input[type=radio]").change(),e("."+t.migration_selection+"-list ul").show(),e.when(t.functions.connection_box_changed()).done(function(){if("migrate_select"===e("input[name=table_migrate_option]:checked").val()?(void 0!==i.select_tables&&e("#select-tables").val(i.select_tables),e(".table-options .expandable-content, .select-tables-wrap").show(),e(".table-options .expand-collapse-arrow").removeClass("collapsed")):e(".select-tables-wrap").hide(),"backup_manual_select"===e("input[name=backup_option]:checked").val()&&(void 0!==i.select_backup&&e("#select-backup").val(i.select_backup),e(".backup-tables-wrap").show()),void 0!==i.select_post_types&&(e("#select-post-types").val(i.select_post_types),t.functions.exclude_post_types_warning()),void 0!==i.replace_old){e(".replace-row").not(".original-repeatable-field").remove();var n=1;e.each(i.replace_old,function(t,o){e(".replace-row:nth-child("+n+")").length||e(".replace-row").last().after(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),e(".replace-row:nth-child("+n+') [name="replace_old[]"]').val(o),e(".replace-row:nth-child("+n+') [name="replace_new[]"]').val(i.replace_new[t]),n++})}}),t.functions.update_migrate_button_text(),"import"!==t.functions.wpmdb_migration_type()&&t.functions.remove_localStorage_form_data())},t.functions.load_data_from_localStorage()})}(jQuery,wpmdb)},function(e,t,i){var n=window.jQuery,o=function(e){return e&&e.__esModule?e:{default:e}}(i(3));n=jQuery;var a=i(53),s=i(55),r=n('<div id="overlay" class="hide"></div>'),c=n(".progress-content").clone().addClass("hide"),l=n(".pro-version").addClass("hide");r.append(l);var p={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,timerStart:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(e){this.$progress.find(".progress-title").html(e),this.title=e},setStatus:function(e){this.$progress.removeClass(this.status).addClass("error"===e?"wpmdb-error":e),"error"===e&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=e,this.updateTitleElem()},setText:function(e){"string"!=typeof e&&(e=""),0>=e.indexOf("wpmdb_error")&&(e=this.decodeErrorObject(e)),this.$progress.find(".progress-text").html(e),this.text=e},setState:function(e,t,i){null!==e&&this.setTitle(e),null!==t&&this.setText(t),null!==i&&this.setStatus(i)},startTimer:function(){this.timerStart=Date.now(),this.timerCount=0,this.counterDisplay=n(".timer"),this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},getTimerCountInSeconds:function(){return Math.floor((Date.now()-this.timerStart)/1e3)},pauseTimer:function(){this.pausedAt=Date.now(),clearInterval(this.elapsedInterval)},resumeTimer:function(){this.timerStart+=Date.now()-this.pausedAt,this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},incrementTimer:function(){this.timerCount=this.getTimerCountInSeconds(),this.displayCount()},displayCount:function(){var e=Math.floor(this.timerCount/3600)%24,t=Math.floor(this.timerCount/60)%60,i=this.timerCount%60,n=this.pad(e,2,0)+":"+this.pad(t,2,0)+":"+this.pad(i,2,0);this.counterDisplay.html(n)},updateTitleElem:function(){var e=this.model.get("activeStageName"),t=this.model.getStageModel(e),i=Math.max(0,t.getTotalProgressPercent()),n=this.model.get("stages").length,o=this.currentStageNum,a=this.status,s=wpmdb_strings.title_progress;"complete"===t.get("status")&&0===t.get("totalSize")&&(i=100),s=(s=(s=s.replace("%1$s",i+"%")).replace("%2$s",o)).replace("%3$s",n),1===n&&(s=i+"%"),wpmdb_strings["title_"+a]&&(s=wpmdb_strings["title_"+a]),s=s+" - "+this.originalTitle,document.title=s},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e},decodeErrorObject:function(e){var t=e.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{t=JSON.parse(t)}catch(t){return e}return"object"===(void 0===t?"undefined":(0,o.default)(t))&&void 0!==t.body?t:e},fixProgressStageWidthForScrollBar:function(){var e=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),t=this.$wrapper.find(".active .progress-items"),i=parseInt(t.css("padding-left"),10),n=parseInt(t.css("padding-right"),10);(0!==e||0===e&&n!==i)&&t.css("padding-right",i-e+"px")}},newMigration:function(e){n("#overlay").remove(),n(".progress-content").remove(),this.migration.$overlay=r.clone(),n("#wpwrap").append(this.migration.$overlay),this.migration.model=new a(e),this.migration.view=new s({model:this.migration.model}),this.migration.$progress=c.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var t=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var i=this;return setTimeout(function(){i.migration.$overlay.add(i.migration.$progress).add(i.migration.$proVersion).removeClass("hide").addClass("show"),i.migration.$proVersion.length&&setTimeout(function(){i.migration.$proVersion.find(".iframe").append(t)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){i.migration.$proVersion.find("iframe").remove(),i.migration.$proVersion.addClass("hide remove"),setTimeout(function(){i.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){i.utils.updateProgTableVisibilitySetting(),i.utils.updatePauseBeforeFinalizeSetting(),i.migration.pauseTimer()}),n(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:i(57)};e.exports=p},function(e,t,i){var n=window.jQuery,o=function(e){return e&&e.__esModule?e:{default:e}}(i(3));var a=i(54),s=(n=jQuery,Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(e,t,i){this.addStage(e.name,t,i)},this)},addStage:function(e,t,i,a){var s,r=[];return _.each(t,function(e){var t,n;"remote"===i?(t=this.get("remoteTableSizes")[e],n=this.get("remoteTableRows")[e]):(t=this.get("localTableSizes")[e],n=this.get("localTableRows")[e]),r.push({name:e,size:t,rows:n})},this),s={name:e,items:r,dataType:i},"object"===(void 0===a?"undefined":(0,o.default)(a))&&(s=n.extend(s,a)),this.addStageModel(s),this.trigger("stage:added",this.get("stageModels")[e]),this.get("stageModels")[e].on("change",function(){this.trigger("change")},this),this.getStageModel(s.name)},addStageItem:function(e,t,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.getStageModel(e).addItem(t,i,n,o)},addStageModel:function(e){var t=this.get("stages"),i=this.get("stageModels"),n=new a(e);t.push(e),i[e.name]=n,this.set("stages",t),this.set("stageModels",i)},getStageModel:function(e){return this.get("stageModels")[e]},getStageItems:function(e,t){var i=this.getStageModel(e).get("items");return void 0===t?i:i.map(function(e){return e[t]})},setActiveStage:function(e){this.setStageComplete(),this.set("activeStageName",e),this.getStageModel(e).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(e){e||(e=this.get("activeStageName")),null!==e&&this.getStageModel(e).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var e=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),e.activateTab()}}));e.exports=s},function(e,t){var i=window.jQuery;i=jQuery;e.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,i.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(e,t,i){console.log("Could not save progress item visibility setting",i)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,i.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(e,t,i){console.log("Could not save pause before finalize setting",i)}}))}}},function(e,t,i){window.jQuery;var n=i(56),o=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:void 0,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(e){this.addStageView(e)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(e){var t=new n({model:e});e.trigger("view:initialized",t),this.$el.append(t.$el),this.$el.parent().find(".stage-tabs").append(t.$tabElem)}}));e.exports=o},function(e,t,i){var n=window.jQuery,o=function(e){return e&&e.__esModule?e:{default:e}}(i(3));n=jQuery;var a=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,names:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("names",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(e){this.addItem(e.name,e.size,e.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var e={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},t=this.get("strings");t="object"===(void 0===t?"undefined":(0,o.default)(t))?t:{},(t=n.extend(e,t)).items_migrated=t.itemsName+" "+t.migrated,t.hide_items=t.hide+" "+t.itemsName,t.show_items=t.show+" "+t.itemsName,this.set("strings",t)},addItem:function(e,t,i,o){var a=this.get("items"),s=this.get("names");if(!~s.indexOf(e)){s.push(e);var r={name:e,size:t,rows:i||t,stageName:this.get("name"),transferred:0,rowsTransferred:0,complete:!1,title:null,get $title(){return this.title||this.createTitleElem()},set $title(e){this.title=e},createTitleElem:function(){return this.title=n("<p>").addClass("item-info").append(n('<span class="name" />').text(this.displayName||this.name)).append(" ").append(n('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(r.size)+")")),this.title},progress:null,get $progress(){return this.progress||this.createProgElem()},set $progress(e){this.progress=e},createProgElem:function(){return this.progress=n('<div class="progress-bar"/>').css("width","0%"),this.progress},el:null,get $el(){return this.el||this.createMainElem()},set $el(e){this.el=e},createMainElem:function(){return this.el=n('<div class="item-progress" />'),this.el.append(this.$title),this.el.append(this.$progress),this.el.append('<span class="dashicons dashicons-yes"/>'),this.el.attr("id","item-"+this.name),this.el.attr("data-stage",this.stageName),this.el},updateProgress:function(e){var t=this.$progress;window.requestAnimationFrame(function(){t.css("width",e+"%")}.bind(this))}};void 0!==o&&o.length&&(r.displayName=o),a.push(r),this.get("lookupItems")[e]=a.length-1,this.set("totalSize",parseFloat(this.get("totalSize"))+parseFloat(t)),this.trigger("item:added",r)}},triggerItemViewInit:function(){var e=this.get("items"),t=this;_.each(e,function(e){t.trigger("item:added",e)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var e=this.getTotalSizeTransferred(),t=this.get("totalSize");return 0>=e||0>=t?0:Math.min(100,Math.round(e/t*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(e){var t=this.get("itemsCompleteArr");if(!~t.indexOf(e)){t.push(e);var i=this.getItemByName(e),n=this.get("totalTransferred"),o=this.get("itemsComplete");this.set("itemsComplete",++o),n+=i.size-i.transferred,this.set("totalTransferred",n),i.transferred=i.size,i.complete=!0,i.rowsTransferred=i.rows,this.trigger("change change:items",i)}},setItemPercentTransferred:function(e,t,i,n){var o=this.getItemByName(e),a=i/1e3;if(1===t){o.complete=!0,o.transferred=a;var s=this.get("itemsComplete");this.set("itemsComplete",++s),this.trigger("change change:items",o)}o.transferred=n/1e3,o.exactPercent=t;var r=this.get("totalTransferred");r+=a,this.set("totalTransferred",r),this.trigger("change change:items",o)},setItemRowsTransferred:function(e,t){var i,n,o=this.getItemByName(e),a=this.get("totalTransferred");1!==(i=-1===parseInt(t)?1:Math.min(1,t/o.rows))?(a+=(n=o.size*i)-o.transferred,this.set("totalTransferred",a),o.transferred=n,o.rowsTransferred=t,this.trigger("change change:items",o)):this.setItemComplete(e)},getItemByName:function(e){var t=this.get("items")[this.get("lookupItems")[e]]||{};return e===t.name?t:this.determineItemByName(e)},determineItemByName:function(e){for(var t=this.get("items"),i=0;i<t.length;i++){var n=t[i];if(e===n.name)return this.get("lookupItems").itemName=i,n}}});e.exports=a},function(e,t){var i=window.jQuery,n=(i=jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:140,visibleDomNodes:0,itemCount:0,percentDone:0,sizeDone:0,tablesDone:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,shouldHideItemProgress:!1,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=i("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(e){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(e){e.name&&this.setItemProgress(e)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=i('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> '+this.model.get("strings").items_migrated+"</span>").append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=i("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var e=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var t;e.$el.hasClass("hide-tables")?(t=!1,e.$el.add(e.$el.siblings()).removeClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").hide_items)):(t=!0,e.$el.add(e.$el.siblings()).addClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").show_items)),Boolean(t)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=t)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?e.$showHideTablesElem.text(e.model.get("strings").show_items):e.$showHideTablesElem.text(e.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=i(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var e=this,t=!1,n=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(t=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",t),-1!==i.inArray(n,["push","pull","find_replace","import"])?("find_replace"===n&&i("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){-1!==i.inArray(wpmdb.current_migration.model.get("activeStageName"),["media","themes","plugins"])&&e.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var t=Boolean(e.$pauseBeforeFinalizeCheckbox.is(":checked"));t!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=t)})},initTabElem:function(){var e=this;this.$tabElem=i("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){e.model.activateTab()})},updateProgressElem:function(){var e=Math.max(0,this.model.getTotalProgressPercent()),t=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),i=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(e=100,this.$showHideTablesElem.fadeOut()),e!==this.percentDone&&(this.percentDone=e,this.$totalProgressElem.find(".percent-complete").text(e),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:e+"%"})),t!=this.sizeDone&&(this.sizeDone=t,this.$totalProgressElem.find(".size-complete").text(t)),i!=this.tablesDone&&(this.tablesDone=i,this.$totalProgressElem.find(".items-complete").text(wpmdb.functions.wpmdb_add_commas(i)))},updateStageTotals:function(e){if((e=e||this.model.get("items").length)!==this.itemCount&&(this.itemCount=e,this.$totalProgressElem.find(".items-total").text(wpmdb.functions.wpmdb_add_commas(e)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get("totalSize"))),!this.shouldHideItemProgress&&500<e)){var t=this.model.get("name").toLowerCase();"themes"!=t&&"plugins"!==t||this.hideItemProgress()}},hideItemProgress:function(){this.shouldHideItemProgress||(this.shouldHideItemProgress=!0,this.$itemsContainer.empty(),this.$showHideTablesElem&&this.$showHideTablesElem.hide())},maybeAddElementToView:function(e){var t=this.shouldHideItemProgress?0:this.maxDomNodes;this.visibleDomNodes<t?(++this.visibleDomNodes,this.$itemsContainer.append(e.$el)):(this.queuedElements.push(e),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){if(!this.$truncationNotice){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNotice=i('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb.functions.wpmdb_add_commas(e)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice)}},updateTruncationNotice:function(){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(e))},getNextElementForView:function(e){var t;return!this.shouldHideItemProgress&&(this.queuedElements.length&&(e&&this.queuedElements.push(e),e=(t=this.queuedElements.shift())instanceof i?t:t.$el),e)},setItemProgress:function(e){var t=Math.min(100,Math.ceil(e.transferred/e.size*100));e.hasOwnProperty("exactPercent")&&(t=100*e.exactPercent),0===e.size&&(t=100),e.updateProgress(t),(100<=t||0===e.size)&&this.elemComplete(e)},elemComplete:function(e){if(!this.shouldHideItemProgress){var t=e.$el.addClass("complete");if(1!==this.model.get("items").length){var i=this.getNextElementForView(t),n=t.height(),o=t.css("margin-bottom"),a=!1;i===t&&(a=i.clone().css({height:0,marginBottom:0,display:"block"}).addClass("clone complete")).appendTo(this.$itemsContainer),t.css({height:n,marginBottom:o}),setTimeout(function(){t.css({height:0,marginBottom:0});var e=0;a&&(e=250,a.css({height:n,marginBottom:o}),a.find(".progress-bar").addClass("progress-bar-no-transition").css({width:"100%"})),setTimeout(function(){t.css({display:"none"}),t.remove(),a&&a.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(i.css({height:"auto",marginBottom:o,display:"block"}))}.bind(this),e)}.bind(this),1e3)}}}}));e.exports=n},function(e,t){window.jQuery;!function(e,t){t.functions.update_multiselect=function(i,n,o){if(e(i).empty(),0<Object.keys(n).length){var a=e.wpmdb.apply_filters("wpmdb_get_table_prefix",null,null),s=!1;e.each(n,function(t,n){if(!e.wpmdb.apply_filters("wpmdb_exclude_subsite",!1,t)){var r=" ";(void 0===o||null===o||0===o.length||void 0!==o&&null!==o&&0<o.length&&-1!==e.inArray(t,o))&&(r=' selected="selected" ',s=!0),n+=" ("+a+("1"!==t?t+"_":"")+")",e(i).append("<option"+r+'value="'+t+'">'+n+"</option>")}}),!1===s&&t.functions.update_multiselect(i,n,[])}}}(jQuery,wpmdb)},function(e,t){window.jQuery;!function(e){var t,i=!1,n=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";2<window.devicePixelRatio&&(n+="-2x"),t=e('<img src="'+(n+=".gif")+'" alt="" class="check-licence-spinner" />'),e(document).ready(function(){e("body").on("click",".check-my-licence-again",function(n){if(n.preventDefault(),e(this).blur(),i)return!1;i=!0,e(this).hide(),t.insertAfter(this);var o=' <a class="check-my-licence-again" href="#">'+wpmdb_update_strings.check_license_again+"</a>";e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",nonce:wpmdb_nonces.check_licence,context:"update"},error:function(t,n,a){i=!1,e(".wpmdb-licence-error-notice").fadeOut(650,function(){e(".wpmdb-licence-error-notice").empty().html(wpmdb_update_strings.license_check_problem+o).fadeIn(650)})},success:function(t){if(i=!1,void 0!==t.errors){var n="";for(var o in t.errors)n+=t.errors[o];e(".wpmdb-licence-error-notice").fadeOut(650,function(){e(".check-licence-spinner").remove(),e(".wpmdb-licence-error-notice").empty().html(n).fadeIn(650)})}else e(".wpmdbpro-custom-visible").fadeOut(650,function(){e(".check-licence-spinner").remove(),e(".wpmdbpro-custom-visible").empty().html(e(".wpmdb-original-update-row").html()).fadeIn(650)})}})}),e(".wpmdbpro-custom").prev().addClass("wpmdbpro-has-message")})}(jQuery)},function(e,t,i){window.jQuery;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(124)),o=i(52);var a=new n.default,s=window.wpmdb||{};!function(e,t){t.migration_progress_controller=i(125),t.current_migration=null,t.migration_selection=t.functions.wpmdb_migration_type(),window.onbeforeunload=function(i){if("import"!==t.functions.wpmdb_migration_type()||e(".step-two").is(":visible")||t.functions.remove_localStorage_form_data(),a.currently_migrating)return(i=i||window.event)&&(i.returnValue=wpmdb_strings.sure),wpmdb_strings.sure},t.functions.exclude_post_types_warning=function(){var t=e("#select-post-types").val(),i="",n=e(".exclude-post-types-warning");t?(i="<code>"+t.join("</code>, <code>")+"</code>",e(".excluded-post-types").html(i),"0"===n.css("opacity")&&n.css({opacity:0}).slideDown(200).animate({opacity:1})):n.css({opacity:0}).slideUp(200).animate({opacity:0})},t.functions.migrate_table_recursive=function(i,n,o){var s=o||0;if(s>=a.tables_to_migrate.length)if("upload"===a.stage&&t.current_migration.model.getStageItems("find_replace").length)a.stage="find_replace",a.tables_to_migrate=t.current_migration.model.getStageItems("find_replace","name"),a.tables_to_migrate=a.tables_to_migrate.map(function(e){return"_mig_"+e}),s=0;else{if("backup"!==a.stage)return e(".progress-label").removeClass("label-visible"),t.common.hooks=e.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete),t.common.hooks.push(t.functions.wpmdb_flush),t.common.hooks=e.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete_events),t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},void t.functions.execute_next_step();if(-1!==e.inArray(a.migration_intent,["push","pull"])?a.stage="migrate":"import"===a.migration_intent?a.stage="upload":a.stage=a.migration_intent,t.current_migration.model.setActiveStage(a.stage),"find_replace"!==a.stage&&"migrate"!==a.stage)return void t.functions.wpmdb_call_next_hook();s=0,a.tables_to_migrate=t.functions.get_tables_to_migrate(null,null)}var r=0;s===a.tables_to_migrate.length-1&&(r=1);var c=0;-1!==e.inArray(a.migration_intent,["push","pull"])&&1===parseInt(t.common.connection_data.gzip)&&(c=1);var l={action:"wpmdb_migrate_table",migration_state_id:t.migration_state_id,table:a.tables_to_migrate[s],stage:a.stage,current_row:i,last_table:r,primary_keys:n,gzip:c,nonce:wpmdb_data.nonces.migrate_table};-1!==e.inArray(a.migration_intent,["push","pull"])&&(l.bottleneck=t.common.connection_data.bottleneck,l.prefix=t.common.connection_data.prefix),t.common.connection_data&&t.common.connection_data.path_current_site&&t.common.connection_data.domain&&(l.path_current_site=t.common.connection_data.path_current_site,l.domain_current_site=t.common.connection_data.domain),a.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:l,error:function(e,i,n){var o=wpmdb_strings.table_process_problem+" "+a.tables_to_migrate[s]+"<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+e.responseText;t.current_migration.setState(wpmdb_strings.migration_failed,o,"error"),a.doing_ajax=!1,console.log(e),console.log(i),console.log(n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){a.doing_ajax=!1,i=e.trim(i);var n=t.functions.wpmdb_parse_json(i),o="";if(!1===n||null===n)return o=""===i||null===i?wpmdb_strings.table_process_problem_empty_response+" "+a.tables_to_migrate[s]:a.get_ajax_errors(i,null,null),t.current_migration.setState(wpmdb_strings.migration_failed,o,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();if(void 0!==n.wpmdb_error&&1===n.wpmdb_error)return t.current_migration.setState(wpmdb_strings.migration_failed,n.body,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();var c=a.tables_to_migrate[s];"import"===a.migration_intent&&"find_replace"===a.stage&&(c=c.replace(wpmdb_data.this_temp_prefix,"")),t.current_migration.setText(),t.current_migration.model.getStageModel(a.stage).setItemRowsTransferred(c,n.current_row),1===r&&"savefile"===a.migration_intent&&(void 0!==n.dump_filename&&(a.dump_filename=n.dump_filename),void 0!==n.dump_path&&(a.dump_path=n.dump_path)),-1===parseInt(n.current_row)&&(s++,n.current_row="",n.primary_keys=""),t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:[n.current_row,n.primary_keys,s]},t.functions.execute_next_step()}})},t.functions.migration_complete_events=function(){if(!1===t.common.migration_error)if(""===t.common.non_fatal_errors)if("savefile"!==a.migration_intent&&!0===e("#save_computer").is(":checked")&&t.current_migration.setText(),a.completed_msg=a.completed_msg+'&nbsp;<div class="dashicons dashicons-yes"></div>',!0===a.migration_cancelled){var i=wpmdb_strings.migration_cancelled_success;"find_replace"===a.migration_intent&&(i=wpmdb_strings.find_replace_cancelled_success),t.current_migration.setState(a.completed_msg,i,"cancelled")}else t.current_migration.setState(a.completed_msg,"","complete");else t.current_migration.setState(wpmdb_strings.completed_with_some_errors,t.common.non_fatal_errors,"error");e(".migration-controls").addClass("hidden"),t.common.hooks=[],t.common.call_stack=[],t.common.migration_error=!1,a.currently_migrating=!1,a.migration_completed=!0,a.migration_paused=!1,a.migration_cancelled=!1,a.doing_ajax=!1,t.common.non_fatal_errors="",a.tables_to_migrate=[],e(".progress-label").remove(),e(".migration-progress-ajax-spinner").remove(),e(".close-progress-content").show(),e("#overlay").css("cursor","pointer"),t.current_migration.model.setMigrationComplete()},t.functions.migration_complete=function(){if(e(".migration-controls").addClass("hidden"),"savefile"===a.migration_intent){a.currently_migrating=!1;var i=wpmdb_strings.migration_complete;if(e("#save_computer").is(":checked")){var n=wpmdb_data.this_download_url+encodeURIComponent(a.dump_filename);e("#gzip_file").is(":checked")&&(n+="&gzip=1"),window.location=n}else i=wpmdb_strings.completed_dump_located_at+" "+a.dump_path;!1===t.common.migration_error&&(t.functions.migration_complete_events(),t.current_migration.setState(a.completed_msg,i,"complete"))}else{t.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var s={action:"wpmdb_finalize_migration",migration_state_id:t.migration_state_id,tables:a.tables_to_migrate.join(","),nonce:wpmdb_data.nonces.finalize_migration};-1!==e.inArray(a.migration_intent,["push","pull"])&&(s.prefix=t.common.connection_data.prefix),a.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:s,error:function(e){a.doing_ajax=!1;var t=wpmdb_strings.finalize_tables_problem;(0,o.jQueryAjaxError)(t,e)},success:function(e){if(a.doing_ajax=!1,void 0!==e&&void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error");t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step()}})}},t.functions.wpmdb_flush=function(){"savefile"!==a.migration_intent&&(t.current_migration.setText(wpmdb_strings.flushing),a.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(e,i,n){a.doing_ajax=!1,t.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(e+" : "+i+" : "+n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(a.doing_ajax=!1,"1"!==e.trim(i))return t.current_migration.setState(wpmdb_strings.migration_failed,i,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step()}}))},t.functions.execute_next_step=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(0<a.delay_between_requests&&!1===a.flag_skip_delay)setTimeout(function(){a.flag_skip_delay=!0,t.functions.execute_next_step(i)},a.delay_between_requests);else if(a.flag_skip_delay=!1,!0===a.migration_paused){e(".migration-progress-ajax-spinner").hide(),t.current_migration.pauseTimer();var o="";!0===a.is_auto_pause_before_finalize?(o=wpmdb_strings.paused_before_finalize,a.is_auto_pause_before_finalize=!1,"find_replace"===t.functions.wpmdb_migration_type()&&(o=wpmdb_strings.find_replace_paused_before_finalize)):o=wpmdb_strings.paused,t.current_migration.setState(null,o,"paused"),e("body").on("click",".pause-resume",function(e){a.set_pause_resume_button(e,i)}),e("body").on("click",".cancel",function(e){a.cancel_migration(e)}),e(".pause-resume").html(wpmdb_strings.resume)}else if(!0===a.migration_cancelled){var s;a.migration_intent=t.functions.wpmdb_migration_type(),"savefile"===a.migration_intent?s=wpmdb_strings.removing_local_sql:"pull"===a.migration_intent?s="backup"===a.stage?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===a.migration_intent&&(s="backup"===a.stage?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),t.current_migration.setText(s);var r={action:"wpmdb_cancel_migration",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};a.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:r,error:function(e,i,n){t.current_migration.setState(wpmdb_strings.migration_cancellation_failed,wpmdb_strings.manually_remove_temp_files+"<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+e.responseText,"error"),console.log(e),console.log(i),console.log(n),a.doing_ajax=!1,t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(a.doing_ajax=!1,i=e.trim(i),"push"===a.migration_intent&&"1"!==i||"push"!==a.migration_intent&&""!==i)return void 0!==i&&void 0!==i.wpmdb_error&&1===i.wpmdb_error&&(i=i.wpmdb_error),t.current_migration.setState(wpmdb_strings.migration_cancellation_failed,i,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();a.completed_msg=wpmdb_strings.migration_cancelled,"find_replace"===a.migration_intent&&(a.completed_msg=wpmdb_strings.find_replace_cancelled),t.functions.migration_complete_events(),t.current_migration.setStatus("cancelled")}})}else n&&t.common.next_step_in_migration.fn.apply(i,t.common.next_step_in_migration.args)},t.functions.maybe_show_prefix_notice=function(t){var i=e(".prefix-notice");i.hide(),t!==wpmdb_data.this_prefix&&(e(".remote-prefix").html(t),a.show_prefix_notice=!0,i.show())},t.functions.maybe_show_mst_warning=function(i){var n=t.functions.wpmdb_migration_type(),o=!1;return-1!==e.inArray(n,["push","pull"])&&void 0!==i.site_details?wpmdb_data.site_details.is_multisite!==i.site_details.is_multisite&&(void 0!==t.mst&&void 0!==i.mst_available&&"1"===i.mst_available||(o=!0)):"import"===n&&void 0!==i.multisite&&void 0!==i.subsite_export&&("false"===wpmdb_data.site_details.is_multisite&&"true"===i.multisite&&"true"!==i.subsite_export||"true"===wpmdb_data.site_details.is_multisite&&"false"===i.multisite)&&(o=!0),(o=e.wpmdb.apply_filters("wpmdb_show_mst_warning",o))&&e(".mst-required").show(),o},t.functions.maybe_show_select_table_notice=function(){if(e("#migrate-selected").is(":checked")&&null===e("#select-tables").val()){if("import"!==t.functions.wpmdb_migration_type())return alert(wpmdb_strings.please_select_one_table),!0;if(e("#import-find-replace").is(":checked")&&e("#select-tables").is(":visible"))return alert(wpmdb_strings.please_select_one_table_import),!0}return!("savefile"===t.functions.wpmdb_migration_type()||!e("#backup-manual-select").is(":checked")||null!==e("#select-backup").val())&&(alert(wpmdb_strings.please_select_one_table_backup),!0)},t.functions.remove_protocol=function(e){return e.replace(/^https?:/i,"")},t.functions.create_table_select=function(t,i,n){var o=document.createElement("select");return e(o).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<t.length&&e.each(t,function(t,a){if(!e.wpmdb.apply_filters("wpmdb_exclude_table",!1,a)){var s=" ";void 0!==n&&null!==n&&0<n.length&&-1!==e.inArray(a,n)&&(s=' selected="selected" ');var r="";0!==i.length&&(r=" ("+i[a]+")"),e(o).append("<option"+s+'value="'+a+'">'+a+r+"</option>")}}),o},t.functions.get_tables_to_migrate=function(){var i=[],n=t.functions.wpmdb_migration_type();return"migrate_select"===e("input[name=table_migrate_option]:checked").val()?i=e("#select-tables").val():"pull"!==n&&void 0!==wpmdb_data.this_prefixed_tables?i=wpmdb_data.this_prefixed_tables:"pull"===n&&void 0!==t.common.connection_data&&void 0!==t.common.connection_data.prefixed_tables&&(i=t.common.connection_data.prefixed_tables),i},t.functions.update_migrate_button_text=function(){var i=t.functions.wpmdb_migration_type(),n=e("#save-migration-profile").is(":checked")?"_save":"",o="migrate_button_"+("savefile"===i?"export":i)+n;e(".migrate-db .button-primary").val(wpmdb_strings[o])},t.functions.connection_box_changed=function(){var i=e(".pull-push-connection-info");if(-1!==e.inArray(t.functions.wpmdb_migration_type(),["push","pull"])&&(!a.doing_ajax&&!e(i).hasClass("temp-disabled")||!1!==t.force_reconnect)){t.force_reconnect=!1;var n=e(".pull-push-connection-info").val(),o=e.trim(n).split("\n"),s=!1,r="";if(""===o&&(s=!0,r=wpmdb_strings.connection_info_missing),1===o.length&&!s){var c=e.trim(n).split(" ");2===c.length&&(o=c)}2===o.length||s||(s=!0,r=wpmdb_strings.connection_info_incorrect),s||a.validate_url(o[0])||(s=!0,r=wpmdb_strings.connection_info_url_invalid);var l=0;if(void 0!==o[1]&&(l=o[1].length),s||32===l||40===l||(s=!0,r=wpmdb_strings.connection_info_key_invalid),s||o[0]!==wpmdb_data.connection_info[0]||(s=!0,r=wpmdb_strings.connection_info_local_url),s||o[1]!==wpmdb_data.connection_info[1]||(s=!0,r=wpmdb_strings.connection_info_local_key),s)return e(".connection-status").html(r),void e(".connection-status").addClass("notification-message error-notice migration-error");var p=o[0]+"\n"+o[1];1===e.trim(n).split("\n").length&&e(".pull-push-connection-info").val(p),!1===wpmdb_data.openssl_available&&(o[0]=o[0].replace("https://","http://"),p=o[0]+"\n"+o[1],e(".pull-push-connection-info").val(p)),a.show_prefix_notice=!1,a.doing_ajax=!0,a.disable_export_type_controls(),e(".basic-access-auth-wrapper").is(":visible")&&(o[0]=o[0].replace(/\/\/(.*)@/,"//"),o[0]=o[0].replace("//","//"+encodeURIComponent(e.trim(e(".auth-username").val()))+":"+encodeURIComponent(e.trim(e(".auth-password").val()))+"@"),p=o[0]+"\n"+o[1],e(".pull-push-connection-info").val(p),e(".basic-access-auth-wrapper").hide()),e(".step-two").hide(),e(".ssl-notice").hide(),e(".prefix-notice").hide(),e(".connection-status").show(),e(".connection-status").html(wpmdb_strings.establishing_remote_connection),e(".connection-status").removeClass("notification-message error-notice migration-error"),e(".connection-status").append(a.ajax_spinner);var d=t.functions.wpmdb_migration_type();return a.profile_name_edited=!1,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:o[0],key:o[1],intent:d,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(t,i,n){e(".connection-status").html(a.get_ajax_errors(t.responseText,"(#100)",t)),e(".connection-status").addClass("notification-message error-notice migration-error"),e(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls()},success:function(i){if(e(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)return e(".connection-status").html(i.body),e(".connection-status").addClass("notification-message error-notice migration-error"),i.body.indexOf("401 Unauthorized")>-1&&e(".basic-access-auth-wrapper").show(),void(e(".pull-push-connection-info").hasClass("temp-disabled")||e(".connect-button").is(":visible")||(e(".pull-push-connection-info").removeAttr("readonly"),e(".connect-button").show()));if(!0!==t.functions.maybe_show_mst_warning(i)){a.maybe_show_ssl_warning(o[0],o[1],i.scheme);var n=a.get_domain_name(i.url);e(".create-new-profile").val(n),e(".pull-push-connection-info").addClass("temp-disabled"),e(".pull-push-connection-info").attr("readonly","readonly"),e(".connect-button").hide(),e(".connection-status").hide(),e(".step-two").show(),t.functions.maybe_show_prefix_notice(i.prefix),a.connection_established=!0,a.set_connection_data(i),a.move_connection_info_box(),a.change_replace_values(),a.maybe_show_mixed_cased_table_name_warning(),a.refresh_table_selects(null,null,this),a.$push_select_backup=e(a.$pull_select).clone(),e(a.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var s=document.createElement("select");e(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),e.each(t.common.connection_data.post_types,function(t,i){e(s).append('<option value="'+i+'">'+i+"</option>")}),a.$pull_post_type_select=s,e("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===t.functions.wpmdb_migration_type()?(e("#new-url").val(t.functions.remove_protocol(wpmdb_data.this_url)),e("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(e("#new-domain").val(wpmdb_data.this_domain),e('.replace-row.pin .old-replace-col input[type="text"]').val(t.functions.remove_protocol(i.url))),e("#old-url").val(t.functions.remove_protocol(i.url)),e("#old-path").val(i.path),e.wpmdb.do_action("wpmdb_update_pull_table_select"),e("#select-post-types").remove(),e(".exclude-post-types-warning").after(a.$pull_post_type_select),t.functions.exclude_post_types_warning(),e(".table-prefix").html(i.prefix),e(".backup-table-prefix").html(wpmdb_data.site_details.prefix),e(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(e("#new-url").val(t.functions.remove_protocol(i.url)),e("#new-path").val(i.path),"true"===wpmdb_data.is_multisite&&e('.replace-row.pin .old-replace-col input[type="text"]').val(t.functions.remove_protocol(wpmdb_data.this_url)),e.wpmdb.do_action("wpmdb_update_push_table_select"),e("#select-backup").remove(),e(".backup-tables-wrap").prepend(a.$push_select_backup)),t.common.next_step_in_migration={fn:e.wpmdb.do_action,args:["verify_connection_to_remote_site",t.common.connection_data]},t.functions.execute_next_step()}else e(".connection-status").hide()}})}},e(document).ready(function(){t.migration_state_id="",e("#plugin-compatibility").change(function(t){var i="1",n=e(this).closest("td").next("td").find(".setting-status");e(this).is(":checked")||(i="0"),e(".plugin-compatibility-wrap").toggle(),n.find(".ajax-success-msg").remove(),n.append(a.ajax_spinner),e("#plugin-compatibility").attr("disabled","disabled"),e(".plugin-compatibility").addClass("disabled"),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:i,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(t,i,n){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+t.status+" "+t.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+t.responseText),e(".ajax-spinner").remove(),e("#plugin-compatibility").removeAttr("disabled"),e(".plugin-compatibility").removeClass("disabled")},success:function(t){""!==e.trim(t)?alert(t):(n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})),e(".ajax-spinner").remove(),e("#plugin-compatibility").removeAttr("disabled"),e(".plugin-compatibility").removeClass("disabled")}})}),e("#plugin-compatibility").is(":checked")&&e(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&e(".ie-warning").show(),0<=navigator.userAgent.indexOf("Edge")&&e(".edge-warning").show(),0===wpmdb_data.valid_licence&&e("#savefile").prop("checked",!0);var i=e(".max-request-size"),n=e(".slider",i);n.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(e,t){var n=a.get_max_request_display_info(wpmdb_data.max_request/1024);a.set_slider_value(i,wpmdb_data.max_request/1024,n.unit,n.amount)},slide:function(e,t){var n=a.get_max_request_display_info(t.value);a.set_slider_value(i,t.value,n.unit,n.amount)},stop:function(t,o){e(".slider-success-msg").remove(),e(".amount",i).after('<img src="'+a.spinner_url+'" alt="" class="slider-spinner general-spinner" />'),n.slider("disable"),e.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_max_request_size",max_request_size:parseInt(o.value),nonce:wpmdb_data.nonces.update_max_request_size},error:function(t,o,s){n.slider("enable"),e(".slider-spinner",i).remove(),alert(wpmdb_strings.max_request_size_problem);var r=a.get_max_request_display_info(wpmdb_data.max_request/1024);a.set_slider_value(i,wpmdb_data.max_request/1024,r.unit,r.amount),n.slider("enable")},success:function(){n.slider("enable"),e(".slider-label-wrapper",i).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),e(".slider-success-msg",i).fadeOut(2e3,function(){e(this).remove()}),e(".slider-spinner",i).remove()}})}});var o=e(".delay-between-requests"),s=e(".slider",o);s.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(e,t){a.set_slider_value(o,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(e,t){a.set_slider_value(o,t.value,"s")},stop:function(t,i){e(".slider-success-msg").remove(),e(".amount",o).after('<img src="'+a.spinner_url+'" alt="" class="slider-spinner general-spinner" />'),s.slider("disable"),e.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_delay_between_requests",delay_between_requests:parseInt(1e3*i.value),nonce:wpmdb_data.nonces.update_delay_between_requests},error:function(t,i,n){s.slider("enable"),e(".slider-spinner",o).remove(),alert(wpmdb_strings.delay_between_requests_problem),a.set_slider_value(o,wpmdb_data.delay_between_requests/1e3,"s"),s.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*i.value),s.slider("enable"),e(".slider-label-wrapper",o).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),e(".slider-success-msg",o).fadeOut(2e3,function(){e(this).remove()}),e(".slider-spinner",o).remove()}})}}),e(".help-tab .video").each(function(){var t=e(this),i=e(".video-viewer");e("a",this).click(function(n){n.preventDefault(),i.attr("src","//www.youtube.com/embed/"+t.data("video-id")+"?autoplay=1"),i.show();var o=i.offset();e(window).scrollTop(o.top-50)})}),e(".backup-options").show(),e(".keep-active-plugins").show(),"savefile"===t.functions.wpmdb_migration_type()&&(e(".backup-options").hide(),e(".keep-active-plugins").hide()),a.last_replace_switch=t.functions.wpmdb_migration_type(),e(".content-tab").on("click",".check-my-licence-again",function(t){t.preventDefault(),a.checked_licence=!1,e(t.target).replaceWith("Checking... "+a.ajax_spinner),a.check_licence(null,"all")}),e.wpmdb.add_action("wpmdb_refresh_table_selects",a.refresh_table_selects,"",a),e.wpmdb.add_action("wpmdb_update_push_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(a.$push_select),e("#select-tables").change()}),e.wpmdb.add_action("wpmdb_update_pull_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(a.$pull_select),e("#select-tables").change()}),e.wpmdb.add_action("wpmdb_disable_table_migration_options",function(){e("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),e(".table-select-wrap").show(),e("#migrate-only-with-prefix").prop("checked",!1),e("#migrate-selected").prop("checked",!0),e(".table-migrate-options").hide(),e(".select-tables-wrap").show()}),e.wpmdb.add_action("wpmdb_enable_table_migration_options",function(){e(".table-migrate-options").show()}),e.wpmdb.add_action("wpmdb_select_all_tables",function(){e("#select-tables").children("option").prop("selected",!0),e("#select-tables").change()}),e.wpmdb.add_filter("wpmdb_base_old_url",function(e,t){return a.remove_protocol(wpmdb_data.this_url)}),a.establish_remote_connection_from_saved_profile(),e("body").on("click",".js-action-link",function(t){t.preventDefault(),e(this).blur()}),e(".licence-input").keypress(function(t){13===t.which&&(t.preventDefault(),e(".register-licence").click())}),e("body").on("click",".register-licence",function(t){if(t.preventDefault(),!a.doing_licence_registration_ajax){var i=e.trim(e(".licence-input").val()),n=e(".licence-status");n.removeClass("notification-message error-notice success-notice"),""!==i?(n.empty().removeClass("success"),a.doing_licence_registration_ajax=!0,e(".button.register-licence").after('<img src="'+a.spinner_url+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),e.ajax({url:ajaxurl,type:"POST",dataType:"JSON",cache:!1,data:{action:"wpmdb_activate_licence",licence_key:i,nonce:wpmdb_data.nonces.activate_licence,context:"licence"},error:function(t,i,o){a.doing_licence_registration_ajax=!1,e(".register-licence-ajax-spinner").remove(),n.html(wpmdb_strings.register_license_problem)},success:function(t){if(e(".register-licence-ajax-spinner").remove(),void 0!==t.errors){var o="";for(var s in t.errors)o+=t.errors[s];n.html(o),void 0!==t.masked_licence&&(a.enable_pro_licence(t,i),e(".migrate-tab .invalid-licence").hide())}else void 0!==t.wpmdb_error&&void 0!==t.body?n.html(t.body):(1===Number(t.is_first_activation)&&(wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%1$s","https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%2$s","https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),n.after('<div id="welcome-wrap"><img id="welcome-img" src="'+wpmdb_data.this_plugin_url+'asset/build/img/mdb-banner.svg" /><div class="welcome-text"><h3>'+wpmdb_strings.welcome_title+"</h3><p>"+wpmdb_strings.welcome_text+"</p></div></div>")),n.html(wpmdb_strings.license_registered).delay(5e3).fadeOut(1e3,function(){e(this).css({visibility:"hidden",display:"block"}).slideUp()}),n.addClass("success notification-message success-notice"),a.enable_pro_licence(t,i),e(".invalid-licence").hide());a.doing_licence_registration_ajax=!1}})):n.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>")}}),e(".clear-log").click(function(){e(".ajax-spinner, .ajax-success-msg").remove(),e(this).after(a.ajax_spinner),e(".debug-log-textarea").val(""),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(t,i,n){e(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(t){e(".ajax-spinner, .ajax-success-msg").remove(),a.refresh_debug_log(),e(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})}})}),e(".multiselect-select-all").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).prop("selected",1),e(t).focus().trigger("change")}),e(".multiselect-deselect-all").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).removeAttr("selected"),e(t).focus().trigger("change")}),e(".multiselect-invert-selection").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).each(function(){e(this).attr("selected",!e(this).attr("selected"))}),e(t).focus().trigger("change")}),e(".option-group input[type=radio]").change(function(){var t=e(this).closest(".option-group");e("ul",t).hide();var i=e(this).closest("li");e("ul",i).show()}),e(".option-group").each(function(){e(".option-group input[type=radio]").each(function(){if(e(this).is(":checked")){var t=e(this).closest("li");e("ul",t).show()}})}),e(".header-expand-collapse").click(function(){var t=null;void 0!==e(this).data("next")&&(t=e(this).data("next")),e(".expand-collapse-arrow",this).hasClass("collapsed")?(e(".expand-collapse-arrow",this).removeClass("collapsed"),t?e(t).show():e(this).next().show()):(e(".expand-collapse-arrow",this).addClass("collapsed"),t?e(t).hide():e(this).next().hide())}),e(".checkbox-label input[type=checkbox]").change(function(){e(this).is(":checked")?e(this).parent().next().show():e(this).parent().next().hide()}),e(".select-post-types-wrap").on("change","#select-post-types",function(){t.functions.exclude_post_types_warning()}),e("#exclude-post-types").is(":checked")&&e("#select-post-types").val()&&e(".exclude-post-types-warning").css({display:"block",opacity:1}),e("#save-migration-profile").change(function(){t.functions.update_migrate_button_text(),e(this).is(":checked")?e(".save-settings-button").show():e(".save-settings-button").hide()}),e("#save-migration-profile").is(":checked")&&e(".save-settings-button").show(),e(".create-new-profile").focus(function(){e("#create_new").prop("checked",!0)}),e(".checkbox-label input[type=checkbox]").each(function(){e(this).is(":checked")&&e(this).parent().next().show()}),e(".migrate-db-button").click(function(i){if(e(this).blur(),i.preventDefault(),t.migration_state_id="",!1!==e.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)&&!0!==t.functions.maybe_show_select_table_notice()){var n=!1,o=!1;if(e("#new-url").length&&!e("#new-url").val()&&(e("#new-url-missing-warning").show(),e("#new-url").focus(),e("html,body").scrollTop(0),n=!0),e("#new-path").length&&!e("#new-path").val()&&(e("#new-path-missing-warning").show(),!1===n&&(e("#new-path").focus(),e("html,body").scrollTop(0)),o=!0),!0===n||!0===o){if("import"!==t.functions.wpmdb_migration_type())return;if(e("#import-find-replace").is(":checked"))return}e("#save-migration-profile").is(":checked")&&a.save_active_profile(),a.form_data=e(e("#migrate-form")[0].elements).not(".auth-credentials").serialize(),a.migration_intent=t.functions.wpmdb_migration_type(),a.stage="backup","savefile"===a.migration_intent&&(a.stage="migrate"),!1===e("#create-backup").is(":checked")&&(-1!==e.inArray(a.migration_intent,["savefile","push","pull"])?a.stage="migrate":"import"===a.migration_intent?a.stage="upload":a.stage=a.migration_intent),t.current_migration=t.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:void 0!==t.common.connection_data?t.common.connection_data.table_sizes:null,remoteTableRows:void 0!==t.common.connection_data?t.common.connection_data.table_rows:null,migrationIntent:t.functions.wpmdb_migration_type()});var s=e("input[name=backup_option]:checked").val(),r=e("input[name=table_migrate_option]:checked").val(),c="",l="";"backup"===a.stage&&("migrate_only_with_prefix"===r&&"backup_selected"===s&&"import"!==a.migration_intent&&(s="backup_only_with_prefix"),"push"===a.migration_intent?(l="remote","backup_only_with_prefix"===s?a.tables_to_migrate=t.common.connection_data.prefixed_tables:"backup_selected"===s?(c=e("#select-tables").val(),c=e.wpmdb.apply_filters("wpmdb_backup_selected_tables",c),a.tables_to_migrate=a.get_intersect(c,t.common.connection_data.tables)):"backup_manual_select"===s&&(a.tables_to_migrate=e("#select-backup").val())):(l="local","backup_only_with_prefix"===s?a.tables_to_migrate=wpmdb_data.this_prefixed_tables:"backup_selected"===s?(c=e("#select-tables").val(),c=e.wpmdb.apply_filters("wpmdb_backup_selected_tables",c),a.tables_to_migrate=a.get_intersect(c,wpmdb_data.this_tables)):"backup_manual_select"===s&&(a.tables_to_migrate=e("#select-backup").val())),t.current_migration.model.addStage("backup",a.tables_to_migrate,l,{strings:{migrated:wpmdb_strings.backed_up}})),l="pull"===a.migration_intent?"remote":"local","find_replace"===a.migration_intent?t.current_migration.model.addStage("find_replace",t.functions.get_tables_to_migrate(null,null),l,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}}):-1!==e.inArray(a.migration_intent,["savefile","push","pull"])&&t.current_migration.model.addStage("migrate",t.functions.get_tables_to_migrate(null,null),l),e.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:l,tables_to_migrate:t.functions.get_tables_to_migrate(null,null)});e("input[name=table_migrate_option]:checked").val();var p=e.trim(e(".pull-push-connection-info").val()).split("\n");a.remote_site=p[0],a.secret_key=p[1];var d=a.get_migration_status_label(a.remote_site,a.migration_intent,"migrating");a.completed_msg=a.get_migration_status_label(a.remote_site,a.migration_intent,"completed"),-1!==e.inArray(a.stage,["find_replace","backup","migrate"])&&(a.tables_to_migrate=t.current_migration.model.getStageItems(a.stage,"name")),t.current_migration.model.setActiveStage(a.stage),t.current_migration.setTitle(d),t.current_migration.startTimer(),a.currently_migrating=!0,t.current_migration.setStatus("active");var m={action:"wpmdb_initiate_migration",intent:a.migration_intent,url:a.remote_site,key:a.secret_key,form_data:a.form_data,stage:a.stage,nonce:wpmdb_data.nonces.initiate_migration};m.site_details={local:wpmdb_data.site_details},-1!==e.inArray(a.migration_intent,["push","pull"])&&(m.temp_prefix=t.common.connection_data.temp_prefix,m.site_details.remote=t.common.connection_data.site_details),m.site_details=JSON.stringify(m.site_details),m=e.wpmdb.apply_filters("wpmdb_initiate_migration_request_data",m,m),a.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:m,error:function(e,i,n){t.current_migration.setState(wpmdb_strings.migration_failed,a.get_ajax_errors(e.responseText,"(#112)",e),"error"),console.log(e),console.log(i),console.log(n),a.doing_ajax=!1,t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(a.doing_ajax=!1,void 0!==i&&void 0!==i.wpmdb_error&&1===i.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,i.body,"error");t.migration_state_id=i.migration_state_id;a.delay_between_requests=0,("savefile"!==a.migration_intent&&void 0!==t.common.connection_data&&void 0!==t.common.connection_data.delay_between_requests||"import"===a.migration_intent)&&("import"===a.migration_intent?a.delay_between_requests=wpmdb_data.delay_between_requests:a.delay_between_requests=Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(t.common.connection_data.delay_between_requests))),-1!==e.inArray(a.migration_intent,["savefile","push","pull","find_replace"])&&(t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:["-1",""]},t.functions.execute_next_step()),e.wpmdb.do_action("wpmdb_migration_initiated",a.stage)}})}}),a.update_migrate_button_text(),e("body").on("click",".close-progress-content-button",function(e){a.hide_overlay(),t.current_migration.restoreTitleElem(),t.functions.maybe_reload_page()}),e("body").on("click","#overlay",function(e){!0===a.migration_completed&&e.target===this&&(a.hide_overlay(),t.current_migration.restoreTitleElem(),t.functions.maybe_reload_page())}),e(".save-settings-button").click(function(t){if(t.preventDefault(),""===e.trim(e(".create-new-profile").val())&&e("#create_new").is(":checked"))return alert(wpmdb_strings.enter_name_for_profile),void e(".create-new-profile").focus();a.save_active_profile()}),a.move_connection_info_box(),e(".migrate-selection.option-group input[type=radio]").change(function(){a.move_connection_info_box(),t.migration_selection=t.functions.wpmdb_migration_type(),a.connection_established&&a.change_replace_values(),t.functions.update_migrate_button_text()}),"pull"!==t.functions.wpmdb_migration_type()&&"push"!==t.functions.wpmdb_migration_type()||a.connection_established||(e(".step-two").hide(),e(".connection-status").show()),e(".general-helper").click(function(t){t.preventDefault();var i=e(this),n=e(this).next();e(".helper-message").not(n).hide();var o=i.position();if(n.hasClass("bottom")){var a=1;!0===n.hasClass("compatibility-help")?a=6:e(this).is(":first-child")&&(a=3),n.css({left:o.left-n.width()/2-a+"px",top:o.top+i.height()+9+"px"})}else n.css({left:o.left+i.width()+9+"px",top:o.top+i.height()/2-18+"px"});n.toggle(),t.stopPropagation()}),e("body").click(function(){e(".helper-message").hide()}),e(".helper-message").click(function(e){e.stopPropagation()}),e("body").on("click",".show-errors-toggle",function(t){t.preventDefault(),e(this).next(".migration-php-errors").toggle()}),e(".nav-tab").click(function(){var t=e(this).attr("data-div-name");t=t.replace("-tab",""),window.location.hash=t,a.switch_to_plugin_tab(t,!1)}),e("body").on("click",'a[href^="#"]',function(t){var i=e(t.target).attr("href").substr(1);if(i){var n=e("."+i);1===n.length&&(n.trigger("click"),t.preventDefault())}}),e("body").on("click",".add-row",function(){var t=e(this).parents("tr");t.before(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),t.prev().find(".old-replace-col input").focus()}),e("body").on("click",".replace-remove-row",function(){e(this).parents("tr").remove(),2>=e(".replace-row").length&&e(".no-replaces-message").show();var t=e(this).prev().attr("id");"new-url"!==t&&"new-path"!==t||e("#"+t+"-missing-warning").hide()}),e("body").on("change","#new-url",function(){e("#new-url-missing-warning").hide()}).on("change","#new-path",function(){e("#new-path-missing-warning").hide()}),e("body").on("click",".arrow-col",function(){if(!e(this).hasClass("disabled")){var t=e(this).prev("td").find("input").val(),i=e(this).next("td").find("input");i.val(t),"new-url"===i.prop("id")?e("#new-url-missing-warning").hide():"new-path"===i.prop("id")&&e("#new-path-missing-warning").hide()}}),e(".add-replace").click(function(){e(".replace-fields").prepend(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),e(".no-replaces-message").hide()}),e("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){e(".sort-handle").css("cursor","-webkit-grabbing"),e(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){e(".sort-handle").css("cursor","-webkit-grab"),e(".sort-handle").css("cursor","-moz-grab")}});var r="";window.location.hash&&(r=window.location.hash.substring(1),a.switch_to_plugin_tab(r,!1)),""!==a.get_query_var("install-plugin")&&(r="addons",a.checked_licence=!0,a.switch_to_plugin_tab(r,!0)),e(".notice-link").click(function(i){i.preventDefault(),t.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link,function(t){e(t).closest(".inline-message").hide()},e(this))}),e("#connection_info").on("copy",function(t){var i=e(this).val().split("\n");if(2===i.length)try{t.originalEvent.clipboardData.setData("text/plain",i.join(" ")),t.preventDefault()}catch(e){}}),e(".reset-api-key").click(function(){confirm(wpmdb_strings.reset_api_key)&&!a.doing_reset_api_key_ajax&&(a.doing_reset_api_key_ajax=!0,e(".reset-api-key").after('<img src="'+a.spinner_url+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(t,i,n){alert(wpmdb_strings.reset_api_key_problem),e(".reset-api-key-ajax-spinner").remove(),a.doing_reset_api_key_ajax=!1},success:function(t){e(".reset-api-key-ajax-spinner").remove(),a.doing_reset_api_key_ajax=!1,e(".connection-info").html(t),wpmdb_data.connection_info=e.trim(t).split("\n")}}))}),e(".copy-api-key").click(function(){var t=e(this),i=e("#connection_info"),n=i.val(),o=n.replace("\n"," ");i.val(o),i.select();try{document.execCommand("copy"),i.blur(),t.css("color","transparent");var a=e(".copy-api-key-confirmation").show();setTimeout(function(){a.fadeOut("fast"),setTimeout(function(){t.css("color","")},200)},1e3)}catch(e){alert("please press Ctrl/Cmd+C to copy")}i.val(n)}),e("input[name=table_migrate_option]").change(function(){e(".select-tables-wrap").hide(),"migrate_select"===e(this).val()&&e(".select-tables-wrap").show()}),e(".show-multiselect").each(function(){e(this).is(":checked")&&(e(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),e(this).parents(".expandable-content").show(),e(this).parents(".expandable-content").children(".select-wrap").toggle())}),e("input[name=backup_option]").change(function(){e(".backup-tables-wrap").hide(),"backup_manual_select"===e(this).val()&&e(".backup-tables-wrap").show()}),e("#backup-manual-select").is(":checked")&&e(".backup-tables-wrap").show(),e(".plugin-compatibility-save").click(function(){if(!a.doing_plugin_compatibility_ajax){e(this).addClass("disabled");var t=e("#selected-plugins");e(t).attr("disabled","disabled"),e(".plugin-compatibility-success-msg").remove(),a.doing_plugin_compatibility_ajax=!0,e(this).after('<img src="'+a.spinner_url+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_whitelist_plugins",whitelist_plugins:e(t).val(),nonce:wpmdb_data.nonces.whitelist_plugins},error:function(i,n,o){alert(wpmdb_strings.blacklist_problem+"\r\n\r\n"+wpmdb_strings.status+" "+i.status+" "+i.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+i.responseText),e(t).removeAttr("disabled"),e(".plugin-compatibility-save").removeClass("disabled"),a.doing_plugin_compatibility_ajax=!1,e(".plugin-compatibility-spinner").remove()},success:function(i){""!==e.trim(i)&&alert(i),e(t).removeAttr("disabled"),e(".plugin-compatibility-save").removeClass("disabled"),a.doing_plugin_compatibility_ajax=!1,e(".plugin-compatibility-spinner").remove(),e(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),e(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),e("body").on("click",".delete-profile",function(){var t=e(this).next().clone();if(e("input",t).remove(),t=e.trim(e(t).html()),confirm(wpmdb_strings.remove_profile.replace("{{profile}}",t))){var i=e(this).parent();if(i.find("input:checked").length){var n=i.siblings().last();if(n.find("input[type=radio]").prop("checked","checked"),n.find("input[type=text]").focus(),e("#migrate-form .crumbs .crumb:last").text("New Profile"),"function"==typeof window.history.pushState){var o=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile=-1";window.history.pushState({updated_profile_id:-1},null,o)}}i.fadeOut(500),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:e(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(e,t,i){alert(wpmdb_strings.remove_profile_problem)},success:function(e){"-1"===e&&alert(wpmdb_strings.remove_profile_not_found)}})}}),e(".main-list-delete-profile-link").click(function(){var t=e(this).prev().html();confirm(wpmdb_strings.remove_profile.replace("{{profile}}",t))&&(e(this).parent().fadeOut(500),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:e(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(e,t,i){alert(wpmdb_strings.remove_profile_problem)}}))}),e("body").on("click",".temp-disabled",function(){confirm(wpmdb_strings.change_connection_info)&&(e(".ssl-notice").hide(),e(".different-plugin-version-notice").hide(),e(".migrate-db-button").show(),e(".temp-disabled").removeAttr("readonly"),e(".temp-disabled").removeClass("temp-disabled"),e(".connect-button").show(),e(".step-two").hide(),e(".connection-status").show().html(wpmdb_strings.enter_connection_info),a.connection_established=!1)}),e(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==e(this).attr("id")){var t=e(this).is(":checked"),i=e(this).attr("id"),n=e(this).closest("td").next("td").find(".setting-status");e(".ajax-success-msg").remove(),n.after(a.ajax_spinner),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:t,setting:i,nonce:wpmdb_data.nonces.save_setting},error:function(t,i,n){alert(wpmdb_strings.save_settings_problem),e(".ajax-spinner").remove()},success:function(t){e(".ajax-spinner").remove(),n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})}})}}),e(".migrate-form").submit(function(e){e.preventDefault()}),e(".connect-button").click(function(i){i.preventDefault(),e(this).blur(),t.functions.connection_box_changed()}),e(".pull-push-connection-info").bind("paste",function(e){setTimeout(function(){t.functions.connection_box_changed()},0)}),e("body").on("click",".try-again",function(){e(".pull-push-connection-info").removeClass("temp-disabled"),t.functions.connection_box_changed()}),e("body").on("click",".try-http",function(){var i=e.trim(e(".pull-push-connection-info").val()).split("\n"),n=i[0].replace("https","http")+"\n"+i[1];e(".pull-push-connection-info").val(n),t.functions.connection_box_changed()}),e(".create-new-profile").change(function(){a.profile_name_edited=!0}),e("body").on("click",".temporarily-disable-ssl",function(){var t="";window.location.hash&&(t=window.location.hash.substring(1)),e(this).attr("href",e(this).attr("href")+"&hash="+t)}),e("body").on("click",".pause-resume",function(e){a.set_pause_resume_button(e)}),e("body").on("click",".cancel",function(e){a.cancel_migration(e)}),e(".enter-licence").click(function(){e(".settings").click(),e(".licence-input").focus()}),e("body").on("click",".copy-licence-to-remote-site",function(){e(".connection-status").html(wpmdb_strings.copying_license),e(".connection-status").removeClass("notification-message error-notice migration-error"),e(".connection-status").append(a.ajax_spinner);var i=e.trim(e(".pull-push-connection-info").val()).split("\n");a.doing_ajax=!0,a.disable_export_type_controls(),e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:i[0],key:i[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(t,i,n){e(".connection-status").html(a.get_ajax_errors(t.responseText,"(#143)",t)),e(".connection-status").addClass("notification-message error-notice migration-error"),e(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls()},success:function(i){if(e(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)return e(".connection-status").html(i.body),e(".connection-status").addClass("notification-message error-notice migration-error"),void(i.body.indexOf("401 Unauthorized")>-1&&e(".basic-access-auth-wrapper").show());t.functions.connection_box_changed()}})}),e("body").on("click",".reactivate-licence",function(t){a.doing_ajax=!0,e(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),e(".invalid-licence").append(a.ajax_spinner),e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(t,i,n){e(".invalid-licence").html(wpmdb_strings.activate_licence_problem),e(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+t.status+" "+t.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+t.responseText),e(".ajax-spinner").remove(),a.doing_ajax=!1},success:function(t){if(e(".ajax-spinner").remove(),a.doing_ajax=!1,void 0===t.wpmdb_error||1!==t.wpmdb_error){if(void 0!==t.wpmdb_dbrains_api_down&&1===t.wpmdb_dbrains_api_down)return e(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void e(".invalid-licence").append(t.body);e(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),location.reload()}else e(".invalid-licence").html(t.body)}})}),e("input[name=table_migrate_option]").change(function(){a.maybe_show_mixed_cased_table_name_warning(),e.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),e("body").on("change","#select-tables",function(){a.maybe_show_mixed_cased_table_name_warning(),e.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),e.wpmdb.add_filter("wpmdb_get_table_prefix",a.get_table_prefix),e.wpmdb.add_filter("wpmdb_get_tables_to_migrate",t.functions.get_tables_to_migrate),e.wpmdb.add_action("wpmdb_lock_replace_url",a.lock_replace_url),e.wpmdb.add_action("wpmdb_pin_replace_url",a.pin_replace_url),e.wpmdb.add_action("move_connection_info_box",t.functions.exclude_post_types_warning),e.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(t){return a.pause_before_finalize=!!e("input[name=pause_before_finalize]:checked").length,!0===a.pause_before_finalize&&"savefile"!==a.migration_intent&&(a.set_pause_resume_button(null),window.is_auto_pause_before_finalize=!0),t}),e(".wpmdb-switch").on("click",function(t){e(this).hasClass("disabled")||a.set_checkbox(e(this).attr("id"))}),e("#beta_optin-wrap").on("click",function(t){e(this).find("span.on").hasClass("checked")||wpmdb_data.is_beta_plugins_installed&&confirm(wpmdb_strings.rollback_beta_to_stable)&&(window.location=wpmdb_data.rollback_to_stable_url)})})}(jQuery,s)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(i(3)),o=s(i(12)),a=s(i(13));function s(e){return e&&e.__esModule?e:{default:e}}var r=window.jQuery,c=window.ajaxurl,l=window.wpmdb_strings,p=window.wpmdb_data,d=function(){function e(){(0,o.default)(this,e),this.show_ssl_notice=!1,this.doing_save_profile=!1,this.doing_ajax=!1,this.profile_name_edited=!1,this.migration_intent=null,this.doing_licence_registration_ajax=!1,this.migration_paused=!1,this.last_replace_switch=wpmdb.functions.wpmdb_migration_type(),this.connection_established=!1,this.profile_name_edited=!1,this.checked_licence=!1,this.show_prefix_notice=!1,this.show_ssl_notice=!1,this.force_reconnect=!1,this.migration_selection="",this.show_version_notice=!1,this.migration_completed=!1,this.currently_migrating=!1,this.dump_filename="",this.dump_path="",this.migration_intent="",this.remote_site=null,this.secret_key=null,this.form_data=null,this.stage=null,this.elapsed_interval=null,this.completed_msg=null,this.tables_to_migrate=[],this.migration_paused=!1,this.previous_progress_title="",this.previous_progress_text_primary="",this.previous_progress_text_secondary="",this.cancelling_text="",this.paused_text="",this.migration_cancelled=!1,this.flag_skip_delay=!1,this.delay_between_requests=0,this.fade_duration=400,this.pause_before_finalize=!1,this.is_auto_pause_before_finalize=!1,this.$connection_info_box=r(".connection-info-wrapper"),this.$push_select=window.wpmdb.$push_select=r("#select-tables").clone(),this.$pull_select=window.wpmdb.$pull_select=r("#select-tables").clone(),this.$push_post_type_select=r("#select-post-types").clone(),this.$pull_post_type_select=r("#select-post-types").clone(),this.$push_select_backup=r("#select-backup").clone(),this.$pull_select_backup=r("#select-backup").clone(),this.spinner_url=window.spinner_url=wpmdb.functions.get_spinner_url(),this.ajax_spinner=window.ajax_spinner='<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" />'}return(0,a.default)(e,[{key:"pad",value:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e}},{key:"is_int",value:function(e){return"number"==typeof(e=parseInt(e))&&0==e%1}},{key:"get_intersect",value:function(e,t){var i,n,o=[],a={},s=t.length;for(i=0;i<s;i++)a[t[i]]=!0;for(s=e.length,i=0;i<s;i++)(n=e[i])in a&&o.push(n);return o}},{key:"pin_replace_url",value:function(e){!0===e&&1>r(".replace-row.pin").length&&1===r("#old-url").length&&r("#old-url").parents(".replace-row").addClass("pin"),!1===e&&0<r(".replace-row.pin").length&&r(".replace-row.pin").removeClass("pin")}},{key:"get_ajax_errors",value:function(e,t,i){return wpmdb.functions.wpmdbGetAjaxErrors(l.connection_local_server_problem,t,e,i)}},{key:"refresh_debug_log",value:function(){r.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:p.nonces.get_log},error:function(e,t,i){alert(l.update_log_problem)},success:function(e){r(".debug-log-textarea").val(e)}})}},{key:"get_query_var",value:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"maybe_show_ssl_warning",value:function(e,t,i){var n=e.substr(0,e.indexOf(":")),o=r(".ssl-notice");if(this.show_ssl_notice||o.hide(),i!==n&&-1!==e.indexOf("https"))return o.show(),this.show_ssl_notice=!0,e=e.replace("https","http"),void r(".pull-push-connection-info").val(e+"\n"+t);this.show_ssl_notice=!1}},{key:"validate_url",value:function(e){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)}},{key:"refresh_table_selects",value:function(){void 0!==p&&void 0!==p.this_tables&&void 0!==p.this_table_sizes_hr&&(this.$push_select=this.create_table_select(p.this_tables,p.this_table_sizes_hr,r(wpmdb.$push_select).val())),void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.tables&&void 0!==wpmdb.common.connection_data.table_sizes_hr&&(this.$pull_select=this.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,r(wpmdb.$pull_select).val()))}},{key:"save_active_profile",value:function(){var e,t=this;if(r(".save-settings-button").blur(),!this.doing_save_profile&&!0!==this.maybe_show_select_table_notice()){var i=!1;r("#create_new").is(":checked")&&(i=!0);var n=r(".create-new-profile").val();this.doing_save_profile=!0,e=r(r("#migrate-form")[0].elements).not(".auth-credentials").serialize(),r(".save-settings-button").attr("disabled","disabled").after('<img src="'+this.spinner_url+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),this.doing_ajax=!0,r.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:e,nonce:p.nonces.save_profile},error:function(e,i,n){t.doing_ajax=!1,alert(l.save_profile_problem),r(".save-settings-button").removeAttr("disabled"),r(".save-profile-ajax-spinner").remove(),r(".save-settings-button").after('<span class="ajax-success-msg">'+l.saved+"</span>"),r(".ajax-success-msg").fadeOut(2e3,function(){r(this).remove()}),t.doing_save_profile=!1},success:function(e){var o=parseInt(r("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(t.doing_ajax=!1,r(".save-settings-button").removeAttr("disabled"),r(".save-profile-ajax-spinner").remove(),r(".save-settings-button").after('<span class="ajax-success-msg">'+l.saved+"</span>"),r(".ajax-success-msg").fadeOut(2e3,function(){r(this).remove()}),t.doing_save_profile=!1,r(".create-new-profile").val(""),i){var a=parseInt(e,10),s=a+1,c=r('<li><span class="delete-profile" data-profile-id="'+s+'"></span><label for="profile-'+s+'"><input id="profile-'+s+'" value="'+a+'" name="save_migration_profile_option" type="radio"></label></li>');c.find("label").append(document.createTextNode(" "+n)),o=s,r("#create_new").parents("li").before(c),r("#profile-"+s).attr("checked","checked")}var d=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+o,m=r("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(r("#migrate-form .crumbs").length)r("#migrate-form .crumbs .crumb:last").text(m);else{var u=r('<div class="crumbs" />').append('<a class="crumb" href="'+p.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+m+"</span>");r("#migrate-form").prepend(u)}window.history.pushState({updated_profile_id:o},null,d)}}})}}},{key:"cancel_migration",value:function(e){this.migration_cancelled=!0,this.cancelling_text=l.cancelling_migration,r(".migration-controls").css({visibility:"hidden"}),"find_replace"===this.migration_intent&&(this.cancelling_text=l.cancelling_find_replace),wpmdb.current_migration.setState(this.cancelling_text,l.completing_current_request,"cancelling"),!0===this.migration_paused&&(this.migration_paused=!1,wpmdb.functions.execute_next_step())}},{key:"set_checkbox",value:function(e){var t=r("#"+e),i=t.find("input[type=checkbox]");t.toggleClass("on").find("span").toggleClass("checked");var n=t.find("span.on").hasClass("checked");i.attr("checked",n).trigger("change")}},{key:"move_connection_info_box",value:function(){var e,t,i,n,o,a,s=r(".connection-status"),c=r(".directory-permission-notice"),l=r(".compatibility-older-mysql"),d=r(".mst-required"),m=r(".keep-active-plugins"),u=r(".step-two"),_=r(".backup-options"),h=wpmdb.functions.wpmdb_migration_type();if(s.hide(),c.hide(),u.show(),_.show(),m.show(),l.hide(),d.hide(),wpmdb.functions.wpmdb_toggle_migration_action_text(),r(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb.functions.wpmdb_migration_type()),r.wpmdb.do_action("move_connection_info_box",{migration_type:h,last_migration_type:this.last_replace_switch}),-1!==r.inArray(h,["push","pull"])){var g=r(".pull-push-connection-info"),f=r.trim(g.val()).split("\n"),b=r("."+h+"-list li");if(b.append(this.$connection_info_box),this.$connection_info_box.show(function(){var e=r(this).find(".pull-push-connection-info");e.val()||e.focus()}),h!==this.last_replace_switch&&2===f.length)return wpmdb.force_reconnect=!0,b.append(this.$connection_info_box),g.removeClass("temp-disabled").attr("readonly","readonly"),r(".connect-button").hide(),void wpmdb.functions.connection_box_changed();this.connection_established?(s.hide(),u.show(),wpmdb.functions.wpmdb_toggle_migration_action_text(),"pull"===h?(t=wpmdb.common.connection_data.prefix,i=p.site_details.prefix,n=p.this_uploads_dir,o=p.this_upload_dir_long,a=p.write_permission):(t=p.this_prefix,i=wpmdb.common.connection_data.prefix,n=wpmdb.common.connection_data.uploads_dir,o=wpmdb.common.connection_data.upload_dir_long,a=wpmdb.common.connection_data.write_permissions),r(".table_prefix").html(t),r(".backup-table-prefix").html(i),r(".uploads-dir").html(n),this.maybe_show_backup_disabled_msg(o,a),!1===this.profile_name_edited&&(e=this.get_domain_name(wpmdb.common.connection_data.url),r(".create-new-profile").val(e))):(s.show(),u.hide())}else if(-1!==r.inArray(h,["find_replace","savefile"]))if(s.hide(),u.show(),r(".table-prefix").html(p.this_prefix),!1===this.profile_name_edited&&r(".create-new-profile").val(""),m.hide(),"savefile"===h)_.hide(),l.show(),"false"===p.write_permission&&(c.show(),u.hide());else{if("true"===p.is_multisite){var w=r(".old-replace-col").eq(1);w.parent().removeClass("pin").find(".replace-remove-row").show(),w.find("input").removeAttr("readonly")}this.maybe_show_backup_disabled_msg(p.this_upload_dir_long,p.write_permission)}this.maybe_show_mixed_cased_table_name_warning()}},{key:"maybe_show_backup_disabled_msg",value:function(e,t){var i=r("#create-backup"),n=r("#create-backup-label"),o=r(".backup-option-disabled");i.removeAttr("disabled"),n.removeClass("disabled"),o.hide(),"false"===t&&(i.prop("checked",!1),i.attr("disabled","disabled"),n.addClass("disabled"),o.show(),r(".upload-directory-location").html(e))}},{key:"change_replace_values",value:function(){var e=null,t=null;null!==wpmdb.common.previous_connection_data&&"object"===(0,n.default)(wpmdb.common.previous_connection_data)&&wpmdb.common.previous_connection_data.url!==wpmdb.common.connection_data.url&&(e=this.remove_protocol(wpmdb.common.previous_connection_data.url),t=wpmdb.common.previous_connection_data.path),"push"===wpmdb.functions.wpmdb_migration_type()||"savefile"===wpmdb.functions.wpmdb_migration_type()?("pull"===this.last_replace_switch?r(".replace-row").each(function(){var e=r(".old-replace-col input",this).val();r(".old-replace-col input",this).val(r(".replace-right-col input",this).val()),r(".replace-right-col input",this).val(e)}):"push"===this.last_replace_switch&&"push"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&r(".replace-row").each(function(){var i=r(".replace-right-col input",this).val();i===t&&r(".replace-right-col input",this).val(wpmdb.common.connection_data.path),i===e&&r(".replace-right-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),r.wpmdb.do_action("wpmdb_update_push_table_select"),r("#select-post-types").remove(),r(".exclude-post-types-warning").after(this.$push_post_type_select),wpmdb.functions.exclude_post_types_warning(),r("#select-backup").remove(),r(".backup-tables-wrap").prepend(this.$push_select_backup)):"pull"===wpmdb.functions.wpmdb_migration_type()&&(""===this.last_replace_switch||"push"===this.last_replace_switch||"savefile"===this.last_replace_switch?r(".replace-row").each(function(){var e=r(".old-replace-col input",this).val();r(".old-replace-col input",this).val(r(".replace-right-col input",this).val()),r(".replace-right-col input",this).val(e)}):"pull"===this.last_replace_switch&&"pull"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&r(".replace-row").each(function(){var i=r(".old-replace-col input",this).val();i===t&&r(".old-replace-col input",this).val(wpmdb.common.connection_data.path),i===e&&r(".old-replace-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),r.wpmdb.do_action("wpmdb_update_pull_table_select"),r("#select-post-types").remove(),r(".exclude-post-types-warning").after(this.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),r("#select-backup").remove(),r(".backup-tables-wrap").prepend(this.$pull_select_backup)),this.last_replace_switch=wpmdb.functions.wpmdb_migration_type()}},{key:"switch_to_plugin_tab",value:function(e,t){r(".nav-tab").removeClass("nav-tab-active"),r(".nav-tab."+e).addClass("nav-tab-active"),r(".content-tab").hide(),r("."+e+"-tab").show(),"settings"===e&&!0===this.should_check_licence()&&(r("p.licence-status").append("Checking License... ").append(this.ajax_spinner),this.check_licence()),"help"===e&&(this.refresh_debug_log(),!0===this.should_check_licence()&&(r(".support-content p").append(this.ajax_spinner),this.check_licence())),"addons"===e&&!0!==t&&!0===this.should_check_licence()&&(r(".addons-content p").append(this.ajax_spinner),this.check_licence())}},{key:"hide_overlay",value:function(){r("#overlay").removeClass("show").addClass("hide"),r("#overlay > div").removeClass("show").addClass("hide"),wpmdb.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){r("#overlay").remove()},500),this.migration_completed=!1}},{key:"check_licence",value:function(e){var t=!this.doing_licence_registration_ajax;this.checked_licence=!0;var i=this;r.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:e,context:"all",nonce:p.nonces.check_licence},error:function(e,t,i){alert(l.license_check_problem)},success:function(e){var n,o,a,s=r(".support-content"),c=r(".addons-content"),l=r(".licence-status:not(.notification-message)");if(void 0!==e.dbrains_api_down)o=e.dbrains_api_down+e.message,a=e.dbrains_api_down;else if(void 0!==e.errors){if(void 0!==e.errors.subscription_expired)n=e.errors.subscription_expired.licence,o=e.errors.subscription_expired.support,a=e.errors.subscription_expired.addons;else{var p="";for(var d in e.errors)p+=e.errors[d];o=p,a=p}void 0!==e.addon_content&&(a+="\n"+e.addon_content)}else o=e.message,a=e.addon_content;t&&l.stop().fadeOut(i.fade_duration,function(){void 0===n&&(r(this).css({visibility:"hidden",display:"block"}).slideUp(),n=""),r(this).empty().html(n).stop().fadeIn(i.fade_duration)}),s.stop().fadeOut(i.fade_duration,function(){r(this).empty().html(o).stop().fadeIn(i.fade_duration)}),c.stop().fadeOut(i.fade_duration,function(){r(this).empty().html(a).stop().fadeIn(i.fade_duration)}),r("#plugin-compatibility").is(":not(:checked)")&&r("#compatibility-header").click()}})}},{key:"should_check_licence",value:function(){return!1===this.checked_licence&&"1"===p.has_licence&&"true"===p.is_pro}},{key:"maybe_show_mixed_cased_table_name_warning",value:function(){if(void 0!==wpmdb.common.connection_data&&!1!==wpmdb.common.connection_data){var e=wpmdb.functions.wpmdb_migration_type(),t=wpmdb.functions.get_tables_to_migrate(null,null);r(".mixed-case-table-name-notice").hide(),null!==t&&(t=t.join(""))!==t.toLowerCase()&&("1"===wpmdb.common.connection_data.lower_case_table_names||"push"!==e&&"savefile"!==e)&&("1"!==p.lower_case_table_names&&"pull"===e||("push"===e||"savefile"===e?r(".mixed-case-table-name-notice.push").show():r(".mixed-case-table-name-notice.pull").show()))}}},{key:"enable_pro_licence",value:function(e,t){r(".licence-input, .register-licence").remove(),r(".licence-not-entered").prepend(e.masked_licence),r(".support-content").empty().html("<p>"+l.fetching_license+'<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" /></p>'),this.check_licence(t),r(".migrate-selection label").removeClass("disabled"),r(".migrate-selection input").removeAttr("disabled")}},{key:"get_domain_name",value:function(e){return e.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","")}},{key:"update_domain_placeholder",value:function(e,t,i){var n=this.get_domain_name(t);return"completed"===i?e.replace(/\%s\s?/,"<span class=domain-label>"+n+"</span>&nbsp;"):e.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+n+"$1</span>&nbsp;")}},{key:"get_migration_status_label",value:function(e,t,i){var n="",o="";switch(t){case"push":n=l.push_migration_label_migrating,o=l.push_migration_label_completed;break;case"pull":n=l.pull_migration_label_migrating,o=l.pull_migration_label_completed;break;case"find_replace":n=l.find_replace_label_migrating,o=l.find_replace_label_completed;break;case"savefile":n=l.exporting_please_wait,o=l.exporting_complete}var a=n;return"completed"===i&&(a=o),"push"!==t&&"pull"!==t||(a=this.update_domain_placeholder(a,e,i)),a=r.wpmdb.apply_filters("wpmdb_get_migration_status_label",a,{intent:t,stage:i})}},{key:"disable_export_type_controls",value:function(){r(".option-group").each(function(e){r("input",this).attr("disabled","disabled"),r("label",this).css("cursor","default")})}},{key:"enable_export_type_controls",value:function(){r(".option-group").each(function(e){r("input",this).removeAttr("disabled"),r("label",this).css("cursor","pointer")})}},{key:"set_slider_value",value:function(e,t,i,n){var o=t;void 0!==n&&(o=n),r(".slider",e).slider("value",parseInt(t)),r(".amount",e).html(wpmdb.functions.wpmdb_add_commas(o)+" "+i)}},{key:"set_pause_resume_button",value:function(e,t){!0===this.migration_paused?(this.migration_paused=!1,this.doing_ajax=!0,wpmdb.current_migration.setState(this.previous_progress_title,this.previous_progress_text_primary,"active"),r(".pause-resume").html(l.pause),wpmdb.current_migration.resumeTimer(),wpmdb.functions.execute_next_step(t)):(this.migration_paused=!0,this.doing_ajax=!1,this.paused_text=l.migration_paused,this.previous_progress_title=r(".progress-title").html(),this.previous_progress_text_primary=r(".progress-text",".progress-wrapper-primary").html(),this.previous_progress_text_secondary=r(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===this.migration_intent&&(this.paused_text=l.find_replace_paused),wpmdb.current_migration.setState(this.paused_text,l.completing_current_request,null),r("body").off("click",".pause-resume"),r("body").off("click",".cancel"))}},{key:"filter_temp_tables",value:function(e,t){var i=p.this_temp_prefix;return"pull"===wpmdb.functions.wpmdb_migration_type()&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.temp_prefix&&(i=wpmdb.common.connection_data.temp_prefix),i===t.substring(0,i.length)||e}},{key:"get_table_prefix",value:function(e,t){return r(".table-select-wrap .table-prefix").text()}},{key:"lock_replace_url",value:function(e){!0===e?(r('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),r(".replace-row.pin .arrow-col").addClass("disabled")):(r('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),r(".replace-row.pin .arrow-col").removeClass("disabled"))}},{key:"set_connection_data",value:function(e){window.wpmdb.common.previous_connection_data=wpmdb.common.connection_data,window.wpmdb.common.connection_data=e,r.wpmdb.do_action("wpmdb_connection_data_updated",e)}},{key:"get_max_request_display_info",value:function(e){var t={unit:"MB"};return t.amount=(e/1024).toFixed(2),t}},{key:"establish_remote_connection_from_saved_profile",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=r.trim(r(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==e&&"find_replace"!==e&&"import"!==e&&!this.doing_ajax&&p.is_pro){this.doing_ajax=!0,this.disable_export_type_controls(),r(".connection-status").html(l.establishing_remote_connection),r(".connection-status").removeClass("notification-message error-notice migration-error"),r(".connection-status").append(this.ajax_spinner);var i=wpmdb.functions.wpmdb_migration_type(),n=this;r.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:t[0],key:t[1],intent:i,nonce:p.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:p.profile},error:function(e,t,i){r(".connection-status").html(n.get_ajax_errors(e.responseText,"(#102)",e)),r(".connection-status").addClass("notification-message error-notice migration-error"),r(".ajax-spinner").remove(),n.doing_ajax=!1,n.enable_export_type_controls()},success:function(e){if(r(".ajax-spinner").remove(),n.doing_ajax=!1,n.enable_export_type_controls(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return r(".connection-status").html(e.body),r(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&r(".basic-access-auth-wrapper").show());if(!0!==n.maybe_show_mst_warning(e)){n.maybe_show_ssl_warning(t[0],t[1],e.scheme),wpmdb.functions.maybe_show_prefix_notice(e.prefix),r(".pull-push-connection-info").addClass("temp-disabled"),r(".pull-push-connection-info").attr("readonly","readonly"),r(".connect-button").hide(),r(".connection-status").hide(),r(".step-two").show(),n.connection_established=!0,n.set_connection_data(e),n.move_connection_info_box(),n.maybe_show_mixed_cased_table_name_warning();var i="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(i=wpmdb_loaded_tables),n.$pull_select=wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,i);var o="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&(void 0!==e.select_post_types?(r("#exclude-post-types").attr("checked","checked"),r(".post-type-select-wrap").show(),o=e.select_post_types):o=wpmdb_loaded_post_types);var a=document.createElement("select");r(a).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),r.each(wpmdb.common.connection_data.post_types,function(e,t){var i=r.inArray(t,o);i=-1!==i||!0===wpmdb_convert_exclude_revisions&&"revision"!==t?' selected="selected" ':" ",r(a).append("<option"+i+'value="'+t+'">'+t+"</option>")}),n.$pull_post_type_select=a;var s="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(s=wpmdb_loaded_tables_backup);var c=document.createElement("select");r(c).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup",class:"multiselect"}),r.each(wpmdb.common.connection_data.tables,function(e,t){var i=r.inArray(t,s);i=-1!==i?' selected="selected" ':" ",r(c).append("<option"+i+'value="'+t+'">'+t+" ("+wpmdb.common.connection_data.table_sizes_hr[t]+")</option>")}),n.$push_select_backup=c,"pull"===wpmdb.functions.wpmdb_migration_type()?(r.wpmdb.do_action("wpmdb_update_pull_table_select"),r("#select-post-types").remove(),r(".exclude-post-types-warning").after(n.$pull_post_type_select),r("#select-backup").remove(),r(".backup-tables-wrap").prepend(n.$pull_select_backup),r(".table-prefix").html(e.prefix),r(".uploads-dir").html(p.this_uploads_dir)):(r("#select-backup").remove(),r(".backup-tables-wrap").prepend(n.$push_select_backup)),r.wpmdb.do_action("verify_connection_to_remote_site",wpmdb.common.connection_data)}else r(".connection-status").hide()}})}}},{key:"migrate_table_recursive",value:function(e,t,i){var n=this,o=i||0;if(o>=this.tables_to_migrate.length)if("upload"===this.stage&&wpmdb.current_migration.model.getStageItems("find_replace").length)this.stage="find_replace",this.tables_to_migrate=wpmdb.current_migration.model.getStageItems("find_replace","name"),this.tables_to_migrate=this.tables_to_migrate.map(function(e){return"_mig_"+e}),o=0;else{if("backup"!==this.stage)return r(".progress-label").removeClass("label-visible"),wpmdb.common.hooks=r.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete),wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush),wpmdb.common.hooks=r.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},void wpmdb.functions.execute_next_step();if(-1!==r.inArray(this.migration_intent,["push","pull"])?this.stage="migrate":"import"===this.migration_intent?this.stage="upload":this.stage=this.migration_intent,wpmdb.current_migration.model.setActiveStage(this.stage),"find_replace"!==this.stage&&"migrate"!==this.stage)return void wpmdb.functions.wpmdb_call_next_hook();o=0,this.tables_to_migrate=wpmdb.functions.get_tables_to_migrate(null,null)}var a=0;o===this.tables_to_migrate.length-1&&(a=1);var s=0;-1!==r.inArray(this.migration_intent,["push","pull"])&&1===parseInt(wpmdb.common.connection_data.gzip)&&(s=1);var d={action:"wpmdb_migrate_table",migration_state_id:wpmdb.migration_state_id,table:this.tables_to_migrate[o],stage:this.stage,current_row:e,last_table:a,primary_keys:t,gzip:s,nonce:p.nonces.migrate_table};-1!==r.inArray(this.migration_intent,["push","pull"])&&(d.bottleneck=wpmdb.common.connection_data.bottleneck,d.prefix=wpmdb.common.connection_data.prefix),wpmdb.common.connection_data&&wpmdb.common.connection_data.path_current_site&&wpmdb.common.connection_data.domain&&(d.path_current_site=wpmdb.common.connection_data.path_current_site,d.domain_current_site=wpmdb.common.connection_data.domain),this.doing_ajax=!0,r.ajax({url:c,type:"POST",dataType:"text",cache:!1,timeout:0,data:d,error:function(e,t,i){var a=l.table_process_problem+" "+n.tables_to_migrate[o]+"<br /><br />"+l.status+": "+e.status+" "+e.statusText+"<br /><br />"+l.response+":<br />"+e.responseText;wpmdb.current_migration.setState(l.migration_failed,a,"error"),n.doing_ajax=!1,console.log(e),console.log(t),console.log(i),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(e){n.doing_ajax=!1,e=r.trim(e);var t=wpmdb.functions.wpmdb_parse_json(e),i="";if(!1===t||null===t)return i=""===e||null===e?l.table_process_problem_empty_response+" "+n.tables_to_migrate[o]:n.get_ajax_errors(e,null,null),wpmdb.current_migration.setState(l.migration_failed,i,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();if(void 0!==t.wpmdb_error&&1===t.wpmdb_error)return wpmdb.current_migration.setState(l.migration_failed,t.body,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();var s=n.tables_to_migrate[o];"import"===n.migration_intent&&"find_replace"===n.stage&&(s=s.replace(p.this_temp_prefix,"")),wpmdb.current_migration.setText(),wpmdb.current_migration.model.getStageModel(n.stage).setItemRowsTransferred(s,t.current_row),1===a&&"savefile"===n.migration_intent&&(void 0!==t.dump_filename&&(n.dump_filename=t.dump_filename),void 0!==t.dump_path&&(n.dump_path=t.dump_path)),-1===parseInt(t.current_row)&&(o++,t.current_row="",t.primary_keys=""),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.migrate_table_recursive,args:[t.current_row,t.primary_keys,o]},wpmdb.functions.execute_next_step()}})}},{key:"migration_complete_events",value:function(){if(!1===wpmdb.common.migration_error)if(""===wpmdb.common.non_fatal_errors)if("savefile"!==this.migration_intent&&!0===r("#save_computer").is(":checked")&&wpmdb.current_migration.setText(),this.completed_msg=this.completed_msg+'&nbsp;<div class="dashicons dashicons-yes"></div>',!0===this.migration_cancelled){var e=l.migration_cancelled_success;"find_replace"===this.migration_intent&&(e=l.find_replace_cancelled_success),wpmdb.current_migration.setState(this.completed_msg,e,"cancelled")}else wpmdb.current_migration.setState(this.completed_msg,"","complete");else wpmdb.current_migration.setState(l.completed_with_some_errors,wpmdb.common.non_fatal_errors,"error");r(".migration-controls").addClass("hidden"),wpmdb.common.hooks=[],wpmdb.common.call_stack=[],wpmdb.common.migration_error=!1,this.currently_migrating=!1,this.migration_completed=!0,this.migration_paused=!1,this.migration_cancelled=!1,this.doing_ajax=!1,wpmdb.common.non_fatal_errors="",this.tables_to_migrate=[],r(".progress-label").remove(),r(".migration-progress-ajax-spinner").remove(),r(".close-progress-content").show(),r("#overlay").css("cursor","pointer"),wpmdb.current_migration.model.setMigrationComplete()}},{key:"migration_complete",value:function(){var e=this;if(r(".migration-controls").addClass("hidden"),"savefile"===this.migration_intent){this.currently_migrating=!1;var t=l.migration_complete;if(r("#save_computer").is(":checked")){var i=p.this_download_url+encodeURIComponent(this.dump_filename);r("#gzip_file").is(":checked")&&(i+="&gzip=1"),window.location=i}else t=l.completed_dump_located_at+" "+this.dump_path;!1===wpmdb.common.migration_error&&(wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setState(this.completed_msg,t,"complete"))}else{wpmdb.current_migration.setState(null,l.finalizing_migration,"finalizing");var n={action:"wpmdb_finalize_migration",migration_state_id:wpmdb.migration_state_id,tables:this.tables_to_migrate.join(","),nonce:p.nonces.finalize_migration};-1!==r.inArray(this.migration_intent,["push","pull"])&&(n.prefix=wpmdb.common.connection_data.prefix),this.doing_ajax=!0,r.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:n,error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(l.migration_failed,l.finalize_tables_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==r.trim(t))return wpmdb.current_migration.setState(l.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}})}}},{key:"wpmdb_flush",value:function(){var e=this;"savefile"!==this.migration_intent&&(wpmdb.current_migration.setText(l.flushing),this.doing_ajax=!0,r.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:wpmdb.migration_state_id,nonce:p.nonces.flush},error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(l.migration_failed,l.flush_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==r.trim(t))return wpmdb.current_migration.setState(l.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}}))}},{key:"execute_next_step",value:function(){var e=this;if(0<this.delay_between_requests&&!1===this.flag_skip_delay)setTimeout(function(){this.flag_skip_delay=!0,wpmdb.functions.execute_next_step()},this.delay_between_requests);else if(this.flag_skip_delay=!1,!0===this.migration_paused){r(".migration-progress-ajax-spinner").hide(),wpmdb.current_migration.pauseTimer();var t="";!0===this.is_auto_pause_before_finalize?(t=l.paused_before_finalize,this.is_auto_pause_before_finalize=!1,"find_replace"===wpmdb.functions.wpmdb_migration_type()&&(t=l.find_replace_paused_before_finalize)):t=l.paused,wpmdb.current_migration.setState(null,t,"paused"),r("body").on("click",".pause-resume",function(e){this.set_pause_resume_button(e)}),r("body").on("click",".cancel",function(e){this.cancel_migration(e)}),r(".pause-resume").html(l.resume)}else if(!0===this.migration_cancelled){var i;this.migration_intent=wpmdb.functions.wpmdb_migration_type(),"savefile"===this.migration_intent?i=l.removing_local_sql:"pull"===this.migration_intent?i="backup"===this.stage?l.removing_local_backup:l.removing_local_temp_tables:"push"===this.migration_intent&&(i="backup"===this.stage?l.removing_remote_sql:l.removing_remote_temp_tables),wpmdb.current_migration.setText(i);var n={action:"wpmdb_cancel_migration",migration_state_id:wpmdb.migration_state_id,nonce:p.nonces.cancel_migration};this.doing_ajax=!0,r.ajax({url:c,type:"POST",dataType:"text",cache:!1,data:n,error:function(t,i,n){wpmdb.current_migration.setState(l.migration_cancellation_failed,l.manually_remove_temp_files+"<br /><br />"+l.status+": "+t.status+" "+t.statusText+"<br /><br />"+l.response+":<br />"+t.responseText,"error"),console.log(t),console.log(i),console.log(n),e.doing_ajax=!1,wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,t=r.trim(t),"push"===e.migration_intent&&"1"!==t||"push"!==e.migration_intent&&""!==t)return void 0!==t&&void 0!==t.wpmdb_error&&1===t.wpmdb_error&&(t=t.wpmdb_error),wpmdb.current_migration.setState(l.migration_cancellation_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();e.completed_msg=l.migration_cancelled,"find_replace"===e.migration_intent&&(e.completed_msg=l.find_replace_cancelled),wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setStatus("cancelled")}})}else wpmdb.common.next_step_in_migration.fn.apply(null,wpmdb.common.next_step_in_migration.args)}},{key:"maybe_show_prefix_notice",value:function(e){var t=r(".prefix-notice");t.hide(),e!==p.this_prefix&&(r(".remote-prefix").html(e),this.show_prefix_notice=!0,t.show())}},{key:"maybe_show_mst_warning",value:function(e){var t=wpmdb.functions.wpmdb_migration_type(),i=!1;return-1!==r.inArray(t,["push","pull"])&&void 0!==e.site_details?p.site_details.is_multisite!==e.site_details.is_multisite&&(void 0!==wpmdb.mst&&void 0!==e.mst_available&&"1"===e.mst_available||(i=!0)):"import"===t&&void 0!==e.multisite&&void 0!==e.subsite_export&&("false"===p.site_details.is_multisite&&"true"===e.multisite&&"true"!==e.subsite_export||"true"===p.site_details.is_multisite&&"false"===e.multisite)&&(i=!0),(i=r.wpmdb.apply_filters("wpmdb_show_mst_warning",i))&&r(".mst-required").show(),i}},{key:"maybe_show_select_table_notice",value:function(){if(r("#migrate-selected").is(":checked")&&null===r("#select-tables").val()){if("import"!==wpmdb.functions.wpmdb_migration_type())return alert(l.please_select_one_table),!0;if(r("#import-find-replace").is(":checked")&&r("#select-tables").is(":visible"))return alert(l.please_select_one_table_import),!0}return!("savefile"===wpmdb.functions.wpmdb_migration_type()||!r("#backup-manual-select").is(":checked")||null!==r("#select-backup").val())&&(alert(l.please_select_one_table_backup),!0)}},{key:"remove_protocol",value:function(e){return e.replace(/^https?:/i,"")}},{key:"create_table_select",value:function(e,t,i){var n=document.createElement("select");return r(n).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<e.length&&r.each(e,function(e,o){if(!r.wpmdb.apply_filters("wpmdb_exclude_table",!1,o)){var a=" ";void 0!==i&&null!==i&&0<i.length&&-1!==r.inArray(o,i)&&(a=' selected="selected" ');var s="";0!==t.length&&(s=" ("+t[o]+")"),r(n).append("<option"+a+'value="'+o+'">'+o+s+"</option>")}}),n}},{key:"get_tables_to_migrate",value:function(){var e=[],t=wpmdb.functions.wpmdb_migration_type();return"migrate_select"===r("input[name=table_migrate_option]:checked").val()?e=r("#select-tables").val():"pull"!==t&&void 0!==p.this_prefixed_tables?e=p.this_prefixed_tables:"pull"===t&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.prefixed_tables&&(e=wpmdb.common.connection_data.prefixed_tables),e}},{key:"update_migrate_button_text",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=r("#save-migration-profile").is(":checked")?"_save":"",i="migrate_button_"+("savefile"===e?"export":e)+t;r(".migrate-db .button-primary").val(l[i])}},{key:"connection_box_changed",value:function(){var e=this,t=r(".pull-push-connection-info");if(-1!==r.inArray(wpmdb.functions.wpmdb_migration_type(),["push","pull"])&&(!this.doing_ajax&&!r(t).hasClass("temp-disabled")||!1!==wpmdb.force_reconnect)){wpmdb.force_reconnect=!1;var i=r(".pull-push-connection-info").val(),n=r.trim(i).split("\n"),o=!1,a="";if(""===n&&(o=!0,a=l.connection_info_missing),1===n.length&&!o){var s=r.trim(i).split(" ");2===s.length&&(n=s)}2===n.length||o||(o=!0,a=l.connection_info_incorrect),o||this.validate_url(n[0])||(o=!0,a=l.connection_info_url_invalid);var d=0;if(void 0!==n[1]&&(d=n[1].length),o||32===d||40===d||(o=!0,a=l.connection_info_key_invalid),o||n[0]!==p.connection_info[0]||(o=!0,a=l.connection_info_local_url),o||n[1]!==p.connection_info[1]||(o=!0,a=l.connection_info_local_key),o)return r(".connection-status").html(a),void r(".connection-status").addClass("notification-message error-notice migration-error");var m=n[0]+"\n"+n[1];1===r.trim(i).split("\n").length&&r(".pull-push-connection-info").val(m),!1===p.openssl_available&&(n[0]=n[0].replace("https://","http://"),m=n[0]+"\n"+n[1],r(".pull-push-connection-info").val(m)),this.show_prefix_notice=!1,this.doing_ajax=!0,this.disable_export_type_controls(),r(".basic-access-auth-wrapper").is(":visible")&&(n[0]=n[0].replace(/\/\/(.*)@/,"//"),n[0]=n[0].replace("//","//"+encodeURIComponent(r.trim(r(".auth-username").val()))+":"+encodeURIComponent(r.trim(r(".auth-password").val()))+"@"),m=n[0]+"\n"+n[1],r(".pull-push-connection-info").val(m),r(".basic-access-auth-wrapper").hide()),r(".step-two").hide(),r(".ssl-notice").hide(),r(".prefix-notice").hide(),r(".connection-status").show(),r(".connection-status").html(l.establishing_remote_connection),r(".connection-status").removeClass("notification-message error-notice migration-error"),r(".connection-status").append(this.ajax_spinner);var u=wpmdb.functions.wpmdb_migration_type();return this.profile_name_edited=!1,r.ajax({url:c,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:n[0],key:n[1],intent:u,nonce:p.nonces.verify_connection_to_remote_site},error:function(t,i,n){r(".connection-status").html(e.get_ajax_errors(t.responseText,"(#100)",t)),r(".connection-status").addClass("notification-message error-notice migration-error"),r(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls()},success:function(t){if(r(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls(),void 0!==t.wpmdb_error&&1===t.wpmdb_error)return r(".connection-status").html(t.body),r(".connection-status").addClass("notification-message error-notice migration-error"),t.body.indexOf("401 Unauthorized")>-1&&r(".basic-access-auth-wrapper").show(),void(r(".pull-push-connection-info").hasClass("temp-disabled")||r(".connect-button").is(":visible")||(r(".pull-push-connection-info").removeAttr("readonly"),r(".connect-button").show()));if(!0!==e.maybe_show_mst_warning(t)){e.maybe_show_ssl_warning(n[0],n[1],t.scheme);var i=e.get_domain_name(t.url);r(".create-new-profile").val(i),r(".pull-push-connection-info").addClass("temp-disabled"),r(".pull-push-connection-info").attr("readonly","readonly"),r(".connect-button").hide(),r(".connection-status").hide(),r(".step-two").show(),wpmdb.functions.maybe_show_prefix_notice(t.prefix),e.connection_established=!0,e.set_connection_data(t),e.move_connection_info_box(),e.change_replace_values(),e.maybe_show_mixed_cased_table_name_warning(),e.refresh_table_selects(null,null,e),e.$push_select_backup=r(e.$pull_select).clone(),r(e.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var o=document.createElement("select");r(o).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),r.each(wpmdb.common.connection_data.post_types,function(e,t){r(o).append('<option value="'+t+'">'+t+"</option>")}),e.$pull_post_type_select=o,r("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb.functions.wpmdb_migration_type()?(r("#new-url").val(e.remove_protocol(p.this_url)),r("#new-path").val(p.this_path),"true"===p.is_multisite&&(r("#new-domain").val(p.this_domain),r('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(t.url))),r("#old-url").val(e.remove_protocol(t.url)),r("#old-path").val(t.path),r.wpmdb.do_action("wpmdb_update_pull_table_select"),r("#select-post-types").remove(),r(".exclude-post-types-warning").after(e.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),r(".table-prefix").html(t.prefix),r(".backup-table-prefix").html(p.site_details.prefix),r(".uploads-dir").html(p.this_uploads_dir)):(r("#new-url").val(e.remove_protocol(t.url)),r("#new-path").val(t.path),"true"===p.is_multisite&&r('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(p.this_url)),r.wpmdb.do_action("wpmdb_update_push_table_select"),r("#select-backup").remove(),r(".backup-tables-wrap").prepend(e.$push_select_backup)),wpmdb.common.next_step_in_migration={fn:r.wpmdb.do_action,args:["verify_connection_to_remote_site",wpmdb.common.connection_data]},wpmdb.functions.execute_next_step()}else r(".connection-status").hide()}})}}}]),e}();t.default=d},function(e,t,i){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(i(3));var o=jQuery,a=i(53),s=i(55),r=o('<div id="overlay" class="hide"></div>'),c=o(".progress-content").clone().addClass("hide"),l=o(".pro-version").addClass("hide");r.append(l);var p={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,timerStart:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(e){this.$progress.find(".progress-title").html(e),this.title=e},setStatus:function(e){this.$progress.removeClass(this.status).addClass("error"===e?"wpmdb-error":e),"error"===e&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=e,this.updateTitleElem()},setText:function(e){"string"!=typeof e&&(e=""),0>=e.indexOf("wpmdb_error")&&(e=this.decodeErrorObject(e)),this.$progress.find(".progress-text").html(e),this.text=e},setState:function(e,t,i){null!==e&&this.setTitle(e),null!==t&&this.setText(t),null!==i&&this.setStatus(i)},startTimer:function(){this.timerStart=Date.now(),this.timerCount=0,this.counterDisplay=o(".timer"),this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},getTimerCountInSeconds:function(){return Math.floor((Date.now()-this.timerStart)/1e3)},pauseTimer:function(){this.pausedAt=Date.now(),clearInterval(this.elapsedInterval)},resumeTimer:function(){this.timerStart+=Date.now()-this.pausedAt,this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},incrementTimer:function(){this.timerCount=this.getTimerCountInSeconds(),this.displayCount()},displayCount:function(){var e=Math.floor(this.timerCount/3600)%24,t=Math.floor(this.timerCount/60)%60,i=this.timerCount%60,n=this.pad(e,2,0)+":"+this.pad(t,2,0)+":"+this.pad(i,2,0);this.counterDisplay.html(n)},updateTitleElem:function(){var e=this.model.get("activeStageName"),t=this.model.getStageModel(e),i=Math.max(0,t.getTotalProgressPercent()),n=this.model.get("stages").length,o=this.currentStageNum,a=this.status,s=wpmdb_strings.title_progress;"complete"===t.get("status")&&0===t.get("totalSize")&&(i=100),s=(s=(s=s.replace("%1$s",i+"%")).replace("%2$s",o)).replace("%3$s",n),1===n&&(s=i+"%"),wpmdb_strings["title_"+a]&&(s=wpmdb_strings["title_"+a]),s=s+" - "+this.originalTitle,document.title=s},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e},decodeErrorObject:function(e){var t=e.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{t=JSON.parse(t)}catch(t){return e}return"object"===(void 0===t?"undefined":(0,n.default)(t))&&void 0!==t.body?t:e},fixProgressStageWidthForScrollBar:function(){var e=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),t=this.$wrapper.find(".active .progress-items"),i=parseInt(t.css("padding-left"),10),n=parseInt(t.css("padding-right"),10);(0!==e||0===e&&n!==i)&&t.css("padding-right",i-e+"px")}},newMigration:function(e){o("#overlay").remove(),o(".progress-content").remove(),this.migration.$overlay=r.clone(),o("#wpwrap").append(this.migration.$overlay),this.migration.model=new a(e),this.migration.view=new s({model:this.migration.model}),this.migration.$progress=c.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var t=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var i=this;return setTimeout(function(){i.migration.$overlay.add(i.migration.$progress).add(i.migration.$proVersion).removeClass("hide").addClass("show"),i.migration.$proVersion.length&&setTimeout(function(){i.migration.$proVersion.find(".iframe").append(t)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){i.migration.$proVersion.find("iframe").remove(),i.migration.$proVersion.addClass("hide remove"),setTimeout(function(){i.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){i.utils.updateProgTableVisibilitySetting(),i.utils.updatePauseBeforeFinalizeSetting(),i.migration.pauseTimer()}),o(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:i(57)};e.exports=p},function(e,t){window.jQuery;jQuery(function(){jQuery(".wpmdb-opt-usage-tracking").on("click",function(e){e.preventDefault();var t=!!e.target.classList.contains("opt-yes");jQuery(".wpmdb-usage-tracking-notice .links").text(t?"Thanks!":"Done."),jQuery(".wpmdb-usage-tracking-notice").delay(1e3).fadeOut(200);var i=jQuery("#allow_tracking-wrap");if(t){if(!i.hasClass("on"))return void i.trigger("click")}else if(i.hasClass("on"))return void i.trigger("click");i.find("input[type=checkbox]").trigger("change")})})},function(e,t){window.jQuery},function(e,t){window.jQuery},function(e,t){window.jQuery},function(e,t){window.jQuery},function(e,t){window.jQuery}]);
  //# sourceMappingURL=bundle-106.js.map