import{r as y,F as h,D as b,P as g}from"./index-DaNIymO8.chunk.mjs";import{j as r,_ as w,r as m,e as u,o as f,h as i,a as s,k as A,t as c,f as C,m as _,n as p,d as x,L as M,g as k}from"./modulepreload-polyfill-DzIIs1ni.chunk.mjs";import{a as S,b as N}from"./index-CGOHHiYr.chunk.mjs";const j='<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>',B={name:"ConfirmationDialog",components:{NcButton:N,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()}}},D={class:"confirm-modal"},F={class:"confirm-modal__buttons"};function V(e,t,a,n,l,o){const d=m("NcButton"),v=m("NcModal");return f(),u(v,{class:"confirm-modal",onClose:o.cancel},{default:i(()=>[s("div",D,[s("h2",null,c(a.title),1),A(e.$slots,"default",{},void 0,!0),s("div",F,[C(d,{variant:"tertiary",disabled:a.disabled,onClick:o.cancel},{default:i(()=>[p(c(e.t("contacts","Cancel")),1)]),_:1},8,["disabled","onClick"]),a.resolve?(f(),u(d,{key:0,disabled:a.disabled,variant:"primary",onClick:o.confirm},{default:i(()=>[p(c(a.confirmText),1)]),_:1},8,["disabled","onClick"])):_("",!0)])])]),_:3},8,["onClose"])}const q=w(B,[["render",V],["__scopeId","data-v-36f53b99"]]),E="text/vcard",I="contacts-import";y(new h({id:I,displayName:()=>r("contacts","Import"),default:b.DEFAULT,enabled:e=>{if(e.length!==1)return!1;const t=e[0];return t.mime===E&&t.permissions&g.READ},iconSvgInline:()=>j,async exec(e){let t;try{const a="confirmation-"+Math.random().toString(16).slice(2),n=document.createElement("div");n.id=a,document.body.appendChild(n),await new Promise((l,o)=>{t=x(q,{title:r("contacts","Are you sure you want to import this contact file?"),resolve:l,reject:o}),t.mixin(M),t.mount(`#${a}`)}),window.location=k(`/apps/contacts/import?file=${e.path}`)}catch{}finally{t?.unmount()}return null}}));
//# sourceMappingURL=contacts-files-action.mjs.map
