import{j as r}from"./vendor-mui-69397583.js";import{b4 as D,d as a,b5 as M,b6 as z}from"./index-c62ac197.js";const A=m=>{const{bodyOpenClassName:p,bodyClass:y,children:f,className:b,closable:n=!0,closeTimeoutMS:C=300,footer:i,footerClass:h,headerClass:w,height:o=400,isOpen:d,lockScroll:N=!0,onClose:t,overlayClassName:u,placement:e="right",portalClassName:x,showBackdrop:v=!0,title:s,width:l=400,...j}=m,S=B=>{t==null||t(B)},g=r.jsx(z,{onClick:S}),k=()=>e==="left"||e==="right"?{dimensionClass:"vertical",contentStyle:{width:l},motionStyle:{[e]:`-${l}${typeof l=="number"&&"px"}`}}:e==="top"||e==="bottom"?{dimensionClass:"horizontal",contentStyle:{height:o},motionStyle:{[e]:`-${o}${typeof o=="number"&&"px"}`}}:{motionStyle:{}},{dimensionClass:O,contentStyle:$,motionStyle:c}=k();return r.jsx(D,{className:{base:a("drawer",b),afterOpen:"drawer-after-open",beforeClose:"drawer-before-close"},overlayClassName:{base:a("drawer-overlay",u,!v&&"bg-transparent"),afterOpen:"drawer-overlay-after-open",beforeClose:"drawer-overlay-before-close"},portalClassName:a("drawer-portal",x),bodyOpenClassName:a("drawer-open",N&&"drawer-lock-scroll",p),ariaHideApp:!1,isOpen:d,closeTimeoutMS:C,...j,children:r.jsxs(M.div,{className:a("drawer-content",O),style:$,initial:c,animate:{[e]:d?0:c[e]},children:[s||n?r.jsxs("div",{className:a("drawer-header",w),children:[typeof s=="string"?r.jsx("h4",{children:s}):r.jsx("div",{className:"flex",children:s}),n&&g]}):null,r.jsx("div",{className:a("drawer-body",y),children:f}),i&&r.jsx("div",{className:a("drawer-footer",h),children:i})]})})};A.displayName="Drawer";export{A as D};
