'use client';
import{jsx as r}from"react/jsx-runtime";import{useMemo as e,Children as o,isValidElement as t,cloneElement as s}from"react";import{makeStyleResponsive as i}from"@gem-sdk/core";import{createStyle as m,createClass as c,createAttr as l}from"@gem-sdk/system";import{getContainerStyles as n}from"../common/styles.js";import d from"../hooks/useAccordion.js";import{getContainerClasses as a}from"../common/classes.js";let p=({builderProps:p,builderAttrs:f,style:u,children:h,setting:g,styles:j,advanced:y})=>{let{align:k}=j??{},{childItem:x}=g??{},{ref:v,mode:A,accordions:C,handleDropdown:D,activeKey:N}=d({setting:g,children:h,builderProps:p}),S=m({...n(u,j)}),w=c(a(y?.cssClass,A)),I=l({...f,"data-id":p?.uid??""}),U=m({...i("jc",k)}),b=c({"gp-flex":!0}),q=e(()=>o.map(h,(e,o)=>{if(!t(e))return e;let i={...e.props,index:o,title:x?.[o],accordions:C,handleDropDown:D,parentSetting:g,parentStyle:j,activeKey:N,childrenIcon:g?.childConfig?.[o],parentUid:p?.uid};return r("div",{className:b,style:U,children:s(e,i)})}),[C,N,p?.uid,x,h,b,U,D,g,j]);return r("div",{...I,ref:v,className:w,style:S,children:q})};export{p as default};
