Liferay.Loader.define("fragment-web@4.0.73/js/actions",["module","exports","require","frontend-js-web","./openDeleteFragmentCollectionModal"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.ACTIONS=void 0;var n=o("frontend-js-web"),l=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(o("./openDeleteFragmentCollectionModal"));const e={deleteCollections({deleteFragmentCollectionURL:e,portletNamespace:t,viewDeleteFragmentCollectionsURL:o}){this.openFragmentCollectionsItemSelector(Liferay.Language.get("delete"),Liferay.Language.get("delete-fragment-set"),o,(o=>{if(!(null==o?void 0:o.length))return;const n=document.getElementById("".concat(t,"fm"));n&&(0,l.default)({multiple:!0,onDelete:()=>{let l=n.elements["".concat(t,"rowIds")];l||(l=document.createElement("input"),l.name="".concat(t,"rowIds")),l.value=o.map((e=>e.value)),n.appendChild(l),submitForm(n,e)}})}),null,t)},exportCollections({exportFragmentCollectionsURL:e,portletNamespace:t,viewExportFragmentCollectionsURL:o}){let l=!1;this.openFragmentCollectionsItemSelector(Liferay.Language.get("export"),Liferay.Language.get("export-fragment-set"),o,(o=>{if(!(null==o?void 0:o.length))return;const n=document.getElementById("".concat(t,"fm"));if(!n)return;let a=n.elements["".concat(t,"rowIds")];a||(a=document.createElement("input"),a.name="".concat(t,"rowIds")),a.value=o.map((e=>e.value)),a.setAttribute("type","hidden"),n.appendChild(a),submitForm(n,e),l=!0}),(()=>{l&&(0,n.openToast)({message:Liferay.Language.get("your-request-processed-successfully"),toastProps:{autoClose:5e3},type:"success"})}),t)},openFragmentCollectionsItemSelector(e,t,o,l,a,r){(0,n.openSelectionModal)({buttonAddLabel:e,multiple:!0,onClose:a,onSelect:e=>{e&&l(e)},selectEventName:"".concat(r,"selectCollections"),title:t,url:o})},openImportView({portletNamespace:e,viewImportURL:t}){(0,n.openModal)({buttons:[{displayType:"secondary",label:Liferay.Language.get("cancel"),type:"cancel"},{label:Liferay.Language.get("import"),type:"submit"}],id:"".concat(e,"openImportView"),onClose:()=>{window.location.reload()},title:Liferay.Language.get("import"),url:t})}};t.ACTIONS=e}}));
//# sourceMappingURL=actions.js.map