/*! third party licenses: js/vendor.LICENSE.txt */
import{n as l,V as s,_ as d}from"./index-BhDGmKuu.chunk.mjs";import{w as m,s as p,t as o}from"./index-CmFt3hdP.chunk.mjs";import{r as u,F as f,D as v,P as y}from"./index-CTW0HUQx.chunk.mjs";const h={name:"ConfirmationDialog",components:{NcButton:m,NcModal:p},props:{title:{type:String,required:!0},resolve:{type:Function,required:!0},reject:{type:Function,required:!0},confirmText:{type:String,default:o("contacts","Confirm")},disabled:{type:Boolean,default:void 0}},methods:{confirm(){this.resolve()},cancel(){this.reject()}}};var w=function(){var t=this,e=t._self._c;return e("NcModal",{staticClass:"confirm-modal",on:{close:t.cancel}},[e("div",{staticClass:"confirm-modal"},[e("h2",[t._v(t._s(t.title))]),t._t("default"),e("div",{staticClass:"confirm-modal__buttons"},[e("NcButton",{attrs:{type:"tertiary",disabled:t.disabled},on:{click:t.cancel}},[t._v(" "+t._s(t.t("contacts","Cancel"))+" ")]),t.resolve?e("NcButton",{attrs:{disabled:t.disabled,type:"primary"},on:{click:t.confirm}},[t._v(" "+t._s(t.confirmText)+" ")]):t._e()],1)],2)])},_=[],g=l(h,w,_,!1,null,"18f78670");const A=g.exports,b='<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>';s.prototype.t=o;const x="text/vcard",C="contacts-import";u(new f({id:C,displayName:()=>o("contacts","Import"),default:v.DEFAULT,enabled:t=>{if(t.length!==1)return!1;const e=t[0];return e.mime===x&&e.permissions&y.READ},iconSvgInline:()=>b,async exec(t){let e;try{const n="confirmation-"+Math.random().toString(16).slice(2),a=document.createElement("div");a.id=n,document.body.appendChild(a),await new Promise((i,c)=>{const r=s.extend(A);e=new r({propsData:{title:o("contacts","Are you sure you want to import this contact file?"),resolve:i,reject:c}}),e.$mount(`#${n}`)}),window.location=d(`/apps/contacts/import?file=${t.path}`)}catch{}e.$destroy()}}));
