"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),BreadcrumbItem_liquid=require("./BreadcrumbItem.liquid.js"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),types=require("../types.js"),constants=require("../constants.js");const Breadcrumb=({setting:e={},builderAttrs:s,style:t,styles:a={},className:r,builderProps:l,advanced:m})=>{let c=[types.ShopifyTemplate.HOME,types.ShopifyTemplate.LANDING,types.ShopifyTemplate.PRODUCT,types.ShopifyTemplate.COLLECTION,types.ShopifyTemplate.ARTICLE],{spacing:i,align:p,background:y}=e??{},o=c.map(s=>BreadcrumbItem_liquid.BreadcrumbItem({lengthOfBreadcrumb:s===types.ShopifyTemplate.HOME?constants.SHOPIFY_TEMPLATE_BREADCRUMB_LENGTH.HOME:constants.SHOPIFY_TEMPLATE_BREADCRUMB_LENGTH.OTHERS_TEMPLATE,breadcrumbItemIndex:s===types.ShopifyTemplate.HOME?constants.SHOPIFY_TEMPLATE_BREADCRUMB_ITEM_INDEX.HOME:constants.SHOPIFY_TEMPLATE_BREADCRUMB_ITEM_INDEX.OTHERS_TEMPLATE,templateName:s,setting:e,styles:a})).join(""),n=system.createAttr({...attrs.getAttr({uid:l?.uid??"",builderAttrs:s})}),u=system.createClass({...classes.getBreadcrumbClasses(r),...m?.cssClass&&{[m.cssClass]:!0}}),E=system.createStyle({...styles.getBreadcrumbStyles(t,{background:y,align:p})}),d=system.createClass({...classes.getNavClasses()}),T=system.createAttr({...attrs.getNavAttr()}),S=system.createStyle({...core.makeGlobalSize(e?.globalSize).padding,...styles.getSpacingStyles(i),...core.makeStyleResponsive("jc",p)});return system.Liquid(core.template`
    <div ${{...n}}
      style="${E}"
      class="${u}">
      ${system.LiquidUnless("template == 'cart' or template == 'list-collections' or template == '404'",core.template`
        ${system.Liquid(`
          {% assign tpl = template %}
          {% if tpl contains '.' %}
            {% assign tpl = tpl | split: '.' | first %}
          {% endif %}
        `)}
        <nav style="${S}" class="${d}" ${{...T}}>
          ${o}
        </nav>
      `)}
  </div>`)};exports.default=Breadcrumb;
