'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("./common/styles.js"),r=require("./common/classes.js"),l=require("@gem-sdk/system"),a=require("./common/helpers.js"),i=require("../../hooks/useDescription.js");exports.default=({setting:o,builderProps:n,pageContext:c,advanced:m})=>{let{isPreviewSharePageMode:d}=s.useRenderMode(),u=s.useCollection(),{ref:C,open:p,isShowViewMore:g,handleToggleShowMore:y,hasLineClamp:x}=i.useGpDescription(o),h=s.t("This collection does not have a description"),j=u?.descriptionHtml,S=l.createClass(r.getClassContainerCollectionDes({setting:o})),M=l.createClass(r.getClassEmptyCollectionDes()),I=l.createClass(r.getClassButtonViewMore({setting:o})),f=l.createClass(r.getDescriptionClasses({advanced:m})),_=l.createClass({...r.getShowMoreIconClasses(),...p?{"gp-rotate-180":!0}:{}}),v=l.createClass(r.getShowMoreTextClasses()),D=l.createClass(r.getClassPreBuilt()),N=l.createStyle({...t.getDefaultStyleCollectionDes({setting:o}),...p?{}:s.makeStyleResponsive("line-clamp",s.makeLineClamp(o?.lineClamp,o?.hasLineClamp))}),q=l.createStyle({...t.getStyleDefaultViewMore(o)}),w=a.getViewLessText({setting:o,builderProps:n,pageContext:c,type:"react"}),T=a.getViewMoreText({setting:o,builderProps:n,pageContext:c,type:"react"}),k=l.createAttr({"data-id":`${n?.uid}`}),L=l.createAttr({"data-gp-text":""}),{gpDescriptionCss:V,textDescriptionCss:H}=t.getStaticCss(),b=d?"":e.jsx("div",{className:M,dangerouslySetInnerHTML:{__html:h}});return e.jsx(e.Fragment,{children:l.If(!j,b,e.jsxs("div",{...k,className:f,children:[e.jsx("style",{children:H}),e.jsx("style",{children:V}),e.jsx("div",{className:D}),e.jsx("div",{ref:C,className:S,style:N,dangerouslySetInnerHTML:{__html:u?.descriptionHtml??""},...L}),l.If(x&&g,e.jsxs("button",{type:"button",className:I,style:q,onClick:y,children:[e.jsx("span",{className:v,children:l.If(p,w?.toString()??"",T?.toString()??"")}),l.If(o?.enableViewMoreIcon,e.jsx("span",{className:_,dangerouslySetInnerHTML:{__html:a.ICON_SVG}}),"")]}),"")]}))})};
