Liferay.Loader.define("@liferay/analytics-settings-web@5.0.51/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","../table/Table","../table/utils"],(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/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={},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")),o=r("../../utils/api"),u=_interopRequireDefault(r("../table/Table")),c=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 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}var _default=({columns:e,emptyState:t,name:r,observer:i,onCloseModal:d,requestFn:f,syncAllAccounts:s,syncAllContacts:p,syncedIds:y,title:b})=>{const[g,m]=(0,l.useState)({});return l.default.createElement(n.default,{center:!0,observer:i,size:"lg"},l.default.createElement(n.default.Header,null,b),l.default.createElement(n.default.Body,null,l.default.createElement(u.default,{columns:e,emptyState:t,mapperItems:e=>e.map((({id:e,name:t,selected:r})=>({checked:r,columns:[{id:"name",value:t}],disabled:!1,id:String(e)}))),onItemsChange:m,requestFn:f})),l.default.createElement(n.default.Footer,{last:l.default.createElement(a.default.Group,{spaced:!0},l.default.createElement(a.default,{displayType:"secondary",onClick:()=>d()},Liferay.Language.get("cancel")),l.default.createElement(a.default,{onClick:async()=>{const{ok:e}=await(0,o.updateAttributesConfiguration)(_objectSpread(_objectSpread({},y),{},{[r]:(0,c.getIds)(g,y[r].map((e=>Number(e)))),syncAllAccounts:s,syncAllContacts:p}));e&&(Liferay.Util.openToast({message:Liferay.Language.get("people-data-have-been-saved")}),d())}},Liferay.Language.get("add")))}))};t.default=_default}}));
//# sourceMappingURL=Modal.js.map