'use client';
import{jsx as r}from"react/jsx-runtime";import{useVariants as e,useSelectedOption as t}from"@gem-sdk/core";import o from"../dropdown-swatches/Dropdown.js";import{useMemo as n}from"react";let a=({...a})=>{let i=e(),{selectedOptions:m}=t(),p=n(()=>{let r=Object.keys(m||{}),e=i.find(e=>{let t=0;return r.forEach(r=>{let o=e?.selectedOptions.find(e=>e.name===r);o?.value===m?.[r]&&t++}),t===r.length});return e},[i,m]);return r(o,{variants:i,initValue:p?.id,variantGroup:!0,...a})};export{a as default};
