Liferay.Loader.define("journal-web@5.0.144/js/ManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web","./modals/openDeleteArticleModal"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{additionalProps:{addArticleURL:t,exportTranslationURL:r,moveArticlesAndFoldersURL:a,openViewMoreStructuresURL:c,selectEntityURL:l,trashEnabled:i,viewDDMStructureArticlesURL:d},portletNamespace:u}=e,s=function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=function _objectWithoutPropertiesLoose(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 _objectSpread(_objectSpread({},s),{},{onActionButtonClick(e,{item:t}){var c;const l=null==t||null===(c=t.data)||void 0===c?void 0:c.action;"deleteEntries"===l?i?Liferay.fire("".concat(u,"editEntry"),{action:"/journal/move_articles_and_folders_to_trash"}):(0,o.default)({onDelete:()=>{Liferay.fire("".concat(u,"editEntry"),{action:"/journal/delete_articles_and_folders"})}}):"expireEntries"===l?Liferay.fire("".concat(u,"editEntry"),{action:"/journal/expire_articles_and_folders"}):"exportTranslation"===l?(()=>{const e=new URL(r),t=Liferay.SearchContainer.get("".concat(u,"articles")).select.getAllSelectedElements().get("value");(0,n.navigate)((0,n.addParams)({["_".concat(e.searchParams.get("p_p_id"),"_key")]:t.join(",")},r))})():"moveEntries"===l&&(()=>{let e=document.querySelectorAll(".entry-selector");e.length||(e=document.querySelectorAll('.card-page-item input[type="checkbox"]')),e.forEach((e=>{e.checked&&(a=(0,n.addParams)("".concat(e.name,"=").concat(e.value),a))})),(0,n.navigate)(a)})()},onFilterDropdownItemClick(e,{item:t}){var r;"openDDMStructuresSelector"===(null==t||null===(r=t.data)||void 0===r?void 0:r.action)&&(0,n.openSelectionModal)({onSelect:e=>{if(e){const t=JSON.parse(e.value);(0,n.navigate)((0,n.addParams)({["".concat(u,"ddmStructureId")]:t.ddmstructureid},d))}},selectEventName:"".concat(u,"selectDDMStructure"),title:Liferay.Language.get("structures"),url:l})},onShowMoreButtonClick(){let e=!0;(0,n.openSelectionModal)({onClose:()=>{e&&(0,n.navigate)(location.href)},onSelect:r=>{r&&(e=!1,(0,n.navigate)((0,n.addParams)({["".concat(u,"ddmStructureId")]:r.ddmstructureid},t)))},selectEventName:"".concat(u,"selectAddMenuItem"),title:Liferay.Language.get("more"),url:c})}})};var n=r("frontend-js-web"),o=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("./modals/openDeleteArticleModal"));function ownKeys(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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(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