Liferay.Loader.define("portal-search-web@6.0.114/js/components/search_bar_configuration_suggestions/contributor_input_set_item/inputs/FieldsInput",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/multi-select","@frontend-taglib-clay$clayui/tooltip","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("@frontend-taglib-clay$clayui/form"),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/multi-select")),i=a("@frontend-taglib-clay$clayui/tooltip"),u=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=r?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(a,l,n):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var c=function FieldsInput({onChange:e,isRequired:t=!1,fields:a=[],touched:c,onBlur:f}){const[d,s]=(0,o.useState)(""),[p,y]=(0,o.useState)(a.map((e=>({label:e,value:e}))));return(0,o.useEffect)((()=>{e(p.map((e=>e.value)))}),[p]),o.default.createElement(r.ClayInput.GroupItem,{className:(0,u.default)({"has-error":t&&!p.length&&c})},o.default.createElement("label",null,Liferay.Language.get("fields"),o.default.createElement(i.ClayTooltipProvider,null,o.default.createElement("span",{className:"c-ml-2","data-tooltip-align":"top",title:Liferay.Language.get("fields-suggestion-help")},o.default.createElement(l.default,{symbol:"question-circle-full"})))),o.default.createElement(n.default,{items:p,onBlur:()=>{d&&(y([...p,{label:d,value:d}]),s("")),f()},onChange:s,onItemsChange:y,value:d}))};t.default=c}}));
//# sourceMappingURL=FieldsInput.js.map