'use client';
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useEditorMode as m}from"@gem-sdk/core";import{createStyleReact as t,createStyle as r,createClass as o,createAttr as a,If as i}from"@gem-sdk/system";import l from"./AdaptiveImage.js";import p from"./NextImage.js";import{getWrapperStyles as c,getImageStyles as d,getContainerStyles as n}from"../common/styles.js";import{getWrapperClasses as f,getImageClasses as j,getContainerClasses as g}from"../common/classes.js";import{getContainerAttrs as u,getAdaptiveImageAttrs as y,getNextImageAttrs as N,getLinkWrapperAttrs as h}from"../common/attrs.js";import{getLinkData as k}from"../../helpers.js";let v=({style:v,styles:x,setting:I,children:C,advanced:W,className:A,builderAttrs:L,builderProps:b,onLoad:q,onClick:w})=>{let{imageLink:z,isAdaptive:B,enableImageLink:D}=I??{},E=m(),{Wrapper:F,urlData:G}=k({defaultWrap:"div",setting:z,enableImageLink:D}),H=t(c(x)),J=r(d(x,b)),K=r(n(v,x)),M=o(f()),O=o(j(A,x)),P=o(g(b?.uid,W?.cssClass,x?.shape)),Q=a(u(L,b?.uid)),R=h({urlData:G,imageLink:z,title:I?.title}),S=y({styles:x,setting:I,mode:E}),T=N({styles:x,setting:I});return e("div",{role:"presentation",...Q,style:K,className:P,onClick:w,children:[s(F,{...R,style:H,className:M,children:i(B,s(l,{...S,style:J,className:O}),s(p,{...T,style:J,className:O,onLoad:q}))}),C]})};export{v as default};
