let e={AUTO:"auto",MANUAL:"manual"},a={SHOW:"show",HIDE:"hide"},i="%number%",t="mark",n=0,r=12,s=12,l=20,o=0,_=10,d=100,g=10,u=20,p=10,y=5,v=20,T="CONTINUE",c=e=>{let{templateStringDisplay:a,outOfStockMessageDisplay:i,continueSellingDisplay:t,unlimitedQuantityMessageDisplay:n}=e??{};return`{% if inventory_management == null and inventory_quantity <= 0 %}
                    ${n}
                  {% elsif available == false %}
                    ${i}
                  {% elsif available and inventory_policy == '${T.toLowerCase()}' and inventory_quantity <= 0 %}
                    ${t}
                  {% else %}
                    ${a}
                  {% endif %}`},f=(e,a)=>{let{scarcityThreshold:i=0,hiddenCounterWhenOutOfStock:t,displayByDefault:n}=e??{},{displayProgressBar:r}=a??{},s=!!i&&i>0;return`{%- liquid
      assign current_variant = variant
      assign available = current_variant.available | default: false
      assign inventory_management = current_variant.inventory_management | default: null
      assign inventory_policy = current_variant.inventory_policy | default: 'deny'
      assign inventory_quantity = current_variant.inventory_quantity | default: 0
      assign scarcityThreshold = ${s}
      assign check_display = ${!!n}

      if inventory_management != null and available == false and inventory_quantity <= 0 and inventory_policy != '${T.toLowerCase()}'
        assign is_out_of_stock = true
        else
        assign is_out_of_stock = false
      endif

      if check_display == true
        assign should_display = true
      elsif ${s} and inventory_quantity >= 0 and inventory_quantity < ${i}
        assign should_display = true
      else
        assign should_display = false
      endif

      if ${!0===t} and available == false
        assign should_display = false
      endif

      if ${!0===r} and available
        assign show_progress_bar = true
      else
        assign show_progress_bar = false
      endif
    -%}
    {% capture variant_policy_list %}
      {
        {% for variant in product.variants %}
        "{{ variant.id }}":"{{ variant.inventory_policy }}",
        "{{ variant.id }}_management":"{{ variant.inventory_management }}"{% if forloop.last == false %},{% endif %}
        {% endfor %}
      }
    {% endcapture %}`},$=(e,a)=>{let{templateStringDisplay:i,outOfStockMessageDisplay:t,continueSellingDisplay:n,unlimitedQuantityMessageDisplay:r}=e??{},{textColor:s}=a??{},l=s||"brand";return`
    <div class="gp-hidden gp-text-white gp-py-1 gp-px-2 gp-mr-1 gp-inline-block gp-my-[1px] gp-text-g-${l} gp-bg-g-${l}" >
      <div id="template">${i}</div>
      <div id="out-of-stock-message">${t}</div>
      <div id="continue-selling">${n}</div>
      <div id="unlimited-quantity-message">${r}</div>
    </div>`},b=(e,a)=>{let i=E(a);if(e)return`
      [data-id="${e}"]  {
          .gp-sc-progress-bar{
            ${i}
          }
          .gp-sc-progress-bar:before{
            ${i}
          }
      }`},E=e=>`
  border-top-left-radius: ${e?.bbrr??"0px"};
  border-top-right-radius: ${e?.bblr??"0px"};
  border-bottom-left-radius: ${e?.btrr??"0px"};
  border-bottom-right-radius: ${e?.btlr??"0px"};`,m=(e,a)=>{if(!e.includes(`<${t}>`))return e;let i="gp-text-white gp-py-1 gp-px-2 gp-mr-1 gp-inline-block gp-my-[1px]",n=`<${t}>`;return n=a.includes("#")?`
      <${t} class='${i}' style='background-color: ${a}'>
    `:`
      <${t} class='${i} gp-bg-g-${a}'>
    `,e.replaceAll(`<${t}>`,n)},A=(e,a,t)=>{if(!e.includes(i))return e;let n="";return n=a.includes("#")?`<span style='--c: ${a}'><$quantity$></span>`:`<span class='gp-text-g-${a}'><$quantity$></span>`,t&&(n=n.replace("<$quantity$>",t.toString())),e.replaceAll(i,n)},N=e=>{let a={};return e["--size"]&&(a["--w"]=e["--size"]),e["--size-tablet"]&&(a["--w-tablet"]=e["--size-tablet"]),e["--size-mobile"]&&(a["--w-mobile"]=e["--size-mobile"]),a};export{T as CONTINUE_SELLING_WHEN_OUT_OF_STOCK,u as DEFAULT_FONT_SIZE,t as DEFAULT_HIGHLIGHT_TAG,p as DEFAULT_PROGRESS_BAR_HEIGHT,i as DEFAULT_QUANTITY_TEMPLATE,g as DEFAULT_RANGE_STEP,l as DEFAULT_REMAINING_PERCENT,s as DEFAULT_REMAINING_QUANTITY,r as DEFAULT_SCARCITY_THRESHOLD,v as MAX_PROGRESS_BAR_HEIGHT,d as MAX_REMAINING_PERCENT,y as MIN_PROGRESS_BAR_HEIGHT,_ as MIN_REMAINING_PERCENT,o as MIN_REMAINING_QUANTITY,n as NO_PRODUCT_LEFT,a as OUT_OF_STOCK,e as QUANTITY_SOURCE,N as convertSizeToWidth,b as getInlineCss,f as getLiquidInitData,c as getLiquidTextContent,$ as getTextDisplayData,m as transformHighlighTag,A as transformNumberTag};
