"use strict";(self.webpackChunkcomplianz_gdpr=self.webpackChunkcomplianz_gdpr||[]).push([[8708,6745],{48708:(t,e,a)=>{a.r(e),a.d(e,{default:()=>p});var n=a(51609),s=a(16745),i=a(86087),l=a(45111),o=a(27723),r=a(56427),c=a(4219);const p=(0,i.memo)((()=>{const{progress:t,active:e,start:a,next:p,total:m,copySites:u}=(0,s.default)(),[g,d]=(0,i.useState)(!1),{addHelpNotice:f,removeHelpNotice:y}=(0,c.default)();return(0,i.useEffect)((()=>{t<100?e&&((async()=>{await u(!1)})(),f("copy-multisite","warning",(0,o.__)("Complianz is currently copying settings of site %1$s to %2$s of %3$s sites.","complianz-gdpr").replace("%1$s",a).replace("%2$s",p).replace("%3$s",m),(0,o.__)("Copying settings...","complianz-gdpr"),!1)):y("copy-multisite")}),[t]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"cmplz-export-container"},(0,n.createElement)(r.__experimentalConfirmDialog,{isOpen:g,onConfirm:async()=>{d(!1),await u(!0)},onCancel:()=>{d(!1)}},(0,o.__)("Are you sure? This will overwrite the settings in all your subsites with the Complianz settings of this site.","complianz-gdpr")),(0,n.createElement)("button",{className:"button button-default",onClick:()=>d(!0)},(0,o.__)("Start","complianz-gdpr"),e&&(0,n.createElement)(n.Fragment,null," ",t,"%",(0,n.createElement)(l.default,{name:"loading",color:"grey"})))))}))},16745:(t,e,a)=>{a.r(e),a.d(e,{default:()=>i});var n=a(81621),s=a(9588);const i=(0,n.vt)(((t,e)=>({progress:0,total:0,start:0,next:0,active:!1,copySites:async e=>{let a={restart:e};t({active:!0});const{start:n,next:i,total:l}=await s.doAction("copy_multisite",a).then((t=>t));let o=Math.round(i/l*100);t({progress:o,start:n,next:i,total:l}),o>=100&&t({active:!1})}})))}}]);