/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
wp-migrate-db
/
frontend
/
build-free
/
static
/
js
/
Upload File
HOME
(this.webpackJSONPwpmdb=this.webpackJSONPwpmdb||[]).push([[6],{604:function(t,e,n){"use strict";n.r(e),n.d(e,"setConnectionStatus",function(){return E}),n.d(e,"setConnectionStatusBatch",function(){return N}),n.d(e,"resetMigration",function(){return R}),n.d(e,"updateConnectionState",function(){return A}),n.d(e,"setError",function(){return L}),n.d(e,"copyLicenseToRemote",function(){return U}),n.d(e,"updatePluginOnRemote",function(){return B}),n.d(e,"retryOverHTTP",function(){return D}),n.d(e,"shouldShowSSLNotice",function(){return M}),n.d(e,"setConnectedProfileName",function(){return V}),n.d(e,"handleTableSelects",function(){return z}),n.d(e,"connectToRemote",function(){return W}),n.d(e,"changeConnection",function(){return q});var r=n(12),a=n(2),c=n(4),i=n.n(c),o=n(8),u=n(20),s=n.n(u),l=n(9),p=n(1),b=n(5),f=function(t){var e=0,n=window.WPMDBStore.getState();if(0===t.length)return window.wpmdb_strings.connection_info_missing;var a=function(t){var e=t.split("\n"),n=t;if(1===e.length){var r=t.trim().split(" ");2===r.length&&(!1===window.wpmdb_data.openssl_available&&(r[0]=r[0].replace("https://","http://")),n=r[0]+"\n"+r[1])}return n}(t),c=a.split("\n"),i=Object(r.a)(c,2),o=i[0],u=i[1];return Object(b.r)(o)?("undefined"!==typeof u&&(e=u.length),32!==e&&40!==e?window.wpmdb_strings.connection_info_key_invalid:o===window.wpmdb_data.connection_info[0]?window.wpmdb_strings.connection_info_local_url:u===n.settings.key?window.wpmdb_strings.connection_info_local_key:{url:o,key:u,str:a}):window.wpmdb_strings.connection_info_url_invalid},_=n(6),d=n(254),h=n(60),m=n(144),O=n(3),j=n(24),v=n(76),g=n(13),w=n(35),y=n(308),k=n(40),x=n(125),S=function(t){var e,n=t.remote_site,r=t.local_site;switch(t.intent){case"pull":e={domain:{search:Object(b.m)(n.url),replace:Object(b.m)(r.this_url)},path:{search:n.path,replace:r.this_path}};break;case"push":e={domain:{search:Object(b.m)(r.this_url),replace:Object(b.m)(n.url)},path:{search:r.this_path,replace:n.path}};break;case"import":e={domain:{search:Object(b.m)(n.URL),replace:Object(b.m)(r.this_url)},path:{search:n.path,replace:r.this_path}}}return e.domain.enabled=!0,e.path.enabled=!0,e},T=n(28);function P(t,e,n){return function(r,a){var c=a();r({type:"UPDATE_REMOTE_SITE",payload:t.data});var i=S({intent:n,remote_site:t.data,local_site:c.migrations.local_site});i=r(Object(k.a)("wpmdb_standard_replace_values",i)),r(Object(T.f)(i)),r(Object(j.i)("push"===n));var o="pull"===n?t.data.prefix:c.migrations.local_site.this_prefix,u="pull"===n?c.migrations.local_site.this_prefix:t.data.prefix;return r(Object(j.k)(o,u)),["push","pull"].includes(n)&&(r(Object(j.m)("true"===t.data.site_details.is_multisite&&"true"===c.migrations.local_site.is_multisite)),r(Object(_.a)(g.k,{local_site_mode:void 0!==c.settings.high_performance_transfers?c.settings.high_performance_transfers:c.migrations.local_site.site_details.high_performance_transfers,remote_site_mode:t.data.site_details.high_performance_transfers}))),!!e&&(r(function(t){return function(e){e({type:g.l,connected:t})}}(e)),r(function(t,e){return function(n,r){r().migrations.local_site.this_prefix!==t.data.prefix&&n(Object(_.a)("SET_CONNECTION_STATUS",{key:"prefix_mismatch",statusVal:!0})),Object(b.k)(e,r())&&n(Object(j.g)())}}(t,n)))}}var C=function(t){t.connectionState;var e=t.result,n=void 0===e?null:e,r=t.intent,c=void 0===r?null:r;return function(t,e){Object(l.b)(function(){var r=M(e()),u=Object(a.a)(Object(a.a)({},x.a),{},{button_status:"hidden"});r&&(u.ssl_notice=!0),t(N(u)),t(z(Object(O.e)("this_tables",e()),n.data.tables,Object(O.d)(["intent","tables_selected","backup_option","backup_tables_selected"],e()))),t(Object(j.b)(!0)),!1!==t(P(n,!0,c))&&(t(V()),t(function(t,e){var n=["database","save_profile","theme_plugin_files"];null===Object(O.d)("selected_existing_profile",e())&&n.push("custom_fields","standard_fields","multisite_tools"),Object(m.a)("status",e()).ssl_notice&&n.push("connect"),t(Object(k.a)("postConnectionPanelsOpen",n)),Object(l.b)(function(){t(Object(w.k)(n)),t(Object(k.b)("postConnectionPanels")),t(Object(w.a)("database","connect"))})}),t(function(){var t=Object(o.a)(i.a.mark(function t(e){var n;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=[],window.hasOwnProperty("wpmdbmf")&&n.push("media_files"),window.hasOwnProperty("wpmdbtp")&&n.push("theme_plugin_files"),n.length>0&&(e(Object(w.b)(n)),e(Object(y.addonsLoaded)()));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()))})}},E=function(t,e){return Object(_.a)(d.a,{key:t,statusVal:e})},N=function(t){return function(e){e(Object(_.a)(d.b,t))}},R=function(t){return Object(_.a)(h.b,t)},A=function(t){return Object(_.a)(d.c,t)},L=function(t){return Object(_.a)(d.a,{key:"error",statusVal:t})},U=function(){return function(){var t=Object(o.a)(i.a.mark(function t(e,n){var r,a;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=n(),a=r.migrations.connection_info.connection_state,t.next=4,Object(b.b)("/copy-license-to-remote",{url:a.url,key:a.key});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},B=function(t){return function(){var e=Object(o.a)(i.a.mark(function e(n,r){var a,c,o;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=r(),c=a.migrations.connection_info.connection_state,e.prev=2,e.next=5,Object(b.b)("/update-plugin-on-remote",{url:c.url,key:c.key,slug:t});case 5:o=e.sent,e.next=15;break;case 8:if(e.prev=8,e.t0=e.catch(2),"AbortError"!==e.t0.name){e.next=13;break}return console.log("fetch aborted",e.t0),e.abrupt("return");case 13:return n(H(e.t0.message)),e.abrupt("return",!1);case 15:return e.abrupt("return",o);case 16:case"end":return e.stop()}},e,null,[[2,8]])}));return function(t,n){return e.apply(this,arguments)}}()},D=function(){return function(){var t=Object(o.a)(i.a.mark(function t(e,n){var r,c,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=n(),c=Object(a.a)({},r.migrations.connection_info.connection_state),o=r.migrations.current_migration.intent,c.url=c.url.replace("https","http"),c.value=c.value.replace("https","http"),e(E("retry_over_http",!0)),e(A(c)),e(W(o));case 8:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},M=function(t){return Object(m.a)("status",t).retry_over_http},V=function(){return function(t,e){var n=Object(O.d)("intent",e()),r=Object(O.e)("url",e());s()(["push","pull"],n)&&(r=Object(O.h)("url",e()));var a=r.replace(/(^\w+:|^)\/\//,""),c="push"===n?Object(p.b)(Object(p.a)("Push to %s","wp-migrate-db"),a):Object(p.b)(Object(p.a)("Pull from %s","wp-migrate-db"),a);t(Object(j.e)(c))}},I=function(t){return function(e){var n=new AbortController;return e(Object(_.a)("SET_ABORT_CONTROLLER",{key:t,controller:n})),n}},J=function(t){return function(e){Object(l.b)(function(){e(N({connecting:!0,button_status:"disabled"})),e(A(Object(a.a)({},t)))})}},z=function(t,e,n){var a=Object(r.a)(n,4),c=a[0],i=a[1],o=a[2],u=a[3];return function(n,r){var a=t,s=e;"pull"===c&&(a=e,s=t);var l=a.filter(function(t){return i.includes(t)});if(l.length!==i.length&&n({type:g.D,payload:l}),"backup_manual_select"===o){var p=s.filter(function(t){return u.includes(t)});p.length!==u.length&&n({type:g.x,payload:p})}}},H=function(t){return function(e,n){var r,a=Object(v.a)(t);e((r=a,function(){var t=Object(o.a)(i.a.mark(function t(e,n){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(M(n())&&e(E("ssl_notice",!0)),!r.includes("#197")){t.next=5;break}return e(D()),t.abrupt("return");case 5:r.includes("401 Unauthorized")&&e(N({show_auth_form:!0})),r.includes("#195")&&e(E("copy_to_remote",!0)),r.includes("#196")&&e(E("update_plugin_on_remote",!0)),e(E("error_msg",r));case 9:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}())),Object(m.a)("status",n()).retry_over_http?e(N({retry_over_http:!1,ssl_notice:!0})):e(function(t,e){t(Object(_.a)(h.b,["connect"])),t(N({error:!0,button_status:"",connecting:!1}))})}},W=function(t){return function(){var e=Object(o.a)(i.a.mark(function e(n,r){var a,c,o,u;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=Object(O.f)("connection_info",r()),c=a.connection_state,o=n(I("connect_to_remote")),n(J(c)),e.prev=3,e.next=6,Object(b.b)("/verify-connection",{url:c.url,key:c.key,intent:t},o);case 6:u=e.sent,e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(3),"AbortError"!==e.t0.name){e.next=14;break}return console.log("fetch aborted",e.t0),e.abrupt("return");case 14:return n(H(e.t0.message)),e.abrupt("return",!1);case 16:if(u.success){e.next=19;break}return n(H(u)),e.abrupt("return");case 19:return n(C({connectionState:c,result:u,intent:t})),e.abrupt("return",u);case 21:case"end":return e.stop()}},e,null,[[3,9]])}));return function(t,n){return e.apply(this,arguments)}}()},q=function(t){return function(){var e=Object(o.a)(i.a.mark(function e(n,r){var c,o,u,s,p,b,_;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c=r(),o=c.migrations.current_migration.intent,u=c.migrations.connection_info.status.pasted,n(N({error:!1,button_status:""})),s=t.connection_state,p=f(t),b=Object(a.a)(Object(a.a)({},s),{},{value:p.str,url:p.url,key:p.key}),"string"!==typeof p){e.next=11;break}return _=Object(a.a)(Object(a.a)({},s),{},{value:t}),Object(l.b)(function(){n(A(_)),n(N({error:!0,button_status:"disabled",error_msg:p}))}),e.abrupt("return",p);case 11:n(A(b)),u&&Object(l.b)(function(){n(W(o,!0)),n(E("pasted",!1))});case 13:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()}}}]);