apiuikit 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  immediately without an extra authorization code exchange step.`,xl="Client Credentials",bl="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",yl="Password",kl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",wl="Authorization Code",vl="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Po="Connecting to a server",jl="",xn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],Sl=[50,100,200,300,500,600,700],Nl={kafka:{label:"Kafka",color:"bg-primary-100 text-primary-700 border-primary-200"},mqtt:{label:"MQTT",color:"bg-purple-100 text-purple-700 border-purple-200"},http:{label:"HTTP",color:"bg-blue-100 text-blue-700 border-blue-200"},https:{label:"HTTPS",color:"bg-blue-100 text-blue-700 border-blue-200"},ws:{label:"WebSocket",color:"bg-green-100 text-green-700 border-green-200"},wss:{label:"WebSocket Secure",color:"bg-green-100 text-green-700 border-green-200"},amqp:{label:"AMQP",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},amqps:{label:"AMQPS",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},ibmmq:{label:"IBM MQ",color:"bg-indigo-100 text-indigo-700 border-indigo-200"},solace:{label:"Solace",color:"bg-pink-100 text-pink-700 border-pink-200"},nats:{label:"NATS",color:"bg-teal-100 text-teal-700 border-teal-200"}},Al=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],El={get:"bg-blue-100 text-blue-800",post:"bg-green-100 text-green-800",put:"bg-yellow-100 text-yellow-800",patch:"bg-orange-100 text-orange-800",delete:"bg-red-100 text-red-800",options:"bg-neutral-100 text-foreground-secondary",head:"bg-neutral-100 text-foreground-secondary",trace:"bg-neutral-100 text-foreground-secondary",[gn.SEND]:"bg-green-100 text-green-800",[gn.RECEIVE]:"bg-blue-100 text-blue-800"};function Lo(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${n} ${r} ${s}`}function Zn(e,t,n){if(e)for(const r of Sl){const s=e[r];s&&(n[`--color-${t}-${r}`]=Lo(s))}}const $l=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Cl={50:"15 23 42",100:"30 41 59",200:"51 65 85",300:"71 85 105",500:"148 163 184",600:"203 213 225",700:"226 232 240",800:"241 245 249",900:"248 250 252"};function Tl(e,t){var s,i,a,l,c,u;if(!t)return e??{};if(!e)return t;const n=(d,f)=>d||f?{...d,...f}:void 0,r=(d,f)=>d||f?{...d,...f}:void 0;return{...e,...t,colors:{primary:n((s=e.colors)==null?void 0:s.primary,(i=t.colors)==null?void 0:i.primary),secondary:n((a=e.colors)==null?void 0:a.secondary,(l=t.colors)==null?void 0:l.secondary),neutral:n((c=e.colors)==null?void 0:c.neutral,(u=t.colors)==null?void 0:u.neutral)},light:r(e.light,t.light),dark:r(e.dark,t.dark)}}function Il(e,t){const n=e==null?void 0:e.mode;return n==="light"||n==="dark"?n:n==="system"?t?"dark":"light":e!=null&&e.dark&&!(e!=null&&e.light)?"dark":"light"}function _l(e,t){const n={},r=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(Cl))n[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of $l){const a=r[s];a&&(n[i]=Lo(a))}return e.colors&&(Zn(e.colors.primary,"primary",n),Zn(e.colors.secondary,"secondary",n),Zn(e.colors.neutral,"neutral",n)),n}const Ol=e=>e.endsWith(".tab"),Is=new WeakMap;let Ml=0;const Rl=e=>{const t=Is.get(e);if(t)return t;const n=`plugin-${Ml++}`;return Is.set(e,n),n};function Bo(e){const t=new Map;for(const n of e){const r=Rl(n);for(const s of Object.keys(n.slots)){const i=n.slots[s];if(!i)continue;const a=t.get(s)??[];if(t.has(s)||t.set(s,a),Ol(s)){const l=i;a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,label:l.label,Component:l.component})}else a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,Component:i})}}return t}function Pl(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ll(e){const[t,n]=g.useState(()=>e?Pl():!1);return g.useEffect(()=>{if(!e||typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches);const s=i=>n(i.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const Bl=[];function Do(e,t,n=ot,r=Bl){var A,E,R,_,H,U,w,k,T,F;const[s,i]=g.useState(null),[a,l]=g.useState(null),c=g.useMemo(()=>Bt(t),[t]),u=((A=n.expand)==null?void 0:A.schemas)===!0,d=(R=(E=n.theme)==null?void 0:E.depthColors)!=null&&R.length?n.theme.depthColors:Lr,f=((_=n.show)==null?void 0:_.extensions)!==!1,p=((H=n.show)==null?void 0:H.codeSamples)!==!1,h=((U=n.show)==null?void 0:U.tryIt)===!0,m=n.topOffset,y=typeof m=="number"&&Number.isFinite(m)?Math.max(0,m):0,x=((w=n.sidePanel)==null?void 0:w.containment)??"viewport",j=(k=n.sidePanel)==null?void 0:k.topOffset,S=typeof j=="number"&&Number.isFinite(j)?Math.max(0,j):y,v=(T=n.markdown)==null?void 0:T.url,C=g.useMemo(()=>{if(typeof v=="function")return v;if(typeof v=="string")return()=>v},[v]),B=g.useMemo(()=>Bo(r),[r]),D=Ll(((F=n.theme)==null?void 0:F.mode)==="system"),P=g.useMemo(()=>Il(n.theme,D),[n.theme,D]),N=g.useMemo(()=>_l(Tl(ot.theme,n.theme),P),[n.theme,P]);return{contextValue:g.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:a,topOffset:y,sidePanelContainment:x,sidePanelTopOffset:S,defaultSchemaExpanded:u,depthColors:d,showExtensions:f,showCodeSamples:p,showTryIt:h,markdownUrl:C,plugins:r,pluginSlotRegistry:B,config:n,resolvedMode:P}),[e,t,c,s,a,y,x,S,u,d,f,p,h,C,r,B,n,P]),themeVars:N,resolvedMode:P,setPortalHost:i,setRootElement:l}}function In({document:e,config:t=ot,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:l,setPortalHost:c,setRootElement:u}=Do("asyncapi",e,t,n);return o.jsx(kt.Provider,{value:i,children:o.jsxs("div",{ref:u,"data-theme":l,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:c,className:"asyncapi-portal-root"}),s]})})}const zr="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function qe({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:l="columns",bottomSpacing:c=!0}){const u=l==="stacked",d=n!=null&&n!==!1,f=`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`;return o.jsxs("div",{className:`w-full mt-6 ${c?"mb-6":""} ${u?"":zr}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:u?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:f,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${u?"flex-col":d&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${u?"w-full":"@lg:w-prose"} min-w-0`,children:t}),u?d&&o.jsx("div",{className:r?"@lg:sticky @lg:top-4":void 0,children:n}):o.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0","data-testid":"section-side-column",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function nt(...e){return e.filter(Boolean).join(" ")}function wt({className:e}){return o.jsx("svg",{className:e,id:"Layer_1",version:"1.1",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}const ln=(e,t)=>`${e?`${e}-`:""}tab-${t}`,cn=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function ct({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:l}){var y;const c=g.useId(),u=g.useRef([]),d=t??(a?"":((y=e[0])==null?void 0:y.id)??""),f=e.some(x=>!!x.icon),p=t?e.findIndex(x=>x.id===t):-1,h=p>=0?p:0,m=(x,j)=>{var C;if(e.length===0)return;const S=B=>(B+e.length)%e.length;let v=j;if(x.key==="ArrowRight"&&(x.preventDefault(),v=S(j+1)),x.key==="ArrowLeft"&&(x.preventDefault(),v=S(j-1)),x.key==="Home"&&(x.preventDefault(),v=0),x.key==="End"&&(x.preventDefault(),v=e.length-1),v!==j){const B=e[v];n(B.id),(C=u.current[v])==null||C.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:nt("@sm:hidden relative",f?"mt-0":"mt-4"),children:[o.jsx("label",{htmlFor:c,className:"sr-only",children:s}),o.jsxs("select",{id:c,name:"tabs",value:d,onChange:x=>n(x.target.value),className:"block w-full appearance-none rounded-md border border-border bg-surface py-2 pl-3 pr-9 text-sm text-foreground-secondary focus:border-secondary-500 focus:outline-none focus:ring-1 focus:ring-secondary-500",children:[a&&o.jsx("option",{value:"",children:a}),e.map(x=>o.jsx("option",{value:x.id,children:x.name},x.id))]}),o.jsx(wt,{className:"pointer-events-none absolute right-3 top-1/2 h-3 w-3 -translate-y-1/2 text-foreground-muted"})]}),o.jsx("div",{className:nt("hidden @sm:block",f||l==="segmented"?"":"mt-6"),children:l==="segmented"?o.jsx("div",{className:"inline-flex h-9.5 w-77.5 items-center gap-1 rounded-lg bg-neutral-100 p-1",role:"tablist","aria-label":r,children:e.map((x,j)=>{const S=x.id===t;return o.jsx("button",{ref:v=>{u.current[j]=v},id:ln(i,x.id),type:"button",role:"tab",tabIndex:j===h?0:-1,"aria-selected":S,"aria-controls":cn(i,x.id),onClick:()=>n(x.id),onKeyDown:v=>m(v,j),className:nt("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",S?"bg-surface text-foreground shadow-sm":"text-foreground-muted hover:text-foreground-secondary"),children:x.name},x.id)})}):f?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":r,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((x,j)=>{const S=x.id===t,v=x.icon;return o.jsx("button",{ref:C=>{u.current[j]=C},id:ln(i,x.id),type:"button",role:"tab",tabIndex:j===h?0:-1,"aria-selected":S,"aria-controls":cn(i,x.id),onClick:()=>n(x.id),onKeyDown:C=>m(C,j),className:nt("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",S?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[v?o.jsx(v,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:x.name})]})},x.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((x,j)=>{const S=x.id===t;return o.jsxs("button",{ref:v=>{u.current[j]=v},id:ln(i,x.id),type:"button",role:"tab",tabIndex:j===h?0:-1,"aria-selected":S,"aria-controls":cn(i,x.id),onClick:()=>n(x.id),onKeyDown:v=>m(v,j),className:nt(S?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",j===0?"rounded-l-lg":"",j===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[o.jsx("span",{children:x.name}),o.jsx("span",{"aria-hidden":"true",className:nt(S?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},x.id)})})})]}):null}function Dl({tabs:e,current:t,idPrefix:n,renderPanel:r}){return o.jsx(o.Fragment,{children:e.map(s=>{const i=s.id===t;return o.jsx("div",{id:cn(n,s.id),role:"tabpanel","aria-labelledby":ln(n,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:r(s,i)},s.id)})})}function Fo(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Hr(e){let t=e;for(;t&&t!==document.body;){if(Fo(t))return t;t=t.parentElement}return document.documentElement}function Fl(e,t){if(!e||!t||!t.contains(e))return null;let n=e;for(;n;){if(Fo(n))return n;if(n===t)break;n=n.parentElement}return null}function zo(e){const t=e.style.overflow,n=e.style.paddingRight,r=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",r>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+r}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function Ho({tabs:e,current:t,onChange:n}){const{rootElement:r,topOffset:s=0}=Re();if(!e.length)return null;const i=typeof document<"u"&&Hr(r)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(ct,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky z-10 flex w-full justify-center bg-background pb-2",style:{top:i},children:o.jsx(qe,{content:a,stickySideContent:!1,bottomSpacing:!1})})}function zl(e,t){const[n,r]=g.useState("docked"),s=g.useRef(t);return s.current=t,g.useEffect(()=>{if(!e)return;let i=null,a=null;const l=()=>{a=null;const u=e.getBoundingClientRect().top,d=i===null?0:u-i;i=u,u>=0?r("docked"):s.current||d>0?r("pinned"):d<0?r("hidden"):r(f=>f==="docked"?"hidden":f)},c=()=>{a===null&&(a=requestAnimationFrame(l))};return l(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),g.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}const Hl=56,Ul=8;function Uo({logo:e,children:t,forceVisible:n=!1}){const{rootElement:r,topOffset:s=0}=Re(),i=zl(r,n),a=s,l=a+Hl+Ul,c={top:a,transform:`translateY(${i==="hidden"?`-${l}px`:"0px"})`,pointerEvents:i==="hidden"?"none":void 0};return o.jsx("header",{className:"document-topbar",style:c,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${zr}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function Wo(e){if(e.length===0)return o.jsx("span",{children:"No allowed values."});if(e.length===1)return o.jsxs("span",{children:["Allowed value is ",o.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>o.jsxs(g.Fragment,{children:[o.jsx("code",{children:r}),", "," "]},s)),n=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function Wl(e){return e.map(t=>`\`${t}\``).join(", ")}function dr(e,{align:t="center",gap:n=8,clearance:r=40,width:s=0,margin:i=8}={}){const a=e.getBoundingClientRect(),l=a.top<r?"bottom":"top",c=l==="top"?a.top-n:a.bottom+n;if(t==="center")return{top:c,left:a.left+a.width/2,placement:l};const u=a.right-s,d=window.innerWidth-s-i;return{top:c,left:Math.max(i,Math.min(u,d)),placement:l}}function Kl(e){const t=[],n=/\{([^}]+)\}/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push({type:"text",value:e.slice(r,s.index)}),t.push({type:"param",value:s[1]}),r=s.index+s[0].length;return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}const _s=360;function Gl(e){let t=0;return e.map((n,r)=>n.type==="text"?o.jsx("span",{children:n.value},r):o.jsx("span",{className:`font-semibold ${xn[t++%xn.length]}`,children:`{${n.value}}`},r))}function Ye({address:e,parameters:t,className:n="text-xs",truncate:r=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=ke(),[l,c]=g.useState(null),[u,d]=g.useState({top:0,left:0,placement:"top"}),[f,p]=g.useState(!1),[h,m]=g.useState(null),y=g.useRef(null),x=g.useId(),j=Kl(e);let S=0;g.useEffect(()=>{if(!r)return;const b=y.current;if(!b)return;const A=()=>p(b.scrollWidth>b.clientWidth);A();const E=new ResizeObserver(A);return E.observe(b),()=>E.disconnect()},[r,e]);const v=(b,A)=>{d(dr(A)),c(b)},C=()=>c(null),B=b=>m(dr(b,{align:"end",width:_s})),D=()=>m(null),P=j.map((b,A)=>{if(b.type==="text")return o.jsx("span",{children:b.value},A);const E=t==null?void 0:t[b.value],R=xn[S++%xn.length],_=l===A,H=!!E&&(E.description||E.type||E.default||E.enum&&E.enum.length>0||E.examples&&E.examples.length>0),U=`channel-address-tooltip-${A}`,w=H&&_?U:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:k=>H&&v(A,k.currentTarget),onMouseLeave:C,children:[o.jsx("span",{className:`font-semibold ${R} ${H?"cursor-help underline decoration-dotted":""}`,role:H?"button":void 0,tabIndex:H?0:void 0,"aria-expanded":H?_:void 0,"aria-describedby":w,onFocus:k=>H&&v(A,k.currentTarget),onBlur:C,onKeyDown:k=>{H&&((k.key==="Enter"||k.key===" ")&&(k.preventDefault(),v(A,k.currentTarget)),k.key==="Escape"&&(k.preventDefault(),C(),k.currentTarget.blur()))},children:`{${b.value}}`}),H&&_&&a&&gt.createPortal(o.jsxs("div",{id:U,className:`fixed -translate-x-1/2 max-w-xs px-2.5 py-1.5 bg-neutral-50 text-foreground-muted text-xs rounded pointer-events-none z-[60] shadow-lg text-left leading-snug ${u.placement==="top"?"-translate-y-full":""}`,style:{top:u.top,left:u.left},children:[E.description&&o.jsx("div",{children:E.description}),E.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:E.type})}),E.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:E.default})]}),E.enum&&E.enum.length>0&&o.jsx("div",{className:"mt-1",children:Wo(E.enum)}),E.examples&&E.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",E.examples.join(", ")]})]}),a)]},A)}),N=i?"px-2 py-1 ":"";return r?o.jsxs("code",{className:`${N}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[o.jsx("span",{ref:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:P}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?x:void 0,className:"shrink-0 cursor-help px-0.5 text-foreground-muted hover:text-foreground-secondary focus:outline-none focus-visible:ring-1 focus-visible:ring-neutral-300 rounded",onMouseEnter:b=>B(b.currentTarget),onMouseLeave:D,onFocus:b=>B(b.currentTarget),onBlur:D,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),B(b.currentTarget)),b.key==="Escape"&&(b.preventDefault(),D(),b.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&gt.createPortal(o.jsx("div",{id:x,role:"tooltip",style:{top:h.top,left:h.left,width:_s},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${h.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:Gl(j)})}),a)]}):o.jsx("code",{className:`${N}rounded text-foreground-secondary break-all ${n}`,children:P})}const Vl={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Qe({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${Vl[t]} ${El[e]} ${n}`,children:e}):null}function fr(e,t){const[n,r]=g.useState(null);return g.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const i=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{s!==null&&cancelAnimationFrame(s),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),n}const Os=6,Jl=12,Zl=8,Xl=.7;function Yl(e,t){if(e===0)return 1/0;const n=e*Xl-Zl*2,r=t*Os+Math.max(0,t-1)*Jl;return Math.max(1,Math.floor((n-r)/Os))}function Ql(e,t){const n=e.reduce((s,i)=>s+i,0);if(n<=t)return e;if(t<=e.length)return e.map(()=>1);const r=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/n*r)))}const ql=20,ec=96,tc=48,Ms=40;function nc({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=g.useState(!1),[l,c]=g.useState(!1),u=i||l,{rootElement:d,portalHost:f,topOffset:p=0}=ke(),h=g.useRef(null),m=g.useRef(null),[y,x]=g.useState(null),[j,S]=g.useState(null),v=g.useMemo(()=>e.filter(z=>z.items.length>0),[e]),C=g.useMemo(()=>v.filter(z=>z.isTab===!1||z.id===t),[v,t]),B=g.useMemo(()=>v.filter(z=>z.showInPopover!==!1),[v]),[D,P]=g.useState(null),N=g.useRef(null),b=g.useRef(null),A=g.useCallback((z,$)=>{P({section:z,key:$}),N.current={section:z,key:$},b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{N.current=null},600)},[]);g.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),g.useEffect(()=>{const $=e.filter(Y=>Y.items.length>0).flatMap(Y=>Y.items.map(ue=>({section:Y.id,key:Y.itemKey(ue),id:Y.targetId(ue)}))).map(Y=>({...Y,el:document.getElementById(Y.id)})).filter(Y=>!!Y.el);if($.length===0)return;const ee=new Map($.map(Y=>[Y.el,Y])),Q=new Map,X=new IntersectionObserver(Y=>{for(const O of Y)O.isIntersecting?Q.set(O.target,O.boundingClientRect.top):Q.delete(O.target);if(Q.size===0)return;let ue=null,Ie=-1/0;for(const[O,W]of Q)W>Ie&&(ue=O,Ie=W);const ge=ue&&ee.get(ue);if(!ge)return;const I=N.current;if(I){if(ge.section!==I.section||ge.key!==I.key)return;N.current=null}P({section:ge.section,key:ge.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return $.forEach(Y=>X.observe(Y.el)),()=>X.disconnect()},[e]);const E=(D==null?void 0:D.section)??t,R=D??s,_=fr(d,!0),H=typeof window>"u"?0:window.innerWidth,U=typeof window>"u"?0:window.innerHeight,w=!!_&&_.bottom>p&&_.top<U,k=Math.max((_==null?void 0:_.top)??p,p),T=Math.min((_==null?void 0:_.bottom)??U,U),F=Math.max(0,T-k),G=(k+T)/2,[J,xe]=g.useState(null);g.useLayoutEffect(()=>{if(!j||!d)return;const z=()=>{const ee=j.getBoundingClientRect().left-d.getBoundingClientRect().left;xe(Q=>Q===ee?Q:ee)};z();const $=new ResizeObserver(z);return $.observe(j),$.observe(d),window.addEventListener("resize",z),()=>{$.disconnect(),window.removeEventListener("resize",z)}},[j,d]);const he=J===null?null:((_==null?void 0:_.left)??0)+J,le=((_==null?void 0:_.left)??0)+ql,ae=he!==null?Math.max(le,he-Ms-ec):le,re=he!==null?he-le>=Ms+tc:!!_&&_.width>=1024,L=!!_&&!re,Z={opacity:w?1:0,pointerEvents:w?"auto":"none",transition:"opacity 0.2s ease"},ie={position:"fixed",top:G,left:ae,transform:"translateY(-50%)",zIndex:45,...Z},se={position:"sticky",bottom:0,height:0,zIndex:45,pointerEvents:"none"},fe=fr(y,L),me=L?{position:"fixed",bottom:fe?U-fe.top+8:68,right:fe?H-fe.right:16,zIndex:46}:{position:"fixed",top:G,left:ae,transform:"translateY(-50%)",maxHeight:`${Math.max(0,F-32)}px`,zIndex:46};g.useEffect(()=>{if(!i)return;const z=ee=>{var Q;ee.key==="Escape"&&(a(!1),c(!1),(Q=h.current)==null||Q.focus())},$=ee=>{var X,Y;const Q=ee.target;(X=h.current)!=null&&X.contains(Q)||(Y=m.current)!=null&&Y.contains(Q)||a(!1)};return document.addEventListener("keydown",z),document.addEventListener("mousedown",$),()=>{document.removeEventListener("keydown",z),document.removeEventListener("mousedown",$)}},[i]);const ce=g.useCallback((z,$)=>{z.isTab!==!1&&n(z.id),$&&setTimeout(()=>{var ee;(ee=document.getElementById($))==null||ee.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),Ae=g.useMemo(()=>B.map(z=>{const $=E===z.id,ee=(R==null?void 0:R.section)===z.id,Q=z.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{ce(z),A(z.id,""),L&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${$?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(Q,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${$?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${$?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:z.label}),o.jsx("span",{className:`ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 font-mono text-[10px] transition-colors ${$?"border border-primary-200 bg-primary-100 text-primary-700":"bg-neutral-100 text-foreground-muted"}`,children:z.items.length})]}),z.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:z.items.map(X=>{const Y=z.itemKey(X),ue=ee&&(R==null?void 0:R.key)===Y;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{ce(z,z.targetId(X)),r(z.id,Y),A(z.id,Y),L&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${ue?"bg-primary-50 font-medium text-primary-700":$?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:z.renderItem(X,{isSelected:ue,isSectionActive:$})})},Y)})})]},z.id)}),[B,E,R,L,ce,r,A]),de=Yl(F,C.length),Be=g.useMemo(()=>{const z=Ql(C.map($=>$.items.length),de);return C.map(($,ee)=>{const Q=E===$.id,X=$.items.length,Y=z[ee];let ue=-1;if((R==null?void 0:R.section)===$.id){const Ie=$.items.findIndex(ge=>$.itemKey(ge)===R.key);Ie>=0&&(ue=Math.min(Y-1,Math.floor(Ie*Y/X)))}return o.jsxs("div",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${Q?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),o.jsx("div",{className:"flex flex-col items-start gap-1",children:Array.from({length:Y},(Ie,ge)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${ge===ue?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},ge))})]},$.id)})},[C,E,R,de]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:S,"aria-hidden":"true",className:`w-full ${zr}`,style:{height:0}}),!L&&o.jsx("button",{ref:h,onClick:()=>a(z=>!z),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2","aria-expanded":u,style:{...ie,visibility:w?"visible":"hidden"},children:Be}),L&&o.jsx("div",{style:se,children:o.jsx("button",{ref:z=>{h.current=z,x(z)},onClick:()=>a(z=>!z),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"absolute bottom-4 right-4 flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg","aria-expanded":u,style:{...Z,visibility:w?"visible":"hidden"},children:o.jsxs("span",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})})}),f&&gt.createPortal(o.jsx("div",{ref:m,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${L?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:{...me,visibility:u?"visible":"hidden"},children:Ae}),f)]})}function Ko({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(nc,{sections:e,activeSection:t,onTabChange:a=>n(a),onItemSelect:(a,l)=>{a!=="info"&&(a==="servers"?s==null||s(l):r==null||r(a,l))},selectedItem:i?{section:i.tab,key:i.key}:null})}function Ur({className:e,children:t,...n}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...n,children:t})}function rc(e){return o.jsxs(Ur,{stroke:"url(#icon-book-open-gradient)",...e,children:[o.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[o.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),o.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})]})}function Wr({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M14 20C17.3137 20 20 17.3137 20 14C20 10.6863 17.3137 8 14 8C10.6863 8 8 10.6863 8 14C8 17.3137 10.6863 20 14 20ZM18 14C18 16.2091 16.2091 18 14 18C11.7909 18 10 16.2091 10 14C10 11.7909 11.7909 10 14 10C16.2091 10 18 11.7909 18 14Z"}),o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M0 12.9996V14.9996C0 16.5478 1.17261 17.822 2.67809 17.9826C2.80588 18.3459 2.95062 18.7011 3.11133 19.0473C2.12484 20.226 2.18536 21.984 3.29291 23.0916L4.70712 24.5058C5.78946 25.5881 7.49305 25.6706 8.67003 24.7531C9.1044 24.9688 9.55383 25.159 10.0163 25.3218C10.1769 26.8273 11.4511 28 12.9993 28H14.9993C16.5471 28 17.8211 26.8279 17.9821 25.3228C18.4024 25.175 18.8119 25.0046 19.2091 24.8129C20.3823 25.6664 22.0344 25.564 23.0926 24.5058L24.5068 23.0916C25.565 22.0334 25.6674 20.3813 24.814 19.2081C25.0054 18.8113 25.1757 18.4023 25.3234 17.9824C26.8282 17.8211 28 16.5472 28 14.9996V12.9996C28 11.452 26.8282 10.1782 25.3234 10.0169C25.1605 9.55375 24.9701 9.10374 24.7541 8.66883C25.6708 7.49189 25.5882 5.78888 24.5061 4.70681L23.0919 3.29259C21.9846 2.18531 20.2271 2.12455 19.0485 3.1103C18.7017 2.94935 18.3459 2.80441 17.982 2.67647C17.8207 1.17177 16.5468 0 14.9993 0H12.9993C11.4514 0 10.1773 1.17231 10.0164 2.6775C9.60779 2.8213 9.20936 2.98653 8.82251 3.17181C7.64444 2.12251 5.83764 2.16276 4.70782 3.29259L3.2936 4.7068C2.16377 5.83664 2.12352 7.64345 3.17285 8.82152C2.98737 9.20877 2.82199 9.60763 2.67809 10.0167C1.17261 10.1773 0 11.4515 0 12.9996ZM15.9993 3C15.9993 2.44772 15.5516 2 14.9993 2H12.9993C12.447 2 11.9993 2.44772 11.9993 3V3.38269C11.9993 3.85823 11.6626 4.26276 11.2059 4.39542C10.4966 4.60148 9.81974 4.88401 9.18495 5.23348C8.76836 5.46282 8.24425 5.41481 7.90799 5.07855L7.53624 4.70681C7.14572 4.31628 6.51256 4.31628 6.12203 4.7068L4.70782 6.12102C4.31729 6.51154 4.31729 7.14471 4.70782 7.53523L5.07958 7.90699C5.41584 8.24325 5.46385 8.76736 5.23451 9.18395C4.88485 9.8191 4.6022 10.4963 4.39611 11.2061C4.2635 11.6629 3.85894 11.9996 3.38334 11.9996H3C2.44772 11.9996 2 12.4474 2 12.9996V14.9996C2 15.5519 2.44772 15.9996 3 15.9996H3.38334C3.85894 15.9996 4.26349 16.3364 4.39611 16.7931C4.58954 17.4594 4.85042 18.0969 5.17085 18.6979C5.39202 19.1127 5.34095 19.6293 5.00855 19.9617L4.70712 20.2632C4.3166 20.6537 4.3166 21.2868 4.70712 21.6774L6.12134 23.0916C6.51186 23.4821 7.14503 23.4821 7.53555 23.0916L7.77887 22.8483C8.11899 22.5081 8.65055 22.4633 9.06879 22.7008C9.73695 23.0804 10.4531 23.3852 11.2059 23.6039C11.6626 23.7365 11.9993 24.1411 11.9993 24.6166V25C11.9993 25.5523 12.447 26 12.9993 26H14.9993C15.5516 26 15.9993 25.5523 15.9993 25V24.6174C15.9993 24.1418 16.3361 23.7372 16.7929 23.6046C17.5032 23.3985 18.1809 23.1157 18.8164 22.7658C19.233 22.5365 19.7571 22.5845 20.0934 22.9208L20.2642 23.0916C20.6547 23.4821 21.2879 23.4821 21.6784 23.0916L23.0926 21.6774C23.4831 21.2868 23.4831 20.6537 23.0926 20.2632L22.9218 20.0924C22.5855 19.7561 22.5375 19.232 22.7669 18.8154C23.1166 18.1802 23.3992 17.503 23.6053 16.7931C23.7379 16.3364 24.1425 15.9996 24.6181 15.9996H25C25.5523 15.9996 26 15.5519 26 14.9996V12.9996C26 12.4474 25.5523 11.9996 25 11.9996H24.6181C24.1425 11.9996 23.7379 11.6629 23.6053 11.2061C23.3866 10.4529 23.0817 9.73627 22.7019 9.06773C22.4643 8.64949 22.5092 8.11793 22.8493 7.77781L23.0919 7.53523C23.4824 7.14471 23.4824 6.51154 23.0919 6.12102L21.6777 4.7068C21.2872 4.31628 20.654 4.31628 20.2635 4.7068L19.9628 5.00748C19.6304 5.33988 19.1137 5.39096 18.6989 5.16979C18.0976 4.84915 17.4596 4.58815 16.7929 4.39467C16.3361 4.2621 15.9993 3.85752 15.9993 3.38187V3Z"})]})}function Go(e){return{id:"info",label:"Info",icon:rc,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function Vo(e){return{id:"schemas",label:"Schemas",icon:Wr,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function Jo({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}function _n({className:e}){return o.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64h261.44zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64h453.44zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64h133.44z"})})}function Zo({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{d:"M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224H128zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64z"}),o.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}const Yt={};function sc({operations:e=Yt,messages:t=Yt,schemas:n=Yt,servers:r=Yt,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const f=g.useMemo(()=>{const p=h=>{var y;return d!=null&&d.useChannelAddressAsIdentifier?((y=e[h])==null?void 0:y.channel)??null:null};return[Go(s),{id:"servers",label:"Servers",icon:Jo,isTab:!1,items:Object.keys(r),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:_n,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var y;const m=p(h);return m!=null&&m.address?o.jsx(Ye,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(Qe,{method:(y=e[h])==null?void 0:y.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:Zo,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},Vo(n)]},[e,t,n,r,s,d]);return o.jsx(Ko,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const On=["get","put","post","delete","options","head","patch","trace"],oc=(e,t)=>`${e} ${t}`;function Rs(e,t){const n=new Map;for(const r of(e==null?void 0:e.parameters)??[])n.set(`${r.in}:${r.name}`,r);for(const r of(t==null?void 0:t.parameters)??[])n.set(`${r.in}:${r.name}`,r);return Array.from(n.values())}function It(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?On.filter(r=>n[r]).map(r=>({key:oc(r,t),method:r,path:t})):[]})}function Kr({className:e}){return o.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 6.873a9 9 0 011 4.127 9 9 0 01-1 4.127M5 6.873a9 9 0 00-1 4.127 9 9 0 001 4.127"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}const Ps={},ic={},ac=[];function lc({paths:e=Ps,webhooks:t=Ps,schemas:n=ic,servers:r=ac,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=g.useMemo(()=>It(e),[e]),f=g.useMemo(()=>It(t),[t]),p=g.useMemo(()=>{const h=r.map((m,y)=>({key:`server-${y}`,url:m}));return[Go(s),{id:"servers",label:"Servers",icon:Jo,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>o.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:_n,items:d,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Qe,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx(Ye,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:Kr,items:f,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Qe,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m.path})]})},Vo(n)]},[d,f,n,r,s]);return o.jsx(Ko,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const cc=e=>o.jsxs("svg",{width:18,height:18,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"5"}),o.jsx("path",{d:"M14 14l-3.5-3.5"})]});function Xo({query:e,onQueryChange:t,results:n,onSelectResult:r,onOpenChange:s}){const i=g.useRef(null),a=g.useRef(null),[l,c]=g.useState(!1),[u,d]=g.useState(-1),f="asyncapi-search-results",p=N=>`asyncapi-search-result-${N}`,{portalHost:h,rootElement:m,topOffset:y=0}=ke(),x=()=>{c(!1),d(-1)};g.useEffect(()=>(s==null||s(l),()=>s==null?void 0:s(!1)),[l,s]);const j=g.useRef(!1),S=g.useRef(!1);g.useEffect(()=>{if(!m)return;const N=()=>{j.current=!0},b=()=>{j.current=!1};return m.addEventListener("mouseenter",N),m.addEventListener("mouseleave",b),()=>{m.removeEventListener("mouseenter",N),m.removeEventListener("mouseleave",b)}},[m]),g.useEffect(()=>{if(!m)return;const N=b=>{S.current=m.contains(b.target)};return document.addEventListener("mousedown",N,!0),()=>document.removeEventListener("mousedown",N,!0)},[m]),g.useEffect(()=>{if(!m)return;const N=b=>{!(b.metaKey||b.ctrlKey)||b.key.toLowerCase()!=="k"||!(m.contains(document.activeElement)||j.current||S.current)||(b.preventDefault(),c(!0))};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[m]),g.useEffect(()=>{if(!l)return;const N=requestAnimationFrame(()=>{var b;return(b=a.current)==null?void 0:b.focus()});return()=>cancelAnimationFrame(N)},[l]),g.useEffect(()=>{if(!(!l||!h))return zo(Hr(h))},[l,h]),g.useEffect(()=>{if(!l)return;const N=b=>{b.key==="Escape"&&x()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[l]),g.useEffect(()=>{if(!l)return;const N=b=>{i.current&&!i.current.contains(b.target)&&x()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[l]),g.useEffect(()=>{u>=n.length&&d(n.length-1)},[u,n.length]),g.useEffect(()=>{var N;u<0||(N=document.getElementById(p(u)))==null||N.scrollIntoView({block:"nearest"})},[u]);const v=l&&e.trim().length>0,C=N=>{x(),r(N)},B=N=>{if(N.key==="Escape"){N.preventDefault(),x();return}if(v){if(N.key==="ArrowDown"){N.preventDefault(),d(b=>n.length===0?-1:Math.min(b+1,n.length-1));return}if(N.key==="ArrowUp"){N.preventDefault(),d(b=>n.length===0?-1:Math.max(b-1,0));return}if(N.key==="Home"){N.preventDefault(),n.length>0&&d(0);return}if(N.key==="End"){N.preventDefault(),n.length>0&&d(n.length-1);return}if((N.key==="Enter"||N.key===" ")&&u>=0&&n[u]){N.preventDefault(),C(n[u]);return}}},D=v?`${n.length} result${n.length===1?"":"s"} found`:"",P=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>c(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",children:o.jsx(cc,{})}),l&&h&&gt.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:y},children:[o.jsx("div",{className:"absolute inset-0 bg-black/30"}),o.jsxs("div",{ref:i,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsx("div",{className:"p-4",children:o.jsx("input",{ref:a,id:"asyncapi-search",type:"search",value:e,onChange:N=>t(N.target.value),onKeyDown:B,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":v,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":u>=0?p(u):void 0,className:"w-full rounded-md bg-surface px-4 py-3 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none"})}),o.jsx("div",{"aria-live":"polite",className:"sr-only",children:D}),v&&o.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((N,b)=>o.jsx("li",{children:o.jsxs("button",{id:p(b),type:"button",role:"option","aria-selected":u===b,onClick:()=>C(N),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(u===b?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:N.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:N.location}),N.subtitle&&o.jsxs("span",{children:["• ",N.subtitle]})]})]})},N.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 px-4 py-1.5 text-xs text-foreground-muted",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↑"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↓"}),"to navigate"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↵"}),"to select"]}),o.jsxs("span",{className:"flex items-center gap-1",children:["Press",o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:P?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),h)]})}function Yo({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Qo({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function Mn({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}const uc=["The following is API documentation in Markdown.","Use it to answer questions about this API and help write client code.","Stick to what is documented below - do not invent endpoints, fields, or behavior."];function qo(e){return`${["> ## Agent Instructions",...uc.map(n=>`> ${n}`)].join(`
4
4
  `)}
5
5
 
6
- ${e.trimStart()}`}function ei({serialize:e,onOpenChange:t}){const[n,r]=g.useState(!1),[s,i]=g.useState(!1),a=g.useRef(null),l=g.useRef(void 0),{deref:c}=ke(),u=()=>qo(e(c));g.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),g.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),g.useEffect(()=>{if(!n)return;const p=h=>{h.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),g.useEffect(()=>{if(!n)return;const p=h=>{a.current&&!a.current.contains(h.target)&&r(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const d=async()=>{const p=u();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:p.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(p),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),i(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(!1),2e3)}catch(h){console.error("[MarkdownExportMenu] Copy for LLM failed:",h)}r(!1)},f=()=>{const p=u(),h=new Blob([p],{type:"text/markdown"}),m=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:m}),window.open(m,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(m),3e4),r(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>r(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(Qo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Yo,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(wt,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-[41] w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:d,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:f,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[o.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),o.jsx(Mn,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const We=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),un=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>un(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,un(r,t)]).join(" "):We(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,un(r,t)]).join(" ")):"",Ne=e=>un(e).trim().replace(/\s+/g," "),dc=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,fc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),pc=e=>{if(!We(e))return e;const t={};for(const[n,r]of Object.entries(e))fc.has(n)||(t[n]=r);return t},ti=(e,t,n,r)=>{const s=`schema-${n}`,i=(l,c,u,d)=>{const f=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,p=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,h=We(l)?l.description:void 0,m=c.length?`${r}.${c.join(".")}`:r;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:d?dc(n,d):s,type:"schema",tab:"schemas",key:n,name:m,path:f,location:p,subtitle:h,text:Ne([pc(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!We(l)||f.has(l))return;if(f.add(l),We(l.properties))for(const[h,m]of Object.entries(l.properties))a(m,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null,f);const p=l.items;We(p)?a(p,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,f):Array.isArray(p)&&p.forEach((h,m)=>{a(h,[...c,`items[${m}]`],[...u,`items[${m}]`],null,f)});for(const h of["allOf","oneOf","anyOf"]){const m=l[h];Array.isArray(m)&&m.forEach((y,x)=>{a(y,[...c,`${h}[${x}]`],[...u,`${h}[${x}]`],d&&h!=="allOf"?[...d,`${h}[${x}]`]:null,f)})}We(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function hc(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:i,text:Ne([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,i]of Object.entries(e.servers)){const a=i,l=a.description??s,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:c,text:Ne([s,l,c,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const u=a.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:Ne(u)});const d=a.bindings,f=We(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${a.protocol} configuration`,path:`servers.${s}.bindings.${a.protocol}`,location:`Servers > ${s} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:Ne(f)})}if(e.operations)for(const[s,i]of Object.entries(e.operations)){const a=i.title??s,l=i.summary??i.description??i.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:a,path:`operations.${s}`,location:`Operations > ${a}`,subtitle:l,text:Ne([s,a,l,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const c=i.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${a} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:Ne(c)});const u=i.bindings;if(We(u))for(const[d,f]of Object.entries(u))f!=null&&t.push({id:`operation-${s}-bindings-${d}`,targetId:`operation-${s}-bindings-${d}`,type:"operation",tab:"operations",key:s,name:`${a} > ${d} configuration`,path:`operations.${s}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:Ne(f)})}if((n=e.components)!=null&&n.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:a,path:`components.messages.${s}`,location:`Messages > ${a}`,subtitle:l,text:Ne([s,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:Ne(i.payload)}),i.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:Ne(i.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))ti(t,i,s,s);return t}function et(e){return Array.isArray?Array.isArray(e):ri(e)==="[object Array]"}function mc(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function pr(e){return e==null?"":mc(e)}function ye(e){return typeof e=="string"}function dn(e){return typeof e=="number"}function gc(e){return e===!0||e===!1||xc(e)&&ri(e)=="[object Boolean]"}function ni(e){return typeof e=="object"}function xc(e){return ni(e)&&e!==null}function Ce(e){return e!=null}function Qt(e){return!e.trim().length}function ri(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const bc="Incorrect 'index' type",hr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",yc=e=>`Invalid value for key ${e}`,kc=e=>`Pattern length exceeds max of ${e}.`,wc=e=>`Missing ${e} property in key`,vc=e=>`Property 'weight' in key '${e}' must be a positive integer`,jc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Ls=Object.prototype.hasOwnProperty;var Sc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=si(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function si(e){let t=null,n=null,r=null,s=1,i=null;if(ye(e)||et(e))r=e,t=Bs(e),n=fn(e);else{if(!Ls.call(e,"name"))throw new Error(wc("name"));const a=e.name;if(r=a,Ls.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(vc(fn(a)));t=Bs(a),n=fn(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Bs(e){return et(e)?e:e.split(".")}function fn(e){return et(e)?e.join("."):e}function Nc(e,t){const n=[];let r=!1;const s=(i,a,l,c)=>{if(Ce(i))if(!a[l])n.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ce(u))return;if(l===a.length-1&&(ye(u)||dn(u)||gc(u)||typeof u=="bigint"))n.push(c!==void 0?{v:pr(u),i:c}:pr(u));else if(et(u)){r=!0;for(let d=0,f=u.length;d<f;d+=1)s(u[d],a,l+1,d)}else a.length&&s(u,a,l+1,c)}};return s(e,ye(t)?t.split("."):t,0),r?n:n[0]}const Ac={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Ec={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},$c={location:0,threshold:.6,distance:100},Cc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Nc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},K=Object.freeze({...Ec,...Ac,...$c,...Cc});function Tc(e){return e>=9&&e<=13||e===32||e===160}function Ic(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let c=0;c<s.length;c++)Tc(s.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const l=Math.round(r/Math.pow(i,.5*e))/r;return n.set(i,l),l},clear(){n.clear()}}}var Gr=class{constructor({getFn:e=K.getFn,fieldNormWeight:t=K.fieldNormWeight}={}){this.norm=Ic(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(ye(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(hr);if(ye(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(hr);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,i=n.length;for(;s<i;){const a=s+i>>>1;n[a]<r.i?s=a+1:i=a}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!Ce(e)||Qt(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const i=this.keys[r],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Ce(a)){if(et(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ce(d)){if(ye(d)){if(!Qt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ce(d.v)){const f=ye(d.v)?d.v:pr(d.v);if(!Qt(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}n.$[r]=l}else if(ye(a)&&!Qt(a)){const l={v:a,n:this.norm.get(a)};n.$[r]=l}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function oi(e,t,{getFn:n=K.getFn,fieldNormWeight:r=K.fieldNormWeight}={}){const s=new Gr({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(si)),s.setSources(t),s.create(),s}function _c(e,{getFn:t=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new Gr({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Oc(e=[],t=K.minMatchCharLength){const n=[];let r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&r===-1?r=i:!l&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function Mc(e,t,n,{location:r=K.location,distance:s=K.distance,threshold:i=K.threshold,findAllMatches:a=K.findAllMatches,minMatchCharLength:l=K.minMatchCharLength,includeMatches:c=K.includeMatches,ignoreLocation:u=K.ignoreLocation}={}){if(t.length>32)throw new Error(kc(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let h=i,m=p;const y=(b,A)=>{const E=b/d;if(u)return E;const R=Math.abs(p-A);return s?E+R/s:R?1:E},x=l>1||c,j=x?Array(f):[];let S;for(;(S=e.indexOf(t,m))>-1;){const b=y(0,S);if(h=Math.min(b,h),m=S+d,x){let A=0;for(;A<d;)j[S+A]=1,A+=1}}m=-1;let v=[],C=1,B=0,D=d+f;const P=1<<d-1;for(let b=0;b<d;b+=1){let A=0,E=D;for(;A<E;)y(b,p+E)<=h?A=E:D=E,E=Math.floor((D-A)/2+A);D=E;let R=Math.max(1,p-E+1);const _=a?f:Math.min(p+E,f)+d,H=Array(_+2);H[_+1]=(1<<b)-1;for(let U=_;U>=R;U-=1){const w=U-1,k=n[e[w]];if(H[U]=(H[U+1]<<1|1)&k,b&&(H[U]|=(v[U+1]|v[U])<<1|1|v[U+1]),H[U]&P&&(C=y(b,w),C<=h)){if(h=C,m=w,B=b,m<=p)break;R=Math.max(1,2*p-m)}}if(y(b+1,p)>h)break;v=H}if(x&&m>=0){const b=Math.min(f-1,m+d-1+B);for(let A=m;A<=b;A+=1)n[e[A]]&&(j[A]=1)}const N={isMatch:m>=0,score:Math.max(.001,C)};if(x){const b=Oc(j,l);b.length?c&&(N.indices=b):N.isMatch=!1}return N}function Rc(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function Vr(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],i=e[n];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const ii={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Pc=new RegExp("["+Object.keys(ii).join("")+"]","g"),_t=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Pc,t=>ii[t]):e=>e;var Jr=class{constructor(e,{location:t=K.location,threshold:n=K.threshold,distance:r=K.distance,includeMatches:s=K.includeMatches,findAllMatches:i=K.findAllMatches,minMatchCharLength:a=K.minMatchCharLength,isCaseSensitive:l=K.isCaseSensitive,ignoreDiacritics:c=K.ignoreDiacritics,ignoreLocation:u=K.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?_t(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:Rc(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,m=f-h;for(;p<m;)d(this.pattern.substr(p,32),p),p+=32;if(h){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?_t(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:y,startIndex:x})=>{const{isMatch:j,score:S,indices:v}=Mc(e,m,y,{location:s+x,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});j&&(p=!0),f+=S,j&&v&&d.push(...v)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(h.indices=Vr(d)),h}};const Lc=new Set(["fuzzy","include"]);function Bc(e){return e.startsWith("inverse")}const mr=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,r;const s=[],i=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+i,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new Jr(e,{location:t.location??K.location,threshold:t.threshold??K.threshold,distance:t.distance??K.distance,includeMatches:t.includeMatches??K.includeMatches,findAllMatches:t.findAllMatches??K.findAllMatches,minMatchCharLength:t.minMatchCharLength??K.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??K.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??K.ignoreDiacritics,ignoreLocation:t.ignoreLocation??K.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Ds=mr.length,Dc="\0",Fc="|";function zc(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const i=s+1;if(i>=n||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Fs(e,t){const n=e.match(t);return n?n[1]:null}function Hc(e,t={}){return e.replace(/\\\|/g,Dc).split(Fc).map(n=>{const r=zc(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const l=r[i];let c=!1,u=-1;for(;!c&&++u<Ds;){const d=mr[u],f=Fs(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ds;){const d=mr[u],f=Fs(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Uc=class{constructor(e,{isCaseSensitive:t=K.isCaseSensitive,ignoreDiacritics:n=K.ignoreDiacritics,includeMatches:r=K.includeMatches,minMatchCharLength:s=K.minMatchCharLength,ignoreLocation:i=K.ignoreLocation,findAllMatches:a=K.findAllMatches,location:l=K.location,threshold:c=K.threshold,distance:u=K.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?_t(e):e,this.pattern=e,this.query=Hc(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?_t(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const f=t[u];a.length=0,i=0,c=!1;for(let p=0,h=f.length;p<h;p+=1){const m=f[p],{isMatch:y,indices:x,score:j}=m.search(e);if(y)i+=1,l+=j,Bc(m.type)&&(c=!0),n&&(Lc.has(m.type)?a.push(...x):a.push(x));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const p={isMatch:!0,score:l/i};return c&&(p.hasInverse=!0),n&&(p.indices=Vr(a)),p}}return{isMatch:!1,score:1}}};const gr=[];function Zr(...e){gr.push(...e)}function bn(e,t){for(let n=0,r=gr.length;n<r;n+=1){const s=gr[n];if(s.condition(e,t))return new s(e,t)}return new Jr(e,t)}const yn={AND:"$and",OR:"$or"},xr={PATH:"$path",PATTERN:"$val"},br=e=>!!(e[yn.AND]||e[yn.OR]),Wc=e=>!!e[xr.PATH],Kc=e=>!et(e)&&ni(e)&&!br(e),zs=e=>({[yn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ai(e,t,{auto:n=!0}={}){const r=s=>{if(ye(s)){const c={keyId:null,pattern:s};return n&&(c.searcher=bn(s,t)),c}const i=Object.keys(s),a=Wc(s);if(!a&&i.length>1&&!br(s))return r(zs(s));if(Kc(s)){const c=a?s[xr.PATH]:i[0],u=a?s[xr.PATTERN]:s[c];if(!ye(u))throw new Error(yc(c));const d={keyId:fn(c),pattern:u};return n&&(d.searcher=bn(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];et(u)&&u.forEach(d=>{l.children.push(r(d))})}),l};return br(e)||(e=zs(e)),r(e)}function yr(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:i})=>{const a=r?r.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n}function Gc(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){e.forEach(n=>{n.score=yr(n.matches,{ignoreFieldNorm:t})})}var Vc=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,i=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),i<n&&this.comparator(t[i],t[r])>0&&(r=i),r!==e){const a=t[e];t[e]=t[r],t[r]=a}}while(r!==e)}};function Jc(e){const t=[];return e.matches.forEach(n=>{if(!Ce(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function Zc(e,t,{includeMatches:n=K.includeMatches,includeScore:r=K.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=Jc(s)),r&&(a.score=s.score),a})}const Xc=/[\p{L}\p{M}\p{N}_]+/gu,Hs=new WeakSet;function Yc(e){Hs.has(e)||(Hs.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Qc(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||Yc(e),t=>t.match(e)||[]):t=>t.match(Xc)||[]}function kr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Qc(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=_t(s)),r(s)}}}var qc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=kr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new Jr(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=r.get(i)||0,l=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),f=this.idfWeights[u];r+=f,d.isMatch&&(s++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(s===0)return{isMatch:!1,score:1};const l=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=Vr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Xn(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const l of i)a.set(l,(a.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function li(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){Xn(e,i,s,r);return}if(a)for(let l=0;l<n;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)Xn(e,u.v,s,r);else Xn(e,c.v,s,r)}}function eu(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)li(r,s,t,n);return r}function tu(e,t,n,r){li(e,t,n,r)}function nu(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,i]of r){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Us(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of n)nu(e,l);const r=l=>{let c=0,u=n.length;for(;c<u;){const d=c+u>>>1;n[d]<l?c=d+1:u=d}return l-c},s=n[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>s?r(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>s?r(l):l,c);e.docTermFieldHits=a}var tt=class{constructor(e,t,n){this.options={...K,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Sc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=bn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Gr))throw new Error(bc);if(this._myIndex=t||oi(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=kr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=eu(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Ce(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=kr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});tu(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Us(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,i)=>!r.has(i)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(hr);this._invertedIndex&&Us(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(ye(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return dn(n)&&n>-1&&(p=p.slice(0,n)),p}const c=i&&dn(n)&&n>0&&ye(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Vc(n,d);ye(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=ye(e)?ye(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Gc(f,{ignoreFieldNorm:l}),i&&f.sort(ye(e)?d:u),dn(n)&&n>-1&&(f=f.slice(0,n));return Zc(f,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!Ce(l))return;const d=r.searchIn(l);if(d.isMatch){const f={score:d.score,value:l,norm:u,indices:d.indices};s&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const p=[f];if(!s||this._coversAllTokens(p)){const h={item:l,idx:c,matches:p};t?(h.score=yr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=ai(e,this.options),n=this._normalizedKeys(),r=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let y;return h===null?(y=[],n.forEach((x,j)=>{y.push(...this._findMatches({key:x,value:c[j],searcher:m}))})):y=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:m}),y&&y.length?[{idx:u,item:c,matches:y}]:[]}const{children:d,operator:f}=l,p=[];for(let h=0,m=d.length;h<m;h+=1){const y=d[h],x=r(y,c,u);if(x.length)p.push(...x);else if(f===yn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ce(l)){const u=r(t,l,c);u.length&&(i.has(c)||(i.set(c,{idx:c,item:l,matches:[]}),a.push(i.get(c))),u.forEach(({matches:d})=>{i.get(c).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!Ce(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,m)=>{const y=this._findMatches({key:h,value:c[m],searcher:r});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const h={idx:u,item:c,matches:d};t?(h.score=yr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Ce(t))return[];const r=[];if(et(t))t.forEach(({v:s,i,n:a})=>{if(!Ce(s))return;const l=n.searchIn(s);if(l.isMatch){const c={score:l.score,key:e,value:s,idx:i,norm:a,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(c.matchedMask=l.matchedMask,c.matchedTerms=l.matchedTerms,c.termCount=l.termCount),r.push(c)}});else{const{v:s,n:i}=t,a=n.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),r.push(l)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const i of s)n.add(i)}return n.size===t}};tt.version="7.5.0";tt.createIndex=oi;tt.parseIndex=_c;tt.config=K;tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(jc);return bn(e,{...K,...n}).searchIn(t)};tt.parseQuery=ai;Zr(Uc);Zr(qc);tt.use=function(...e){e.forEach(t=>Zr(t))};var ru=tt;function ci(e,t,n={}){const[r,s]=g.useState(""),[i,a]=g.useState(""),l=n.debounceMs??150;g.useEffect(()=>{const f=setTimeout(()=>a(r),l);return()=>clearTimeout(f)},[r,l]);const c=g.useMemo(()=>t(e),[e,t]),u=g.useMemo(()=>new ru(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,n.threshold]),d=g.useMemo(()=>i.trim()?u.search(i.trim(),{limit:n.limit??20}).map(f=>f.item):[],[u,i,n.limit]);return{query:r,setQuery:s,results:d,searchIndex:c}}function su(e,t={}){return ci(e,hc,t)}const wr="search-match",ui=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function ou(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let l=0;for(let c=a.indexOf(n);c!==-1;c=a.indexOf(n,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+n.length),r.push(u),l=c+n.length}}return r}function iu(e,t){if(!ui())return;const n=ou(e,t);if(!n.length){CSS.highlights.delete(wr);return}CSS.highlights.set(wr,new Highlight(...n))}function Yn(){ui()&&CSS.highlights.delete(wr)}function Ws(e,t){const n=g.useRef(null);g.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:i}=e;let a=!1;const l=u=>{if(a)return;const d=document.getElementById(r);if(!d){u<40&&setTimeout(()=>l(u+1),50);return}if(n.current!==r){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}i&&c(0)},c=u=>{if(a)return;const d=document.getElementById(r);d&&iu(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function di({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:l}){var w;const c=((w=e[0])==null?void 0:w.id)??t,u=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=g.useState(()=>u&&u!=="servers"?u:c),[p,h]=g.useState(()=>u),m=k=>{f(k),h(k)},[y,x]=g.useState(()=>{const k={};return u&&(i!=null&&i.key)&&(k[u]=i.key),k}),j=e.some(k=>k.id===d)?d:c,S={};for(const k of r)S[k.id]=k.visible?y[k.id]??null:null;const v=(k,T)=>x(F=>({...F,[k]:T})),[C,B]=g.useState(null),[D,P]=g.useState(null),[N,b]=g.useState(null),A=k=>{n(k.tab)?m(k.tab):k.tab==="servers"&&h("servers");const T={};for(const F of r)T[F.id]=F.id===k.tab?k.key:null;x(T),B(k.focusSection??null),P(k.tab==="schemas"&&k.schemaFocusTokens?{tokens:k.schemaFocusTokens,id:k.targetId}:null),k.tab==="schemas"&&Yn(),b({targetId:k.targetId,query:s,highlight:k.tab!=="schemas"})},E=(k,T)=>{m(k),x(F=>{const G={...F};for(const J of r)J.id!=="servers"&&(G[J.id]=J.id===k?T:null);return G})},R=k=>{h("servers");const T={};for(const F of r)T[F.id]=F.id==="servers"?k:null;x(T)},_=k=>{n(k)&&m(k)},H=g.useMemo(()=>{for(const k of r){const T=S[k.id];if(T)return{tab:k.id,key:T}}return null},[...r.map(k=>S[k.id])]);Ws(N,[j,C,D,...r.map(k=>S[k.id])]);const[U]=g.useState(()=>u&&(i!=null&&i.key)&&l?{targetId:l(u,i.key),query:"",highlight:!1}:null);return Ws(U,[j]),g.useEffect(()=>{a==null||a(H?{tab:H.tab,key:H.key}:{tab:j,key:null})},[j,H]),g.useEffect(()=>{s.trim()||(b(null),Yn())},[s]),g.useEffect(()=>Yn,[]),{effectiveTab:j,focusTab:m,navActiveSection:p??j,selected:S,setSelectedKey:v,selectedNavItem:H,handleSearchSelect:A,handleNavItemSelect:E,handleNavServerSelect:R,handleContentTabChange:_,focusSection:C,schemaFocusTarget:D}}const V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),He=e=>V(e)?e:null,Ks="^[\0-ÿ]*$",au=Math.pow(-2,31),lu=Math.pow(2,31)-1,cu=Math.pow(-2,63),uu=Math.pow(2,63)-1,du={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"},Xr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Xr(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function vr(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=Ot(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Gs(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function fu(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function pu(e,t,n){if(!(t===void 0||n.examples||Array.isArray(e)))switch(e){case"boolean":n.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":n.examples=[parseInt(t,10)];break;default:n.examples=[t]}}function jr(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Sr(e,t,n){const{type:r,jsonSchema:s}=fu(e,n);pu(r,t.example,s);function i(...a){a.forEach(l=>{let c=!0;l==="minLength"||l==="maxLength"?c=t[l]>-1:l==="multipleOf"&&(c=t[l]>0),t[l]!==void 0&&c&&(s[l]=t[l])})}switch(r){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function Yr(e,t,n){t!==void 0&&(e[t]=n)}function Mt(e,t){let n={};if(Array.isArray(e))return mu(n,e,t);const r=Xr(e),s=typeof e=="string"?e:r.type;switch(n.type=du[s],s){case"int":{n.minimum=au,n.maximum=lu;break}case"long":{n.minimum=cu,n.maximum=uu;break}case"bytes":{n.pattern=Ks;break}case"fixed":{n.pattern=Ks,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Mt(r.values,t);break}case"array":{n.items=Mt(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=hu(r,t,n);Yr(t,Ot(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Ot(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=jr(r)?{...i}:i);break}}return vr(r,n,t),Sr(s,r,n),n}function hu(e,t,n){const r=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=jr(s)?{...i}:i;Gs(s,n,s.default!==void 0),jr(s)&&(vr(s,a,t),Sr(s.type,s,a)),r.set(s.name,a)}else{const a=Mt(s.type,t);Gs(s,n,s.default!==void 0),vr(s,a,t),Sr(s.type,s,a),r.set(s.name,a),Yr(t,Ot(s.type),a)}}return r}function mu(e,t,n){const r=[];let s=null;for(const i of t){const a=Mt(i,n);(typeof i=="string"?i:Xr(i).type)==="null"?s=a:(r.push(a),Yr(n,Ot(i),a))}return s&&r.push(s),e.oneOf=r,e}function Nr(e){return Mt(e,{})}const Vs=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),gu=new Set(["record","enum","array","map","fixed"]),Js=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Qr(e){const t=[];return pt(e,"schema",t,new Set),t}function pt(e,t,n,r){if(typeof e=="string"){!Vs.has(e)&&!Js.test(e)&&n.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&n.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>pt(i,`${t}[${a}]`,n,r));return}if(!V(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||V(s)?pt(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Vs.has(s)&&!gu.has(s)&&!Js.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const l=`${t}.fields[${a}]`;if(!V(i)||typeof i.name!="string"){n.push(`${l}: field must have a string "name"`);return}pt(i.type,`${l}.type`,n,r)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):pt(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):pt(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let kn=null,Qn=null;const Ar=new Set;function xu(){return Qn||(Qn=Promise.resolve().then(()=>require("./protoToJsonSchema-QVW5EW0-.cjs")).then(e=>{kn=e.protoToJsonSchema,Ar.forEach(t=>t())})),Qn}function bu(){return kn||xu(),kn}function yu(e){return Ar.add(e),()=>Ar.delete(e)}function Zs(){return kn!==null}function qr(){return g.useSyncExternalStore(yu,Zs,Zs)}const ku="x-parser-original-payload",wn="x-lib-conversion-error",wu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,vu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Dt(e){return typeof e=="string"&&wu.test(e)}function Ft(e){return typeof e=="string"&&vu.test(e)}function fi(e){return V(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function pi(e){var t,n;if(typeof e!="string")return null;if(Dt(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Ft(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function hi(e){return Dt(e)?"Avro":Ft(e)?"Protobuf":null}function ju(e,t){return t?!1:!e||Dt(e)||Ft(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Su=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Nu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Au(e){return typeof e=="string"||Array.isArray(e)?!0:V(e)?typeof e.type=="string"&&Nu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Su.some(t=>t in e):!1}function Rt(e,t){let n=e;if(t&&V(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=Eu(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=fi(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function Eu(e){var a;if(!fi(e))return{schema:He(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[ku],s=(a=He(n))==null?void 0:a[wn];if(typeof s=="string")return{schema:He(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:He(n)??{},schemaFormat:t,originalSchema:r};if(Dt(t)&&Au(n)){const l=Qr(n);if(l.length>0)return{schema:He(n)??{},schemaFormat:t,originalSchema:n,conversionError:l[0]};try{return{schema:Nr(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:He(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Ft(t)&&typeof n=="string"){const l=bu();if(!l)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:l(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=He(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const pe=(e,t)=>`${"#".repeat(e)} ${t}`,M=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),jt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$u={objects:new Set,refs:new Set};function pn(e,t,n=$u){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||jt(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const i=jt(e)?e["x-parser-schema-id"]:void 0;return typeof i=="string"?{$ref:`#/components/schemas/${i} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:jt(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(i=>pn(i,t,r));if(jt(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return jt(i)||Array.isArray(i)?pn(i,t,r):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=pn(a,t,r);return s}function vn(e,t,n){if(!t)return"";const r=pn(t,n);return`${pe(4,`\`${M(e)}\``)}
6
+ ${e.trimStart()}`}function ei({serialize:e,onOpenChange:t}){const[n,r]=g.useState(!1),[s,i]=g.useState(!1),a=g.useRef(null),l=g.useRef(void 0),{deref:c}=ke(),u=()=>qo(e(c));g.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),g.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),g.useEffect(()=>{if(!n)return;const p=h=>{h.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),g.useEffect(()=>{if(!n)return;const p=h=>{a.current&&!a.current.contains(h.target)&&r(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const d=async()=>{const p=u();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:p.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(p),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),i(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(!1),2e3)}catch(h){console.error("[MarkdownExportMenu] Copy for LLM failed:",h)}r(!1)},f=()=>{const p=u(),h=new Blob([p],{type:"text/markdown"}),m=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:m}),window.open(m,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(m),3e4),r(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>r(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(Qo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Yo,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(wt,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-[41] w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:d,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:f,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[o.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),o.jsx(Mn,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const We=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),un=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>un(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,un(r,t)]).join(" "):We(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,un(r,t)]).join(" ")):"",Ne=e=>un(e).trim().replace(/\s+/g," "),dc=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,fc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),pc=e=>{if(!We(e))return e;const t={};for(const[n,r]of Object.entries(e))fc.has(n)||(t[n]=r);return t},ti=(e,t,n,r)=>{const s=`schema-${n}`,i=(l,c,u,d)=>{const f=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,p=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,h=We(l)?l.description:void 0,m=c.length?`${r}.${c.join(".")}`:r;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:d?dc(n,d):s,type:"schema",tab:"schemas",key:n,name:m,path:f,location:p,subtitle:h,text:Ne([pc(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!We(l)||f.has(l))return;if(f.add(l),We(l.properties))for(const[h,m]of Object.entries(l.properties))a(m,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null,f);const p=l.items;We(p)?a(p,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,f):Array.isArray(p)&&p.forEach((h,m)=>{a(h,[...c,`items[${m}]`],[...u,`items[${m}]`],null,f)});for(const h of["allOf","oneOf","anyOf"]){const m=l[h];Array.isArray(m)&&m.forEach((y,x)=>{a(y,[...c,`${h}[${x}]`],[...u,`${h}[${x}]`],d&&h!=="allOf"?[...d,`${h}[${x}]`]:null,f)})}We(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function hc(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:i,text:Ne([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,i]of Object.entries(e.servers)){const a=i,l=a.description??s,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:c,text:Ne([s,l,c,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const u=a.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:Ne(u)});const d=a.bindings,f=We(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${a.protocol} configuration`,path:`servers.${s}.bindings.${a.protocol}`,location:`Servers > ${s} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:Ne(f)})}if(e.operations)for(const[s,i]of Object.entries(e.operations)){const a=i.title??s,l=i.summary??i.description??i.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:a,path:`operations.${s}`,location:`Operations > ${a}`,subtitle:l,text:Ne([s,a,l,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const c=i.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${a} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:Ne(c)});const u=i.bindings;if(We(u))for(const[d,f]of Object.entries(u))f!=null&&t.push({id:`operation-${s}-bindings-${d}`,targetId:`operation-${s}-bindings-${d}`,type:"operation",tab:"operations",key:s,name:`${a} > ${d} configuration`,path:`operations.${s}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:Ne(f)})}if((n=e.components)!=null&&n.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:a,path:`components.messages.${s}`,location:`Messages > ${a}`,subtitle:l,text:Ne([s,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:Ne(i.payload)}),i.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:Ne(i.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))ti(t,i,s,s);return t}function et(e){return Array.isArray?Array.isArray(e):ri(e)==="[object Array]"}function mc(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function pr(e){return e==null?"":mc(e)}function ye(e){return typeof e=="string"}function dn(e){return typeof e=="number"}function gc(e){return e===!0||e===!1||xc(e)&&ri(e)=="[object Boolean]"}function ni(e){return typeof e=="object"}function xc(e){return ni(e)&&e!==null}function Ce(e){return e!=null}function Qt(e){return!e.trim().length}function ri(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const bc="Incorrect 'index' type",hr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",yc=e=>`Invalid value for key ${e}`,kc=e=>`Pattern length exceeds max of ${e}.`,wc=e=>`Missing ${e} property in key`,vc=e=>`Property 'weight' in key '${e}' must be a positive integer`,jc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Ls=Object.prototype.hasOwnProperty;var Sc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=si(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function si(e){let t=null,n=null,r=null,s=1,i=null;if(ye(e)||et(e))r=e,t=Bs(e),n=fn(e);else{if(!Ls.call(e,"name"))throw new Error(wc("name"));const a=e.name;if(r=a,Ls.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(vc(fn(a)));t=Bs(a),n=fn(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Bs(e){return et(e)?e:e.split(".")}function fn(e){return et(e)?e.join("."):e}function Nc(e,t){const n=[];let r=!1;const s=(i,a,l,c)=>{if(Ce(i))if(!a[l])n.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ce(u))return;if(l===a.length-1&&(ye(u)||dn(u)||gc(u)||typeof u=="bigint"))n.push(c!==void 0?{v:pr(u),i:c}:pr(u));else if(et(u)){r=!0;for(let d=0,f=u.length;d<f;d+=1)s(u[d],a,l+1,d)}else a.length&&s(u,a,l+1,c)}};return s(e,ye(t)?t.split("."):t,0),r?n:n[0]}const Ac={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Ec={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},$c={location:0,threshold:.6,distance:100},Cc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Nc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},K=Object.freeze({...Ec,...Ac,...$c,...Cc});function Tc(e){return e>=9&&e<=13||e===32||e===160}function Ic(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let c=0;c<s.length;c++)Tc(s.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const l=Math.round(r/Math.pow(i,.5*e))/r;return n.set(i,l),l},clear(){n.clear()}}}var Gr=class{constructor({getFn:e=K.getFn,fieldNormWeight:t=K.fieldNormWeight}={}){this.norm=Ic(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(ye(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(hr);if(ye(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(hr);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,i=n.length;for(;s<i;){const a=s+i>>>1;n[a]<r.i?s=a+1:i=a}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!Ce(e)||Qt(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const i=this.keys[r],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Ce(a)){if(et(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ce(d)){if(ye(d)){if(!Qt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ce(d.v)){const f=ye(d.v)?d.v:pr(d.v);if(!Qt(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}n.$[r]=l}else if(ye(a)&&!Qt(a)){const l={v:a,n:this.norm.get(a)};n.$[r]=l}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function oi(e,t,{getFn:n=K.getFn,fieldNormWeight:r=K.fieldNormWeight}={}){const s=new Gr({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(si)),s.setSources(t),s.create(),s}function _c(e,{getFn:t=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new Gr({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Oc(e=[],t=K.minMatchCharLength){const n=[];let r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&r===-1?r=i:!l&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function Mc(e,t,n,{location:r=K.location,distance:s=K.distance,threshold:i=K.threshold,findAllMatches:a=K.findAllMatches,minMatchCharLength:l=K.minMatchCharLength,includeMatches:c=K.includeMatches,ignoreLocation:u=K.ignoreLocation}={}){if(t.length>32)throw new Error(kc(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let h=i,m=p;const y=(b,A)=>{const E=b/d;if(u)return E;const R=Math.abs(p-A);return s?E+R/s:R?1:E},x=l>1||c,j=x?Array(f):[];let S;for(;(S=e.indexOf(t,m))>-1;){const b=y(0,S);if(h=Math.min(b,h),m=S+d,x){let A=0;for(;A<d;)j[S+A]=1,A+=1}}m=-1;let v=[],C=1,B=0,D=d+f;const P=1<<d-1;for(let b=0;b<d;b+=1){let A=0,E=D;for(;A<E;)y(b,p+E)<=h?A=E:D=E,E=Math.floor((D-A)/2+A);D=E;let R=Math.max(1,p-E+1);const _=a?f:Math.min(p+E,f)+d,H=Array(_+2);H[_+1]=(1<<b)-1;for(let U=_;U>=R;U-=1){const w=U-1,k=n[e[w]];if(H[U]=(H[U+1]<<1|1)&k,b&&(H[U]|=(v[U+1]|v[U])<<1|1|v[U+1]),H[U]&P&&(C=y(b,w),C<=h)){if(h=C,m=w,B=b,m<=p)break;R=Math.max(1,2*p-m)}}if(y(b+1,p)>h)break;v=H}if(x&&m>=0){const b=Math.min(f-1,m+d-1+B);for(let A=m;A<=b;A+=1)n[e[A]]&&(j[A]=1)}const N={isMatch:m>=0,score:Math.max(.001,C)};if(x){const b=Oc(j,l);b.length?c&&(N.indices=b):N.isMatch=!1}return N}function Rc(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function Vr(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],i=e[n];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const ii={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Pc=new RegExp("["+Object.keys(ii).join("")+"]","g"),_t=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Pc,t=>ii[t]):e=>e;var Jr=class{constructor(e,{location:t=K.location,threshold:n=K.threshold,distance:r=K.distance,includeMatches:s=K.includeMatches,findAllMatches:i=K.findAllMatches,minMatchCharLength:a=K.minMatchCharLength,isCaseSensitive:l=K.isCaseSensitive,ignoreDiacritics:c=K.ignoreDiacritics,ignoreLocation:u=K.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?_t(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:Rc(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,m=f-h;for(;p<m;)d(this.pattern.substr(p,32),p),p+=32;if(h){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?_t(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:y,startIndex:x})=>{const{isMatch:j,score:S,indices:v}=Mc(e,m,y,{location:s+x,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});j&&(p=!0),f+=S,j&&v&&d.push(...v)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(h.indices=Vr(d)),h}};const Lc=new Set(["fuzzy","include"]);function Bc(e){return e.startsWith("inverse")}const mr=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,r;const s=[],i=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+i,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new Jr(e,{location:t.location??K.location,threshold:t.threshold??K.threshold,distance:t.distance??K.distance,includeMatches:t.includeMatches??K.includeMatches,findAllMatches:t.findAllMatches??K.findAllMatches,minMatchCharLength:t.minMatchCharLength??K.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??K.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??K.ignoreDiacritics,ignoreLocation:t.ignoreLocation??K.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Ds=mr.length,Dc="\0",Fc="|";function zc(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const i=s+1;if(i>=n||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Fs(e,t){const n=e.match(t);return n?n[1]:null}function Hc(e,t={}){return e.replace(/\\\|/g,Dc).split(Fc).map(n=>{const r=zc(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const l=r[i];let c=!1,u=-1;for(;!c&&++u<Ds;){const d=mr[u],f=Fs(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ds;){const d=mr[u],f=Fs(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Uc=class{constructor(e,{isCaseSensitive:t=K.isCaseSensitive,ignoreDiacritics:n=K.ignoreDiacritics,includeMatches:r=K.includeMatches,minMatchCharLength:s=K.minMatchCharLength,ignoreLocation:i=K.ignoreLocation,findAllMatches:a=K.findAllMatches,location:l=K.location,threshold:c=K.threshold,distance:u=K.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?_t(e):e,this.pattern=e,this.query=Hc(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?_t(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const f=t[u];a.length=0,i=0,c=!1;for(let p=0,h=f.length;p<h;p+=1){const m=f[p],{isMatch:y,indices:x,score:j}=m.search(e);if(y)i+=1,l+=j,Bc(m.type)&&(c=!0),n&&(Lc.has(m.type)?a.push(...x):a.push(x));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const p={isMatch:!0,score:l/i};return c&&(p.hasInverse=!0),n&&(p.indices=Vr(a)),p}}return{isMatch:!1,score:1}}};const gr=[];function Zr(...e){gr.push(...e)}function bn(e,t){for(let n=0,r=gr.length;n<r;n+=1){const s=gr[n];if(s.condition(e,t))return new s(e,t)}return new Jr(e,t)}const yn={AND:"$and",OR:"$or"},xr={PATH:"$path",PATTERN:"$val"},br=e=>!!(e[yn.AND]||e[yn.OR]),Wc=e=>!!e[xr.PATH],Kc=e=>!et(e)&&ni(e)&&!br(e),zs=e=>({[yn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ai(e,t,{auto:n=!0}={}){const r=s=>{if(ye(s)){const c={keyId:null,pattern:s};return n&&(c.searcher=bn(s,t)),c}const i=Object.keys(s),a=Wc(s);if(!a&&i.length>1&&!br(s))return r(zs(s));if(Kc(s)){const c=a?s[xr.PATH]:i[0],u=a?s[xr.PATTERN]:s[c];if(!ye(u))throw new Error(yc(c));const d={keyId:fn(c),pattern:u};return n&&(d.searcher=bn(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];et(u)&&u.forEach(d=>{l.children.push(r(d))})}),l};return br(e)||(e=zs(e)),r(e)}function yr(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:i})=>{const a=r?r.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n}function Gc(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){e.forEach(n=>{n.score=yr(n.matches,{ignoreFieldNorm:t})})}var Vc=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,i=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),i<n&&this.comparator(t[i],t[r])>0&&(r=i),r!==e){const a=t[e];t[e]=t[r],t[r]=a}}while(r!==e)}};function Jc(e){const t=[];return e.matches.forEach(n=>{if(!Ce(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function Zc(e,t,{includeMatches:n=K.includeMatches,includeScore:r=K.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=Jc(s)),r&&(a.score=s.score),a})}const Xc=/[\p{L}\p{M}\p{N}_]+/gu,Hs=new WeakSet;function Yc(e){Hs.has(e)||(Hs.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Qc(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||Yc(e),t=>t.match(e)||[]):t=>t.match(Xc)||[]}function kr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Qc(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=_t(s)),r(s)}}}var qc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=kr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new Jr(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=r.get(i)||0,l=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),f=this.idfWeights[u];r+=f,d.isMatch&&(s++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(s===0)return{isMatch:!1,score:1};const l=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=Vr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Xn(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const l of i)a.set(l,(a.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function li(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){Xn(e,i,s,r);return}if(a)for(let l=0;l<n;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)Xn(e,u.v,s,r);else Xn(e,c.v,s,r)}}function eu(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)li(r,s,t,n);return r}function tu(e,t,n,r){li(e,t,n,r)}function nu(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,i]of r){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Us(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of n)nu(e,l);const r=l=>{let c=0,u=n.length;for(;c<u;){const d=c+u>>>1;n[d]<l?c=d+1:u=d}return l-c},s=n[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>s?r(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>s?r(l):l,c);e.docTermFieldHits=a}var tt=class{constructor(e,t,n){this.options={...K,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Sc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=bn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Gr))throw new Error(bc);if(this._myIndex=t||oi(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=kr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=eu(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Ce(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=kr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});tu(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Us(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,i)=>!r.has(i)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(hr);this._invertedIndex&&Us(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(ye(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return dn(n)&&n>-1&&(p=p.slice(0,n)),p}const c=i&&dn(n)&&n>0&&ye(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Vc(n,d);ye(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=ye(e)?ye(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Gc(f,{ignoreFieldNorm:l}),i&&f.sort(ye(e)?d:u),dn(n)&&n>-1&&(f=f.slice(0,n));return Zc(f,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!Ce(l))return;const d=r.searchIn(l);if(d.isMatch){const f={score:d.score,value:l,norm:u,indices:d.indices};s&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const p=[f];if(!s||this._coversAllTokens(p)){const h={item:l,idx:c,matches:p};t?(h.score=yr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=ai(e,this.options),n=this._normalizedKeys(),r=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let y;return h===null?(y=[],n.forEach((x,j)=>{y.push(...this._findMatches({key:x,value:c[j],searcher:m}))})):y=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:m}),y&&y.length?[{idx:u,item:c,matches:y}]:[]}const{children:d,operator:f}=l,p=[];for(let h=0,m=d.length;h<m;h+=1){const y=d[h],x=r(y,c,u);if(x.length)p.push(...x);else if(f===yn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ce(l)){const u=r(t,l,c);u.length&&(i.has(c)||(i.set(c,{idx:c,item:l,matches:[]}),a.push(i.get(c))),u.forEach(({matches:d})=>{i.get(c).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!Ce(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,m)=>{const y=this._findMatches({key:h,value:c[m],searcher:r});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const h={idx:u,item:c,matches:d};t?(h.score=yr(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Ce(t))return[];const r=[];if(et(t))t.forEach(({v:s,i,n:a})=>{if(!Ce(s))return;const l=n.searchIn(s);if(l.isMatch){const c={score:l.score,key:e,value:s,idx:i,norm:a,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(c.matchedMask=l.matchedMask,c.matchedTerms=l.matchedTerms,c.termCount=l.termCount),r.push(c)}});else{const{v:s,n:i}=t,a=n.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),r.push(l)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const i of s)n.add(i)}return n.size===t}};tt.version="7.5.0";tt.createIndex=oi;tt.parseIndex=_c;tt.config=K;tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(jc);return bn(e,{...K,...n}).searchIn(t)};tt.parseQuery=ai;Zr(Uc);Zr(qc);tt.use=function(...e){e.forEach(t=>Zr(t))};var ru=tt;function ci(e,t,n={}){const[r,s]=g.useState(""),[i,a]=g.useState(""),l=n.debounceMs??150;g.useEffect(()=>{const f=setTimeout(()=>a(r),l);return()=>clearTimeout(f)},[r,l]);const c=g.useMemo(()=>t(e),[e,t]),u=g.useMemo(()=>new ru(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,n.threshold]),d=g.useMemo(()=>i.trim()?u.search(i.trim(),{limit:n.limit??20}).map(f=>f.item):[],[u,i,n.limit]);return{query:r,setQuery:s,results:d,searchIndex:c}}function su(e,t={}){return ci(e,hc,t)}const wr="search-match",ui=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function ou(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let l=0;for(let c=a.indexOf(n);c!==-1;c=a.indexOf(n,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+n.length),r.push(u),l=c+n.length}}return r}function iu(e,t){if(!ui())return;const n=ou(e,t);if(!n.length){CSS.highlights.delete(wr);return}CSS.highlights.set(wr,new Highlight(...n))}function Yn(){ui()&&CSS.highlights.delete(wr)}function Ws(e,t){const n=g.useRef(null);g.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:i}=e;let a=!1;const l=u=>{if(a)return;const d=document.getElementById(r);if(!d){u<40&&setTimeout(()=>l(u+1),50);return}if(n.current!==r){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}i&&c(0)},c=u=>{if(a)return;const d=document.getElementById(r);d&&iu(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function di({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:l}){var w;const c=((w=e[0])==null?void 0:w.id)??t,u=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=g.useState(()=>u&&u!=="servers"?u:c),[p,h]=g.useState(()=>u),m=k=>{f(k),h(k)},[y,x]=g.useState(()=>{const k={};return u&&(i!=null&&i.key)&&(k[u]=i.key),k}),j=e.some(k=>k.id===d)?d:c,S={};for(const k of r)S[k.id]=k.visible?y[k.id]??null:null;const v=(k,T)=>x(F=>({...F,[k]:T})),[C,B]=g.useState(null),[D,P]=g.useState(null),[N,b]=g.useState(null),A=k=>{n(k.tab)?m(k.tab):k.tab==="servers"&&h("servers");const T={};for(const F of r)T[F.id]=F.id===k.tab?k.key:null;x(T),B(k.focusSection??null),P(k.tab==="schemas"&&k.schemaFocusTokens?{tokens:k.schemaFocusTokens,id:k.targetId}:null),k.tab==="schemas"&&Yn(),b({targetId:k.targetId,query:s,highlight:k.tab!=="schemas"})},E=(k,T)=>{m(k),x(F=>{const G={...F};for(const J of r)J.id!=="servers"&&(G[J.id]=J.id===k?T:null);return G})},R=k=>{h("servers");const T={};for(const F of r)T[F.id]=F.id==="servers"?k:null;x(T)},_=k=>{n(k)&&m(k)},H=g.useMemo(()=>{for(const k of r){const T=S[k.id];if(T)return{tab:k.id,key:T}}return null},[...r.map(k=>S[k.id])]);Ws(N,[j,C,D,...r.map(k=>S[k.id])]);const[U]=g.useState(()=>u&&(i!=null&&i.key)&&l?{targetId:l(u,i.key),query:"",highlight:!1}:null);return Ws(U,[j]),g.useEffect(()=>{a==null||a(H?{tab:H.tab,key:H.key}:{tab:j,key:null})},[j,H]),g.useEffect(()=>{s.trim()||(b(null),Yn())},[s]),g.useEffect(()=>Yn,[]),{effectiveTab:j,focusTab:m,navActiveSection:p??j,selected:S,setSelectedKey:v,selectedNavItem:H,handleSearchSelect:A,handleNavItemSelect:E,handleNavServerSelect:R,handleContentTabChange:_,focusSection:C,schemaFocusTarget:D}}const V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),He=e=>V(e)?e:null,Ks="^[\0-ÿ]*$",au=Math.pow(-2,31),lu=Math.pow(2,31)-1,cu=Math.pow(-2,63),uu=Math.pow(2,63)-1,du={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"},Xr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Xr(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function vr(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=Ot(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Gs(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function fu(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function pu(e,t,n){if(!(t===void 0||n.examples||Array.isArray(e)))switch(e){case"boolean":n.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":n.examples=[parseInt(t,10)];break;default:n.examples=[t]}}function jr(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Sr(e,t,n){const{type:r,jsonSchema:s}=fu(e,n);pu(r,t.example,s);function i(...a){a.forEach(l=>{let c=!0;l==="minLength"||l==="maxLength"?c=t[l]>-1:l==="multipleOf"&&(c=t[l]>0),t[l]!==void 0&&c&&(s[l]=t[l])})}switch(r){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function Yr(e,t,n){t!==void 0&&(e[t]=n)}function Mt(e,t){let n={};if(Array.isArray(e))return mu(n,e,t);const r=Xr(e),s=typeof e=="string"?e:r.type;switch(n.type=du[s],s){case"int":{n.minimum=au,n.maximum=lu;break}case"long":{n.minimum=cu,n.maximum=uu;break}case"bytes":{n.pattern=Ks;break}case"fixed":{n.pattern=Ks,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Mt(r.values,t);break}case"array":{n.items=Mt(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=hu(r,t,n);Yr(t,Ot(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Ot(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=jr(r)?{...i}:i);break}}return vr(r,n,t),Sr(s,r,n),n}function hu(e,t,n){const r=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=jr(s)?{...i}:i;Gs(s,n,s.default!==void 0),jr(s)&&(vr(s,a,t),Sr(s.type,s,a)),r.set(s.name,a)}else{const a=Mt(s.type,t);Gs(s,n,s.default!==void 0),vr(s,a,t),Sr(s.type,s,a),r.set(s.name,a),Yr(t,Ot(s.type),a)}}return r}function mu(e,t,n){const r=[];let s=null;for(const i of t){const a=Mt(i,n);(typeof i=="string"?i:Xr(i).type)==="null"?s=a:(r.push(a),Yr(n,Ot(i),a))}return s&&r.push(s),e.oneOf=r,e}function Nr(e){return Mt(e,{})}const Vs=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),gu=new Set(["record","enum","array","map","fixed"]),Js=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Qr(e){const t=[];return pt(e,"schema",t,new Set),t}function pt(e,t,n,r){if(typeof e=="string"){!Vs.has(e)&&!Js.test(e)&&n.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&n.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>pt(i,`${t}[${a}]`,n,r));return}if(!V(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||V(s)?pt(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Vs.has(s)&&!gu.has(s)&&!Js.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const l=`${t}.fields[${a}]`;if(!V(i)||typeof i.name!="string"){n.push(`${l}: field must have a string "name"`);return}pt(i.type,`${l}.type`,n,r)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):pt(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):pt(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let kn=null,Qn=null;const Ar=new Set;function xu(){return Qn||(Qn=Promise.resolve().then(()=>require("./protoToJsonSchema-CQwj_Ytd.cjs")).then(e=>{kn=e.protoToJsonSchema,Ar.forEach(t=>t())})),Qn}function bu(){return kn||xu(),kn}function yu(e){return Ar.add(e),()=>Ar.delete(e)}function Zs(){return kn!==null}function qr(){return g.useSyncExternalStore(yu,Zs,Zs)}const ku="x-parser-original-payload",wn="x-lib-conversion-error",wu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,vu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Dt(e){return typeof e=="string"&&wu.test(e)}function Ft(e){return typeof e=="string"&&vu.test(e)}function fi(e){return V(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function pi(e){var t,n;if(typeof e!="string")return null;if(Dt(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Ft(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function hi(e){return Dt(e)?"Avro":Ft(e)?"Protobuf":null}function ju(e,t){return t?!1:!e||Dt(e)||Ft(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Su=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Nu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Au(e){return typeof e=="string"||Array.isArray(e)?!0:V(e)?typeof e.type=="string"&&Nu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Su.some(t=>t in e):!1}function Rt(e,t){let n=e;if(t&&V(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=Eu(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=fi(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function Eu(e){var a;if(!fi(e))return{schema:He(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[ku],s=(a=He(n))==null?void 0:a[wn];if(typeof s=="string")return{schema:He(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:He(n)??{},schemaFormat:t,originalSchema:r};if(Dt(t)&&Au(n)){const l=Qr(n);if(l.length>0)return{schema:He(n)??{},schemaFormat:t,originalSchema:n,conversionError:l[0]};try{return{schema:Nr(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:He(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Ft(t)&&typeof n=="string"){const l=bu();if(!l)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:l(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=He(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const pe=(e,t)=>`${"#".repeat(e)} ${t}`,M=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),jt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$u={objects:new Set,refs:new Set};function pn(e,t,n=$u){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||jt(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const i=jt(e)?e["x-parser-schema-id"]:void 0;return typeof i=="string"?{$ref:`#/components/schemas/${i} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:jt(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(i=>pn(i,t,r));if(jt(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return jt(i)||Array.isArray(i)?pn(i,t,r):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=pn(a,t,r);return s}function vn(e,t,n){if(!t)return"";const r=pn(t,n);return`${pe(4,`\`${M(e)}\``)}
7
7
 
8
8
  \`\`\`json
9
9
  ${JSON.stringify(r,null,2)}
@@ -63,7 +63,7 @@ _(could not convert schema: ${M(i)})_`;const l=s&&!r.description?{...r,descripti
63
63
  `)}function yi(e,t,n,r=Bt(e)){var l,c,u,d;const s=(c=(l=e.paths)==null?void 0:l[n])==null?void 0:c[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(pe(1,M(a.title))),i.push(`**Version:** ${M(a.version)}`),a.description&&i.push(M(a.description)),(u=e.servers)!=null&&u.length){const f=[pe(2,"Servers")];for(const p of e.servers)f.push(`- \`${M(p.url)}\`${p.description?` — ${M(p.description)}`:""}`);i.push(f.join(`
64
64
  `))}return i.push(bi(t,n,s,r,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
65
65
 
66
- `)}function Rn({label:e,children:t}){return o.jsx(Tn,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function ki(){const{plugins:e,pluginSlotRegistry:t}=Re();return g.useMemo(()=>t??Bo(e??[]),[t,e])}function wi(e){return ki().get(e)??[]}function zt({name:e,context:t}){const n=wi(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Rn,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function vi(e){return ki().get(e)??[]}const _u=/^(https?:|data:image\/)/i;function ns(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:n,altText:r,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof n!="string"||!_u.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const ji={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},Ou=()=>Promise.resolve().then(()=>require("./LogoExtension-pwW1l7NO.cjs"));function rs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ut=rs();function Si(e){ut=e}var Ct={exec:()=>null};function te(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(ve.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Mu=/^(?:[ \t]*(?:\n|$))+/,Ru=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ht=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Lu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ss=/(?:[*+-]|\d{1,9}[.)])/,Ni=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ai=te(Ni).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Bu=te(Ni).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),os=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Du=/^[^\n]+/,is=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Fu=te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",is).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zu=te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ss).getRegex(),Pn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",as=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hu=te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",as).replace("tag",Pn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ei=te(os).replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex(),Uu=te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ei).getRegex(),ls={blockquote:Uu,code:Ru,def:Fu,fences:Pu,heading:Lu,hr:Ht,html:Hu,lheading:Ai,list:zu,newline:Mu,paragraph:Ei,table:Ct,text:Du},Xs=te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex(),Wu={...ls,lheading:Bu,table:Xs,paragraph:te(os).replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex()},Ku={...ls,html:te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",as).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ct,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:te(os).replace("hr",Ht).replace("heading",` *#{1,6} *[^
66
+ `)}function Rn({label:e,children:t}){return o.jsx(Tn,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function ki(){const{plugins:e,pluginSlotRegistry:t}=Re();return g.useMemo(()=>t??Bo(e??[]),[t,e])}function wi(e){return ki().get(e)??[]}function zt({name:e,context:t}){const n=wi(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Rn,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function vi(e){return ki().get(e)??[]}const _u=/^(https?:|data:image\/)/i;function ns(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:n,altText:r,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof n!="string"||!_u.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const ji={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},Ou=()=>Promise.resolve().then(()=>require("./LogoExtension-BVOE2HZc.cjs"));function rs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ut=rs();function Si(e){ut=e}var Ct={exec:()=>null};function te(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(ve.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Mu=/^(?:[ \t]*(?:\n|$))+/,Ru=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ht=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Lu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ss=/(?:[*+-]|\d{1,9}[.)])/,Ni=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ai=te(Ni).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Bu=te(Ni).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),os=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Du=/^[^\n]+/,is=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Fu=te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",is).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zu=te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ss).getRegex(),Pn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",as=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hu=te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",as).replace("tag",Pn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ei=te(os).replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex(),Uu=te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ei).getRegex(),ls={blockquote:Uu,code:Ru,def:Fu,fences:Pu,heading:Lu,hr:Ht,html:Hu,lheading:Ai,list:zu,newline:Mu,paragraph:Ei,table:Ct,text:Du},Xs=te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex(),Wu={...ls,lheading:Bu,table:Xs,paragraph:te(os).replace("hr",Ht).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pn).getRegex()},Ku={...ls,html:te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",as).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ct,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:te(os).replace("hr",Ht).replace("heading",` *#{1,6} *[^
67
67
  ]`).replace("lheading",Ai).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Gu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$i=/^( {2,}|\\)\n(?!\s*$)/,Ju=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ln=/[\p{P}\p{S}]/u,cs=/[\s\p{P}\p{S}]/u,Ci=/[^\s\p{P}\p{S}]/u,Zu=te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,cs).getRegex(),Ti=/(?!~)[\p{P}\p{S}]/u,Xu=/(?!~)[\s\p{P}\p{S}]/u,Yu=/(?:[^\s\p{P}\p{S}]|~)/u,Qu=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ii=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qu=te(Ii,"u").replace(/punct/g,Ln).getRegex(),ed=te(Ii,"u").replace(/punct/g,Ti).getRegex(),_i="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",td=te(_i,"gu").replace(/notPunctSpace/g,Ci).replace(/punctSpace/g,cs).replace(/punct/g,Ln).getRegex(),nd=te(_i,"gu").replace(/notPunctSpace/g,Yu).replace(/punctSpace/g,Xu).replace(/punct/g,Ti).getRegex(),rd=te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ci).replace(/punctSpace/g,cs).replace(/punct/g,Ln).getRegex(),sd=te(/\\(punct)/,"gu").replace(/punct/g,Ln).getRegex(),od=te(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),id=te(as).replace("(?:-->|$)","-->").getRegex(),ad=te("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",id).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ld=te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Oi=te(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",is).getRegex(),Mi=te(/^!?\[(ref)\](?:\[\])?/).replace("ref",is).getRegex(),cd=te("reflink|nolink(?!\\()","g").replace("reflink",Oi).replace("nolink",Mi).getRegex(),us={_backpedal:Ct,anyPunctuation:sd,autolink:od,blockSkip:Qu,br:$i,code:Vu,del:Ct,emStrongLDelim:qu,emStrongRDelimAst:td,emStrongRDelimUnd:rd,escape:Gu,link:ld,nolink:Mi,punctuation:Zu,reflink:Oi,reflinkSearch:cd,tag:ad,text:Ju,url:Ct},ud={...us,link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},Er={...us,emStrongRDelimAst:nd,emStrongLDelim:ed,url:te(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},dd={...Er,br:te($i).replace("{2,}","*").getRegex(),text:te(Er.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qt={normal:ls,gfm:Wu,pedantic:Ku},St={normal:us,gfm:Er,breaks:dd,pedantic:ud},fd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ys=e=>fd[e];function De(e,t){if(t){if(ve.escapeTest.test(e))return e.replace(ve.escapeReplace,Ys)}else if(ve.escapeTestNoEncode.test(e))return e.replace(ve.escapeReplaceNoEncode,Ys);return e}function Qs(e){try{e=encodeURI(e).replace(ve.percentDecode,"%")}catch{return null}return e}function qs(e,t){var i;const n=e.replace(ve.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),r=n.split(ve.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(ve.slashPipe,"|");return r}function Nt(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function pd(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function eo(e,t,n,r,s){const i=t.href,a=t.title||null,l=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function hd(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
68
68
  `).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
69
69
  `)}var Sn=class{constructor(e){ne(this,"options");ne(this,"rules");ne(this,"lexer");this.options=e||ut}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Nt(n,`
@@ -173,6 +173,6 @@ ${r}}`}const sh={info:{key:"kafka-go",title:"kafka-go",description:"Kafka produc
173
173
  `);r(`payload := ${u[0]}`,1);for(const d of u.slice(1))r(d,1);s(),r("data, err := json.Marshal(payload)",1),r("if err != nil {",1),r('log.Fatal("marshal:", err)',2),r("}",1),s(),r("message := kafka.Message{Value: data}",1),((l=e.kafka)==null?void 0:l.key)!==void 0&&r(`message.Key = []byte(${JSON.stringify(e.kafka.key)})`,1),s(),r("if err := writer.WriteMessages(context.Background(), message); err != nil {",1),r('log.Fatal("write:", err)',2),r("}",1)}else{const u=((c=e.kafka)==null?void 0:c.groupId)??"";r("reader := kafka.NewReader(kafka.ReaderConfig{",1),r(`Brokers: []string{${a.map(d=>JSON.stringify(d)).join(", ")}},`,2),r(`Topic: ${JSON.stringify(e.channelAddress)},`,2),r(`GroupID: ${JSON.stringify(u)},`,2),r("})",1),r("defer reader.Close()",1),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const d of JSON.stringify(e.message.payload,null,2).split(`
174
174
  `))r(`// ${d}`,1);s(),r("for {",1),r("message, err := reader.ReadMessage(context.Background())",2),r("if err != nil {",2),r('log.Println("read:", err)',3),r("return",3),r("}",2),r("log.Println(string(message.Value))",2),r("}",1)}return r("}"),i()}},oh={info:{key:"ws",title:"ws",description:"WebSocket client for Node.js — chosen over the browser-native WebSocket API because it supports custom handshake headers",link:"https://github.com/websockets/ws",extname:".js",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new Fe({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const l of e.placeholders)r(`// - ${l}`);s()}r("import WebSocket from 'ws';"),s();const a=Zt(e.serverUrl,e.channelAddress,e.query);if(Object.keys(e.headers).length>0){r(`const socket = new WebSocket('${a}', {`),r("headers: {",1);const l=Object.entries(e.headers);l.forEach(([c,u],d)=>{const f=d<l.length-1?",":"";r(`'${c}': '${u}'${f}`,2)}),r("},",1),r("});")}else r(`const socket = new WebSocket('${a}');`);if(s(),e.action==="send"){r("socket.on('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
175
175
  `);l[l.length-1]+="));",r(`socket.send(JSON.stringify(${l[0]}`,1);for(const c of l.slice(1))r(c,1);r("});"),s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const l of JSON.stringify(e.message.payload,null,2).split(`
176
- `))r(`// ${l}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},bt={};function Xt(e){if(bt[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);bt[e.info.key]={...e,clientsById:{...e.clientsById}}}function Le(e,t){const n=bt[e];if(!n)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(n.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);n.clientsById[t.info.key]=t}function ih(){return Object.values(bt).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function ah(e,t){const n=[];for(const r of ih()){const s=r.clients.filter(i=>Wp(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}Xt({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});Le("agent",Xp);Le("agent",Zp);Xt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});Le("javascript",oh);Le("javascript",th);Le("javascript",nh);Xt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});Le("python",qp);Le("python",eh);Xt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});Le("rust",Yp);Le("rust",Qp);Xt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});Le("go",rh);Le("go",sh);var lh=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=bt[t])==null?void 0:a.clientsById[n];if(!s){const l=Object.values(bt).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new Cp(t,n,l)}const i=Kp(this.document,e,s.info.protocol);return s.convert(i,r)}};const ch="javascript",uh="ws";function dh(e,t){return ah(e,t)}function Ma(e,t,n,r){try{return new lh(e).convert(t,n,r)}catch{return null}}function fh(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(Ma(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${ch}:${uh}`}const ph={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function Ra(e){return ph[e]??"plaintext"}const hh={c:()=>Promise.resolve().then(()=>require("./c-B4BAHWS4.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BA1RB3o9.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-IihVQN8U.cjs")),go:()=>Promise.resolve().then(()=>require("./go-By8nj0Vi.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-DFXAwvvK.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-B3HlgtFq.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-BMUCoWpx.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-CGL4kvvH.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-_vvcEGSJ.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-BAji1QIq.cjs"))};function $n(e){return e==="plaintext"||!!Me.getLanguage(e)}async function Pa(e){if($n(e))return;const t=hh[e];if(!t)return;const n=await t();Me.registerLanguage(e,n.default)}function mh({operationId:e}){const{document:t,showCodeSamples:n}=Re(),r=g.useId(),s=g.useMemo(()=>e?dh(t,e):[],[t,e]),i=g.useMemo(()=>fh(t,e,s),[t,e,s]),[a,l]=g.useState(null),c=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[u,d]=c.split(":"),f=Ra(u),[,p]=g.useState(()=>$n(f));g.useEffect(()=>{p($n(f));let m=!1;return Pa(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Ma(t,e,u,d):null,[t,e,u,d]);return!n||!h?null:o.jsxs("div",{id:`operation-${e}-code-sample`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{htmlFor:r,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:r,value:c,onChange:m=>l({document:t,operationId:e,selection:m.target.value}),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:s.map(m=>o.jsx("optgroup",{label:m.title,children:m.clients.map(y=>o.jsx("option",{value:`${m.key}:${y.key}`,children:y.title},y.key))},m.key))})]}),o.jsx(Fn,{code:h,language:f})]})}const Et="reference";function La({name:e,context:t,enabled:n=!0,children:r}){const s=vi(e),[i,a]=g.useState(Et),[l,c]=g.useState(()=>new Set([Et])),u=g.useId(),d=g.useMemo(()=>new Map(s.map(x=>[x.id,x])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??Et,m=[{id:Et,name:"Reference"},...s.map(x=>({id:x.id,name:x.label}))],y=x=>{c(j=>j.has(x)?j:new Set([...j,x])),a(x)};return f?o.jsxs(o.Fragment,{children:[o.jsx(ct,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:m,current:h,onChange:y}),o.jsx(Dl,{tabs:m,current:h,idPrefix:u,renderPanel:(x,j)=>{if(!j&&!l.has(x.id))return null;if(x.id===Et)return r;const S=d.get(x.id);if(!S)return null;const v=S.Component;return o.jsx(Rn,{label:`${e}:${S.pluginName}`,children:o.jsx(v,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function gh({op:e,id:t,focusSection:n=null}){var y;const{document:r}=Mo(),s=g.useId(),i=e.messages??[],a=e.tags??[],l=e.bindings,c=e.traits,u=e.reply,d=e.externalDocs,f=e.security,p=l??(Array.isArray(c)?(y=c.find(x=>x.bindings))==null?void 0:y.bindings:void 0),h=e.action===gn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((x,j)=>o.jsx(Ca,{message:x,messageId:x.name,i:j},j))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(La,{name:"asyncapi.operation.tab",context:{document:r,operationId:t??""},enabled:!!t,children:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(d==null?void 0:d.url)&&Ve(d.url)&&o.jsxs("a",{href:d.url,target:"_blank",rel:"noreferrer",title:d.description||d.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Mn,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(Pe,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(mh,{operationId:t}),t&&o.jsx(zt,{name:"asyncapi.operation.reference.supplementary",context:{document:r,operationId:t}}),f&&f.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsx(Vt,{ariaLabelledBy:s,forceExpanded:n==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(ws,{securities:f})})})]}),p&&Object.entries(p).map(([x,j])=>j?o.jsxs("div",{id:`operation-${t}-bindings-${x}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Aa,{protocol:x,bindings:j,focused:n===`binding:${x}`})]},x):null),u?o.jsx(Np,{requestMessages:i,reply:u,isSend:h,operationId:t}):i.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[o.jsx("span",{className:"font-bold",children:t})," ",h?"accepts":"expects",i.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),m]}),a.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((x,j)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:x.name},j))})]})]})})})}const xh=g.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function Ba({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,layout:s}){const i=m=>n==null?void 0:n(m),a=Re(),l=a.specType==="asyncapi"?a.document:null,c=a.showTryIt===!0;if(!Object.keys(e).length)return null;const u=t?e[t]:null,d=Object.keys(e).map(m=>{var B;const y=e[m],x=y.channel,j=x==null?void 0:x.address,S=x==null?void 0:x.parameters,v=((B=y.action)==null?void 0:B.toUpperCase())??"",C=t===m;return o.jsxs("tr",{id:`operation-${m}`,onClick:()=>i(m),role:"button",tabIndex:0,"aria-label":`${v||"Operation"} ${j??m}`,"aria-current":C?"true":void 0,onKeyDown:D=>{D.key!=="Enter"&&D.key!==" "||(D.preventDefault(),i(m))},className:`cursor-pointer hover:bg-neutral-50 ${C?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:j&&o.jsx(Ye,{address:j,parameters:S,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(Qe,{method:y.action,className:"w-24"})})]},m)}),f=u?u.channel:null,p=u&&(f!=null&&f.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Qe,{method:u.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Ye,{address:f.address,parameters:f.parameters,truncate:!0,peek:!0})})]}):t??"Operation",h=o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:d})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{title:jl,content:h,stickySideContent:!1,layout:s})}),o.jsx($a,{isOpen:!!u,side:"right",onClose:()=>i(null),title:p,headerActions:c&&u&&t&&l&&o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Rn,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(xh,{document:l,operationId:t})})}),children:u&&o.jsx(gh,{op:u,id:t,focusSection:r},t)})]})}function vs({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=ke(),i=qr(),a=g.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Rt(u,s)]),[e,s,i]),l=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([c,u])=>{const d=u.schema,f=pi(u.schemaFormat),p=d.properties?Object.keys(d.properties).length:0;return o.jsxs("article",{id:`schema-${c}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===c?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:c}),u.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:u.description})]}),o.jsx("span",{className:"inline-flex rounded-full bg-neutral-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-foreground-secondary",children:d.type??"unknown"})]}),(d.format||f||p>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[d.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",d.format]}),f&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:u.schemaFormat,children:f}),p>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[p," properties"]})]}),u.conversionError&&o.jsxs("p",{className:"mt-4 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5",children:["Could not convert"," ",hi(u.schemaFormat)??"the"," schema — showing raw definition. ",u.conversionError]}),u.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),u.pendingConversion?null:u.conversionError&&typeof u.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(sa,{schema:u.originalSchema})}):o.jsx(ks,{schema:d,rootName:c,className:"mt-4",focusTokens:c===t?(n==null?void 0:n.tokens)??null:null,focusId:c===t?(n==null?void 0:n.id)??null:null})]},c)})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No schemas defined in this document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{content:l,stickySideContent:!1,layout:r})})}const bh=e=>e==="operations"||e==="messages"||e==="schemas",yh=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function kh({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var w,k,T,F;const i=t.show??{},[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&ta(e.info),p=(n==null?void 0:n.some(G=>!!G.slots["asyncapi.document.topbar"]))??!1,h=d||f||p,m=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:_n}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:Zo}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Wr}]:[]],{query:y,setQuery:x,results:j}=su(e,{threshold:.3,limit:20}),{effectiveTab:S,focusTab:v,navActiveSection:C,selected:B,setSelectedKey:D,selectedNavItem:P,handleSearchSelect:N,handleNavItemSelect:b,handleNavServerSelect:A,handleContentTabChange:E,focusSection:R,schemaFocusTarget:_}=di({tabs:m,defaultTab:"operations",isTabKey:bh,sections:[{id:"operations",visible:i.operations!==!1},{id:"messages",visible:i.messages!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:y,initialLocation:r,onLocationChange:s,getTargetId:yh}),H=e.servers?Object.keys(e.servers):[],U=S==="operations"?o.jsx(Ba,{operations:e.operations??{},selectedKey:B.operations,onSelectKey:G=>D("operations",G),focusSection:R}):S==="messages"?o.jsx(ya,{messages:((w=e.components)==null?void 0:w.messages)??{},selectedKey:B.messages,focusSection:R}):S==="schemas"?o.jsx(vs,{schemas:((k=e.components)==null?void 0:k.schemas)??{},selectedKey:B.schemas,focusTarget:_}):null;return o.jsx(In,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Uo,{logo:f?o.jsx(xs,{source:e.info}):void 0,forceVisible:a||c,children:[o.jsx(zt,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(Xo,{query:y,onQueryChange:x,results:j,onSelectResult:N,onOpenChange:l}),i.copyMarkdown!==!1&&o.jsx(ei,{serialize:G=>es(e,G),onOpenChange:u})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(ra,{...e.info,showLogo:!1})}),i.servers!==!1&&H.length>0&&o.jsx("div",{id:`server-${B.servers??H[0]}`,children:o.jsx(Ea,{servers:e.servers,selectedServer:B.servers,onSelectServer:G=>D("servers",G),focusSection:R})}),o.jsx(Ho,{tabs:m,current:S,onChange:E}),S&&o.jsx("div",{id:`panel-${S}`,role:"tabpanel","aria-labelledby":`tab-${S}`,children:U}),i.sidebar!==!1&&o.jsx(sc,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(T=e.components)==null?void 0:T.messages:void 0,schemas:i.schemas!==!1?(F=e.components)==null?void 0:F.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:C,onTabChange:v,onItemSelect:b,onSelectServer:A,selectedItem:P})]})})}const js=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(wh,{...e})}),wh=e=>{const t=e.asyncapi,n=g.useMemo(()=>yt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Fr(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(kh,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Hn({document:e,config:t=ot,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:l,setPortalHost:c,setRootElement:u}=Do("openapi",e,t,n);return o.jsx(kt.Provider,{value:i,children:o.jsxs("div",{ref:u,"data-theme":l,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:c,className:"openapi-portal-root"}),s]})})}function vh(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:Ne([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,i)=>{const a=`server-${i}`;t.push({id:a,targetId:a,type:"server",tab:"servers",key:a,name:s.description??s.url??a,path:`servers[${i}]`,location:`Servers > ${s.url??a}`,subtitle:s.url,text:Ne([s.url,s.description,s.variables])})});const n=(s,{tab:i,type:a,idPrefix:l,docKey:c,sectionLabel:u})=>{for(const d of Object.keys(s)){const f=s[d];if(f)for(const p of On){const h=f[p];if(!h)continue;const m=`${p} ${d}`,y=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${l}-${m}`,targetId:`${l}-${m}-detail`,type:a,tab:i,key:m,name:y,path:`${c}.${d}.${p}`,location:`${u} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:Ne([p,d,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))ti(t,i,s,s);return t}function jh(e,t={}){return ci(e,vh,t)}function Da({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(na,{title:i,description:a,license:l,contact:c,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function Sh({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(va,{address:e,variables:n}),t&&o.jsx(Pe,{children:t})]})}const or=e=>`server-${e}`,ir=e=>Number(e.slice(7));function Fa({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,h)=>p.url||or(h)),[i,a]=g.useState(void 0),l=p=>!!p&&ir(p)>=0&&ir(p)<e.length,c=l(t)?t:l(i)?i:or(0),u=e[ir(c)],d=p=>{a(p),n==null||n(p)},f=u?o.jsx(Sh,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{title:Po,content:f,sideContent:o.jsx(ka,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?or(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}const $o=320;function Nh({parameters:e}){const{portalHost:t}=ke(),[n,r]=g.useState(!1),[s,i]=g.useState({top:0,left:0,placement:"bottom"}),a=g.useRef(null),l=g.useRef(null),c=g.useId();return g.useEffect(()=>{if(!n)return;const u=a.current;if(!u)return;const d=()=>i(dr(u,{align:"end",width:$o}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),g.useEffect(()=>{if(!n)return;const u=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),r(!1),(p=a.current)==null||p.focus())},d=f=>{var h;const p=((h=f.composedPath)==null?void 0:h.call(f))??[];p.includes(l.current)||p.includes(a.current)||r(!1)};return document.addEventListener("keydown",u,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",u,!0),document.removeEventListener("pointerdown",d,!0)}},[n]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>r(u=>!u),"aria-expanded":n,"aria-haspopup":"dialog","aria-controls":n?c:void 0,"aria-label":`${e.length} query ${e.length===1?"parameter":"parameters"}`,className:`shrink-0 inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-mono text-[11px] leading-4 transition-colors ${n?"border-neutral-300 bg-neutral-200/70 text-foreground-secondary":"border-border bg-neutral-100 text-foreground-muted hover:border-neutral-300 hover:text-foreground-secondary"}`,children:[o.jsxs("span",{"aria-hidden":!0,children:["?",e.length]}),o.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 10 10",className:`h-2 w-2 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M1.5 3.5L5 7l3.5-3.5"})})]}),n&&t&&gt.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:$o},className:`fixed z-[60] max-h-80 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg ${s.placement==="top"?"-translate-y-full":""}`,children:[o.jsx("p",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-[10px] font-medium uppercase tracking-wider text-foreground-muted",children:"Query parameters"}),o.jsx("ul",{className:"divide-y divide-border",children:e.map(u=>o.jsxs("li",{className:"px-3 py-2",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"font-mono text-xs font-semibold text-foreground",children:u.name}),u.type&&o.jsx("span",{className:"text-[10px] text-foreground-muted",children:u.type}),u.required&&o.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium uppercase tracking-wide text-red-600",children:"Required"})]}),u.description&&o.jsx("p",{className:"mt-1 text-xs leading-snug text-foreground-secondary",children:u.description}),u.default&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Default:"})," ",o.jsx("code",{children:u.default})]}),u.enum&&u.enum.length>0&&o.jsx("p",{className:"mt-1 text-[11px] text-foreground-muted",children:Wo(u.enum)}),u.examples&&u.examples.length>0&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Examples:"})," ",u.examples.join(", ")]})]},u.name))})]}),t)]})}function Ah({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 11v5"}),o.jsx("path",{d:"M12 8h.01"})]})}function za(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function Eh(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${za(`$${n}`)}}`)}function $h(e){return e.operationId??e.operationRef??null}const Ch=e=>e.trim().replace(/[.:;]+$/,""),ar=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function Th({links:e,onFollowOperation:t,isOperationKnown:n}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var d;const i=$h(s),a=Object.entries(s.parameters??{}),l=s.description?Ch(s.description):null,c=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=l??i??r;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(Ah,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[c?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):o.jsx("span",{className:"text-foreground-secondary",children:u}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([f,p],h)=>o.jsxs(g.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(ar,{children:f})," from ",o.jsx(ar,{children:za(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(ar,{children:s.server.url})]}):null,"."]})]},r)})})}function Ih(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>On.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function _h({callbacks:e,id:t,renderOperation:n,depth:r}){const s=Ih(e);return s.length===0?null:o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),o.jsx("div",{className:"space-y-2",children:s.map(({name:i,url:a,method:l,op:c,urlIndex:u})=>o.jsx(Vt,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Qe,{method:l,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:i}),o.jsx("code",{className:"font-mono text-foreground-muted truncate",children:Eh(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(n,{method:l,path:a,op:c,id:`${t}-${i}-${u}-${l}`,idPrefix:"callback",depth:r+1})})},`${i}-${u}-${l}`))})]})}const Oh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-ILzruYIb.cjs")).then(({CodeSamples:e})=>({default:e})));function Mh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Ha({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?o.jsx(o.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):o.jsxs(o.Fragment,{children:[e," (",o.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>o.jsx("option",{value:s,children:s},s))}),")"]})}function Ua(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function Rh(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function Ph({responses:e,onFollowOperation:t,isOperationKnown:n}){var D,P;const r=Object.keys(e),[s,i]=g.useState(r[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=g.useState(l[0]),d=c?(D=a==null?void 0:a.content)==null?void 0:D[c]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,m]=g.useState("body"),y=l.length>0&&!!d,x=Object.keys(f).length>0,j=Object.keys(p).length>0,S=[...y?[{id:"body",name:"Body"}]:[],...x?[{id:"headers",name:"Headers"}]:[]],v=S.length>1,C=S.some(N=>N.id===h)?h:(P=S[0])==null?void 0:P.id,B=S.length>0;return g.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),m("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(N=>o.jsx("button",{role:"tab","aria-selected":s===N,onClick:()=>i(N),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${Rh(N)} ${s===N?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:N},N))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),B?o.jsxs(o.Fragment,{children:[v&&o.jsx(ct,{tabs:S,current:C,onChange:N=>m(N)}),o.jsx("div",{className:v?"mt-4":void 0,children:C==="headers"?o.jsx(lt,{schema:Bh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(lt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Ha,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:Ua(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&o.jsx(Th,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function Wa(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const Lh=e=>Wa(e),Bh=e=>Wa(Object.entries(e).map(([t,n])=>({name:t,...n})));function Dh({parameters:e}){var l;const t=Al.filter(({location:c})=>e.some(u=>u.in===c)),[n,r]=g.useState(((l=t[0])==null?void 0:l.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===n)?n:t[0].location,i=t.find(c=>c.location===s),a=Lh(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(ct,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(lt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function Fh({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[l,c]=g.useState(s?"parameters":"body"),[u,d]=g.useState(i[0]),f=u?n[u]:void 0;if(!s&&!a)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[a?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[o.jsx("span",{className:"font-bold",children:e})," expects the following ",zh(p),":"]}),s&&a&&o.jsx(ct,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:l,onChange:h=>c(h)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(l==="parameters"||!a)&&s&&o.jsx(Dh,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(lt,{schema:f.schema??{},label:o.jsx(Ha,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:r,example:Ua(f)})]})]})}function zh(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function Hh({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:i,id:a,depth:l,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:d}){const f=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!i&&Object.keys(i).length>0&&l<Uh,m=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[y,x]=g.useState(m[0]??"request");if(m.length===0)return null;const j=m.includes(y)?y:m[0];return o.jsxs("div",{className:c?"flex-1 flex flex-col min-h-0":void 0,children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(S=>o.jsx("button",{role:"tab","aria-selected":j===S,onClick:()=>x(S),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===S?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:S},S))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${c?"flex-1 -mb-4":""}`,children:[j==="request"&&o.jsx(Fh,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&o.jsx(Ph,{responses:s,onFollowOperation:u,isOperationKnown:d}),j==="callbacks"&&i&&o.jsx(_h,{callbacks:i,id:a,depth:l,renderOperation:Ka})]})]})}const Uh=1;function Ka({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var v,C,B,D;const{document:d}=Ro(),f=(n.parameters??[]).filter(P=>P.in!=="query"&&P.in!=="path"),p=n.security??i??[],h=n.responses??{},m=((v=n.requestBody)==null?void 0:v.content)??{},y=n.operationId?Mh(n.operationId):`${e.toUpperCase()} ${t}`,x=new Map;for(const P of p)for(const[N,b]of Object.entries(P)){if(b.length===0)continue;const A=x.get(N)??[];x.set(N,Array.from(new Set([...A,...b])))}const j=Array.from(new Set(p.flatMap(P=>Object.keys(P)))).map(P=>{const N=a==null?void 0:a[P];if(!N)return null;const b=x.get(P);return b?{...N,requiredScopes:b}:N}).filter(P=>!!P),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(La,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:S,children:o.jsxs(o.Fragment,{children:[(n.deprecated||((C=n.externalDocs)==null?void 0:C.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((B=n.externalDocs)==null?void 0:B.url)&&Ve(n.externalDocs.url)&&o.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Mn,{className:"w-3.5 h-3.5"})]})]}),n.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&o.jsx(Pe,{children:n.description}),o.jsx(g.Suspense,{fallback:null,children:o.jsx(Oh,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(zt,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${r}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),j.length>0&&o.jsx(Vt,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(wa,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:j.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(ws,{securities:j})})})]}),o.jsx(Hh,{label:y,parameters:f,requestBodyContent:m,requestBodyDescription:(D=n.requestBody)==null?void 0:D.description,responses:h,callbacks:n.callbacks,id:r,depth:u,fillHeight:S,onFollowOperation:l,isOperationKnown:c})]})})})}const Wh=g.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function Ga(e){var n;const t=e.schema;return{description:e.description,type:t==null?void 0:t.type,default:(t==null?void 0:t.default)!==void 0?String(t.default):void 0,enum:(n=t==null?void 0:t.enum)==null?void 0:n.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function Co(e){const t={};for(const n of e)t[n.name]=Ga(n);return t}function Kh(e){return e.filter(t=>t.in==="query").map(t=>({...Ga(t),name:t.name,required:t.required}))}function Cn({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var b;const c=A=>s==null?void 0:s(A),u=Re(),d=u.specType==="openapi"?u.document:null,f=u.showTryIt===!0,p=g.useMemo(()=>It(e),[e]),h=g.useMemo(()=>{var E,R,_;const A=new Map;for(const H of p){const U=((_=(R=(E=e[H.path])==null?void 0:E[H.method])==null?void 0:R.tags)==null?void 0:_[0])||"Other",w=A.get(U)??[];w.push(H),A.set(U,w)}return Array.from(A,([H,U])=>({label:H,items:U}))},[p,e]),[m,y]=g.useState(()=>new Set),x=m.size===0;g.useEffect(()=>{if(!r)return;const A=h.find(({items:E})=>E.some(({key:R})=>R===r));A&&y(E=>{if(!E.has(A.label))return E;const R=new Set(E);return R.delete(A.label),R})},[h,r]);const j=g.useMemo(()=>{var E,R;const A=new Map;for(const{key:_,method:H,path:U}of p){const w=(R=(E=e[U])==null?void 0:E[H])==null?void 0:R.operationId;w&&A.set(w,_)}return A},[p,e]);if(p.length===0)return null;const S=r?p.find(A=>A.key===r):null,v=S?(b=e[S.path])==null?void 0:b[S.method]:null,C=({key:A,method:E,path:R},_)=>{var w;const H=r===A,U=Rs(e[R],(w=e[R])==null?void 0:w[E]);return o.jsxs("tr",{id:`${a}-${A}`,onClick:()=>c(A),role:"button",tabIndex:_?0:-1,"aria-hidden":!_,"aria-label":`${E.toUpperCase()} ${R}`,"aria-current":H?"true":void 0,onKeyDown:k=>{k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),c(A))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${_?`cursor-pointer opacity-100 visible ${H?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[o.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${_?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${_?"max-h-12":"max-h-0"}`,children:o.jsx(Ye,{address:R,parameters:Co(U),truncate:!0,className:"text-xs"})})}),o.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${_?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${_?"max-h-12":"max-h-0"}`,children:o.jsx(Qe,{method:E,className:"w-20"})})})]},A)},B=h.map(({label:A,items:E},R)=>{const _=!m.has(A),H=`${a}-group-${R}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${A} endpoints (${E.length})`,"aria-expanded":_,"aria-controls":H,onClick:()=>y(U=>{const w=new Set(U);return _?w.add(A):w.delete(A),w}),className:"group/header flex w-full items-center gap-3 px-6 py-3.5 text-left hover:bg-neutral-100/80 transition-colors",children:[o.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-foreground-muted shadow-sm transition-colors group-hover/header:border-neutral-300 group-hover/header:text-foreground-secondary",children:_?o.jsx(wt,{className:"h-2.5 w-2.5"}):o.jsx(ja,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:E.length})]})})})}),o.jsx("tbody",{id:H,"aria-hidden":!_,className:`bg-surface ${_?"divide-y divide-border":""}`,children:E.map(U=>C(U,_))})]},A)}),D=Rs(S?e[S.path]:void 0,v),P=S?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Qe,{method:S.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Ye,{address:S.path,parameters:Co(D),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(Nh,{parameters:Kh(D)})]}):r,N=o.jsxs("div",{children:[o.jsx("div",{className:"mb-3 flex justify-end",children:o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[o.jsx("input",{type:"checkbox",checked:x,onChange:A=>y(A.target.checked?new Set:new Set(h.map(({label:E})=>E))),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),y(x?new Set(h.map(({label:E})=>E)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),o.jsx("span",{children:"Expand all"})]})}),o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),B]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{content:N,stickySideContent:!1,layout:l})}),o.jsx($a,{isOpen:!!S,side:"right",onClose:()=>c(null),title:P,headerActions:f&&S&&d&&o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Rn,{label:"built-in:openapi.operation.tryIt",children:o.jsx(Wh,{document:d,method:S.method,path:S.path})})}),children:S&&v&&o.jsx(Ka,{method:S.method,path:S.path,op:{...v,parameters:D},id:S.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:A=>j.has(A),onFollowOperation:A=>{const E=j.get(A);E&&c(E)}},S.key)})]})}const Gh=e=>e==="endpoints"||e==="webhooks"||e==="schemas",Vh=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function Jh({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var k,T,F,G;const i=t.show??{},[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&ta(e.info),p=(n==null?void 0:n.some(J=>!!J.slots["openapi.document.topbar"]))??!1,h=d||f||p,m=e.webhooks??{},y=Object.keys(m).length>0,x=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:_n}]:[],...y&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Kr}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Wr}]:[]],{query:j,setQuery:S,results:v}=jh(e,{threshold:.3,limit:20}),{effectiveTab:C,focusTab:B,navActiveSection:D,selected:P,setSelectedKey:N,selectedNavItem:b,handleSearchSelect:A,handleNavItemSelect:E,handleNavServerSelect:R,handleContentTabChange:_,schemaFocusTarget:H}=di({tabs:x,defaultTab:"endpoints",isTabKey:Gh,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:y&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:j,initialLocation:r,onLocationChange:s,getTargetId:Vh}),U=(e.servers??[]).map(J=>J.url),w=C==="endpoints"?o.jsx(Cn,{paths:e.paths??{},security:e.security,securitySchemes:(k=e.components)==null?void 0:k.securitySchemes,selectedKey:P.endpoints,onSelectKey:J=>N("endpoints",J)}):C==="webhooks"?o.jsx(Cn,{paths:m,security:e.security,securitySchemes:(T=e.components)==null?void 0:T.securitySchemes,selectedKey:P.webhooks,onSelectKey:J=>N("webhooks",J),columnLabel:"Webhook",idPrefix:"webhook"}):C==="schemas"?o.jsx(vs,{schemas:((F=e.components)==null?void 0:F.schemas)??{},selectedKey:P.schemas,focusTarget:H}):null;return o.jsx(Hn,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Uo,{logo:f?o.jsx(xs,{source:e.info}):void 0,forceVisible:a||c,children:[o.jsx(zt,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(Xo,{query:j,onQueryChange:S,results:v,onSelectResult:A,onOpenChange:l}),i.copyMarkdown!==!1&&o.jsx(ei,{serialize:J=>ts(e,J),onOpenChange:u})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Da,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&U.length>0&&o.jsx("div",{id:P.servers??"server-0",children:o.jsx(Fa,{servers:e.servers,selectedServer:P.servers,onSelectServer:J=>N("servers",J)})}),o.jsx(Ho,{tabs:x,current:C,onChange:_}),C&&o.jsx("div",{id:`panel-${C}`,role:"tabpanel","aria-labelledby":`tab-${C}`,children:w}),i.sidebar!==!1&&o.jsx(lc,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:y&&i.webhooks!==!1?m:void 0,schemas:i.schemas!==!1?(G=e.components)==null?void 0:G.schemas:void 0,servers:i.servers!==!1?U:void 0,hasInfo:i.info!==!1,activeTab:D,onTabChange:B,onItemSelect:E,onSelectServer:R,selectedItem:b})]})})}const Ss=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Zh,{...e})}),Zh=e=>{const t=e.openapi,n=g.useMemo(()=>yt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Fr(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(Jh,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Va(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,n)=>e.toMarkdown(t,n)}}const mt=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
176
+ `))r(`// ${l}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},bt={};function Xt(e){if(bt[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);bt[e.info.key]={...e,clientsById:{...e.clientsById}}}function Le(e,t){const n=bt[e];if(!n)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(n.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);n.clientsById[t.info.key]=t}function ih(){return Object.values(bt).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function ah(e,t){const n=[];for(const r of ih()){const s=r.clients.filter(i=>Wp(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}Xt({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});Le("agent",Xp);Le("agent",Zp);Xt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});Le("javascript",oh);Le("javascript",th);Le("javascript",nh);Xt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});Le("python",qp);Le("python",eh);Xt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});Le("rust",Yp);Le("rust",Qp);Xt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});Le("go",rh);Le("go",sh);var lh=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=bt[t])==null?void 0:a.clientsById[n];if(!s){const l=Object.values(bt).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new Cp(t,n,l)}const i=Kp(this.document,e,s.info.protocol);return s.convert(i,r)}};const ch="javascript",uh="ws";function dh(e,t){return ah(e,t)}function Ma(e,t,n,r){try{return new lh(e).convert(t,n,r)}catch{return null}}function fh(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(Ma(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${ch}:${uh}`}const ph={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function Ra(e){return ph[e]??"plaintext"}const hh={c:()=>Promise.resolve().then(()=>require("./c-B4BAHWS4.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BA1RB3o9.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-IihVQN8U.cjs")),go:()=>Promise.resolve().then(()=>require("./go-By8nj0Vi.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-DFXAwvvK.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-B3HlgtFq.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-BMUCoWpx.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-CGL4kvvH.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-_vvcEGSJ.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-BAji1QIq.cjs"))};function $n(e){return e==="plaintext"||!!Me.getLanguage(e)}async function Pa(e){if($n(e))return;const t=hh[e];if(!t)return;const n=await t();Me.registerLanguage(e,n.default)}function mh({operationId:e}){const{document:t,showCodeSamples:n}=Re(),r=g.useId(),s=g.useMemo(()=>e?dh(t,e):[],[t,e]),i=g.useMemo(()=>fh(t,e,s),[t,e,s]),[a,l]=g.useState(null),c=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[u,d]=c.split(":"),f=Ra(u),[,p]=g.useState(()=>$n(f));g.useEffect(()=>{p($n(f));let m=!1;return Pa(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Ma(t,e,u,d):null,[t,e,u,d]);return!n||!h?null:o.jsxs("div",{id:`operation-${e}-code-sample`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{htmlFor:r,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:r,value:c,onChange:m=>l({document:t,operationId:e,selection:m.target.value}),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:s.map(m=>o.jsx("optgroup",{label:m.title,children:m.clients.map(y=>o.jsx("option",{value:`${m.key}:${y.key}`,children:y.title},y.key))},m.key))})]}),o.jsx(Fn,{code:h,language:f})]})}const Et="reference";function La({name:e,context:t,enabled:n=!0,children:r}){const s=vi(e),[i,a]=g.useState(Et),[l,c]=g.useState(()=>new Set([Et])),u=g.useId(),d=g.useMemo(()=>new Map(s.map(x=>[x.id,x])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??Et,m=[{id:Et,name:"Reference"},...s.map(x=>({id:x.id,name:x.label}))],y=x=>{c(j=>j.has(x)?j:new Set([...j,x])),a(x)};return f?o.jsxs(o.Fragment,{children:[o.jsx(ct,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:m,current:h,onChange:y}),o.jsx(Dl,{tabs:m,current:h,idPrefix:u,renderPanel:(x,j)=>{if(!j&&!l.has(x.id))return null;if(x.id===Et)return r;const S=d.get(x.id);if(!S)return null;const v=S.Component;return o.jsx(Rn,{label:`${e}:${S.pluginName}`,children:o.jsx(v,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function gh({op:e,id:t,focusSection:n=null}){var y;const{document:r}=Mo(),s=g.useId(),i=e.messages??[],a=e.tags??[],l=e.bindings,c=e.traits,u=e.reply,d=e.externalDocs,f=e.security,p=l??(Array.isArray(c)?(y=c.find(x=>x.bindings))==null?void 0:y.bindings:void 0),h=e.action===gn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((x,j)=>o.jsx(Ca,{message:x,messageId:x.name,i:j},j))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(La,{name:"asyncapi.operation.tab",context:{document:r,operationId:t??""},enabled:!!t,children:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(d==null?void 0:d.url)&&Ve(d.url)&&o.jsxs("a",{href:d.url,target:"_blank",rel:"noreferrer",title:d.description||d.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Mn,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(Pe,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(mh,{operationId:t}),t&&o.jsx(zt,{name:"asyncapi.operation.reference.supplementary",context:{document:r,operationId:t}}),f&&f.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsx(Vt,{ariaLabelledBy:s,forceExpanded:n==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(ws,{securities:f})})})]}),p&&Object.entries(p).map(([x,j])=>j?o.jsxs("div",{id:`operation-${t}-bindings-${x}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Aa,{protocol:x,bindings:j,focused:n===`binding:${x}`})]},x):null),u?o.jsx(Np,{requestMessages:i,reply:u,isSend:h,operationId:t}):i.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[o.jsx("span",{className:"font-bold",children:t})," ",h?"accepts":"expects",i.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),m]}),a.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((x,j)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:x.name},j))})]})]})})})}const xh=g.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function Ba({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,layout:s}){const i=m=>n==null?void 0:n(m),a=Re(),l=a.specType==="asyncapi"?a.document:null,c=a.showTryIt===!0;if(!Object.keys(e).length)return null;const u=t?e[t]:null,d=Object.keys(e).map(m=>{var B;const y=e[m],x=y.channel,j=x==null?void 0:x.address,S=x==null?void 0:x.parameters,v=((B=y.action)==null?void 0:B.toUpperCase())??"",C=t===m;return o.jsxs("tr",{id:`operation-${m}`,onClick:()=>i(m),role:"button",tabIndex:0,"aria-label":`${v||"Operation"} ${j??m}`,"aria-current":C?"true":void 0,onKeyDown:D=>{D.key!=="Enter"&&D.key!==" "||(D.preventDefault(),i(m))},className:`cursor-pointer hover:bg-neutral-50 ${C?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:j&&o.jsx(Ye,{address:j,parameters:S,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(Qe,{method:y.action,className:"w-24"})})]},m)}),f=u?u.channel:null,p=u&&(f!=null&&f.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Qe,{method:u.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Ye,{address:f.address,parameters:f.parameters,truncate:!0,peek:!0})})]}):t??"Operation",h=o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:d})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{title:jl,content:h,stickySideContent:!1,layout:s})}),o.jsx($a,{isOpen:!!u,side:"right",onClose:()=>i(null),title:p,headerActions:c&&u&&t&&l&&o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Rn,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(xh,{document:l,operationId:t})})}),children:u&&o.jsx(gh,{op:u,id:t,focusSection:r},t)})]})}function vs({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=ke(),i=qr(),a=g.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Rt(u,s)]),[e,s,i]),l=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([c,u])=>{const d=u.schema,f=pi(u.schemaFormat),p=d.properties?Object.keys(d.properties).length:0;return o.jsxs("article",{id:`schema-${c}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===c?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:c}),u.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:u.description})]}),o.jsx("span",{className:"inline-flex rounded-full bg-neutral-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-foreground-secondary",children:d.type??"unknown"})]}),(d.format||f||p>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[d.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",d.format]}),f&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:u.schemaFormat,children:f}),p>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[p," properties"]})]}),u.conversionError&&o.jsxs("p",{className:"mt-4 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5",children:["Could not convert"," ",hi(u.schemaFormat)??"the"," schema — showing raw definition. ",u.conversionError]}),u.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),u.pendingConversion?null:u.conversionError&&typeof u.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(sa,{schema:u.originalSchema})}):o.jsx(ks,{schema:d,rootName:c,className:"mt-4",focusTokens:c===t?(n==null?void 0:n.tokens)??null:null,focusId:c===t?(n==null?void 0:n.id)??null:null})]},c)})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No schemas defined in this document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{content:l,stickySideContent:!1,layout:r})})}const bh=e=>e==="operations"||e==="messages"||e==="schemas",yh=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function kh({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var w,k,T,F;const i=t.show??{},[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&ta(e.info),p=(n==null?void 0:n.some(G=>!!G.slots["asyncapi.document.topbar"]))??!1,h=d||f||p,m=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:_n}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:Zo}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Wr}]:[]],{query:y,setQuery:x,results:j}=su(e,{threshold:.3,limit:20}),{effectiveTab:S,focusTab:v,navActiveSection:C,selected:B,setSelectedKey:D,selectedNavItem:P,handleSearchSelect:N,handleNavItemSelect:b,handleNavServerSelect:A,handleContentTabChange:E,focusSection:R,schemaFocusTarget:_}=di({tabs:m,defaultTab:"operations",isTabKey:bh,sections:[{id:"operations",visible:i.operations!==!1},{id:"messages",visible:i.messages!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:y,initialLocation:r,onLocationChange:s,getTargetId:yh}),H=e.servers?Object.keys(e.servers):[],U=S==="operations"?o.jsx(Ba,{operations:e.operations??{},selectedKey:B.operations,onSelectKey:G=>D("operations",G),focusSection:R}):S==="messages"?o.jsx(ya,{messages:((w=e.components)==null?void 0:w.messages)??{},selectedKey:B.messages,focusSection:R}):S==="schemas"?o.jsx(vs,{schemas:((k=e.components)==null?void 0:k.schemas)??{},selectedKey:B.schemas,focusTarget:_}):null;return o.jsx(In,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Uo,{logo:f?o.jsx(xs,{source:e.info}):void 0,forceVisible:a||c,children:[o.jsx(zt,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(Xo,{query:y,onQueryChange:x,results:j,onSelectResult:N,onOpenChange:l}),i.copyMarkdown!==!1&&o.jsx(ei,{serialize:G=>es(e,G),onOpenChange:u})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(ra,{...e.info,showLogo:!1})}),i.servers!==!1&&H.length>0&&o.jsx("div",{id:`server-${B.servers??H[0]}`,children:o.jsx(Ea,{servers:e.servers,selectedServer:B.servers,onSelectServer:G=>D("servers",G),focusSection:R})}),o.jsx(Ho,{tabs:m,current:S,onChange:E}),S&&o.jsx("div",{id:`panel-${S}`,role:"tabpanel","aria-labelledby":`tab-${S}`,children:U}),i.sidebar!==!1&&o.jsx(sc,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(T=e.components)==null?void 0:T.messages:void 0,schemas:i.schemas!==!1?(F=e.components)==null?void 0:F.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:C,onTabChange:v,onItemSelect:b,onSelectServer:A,selectedItem:P})]})})}const js=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(wh,{...e})}),wh=e=>{const t=e.asyncapi,n=g.useMemo(()=>yt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Fr(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(kh,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Hn({document:e,config:t=ot,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:l,setPortalHost:c,setRootElement:u}=Do("openapi",e,t,n);return o.jsx(kt.Provider,{value:i,children:o.jsxs("div",{ref:u,"data-theme":l,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:c,className:"openapi-portal-root"}),s]})})}function vh(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:Ne([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,i)=>{const a=`server-${i}`;t.push({id:a,targetId:a,type:"server",tab:"servers",key:a,name:s.description??s.url??a,path:`servers[${i}]`,location:`Servers > ${s.url??a}`,subtitle:s.url,text:Ne([s.url,s.description,s.variables])})});const n=(s,{tab:i,type:a,idPrefix:l,docKey:c,sectionLabel:u})=>{for(const d of Object.keys(s)){const f=s[d];if(f)for(const p of On){const h=f[p];if(!h)continue;const m=`${p} ${d}`,y=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${l}-${m}`,targetId:`${l}-${m}-detail`,type:a,tab:i,key:m,name:y,path:`${c}.${d}.${p}`,location:`${u} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:Ne([p,d,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))ti(t,i,s,s);return t}function jh(e,t={}){return ci(e,vh,t)}function Da({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(na,{title:i,description:a,license:l,contact:c,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function Sh({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(va,{address:e,variables:n}),t&&o.jsx(Pe,{children:t})]})}const or=e=>`server-${e}`,ir=e=>Number(e.slice(7));function Fa({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,h)=>p.url||or(h)),[i,a]=g.useState(void 0),l=p=>!!p&&ir(p)>=0&&ir(p)<e.length,c=l(t)?t:l(i)?i:or(0),u=e[ir(c)],d=p=>{a(p),n==null||n(p)},f=u?o.jsx(Sh,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{title:Po,content:f,sideContent:o.jsx(ka,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?or(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}const $o=320;function Nh({parameters:e}){const{portalHost:t}=ke(),[n,r]=g.useState(!1),[s,i]=g.useState({top:0,left:0,placement:"bottom"}),a=g.useRef(null),l=g.useRef(null),c=g.useId();return g.useEffect(()=>{if(!n)return;const u=a.current;if(!u)return;const d=()=>i(dr(u,{align:"end",width:$o}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),g.useEffect(()=>{if(!n)return;const u=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),r(!1),(p=a.current)==null||p.focus())},d=f=>{var h;const p=((h=f.composedPath)==null?void 0:h.call(f))??[];p.includes(l.current)||p.includes(a.current)||r(!1)};return document.addEventListener("keydown",u,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",u,!0),document.removeEventListener("pointerdown",d,!0)}},[n]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>r(u=>!u),"aria-expanded":n,"aria-haspopup":"dialog","aria-controls":n?c:void 0,"aria-label":`${e.length} query ${e.length===1?"parameter":"parameters"}`,className:`shrink-0 inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-mono text-[11px] leading-4 transition-colors ${n?"border-neutral-300 bg-neutral-200/70 text-foreground-secondary":"border-border bg-neutral-100 text-foreground-muted hover:border-neutral-300 hover:text-foreground-secondary"}`,children:[o.jsxs("span",{"aria-hidden":!0,children:["?",e.length]}),o.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 10 10",className:`h-2 w-2 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M1.5 3.5L5 7l3.5-3.5"})})]}),n&&t&&gt.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:$o},className:`fixed z-[60] max-h-80 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg ${s.placement==="top"?"-translate-y-full":""}`,children:[o.jsx("p",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-[10px] font-medium uppercase tracking-wider text-foreground-muted",children:"Query parameters"}),o.jsx("ul",{className:"divide-y divide-border",children:e.map(u=>o.jsxs("li",{className:"px-3 py-2",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"font-mono text-xs font-semibold text-foreground",children:u.name}),u.type&&o.jsx("span",{className:"text-[10px] text-foreground-muted",children:u.type}),u.required&&o.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium uppercase tracking-wide text-red-600",children:"Required"})]}),u.description&&o.jsx("p",{className:"mt-1 text-xs leading-snug text-foreground-secondary",children:u.description}),u.default&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Default:"})," ",o.jsx("code",{children:u.default})]}),u.enum&&u.enum.length>0&&o.jsx("p",{className:"mt-1 text-[11px] text-foreground-muted",children:Wo(u.enum)}),u.examples&&u.examples.length>0&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Examples:"})," ",u.examples.join(", ")]})]},u.name))})]}),t)]})}function Ah({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 11v5"}),o.jsx("path",{d:"M12 8h.01"})]})}function za(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function Eh(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${za(`$${n}`)}}`)}function $h(e){return e.operationId??e.operationRef??null}const Ch=e=>e.trim().replace(/[.:;]+$/,""),ar=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function Th({links:e,onFollowOperation:t,isOperationKnown:n}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var d;const i=$h(s),a=Object.entries(s.parameters??{}),l=s.description?Ch(s.description):null,c=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=l??i??r;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(Ah,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[c?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):o.jsx("span",{className:"text-foreground-secondary",children:u}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([f,p],h)=>o.jsxs(g.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(ar,{children:f})," from ",o.jsx(ar,{children:za(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(ar,{children:s.server.url})]}):null,"."]})]},r)})})}function Ih(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>On.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function _h({callbacks:e,id:t,renderOperation:n,depth:r}){const s=Ih(e);return s.length===0?null:o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),o.jsx("div",{className:"space-y-2",children:s.map(({name:i,url:a,method:l,op:c,urlIndex:u})=>o.jsx(Vt,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Qe,{method:l,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:i}),o.jsx("code",{className:"font-mono text-foreground-muted truncate",children:Eh(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(n,{method:l,path:a,op:c,id:`${t}-${i}-${u}-${l}`,idPrefix:"callback",depth:r+1})})},`${i}-${u}-${l}`))})]})}const Oh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-C5Tl3k83.cjs")).then(({CodeSamples:e})=>({default:e})));function Mh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Ha({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?o.jsx(o.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):o.jsxs(o.Fragment,{children:[e," (",o.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>o.jsx("option",{value:s,children:s},s))}),")"]})}function Ua(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function Rh(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function Ph({responses:e,onFollowOperation:t,isOperationKnown:n}){var D,P;const r=Object.keys(e),[s,i]=g.useState(r[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=g.useState(l[0]),d=c?(D=a==null?void 0:a.content)==null?void 0:D[c]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,m]=g.useState("body"),y=l.length>0&&!!d,x=Object.keys(f).length>0,j=Object.keys(p).length>0,S=[...y?[{id:"body",name:"Body"}]:[],...x?[{id:"headers",name:"Headers"}]:[]],v=S.length>1,C=S.some(N=>N.id===h)?h:(P=S[0])==null?void 0:P.id,B=S.length>0;return g.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),m("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(N=>o.jsx("button",{role:"tab","aria-selected":s===N,onClick:()=>i(N),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${Rh(N)} ${s===N?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:N},N))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),B?o.jsxs(o.Fragment,{children:[v&&o.jsx(ct,{tabs:S,current:C,onChange:N=>m(N)}),o.jsx("div",{className:v?"mt-4":void 0,children:C==="headers"?o.jsx(lt,{schema:Bh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(lt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Ha,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:Ua(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&o.jsx(Th,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function Wa(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const Lh=e=>Wa(e),Bh=e=>Wa(Object.entries(e).map(([t,n])=>({name:t,...n})));function Dh({parameters:e}){var l;const t=Al.filter(({location:c})=>e.some(u=>u.in===c)),[n,r]=g.useState(((l=t[0])==null?void 0:l.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===n)?n:t[0].location,i=t.find(c=>c.location===s),a=Lh(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(ct,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(lt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function Fh({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[l,c]=g.useState(s?"parameters":"body"),[u,d]=g.useState(i[0]),f=u?n[u]:void 0;if(!s&&!a)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[a?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[o.jsx("span",{className:"font-bold",children:e})," expects the following ",zh(p),":"]}),s&&a&&o.jsx(ct,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:l,onChange:h=>c(h)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(l==="parameters"||!a)&&s&&o.jsx(Dh,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(lt,{schema:f.schema??{},label:o.jsx(Ha,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:r,example:Ua(f)})]})]})}function zh(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function Hh({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:i,id:a,depth:l,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:d}){const f=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!i&&Object.keys(i).length>0&&l<Uh,m=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[y,x]=g.useState(m[0]??"request");if(m.length===0)return null;const j=m.includes(y)?y:m[0];return o.jsxs("div",{className:c?"flex-1 flex flex-col min-h-0":void 0,children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(S=>o.jsx("button",{role:"tab","aria-selected":j===S,onClick:()=>x(S),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===S?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:S},S))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${c?"flex-1 -mb-4":""}`,children:[j==="request"&&o.jsx(Fh,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&o.jsx(Ph,{responses:s,onFollowOperation:u,isOperationKnown:d}),j==="callbacks"&&i&&o.jsx(_h,{callbacks:i,id:a,depth:l,renderOperation:Ka})]})]})}const Uh=1;function Ka({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var v,C,B,D;const{document:d}=Ro(),f=(n.parameters??[]).filter(P=>P.in!=="query"&&P.in!=="path"),p=n.security??i??[],h=n.responses??{},m=((v=n.requestBody)==null?void 0:v.content)??{},y=n.operationId?Mh(n.operationId):`${e.toUpperCase()} ${t}`,x=new Map;for(const P of p)for(const[N,b]of Object.entries(P)){if(b.length===0)continue;const A=x.get(N)??[];x.set(N,Array.from(new Set([...A,...b])))}const j=Array.from(new Set(p.flatMap(P=>Object.keys(P)))).map(P=>{const N=a==null?void 0:a[P];if(!N)return null;const b=x.get(P);return b?{...N,requiredScopes:b}:N}).filter(P=>!!P),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(La,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:S,children:o.jsxs(o.Fragment,{children:[(n.deprecated||((C=n.externalDocs)==null?void 0:C.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((B=n.externalDocs)==null?void 0:B.url)&&Ve(n.externalDocs.url)&&o.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Mn,{className:"w-3.5 h-3.5"})]})]}),n.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&o.jsx(Pe,{children:n.description}),o.jsx(g.Suspense,{fallback:null,children:o.jsx(Oh,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(zt,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${r}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),j.length>0&&o.jsx(Vt,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(wa,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:j.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(ws,{securities:j})})})]}),o.jsx(Hh,{label:y,parameters:f,requestBodyContent:m,requestBodyDescription:(D=n.requestBody)==null?void 0:D.description,responses:h,callbacks:n.callbacks,id:r,depth:u,fillHeight:S,onFollowOperation:l,isOperationKnown:c})]})})})}const Wh=g.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function Ga(e){var n;const t=e.schema;return{description:e.description,type:t==null?void 0:t.type,default:(t==null?void 0:t.default)!==void 0?String(t.default):void 0,enum:(n=t==null?void 0:t.enum)==null?void 0:n.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function Co(e){const t={};for(const n of e)t[n.name]=Ga(n);return t}function Kh(e){return e.filter(t=>t.in==="query").map(t=>({...Ga(t),name:t.name,required:t.required}))}function Cn({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var b;const c=A=>s==null?void 0:s(A),u=Re(),d=u.specType==="openapi"?u.document:null,f=u.showTryIt===!0,p=g.useMemo(()=>It(e),[e]),h=g.useMemo(()=>{var E,R,_;const A=new Map;for(const H of p){const U=((_=(R=(E=e[H.path])==null?void 0:E[H.method])==null?void 0:R.tags)==null?void 0:_[0])||"Other",w=A.get(U)??[];w.push(H),A.set(U,w)}return Array.from(A,([H,U])=>({label:H,items:U}))},[p,e]),[m,y]=g.useState(()=>new Set),x=m.size===0;g.useEffect(()=>{if(!r)return;const A=h.find(({items:E})=>E.some(({key:R})=>R===r));A&&y(E=>{if(!E.has(A.label))return E;const R=new Set(E);return R.delete(A.label),R})},[h,r]);const j=g.useMemo(()=>{var E,R;const A=new Map;for(const{key:_,method:H,path:U}of p){const w=(R=(E=e[U])==null?void 0:E[H])==null?void 0:R.operationId;w&&A.set(w,_)}return A},[p,e]);if(p.length===0)return null;const S=r?p.find(A=>A.key===r):null,v=S?(b=e[S.path])==null?void 0:b[S.method]:null,C=({key:A,method:E,path:R},_)=>{var w;const H=r===A,U=Rs(e[R],(w=e[R])==null?void 0:w[E]);return o.jsxs("tr",{id:`${a}-${A}`,onClick:()=>c(A),role:"button",tabIndex:_?0:-1,"aria-hidden":!_,"aria-label":`${E.toUpperCase()} ${R}`,"aria-current":H?"true":void 0,onKeyDown:k=>{k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),c(A))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${_?`cursor-pointer opacity-100 visible ${H?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[o.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${_?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${_?"max-h-12":"max-h-0"}`,children:o.jsx(Ye,{address:R,parameters:Co(U),truncate:!0,className:"text-xs"})})}),o.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${_?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${_?"max-h-12":"max-h-0"}`,children:o.jsx(Qe,{method:E,className:"w-20"})})})]},A)},B=h.map(({label:A,items:E},R)=>{const _=!m.has(A),H=`${a}-group-${R}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${A} endpoints (${E.length})`,"aria-expanded":_,"aria-controls":H,onClick:()=>y(U=>{const w=new Set(U);return _?w.add(A):w.delete(A),w}),className:"group/header flex w-full items-center gap-3 px-6 py-3.5 text-left hover:bg-neutral-100/80 transition-colors",children:[o.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-foreground-muted shadow-sm transition-colors group-hover/header:border-neutral-300 group-hover/header:text-foreground-secondary",children:_?o.jsx(wt,{className:"h-2.5 w-2.5"}):o.jsx(ja,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:E.length})]})})})}),o.jsx("tbody",{id:H,"aria-hidden":!_,className:`bg-surface ${_?"divide-y divide-border":""}`,children:E.map(U=>C(U,_))})]},A)}),D=Rs(S?e[S.path]:void 0,v),P=S?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Qe,{method:S.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Ye,{address:S.path,parameters:Co(D),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(Nh,{parameters:Kh(D)})]}):r,N=o.jsxs("div",{children:[o.jsx("div",{className:"mb-3 flex justify-end",children:o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[o.jsx("input",{type:"checkbox",checked:x,onChange:A=>y(A.target.checked?new Set:new Set(h.map(({label:E})=>E))),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),y(x?new Set(h.map(({label:E})=>E)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),o.jsx("span",{children:"Expand all"})]})}),o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),B]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(qe,{content:N,stickySideContent:!1,layout:l})}),o.jsx($a,{isOpen:!!S,side:"right",onClose:()=>c(null),title:P,headerActions:f&&S&&d&&o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Rn,{label:"built-in:openapi.operation.tryIt",children:o.jsx(Wh,{document:d,method:S.method,path:S.path})})}),children:S&&v&&o.jsx(Ka,{method:S.method,path:S.path,op:{...v,parameters:D},id:S.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:A=>j.has(A),onFollowOperation:A=>{const E=j.get(A);E&&c(E)}},S.key)})]})}const Gh=e=>e==="endpoints"||e==="webhooks"||e==="schemas",Vh=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function Jh({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var k,T,F,G;const i=t.show??{},[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&ta(e.info),p=(n==null?void 0:n.some(J=>!!J.slots["openapi.document.topbar"]))??!1,h=d||f||p,m=e.webhooks??{},y=Object.keys(m).length>0,x=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:_n}]:[],...y&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Kr}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Wr}]:[]],{query:j,setQuery:S,results:v}=jh(e,{threshold:.3,limit:20}),{effectiveTab:C,focusTab:B,navActiveSection:D,selected:P,setSelectedKey:N,selectedNavItem:b,handleSearchSelect:A,handleNavItemSelect:E,handleNavServerSelect:R,handleContentTabChange:_,schemaFocusTarget:H}=di({tabs:x,defaultTab:"endpoints",isTabKey:Gh,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:y&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:j,initialLocation:r,onLocationChange:s,getTargetId:Vh}),U=(e.servers??[]).map(J=>J.url),w=C==="endpoints"?o.jsx(Cn,{paths:e.paths??{},security:e.security,securitySchemes:(k=e.components)==null?void 0:k.securitySchemes,selectedKey:P.endpoints,onSelectKey:J=>N("endpoints",J)}):C==="webhooks"?o.jsx(Cn,{paths:m,security:e.security,securitySchemes:(T=e.components)==null?void 0:T.securitySchemes,selectedKey:P.webhooks,onSelectKey:J=>N("webhooks",J),columnLabel:"Webhook",idPrefix:"webhook"}):C==="schemas"?o.jsx(vs,{schemas:((F=e.components)==null?void 0:F.schemas)??{},selectedKey:P.schemas,focusTarget:H}):null;return o.jsx(Hn,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[h&&o.jsxs(Uo,{logo:f?o.jsx(xs,{source:e.info}):void 0,forceVisible:a||c,children:[o.jsx(zt,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(Xo,{query:j,onQueryChange:S,results:v,onSelectResult:A,onOpenChange:l}),i.copyMarkdown!==!1&&o.jsx(ei,{serialize:J=>ts(e,J),onOpenChange:u})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Da,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&U.length>0&&o.jsx("div",{id:P.servers??"server-0",children:o.jsx(Fa,{servers:e.servers,selectedServer:P.servers,onSelectServer:J=>N("servers",J)})}),o.jsx(Ho,{tabs:x,current:C,onChange:_}),C&&o.jsx("div",{id:`panel-${C}`,role:"tabpanel","aria-labelledby":`tab-${C}`,children:w}),i.sidebar!==!1&&o.jsx(lc,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:y&&i.webhooks!==!1?m:void 0,schemas:i.schemas!==!1?(G=e.components)==null?void 0:G.schemas:void 0,servers:i.servers!==!1?U:void 0,hasInfo:i.info!==!1,activeTab:D,onTabChange:B,onItemSelect:E,onSelectServer:R,selectedItem:b})]})})}const Ss=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Zh,{...e})}),Zh=e=>{const t=e.openapi,n=g.useMemo(()=>yt(t),[t]),r=e.kind;g.useEffect(()=>{r==="resolved"&&n!==t&&Fr(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??ot;return o.jsx(Jh,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Va(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,n)=>e.toMarkdown(t,n)}}const mt=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
177
177
  `)[0])==null?void 0:n.trim())||void 0},Xh=e=>On.some(t=>t===e),Yh=Va({name:"OpenAPI",matches:e=>typeof e.openapi=="string"||typeof e.swagger=="string",sectionTitle:"Endpoints",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return mt((t=e.info)==null?void 0:t.description)},targets:e=>It(e.paths??{}).map(({key:t,method:n,path:r})=>{var i,a;const s=(a=(i=e.paths)==null?void 0:i[r])==null?void 0:a[n];return{key:t,label:`${n.toUpperCase()} ${r}`,summary:mt(s==null?void 0:s.summary)??mt(s==null?void 0:s.description),target:{kind:"operation",document:e,method:n,path:r}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return ts(e);if(typeof t.path!="string"||!Xh(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return yi(e,t.method,t.path)}}),Qh=Va({name:"AsyncAPI",matches:e=>typeof e.asyncapi=="string",sectionTitle:"Operations",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return mt((t=e.info)==null?void 0:t.description)},targets:e=>Object.entries(e.operations??{}).map(([t,n])=>({key:t,label:n!=null&&n.action?`${n.action.toUpperCase()} ${t}`:t,summary:mt(n==null?void 0:n.summary)??mt(n==null?void 0:n.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return es(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return xi(e,t.id)}}),To=[Yh,Qh];function Ns(e){const t=typeof e=="object"&&e!==null?e:{},n=To.find(r=>r.matches(t));if(!n)throw new Error(`[apiuikit] Unrecognized document: expected a top-level "openapi", "swagger", or "asyncapi" version key. Supported specs: ${To.map(r=>r.name).join(", ")}.`);return n}function Ja(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function qh(e){return Ns(e).targets(e)}function em(e,t){const n=Ns(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return n.toMarkdown(e,t)}function tm(e,t={}){const n=Ns(e),{baseUrl:r,url:s,optional:i}=t,a=(r==null?void 0:r.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${Ja(p.key)}.md`),u=[`# ${t.title??n.title(e)}`],d=t.summary??n.summary(e);d&&u.push("",`> ${d}`);const f=n.targets(e).map(p=>({entry:p,href:c(p)})).filter(p=>!!p.href);if(f.length){u.push("",`## ${n.sectionTitle}`,"");for(const{entry:p,href:h}of f)u.push(`- [${p.label}](${h})${p.summary?`: ${p.summary}`:""}`)}if(i!=null&&i.length){u.push("","## Optional","");for(const p of i)u.push(`- [${p.label}](${p.url})${p.description?`: ${p.description}`:""}`)}return u.push(""),u.join(`
178
- `)}function Za(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=i=>{const a=s(i);return a!==void 0?a:n(i)?t:void 0}}const nm=["application/vnd.apache.avro","application/vnd.apache.avro+json","application/vnd.apache.avro+yaml","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/vnd.apache.avro;version=1.8.2","application/vnd.apache.avro+json;version=1.8.2","application/vnd.apache.avro+yaml;version=1.8.2"];function rm(){return{validate:om,parse:im,getMimeTypes:()=>nm}}function sm(e){Za(e,rm(),Dt)}function om(e){return Qr(e.data).map(t=>({message:t,path:e.path}))}function im(e){var n,r;const t=Qr(e.data);if(t.length>0)return{[wn]:t[0]};try{const s=Nr(e.data),i=e.meta.message,a=(r=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=Nr(a)),s}catch(s){return{[wn]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function am(){try{const e=await Promise.resolve().then(()=>require("./index-CfELqow6.cjs")).then(n=>n.index),t=e.default??e;if(typeof t!="function")throw new Error("Unexpected export shape from '@asyncapi/parser/browser'.");return t}catch(e){throw console.error("[apiuikit] Failed to load '@asyncapi/parser/browser':",e),new Error("[apiuikit] The parsed entry requires '@asyncapi/parser'. Install it (`npm i @asyncapi/parser`), or use the `AsyncAPI` component with a pre-resolved document instead.")}}async function Xa(e){try{const t=await am(),n=new t;sm(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-BEVutm25.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e);return{diagnostics:i,document:s?cm(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function lm(e,t){const{diagnostics:n,document:r}=await Xa(e);return{diagnostics:n,view:r?o.jsx(js,{kind:"resolved",asyncapi:r,config:t}):null}}function cm(e){return e.json()}function um({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}){const[c,u]=g.useState(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{let f=!0;return Xa(e).then(({document:p,diagnostics:h})=>{var m;f&&(u(p),(m=d.current)==null||m.call(d,h))}),()=>{f=!1}},[e]),c?o.jsx(js,{kind:"resolved",asyncapi:c,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}):null}async function dm(){try{return await Promise.resolve().then(()=>require("./index-CI3MIo1V.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const lr=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function Ya(e){try{const{validate:t,dereference:n}=await dm(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(l=>lr(l,0)),document:null};const s=(r.errors??[]).map(l=>lr(l,1)),{schema:i,errors:a}=n(e);return a!=null&&a.length&&s.push(...a.map(l=>lr(l,0))),{diagnostics:s,document:i??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function fm(e,t){const{diagnostics:n,document:r}=await Ya(e);return{diagnostics:n,view:r?o.jsx(Ss,{kind:"resolved",openapi:r,config:t}):null}}function pm({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}){const[c,u]=g.useState(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{let f=!0;return Ya(e).then(({document:p,diagnostics:h})=>{var m;f&&(u(p),(m=d.current)==null||m.call(d,h))}),()=>{f=!1}},[e]),c?o.jsx(Ss,{kind:"resolved",openapi:c,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}):null}function Qa(e,t,n){return function({document:s,config:i,plugins:a,children:l}){const c=g.useContext(kt),u=g.useMemo(()=>s?yt(s):null,[s]),d=!!c&&c.specType!==n;if(g.useEffect(()=>{d&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${c.specType} document provider, which cannot supply the document it needs. `+(u?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[c,d,u]),c&&!d)return o.jsx(o.Fragment,{children:l});if(!u){if(c)return o.jsx(o.Fragment,{children:l});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:u,config:i,plugins:a,children:l})}}function hm({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>yt(e),[e]);return o.jsx(In,{document:s,config:t,plugins:n,children:r})}const Un=Qa(In,"AsyncAPI","asyncapi");function Wn(){const e=ke();return e.specType==="asyncapi",e.document}function mm({layout:e}){const t=Wn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Ea,{servers:t.servers,layout:e})}function gm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(mm,{layout:e})})}function xm({layout:e}){const t=Wn(),[n,r]=g.useState(null);return o.jsx(Ba,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function bm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(xm,{layout:e})})}function ym({layout:e}){var n;const t=Wn();return o.jsx(ya,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function km({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(ym,{layout:e})})}function wm({layout:e}){const t=Wn();return t.info?o.jsx(ra,{...t.info,layout:e}):null}function vm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(wm,{layout:e})})}const jm=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function cr({layout:e}){var r,s;const t=g.useContext(kt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(vs,{schemas:n,layout:e})}function As({document:e,config:t,plugins:n,layout:r}){const s=g.useContext(kt),i=g.useMemo(()=>e?yt(e):null,[e]);if(s)return o.jsx(cr,{layout:r});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return jm(i)?o.jsx(Hn,{document:i,config:t,plugins:n,children:o.jsx(cr,{layout:r})}):o.jsx(In,{document:i,config:t,plugins:n,children:o.jsx(cr,{layout:r})})}const Sm=As,Nm=As;function Am({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>yt(e),[e]);return o.jsx(Hn,{document:s,config:t,plugins:n,children:r})}const Kn=Qa(Hn,"OpenAPI","openapi");function Gn(){const e=Re();return e.specType==="openapi",e.document}function Em({layout:e}){const t=Gn();return!t.servers||t.servers.length===0?null:o.jsx(Fa,{servers:t.servers,layout:e})}function $m({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Em,{layout:e})})}function Cm({layout:e}){var s;const t=Gn(),[n,r]=g.useState(null);return o.jsx(Cn,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function Tm({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Cm,{layout:e})})}function Im({layout:e}){var i;const t=Gn(),[n,r]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Cn,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:n,onSelectKey:r,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function _m({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Im,{layout:e})})}function Om({layout:e}){const t=Gn();return t.info?o.jsx(Da,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function Mm({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Om,{layout:e})})}exports.AsyncAPI=js;exports.AsyncAPIInfo=vm;exports.AsyncAPIMessages=km;exports.AsyncAPIOperations=bm;exports.AsyncAPIProvider=hm;exports.AsyncAPIRenderer=um;exports.AsyncAPISchemas=Sm;exports.AsyncAPIServers=gm;exports.CodeBlock=Fn;exports.ErrorBoundary=Tn;exports.OpenAPI=Ss;exports.OpenAPIEndpoints=Tm;exports.OpenAPIInfo=Mm;exports.OpenAPIProvider=Am;exports.OpenAPIRenderer=pm;exports.OpenAPISchemas=Nm;exports.OpenAPIServers=$m;exports.OpenAPIWebhooks=_m;exports.PluginSlot=zt;exports.SchemaTabs=lt;exports.SchemaTree=ks;exports.Schemas=As;exports.X_LIB_CONVERSION_ERROR=wn;exports.asyncApiOperationToMarkdown=xi;exports.asyncApiToMarkdown=es;exports.commonjsGlobal=yd;exports.defaultConfig=ot;exports.documentToLlmsTxt=tm;exports.documentToMarkdown=em;exports.ensureHljsLanguage=Pa;exports.getAugmentedNamespace=kd;exports.getDefaultExportFromCjs=Bi;exports.hljsLanguageForTarget=Ra;exports.isHljsLanguageReady=$n;exports.isProtobufSchemaFormat=Ft;exports.listDocumentTargets=qh;exports.markdownForLlm=qo;exports.openApiEndpointToMarkdown=yi;exports.openApiToMarkdown=ts;exports.parseAndRender=lm;exports.parseAndRender$1=fm;exports.registerSchemaParserWithFallback=Za;exports.resolveLogo=ns;exports.targetSlug=Ja;exports.useAsyncAPIDocument=ke;exports.useAsyncAPIDocumentContext=Mo;exports.useDocumentContext=Re;exports.useOpenAPIDocumentContext=Ro;exports.useOperationTabPlugins=vi;exports.usePluginSlot=wi;
178
+ `)}function Za(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=i=>{const a=s(i);return a!==void 0?a:n(i)?t:void 0}}const nm=["application/vnd.apache.avro","application/vnd.apache.avro+json","application/vnd.apache.avro+yaml","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/vnd.apache.avro;version=1.8.2","application/vnd.apache.avro+json;version=1.8.2","application/vnd.apache.avro+yaml;version=1.8.2"];function rm(){return{validate:om,parse:im,getMimeTypes:()=>nm}}function sm(e){Za(e,rm(),Dt)}function om(e){return Qr(e.data).map(t=>({message:t,path:e.path}))}function im(e){var n,r;const t=Qr(e.data);if(t.length>0)return{[wn]:t[0]};try{const s=Nr(e.data),i=e.meta.message,a=(r=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=Nr(a)),s}catch(s){return{[wn]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function am(){try{const e=await Promise.resolve().then(()=>require("./index-DKcgVKzx.cjs")).then(n=>n.index),t=e.default??e;if(typeof t!="function")throw new Error("Unexpected export shape from '@asyncapi/parser/browser'.");return t}catch(e){throw console.error("[apiuikit] Failed to load '@asyncapi/parser/browser':",e),new Error("[apiuikit] The parsed entry requires '@asyncapi/parser'. Install it (`npm i @asyncapi/parser`), or use the `AsyncAPI` component with a pre-resolved document instead.")}}async function Xa(e){try{const t=await am(),n=new t;sm(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-DO1jnL81.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e);return{diagnostics:i,document:s?cm(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function lm(e,t){const{diagnostics:n,document:r}=await Xa(e);return{diagnostics:n,view:r?o.jsx(js,{kind:"resolved",asyncapi:r,config:t}):null}}function cm(e){return e.json()}function um({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}){const[c,u]=g.useState(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{let f=!0;return Xa(e).then(({document:p,diagnostics:h})=>{var m;f&&(u(p),(m=d.current)==null||m.call(d,h))}),()=>{f=!1}},[e]),c?o.jsx(js,{kind:"resolved",asyncapi:c,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}):null}async function dm(){try{return await Promise.resolve().then(()=>require("./index-29FyeXas.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const lr=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function Ya(e){try{const{validate:t,dereference:n}=await dm(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(l=>lr(l,0)),document:null};const s=(r.errors??[]).map(l=>lr(l,1)),{schema:i,errors:a}=n(e);return a!=null&&a.length&&s.push(...a.map(l=>lr(l,0))),{diagnostics:s,document:i??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function fm(e,t){const{diagnostics:n,document:r}=await Ya(e);return{diagnostics:n,view:r?o.jsx(Ss,{kind:"resolved",openapi:r,config:t}):null}}function pm({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}){const[c,u]=g.useState(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{let f=!0;return Ya(e).then(({document:p,diagnostics:h})=>{var m;f&&(u(p),(m=d.current)==null||m.call(d,h))}),()=>{f=!1}},[e]),c?o.jsx(Ss,{kind:"resolved",openapi:c,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:l}):null}function Qa(e,t,n){return function({document:s,config:i,plugins:a,children:l}){const c=g.useContext(kt),u=g.useMemo(()=>s?yt(s):null,[s]),d=!!c&&c.specType!==n;if(g.useEffect(()=>{d&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${c.specType} document provider, which cannot supply the document it needs. `+(u?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[c,d,u]),c&&!d)return o.jsx(o.Fragment,{children:l});if(!u){if(c)return o.jsx(o.Fragment,{children:l});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:u,config:i,plugins:a,children:l})}}function hm({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>yt(e),[e]);return o.jsx(In,{document:s,config:t,plugins:n,children:r})}const Un=Qa(In,"AsyncAPI","asyncapi");function Wn(){const e=ke();return e.specType==="asyncapi",e.document}function mm({layout:e}){const t=Wn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Ea,{servers:t.servers,layout:e})}function gm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(mm,{layout:e})})}function xm({layout:e}){const t=Wn(),[n,r]=g.useState(null);return o.jsx(Ba,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function bm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(xm,{layout:e})})}function ym({layout:e}){var n;const t=Wn();return o.jsx(ya,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function km({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(ym,{layout:e})})}function wm({layout:e}){const t=Wn();return t.info?o.jsx(ra,{...t.info,layout:e}):null}function vm({layout:e,...t}){return o.jsx(Un,{...t,children:o.jsx(wm,{layout:e})})}const jm=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function cr({layout:e}){var r,s;const t=g.useContext(kt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(vs,{schemas:n,layout:e})}function As({document:e,config:t,plugins:n,layout:r}){const s=g.useContext(kt),i=g.useMemo(()=>e?yt(e):null,[e]);if(s)return o.jsx(cr,{layout:r});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return jm(i)?o.jsx(Hn,{document:i,config:t,plugins:n,children:o.jsx(cr,{layout:r})}):o.jsx(In,{document:i,config:t,plugins:n,children:o.jsx(cr,{layout:r})})}const Sm=As,Nm=As;function Am({document:e,config:t,plugins:n,children:r}){const s=g.useMemo(()=>yt(e),[e]);return o.jsx(Hn,{document:s,config:t,plugins:n,children:r})}const Kn=Qa(Hn,"OpenAPI","openapi");function Gn(){const e=Re();return e.specType==="openapi",e.document}function Em({layout:e}){const t=Gn();return!t.servers||t.servers.length===0?null:o.jsx(Fa,{servers:t.servers,layout:e})}function $m({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Em,{layout:e})})}function Cm({layout:e}){var s;const t=Gn(),[n,r]=g.useState(null);return o.jsx(Cn,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function Tm({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Cm,{layout:e})})}function Im({layout:e}){var i;const t=Gn(),[n,r]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Cn,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:n,onSelectKey:r,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function _m({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Im,{layout:e})})}function Om({layout:e}){const t=Gn();return t.info?o.jsx(Da,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function Mm({layout:e,...t}){return o.jsx(Kn,{...t,children:o.jsx(Om,{layout:e})})}exports.AsyncAPI=js;exports.AsyncAPIInfo=vm;exports.AsyncAPIMessages=km;exports.AsyncAPIOperations=bm;exports.AsyncAPIProvider=hm;exports.AsyncAPIRenderer=um;exports.AsyncAPISchemas=Sm;exports.AsyncAPIServers=gm;exports.CodeBlock=Fn;exports.ErrorBoundary=Tn;exports.OpenAPI=Ss;exports.OpenAPIEndpoints=Tm;exports.OpenAPIInfo=Mm;exports.OpenAPIProvider=Am;exports.OpenAPIRenderer=pm;exports.OpenAPISchemas=Nm;exports.OpenAPIServers=$m;exports.OpenAPIWebhooks=_m;exports.PluginSlot=zt;exports.SchemaTabs=lt;exports.SchemaTree=ks;exports.Schemas=As;exports.X_LIB_CONVERSION_ERROR=wn;exports.asyncApiOperationToMarkdown=xi;exports.asyncApiToMarkdown=es;exports.commonjsGlobal=yd;exports.defaultConfig=ot;exports.documentToLlmsTxt=tm;exports.documentToMarkdown=em;exports.ensureHljsLanguage=Pa;exports.getAugmentedNamespace=kd;exports.getDefaultExportFromCjs=Bi;exports.hljsLanguageForTarget=Ra;exports.isHljsLanguageReady=$n;exports.isProtobufSchemaFormat=Ft;exports.listDocumentTargets=qh;exports.markdownForLlm=qo;exports.openApiEndpointToMarkdown=yi;exports.openApiToMarkdown=ts;exports.parseAndRender=lm;exports.parseAndRender$1=fm;exports.registerSchemaParserWithFallback=Za;exports.resolveLogo=ns;exports.targetSlug=Ja;exports.useAsyncAPIDocument=ke;exports.useAsyncAPIDocumentContext=Mo;exports.useDocumentContext=Re;exports.useOpenAPIDocumentContext=Ro;exports.useOperationTabPlugins=vi;exports.usePluginSlot=wi;