import{l as h,c as N,u as w}from"./public-BQSk-kMe.chunk.mjs";import{d as L,r as u,c as i,o as T,n as B,e as S,f as q,u as O,b as k}from"./vue.runtime.esm-CF8vEa-4.chunk.mjs";import{n as x,G as D}from"./NcLoadingIcon-DNqaLvLX.chunk.mjs";const E=L({name:"NcDialog",components:{NcDialogButton:h,NcModal:N},props:{name:{type:String,required:!0},message:{type:String,default:""},additionalTrapElements:{type:Array,validator:a=>Array.isArray(a)&&a.every(e=>typeof e=="string"||e instanceof HTMLElement),default:()=>[]},container:{type:String,required:!1,default:"body"},open:{type:Boolean,default:!0},size:{type:String,required:!1,default:"small",validator:a=>typeof a=="string"&&["small","normal","large","full"].includes(a)},buttons:{type:Array,required:!1,default:()=>[],validator:a=>Array.isArray(a)&&a.every(e=>typeof e=="object")},noClose:{type:Boolean,default:!1},canClose:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!1},isForm:{type:Boolean,default:!1},outTransition:{type:Boolean,default:!1},navigationClasses:{type:[String,Array,Object],required:!1,default:""},navigationAriaLabel:{type:String,required:!1,default:""},navigationAriaLabelledby:{type:String,required:!1,default:""},contentClasses:{type:[String,Array,Object],required:!1,default:""},dialogClasses:{type:[String,Array,Object],required:!1,default:""}},emits:["closing","update:open","submit"],setup(a,{emit:e,slots:o}){const n=u(),{width:c}=w(n,{width:900}),l=i(()=>c.value<876),p=i(()=>o?.navigation!==void 0),s=D(),y=i(()=>a.navigationAriaLabel||void 0),m=i(()=>{if(!a.navigationAriaLabel)return a.navigationAriaLabelledby||s}),g=u(),r=i(()=>a.isForm&&!p.value?"form":"div"),b=i(()=>r.value==="form"?{submit(t){t.preventDefault(),e("submit",t)},reset(t){t.preventDefault(),e("reset",t)}}:{}),d=u(!0);function C(t,A){t.nativeType==="submit"&&r.value==="form"&&!g.value.reportValidity()||(f(A),window.setTimeout(()=>v(),300))}const f=t=>{d.value=!1,e("closing",t)},v=()=>{d.value=!0,e("update:open",!1)},_=i(()=>({noClose:a.noClose||!a.canClose,container:a.container===void 0?"body":a.container,labelId:s,size:a.size,show:a.open&&d.value,outTransition:a.outTransition,closeOnClickOutside:a.closeOnClickOutside,additionalTrapElements:a.additionalTrapElements}));return{dialogElement:g,dialogListeners:b,dialogTagName:r,handleButtonClose:C,handleClosing:f,handleClosed:v,hasNavigation:p,navigationId:s,navigationAriaLabelAttr:y,navigationAriaLabelledbyAttr:m,isNavigationCollapsed:l,modalProps:_,wrapper:n}}});var j=function(){var a=this,e=a._self._c;return a._self._setupProxy,a.open?e("NcModal",a._b({staticClass:"dialog__modal",attrs:{"enable-slideshow":!1,"enable-swipe":!1},on:{close:a.handleClosed,"update:show":function(o){return a.handleClosing()}}},"NcModal",a.modalProps,!1),[e("h2",{staticClass:"dialog__name",attrs:{id:a.navigationId},domProps:{textContent:a._s(a.name)}}),e(a.dialogTagName,a._g({ref:"dialogElement",tag:"component",staticClass:"dialog",class:a.dialogClasses},a.dialogListeners),[e("div",{ref:"wrapper",class:["dialog__wrapper",{"dialog__wrapper--collapsed":a.isNavigationCollapsed}]},[a.hasNavigation?e("nav",{staticClass:"dialog__navigation",class:a.navigationClasses,attrs:{"aria-label":a.navigationAriaLabelAttr,"aria-labelledby":a.navigationAriaLabelledbyAttr}},[a._t("navigation",null,{isCollapsed:a.isNavigationCollapsed})],2):a._e(),e("div",{staticClass:"dialog__content",class:a.contentClasses},[a._t("default",function(){return[e("p",{staticClass:"dialog__text"},[a._v(" "+a._s(a.message)+" ")])]})],2)]),e("div",{staticClass:"dialog__actions"},[a._t("actions",function(){return a._l(a.buttons,function(o,n){return e("NcDialogButton",a._b({key:n,on:{click:(c,l)=>a.handleButtonClose(o,l)}},"NcDialogButton",o,!1))})})],2)])],1):a._e()},M=[],P=x(E,j,M,!1,null,"1aa5fbdd");const W=P.exports;function V(a){return S()?(q(a),!0):!1}function H(a){return typeof a=="function"?a():O(a)}const R=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function z(a){return k()}function $(a,e=!0,o){z()?T(a,o):e?a():B(a)}export{W as N,H as a,V as b,R as i,$ as t};
//# sourceMappingURL=index-CntyOPgG.chunk.mjs.map
