'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),base=require("../base/base.js"),React=require("react");const ImageShopifyVariant=({product:e,isVariantOutStock:t,...a})=>{let i=e?.medias?.edges.map(e=>e.node),s=e?.variants?.edges.map(e=>{let t=e.node?.mediaId||"0",a=i?.find(e=>e?.id===t)?.src||"";return{title:e.node?.title||"",selectedOptions:e.node?.selectedOptions.map(e=>e.value),mediaId:t,image:a,id:e.node?.id||"0"}}),r=React.useMemo(()=>{let e=a.value?.label,t=s?.find(t=>t?.selectedOptions?.includes(e)&&t?.image)?.image||"";return t},[a.value,s]);return jsxRuntime.jsx(base.default,{...a,swatchesImage:r,isVariantOutStock:t})};exports.default=ImageShopifyVariant;
