import{__assign as e}from"tslib";import{jsxs as i,jsx as r,Fragment as t}from"react/jsx-runtime";import{ChevronDown as n}from"lucide-react";import{useState as o,useCallback as c}from"react";var l=function(l){var a=l.id,s=l.required,d=l.title,p=l.children,u=l.openSections,m=l.setOpenSections;l.dividerRequired;var v=l.defaultOpen,h=void 0===v||v,f=l.collapsible,x=void 0!==f&&f,y=l.bordered,g=void 0!==y&&y,b=l.customStyles,N=l.readOnly,S=l.headerActions,w=o(h),C=w[0],I=w[1],O=void 0!==u&&void 0!==m&&u.has(a),R=!x||(O?u.has(a):C),k=c(function(){x&&(O?m(function(e){var i=new Set(e);return i.has(a)?i.delete(a):i.add(a),i}):I(function(e){return!e}))},[a,m,x,O]);return i("div",e({className:"section-wrapper",style:g?{border:"1px solid #ccc",padding:"8px 12px",borderRadius:"8px"}:{}},{children:[i("div",e({className:"section-header",onClick:k,role:x?"button":"presentation",style:{cursor:x?"pointer":"default",display:"flex",alignItems:"center"}},{children:[i("div",e({className:"section-header-title ".concat(R?"active":""),style:{display:"flex",alignItems:"center",gap:"1.5px"}},{children:[s&&r("span",e({style:{color:"#8F2C23",marginRight:"2px"}},{children:"*"})),r("span",e({style:{color:N?"#717b8c":void 0,cursor:N?"not-allowed":"pointer",flex:1}},{children:d}))]})),i("div",e({style:{display:"flex",alignItems:"center",gap:"8px"},onClick:function(e){return e.stopPropagation()}},{children:[S,x&&r(n,{size:24,className:"section-chevron ".concat(R?"open":"")})]}))]})),R&&r(t,{children:r("div",e({className:"section-content",style:b},{children:p}))})]}))};export{l as SectionWrapper};
//# sourceMappingURL=SectionWrapper.js.map
