Liferay.Loader.define("@liferay/commerce-order-rule-web@1.0.33/js/addCOREntry",["module","exports","require","commerce-frontend-js/ServiceProvider/index","commerce-frontend-js/utilities/eventsDefinitions","frontend-js-web"],(function(e,t,r){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({editCOREntryPortletURL:e,namespace:t}){const r=n.default.AdminOrderAPI("v1"),c=document.getElementById("".concat(t,"fm"));c.addEventListener("submit",(n=>{n.preventDefault();const a=c.querySelector("#".concat(t,"description")).value,d=c.querySelector("#".concat(t,"name")).value,s=c.querySelector("#".concat(t,"type")).value;return r.addOrderRule({description:a,name:d,type:s}).then((r=>{const n=(0,i.createPortletURL)(e);n.searchParams.append("".concat(t,"corEntryId"),r.id),n.searchParams.append("p_auth",Liferay.authToken),window.parent.Liferay.fire(o.CLOSE_MODAL,{redirectURL:n.toString(),successNotification:{message:Liferay.Language.get("your-request-completed-successfully"),showSuccessNotification:!0}})}))}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("commerce-frontend-js/ServiceProvider/index")),o=r("commerce-frontend-js/utilities/eventsDefinitions"),i=r("frontend-js-web")}));
//# sourceMappingURL=addCOREntry.js.map