Liferay.Loader.define("portal-search-web@6.0.73/js/components/SystemSettingsFieldList",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$react"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r("@frontend-taglib-clay$clayui/button"),l=(n=r("@frontend-taglib-clay$clayui/form"))&&n.__esModule?n:{default:n},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e={borderRadius:"10px",height:"18px",padding:"2px",position:"absolute",width:"18px"};var s=function({fieldLabel:t,fieldName:r,initialValue:n,namespace:i}){const[c,f]=(0,o.useState)(n||[]),s=e=>()=>{f([...c.slice(0,e+1),"",...c.slice(e+1)])},d=e=>()=>{f(c.filter(((t,r)=>e!==r)))},p=e=>t=>{const r=c.map(((r,n)=>e===n?t.target.value:r));f(r)};return o.default.createElement("div",{className:"system-settings-field-list-container"},c.map(((n,i)=>o.default.createElement(o.default.Fragment,{key:i},o.default.createElement(l.default.Group,null,i>0&&o.default.createElement(a.ClayButtonWithIcon,{className:"system-settings-field-list-delete-button",onClick:d(i),style:u(u({},e),{},{right:"30px"}),symbol:"hr",title:Liferay.Language.get("remove")}),o.default.createElement(a.ClayButtonWithIcon,{className:"system-settings-field-list-add-button",onClick:s(i),style:u(u({},e),{},{right:"8px"}),symbol:"plus",title:Liferay.Language.get("duplicate")}),o.default.createElement("label",{htmlFor:"".concat(r).concat(i)},t),o.default.createElement("textarea",{className:"form-control",id:"".concat(r).concat(i),onChange:p(i),value:n}))))),o.default.createElement("input",{name:"".concat(i).concat(r),type:"hidden",value:c.filter((e=>""!==e.trim())).join("|")}))};t.default=s}}));
//# sourceMappingURL=SystemSettingsFieldList.js.map