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