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