'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("react"),a=require("../hooks/useTab.js"),l=require("@gem-sdk/system"),r=require("../common/attrs.js"),i=require("../../text/components/Text.js"),n=require("../common/styles.js"),c=require("../common/classes.js");exports.default=d=>{let{builderAttrs:o,builderProps:u,style:C,setting:p,advanced:m,children:g}=d,{cssClass:y}=m??{},{panelWidth:x,childItem:j,labelAlign:h,labelTypo:v,labelTypoV2:S}=p??{},{currentDevice:T,productID:b,dispatchEventTabActive:q,activeTab:N,setActiveKey:f,refContainer:A}=a.useTab(p,u);p&&!p?.labelWidth&&(p.labelWidth={desktop:"200px"});let k=l.createAttr({...r.getAttr({uid:u?.uid||""})}),L=l.createStyle({...n.getStyleWrapper({setting:p,style:C,uid:u?.uid,pageContext:d.pageContext??{}})}),P=l.createClass({...c.getClassesWrapper({builderProps:u,advancedCssClass:y})}),W=l.createClass({...c.getContainClasses({setting:p})}),I=c.getStyleTagClasses({panelWidth:x,builderProps:u}),$=l.createClass({...c.getTabParentListClasses()}),w=l.createStyle({...n.getTabParentListStyle(p)}),_=l.createClass({...c.getTabListClasses({setting:p})}),E=l.createStyle({...n.getTabListStyle(p)}),F=e=>l.createClass({...c.getItemClasses({setting:p,isNotLiquid:!0,isActive:e,currentDevice:T})}),M=e=>l.createStyle({...n.getItemStyle(p,e)}),O=s.Children.map(g,e=>e?.props?.uid),U=l.createClass({...c.getWrapperContentClasses()}),V=l.createClass({...c.getContainContentClasses()}),z=l.createStyle({...n.getContainContentStyle()}),B=l.createClass({...c.getTextClasses()}),D=l.createAttr({...r.getAttrContent({uid:u?.uid||""})});return e.jsxs("div",{ref:A,...o,...k,style:L,className:P,children:[e.jsx("style",{children:I}),e.jsxs("div",{className:W,children:[e.jsx("div",{className:$,style:w,children:e.jsx("ul",{className:_,style:E,children:j?.map((t,s)=>{let a=N==s;return e.jsx("li",{"aria-hidden":!0,className:F(a),style:M(a),onClick:()=>{f(s),q(s)},children:e.jsx(i.default,{className:B,styles:{typo:S,typography:v,textAlign:h},setting:{text:t,htmlTag:"div",excludeFlex:!0,options:{useState:!0,uniqueId:b?`${O?.[s]}-${b}`:`${O?.[s]}`,productID:b}}})},O&&O[s])})})}),e.jsx("div",{className:U,children:e.jsx("div",{...D,className:V,style:z,children:s.Children.map(t.filterToolbarPreview(g),(t,a)=>s.isValidElement(t)?e.jsx(t.type,{...t.props,isActive:a==N,parentUid:u?.uid}):null)})})]}),t.filterToolbarPreview(g,!0)]})};
