import{e as E,aD as o,aE as O,a8 as $,aF as x,v as C}from"./DkmmfJiv.js";function q(n,c,u){const[e={},r]=typeof c=="string"?[{},c]:[c,u],t=E(()=>o(n)),a=e.key||O([r,typeof t.value=="string"?t.value:"",...L(e)]);if(!a||typeof a!="string")throw new TypeError("[nuxt] [useFetch] key must be a string: "+a);if(!n)throw new Error("[nuxt] [useFetch] request is missing.");const i=a===r?"$f"+a:a;if(!e.baseURL&&typeof t.value=="string"&&t.value[0]==="/"&&t.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:y,lazy:m,default:d,transform:b,pick:g,watch:f,immediate:v,getCachedData:w,deep:D,dedupe:_,...k}=e,h=$({...x,...k,cache:typeof e.cache=="boolean"?void 0:e.cache}),F={server:y,lazy:m,default:d,transform:b,pick:g,immediate:v,getCachedData:w,deep:D,dedupe:_,watch:f===!1?[]:[h,t,...f||[]]};let s;return C(i,()=>{var l;(l=s==null?void 0:s.abort)==null||l.call(s),s=typeof AbortController<"u"?new AbortController:{};const p=o(e.timeout);return p&&setTimeout(()=>s.abort(),p),(e.$fetch||globalThis.$fetch)(t.value,{signal:s.signal,...h})},F)}function L(n){var u;const c=[((u=o(n.method))==null?void 0:u.toUpperCase())||"GET",o(n.baseURL)];for(const e of[n.params||n.query]){const r=o(e);if(!r)continue;const t={};for(const[a,i]of Object.entries(r))t[o(a)]=o(i);c.push(t)}return c}export{q as u};