"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("react");exports.default=r=>{let[s,u]=t.useState(0),{seUseProductCompareAtPrice:c}=e.useProductBundleDiscount(),[l,a]=t.useState(r?.hasPreSelectItem?r?.selectItemDefault:-1),f=t.useCallback(e=>l===e,[l]);return t.useEffect(()=>{c(r?.useProductCompareAtPrice)},[c,r?.useProductCompareAtPrice]),t.useEffect(()=>{r?.hasPreSelectItem||a(-1)},[r?.hasPreSelectItem]),t.useEffect(()=>{r?.hasPreSelectItem&&a(r?.selectItemDefault)},[r?.hasPreSelectItem,r?.selectItemDefault]),t.useEffect(()=>{let e;return s<10&&(e=setInterval(()=>{u(e=>e+1)},100)),()=>clearInterval(e)},[s]),{timer:s,isSelected:f,setSelected:a}};
