(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[7172],{717172(__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__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{"default":()=>E});var e=__webpack_require__(67659);var t=__webpack_require__(833081);var a=__webpack_require__(147928);var r=__webpack_require__(503223);var s=__webpack_require__(852841);var n=__webpack_require__(652335);var i=__webpack_require__(954817);var l=__webpack_require__(564063);var o=__webpack_require__(636370);var u=__webpack_require__(992996);var c=__webpack_require__(308571);var p=__webpack_require__(115681);var f=__webpack_require__(562896);var d=__webpack_require__(505632);var v=__webpack_require__(533871);var g=__webpack_require__(440869);var y=__webpack_require__(430652);var m=__webpack_require__(155504);var h=__webpack_require__(507014);var w=__webpack_require__(449839);var P=__webpack_require__(739506);let k=5*m.Z2;function E(){let m=(0,a.Zp)();let E=(0,t.wA)();let S=(0,c.P)();let C=S((0,f.vn)());let{trackEvent:T}=(0,e.useContext)(h.O2);let b=(0,t.d4)(P.NY0);let[_,x]=(0,e.useState)("");let[F,D]=(0,e.useState)(!1);let[O,R]=(0,e.useState)(!1);(0,e.useEffect)(()=>()=>{(0,f.B0)()},[]),(0,e.useEffect)(()=>{!b&&m(u.XR,{replace:!0})},[b,m]);let Z=()=>{x(""),m(u.XR,{replace:!0})};let B=async()=>{R(!0),D(!1);try{try{await (0,g.BEp)(_)}catch{D(!0);return}let t=Date.now();let a={verification_method:"password"};T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"started"}});try{await (0,g.Vg1)(_),await (0,g.hmH)(E),T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"completed",duration_ms:Date.now()-t}}),y.oR.success(e.createElement(y.pi,{title:S("passkeyTurnedOff",[C])}),{duration:k}),T({category:w.FZ.Settings,event:w.gP.SettingsUpdated,properties:{settings_group:"security_privacy",settings_type:"passkey",old_value:!0,new_value:!1}}),Z()}catch(n){let r=Date.now()-t;let s=(0,v.y2)(n);T({category:w.FZ.Settings,event:w.gP.PasskeyTurnOff,properties:{...a,status:"failed",duration_ms:r,reason:s}}),(0,d.Cp)((0,p.sV)("Passkey turn off in settings failed",n),{extra:{verificationMethod:"password",durationMs:r,errorCode:s}}),y.oR.error(e.createElement(y.pi,{title:S("turnOffPasskeyFailed",[C])}),{duration:k}),Z()}}finally{R(!1)}};return!b?null:(0,e.createElement(i.a,{flexDirection:r.uV.Column,justifyContent:r.TE.Start,alignItems:r.RE.Stretch,gap:6,padding:4,className:"h-full min-h-0"},e.createElement(i.a,{flexDirection:r.uV.Column,gap:6,justifyContent:r.TE.Between,asChild:!0,className:"min-h-0 shrink-0"},e.createElement("form",{onSubmit:e=>{e.preventDefault(),B()}},e.createElement(o.YJ,{id:"turn-off-passkey-current-password",label:S("enterPasswordCurrent"),textFieldProps:{type:o.ux.Password},size:o.dY.Lg,labelProps:{marginBottom:1},inputProps:{autoFocus:!0,"data-testid":"turn-off-passkey-password-input"},value:_,error:F,helpText:F?S("unlockPageIncorrectPassword"):null,onChange:e=>{x(e.target.value),D(!1)}}),e.createElement(l.$,{type:"submit",variant:s.A.Primary,size:n.Mp.Lg,className:"w-full","data-testid":"turn-off-passkey-verify-continue-button",disabled:!_||O||F,isLoading:O},S("continue"))))))}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);