import{J as f,c as h,K as m,$ as p,w as i,o as v,y,e as w,f as b,E as g,a0 as B,j as R,v as M,d as r,R as k,Q as x,l as A,_ as C}from"./index.b636aed2.js";const S=["onClick"],$={inheritAttrs:!1},O=Object.assign($,{__name:"base-modal",props:{isActive:{default:!1,required:!0,type:Boolean},name:{default:Date.now().toString(),required:!0,type:String}},emits:["close"],setup(o,{emit:l}){const s=o,t=f(),c=t.currentRoute.value,a=h(()=>`#${s.name.trim().replace(new RegExp(" ","g"),"-")}`);function u(e){e?t.push({name:c.name,hash:a.value}):location.hash===a.value&&(location.hash="")}function d(){t.back()}function n(e){document.body.style.overflow=e?"hidden":""}function _(e){e.hash!==a.value&&l("close")}return m(()=>n(!0)),p(()=>n(!1)),i(()=>s.isActive,u,{immediate:!0}),i(()=>t.currentRoute.value,_),(e,V)=>(v(),y(B,{to:"body"},[w(g,null,{default:b(()=>[R(r("div",{class:"modal__overlay",onClick:A(d,["self"])},[r("div",k({class:"modal__content"},e.$attrs),[x(e.$slots,"default",{},void 0,!0)],16)],8,S),[[M,o.isActive]])]),_:3})]))}}),q=C(O,[["__scopeId","data-v-a254db57"]]);export{q as B};
