Liferay.Loader.define("site-membership-web@5.0.57/js/OrganizationsManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{portletNamespace:t}=e,n=function _objectWithoutProperties(e,t){if(null==e)return{};var n,r,o=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["portletNamespace"]);return _objectSpread(_objectSpread({},n),{},{onActionButtonClick(e,{item:n}){var o;"deleteSelectedOrganizations"===(null==n||null===(o=n.data)||void 0===o?void 0:o.action)&&(0,r.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-delete-this"),onConfirm:e=>{if(e){const e=document.getElementById("".concat(t,"fm"));e&&submitForm(e)}}})},onCreateButtonClick(e,{item:n}){const o=null==n?void 0:n.data;var i;"selectOrganizations"===(null==o?void 0:o.action)&&(i=o,(0,r.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),multiple:!0,onSelect(e){if(e.length){const n=document.getElementById("".concat(t,"addGroupOrganizationsFm"));if(!n)return;const r=document.createElement("input");r.name="".concat(t,"rowIds"),r.value=e.map((e=>JSON.parse(e.value).organizationId)).join(","),n.appendChild(r),submitForm(n)}},title:(0,r.sub)(Liferay.Language.get("assign-organizations-to-this-x"),null==i?void 0:i.groupTypeLabel),url:null==i?void 0:i.selectOrganizationsURL}))}})};var r=n("frontend-js-web");function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=OrganizationsManagementToolbarPropsTransformer.js.map