import{r as y,D as h,P as b}from"./index-6KQGWPf7.chunk.mjs";import{p as r,_ as g,r as m,o as u,f as p,h as i,a as s,t as c,q as w,e as A,s as f,u as C,d as _,L as x,g as M}from"./modulepreload-polyfill-CUNWF7kj.chunk.mjs";import{c as S,f as k}from"./index-BxnMnX_w.chunk.mjs";const N='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-account-multiple" viewBox="0 0 24 24"><path d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" /></svg>',q={name:"ConfirmationDialog",components:{NcButton:k,NcModal:S},props:{title:{type:String,required:!0},resolve:{type:Function,required:!0},reject:{type:Function,required:!0},confirmText:{type:String,default:r("contacts","Confirm")},disabled:{type:Boolean,default:void 0}},methods:{confirm(){this.resolve()},cancel(){this.reject()}}},B={class:"confirm-modal"},D={class:"confirm-modal__buttons"};function V(o,t,e,n,l,a){const d=m("NcButton"),v=m("NcModal");return u(),p(v,{class:"confirm-modal",onClose:a.cancel},{default:i(()=>[s("div",B,[s("h2",null,c(e.title),1),w(o.$slots,"default",{},void 0,!0),s("div",D,[A(d,{variant:"tertiary",disabled:e.disabled,onClick:a.cancel},{default:i(()=>[f(c(o.t("contacts","Cancel")),1)]),_:1},8,["disabled","onClick"]),e.resolve?(u(),p(d,{key:0,disabled:e.disabled,variant:"primary",onClick:a.confirm},{default:i(()=>[f(c(e.confirmText),1)]),_:1},8,["disabled","onClick"])):C("",!0)])])]),_:3},8,["onClose"])}const E=g(q,[["render",V],["__scopeId","data-v-36f53b99"]]),F="text/vcard",I="contacts-import";y({id:I,displayName:()=>r("contacts","Import"),default:h.DEFAULT,enabled:({nodes:o})=>{if(o.length!==1)return!1;const t=o[0];return t.mime===F&&!!(t.permissions&b.READ)},iconSvgInline:()=>N,async exec({nodes:[o]}){let t;try{const e="confirmation-"+Math.random().toString(16).slice(2),n=document.createElement("div");n.id=e,document.body.appendChild(n),await new Promise((l,a)=>{t=_(E,{title:r("contacts","Are you sure you want to import this contact file?"),resolve:l,reject:a}),t.mixin(x),t.mount(`#${e}`)}),window.location=M(`/apps/contacts/import?file=${o.path}`)}catch{}finally{t?.unmount()}return null}});
//# sourceMappingURL=contacts-files-action.mjs.map
