Liferay.Loader.define("portal-search-ranking-web@3.0.53/js/components/alias/Alias.es",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/multi-select","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/constants.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/multi-select")),i=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),u=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireWildcard(a("liferay!frontend-js-react-web$react"))),o=a("../../utils/constants.es");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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 n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Alias extends u.Component{constructor(...e){super(...e),_defineProperty(this,"state",{inputValue:""}),_defineProperty(this,"_handleInputChange",(e=>{this.setState({inputValue:e})})),_defineProperty(this,"_handleItemsChange",(e=>{this.props.onChange(function filterDuplicates(e){const t=function filterEmptyStrings(e){return e.filter((({label:e,value:t})=>e&&t))}(function trimListItems(e){return e.map((({label:e,value:t})=>({label:e.trim(),value:t.trim()})))}(e));return t.filter(((e,a)=>t.findIndex((t=>t.label===e.label&&t.value===e.value))===a))}(e))}))}render(){const{keywords:e}=this.props,{inputValue:t}=this.state;return u.default.createElement(r.default.Group,null,u.default.createElement("label",{htmlFor:"aliases-input"},Liferay.Language.get("aliases"),u.default.createElement("span",{className:(0,i.default)("input-label-help-icon",o.PORTAL_TOOLTIP_TRIGGER_CLASS),"data-title":Liferay.Language.get("add-an-alias-help")},u.default.createElement(n.default,{symbol:"question-circle-full"}))),u.default.createElement(r.ClayInput.Group,null,u.default.createElement(r.ClayInput.GroupItem,null,u.default.createElement(l.default,{id:"aliases-input",items:(a=e,a.map((e=>({label:e,value:e})))),onChange:this._handleInputChange,onItemsChange:this._handleItemsChange,value:t}),u.default.createElement(r.default.FeedbackGroup,null,u.default.createElement(r.default.Text,null,Liferay.Language.get("add-an-alias-instruction"))))));var a}}var s=Alias;t.default=s}}));
//# sourceMappingURL=Alias.es.js.map