Liferay.Loader.define("portal-search-web@6.0.114/js/shared/input_sets/Item",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","./DropZone","./itemTypes"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),n=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]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(a("liferay!frontend-js-react-web$react")),o=a("liferay!frontend-js-react-web$react-dnd"),u=_interopRequireDefault(a("./DropZone")),c=a("./itemTypes");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 d=function Item({children:e,index:t,isLastItem:a,onInputSetItemDelete:d,onInputSetItemMove:f}){const[{isDragging:s},p,m]=(0,o.useDrag)({collect:e=>({isDragging:!!e.isDragging()}),item:{index:t,type:c.ITEM_TYPES.ITEM}});return i.default.createElement("div",{className:"input-sets-item-root"},i.default.createElement(u.default,{index:t,move:f}),i.default.createElement(n.default.Group,{className:"c-mb-0 c-pl-2 c-pr-2 input-sets-item-form-group list-group-item rounded",ref:m},i.default.createElement(n.ClayInput.Group,null,i.default.createElement(n.ClayInput.GroupItem,{className:"c-m-md-auto",ref:p,shrink:!0,style:{cursor:"move",opacity:s?.5:1}},i.default.createElement(r.default,{"aria-label":Liferay.Language.get("move"),borderless:!0,className:"shadow-none",displayType:"secondary",monospaced:!0,small:!0},i.default.createElement(l.default,{symbol:"drag"}))),e,i.default.createElement(n.ClayInput.GroupItem,{className:"c-m-md-auto",shrink:!0},i.default.createElement(r.default,{"aria-label":Liferay.Language.get("delete"),borderless:!0,className:"c-ml-2 shadow-none",displayType:"secondary",monospaced:!0,onClick:d(t),small:!0},i.default.createElement(l.default,{symbol:"trash"}))))),a&&i.default.createElement(u.default,{index:t+1,move:f}))};t.default=d}}));
//# sourceMappingURL=Item.js.map