"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js");const Sticky=({children:e,builderAttrs:s,setting:t,style:r,builderProps:a,advanced:i,pageContext:l})=>{let{width:d,position:o,display:c,preloadBgImage:n,background:p,isScrollToTop:g}=t??{},m=i?.d,y=system.createStyle({...core.makeStyleResponsive("w",d),...styles.getContainerStyles({position:o,style:r,display:c})}),u=system.createStyle(styles.getContentStyles({setting:t,style:r,uid:a?.uid,pageContext:l??{},type:"Liquid"})),$=system.createClass(classes.getContainerClasses({uid:a?.uid,isScrollToTop:g,cssClass:i?.cssClass,isLiquid:!0})),k=system.createStateOrContext({uid:a?.uid,setting:{display:{desktop:c?.desktop,tablet:c?.tablet??c?.desktop,mobile:c?.mobile??c?.tablet??c?.desktop}},advanced:{d:m}}),f=`.drawer-page-content {
       transform: none !important;
      -webkit-transform: none !important;
  }`;return core.template`
    ${core.RenderIf(!!n,`${core.RenderIf(!!p?.desktop?.image?.src,`<link rel="preload" href="${p?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!p?.tablet?.image?.src,`<link rel="preload" href="${p?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!p?.mobile?.image?.src,`<link rel="preload" href="${p?.mobile?.image?.src}" as="image" />`)}`)}
    <gp-sticky
    data-id="${a?.uid}"
      gp-data='${JSON.stringify(k)}'
      id="${a?.uid}"
      data-id="${a?.uid}"
      class="${$} ${helpers.getSettingPreloadData("gps-lazy")}"
      style="${y}"
    >
      <style>${f}</style>
      <div ${{...s}} style="${{...u}}">
        ${e}
      </div>
    </gp-sticky>
    ${core.RenderIf(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-sticky-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-sticky-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};exports.default=Sticky;
