import{s as e}from"./rolldown-runtime-Bjp52BOI.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{Lr as t,dr as n,ur as r}from"./initial-vendor-CbfHqnih.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as i}from"./icon-Dt4VFpdV.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as a}from"./MethodPill-c-UgMFw3.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as o,t as s}from"./DuplicateIcon-BRwru6S6.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{$r as c,An as l,At as u,Di as d,Ea as f,G as p,H as m,Nr as h,Oa as g,U as _,V as v,W as y,Xr as b,Zr as x,f as S,fi as C,ia as w,it as T,jn as E,kn as D,l as O,m as ee,ni as te,nt as ne,ot as re,p as k,pr as A,rt as j,u as M,vn as N,wa as P,yn as F,za as I}from"./index-DiVFqI9q.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as L,t as R}from"./DynamicMarkdown-B7gJlzwx.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";var z=e=>{let t=e.trim().split(/\s+/),n,r;if(!(t.length>2)){if(t[0]&&t[1])[n,r]=t;else if(t[0])r=t[0];else return;return{filename:n,channelId:r}}},B=e(t(),1),V=e(r(),1),H=({className:e})=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:n(`lucide lucide-chevron-down-icon lucide-chevron-down`,e),children:(0,V.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),U=({className:e,strokeWidth:t=2})=>(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:t,strokeLinecap:`round`,strokeLinejoin:`round`,className:n(`lucide lucide-chevrons-up-down-icon lucide-chevrons-up-down`,e),children:[(0,V.jsx)(`path`,{d:`m7 15 5 5 5-5`}),(0,V.jsx)(`path`,{d:`m7 9 5-5 5 5`})]}),W=({baseUrlOptions:e,baseUrlNames:t,selectedBaseUrlIndex:n=0,setSelectedBaseUrlIndex:r,onBaseUrlChange:i,urlDisplay:a,selectBaseUrlAriaLabel:o})=>{let[s,c]=(0,B.useState)(0),l=(e,n)=>{let r=t?.[n];return r?`${r} (${e})`:e},u=e?.[n]===void 0?void 0:l(e[n],n);return(0,B.useEffect)(()=>{let e=document.createElement(`span`);e.className=`text-sm absolute font-mono invisible`,e.textContent=u??``,document.body.appendChild(e),c(e.offsetWidth+16),document.body.removeChild(e)},[u]),!e||e.length===0||!r?null:e.length===1&&a===`full`?(0,V.jsx)(`div`,{className:`min-w-max bg-transparent text-sm text-gray-600 dark:text-gray-400 outline-0 font-mono cursor-pointer hover:text-gray-900 dark:hover:text-gray-300`,children:l(e[0]??``,0)}):e.length===1?null:(0,V.jsxs)(`div`,{className:`flex items-center gap-1 relative -mr-1`,children:[(0,V.jsx)(`select`,{"aria-label":o,className:`bg-transparent text-sm text-gray-600 dark:text-gray-400 outline-0 font-mono cursor-pointer hover:text-gray-900 dark:hover:text-gray-300`,value:n,onClick:e=>e.stopPropagation(),onChange:e=>{r(Number(e.target.value)),i?.()},style:{width:`${s}px`},children:e.map((e,t)=>(0,V.jsx)(`option`,{value:t,children:l(e,t)},`${t}:${e}`))}),(0,V.jsx)(U,{className:`absolute right-0 w-3 h-3 text-gray-400 dark:text-white/30 pointer-events-none`,strokeWidth:2.5})]})},ie=({path:e,method:t})=>{let n=(0,B.useMemo)(()=>{let n=e.split(`/`);return n.flatMap((e,r)=>{let i=[];return r>0&&e&&i.push((0,V.jsx)(J,{},r)),r>0&&!e&&r===n.length-1?(i.push((0,V.jsx)(J,{},r)),i):(e.split(`{`).forEach((e,n)=>{if(e.includes(`}`)){let[a,o]=e.split(`}`);i.push((0,V.jsx)(q,{method:t,children:a},`${r}-${n}-param`)),o&&i.push((0,V.jsx)(K,{children:o},`${r}-${n}`))}else e&&i.push((0,V.jsx)(K,{children:e},`${r}-${n}`))}),i)})},[e,t]);return(0,V.jsx)(`div`,{className:`flex items-center flex-1 gap-0.5 font-mono pr-1.5`,children:n})},G=({isCopiedActive:e,hasGrayBackground:t,onCopy:r,copyAriaLabel:i,copiedStatusText:a})=>(0,V.jsxs)(`button`,{type:`button`,"aria-label":i,onClick:e=>{e.stopPropagation(),r()},className:n(`absolute right-[5px] top-1/2 -translate-y-1/2 size-6.5 flex items-center justify-center bg-background-light dark:bg-background-dark rounded-md opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,t&&`bg-transparent dark:bg-transparent`,e&&`opacity-100`),children:[(0,V.jsx)(`span`,{className:`sr-only`,role:`status`,children:e?a:``}),e?(0,V.jsx)(o,{"aria-hidden":`true`,strokeWidth:2,className:`size-4 shrink-0 text-primary dark:text-primary-light`}):(0,V.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0 text-gray-400 dark:text-white/40`})]}),K=({children:e})=>(0,V.jsx)(`div`,{className:`text-sm font-medium text-gray-800 dark:text-white min-w-max`,children:e}),q=({children:e,method:t})=>{let{paramStyle:r}=C(t);return(0,V.jsx)(`div`,{className:n(`text-sm font-mono font-medium rounded-md px-1 border-2 min-w-max`,r),children:`\{${e}\}`})},J=()=>(0,V.jsx)(`div`,{className:`text-sm text-gray-400`,children:`/`}),Y=({label:e,method:t,onClick:r,isSending:a,onCancel:o,cancelLabel:s,className:c,icon:l,disabled:u,sendingRequestAriaLabel:d})=>{let{activeNavPillBg:f,activeNavPillText:p}=C(t),m=a&&o!==void 0;return(0,V.jsx)(`button`,{"aria-label":m?s:a?d:e,className:n(`tryit-button`,`flex items-center justify-center px-3 h-9 font-medium rounded-xl mouse-pointer hover:opacity-80 gap-1.5 print:hidden`,f,p,c,(u||a&&!m)&&`opacity-50 hover:opacity-50 cursor-not-allowed pointer-events-none`),onClick:m?o:r,disabled:u||a&&!m,"data-testid":`try-it-button`,children:m?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{children:s}),(0,V.jsx)(i,{icon:`stop`,iconType:`solid`,className:`w-3 h-3 bg-white`,overrideSize:!0,overrideColor:!0})]}):a?(0,V.jsx)(i,{icon:`spinner-third`,iconType:`duotone`,className:`w-4 h-4 bg-white animate-spin`,overrideSize:!0,overrideColor:!0}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{children:e}),l||(0,V.jsx)(i,{icon:`play`,iconType:`solid`,className:`w-3 h-3 bg-white`,overrideSize:!0,overrideColor:!0})]})})},ae=({markdown:e,className:t})=>e?(0,V.jsx)(R,{mode:`static`,className:n(`prose prose-sm prose-gray dark:prose-invert overflow-wrap-anywhere [&_*]:overflow-wrap-anywhere [&_ul]:list-none [&_ul>li]:before:top-[0.75em]`,`[&_li_p.whitespace-pre-line]:my-0! [&_li.py-1]:py-0! [&_li.py-1]:my-2!`,t),children:e}):null,oe=({markdown:e,className:t})=>(0,V.jsx)(L,{mode:`static`,className:n(`prose prose-sm prose-gray dark:prose-invert overflow-wrap-anywhere [&_*]:overflow-wrap-anywhere [&_ul]:list-none [&_ul>li]:before:top-[0.75em]`,`[&_li_p.whitespace-pre-line]:my-0! [&_li.py-1]:py-0! [&_li.py-1]:my-2!`,t),children:e}),se=({onClick:e,count:t,labeled:n,expanded:r})=>{let i=``;if(t===0)return null;let a=r?`hide`:`show`;i=t===1?`${a} 1 property`:`${a} ${t} properties`;let o=r?D:E;return n?(0,V.jsxs)(`button`,{"aria-label":i,"aria-expanded":r,onClick:e,className:`flex justify-center items-center pt-0.5 pb-0.5 pl-2 pr-1.5 rounded-lg border border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400`,children:[(0,V.jsx)(`span`,{className:`text-sm font-sans font-medium mr-1 whitespace-nowrap`,children:i}),(0,V.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`,strokeWidth:2.5})]}):(0,V.jsx)(`button`,{"aria-label":i,"aria-expanded":r,onClick:e,className:`relative flex size-6 items-center justify-center rounded-md text-gray-600 dark:text-gray-500 after:content-[''] after:absolute after:-inset-1 pointer-coarse:after:-inset-3`,children:(0,V.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`,strokeWidth:2.5})})},ce=({page:e})=>{let t=w(),r=d(),i=P(e.href,r),o=e.type===`asyncapi`,s=e.playground===`none`||e.playground===`simple`||e.method===`webhook`;return(0,V.jsxs)(h,{href:e.href,title:e.title,onClick:n=>{n.preventDefault(),s?t.push(c(e.href)):t.push(c(`${e.href}?playground=open`))},className:n(`col-span-2 grid grid-cols-subgrid items-center rounded-lg p-1.5 min-w-0 cursor-pointer`,i?`bg-gray-50 dark:bg-white/5 text-primary dark:text-primary-light font-medium`:`text-gray-700 hover:bg-gray-50 dark:hover:bg-white/5 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300`),children:[(0,V.jsx)(`span`,{className:`flex items-center`,children:(0,V.jsx)(a,{method:e.method,shortMethod:o,className:`font-medium px-1 py-px text-xs rounded-md whitespace-nowrap`,active:i})}),(0,V.jsx)(`span`,{className:`truncate text-sm min-w-0`,children:e.title})]})},le=({search:e,setSearch:t})=>{let n=x();return(0,V.jsx)(`div`,{className:`shrink-0 px-2 pt-2`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-gray-200 dark:border-white/10 bg-background-light dark:bg-background-dark px-3 py-2`,children:[(0,V.jsx)(A,{"aria-hidden":`true`,className:`size-4 shrink-0 text-gray-500 dark:text-gray-400`}),(0,V.jsx)(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key.length===1&&e.stopPropagation()},autoFocus:!0,placeholder:n[`api.searchEndpoint`],"aria-label":n[`aria.searchForEndpoint`],autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,className:`w-full min-w-0 bg-transparent border-0 outline-hidden focus:ring-0 p-0 text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950 dark:text-white caret-gray-950 dark:caret-white placeholder:select-none placeholder:text-gray-400 dark:placeholder:text-gray-700`})]})})},X=e=>e.openapi!==void 0||e.api!==void 0||e.asyncapi!==void 0,Z=e=>e.flatMap(e=>f(e)?X(e)?[e]:[]:[...e.root&&X(e.root)?[e.root]:[],...Z(e.pages)]),ue=e=>e.map(e=>{if(e.asyncapi)return z(e.asyncapi)==null?void 0:{method:`websocket`,title:e.title||g(e.href),href:e.href,type:`asyncapi`,playground:e.playground};{let t=e.openapi||e.api;if(t==null)return;let n=I(t);return n==null?void 0:{method:n.method,title:e.title||g(e.href),href:e.href,type:`openapi`,playground:e.playground}}}).filter(e=>e!=null),de=({endpoint:e,channel:t,operation:r})=>{let{divisions:i}=(0,B.useContext)(b),[{pageMetadata:o}]=ne(),s=d(),c=o.title||g(s),[u,f]=(0,B.useState)(``),h=Z(i.groupsOrPages),_=(0,B.useMemo)(()=>ue(h),[h]),x=r?r.title||c:e?e.title||c:t?.title||c,S=r?r.method:e?e.method:`websocket`,C=S===`websocket`,w=(0,B.useMemo)(()=>u?_.filter(e=>e.title.toLowerCase().includes(u.toLowerCase())):_,[u,_]);return(0,V.jsxs)(j,{children:[(0,V.jsx)(re,{className:`hidden lg:block group rounded-xl`,id:F.EndpointsMenuTrigger,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-x-2 border-standard rounded-xl p-1.5 pr-3 min-w-80 hover:bg-gray-50 dark:hover:bg-white/5`,children:[(0,V.jsx)(a,{method:S,shortMethod:C,active:!0}),(0,V.jsx)(`div`,{className:`flex-1 text-left text-sm font-medium text-gray-900 dark:text-white truncate`,children:x}),(0,V.jsx)(l,{"aria-hidden":`true`,strokeWidth:2,className:`size-4 text-gray-500 dark:text-gray-400 shrink-0 transition-transform duration-100 group-data-popup-open:rotate-180`})]})}),(0,V.jsxs)(T,{className:n(`hidden lg:flex flex-col w-80 p-0 overflow-hidden rounded-2xl`,`border border-gray-100 dark:border-white/10 max-h-96`),children:[(0,V.jsx)(le,{search:u,setSearch:f}),(0,V.jsxs)(v,{className:`min-h-0 flex-1`,children:[(0,V.jsx)(p,{className:`max-h-72`,children:(0,V.jsx)(m,{className:`px-2 pb-2 mt-1.5 grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-px`,children:w.map(e=>(0,V.jsx)(ce,{page:e},`search-${e.title}-${e.href}`))})}),(0,V.jsx)(y,{orientation:`vertical`,className:`my-2`})]})]})]})},fe=({title:e,description:t})=>(0,V.jsxs)(`div`,{className:`space-y-1 min-w-full w-full max-w-full`,children:[(0,V.jsx)(`div`,{className:`text-base font-medium text-gray-900 dark:text-white max-w-full`,children:e}),(0,V.jsxs)(v,{className:`max-w-full!`,children:[(0,V.jsx)(p,{className:`overflow-y-hidden! -mx-1 px-1 -my-1 py-1`,children:(0,V.jsx)(m,{className:`flex items-start gap-x-12 justify-between`,children:t&&(0,V.jsx)(oe,{markdown:t,className:`text-sm text-gray-500 dark:text-gray-400 [&_code:not(pre_*)]:box-decoration-slice`})})}),(0,V.jsx)(y,{orientation:`horizontal`})]})]}),pe=({isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,children:r})=>(0,V.jsx)(O,{open:e,onOpenChange:e=>t?.(e),children:(0,V.jsxs)(k,{children:[(0,V.jsx)(M,{}),(0,V.jsx)(ee,{className:n(u.Popup,`overflow-y-auto p-4 sm:p-6 md:p-12`),children:(0,V.jsxs)(S,{"data-testid":`api-playground-modal`,"aria-label":`API playground`,className:`relative mx-auto max-w-screen-xl max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-3rem)] md:max-h-[calc(100dvh-6rem)] overflow-hidden bg-background-light dark:bg-background-dark shadow-search rounded-3xl border-standard`,children:[(0,V.jsx)(`style`,{children:`[data-testid="api-playground-modal"] div:has(> #${F.AskAssistantCodeBlockButton}) { display: none; }`}),(0,V.jsxs)(v,{className:`max-h-[inherit] rounded-[inherit]`,children:[(0,V.jsx)(p,{className:`max-h-[inherit] overscroll-contain`,children:(0,V.jsx)(m,{className:`min-w-0! w-full`,children:r})}),(0,V.jsx)(y,{orientation:`vertical`,className:`z-50 my-6`}),(0,V.jsx)(y,{orientation:`horizontal`,className:`z-50`}),(0,V.jsx)(_,{})]})]})})]})});function me({children:e,className:t}){return(0,V.jsx)(`div`,{className:n(`rounded-full h-5 w-5 flex items-center justify-center bg-gray-50 dark:bg-white/10 text-xs font-sans font-medium text-gray-600 dark:text-gray-300`,t),children:e})}var Q=({hidden:e,onReveal:t})=>{let[n,r]=(0,B.useState)(null),i=(0,B.useCallback)(e=>{r(e)},[]),a=(0,B.useRef)(t);return(0,B.useEffect)(()=>{a.current=t}),te(()=>{n&&(e?n.setAttribute(`hidden`,`until-found`):n.removeAttribute(`hidden`))},[n,e]),(0,B.useEffect)(()=>{if(!n)return;let e=()=>a.current();return n.addEventListener(`beforematch`,e),()=>n.removeEventListener(`beforematch`,e)},[n]),i},he=e=>/^\s*\|.*\|\s*$/m.test(e),$=({className:e,onClick:t,label:n,dataTestId:r})=>(0,V.jsx)(`div`,{className:e,children:(0,V.jsxs)(`button`,{"aria-label":n,className:`flex text-playground-input w-fit items-center gap-x-1.5 py-1! px-2! hover:bg-gray-50 dark:hover:bg-white/[0.03]`,onClick:t,"data-testid":r,children:[(0,V.jsx)(N,{icon:`plus`,iconType:`solid`,className:`bg-gray-500 dark:bg-white/40 h-3 w-3`}),(0,V.jsx)(`span`,{className:`text-gray-600 dark:text-gray-200`,children:n})]})}),ge=({onAddKey:e,existingKeys:t,dataTestId:r})=>{let[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(``),c=x(),l=t.includes(o),u=o.length>0&&!l;return i?(0,V.jsx)(`input`,{className:n(`py-6 flex-1 bg-transparent outline-0 text-sm text-gray-900 dark:text-gray-100 placeholder-gray-300 dark:placeholder-white/30 font-mono font-medium`,l?`underline decoration-wavy decoration-red-400`:``),placeholder:c[`api.enterPropertyKey`],type:`text`,autoFocus:!0,value:o,onBlur:()=>{s(``),a(!1)},onChange:e=>s(e.target.value),onKeyDown:t=>{(t.key===`Enter`||t.key===`Tab`)&&u&&e(t.currentTarget.value)},spellCheck:!1}):(0,V.jsx)($,{className:`py-5`,onClick:()=>a(e=>!e),label:c[`api.addNewProperty`],dataTestId:r})},_e=e=>{if(e.target instanceof HTMLTextAreaElement)return;let t=e.clipboardData.getData(`text/plain`).trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return;let n;try{n=JSON.parse(t)}catch{return}return typeof n==`object`&&n?n:void 0};export{Q as a,fe as c,ae as d,Y as f,H as g,W as h,he as i,de as l,ie as m,ge as n,me as o,G as p,$ as r,pe as s,_e as t,se as u};