"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../../helpers.js"),s=require("./common/styles.js"),l=require("@gem-sdk/system"),i=require("./common/classes.js"),a=require("./common/helpers.js");exports.default=({setting:r,advanced:o,builderProps:n,pageContext:c})=>{let p=l.createClass(i.getClassContainerCollectionDes({setting:r})),d=l.createClass(i.getClassButtonViewMore({setting:r})),g=l.createClass(i.getDescriptionClasses({advanced:o})),$=l.createClass(i.getShowMoreIconClasses()),u=l.createClass(i.getShowMoreTextClasses()),C=l.createClass(i.getClassPreBuilt()),m=l.createStyle({...s.getDefaultStyleCollectionDes({setting:r}),...e.makeStyleResponsive("line-clamp",e.makeLineClamp(r?.lineClamp,r?.hasLineClamp))}),v=l.createStyle({...s.getStyleDefaultViewMore(r)}),y=a.getViewLessText({setting:r,builderProps:n,pageContext:c,type:"liquid"}),S=a.getViewMoreText({setting:r,builderProps:n,pageContext:c,type:"liquid"}),w=l.createAttr({"data-id":`${n?.uid}`,"view-more-text":`${c?.isPreviewing?S:`{{${S}}}`}`,"view-less-text":`${c?.isPreviewing?y:`{{${y}}}`}`}),f=l.createAttr({"data-gp-text":""}),{gpDescriptionCss:q,textDescriptionCss:x}=s.getStaticCss(),L=l.createStateOrContext({setting:{lineClamp:r?.lineClamp,hasLineClamp:r?.hasLineClamp,viewMoreText:S,viewLessText:y,enableViewMoreIcon:r?.enableViewMoreIcon},textStyle:m});return l.If(!1,"",l.Liquid(e.template`
    <gp-collection-description
      ${w}
      class="${g}"
      gp-data='${JSON.stringify(L).replaceAll("'","&#039;")}'
    >
      <style>${x}</style>
      <style>${q}</style>
      <div class="${C}" ></div>
      ${l.LiquidUnless("collection","<p>Collection not found</p>",e.template`<div ${f} class="${p}" style="${m}">
          {{collection.description}}
        </div>
        ${l.LiquidIf("collection.description != blank",e.template`<button type="button" class="${d}" style="${v}">
          <span class="${u}">
            ${l.If(c?.isPreviewing,S?.toString()||"",`{{${S}}}`)}
          </span>
          ${l.If(r?.enableViewMoreIcon,e.template`<span class="${$}">${a.ICON_SVG}</span>`," ")}
          </button>`)}`)}
    </gp-collection-description>
    ${(()=>{let s=e.isLocalEnv?"{{ 'gp-collection-description-v7-5.js' | asset_url }}":`${e.baseAssetURL}/assets-v2/gp-collection-description-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="${s}" defer="defer"></script>`})()}
    `))};
