(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["tools-partials-BackupSettings-vue"],{1407:function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("core-card",{staticClass:"aioseo-backup-settings",attrs:{slug:"backupSettings",toggles:!1,"no-slide":"","header-text":t.strings.backupSettings},scopedSlots:t._u([{key:"header-icon",fn:function(){return[s("svg-history")]},proxy:!0}])},[t.backupsDeleteSuccess?s("core-alert",{attrs:{type:"green"}},[t._v(" "+t._s(t.strings.backupSuccessfullyDeleted)+" ")]):t._e(),t.backupsRestoreSuccess?s("core-alert",{attrs:{type:"green"}},[t._v(" "+t._s(t.strings.backupSuccessfullyRestored)+" ")]):t._e(),t.backups.length?t._e():s("div",{staticClass:"aioseo-section-description"},[t._v(" "+t._s(t.strings.noBackups)+" ")]),t.backups.length?[s("div",{staticClass:"backups-table"},[s("div",{staticClass:"backups-rows"},t._l(t.backups,(function(e,o){return s("div",{key:o,staticClass:"backup-row",class:{even:0===o%2}},[s("div",{staticClass:"backup-name",domProps:{innerHTML:t._s(t.getBackupName(e))}}),s("div",{staticClass:"backup-actions"},[s("core-tooltip",{attrs:{type:"action"},scopedSlots:t._u([{key:"tooltip",fn:function(){return[t._v(" "+t._s(t.strings.restore)+" ")]},proxy:!0}],null,!0)},[s("svg-refresh",{nativeOn:{click:function(s){return t.maybeRestoreBackup(e)}}})],1),s("core-tooltip",{attrs:{type:"action"},scopedSlots:t._u([{key:"tooltip",fn:function(){return[t._v(" "+t._s(t.strings.delete)+" ")]},proxy:!0}],null,!0)},[s("svg-trash",{nativeOn:{click:function(s){return t.maybeDeleteBackup(e)}}})],1)],1)])})),0)])]:t._e(),s("base-button",{attrs:{type:"blue",size:"medium",loading:t.loading},on:{click:t.processCreateBackup}},[s("svg-circle-plus"),t._v(" "+t._s(t.strings.createBackup)+" ")],1),t.showModal?s("core-modal",{attrs:{"no-header":""},scopedSlots:t._u([{key:"body",fn:function(){return[s("div",{staticClass:"aioseo-modal-body"},[s("button",{staticClass:"close",on:{click:function(e){e.stopPropagation(),t.showModal=!1}}},[s("svg-close",{on:{click:function(e){t.showModal=!1}}})],1),s("h3",[t._v(t._s(t.areYouSure))]),s("div",{staticClass:"reset-description",domProps:{innerHTML:t._s(t.strings.actionCannotBeUndone)}}),s("base-button",{attrs:{type:"blue",size:"medium"},on:{click:t.processBackupAction}},[t._v(" "+t._s(t.iAmSure)+" ")]),s("base-button",{attrs:{type:"gray",size:"medium"},on:{click:function(e){t.showModal=!1}}},[t._v(" "+t._s(t.strings.noChangedMind)+" ")])],1)]},proxy:!0}],null,!1,1131809547)}):t._e()],2)},c=[],a=s("5530"),u=s("2f62"),i={data:function(){return{timeout:null,backupToDelete:null,backupToRestore:null,backupsDeleteSuccess:!1,showModal:!1,backupsRestoreSuccess:!1,loading:!1,strings:{backupSettings:this.$t.__("Backup Settings",this.$td),areYouSureDeleteBackup:this.$t.__("Are you sure you want to delete this backup?",this.$td),areYouSureRestoreBackup:this.$t.__("Are you sure you want to restore this backup?",this.$td),yesDeleteBackup:this.$t.__("Yes, I want to delete this backup",this.$td),yesRestoreBackup:this.$t.__("Yes, I want to restore this backup",this.$td),noChangedMind:this.$t.__("No, I changed my mind",this.$td),actionCannotBeUndone:this.$t.__("This action cannot be undone.",this.$td),noBackups:this.$t.__("You have no saved backups.",this.$td),createBackup:this.$t.__("Create Backup",this.$td),restore:this.$t.__("Restore",this.$td),delete:this.$t.__("Delete",this.$td),backupSuccessfullyDeleted:this.$t.__("Success! The backup was deleted.",this.$td),backupSuccessfullyRestored:this.$t.__("Success! The backup was restored.",this.$td)}}},computed:Object(a["a"])(Object(a["a"])({},Object(u["e"])(["backups"])),{},{areYouSure:function(){return this.backupToDelete?this.strings.areYouSureDeleteBackup:this.strings.areYouSureRestoreBackup},iAmSure:function(){return this.backupToDelete?this.strings.yesDeleteBackup:this.strings.yesRestoreBackup}}),methods:Object(a["a"])(Object(a["a"])({},Object(u["b"])(["createBackup","deleteBackup","restoreBackup"])),{},{processCreateBackup:function(){var t=this;this.loading=!0,this.createBackup().then((function(){t.loading=!1}))},maybeDeleteBackup:function(t){this.showModal=!0,this.backupToDelete=t},maybeRestoreBackup:function(t){this.showModal=!0,this.backupToRestore=t},processDeleteBackup:function(){var t=this;this.loading=!0,this.deleteBackup(this.backupToDelete).then((function(){clearTimeout(t.timeout),t.loading=!1,t.showModal=!1,t.backupToDelete=null,t.backupsDeleteSuccess=!0,t.timeout=setTimeout((function(){t.backupsDeleteSuccess=!1,t.backupsRestoreSuccess=!1}),3e3)}))},processRestoreBackup:function(){var t=this;this.loading=!0,this.restoreBackup(this.backupToRestore).then((function(){clearTimeout(t.timeout),t.loading=!1,t.showModal=!1,t.backupToRestore=null,t.backupsRestoreSuccess=!0,t.timeout=setTimeout((function(){t.backupsDeleteSuccess=!1,t.backupsRestoreSuccess=!1}),3e3)}))},getBackupName:function(t){return this.$t.sprintf(this.$t.__("%1$s at %2$s",this.$td),""+this.$moment(1e3*t).tz(this.$moment.tz.guess()).format("MMMM D, YYYY")+"",""+this.$moment(1e3*t).tz(this.$moment.tz.guess()).format("h:mmA z")+"")},processBackupAction:function(){return this.backupToDelete?this.processDeleteBackup():this.processRestoreBackup()}})},n=i,r=(s("da9b"),s("2877")),l=Object(r["a"])(n,o,c,!1,null,null,null);e["default"]=l.exports},da9b:function(t,e,s){"use strict";s("e04a")},e04a:function(t,e,s){}}]);