"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),Text_liquid=require("../../../text/components/Text.liquid.js"),system=require("@gem-sdk/system");const ProductSku=({setting:e,styles:t,advanced:s,builderProps:r})=>{let a=t?.typo?.attrs?.transform==="capitalize",l=e?.label&&e.label.trim().length?`${a?e.label.toString().toLocaleLowerCase():e.label}`:"";t?.disableHoverColor&&delete t.underlineLink;let u=()=>{let e=core.isLocalEnv?"{{ 'gp-product-sku-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-sku-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return core.template`
    ${system.LiquidUnless("product","<p>Product not found</p>",`{% assign currentVariant = product.selected_or_first_available_variant %}
      <gp-product-sku gp-data='${JSON.stringify({label:l})}'>
        ${Text_liquid.default({styles:t,setting:{...e,text:`${system.LiquidIf("currentVariant.sku.size > 0 ",`${l} ${system.If(a,"{{ currentVariant.sku | downcase }}","{{ currentVariant.sku }}")}`)}`,excludeFlex:!0,isForceValue:!0},advanced:s,builderProps:r,className:"gp-product-sku"})}
      </gp-product-sku>
      ${u()}`)}`};exports.default=ProductSku;
