Liferay.Loader.define("account-admin-web@2.0.71/account_entries_admin/js/AccountUsersManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{additionalProps:{accountEntryName:t},portletNamespace:o}=e;return _objectSpread(_objectSpread({},function _objectWithoutProperties(e,t){if(null==e)return{};var o,n,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,["additionalProps","portletNamespace"])),{},{onActionButtonClick:(e,{item:t})=>{const r=null==t?void 0:t.data;"removeUsers"===(null==r?void 0:r.action)&&(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-remove-the-selected-users"),onConfirm:e=>{if(e){const e=document.getElementById("".concat(o,"fm"));e&&(0,n.postForm)(e,{data:{accountUserIds:(0,n.getCheckedCheckboxes)(e,"".concat(o,"allRowIds"))},url:null==r?void 0:r.removeUsersURL})}}})},onCreateButtonClick:(e,{item:n})=>{const r=n.data;"selectAccountUsers"===(null==r?void 0:r.action)&&openSelectAccountUsersModal(t,null==r?void 0:r.assignAccountUsersURL,null==r?void 0:r.selectAccountUsersURL,o)},onCreationMenuItemClick:(e,{item:r})=>{const s=null==r?void 0:r.data,c=null==s?void 0:s.action;"inviteAccountUsers"===c?(0,n.openModal)({containerProps:{className:"modal-height-xl"},id:"".concat(o,"inviteUsersDialog"),iframeBodyCssClass:"",size:"lg",title:(0,n.sub)(Liferay.Language.get("invite-users-to-x"),t),url:null==s?void 0:s.requestInvitationsURL}):"selectAccountUsers"===c&&openSelectAccountUsersModal(t,null==s?void 0:s.assignAccountUsersURL,null==s?void 0:s.selectAccountUsersURL,o)}})};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}function openSelectAccountUsersModal(e,t,o,r){(0,n.openSelectionModal)({buttonAddLabel:Liferay.Language.get("assign"),containerProps:{className:""},iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const o=document.getElementById("".concat(r,"fm"));if(o){const r=e.map((e=>e.value));(0,n.postForm)(o,{data:{accountUserIds:r.join(",")},url:t})}},title:(0,n.sub)(Liferay.Language.get("assign-users-to-x"),e),url:o})}}}));
//# sourceMappingURL=AccountUsersManagementToolbarPropsTransformer.js.map