'use client';
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useCollection as t,useRenderMode as l}from"@gem-sdk/core";import s from"../../../grid/components/row/Row.js";import{createClass as r,createStyle as m,If as i}from"@gem-sdk/system";import{getClassContainerBanner as n,getClassContainerBackgoundImage as a,getClassOverlayBanner as c,getClassLinkBanner as p}from"./common/classes.js";import{getDimension as d,getStyleOverlay as f,getStyleContainerBackgoundImage as g}from"./common/styles.js";import{updateBackroundImageSrc as y}from"./common/helpers.js";import k from"../../../link/components/Link.js";let CollectionBanner=({builderAttrs:h,builderProps:j,setting:u,style:v,children:N,advanced:b})=>{let C=t(),{isPreviewSharePageMode:w,isEditMode:x}=l(),{link:B,layout:I,width:L,verticalGutter:M,verticalAlign:O,horizontalAlign:R}=u??{};y({setting:u,collectionSrc:C?.collectionMedia?.src});let S=r({...n({builderProps:j,setting:u,advanced:b})}),W=r({...a({setting:u})}),q=r({...c({setting:u})}),z=r({...p()}),A=m({...d({setting:u,style:v})}),D=m({...f({setting:u})}),E=m({...g({setting:u,hasCollectionImage:!1})}),F=!!B?.link&&!x&&!w;return e("div",{...h,className:S,style:A,children:[o("div",{className:W,style:E}),o("div",{"aria-label":"Overlay",className:q,style:D}),i(F,o(k,{setting:{href:B?.link,target:B?.target},className:z})),o(s,{setting:{layout:I,horizontalAlign:R,verticalAlign:O},styles:{verticalGutter:M,width:L,fullWidth:{desktop:!1,tablet:!1,mobile:!1}},style:v,children:N})]})};export{CollectionBanner as default};
