Liferay.Loader.define("@liferay/analytics-settings-web@5.0.47/js/components/people/Modal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$react","../../utils/api","../../utils/constants","../table/Table","../table/utils"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/modal")),l=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={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=r("../../utils/api"),u=r("../../utils/constants"),c=_interopRequireDefault(r("../table/Table")),i=r("../table/utils");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 ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}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}var _default=({columns:e,emptyStateTitle:t,name:r,noResultsTitle:s,observer:d,onCloseModal:f,requestFn:p,syncAllAccounts:y,syncAllContacts:b,syncedIds:g,title:m})=>{const[O,j]=(0,l.useState)({});return l.default.createElement(a.default,{center:!0,observer:d,size:"lg"},l.default.createElement(a.default.Header,null,m),l.default.createElement(a.default.Body,null,l.default.createElement(c.default,{columns:e,emptyStateTitle:t,mapperItems:e=>e.map((({id:e,name:t,selected:r})=>({checked:r,columns:[{label:t}],disabled:!1,id:String(e)}))),noResultsTitle:s,onItemsChange:j,requestFn:p})),l.default.createElement(a.default.Footer,{last:l.default.createElement(n.default.Group,{spaced:!0},l.default.createElement(n.default,{displayType:"secondary",onClick:()=>f()},Liferay.Language.get("cancel")),l.default.createElement(n.default,{onClick:async()=>{const{ok:e}=await(0,o.updateAttributesConfiguration)(_objectSpread(_objectSpread({},g),{},{[r]:(0,i.getIds)(O,g[r].map((e=>Number(e)))),syncAllAccounts:y,syncAllContacts:b}));e&&(Liferay.Util.openToast({message:u.SUCCESS_MESSAGE}),f())}},Liferay.Language.get("add")))}))};t.default=_default}}));
//# sourceMappingURL=Modal.js.map