Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/utils/fetch",["module","exports","require","frontend-js-web","./constants","./toasts"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.fetchData=function(t="",r){return(0,n.fetch)(t,s({headers:e,method:p},r)).then((e=>{if(!e.ok)throw o.DEFAULT_ERROR;return e.json()})).catch((e=>{throw(0,c.openErrorToast)(),e}))},t.addParams=f,t.fetchPreviewSearch=function(t,r){return(0,n.fetch)(f("/o/search-experiences-rest/v1.0/search",t),s({headers:e,method:"POST"},r))};var n=r("frontend-js-web"),o=r("./constants"),c=r("./toasts");function a(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=new Headers({Accept:"application/json","Accept-Language":Liferay.ThemeDisplay.getBCP47LanguageId(),"Content-Type":"application/json"}),p="GET";function f(e,t){const r=new URL(e,Liferay.ThemeDisplay.getPortalURL());return Object.keys(t).forEach((e=>{null!==t[e]&&r.searchParams.append(e,t[e])})),r}}}));
//# sourceMappingURL=fetch.js.map