import{i as w,o as a,w as d,e as k,b as t,d as S,n as c,a as p,L as u,c as o,f as n,u as m,t as y,m as v,J as C}from"./app-B4kV47qU.js";import{u as T}from"./modalStore-BgORG3Nn.js";const q={key:0,class:"c-modal-header pb-3"},M={class:"c-main-content styled-scrollbar"},z={key:2,class:"c-model-btn-container-end"},L={key:0,xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-loader animate-spin"},P={__name:"Modal",props:{state:{type:[String,Boolean],default:null},closeBtn:{type:Boolean,default:!0},backdropClose:{type:Boolean,default:!0},headerState:{type:Boolean,default:!1},headerTitle:{type:String,default:"Header Title"},actionBtnState:{type:Boolean,default:!1},actionProcessing:{type:Boolean,default:!1},actionBtnText:{type:String,default:"Submit"},bgBlur:{type:Boolean,default:!1},bgColor:{type:String,default:"bg-white dark:bg-dark-900"},modalSize:{type:String,default:"w-11/12 lg:w-1/3"},modalType:{type:String,default:"modal",validator:function(e){return["modal","sidebar"].indexOf(e)!==-1}}},emits:["action","close"],setup(e,{emit:f}){const s=T(),r=f,i=e,g=()=>{i.backdropClose&&s.close(i.state)},b={sidebar:"as-sidebar",modal:"as-modal"},x={sidebar:"right",modal:"scale-up"},h=()=>{r("close"),s.close(i.state)};return(B,l)=>(a(),w(u,{name:"fade"},{default:d(()=>[k(t("div",{class:c(["c-modal-container",[{"bg-blur":e.bgBlur},b[e.modalType]]]),onClick:S(g,["self"])},[p(u,{name:x[e.modalType]},{default:d(()=>[m(s).getState(e.state)?(a(),o("div",{key:0,class:c(["c-modal-content rounded-lg p-6",[e.bgColor,e.modalSize]])},[e.headerState?(a(),o("h6",q,y(e.headerTitle),1)):n("",!0),e.closeBtn?(a(),o("button",{key:1,class:"c-modal-close",type:"button",onClick:h},l[1]||(l[1]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"m12 13.4l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l2.9-2.9l-2.9-2.875q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9l2.875-2.9q.275-.275.7-.275t.7.275q.3.3.3.713t-.3.687L13.375 12l2.9 2.9q.275.275.275.7t-.275.7q-.3.3-.713.3t-.687-.3L12 13.4Z"})],-1)]))):n("",!0),t("div",M,[v(B.$slots,"default")]),e.actionBtnState?(a(),o("div",z,[t("button",{onClick:l[0]||(l[0]=N=>r("action")),type:"button",class:"btn btn-primary"},[e.actionProcessing?(a(),o("svg",L,l[2]||(l[2]=[t("line",{x1:"12",y1:"2",x2:"12",y2:"6"},null,-1),t("line",{x1:"12",y1:"18",x2:"12",y2:"22"},null,-1),t("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"},null,-1),t("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"},null,-1),t("line",{x1:"2",y1:"12",x2:"6",y2:"12"},null,-1),t("line",{x1:"18",y1:"12",x2:"22",y2:"12"},null,-1),t("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"},null,-1),t("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"},null,-1)]))):n("",!0),t("span",null,y(e.actionBtnText),1)])])):n("",!0)],2)):n("",!0)]),_:3},8,["name"])],2),[[C,m(s).getState(e.state)]])]),_:3}))}};export{P as _};
