import{jsx as a}from"react/jsx-runtime";import n,{forwardRef as e,useRef as i,useMemo as r}from"react";import s from"classnames";import t from"../../../hooks/useMergeRefs.js";import{TabPanelsAnimationDirection as o}from"./TabPanelsConstants.js";import"./TabPanels.scss.js";var c=e((function(e,c){var m=e.className,l=e.id,p=e.activeTabId,d=void 0===p?0:p,f=e.noAnimation,v=e.animationDirection,u=void 0===v?o.RTL:v,b=e.children,j=e.renderOnlyActiveTab,T=void 0!==j&&j,g=i(null),O=t({refs:[c,g]}),h=r((function(){return n.Children.map(b,(function(a,e){var i=d===e;if(T&&!i)return null;var r=i?"active":"non-active",t=f&&"no-animation",o=i?"animation-direction-".concat(u):"";return n.cloneElement(a,Object.assign(Object.assign({index:e},a.props),{className:s("tab-panel",r,t,o,a.props.className)}))})).filter(Boolean)}),[b,d,T,u]);return a("div",Object.assign({ref:O,className:s("tab-panels--wrapper",m),id:l},{children:h}))}));Object.assign(c,{isTabPanels:!0,animationDirections:o});var m=c;export{m as default};
