"use strict";var e=require("@gem-sdk/core"),r=require("react");exports.useFeatureImagePostPurchase=t=>{let{gallery:u}=t,a=e.useCurrentVariant(),s=e.useFeaturedImageGlobal(),d=e.useProductStore(e=>e.setProductFeaturedImage),i=r.useMemo(()=>{if(!s)return 0;let e=u.findIndex(e=>e.id===s.id);return -1!==e?e:0},[s,u]);return r.useEffect(()=>{a?.media&&"IMAGE"===a.media.contentType&&d(a.media)},[a,d]),{idxActive:i}};
