let QUANTITY_SOURCE={AUTO:"auto",MANUAL:"manual"},OUT_OF_STOCK={SHOW:"show",HIDE:"hide"},DEFAULT_QUANTITY_TEMPLATE="%number%",DEFAULT_HIGHLIGHT_TAG="mark",NO_PRODUCT_LEFT=0,DEFAULT_SCARCITY_THRESHOLD=12,DEFAULT_REMAINING_QUANTITY=12,DEFAULT_REMAINING_PERCENT=20,MIN_REMAINING_QUANTITY=0,MIN_REMAINING_PERCENT=10,MAX_REMAINING_PERCENT=100,DEFAULT_RANGE_STEP=10,DEFAULT_FONT_SIZE=20,DEFAULT_PROGRESS_BAR_HEIGHT=10,MIN_PROGRESS_BAR_HEIGHT=5,MAX_PROGRESS_BAR_HEIGHT=20,CONTINUE_SELLING_WHEN_OUT_OF_STOCK="CONTINUE",getLiquidTextContent=e=>{let{templateStringDisplay:t,outOfStockMessageDisplay:a,continueSellingDisplay:i,unlimitedQuantityMessageDisplay:n}=e??{};return`{% if inventory_management == null and inventory_quantity <= 0 %}
                    ${n}
                  {% elsif available == false %}
                    ${a}
                  {% elsif available and inventory_policy == '${CONTINUE_SELLING_WHEN_OUT_OF_STOCK.toLowerCase()}' and inventory_quantity <= 0 %}
                    ${i}
                  {% else %}
                    ${t}
                  {% endif %}`},getLiquidInitData=(e,t)=>{let{scarcityThreshold:a=0,hiddenCounterWhenOutOfStock:i,displayByDefault:n}=e??{},{displayProgressBar:_}=t??{},r=!!a&&a>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 = ${r}
      assign check_display = ${!!n}

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

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

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

      if ${!0===_} 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 %}`},getTextDisplayData=(e,t)=>{let{templateStringDisplay:a,outOfStockMessageDisplay:i,continueSellingDisplay:n,unlimitedQuantityMessageDisplay:_}=e??{},{textColor:r}=t??{},s=r||"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-${s} gp-bg-g-${s}" >
      <div id="template">${a}</div>
      <div id="out-of-stock-message">${i}</div>
      <div id="continue-selling">${n}</div>
      <div id="unlimited-quantity-message">${_}</div>
    </div>`},getInlineCss=(e,t)=>{let a=getBorderRadius(t);if(e)return`
      [data-id="${e}"]  {
          .gp-sc-progress-bar{
            ${a}
          }
          .gp-sc-progress-bar:before{
            ${a}
          }
      }`},getBorderRadius=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"};`,transformHighlighTag=(e,t)=>{if(!e.includes(`<${DEFAULT_HIGHLIGHT_TAG}>`))return e;let a="gp-text-white gp-py-1 gp-px-2 gp-mr-1 gp-inline-block gp-my-[1px]",i=`<${DEFAULT_HIGHLIGHT_TAG}>`;return i=t.includes("#")?`
      <${DEFAULT_HIGHLIGHT_TAG} class='${a}' style='background-color: ${t}'>
    `:`
      <${DEFAULT_HIGHLIGHT_TAG} class='${a} gp-bg-g-${t}'>
    `,e.replaceAll(`<${DEFAULT_HIGHLIGHT_TAG}>`,i)},transformNumberTag=(e,t,a)=>{if(!e.includes(DEFAULT_QUANTITY_TEMPLATE))return e;let i="";return i=t.includes("#")?`<span style='--c: ${t}'><$quantity$></span>`:`<span class='gp-text-g-${t}'><$quantity$></span>`,a&&(i=i.replace("<$quantity$>",a.toString())),e.replaceAll(DEFAULT_QUANTITY_TEMPLATE,i)},convertSizeToWidth=e=>{let t={};return e["--size"]&&(t["--w"]=e["--size"]),e["--size-tablet"]&&(t["--w-tablet"]=e["--size-tablet"]),e["--size-mobile"]&&(t["--w-mobile"]=e["--size-mobile"]),t};export{CONTINUE_SELLING_WHEN_OUT_OF_STOCK,DEFAULT_FONT_SIZE,DEFAULT_HIGHLIGHT_TAG,DEFAULT_PROGRESS_BAR_HEIGHT,DEFAULT_QUANTITY_TEMPLATE,DEFAULT_RANGE_STEP,DEFAULT_REMAINING_PERCENT,DEFAULT_REMAINING_QUANTITY,DEFAULT_SCARCITY_THRESHOLD,MAX_PROGRESS_BAR_HEIGHT,MAX_REMAINING_PERCENT,MIN_PROGRESS_BAR_HEIGHT,MIN_REMAINING_PERCENT,MIN_REMAINING_QUANTITY,NO_PRODUCT_LEFT,OUT_OF_STOCK,QUANTITY_SOURCE,convertSizeToWidth,getInlineCss,getLiquidInitData,getLiquidTextContent,getTextDisplayData,transformHighlighTag,transformNumberTag};
