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