"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})=>{let{width:l,position:d,display:o,preloadBgImage:c,background:n,isScrollToTop:p}=t??{},m=i?.d,g=system.createStyle({...core.makeStyleResponsive("w",l),...styles.getContainerStyles({position:d,style:r,display:o})}),y=system.createStyle(styles.getContentStyles({width:l,style:r,background:n})),$=system.createClass(classes.getContainerClasses({uid:a?.uid,isScrollToTop:p,cssClass:i?.cssClass,isLiquid:!0})),k=system.createStateOrContext({uid:a?.uid,setting:{display:{desktop:o?.desktop,tablet:o?.tablet??o?.desktop,mobile:o?.mobile??o?.tablet??o?.desktop}},advanced:{d:m}}),u=`.drawer-page-content {
       transform: none !important;
      -webkit-transform: none !important;
  }`;return core.template`
    ${core.RenderIf(!!c,`${core.RenderIf(!!n?.desktop?.image?.src,`<link rel="preload" href="${n?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!n?.tablet?.image?.src,`<link rel="preload" href="${n?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!n?.mobile?.image?.src,`<link rel="preload" href="${n?.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="${g}"
    >
      <style>${u}</style>
      <div ${{...s}} style="${{...y}}">
        ${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;
