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