'use client';
import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{useEditorMode as s,isEmptyChildren as m}from"@gem-sdk/core";import o from"next/head";import t from"../../grid/components/ChildrenDroppable.js";import"react";import{ELEMENT_Z_INDEX as a}from"../../common/const.js";import l from"../hooks/useSticky.js";import{createStyle as d,createClass as c}from"@gem-sdk/system";import{getContentStyles as n}from"../common/styles.js";import{getContainerClasses as p}from"../common/classes.js";let Sticky=({children:f,builderAttrs:g,setting:k,style:h,builderProps:u,advanced:y})=>{let j=s(),{background:b,preloadBgImage:x,width:C,isScrollToTop:S}=k??{},{positionStyle:v,displayStyle:I,makeDisplaySettingStyles:q,getCSSAlign:z,w:D}=l(k),K=d({margin:"0 auto",...I,...z,...v,zIndex:a.STICKY,..."edit"!==j&&q}),L=d(n({width:C,style:h,background:b})),N=c(p({uid:u?.uid,isScrollToTop:S,cssClass:y?.cssClass,isLiquid:!1}));return e(r,{children:[!!x&&e(o,{children:[!!b?.desktop?.image?.src&&i("link",{rel:"preload",href:b.desktop.image.src,as:"image"}),!!b?.tablet?.image?.src&&i("link",{rel:"preload",href:b.tablet.image.src,as:"image"}),!!b?.mobile?.image?.src&&i("link",{rel:"preload",href:b.mobile.image.src,as:"image"})]}),i("div",{className:N,id:u?.uid,style:{...D,...K},children:i("div",{...g,"data-id":u?.uid,style:L,children:m(f)?i(t,{}):f})})]})};export{Sticky as default};
