"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../../helpers.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers$1=require("./common/helpers.js"),attrs=require("./common/attrs.js"),translate=require("../../../settings/product-properties/configs/translate.js");const ProductPropertyInput=({setting:e,styles:r,builderProps:t,pageContext:s,attributes:a})=>{let{name:o,type:l,placeholder:u,required:m,minChar:n,maxChar:p,label:c}=e??{minChar:Number,maxChar:Number,minNumber:Number,maxNumber:Number},i="textarea"===l?"textarea":"input",d=helpers.getDynamicSourceLocales({val:u,uid:t?.uid,settingId:helpers.createSettingId({id:translate.ProductProperties?.placeholder?.id}),pageContext:s??{}}),g=`${d}${u&&m&&!c?" *":""}`,y=system.createClass({...classes.getClasses(r),...core.composeClasses("gp-shadow-none group-data-[invalid=true]:gp-border-[#F44336]")}),$=system.createStyle({...styles.getStyles(r)}),{elementValue:h}=helpers$1.getElementContent(e),q=system.createAttr({...attrs.getInputAttrs(a)});return core.template`
    <${i}
      ${{...q}}
      type="${l}"
      placeholder="${g}"
      name="properties[${o}]"
      form="{{ product_form_id }}"
      value="${h}"
      class="${y}"
      style="${$}"
      ${m?`required="${m}"`:""}
      minlength="${n}"
      maxlength="${p}"
    ></${i}>
    `};exports.default=ProductPropertyInput;
