Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/sxp_blueprint_admin/js/shared/sxp_element/FieldListInput",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$react","./FieldRow"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/form")),l=_interopRequireDefault(r("@frontend-taglib-clay$clayui/icon")),o=_interopRequireDefault(r("liferay!frontend-js-react-web$react")),i=_interopRequireDefault(r("./FieldRow"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FieldListInput({disabled:e,id:t,indexFields:r,name:d,setFieldTouched:c,setFieldValue:u,showBoost:f,value:s}){const _handleBlur=()=>{c(d)},_handleChange=e=>t=>{u("".concat(d,"[").concat(e,"]"),_objectSpread(_objectSpread({},s[e]),t))},_handleFieldRowDelete=e=>()=>{_handleBlur(),u(d,s.filter(((t,r)=>e!==r)))};return o.default.createElement("div",{className:"field"},null==s?void 0:s.map(((a,n)=>o.default.createElement(i.default,{boost:a.boost,disabled:e,field:a.field,id:0===n?t:"".concat(t,"_").concat(n),index:n,indexFields:r,key:n,languageIdPosition:a.languageIdPosition,locale:a.locale,onBlur:_handleBlur,onChange:_handleChange(n),onDelete:_handleFieldRowDelete(n),showBoost:f}))),o.default.createElement(n.default.Group,{className:"add-remove-field"},o.default.createElement(a.default.Group,{spaced:!0},o.default.createElement(a.default,{"aria-label":Liferay.Language.get("add-field"),disabled:e,displayType:"secondary",monospaced:!0,onClick:()=>{u(d,[...s,{field:""}])},small:!0},o.default.createElement(l.default,{symbol:"plus"})))))}var d=o.default.memo(FieldListInput);t.default=d}}));
//# sourceMappingURL=FieldListInput.js.map