Liferay.Loader.define("commerce-frontend-js@4.0.52/utilities/AJAX/index",["module","exports","require","frontend-js-web","../index"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=t("frontend-js-web");function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){c(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const e=i({},t("../index").fetchParams);function s(r,t={},o={}){const c=new URL(r,Liferay.ThemeDisplay.getPortalURL());return Object.entries(o).map((([e,r])=>{c.searchParams.append(e,r)})),(0,n.fetch)(c,i(i({},e),t)).then((e=>e.ok?204===e.status?Promise.resolve():e.json():e.json().catch((e=>Promise.reject(new Error(e)))).then((e=>Promise.reject(e))))).catch((e=>Promise.reject(e)))}var a={DELETE:(e,r={},t={})=>s(e,i({method:"DELETE"},r),t),GET:(e,r={},t={})=>s(e,r,t),PATCH:(e,r={},t={},n={})=>s(e,i({body:JSON.stringify(r),method:"PATCH"},t),n),POST:(e,r={},t={},n={})=>s(e,i({body:JSON.stringify(r),method:"POST"},t),n),PUT:(e,r={},t={},n={})=>s(e,i({body:JSON.stringify(r),method:"PUT"},t),n)};r.default=a}}));
//# sourceMappingURL=index.js.map