/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
function n(n){return n?"string"==typeof n?(n.startsWith("?")?n.slice(1):n).split("&").filter(Boolean).map((n=>n.trim())):Object.entries(n).filter((([n,t])=>null!=t)).map((([n,t])=>`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`)):[]}function t(t,o={}){let e=function(n){let t;try{t="string"==typeof n?JSON.parse(n):n}catch(o){t={url:n}}return t}(t);const l={Accept:"application/json","Content-Type":"application/json","Accept-Language":(null==o?void 0:o.language)||"en"},i=[...n(null==o?void 0:o.query),...n(null==e?void 0:e.query)].join("&"),c=i?`?${i}`:"",u=(null==e?void 0:e.method)||(null==o?void 0:o.method)||"GET",d={method:u,signal:null==o?void 0:o.signal,headers:Object.assign(Object.assign(Object.assign({},l),(null==e?void 0:e.headers)||{}),(null==o?void 0:o.headers)||{})};return"GET"!==u&&(d.body=JSON.stringify(Object.assign(Object.assign({},(null==o?void 0:o.body)||{}),(null==e?void 0:e.body)||{}))),fetch(`${e.url+((null==o?void 0:o.additionalPath)||"")}${c}`,d)}export{t as f}