import{B as e,Bt as t,C as n,G as r,L as i,M as a,Mt as o,N as s,R as c,Tt as l,Ut as u,bt as d,c as f,j as p,ot as m,qt as h,s as g,xt as _,y as v}from"./vue-3bs2-dMU.js";import{C as y,E as b,K as x,O as S,f as C,h as w}from"./stores-DmetsdTd.js";import{I as T,K as E,dt as D,mt as O}from"./vuetify-gGrfRH2I.js";import{t as k}from"./ConfirmListDialog-CmS4OViN.js";r(),l(),u(),v();var A={class:`d-flex flex-row flex-gap align-center`},j={class:`text-red`},M=e({__name:`ConfirmDeleteDialog`,props:{guid:{},hashes:{}},setup(e){let r=e,l=g(),u=f(),{t:v}=x(),M=b(),N=C(),P=S(),F=y(),I=w(),L=p(()=>F.torrents.filter(e=>r.hashes?.includes(e.hash))),R=p(()=>L.value.map(e=>e.name)),z=p(()=>P.preferences.delete_torrent_content_files??I.deleteWithFiles),B=o(z.value);async function V(){let e=B.value;M.usesQbit5?(await P.setPreferences({delete_torrent_content_files:e}),await P.fetchPreferences()):I.deleteWithFiles=e}async function H(){await F.deleteTorrents(r.hashes,B.value),N.unselectAllTorrents(),l.name===`torrentDetail`&&await u.push({name:`dashboard`})}return(r,o)=>(m(),s(k,{width:void 0,guid:e.guid,title:t(v)(`dialogs.delete.title`,L.value.length),items:R.value,"no-text":t(v)(`common.cancel`),"yes-color":`error`,"yes-text":t(v)(`common.delete`),onConfirm:H},{default:d(()=>[a(`div`,A,[c(E,{disabled:B.value===z.value,color:`accent`,variant:`text`,icon:`mdi-content-save`,onClick:V},null,8,[`disabled`]),c(T,{modelValue:B.value,"onUpdate:modelValue":o[0]||=e=>B.value=e,"hide-details":``,label:t(v)(`dialogs.delete.deleteWithFiles`)},null,8,[`modelValue`,`label`])]),c(D,null,{default:d(()=>[_(a(`div`,j,[c(O,null,{default:d(()=>[...o[1]||=[i(`mdi-alert`,-1)]]),_:1}),i(` `+h(t(v)(`dialogs.delete.warnDelete`)),1)],512),[[n,B.value]])]),_:1})]),_:1},8,[`guid`,`title`,`items`,`no-text`,`yes-text`]))}});export{M as default};