Liferay.Loader.define("depot-web@2.0.70/js/ManageLanguages.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/label","@frontend-taglib-clay$clayui/modal","@frontend-taglib-clay$clayui/table","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default(e){return c.default.createElement(ManageLanguages,e)};var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),r=a("@frontend-taglib-clay$clayui/form"),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/label")),u=_interopRequireDefault(a("@frontend-taglib-clay$clayui/modal")),o=_interopRequireDefault(a("@frontend-taglib-clay$clayui/table")),c=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}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}}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}const noop=()=>{},ManageLanguages=({availableLocales:e,customDefaultLocaleId:t,customLocales:a,observer:d,onModalClose:i=noop,onModalDone:f=noop})=>{const[s,y]=(0,c.useState)(a),[p,g]=(0,c.useState)(s.map((({localeId:e})=>e)));(0,c.useEffect)((()=>{g(s.map((({localeId:e})=>e)))}),[s]);const Language=({displayName:e,isDefault:t,localeId:a})=>{const l=-1!==p.indexOf(a);return c.default.createElement(o.default.Row,null,c.default.createElement(o.default.Cell,null,c.default.createElement(r.ClayCheckbox,{checked:l,disabled:t,label:e,onChange:()=>{((e,t,a)=>{y(e?s.concat({displayName:t,localeId:a}):s.filter((({localeId:e})=>e!==a)))})(!l,e,a)}},t&&c.default.createElement(n.default,{className:"ml-3",displayType:"info"},Liferay.Language.get("default")))))};return c.default.createElement(u.default,{observer:d,size:"md"},c.default.createElement(u.default.Header,null,Liferay.Language.get("language-selection")),c.default.createElement(u.default.Body,{scrollable:!0},c.default.createElement(o.default,{borderless:!0,headVerticalAlignment:"middle"},c.default.createElement(o.default.Body,null,e.map((e=>c.default.createElement(Language,_extends({},e,{isDefault:t===e.localeId,key:e.localeId}))))))),c.default.createElement(u.default.Footer,{last:c.default.createElement(l.default.Group,{spaced:!0},c.default.createElement(l.default,{displayType:"secondary",onClick:i},Liferay.Language.get("cancel")),c.default.createElement(l.default,{displayType:"primary",onClick:()=>f(s)},Liferay.Language.get("done")))}))}}}));
//# sourceMappingURL=ManageLanguages.es.js.map