"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),translate=require("../../settings/text-input/configs/translate.js");const TextInput=({setting:e,builderProps:s,className:t,builderAttrs:a,advanced:r,pageContext:l,styles:c})=>{let{text:o,name:i,placeholder:m,required:n,formType:d}=e??{},p=i?.[d??"text"]===""||void 0===i?"contact[first_name]":i?.[d??"text"],y=helpers.getDynamicSourceLocales({val:m,uid:s?.uid,settingId:helpers.createSettingId({id:translate.TextInput?.placeholder?.id}),pageContext:l??{}}),u=system.createStyle(styles.composeContainerStyles(r,e)),$=system.createClass(classes.composeContainerClasses(r,s)),x=system.createClass(classes.composeTextFieldClasses(e,s,t??"")),v=system.createStyle(styles.composeTextareaStyles(r,e,c)),g=system.createClass({composedTextFieldClasses:!0}),C=styles.getRowsTextArea(e),q="textarea"===d;return core.template`
    <div
      ${a}
      data-id="${s?.uid}"
      class="${$}"
      style="${u}"
    >
      <div>
        ${system.If(!q,core.template`<input
            type="text"
            class="${x}"
            style="${v}"
            placeholder="${y}"
            ${system.If(n,"required")}
            name="${p}"
            value="${o}"
          ></input>`,core.template`<textarea
            rows="${C}"
            class="${g}"
            style="${v}"
            placeholder="${y}"
            ${system.If(n,"required")}
            name="${p}"
            value="${o}"
          ></textarea>`)}
      </div>
    </div>
  `};exports.default=TextInput;
