'use client';
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{useProduct as s}from"@gem-sdk/core";import a from"./layouts/FeatureImageWithGalleryImage.js";import o from"./FeatureImage.js";import m from"./layouts/OnlyGalleryImage.js";import{createClass as l,createStyle as i}from"@gem-sdk/system";import{getProductImageClass as c}from"../../common/classes.js";let PostPurchaseProductImages=g=>{let{setting:n,styles:d,builderProps:f,builderAttrs:u,style:p,children:y}=g,I={...n,...d},{layoutType:h="bottom-center"}=I,b=s(),E=e=>e?.medias?.edges.filter(e=>!["VIDEO","EXTERNAL_VIDEO","MODEL_3D"].includes(e.node?.contentType||"")).map(e=>e?.node),D=e=>!!e&&["EXTERNAL_VIDEO","MODEL_3D","VIDEO"].includes(e),P=r(()=>{let e=E(b)?.map(e=>(e&&(e.src=D(e.contentType)?e?.previewImage:e.src),e));return e?.length?e:[{id:b?.featuredImage?.id||"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]),O=()=>["bottom-center","left","right"].includes(h)?t(a,{gallery:P,builderProps:f,setting:n,styles:d}):["one-col","two-col"].includes(h)?t(m,{gallery:P,builderProps:f,setting:n,styles:d}):t(o,{gallery:P,styles:d,setting:n}),j=l(c({align:I?.align})),_=i({...p});return e("div",{...u,className:j,style:_,children:[t("div",{className:j,children:O()}),y]})};export{PostPurchaseProductImages as default};
