import{template as e}from"@gem-sdk/core";import{getDynamicSourceLocales as t,createSettingId as s}from"../../../helpers.js";import{createStyle as r,createClass as a,If as o}from"@gem-sdk/system";import{composeContainerStyles as i,composeTextareaStyles as l,getRowsTextArea as d}from"./common/styles.js";import{composeContainerClasses as m,composeTextFieldClasses as p}from"./common/classes.js";import{TextInput as $}from"../../settings/text-input/configs/translate.js";let n=({setting:n,builderProps:c,className:u,builderAttrs:x,advanced:f,pageContext:v,styles:g})=>{let{text:y,name:h,placeholder:j,required:I,formType:T}=n??{},k=h?.[T??"text"]===""||void 0===h?"contact[first_name]":h?.[T??"text"],q=t({val:j,uid:c?.uid,settingId:s({id:$?.placeholder?.id}),pageContext:v??{}}),C=r(i(f,n)),w=a(m(f,c)),F=a(p(n,c,u??"")),_=r(l(f,n,g)),b=a({composedTextFieldClasses:!0}),z=d(n),A="textarea"===T;return e`
    <div
      ${x}
      data-id="${c?.uid}"
      class="${w}"
      style="${C}"
    >
      <div>
        ${o(!A,e`<input
            type="text"
            class="${F}"
            style="${_}"
            placeholder="${q}"
            ${o(I,"required")}
            name="${k}"
            value="${y}"
          ></input>`,e`<textarea
            rows="${z}"
            class="${b}"
            style="${_}"
            placeholder="${q}"
            ${o(I,"required")}
            name="${k}"
            value="${y}"
          ></textarea>`)}
      </div>
    </div>
  `};export{n as default};
