Liferay.Loader.define("depot-web@2.0.70/js/LanguagesList.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/table","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd","liferay!frontend-js-react-web$react-dnd-html5-backend","./LanguageListItem.es","./LanguageListItemEditable.es"],(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/table")),l=_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),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 r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),i=r("liferay!frontend-js-react-web$react-dnd"),u=r("liferay!frontend-js-react-web$react-dnd-html5-backend"),c=_interopRequireDefault(r("./LanguageListItem.es")),d=_interopRequireDefault(r("./LanguageListItemEditable.es"));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}}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}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}const noop=()=>{},LanguagesList=({defaultLocaleId:e,locales:t,isEditable:r=!1,onMakeDefault:l=noop,onEditBtnClick:f=noop,onItemDrop:s=noop,moveItem:p=noop})=>{const y=(0,o.useRef)((0,i.createDndContext)(u.HTML5Backend));return o.default.createElement(n.default,{borderless:!0,headVerticalAlignment:"middle",hover:!1},o.default.createElement(n.default.Head,null,o.default.createElement(n.default.Row,null,o.default.createElement(n.default.Cell,{expanded:!0,headingCell:!0,headingTitle:!0},Liferay.Language.get("active-language")),r&&o.default.createElement(n.default.Cell,{align:"center"},o.default.createElement(a.default,{displayType:"secondary",onClick:f,small:!0},Liferay.Language.get("edit"))))),o.default.createElement(n.default.Body,null,o.default.createElement(i.DndProvider,{manager:y.current.dragDropManager},t.map(((a,n)=>{const i=_objectSpread(_objectSpread({},a),{},{index:n,isDefault:e===a.localeId,key:a.localeId});return r?o.default.createElement(d.default,_extends({},i,{isFirst:0===n,isLast:n===t.length-1,onItemDrop:s,onMakeDefault:l,onMoveDown:()=>p(n,n+1),onMoveUp:()=>p(n,n-1)})):o.default.createElement(c.default,i)})))))};LanguagesList.prototypes={isEditable:l.default.bool,moveItem:l.default.func,onEditBtnClick:l.default.func,onItemDrop:l.default.func,onMakeDefault:l.default.func};var f=LanguagesList;t.default=f}}));
//# sourceMappingURL=LanguagesList.es.js.map