apiuikit 1.8.0 → 1.8.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.
- package/dist/{CodeSamples-CE_PYa2j.cjs → CodeSamples-BQmjSY09.cjs} +1 -1
- package/dist/{CodeSamples-D8ZHopnj.js → CodeSamples-tMMzvAH8.js} +1 -1
- package/dist/{LogoExtension-BsfaM3h2.cjs → LogoExtension-D27JNW7U.cjs} +1 -1
- package/dist/{LogoExtension-BxAoBfvv.js → LogoExtension-DVr1eLrt.js} +1 -1
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.es.js +1 -1
- package/dist/{index-CXAGho9r.cjs → index-BjY_1Vlo.cjs} +1 -1
- package/dist/{index-CXSFEEqv.js → index-Cssg9iXM.js} +1 -1
- package/dist/index-CxGadJ5P.cjs +178 -0
- package/dist/{index-C4dsAuGH.cjs → index-Db1EbA-L.cjs} +1 -1
- package/dist/{index-DGGpf1hd.js → index-DnN6KAng.js} +1 -1
- package/dist/{index-mzpFFTrv.js → index-OE2woH_D.js} +4301 -5132
- package/dist/{protoToJsonSchema-Bz9yIjAo.js → protoToJsonSchema-8tUWzCij.js} +1 -1
- package/dist/{protoToJsonSchema-DjrQ6cDd.cjs → protoToJsonSchema-BjH2ujBn.cjs} +1 -1
- package/dist/{protobufSchemaParser-BDvHrzAl.cjs → protobufSchemaParser-l_gdtemJ.cjs} +1 -1
- package/dist/{protobufSchemaParser-CaWUT6i7.js → protobufSchemaParser-mScuw-9s.js} +2 -2
- package/package.json +1 -1
- package/dist/index-BG2MGxhP.cjs +0 -180
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";var qa=Object.defineProperty;var el=(e,t,r)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>el(e,typeof t!="symbol"?t+"":t,r);const o=require("react/jsx-runtime"),g=require("react"),pt=require("react-dom"),Eo=require("isomorphic-dompurify"),Or=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],_r=(e,t)=>{const r=t.length>0?t:Or,n=(e%r.length+r.length)%r.length;return r[n]},gt={show:{sidebar:!0,info:!0,servers:!0,operations:!0,messages:!0,messageExamples:!1,schemas:!0},theme:{colors:{primary:{50:"#ddf4ff",100:"#b6e3ff",200:"#80ccff",300:"#54aeff",500:"#58a6ff",600:"#1f6feb",700:"#0d419d"}},light:{background:"#f8fafc",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:Or},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},Mr=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",tl=e=>typeof e=="object"&&e!==null;function nl(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function $o(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(const n of t.slice(2).split("/")){if(!tl(r))return;const s=nl(n);if(s===void 0||(r=r[s],r===void 0))return}return r}function Lt(e){const t=new Map;return r=>{if(t.has(r))return t.get(r);const n=$o(e,r);return t.set(r,n),n}}const Wn=e=>typeof e=="object"&&e!==null,rl=e=>e.replace(/^#\//,"").split("/").pop()??e,Rr=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Mr(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(n=>Rr(n,t))),Co=(e,t=new Set,r=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(r.has(e))return!1;if(r.add(e),Mr(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Co(s,t,r))}finally{t.delete(e)}},sl=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Ss=e=>e.length?`#/${e.map(sl).join("/")}`:"#";function xt(e){if(!Co(e))return e;const t=new Map,r=new Set,n=new Map,s=(i,a)=>{if(Array.isArray(i)){if(r.has(i))return{$ref:n.get(i)};const l=t.get(i);if(l!==void 0)return l;const c=[];n.set(i,Ss(a)),t.set(i,c),r.add(i);try{i.forEach((u,d)=>c.push(s(u,[...a,String(d)])))}finally{r.delete(i)}return c}if(Mr(i)){const l=$o(e,i.$ref),c=Wn(l)||Array.isArray(l);if(c&&!r.has(l)){const u=s(l,a);return Wn(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=rl(i.$ref)),u}if(l!==void 0&&!c)return l}if(Wn(i)){if(r.has(i))return{$ref:n.get(i)};const l=t.get(i);if(l!==void 0)return l;const c={};n.set(i,Ss(a)),t.set(i,c),r.add(i);try{for(const[u,d]of Object.entries(i))c[u]=s(d,[...a,u])}finally{r.delete(i)}return c}return i};return s(e,[])}class Cn extends g.Component{constructor(){super(...arguments);re(this,"state",{error:null});re(this,"reset",()=>{this.setState({error:null})})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){var s,i;console.error("[apiuikit] Rendering error:",r,n.componentStack),(i=(s=this.props).onError)==null||i.call(s,r,n)}render(){const{error:r}=this.state;if(!r)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n(r,this.reset):n!==void 0?n:o.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-surface p-6 text-foreground",children:[o.jsx("p",{className:"font-semibold text-foreground",children:"Something went wrong rendering this API specification."}),o.jsx("p",{className:"text-sm text-foreground-secondary break-words",children:r.message}),o.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md bg-primary-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600",children:"Try again"})]})}}const bt=g.createContext(null),Ke=()=>{const e=g.useContext(bt);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},To=()=>{const e=Ke();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Io=()=>{const e=Ke();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},ge=Ke;var mn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(mn||{});const ol="Contact",il="Email",Ns="License",As="External Documentation",al="Tags",ll="Implicit",cl=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
|
+
for native apps and JavaScript apps where the access token is returned
|
|
3
|
+
immediately without an extra authorization code exchange step.`,ul="Client Credentials",dl="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",fl="Password",pl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",hl="Authorization Code",ml="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Oo="Connecting to a server",gl="",gn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],xl=[50,100,200,300,500,600,700],bl={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"}},yl=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],kl={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",[mn.SEND]:"bg-green-100 text-green-800",[mn.RECEIVE]:"bg-blue-100 text-blue-800"};function _o(e){const t=e.replace("#","").padEnd(6,"0"),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${r} ${n} ${s}`}function Kn(e,t,r){if(e)for(const n of xl){const s=e[n];s&&(r[`--color-${t}-${n}`]=_o(s))}}const wl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],vl={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 jl(e){const t={},r=e.light?"light":e.dark?"dark":null,n=r==="dark"?e.dark:r==="light"?e.light:void 0;if(r==="dark")for(const[s,i]of Object.entries(vl))t[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of wl){const a=n[s];a&&(t[i]=_o(a))}return e.colors&&(Kn(e.colors.primary,"primary",t),Kn(e.colors.secondary,"secondary",t),Kn(e.colors.neutral,"neutral",t)),t}const Sl=e=>e.endsWith(".tab"),Es=new WeakMap;let Nl=0;const Al=e=>{const t=Es.get(e);if(t)return t;const r=`plugin-${Nl++}`;return Es.set(e,r),r};function Mo(e){const t=new Map;for(const r of e){const n=Al(r);for(const s of Object.keys(r.slots)){const i=r.slots[s];if(!i)continue;const a=t.get(s)??[];if(t.has(s)||t.set(s,a),Sl(s)){const l=i;a.push({id:`${s.replace(/\./g,"-")}-${n}`,pluginName:r.name,label:l.label,Component:l.component})}else a.push({id:`${s.replace(/\./g,"-")}-${n}`,pluginName:r.name,Component:i})}}return t}const El=[];function Ro(e,t,r=gt,n=El){var N,k,x,$,I,E,P,z;const[s,i]=g.useState(null),[a,l]=g.useState(null),c=g.useMemo(()=>Lt(t),[t]),u=((N=r.expand)==null?void 0:N.schemas)===!0,d=(x=(k=r.theme)==null?void 0:k.depthColors)!=null&&x.length?r.theme.depthColors:Or,f=(($=r.show)==null?void 0:$.extensions)!==!1,p=((I=r.show)==null?void 0:I.codeSamples)!==!1,h=r.topOffset,m=typeof h=="number"&&Number.isFinite(h)?Math.max(0,h):0,y=((E=r.sidePanel)==null?void 0:E.containment)??"viewport",b=(P=r.sidePanel)==null?void 0:P.topOffset,v=typeof b=="number"&&Number.isFinite(b)?Math.max(0,b):m,S=(z=r.markdown)==null?void 0:z.url,w=g.useMemo(()=>{if(typeof S=="function")return S;if(typeof S=="string")return()=>S},[S]),C=g.useMemo(()=>Mo(n),[n]),B=g.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:a,topOffset:m,sidePanelContainment:y,sidePanelTopOffset:v,defaultSchemaExpanded:u,depthColors:d,showExtensions:f,showCodeSamples:p,markdownUrl:w,plugins:n,pluginSlotRegistry:C,config:r}),[e,t,c,s,a,m,y,v,u,d,f,p,w,n,C,r]),H=r.theme?jl(r.theme):{};return{contextValue:B,themeVars:H,setPortalHost:i,setRootElement:l}}function Tn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Ro("asyncapi",e,t,r);return o.jsx(bt.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"asyncapi-portal-root"}),s]})})}const Po="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function Xe({title:e,content:t,sideContent:r,stickySideContent:n=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:l="columns"}){const c=l==="stacked",u=r!=null&&r!==!1,d=`${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 mb-6 ${c?"":Po}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:c?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:d,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${c?"flex-col":u&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${c?"w-full":"@lg:w-prose"} min-w-0`,children:t}),c?u&&o.jsx("div",{className:n?"@lg:sticky @lg:top-4":void 0,children:r}):o.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0","data-testid":"section-side-column",children:o.jsx("div",{className:`${n&&"@lg:sticky @lg:top-4"}`,children:r})})]})]})}function et(...e){return e.filter(Boolean).join(" ")}function yt({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 an=(e,t)=>`${e?`${e}-`:""}tab-${t}`,ln=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function it({tabs:e,current:t,onChange:r=()=>{},ariaLabel:n="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(b=>!!b.icon),p=t?e.findIndex(b=>b.id===t):-1,h=p>=0?p:0,m=(b,v)=>{var C;if(e.length===0)return;const S=B=>(B+e.length)%e.length;let w=v;if(b.key==="ArrowRight"&&(b.preventDefault(),w=S(v+1)),b.key==="ArrowLeft"&&(b.preventDefault(),w=S(v-1)),b.key==="Home"&&(b.preventDefault(),w=0),b.key==="End"&&(b.preventDefault(),w=e.length-1),w!==v){const B=e[w];r(B.id),(C=u.current[w])==null||C.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:et("@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:b=>r(b.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(b=>o.jsx("option",{value:b.id,children:b.name},b.id))]}),o.jsx(yt,{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:et("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":n,children:e.map((b,v)=>{const S=b.id===t;return o.jsx("button",{ref:w=>{u.current[v]=w},id:an(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":ln(i,b.id),onClick:()=>r(b.id),onKeyDown:w=>m(w,v),className:et("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:b.name},b.id)})}):f?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":n,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((b,v)=>{const S=b.id===t,w=b.icon;return o.jsx("button",{ref:C=>{u.current[v]=C},id:an(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":ln(i,b.id),onClick:()=>r(b.id),onKeyDown:C=>m(C,v),className:et("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:[w?o.jsx(w,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:b.name})]})},b.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":n,children:e.map((b,v)=>{const S=b.id===t;return o.jsxs("button",{ref:w=>{u.current[v]=w},id:an(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":ln(i,b.id),onClick:()=>r(b.id),onKeyDown:w=>m(w,v),className:et(S?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",v===0?"rounded-l-lg":"",v===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:b.name}),o.jsx("span",{"aria-hidden":"true",className:et(S?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},b.id)})})})]}):null}function $l({tabs:e,current:t,idPrefix:r,renderPanel:n}){return o.jsx(o.Fragment,{children:e.map(s=>{const i=s.id===t;return o.jsx("div",{id:ln(r,s.id),role:"tabpanel","aria-labelledby":an(r,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:n(s,i)},s.id)})})}function Lo(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Pr(e){let t=e;for(;t&&t!==document.body;){if(Lo(t))return t;t=t.parentElement}return document.documentElement}function Cl(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Lo(r))return r;if(r===t)break;r=r.parentElement}return null}function Bo(e){const t=e.style.overflow,r=e.style.paddingRight,n=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",n>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+n}px`}return()=>{e.style.overflow=t,e.style.paddingRight=r}}function Do({tabs:e,current:t,onChange:r}){const{rootElement:n,topOffset:s=0}=Ke();if(!e.length)return null;const i=typeof document<"u"&&Pr(n)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(it,{tabs:e,current:t,onChange:r,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky z-10 flex w-full justify-center bg-background",style:{top:i},children:o.jsx(Xe,{content:a,stickySideContent:!1})})}function Tl(e,t){const[r,n]=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?n("docked"):s.current||d>0?n("pinned"):d<0?n("hidden"):n(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&&n(i=>i==="hidden"?"pinned":i)},[t]),r}function Lr(e,t){const[r,n]=g.useState(null);return g.useLayoutEffect(()=>{if(!e||!t){n(null);return}let s=null;const i=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,n(e.getBoundingClientRect())}))};n(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]),r}const Zt=16,$s=10,Il=10,Ol=40,_l=8;function Fo({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=Ke(),i=Tl(n,r),a=i!=="docked",l=Lr(n,a),c=typeof window>"u"?0:window.innerWidth,u=l?Math.max(l.left,0):0,d=l?Math.min(l.right,c):c,f=s+$s-Il+Ol+_l,p={left:a?u+Zt:Zt,right:a?Math.max(c-d,0)+Zt:Zt,transform:`translateY(${i==="hidden"?`-${f}px`:"0px"})`,...a?{position:"fixed",top:s+$s,pointerEvents:i==="hidden"?"none":void 0}:{}};return o.jsx("header",{className:"document-topbar",style:p,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Po}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function zo(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((n,s)=>o.jsxs(g.Fragment,{children:[o.jsx("code",{children:n}),", "," "]},s)),r=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",r]})}function Ml(e){return e.map(t=>`\`${t}\``).join(", ")}function ar(e,{align:t="center",gap:r=8,clearance:n=40,width:s=0,margin:i=8}={}){const a=e.getBoundingClientRect(),l=a.top<n?"bottom":"top",c=l==="top"?a.top-r:a.bottom+r;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 Rl(e){const t=[],r=/\{([^}]+)\}/g;let n=0,s;for(;(s=r.exec(e))!==null;)s.index>n&&t.push({type:"text",value:e.slice(n,s.index)}),t.push({type:"param",value:s[1]}),n=s.index+s[0].length;return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}const Cs=360;function Pl(e){let t=0;return e.map((r,n)=>r.type==="text"?o.jsx("span",{children:r.value},n):o.jsx("span",{className:`font-semibold ${gn[t++%gn.length]}`,children:`{${r.value}}`},n))}function Je({address:e,parameters:t,className:r="text-xs",truncate:n=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=ge(),[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),b=g.useId(),v=Rl(e);let S=0;g.useEffect(()=>{if(!n)return;const x=y.current;if(!x)return;const $=()=>p(x.scrollWidth>x.clientWidth);$();const I=new ResizeObserver($);return I.observe(x),()=>I.disconnect()},[n,e]);const w=(x,$)=>{d(ar($)),c(x)},C=()=>c(null),B=x=>m(ar(x,{align:"end",width:Cs})),H=()=>m(null),N=v.map((x,$)=>{if(x.type==="text")return o.jsx("span",{children:x.value},$);const I=t==null?void 0:t[x.value],E=gn[S++%gn.length],P=l===$,z=!!I&&(I.description||I.type||I.default||I.enum&&I.enum.length>0||I.examples&&I.examples.length>0),J=`channel-address-tooltip-${$}`,j=z&&P?J:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:A=>z&&w($,A.currentTarget),onMouseLeave:C,children:[o.jsx("span",{className:`font-semibold ${E} ${z?"cursor-help underline decoration-dotted":""}`,role:z?"button":void 0,tabIndex:z?0:void 0,"aria-expanded":z?P:void 0,"aria-describedby":j,onFocus:A=>z&&w($,A.currentTarget),onBlur:C,onKeyDown:A=>{z&&((A.key==="Enter"||A.key===" ")&&(A.preventDefault(),w($,A.currentTarget)),A.key==="Escape"&&(A.preventDefault(),C(),A.currentTarget.blur()))},children:`{${x.value}}`}),z&&P&&a&&pt.createPortal(o.jsxs("div",{id:J,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:[I.description&&o.jsx("div",{children:I.description}),I.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:I.type})}),I.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:I.default})]}),I.enum&&I.enum.length>0&&o.jsx("div",{className:"mt-1",children:zo(I.enum)}),I.examples&&I.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",I.examples.join(", ")]})]}),a)]},$)}),k=i?"px-2 py-1 ":"";return n?o.jsxs("code",{className:`${k}rounded text-foreground-secondary flex items-center min-w-0 ${r}`,children:[o.jsx("span",{ref:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:N}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?b: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:x=>B(x.currentTarget),onMouseLeave:H,onFocus:x=>B(x.currentTarget),onBlur:H,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),B(x.currentTarget)),x.key==="Escape"&&(x.preventDefault(),H(),x.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&pt.createPortal(o.jsx("div",{id:b,role:"tooltip",style:{top:h.top,left:h.left,width:Cs},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:Pl(v)})}),a)]}):o.jsx("code",{className:`${k}rounded text-foreground-secondary break-all ${r}`,children:N})}const Ll={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Ze({method:e,size:t="sm",className:r=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${Ll[t]} ${kl[e]} ${r}`,children:e}):null}const Ts=6,Bl=12,Dl=8,Fl=.7;function zl(e,t){if(e===0)return 1/0;const r=e*Fl-Dl*2,n=t*Ts+Math.max(0,t-1)*Bl;return Math.max(1,Math.floor((r-n)/Ts))}function Hl(e,t){const r=e.reduce((s,i)=>s+i,0);if(r<=t)return e;if(t<=e.length)return e.map(()=>1);const n=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/r*n)))}const Is=20;function Ul({sections:e,activeSection:t,onTabChange:r,onItemSelect:n,selectedItem:s}){const[i,a]=g.useState(!1),[l,c]=g.useState(!1),u=i||l,{rootElement:d,portalHost:f,topOffset:p=0}=ge(),h=g.useRef(null),m=g.useRef(null),y=g.useMemo(()=>e.filter(L=>L.items.length>0),[e]),b=g.useMemo(()=>y.filter(L=>L.isTab===!1||L.id===t),[y,t]),v=g.useMemo(()=>y.filter(L=>L.showInPopover!==!1),[y]),[S,w]=g.useState(null),C=g.useRef(null),B=g.useRef(null),H=g.useCallback((L,F)=>{w({section:L,key:F}),C.current={section:L,key:F},B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{C.current=null},600)},[]);g.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]),g.useEffect(()=>{const F=e.filter(D=>D.items.length>0).flatMap(D=>D.items.map(te=>({section:D.id,key:D.itemKey(te),id:D.targetId(te)}))).map(D=>({...D,el:document.getElementById(D.id)})).filter(D=>!!D.el);if(F.length===0)return;const _=new Map(F.map(D=>[D.el,D])),W=new Map,X=new IntersectionObserver(D=>{for(const ie of D)ie.isIntersecting?W.set(ie.target,ie.boundingClientRect.top):W.delete(ie.target);if(W.size===0)return;let te=null,ae=-1/0;for(const[ie,$e]of W)$e>ae&&(te=ie,ae=$e);const q=te&&_.get(te);if(!q)return;const xe=C.current;if(xe){if(q.section!==xe.section||q.key!==xe.key)return;C.current=null}w({section:q.section,key:q.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return F.forEach(D=>X.observe(D.el)),()=>X.disconnect()},[e]);const N=(S==null?void 0:S.section)??t,k=S??s,x=Lr(d,!0),$=typeof window>"u"?0:window.innerWidth,I=typeof window>"u"?0:window.innerHeight,E=!!x&&x.bottom>p&&x.top<I,P=Math.max(0,I-p),z=p+P/2,J=!!x&&x.width<1024,j={opacity:E?1:0,pointerEvents:E?"auto":"none",transition:"opacity 0.2s ease"},A={position:"fixed",top:z,left:((x==null?void 0:x.left)??0)+Is,transform:"translateY(-50%)",zIndex:51,...j},M=Math.min((x==null?void 0:x.right)??0,$)-60,Z={position:"fixed",bottom:16,left:M,zIndex:51,...j},Q=J?{position:"fixed",bottom:68,right:$-(M+44),zIndex:52}:{position:"fixed",top:z,left:((x==null?void 0:x.left)??0)+Is,transform:"translateY(-50%)",maxHeight:`calc(100vh - ${p+32}px)`,zIndex:52};g.useEffect(()=>{if(!i)return;const L=_=>{_.key==="Escape"&&a(!1)},F=_=>{var X,D;const W=_.target;(X=h.current)!=null&&X.contains(W)||(D=m.current)!=null&&D.contains(W)||a(!1)};return document.addEventListener("keydown",L),document.addEventListener("mousedown",F),()=>{document.removeEventListener("keydown",L),document.removeEventListener("mousedown",F)}},[i]);const se=g.useCallback((L,F)=>{L.isTab!==!1&&r(L.id),F&&setTimeout(()=>{var _;(_=document.getElementById(F))==null||_.scrollIntoView({behavior:"smooth",block:"start"})},50)},[r]),ue=g.useMemo(()=>v.map(L=>{const F=N===L.id,_=(k==null?void 0:k.section)===L.id,W=L.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{se(L),H(L.id,""),J&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${F?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(W,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${F?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${F?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:L.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 ${F?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:L.items.length})]}),L.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:L.items.map(X=>{const D=L.itemKey(X),te=_&&(k==null?void 0:k.key)===D;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{se(L,L.targetId(X)),n(L.id,D),H(L.id,D),J&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${te?"bg-primary-50 font-medium text-primary-500":F?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:L.renderItem(X,{isSelected:te,isSectionActive:F})})},D)})})]},L.id)}),[v,N,k,J,se,n,H]),fe=zl(P,b.length),le=g.useMemo(()=>{const L=Hl(b.map(F=>F.items.length),fe);return b.map((F,_)=>{const W=N===F.id,X=F.items.length,D=L[_];let te=-1;if((k==null?void 0:k.section)===F.id){const ae=F.items.findIndex(q=>F.itemKey(q)===k.key);ae>=0&&(te=Math.min(D-1,Math.floor(ae*D/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 ${W?"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:D},(ae,q)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${q===te?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},q))})]},F.id)})},[b,N,k,fe]);return o.jsxs(o.Fragment,{children:[!J&&o.jsx("button",{ref:h,onClick:()=>a(L=>!L),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",style:A,children:le}),J&&o.jsx("button",{ref:h,onClick:()=>a(L=>!L),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:Z,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&&pt.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 ${J?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:Q,children:ue}),f)]})}function Ho({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Ul,{sections:e,activeSection:t,onTabChange:a=>r(a),onItemSelect:(a,l)=>{a!=="info"&&(a==="servers"?s==null||s(l):n==null||n(a,l))},selectedItem:i?{section:i.tab,key:i.key}:null})}function Br({className:e,children:t,...r}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...r,children:t})}function Wl(e){return o.jsxs(Br,{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 Dr({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 Uo(e){return{id:"info",label:"Info",icon:Wl,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function Wo(e){return{id:"schemas",label:"Schemas",icon:Dr,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function Ko({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 In({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 Go({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 Xt={};function Kl({operations:e=Xt,messages:t=Xt,schemas:r=Xt,servers:n=Xt,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[Uo(s),{id:"servers",label:"Servers",icon:Ko,isTab:!1,items:Object.keys(n),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:In,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(Je,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(Ze,{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:Go,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},Wo(r)]},[e,t,r,n,s,d]);return o.jsx(Ho,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const On=["get","put","post","delete","options","head","patch","trace"],Gl=(e,t)=>`${e} ${t}`;function Os(e,t){const r=new Map;for(const n of(e==null?void 0:e.parameters)??[])r.set(`${n.in}:${n.name}`,n);for(const n of(t==null?void 0:t.parameters)??[])r.set(`${n.in}:${n.name}`,n);return Array.from(r.values())}function Tt(e){return Object.keys(e).sort().flatMap(t=>{const r=e[t];return r?On.filter(n=>r[n]).map(n=>({key:Gl(n,t),method:n,path:t})):[]})}function Fr({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 _s={},Vl={},Jl=[];function Zl({paths:e=_s,webhooks:t=_s,schemas:r=Vl,servers:n=Jl,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=g.useMemo(()=>Tt(e),[e]),f=g.useMemo(()=>Tt(t),[t]),p=g.useMemo(()=>{const h=n.map((m,y)=>({key:`server-${y}`,url:m}));return[Uo(s),{id:"servers",label:"Servers",icon:Ko,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:In,items:d,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx(Je,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:Fr,items:f,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m.path})]})},Wo(r)]},[d,f,r,n,s]);return o.jsx(Ho,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Xl=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 Vo({query:e,onQueryChange:t,results:r,onSelectResult:n,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=k=>`asyncapi-search-result-${k}`,{portalHost:h,rootElement:m,topOffset:y=0}=ge(),b=()=>{c(!1),d(-1)};g.useEffect(()=>(s==null||s(l),()=>s==null?void 0:s(!1)),[l,s]);const v=g.useRef(!1),S=g.useRef(!1);g.useEffect(()=>{if(!m)return;const k=()=>{v.current=!0},x=()=>{v.current=!1};return m.addEventListener("mouseenter",k),m.addEventListener("mouseleave",x),()=>{m.removeEventListener("mouseenter",k),m.removeEventListener("mouseleave",x)}},[m]),g.useEffect(()=>{if(!m)return;const k=x=>{S.current=m.contains(x.target)};return document.addEventListener("mousedown",k,!0),()=>document.removeEventListener("mousedown",k,!0)},[m]),g.useEffect(()=>{if(!m)return;const k=x=>{!(x.metaKey||x.ctrlKey)||x.key.toLowerCase()!=="k"||!(m.contains(document.activeElement)||v.current||S.current)||(x.preventDefault(),c(!0))};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[m]),g.useEffect(()=>{if(!l)return;const k=requestAnimationFrame(()=>{var x;return(x=a.current)==null?void 0:x.focus()});return()=>cancelAnimationFrame(k)},[l]),g.useEffect(()=>{if(!(!l||!h))return Bo(Pr(h))},[l,h]),g.useEffect(()=>{if(!l)return;const k=x=>{x.key==="Escape"&&b()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[l]),g.useEffect(()=>{if(!l)return;const k=x=>{i.current&&!i.current.contains(x.target)&&b()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),g.useEffect(()=>{u>=r.length&&d(r.length-1)},[u,r.length]),g.useEffect(()=>{var k;u<0||(k=document.getElementById(p(u)))==null||k.scrollIntoView({block:"nearest"})},[u]);const w=l&&e.trim().length>0,C=k=>{b(),n(k)},B=k=>{if(k.key==="Escape"){k.preventDefault(),b();return}if(w){if(k.key==="ArrowDown"){k.preventDefault(),d(x=>r.length===0?-1:Math.min(x+1,r.length-1));return}if(k.key==="ArrowUp"){k.preventDefault(),d(x=>r.length===0?-1:Math.max(x-1,0));return}if(k.key==="Home"){k.preventDefault(),r.length>0&&d(0);return}if(k.key==="End"){k.preventDefault(),r.length>0&&d(r.length-1);return}if((k.key==="Enter"||k.key===" ")&&u>=0&&r[u]){k.preventDefault(),C(r[u]);return}}},H=w?`${r.length} result${r.length===1?"":"s"} found`:"",N=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(Xl,{})}),l&&h&&pt.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:k=>t(k.target.value),onKeyDown:B,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"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:H}),w&&o.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:r.length>0?o.jsx("ul",{className:"divide-y divide-border",children:r.map((k,x)=>o.jsx("li",{children:o.jsxs("button",{id:p(x),type:"button",role:"option","aria-selected":u===x,onClick:()=>C(k),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(u===x?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:k.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:k.location}),k.subtitle&&o.jsxs("span",{children:["• ",k.subtitle]})]})]})},k.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:N?"⌘ 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 Jo({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 Zo({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 _n({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 Yl=["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 Xo(e){return`${["> ## Agent Instructions",...Yl.map(r=>`> ${r}`)].join(`
|
|
4
|
+
`)}
|
|
5
|
+
|
|
6
|
+
${e.trimStart()}`}function Yo({serialize:e,onOpenChange:t}){const[r,n]=g.useState(!1),[s,i]=g.useState(!1),a=g.useRef(null),l=g.useRef(void 0),{deref:c}=ge(),u=()=>Xo(e(c));g.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),g.useEffect(()=>(t==null||t(r),()=>t==null?void 0:t(!1)),[r,t]),g.useEffect(()=>{if(!r)return;const p=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),g.useEffect(()=>{if(!r)return;const p=h=>{a.current&&!a.current.contains(h.target)&&n(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]);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)}n(!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),n(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>n(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":r,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(Zo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Jo,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(yt,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${r?"rotate-180":""}`})]}),r&&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(_n,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const ze=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),cn=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(r=>cn(r,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([r,n])=>[r,cn(n,t)]).join(" "):ze(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([r,n])=>[r,cn(n,t)]).join(" ")):"",ve=e=>cn(e).trim().replace(/\s+/g," "),Ql=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,ql=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),ec=e=>{if(!ze(e))return e;const t={};for(const[r,n]of Object.entries(e))ql.has(r)||(t[r]=n);return t},Qo=(e,t,r,n)=>{const s=`schema-${r}`,i=(l,c,u,d)=>{const f=`components.schemas.${r}${c.length?`.${c.join(".")}`:""}`,p=`Schemas > ${n}${u.length?` > ${u.join(" > ")}`:""}`,h=ze(l)?l.description:void 0,m=c.length?`${n}.${c.join(".")}`:n;e.push({id:`schema-${r}-${c.join("-")||"root"}`,targetId:d?Ql(r,d):s,type:"schema",tab:"schemas",key:r,name:m,path:f,location:p,subtitle:h,text:ve([ec(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!ze(l)||f.has(l))return;if(f.add(l),ze(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;ze(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,b)=>{a(y,[...c,`${h}[${b}]`],[...u,`${h}[${b}]`],d&&h!=="allOf"?[...d,`${h}[${b}]`]:null,f)})}ze(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function tc(e){var r,n;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:ve([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:ve([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:ve(u)});const d=a.bindings,f=ze(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:ve(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:ve([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:ve(c)});const u=i.bindings;if(ze(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:ve(f)})}if((r=e.components)!=null&&r.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:ve([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:ve(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:ve(i.headers)})}if((n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))Qo(t,i,s,s);return t}function Ye(e){return Array.isArray?Array.isArray(e):ei(e)==="[object Array]"}function nc(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 lr(e){return e==null?"":nc(e)}function me(e){return typeof e=="string"}function un(e){return typeof e=="number"}function rc(e){return e===!0||e===!1||sc(e)&&ei(e)=="[object Boolean]"}function qo(e){return typeof e=="object"}function sc(e){return qo(e)&&e!==null}function Ne(e){return e!=null}function Yt(e){return!e.trim().length}function ei(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const oc="Incorrect 'index' type",cr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",ic=e=>`Invalid value for key ${e}`,ac=e=>`Pattern length exceeds max of ${e}.`,lc=e=>`Missing ${e} property in key`,cc=e=>`Property 'weight' in key '${e}' must be a positive integer`,uc="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.",Ms=Object.prototype.hasOwnProperty;var dc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=ti(r);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function ti(e){let t=null,r=null,n=null,s=1,i=null;if(me(e)||Ye(e))n=e,t=Rs(e),r=dn(e);else{if(!Ms.call(e,"name"))throw new Error(lc("name"));const a=e.name;if(n=a,Ms.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(cc(dn(a)));t=Rs(a),r=dn(a),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function Rs(e){return Ye(e)?e:e.split(".")}function dn(e){return Ye(e)?e.join("."):e}function fc(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Ne(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ne(u))return;if(l===a.length-1&&(me(u)||un(u)||rc(u)||typeof u=="bigint"))r.push(c!==void 0?{v:lr(u),i:c}:lr(u));else if(Ye(u)){n=!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,me(t)?t.split("."):t,0),n?r:r[0]}const pc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},hc={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},mc={location:0,threshold:.6,distance:100},gc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:fc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},K=Object.freeze({...hc,...pc,...mc,...gc});function xc(e){return e>=9&&e<=13||e===32||e===160}function bc(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let c=0;c<s.length;c++)xc(s.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),r.has(i))return r.get(i);const l=Math.round(n/Math.pow(i,.5*e))/n;return r.set(i,l),l},clear(){r.clear()}}}var zr=class{constructor({getFn:e=K.getFn,fieldNormWeight:t=K.fieldNormWeight}={}){this.norm=bc(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,r)=>{this._keysMap[t.id]=r})}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(me(this.docs[0]))for(let r=0;r<e;r++){const n=this._createStringRecord(this.docs[r],r);n&&(this.records[t++]=n)}else for(let r=0;r<e;r++)this.records[t++]=this._createObjectRecord(this.docs[r],r);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(cr);if(me(e)){const n=this._createStringRecord(e,t);return n&&this.records.push(n),n}const r=this._createObjectRecord(e,t);return this.records.push(r),r}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(cr);for(let t=0,r=this.records.length;t<r;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,r=this.records.length;t<r;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(n=>!t.has(n.i));const r=Array.from(t).sort((n,s)=>n-s);for(const n of this.records){let s=0,i=r.length;for(;s<i;){const a=s+i>>>1;r[a]<n.i?s=a+1:i=a}n.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!Ne(e)||Yt(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const r={i:t,$:{}};for(let n=0,s=this.keys.length;n<s;n++){const i=this.keys[n],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Ne(a)){if(Ye(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ne(d)){if(me(d)){if(!Yt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ne(d.v)){const f=me(d.v)?d.v:lr(d.v);if(!Yt(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}r.$[n]=l}else if(me(a)&&!Yt(a)){const l={v:a,n:this.norm.get(a)};r.$[n]=l}}}return r}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function ni(e,t,{getFn:r=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){const s=new zr({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(ti)),s.setSources(t),s.create(),s}function yc(e,{getFn:t=K.getFn,fieldNormWeight:r=K.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new zr({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function kc(e=[],t=K.minMatchCharLength){const r=[];let n=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&n===-1?n=i:!l&&n!==-1&&(s=i-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[i-1]&&i-n>=t&&r.push([n,i-1]),r}function wc(e,t,r,{location:n=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(ac(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=i,m=p;const y=(x,$)=>{const I=x/d;if(u)return I;const E=Math.abs(p-$);return s?I+E/s:E?1:I},b=l>1||c,v=b?Array(f):[];let S;for(;(S=e.indexOf(t,m))>-1;){const x=y(0,S);if(h=Math.min(x,h),m=S+d,b){let $=0;for(;$<d;)v[S+$]=1,$+=1}}m=-1;let w=[],C=1,B=0,H=d+f;const N=1<<d-1;for(let x=0;x<d;x+=1){let $=0,I=H;for(;$<I;)y(x,p+I)<=h?$=I:H=I,I=Math.floor((H-$)/2+$);H=I;let E=Math.max(1,p-I+1);const P=a?f:Math.min(p+I,f)+d,z=Array(P+2);z[P+1]=(1<<x)-1;for(let J=P;J>=E;J-=1){const j=J-1,A=r[e[j]];if(z[J]=(z[J+1]<<1|1)&A,x&&(z[J]|=(w[J+1]|w[J])<<1|1|w[J+1]),z[J]&N&&(C=y(x,j),C<=h)){if(h=C,m=j,B=x,m<=p)break;E=Math.max(1,2*p-m)}}if(y(x+1,p)>h)break;w=z}if(b&&m>=0){const x=Math.min(f-1,m+d-1+B);for(let $=m;$<=x;$+=1)r[e[$]]&&(v[$]=1)}const k={isMatch:m>=0,score:Math.max(.001,C)};if(b){const x=kc(v,l);x.length?c&&(k.indices=x):k.isMatch=!1}return k}function vc(e){const t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}function Hr(e){if(e.length<=1)return e;e.sort((r,n)=>r[0]-n[0]||r[1]-n[1]);const t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){const s=t[t.length-1],i=e[r];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const ri={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},jc=new RegExp("["+Object.keys(ri).join("")+"]","g"),It=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(jc,t=>ri[t]):e=>e;var Ur=class{constructor(e,{location:t=K.location,threshold:r=K.threshold,distance:n=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:r,distance:n,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?It(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:vc(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:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?It(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return n&&(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:b})=>{const{isMatch:v,score:S,indices:w}=wc(e,m,y,{location:s+b,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:n,ignoreLocation:u});v&&(p=!0),f+=S,v&&w&&d.push(...w)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&n&&(h.indices=Hr(d)),h}};const Sc=new Set(["fuzzy","include"]);function Nc(e){return e.startsWith("inverse")}const ur=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const r=t===e;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let r=0,n;const s=[],i=e.length;for(;(n=t.indexOf(e,r))>-1;)r=n+i,s.push([n,r-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 r=t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const r=!t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const r=!t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const r=t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const r=t.indexOf(e)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const r=new Ur(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(n){return r.searchIn(n)}}}}],Ps=ur.length,Ac="\0",Ec="|";function $c(e){const t=[],r=e.length;let n=0;for(;n<r;){for(;n<r&&e[n]===" ";)n++;if(n>=r)break;let s=n;for(;s<r&&e[s]!==" "&&e[s]!=='"';)s++;if(s<r&&e[s]==='"'){for(s++;s<r;){if(e[s]==='"'){const i=s+1;if(i>=r||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=r||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(n,s)),n=s}else{for(;s<r&&e[s]!==" ";)s++;t.push(e.substring(n,s)),n=s}}return t}function Ls(e,t){const r=e.match(t);return r?r[1]:null}function Cc(e,t={}){return e.replace(/\\\|/g,Ac).split(Ec).map(r=>{const n=$c(r.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=n.length;i<a;i+=1){const l=n[i];let c=!1,u=-1;for(;!c&&++u<Ps;){const d=ur[u],f=Ls(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ps;){const d=ur[u],f=Ls(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Tc=class{constructor(e,{isCaseSensitive:t=K.isCaseSensitive,ignoreDiacritics:r=K.ignoreDiacritics,includeMatches:n=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:r,includeMatches:n,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=r?It(e):e,this.pattern=e,this.query=Cc(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:r,isCaseSensitive:n,ignoreDiacritics:s}=this.options;e=n?e:e.toLowerCase(),e=s?It(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:b,score:v}=m.search(e);if(y)i+=1,l+=v,Nc(m.type)&&(c=!0),r&&(Sc.has(m.type)?a.push(...b):a.push(b));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),r&&(p.indices=Hr(a)),p}}return{isMatch:!1,score:1}}};const dr=[];function Wr(...e){dr.push(...e)}function xn(e,t){for(let r=0,n=dr.length;r<n;r+=1){const s=dr[r];if(s.condition(e,t))return new s(e,t)}return new Ur(e,t)}const bn={AND:"$and",OR:"$or"},fr={PATH:"$path",PATTERN:"$val"},pr=e=>!!(e[bn.AND]||e[bn.OR]),Ic=e=>!!e[fr.PATH],Oc=e=>!Ye(e)&&qo(e)&&!pr(e),Bs=e=>({[bn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function si(e,t,{auto:r=!0}={}){const n=s=>{if(me(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=xn(s,t)),c}const i=Object.keys(s),a=Ic(s);if(!a&&i.length>1&&!pr(s))return n(Bs(s));if(Oc(s)){const c=a?s[fr.PATH]:i[0],u=a?s[fr.PATTERN]:s[c];if(!me(u))throw new Error(ic(c));const d={keyId:dn(c),pattern:u};return r&&(d.searcher=xn(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];Ye(u)&&u.forEach(d=>{l.children.push(n(d))})}),l};return pr(e)||(e=Bs(e)),n(e)}function hr(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){let r=1;return e.forEach(({key:n,norm:s,score:i})=>{const a=n?n.weight:null;r*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),r}function _c(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){e.forEach(r=>{r.score=hr(r.matches,{ignoreFieldNorm:t})})}var Mc=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 r=e-1>>1;if(this.comparator(t[e],t[r])<=0)break;const n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){const t=this.heap,r=t.length;let n=e;do{e=n;const s=2*e+1,i=2*e+2;if(s<r&&this.comparator(t[s],t[n])>0&&(n=s),i<r&&this.comparator(t[i],t[n])>0&&(n=i),n!==e){const a=t[e];t[e]=t[n],t[n]=a}}while(n!==e)}};function Rc(e){const t=[];return e.matches.forEach(r=>{if(!Ne(r.indices)||!r.indices.length)return;const n={indices:r.indices,value:r.value};r.key&&(n.key=r.key.id),r.idx>-1&&(n.refIndex=r.idx),t.push(n)}),t}function Pc(e,t,{includeMatches:r=K.includeMatches,includeScore:n=K.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return r&&(a.matches=Rc(s)),n&&(a.score=s.score),a})}const Lc=/[\p{L}\p{M}\p{N}_]+/gu,Ds=new WeakSet;function Bc(e){Ds.has(e)||(Ds.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 Dc(e){if(typeof e=="function"){let t=!1;return r=>{const n=e(r);if(!t&&(t=!0,!Array.isArray(n)||n.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(n)?"array containing non-strings":typeof n}.`);return n}}return e instanceof RegExp?(e.global||Bc(e),t=>t.match(e)||[]):t=>t.match(Lc)||[]}function mr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=Dc(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=It(s)),n(s)}}}var Fc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=mr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const r=this.analyzer.tokenize(e),{df:n,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of r){this.termSearchers.push(new Ur(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=n.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 r=0,n=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];n+=f,d.isMatch&&(s++,r+=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=n>0?1-r/n:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=Hr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Gn(e,t,r,n){const s=n.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(r,(e.docFieldCount.get(r)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(r);a||(a=new Map,e.docTermFieldHits.set(r,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 oi(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Gn(e,i,s,n);return}if(a)for(let l=0;l<r;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)Gn(e,u.v,s,n);else Gn(e,c.v,s,n)}}function zc(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)oi(n,s,t,r);return n}function Hc(e,t,r,n){oi(e,t,r,n)}function Uc(e,t){const r=e.docFieldCount.get(t);if(r===void 0)return;e.fieldCount-=r,e.docFieldCount.delete(t);const n=e.docTermFieldHits.get(t);if(n){for(const[s,i]of n){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Fs(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of r)Uc(e,l);const n=l=>{let c=0,u=r.length;for(;c<u;){const d=c+u>>>1;r[d]<l?c=d+1:u=d}return l-c},s=r[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>s?n(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>s?n(l):l,c);e.docTermFieldHits=a}var Qe=class{constructor(e,t,r){this.options={...K,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new dc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=xn(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 zr))throw new Error(oc);if(this._myIndex=t||ni(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=mr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=zc(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Ne(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=mr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Hc(this._invertedIndex,t,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],r=[];for(let n=0,s=this._docs.length;n<s;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){this._invertedIndex&&Fs(this._invertedIndex,r);const n=new Set(r);this._docs=this._docs.filter((s,i)=>!n.has(i)),this._myIndex.removeAll(r),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(cr);this._invertedIndex&&Fs(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:r=-1}=t||{},{includeMatches:n,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(me(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return un(r)&&r>-1&&(p=p.slice(0,r)),p}const c=i&&un(r)&&r>0&&me(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Mc(r,d);me(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=me(e)?me(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),_c(f,{ignoreFieldNorm:l}),i&&f.sort(me(e)?d:u),un(r)&&r>-1&&(f=f.slice(0,r));return Pc(f,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){const n=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(!Ne(l))return;const d=n.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=hr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=si(e,this.options),r=this._normalizedKeys(),n=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let y;return h===null?(y=[],r.forEach((b,v)=>{y.push(...this._findMatches({key:b,value:c[v],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],b=n(y,c,u);if(b.length)p.push(...b);else if(f===bn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ne(l)){const u=n(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:r}={}){const n=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(!Ne(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,m)=>{const y=this._findMatches({key:h,value:c[m],searcher:n});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=hr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:r}){if(!Ne(t))return[];const n=[];if(Ye(t))t.forEach(({v:s,i,n:a})=>{if(!Ne(s))return;const l=r.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),n.push(c)}});else{const{v:s,n:i}=t,a=r.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),n.push(l)}}return n}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let s=0;s<e.length;s++)n|=e[s].matchedMask||0;return n===2**t-1}const r=new Set;for(let n=0;n<e.length;n++){const s=e[n].matchedTerms;if(s)for(const i of s)r.add(i)}return r.size===t}};Qe.version="7.5.0";Qe.createIndex=ni;Qe.parseIndex=yc;Qe.config=K;Qe.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(uc);return xn(e,{...K,...r}).searchIn(t)};Qe.parseQuery=si;Wr(Tc);Wr(Fc);Qe.use=function(...e){e.forEach(t=>Wr(t))};var Wc=Qe;function ii(e,t,r={}){const[n,s]=g.useState(""),[i,a]=g.useState(""),l=r.debounceMs??150;g.useEffect(()=>{const f=setTimeout(()=>a(n),l);return()=>clearTimeout(f)},[n,l]);const c=g.useMemo(()=>t(e),[e,t]),u=g.useMemo(()=>new Wc(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:r.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,r.threshold]),d=g.useMemo(()=>i.trim()?u.search(i.trim(),{limit:r.limit??20}).map(f=>f.item):[],[u,i,r.limit]);return{query:n,setQuery:s,results:d,searchIndex:c}}function Kc(e,t={}){return ii(e,tc,t)}const gr="search-match",ai=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Gc(e,t){const r=t.trim().toLowerCase();if(!r)return[];const n=[],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(r);c!==-1;c=a.indexOf(r,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+r.length),n.push(u),l=c+r.length}}return n}function Vc(e,t){if(!ai())return;const r=Gc(e,t);if(!r.length){CSS.highlights.delete(gr);return}CSS.highlights.set(gr,new Highlight(...r))}function Vn(){ai()&&CSS.highlights.delete(gr)}function Jc(e,t){const r=g.useRef(null);g.useEffect(()=>{if(!e)return;const{targetId:n,query:s,highlight:i}=e;let a=!1;const l=u=>{if(a)return;const d=document.getElementById(n);if(!d){u<40&&setTimeout(()=>l(u+1),50);return}if(r.current!==n){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}r.current=n}i&&c(0)},c=u=>{if(a)return;const d=document.getElementById(n);d&&Vc(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function li({tabs:e,defaultTab:t,isTabKey:r,sections:n,searchQuery:s}){var I;const i=((I=e[0])==null?void 0:I.id)??t,[a,l]=g.useState(i),[c,u]=g.useState(null),d=E=>{l(E),u(E)},[f,p]=g.useState({}),h=e.some(E=>E.id===a)?a:i,m={};for(const E of n)m[E.id]=E.visible?f[E.id]??null:null;const y=(E,P)=>p(z=>({...z,[E]:P})),[b,v]=g.useState(null),[S,w]=g.useState(null),[C,B]=g.useState(null),H=E=>{r(E.tab)?d(E.tab):E.tab==="servers"&&u("servers");const P={};for(const z of n)P[z.id]=z.id===E.tab?E.key:null;p(P),v(E.focusSection??null),w(E.tab==="schemas"&&E.schemaFocusTokens?{tokens:E.schemaFocusTokens,id:E.targetId}:null),E.tab==="schemas"&&Vn(),B({targetId:E.targetId,query:s,highlight:E.tab!=="schemas"})},N=(E,P)=>{d(E),p(z=>{const J={...z};for(const j of n)j.id!=="servers"&&(J[j.id]=j.id===E?P:null);return J})},k=E=>{u("servers");const P={};for(const z of n)P[z.id]=z.id==="servers"?E:null;p(P)},x=E=>{r(E)&&d(E)},$=(()=>{for(const E of n){const P=m[E.id];if(P)return{tab:E.id,key:P}}return null})();return Jc(C,[h,b,S,...n.map(E=>m[E.id])]),g.useEffect(()=>{s.trim()||(B(null),Vn())},[s]),g.useEffect(()=>Vn,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:m,setSelectedKey:y,selectedNavItem:$,handleSearchSelect:H,handleNavItemSelect:N,handleNavServerSelect:k,handleContentTabChange:x,focusSection:b,schemaFocusTarget:S}}const V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),De=e=>V(e)?e:null,zs="^[\0-ÿ]*$",Zc=Math.pow(-2,31),Xc=Math.pow(2,31)-1,Yc=Math.pow(-2,63),Qc=Math.pow(2,63)-1,qc={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"},Kr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Kr(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function xr(e,t,r){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const n=Ot(e);n!==void 0&&r[n]&&(t["x-parser-schema-id"]=n)}function Hs(e,t,r){!(Array.isArray(e.type)&&e.type.includes("null"))&&!r&&(t.required=t.required||[],t.required.push(e.name))}function eu(e,t){let r=e,n=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";r=e[+s],n.oneOf!==void 0&&(n=n.oneOf[0])}return{type:r,jsonSchema:n}}function tu(e,t,r){if(!(t===void 0||r.examples||Array.isArray(e)))switch(e){case"boolean":r.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":r.examples=[parseInt(t,10)];break;default:r.examples=[t]}}function br(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function yr(e,t,r){const{type:n,jsonSchema:s}=eu(e,r);tu(n,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(n){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 Gr(e,t,r){t!==void 0&&(e[t]=r)}function _t(e,t){let r={};if(Array.isArray(e))return ru(r,e,t);const n=Kr(e),s=typeof e=="string"?e:n.type;switch(r.type=qc[s],s){case"int":{r.minimum=Zc,r.maximum=Xc;break}case"long":{r.minimum=Yc,r.maximum=Qc;break}case"bytes":{r.pattern=zs;break}case"fixed":{r.pattern=zs,r.minLength=n.size,r.maxLength=n.size;break}case"map":{r.additionalProperties=_t(n.values,t);break}case"array":{r.items=_t(n.items,t);break}case"enum":{r.enum=n.symbols;break}case"float":case"double":{r.format=s;break}case"record":{const i=nu(n,t,r);Gr(t,Ot(e),r),r.properties=Object.fromEntries(i.entries());break}default:{const i=t[Ot(e)]??(typeof s=="string"?t[s]:void 0);i&&(r=br(n)?{...i}:i);break}}return xr(n,r,t),yr(s,n,r),r}function nu(e,t,r){const n=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=br(s)?{...i}:i;Hs(s,r,s.default!==void 0),br(s)&&(xr(s,a,t),yr(s.type,s,a)),n.set(s.name,a)}else{const a=_t(s.type,t);Hs(s,r,s.default!==void 0),xr(s,a,t),yr(s.type,s,a),n.set(s.name,a),Gr(t,Ot(s.type),a)}}return n}function ru(e,t,r){const n=[];let s=null;for(const i of t){const a=_t(i,r);(typeof i=="string"?i:Kr(i).type)==="null"?s=a:(n.push(a),Gr(r,Ot(i),a))}return s&&n.push(s),e.oneOf=n,e}function kr(e){return _t(e,{})}const Us=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),su=new Set(["record","enum","array","map","fixed"]),Ws=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Vr(e){const t=[];return ut(e,"schema",t,new Set),t}function ut(e,t,r,n){if(typeof e=="string"){!Us.has(e)&&!Ws.test(e)&&r.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&r.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>ut(i,`${t}[${a}]`,r,n));return}if(!V(e)){r.push(`${t}: expected an Avro type string, object, or union`);return}if(n.has(e))return;n.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||V(s)?ut(s,`${t}.type`,r,n):r.push(`${t}: missing "type"`);return}if(!Us.has(s)&&!su.has(s)&&!Ws.test(s)){r.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){r.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"){r.push(`${l}: field must have a string "name"`);return}ut(i.type,`${l}.type`,r,n)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&r.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?r.push(`${t}: array must have "items"`):ut(e.items,`${t}.items`,r,n);break}case"map":{e.values===void 0?r.push(`${t}: map must have "values"`):ut(e.values,`${t}.values`,r,n);break}case"fixed":{typeof e.size!="number"&&r.push(`${t}: fixed must have a numeric "size"`);break}}}let yn=null,Jn=null;const wr=new Set;function ou(){return Jn||(Jn=Promise.resolve().then(()=>require("./protoToJsonSchema-BjH2ujBn.cjs")).then(e=>{yn=e.protoToJsonSchema,wr.forEach(t=>t())})),Jn}function iu(){return yn||ou(),yn}function au(e){return wr.add(e),()=>wr.delete(e)}function Ks(){return yn!==null}function Jr(){return g.useSyncExternalStore(au,Ks,Ks)}const lu="x-parser-original-payload",kn="x-lib-conversion-error",cu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,uu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Bt(e){return typeof e=="string"&&cu.test(e)}function Dt(e){return typeof e=="string"&&uu.test(e)}function ci(e){return V(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function ui(e){var t,r;if(typeof e!="string")return null;if(Bt(e)){const n=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return n?`avro ${n}`:"avro"}if(Dt(e)){const n=(r=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:r[1];return n?`protobuf ${n}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function di(e){return Bt(e)?"Avro":Dt(e)?"Protobuf":null}function du(e,t){return t?!1:!e||Bt(e)||Dt(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const fu=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],pu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function hu(e){return typeof e=="string"||Array.isArray(e)?!0:V(e)?typeof e.type=="string"&&pu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!fu.some(t=>t in e):!1}function Mt(e,t){let r=e;if(t&&V(r)&&typeof r.$ref=="string"){const a=t(r.$ref);a!==void 0&&(r=a)}const n=mu(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=ci(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function mu(e){var a;if(!ci(e))return{schema:De(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[lu],s=(a=De(r))==null?void 0:a[kn];if(typeof s=="string")return{schema:De(n)??{},schemaFormat:t,originalSchema:n,conversionError:s};if(n!==void 0)return{schema:De(r)??{},schemaFormat:t,originalSchema:n};if(Bt(t)&&hu(r)){const l=Vr(r);if(l.length>0)return{schema:De(r)??{},schemaFormat:t,originalSchema:r,conversionError:l[0]};try{return{schema:kr(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:De(r)??{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Dt(t)&&typeof r=="string"){const l=iu();if(!l)return{schema:{},schemaFormat:t,originalSchema:r,pendingConversion:!0};try{return{schema:l(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=De(r);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:r}}const ce=(e,t)=>`${"#".repeat(e)} ${t}`,O=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),vt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),gu={objects:new Set,refs:new Set};function fn(e,t,r=gu){if(e===null||typeof e!="object")return e;if(r.objects.has(e)||vt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const i=vt(e)?e["x-parser-schema-id"]:void 0;return typeof i=="string"?{$ref:`#/components/schemas/${i} (circular)`}:"[circular reference]"}const n={objects:new Set(r.objects).add(e),refs:vt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(i=>fn(i,t,n));if(vt(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return vt(i)||Array.isArray(i)?fn(i,t,n):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=fn(a,t,n);return s}function wn(e,t,r){if(!t)return"";const n=fn(t,r);return`${ce(4,`\`${O(e)}\``)}
|
|
7
|
+
|
|
8
|
+
\`\`\`json
|
|
9
|
+
${JSON.stringify(n,null,2)}
|
|
10
|
+
\`\`\``}function Et(e,t,r){if(!t||typeof t=="boolean")return"";const{schema:n,description:s,conversionError:i,pendingConversion:a}=Mt(t,r);if(a)return`${ce(4,`\`${O(e)}\``)}
|
|
11
|
+
|
|
12
|
+
_(schema conversion still in progress)_`;if(i)return`${ce(4,`\`${O(e)}\``)}
|
|
13
|
+
|
|
14
|
+
_(could not convert schema: ${O(i)})_`;const l=s&&!n.description?{...n,description:s}:n;return wn(e,l,r)}function fi(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${O(e.in)}${e.name?`: \`${O(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${O(e.bearerFormat)})`:""}`;case"openIdConnect":return"OpenID Connect";case"oauth2":return"OAuth2";case"mutualTLS":return"Mutual TLS";case"X509":return"X.509 Certificate";case"userPassword":return"User / Password";case"plain":case"scramSha256":case"scramSha512":return"SASL";case"gssapi":return"SASL (GSSAPI)";case"symmetricEncryption":return"Symmetric Encryption";case"asymmetricEncryption":return"Asymmetric Encryption";default:return O(e.type)}}function xu(e){if(!(e!=null&&e.length))return"";const t=[];for(const r of e)if(r!=null&&r.type&&(t.push(`- **${fi(r)}**`),r.description&&t.push(` ${O(r.description)}`),r.type==="openIdConnect"&&r.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${O(r.openIdConnectUrl)}\``),r.type==="oauth2"))for(const[n,s]of Object.entries(r.flows??{})){t.push(` - Flow \`${O(n)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${O(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${O(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${O(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${O(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
|
|
15
|
+
`)].join(`
|
|
16
|
+
|
|
17
|
+
`):""}function pi(e){const t=[],{info:r}=e;t.push(ce(1,O(r.title)));const n=[`**Version:** ${O(r.version)}`];if(r.license&&n.push(`**License:** ${O(r.license.name)}${r.license.url?` (${O(r.license.url)})`:""}`),r.contact){const s=[r.contact.name,r.contact.email].filter(Boolean).map(O).join(" ");s&&n.push(`**Contact:** ${s}`)}if(t.push(n.join(`
|
|
18
|
+
`)),r.description&&t.push(O(r.description)),e.servers&&Object.keys(e.servers).length){const s=[ce(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(ce(3,O(i)));const l=[`**Host:** \`${O(a.host)}${a.pathname?O(a.pathname):""}\``];l.push(`**Protocol:** ${O(a.protocol)}${a.protocolVersion?` ${O(a.protocolVersion)}`:""}`),a.description&&l.push(O(a.description)),s.push(l.join(`
|
|
19
|
+
`));const c=xu(a.security);c&&s.push(c)}t.push(s.join(`
|
|
20
|
+
|
|
21
|
+
`))}return t}function Zr(e,t=Lt(e)){var i,a,l;const r=pi(e);if(e.operations&&Object.keys(e.operations).length){const c=[ce(2,"Operations")];for(const[u,d]of Object.entries(e.operations)){const f=d.channel;c.push(ce(3,`${O((i=d.action)==null?void 0:i.toUpperCase())} \`${O(u)}\``));const p=[];f!=null&&f.address&&p.push(`**Channel:** \`${O(f.address)}\``),d.summary&&p.push(O(d.summary)),d.description&&p.push(O(d.description));const h=d.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${O(m.name??m.title??"message")}\``).join(", ")}`),c.push(p.join(`
|
|
22
|
+
|
|
23
|
+
`))}r.push(c.join(`
|
|
24
|
+
|
|
25
|
+
`))}const n=(a=e.components)==null?void 0:a.messages;if(n&&Object.keys(n).length){const c=[ce(2,"Messages")];for(const[u,d]of Object.entries(n)){c.push(ce(3,O(d.title??d.name??u)));const f=[];d.summary&&f.push(O(d.summary)),d.description&&f.push(O(d.description)),d.contentType&&f.push(`**Content-Type:** \`${O(d.contentType)}\``),c.push(f.join(`
|
|
26
|
+
|
|
27
|
+
`)),d.payload&&c.push(Et("payload",d.payload,t)),d.headers&&c.push(Et("headers",d.headers,t))}r.push(c.join(`
|
|
28
|
+
|
|
29
|
+
`))}const s=(l=e.components)==null?void 0:l.schemas;if(s&&Object.keys(s).length){const c=[ce(2,"Schemas")];for(const[u,d]of Object.entries(s))c.push(Et(u,d,t));r.push(c.join(`
|
|
30
|
+
|
|
31
|
+
`))}return r.filter(Boolean).join(`
|
|
32
|
+
|
|
33
|
+
`)}function bu(e,t,r){var l;const n=t.channel,s=[ce(3,`${O((l=t.action)==null?void 0:l.toUpperCase())} \`${O(e)}\``)],i=[];n!=null&&n.address&&i.push(`**Channel:** \`${O(n.address)}\``),t.summary&&i.push(O(t.summary)),t.description&&i.push(O(t.description)),s.push(i.join(`
|
|
34
|
+
|
|
35
|
+
`));const a=t.messages??[];for(const c of a){const u=[ce(4,O(c.title??c.name??"Message"))],d=[];c.summary&&d.push(O(c.summary)),c.description&&d.push(O(c.description)),c.contentType&&d.push(`**Content-Type:** \`${O(c.contentType)}\``),d.length&&u.push(d.join(`
|
|
36
|
+
|
|
37
|
+
`)),s.push(u.join(`
|
|
38
|
+
|
|
39
|
+
`)),c.payload&&s.push(Et("payload",c.payload,r)),c.headers&&s.push(Et("headers",c.headers,r))}return s.filter(Boolean).join(`
|
|
40
|
+
|
|
41
|
+
`)}function hi(e,t,r=Lt(e)){var i;const n=(i=e.operations)==null?void 0:i[t];if(!n)return"";const s=pi(e);return s.push(bu(t,n,r)),s.filter(Boolean).join(`
|
|
42
|
+
|
|
43
|
+
`)}function yu(e,t){if(!e.length||!t)return"";const r=new Map;for(const i of e)for(const[a,l]of Object.entries(i)){if(!l.length)continue;const c=r.get(a)??[];r.set(a,Array.from(new Set([...c,...l])))}const n=Array.from(new Set(e.flatMap(i=>Object.keys(i)))),s=[];for(const i of n){const a=t[i];if(!a)continue;const l=r.get(i);if(s.push(`- **${fi(a)}** (\`${O(i)}\`)`),a.description&&s.push(` ${O(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${O(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${O(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${O(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${O(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${O(u.refreshUrl)}\``);const d=l!=null&&l.length?l:Object.keys(u.scopes??{});d.length&&s.push(` - ${l!=null&&l.length?"Required scopes":"Scopes"}: ${d.map(f=>`\`${O(f)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${O(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
|
|
44
|
+
`)].join(`
|
|
45
|
+
|
|
46
|
+
`):""}function mi(e,t,r,n,s,i){var p;const a=[ce(3,`${e.toUpperCase()} \`${O(t)}\``)],l=[];r.summary&&l.push(O(r.summary)),r.description&&l.push(O(r.description)),r.deprecated&&l.push("**Deprecated**");const c=r.security??i??[],u=yu(c,s);u&&l.push(u);for(const h of["path","query","header","cookie"]){const m=(r.parameters??[]).filter(y=>y.in===h);if(m.length){l.push(`**${h[0].toUpperCase()}${h.slice(1)} Parameters:**`);for(const y of m){const b=y.schema;l.push(`- \`${O(y.name)}\`${y.required?" (required)":""}${b!=null&&b.type?` — ${O(b.type)}`:""}${y.description?`: ${O(y.description)}`:""}`)}}}a.push(l.join(`
|
|
47
|
+
|
|
48
|
+
`));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,m]of Object.entries(d))a.push([`**Request Body** (\`${O(h)}\`)`,wn("body",m.schema,n)].join(`
|
|
49
|
+
|
|
50
|
+
`));const f=r.responses??{};for(const[h,m]of Object.entries(f)){const y=[ce(4,`${h}${m.description?`: ${O(m.description)}`:""}`)];for(const[b,v]of Object.entries(m.content??{}))y.push([`**Body** (\`${O(b)}\`)`,wn("body",v.schema,n)].join(`
|
|
51
|
+
|
|
52
|
+
`));a.push(y.join(`
|
|
53
|
+
|
|
54
|
+
`))}return a.join(`
|
|
55
|
+
|
|
56
|
+
`)}function Xr(e,t=Lt(e)){var a,l,c,u,d;const r=[],{info:n}=e;if(r.push(ce(1,O(n.title))),r.push(`**Version:** ${O(n.version)}`),n.description&&r.push(O(n.description)),(a=e.servers)!=null&&a.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${O(p.url)}\`${p.description?` — ${O(p.description)}`:""}`);r.push(f.join(`
|
|
57
|
+
`))}const s=e.paths?Tt(e.paths):[];if(s.length){const f=[ce(2,"Endpoints")];for(const{method:p,path:h}of s){const m=(c=(l=e.paths)==null?void 0:l[h])==null?void 0:c[p];m&&f.push(mi(p,h,m,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}r.push(f.join(`
|
|
58
|
+
|
|
59
|
+
`))}const i=(d=e.components)==null?void 0:d.schemas;if(i&&Object.keys(i).length){const f=[ce(2,"Schemas")];for(const[p,h]of Object.entries(i))f.push(wn(p,h,t));r.push(f.join(`
|
|
60
|
+
|
|
61
|
+
`))}return r.filter(Boolean).join(`
|
|
62
|
+
|
|
63
|
+
`)}function gi(e,t,r,n=Lt(e)){var l,c,u,d;const s=(c=(l=e.paths)==null?void 0:l[r])==null?void 0:c[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(ce(1,O(a.title))),i.push(`**Version:** ${O(a.version)}`),a.description&&i.push(O(a.description)),(u=e.servers)!=null&&u.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${O(p.url)}\`${p.description?` — ${O(p.description)}`:""}`);i.push(f.join(`
|
|
64
|
+
`))}return i.push(mi(t,r,s,n,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
|
|
65
|
+
|
|
66
|
+
`)}const ku=/^(https?:|data:image\/)/i;function Yr(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:r,altText:n,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof r!="string"||!ku.test(r)?null:{url:r,altText:typeof n=="string"&&n?n:void 0,backgroundColor:typeof s=="string"?s:void 0}}const xi={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},wu=()=>Promise.resolve().then(()=>require("./LogoExtension-D27JNW7U.cjs"));function Qr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var at=Qr();function bi(e){at=e}var $t={exec:()=>null};function ee(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(ye.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var ye={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")},vu=/^(?:[ \t]*(?:\n|$))+/,ju=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Su=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ft=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qr=/(?:[*+-]|\d{1,9}[.)])/,yi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ki=ee(yi).replace(/bull/g,qr).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(),Au=ee(yi).replace(/bull/g,qr).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(),es=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Eu=/^[^\n]+/,ts=/(?!\s*\])(?:\\.|[^\[\]\\])+/,$u=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ts).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Cu=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qr).getRegex(),Mn="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",ns=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tu=ee("^ {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",ns).replace("tag",Mn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wi=ee(es).replace("hr",Ft).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",Mn).getRegex(),Iu=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wi).getRegex(),rs={blockquote:Iu,code:ju,def:$u,fences:Su,heading:Nu,hr:Ft,html:Tu,lheading:ki,list:Cu,newline:vu,paragraph:wi,table:$t,text:Eu},Gs=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ft).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",Mn).getRegex(),Ou={...rs,lheading:Au,table:Gs,paragraph:ee(es).replace("hr",Ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gs).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",Mn).getRegex()},_u={...rs,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ns).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:$t,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee(es).replace("hr",Ft).replace("heading",` *#{1,6} *[^
|
|
67
|
+
]`).replace("lheading",ki).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Mu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ru=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vi=/^( {2,}|\\)\n(?!\s*$)/,Pu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Rn=/[\p{P}\p{S}]/u,ss=/[\s\p{P}\p{S}]/u,ji=/[^\s\p{P}\p{S}]/u,Lu=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ss).getRegex(),Si=/(?!~)[\p{P}\p{S}]/u,Bu=/(?!~)[\s\p{P}\p{S}]/u,Du=/(?:[^\s\p{P}\p{S}]|~)/u,Fu=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ni=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zu=ee(Ni,"u").replace(/punct/g,Rn).getRegex(),Hu=ee(Ni,"u").replace(/punct/g,Si).getRegex(),Ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Uu=ee(Ai,"gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,ss).replace(/punct/g,Rn).getRegex(),Wu=ee(Ai,"gu").replace(/notPunctSpace/g,Du).replace(/punctSpace/g,Bu).replace(/punct/g,Si).getRegex(),Ku=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,ss).replace(/punct/g,Rn).getRegex(),Gu=ee(/\\(punct)/,"gu").replace(/punct/g,Rn).getRegex(),Vu=ee(/^<(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(),Ju=ee(ns).replace("(?:-->|$)","-->").getRegex(),Zu=ee("^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",Ju).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Xu=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ei=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",vn).replace("ref",ts).getRegex(),$i=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",ts).getRegex(),Yu=ee("reflink|nolink(?!\\()","g").replace("reflink",Ei).replace("nolink",$i).getRegex(),os={_backpedal:$t,anyPunctuation:Gu,autolink:Vu,blockSkip:Fu,br:vi,code:Ru,del:$t,emStrongLDelim:zu,emStrongRDelimAst:Uu,emStrongRDelimUnd:Ku,escape:Mu,link:Xu,nolink:$i,punctuation:Lu,reflink:Ei,reflinkSearch:Yu,tag:Zu,text:Pu,url:$t},Qu={...os,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",vn).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vn).getRegex()},vr={...os,emStrongRDelimAst:Wu,emStrongLDelim:Hu,url:ee(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},qu={...vr,br:ee(vi).replace("{2,}","*").getRegex(),text:ee(vr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qt={normal:rs,gfm:Ou,pedantic:_u},jt={normal:os,gfm:vr,breaks:qu,pedantic:Qu},ed={"&":"&","<":"<",">":">",'"':""","'":"'"},Vs=e=>ed[e];function Re(e,t){if(t){if(ye.escapeTest.test(e))return e.replace(ye.escapeReplace,Vs)}else if(ye.escapeTestNoEncode.test(e))return e.replace(ye.escapeReplaceNoEncode,Vs);return e}function Js(e){try{e=encodeURI(e).replace(ye.percentDecode,"%")}catch{return null}return e}function Zs(e,t){var i;const r=e.replace(ye.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ye.splitPipe);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ye.slashPipe,"|");return n}function St(e,t,r){const n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function td(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Xs(e,t,r,n,s){const i=t.href,a=t.title||null,l=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,c}function nd(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const s=n[1];return t.split(`
|
|
68
|
+
`).map(i=>{const a=i.match(r.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
69
|
+
`)}var jn=class{constructor(e){re(this,"options");re(this,"rules");re(this,"lexer");this.options=e||at}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 r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:St(r,`
|
|
70
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=nd(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=St(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:St(t[0],`
|
|
71
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=St(t[0],`
|
|
72
|
+
`).split(`
|
|
73
|
+
`),n="",s="";const i=[];for(;r.length>0;){let a=!1;const l=[];let c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))l.push(r[c]),a=!0;else if(!a)l.push(r[c]);else break;r=r.slice(c);const u=l.join(`
|
|
74
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
75
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
76
|
+
${u}`:u,s=s?`${s}
|
|
77
|
+
${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,r.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
|
|
78
|
+
`+r.join(`
|
|
79
|
+
`),y=this.blockquote(m);i[i.length-1]=y,n=n.substring(0,n.length-h.raw.length)+y.raw,s=s.substring(0,s.length-h.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
|
|
80
|
+
`+r.join(`
|
|
81
|
+
`),y=this.list(m);i[i.length-1]=y,n=n.substring(0,n.length-p.raw.length)+y.raw,s=s.substring(0,s.length-h.raw.length)+y.raw,r=m.substring(i.at(-1).raw.length).split(`
|
|
82
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const i=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let c=!1,u="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(`
|
|
83
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),p=e.split(`
|
|
84
|
+
`,1)[0],h=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
85
|
+
`,e=e.substring(p.length+1),c=!0),!c){const v=this.rules.other.nextBulletRegex(m),S=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;e;){const H=e.split(`
|
|
86
|
+
`,1)[0];let N;if(p=H,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),N=p):N=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||C.test(p)||B.test(p)||v.test(p)||S.test(p))break;if(N.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
|
|
87
|
+
`+N.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||C.test(f)||S.test(f))break;d+=`
|
|
88
|
+
`+p}!h&&!p.trim()&&(h=!0),u+=H+`
|
|
89
|
+
`,e=e.substring(H.length+1),f=N.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let y=null,b;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(b=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!y,checked:b,loose:!1,text:d,tokens:[]}),s.raw+=u}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const u=s.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=Zs(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
90
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const l of n)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(const l of s)i.rows.push(Zs(l,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
91
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const i=St(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=td(t[2],"()");if(i===-2)return;if(i>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Xs(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Xs(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const i=[...n[0]].length-1;let a,l,c=i,u=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(n=d.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...n[0]][0].length,p=e.slice(0,i+n.index+f+l);if(Math.min(i,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let i;do i=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(i!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},He=class jr{constructor(t){re(this,"tokens");re(this,"options");re(this,"state");re(this,"tokenizer");re(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||at,this.options.tokenizer=this.options.tokenizer||new jn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:ye,block:Qt.normal,inline:jt.normal};this.options.pedantic?(r.block=Qt.pedantic,r.inline=jt.pedantic):this.options.gfm&&(r.block=Qt.gfm,this.options.breaks?r.inline=jt.breaks:r.inline=jt.gfm),this.tokenizer.rules=r}static get rules(){return{block:Qt,inline:jt}}static lex(t,r){return new jr(r).lex(t)}static lexInline(t,r){return new jr(r).inlineTokens(t)}lex(t){t=t.replace(ye.carriageReturn,`
|
|
92
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var s,i,a;for(this.options.pedantic&&(t=t.replace(ye.tabCharGlobal," ").replace(ye.spaceLine,""));t;){let l;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(u=>(l=u.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const u=r.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
93
|
+
`:r.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
94
|
+
`+l.raw,u.text+=`
|
|
95
|
+
`+l.text,this.inlineQueue.at(-1).src=u.text):r.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
96
|
+
`+l.raw,u.text+=`
|
|
97
|
+
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
98
|
+
`+l.raw,u.text+=`
|
|
99
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(l),n=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
100
|
+
`+l.raw,u.text+=`
|
|
101
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(l);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var l,c,u;let n=t,s=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(p=>(d=p.call({lexer:this},t,r))?(t=t.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const p=r.at(-1);d.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(t,n,a)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),r.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(y=>{m=y.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(f=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):r.push(d);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},Sn=class{constructor(e){re(this,"options");re(this,"parser");this.options=e||at}space(e){return""}code({text:e,lang:t,escaped:r}){var i;const n=(i=(t||"").match(ye.notSpaceStart))==null?void 0:i[0],s=e.replace(ye.endingNewline,"")+`
|
|
102
|
+
`;return n?'<pre><code class="language-'+Re(n)+'">'+(r?s:Re(s,!0))+`</code></pre>
|
|
103
|
+
`:"<pre><code>"+(r?s:Re(s,!0))+`</code></pre>
|
|
104
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
105
|
+
${this.parser.parse(e)}</blockquote>
|
|
106
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
107
|
+
`}hr(e){return`<hr>
|
|
108
|
+
`}list(e){const t=e.ordered,r=e.start;let n="";for(let a=0;a<e.items.length;a++){const l=e.items[a];n+=this.listitem(l)}const s=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+s+i+`>
|
|
109
|
+
`+n+"</"+s+`>
|
|
110
|
+
`}listitem(e){var r;let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+Re(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
111
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
112
|
+
`}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let n="";for(let s=0;s<e.rows.length;s++){const i=e.rows[s];r="";for(let a=0;a<i.length;a++)r+=this.tablecell(i[a]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
113
|
+
<thead>
|
|
114
|
+
`+t+`</thead>
|
|
115
|
+
`+n+`</table>
|
|
116
|
+
`}tablerow({text:e}){return`<tr>
|
|
117
|
+
${e}</tr>
|
|
118
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
119
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Re(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=Js(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+Re(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const s=Js(e);if(s===null)return Re(r);e=s;let i=`<img src="${e}" alt="${r}"`;return t&&(i+=` title="${Re(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Re(e.text)}},is=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ue=class Sr{constructor(t){re(this,"options");re(this,"renderer");re(this,"textRenderer");this.options=t||at,this.options.renderer=this.options.renderer||new Sn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new is}static parse(t,r){return new Sr(r).parse(t)}static parseInline(t,r){return new Sr(r).parseInline(t)}parse(t,r=!0){var s,i;let n="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=l,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){n+=d||"";continue}}const c=l;switch(c.type){case"space":{n+=this.renderer.space(c);continue}case"hr":{n+=this.renderer.hr(c);continue}case"heading":{n+=this.renderer.heading(c);continue}case"code":{n+=this.renderer.code(c);continue}case"table":{n+=this.renderer.table(c);continue}case"blockquote":{n+=this.renderer.blockquote(c);continue}case"list":{n+=this.renderer.list(c);continue}case"html":{n+=this.renderer.html(c);continue}case"paragraph":{n+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],d+=`
|
|
120
|
+
`+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):n+=d;continue}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,r=this.renderer){var s,i;let n="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=u||"";continue}}const c=l;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},ir,pn=(ir=class{constructor(e){re(this,"options");re(this,"block");this.options=e||at}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?He.lex:He.lexInline}provideParser(){return this.block?Ue.parse:Ue.parseInline}},re(ir,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),ir),Ci=class{constructor(...e){re(this,"defaults",Qr());re(this,"options",this.setOptions);re(this,"parse",this.parseMarkdown(!0));re(this,"parseInline",this.parseMarkdown(!1));re(this,"Parser",Ue);re(this,"Renderer",Sn);re(this,"TextRenderer",is);re(this,"Lexer",He);re(this,"Tokenizer",jn);re(this,"Hooks",pn);this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=i;r=r.concat(this.walkTokens(a.items,t));break}default:{const a=i;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){const s=this.defaults.renderer||new Sn(this.defaults);for(const i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=r.renderer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}n.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new jn(this.defaults);for(const i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=r.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new pn;for(const i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=r.hooks[a],c=s[a];pn.passThroughHooks.has(i)?s[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(s,u)).then(f=>c.call(s,f));const d=l.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return He.lex(e,t??this.defaults)}parser(e,t){return Ue.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{const s={...n},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const l=i.hooks?i.hooks.provideLexer():e?He.lex:He.lexInline,c=i.hooks?i.hooks.provideParser():e?Ue.parse:Ue.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>c(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(r=i.hooks.preprocess(r));let u=l(r,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let d=c(u,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(u){return a(u)}}}onError(e,t){return r=>{if(r.message+=`
|
|
121
|
+
Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Re(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},rt=new Ci;function oe(e,t){return rt.parse(e,t)}oe.options=oe.setOptions=function(e){return rt.setOptions(e),oe.defaults=rt.defaults,bi(oe.defaults),oe};oe.getDefaults=Qr;oe.defaults=at;oe.use=function(...e){return rt.use(...e),oe.defaults=rt.defaults,bi(oe.defaults),oe};oe.walkTokens=function(e,t){return rt.walkTokens(e,t)};oe.parseInline=rt.parseInline;oe.Parser=Ue;oe.parser=Ue.parse;oe.Renderer=Sn;oe.TextRenderer=is;oe.Lexer=He;oe.lexer=He.lex;oe.Tokenizer=jn;oe.Hooks=pn;oe.parse=oe;oe.options;oe.setOptions;oe.use;oe.walkTokens;oe.parseInline;Ue.parse;He.lex;function rd(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const r=Ys(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,r,t.lang||"")).then(Qs(t));const n=e.highlight(t.text,r,t.lang||"");if(n instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Qs(t)(n)},useNewRenderer:!0,renderer:{code(t,r,n){typeof t=="object"&&(n=t.escaped,r=t.lang,t=t.text);const s=Ys(r),i=s?e.langPrefix+eo(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${n?t:eo(t,!0)}
|
|
122
|
+
</code></pre>`}}}}function Ys(e){return(e||"").match(/\S*/)[0]}function Qs(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Ti=/[&<>"']/,sd=new RegExp(Ti.source,"g"),Ii=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,od=new RegExp(Ii.source,"g"),id={"&":"&","<":"<",">":">",'"':""","'":"'"},qs=e=>id[e];function eo(e,t){if(t){if(Ti.test(e))return e.replace(sd,qs)}else if(Ii.test(e))return e.replace(od,qs);return e}var ad=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ld(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function _i(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const r=e[t],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&_i(r)}),e}class to{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ve(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const s in n)r[s]=n[s]}),r}const cd="</span>",no=e=>!!e.scope,ud=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map((n,s)=>`${n}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class dd{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Mi(t)}openNode(t){if(!no(t))return;const r=ud(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){no(t)&&(this.buffer+=cd)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const ro=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class as{constructor(){this.rootNode=ro(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r=ro({scope:t});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{as._collapse(r)}))}}class fd extends as{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,r){const n=t.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new dd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Rt(e){return e?typeof e=="string"?e:e.source:null}function Ri(e){return lt("(?=",e,")")}function pd(e){return lt("(?:",e,")*")}function hd(e){return lt("(?:",e,")?")}function lt(...e){return e.map(r=>Rt(r)).join("")}function md(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ls(...e){return"("+(md(e).capture?"":"?:")+e.map(n=>Rt(n)).join("|")+")"}function Pi(e){return new RegExp(e.toString()+"|").exec("").length-1}function gd(e,t){const r=e&&e.exec(t);return r&&r.index===0}const xd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cs(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const s=r;let i=Rt(n),a="";for(;i.length>0;){const l=xd.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&r++)}return a}).map(n=>`(${n})`).join(t)}const bd=/\b\B/,Li="[a-zA-Z]\\w*",us="[a-zA-Z_]\\w*",Bi="\\b\\d+(\\.\\d+)?",Di="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Fi="\\b(0b[01]+)",yd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",kd=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=lt(t,/.*\b/,e.binary,/\b.*/)),Ve({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},Pt={begin:"\\\\[\\s\\S]",relevance:0},wd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pt]},vd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pt]},jd={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Pn=function(e,t,r={}){const n=Ve({scope:"comment",begin:e,end:t,contains:[]},r);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ls("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:lt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},Sd=Pn("//","$"),Nd=Pn("/\\*","\\*/"),Ad=Pn("#","$"),Ed={scope:"number",begin:Bi,relevance:0},$d={scope:"number",begin:Di,relevance:0},Cd={scope:"number",begin:Fi,relevance:0},Td={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pt,{begin:/\[/,end:/\]/,relevance:0,contains:[Pt]}]},Id={scope:"title",begin:Li,relevance:0},Od={scope:"title",begin:us,relevance:0},_d={begin:"\\.\\s*"+us,relevance:0},Md=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var qt=Object.freeze({__proto__:null,APOS_STRING_MODE:wd,BACKSLASH_ESCAPE:Pt,BINARY_NUMBER_MODE:Cd,BINARY_NUMBER_RE:Fi,COMMENT:Pn,C_BLOCK_COMMENT_MODE:Nd,C_LINE_COMMENT_MODE:Sd,C_NUMBER_MODE:$d,C_NUMBER_RE:Di,END_SAME_AS_BEGIN:Md,HASH_COMMENT_MODE:Ad,IDENT_RE:Li,MATCH_NOTHING_RE:bd,METHOD_GUARD:_d,NUMBER_MODE:Ed,NUMBER_RE:Bi,PHRASAL_WORDS_MODE:jd,QUOTE_STRING_MODE:vd,REGEXP_MODE:Td,RE_STARTERS_RE:yd,SHEBANG:kd,TITLE_MODE:Id,UNDERSCORE_IDENT_RE:us,UNDERSCORE_TITLE_MODE:Od});function Rd(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Pd(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Ld(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Rd,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Bd(e,t){Array.isArray(e.illegal)&&(e.illegal=ls(...e.illegal))}function Dd(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Fd(e,t){e.relevance===void 0&&(e.relevance=1)}const zd=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=r.keywords,e.begin=lt(r.beforeMatch,Ri(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Hd=["of","and","for","in","not","or","if","then","parent","list","value"],Ud="keyword";function zi(e,t,r=Ud){const n=Object.create(null);return typeof e=="string"?s(r,e.split(" ")):Array.isArray(e)?s(r,e):Object.keys(e).forEach(function(i){Object.assign(n,zi(e[i],t,i))}),n;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");n[c[0]]=[i,Wd(c[0],c[1])]})}}function Wd(e,t){return t?Number(t):Kd(e)?0:1}function Kd(e){return Hd.includes(e.toLowerCase())}const so={},nt=e=>{console.error(e)},oo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ct=(e,t)=>{so[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),so[`${e}/${t}`]=!0)},Nn=new Error;function Hi(e,t,{key:r}){let n=0;const s=e[r],i={},a={};for(let l=1;l<=t.length;l++)a[l+n]=s[l],i[l+n]=!0,n+=Pi(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Gd(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw nt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Nn;if(typeof e.beginScope!="object"||e.beginScope===null)throw nt("beginScope must be object"),Nn;Hi(e,e.begin,{key:"beginScope"}),e.begin=cs(e.begin,{joinWith:""})}}function Vd(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw nt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Nn;if(typeof e.endScope!="object"||e.endScope===null)throw nt("endScope must be object"),Nn;Hi(e,e.end,{key:"endScope"}),e.end=cs(e.end,{joinWith:""})}}function Jd(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Zd(e){Jd(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Gd(e),Vd(e)}function Xd(e){function t(a,l){return new RegExp(Rt(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=Pi(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(cs(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,p)=>p>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new r;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new n;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[Pd,Dd,Zd,zd].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Ld,Bd,Fd].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=zi(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Rt(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Yd(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),c.matcher=s(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ve(e.classNameAliases||{}),i(e)}function Ui(e){return e?e.endsWithParent||Ui(e.starts):!1}function Yd(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ve(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ui(e)?Ve(e,{starts:e.starts?Ve(e.starts):null}):Object.isFrozen(e)?Ve(e):e}var Qd="11.11.1";class qd extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const Zn=Mi,io=Ve,ao=Symbol("nomatch"),ef=7,Wi=function(e){const t=Object.create(null),r=Object.create(null),n=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:fd};function c(j){return l.noHighlightRe.test(j)}function u(j){let A=j.className+" ";A+=j.parentNode?j.parentNode.className:"";const M=l.languageDetectRe.exec(A);if(M){const Z=k(M[1]);return Z||(oo(i.replace("{}",M[1])),oo("Falling back to no-highlight mode for this block.",j)),Z?M[1]:"no-highlight"}return A.split(/\s+/).find(Z=>c(Z)||k(Z))}function d(j,A,M){let Z="",Q="";typeof A=="object"?(Z=j,M=A.ignoreIllegals,Q=A.language):(ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),ct("10.7.0",`Please use highlight(code, options) instead.
|
|
123
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Q=j,Z=A),M===void 0&&(M=!0);const se={code:Z,language:Q};z("before:highlight",se);const ue=se.result?se.result:f(se.language,se.code,M);return ue.code=se.code,z("after:highlight",ue),ue}function f(j,A,M,Z){const Q=Object.create(null);function se(T,R){return T.keywords[R]}function ue(){if(!U.keywords){de.addText(ne);return}let T=0;U.keywordPatternRe.lastIndex=0;let R=U.keywordPatternRe.exec(ne),G="";for(;R;){G+=ne.substring(T,R.index);const Y=ie.case_insensitive?R[0].toLowerCase():R[0],pe=se(U,Y);if(pe){const[Be,Ya]=pe;if(de.addText(G),G="",Q[Y]=(Q[Y]||0)+1,Q[Y]<=ef&&(qe+=Ya),Be.startsWith("_"))G+=R[0];else{const Qa=ie.classNameAliases[Be]||Be;L(R[0],Qa)}}else G+=R[0];T=U.keywordPatternRe.lastIndex,R=U.keywordPatternRe.exec(ne)}G+=ne.substring(T),de.addText(G)}function fe(){if(ne==="")return;let T=null;if(typeof U.subLanguage=="string"){if(!t[U.subLanguage]){de.addText(ne);return}T=f(U.subLanguage,ne,!0,he[U.subLanguage]),he[U.subLanguage]=T._top}else T=h(ne,U.subLanguage.length?U.subLanguage:null);U.relevance>0&&(qe+=T.relevance),de.__addSublanguage(T._emitter,T.language)}function le(){U.subLanguage!=null?fe():ue(),ne=""}function L(T,R){T!==""&&(de.startScope(R),de.addText(T),de.endScope())}function F(T,R){let G=1;const Y=R.length-1;for(;G<=Y;){if(!T._emit[G]){G++;continue}const pe=ie.classNameAliases[T[G]]||T[G],Be=R[G];pe?L(Be,pe):(ne=Be,ue(),ne=""),G++}}function _(T,R){return T.scope&&typeof T.scope=="string"&&de.openNode(ie.classNameAliases[T.scope]||T.scope),T.beginScope&&(T.beginScope._wrap?(L(ne,ie.classNameAliases[T.beginScope._wrap]||T.beginScope._wrap),ne=""):T.beginScope._multi&&(F(T.beginScope,R),ne="")),U=Object.create(T,{parent:{value:U}}),U}function W(T,R,G){let Y=gd(T.endRe,G);if(Y){if(T["on:end"]){const pe=new to(T);T["on:end"](R,pe),pe.isMatchIgnored&&(Y=!1)}if(Y){for(;T.endsParent&&T.parent;)T=T.parent;return T}}if(T.endsWithParent)return W(T.parent,R,G)}function X(T){return U.matcher.regexIndex===0?(ne+=T[0],1):(Le=!0,0)}function D(T){const R=T[0],G=T.rule,Y=new to(G),pe=[G.__beforeBegin,G["on:begin"]];for(const Be of pe)if(Be&&(Be(T,Y),Y.isMatchIgnored))return X(R);return G.skip?ne+=R:(G.excludeBegin&&(ne+=R),le(),!G.returnBegin&&!G.excludeBegin&&(ne=R)),_(G,T),G.returnBegin?0:R.length}function te(T){const R=T[0],G=A.substring(T.index),Y=W(U,T,G);if(!Y)return ao;const pe=U;U.endScope&&U.endScope._wrap?(le(),L(R,U.endScope._wrap)):U.endScope&&U.endScope._multi?(le(),F(U.endScope,T)):pe.skip?ne+=R:(pe.returnEnd||pe.excludeEnd||(ne+=R),le(),pe.excludeEnd&&(ne=R));do U.scope&&de.closeNode(),!U.skip&&!U.subLanguage&&(qe+=U.relevance),U=U.parent;while(U!==Y.parent);return Y.starts&&_(Y.starts,T),pe.returnEnd?0:R.length}function ae(){const T=[];for(let R=U;R!==ie;R=R.parent)R.scope&&T.unshift(R.scope);T.forEach(R=>de.openNode(R))}let q={};function xe(T,R){const G=R&&R[0];if(ne+=T,G==null)return le(),0;if(q.type==="begin"&&R.type==="end"&&q.index===R.index&&G===""){if(ne+=A.slice(R.index,R.index+1),!s){const Y=new Error(`0 width match regex (${j})`);throw Y.languageName=j,Y.badRule=q.rule,Y}return 1}if(q=R,R.type==="begin")return D(R);if(R.type==="illegal"&&!M){const Y=new Error('Illegal lexeme "'+G+'" for mode "'+(U.scope||"<unnamed>")+'"');throw Y.mode=U,Y}else if(R.type==="end"){const Y=te(R);if(Y!==ao)return Y}if(R.type==="illegal"&&G==="")return ne+=`
|
|
124
|
+
`,1;if(wt>1e5&&wt>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=G,G.length}const ie=k(j);if(!ie)throw nt(i.replace("{}",j)),new Error('Unknown language: "'+j+'"');const $e=Xd(ie);let Ee="",U=Z||$e;const he={},de=new l.__emitter(l);ae();let ne="",qe=0,Me=0,wt=0,Le=!1;try{if(ie.__emitTokens)ie.__emitTokens(A,de);else{for(U.matcher.considerAll();;){wt++,Le?Le=!1:U.matcher.considerAll(),U.matcher.lastIndex=Me;const T=U.matcher.exec(A);if(!T)break;const R=A.substring(Me,T.index),G=xe(R,T);Me=T.index+G}xe(A.substring(Me))}return de.finalize(),Ee=de.toHTML(),{language:j,value:Ee,relevance:qe,illegal:!1,_emitter:de,_top:U}}catch(T){if(T.message&&T.message.includes("Illegal"))return{language:j,value:Zn(A),illegal:!0,relevance:0,_illegalBy:{message:T.message,index:Me,context:A.slice(Me-100,Me+100),mode:T.mode,resultSoFar:Ee},_emitter:de};if(s)return{language:j,value:Zn(A),illegal:!1,relevance:0,errorRaised:T,_emitter:de,_top:U};throw T}}function p(j){const A={value:Zn(j),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return A._emitter.addText(j),A}function h(j,A){A=A||l.languages||Object.keys(t);const M=p(j),Z=A.filter(k).filter($).map(le=>f(le,j,!1));Z.unshift(M);const Q=Z.sort((le,L)=>{if(le.relevance!==L.relevance)return L.relevance-le.relevance;if(le.language&&L.language){if(k(le.language).supersetOf===L.language)return 1;if(k(L.language).supersetOf===le.language)return-1}return 0}),[se,ue]=Q,fe=se;return fe.secondBest=ue,fe}function m(j,A,M){const Z=A&&r[A]||M;j.classList.add("hljs"),j.classList.add(`language-${Z}`)}function y(j){let A=null;const M=u(j);if(c(M))return;if(z("before:highlightElement",{el:j,language:M}),j.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",j);return}if(j.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(j)),l.throwUnescapedHTML))throw new qd("One of your code blocks includes unescaped HTML.",j.innerHTML);A=j;const Z=A.textContent,Q=M?d(Z,{language:M,ignoreIllegals:!0}):h(Z);j.innerHTML=Q.value,j.dataset.highlighted="yes",m(j,M,Q.language),j.result={language:Q.language,re:Q.relevance,relevance:Q.relevance},Q.secondBest&&(j.secondBest={language:Q.secondBest.language,relevance:Q.secondBest.relevance}),z("after:highlightElement",{el:j,result:Q,text:Z})}function b(j){l=io(l,j)}const v=()=>{C(),ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function S(){C(),ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function C(){function j(){C()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",j,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(y)}function B(j,A){let M=null;try{M=A(e)}catch(Z){if(nt("Language definition for '{}' could not be registered.".replace("{}",j)),s)nt(Z);else throw Z;M=a}M.name||(M.name=j),t[j]=M,M.rawDefinition=A.bind(null,e),M.aliases&&x(M.aliases,{languageName:j})}function H(j){delete t[j];for(const A of Object.keys(r))r[A]===j&&delete r[A]}function N(){return Object.keys(t)}function k(j){return j=(j||"").toLowerCase(),t[j]||t[r[j]]}function x(j,{languageName:A}){typeof j=="string"&&(j=[j]),j.forEach(M=>{r[M.toLowerCase()]=A})}function $(j){const A=k(j);return A&&!A.disableAutodetect}function I(j){j["before:highlightBlock"]&&!j["before:highlightElement"]&&(j["before:highlightElement"]=A=>{j["before:highlightBlock"](Object.assign({block:A.el},A))}),j["after:highlightBlock"]&&!j["after:highlightElement"]&&(j["after:highlightElement"]=A=>{j["after:highlightBlock"](Object.assign({block:A.el},A))})}function E(j){I(j),n.push(j)}function P(j){const A=n.indexOf(j);A!==-1&&n.splice(A,1)}function z(j,A){const M=j;n.forEach(function(Z){Z[M]&&Z[M](A)})}function J(j){return ct("10.7.0","highlightBlock will be removed entirely in v12.0"),ct("10.7.0","Please use highlightElement now."),y(j)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:C,highlightElement:y,highlightBlock:J,configure:b,initHighlighting:v,initHighlightingOnLoad:S,registerLanguage:B,unregisterLanguage:H,listLanguages:N,getLanguage:k,registerAliases:x,autoDetection:$,inherit:io,addPlugin:E,removePlugin:P}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Qd,e.regex={concat:lt,lookahead:Ri,either:ls,optional:hd,anyNumberOfTimes:pd};for(const j in qt)typeof qt[j]=="object"&&_i(qt[j]);return Object.assign(e,qt),e},ht=Wi({});ht.newInstance=()=>Wi({});var tf=ht;ht.HighlightJS=ht;ht.default=ht;const Ie=Oi(tf);function nf(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],s={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[t,r,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rf(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},b=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,y,i,a],v=[...b];return v.pop(),v.push(l),h.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}function sf(e){const t=e.regex,r={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],v={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:b,built_in:[...S,...w,"set","shopt",...C,...B]},contains:[h,e.SHEBANG(),m,f,i,a,v,l,c,u,d,r]}}const lo="[A-Za-z$_][0-9A-Za-z$_]*",of=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],af=["true","false","null","undefined","NaN","Infinity"],Ki=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Gi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cf=[].concat(Vi,Ki,Gi);function uf(e){const t=e.regex,r=(M,{after:Z})=>{const Q="</"+M[0].slice(1);return M.input.indexOf(Q,Z)!==-1},n=lo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,Z)=>{const Q=M[0].length+M.index,se=M.input[Q];if(se==="<"||se===","){Z.ignoreMatch();return}se===">"&&(r(M,{after:Q})||Z.ignoreMatch());let ue;const fe=M.input.substring(Q);if(ue=fe.match(/^\s*=/)){Z.ignoreMatch();return}if((ue=fe.match(/^\s+extends\s+/))&&ue.index===0){Z.ignoreMatch();return}}},l={$pattern:lo,keyword:of,literal:af,built_in:cf,"variable.language":lf},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},S={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,y,b,{match:/\$\d+/},f];p.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const C=[].concat(S,p.contains),B=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(C)}]),H={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ki,...Gi]}},x={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[H],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function E(M){return t.concat("(?!",M.join("|"),")")}const P={match:t.concat(/\b/,E([...Vi,"super","import"].map(M=>`${M}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},J={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},H]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[H]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,y,b,S,{match:/\$\d+/},f,k,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[H,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[H]},P,I,N,J,{match:/\$[(.]/}]}}function df(e){const t=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${n.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},b={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,v,f]}]}}Ie.registerLanguage("json",nf);Ie.registerLanguage("yaml",rf);Ie.registerLanguage("bash",sf);Ie.registerLanguage("javascript",uf);Ie.registerLanguage("python",df);const Ji=new Ci(rd({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!Ie.getLanguage(t))return e;try{return Ie.highlight(e,{language:t}).value}catch{return e}}}));Ji.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function ff(e){return Ji.parse(e)}const pf={"--tw-prose-body":"rgb(var(--color-text-secondary) / 1)","--tw-prose-headings":"rgb(var(--color-text-primary) / 1)","--tw-prose-lead":"rgb(var(--color-text-secondary) / 1)","--tw-prose-links":"rgb(var(--color-primary-600) / 1)","--tw-prose-bold":"rgb(var(--color-text-primary) / 1)","--tw-prose-counters":"rgb(var(--color-text-muted) / 1)","--tw-prose-bullets":"rgb(var(--color-text-muted) / 1)","--tw-prose-hr":"rgb(var(--color-border) / 1)","--tw-prose-quotes":"rgb(var(--color-text-secondary) / 1)","--tw-prose-quote-borders":"rgb(var(--color-border) / 1)","--tw-prose-captions":"rgb(var(--color-text-muted) / 1)","--tw-prose-kbd":"rgb(var(--color-text-primary) / 1)","--tw-prose-code":"rgb(var(--color-text-secondary) / 1)","--tw-prose-th-borders":"rgb(var(--color-border) / 1)","--tw-prose-td-borders":"rgb(var(--color-border) / 1)"},Oe=({children:e,className:t=""})=>e?typeof e!="string"?o.jsx(o.Fragment,{children:e}):o.jsx("div",{className:`prose max-w-none prose-code:before:content-none prose-code:after:content-none ${t}`,style:pf,dangerouslySetInnerHTML:{__html:Eo.sanitize(ff(e))}}):null;function hf({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:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}function mf({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:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function gf({className:e,...t}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"})})}function xf({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:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}function Nt({IconClass:e,term:t,visibleTerm:r=!0,text:n,href:s,vertical:i=!1,className:a=""}){const l=s?c=>o.jsx("a",{href:s,target:"_blank",...c}):c=>o.jsx("div",{...c});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(l,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${n}`,alt:`${n}`}),r?o.jsx("span",{className:"pl-2 text-sm",children:t}):o.jsx("span",{className:"sr-only",children:t})]})}),o.jsxs("dd",{className:`${i&&"pt-2"} pl-2 text-sm`,children:[!r&&o.jsx(l,{children:n}),i&&o.jsx(l,{children:n})]})]})}function ds({name:e,href:t,title:r}){return o.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${t&&"hover:bg-cyan-500 hover:text-white"}`,href:t,target:"_blank",title:r,children:e})}function bf({license:e,externalDocs:t,contact:r,tags:n,logo:s}){const i={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(r==null?void 0:r.name)??null,contactUrl:(r==null?void 0:r.url)??null,contactEmail:(r==null?void 0:r.email)??null,tags:n};return o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:"hidden @lg:block mb-3",children:s}),o.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[i.licenseName&&o.jsx(Nt,{IconClass:gf,text:`${i.licenseName} ${Ns}`,term:Ns,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Nt,{IconClass:_n,text:As,href:i.externalDocsUrl,term:As,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Nt,{IconClass:hf,text:`${i.contactEmail}`,term:il,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Nt,{IconClass:mf,text:`${i.contactName}`,term:ol,visibleTerm:!i.contactName,href:i.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),o.jsx("dl",{className:"mt-[10px]",children:i.tags&&o.jsx(Nt,{IconClass:xf,term:al,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:i.tags&&o.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:i.tags.map((a,l)=>{const c=a,u=c.externalDocs;return o.jsx(ds,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const yf=[/^x-parser-/i,/^x-lib-/i];function kf(e){return yf.some(t=>t.test(e))}const co=new Map;function wf(e){let t=co.get(e);return t||(t=g.lazy(xi[e]),co.set(e,t)),t}const vf=e=>e.startsWith("x-"),fs=(e,t)=>e?e[t]:void 0;function jf({source:e,pathPrefix:t}){const{showExtensions:r}=ge();if(!r||!e)return null;const n=Object.keys(e).filter(s=>vf(s)&&!kf(s)&&Object.prototype.hasOwnProperty.call(xi,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=wf(s);return o.jsx(g.Suspense,{fallback:null,children:o.jsx(i,{value:fs(e,s),path:`${t}.${s}`})},s)})})}const Sf=g.lazy(wu),Zi=e=>Yr(fs(e,"x-logo"))!==null;function ps({source:e}){const t=fs(e,"x-logo");return Yr(t)?o.jsx(g.Suspense,{fallback:null,children:o.jsx(Sf,{value:t,path:"info.x-logo"})}):null}function Xi({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(ps,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(Oe,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(bf,{logo:u,license:r,externalDocs:s,contact:n,tags:i}),a&&o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:o.jsx(jf,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:u,layout:l})})}const Yi=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(Xi,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),Nf=1500,Af=320,Ef=48,$f="#011627";function Cf(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function Tf(e){try{return await navigator.clipboard.writeText(e),!0}catch{return Cf(e)}}function Ln({code:e,className:t,language:r="json",collapsedMaxHeight:n=Af}){const[s,i]=g.useState("idle"),a=g.useRef(void 0),[l,c]=g.useState(!1),[u,d]=g.useState(!1),[f,p]=g.useState(0),h=g.useRef(null),m=g.useRef(null),y=g.useId();g.useEffect(()=>()=>clearTimeout(a.current),[]),g.useEffect(()=>{const N=m.current;if(!N)return;const k=()=>{p(N.scrollHeight),d(N.scrollHeight>n+Ef)};k();const x=new ResizeObserver(k);return x.observe(N),()=>x.disconnect()},[e,r,n]);const b=()=>{Tf(e).then(N=>{i(N?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),Nf)})},S=Ie.getLanguage(r)?Ie.highlight(e,{language:r}).value:null,w=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",C=u&&!l,B=e.replace(/\n+$/,"").split(`
|
|
125
|
+
`).length,H=()=>{var N,k;l&&(((N=h.current)==null?void 0:N.getBoundingClientRect().top)??0)<0&&((k=h.current)==null||k.scrollIntoView({block:"nearest"})),c(x=>!x)};return o.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:b,"aria-label":w,title:w,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?o.jsx(Zo,{className:"w-4 h-4 text-green-600"}):o.jsx(Jo,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:m,id:y,style:u?{maxHeight:l?f:n}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${u?"overflow-y-hidden":""}`,children:S!==null?o.jsx("code",{className:`hljs language-${r}`,dangerouslySetInnerHTML:{__html:Eo.sanitize(S)}}):o.jsx("code",{className:"hljs",children:e})}),u&&o.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${C?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${$f})`}})]}),u&&o.jsxs("button",{type:"button",onClick:H,"aria-expanded":l,"aria-controls":y,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[l?"Show less":`Show all ${B} lines`,o.jsx(yt,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]})]})}const If=/^x-parser-/i;function Nr(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(n=>Nr(n,t));const r={};for(const[n,s]of Object.entries(e))If.test(n)||(r[n]=Nr(s,t));return r}finally{t.delete(e)}}return e}const Qi=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Nr(e),null,2);return o.jsx(Ln,{code:t})},uo=new Set,hs=e=>e.replace(/^#\//,"").split("/").pop()??e,Ar=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Of={objects:new Set,refs:new Set},Fe=(e,t,r)=>{if(!e.$ref)return{schema:e,refLabel:Ar(e)};const n=e.$ref,s=hs(n);if(r.has(n))return{schema:e,refLabel:s,circular:!0};const i=De(t(n));if(!i)return{schema:e,refLabel:s};const{schema:a}=Mt(i);r.add(n);try{const l=Fe(a,t,r);return{schema:l.schema,refLabel:l.circular?void 0:s,circular:l.circular}}finally{r.delete(n)}},st=e=>{const t=e.items,r=Array.isArray(t)?t[0]:t;return V(r)?r:null},qi=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>V(n));return r.length>0?r:null},_f=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||V(e.additionalItems)?e.additionalItems:null,Mf=e=>e.contains===void 0?null:typeof e.contains=="boolean"||V(e.contains)?e.contains:null,ea=e=>e.contains!==void 0,An=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
126
|
+
|
|
127
|
+
${t}`:t},Rf=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Ge=(e,t,r,n)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=An(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[i,a]of Object.entries(t.properties)){if(!V(a))continue;const l=s.properties[i];V(l)?s.properties[i]=Ge(l,a):s.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((i,a)=>{const l=s.items[a];return V(i)&&V(l)?Ge(l,i):V(i)?i:l}):s.items=t.items;else{const i=st(t),a=st(s);i&&a?s.items=Ge(a,i):i&&(s.items=t.items)}if(t.patternProperties&&V(t.patternProperties)){const i={...V(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!V(l)){i[a]=l;continue}const c=i[a];V(c)?i[a]=Ge(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(V(t.propertyNames)){const i=s.propertyNames;s.propertyNames=V(i)?Ge(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(V(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=V(i)?Ge(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Rf.has(i)||a===void 0||(s[i]=a);return s},fo=(e,t,r,n)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>V(d)?[u,be(d,t,r,n)]:[u,d])));const i=st(s);i&&(s.items=be(i,t,r,n));const a=Ut(s);a!==null&&V(a)&&(s.propertyNames=be(a,t,r,n));const l=kt(s);l!==null&&V(l)&&(s.additionalProperties=be(l,t,r,n));const c=ms(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,be(d,t,r,n)]))),s},be=(e,t,r,n=new Set)=>{if(n.has(e))return e;n.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const i=[];let a={};for(const d of s){if(!V(d))continue;const{schema:f,circular:p}=Fe(d,t,r);if(p)continue;const h=be(f,t,r,n);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),i.push(m)}i.push(...ra(h)),a=Ge(a,h,t,r)}if(e.if!==void 0){const d={if:e.if};e.then!==void 0&&(d.then=e.then),e.else!==void 0&&(d.else=e.else),i.push(d)}const l={...e};delete l.allOf;const c=Object.keys(l).length>0?Ge(a,l,t,r):a,u=fo(c,t,r,n);if(i.length===1){const d=i[0];u.if=d.if,d.then!==void 0&&(u.then=d.then),d.else!==void 0&&(u.else=d.else)}else i.length>1&&(u._allOfConditionals=i);return u}return fo(e,t,r,n)}finally{n.delete(e)}},zt=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>V(n));return r.length>0?r:null},Ht=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>V(n));return r.length>0?r:null},ta=e=>e.not===void 0?null:typeof e.not=="boolean"||V(e.not)?e.not:null,we=e=>ta(e)!==null,na=e=>{const{not:t,...r}=e;return r},Pf=e=>{const{if:t,then:r,else:n,...s}=e;return s},je=e=>e.if!==void 0,Xn=e=>e===void 0?null:typeof e=="boolean"||V(e)?e:null,ra=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>V(t)):[],Se=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Ut=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||V(e.propertyNames)?e.propertyNames:null,kt=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||V(e.additionalProperties)?e.additionalProperties:null,ms=e=>{const t=e.patternProperties;return V(t)?Object.entries(t).flatMap(([r,n])=>V(n)?[[r,n]]:[]):[]},Lf=(e,t)=>`${e}.[pattern:${t}]`,Wt=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Bn=e=>{const t=Ut(e);if(t!==null&&V(t))return!0;const r=kt(e);return r!==null&&V(r)?!0:ms(e).length>0},sa=e=>!!(zt(e)||Ht(e)||Wt(e)||Bn(e)||e.type==="array"||e.items||e.type!==void 0),Te=e=>!(we(e)||je(e)||Se(e)||zt(e)||Ht(e)||Wt(e)||Bn(e)||e.items||ea(e)||e.type==="array"||e.type==="object");function Bf(e){if(typeof kt(e)=="boolean")return!0;const r=Ut(e);return!!(typeof r=="boolean"||r!==null&&V(r)&&Te(r)&&typeof r.pattern=="string"&&r.pattern.length>0)}function po(e){return typeof e.multipleOf=="number"||typeof e.minimum=="number"||typeof e.exclusiveMinimum=="number"||typeof e.maximum=="number"||typeof e.exclusiveMaximum=="number"||typeof e.minLength=="number"||typeof e.maxLength=="number"||typeof e.minItems=="number"||typeof e.maxItems=="number"||typeof e.minProperties=="number"||typeof e.maxProperties=="number"||typeof e.pattern=="string"&&e.pattern.length>0||Array.isArray(e.enum)&&e.enum.length>0||e.const!==void 0||e.uniqueItems===!0||Bf(e)}const oa=(e,t)=>po(e)?!0:t?po(t):!1,Df=(e,t)=>{if(we(e)||je(e)||Se(e)||zt(e)||Ht(e)||Wt(e)||Bn(e))return!0;if(e.type==="array"||e.items){if(ea(e)||qi(e)!==null)return!0;const r=st(e);if(!r)return!1;if(r.$ref&&t){const{schema:n}=Fe(r,t,uo),s=be(n,t,uo);return!Te(s)}return!Te(r)}return!1};function ia(e){return JSON.stringify(e)}function ho(e){return typeof e=="string"?e:JSON.stringify(e)}function Ae({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function aa({children:e,mono:t=!1,title:r}){return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:r,children:t?o.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function Ff(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function zf(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Hf(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Uf(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function mo(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function go(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function en({name:e,lower:t,upper:r,suffix:n}){return!t&&!r?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Ae,{children:String(t.value)}),o.jsx(Ae,{children:t.op})]}),o.jsx(Ae,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(Ae,{children:r.op}),o.jsx(Ae,{children:String(r.value)})]}),n&&o.jsx(Ae,{children:n})]})}function hn({value:e,displayValue:t}){const r=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(ho(e))},n=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(ho(e)))};return o.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:r,onKeyDown:n,children:t??ia(e)})}function Wf({schema:e}){const t=kt(e);return typeof t!="boolean"?null:o.jsx(Ae,{children:t?"additional properties allowed":"additional properties not allowed"})}function Kf({schema:e}){const t=Ut(e);return typeof t=="boolean"?o.jsx(aa,{children:t?"any property name":"no property names"}):t!==null&&V(t)&&Te(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ae,{children:"property name pattern:"}),o.jsx(hn,{value:t.pattern,displayValue:t.pattern})]}):null}function xo({schema:e,rangeName:t="value"}){const r=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,n=Ff(e),s=zf(e),i=Hf(e),a=Uf(e),l=mo(e,"minItems"),c=go(e,"maxItems"),u=mo(e,"minProperties"),d=go(e,"maxProperties");return o.jsxs(o.Fragment,{children:[typeof e.multipleOf=="number"&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ae,{children:"multiple of :"}),o.jsx(aa,{children:String(e.multipleOf)})]}),(n||s)&&o.jsx(en,{name:t,lower:n,upper:s}),(i||a)&&o.jsx(en,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(en,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(en,{name:t,lower:u,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ae,{children:"regex pattern:"}),o.jsx(hn,{value:e.pattern,displayValue:e.pattern})]}),r&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(Ae,{children:"enum values:"}),r.map((f,p)=>o.jsx(hn,{value:f},`${p}-${ia(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ae,{children:"const value:"}),o.jsx(hn,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Ae,{children:"unique"}),o.jsx(Wf,{schema:e}),o.jsx(Kf,{schema:e})]})}function la({schema:e,itemSchema:t,fieldName:r,className:n="flex flex-col gap-1"}){const s=t!=null&&Te(t),i=r??"value";return o.jsxs("div",{className:n,children:[o.jsx(xo,{schema:e,rangeName:i}),s&&o.jsx(xo,{schema:t,rangeName:"item"})]})}const ca=(e,t)=>{const r=zt(e);if(r)return{text:`one of (${r.length})`};const n=Ht(e);if(n)return{text:`any of (${n.length})`};if(we(e)&&!sa(na(e)))return{text:"not"};if(e.type==="array"||e.items){const u=st(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?hs(u.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=s?`${s}`:"type: unknown";const a=kt(e);!Wt(e)&&a!==null&&V(a)&&(s==="object"||i==="type: unknown")&&(i=s==="object"?"object (map)":"map");const l=typeof e.format=="string"?e.format:void 0,c=t&&(s==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:l,refHint:c}},Gf=(e,t)=>{if(!t)return!1;const r=ca(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function ua({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=ca(e,t);return o.jsxs("span",{className:r,children:[s??n,i&&!n.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const bo="ml-6";function tn({schema:e,showBorder:t=!0}){const r=typeof e.description=="string"?e.description:void 0;return o.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),o.jsx(ua,{schema:e})]}),oa(e)&&o.jsx(la,{schema:e,className:`flex flex-col gap-1 mt-1 ${bo}`}),r&&r.split(`
|
|
128
|
+
|
|
129
|
+
`).map((n,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${bo} leading-relaxed`,children:n},s))]})}function Yn({children:e}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:"Should Not match:"}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Vf({value:e}){const t=e?"any value":"false schema";return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:t})}function da({tabs:e,selected:t,onChange:r,ariaLabel:n}){const s=g.useRef([]),i=l=>(l+e.length)%e.length,a=(l,c)=>{var d;let u=c;l.key==="ArrowRight"&&(l.preventDefault(),u=i(c+1)),l.key==="ArrowLeft"&&(l.preventDefault(),u=i(c-1)),l.key==="Home"&&(l.preventDefault(),u=0),l.key==="End"&&(l.preventDefault(),u=e.length-1),u!==c&&(r(e[u].id),(d=s.current[u])==null||d.focus())};return o.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":n,children:e.map(({id:l,label:c},u)=>{const d=l===t;return o.jsx("button",{ref:f=>{s.current[u]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>r(l),onKeyDown:f=>a(f,u),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:c},l)})})}function Jf({variant:e="oneOf",caseCount:t,caseLabels:r,selectedCase:n,onSelectCase:s,children:i}){if(t===0)return null;const a=(r==null?void 0:r.length)===t?r:Array.from({length:t},(u,d)=>`case ${d+1}`),l=e==="anyOf"?"Any of:":"One of:",c=e==="anyOf"?"Any of cases":"One of cases";return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:l}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(da,{tabs:a.map((u,d)=>({id:String(d),label:u})),selected:String(n),onChange:u=>s(Number(u)),ariaLabel:c}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const Zf="ml-0 border-dashed border-border";function tt({depth:e,children:t,lineVariant:r="depth"}){const{depthColors:n}=ge();return r==="none"?o.jsx("div",{children:t}):r==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Zf}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:_r(e,n)},children:t})}function Xf({depth:e,expanded:t,onToggle:r}){const{depthColors:n}=ge(),s=_r(e,n);return o.jsxs("button",{type:"button",onClick:r,"aria-expanded":t,"aria-label":t?"Hide details":void 0,className:"cursor-pointer mt-1 flex items-center gap-1.5 shrink-0 text-left hover:opacity-80",children:[o.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&o.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const Yf="ml-6";function ke({id:e,path:t,depth:r,schema:n,refLabel:s,itemSchema:i,typeLabelOverride:a,required:l,description:c,expandable:u,expanded:d,onToggle:f,showBorder:p=!0}){const{depthColors:h}=ge(),m=_r(r,h),y=n&&Gf(n,s),b=u?Yf:"";let v="",S=t;if(t.endsWith("[]")){const w=t.slice(0,-2),C=w.lastIndexOf(".");C>=0?(v=w.slice(0,C+1),S=`${w.slice(C+1)}[]`):S=t}else{const w=t.lastIndexOf("."),C=t.lastIndexOf("[]"),B=Math.max(w,C);B>=0&&(v=t.slice(0,B+(t[B]==="."?1:2)),S=t.slice(B+(t[B]==="."?1:2)))}return p=p&&!d,o.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[o.jsxs("span",{className:"truncate min-w-0",children:[v&&o.jsx("span",{className:"text-foreground-muted",children:v}),o.jsx("span",{className:"font-semibold",style:{color:m},children:S})]}),l&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(n==null?void 0:n.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(n==null?void 0:n.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(n==null?void 0:n.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),n?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(ua,{schema:n,refLabel:s}),y&&o.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):a&&o.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:a})]}),n&&oa(n,i)&&o.jsx(la,{schema:n,itemSchema:i,fieldName:S,className:`flex flex-col gap-1 mt-1 ${b}`}),c&&c.split(`
|
|
130
|
+
|
|
131
|
+
`).map((w,C)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${b} leading-relaxed`,children:w},C)),u&&o.jsx(Xf,{depth:r,expanded:d,onToggle:f})]})}function Qn({label:e,children:t}){return o.jsxs("div",{children:[o.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:o.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),o.jsx("div",{children:t})]})}function Qf({ifContent:e,thenContent:t,elseContent:r}){return o.jsxs("div",{className:"py-2 pt-5 px-1",children:[o.jsx("div",{className:"flex flex-col items-start",children:o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border-2 border-dashed border-border rounded-md bg-surface",children:"Conditions apply:"})}),o.jsx(tt,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(Qn,{label:"If schema matches:",children:e}),t!=null&&o.jsx(Qn,{label:"Then schema should follow:",children:t}),r!=null&&o.jsx(Qn,{label:"Else schema should follow:",children:r})]})})]})}function nn({label:e,children:t}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:e}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const qf=e=>e==="none"?"depth":e;function Ce({schema:e,path:t,depth:r,required:n,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=Of,focusTokens:d=null,focusId:f=null}){var F;const p=qf(l),h=d!=null,y=h&&d.length===0?f??void 0:void 0,[b,v]=g.useState(c||h),[S,w]=g.useState(c);S!==c&&(w(c),v(c||h)),g.useEffect(()=>{h&&v(!0)},[h]);const[C,B]=g.useState(0),H=(F=d==null?void 0:d[0])==null?void 0:F.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),N=H?Number(H[1]):-1;g.useEffect(()=>{N>=0&&B(N)},[N]);const k=Jr(),{schema:x,refLabel:$,circular:I}=g.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Ar(e),circular:!0};const _=Fe(e,i,s);return _.circular?_:{..._,schema:be(_.schema,i,s)}},[e,i,s,u,k]),E=g.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),P=na(Pf(x)),z=!sa(P)&&(we(x)||je(x)||Se(x)),J=()=>{const _=ta(x);if(_===null)return null;if(typeof _=="boolean")return o.jsx(Yn,{children:o.jsx(Vf,{value:_})});const W=Fe(_,i,s);if(W.circular)return o.jsx(Yn,{children:o.jsx(ke,{path:t,depth:r+1,typeLabelOverride:`↩ ${_.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const X=be(W.schema,i,s),D=Te(X);return o.jsx(Yn,{children:D?o.jsx(tn,{schema:X,showBorder:!1}):o.jsx(Ce,{schema:_,path:t,depth:r+1,refStack:s,deref:i,ancestors:E,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},j=(_,W)=>{if(typeof _=="boolean")return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:_?"any value":"false schema"});const X=Fe(_,i,s);if(X.circular)return o.jsx(ke,{path:W,depth:r+1,typeLabelOverride:`↩ ${_.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const D=be(X.schema,i,s);return Te(D)?o.jsx(tn,{schema:D,showBorder:!1}):o.jsx(Ce,{schema:_,path:W,depth:r+1,refStack:s,deref:i,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},A=_=>{const W=Xn(_.if);if(W===null)return null;const X=Xn(_.then),D=Xn(_.else);return o.jsx(Qf,{ifContent:j(W,t),thenContent:X!==null?j(X,t):void 0,elseContent:D!==null?j(D,t):void 0})},M=()=>{const _=ra(x);return _.length===0?null:o.jsx(o.Fragment,{children:_.map((W,X)=>o.jsx("div",{children:A(W)},X))})};if(I)return o.jsx(ke,{id:y,path:t,depth:r,typeLabelOverride:`↩ ${e.$ref??$??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(z){const _=o.jsxs(o.Fragment,{children:[we(x)&&J(),je(x)&&A(x),Se(x)&&M()]});return a?_:o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(W=>!W)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:_})]})}const Z=zt(P),Q=Ht(P),se=Z??Q,ue=Z?"oneOf":"anyOf";if(se){const _=se.map((Ee,U)=>typeof Ee.title=="string"?Ee.title:`case ${U+1}`),W=a?1:r+1,X=se[C],D=Fe(X,i,s),te=D.circular?D.schema:be(D.schema,i,s),ae=!D.circular&&Te(te),q=d&&N===C?d.slice(1):null,xe=ae?o.jsx(tn,{schema:te,showBorder:!1}):o.jsx(Ce,{schema:X,path:t,depth:W-1,refStack:s,deref:i,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:q,focusId:f},C),ie=o.jsx(Jf,{variant:ue,caseCount:se.length,caseLabels:_,selectedCase:C,onSelectCase:B,children:xe}),$e=o.jsxs(o.Fragment,{children:[ie,we(x)&&J(),je(x)&&A(x),Se(x)&&M()]});return a?$e:o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(Ee=>!Ee)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:$e})]})}const fe=(_,W,X)=>{const D=Fe(_,i,s);if(D.circular)return o.jsx(ke,{path:W,depth:X,typeLabelOverride:`↩ ${_.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const te=be(D.schema,i,s);return Te(te)?o.jsx(tn,{schema:te,showBorder:!1}):o.jsx(Ce,{schema:_,path:W,depth:X,refStack:s,deref:i,ancestors:E,branchLineVariant:p,defaultExpanded:c})},le=_=>{const W=P.properties??{},X=new Set(P.required??[]),D=Ut(P),te=kt(P),ae=ms(P);return o.jsxs(o.Fragment,{children:[Object.entries(W).map(([q,xe])=>{if(!V(xe))return null;const ie=d&&d[0]==="properties"&&d[1]===q?d.slice(2):null;return o.jsx(Ce,{schema:xe,path:`${t}.${q}`,depth:_,required:X.has(q),refStack:s,deref:i,ancestors:E,branchLineVariant:p,defaultExpanded:c,focusTokens:ie,focusId:f},q)}),D!==null&&V(D)&&o.jsx(nn,{label:"Property names must adhere to:",children:fe(D,`${t}.[propertyName]`,_)}),ae.map(([q,xe])=>o.jsx(Ce,{schema:xe,path:Lf(t,q),depth:_,refStack:s,deref:i,ancestors:E,branchLineVariant:p,defaultExpanded:c},q)),te!==null&&V(te)&&o.jsx(nn,{label:"Additional properties must adhere to:",children:fe(te,`${t}.[additionalProperty]`,_)}),we(x)&&J(),je(x)&&A(x),Se(x)&&M()]})};if(Wt(P)||Bn(P))return a?le(r+1):o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(_=>!_)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:le(r+1)})]});if(P.type==="array"||P.items){const _=qi(P),W=_!==null,X=W?_f(P):null,D=Mf(P),te=D!==null,ae=W?null:st(P),q=ae!==null,xe=W||q||te||we(x)||je(x)||Se(x),ie=`${t}[]`,$e=a?t:ie,Ee=q?Fe(ae,i,s):null,U=(Ee==null?void 0:Ee.schema)??null,he=U?be(U,i,s):null,de=U!==null&&(E.objects.has(U)||typeof(ae==null?void 0:ae.$ref)=="string"&&E.refs.has(ae.$ref)),ne=U!==null?{objects:new Set(E.objects).add(U),refs:typeof(ae==null?void 0:ae.$ref)=="string"?new Set(E.refs).add(ae.$ref):E.refs}:E,qe=!W&&!te&&he!==null&&Te(he),Me=he!=null&&he.properties?Object.entries(he.properties).filter(([,R])=>V(R)):[],wt=new Set(he&&Array.isArray(he.required)?he.required:[]),Le=!W&&d&&d[0]==="items"?d.slice(1):null,T=R=>o.jsxs(o.Fragment,{children:[W?o.jsxs(o.Fragment,{children:[_.map((G,Y)=>o.jsx(Ce,{schema:G,path:`${t}[${Y}]`,depth:R,refStack:s,deref:i,ancestors:E,branchLineVariant:p,defaultExpanded:c},Y)),X!==null&&typeof X!="boolean"&&o.jsx(nn,{label:"Additional items:",children:fe(X,`${t}[*]`,R)}),X===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):q&&(de?o.jsx(ke,{path:$e,depth:R,typeLabelOverride:`↩ ${ae.$ref??Ar(U)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Me.length>0?Me.map(([G,Y])=>{const pe=Le&&Le[0]==="properties"&&Le[1]===G?Le.slice(2):null;return o.jsx(Ce,{schema:Y,path:`${$e}.${G}`,depth:R,required:wt.has(G),refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:pe,focusId:f},G)}):o.jsx(Ce,{schema:ae,path:$e,depth:R,refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:Le,focusId:f})),te&&o.jsx(nn,{label:"Contains at least one:",children:typeof D=="boolean"?o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:D?"any item":"impossible constraint"}):fe(D,`${t}[contains]`,R)}),we(x)&&J(),je(x)&&A(x),Se(x)&&M()]});return qe&&!we(x)&&!je(x)&&!Se(x)?o.jsx(ke,{id:y,path:ie,depth:r,schema:x,itemSchema:he,refLabel:$,required:n,description:An(x.description,he.description),expandable:!1,expanded:!1,onToggle:()=>{}}):qe?o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:ie,depth:r,schema:x,itemSchema:he,refLabel:$,required:n,description:An(x.description,he.description),expandable:!0,expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsxs(tt,{depth:r,lineVariant:l,children:[we(x)&&J(),je(x)&&A(x),Se(x)&&M()]})]}):a?xe?T(r+1):null:o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:ie,depth:r,schema:x,itemSchema:he,refLabel:$,required:n,description:x.description,expandable:W||q||te||we(x)||je(x)||Se(x),expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:T(r+1)})]})}if(we(x)||je(x)||Se(x)){const _=o.jsxs(o.Fragment,{children:[we(x)&&J(),je(x)&&A(x),Se(x)&&M()]});return a?_:o.jsxs(o.Fragment,{children:[o.jsx(ke,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(W=>!W)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:_})]})}return a?null:o.jsx(ke,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function gs({schema:e,rootName:t,className:r="",focusTokens:n=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=ge(),l=g.useMemo(()=>new Set,[]),c=De(e),u=g.useMemo(()=>c?be(c,i,l):null,[c,i,l]);if(!c||!u)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(c.$ref?hs(c.$ref):void 0)??"schema",f=!!t;if(!Df(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:r,children:o.jsx(Ce,{schema:c,path:d,depth:0,refStack:l,deref:i,defaultExpanded:a,focusTokens:n,focusId:s})}):null;const h=u.type==="array"||u.items?`${d}[]`:d,m=st(u),y=m?be(m,i,l):null,b=y!==null&&Te(y);return o.jsx("div",{className:r,children:o.jsx(ke,{path:h,depth:0,schema:u,itemSchema:b?y:void 0,description:u.type==="array"||u.items?An(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:r,children:o.jsx(Ce,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:n,focusId:s})})}const ep=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function rn(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function dt(e,t=()=>{},r=new Set,n=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return ep(i)?n.has(s)?rn(i,"null")?{type:"null"}:{}:dt(i,t,new Set,new Set(n).add(s)):{}}if(r.has(e))return rn(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return dt({...i,...s[0]},t,r,n)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return dt({...i,...s[0]},t,r,n)}if(rn(e,"object")&&e.properties&&typeof e.properties=="object"){r.add(e);try{const s={};for(const[i,a]of Object.entries(e.properties)){const l=/id$/i.test(i)&&a.type==="string"&&!a.format&&!a.examples,c=a.type==="string"&&!a.format&&!a.examples&&!a.enum;s[i]=l?{...a,format:"uuid"}:c?{...a,examples:["string"]}:dt(a,t,r,n)}return{...e,properties:s}}finally{r.delete(e)}}if(rn(e,"array")&&e.items&&typeof e.items=="object"){r.add(e);try{return{...e,items:dt(e.items,t,r,n)}}finally{r.delete(e)}}return e}function tp({schema:e,providedExample:t}){const r=t!==void 0,[n,s]=g.useState(r?t:null),{deref:i}=ge();if(g.useEffect(()=>{if(r){s(t);return}let l=!1;return Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs")).then(({generate:c})=>c(dt(e,i),{seed:42,useExamplesValue:!0,optionalsProbability:1})).then(c=>{l||s(c)}).catch(()=>{}),()=>{l=!0}},[e,i,r,t]),n===null)return null;const a=JSON.stringify(n,null,2);return o.jsxs("div",{children:[o.jsx(Ln,{code:a}),!r&&o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function ot({schema:e,label:t,rootName:r,description:n,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:l,example:c,defaultView:u="example"}){const d=ui(s),f=!l&&du(s,a),[p,h]=g.useState(f&&u==="example"?"example":"schema");return g.useEffect(()=>{!f&&p==="example"&&h("schema")},[f,p]),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),d&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:d})]}),n&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:n})]}),o.jsx(da,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),a&&o.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",di(s)??"the"," schema, showing raw definition. ",a]}),l?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[p==="schema"&&o.jsx(gs,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(Qi,{schema:i??e}),p==="example"&&f&&o.jsx(tp,{schema:e,providedExample:c})]})]})}function fa({message:e,expanded:t,onToggleExpanded:r,paddingX:n="px-4",focusSection:s=null}){var h;const[i,a]=g.useState("payload");g.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:l}=ge(),c=Jr(),u=g.useMemo(()=>e.payload?Mt(e.payload,l):null,[e.payload,l,c]),d=g.useMemo(()=>e.headers?Mt(e.headers,l):null,[e.headers,l,c]),f=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsxs("div",{className:`${n} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&o.jsxs("div",{children:[e.payload&&e.headers&&o.jsx(it,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:m=>a(m)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(ot,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:f==null?void 0:f.payload}),(i==="headers"||!e.payload)&&d&&o.jsx(ot,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion,example:f==null?void 0:f.headers})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,y)=>o.jsx(ds,{name:`#${m.name}`},y))})]})})}),p&&o.jsxs("button",{onClick:r,className:"w-full flex items-center justify-center gap-1.5 py-2 border-t border-border bg-neutral-50 hover:bg-neutral-100 transition-colors text-xs text-foreground-muted hover:text-foreground-secondary",children:[o.jsx("span",{children:t?"Show less":"Show more"}),o.jsx(yt,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function np({messageKey:e,message:t,first:r,isSelected:n,focusSection:s}){const[i,a]=g.useState(!1);return g.useEffect(()=>{n&&a(!0)},[n]),o.jsxs("tbody",{id:`message-${e}`,className:`${r?"":"border-t border-border"} ${n?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[o.jsxs("tr",{className:"",children:[o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),o.jsx("span",{className:"w-fit text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:e})]})}),o.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:t.contentType??"—"})})]}),t.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:t.correlationId.description??t.correlationId.location,children:t.correlationId.location})})]})]})})]}),o.jsx("tr",{children:o.jsx("td",{colSpan:3,className:"p-0",children:o.jsx(fa,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function pa({messages:e,selectedKey:t,focusSection:r,layout:n}){const s=Object.entries(e),i=s.length?o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100",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:"Message"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),s.map(([a,l],c)=>o.jsx(np,{messageKey:a,message:l,first:c===0,isSelected:t===a,focusSection:r},a))]})})}):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 messages defined in this AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{content:i,stickySideContent:!1,layout:n})})}function ha({serverNames:e=[],current:t,setCurrent:r}){return o.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(n=>o.jsx("button",{type:"button",onClick:()=>r(n),"aria-current":t===n?"page":void 0,className:et(t===n?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:o.jsx("span",{className:"truncate",children:n})},n))})}function ma(e){return o.jsx(Br,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}function rp(e){return o.jsx(Br,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}function ga({address:e,variables:t,children:r}){return o.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[o.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[o.jsx(rp,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Je,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),r]})}function xa({className:e}){return o.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:o.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function Kt({trigger:e,children:t,defaultExpanded:r=!1,forceExpanded:n=!1,ariaLabelledBy:s,className:i=""}){const[a,l]=g.useState(r),c=g.useId();return g.useEffect(()=>{n&&l(!0)},[n]),o.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${i}`,children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":c,"aria-labelledby":s,onClick:()=>l(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,a?o.jsx(yt,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(xa,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${a?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:t})})]})}const qn={userPassword:"User/Password",oauth2:"OAuth2",apiKey:"API key",bearer:"Bearer Token",openIdConnect:"OpenID",X509:"X.509 certificate",scramSha256:"SASL",scramSha512:"SASL",plain:"SASL",gssapi:"SASL"};function er(e){var r,n;const t=(r=e.type)==null?void 0:r.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(n=e.scheme)==null?void 0:n.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function sp(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function op(e){const t=(e??[]).filter(s=>qn[er(s)]),r=new Map;for(const s of t){const i=qn[er(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=er(s),l=qn[a],c=(r.get(l)??0)>1?sp(s):void 0;let u=c?`${l} (${c})`:l;return n.has(u)&&(u=`${u} #${i+1}`),n.add(u),{id:`${a}-${i}`,name:u,kind:a,scheme:s}})}function xs({securities:e}){var u;const t=g.useMemo(()=>op(e),[e]),r=t.length>1,[n,s]=g.useState(r?null:((u=t[0])==null?void 0:u.id)??null);g.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(d=>d&&t.some(f=>f.id===d)?d:null)},[t]);const i=t.find(d=>d.id===n),a=i==null?void 0:i.kind,l=i==null?void 0:i.scheme,c=l==null?void 0:l.description;return o.jsxs("div",{children:[r&&o.jsx(it,{tabs:t,current:n,onChange:d=>s(f=>d&&f===d?null:d||null),placeholder:"Select an authorization method"}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[a==="userPassword"&&o.jsxs(sn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),a&&["scramSha256","scramSha512","plain"].includes(a)&&o.jsxs(sn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),a==="gssapi"&&o.jsxs(sn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),a==="X509"&&o.jsxs(sn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),a==="bearer"&&o.jsx(ip,{security:l}),a==="apiKey"&&o.jsx(ap,{security:l}),a==="openIdConnect"&&o.jsx(lp,{security:l}),a==="oauth2"&&o.jsx(cp,{security:l})]})]})}const sn=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(Oe,{children:e})}):o.jsx("span",{children:t}),ip=({security:e})=>e!=null&&e.description?o.jsx(Oe,{children:e.description}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",o.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?o.jsxs(o.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),ap=({security:e})=>{if(e!=null&&e.description)return o.jsx(Oe,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?o.jsxs("span",{children:["You have to"," ",o.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?o.jsxs(o.Fragment,{children:[" named ",o.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the password and leave the user name empty"})," ","to connect to this server."]}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the user name and leave the password empty"})," ","to connect to this server."]})},lp=({security:e})=>{var r,n;const t=(r=e.requiredScopes)!=null&&r.length?e.requiredScopes:e.scopes;return o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(Oe,{children:e.description}):o.jsx("p",{children:"You can use OpenID to connect to this server."}),o.jsxs("p",{children:["The OpenID Connect URL is"," ",o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(n=e.requiredScopes)!=null&&n.length?"Required scopes":"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("code",{children:Ml(t)})})]})]})},cp=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(Oe,{children:e.description}),t&&Object.entries(t).map(([r,n])=>{var c,u;let s="",i="";switch(r){case"clientCredentials":s=ul,i=dl;break;case"implicit":s=ll,i=cl;break;case"password":s=fl,i=pl;break;case"authorizationCode":s=hl,i=ml;break}const a=(c=e.requiredScopes)!=null&&c.length?e.requiredScopes:n.availableScopes??n.scopes,l=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:i})]}),o.jsx("div",{className:"mt-5 border-t border-border",children:o.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[n.authorizationUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.authorizationUrl})})]}),n.tokenUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.tokenUrl})})]}),n.refreshUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.refreshUrl})})]}),a&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:l}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(a)?a:Object.keys(a)).map(d=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:d},d))})})]})]})})]},r)})]})};function up(e){return e.startsWith("http://")||e.startsWith("https://")}function ba(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function ya({value:e}){if(e==null)return null;if(typeof e=="string"&&up(e))return o.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 underline underline-offset-2 break-all hover:text-blue-800",children:e});if(typeof e=="boolean")return o.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return o.jsx("span",{className:"text-xs font-mono text-blue-600",children:e});if(typeof e=="object"){const t=e;return"type"in t&&Array.isArray(t.enum)?o.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((r,n)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(r)},n))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?o.jsx(Oe,{className:"prose-sm",children:t.description}):o.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([r,n])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:ba(r)}),o.jsx(ya,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function ka({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=bl[r.toLowerCase()]??{label:r,color:"bg-neutral-100 text-foreground-secondary border-border"},i=Object.entries(e??{}).filter(([a,l])=>a!=="bindingVersion"&&l!==void 0&&l!==null);return i.length===0?null:o.jsx(Kt,{className:"mt-2",defaultExpanded:t,forceExpanded:n,trigger:o.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:o.jsx("div",{className:"divide-y divide-neutral-100",children:i.length===0?o.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):i.map(([a,l])=>o.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[o.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:ba(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(ya,{value:l})})]},a))})})}function dp({host:e,protocol:t,description:r,tags:n,variables:s,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=s,d=g.useId();return o.jsxs("div",{children:[o.jsx(ga,{address:e,variables:u,children:o.jsx("div",{className:"mt-2",children:n&&n.map((f,p)=>{const h=f,m=h.externalDocs;return o.jsx(ds,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),o.jsx(Oe,{children:r}),i&&i.length>0&&o.jsxs("div",{id:l?`server-${l}-security`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(ma,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),o.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",i.length>1?"s":"",":"]}),o.jsx(Kt,{className:"mt-4",ariaLabelledBy:d,forceExpanded:c==="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:i.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(xs,{securities:i})})})]}),(()=>{const f=a==null?void 0:a[t];return f&&Object.keys(f).some(h=>h!=="bindingVersion")?o.jsxs("div",{id:l?`server-${l}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Fr,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),o.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),o.jsx(ka,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function wa({servers:e,selectedServer:t,onSelectServer:r,focusSection:n=null,layout:s}){const i=Object.keys(e),[a,l]=g.useState(void 0),c=[t,a].find(f=>!!f&&i.includes(f))??i[0],u=f=>{l(f),r==null||r(f)},d=o.jsx(dp,{...e[c],serverKey:c,focusSection:t||a?n:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:Oo,content:d,sideContent:o.jsx(ha,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const va=g.forwardRef(function({isOpen:t,side:r,onClose:n,title:s,headerActions:i,children:a,width:l="w-[50rem]"},c){g.useEffect(()=>{const S=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[n]);const u=r==="right"?"right-0":"left-0",d=r==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:h,sidePanelTopOffset:m=0}=ge(),y=h==="component";g.useEffect(()=>{if(!t||!f)return;const S=y?Cl(f,p):Pr(f);if(S)return Bo(S)},[y,t,f,p]);const b=Lr(p,y),v=(()=>{if(!y)return{position:"fixed",inset:0};if(!b)return{position:"fixed",inset:0};const S=Math.max(m,b.top),w=Math.max(0,b.left),C=Math.min(window.innerHeight,b.bottom),B=Math.min(window.innerWidth,b.right);return{position:"fixed",top:S,left:w,width:Math.max(0,B-w),height:Math.max(0,C-S)}})();return f?pt.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...v,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:n,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),o.jsxs("div",{ref:c,className:`absolute top-0 ${u} h-full ${l} max-w-[100cqw] bg-background ${t?"shadow-xl":""} flex flex-col transition-transform duration-300 ease-in-out`,style:{transform:t?"translateX(0)":d},children:[s&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?o.jsx("span",{className:"truncate block",children:s}):s}),i,o.jsx("button",{onClick:n,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:o.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a})]})]}),f):null});function ja({message:e,messageId:t,i:r}){const[n,s]=g.useState(!1);return o.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${r+1}`}),(t??e.name)&&o.jsx("span",{className:"text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 p-0.5 rounded shrink-0",children:t??e.name})]}),e.summary&&o.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:e.contentType}),e.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:e.correlationId.description??e.correlationId.location,children:e.correlationId.location}),e.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),o.jsx(fa,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function fp({requestMessages:e,reply:t,isSend:r,operationId:n}){const[s,i]=g.useState("request"),a=t.messages??[],l=t.channel,c=t.address,u=s==="request"?e:a,d=s==="request"?r?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",c?o.jsxs(o.Fragment,{children:["a channel in"," ",o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:c.location})]}):(l==null?void 0:l.address)&&o.jsx(Je,{address:l.address,parameters:l.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>o.jsx("button",{onClick:()=>i(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
132
|
+
${s===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:n})," ",d,u.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:u.map((f,p)=>o.jsx(ja,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const pp="",hp=`
|
|
133
|
+
`;var Pe=class{constructor({indent:e,join:t}={}){this.code=[],this.indentLine=(r,n=0)=>`${this.indentationCharacter.repeat(n)}${r}`,this.push=(r,n=0)=>{this.code.push(this.indentLine(r,n))},this.blank=()=>{this.code.push("")},this.join=()=>this.code.join(this.lineJoin),this.indentationCharacter=e??pp,this.lineJoin=t??hp}},Gt=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},mp=class extends Gt{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},gp=class extends Gt{constructor(e,t,r=[]){const n=r.length>0?` Registered targetId/clientId pairs: ${r.join(", ")}.`:" No targets are registered — did you forget to import a client module?";super(`Unsupported target "${e}/${t}".${n}`),this.name="UnsupportedTargetError"}},xp=class extends Gt{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},bp=class extends Gt{constructor(e,t){super(`Operation "${e}" is not reachable over "${t}": no server it's associated with declares that protocol (or a secure variant of it), and its channel has no explicit "${t}" binding`),this.name="MissingBindingError"}},yo=class extends Gt{constructor(e){super(`Operation "${e}"'s message has no "examples" entry, and no "payload" schema to generate one from (or its schema has no recognizable type — composition keywords like oneOf/anyOf/allOf aren't resolved into an example).`),this.name="MissingExampleError"}};const ko=10;function yp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function kp(e,t){if(!t.startsWith("#/"))throw new Error(`Unsupported $ref "${t}": only local refs (starting with "#/") are supported`);const r=t.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let n=e;for(const s of r){if(typeof n!="object"||n===null)throw new Error(`Cannot resolve $ref "${t}": no value at "${s}"`);n=n[s]}return n}function We(e,t){let r=t;for(let n=0;yp(r);n++){if(n>=ko)throw new Error(`Exceeded max $ref depth (${ko}) resolving "${r.$ref}" — possible cycle`);r=kp(e,r.$ref)}return r}const wp=10;function vp(e){switch(e){case"date-time":return"2024-01-01T00:00:00Z";case"date":return"2024-01-01";case"time":return"00:00:00Z";case"email":return"user@example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"uri":case"url":return"https://example.com";case"hostname":return"example.com";case"ipv4":return"192.0.2.1";case"ipv6":return"::1";default:return"string"}}function jp(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function Er(e,t,r=0){if(r>wp)return;const n=We(e,t);if(!n||typeof n!="object")return;const s=n;if(s.examples&&s.examples.length>0)return s.examples[0];if(s.default!==void 0)return s.default;if(s.const!==void 0)return s.const;if(s.enum&&s.enum.length>0)return s.enum[0];switch(jp(s.type)){case"object":{const i={};for(const[a,l]of Object.entries(s.properties??{})){const c=Er(e,l,r+1);c!==void 0&&(i[a]=c)}return i}case"array":{if(s.items===void 0)return[];const i=Er(e,s.items,r+1);return i!==void 0?[i]:[]}case"string":return vp(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const Sp=10;function Np(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Ct(e,t,r=0){if(r>=Sp||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>Ct(e,s,r+1));if(Np(t))return Ct(e,We(e,t),r+1);const n={};for(const[s,i]of Object.entries(t))n[s]=Ct(e,i,r+1);return n}function Sa(e,t,r){return e!==void 0?{value:String(e),isPlaceholder:!1}:t&&t.length>0?{value:String(t[0]),isPlaceholder:!1}:{value:`<${r}>`,isPlaceholder:!0}}function on(e,t){return e?Sa(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function wo(e){const t={},r=[];for(const[n,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=Sa(s.default,s.examples,n);t[n]=i.value,i.isPlaceholder&&r.push(n)}return{values:t,placeholders:r}}function vo(e,t){return t!=null&&t.length?t.map(r=>We(e,r)).filter(r=>!!(r!=null&&r.type)):[]}const Ap={"kafka-secure":"kafka",wss:"ws"};function Ep(e){return Ap[e]??e}function $p(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Cp(e){return e.slice(e.lastIndexOf("/")+1)}function Tp(e,t){return t&&t.length>0?t.map(r=>{const n=We(e,r);if(n)return{name:$p(r)?Cp(r.$ref):"",server:n}}).filter(r=>!!r):Object.entries(e.servers??{}).map(([r,n])=>{const s=We(e,n);return s?{name:r,server:s}:void 0}).filter(r=>!!r)}function Na(e,t){var i;const r=(i=e.operations)==null?void 0:i[t],n=r&&We(e,r);if(!n)throw new mp(t);const s=We(e,n.channel);if(!s)throw new xp(t);return{operation:n,channel:s}}function Aa(e,t,r,n){var l;const s=Tp(e,r.servers??t.servers),i=s.find(c=>Ep(c.server.protocol)===n),a=(l=t.bindings)==null?void 0:l[n];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function Ip(e,t,r){try{const{operation:n,channel:s}=Na(e,t);return Aa(e,s,n,r).eligible}catch{return!1}}function Op(e,t,r){var I,E,P,z,J,j,A,M,Z,Q,se,ue,fe,le;const{operation:n,channel:s}=Na(e,t),{servers:i,matchedServer:a,eligible:l}=Aa(e,s,n,r);if(!l)throw new bp(t,r);const c=[];let u={},d={},f;if(r==="ws"){const L=wo((E=(I=s.bindings)==null?void 0:I.ws)==null?void 0:E.query),F=wo((z=(P=s.bindings)==null?void 0:P.ws)==null?void 0:z.headers);u=L.values,d=F.values,c.push(...L.placeholders.map(_=>`query param "${_}"`)),c.push(...F.placeholders.map(_=>`header "${_}"`))}else r==="kafka"&&(f=(j=(J=s.bindings)==null?void 0:J.kafka)==null?void 0:j.topic);const p=s.address??"";let h=p;for(const[L,F]of Object.entries(s.parameters??{})){const _=on(F,L);h=h.replace(`{${L}}`,_.value),_.isPlaceholder&&c.push(`channel parameter "${L}"`)}r==="kafka"&&f&&(h=f);const m=(A=a??i[0])==null?void 0:A.server,y=m?`${m.protocol}://${m.host}${m.pathname??""}`:"",b=(m==null?void 0:m.host)??"",v=vo(e,m==null?void 0:m.security),S=i.map(({name:L,server:F})=>({name:L,host:F.host,protocol:F.protocol,pathname:F.pathname,url:`${F.protocol}://${F.host}${F.pathname??""}`,description:F.description,security:vo(e,F.security)})),w=n.messages!==void 0?We(e,n.messages[0]):We(e,Object.values(s.messages??{})[0]),C=(M=w==null?void 0:w.examples)==null?void 0:M[0];let B,H;if(C)B=C.name,H=C.payload;else if((w==null?void 0:w.payload)!==void 0){if(H=Er(e,w.payload),H===void 0)throw new yo(t);c.push("message payload (no explicit example — generated from its schema)")}else throw new yo(t);const N=(w==null?void 0:w.payload)!==void 0?Ct(e,w.payload):void 0,k=(w==null?void 0:w.headers)!==void 0?Ct(e,w.headers):void 0,x=n.action==="send"?"send":"receive";let $;if(r==="kafka"){const L=(Q=(Z=w==null?void 0:w.bindings)==null?void 0:Z.kafka)==null?void 0:Q.key,F=L?on(L,"kafka message key"):void 0;F!=null&&F.isPlaceholder&&c.push("kafka message key");const _=on((ue=(se=n.bindings)==null?void 0:se.kafka)==null?void 0:ue.clientId,"kafka clientId");_.isPlaceholder&&c.push("kafka clientId");let W;x==="receive"&&(W=on((le=(fe=n.bindings)==null?void 0:fe.kafka)==null?void 0:le.groupId,"kafka consumer group id"),W.isPlaceholder&&c.push("kafka consumer group id")),$={key:F==null?void 0:F.value,groupId:W==null?void 0:W.value,clientId:_.value}}return{operationId:t,action:x,protocol:r,serverUrl:y,serverHost:b,servers:S,channelAddress:h,channelTemplate:p,query:u,headers:d,operationSummary:n.summary,operationDescription:n.description,message:{name:B,payload:H,title:(w==null?void 0:w.title)??(w==null?void 0:w.name),summary:w==null?void 0:w.summary,description:w==null?void 0:w.description,contentType:w==null?void 0:w.contentType,payloadSchema:N,headersSchema:k},placeholders:c,info:e.info,security:v,...$?{kafka:$}:{}}}function _p(e){switch(e.type){case"apiKey":case"httpApiKey":return`API key${e.in?` (in ${e.in}${e.name?`: \`${e.name}\``:""})`:""}`;case"http":return e.scheme?`HTTP ${e.scheme}`:"HTTP authentication";case"oauth2":return"OAuth2";case"openIdConnect":return"OpenID Connect";case"userPassword":return"Username/password";case"X509":return"X.509 certificate";case"symmetricEncryption":return"Symmetric encryption";case"asymmetricEncryption":return"Asymmetric encryption";case"plain":return"SASL/PLAIN";case"scramSha256":return"SASL/SCRAM-SHA-256";case"scramSha512":return"SASL/SCRAM-SHA-512";case"gssapi":return"SASL/GSSAPI (Kerberos)";default:return e.type}}function Mp(e,t){if(t.length!==0){e("**Authorization:**");for(const r of t)if(e(`- **${_p(r)}**`),r.description&&e(r.description,1),r.type==="openIdConnect"&&r.openIdConnectUrl&&e(`- OpenID Connect URL: \`${r.openIdConnectUrl}\``,1),r.type==="oauth2")for(const[n,s]of Object.entries(r.flows??{})){e(`- Flow \`${n}\`:`,1),s.authorizationUrl&&e(`- Authorization URL: \`${s.authorizationUrl}\``,2),s.tokenUrl&&e(`- Token URL: \`${s.tokenUrl}\``,2),s.refreshUrl&&e(`- Refresh URL: \`${s.refreshUrl}\``,2);const i=Object.keys(s.scopes??{});i.length>0&&e(`- Scopes: ${i.map(a=>`\`${a}\``).join(", ")}`,2)}}}function Rp(e,t,r){e(`### ${r.name||r.host}`),t(),e(`**Host:** \`${r.host}${r.pathname??""}\``),e(`**Protocol:** ${r.protocol}`),r.description&&e(r.description),t(),r.security.length>0&&(Mp(e,r.security),t())}function jo(e,t,r,n){e(`#### \`${r}\``),t(),e("```json");for(const s of JSON.stringify(n,null,2).split(`
|
|
134
|
+
`))e(s);e("```"),t()}function Ea(e,t){var u,d,f,p,h,m,y;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});n(`# ${((u=e.info)==null?void 0:u.title)??e.operationId}`),s();const a=(d=e.info)==null?void 0:d.license;if(n(`**Version:** ${((f=e.info)==null?void 0:f.version)??"unknown"}${a?" ":""}`),a&&n(`**License:** ${a.name??""}${a.url?` (${a.url})`:""}`),s(),(p=e.info)!=null&&p.description&&(n(e.info.description),s()),n(`You are an AI agent that needs to ${e.action==="send"?"send a message to":"receive messages from"} an asynchronous (${e.protocol}) API operation ("${e.operationId}"). Use only the details below — do not invent field names, URLs, topics, or values that aren't given here.`),s(),e.servers.length>0){n("## Servers"),s();for(const b of e.servers)Rp(n,s,b)}n(`### ${e.action.toUpperCase()} \`${e.operationId}\``),s(),n(`**Channel:** \`${e.channelTemplate}\``);const l=Object.keys(e.query),c=Object.keys(e.headers);if(l.length>0&&n(`**Query parameters:** ${l.map(b=>`\`${b}=${e.query[b]}\``).join(", ")}`),c.length>0&&n(`**Headers:** ${c.map(b=>`\`${b}: ${e.headers[b]}\``).join(", ")}`),((h=e.kafka)==null?void 0:h.clientId)!==void 0&&n(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((m=e.kafka)==null?void 0:m.groupId)!==void 0&&n(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((y=e.kafka)==null?void 0:y.key)!==void 0&&n(`**Kafka message key:** \`${e.kafka.key}\``),s(),e.operationSummary&&(n(e.operationSummary),s()),e.operationDescription&&(n(e.operationDescription),s()),n(`#### ${e.message.title??e.operationId}`),s(),e.message.summary&&(n(e.message.summary),s()),e.message.description&&(n(e.message.description),s()),e.message.contentType&&(n(`**Content-Type:** \`${e.message.contentType}\``),s()),e.message.payloadSchema!==void 0&&jo(n,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&jo(n,s,"headers",e.message.headersSchema),n("## Instructions"),s(),e.action==="send"?(n("1. Construct a JSON payload that conforms to the `payload` schema above."),n(`2. Send it to the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`)):(n(`1. Subscribe/listen on the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`),n("2. Expect incoming messages conforming to the `payload` schema above.")),e.placeholders.length>0){n("3. Some values above could not be resolved from the AsyncAPI document's `default`/`examples` and are placeholders — replace them with real values before acting:");for(const b of e.placeholders)n(`- ${b}`,1)}return i()}const Pp={info:{key:"kafka",title:"Agent Prompt (Kafka)",description:"Self-contained Markdown prompt describing this operation — intro, broker, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"kafka"},convert:(e,t)=>Ea(e,t)},Lp={info:{key:"ws",title:"Agent Prompt (WebSocket)",description:"Self-contained Markdown prompt describing this operation — intro, server, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"ws"},convert:(e,t)=>Ea(e,t)};function Vt(e,t,r){const n=e.replace(/\/$/,""),s=t.startsWith("/")?t:`/${t}`,i=new URLSearchParams(r).toString();return i?`${n}${s}?${i}`:`${n}${s}`}const Bp={info:{key:"tokio-tungstenite",title:"tokio-tungstenite",description:"Rust WebSocket client built on tokio-tungstenite, driven with async/await on the Tokio runtime.",link:"https://github.com/snapview/tokio-tungstenite",extname:".rs",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const c of e.placeholders)n(`// - ${c}`);s()}const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(n("use futures_util::{SinkExt, StreamExt};"),l.length>0?n("use tokio_tungstenite::{connect_async, tungstenite::client::IntoClientRequest, tungstenite::Message};"):n("use tokio_tungstenite::{connect_async, tungstenite::Message};"),s(),s(),n("#[tokio::main]"),n("async fn main() {"),n(`let url = ${JSON.stringify(a)};`,1),s(),l.length>0){n('let mut request = url.into_client_request().expect("Invalid URL");',1);for(const[c,u]of l)n("request",1),n(".headers_mut()",2),n(`.insert(${JSON.stringify(c)}, ${JSON.stringify(u)}.parse().expect("Invalid header value"));`,2);s(),n('let (ws_stream, _) = connect_async(request).await.expect("Failed to connect");',1)}else n('let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");',1);if(n(`let (${e.action==="send"?"mut write":"_write"}, mut read) = ws_stream.split();`,1),s(),e.action==="send"){const c=JSON.stringify(e.message.payload,null,2).split(`
|
|
135
|
+
`);c[c.length-1]+=");",n(`let payload = serde_json::json!(${c[0]}`,1);for(const u of c.slice(1))n(u,1);s(),n("write",1),n(".send(Message::Text(payload.to_string().into()))",2),n(".await",2),n('.expect("Failed to send message");',2),s(),n("if let Some(msg) = read.next().await {",1),n('println!("{}", msg.expect("Failed to read message"));',2),n("}",1)}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
136
|
+
`))n(`// ${c}`,1);s(),n("while let Some(msg) = read.next().await {",1),n('println!("{}", msg.expect("Failed to read message"));',2),n("}",1)}return n("}"),i()}},Dp={info:{key:"rdkafka",title:"rdkafka",description:"Kafka producer/consumer client using the rdkafka crate, a librdkafka binding driven with async/await on the Tokio runtime.",link:"https://github.com/fede1024/rust-rdkafka",extname:".rs",protocol:"kafka"},convert:(e,t)=>{var l,c,u;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const d of e.placeholders)n(`// - ${d}`);s()}const a=((l=e.kafka)==null?void 0:l.clientId)??"";if(e.action==="send"){n("use rdkafka::config::ClientConfig;"),n("use rdkafka::producer::{FutureProducer, FutureRecord};"),n("use std::time::Duration;"),s(),s(),n("#[tokio::main]"),n("async fn main() {"),n("let producer: FutureProducer = ClientConfig::new()",1),n(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),n(`.set("client.id", ${JSON.stringify(a)})`,2),n(".create()",2),n('.expect("Failed to create producer");',2),s();const d=JSON.stringify(e.message.payload,null,2).split(`
|
|
137
|
+
`);d[d.length-1]+=");",n(`let payload = serde_json::json!(${d[0]}`,1);for(const f of d.slice(1))n(f,1);s(),n(`let record = FutureRecord::to(${JSON.stringify(e.channelAddress)})`,1),n(".payload(&payload.to_string())",2),((c=e.kafka)==null?void 0:c.key)!==void 0?n(`.key(${JSON.stringify(e.kafka.key)});`,2):n('.key("");',2),s(),n("producer",1),n(".send(record, Duration::from_secs(0))",2),n(".await",2),n('.expect("Failed to send message");',2),n("}")}else{const d=((u=e.kafka)==null?void 0:u.groupId)??"";n("use rdkafka::config::ClientConfig;"),n("use rdkafka::consumer::{Consumer, StreamConsumer};"),n("use rdkafka::Message;"),n("use futures_util::StreamExt;"),s(),s(),n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
138
|
+
`))n(`// ${f}`);s(),n("#[tokio::main]"),n("async fn main() {"),n("let consumer: StreamConsumer = ClientConfig::new()",1),n(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),n(`.set("group.id", ${JSON.stringify(d)})`,2),n(`.set("client.id", ${JSON.stringify(a)})`,2),n('.set("auto.offset.reset", "earliest")',2),n(".create()",2),n('.expect("Failed to create consumer");',2),s(),n(`consumer.subscribe(&[${JSON.stringify(e.channelAddress)}]).expect("Failed to subscribe");`,1),s(),n("let mut stream = consumer.stream();",1),n("while let Some(message) = stream.next().await {",1),n('let message = message.expect("Failed to read message");',2),n("if let Some(payload) = message.payload_view::<str>().and_then(Result::ok) {",2),n('println!("{}", payload);',3),n("}",2),n("}",1),n("}")}return i()}};function $r(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
139
|
+
${e.map(a=>`${s}${$r(a,t,r+1)}`).join(`,
|
|
140
|
+
`)},
|
|
141
|
+
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
142
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${$r(l,t,r+1)}`).join(`,
|
|
143
|
+
`)},
|
|
144
|
+
${n}}`}const Fp={info:{key:"websockets",title:"websockets",description:"Python WebSocket client using the `websockets` package's asyncio API.",link:"https://websockets.readthedocs.io/",extname:".py",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("# NOTE: some values could not be resolved from the AsyncAPI document's"),n("# default/examples and were filled with a placeholder — replace them"),n("# with real values before running this snippet:");for(const c of e.placeholders)n(`# - ${c}`);s()}n("import asyncio"),e.action==="send"&&n("import json"),s(),n("import websockets"),s(),s(),n("async def main() -> None:");const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(l.length>0){n("async with websockets.connect(",1),n(`${JSON.stringify(a)},`,2),n("additional_headers={",2);for(const[c,u]of l)n(`${JSON.stringify(c)}: ${JSON.stringify(u)},`,3);n("},",2),n(") as websocket:",1)}else n(`async with websockets.connect(${JSON.stringify(a)}) as websocket:`,1);if(s(),e.action==="send"){const c=$r(e.message.payload,r.indent).split(`
|
|
145
|
+
`);c[c.length-1]+=")",n("await websocket.send(",2),n(`json.dumps(${c[0]}`,3);for(const u of c.slice(1))n(u,3);n(")",2),s(),n("message = await websocket.recv()",2),n("print(message)",2)}else{n(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,2);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
146
|
+
`))n(`# ${c}`,2);s(),n("async for message in websocket:",2),n("print(message)",3)}return s(),s(),n("asyncio.run(main())"),i()}};function Cr(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
147
|
+
${e.map(a=>`${s}${Cr(a,t,r+1)}`).join(`,
|
|
148
|
+
`)},
|
|
149
|
+
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
150
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Cr(l,t,r+1)}`).join(`,
|
|
151
|
+
`)},
|
|
152
|
+
${n}}`}const zp={info:{key:"confluent-kafka",title:"confluent-kafka",description:"Kafka producer/consumer client using the confluent-kafka package — a librdkafka-backed client for Python.",link:"https://github.com/confluentinc/confluent-kafka-python",extname:".py",protocol:"kafka"},convert:(e,t)=>{var l,c,u;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("# NOTE: some values could not be resolved from the AsyncAPI document's"),n("# default/examples and were filled with a placeholder — replace them"),n("# with real values before running this snippet:");for(const d of e.placeholders)n(`# - ${d}`);s()}n("import json"),s(),e.action==="send"?n("from confluent_kafka import Producer"):n("from confluent_kafka import Consumer"),s(),s();const a=((l=e.kafka)==null?void 0:l.clientId)??"";if(e.action==="send"){n("producer = Producer({",0),n(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),n(`"client.id": ${JSON.stringify(a)},`,1),n("})"),s();const d=Cr(e.message.payload,r.indent).split(`
|
|
153
|
+
`);d[d.length-1]+=")",n(`payload = json.dumps(${d[0]}`);for(const f of d.slice(1))n(f);s(),n("producer.produce(",0),n(`${JSON.stringify(e.channelAddress)},`,1),n("value=payload.encode('utf-8'),",1),((c=e.kafka)==null?void 0:c.key)!==void 0&&n(`key=${JSON.stringify(e.kafka.key)},`,1),n(")"),n("producer.flush()")}else{const d=((u=e.kafka)==null?void 0:u.groupId)??"";n("consumer = Consumer({",0),n(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),n(`"group.id": ${JSON.stringify(d)},`,1),n(`"client.id": ${JSON.stringify(a)},`,1),n('"auto.offset.reset": "earliest",',1),n("})"),s(),n(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
154
|
+
`))n(`# ${f}`);s(),n(`consumer.subscribe([${JSON.stringify(e.channelAddress)}])`),s(),n("try:"),n("while True:",1),n("msg = consumer.poll(1.0)",2),n("if msg is None:",2),n("continue",3),n("if msg.error():",2),n("print(msg.error())",3),n("continue",3),n("print(msg.value().decode('utf-8'))",2),n("finally:"),n("consumer.close()",1)}return i()}},Hp={info:{key:"websocket",title:"WebSocket (browser)",description:"Browser-native WHATWG WebSocket API — no dependency to install, but it cannot set custom handshake headers, so only query-param bindings are supported.",link:"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket",extname:".js",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent}),a=Object.keys(e.headers);if(a.length>0&&(n(`// NOTE: this operation's "ws" binding declares handshake headers`),n(`// (${a.join(", ")}), but the browser-native WebSocket API cannot`),n("// set custom headers on the handshake request — they are omitted below."),n("// Move any required auth into the query string, or generate a Node.js"),n('// snippet instead (targetId: "javascript", clientId: "ws").'),s()),e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const l of e.placeholders)n(`// - ${l}`);s()}if(n(`const socket = new WebSocket('${Vt(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){n("socket.addEventListener('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
|
|
155
|
+
`);l[l.length-1]+="));",n(`socket.send(JSON.stringify(${l[0]}`,1);for(const c of l.slice(1))n(c,1);n("});"),s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const l of JSON.stringify(e.message.payload,null,2).split(`
|
|
156
|
+
`))n(`// ${l}`);s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}return i()}},Up={info:{key:"kafkajs",title:"kafkajs",description:"Kafka producer/consumer client using the kafkajs package — a pure JavaScript Kafka client for Node.js (no native build step, unlike node-rdkafka).",link:"https://kafka.js.org/",extname:".js",protocol:"kafka"},convert:(e,t)=>{var c,u,d;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const f of e.placeholders)n(`// - ${f}`);s()}n("import { Kafka } from 'kafkajs';"),s();const a=e.serverHost.split(",").map(f=>f.trim()).filter(Boolean),l=((c=e.kafka)==null?void 0:c.clientId)??"";if(n("const kafka = new Kafka({"),n(`clientId: '${l}',`,1),n(`brokers: [${a.map(f=>`'${f}'`).join(", ")}],`,1),n("});"),s(),e.action==="send"){n("const producer = kafka.producer();"),s(),n("async function main() {"),n("await producer.connect();",1),n("await producer.send({",1),n(`topic: '${e.channelAddress}',`,2),n("messages: [",2),n("{",3),((u=e.kafka)==null?void 0:u.key)!==void 0&&n(`key: '${e.kafka.key}',`,4);const f=JSON.stringify(e.message.payload,null,2).split(`
|
|
157
|
+
`);f[f.length-1]+="),",n(`value: JSON.stringify(${f[0]}`,4);for(const p of f.slice(1))n(p,4);n("},",3),n("],",2),n("});",1),n("await producer.disconnect();",1),n("}"),s(),n("main();")}else{n(`const consumer = kafka.consumer({ groupId: '${((d=e.kafka)==null?void 0:d.groupId)??""}' });`),s(),n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
158
|
+
`))n(`// ${f}`);s(),n("async function main() {"),n("await consumer.connect();",1),n(`await consumer.subscribe({ topic: '${e.channelAddress}', fromBeginning: true });`,1),s(),n("await consumer.run({",1),n("eachMessage: async ({ message }) => {",2),n("console.log(message.value?.toString());",3),n("},",2),n("});",1),n("}"),s(),n("main();")}return i()}};function Tr(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
159
|
+
${e.map(a=>`${s}${Tr(a,t,r+1)}`).join(`,
|
|
160
|
+
`)},
|
|
161
|
+
${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
162
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Tr(l,t,r+1)}`).join(`,
|
|
163
|
+
`)},
|
|
164
|
+
${n}}`}const Wp={info:{key:"gorilla",title:"gorilla/websocket",description:"Go WebSocket client using the gorilla/websocket package's Dialer API.",link:"https://github.com/gorilla/websocket",extname:".go",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const c of e.placeholders)n(`// - ${c}`);s()}const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(n("package main"),s(),n("import ("),e.action==="send"&&n('"encoding/json"',1),n('"log"',1),l.length>0&&n('"net/http"',1),s(),n('"github.com/gorilla/websocket"',1),n(")"),s(),n("func main() {"),n(`url := ${JSON.stringify(a)}`,1),s(),l.length>0){n("header := http.Header{}",1);for(const[c,u]of l)n(`header.Set(${JSON.stringify(c)}, ${JSON.stringify(u)})`,1);s(),n("conn, _, err := websocket.DefaultDialer.Dial(url, header)",1)}else n("conn, _, err := websocket.DefaultDialer.Dial(url, nil)",1);if(n("if err != nil {",1),n('log.Fatal("dial:", err)',2),n("}",1),n("defer conn.Close()",1),s(),e.action==="send"){const c=Tr(e.message.payload,r.indent).split(`
|
|
165
|
+
`);n(`payload := ${c[0]}`,1);for(const u of c.slice(1))n(u,1);s(),n("data, err := json.Marshal(payload)",1),n("if err != nil {",1),n('log.Fatal("marshal:", err)',2),n("}",1),n("if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {",1),n('log.Fatal("write:", err)',2),n("}",1),s(),n("_, message, err := conn.ReadMessage()",1),n("if err != nil {",1),n('log.Fatal("read:", err)',2),n("}",1),n("log.Println(string(message))",1)}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
166
|
+
`))n(`// ${c}`,1);s(),n("for {",1),n("_, message, err := conn.ReadMessage()",2),n("if err != nil {",2),n('log.Println("read:", err)',3),n("return",3),n("}",2),n("log.Println(string(message))",2),n("}",1)}return n("}"),i()}};function Ir(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
167
|
+
${e.map(a=>`${s}${Ir(a,t,r+1)}`).join(`,
|
|
168
|
+
`)},
|
|
169
|
+
${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
170
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Ir(l,t,r+1)}`).join(`,
|
|
171
|
+
`)},
|
|
172
|
+
${n}}`}const Kp={info:{key:"kafka-go",title:"kafka-go",description:"Kafka producer/consumer client using the segmentio/kafka-go package — a pure Go client (no cgo, unlike confluent-kafka-go).",link:"https://github.com/segmentio/kafka-go",extname:".go",protocol:"kafka"},convert:(e,t)=>{var l,c;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const u of e.placeholders)n(`// - ${u}`);s()}const a=e.serverHost.split(",").map(u=>u.trim()).filter(Boolean);if(n("package main"),s(),n("import ("),e.action==="send"?(n('"context"',1),n('"encoding/json"',1),n('"log"',1)):(n('"context"',1),n('"log"',1)),s(),n('"github.com/segmentio/kafka-go"',1),n(")"),s(),n("func main() {"),e.action==="send"){n("writer := &kafka.Writer{",1),n(`Addr: kafka.TCP(${a.map(d=>JSON.stringify(d)).join(", ")}),`,2),n(`Topic: ${JSON.stringify(e.channelAddress)},`,2),n("Balancer: &kafka.LeastBytes{},",2),n("}",1),n("defer writer.Close()",1),s();const u=Ir(e.message.payload,r.indent).split(`
|
|
173
|
+
`);n(`payload := ${u[0]}`,1);for(const d of u.slice(1))n(d,1);s(),n("data, err := json.Marshal(payload)",1),n("if err != nil {",1),n('log.Fatal("marshal:", err)',2),n("}",1),s(),n("message := kafka.Message{Value: data}",1),((l=e.kafka)==null?void 0:l.key)!==void 0&&n(`message.Key = []byte(${JSON.stringify(e.kafka.key)})`,1),s(),n("if err := writer.WriteMessages(context.Background(), message); err != nil {",1),n('log.Fatal("write:", err)',2),n("}",1)}else{const u=((c=e.kafka)==null?void 0:c.groupId)??"";n("reader := kafka.NewReader(kafka.ReaderConfig{",1),n(`Brokers: []string{${a.map(d=>JSON.stringify(d)).join(", ")}},`,2),n(`Topic: ${JSON.stringify(e.channelAddress)},`,2),n(`GroupID: ${JSON.stringify(u)},`,2),n("})",1),n("defer reader.Close()",1),s(),n(`// 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
|
+
`))n(`// ${d}`,1);s(),n("for {",1),n("message, err := reader.ReadMessage(context.Background())",2),n("if err != nil {",2),n('log.Println("read:", err)',3),n("return",3),n("}",2),n("log.Println(string(message.Value))",2),n("}",1)}return n("}"),i()}},Gp={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 r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const l of e.placeholders)n(`// - ${l}`);s()}n("import WebSocket from 'ws';"),s();const a=Vt(e.serverUrl,e.channelAddress,e.query);if(Object.keys(e.headers).length>0){n(`const socket = new WebSocket('${a}', {`),n("headers: {",1);const l=Object.entries(e.headers);l.forEach(([c,u],d)=>{const f=d<l.length-1?",":"";n(`'${c}': '${u}'${f}`,2)}),n("},",1),n("});")}else n(`const socket = new WebSocket('${a}');`);if(s(),e.action==="send"){n("socket.on('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
|
|
175
|
+
`);l[l.length-1]+="));",n(`socket.send(JSON.stringify(${l[0]}`,1);for(const c of l.slice(1))n(c,1);n("});"),s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}else{n(`// 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
|
+
`))n(`// ${l}`);s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}return i()}},mt={};function Jt(e){if(mt[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);mt[e.info.key]={...e,clientsById:{...e.clientsById}}}function _e(e,t){const r=mt[e];if(!r)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(r.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);r.clientsById[t.info.key]=t}function Vp(){return Object.values(mt).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Jp(e,t){const r=[];for(const n of Vp()){const s=n.clients.filter(i=>Ip(e,t,i.protocol));s.length>0&&r.push({...n,default:s[0].key,clients:s})}return r}Jt({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});_e("agent",Lp);_e("agent",Pp);Jt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});_e("javascript",Gp);_e("javascript",Hp);_e("javascript",Up);Jt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});_e("python",Fp);_e("python",zp);Jt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});_e("rust",Bp);_e("rust",Dp);Jt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});_e("go",Wp);_e("go",Kp);var Zp=class{constructor(e){this.document=e}convert(e,t,r,n={}){var a;const s=(a=mt[t])==null?void 0:a.clientsById[r];if(!s){const l=Object.values(mt).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new gp(t,r,l)}const i=Op(this.document,e,s.info.protocol);return s.convert(i,n)}};const Xp="javascript",Yp="ws";function Qp(e,t){return Jp(e,t)}function $a(e,t,r,n){try{return new Zp(e).convert(t,r,n)}catch{return null}}function qp(e,t,r){if(t){for(const n of r)for(const s of n.clients)if($a(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${Xp}:${Yp}`}const eh={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 Ca(e){return eh[e]??"plaintext"}const th={c:()=>Promise.resolve().then(()=>require("./c-C_Sx7N-F.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BcGgviMR.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-yuAGIuP4.cjs")),go:()=>Promise.resolve().then(()=>require("./go-BpetKc7b.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-BIk0G-rH.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-kGuORR5a.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-DF4zG2hq.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-nPcbuC2a.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-DKnYCg2f.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-CAnH__EC.cjs"))};function En(e){return e==="plaintext"||!!Ie.getLanguage(e)}async function Ta(e){if(En(e))return;const t=th[e];if(!t)return;const r=await t();Ie.registerLanguage(e,r.default)}function nh({operationId:e}){const{document:t,showCodeSamples:r}=Ke(),n=g.useId(),s=g.useMemo(()=>e?Qp(t,e):[],[t,e]),i=g.useMemo(()=>qp(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=Ca(u),[,p]=g.useState(()=>En(f));g.useEffect(()=>{p(En(f));let m=!1;return Ta(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?$a(t,e,u,d):null,[t,e,u,d]);return!r||!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:n,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:n,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(Ln,{code:h,language:f})]})}function Ia({label:e,children:t}){return o.jsx(Cn,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function Oa(){const{plugins:e,pluginSlotRegistry:t}=Ke();return g.useMemo(()=>t??Mo(e??[]),[t,e])}function _a(e){return Oa().get(e)??[]}function bs({name:e,context:t}){const r=_a(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Ia,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function Ma(e){return Oa().get(e)??[]}const At="reference";function Ra({name:e,context:t,enabled:r=!0,children:n}){const s=Ma(e),[i,a]=g.useState(At),[l,c]=g.useState(()=>new Set([At])),u=g.useId(),d=g.useMemo(()=>new Map(s.map(b=>[b.id,b])),[s]),f=r&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??At,m=[{id:At,name:"Reference"},...s.map(b=>({id:b.id,name:b.label}))],y=b=>{c(v=>v.has(b)?v:new Set([...v,b])),a(b)};return f?o.jsxs(o.Fragment,{children:[o.jsx(it,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:m,current:h,onChange:y}),o.jsx($l,{tabs:m,current:h,idPrefix:u,renderPanel:(b,v)=>{if(!v&&!l.has(b.id))return null;if(b.id===At)return n;const S=d.get(b.id);if(!S)return null;const w=S.Component;return o.jsx(Ia,{label:`${e}:${S.pluginName}`,children:o.jsx(w,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function rh({op:e,id:t,focusSection:r=null}){var y;const{document:n}=To(),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(b=>b.bindings))==null?void 0:y.bindings:void 0),h=e.action===mn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,v)=>o.jsx(ja,{message:b,messageId:b.name,i:v},v))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(Ra,{name:"asyncapi.operation.tab",context:{document:n,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)&&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(_n,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(Oe,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(nh,{operationId:t}),t&&o.jsx(bs,{name:"asyncapi.operation.reference.supplementary",context:{document:n,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(Kt,{ariaLabelledBy:s,forceExpanded:r==="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(xs,{securities:f})})})]}),p&&Object.entries(p).map(([b,v])=>v?o.jsxs("div",{id:`operation-${t}-bindings-${b}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(ka,{protocol:b,bindings:v,focused:r===`binding:${b}`})]},b):null),u?o.jsx(fp,{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((b,v)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:b.name},v))})]})]})})})}function Pa({operations:e,selectedKey:t=null,onSelectKey:r,focusSection:n=null,layout:s}){const i=f=>r==null?void 0:r(f);if(!Object.keys(e).length)return null;const a=t?e[t]:null,l=Object.keys(e).map(f=>{var S;const p=e[f],h=p.channel,m=h==null?void 0:h.address,y=h==null?void 0:h.parameters,b=((S=p.action)==null?void 0:S.toUpperCase())??"",v=t===f;return o.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),role:"button",tabIndex:0,"aria-label":`${b||"Operation"} ${m??f}`,"aria-current":v?"true":void 0,onKeyDown:w=>{w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),i(f))},className:`cursor-pointer hover:bg-neutral-50 ${v?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:m&&o.jsx(Je,{address:m,parameters:y,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(Ze,{method:p.action,className:"w-24"})})]},f)}),c=a?a.channel:null,u=a&&(c!=null&&c.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:a.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Je,{address:c.address,parameters:c.parameters,truncate:!0,peek:!0})})]}):t??"Operation",d=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:l})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:gl,content:d,stickySideContent:!1,layout:s})}),o.jsx(va,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(rh,{op:a,id:t,focusSection:n},t)})]})}function ys({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=ge(),i=Jr(),a=g.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Mt(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=ui(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"," ",di(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(Qi,{schema:u.originalSchema})}):o.jsx(gs,{schema:d,rootName:c,className:"mt-4",focusTokens:c===t?(r==null?void 0:r.tokens)??null:null,focusId:c===t?(r==null?void 0:r.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(Xe,{content:l,stickySideContent:!1,layout:n})})}const sh=e=>e==="operations"||e==="messages"||e==="schemas";function oh({asyncapi:e,config:t,plugins:r}){var P,z,J,j;const n=t.show??{},[s,i]=g.useState(!1),[a,l]=g.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&Zi(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:In}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Go}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Dr}]:[]],{query:p,setQuery:h,results:m}=Kc(e,{threshold:.3,limit:20}),{effectiveTab:y,focusTab:b,navActiveSection:v,selected:S,setSelectedKey:w,selectedNavItem:C,handleSearchSelect:B,handleNavItemSelect:H,handleNavServerSelect:N,handleContentTabChange:k,focusSection:x,schemaFocusTarget:$}=li({tabs:f,defaultTab:"operations",isTabKey:sh,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:p}),I=e.servers?Object.keys(e.servers):[],E=y==="operations"?o.jsx(Pa,{operations:e.operations??{},selectedKey:S.operations,onSelectKey:A=>w("operations",A),focusSection:x}):y==="messages"?o.jsx(pa,{messages:((P=e.components)==null?void 0:P.messages)??{},selectedKey:S.messages,focusSection:x}):y==="schemas"?o.jsx(ys,{schemas:((z=e.components)==null?void 0:z.schemas)??{},selectedKey:S.schemas,focusTarget:$}):null;return o.jsx(Tn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(Fo,{logo:u?o.jsx(ps,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Vo,{query:p,onQueryChange:h,results:m,onSelectResult:B,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Yo,{serialize:A=>Zr(e,A),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Yi,{...e.info,showLogo:!1})}),n.servers!==!1&&I.length>0&&o.jsx("div",{id:`server-${S.servers??I[0]}`,children:o.jsx(wa,{servers:e.servers,selectedServer:S.servers,onSelectServer:A=>w("servers",A),focusSection:x})}),n.sidebar!==!1&&o.jsx(Kl,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(J=e.components)==null?void 0:J.messages:void 0,schemas:n.schemas!==!1?(j=e.components)==null?void 0:j.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:v,onTabChange:b,onItemSelect:H,onSelectServer:N,selectedItem:C}),o.jsx(Do,{tabs:f,current:y,onChange:k}),y&&o.jsx("div",{id:`panel-${y}`,role:"tabpanel","aria-labelledby":`tab-${y}`,children:E})]})})}const ks=e=>o.jsx(Cn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(ih,{...e})}),ih=e=>{const t=e.asyncapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Rr(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.')},[n,t,r]);const s=e.config??gt;return o.jsx(oh,{asyncapi:r,config:s,plugins:e.plugins})};function Dn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Ro("openapi",e,t,r);return o.jsx(bt.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"openapi-portal-root"}),s]})})}function ah(e){var n;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:ve([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:ve([s.url,s.description,s.variables])})});const r=(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:ve([p,d,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&r(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&r(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))Qo(t,i,s,s);return t}function lh(e,t={}){return ii(e,ah,t)}function La({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(Xi,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function ch({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx(ga,{address:e,variables:r}),t&&o.jsx(Oe,{children:t})]})}const tr=e=>`server-${e}`,nr=e=>Number(e.slice(7));function Ba({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||tr(h)),[i,a]=g.useState(void 0),l=p=>!!p&&nr(p)>=0&&nr(p)<e.length,c=l(t)?t:l(i)?i:tr(0),u=e[nr(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(ch,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:Oo,content:f,sideContent:o.jsx(ha,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?tr(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const So=320;function uh({parameters:e}){const{portalHost:t}=ge(),[r,n]=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(!r)return;const u=a.current;if(!u)return;const d=()=>i(ar(u,{align:"end",width:So}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[r]),g.useEffect(()=>{if(!r)return;const u=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),n(!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)||n(!1)};return document.addEventListener("keydown",u,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",u,!0),document.removeEventListener("pointerdown",d,!0)}},[r]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>n(u=>!u),"aria-expanded":r,"aria-haspopup":"dialog","aria-controls":r?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 ${r?"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 ${r?"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"})})]}),r&&t&&pt.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:So},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:zo(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 dh({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 Da(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function fh(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${Da(`$${r}`)}}`)}function ph(e){return e.operationId??e.operationRef??null}const hh=e=>e.trim().replace(/[.:;]+$/,""),rr=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function mh({links:e,onFollowOperation:t,isOperationKnown:r}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([n,s])=>{var d;const i=ph(s),a=Object.entries(s.parameters??{}),l=s.description?hh(s.description):null,c=!!s.operationId&&!!t&&!!(r!=null&&r(s.operationId)),u=l??i??n;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(dh,{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(rr,{children:f})," from ",o.jsx(rr,{children:Da(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(rr,{children:s.server.url})]}):null,"."]})]},n)})})}function gh(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>On.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function xh({callbacks:e,id:t,renderOperation:r,depth:n}){const s=gh(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(Kt,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Ze,{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:fh(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(r,{method:l,path:a,op:c,id:`${t}-${i}-${u}-${l}`,idPrefix:"callback",depth:n+1})})},`${i}-${u}-${l}`))})]})}const bh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-BQmjSY09.cjs")).then(({CodeSamples:e})=>({default:e})));function yh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Fa({prefix:e,mediaTypes:t,selected:r,onChange:n}){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:r,onChange:s=>n(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 za(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 kh(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 wh({responses:e,onFollowOperation:t,isOperationKnown:r}){var H,N;const n=Object.keys(e),[s,i]=g.useState(n[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=g.useState(l[0]),d=c?(H=a==null?void 0:a.content)==null?void 0:H[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,b=Object.keys(f).length>0,v=Object.keys(p).length>0,S=[...y?[{id:"body",name:"Body"}]:[],...b?[{id:"headers",name:"Headers"}]:[]],w=S.length>1,C=S.some(k=>k.id===h)?h:(N=S[0])==null?void 0:N.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:n.map(k=>o.jsx("button",{role:"tab","aria-selected":s===k,onClick:()=>i(k),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${kh(k)} ${s===k?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:k},k))}),(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:[w&&o.jsx(it,{tabs:S,current:C,onChange:k=>m(k)}),o.jsx("div",{className:w?"mt-4":void 0,children:C==="headers"?o.jsx(ot,{schema:jh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(ot,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Fa,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:za(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),v&&o.jsx(mh,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function Ha(e){const t={},r=[];for(const n of e){const s=n.schema??{};t[n.name]={...s,description:s.description??n.description},n.required&&r.push(n.name)}return{type:"object",properties:t,...r.length>0?{required:r}:{}}}const vh=e=>Ha(e),jh=e=>Ha(Object.entries(e).map(([t,r])=>({name:t,...r})));function Sh({parameters:e}){var l;const t=yl.filter(({location:c})=>e.some(u=>u.in===c)),[r,n]=g.useState(((l=t[0])==null?void 0:l.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===r)?r:t[0].location,i=t.find(c=>c.location===s),a=vh(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(it,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:n}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(ot,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function Nh({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}){const s=t.length>0,i=Object.keys(r),a=i.length>0,[l,c]=g.useState(s?"parameters":"body"),[u,d]=g.useState(i[0]),f=u?r[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 ",Ah(p),":"]}),s&&a&&o.jsx(it,{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(Sh,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(ot,{schema:f.schema??{},label:o.jsx(Fa,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:za(f)})]})]})}function Ah(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 Eh({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n,responses:s,callbacks:i,id:a,depth:l,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:d}){const f=t.length>0||Object.keys(r).length>0,p=Object.keys(s).length>0,h=!!i&&Object.keys(i).length>0&&l<$h,m=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[y,b]=g.useState(m[0]??"request");if(m.length===0)return null;const v=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":v===S,onClick:()=>b(S),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${v===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:[v==="request"&&o.jsx(Nh,{label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}),v==="response"&&o.jsx(wh,{responses:s,onFollowOperation:u,isOperationKnown:d}),v==="callbacks"&&i&&o.jsx(xh,{callbacks:i,id:a,depth:l,renderOperation:Ua})]})]})}const $h=1;function Ua({method:e,path:t,op:r,id:n,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var w,C,B,H;const{document:d}=Io(),f=(r.parameters??[]).filter(N=>N.in!=="query"&&N.in!=="path"),p=r.security??i??[],h=r.responses??{},m=((w=r.requestBody)==null?void 0:w.content)??{},y=r.operationId?yh(r.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const N of p)for(const[k,x]of Object.entries(N)){if(x.length===0)continue;const $=b.get(k)??[];b.set(k,Array.from(new Set([...$,...x])))}const v=Array.from(new Set(p.flatMap(N=>Object.keys(N)))).map(N=>{const k=a==null?void 0:a[N];if(!k)return null;const x=b.get(N);return x?{...k,requiredScopes:x}:k}).filter(N=>!!N),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(Ra,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:S,children:o.jsxs(o.Fragment,{children:[(r.deprecated||((C=r.externalDocs)==null?void 0:C.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[r.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=r.externalDocs)==null?void 0:B.url)&&o.jsxs("a",{href:r.externalDocs.url,target:"_blank",rel:"noreferrer",title:r.externalDocs.description||r.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(_n,{className:"w-3.5 h-3.5"})]})]}),r.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:r.summary}),r.description&&o.jsx(Oe,{children:r.description}),o.jsx(g.Suspense,{fallback:null,children:o.jsx(bh,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(bs,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${n}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),v.length>0&&o.jsx(Kt,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(ma,{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:v.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(xs,{securities:v})})})]}),o.jsx(Eh,{label:y,parameters:f,requestBodyContent:m,requestBodyDescription:(H=r.requestBody)==null?void 0:H.description,responses:h,callbacks:r.callbacks,id:n,depth:u,fillHeight:S,onFollowOperation:l,isOperationKnown:c})]})})})}function Wa(e){var r;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:(r=t==null?void 0:t.enum)==null?void 0:r.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function No(e){const t={};for(const r of e)t[r.name]=Wa(r);return t}function Ch(e){return e.filter(t=>t.in==="query").map(t=>({...Wa(t),name:t.name,required:t.required}))}function $n({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var H;const c=N=>s==null?void 0:s(N),u=g.useMemo(()=>Tt(e),[e]),d=g.useMemo(()=>{var k,x,$;const N=new Map;for(const I of u){const E=(($=(x=(k=e[I.path])==null?void 0:k[I.method])==null?void 0:x.tags)==null?void 0:$[0])||"Other",P=N.get(E)??[];P.push(I),N.set(E,P)}return Array.from(N,([I,E])=>({label:I,items:E}))},[u,e]),[f,p]=g.useState(()=>new Set),h=f.size===0;g.useEffect(()=>{if(!n)return;const N=d.find(({items:k})=>k.some(({key:x})=>x===n));N&&p(k=>{if(!k.has(N.label))return k;const x=new Set(k);return x.delete(N.label),x})},[d,n]);const m=g.useMemo(()=>{var k,x;const N=new Map;for(const{key:$,method:I,path:E}of u){const P=(x=(k=e[E])==null?void 0:k[I])==null?void 0:x.operationId;P&&N.set(P,$)}return N},[u,e]);if(u.length===0)return null;const y=n?u.find(N=>N.key===n):null,b=y?(H=e[y.path])==null?void 0:H[y.method]:null,v=({key:N,method:k,path:x},$)=>{var P;const I=n===N,E=Os(e[x],(P=e[x])==null?void 0:P[k]);return o.jsxs("tr",{id:`${a}-${N}`,onClick:()=>c(N),role:"button",tabIndex:$?0:-1,"aria-hidden":!$,"aria-label":`${k.toUpperCase()} ${x}`,"aria-current":I?"true":void 0,onKeyDown:z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),c(N))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${$?`cursor-pointer opacity-100 visible ${I?"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(Je,{address:x,parameters:No(E),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(Ze,{method:k,className:"w-20"})})})]},N)},S=d.map(({label:N,items:k},x)=>{const $=!f.has(N),I=`${a}-group-${x}-${N.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":`${N} endpoints (${k.length})`,"aria-expanded":$,"aria-controls":I,onClick:()=>p(E=>{const P=new Set(E);return $?P.add(N):P.delete(N),P}),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(yt,{className:"h-2.5 w-2.5"}):o.jsx(xa,{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:N}),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:k.length})]})})})}),o.jsx("tbody",{id:I,"aria-hidden":!$,className:`bg-surface ${$?"divide-y divide-border":""}`,children:k.map(E=>v(E,$))})]},N)}),w=Os(y?e[y.path]:void 0,b),C=y?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:y.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Je,{address:y.path,parameters:No(w),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(uh,{parameters:Ch(w)})]}):n,B=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:h,onChange:N=>p(N.target.checked?new Set:new Set(d.map(({label:k})=>k))),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),p(h?new Set(d.map(({label:k})=>k)):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"})]})}),S]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{content:B,stickySideContent:!1,layout:l})}),o.jsx(va,{isOpen:!!y,side:"right",onClose:()=>c(null),title:C,children:y&&b&&o.jsx(Ua,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:N=>m.has(N),onFollowOperation:N=>{const k=m.get(N);k&&c(k)}},y.key)})]})}const Th=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function Ih({openapi:e,config:t,plugins:r}){var z,J,j,A;const n=t.show??{},[s,i]=g.useState(!1),[a,l]=g.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&Zi(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:In}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Fr}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Dr}]:[]],{query:m,setQuery:y,results:b}=lh(e,{threshold:.3,limit:20}),{effectiveTab:v,focusTab:S,navActiveSection:w,selected:C,setSelectedKey:B,selectedNavItem:H,handleSearchSelect:N,handleNavItemSelect:k,handleNavServerSelect:x,handleContentTabChange:$,schemaFocusTarget:I}=li({tabs:h,defaultTab:"endpoints",isTabKey:Th,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:p&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:m}),E=(e.servers??[]).map(M=>M.url),P=v==="endpoints"?o.jsx($n,{paths:e.paths??{},security:e.security,securitySchemes:(z=e.components)==null?void 0:z.securitySchemes,selectedKey:C.endpoints,onSelectKey:M=>B("endpoints",M)}):v==="webhooks"?o.jsx($n,{paths:f,security:e.security,securitySchemes:(J=e.components)==null?void 0:J.securitySchemes,selectedKey:C.webhooks,onSelectKey:M=>B("webhooks",M),columnLabel:"Webhook",idPrefix:"webhook"}):v==="schemas"?o.jsx(ys,{schemas:((j=e.components)==null?void 0:j.schemas)??{},selectedKey:C.schemas,focusTarget:I}):null;return o.jsx(Dn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(Fo,{logo:u?o.jsx(ps,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Vo,{query:m,onQueryChange:y,results:b,onSelectResult:N,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Yo,{serialize:M=>Xr(e,M),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(La,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),n.servers!==!1&&E.length>0&&o.jsx("div",{id:C.servers??"server-0",children:o.jsx(Ba,{servers:e.servers,selectedServer:C.servers,onSelectServer:M=>B("servers",M)})}),n.sidebar!==!1&&o.jsx(Zl,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:p&&n.webhooks!==!1?f:void 0,schemas:n.schemas!==!1?(A=e.components)==null?void 0:A.schemas:void 0,servers:n.servers!==!1?E:void 0,hasInfo:n.info!==!1,activeTab:w,onTabChange:S,onItemSelect:k,onSelectServer:x,selectedItem:H}),o.jsx(Do,{tabs:h,current:v,onChange:$}),v&&o.jsx("div",{id:`panel-${v}`,role:"tabpanel","aria-labelledby":`tab-${v}`,children:P})]})})}const ws=e=>o.jsx(Cn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Oh,{...e})}),Oh=e=>{const t=e.openapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Rr(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.')},[n,t,r]);const s=e.config??gt;return o.jsx(Ih,{openapi:r,config:s,plugins:e.plugins})};function Ka(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,r)=>e.toMarkdown(t,r)}}const ft=e=>{var r;return typeof e!="string"?void 0:((r=e.trim().split(`
|
|
177
|
+
`)[0])==null?void 0:r.trim())||void 0},_h=e=>On.some(t=>t===e),Mh=Ka({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 ft((t=e.info)==null?void 0:t.description)},targets:e=>Tt(e.paths??{}).map(({key:t,method:r,path:n})=>{var i,a;const s=(a=(i=e.paths)==null?void 0:i[n])==null?void 0:a[r];return{key:t,label:`${r.toUpperCase()} ${n}`,summary:ft(s==null?void 0:s.summary)??ft(s==null?void 0:s.description),target:{kind:"operation",document:e,method:r,path:n}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Xr(e);if(typeof t.path!="string"||!_h(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return gi(e,t.method,t.path)}}),Rh=Ka({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 ft((t=e.info)==null?void 0:t.description)},targets:e=>Object.entries(e.operations??{}).map(([t,r])=>({key:t,label:r!=null&&r.action?`${r.action.toUpperCase()} ${t}`:t,summary:ft(r==null?void 0:r.summary)??ft(r==null?void 0:r.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Zr(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return hi(e,t.id)}}),Ao=[Mh,Rh];function vs(e){const t=typeof e=="object"&&e!==null?e:{},r=Ao.find(n=>n.matches(t));if(!r)throw new Error(`[apiuikit] Unrecognized document: expected a top-level "openapi", "swagger", or "asyncapi" version key. Supported specs: ${Ao.map(n=>n.name).join(", ")}.`);return r}function Ga(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ph(e){return vs(e).targets(e)}function Lh(e,t){const r=vs(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return r.toMarkdown(e,t)}function Bh(e,t={}){const r=vs(e),{baseUrl:n,url:s,optional:i}=t,a=(n==null?void 0:n.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${Ga(p.key)}.md`),u=[`# ${t.title??r.title(e)}`],d=t.summary??r.summary(e);d&&u.push("",`> ${d}`);const f=r.targets(e).map(p=>({entry:p,href:c(p)})).filter(p=>!!p.href);if(f.length){u.push("",`## ${r.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 Va(e,t,r){e.registerSchemaParser(t);const n=e.parserRegistry,s=n.get.bind(n);n.get=i=>{const a=s(i);return a!==void 0?a:r(i)?t:void 0}}const Dh=["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 Fh(){return{validate:Hh,parse:Uh,getMimeTypes:()=>Dh}}function zh(e){Va(e,Fh(),Bt)}function Hh(e){return Vr(e.data).map(t=>({message:t,path:e.path}))}function Uh(e){var r,n;const t=Vr(e.data);if(t.length>0)return{[kn]:t[0]};try{const s=kr(e.data),i=e.meta.message,a=(n=(r=i==null?void 0:i.bindings)==null?void 0:r.kafka)==null?void 0:n.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=kr(a)),s}catch(s){return{[kn]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Wh(){try{const e=await Promise.resolve().then(()=>require("./index-BjY_1Vlo.cjs")).then(r=>r.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 Ja(e){try{const t=await Wh(),r=new t;zh(r);const{registerProtobufSchemaParser:n}=await Promise.resolve().then(()=>require("./protobufSchemaParser-l_gdtemJ.cjs"));n(r);const{document:s,diagnostics:i}=await r.parse(e);return{diagnostics:i,document:s?Gh(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Kh(e,t){const{diagnostics:r,document:n}=await Ja(e);return{diagnostics:r,view:n?o.jsx(ks,{kind:"resolved",asyncapi:n,config:t}):null}}function Gh(e){return e.json()}function Vh({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=g.useState(null),c=g.useRef(n);return c.current=n,g.useEffect(()=>{let u=!0;return Ja(e).then(({document:d,diagnostics:f})=>{var p;u&&(l(d),(p=c.current)==null||p.call(c,f))}),()=>{u=!1}},[e]),a?o.jsx(ks,{kind:"resolved",asyncapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}async function Jh(){try{return await Promise.resolve().then(()=>require("./index-Db1EbA-L.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 sr=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function Za(e){try{const{validate:t,dereference:r}=await Jh(),n=await t(e);if(!n.valid)return{diagnostics:n.errors.map(l=>sr(l,0)),document:null};const s=(n.errors??[]).map(l=>sr(l,1)),{schema:i,errors:a}=r(e);return a!=null&&a.length&&s.push(...a.map(l=>sr(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 Zh(e,t){const{diagnostics:r,document:n}=await Za(e);return{diagnostics:r,view:n?o.jsx(ws,{kind:"resolved",openapi:n,config:t}):null}}function Xh({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=g.useState(null),c=g.useRef(n);return c.current=n,g.useEffect(()=>{let u=!0;return Za(e).then(({document:d,diagnostics:f})=>{var p;u&&(l(d),(p=c.current)==null||p.call(c,f))}),()=>{u=!1}},[e]),a?o.jsx(ws,{kind:"resolved",openapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}function Xa(e,t,r){return function({document:s,config:i,plugins:a,children:l}){const c=g.useContext(bt),u=g.useMemo(()=>s?xt(s):null,[s]),d=!!c&&c.specType!==r;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 Yh({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Tn,{document:s,config:t,plugins:r,children:n})}const Fn=Xa(Tn,"AsyncAPI","asyncapi");function zn(){const e=ge();return e.specType==="asyncapi",e.document}function Qh({layout:e}){const t=zn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(wa,{servers:t.servers,layout:e})}function qh({layout:e,...t}){return o.jsx(Fn,{...t,children:o.jsx(Qh,{layout:e})})}function em({layout:e}){const t=zn(),[r,n]=g.useState(null);return o.jsx(Pa,{operations:t.operations??{},selectedKey:r,onSelectKey:n,layout:e})}function tm({layout:e,...t}){return o.jsx(Fn,{...t,children:o.jsx(em,{layout:e})})}function nm({layout:e}){var r;const t=zn();return o.jsx(pa,{messages:((r=t.components)==null?void 0:r.messages)??{},layout:e})}function rm({layout:e,...t}){return o.jsx(Fn,{...t,children:o.jsx(nm,{layout:e})})}function sm({layout:e}){const t=zn();return t.info?o.jsx(Yi,{...t.info,layout:e}):null}function om({layout:e,...t}){return o.jsx(Fn,{...t,children:o.jsx(sm,{layout:e})})}const im=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function or({layout:e}){var n,s;const t=g.useContext(bt),r=((s=(n=t==null?void 0:t.document)==null?void 0:n.components)==null?void 0:s.schemas)??{};return o.jsx(ys,{schemas:r,layout:e})}function js({document:e,config:t,plugins:r,layout:n}){const s=g.useContext(bt),i=g.useMemo(()=>e?xt(e):null,[e]);if(s)return o.jsx(or,{layout:n});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return im(i)?o.jsx(Dn,{document:i,config:t,plugins:r,children:o.jsx(or,{layout:n})}):o.jsx(Tn,{document:i,config:t,plugins:r,children:o.jsx(or,{layout:n})})}const am=js,lm=js;function cm({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Dn,{document:s,config:t,plugins:r,children:n})}const Hn=Xa(Dn,"OpenAPI","openapi");function Un(){const e=Ke();return e.specType==="openapi",e.document}function um({layout:e}){const t=Un();return!t.servers||t.servers.length===0?null:o.jsx(Ba,{servers:t.servers,layout:e})}function dm({layout:e,...t}){return o.jsx(Hn,{...t,children:o.jsx(um,{layout:e})})}function fm({layout:e}){var s;const t=Un(),[r,n]=g.useState(null);return o.jsx($n,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:r,onSelectKey:n,layout:e})}function pm({layout:e,...t}){return o.jsx(Hn,{...t,children:o.jsx(fm,{layout:e})})}function hm({layout:e}){var i;const t=Un(),[r,n]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx($n,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:r,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function mm({layout:e,...t}){return o.jsx(Hn,{...t,children:o.jsx(hm,{layout:e})})}function gm({layout:e}){const t=Un();return t.info?o.jsx(La,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function xm({layout:e,...t}){return o.jsx(Hn,{...t,children:o.jsx(gm,{layout:e})})}exports.AsyncAPI=ks;exports.AsyncAPIInfo=om;exports.AsyncAPIMessages=rm;exports.AsyncAPIOperations=tm;exports.AsyncAPIProvider=Yh;exports.AsyncAPIRenderer=Vh;exports.AsyncAPISchemas=am;exports.AsyncAPIServers=qh;exports.CodeBlock=Ln;exports.ErrorBoundary=Cn;exports.OpenAPI=ws;exports.OpenAPIEndpoints=pm;exports.OpenAPIInfo=xm;exports.OpenAPIProvider=cm;exports.OpenAPIRenderer=Xh;exports.OpenAPISchemas=lm;exports.OpenAPIServers=dm;exports.OpenAPIWebhooks=mm;exports.PluginSlot=bs;exports.SchemaTabs=ot;exports.SchemaTree=gs;exports.Schemas=js;exports.X_LIB_CONVERSION_ERROR=kn;exports.asyncApiOperationToMarkdown=hi;exports.asyncApiToMarkdown=Zr;exports.commonjsGlobal=ad;exports.defaultConfig=gt;exports.documentToLlmsTxt=Bh;exports.documentToMarkdown=Lh;exports.ensureHljsLanguage=Ta;exports.getAugmentedNamespace=ld;exports.getDefaultExportFromCjs=Oi;exports.hljsLanguageForTarget=Ca;exports.isHljsLanguageReady=En;exports.isProtobufSchemaFormat=Dt;exports.listDocumentTargets=Ph;exports.markdownForLlm=Xo;exports.openApiEndpointToMarkdown=gi;exports.openApiToMarkdown=Xr;exports.parseAndRender=Kh;exports.parseAndRender$1=Zh;exports.registerSchemaParserWithFallback=Va;exports.resolveLogo=Yr;exports.targetSlug=Ga;exports.useAsyncAPIDocument=ge;exports.useAsyncAPIDocumentContext=To;exports.useDocumentContext=Ke;exports.useOpenAPIDocumentContext=Io;exports.useOperationTabPlugins=Ma;exports.usePluginSlot=_a;
|