'use client';
import{jsx as r}from"react/jsx-runtime";import{useEditorMode as t,ProductProvider as e,isEmptyChildren as o}from"@gem-sdk/core";import"react";import i from"../../../../../grid/components/row/Row.js";import m from"../../../../../grid/components/ChildrenDroppable.js";import{createAttr as s,createClass as d}from"@gem-sdk/system";import{getProductOfferAttrs as l}from"../common/attrs.js";import{getProductOfferItemClasses as c}from"../common/classes.js";let ProductOfferItem=n=>{let{product:a,setting:p,builderProps:f,children:u,index:h,totalProduct:j,builderAttrs:g,styles:y}=n,I=t(),{variantSelected:b,productOfferLayout:O,layout:k,...v}=p??{};Object.keys(k||{}).forEach(r=>{O?.[r]==="2col"&&k?.[r]&&(k[r].display="fill")});let w=b?.[a?.baseID??""]?.variantId,x=s({...l(a,f?.uid)}),D=d({...c(h,p,j)});return r("div",{className:D,children:r(e,{product:a,readOnly:!0,initialVariantId:w??"Latest",children:r("div",{..."edit"===I?{...x}:{},children:r(i,{builderAttrs:g,setting:{...v,layout:k},styles:y,children:o(u)?r(m,{}):u})})})},`uid-${a?.id}`)};export{ProductOfferItem};
