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