(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[5151],{15151(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>b});var t=__webpack_require__(303280);__webpack_require__.n(t);var e=__webpack_require__(860012);var a=__webpack_require__(48084);var n=__webpack_require__(408685);var i=__webpack_require__(848574);var r=__webpack_require__(556734);var c=__webpack_require__(126528);var l=__webpack_require__(68940);var o=__webpack_require__(917214);var d=__webpack_require__(199448);var s=__webpack_require__(682988);var g=__webpack_require__(518176);var u=__webpack_require__(378831);var y=__webpack_require__(184899);var f=__webpack_require__(143195);var v=__webpack_require__(79222);var m=__webpack_require__(499749);var p=__webpack_require__(626481);var E=__webpack_require__(732806);var w=__webpack_require__(365161);var _=__webpack_require__(559167);let b=b=>{let S=(0,t.c)(52);let{isOnboarding:h}=b;let k=h===undefined?!1:h;let{trackEvent:B,createEventBuilder:A}=(0,g.s)();let T=(0,o.P)();let R=(0,a.wA)();let{setIsBackupAndSyncFeatureEnabled:C,error:I}=(0,d.e)();let M=(0,a.d4)(E.$lR);let P=(0,a.d4)(E.IiS);let J=(0,a.d4)(y.Qz);let L=(0,a.d4)(E.R0A);let D=(0,a.d4)(y.Qy);let x=(0,a.d4)(f.JU);let F=k?L:J;let N;S[0]!==A||S[1]!==F||S[2]!==x||S[3]!==B?(N=t=>{B(A(s.gP.SettingsUpdated).addCategory(s.FZ.Settings).addProperties({settings_group:"backup_and_sync",settings_type:"main",old_value:F,new_value:t,was_notifications_on:x}).build())},S[0]=A,S[1]=F,S[2]=x,S[3]=B,S[4]=N):N=S[4];let W=N;let Y;let $;S[5]!==R||S[6]!==J||S[7]!==M||S[8]!==k||S[9]!==L||S[10]!==P||S[11]!==C?(Y=()=>{if(k){P===!1&&L===!0&&R((0,w.tW)());return}M===!1&&J&&(async()=>{try{await C(n.f.main,!1),await C(n.f.accountSyncing,!1),await C(n.f.contactSyncing,!1)}catch(t){console.error("Failed to disable backup and sync features:",t)}})()},$=[k,M,P,J,L,C,R],S[5]=R,S[6]=J,S[7]=M,S[8]=k,S[9]=L,S[10]=P,S[11]=C,S[12]=Y,S[13]=$):(Y=S[12],$=S[13]),(0,e.useEffect)(Y,$);let z;S[14]!==R||S[15]!==F||S[16]!==J||S[17]!==M||S[18]!==k||S[19]!==P||S[20]!==C||S[21]!==W?(z=async()=>{if(k){if(F){W(!1),R((0,w.tW)());return}if(W(!0),P===!1){R((0,v.toY)({name:_.Md,enableBackupAndSync:async()=>{R((0,w.yy)()),R((0,w.B2)())}}));return}R((0,w.B2)());return}if(J){W(!1),await C(n.f.main,!1),await C(n.f.accountSyncing,!1),await C(n.f.contactSyncing,!1);return}if(W(!0),M===!1){R((0,v.toY)({name:_.Md,enableBackupAndSync:async()=>{await R((0,v.K9g)(!0)),await C(n.f.main,!0),await C(n.f.accountSyncing,!0),await C(n.f.contactSyncing,!0)}}));return}await C(n.f.main,!0),await C(n.f.accountSyncing,!0),await C(n.f.contactSyncing,!0)},S[14]=R,S[15]=F,S[16]=J,S[17]=M,S[18]=k,S[19]=P,S[20]=C,S[21]=W,S[22]=z):z=S[22];let O=z;let Q=!k&&D;let U;S[23]!==T?(U=T("backupAndSyncEnable"),S[23]=T,S[24]=U):U=S[24];let V;S[25]!==U?(V=e.createElement(l.E,{variant:i.J3.BodyMd,fontWeight:i.IT.Medium},U),S[25]=U,S[26]=V):V=S[26];let j;S[27]!==F||S[28]!==O||S[29]!==Q?(j=Q?e.createElement(c.a,{paddingLeft:5,paddingRight:5},e.createElement(p.A,{size:36})):e.createElement("div",{className:"privacy-settings__setting__toggle","data-testid":"backup-and-sync-toggle-container"},e.createElement(m.A,{value:F,onToggle:O,dataTestId:"backup-and-sync-toggle-button"})),S[27]=F,S[28]=O,S[29]=Q,S[30]=j):j=S[30];let G;S[31]!==V||S[32]!==j?(G=e.createElement(c.a,{flexDirection:r.uV.Row,justifyContent:r.TE.Between,alignItems:r.RE.Start,marginBottom:1},V,j),S[31]=V,S[32]=j,S[33]=G):G=S[33];let H;S[34]!==T?(H=T("backupAndSyncPrivacyLink"),S[34]=T,S[35]=H):H=S[35];let K;S[36]!==H?(K=e.createElement(l.E,{asChild:!0,variant:i.J3.BodyMd,key:"privacy-link",color:i.r7.InfoDefault},e.createElement("a",{href:u.A.PROFILE_PRIVACY,target:"_blank",rel:"noopener noreferrer"},H)),S[36]=H,S[37]=K):K=S[37];let Z;S[38]!==T||S[39]!==K?(Z=T("backupAndSyncEnableDescription",[K]),S[38]=T,S[39]=K,S[40]=Z):Z=S[40];let q;S[41]!==Z?(q=e.createElement(l.E,{variant:i.J3.BodyMd,color:i.r7.TextAlternative,asChild:!0},e.createElement("div",null,Z)),S[41]=Z,S[42]=q):q=S[42];let X;S[43]!==I||S[44]!==T?(X=I&&e.createElement(c.a,{marginTop:4,paddingBottom:4},e.createElement(l.E,{color:i.r7.ErrorDefault,variant:i.J3.BodySm},T("notificationsSettingsBoxError"))),S[43]=I,S[44]=T,S[45]=X):X=S[45];let tt;S[46]!==q||S[47]!==X?(tt=e.createElement("div",{className:"privacy-settings__setting__description"},q,X),S[46]=q,S[47]=X,S[48]=tt):tt=S[48];let te;return S[49]!==tt||S[50]!==G?(te=e.createElement(c.a,{marginTop:4,marginBottom:4,paddingLeft:4,paddingRight:4,className:"privacy-settings__setting__wrapper",id:"backup-and-sync-toggle","data-testid":"backup-and-sync-container"},G,tt),S[49]=tt,S[50]=G,S[51]=te):te=S[51],te}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);