Liferay.Loader.define("journal-web@5.0.100/js/ManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web","./modals/openDeleteArticleModal"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{additionalProps:{addArticleURL:t,exportTranslationURL:r,moveArticlesAndFoldersURL:n,openViewMoreStructuresURL:c,selectEntityURL:i,trashEnabled:u,viewDDMStructureArticlesURL:s},portletNamespace:d}=e,f=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["additionalProps","portletNamespace"]);const p=()=>{const e=new URL(n);["rowIdsJournalArticle","rowIdsJournalFolder"].forEach((t=>{e.searchParams.set("".concat(d).concat(t),(e=>{const t=document.querySelectorAll('input[type="checkbox"][name="'+"".concat(d).concat(e)+'"]');return Array.from(t).filter((t=>t.checked&&t.name==="".concat(d).concat(e))).map((e=>e.value)).join(",")})(t))})),(0,o.navigate)(e)};return l(l({},f),{},{onActionButtonClick(e,{item:t}){var n;const c=null==t||null===(n=t.data)||void 0===n?void 0:n.action;"deleteEntries"===c?u?Liferay.fire("".concat(d,"editEntry"),{action:"/journal/move_articles_and_folders_to_trash"}):(0,a.default)({onDelete:()=>{Liferay.fire("".concat(d,"editEntry"),{action:"/journal/delete_articles_and_folders"})}}):"expireEntries"===c?Liferay.fire("".concat(d,"editEntry"),{action:"/journal/expire_articles_and_folders"}):"exportTranslation"===c?(()=>{const e=new URL(r),t=Liferay.SearchContainer.get("".concat(d,"articles")).select.getAllSelectedElements().get("value");(0,o.navigate)((0,o.addParams)({["_".concat(e.searchParams.get("p_p_id"),"_key")]:t.join(",")},r))})():"moveEntries"===c&&p()},onFilterDropdownItemClick(e,{item:t}){var r;"openDDMStructuresSelector"===(null==t||null===(r=t.data)||void 0===r?void 0:r.action)&&(0,o.openSelectionModal)({onSelect:e=>{if(e){const t=JSON.parse(e.value);(0,o.navigate)((0,o.addParams)({["".concat(d,"ddmStructureKey")]:t.ddmstructurekey},s))}},selectEventName:"".concat(d,"selectDDMStructure"),title:Liferay.Language.get("structures"),url:i})},onShowMoreButtonClick(){let e=!0;(0,o.openSelectionModal)({onClose:()=>{e&&(0,o.navigate)(location.href)},onSelect:r=>{r&&(e=!1,(0,o.navigate)((0,o.addParams)({["".concat(d,"ddmStructureKey")]:r.ddmstructurekey},t)))},selectEventName:"".concat(d,"selectAddMenuItem"),title:Liferay.Language.get("more"),url:c})}})};var o=r("frontend-js-web"),a=(n=r("./modals/openDeleteArticleModal"))&&n.__esModule?n:{default:n};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=ManagementToolbarPropsTransformer.js.map