"use strict";var core=require("@gem-sdk/core"),React=require("react"),useGetProductId=require("../../hooks/useGetProductId.js"),useTabInteraction=require("./useTabInteraction.js");const useTab=(e,t)=>{let{activeKey:r}=e??{},u=core.useCurrentDevice(),[s,c]=React.useState(!r||r<0||r>=(e?.childItem??[]).length?0:r),{refContainer:a,productID:o}=useGetProductId.useGetProductId(),{dispatchEventTabActive:i}=useTabInteraction.useTabInteraction({activeKey:r||1,setActiveKey:c,activeTab:s,refContainer:a,componentUid:t?.uid||""});return e&&!e?.labelWidth&&(e.labelWidth={desktop:"200px"}),{currentDevice:u,productID:o,dispatchEventTabActive:i,activeTab:s,setActiveKey:c,refContainer:a}};exports.useTab=useTab;
