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:l,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"]);return c(c({},f),{},{onActionButtonClick(e,{item:t}){var l;const c=null==t||null===(l=t.data)||void 0===l?void 0:l.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&&(()=>{let e=document.querySelectorAll(".entry-selector");e.length||(e=document.querySelectorAll('.card-page-item input[type="checkbox"]'));const t=Array.from(e).filter((e=>e.checked)).map((e=>e.value)).join(","),r=new URL(n);r.searchParams.set("".concat(d,"rowIdsJournalArticle"),t),(0,o.navigate)(r)})()},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:l})}})};var o=r("frontend-js-web"),a=(n=r("./modals/openDeleteArticleModal"))&&n.__esModule?n:{default:n};function l(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 c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(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