"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),ProductPropertyChoice_liquid=require("./property-choice/ProductPropertyChoice.liquid.js"),ProductPropertyInput_liquid=require("./property-input/ProductPropertyInput.liquid.js"),ProductPropertySelect_liquid=require("./property-select/ProductPropertySelect.liquid.js"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),helpers=require("./common/helpers.js"),attrs=require("./common/attrs.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js");const ProductProperties=({setting:e,styles:s,builderProps:t,advanced:r,pageContext:l})=>{let{name:a,type:o,childItem:p,translate:c}=e??{},{isDisplayLabel:d=!0}=s??{};e&&!a&&(e.name="Property");let i=t?.uid,{displayLabel:u}=helpers.getContents(i,l,e),y=system.createAttr({...attrs.getWrapperLiquidAttrs(i,l,e)}),n=system.createStyle({...styles.getWrapperStyles(s)}),g=system.createStyle({...styles.getLabelStyles(s)}),m=system.createClass({...classes.getLabelClasses(s)}),C=system.createClass({...classes.getLiquidTagClasses(e)}),P=system.createClass({...classes.getLabelWrapperClasses(r)}),$=system.createStyle({...styles.getLabelContentStyles()}),h=helpers.getLabelContent(e),q=system.createClass({...classes.getWrapperErrorMessageClasses(),...core.composeClasses("data-[hidden=true]:gp-hidden")}),v=system.createStyle({...styles.getWrapperErrorMessageStyles(s)}),f=system.createAttr({...attrs.getWrapperErrorMessageAttrs()});return core.template`
    <gp-product-property ${{...y}} class="${C}"
      style="${n}"
    >
      ${core.RenderIf(d,core.template`<div class="${P}">
        <label htmlFor="${i}-${a}" class="${m}" style="${g}">
          ${u}
          <span style="${$}">${h}</span>
        </label>
      </div>`)}

      <div>
        ${core.RenderIf("dropdown"===o,ProductPropertySelect_liquid.default({setting:e,styles:s,builderProps:t,pageContext:l}))}
        ${core.RenderIf("checkbox"===o||"radio"===o,ProductPropertyChoice_liquid.default({setting:{...e,childItem:p,name:a,translate:c},styles:s,builderProps:t,pageContext:l}))}
        ${core.RenderIf("text"===o||"textarea"===o||"email"===o||"hidden"===o,ProductPropertyInput_liquid.default({setting:e,styles:s,builderProps:t,pageContext:l}))}
        <div
          ${{...f}}
          class="${q}"
          style="${v}"
        >
          <svg
            width="16"
            height="16"
            viewBox="0 0 16 16"
            fill="currentColor"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8 10.5C7.58579 10.5 7.25 10.8358 7.25 11.25C7.25 11.6642 7.58579 12 8 12C8.41421 12 8.75 11.6642 8.75 11.25C8.75 10.8358 8.41421 10.5 8 10.5ZM8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4V9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9V4Z"
              fill="currentColor"
            ></path>
          </svg>
          <span data-slot-type="message-content" class="gp-pl-1"></span>
        </div>
      </div>
    </gp-product-property>
    ${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-property-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-property-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}`};exports.default=ProductProperties;
