'use client';
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{composeAppendTypoClass as o,composeAppendTypoStyle as m}from"../common/helpers.js";import{createClass as s,createStyle as n,If as i}from"@gem-sdk/system";import{getBreadcrumbChildItemStyles as l,generateBreadcrumbChildIconStyles as a}from"../common/styles.js";import{getBreadcrumbChildItemClasses as p,getBreadcrumbSecondItemClasses as c,generateBreadcrumbClasses as d}from"../common/classes.js";import{useMemo as y}from"react";let f=f=>{let{breadcrumbItemIndex:h,lengthOfBreadcrumb:u,setting:j,templateName:g,styles:x}=f,{hideCurrentPage:C,labelColor:I,fontWeight:N,iconSvg:S}=j??{},T=s({...p(h,u,o(x?.typo))}),$=n({...l({breadcrumbItemIndex:h,lengthOfBreadcrumb:u,fontWeight:N,appendTypoStyle:m(x?.typo),labelColor:I})}),_=n({...a(j?.iconWidth,j?.color)}),b=s({...c(h+1,C,u)}),k=y(()=>h+1===u,[h,u]),v=s({...d(j?.hideCurrentPage,{extendCondition:k})}),B=y(()=>k?`${T} ${v}`.trim():T,[T,v,k]);return e(r,{children:[t("div",{className:B,style:$,children:t("span",{children:g})}),i(!!(S&&!k),t("span",{style:_,className:b,dangerouslySetInnerHTML:{__html:S??""}}))]})};export{f as default};
