Liferay.Loader.define("site-membership-web@5.0.57/js/UserManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{portletNamespace:t}=e,o=function _objectWithoutProperties(e,t){if(null==e)return{};var o,n,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var o,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)o=l[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)o=l[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,["portletNamespace"]);return _objectSpread(_objectSpread({},o),{},{onActionButtonClick(e,{item:o}){const r=null==o?void 0:o.data,l=null==r?void 0:r.action;var a;"deleteSelectedUsers"===l?(0,n.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)}}}):"selectRole"===l&&(a=r,(0,n.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),multiple:!0,onSelect:e=>{if(e.length){const o=document.getElementById("".concat(t,"fm"));if(!o)return;const n=document.createElement("input");n.name="".concat(t,"rowIdsRole"),n.value=e.map((e=>e.value)),o.appendChild(n),submitForm(o,null==a?void 0:a.editUsersRolesURL)}},title:Liferay.Language.get("assign-roles"),url:null==a?void 0:a.selectRoleURL}))},onCreateButtonClick(e,{item:o}){const r=null==o?void 0:o.data;var l;"selectUsers"===(null==r?void 0:r.action)&&(l=r,(0,n.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),multiple:!0,onSelect:e=>{if(e.length){const o=document.getElementById("".concat(t,"addGroupUsersFm"));if(!o)return;const n=document.createElement("input");n.name="".concat(t,"rowIds"),n.value=e.map((e=>e.value)),o.appendChild(n),submitForm(o)}},title:(0,n.sub)(Liferay.Language.get("assign-users-to-this-x"),null==l?void 0:l.groupTypeLabel),url:(0,n.addParams)("p_p_id=".concat((0,n.getPortletId)(t)),null==l?void 0:l.selectUsersURL)}))},onFilterDropdownItemClick(e,{item:o}){var r,l;"selectRoles"===(null==o||null===(r=o.data)||void 0===r?void 0:r.action)&&(l=null==o?void 0:o.data,(0,n.openSelectionModal)({onSelect:e=>{location.href=(0,n.addParams)("".concat("".concat(t,"roleId"),"=",e.id),l.viewRoleURL)},selectEventName:"".concat(t,"selectRole"),title:Liferay.Language.get("select-role"),url:null==l?void 0:l.selectRolesURL}))}})};var n=o("frontend-js-web");function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){_defineProperty(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}}}));
//# sourceMappingURL=UserManagementToolbarPropsTransformer.js.map