Liferay.Loader.define("account-admin-web@2.0.39/account_entries_admin/js/AccountOrganizationsManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{portletNamespace:t}=e;return a(a({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["portletNamespace"])),{},{onActionButtonClick:(e,{item:n})=>{const o=null==n?void 0:n.data;if("removeOrganizations"===(null==o?void 0:o.action)&&confirm(Liferay.Language.get("are-you-sure-you-want-to-remove-the-selected-organizations"))){const e=document.getElementById("".concat(t,"fm"));e&&(0,r.postForm)(e,{data:{accountOrganizationIds:Liferay.Util.listCheckedExcept(e,"".concat(t,"allRowIds"))},url:null==o?void 0:o.removeOrganizationsURL})}},onCreateButtonClick:(e,{item:n})=>{const o=null==n?void 0:n.data;(0,r.openSelectionModal)({buttonAddLabel:Liferay.Language.get("assign"),multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const n=document.getElementById("".concat(t,"fm"));if(n){const t=e.map((e=>e.value));(0,r.postForm)(n,{data:{accountOrganizationIds:t.join(",")},url:null==o?void 0:o.assignAccountOrganizationsURL})}},title:Liferay.Util.sub(Liferay.Language.get("assign-organizations-to-x"),null==o?void 0:o.accountEntryName),url:null==o?void 0:o.selectAccountOrganizationsURL})}})};var r=n("frontend-js-web");function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=AccountOrganizationsManagementToolbarPropsTransformer.js.map