'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@gem-sdk/core"),s=require("./layouts/FeatureImageWithGalleryImage.js"),a=require("./FeatureImage.js"),l=require("./layouts/OnlyGalleryImage.js"),i=require("@gem-sdk/system"),u=require("../../common/classes.js");exports.default=c=>{let{setting:d,styles:o,builderProps:g,builderAttrs:n,style:m,children:f}=c,I={...d,...o},{layoutType:y="bottom-center"}=I,b=t.useProduct(),h=e=>e?.medias?.edges.filter(e=>!["VIDEO","EXTERNAL_VIDEO","MODEL_3D"].includes(e.node?.contentType||"")).map(e=>e?.node),p=e=>!!e&&["EXTERNAL_VIDEO","MODEL_3D","VIDEO"].includes(e),E=r.useMemo(()=>{let e=h(b)?.map(e=>(e&&(e.src=p(e.contentType)?e?.previewImage:e.src),e));return e?.length?e:[{id:b?.featuredImage?.id||"noImageError",baseID:b?.featuredImage?.baseID||"noImageError",src:b?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:b?.featuredImage?.width||480,height:b?.featuredImage?.height||480}]},[b]),j=i.createClass(u.getProductImageClass({align:I?.align})),D=i.createStyle({...m});return e.jsxs("div",{...n,className:j,style:D,children:[e.jsx("div",{className:j,children:["bottom-center","left","right"].includes(y)?e.jsx(s.default,{gallery:E,builderProps:g,setting:d,styles:o}):["one-col","two-col"].includes(y)?e.jsx(l.default,{gallery:E,builderProps:g,setting:d,styles:o}):e.jsx(a.default,{gallery:E,styles:o,setting:d})}),f]})};
