import{jsx as p,Fragment as A,jsxs as k}from"react/jsx-runtime";import{ParametersGroup as x}from"./ParametersGroup.js";import{Body as y}from"./Body.js";import{makeDeepLink as _}from"../../services/index.js";import{useTranslate as g}from"../../hooks/index.js";const o=["path","query","cookie","header"];function j({body:r,parameters:e=[],operationId:t,callbackId:s}){const i=g();if(!r&&!e.length)return null;const f={[o[0]]:i("openapi.path","Path"),[o[1]]:i("openapi.query","Query"),[o[2]]:i("openapi.cookie","Cookies"),[o[3]]:i("openapi.header","Headers")},d=(n=>{const u={};return n.forEach(m=>{L(u,m.in,m)}),u})(e),h=e.length>0?o:[],{content:a,description:P,required:q}=r||{};return k(A,{children:[h.map(n=>p(x,{title:f[n],parameters:d[n],deepLink:c(t,s,n)},n)),a&&p(y,{content:a,description:P,required:q,deepLink:c(t,s)})]})}function L(r,e="",t){r[e]||(r[e]=[]),r[e].push(t)}function c(r,e,t="body"){const s=`${e?`${e}/request/${t}`:`request/${t}`}`;return _(r,s)}export{j as RequestParameters};
