apiuikit 1.8.2 → 1.8.3
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-CL8eb-T3.js → CodeSamples-BWvMuksg.js} +1 -1
- package/dist/{CodeSamples-Cv-2sVZy.cjs → CodeSamples-Cvh_2_x5.cjs} +1 -1
- package/dist/{LogoExtension-DU3IhX6X.js → LogoExtension-BHy28s8Y.js} +1 -1
- package/dist/{LogoExtension-CPGCplgQ.cjs → LogoExtension-Dc7mY8J6.cjs} +1 -1
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +1 -1
- package/dist/components/DocumentTopBar.d.ts +4 -2
- package/dist/{index-BQPvrcDl.cjs → index-8gOyuoTj.cjs} +75 -75
- package/dist/{index-COqgZ4Yj.cjs → index-BQS9YcP-.cjs} +1 -1
- package/dist/{index-DQ7J7s-P.js → index-CnGwk9EN.js} +2754 -2772
- package/dist/{index-AW9A5hmB.cjs → index-CzrvJcJ8.cjs} +1 -1
- package/dist/{index-CRgA--GI.js → index-DCqgYJYx.js} +1 -1
- package/dist/{index-BknhLZWz.js → index-ZIZhr0U6.js} +1 -1
- package/dist/{protoToJsonSchema-BMBlvMH-.cjs → protoToJsonSchema-BU9Hfl7F.cjs} +1 -1
- package/dist/{protoToJsonSchema-DqNgaYMA.js → protoToJsonSchema-kF7eY8gE.js} +1 -1
- package/dist/{protobufSchemaParser-DpLRfSmz.cjs → protobufSchemaParser-B_yfGaIm.cjs} +1 -1
- package/dist/{protobufSchemaParser-iQvfvNCx.js → protobufSchemaParser-qOi4Vagu.js} +2 -2
- package/dist/utils/scrollLock.d.ts +0 -1
- package/package.json +1 -1
- package/dist/utils/useScrollClipAncestor.d.ts +0 -12
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Ya=Object.defineProperty;var Qa=(e,t,r)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>Qa(e,typeof t!="symbol"?t+"":t,r);const o=require("react/jsx-runtime"),g=require("react"),pt=require("react-dom"),No=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",qa=e=>typeof e=="object"&&e!==null;function el(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Ao(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(const n of t.slice(2).split("/")){if(!qa(r))return;const s=el(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=Ao(e,r);return t.set(r,n),n}}const Un=e=>typeof e=="object"&&e!==null,tl=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))),Eo=(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=>Eo(s,t,r))}finally{t.delete(e)}},nl=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),js=e=>e.length?`#/${e.map(nl).join("/")}`:"#";function xt(e){if(!Eo(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,js(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=Ao(e,i.$ref),c=Un(l)||Array.isArray(l);if(c&&!r.has(l)){const u=s(l,a);return Un(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=tl(i.$ref)),u}if(l!==void 0&&!c)return l}if(Un(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,js(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 $n 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},$o=()=>{const e=Ke();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Co=()=>{const e=Ke();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},be=Ke;var hn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(hn||{});const rl="Contact",sl="Email",Ss="License",Ns="External Documentation",ol="Tags",il="Implicit",al=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
2
|
for native apps and JavaScript apps where the access token is returned
|
|
3
|
-
immediately without an extra authorization code exchange step.`,cl="Client Credentials",ul="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",dl="Password",fl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",pl="Authorization Code",hl="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",ml="",gn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],gl=[50,100,200,300,500,600,700],xl={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"}},bl=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],yl={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 Gn(e,t,r){if(e)for(const n of gl){const s=e[n];s&&(r[`--color-${t}-${n}`]=_o(s))}}const kl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],wl={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 vl(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(wl))t[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of kl){const a=n[s];a&&(t[i]=_o(a))}return e.colors&&(Gn(e.colors.primary,"primary",t),Gn(e.colors.secondary,"secondary",t),Gn(e.colors.neutral,"neutral",t)),t}const jl=e=>e.endsWith(".tab"),$s=new WeakMap;let Sl=0;const Al=e=>{const t=$s.get(e);if(t)return t;const r=`plugin-${Sl++}`;return $s.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),jl(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 Nl=[];function Ro(e,t,r=gt,n=Nl){var A,k,x,$,I,E,P,z;const[s,i]=g.useState(null),[a,l]=g.useState(null),c=g.useMemo(()=>Lt(t),[t]),u=((A=r.expand)==null?void 0:A.schemas)===!0,d=(x=(k=r.theme)==null?void 0:k.depthColors)!=null&&x.length?r.theme.depthColors:_r,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?vl(r.theme):{};return{contextValue:B,themeVars:H,setPortalHost:i,setRootElement:l}}function In({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 El({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 Lr(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Br(e){let t=e;for(;t&&t!==document.body;){if(Lr(t))return t;t=t.parentElement}return document.documentElement}function $l(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Lr(r))return r;if(r===t)break;r=r.parentElement}return null}function Lo(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 Bo({tabs:e,current:t,onChange:r}){const{rootElement:n,topOffset:s=0}=Ke();if(!e.length)return null;const i=typeof document<"u"&&Br(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 Cl(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 xn(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}function Tl(e){const[t,r]=g.useState(null);return g.useLayoutEffect(()=>{if(!e){r(null);return}let n=e.parentElement;for(;n&&n!==document.body;){if(Lr(n)){r(n);return}n=n.parentElement}r(null)},[e]),t}const Zt=16,Il=10,Ol=10,_l=40,Ml=8;function Do({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=Ke(),i=Cl(n,r),a=i!=="docked",l=xn(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=Tl(n),p=xn(f,a),h=p?Math.max(p.top,0):0,m=Math.max(s,h)+Il,y=m-Ol+_l+Ml,b={left:a?u+Zt:Zt,right:a?Math.max(c-d,0)+Zt:Zt,transform:`translateY(${i==="hidden"?`-${y}px`:"0px"})`,...a?{position:"fixed",top:m,pointerEvents:i==="hidden"?"none":void 0}:{}};return o.jsx("header",{className:"document-topbar",style:b,"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 Fo(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 Rl(e){return e.map(t=>`\`${t}\``).join(", ")}function lr(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 Pl(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 Ll(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=Pl(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(lr($)),c(x)},C=()=>c(null),B=x=>m(lr(x,{align:"end",width:Cs})),H=()=>m(null),A=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:N=>z&&w($,N.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:N=>z&&w($,N.currentTarget),onBlur:C,onKeyDown:N=>{z&&((N.key==="Enter"||N.key===" ")&&(N.preventDefault(),w($,N.currentTarget)),N.key==="Escape"&&(N.preventDefault(),C(),N.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:Fo(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:A}),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:Ll(v)})}),a)]}):o.jsx("code",{className:`${k}rounded text-foreground-secondary break-all ${r}`,children:A})}const Bl={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 ${Bl[t]} ${yl[e]} ${r}`,children:e}):null}const Ts=6,Dl=12,Fl=8,zl=.7;function Hl(e,t){if(e===0)return 1/0;const r=e*zl-Fl*2,n=t*Ts+Math.max(0,t-1)*Dl;return Math.max(1,Math.floor((r-n)/Ts))}function Ul(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 Wl({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 A=(S==null?void 0:S.section)??t,k=S??s,x=xn(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"},N={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=A===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,A,k,J,se,n,H]),fe=Hl(P,b.length),le=g.useMemo(()=>{const L=Ul(b.map(F=>F.items.length),fe);return b.map((F,_)=>{const W=A===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,A,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:N,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 zo({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Wl,{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 Dr({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 Kl(e){return o.jsxs(Dr,{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 Fr({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 Ho(e){return{id:"info",label:"Info",icon:Kl,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function Uo(e){return{id:"schemas",label:"Schemas",icon:Fr,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function Wo({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 On({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 Ko({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 Gl({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[Ho(s),{id:"servers",label:"Servers",icon:Wo,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:On,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:Ko,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},Uo(r)]},[e,t,r,n,s,d]);return o.jsx(zo,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const _n=["get","put","post","delete","options","head","patch","trace"],Vl=(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?_n.filter(n=>r[n]).map(n=>({key:Vl(n,t),method:n,path:t})):[]})}function zr({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={},Jl={},Zl=[];function Xl({paths:e=_s,webhooks:t=_s,schemas:r=Jl,servers:n=Zl,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[Ho(s),{id:"servers",label:"Servers",icon:Wo,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:On,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:zr,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})]})},Uo(r)]},[d,f,r,n,s]);return o.jsx(zo,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Yl=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 Go({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 Lo(Br(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`:"",A=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(Yl,{})}),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:A?"⌘ 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 Vo({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 Jo({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function Mn({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}const Ql=["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 Zo(e){return`${["> ## Agent Instructions",...Ql.map(r=>`> ${r}`)].join(`
|
|
3
|
+
immediately without an extra authorization code exchange step.`,ll="Client Credentials",cl="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",ul="Password",dl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",fl="Authorization Code",pl="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",To="Connecting to a server",hl="",mn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ml=[50,100,200,300,500,600,700],gl={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"}},xl=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],bl={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",[hn.SEND]:"bg-green-100 text-green-800",[hn.RECEIVE]:"bg-blue-100 text-blue-800"};function Io(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 Wn(e,t,r){if(e)for(const n of ml){const s=e[n];s&&(r[`--color-${t}-${n}`]=Io(s))}}const yl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],kl={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 wl(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(kl))t[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of yl){const a=n[s];a&&(t[i]=Io(a))}return e.colors&&(Wn(e.colors.primary,"primary",t),Wn(e.colors.secondary,"secondary",t),Wn(e.colors.neutral,"neutral",t)),t}const vl=e=>e.endsWith(".tab"),As=new WeakMap;let jl=0;const Sl=e=>{const t=As.get(e);if(t)return t;const r=`plugin-${jl++}`;return As.set(e,r),r};function Oo(e){const t=new Map;for(const r of e){const n=Sl(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),vl(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 Nl=[];function _o(e,t,r=gt,n=Nl){var A,k,x,$,T,C,P,z;const[s,i]=g.useState(null),[a,l]=g.useState(null),c=g.useMemo(()=>Lt(t),[t]),u=((A=r.expand)==null?void 0:A.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=((T=r.show)==null?void 0:T.codeSamples)!==!1,h=r.topOffset,m=typeof h=="number"&&Number.isFinite(h)?Math.max(0,h):0,y=((C=r.sidePanel)==null?void 0:C.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]),I=g.useMemo(()=>Oo(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:I,config:r}),[e,t,c,s,a,m,y,v,u,d,f,p,w,n,I,r]),F=r.theme?wl(r.theme):{};return{contextValue:B,themeVars:F,setPortalHost:i,setRootElement:l}}function Cn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=_o("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 Mo="@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?"":Mo}`,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 on=(e,t)=>`${e?`${e}-`:""}tab-${t}`,an=(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 I;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),(I=u.current[w])==null||I.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:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(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:I=>{u.current[v]=I},id:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(i,b.id),onClick:()=>r(b.id),onKeyDown:I=>m(I,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:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(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 Al({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:an(r,s.id),role:"tabpanel","aria-labelledby":on(r,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:n(s,i)},s.id)})})}function Ro(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(Ro(t))return t;t=t.parentElement}return document.documentElement}function El(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Ro(r))return r;if(r===t)break;r=r.parentElement}return null}function Po(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 Lo({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 $l(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}const Cl=10,Tl=10,Il=40,Ol=8;function Bo({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=Ke(),i=$l(n,r),a=s+Cl,l=a-Tl+Il+Ol,c={top:a,transform:`translateY(${i==="hidden"?`-${l}px`:"0px"})`,pointerEvents:i==="hidden"?"none":void 0};return o.jsx("header",{className:"document-topbar",style:c,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Mo}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function Do(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 _l(e){return e.map(t=>`\`${t}\``).join(", ")}function ir(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 Ml(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 Es=360;function Rl(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 ${mn[t++%mn.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}=be(),[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=Ml(e);let S=0;g.useEffect(()=>{if(!n)return;const x=y.current;if(!x)return;const $=()=>p(x.scrollWidth>x.clientWidth);$();const T=new ResizeObserver($);return T.observe(x),()=>T.disconnect()},[n,e]);const w=(x,$)=>{d(ir($)),c(x)},I=()=>c(null),B=x=>m(ir(x,{align:"end",width:Es})),F=()=>m(null),A=v.map((x,$)=>{if(x.type==="text")return o.jsx("span",{children:x.value},$);const T=t==null?void 0:t[x.value],C=mn[S++%mn.length],P=l===$,z=!!T&&(T.description||T.type||T.default||T.enum&&T.enum.length>0||T.examples&&T.examples.length>0),V=`channel-address-tooltip-${$}`,j=z&&P?V:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:E=>z&&w($,E.currentTarget),onMouseLeave:I,children:[o.jsx("span",{className:`font-semibold ${C} ${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:E=>z&&w($,E.currentTarget),onBlur:I,onKeyDown:E=>{z&&((E.key==="Enter"||E.key===" ")&&(E.preventDefault(),w($,E.currentTarget)),E.key==="Escape"&&(E.preventDefault(),I(),E.currentTarget.blur()))},children:`{${x.value}}`}),z&&P&&a&&pt.createPortal(o.jsxs("div",{id:V,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:[T.description&&o.jsx("div",{children:T.description}),T.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:T.type})}),T.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:T.default})]}),T.enum&&T.enum.length>0&&o.jsx("div",{className:"mt-1",children:Do(T.enum)}),T.examples&&T.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",T.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:A}),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:F,onFocus:x=>B(x.currentTarget),onBlur:F,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),B(x.currentTarget)),x.key==="Escape"&&(x.preventDefault(),F(),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:Es},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:Rl(v)})}),a)]}):o.jsx("code",{className:`${k}rounded text-foreground-secondary break-all ${r}`,children:A})}const Pl={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 ${Pl[t]} ${bl[e]} ${r}`,children:e}):null}function ar(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 $s=6,Ll=12,Bl=8,Dl=.7;function Fl(e,t){if(e===0)return 1/0;const r=e*Dl-Bl*2,n=t*$s+Math.max(0,t-1)*Ll;return Math.max(1,Math.floor((r-n)/$s))}function zl(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 Cs=20;function Hl({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}=be(),h=g.useRef(null),m=g.useRef(null),[y,b]=g.useState(null),v=g.useMemo(()=>e.filter(N=>N.items.length>0),[e]),S=g.useMemo(()=>v.filter(N=>N.isTab===!1||N.id===t),[v,t]),w=g.useMemo(()=>v.filter(N=>N.showInPopover!==!1),[v]),[I,B]=g.useState(null),F=g.useRef(null),A=g.useRef(null),k=g.useCallback((N,L)=>{B({section:N,key:L}),F.current={section:N,key:L},A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{F.current=null},600)},[]);g.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),g.useEffect(()=>{const L=e.filter(H=>H.items.length>0).flatMap(H=>H.items.map(Q=>({section:H.id,key:H.itemKey(Q),id:H.targetId(Q)}))).map(H=>({...H,el:document.getElementById(H.id)})).filter(H=>!!H.el);if(L.length===0)return;const J=new Map(L.map(H=>[H.el,H])),Z=new Map,oe=new IntersectionObserver(H=>{for(const fe of H)fe.isIntersecting?Z.set(fe.target,fe.boundingClientRect.top):Z.delete(fe.target);if(Z.size===0)return;let Q=null,he=-1/0;for(const[fe,D]of Z)D>he&&(Q=fe,he=D);const q=Q&&J.get(Q);if(!q)return;const $e=F.current;if($e){if(q.section!==$e.section||q.key!==$e.key)return;F.current=null}B({section:q.section,key:q.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return L.forEach(H=>oe.observe(H.el)),()=>oe.disconnect()},[e]);const x=(I==null?void 0:I.section)??t,$=I??s,T=ar(d,!0),C=typeof window>"u"?0:window.innerWidth,P=typeof window>"u"?0:window.innerHeight,z=!!T&&T.bottom>p&&T.top<P,V=Math.max(0,P-p),j=p+V/2,E=!!T&&T.width<1024,M={opacity:z?1:0,pointerEvents:z?"auto":"none",transition:"opacity 0.2s ease"},G={position:"fixed",top:j,left:((T==null?void 0:T.left)??0)+Cs,transform:"translateY(-50%)",zIndex:51,...M},Y={position:"sticky",bottom:0,height:0,zIndex:51,pointerEvents:"none"},te=ar(y,E),ue=E?{position:"fixed",bottom:te?P-te.top+8:68,right:te?C-te.right:16,zIndex:52}:{position:"fixed",top:j,left:((T==null?void 0:T.left)??0)+Cs,transform:"translateY(-50%)",maxHeight:`calc(100vh - ${p+32}px)`,zIndex:52};g.useEffect(()=>{if(!i)return;const N=J=>{J.key==="Escape"&&a(!1)},L=J=>{var oe,H;const Z=J.target;(oe=h.current)!=null&&oe.contains(Z)||(H=m.current)!=null&&H.contains(Z)||a(!1)};return document.addEventListener("keydown",N),document.addEventListener("mousedown",L),()=>{document.removeEventListener("keydown",N),document.removeEventListener("mousedown",L)}},[i]);const de=g.useCallback((N,L)=>{N.isTab!==!1&&r(N.id),L&&setTimeout(()=>{var J;(J=document.getElementById(L))==null||J.scrollIntoView({behavior:"smooth",block:"start"})},50)},[r]),le=g.useMemo(()=>w.map(N=>{const L=x===N.id,J=($==null?void 0:$.section)===N.id,Z=N.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{de(N),k(N.id,""),E&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${L?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(Z,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${L?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${L?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:N.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 ${L?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:N.items.length})]}),N.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:N.items.map(oe=>{const H=N.itemKey(oe),Q=J&&($==null?void 0:$.key)===H;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{de(N,N.targetId(oe)),n(N.id,H),k(N.id,H),E&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${Q?"bg-primary-50 font-medium text-primary-500":L?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:N.renderItem(oe,{isSelected:Q,isSectionActive:L})})},H)})})]},N.id)}),[w,x,$,E,de,n,k]),ae=Fl(V,S.length),se=g.useMemo(()=>{const N=zl(S.map(L=>L.items.length),ae);return S.map((L,J)=>{const Z=x===L.id,oe=L.items.length,H=N[J];let Q=-1;if(($==null?void 0:$.section)===L.id){const he=L.items.findIndex(q=>L.itemKey(q)===$.key);he>=0&&(Q=Math.min(H-1,Math.floor(he*H/oe)))}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 ${Z?"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:H},(he,q)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${q===Q?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},q))})]},L.id)})},[S,x,$,ae]);return o.jsxs(o.Fragment,{children:[!E&&o.jsx("button",{ref:h,onClick:()=>a(N=>!N),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:G,children:se}),E&&o.jsx("div",{style:Y,children:o.jsx("button",{ref:N=>{h.current=N,b(N)},onClick:()=>a(N=>!N),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"absolute bottom-4 right-4 flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:M,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 ${E?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:ue,children:le}),f)]})}function Fo({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Hl,{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 Lr({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 Ul(e){return o.jsxs(Lr,{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 Br({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 zo(e){return{id:"info",label:"Info",icon:Ul,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function Ho(e){return{id:"schemas",label:"Schemas",icon:Br,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function Uo({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 Tn({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 Wo({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 Zt={};function Wl({operations:e=Zt,messages:t=Zt,schemas:r=Zt,servers:n=Zt,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[zo(s),{id:"servers",label:"Servers",icon:Uo,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:Tn,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:Wo,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},Ho(r)]},[e,t,r,n,s,d]);return o.jsx(Fo,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const In=["get","put","post","delete","options","head","patch","trace"],Kl=(e,t)=>`${e} ${t}`;function Ts(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?In.filter(n=>r[n]).map(n=>({key:Kl(n,t),method:n,path:t})):[]})}function Dr({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 Is={},Gl={},Vl=[];function Jl({paths:e=Is,webhooks:t=Is,schemas:r=Gl,servers:n=Vl,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[zo(s),{id:"servers",label:"Servers",icon:Uo,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:Tn,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:Dr,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})]})},Ho(r)]},[d,f,r,n,s]);return o.jsx(Fo,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Zl=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 Ko({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}=be(),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 Po(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,I=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(),I(r[u]);return}}},F=w?`${r.length} result${r.length===1?"":"s"} found`:"",A=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(Zl,{})}),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:F}),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:()=>I(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:A?"⌘ 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 Go({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 Vo({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 On({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 Xl=["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 Jo(e){return`${["> ## Agent Instructions",...Xl.map(r=>`> ${r}`)].join(`
|
|
4
4
|
`)}
|
|
5
5
|
|
|
6
|
-
${e.trimStart()}`}function Xo({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=()=>Zo(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(Jo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Vo,{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(Mn,{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}`,ec=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),tc=e=>{if(!ze(e))return e;const t={};for(const[r,n]of Object.entries(e))ec.has(r)||(t[r]=n);return t},Yo=(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([tc(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 nc(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))Yo(t,i,s,s);return t}function Ye(e){return Array.isArray?Array.isArray(e):qo(e)==="[object Array]"}function rc(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 cr(e){return e==null?"":rc(e)}function me(e){return typeof e=="string"}function un(e){return typeof e=="number"}function sc(e){return e===!0||e===!1||oc(e)&&qo(e)=="[object Boolean]"}function Qo(e){return typeof e=="object"}function oc(e){return Qo(e)&&e!==null}function Ae(e){return e!=null}function Yt(e){return!e.trim().length}function qo(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ic="Incorrect 'index' type",ur="Invalid doc index: must be a non-negative integer within the bounds of the docs array",ac=e=>`Invalid value for key ${e}`,lc=e=>`Pattern length exceeds max of ${e}.`,cc=e=>`Missing ${e} property in key`,uc=e=>`Property 'weight' in key '${e}' must be a positive integer`,dc="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 fc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=ei(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 ei(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(cc("name"));const a=e.name;if(n=a,Ms.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(uc(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 pc(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Ae(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ae(u))return;if(l===a.length-1&&(me(u)||un(u)||sc(u)||typeof u=="bigint"))r.push(c!==void 0?{v:cr(u),i:c}:cr(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 hc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},mc={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},gc={location:0,threshold:.6,distance:100},xc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:pc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},K=Object.freeze({...mc,...hc,...gc,...xc});function bc(e){return e>=9&&e<=13||e===32||e===160}function yc(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++)bc(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 Hr=class{constructor({getFn:e=K.getFn,fieldNormWeight:t=K.fieldNormWeight}={}){this.norm=yc(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(ur);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(ur);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!Ae(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(Ae(a)){if(Ye(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ae(d)){if(me(d)){if(!Yt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ae(d.v)){const f=me(d.v)?d.v:cr(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 ti(e,t,{getFn:r=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){const s=new Hr({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(ei)),s.setSources(t),s.create(),s}function kc(e,{getFn:t=K.getFn,fieldNormWeight:r=K.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new Hr({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function wc(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 vc(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(lc(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 A=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,N=r[e[j]];if(z[J]=(z[J+1]<<1|1)&N,x&&(z[J]|=(w[J+1]|w[J])<<1|1|w[J+1]),z[J]&A&&(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=wc(v,l);x.length?c&&(k.indices=x):k.isMatch=!1}return k}function jc(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 Ur(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 ni={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Sc=new RegExp("["+Object.keys(ni).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(Sc,t=>ni[t]):e=>e;var Wr=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:jc(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}=vc(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=Ur(d)),h}};const Ac=new Set(["fuzzy","include"]);function Nc(e){return e.startsWith("inverse")}const dr=[{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 Wr(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=dr.length,Ec="\0",$c="|";function Cc(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 Tc(e,t={}){return e.replace(/\\\|/g,Ec).split($c).map(r=>{const n=Cc(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=dr[u],f=Ls(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ps;){const d=dr[u],f=Ls(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Ic=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=Tc(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&&(Ac.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=Ur(a)),p}}return{isMatch:!1,score:1}}};const fr=[];function Kr(...e){fr.push(...e)}function bn(e,t){for(let r=0,n=fr.length;r<n;r+=1){const s=fr[r];if(s.condition(e,t))return new s(e,t)}return new Wr(e,t)}const yn={AND:"$and",OR:"$or"},pr={PATH:"$path",PATTERN:"$val"},hr=e=>!!(e[yn.AND]||e[yn.OR]),Oc=e=>!!e[pr.PATH],_c=e=>!Ye(e)&&Qo(e)&&!hr(e),Bs=e=>({[yn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ri(e,t,{auto:r=!0}={}){const n=s=>{if(me(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=bn(s,t)),c}const i=Object.keys(s),a=Oc(s);if(!a&&i.length>1&&!hr(s))return n(Bs(s));if(_c(s)){const c=a?s[pr.PATH]:i[0],u=a?s[pr.PATTERN]:s[c];if(!me(u))throw new Error(ac(c));const d={keyId:dn(c),pattern:u};return r&&(d.searcher=bn(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 hr(e)||(e=Bs(e)),n(e)}function mr(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 Mc(e,{ignoreFieldNorm:t=K.ignoreFieldNorm}){e.forEach(r=>{r.score=mr(r.matches,{ignoreFieldNorm:t})})}var Rc=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 Pc(e){const t=[];return e.matches.forEach(r=>{if(!Ae(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 Lc(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=Pc(s)),n&&(a.score=s.score),a})}const Bc=/[\p{L}\p{M}\p{N}_]+/gu,Ds=new WeakSet;function Dc(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 Fc(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||Dc(e),t=>t.match(e)||[]):t=>t.match(Bc)||[]}function gr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=Fc(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=It(s)),n(s)}}}var zc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=gr({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 Wr(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=Ur(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Vn(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 si(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Vn(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)Vn(e,u.v,s,n);else Vn(e,c.v,s,n)}}function Hc(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)si(n,s,t,r);return n}function Uc(e,t,r,n){si(e,t,r,n)}function Wc(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)Wc(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 fc(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=bn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Hr))throw new Error(ic);if(this._myIndex=t||ti(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=gr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Hc(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Ae(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=gr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Uc(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(ur);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 Rc(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),Mc(f,{ignoreFieldNorm:l}),i&&f.sort(me(e)?d:u),un(r)&&r>-1&&(f=f.slice(0,r));return Lc(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(!Ae(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=mr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=ri(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===yn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ae(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(!Ae(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=mr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:r}){if(!Ae(t))return[];const n=[];if(Ye(t))t.forEach(({v:s,i,n:a})=>{if(!Ae(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=ti;Qe.parseIndex=kc;Qe.config=K;Qe.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(dc);return bn(e,{...K,...r}).searchIn(t)};Qe.parseQuery=ri;Kr(Ic);Kr(zc);Qe.use=function(...e){e.forEach(t=>Kr(t))};var Kc=Qe;function oi(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 Kc(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 Gc(e,t={}){return oi(e,nc,t)}const xr="search-match",ii=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Vc(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 Jc(e,t){if(!ii())return;const r=Vc(e,t);if(!r.length){CSS.highlights.delete(xr);return}CSS.highlights.set(xr,new Highlight(...r))}function Jn(){ii()&&CSS.highlights.delete(xr)}function Zc(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&&Jc(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function ai({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"&&Jn(),B({targetId:E.targetId,query:s,highlight:E.tab!=="schemas"})},A=(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 Zc(C,[h,b,S,...n.map(E=>m[E.id])]),g.useEffect(()=>{s.trim()||(B(null),Jn())},[s]),g.useEffect(()=>Jn,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:m,setSelectedKey:y,selectedNavItem:$,handleSearchSelect:H,handleNavItemSelect:A,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-ÿ]*$",Xc=Math.pow(-2,31),Yc=Math.pow(2,31)-1,Qc=Math.pow(-2,63),qc=Math.pow(2,63)-1,eu={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"},Gr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Gr(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function br(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 tu(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 nu(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 yr(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function kr(e,t,r){const{type:n,jsonSchema:s}=tu(e,r);nu(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 Vr(e,t,r){t!==void 0&&(e[t]=r)}function _t(e,t){let r={};if(Array.isArray(e))return su(r,e,t);const n=Gr(e),s=typeof e=="string"?e:n.type;switch(r.type=eu[s],s){case"int":{r.minimum=Xc,r.maximum=Yc;break}case"long":{r.minimum=Qc,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=ru(n,t,r);Vr(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=yr(n)?{...i}:i);break}}return br(n,r,t),kr(s,n,r),r}function ru(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=yr(s)?{...i}:i;Hs(s,r,s.default!==void 0),yr(s)&&(br(s,a,t),kr(s.type,s,a)),n.set(s.name,a)}else{const a=_t(s.type,t);Hs(s,r,s.default!==void 0),br(s,a,t),kr(s.type,s,a),n.set(s.name,a),Vr(t,Ot(s.type),a)}}return n}function su(e,t,r){const n=[];let s=null;for(const i of t){const a=_t(i,r);(typeof i=="string"?i:Gr(i).type)==="null"?s=a:(n.push(a),Vr(r,Ot(i),a))}return s&&n.push(s),e.oneOf=n,e}function wr(e){return _t(e,{})}const Us=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),ou=new Set(["record","enum","array","map","fixed"]),Ws=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Jr(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)&&!ou.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 kn=null,Zn=null;const vr=new Set;function iu(){return Zn||(Zn=Promise.resolve().then(()=>require("./protoToJsonSchema-BMBlvMH-.cjs")).then(e=>{kn=e.protoToJsonSchema,vr.forEach(t=>t())})),Zn}function au(){return kn||iu(),kn}function lu(e){return vr.add(e),()=>vr.delete(e)}function Ks(){return kn!==null}function Zr(){return g.useSyncExternalStore(lu,Ks,Ks)}const cu="x-parser-original-payload",wn="x-lib-conversion-error",uu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,du=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Bt(e){return typeof e=="string"&&uu.test(e)}function Dt(e){return typeof e=="string"&&du.test(e)}function li(e){return V(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function ci(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 ui(e){return Bt(e)?"Avro":Dt(e)?"Protobuf":null}function fu(e,t){return t?!1:!e||Bt(e)||Dt(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const pu=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],hu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function mu(e){return typeof e=="string"||Array.isArray(e)?!0:V(e)?typeof e.type=="string"&&hu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!pu.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=gu(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=li(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function gu(e){var a;if(!li(e))return{schema:De(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[cu],s=(a=De(r))==null?void 0:a[wn];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)&&mu(r)){const l=Jr(r);if(l.length>0)return{schema:De(r)??{},schemaFormat:t,originalSchema:r,conversionError:l[0]};try{return{schema:wr(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=au();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),xu={objects:new Set,refs:new Set};function fn(e,t,r=xu){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 vn(e,t,r){if(!t)return"";const n=fn(t,r);return`${ce(4,`\`${O(e)}\``)}
|
|
6
|
+
${e.trimStart()}`}function Zo({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}=be(),u=()=>Jo(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(Vo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Go,{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(On,{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),ln=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(r=>ln(r,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([r,n])=>[r,ln(n,t)]).join(" "):ze(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([r,n])=>[r,ln(n,t)]).join(" ")):"",je=e=>ln(e).trim().replace(/\s+/g," "),Yl=(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"]),ql=e=>{if(!ze(e))return e;const t={};for(const[r,n]of Object.entries(e))Ql.has(r)||(t[r]=n);return t},Xo=(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?Yl(r,d):s,type:"schema",tab:"schemas",key:r,name:m,path:f,location:p,subtitle:h,text:je([ql(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 ec(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:je([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:je([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:je(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:je(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:je([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:je(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:je(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:je([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:je(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:je(i.headers)})}if((n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))Xo(t,i,s,s);return t}function Ye(e){return Array.isArray?Array.isArray(e):Qo(e)==="[object Array]"}function tc(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?"":tc(e)}function xe(e){return typeof e=="string"}function cn(e){return typeof e=="number"}function nc(e){return e===!0||e===!1||rc(e)&&Qo(e)=="[object Boolean]"}function Yo(e){return typeof e=="object"}function rc(e){return Yo(e)&&e!==null}function Ae(e){return e!=null}function Xt(e){return!e.trim().length}function Qo(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sc="Incorrect 'index' type",cr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",oc=e=>`Invalid value for key ${e}`,ic=e=>`Pattern length exceeds max of ${e}.`,ac=e=>`Missing ${e} property in key`,lc=e=>`Property 'weight' in key '${e}' must be a positive integer`,cc="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.",Os=Object.prototype.hasOwnProperty;var uc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=qo(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 qo(e){let t=null,r=null,n=null,s=1,i=null;if(xe(e)||Ye(e))n=e,t=_s(e),r=un(e);else{if(!Os.call(e,"name"))throw new Error(ac("name"));const a=e.name;if(n=a,Os.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(lc(un(a)));t=_s(a),r=un(a),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function _s(e){return Ye(e)?e:e.split(".")}function un(e){return Ye(e)?e.join("."):e}function dc(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Ae(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ae(u))return;if(l===a.length-1&&(xe(u)||cn(u)||nc(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,xe(t)?t.split("."):t,0),n?r:r[0]}const fc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},pc={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},hc={location:0,threshold:.6,distance:100},mc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:dc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},U=Object.freeze({...pc,...fc,...hc,...mc});function gc(e){return e>=9&&e<=13||e===32||e===160}function xc(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++)gc(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 Fr=class{constructor({getFn:e=U.getFn,fieldNormWeight:t=U.fieldNormWeight}={}){this.norm=xc(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(xe(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(xe(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!Ae(e)||Xt(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(Ae(a)){if(Ye(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ae(d)){if(xe(d)){if(!Xt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ae(d.v)){const f=xe(d.v)?d.v:lr(d.v);if(!Xt(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}r.$[n]=l}else if(xe(a)&&!Xt(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 ei(e,t,{getFn:r=U.getFn,fieldNormWeight:n=U.fieldNormWeight}={}){const s=new Fr({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(qo)),s.setSources(t),s.create(),s}function bc(e,{getFn:t=U.getFn,fieldNormWeight:r=U.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new Fr({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function yc(e=[],t=U.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 kc(e,t,r,{location:n=U.location,distance:s=U.distance,threshold:i=U.threshold,findAllMatches:a=U.findAllMatches,minMatchCharLength:l=U.minMatchCharLength,includeMatches:c=U.includeMatches,ignoreLocation:u=U.ignoreLocation}={}){if(t.length>32)throw new Error(ic(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 T=x/d;if(u)return T;const C=Math.abs(p-$);return s?T+C/s:C?1:T},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=[],I=1,B=0,F=d+f;const A=1<<d-1;for(let x=0;x<d;x+=1){let $=0,T=F;for(;$<T;)y(x,p+T)<=h?$=T:F=T,T=Math.floor((F-$)/2+$);F=T;let C=Math.max(1,p-T+1);const P=a?f:Math.min(p+T,f)+d,z=Array(P+2);z[P+1]=(1<<x)-1;for(let V=P;V>=C;V-=1){const j=V-1,E=r[e[j]];if(z[V]=(z[V+1]<<1|1)&E,x&&(z[V]|=(w[V+1]|w[V])<<1|1|w[V+1]),z[V]&A&&(I=y(x,j),I<=h)){if(h=I,m=j,B=x,m<=p)break;C=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,I)};if(b){const x=yc(v,l);x.length?c&&(k.indices=x):k.isMatch=!1}return k}function wc(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 zr(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 ti={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},vc=new RegExp("["+Object.keys(ti).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(vc,t=>ti[t]):e=>e;var Hr=class{constructor(e,{location:t=U.location,threshold:r=U.threshold,distance:n=U.distance,includeMatches:s=U.includeMatches,findAllMatches:i=U.findAllMatches,minMatchCharLength:a=U.minMatchCharLength,isCaseSensitive:l=U.isCaseSensitive,ignoreDiacritics:c=U.ignoreDiacritics,ignoreLocation:u=U.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:wc(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}=kc(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=zr(d)),h}};const jc=new Set(["fuzzy","include"]);function Sc(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 Hr(e,{location:t.location??U.location,threshold:t.threshold??U.threshold,distance:t.distance??U.distance,includeMatches:t.includeMatches??U.includeMatches,findAllMatches:t.findAllMatches??U.findAllMatches,minMatchCharLength:t.minMatchCharLength??U.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??U.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??U.ignoreDiacritics,ignoreLocation:t.ignoreLocation??U.ignoreLocation});return{type:"fuzzy",search(n){return r.searchIn(n)}}}}],Ms=ur.length,Nc="\0",Ac="|";function Ec(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 Rs(e,t){const r=e.match(t);return r?r[1]:null}function $c(e,t={}){return e.replace(/\\\|/g,Nc).split(Ac).map(r=>{const n=Ec(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<Ms;){const d=ur[u],f=Rs(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ms;){const d=ur[u],f=Rs(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Cc=class{constructor(e,{isCaseSensitive:t=U.isCaseSensitive,ignoreDiacritics:r=U.ignoreDiacritics,includeMatches:n=U.includeMatches,minMatchCharLength:s=U.minMatchCharLength,ignoreLocation:i=U.ignoreLocation,findAllMatches:a=U.findAllMatches,location:l=U.location,threshold:c=U.threshold,distance:u=U.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=$c(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,Sc(m.type)&&(c=!0),r&&(jc.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=zr(a)),p}}return{isMatch:!1,score:1}}};const dr=[];function Ur(...e){dr.push(...e)}function gn(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 Hr(e,t)}const xn={AND:"$and",OR:"$or"},fr={PATH:"$path",PATTERN:"$val"},pr=e=>!!(e[xn.AND]||e[xn.OR]),Tc=e=>!!e[fr.PATH],Ic=e=>!Ye(e)&&Yo(e)&&!pr(e),Ps=e=>({[xn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ni(e,t,{auto:r=!0}={}){const n=s=>{if(xe(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=gn(s,t)),c}const i=Object.keys(s),a=Tc(s);if(!a&&i.length>1&&!pr(s))return n(Ps(s));if(Ic(s)){const c=a?s[fr.PATH]:i[0],u=a?s[fr.PATTERN]:s[c];if(!xe(u))throw new Error(oc(c));const d={keyId:un(c),pattern:u};return r&&(d.searcher=gn(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=Ps(e)),n(e)}function hr(e,{ignoreFieldNorm:t=U.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 Oc(e,{ignoreFieldNorm:t=U.ignoreFieldNorm}){e.forEach(r=>{r.score=hr(r.matches,{ignoreFieldNorm:t})})}var _c=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 Mc(e){const t=[];return e.matches.forEach(r=>{if(!Ae(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 Rc(e,t,{includeMatches:r=U.includeMatches,includeScore:n=U.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return r&&(a.matches=Mc(s)),n&&(a.score=s.score),a})}const Pc=/[\p{L}\p{M}\p{N}_]+/gu,Ls=new WeakSet;function Lc(e){Ls.has(e)||(Ls.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 Bc(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||Lc(e),t=>t.match(e)||[]):t=>t.match(Pc)||[]}function mr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=Bc(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=It(s)),n(s)}}}var Dc=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 Hr(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=zr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Kn(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 ri(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Kn(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)Kn(e,u.v,s,n);else Kn(e,c.v,s,n)}}function Fc(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)ri(n,s,t,r);return n}function zc(e,t,r,n){ri(e,t,r,n)}function Hc(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 Bs(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of r)Hc(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={...U,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new uc(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=gn(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 Fr))throw new Error(sc);if(this._myIndex=t||ei(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=Fc(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Ae(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});zc(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&&Bs(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&&Bs(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(xe(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return cn(r)&&r>-1&&(p=p.slice(0,r)),p}const c=i&&cn(r)&&r>0&&xe(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new _c(r,d);xe(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=xe(e)?xe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Oc(f,{ignoreFieldNorm:l}),i&&f.sort(xe(e)?d:u),cn(r)&&r>-1&&(f=f.slice(0,r));return Rc(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(!Ae(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=ni(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===xn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ae(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(!Ae(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(!Ae(t))return[];const n=[];if(Ye(t))t.forEach(({v:s,i,n:a})=>{if(!Ae(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=ei;Qe.parseIndex=bc;Qe.config=U;Qe.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(cc);return gn(e,{...U,...r}).searchIn(t)};Qe.parseQuery=ni;Ur(Cc);Ur(Dc);Qe.use=function(...e){e.forEach(t=>Ur(t))};var Uc=Qe;function si(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 Uc(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 Wc(e,t={}){return si(e,ec,t)}const gr="search-match",oi=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Kc(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 Gc(e,t){if(!oi())return;const r=Kc(e,t);if(!r.length){CSS.highlights.delete(gr);return}CSS.highlights.set(gr,new Highlight(...r))}function Gn(){oi()&&CSS.highlights.delete(gr)}function Vc(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&&Gc(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function ii({tabs:e,defaultTab:t,isTabKey:r,sections:n,searchQuery:s}){var T;const i=((T=e[0])==null?void 0:T.id)??t,[a,l]=g.useState(i),[c,u]=g.useState(null),d=C=>{l(C),u(C)},[f,p]=g.useState({}),h=e.some(C=>C.id===a)?a:i,m={};for(const C of n)m[C.id]=C.visible?f[C.id]??null:null;const y=(C,P)=>p(z=>({...z,[C]:P})),[b,v]=g.useState(null),[S,w]=g.useState(null),[I,B]=g.useState(null),F=C=>{r(C.tab)?d(C.tab):C.tab==="servers"&&u("servers");const P={};for(const z of n)P[z.id]=z.id===C.tab?C.key:null;p(P),v(C.focusSection??null),w(C.tab==="schemas"&&C.schemaFocusTokens?{tokens:C.schemaFocusTokens,id:C.targetId}:null),C.tab==="schemas"&&Gn(),B({targetId:C.targetId,query:s,highlight:C.tab!=="schemas"})},A=(C,P)=>{d(C),p(z=>{const V={...z};for(const j of n)j.id!=="servers"&&(V[j.id]=j.id===C?P:null);return V})},k=C=>{u("servers");const P={};for(const z of n)P[z.id]=z.id==="servers"?C:null;p(P)},x=C=>{r(C)&&d(C)},$=(()=>{for(const C of n){const P=m[C.id];if(P)return{tab:C.id,key:P}}return null})();return Vc(I,[h,b,S,...n.map(C=>m[C.id])]),g.useEffect(()=>{s.trim()||(B(null),Gn())},[s]),g.useEffect(()=>Gn,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:m,setSelectedKey:y,selectedNavItem:$,handleSearchSelect:F,handleNavItemSelect:A,handleNavServerSelect:k,handleContentTabChange:x,focusSection:b,schemaFocusTarget:S}}const K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),De=e=>K(e)?e:null,Ds="^[\0-ÿ]*$",Jc=Math.pow(-2,31),Zc=Math.pow(2,31)-1,Xc=Math.pow(-2,63),Yc=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"},Wr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Wr(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 Fs(e,t,r){!(Array.isArray(e.type)&&e.type.includes("null"))&&!r&&(t.required=t.required||[],t.required.push(e.name))}function qc(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 eu(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}=qc(e,r);eu(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 Kr(e,t,r){t!==void 0&&(e[t]=r)}function _t(e,t){let r={};if(Array.isArray(e))return nu(r,e,t);const n=Wr(e),s=typeof e=="string"?e:n.type;switch(r.type=Qc[s],s){case"int":{r.minimum=Jc,r.maximum=Zc;break}case"long":{r.minimum=Xc,r.maximum=Yc;break}case"bytes":{r.pattern=Ds;break}case"fixed":{r.pattern=Ds,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=tu(n,t,r);Kr(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 tu(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;Fs(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);Fs(s,r,s.default!==void 0),xr(s,a,t),yr(s.type,s,a),n.set(s.name,a),Kr(t,Ot(s.type),a)}}return n}function nu(e,t,r){const n=[];let s=null;for(const i of t){const a=_t(i,r);(typeof i=="string"?i:Wr(i).type)==="null"?s=a:(n.push(a),Kr(r,Ot(i),a))}return s&&n.push(s),e.oneOf=n,e}function kr(e){return _t(e,{})}const zs=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),ru=new Set(["record","enum","array","map","fixed"]),Hs=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Gr(e){const t=[];return ut(e,"schema",t,new Set),t}function ut(e,t,r,n){if(typeof e=="string"){!zs.has(e)&&!Hs.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(!K(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)||K(s)?ut(s,`${t}.type`,r,n):r.push(`${t}: missing "type"`);return}if(!zs.has(s)&&!ru.has(s)&&!Hs.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(!K(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 bn=null,Vn=null;const wr=new Set;function su(){return Vn||(Vn=Promise.resolve().then(()=>require("./protoToJsonSchema-BU9Hfl7F.cjs")).then(e=>{bn=e.protoToJsonSchema,wr.forEach(t=>t())})),Vn}function ou(){return bn||su(),bn}function iu(e){return wr.add(e),()=>wr.delete(e)}function Us(){return bn!==null}function Vr(){return g.useSyncExternalStore(iu,Us,Us)}const au="x-parser-original-payload",yn="x-lib-conversion-error",lu=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,cu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Bt(e){return typeof e=="string"&&lu.test(e)}function Dt(e){return typeof e=="string"&&cu.test(e)}function ai(e){return K(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function li(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 ci(e){return Bt(e)?"Avro":Dt(e)?"Protobuf":null}function uu(e,t){return t?!1:!e||Bt(e)||Dt(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const du=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],fu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function pu(e){return typeof e=="string"||Array.isArray(e)?!0:K(e)?typeof e.type=="string"&&fu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!du.some(t=>t in e):!1}function Mt(e,t){let r=e;if(t&&K(r)&&typeof r.$ref=="string"){const a=t(r.$ref);a!==void 0&&(r=a)}const n=hu(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=ai(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function hu(e){var a;if(!ai(e))return{schema:De(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[au],s=(a=De(r))==null?void 0:a[yn];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)&&pu(r)){const l=Gr(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=ou();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}`,_=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),vt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),mu={objects:new Set,refs:new Set};function dn(e,t,r=mu){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=>dn(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)?dn(i,t,n):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=dn(a,t,n);return s}function kn(e,t,r){if(!t)return"";const n=dn(t,r);return`${ce(4,`\`${_(e)}\``)}
|
|
7
7
|
|
|
8
8
|
\`\`\`json
|
|
9
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,`\`${
|
|
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,`\`${_(e)}\``)}
|
|
11
11
|
|
|
12
|
-
_(schema conversion still in progress)_`;if(i)return`${ce(4,`\`${
|
|
12
|
+
_(schema conversion still in progress)_`;if(i)return`${ce(4,`\`${_(e)}\``)}
|
|
13
13
|
|
|
14
|
-
_(could not convert schema: ${
|
|
14
|
+
_(could not convert schema: ${_(i)})_`;const l=s&&!n.description?{...n,description:s}:n;return kn(e,l,r)}function ui(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${_(e.in)}${e.name?`: \`${_(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${_(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 _(e.type)}}function gu(e){if(!(e!=null&&e.length))return"";const t=[];for(const r of e)if(r!=null&&r.type&&(t.push(`- **${ui(r)}**`),r.description&&t.push(` ${_(r.description)}`),r.type==="openIdConnect"&&r.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${_(r.openIdConnectUrl)}\``),r.type==="oauth2"))for(const[n,s]of Object.entries(r.flows??{})){t.push(` - Flow \`${_(n)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${_(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${_(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${_(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${_(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
|
|
15
15
|
`)].join(`
|
|
16
16
|
|
|
17
|
-
`):""}function
|
|
18
|
-
`)),r.description&&t.push(
|
|
19
|
-
`));const c=
|
|
17
|
+
`):""}function di(e){const t=[],{info:r}=e;t.push(ce(1,_(r.title)));const n=[`**Version:** ${_(r.version)}`];if(r.license&&n.push(`**License:** ${_(r.license.name)}${r.license.url?` (${_(r.license.url)})`:""}`),r.contact){const s=[r.contact.name,r.contact.email].filter(Boolean).map(_).join(" ");s&&n.push(`**Contact:** ${s}`)}if(t.push(n.join(`
|
|
18
|
+
`)),r.description&&t.push(_(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,_(i)));const l=[`**Host:** \`${_(a.host)}${a.pathname?_(a.pathname):""}\``];l.push(`**Protocol:** ${_(a.protocol)}${a.protocolVersion?` ${_(a.protocolVersion)}`:""}`),a.description&&l.push(_(a.description)),s.push(l.join(`
|
|
19
|
+
`));const c=gu(a.security);c&&s.push(c)}t.push(s.join(`
|
|
20
20
|
|
|
21
|
-
`))}return t}function
|
|
21
|
+
`))}return t}function Jr(e,t=Lt(e)){var i,a,l;const r=di(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,`${_((i=d.action)==null?void 0:i.toUpperCase())} \`${_(u)}\``));const p=[];f!=null&&f.address&&p.push(`**Channel:** \`${_(f.address)}\``),d.summary&&p.push(_(d.summary)),d.description&&p.push(_(d.description));const h=d.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${_(m.name??m.title??"message")}\``).join(", ")}`),c.push(p.join(`
|
|
22
22
|
|
|
23
23
|
`))}r.push(c.join(`
|
|
24
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,
|
|
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,_(d.title??d.name??u)));const f=[];d.summary&&f.push(_(d.summary)),d.description&&f.push(_(d.description)),d.contentType&&f.push(`**Content-Type:** \`${_(d.contentType)}\``),c.push(f.join(`
|
|
26
26
|
|
|
27
27
|
`)),d.payload&&c.push(Et("payload",d.payload,t)),d.headers&&c.push(Et("headers",d.headers,t))}r.push(c.join(`
|
|
28
28
|
|
|
@@ -30,44 +30,44 @@ _(could not convert schema: ${O(i)})_`;const l=s&&!n.description?{...n,descripti
|
|
|
30
30
|
|
|
31
31
|
`))}return r.filter(Boolean).join(`
|
|
32
32
|
|
|
33
|
-
`)}function
|
|
33
|
+
`)}function xu(e,t,r){var l;const n=t.channel,s=[ce(3,`${_((l=t.action)==null?void 0:l.toUpperCase())} \`${_(e)}\``)],i=[];n!=null&&n.address&&i.push(`**Channel:** \`${_(n.address)}\``),t.summary&&i.push(_(t.summary)),t.description&&i.push(_(t.description)),s.push(i.join(`
|
|
34
34
|
|
|
35
|
-
`));const a=t.messages??[];for(const c of a){const u=[ce(4,
|
|
35
|
+
`));const a=t.messages??[];for(const c of a){const u=[ce(4,_(c.title??c.name??"Message"))],d=[];c.summary&&d.push(_(c.summary)),c.description&&d.push(_(c.description)),c.contentType&&d.push(`**Content-Type:** \`${_(c.contentType)}\``),d.length&&u.push(d.join(`
|
|
36
36
|
|
|
37
37
|
`)),s.push(u.join(`
|
|
38
38
|
|
|
39
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
40
|
|
|
41
|
-
`)}function
|
|
41
|
+
`)}function fi(e,t,r=Lt(e)){var i;const n=(i=e.operations)==null?void 0:i[t];if(!n)return"";const s=di(e);return s.push(xu(t,n,r)),s.filter(Boolean).join(`
|
|
42
42
|
|
|
43
|
-
`)}function
|
|
43
|
+
`)}function bu(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(`- **${ui(a)}** (\`${_(i)}\`)`),a.description&&s.push(` ${_(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${_(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${_(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${_(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${_(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${_(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=>`\`${_(f)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${_(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
|
|
44
44
|
`)].join(`
|
|
45
45
|
|
|
46
|
-
`):""}function
|
|
46
|
+
`):""}function pi(e,t,r,n,s,i){var p;const a=[ce(3,`${e.toUpperCase()} \`${_(t)}\``)],l=[];r.summary&&l.push(_(r.summary)),r.description&&l.push(_(r.description)),r.deprecated&&l.push("**Deprecated**");const c=r.security??i??[],u=bu(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(`- \`${_(y.name)}\`${y.required?" (required)":""}${b!=null&&b.type?` — ${_(b.type)}`:""}${y.description?`: ${_(y.description)}`:""}`)}}}a.push(l.join(`
|
|
47
47
|
|
|
48
|
-
`));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,m]of Object.entries(d))a.push([`**Request Body** (\`${
|
|
48
|
+
`));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,m]of Object.entries(d))a.push([`**Request Body** (\`${_(h)}\`)`,kn("body",m.schema,n)].join(`
|
|
49
49
|
|
|
50
|
-
`));const f=r.responses??{};for(const[h,m]of Object.entries(f)){const y=[ce(4,`${h}${m.description?`: ${
|
|
50
|
+
`));const f=r.responses??{};for(const[h,m]of Object.entries(f)){const y=[ce(4,`${h}${m.description?`: ${_(m.description)}`:""}`)];for(const[b,v]of Object.entries(m.content??{}))y.push([`**Body** (\`${_(b)}\`)`,kn("body",v.schema,n)].join(`
|
|
51
51
|
|
|
52
52
|
`));a.push(y.join(`
|
|
53
53
|
|
|
54
54
|
`))}return a.join(`
|
|
55
55
|
|
|
56
|
-
`)}function
|
|
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(
|
|
56
|
+
`)}function Zr(e,t=Lt(e)){var a,l,c,u,d;const r=[],{info:n}=e;if(r.push(ce(1,_(n.title))),r.push(`**Version:** ${_(n.version)}`),n.description&&r.push(_(n.description)),(a=e.servers)!=null&&a.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${_(p.url)}\`${p.description?` — ${_(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(pi(p,h,m,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}r.push(f.join(`
|
|
58
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(
|
|
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(kn(p,h,t));r.push(f.join(`
|
|
60
60
|
|
|
61
61
|
`))}return r.filter(Boolean).join(`
|
|
62
62
|
|
|
63
|
-
`)}function
|
|
64
|
-
`))}return i.push(
|
|
63
|
+
`)}function hi(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,_(a.title))),i.push(`**Version:** ${_(a.version)}`),a.description&&i.push(_(a.description)),(u=e.servers)!=null&&u.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${_(p.url)}\`${p.description?` — ${_(p.description)}`:""}`);i.push(f.join(`
|
|
64
|
+
`))}return i.push(pi(t,r,s,n,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
|
|
65
65
|
|
|
66
|
-
`)}const
|
|
67
|
-
]`).replace("lheading",
|
|
66
|
+
`)}const yu=/^(https?:|data:image\/)/i;function Xr(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"||!yu.test(r)?null:{url:r,altText:typeof n=="string"&&n?n:void 0,backgroundColor:typeof s=="string"?s:void 0}}const mi={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},ku=()=>Promise.resolve().then(()=>require("./LogoExtension-Dc7mY8J6.cjs"));function Yr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var at=Yr();function gi(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(ke.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var ke={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")},wu=/^(?:[ \t]*(?:\n|$))+/,vu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ju=/^ {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+|$)/,Su=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qr=/(?:[*+-]|\d{1,9}[.)])/,xi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bi=ee(xi).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(),Nu=ee(xi).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(),qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Au=/^[^\n]+/,es=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Eu=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",es).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$u=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qr).getRegex(),_n="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",ts=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cu=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",ts).replace("tag",_n).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yi=ee(qr).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",_n).getRegex(),Tu=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yi).getRegex(),ns={blockquote:Tu,code:vu,def:Eu,fences:ju,heading:Su,hr:Ft,html:Cu,lheading:bi,list:$u,newline:wu,paragraph:yi,table:$t,text:Au},Ws=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",_n).getRegex(),Iu={...ns,lheading:Nu,table:Ws,paragraph:ee(qr).replace("hr",Ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ws).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",_n).getRegex()},Ou={...ns,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ts).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(qr).replace("hr",Ft).replace("heading",` *#{1,6} *[^
|
|
67
|
+
]`).replace("lheading",bi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_u=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ki=/^( {2,}|\\)\n(?!\s*$)/,Ru=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mn=/[\p{P}\p{S}]/u,rs=/[\s\p{P}\p{S}]/u,wi=/[^\s\p{P}\p{S}]/u,Pu=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rs).getRegex(),vi=/(?!~)[\p{P}\p{S}]/u,Lu=/(?!~)[\s\p{P}\p{S}]/u,Bu=/(?:[^\s\p{P}\p{S}]|~)/u,Du=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ji=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Fu=ee(ji,"u").replace(/punct/g,Mn).getRegex(),zu=ee(ji,"u").replace(/punct/g,vi).getRegex(),Si="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Hu=ee(Si,"gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,rs).replace(/punct/g,Mn).getRegex(),Uu=ee(Si,"gu").replace(/notPunctSpace/g,Bu).replace(/punctSpace/g,Lu).replace(/punct/g,vi).getRegex(),Wu=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,rs).replace(/punct/g,Mn).getRegex(),Ku=ee(/\\(punct)/,"gu").replace(/punct/g,Mn).getRegex(),Gu=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(),Vu=ee(ts).replace("(?:-->|$)","-->").getRegex(),Ju=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",Vu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zu=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",wn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ni=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",wn).replace("ref",es).getRegex(),Ai=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",es).getRegex(),Xu=ee("reflink|nolink(?!\\()","g").replace("reflink",Ni).replace("nolink",Ai).getRegex(),ss={_backpedal:$t,anyPunctuation:Ku,autolink:Gu,blockSkip:Du,br:ki,code:Mu,del:$t,emStrongLDelim:Fu,emStrongRDelimAst:Hu,emStrongRDelimUnd:Wu,escape:_u,link:Zu,nolink:Ai,punctuation:Pu,reflink:Ni,reflinkSearch:Xu,tag:Ju,text:Ru,url:$t},Yu={...ss,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",wn).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wn).getRegex()},vr={...ss,emStrongRDelimAst:Uu,emStrongLDelim:zu,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(ki).replace("{2,}","*").getRegex(),text:ee(vr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yt={normal:ns,gfm:Iu,pedantic:Ou},jt={normal:ss,gfm:vr,breaks:Qu,pedantic:Yu},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},Ks=e=>qu[e];function Re(e,t){if(t){if(ke.escapeTest.test(e))return e.replace(ke.escapeReplace,Ks)}else if(ke.escapeTestNoEncode.test(e))return e.replace(ke.escapeReplaceNoEncode,Ks);return e}function Gs(e){try{e=encodeURI(e).replace(ke.percentDecode,"%")}catch{return null}return e}function Vs(e,t){var i;const r=e.replace(ke.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ke.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(ke.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 ed(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 Js(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 td(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const s=n[1];return t.split(`
|
|
68
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
|
|
70
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=
|
|
69
|
+
`)}var vn=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=td(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
71
|
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=St(t[0],`
|
|
72
72
|
`).split(`
|
|
73
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(`
|
|
@@ -82,14 +82,14 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
82
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
83
|
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),p=e.split(`
|
|
84
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),
|
|
86
|
-
`,1)[0];let A;if(p=
|
|
87
|
-
`+A.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||
|
|
88
|
-
`+p}!h&&!p.trim()&&(h=!0),u+=
|
|
89
|
-
`,e=e.substring(
|
|
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(
|
|
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=
|
|
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(
|
|
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),I=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;e;){const F=e.split(`
|
|
86
|
+
`,1)[0];let A;if(p=F,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),A=p):A=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||I.test(p)||B.test(p)||v.test(p)||S.test(p))break;if(A.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
|
|
87
|
+
`+A.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||I.test(f)||S.test(f))break;d+=`
|
|
88
|
+
`+p}!h&&!p.trim()&&(h=!0),u+=F+`
|
|
89
|
+
`,e=e.substring(F.length+1),f=A.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=Vs(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(Vs(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=ed(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)),Js(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 Js(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 vn,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:ke,block:Yt.normal,inline:jt.normal};this.options.pedantic?(r.block=Yt.pedantic,r.inline=jt.pedantic):this.options.gfm&&(r.block=Yt.gfm,this.options.breaks?r.inline=jt.breaks:r.inline=jt.gfm),this.tokenizer.rules=r}static get rules(){return{block:Yt,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(ke.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(ke.tabCharGlobal," ").replace(ke.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
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
94
|
`+l.raw,u.text+=`
|
|
95
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+=`
|
|
@@ -98,7 +98,7 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
98
98
|
`+l.raw,u.text+=`
|
|
99
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
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}},
|
|
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}},jn=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(ke.notSpaceStart))==null?void 0:i[0],s=e.replace(ke.endingNewline,"")+`
|
|
102
102
|
`;return n?'<pre><code class="language-'+Re(n)+'">'+(r?s:Re(s,!0))+`</code></pre>
|
|
103
103
|
`:"<pre><code>"+(r?s:Re(s,!0))+`</code></pre>
|
|
104
104
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -116,63 +116,63 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
116
116
|
`}tablerow({text:e}){return`<tr>
|
|
117
117
|
${e}</tr>
|
|
118
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=
|
|
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}},
|
|
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
|
|
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 Ci=/[&<>"']/,od=new RegExp(Ci.source,"g"),Ti=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,id=new RegExp(Ti.source,"g"),ad={"&":"&","<":"<",">":">",'"':""","'":"'"},qs=e=>ad[e];function eo(e,t){if(t){if(Ci.test(e))return e.replace(od,qs)}else if(Ti.test(e))return e.replace(id,qs);return e}var ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cd(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 Oi(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)&&Oi(r)}),e}class to{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _i(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 ud="</span>",no=e=>!!e.scope,dd=(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 fd{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=_i(t)}openNode(t){if(!no(t))return;const r=dd(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){no(t)&&(this.buffer+=ud)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const ro=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class ls{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=>{ls._collapse(r)}))}}class pd extends ls{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 fd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Rt(e){return e?typeof e=="string"?e:e.source:null}function Mi(e){return lt("(?=",e,")")}function hd(e){return lt("(?:",e,")*")}function md(e){return lt("(?:",e,")?")}function lt(...e){return e.map(r=>Rt(r)).join("")}function gd(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function cs(...e){return"("+(gd(e).capture?"":"?:")+e.map(n=>Rt(n)).join("|")+")"}function Ri(e){return new RegExp(e.toString()+"|").exec("").length-1}function xd(e,t){const r=e&&e.exec(t);return r&&r.index===0}const bd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function us(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=bd.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 yd=/\b\B/,Pi="[a-zA-Z]\\w*",ds="[a-zA-Z_]\\w*",Li="\\b\\d+(\\.\\d+)?",Bi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Di="\\b(0b[01]+)",kd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",wd=(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},vd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pt]},jd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pt]},Sd={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/},Ln=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=cs("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},Ad=Ln("//","$"),Nd=Ln("/\\*","\\*/"),Ed=Ln("#","$"),$d={scope:"number",begin:Li,relevance:0},Cd={scope:"number",begin:Bi,relevance:0},Td={scope:"number",begin:Di,relevance:0},Id={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pt,{begin:/\[/,end:/\]/,relevance:0,contains:[Pt]}]},Od={scope:"title",begin:Pi,relevance:0},_d={scope:"title",begin:ds,relevance:0},Md={begin:"\\.\\s*"+ds,relevance:0},Rd=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:vd,BACKSLASH_ESCAPE:Pt,BINARY_NUMBER_MODE:Td,BINARY_NUMBER_RE:Di,COMMENT:Ln,C_BLOCK_COMMENT_MODE:Nd,C_LINE_COMMENT_MODE:Ad,C_NUMBER_MODE:Cd,C_NUMBER_RE:Bi,END_SAME_AS_BEGIN:Rd,HASH_COMMENT_MODE:Ed,IDENT_RE:Pi,MATCH_NOTHING_RE:yd,METHOD_GUARD:Md,NUMBER_MODE:$d,NUMBER_RE:Li,PHRASAL_WORDS_MODE:Sd,QUOTE_STRING_MODE:jd,REGEXP_MODE:Id,RE_STARTERS_RE:kd,SHEBANG:wd,TITLE_MODE:Od,UNDERSCORE_IDENT_RE:ds,UNDERSCORE_TITLE_MODE:_d});function Pd(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Ld(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Bd(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Pd,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Dd(e,t){Array.isArray(e.illegal)&&(e.illegal=cs(...e.illegal))}function Fd(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 zd(e,t){e.relevance===void 0&&(e.relevance=1)}const Hd=(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,Mi(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Ud=["of","and","for","in","not","or","if","then","parent","list","value"],Wd="keyword";function Fi(e,t,r=Wd){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,Fi(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,Kd(c[0],c[1])]})}}function Kd(e,t){return t?Number(t):Gd(e)?0:1}function Gd(e){return Ud.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 zi(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+=Ri(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Vd(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;zi(e,e.begin,{key:"beginScope"}),e.begin=us(e.begin,{joinWith:""})}}function Jd(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;zi(e,e.end,{key:"endScope"}),e.end=us(e.end,{joinWith:""})}}function Zd(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Xd(e){Zd(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Vd(e),Jd(e)}function Yd(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+=Ri(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(us(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;[Ld,Fd,Xd,Hd].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Bd,Dd,zd].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=Fi(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 Qd(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 Hi(e){return e?e.endsWithParent||Hi(e.starts):!1}function Qd(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ve(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Hi(e)?Ve(e,{starts:e.starts?Ve(e.starts):null}):Object.isFrozen(e)?Ve(e):e}var qd="11.11.1";class ef extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const Xn=_i,io=Ve,ao=Symbol("nomatch"),tf=7,Ui=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:pd};function c(j){return l.noHighlightRe.test(j)}function u(j){let N=j.className+" ";N+=j.parentNode?j.parentNode.className:"";const M=l.languageDetectRe.exec(N);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 N.split(/\s+/).find(Z=>c(Z)||k(Z))}function d(j,N,M){let Z="",Q="";typeof N=="object"?(Z=j,M=N.ignoreIllegals,Q=N.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`),
|
|
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=Yd(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(N,de);else{for(U.matcher.considerAll();;){wt++,Le?Le=!1:U.matcher.considerAll(),U.matcher.lastIndex=Me;const T=U.matcher.exec(N);if(!T)break;const R=N.substring(Me,T.index),G=xe(R,T);Me=T.index+G}xe(N.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:Xn(N),illegal:!0,relevance:0,_illegalBy:{message:T.message,index:Me,context:N.slice(Me-100,Me+100),mode:T.mode,resultSoFar:Ee},_emitter:de};if(s)return{language:j,value:Xn(N),illegal:!1,relevance:0,errorRaised:T,_emitter:de,_top:U};throw T}}function p(j){const N={value:Xn(j),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return N._emitter.addText(j),N}function h(j,N){N=N||l.languages||Object.keys(t);const M=p(j),Z=N.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,N,M){const Z=N&&r[N]||M;j.classList.add("hljs"),j.classList.add(`language-${Z}`)}function y(j){let N=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 ef("One of your code blocks includes unescaped HTML.",j.innerHTML);N=j;const Z=N.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,N){let M=null;try{M=N(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=N.bind(null,e),M.aliases&&x(M.aliases,{languageName:j})}function H(j){delete t[j];for(const N of Object.keys(r))r[N]===j&&delete r[N]}function A(){return Object.keys(t)}function k(j){return j=(j||"").toLowerCase(),t[j]||t[r[j]]}function x(j,{languageName:N}){typeof j=="string"&&(j=[j]),j.forEach(M=>{r[M.toLowerCase()]=N})}function $(j){const N=k(j);return N&&!N.disableAutodetect}function I(j){j["before:highlightBlock"]&&!j["before:highlightElement"]&&(j["before:highlightElement"]=N=>{j["before:highlightBlock"](Object.assign({block:N.el},N))}),j["after:highlightBlock"]&&!j["after:highlightElement"]&&(j["after:highlightElement"]=N=>{j["after:highlightBlock"](Object.assign({block:N.el},N))})}function E(j){I(j),n.push(j)}function P(j){const N=n.indexOf(j);N!==-1&&n.splice(N,1)}function z(j,N){const M=j;n.forEach(function(Z){Z[M]&&Z[M](N)})}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:A,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:Mi,either:cs,optional:md,anyNumberOfTimes:hd};for(const j in qt)typeof qt[j]=="object"&&Oi(qt[j]);return Object.assign(e,qt),e},ht=Ui({});ht.newInstance=()=>Ui({});var nf=ht;ht.HighlightJS=ht;ht.default=ht;const Ie=Ii(nf);function rf(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 sf(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 of(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$_]*",af=["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"],lf=["true","false","null","undefined","NaN","Infinity"],Wi=["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"],Ki=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],uf=[].concat(Gi,Wi,Ki);function df(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:af,literal:lf,built_in:uf,"variable.language":cf},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},A={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:{_:[...Wi,...Ki]}},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([...Gi,"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*=>",N={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},N,{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,A,J,{match:/\$[(.]/}]}}function ff(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",rf);Ie.registerLanguage("yaml",sf);Ie.registerLanguage("bash",of);Ie.registerLanguage("javascript",df);Ie.registerLanguage("python",ff);const Vi=new $i(sd({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}}}));Vi.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 pf(e){return Vi.parse(e)}const hf={"--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:hf,dangerouslySetInnerHTML:{__html:Eo.sanitize(pf(e))}}):null;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:"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 gf({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 xf({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 bf({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 At({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 fs({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 yf({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(At,{IconClass:xf,text:`${i.licenseName} ${Ns}`,term:Ns,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(At,{IconClass:Mn,text:Es,href:i.externalDocsUrl,term:Es,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(At,{IconClass:mf,text:`${i.contactEmail}`,term:ol,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(At,{IconClass:gf,text:`${i.contactName}`,term:sl,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(At,{IconClass:bf,term:il,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(fs,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const kf=[/^x-parser-/i,/^x-lib-/i];function wf(e){return kf.some(t=>t.test(e))}const co=new Map;function vf(e){let t=co.get(e);return t||(t=g.lazy(gi[e]),co.set(e,t)),t}const jf=e=>e.startsWith("x-"),ps=(e,t)=>e?e[t]:void 0;function Sf({source:e,pathPrefix:t}){const{showExtensions:r}=ge();if(!r||!e)return null;const n=Object.keys(e).filter(s=>jf(s)&&!wf(s)&&Object.prototype.hasOwnProperty.call(gi,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=vf(s);return o.jsx(g.Suspense,{fallback:null,children:o.jsx(i,{value:ps(e,s),path:`${t}.${s}`})},s)})})}const Af=g.lazy(vu),Ji=e=>Qr(ps(e,"x-logo"))!==null;function hs({source:e}){const t=ps(e,"x-logo");return Qr(t)?o.jsx(g.Suspense,{fallback:null,children:o.jsx(Af,{value:t,path:"info.x-logo"})}):null}function Zi({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(hs,{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(yf,{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(Sf,{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 Xi=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(Zi,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),Nf=1500,Ef=320,$f=48,Cf="#011627";function Tf(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 If(e){try{return await navigator.clipboard.writeText(e),!0}catch{return Tf(e)}}function Bn({code:e,className:t,language:r="json",collapsedMaxHeight:n=Ef}){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 A=m.current;if(!A)return;const k=()=>{p(A.scrollHeight),d(A.scrollHeight>n+$f)};k();const x=new ResizeObserver(k);return x.observe(A),()=>x.disconnect()},[e,r,n]);const b=()=>{If(e).then(A=>{i(A?"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,
|
|
126
|
-
|
|
127
|
-
${t}`:t},Pf=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=En(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))Pf.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=gs(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(...na(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},ea=e=>e.not===void 0?null:typeof e.not=="boolean"||V(e.not)?e.not:null,we=e=>ea(e)!==null,ta=e=>{const{not:t,...r}=e;return r},Lf=e=>{const{if:t,then:r,else:n,...s}=e;return s},je=e=>e.if!==void 0,Yn=e=>e===void 0?null:typeof e=="boolean"||V(e)?e:null,na=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,gs=e=>{const t=e.patternProperties;return V(t)?Object.entries(t).flatMap(([r,n])=>V(n)?[[r,n]]:[]):[]},Bf=(e,t)=>`${e}.[pattern:${t}]`,Wt=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Dn=e=>{const t=Ut(e);if(t!==null&&V(t))return!0;const r=kt(e);return r!==null&&V(r)?!0:gs(e).length>0},ra=e=>!!(zt(e)||Ht(e)||Wt(e)||Dn(e)||e.type==="array"||e.items||e.type!==void 0),Te=e=>!(we(e)||je(e)||Se(e)||zt(e)||Ht(e)||Wt(e)||Dn(e)||e.items||qi(e)||e.type==="array"||e.type==="object");function Df(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||Df(e)}const sa=(e,t)=>po(e)?!0:t?po(t):!1,Ff=(e,t)=>{if(we(e)||je(e)||Se(e)||zt(e)||Ht(e)||Wt(e)||Dn(e))return!0;if(e.type==="array"||e.items){if(qi(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 oa(e){return JSON.stringify(e)}function ho(e){return typeof e=="string"?e:JSON.stringify(e)}function Ne({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function ia({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 zf(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Hf(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Uf(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Wf(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(Ne,{children:String(t.value)}),o.jsx(Ne,{children:t.op})]}),o.jsx(Ne,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(Ne,{children:r.op}),o.jsx(Ne,{children:String(r.value)})]}),n&&o.jsx(Ne,{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??oa(e)})}function Kf({schema:e}){const t=kt(e);return typeof t!="boolean"?null:o.jsx(Ne,{children:t?"additional properties allowed":"additional properties not allowed"})}function Gf({schema:e}){const t=Ut(e);return typeof t=="boolean"?o.jsx(ia,{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(Ne,{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=zf(e),s=Hf(e),i=Uf(e),a=Wf(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(Ne,{children:"multiple of :"}),o.jsx(ia,{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(Ne,{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(Ne,{children:"enum values:"}),r.map((f,p)=>o.jsx(hn,{value:f},`${p}-${oa(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ne,{children:"const value:"}),o.jsx(hn,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Ne,{children:"unique"}),o.jsx(Kf,{schema:e}),o.jsx(Gf,{schema:e})]})}function aa({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 la=(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)&&!ra(ta(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?ms(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}},Vf=(e,t)=>{if(!t)return!1;const r=la(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function ca({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=la(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(ca,{schema:e})]}),sa(e)&&o.jsx(aa,{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 ${
|
|
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(Yf,{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 ep=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=_f,focusTokens:d=null,focusId:f=null}){var F;const p=ep(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+)\]$/),A=H?Number(H[1]):-1;g.useEffect(()=>{A>=0&&B(A)},[A]);const k=Zr(),{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:Er(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=ta(Lf(x)),z=!ra(P)&&(we(x)||je(x)||Se(x)),J=()=>{const _=ea(x);if(_===null)return null;if(typeof _=="boolean")return o.jsx(Qn,{children:o.jsx(Jf,{value:_})});const W=Fe(_,i,s);if(W.circular)return o.jsx(Qn,{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(Qn,{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})},N=_=>{const W=Yn(_.if);if(W===null)return null;const X=Yn(_.then),D=Yn(_.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 _=na(x);return _.length===0?null:o.jsx(o.Fragment,{children:_.map((W,X)=>o.jsx("div",{children:N(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)&&N(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&&A===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(Zf,{variant:ue,caseCount:se.length,caseLabels:_,selectedCase:C,onSelectCase:B,children:xe}),$e=o.jsxs(o.Fragment,{children:[ie,we(x)&&J(),je(x)&&N(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=gs(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:Bf(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)&&N(x),Se(x)&&M()]})};if(Wt(P)||Dn(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?Mf(P):null,D=Rf(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??Er(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)&&N(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:En(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:En(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)&&N(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)&&N(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 xs({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?ms(c.$ref):void 0)??"schema",f=!!t;if(!Ff(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?En(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 tp=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 tp(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 np({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(Bn,{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=ci(s),f=!l&&fu(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(ua,{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 ",ui(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(xs,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(Yi,{schema:i??e}),p==="example"&&f&&o.jsx(np,{schema:e,providedExample:c})]})]})}function da({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=Zr(),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(fs,{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 rp({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(da,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function fa({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(rp,{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 pa({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 ha(e){return o.jsx(Dr,{...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 sp(e){return o.jsx(Dr,{...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 ma({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(sp,{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 ga({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(ga,{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 er={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 tr(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 op(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function ip(e){const t=(e??[]).filter(s=>er[tr(s)]),r=new Map;for(const s of t){const i=er[tr(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=tr(s),l=er[a],c=(r.get(l)??0)>1?op(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 bs({securities:e}){var u;const t=g.useMemo(()=>ip(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(ap,{security:l}),a==="apiKey"&&o.jsx(lp,{security:l}),a==="openIdConnect"&&o.jsx(cp,{security:l}),a==="oauth2"&&o.jsx(up,{security:l})]})]})}const sn=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(Oe,{children:e})}):o.jsx("span",{children:t}),ap=({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."]}),lp=({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."]})},cp=({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:Rl(t)})})]})]})},up=({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=cl,i=ul;break;case"implicit":s=al,i=ll;break;case"password":s=dl,i=fl;break;case"authorizationCode":s=pl,i=hl;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 dp(e){return e.startsWith("http://")||e.startsWith("https://")}function xa(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function ba({value:e}){if(e==null)return null;if(typeof e=="string"&&dp(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:xa(r)}),o.jsx(ba,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function ya({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=xl[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:xa(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(ba,{value:l})})]},a))})})}function fp({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(ma,{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(fs,{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(ha,{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(bs,{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(zr,{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(ya,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function ka({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(fp,{...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(pa,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const wa=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?$l(f,p):Br(f);if(S)return Lo(S)},[y,t,f,p]);const b=xn(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 va({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(da,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function pp({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(
|
|
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??
|
|
134
|
-
`))e(s);e("```"),t()}function Na(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)
|
|
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=Gs(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=Gs(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)}},os=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 jn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new os}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}},or,fn=(or=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(or,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),or),Ei=class{constructor(...e){re(this,"defaults",Yr());re(this,"options",this.setOptions);re(this,"parse",this.parseMarkdown(!0));re(this,"parseInline",this.parseMarkdown(!1));re(this,"Parser",Ue);re(this,"Renderer",jn);re(this,"TextRenderer",os);re(this,"Lexer",He);re(this,"Tokenizer",vn);re(this,"Hooks",fn);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 jn(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 vn(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 fn;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];fn.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 Ei;function ie(e,t){return rt.parse(e,t)}ie.options=ie.setOptions=function(e){return rt.setOptions(e),ie.defaults=rt.defaults,gi(ie.defaults),ie};ie.getDefaults=Yr;ie.defaults=at;ie.use=function(...e){return rt.use(...e),ie.defaults=rt.defaults,gi(ie.defaults),ie};ie.walkTokens=function(e,t){return rt.walkTokens(e,t)};ie.parseInline=rt.parseInline;ie.Parser=Ue;ie.parser=Ue.parse;ie.Renderer=jn;ie.TextRenderer=os;ie.Lexer=He;ie.lexer=He.lex;ie.Tokenizer=vn;ie.Hooks=fn;ie.parse=ie;ie.options;ie.setOptions;ie.use;ie.walkTokens;ie.parseInline;Ue.parse;He.lex;function nd(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=Zs(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,r,t.lang||"")).then(Xs(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.");Xs(t)(n)},useNewRenderer:!0,renderer:{code(t,r,n){typeof t=="object"&&(n=t.escaped,r=t.lang,t=t.text);const s=Zs(r),i=s?e.langPrefix+Qs(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${n?t:Qs(t,!0)}
|
|
122
|
+
</code></pre>`}}}}function Zs(e){return(e||"").match(/\S*/)[0]}function Xs(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const $i=/[&<>"']/,rd=new RegExp($i.source,"g"),Ci=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,sd=new RegExp(Ci.source,"g"),od={"&":"&","<":"<",">":">",'"':""","'":"'"},Ys=e=>od[e];function Qs(e,t){if(t){if($i.test(e))return e.replace(rd,Ys)}else if(Ci.test(e))return e.replace(sd,Ys);return e}var id=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ad(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 Ii(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)&&Ii(r)}),e}class qs{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Oi(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 ld="</span>",eo=e=>!!e.scope,cd=(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 ud{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Oi(t)}openNode(t){if(!eo(t))return;const r=cd(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){eo(t)&&(this.buffer+=ld)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const to=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class is{constructor(){this.rootNode=to(),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=to({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=>{is._collapse(r)}))}}class dd extends is{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 ud(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Rt(e){return e?typeof e=="string"?e:e.source:null}function _i(e){return lt("(?=",e,")")}function fd(e){return lt("(?:",e,")*")}function pd(e){return lt("(?:",e,")?")}function lt(...e){return e.map(r=>Rt(r)).join("")}function hd(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function as(...e){return"("+(hd(e).capture?"":"?:")+e.map(n=>Rt(n)).join("|")+")"}function Mi(e){return new RegExp(e.toString()+"|").exec("").length-1}function md(e,t){const r=e&&e.exec(t);return r&&r.index===0}const gd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ls(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=gd.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 xd=/\b\B/,Ri="[a-zA-Z]\\w*",cs="[a-zA-Z_]\\w*",Pi="\\b\\d+(\\.\\d+)?",Li="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Bi="\\b(0b[01]+)",bd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",yd=(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},kd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pt]},wd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pt]},vd={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/},Rn=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=as("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},jd=Rn("//","$"),Sd=Rn("/\\*","\\*/"),Nd=Rn("#","$"),Ad={scope:"number",begin:Pi,relevance:0},Ed={scope:"number",begin:Li,relevance:0},$d={scope:"number",begin:Bi,relevance:0},Cd={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pt,{begin:/\[/,end:/\]/,relevance:0,contains:[Pt]}]},Td={scope:"title",begin:Ri,relevance:0},Id={scope:"title",begin:cs,relevance:0},Od={begin:"\\.\\s*"+cs,relevance:0},_d=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:kd,BACKSLASH_ESCAPE:Pt,BINARY_NUMBER_MODE:$d,BINARY_NUMBER_RE:Bi,COMMENT:Rn,C_BLOCK_COMMENT_MODE:Sd,C_LINE_COMMENT_MODE:jd,C_NUMBER_MODE:Ed,C_NUMBER_RE:Li,END_SAME_AS_BEGIN:_d,HASH_COMMENT_MODE:Nd,IDENT_RE:Ri,MATCH_NOTHING_RE:xd,METHOD_GUARD:Od,NUMBER_MODE:Ad,NUMBER_RE:Pi,PHRASAL_WORDS_MODE:vd,QUOTE_STRING_MODE:wd,REGEXP_MODE:Cd,RE_STARTERS_RE:bd,SHEBANG:yd,TITLE_MODE:Td,UNDERSCORE_IDENT_RE:cs,UNDERSCORE_TITLE_MODE:Id});function Md(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Rd(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Pd(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Md,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Ld(e,t){Array.isArray(e.illegal)&&(e.illegal=as(...e.illegal))}function Bd(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 Dd(e,t){e.relevance===void 0&&(e.relevance=1)}const Fd=(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,_i(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},zd=["of","and","for","in","not","or","if","then","parent","list","value"],Hd="keyword";function Di(e,t,r=Hd){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,Di(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,Ud(c[0],c[1])]})}}function Ud(e,t){return t?Number(t):Wd(e)?0:1}function Wd(e){return zd.includes(e.toLowerCase())}const no={},nt=e=>{console.error(e)},ro=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ct=(e,t)=>{no[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),no[`${e}/${t}`]=!0)},Sn=new Error;function Fi(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+=Mi(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Kd(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw nt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Sn;if(typeof e.beginScope!="object"||e.beginScope===null)throw nt("beginScope must be object"),Sn;Fi(e,e.begin,{key:"beginScope"}),e.begin=ls(e.begin,{joinWith:""})}}function Gd(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw nt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Sn;if(typeof e.endScope!="object"||e.endScope===null)throw nt("endScope must be object"),Sn;Fi(e,e.end,{key:"endScope"}),e.end=ls(e.end,{joinWith:""})}}function Vd(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Jd(e){Vd(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Kd(e),Gd(e)}function Zd(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+=Mi(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ls(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;[Rd,Bd,Jd,Fd].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Pd,Ld,Dd].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=Di(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 Xd(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 zi(e){return e?e.endsWithParent||zi(e.starts):!1}function Xd(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ve(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:zi(e)?Ve(e,{starts:e.starts?Ve(e.starts):null}):Object.isFrozen(e)?Ve(e):e}var Yd="11.11.1";class Qd extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const Jn=Oi,so=Ve,oo=Symbol("nomatch"),qd=7,Hi=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:dd};function c(j){return l.noHighlightRe.test(j)}function u(j){let E=j.className+" ";E+=j.parentNode?j.parentNode.className:"";const M=l.languageDetectRe.exec(E);if(M){const G=k(M[1]);return G||(ro(i.replace("{}",M[1])),ro("Falling back to no-highlight mode for this block.",j)),G?M[1]:"no-highlight"}return E.split(/\s+/).find(G=>c(G)||k(G))}function d(j,E,M){let G="",Y="";typeof E=="object"?(G=j,M=E.ignoreIllegals,Y=E.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`),Y=j,G=E),M===void 0&&(M=!0);const te={code:G,language:Y};z("before:highlight",te);const ue=te.result?te.result:f(te.language,te.code,M);return ue.code=te.code,z("after:highlight",ue),ue}function f(j,E,M,G){const Y=Object.create(null);function te(O,R){return O.keywords[R]}function ue(){if(!D.keywords){pe.addText(ne);return}let O=0;D.keywordPatternRe.lastIndex=0;let R=D.keywordPatternRe.exec(ne),W="";for(;R;){W+=ne.substring(O,R.index);const X=q.case_insensitive?R[0].toLowerCase():R[0],me=te(D,X);if(me){const[Be,Za]=me;if(pe.addText(W),W="",Y[X]=(Y[X]||0)+1,Y[X]<=qd&&(qe+=Za),Be.startsWith("_"))W+=R[0];else{const Xa=q.classNameAliases[Be]||Be;ae(R[0],Xa)}}else W+=R[0];O=D.keywordPatternRe.lastIndex,R=D.keywordPatternRe.exec(ne)}W+=ne.substring(O),pe.addText(W)}function de(){if(ne==="")return;let O=null;if(typeof D.subLanguage=="string"){if(!t[D.subLanguage]){pe.addText(ne);return}O=f(D.subLanguage,ne,!0,ge[D.subLanguage]),ge[D.subLanguage]=O._top}else O=h(ne,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(qe+=O.relevance),pe.__addSublanguage(O._emitter,O.language)}function le(){D.subLanguage!=null?de():ue(),ne=""}function ae(O,R){O!==""&&(pe.startScope(R),pe.addText(O),pe.endScope())}function se(O,R){let W=1;const X=R.length-1;for(;W<=X;){if(!O._emit[W]){W++;continue}const me=q.classNameAliases[O[W]]||O[W],Be=R[W];me?ae(Be,me):(ne=Be,ue(),ne=""),W++}}function N(O,R){return O.scope&&typeof O.scope=="string"&&pe.openNode(q.classNameAliases[O.scope]||O.scope),O.beginScope&&(O.beginScope._wrap?(ae(ne,q.classNameAliases[O.beginScope._wrap]||O.beginScope._wrap),ne=""):O.beginScope._multi&&(se(O.beginScope,R),ne="")),D=Object.create(O,{parent:{value:D}}),D}function L(O,R,W){let X=md(O.endRe,W);if(X){if(O["on:end"]){const me=new qs(O);O["on:end"](R,me),me.isMatchIgnored&&(X=!1)}if(X){for(;O.endsParent&&O.parent;)O=O.parent;return O}}if(O.endsWithParent)return L(O.parent,R,W)}function J(O){return D.matcher.regexIndex===0?(ne+=O[0],1):(Le=!0,0)}function Z(O){const R=O[0],W=O.rule,X=new qs(W),me=[W.__beforeBegin,W["on:begin"]];for(const Be of me)if(Be&&(Be(O,X),X.isMatchIgnored))return J(R);return W.skip?ne+=R:(W.excludeBegin&&(ne+=R),le(),!W.returnBegin&&!W.excludeBegin&&(ne=R)),N(W,O),W.returnBegin?0:R.length}function oe(O){const R=O[0],W=E.substring(O.index),X=L(D,O,W);if(!X)return oo;const me=D;D.endScope&&D.endScope._wrap?(le(),ae(R,D.endScope._wrap)):D.endScope&&D.endScope._multi?(le(),se(D.endScope,O)):me.skip?ne+=R:(me.returnEnd||me.excludeEnd||(ne+=R),le(),me.excludeEnd&&(ne=R));do D.scope&&pe.closeNode(),!D.skip&&!D.subLanguage&&(qe+=D.relevance),D=D.parent;while(D!==X.parent);return X.starts&&N(X.starts,O),me.returnEnd?0:R.length}function H(){const O=[];for(let R=D;R!==q;R=R.parent)R.scope&&O.unshift(R.scope);O.forEach(R=>pe.openNode(R))}let Q={};function he(O,R){const W=R&&R[0];if(ne+=O,W==null)return le(),0;if(Q.type==="begin"&&R.type==="end"&&Q.index===R.index&&W===""){if(ne+=E.slice(R.index,R.index+1),!s){const X=new Error(`0 width match regex (${j})`);throw X.languageName=j,X.badRule=Q.rule,X}return 1}if(Q=R,R.type==="begin")return Z(R);if(R.type==="illegal"&&!M){const X=new Error('Illegal lexeme "'+W+'" for mode "'+(D.scope||"<unnamed>")+'"');throw X.mode=D,X}else if(R.type==="end"){const X=oe(R);if(X!==oo)return X}if(R.type==="illegal"&&W==="")return ne+=`
|
|
124
|
+
`,1;if(wt>1e5&&wt>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=W,W.length}const q=k(j);if(!q)throw nt(i.replace("{}",j)),new Error('Unknown language: "'+j+'"');const $e=Zd(q);let fe="",D=G||$e;const ge={},pe=new l.__emitter(l);H();let ne="",qe=0,Me=0,wt=0,Le=!1;try{if(q.__emitTokens)q.__emitTokens(E,pe);else{for(D.matcher.considerAll();;){wt++,Le?Le=!1:D.matcher.considerAll(),D.matcher.lastIndex=Me;const O=D.matcher.exec(E);if(!O)break;const R=E.substring(Me,O.index),W=he(R,O);Me=O.index+W}he(E.substring(Me))}return pe.finalize(),fe=pe.toHTML(),{language:j,value:fe,relevance:qe,illegal:!1,_emitter:pe,_top:D}}catch(O){if(O.message&&O.message.includes("Illegal"))return{language:j,value:Jn(E),illegal:!0,relevance:0,_illegalBy:{message:O.message,index:Me,context:E.slice(Me-100,Me+100),mode:O.mode,resultSoFar:fe},_emitter:pe};if(s)return{language:j,value:Jn(E),illegal:!1,relevance:0,errorRaised:O,_emitter:pe,_top:D};throw O}}function p(j){const E={value:Jn(j),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return E._emitter.addText(j),E}function h(j,E){E=E||l.languages||Object.keys(t);const M=p(j),G=E.filter(k).filter($).map(le=>f(le,j,!1));G.unshift(M);const Y=G.sort((le,ae)=>{if(le.relevance!==ae.relevance)return ae.relevance-le.relevance;if(le.language&&ae.language){if(k(le.language).supersetOf===ae.language)return 1;if(k(ae.language).supersetOf===le.language)return-1}return 0}),[te,ue]=Y,de=te;return de.secondBest=ue,de}function m(j,E,M){const G=E&&r[E]||M;j.classList.add("hljs"),j.classList.add(`language-${G}`)}function y(j){let E=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);E=j;const G=E.textContent,Y=M?d(G,{language:M,ignoreIllegals:!0}):h(G);j.innerHTML=Y.value,j.dataset.highlighted="yes",m(j,M,Y.language),j.result={language:Y.language,re:Y.relevance,relevance:Y.relevance},Y.secondBest&&(j.secondBest={language:Y.secondBest.language,relevance:Y.secondBest.relevance}),z("after:highlightElement",{el:j,result:Y,text:G})}function b(j){l=so(l,j)}const v=()=>{I(),ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function S(){I(),ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function I(){function j(){I()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",j,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(y)}function B(j,E){let M=null;try{M=E(e)}catch(G){if(nt("Language definition for '{}' could not be registered.".replace("{}",j)),s)nt(G);else throw G;M=a}M.name||(M.name=j),t[j]=M,M.rawDefinition=E.bind(null,e),M.aliases&&x(M.aliases,{languageName:j})}function F(j){delete t[j];for(const E of Object.keys(r))r[E]===j&&delete r[E]}function A(){return Object.keys(t)}function k(j){return j=(j||"").toLowerCase(),t[j]||t[r[j]]}function x(j,{languageName:E}){typeof j=="string"&&(j=[j]),j.forEach(M=>{r[M.toLowerCase()]=E})}function $(j){const E=k(j);return E&&!E.disableAutodetect}function T(j){j["before:highlightBlock"]&&!j["before:highlightElement"]&&(j["before:highlightElement"]=E=>{j["before:highlightBlock"](Object.assign({block:E.el},E))}),j["after:highlightBlock"]&&!j["after:highlightElement"]&&(j["after:highlightElement"]=E=>{j["after:highlightBlock"](Object.assign({block:E.el},E))})}function C(j){T(j),n.push(j)}function P(j){const E=n.indexOf(j);E!==-1&&n.splice(E,1)}function z(j,E){const M=j;n.forEach(function(G){G[M]&&G[M](E)})}function V(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:I,highlightElement:y,highlightBlock:V,configure:b,initHighlighting:v,initHighlightingOnLoad:S,registerLanguage:B,unregisterLanguage:F,listLanguages:A,getLanguage:k,registerAliases:x,autoDetection:$,inherit:so,addPlugin:C,removePlugin:P}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Yd,e.regex={concat:lt,lookahead:_i,either:as,optional:pd,anyNumberOfTimes:fd};for(const j in Qt)typeof Qt[j]=="object"&&Ii(Qt[j]);return Object.assign(e,Qt),e},ht=Hi({});ht.newInstance=()=>Hi({});var ef=ht;ht.HighlightJS=ht;ht.default=ht;const Ie=Ti(ef);function tf(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 nf(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 rf(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"],I=["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",...I,...B]},contains:[h,e.SHEBANG(),m,f,i,a,v,l,c,u,d,r]}}const io="[A-Za-z$_][0-9A-Za-z$_]*",sf=["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"],of=["true","false","null","undefined","NaN","Infinity"],Ui=["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"],Wi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ki=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],af=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lf=[].concat(Ki,Ui,Wi);function cf(e){const t=e.regex,r=(M,{after:G})=>{const Y="</"+M[0].slice(1);return M.input.indexOf(Y,G)!==-1},n=io,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,G)=>{const Y=M[0].length+M.index,te=M.input[Y];if(te==="<"||te===","){G.ignoreMatch();return}te===">"&&(r(M,{after:Y})||G.ignoreMatch());let ue;const de=M.input.substring(Y);if(ue=de.match(/^\s*=/)){G.ignoreMatch();return}if((ue=de.match(/^\s+extends\s+/))&&ue.index===0){G.ignoreMatch();return}}},l={$pattern:io,keyword:sf,literal:of,built_in:lf,"variable.language":af},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 I=[].concat(S,p.contains),B=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I)}]),F={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},A={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:{_:[...Ui,...Wi]}},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:[F],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(M){return t.concat("(?!",M.join("|"),")")}const P={match:t.concat(/\b/,C([...Ki,"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},V={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},F]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[F]};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},E,{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:[F,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:[F]},P,T,A,V,{match:/\$[(.]/}]}}function uf(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",tf);Ie.registerLanguage("yaml",nf);Ie.registerLanguage("bash",rf);Ie.registerLanguage("javascript",cf);Ie.registerLanguage("python",uf);const Gi=new Ei(nd({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}}}));Gi.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 df(e){return Gi.parse(e)}const ff={"--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:ff,dangerouslySetInnerHTML:{__html:No.sanitize(df(e))}}):null;function pf({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 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:"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 mf({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 gf({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 us({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 xf({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:mf,text:`${i.licenseName} ${Ss}`,term:Ss,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Nt,{IconClass:On,text:Ns,href:i.externalDocsUrl,term:Ns,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Nt,{IconClass:pf,text:`${i.contactEmail}`,term:sl,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Nt,{IconClass:hf,text:`${i.contactName}`,term:rl,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:gf,term:ol,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(us,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const bf=[/^x-parser-/i,/^x-lib-/i];function yf(e){return bf.some(t=>t.test(e))}const ao=new Map;function kf(e){let t=ao.get(e);return t||(t=g.lazy(mi[e]),ao.set(e,t)),t}const wf=e=>e.startsWith("x-"),ds=(e,t)=>e?e[t]:void 0;function vf({source:e,pathPrefix:t}){const{showExtensions:r}=be();if(!r||!e)return null;const n=Object.keys(e).filter(s=>wf(s)&&!yf(s)&&Object.prototype.hasOwnProperty.call(mi,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=kf(s);return o.jsx(g.Suspense,{fallback:null,children:o.jsx(i,{value:ds(e,s),path:`${t}.${s}`})},s)})})}const jf=g.lazy(ku),Vi=e=>Xr(ds(e,"x-logo"))!==null;function fs({source:e}){const t=ds(e,"x-logo");return Xr(t)?o.jsx(g.Suspense,{fallback:null,children:o.jsx(jf,{value:t,path:"info.x-logo"})}):null}function Ji({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(fs,{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(xf,{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(vf,{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 Zi=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(Ji,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),Sf=1500,Nf=320,Af=48,Ef="#011627";function $f(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 Cf(e){try{return await navigator.clipboard.writeText(e),!0}catch{return $f(e)}}function Pn({code:e,className:t,language:r="json",collapsedMaxHeight:n=Nf}){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 A=m.current;if(!A)return;const k=()=>{p(A.scrollHeight),d(A.scrollHeight>n+Af)};k();const x=new ResizeObserver(k);return x.observe(A),()=>x.disconnect()},[e,r,n]);const b=()=>{Cf(e).then(A=>{i(A?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),Sf)})},S=Ie.getLanguage(r)?Ie.highlight(e,{language:r}).value:null,w=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",I=u&&!l,B=e.replace(/\n+$/,"").split(`
|
|
125
|
+
`).length,F=()=>{var A,k;l&&(((A=h.current)==null?void 0:A.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(Vo,{className:"w-4 h-4 text-green-600"}):o.jsx(Go,{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:No.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 ${I?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${Ef})`}})]}),u&&o.jsxs("button",{type:"button",onClick:F,"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 Tf=/^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))Tf.test(n)||(r[n]=Nr(s,t));return r}finally{t.delete(e)}}return e}const Xi=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Nr(e),null,2);return o.jsx(Pn,{code:t})},lo=new Set,ps=e=>e.replace(/^#\//,"").split("/").pop()??e,Ar=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},If={objects:new Set,refs:new Set},Fe=(e,t,r)=>{if(!e.$ref)return{schema:e,refLabel:Ar(e)};const n=e.$ref,s=ps(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 K(r)?r:null},Yi=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>K(n));return r.length>0?r:null},Of=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||K(e.additionalItems)?e.additionalItems:null,_f=e=>e.contains===void 0?null:typeof e.contains=="boolean"||K(e.contains)?e.contains:null,Qi=e=>e.contains!==void 0,Nn=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
126
|
+
|
|
127
|
+
${t}`:t},Mf=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=Nn(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(!K(a))continue;const l=s.properties[i];K(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 K(i)&&K(l)?Ge(l,i):K(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&&K(t.patternProperties)){const i={...K(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!K(l)){i[a]=l;continue}const c=i[a];K(c)?i[a]=Ge(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(K(t.propertyNames)){const i=s.propertyNames;s.propertyNames=K(i)?Ge(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(K(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=K(i)?Ge(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Mf.has(i)||a===void 0||(s[i]=a);return s},co=(e,t,r,n)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>K(d)?[u,ye(d,t,r,n)]:[u,d])));const i=st(s);i&&(s.items=ye(i,t,r,n));const a=Ut(s);a!==null&&K(a)&&(s.propertyNames=ye(a,t,r,n));const l=kt(s);l!==null&&K(l)&&(s.additionalProperties=ye(l,t,r,n));const c=hs(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,ye(d,t,r,n)]))),s},ye=(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(!K(d))continue;const{schema:f,circular:p}=Fe(d,t,r);if(p)continue;const h=ye(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(...ta(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=co(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 co(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=>K(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=>K(n));return r.length>0?r:null},qi=e=>e.not===void 0?null:typeof e.not=="boolean"||K(e.not)?e.not:null,ve=e=>qi(e)!==null,ea=e=>{const{not:t,...r}=e;return r},Rf=e=>{const{if:t,then:r,else:n,...s}=e;return s},Se=e=>e.if!==void 0,Zn=e=>e===void 0?null:typeof e=="boolean"||K(e)?e:null,ta=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>K(t)):[],Ne=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Ut=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||K(e.propertyNames)?e.propertyNames:null,kt=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||K(e.additionalProperties)?e.additionalProperties:null,hs=e=>{const t=e.patternProperties;return K(t)?Object.entries(t).flatMap(([r,n])=>K(n)?[[r,n]]:[]):[]},Pf=(e,t)=>`${e}.[pattern:${t}]`,Wt=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Ln=e=>{const t=Ut(e);if(t!==null&&K(t))return!0;const r=kt(e);return r!==null&&K(r)?!0:hs(e).length>0},na=e=>!!(zt(e)||Ht(e)||Wt(e)||Ln(e)||e.type==="array"||e.items||e.type!==void 0),Te=e=>!(ve(e)||Se(e)||Ne(e)||zt(e)||Ht(e)||Wt(e)||Ln(e)||e.items||Qi(e)||e.type==="array"||e.type==="object");function Lf(e){if(typeof kt(e)=="boolean")return!0;const r=Ut(e);return!!(typeof r=="boolean"||r!==null&&K(r)&&Te(r)&&typeof r.pattern=="string"&&r.pattern.length>0)}function uo(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||Lf(e)}const ra=(e,t)=>uo(e)?!0:t?uo(t):!1,Bf=(e,t)=>{if(ve(e)||Se(e)||Ne(e)||zt(e)||Ht(e)||Wt(e)||Ln(e))return!0;if(e.type==="array"||e.items){if(Qi(e)||Yi(e)!==null)return!0;const r=st(e);if(!r)return!1;if(r.$ref&&t){const{schema:n}=Fe(r,t,lo),s=ye(n,t,lo);return!Te(s)}return!Te(r)}return!1};function sa(e){return JSON.stringify(e)}function fo(e){return typeof e=="string"?e:JSON.stringify(e)}function Ee({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function oa({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 Df(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Ff(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function zf(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Hf(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function po(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function ho(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function qt({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(Ee,{children:String(t.value)}),o.jsx(Ee,{children:t.op})]}),o.jsx(Ee,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(Ee,{children:r.op}),o.jsx(Ee,{children:String(r.value)})]}),n&&o.jsx(Ee,{children:n})]})}function pn({value:e,displayValue:t}){const r=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(fo(e))},n=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(fo(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??sa(e)})}function Uf({schema:e}){const t=kt(e);return typeof t!="boolean"?null:o.jsx(Ee,{children:t?"additional properties allowed":"additional properties not allowed"})}function Wf({schema:e}){const t=Ut(e);return typeof t=="boolean"?o.jsx(oa,{children:t?"any property name":"no property names"}):t!==null&&K(t)&&Te(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"property name pattern:"}),o.jsx(pn,{value:t.pattern,displayValue:t.pattern})]}):null}function mo({schema:e,rangeName:t="value"}){const r=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,n=Df(e),s=Ff(e),i=zf(e),a=Hf(e),l=po(e,"minItems"),c=ho(e,"maxItems"),u=po(e,"minProperties"),d=ho(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(Ee,{children:"multiple of :"}),o.jsx(oa,{children:String(e.multipleOf)})]}),(n||s)&&o.jsx(qt,{name:t,lower:n,upper:s}),(i||a)&&o.jsx(qt,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(qt,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(qt,{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(Ee,{children:"regex pattern:"}),o.jsx(pn,{value:e.pattern,displayValue:e.pattern})]}),r&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(Ee,{children:"enum values:"}),r.map((f,p)=>o.jsx(pn,{value:f},`${p}-${sa(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"const value:"}),o.jsx(pn,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Ee,{children:"unique"}),o.jsx(Uf,{schema:e}),o.jsx(Wf,{schema:e})]})}function ia({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(mo,{schema:e,rangeName:i}),s&&o.jsx(mo,{schema:t,rangeName:"item"})]})}const aa=(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(ve(e)&&!na(ea(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?ps(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&&K(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}},Kf=(e,t)=>{if(!t)return!1;const r=aa(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function la({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=aa(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 go="ml-6";function en({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(la,{schema:e})]}),ra(e)&&o.jsx(ia,{schema:e,className:`flex flex-col gap-1 mt-1 ${go}`}),r&&r.split(`
|
|
128
|
+
|
|
129
|
+
`).map((n,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${go} leading-relaxed`,children:n},s))]})}function Xn({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 Gf({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 ca({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 Vf({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(ca,{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 Jf="ml-0 border-dashed border-border";function tt({depth:e,children:t,lineVariant:r="depth"}){const{depthColors:n}=be();return r==="none"?o.jsx("div",{children:t}):r==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Jf}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:_r(e,n)},children:t})}function Zf({depth:e,expanded:t,onToggle:r}){const{depthColors:n}=be(),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 Xf="ml-6";function we({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}=be(),m=_r(r,h),y=n&&Kf(n,s),b=u?Xf:"";let v="",S=t;if(t.endsWith("[]")){const w=t.slice(0,-2),I=w.lastIndexOf(".");I>=0?(v=w.slice(0,I+1),S=`${w.slice(I+1)}[]`):S=t}else{const w=t.lastIndexOf("."),I=t.lastIndexOf("[]"),B=Math.max(w,I);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(la,{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&&ra(n,i)&&o.jsx(ia,{schema:n,itemSchema:i,fieldName:S,className:`flex flex-col gap-1 mt-1 ${b}`}),c&&c.split(`
|
|
130
|
+
|
|
131
|
+
`).map((w,I)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${b} leading-relaxed`,children:w},I)),u&&o.jsx(Zf,{depth:r,expanded:d,onToggle:f})]})}function Yn({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 Yf({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(Yn,{label:"If schema matches:",children:e}),t!=null&&o.jsx(Yn,{label:"Then schema should follow:",children:t}),r!=null&&o.jsx(Yn,{label:"Else schema should follow:",children:r})]})})]})}function tn({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=If,focusTokens:d=null,focusId:f=null}){var se;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[I,B]=g.useState(0),F=(se=d==null?void 0:d[0])==null?void 0:se.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),A=F?Number(F[1]):-1;g.useEffect(()=>{A>=0&&B(A)},[A]);const k=Vr(),{schema:x,refLabel:$,circular:T}=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 N=Fe(e,i,s);return N.circular?N:{...N,schema:ye(N.schema,i,s)}},[e,i,s,u,k]),C=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=ea(Rf(x)),z=!na(P)&&(ve(x)||Se(x)||Ne(x)),V=()=>{const N=qi(x);if(N===null)return null;if(typeof N=="boolean")return o.jsx(Xn,{children:o.jsx(Gf,{value:N})});const L=Fe(N,i,s);if(L.circular)return o.jsx(Xn,{children:o.jsx(we,{path:t,depth:r+1,typeLabelOverride:`↩ ${N.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const J=ye(L.schema,i,s),Z=Te(J);return o.jsx(Xn,{children:Z?o.jsx(en,{schema:J,showBorder:!1}):o.jsx(Ce,{schema:N,path:t,depth:r+1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},j=(N,L)=>{if(typeof N=="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:N?"any value":"false schema"});const J=Fe(N,i,s);if(J.circular)return o.jsx(we,{path:L,depth:r+1,typeLabelOverride:`↩ ${N.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const Z=ye(J.schema,i,s);return Te(Z)?o.jsx(en,{schema:Z,showBorder:!1}):o.jsx(Ce,{schema:N,path:L,depth:r+1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},E=N=>{const L=Zn(N.if);if(L===null)return null;const J=Zn(N.then),Z=Zn(N.else);return o.jsx(Yf,{ifContent:j(L,t),thenContent:J!==null?j(J,t):void 0,elseContent:Z!==null?j(Z,t):void 0})},M=()=>{const N=ta(x);return N.length===0?null:o.jsx(o.Fragment,{children:N.map((L,J)=>o.jsx("div",{children:E(L)},J))})};if(T)return o.jsx(we,{id:y,path:t,depth:r,typeLabelOverride:`↩ ${e.$ref??$??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(z){const N=o.jsxs(o.Fragment,{children:[ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]});return a?N:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(L=>!L)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:N})]})}const G=zt(P),Y=Ht(P),te=G??Y,ue=G?"oneOf":"anyOf";if(te){const N=te.map((fe,D)=>typeof fe.title=="string"?fe.title:`case ${D+1}`),L=a?1:r+1,J=te[I],Z=Fe(J,i,s),oe=Z.circular?Z.schema:ye(Z.schema,i,s),H=!Z.circular&&Te(oe),Q=d&&A===I?d.slice(1):null,he=H?o.jsx(en,{schema:oe,showBorder:!1}):o.jsx(Ce,{schema:J,path:t,depth:L-1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:Q,focusId:f},I),q=o.jsx(Vf,{variant:ue,caseCount:te.length,caseLabels:N,selectedCase:I,onSelectCase:B,children:he}),$e=o.jsxs(o.Fragment,{children:[q,ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]});return a?$e:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(fe=>!fe)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:$e})]})}const de=(N,L,J)=>{const Z=Fe(N,i,s);if(Z.circular)return o.jsx(we,{path:L,depth:J,typeLabelOverride:`↩ ${N.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const oe=ye(Z.schema,i,s);return Te(oe)?o.jsx(en,{schema:oe,showBorder:!1}):o.jsx(Ce,{schema:N,path:L,depth:J,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c})},le=N=>{const L=P.properties??{},J=new Set(P.required??[]),Z=Ut(P),oe=kt(P),H=hs(P);return o.jsxs(o.Fragment,{children:[Object.entries(L).map(([Q,he])=>{if(!K(he))return null;const q=d&&d[0]==="properties"&&d[1]===Q?d.slice(2):null;return o.jsx(Ce,{schema:he,path:`${t}.${Q}`,depth:N,required:J.has(Q),refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c,focusTokens:q,focusId:f},Q)}),Z!==null&&K(Z)&&o.jsx(tn,{label:"Property names must adhere to:",children:de(Z,`${t}.[propertyName]`,N)}),H.map(([Q,he])=>o.jsx(Ce,{schema:he,path:Pf(t,Q),depth:N,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c},Q)),oe!==null&&K(oe)&&o.jsx(tn,{label:"Additional properties must adhere to:",children:de(oe,`${t}.[additionalProperty]`,N)}),ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]})};if(Wt(P)||Ln(P))return a?le(r+1):o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(N=>!N)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:le(r+1)})]});if(P.type==="array"||P.items){const N=Yi(P),L=N!==null,J=L?Of(P):null,Z=_f(P),oe=Z!==null,H=L?null:st(P),Q=H!==null,he=L||Q||oe||ve(x)||Se(x)||Ne(x),q=`${t}[]`,$e=a?t:q,fe=Q?Fe(H,i,s):null,D=(fe==null?void 0:fe.schema)??null,ge=D?ye(D,i,s):null,pe=D!==null&&(C.objects.has(D)||typeof(H==null?void 0:H.$ref)=="string"&&C.refs.has(H.$ref)),ne=D!==null?{objects:new Set(C.objects).add(D),refs:typeof(H==null?void 0:H.$ref)=="string"?new Set(C.refs).add(H.$ref):C.refs}:C,qe=!L&&!oe&&ge!==null&&Te(ge),Me=ge!=null&&ge.properties?Object.entries(ge.properties).filter(([,R])=>K(R)):[],wt=new Set(ge&&Array.isArray(ge.required)?ge.required:[]),Le=!L&&d&&d[0]==="items"?d.slice(1):null,O=R=>o.jsxs(o.Fragment,{children:[L?o.jsxs(o.Fragment,{children:[N.map((W,X)=>o.jsx(Ce,{schema:W,path:`${t}[${X}]`,depth:R,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c},X)),J!==null&&typeof J!="boolean"&&o.jsx(tn,{label:"Additional items:",children:de(J,`${t}[*]`,R)}),J===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):Q&&(pe?o.jsx(we,{path:$e,depth:R,typeLabelOverride:`↩ ${H.$ref??Ar(D)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Me.length>0?Me.map(([W,X])=>{const me=Le&&Le[0]==="properties"&&Le[1]===W?Le.slice(2):null;return o.jsx(Ce,{schema:X,path:`${$e}.${W}`,depth:R,required:wt.has(W),refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:me,focusId:f},W)}):o.jsx(Ce,{schema:H,path:$e,depth:R,refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:Le,focusId:f})),oe&&o.jsx(tn,{label:"Contains at least one:",children:typeof Z=="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:Z?"any item":"impossible constraint"}):de(Z,`${t}[contains]`,R)}),ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]});return qe&&!ve(x)&&!Se(x)&&!Ne(x)?o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:Nn(x.description,ge.description),expandable:!1,expanded:!1,onToggle:()=>{}}):qe?o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:Nn(x.description,ge.description),expandable:!0,expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsxs(tt,{depth:r,lineVariant:l,children:[ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]})]}):a?he?O(r+1):null:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:x.description,expandable:L||Q||oe||ve(x)||Se(x)||Ne(x),expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:O(r+1)})]})}if(ve(x)||Se(x)||Ne(x)){const N=o.jsxs(o.Fragment,{children:[ve(x)&&V(),Se(x)&&E(x),Ne(x)&&M()]});return a?N:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(L=>!L)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:N})]})}return a?null:o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function ms({schema:e,rootName:t,className:r="",focusTokens:n=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=be(),l=g.useMemo(()=>new Set,[]),c=De(e),u=g.useMemo(()=>c?ye(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?ps(c.$ref):void 0)??"schema",f=!!t;if(!Bf(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?ye(m,i,l):null,b=y!==null&&Te(y);return o.jsx("div",{className:r,children:o.jsx(we,{path:h,depth:0,schema:u,itemSchema:b?y:void 0,description:u.type==="array"||u.items?Nn(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 qf=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function nn(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 qf(i)?n.has(s)?nn(i,"null")?{type:"null"}:{}:dt(i,t,new Set,new Set(n).add(s)):{}}if(r.has(e))return nn(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(nn(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(nn(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 ep({schema:e,providedExample:t}){const r=t!==void 0,[n,s]=g.useState(r?t:null),{deref:i}=be();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(Pn,{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=li(s),f=!l&&uu(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(ca,{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 ",ci(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(ms,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(Xi,{schema:i??e}),p==="example"&&f&&o.jsx(ep,{schema:e,providedExample:c})]})]})}function ua({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}=be(),c=Vr(),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(us,{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 tp({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(ua,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function da({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(tp,{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 fa({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 pa(e){return o.jsx(Lr,{...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 np(e){return o.jsx(Lr,{...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 ha({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(np,{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 ma({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(ma,{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 qn(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 rp(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function sp(e){const t=(e??[]).filter(s=>Qn[qn(s)]),r=new Map;for(const s of t){const i=Qn[qn(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=qn(s),l=Qn[a],c=(r.get(l)??0)>1?rp(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 gs({securities:e}){var u;const t=g.useMemo(()=>sp(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(rn,{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(rn,{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(rn,{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(rn,{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(op,{security:l}),a==="apiKey"&&o.jsx(ip,{security:l}),a==="openIdConnect"&&o.jsx(ap,{security:l}),a==="oauth2"&&o.jsx(lp,{security:l})]})]})}const rn=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(Oe,{children:e})}):o.jsx("span",{children:t}),op=({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."]}),ip=({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."]})},ap=({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:_l(t)})})]})]})},lp=({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=ll,i=cl;break;case"implicit":s=il,i=al;break;case"password":s=ul,i=dl;break;case"authorizationCode":s=fl,i=pl;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 cp(e){return e.startsWith("http://")||e.startsWith("https://")}function ga(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function xa({value:e}){if(e==null)return null;if(typeof e=="string"&&cp(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:ga(r)}),o.jsx(xa,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function ba({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=gl[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:ga(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(xa,{value:l})})]},a))})})}function up({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(ha,{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(us,{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(pa,{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(gs,{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(Dr,{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(ba,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function ya({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(up,{...e[c],serverKey:c,focusSection:t||a?n:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:To,content:d,sideContent:o.jsx(fa,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const ka=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}=be(),y=h==="component";g.useEffect(()=>{if(!t||!f)return;const S=y?El(f,p):Pr(f);if(S)return Po(S)},[y,t,f,p]);const b=ar(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),I=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,I-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 wa({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(ua,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function dp({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(wa,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const fp="",pp=`
|
|
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??fp,this.lineJoin=t??pp}},Gt=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},hp=class extends Gt{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},mp=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"}},gp=class extends Gt{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},xp=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"}},xo=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 bo=10;function bp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function yp(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;bp(r);n++){if(n>=bo)throw new Error(`Exceeded max $ref depth (${bo}) resolving "${r.$ref}" — possible cycle`);r=yp(e,r.$ref)}return r}const kp=10;function wp(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 vp(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function Er(e,t,r=0){if(r>kp)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(vp(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 wp(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const jp=10;function Sp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Ct(e,t,r=0){if(r>=jp||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>Ct(e,s,r+1));if(Sp(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 va(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 sn(e,t){return e?va(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function yo(e){const t={},r=[];for(const[n,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=va(s.default,s.examples,n);t[n]=i.value,i.isPlaceholder&&r.push(n)}return{values:t,placeholders:r}}function ko(e,t){return t!=null&&t.length?t.map(r=>We(e,r)).filter(r=>!!(r!=null&&r.type)):[]}const Np={"kafka-secure":"kafka",wss:"ws"};function Ap(e){return Np[e]??e}function Ep(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function $p(e){return e.slice(e.lastIndexOf("/")+1)}function Cp(e,t){return t&&t.length>0?t.map(r=>{const n=We(e,r);if(n)return{name:Ep(r)?$p(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 ja(e,t){var i;const r=(i=e.operations)==null?void 0:i[t],n=r&&We(e,r);if(!n)throw new hp(t);const s=We(e,n.channel);if(!s)throw new gp(t);return{operation:n,channel:s}}function Sa(e,t,r,n){var l;const s=Cp(e,r.servers??t.servers),i=s.find(c=>Ap(c.server.protocol)===n),a=(l=t.bindings)==null?void 0:l[n];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function Tp(e,t,r){try{const{operation:n,channel:s}=ja(e,t);return Sa(e,s,n,r).eligible}catch{return!1}}function Ip(e,t,r){var T,C,P,z,V,j,E,M,G,Y,te,ue,de,le;const{operation:n,channel:s}=ja(e,t),{servers:i,matchedServer:a,eligible:l}=Sa(e,s,n,r);if(!l)throw new xp(t,r);const c=[];let u={},d={},f;if(r==="ws"){const ae=yo((C=(T=s.bindings)==null?void 0:T.ws)==null?void 0:C.query),se=yo((z=(P=s.bindings)==null?void 0:P.ws)==null?void 0:z.headers);u=ae.values,d=se.values,c.push(...ae.placeholders.map(N=>`query param "${N}"`)),c.push(...se.placeholders.map(N=>`header "${N}"`))}else r==="kafka"&&(f=(j=(V=s.bindings)==null?void 0:V.kafka)==null?void 0:j.topic);const p=s.address??"";let h=p;for(const[ae,se]of Object.entries(s.parameters??{})){const N=sn(se,ae);h=h.replace(`{${ae}}`,N.value),N.isPlaceholder&&c.push(`channel parameter "${ae}"`)}r==="kafka"&&f&&(h=f);const m=(E=a??i[0])==null?void 0:E.server,y=m?`${m.protocol}://${m.host}${m.pathname??""}`:"",b=(m==null?void 0:m.host)??"",v=ko(e,m==null?void 0:m.security),S=i.map(({name:ae,server:se})=>({name:ae,host:se.host,protocol:se.protocol,pathname:se.pathname,url:`${se.protocol}://${se.host}${se.pathname??""}`,description:se.description,security:ko(e,se.security)})),w=n.messages!==void 0?We(e,n.messages[0]):We(e,Object.values(s.messages??{})[0]),I=(M=w==null?void 0:w.examples)==null?void 0:M[0];let B,F;if(I)B=I.name,F=I.payload;else if((w==null?void 0:w.payload)!==void 0){if(F=Er(e,w.payload),F===void 0)throw new xo(t);c.push("message payload (no explicit example — generated from its schema)")}else throw new xo(t);const A=(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 ae=(Y=(G=w==null?void 0:w.bindings)==null?void 0:G.kafka)==null?void 0:Y.key,se=ae?sn(ae,"kafka message key"):void 0;se!=null&&se.isPlaceholder&&c.push("kafka message key");const N=sn((ue=(te=n.bindings)==null?void 0:te.kafka)==null?void 0:ue.clientId,"kafka clientId");N.isPlaceholder&&c.push("kafka clientId");let L;x==="receive"&&(L=sn((le=(de=n.bindings)==null?void 0:de.kafka)==null?void 0:le.groupId,"kafka consumer group id"),L.isPlaceholder&&c.push("kafka consumer group id")),$={key:se==null?void 0:se.value,groupId:L==null?void 0:L.value,clientId:N.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:F,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:A,headersSchema:k},placeholders:c,info:e.info,security:v,...$?{kafka:$}:{}}}function Op(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 _p(e,t){if(t.length!==0){e("**Authorization:**");for(const r of t)if(e(`- **${Op(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 Mp(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&&(_p(e,r.security),t())}function wo(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 Na(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)Mp(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&&wo(n,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&wo(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 Rp={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)=>Na(e,t)},Pp={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)=>Na(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 Lp={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
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()}},
|
|
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()}},Bp={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
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
|
|
139
|
-
${e.map(a=>`${s}${
|
|
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
140
|
`)},
|
|
141
141
|
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
142
|
-
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${
|
|
142
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${$r(l,t,r+1)}`).join(`,
|
|
143
143
|
`)},
|
|
144
|
-
${n}}`}const
|
|
144
|
+
${n}}`}const Dp={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
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
|
|
147
|
-
${e.map(a=>`${s}${
|
|
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
148
|
`)},
|
|
149
149
|
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
150
|
-
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${
|
|
150
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Cr(l,t,r+1)}`).join(`,
|
|
151
151
|
`)},
|
|
152
|
-
${n}}`}const
|
|
152
|
+
${n}}`}const Fp={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
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()}},
|
|
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()}},zp={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
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()}},
|
|
156
|
+
`))n(`// ${l}`);s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}return i()}},Hp={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
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
|
|
159
|
-
${e.map(a=>`${s}${
|
|
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
160
|
`)},
|
|
161
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)}: ${
|
|
162
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Tr(l,t,r+1)}`).join(`,
|
|
163
163
|
`)},
|
|
164
|
-
${n}}`}const
|
|
164
|
+
${n}}`}const Up={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
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
|
|
167
|
-
${e.map(a=>`${s}${
|
|
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
168
|
`)},
|
|
169
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)}: ${
|
|
170
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Ir(l,t,r+1)}`).join(`,
|
|
171
171
|
`)},
|
|
172
|
-
${n}}`}const
|
|
172
|
+
${n}}`}const Wp={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
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()}},
|
|
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()}},Kp={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
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 Jp(){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 Zp(e,t){const r=[];for(const n of Jp()){const s=n.clients.filter(i=>Op(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",Bp);_e("agent",Lp);Jt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});_e("javascript",Vp);_e("javascript",Up);_e("javascript",Wp);Jt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});_e("python",zp);_e("python",Hp);Jt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});_e("rust",Dp);_e("rust",Fp);Jt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});_e("go",Kp);_e("go",Gp);var Xp=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 xp(t,r,l)}const i=_p(this.document,e,s.info.protocol);return s.convert(i,n)}};const Yp="javascript",Qp="ws";function qp(e,t){return Zp(e,t)}function Ea(e,t,r,n){try{return new Xp(e).convert(t,r,n)}catch{return null}}function eh(e,t,r){if(t){for(const n of r)for(const s of n.clients)if(Ea(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${Yp}:${Qp}`}const th={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 $a(e){return th[e]??"plaintext"}const nh={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 $n(e){return e==="plaintext"||!!Ie.getLanguage(e)}async function Ca(e){if($n(e))return;const t=nh[e];if(!t)return;const r=await t();Ie.registerLanguage(e,r.default)}function rh({operationId:e}){const{document:t,showCodeSamples:r}=Ke(),n=g.useId(),s=g.useMemo(()=>e?qp(t,e):[],[t,e]),i=g.useMemo(()=>eh(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=$a(u),[,p]=g.useState(()=>$n(f));g.useEffect(()=>{p($n(f));let m=!1;return Ca(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Ea(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(Bn,{code:h,language:f})]})}function Ta({label:e,children:t}){return o.jsx(Tn,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function Ia(){const{plugins:e,pluginSlotRegistry:t}=Ke();return g.useMemo(()=>t??Mo(e??[]),[t,e])}function Oa(e){return Ia().get(e)??[]}function ys({name:e,context:t}){const r=Oa(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Ta,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function _a(e){return Ia().get(e)??[]}const Nt="reference";function Ma({name:e,context:t,enabled:r=!0,children:n}){const s=_a(e),[i,a]=g.useState(Nt),[l,c]=g.useState(()=>new Set([Nt])),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)??Nt,m=[{id:Nt,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(El,{tabs:m,current:h,idPrefix:u,renderPanel:(b,v)=>{if(!v&&!l.has(b.id))return null;if(b.id===Nt)return n;const S=d.get(b.id);if(!S)return null;const w=S.Component;return o.jsx(Ta,{label:`${e}:${S.pluginName}`,children:o.jsx(w,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function sh({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(va,{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(Ma,{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(Mn,{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(rh,{operationId:t}),t&&o.jsx(ys,{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(bs,{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(ya,{protocol:b,bindings:v,focused:r===`binding:${b}`})]},b):null),u?o.jsx(pp,{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 Ra({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:ml,content:d,stickySideContent:!1,layout:s})}),o.jsx(wa,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(sh,{op:a,id:t,focusSection:n},t)})]})}function ks({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=ge(),i=Zr(),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=ci(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"," ",ui(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(Yi,{schema:u.originalSchema})}):o.jsx(xs,{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 oh=e=>e==="operations"||e==="messages"||e==="schemas";function ih({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&&Ji(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:On}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Ko}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Fr}]:[]],{query:p,setQuery:h,results:m}=Gc(e,{threshold:.3,limit:20}),{effectiveTab:y,focusTab:b,navActiveSection:v,selected:S,setSelectedKey:w,selectedNavItem:C,handleSearchSelect:B,handleNavItemSelect:H,handleNavServerSelect:A,handleContentTabChange:k,focusSection:x,schemaFocusTarget:$}=ai({tabs:f,defaultTab:"operations",isTabKey:oh,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(Ra,{operations:e.operations??{},selectedKey:S.operations,onSelectKey:N=>w("operations",N),focusSection:x}):y==="messages"?o.jsx(fa,{messages:((P=e.components)==null?void 0:P.messages)??{},selectedKey:S.messages,focusSection:x}):y==="schemas"?o.jsx(ks,{schemas:((z=e.components)==null?void 0:z.schemas)??{},selectedKey:S.schemas,focusTarget:$}):null;return o.jsx(In,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(Do,{logo:u?o.jsx(hs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Go,{query:p,onQueryChange:h,results:m,onSelectResult:B,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Xo,{serialize:N=>Xr(e,N),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Xi,{...e.info,showLogo:!1})}),n.servers!==!1&&I.length>0&&o.jsx("div",{id:`server-${S.servers??I[0]}`,children:o.jsx(ka,{servers:e.servers,selectedServer:S.servers,onSelectServer:N=>w("servers",N),focusSection:x})}),n.sidebar!==!1&&o.jsx(Gl,{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:A,selectedItem:C}),o.jsx(Bo,{tabs:f,current:y,onChange:k}),y&&o.jsx("div",{id:`panel-${y}`,role:"tabpanel","aria-labelledby":`tab-${y}`,children:E})]})})}const ws=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(ah,{...e})}),ah=e=>{const t=e.asyncapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Pr(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(ih,{asyncapi:r,config:s,plugins:e.plugins})};function Fn({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 lh(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 _n){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))Yo(t,i,s,s);return t}function ch(e,t={}){return oi(e,lh,t)}function Pa({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(Zi,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function uh({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx(ma,{address:e,variables:r}),t&&o.jsx(Oe,{children:t})]})}const nr=e=>`server-${e}`,rr=e=>Number(e.slice(7));function La({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||nr(h)),[i,a]=g.useState(void 0),l=p=>!!p&&rr(p)>=0&&rr(p)<e.length,c=l(t)?t:l(i)?i:nr(0),u=e[rr(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(uh,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:Oo,content:f,sideContent:o.jsx(pa,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?nr(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const So=320;function dh({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(lr(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:Fo(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 fh({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 Ba(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function ph(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${Ba(`$${r}`)}}`)}function hh(e){return e.operationId??e.operationRef??null}const mh=e=>e.trim().replace(/[.:;]+$/,""),sr=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function gh({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=hh(s),a=Object.entries(s.parameters??{}),l=s.description?mh(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(fh,{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(sr,{children:f})," from ",o.jsx(sr,{children:Ba(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(sr,{children:s.server.url})]}):null,"."]})]},n)})})}function xh(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>_n.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function bh({callbacks:e,id:t,renderOperation:r,depth:n}){const s=xh(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:ph(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 yh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-Cv-2sVZy.cjs")).then(({CodeSamples:e})=>({default:e})));function kh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Da({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 Fa(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 wh(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 vh({responses:e,onFollowOperation:t,isOperationKnown:r}){var H,A;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:(A=S[0])==null?void 0:A.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 ${wh(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:Sh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(ot,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Da,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:Fa(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),v&&o.jsx(gh,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function za(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 jh=e=>za(e),Sh=e=>za(Object.entries(e).map(([t,r])=>({name:t,...r})));function Ah({parameters:e}){var l;const t=bl.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=jh(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 ",Eh(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(Ah,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(ot,{schema:f.schema??{},label:o.jsx(Da,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:Fa(f)})]})]})}function Eh(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 $h({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<Ch,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(vh,{responses:s,onFollowOperation:u,isOperationKnown:d}),v==="callbacks"&&i&&o.jsx(bh,{callbacks:i,id:a,depth:l,renderOperation:Ha})]})]})}const Ch=1;function Ha({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(A=>A.in!=="query"&&A.in!=="path"),p=r.security??i??[],h=r.responses??{},m=((w=r.requestBody)==null?void 0:w.content)??{},y=r.operationId?kh(r.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const A of p)for(const[k,x]of Object.entries(A)){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(A=>Object.keys(A)))).map(A=>{const k=a==null?void 0:a[A];if(!k)return null;const x=b.get(A);return x?{...k,requiredScopes:x}:k}).filter(A=>!!A),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(Ma,{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(Mn,{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(yh,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(ys,{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(ha,{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(bs,{securities:v})})})]}),o.jsx($h,{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 Ua(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 Ao(e){const t={};for(const r of e)t[r.name]=Ua(r);return t}function Th(e){return e.filter(t=>t.in==="query").map(t=>({...Ua(t),name:t.name,required:t.required}))}function Cn({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var H;const c=A=>s==null?void 0:s(A),u=g.useMemo(()=>Tt(e),[e]),d=g.useMemo(()=>{var k,x,$;const A=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=A.get(E)??[];P.push(I),A.set(E,P)}return Array.from(A,([I,E])=>({label:I,items:E}))},[u,e]),[f,p]=g.useState(()=>new Set),h=f.size===0;g.useEffect(()=>{if(!n)return;const A=d.find(({items:k})=>k.some(({key:x})=>x===n));A&&p(k=>{if(!k.has(A.label))return k;const x=new Set(k);return x.delete(A.label),x})},[d,n]);const m=g.useMemo(()=>{var k,x;const A=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&&A.set(P,$)}return A},[u,e]);if(u.length===0)return null;const y=n?u.find(A=>A.key===n):null,b=y?(H=e[y.path])==null?void 0:H[y.method]:null,v=({key:A,method:k,path:x},$)=>{var P;const I=n===A,E=Os(e[x],(P=e[x])==null?void 0:P[k]);return o.jsxs("tr",{id:`${a}-${A}`,onClick:()=>c(A),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(A))},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:Ao(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"})})})]},A)},S=d.map(({label:A,items:k},x)=>{const $=!f.has(A),I=`${a}-group-${x}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${A} endpoints (${k.length})`,"aria-expanded":$,"aria-controls":I,onClick:()=>p(E=>{const P=new Set(E);return $?P.add(A):P.delete(A),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(ga,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:k.length})]})})})}),o.jsx("tbody",{id:I,"aria-hidden":!$,className:`bg-surface ${$?"divide-y divide-border":""}`,children:k.map(E=>v(E,$))})]},A)}),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:Ao(w),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(dh,{parameters:Th(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:A=>p(A.target.checked?new Set:new Set(d.map(({label:k})=>k))),onKeyDown:A=>{A.key==="Enter"&&(A.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(wa,{isOpen:!!y,side:"right",onClose:()=>c(null),title:C,children:y&&b&&o.jsx(Ha,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:A=>m.has(A),onFollowOperation:A=>{const k=m.get(A);k&&c(k)}},y.key)})]})}const Ih=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function Oh({openapi:e,config:t,plugins:r}){var z,J,j,N;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&&Ji(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:On}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:zr}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Fr}]:[]],{query:m,setQuery:y,results:b}=ch(e,{threshold:.3,limit:20}),{effectiveTab:v,focusTab:S,navActiveSection:w,selected:C,setSelectedKey:B,selectedNavItem:H,handleSearchSelect:A,handleNavItemSelect:k,handleNavServerSelect:x,handleContentTabChange:$,schemaFocusTarget:I}=ai({tabs:h,defaultTab:"endpoints",isTabKey:Ih,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(Cn,{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(Cn,{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(ks,{schemas:((j=e.components)==null?void 0:j.schemas)??{},selectedKey:C.schemas,focusTarget:I}):null;return o.jsx(Fn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(Do,{logo:u?o.jsx(hs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Go,{query:m,onQueryChange:y,results:b,onSelectResult:A,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Xo,{serialize:M=>Yr(e,M),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Pa,{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(La,{servers:e.servers,selectedServer:C.servers,onSelectServer:M=>B("servers",M)})}),n.sidebar!==!1&&o.jsx(Xl,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:p&&n.webhooks!==!1?f:void 0,schemas:n.schemas!==!1?(N=e.components)==null?void 0:N.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(Bo,{tabs:h,current:v,onChange:$}),v&&o.jsx("div",{id:`panel-${v}`,role:"tabpanel","aria-labelledby":`tab-${v}`,children:P})]})})}const vs=e=>o.jsx(Tn,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(_h,{...e})}),_h=e=>{const t=e.openapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Pr(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(Oh,{openapi:r,config:s,plugins:e.plugins})};function Wa(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},
|
|
178
|
-
`)}function
|
|
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 Gp(){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 Vp(e,t){const r=[];for(const n of Gp()){const s=n.clients.filter(i=>Tp(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",Pp);_e("agent",Rp);Jt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});_e("javascript",Kp);_e("javascript",zp);_e("javascript",Hp);Jt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});_e("python",Dp);_e("python",Fp);Jt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});_e("rust",Lp);_e("rust",Bp);Jt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});_e("go",Up);_e("go",Wp);var Jp=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 mp(t,r,l)}const i=Ip(this.document,e,s.info.protocol);return s.convert(i,n)}};const Zp="javascript",Xp="ws";function Yp(e,t){return Vp(e,t)}function Aa(e,t,r,n){try{return new Jp(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(Aa(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${Zp}:${Xp}`}const qp={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 Ea(e){return qp[e]??"plaintext"}const eh={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 An(e){return e==="plaintext"||!!Ie.getLanguage(e)}async function $a(e){if(An(e))return;const t=eh[e];if(!t)return;const r=await t();Ie.registerLanguage(e,r.default)}function th({operationId:e}){const{document:t,showCodeSamples:r}=Ke(),n=g.useId(),s=g.useMemo(()=>e?Yp(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=Ea(u),[,p]=g.useState(()=>An(f));g.useEffect(()=>{p(An(f));let m=!1;return $a(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Aa(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(Pn,{code:h,language:f})]})}function Ca({label:e,children:t}){return o.jsx($n,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function Ta(){const{plugins:e,pluginSlotRegistry:t}=Ke();return g.useMemo(()=>t??Oo(e??[]),[t,e])}function Ia(e){return Ta().get(e)??[]}function xs({name:e,context:t}){const r=Ia(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Ca,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function Oa(e){return Ta().get(e)??[]}const At="reference";function _a({name:e,context:t,enabled:r=!0,children:n}){const s=Oa(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(Al,{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(Ca,{label:`${e}:${S.pluginName}`,children:o.jsx(w,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function nh({op:e,id:t,focusSection:r=null}){var y;const{document:n}=$o(),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===hn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,v)=>o.jsx(wa,{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(_a,{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(On,{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(th,{operationId:t}),t&&o.jsx(xs,{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(gs,{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(ba,{protocol:b,bindings:v,focused:r===`binding:${b}`})]},b):null),u?o.jsx(dp,{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 Ma({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:hl,content:d,stickySideContent:!1,layout:s})}),o.jsx(ka,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(nh,{op:a,id:t,focusSection:n},t)})]})}function bs({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=be(),i=Vr(),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=li(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"," ",ci(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(Xi,{schema:u.originalSchema})}):o.jsx(ms,{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 rh=e=>e==="operations"||e==="messages"||e==="schemas";function sh({asyncapi:e,config:t,plugins:r}){var P,z,V,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&&Vi(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Tn}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Wo}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Br}]:[]],{query:p,setQuery:h,results:m}=Wc(e,{threshold:.3,limit:20}),{effectiveTab:y,focusTab:b,navActiveSection:v,selected:S,setSelectedKey:w,selectedNavItem:I,handleSearchSelect:B,handleNavItemSelect:F,handleNavServerSelect:A,handleContentTabChange:k,focusSection:x,schemaFocusTarget:$}=ii({tabs:f,defaultTab:"operations",isTabKey:rh,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}),T=e.servers?Object.keys(e.servers):[],C=y==="operations"?o.jsx(Ma,{operations:e.operations??{},selectedKey:S.operations,onSelectKey:E=>w("operations",E),focusSection:x}):y==="messages"?o.jsx(da,{messages:((P=e.components)==null?void 0:P.messages)??{},selectedKey:S.messages,focusSection:x}):y==="schemas"?o.jsx(bs,{schemas:((z=e.components)==null?void 0:z.schemas)??{},selectedKey:S.schemas,focusTarget:$}):null;return o.jsx(Cn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(Bo,{logo:u?o.jsx(fs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Ko,{query:p,onQueryChange:h,results:m,onSelectResult:B,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Zo,{serialize:E=>Jr(e,E),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Zi,{...e.info,showLogo:!1})}),n.servers!==!1&&T.length>0&&o.jsx("div",{id:`server-${S.servers??T[0]}`,children:o.jsx(ya,{servers:e.servers,selectedServer:S.servers,onSelectServer:E=>w("servers",E),focusSection:x})}),n.sidebar!==!1&&o.jsx(Wl,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(V=e.components)==null?void 0:V.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:F,onSelectServer:A,selectedItem:I}),o.jsx(Lo,{tabs:f,current:y,onChange:k}),y&&o.jsx("div",{id:`panel-${y}`,role:"tabpanel","aria-labelledby":`tab-${y}`,children:C})]})})}const ys=e=>o.jsx($n,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(oh,{...e})}),oh=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(sh,{asyncapi:r,config:s,plugins:e.plugins})};function Bn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=_o("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 ih(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:je([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:je([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 In){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:je([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))Xo(t,i,s,s);return t}function ah(e,t={}){return si(e,ih,t)}function Ra({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(Ji,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function lh({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx(ha,{address:e,variables:r}),t&&o.jsx(Oe,{children:t})]})}const er=e=>`server-${e}`,tr=e=>Number(e.slice(7));function Pa({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||er(h)),[i,a]=g.useState(void 0),l=p=>!!p&&tr(p)>=0&&tr(p)<e.length,c=l(t)?t:l(i)?i:er(0),u=e[tr(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(lh,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:To,content:f,sideContent:o.jsx(fa,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?er(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const vo=320;function ch({parameters:e}){const{portalHost:t}=be(),[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(ir(u,{align:"end",width:vo}));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:vo},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:Do(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 uh({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 La(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function dh(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${La(`$${r}`)}}`)}function fh(e){return e.operationId??e.operationRef??null}const ph=e=>e.trim().replace(/[.:;]+$/,""),nr=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function hh({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=fh(s),a=Object.entries(s.parameters??{}),l=s.description?ph(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(uh,{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(nr,{children:f})," from ",o.jsx(nr,{children:La(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(nr,{children:s.server.url})]}):null,"."]})]},n)})})}function mh(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>In.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function gh({callbacks:e,id:t,renderOperation:r,depth:n}){const s=mh(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:dh(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 xh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-Cvh_2_x5.cjs")).then(({CodeSamples:e})=>({default:e})));function bh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Ba({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 Da(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 yh(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 kh({responses:e,onFollowOperation:t,isOperationKnown:r}){var F,A;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?(F=a==null?void 0:a.content)==null?void 0:F[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,I=S.some(k=>k.id===h)?h:(A=S[0])==null?void 0:A.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 ${yh(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:I,onChange:k=>m(k)}),o.jsx("div",{className:w?"mt-4":void 0,children:I==="headers"?o.jsx(ot,{schema:vh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(ot,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Ba,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:Da(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),v&&o.jsx(hh,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function Fa(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 wh=e=>Fa(e),vh=e=>Fa(Object.entries(e).map(([t,r])=>({name:t,...r})));function jh({parameters:e}){var l;const t=xl.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=wh(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 Sh({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 ",Nh(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(jh,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(ot,{schema:f.schema??{},label:o.jsx(Ba,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:Da(f)})]})]})}function Nh(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 Ah({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<Eh,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(Sh,{label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}),v==="response"&&o.jsx(kh,{responses:s,onFollowOperation:u,isOperationKnown:d}),v==="callbacks"&&i&&o.jsx(gh,{callbacks:i,id:a,depth:l,renderOperation:za})]})]})}const Eh=1;function za({method:e,path:t,op:r,id:n,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var w,I,B,F;const{document:d}=Co(),f=(r.parameters??[]).filter(A=>A.in!=="query"&&A.in!=="path"),p=r.security??i??[],h=r.responses??{},m=((w=r.requestBody)==null?void 0:w.content)??{},y=r.operationId?bh(r.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const A of p)for(const[k,x]of Object.entries(A)){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(A=>Object.keys(A)))).map(A=>{const k=a==null?void 0:a[A];if(!k)return null;const x=b.get(A);return x?{...k,requiredScopes:x}:k}).filter(A=>!!A),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(_a,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:S,children:o.jsxs(o.Fragment,{children:[(r.deprecated||((I=r.externalDocs)==null?void 0:I.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(On,{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(xh,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(xs,{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(pa,{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(gs,{securities:v})})})]}),o.jsx(Ah,{label:y,parameters:f,requestBodyContent:m,requestBodyDescription:(F=r.requestBody)==null?void 0:F.description,responses:h,callbacks:r.callbacks,id:n,depth:u,fillHeight:S,onFollowOperation:l,isOperationKnown:c})]})})})}function Ha(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 jo(e){const t={};for(const r of e)t[r.name]=Ha(r);return t}function $h(e){return e.filter(t=>t.in==="query").map(t=>({...Ha(t),name:t.name,required:t.required}))}function En({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var F;const c=A=>s==null?void 0:s(A),u=g.useMemo(()=>Tt(e),[e]),d=g.useMemo(()=>{var k,x,$;const A=new Map;for(const T of u){const C=(($=(x=(k=e[T.path])==null?void 0:k[T.method])==null?void 0:x.tags)==null?void 0:$[0])||"Other",P=A.get(C)??[];P.push(T),A.set(C,P)}return Array.from(A,([T,C])=>({label:T,items:C}))},[u,e]),[f,p]=g.useState(()=>new Set),h=f.size===0;g.useEffect(()=>{if(!n)return;const A=d.find(({items:k})=>k.some(({key:x})=>x===n));A&&p(k=>{if(!k.has(A.label))return k;const x=new Set(k);return x.delete(A.label),x})},[d,n]);const m=g.useMemo(()=>{var k,x;const A=new Map;for(const{key:$,method:T,path:C}of u){const P=(x=(k=e[C])==null?void 0:k[T])==null?void 0:x.operationId;P&&A.set(P,$)}return A},[u,e]);if(u.length===0)return null;const y=n?u.find(A=>A.key===n):null,b=y?(F=e[y.path])==null?void 0:F[y.method]:null,v=({key:A,method:k,path:x},$)=>{var P;const T=n===A,C=Ts(e[x],(P=e[x])==null?void 0:P[k]);return o.jsxs("tr",{id:`${a}-${A}`,onClick:()=>c(A),role:"button",tabIndex:$?0:-1,"aria-hidden":!$,"aria-label":`${k.toUpperCase()} ${x}`,"aria-current":T?"true":void 0,onKeyDown:z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),c(A))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${$?`cursor-pointer opacity-100 visible ${T?"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:jo(C),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"})})})]},A)},S=d.map(({label:A,items:k},x)=>{const $=!f.has(A),T=`${a}-group-${x}-${A.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${A} endpoints (${k.length})`,"aria-expanded":$,"aria-controls":T,onClick:()=>p(C=>{const P=new Set(C);return $?P.add(A):P.delete(A),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(ma,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:A}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:k.length})]})})})}),o.jsx("tbody",{id:T,"aria-hidden":!$,className:`bg-surface ${$?"divide-y divide-border":""}`,children:k.map(C=>v(C,$))})]},A)}),w=Ts(y?e[y.path]:void 0,b),I=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:jo(w),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(ch,{parameters:$h(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:A=>p(A.target.checked?new Set:new Set(d.map(({label:k})=>k))),onKeyDown:A=>{A.key==="Enter"&&(A.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(ka,{isOpen:!!y,side:"right",onClose:()=>c(null),title:I,children:y&&b&&o.jsx(za,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:A=>m.has(A),onFollowOperation:A=>{const k=m.get(A);k&&c(k)}},y.key)})]})}const Ch=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function Th({openapi:e,config:t,plugins:r}){var z,V,j,E;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&&Vi(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Tn}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Dr}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Br}]:[]],{query:m,setQuery:y,results:b}=ah(e,{threshold:.3,limit:20}),{effectiveTab:v,focusTab:S,navActiveSection:w,selected:I,setSelectedKey:B,selectedNavItem:F,handleSearchSelect:A,handleNavItemSelect:k,handleNavServerSelect:x,handleContentTabChange:$,schemaFocusTarget:T}=ii({tabs:h,defaultTab:"endpoints",isTabKey:Ch,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}),C=(e.servers??[]).map(M=>M.url),P=v==="endpoints"?o.jsx(En,{paths:e.paths??{},security:e.security,securitySchemes:(z=e.components)==null?void 0:z.securitySchemes,selectedKey:I.endpoints,onSelectKey:M=>B("endpoints",M)}):v==="webhooks"?o.jsx(En,{paths:f,security:e.security,securitySchemes:(V=e.components)==null?void 0:V.securitySchemes,selectedKey:I.webhooks,onSelectKey:M=>B("webhooks",M),columnLabel:"Webhook",idPrefix:"webhook"}):v==="schemas"?o.jsx(bs,{schemas:((j=e.components)==null?void 0:j.schemas)??{},selectedKey:I.schemas,focusTarget:T}):null;return o.jsx(Bn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(Bo,{logo:u?o.jsx(fs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Ko,{query:m,onQueryChange:y,results:b,onSelectResult:A,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Zo,{serialize:M=>Zr(e,M),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Ra,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),n.servers!==!1&&C.length>0&&o.jsx("div",{id:I.servers??"server-0",children:o.jsx(Pa,{servers:e.servers,selectedServer:I.servers,onSelectServer:M=>B("servers",M)})}),n.sidebar!==!1&&o.jsx(Jl,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:p&&n.webhooks!==!1?f:void 0,schemas:n.schemas!==!1?(E=e.components)==null?void 0:E.schemas:void 0,servers:n.servers!==!1?C:void 0,hasInfo:n.info!==!1,activeTab:w,onTabChange:S,onItemSelect:k,onSelectServer:x,selectedItem:F}),o.jsx(Lo,{tabs:h,current:v,onChange:$}),v&&o.jsx("div",{id:`panel-${v}`,role:"tabpanel","aria-labelledby":`tab-${v}`,children:P})]})})}const ks=e=>o.jsx($n,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Ih,{...e})}),Ih=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(Th,{openapi:r,config:s,plugins:e.plugins})};function Ua(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},Oh=e=>In.some(t=>t===e),_h=Ua({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 Zr(e);if(typeof t.path!="string"||!Oh(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return hi(e,t.method,t.path)}}),Mh=Ua({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 Jr(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return fi(e,t.id)}}),So=[_h,Mh];function ws(e){const t=typeof e=="object"&&e!==null?e:{},r=So.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: ${So.map(n=>n.name).join(", ")}.`);return r}function Wa(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Rh(e){return ws(e).targets(e)}function Ph(e,t){const r=ws(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return r.toMarkdown(e,t)}function Lh(e,t={}){const r=ws(e),{baseUrl:n,url:s,optional:i}=t,a=(n==null?void 0:n.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${Wa(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 Ka(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 Bh=["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 Dh(){return{validate:zh,parse:Hh,getMimeTypes:()=>Bh}}function Fh(e){Ka(e,Dh(),Bt)}function zh(e){return Gr(e.data).map(t=>({message:t,path:e.path}))}function Hh(e){var r,n;const t=Gr(e.data);if(t.length>0)return{[yn]: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{[yn]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Uh(){try{const e=await Promise.resolve().then(()=>require("./index-BQS9YcP-.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 Ga(e){try{const t=await Uh(),r=new t;Fh(r);const{registerProtobufSchemaParser:n}=await Promise.resolve().then(()=>require("./protobufSchemaParser-B_yfGaIm.cjs"));n(r);const{document:s,diagnostics:i}=await r.parse(e);return{diagnostics:i,document:s?Kh(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Wh(e,t){const{diagnostics:r,document:n}=await Ga(e);return{diagnostics:r,view:n?o.jsx(ys,{kind:"resolved",asyncapi:n,config:t}):null}}function Kh(e){return e.json()}function Gh({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 Ga(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(ys,{kind:"resolved",asyncapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}async function Vh(){try{return await Promise.resolve().then(()=>require("./index-CzrvJcJ8.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 rr=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function Va(e){try{const{validate:t,dereference:r}=await Vh(),n=await t(e);if(!n.valid)return{diagnostics:n.errors.map(l=>rr(l,0)),document:null};const s=(n.errors??[]).map(l=>rr(l,1)),{schema:i,errors:a}=r(e);return a!=null&&a.length&&s.push(...a.map(l=>rr(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 Jh(e,t){const{diagnostics:r,document:n}=await Va(e);return{diagnostics:r,view:n?o.jsx(ks,{kind:"resolved",openapi:n,config:t}):null}}function Zh({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 Va(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",openapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}function Ja(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 Xh({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Cn,{document:s,config:t,plugins:r,children:n})}const Dn=Ja(Cn,"AsyncAPI","asyncapi");function Fn(){const e=be();return e.specType==="asyncapi",e.document}function Yh({layout:e}){const t=Fn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(ya,{servers:t.servers,layout:e})}function Qh({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(Yh,{layout:e})})}function qh({layout:e}){const t=Fn(),[r,n]=g.useState(null);return o.jsx(Ma,{operations:t.operations??{},selectedKey:r,onSelectKey:n,layout:e})}function em({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(qh,{layout:e})})}function tm({layout:e}){var r;const t=Fn();return o.jsx(da,{messages:((r=t.components)==null?void 0:r.messages)??{},layout:e})}function nm({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(tm,{layout:e})})}function rm({layout:e}){const t=Fn();return t.info?o.jsx(Zi,{...t.info,layout:e}):null}function sm({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(rm,{layout:e})})}const om=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function sr({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(bs,{schemas:r,layout:e})}function vs({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(sr,{layout:n});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return om(i)?o.jsx(Bn,{document:i,config:t,plugins:r,children:o.jsx(sr,{layout:n})}):o.jsx(Cn,{document:i,config:t,plugins:r,children:o.jsx(sr,{layout:n})})}const im=vs,am=vs;function lm({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Bn,{document:s,config:t,plugins:r,children:n})}const zn=Ja(Bn,"OpenAPI","openapi");function Hn(){const e=Ke();return e.specType==="openapi",e.document}function cm({layout:e}){const t=Hn();return!t.servers||t.servers.length===0?null:o.jsx(Pa,{servers:t.servers,layout:e})}function um({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(cm,{layout:e})})}function dm({layout:e}){var s;const t=Hn(),[r,n]=g.useState(null);return o.jsx(En,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:r,onSelectKey:n,layout:e})}function fm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(dm,{layout:e})})}function pm({layout:e}){var i;const t=Hn(),[r,n]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(En,{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 hm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(pm,{layout:e})})}function mm({layout:e}){const t=Hn();return t.info?o.jsx(Ra,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function gm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(mm,{layout:e})})}exports.AsyncAPI=ys;exports.AsyncAPIInfo=sm;exports.AsyncAPIMessages=nm;exports.AsyncAPIOperations=em;exports.AsyncAPIProvider=Xh;exports.AsyncAPIRenderer=Gh;exports.AsyncAPISchemas=im;exports.AsyncAPIServers=Qh;exports.CodeBlock=Pn;exports.ErrorBoundary=$n;exports.OpenAPI=ks;exports.OpenAPIEndpoints=fm;exports.OpenAPIInfo=gm;exports.OpenAPIProvider=lm;exports.OpenAPIRenderer=Zh;exports.OpenAPISchemas=am;exports.OpenAPIServers=um;exports.OpenAPIWebhooks=hm;exports.PluginSlot=xs;exports.SchemaTabs=ot;exports.SchemaTree=ms;exports.Schemas=vs;exports.X_LIB_CONVERSION_ERROR=yn;exports.asyncApiOperationToMarkdown=fi;exports.asyncApiToMarkdown=Jr;exports.commonjsGlobal=id;exports.defaultConfig=gt;exports.documentToLlmsTxt=Lh;exports.documentToMarkdown=Ph;exports.ensureHljsLanguage=$a;exports.getAugmentedNamespace=ad;exports.getDefaultExportFromCjs=Ti;exports.hljsLanguageForTarget=Ea;exports.isHljsLanguageReady=An;exports.isProtobufSchemaFormat=Dt;exports.listDocumentTargets=Rh;exports.markdownForLlm=Jo;exports.openApiEndpointToMarkdown=hi;exports.openApiToMarkdown=Zr;exports.parseAndRender=Wh;exports.parseAndRender$1=Jh;exports.registerSchemaParserWithFallback=Ka;exports.resolveLogo=Xr;exports.targetSlug=Wa;exports.useAsyncAPIDocument=be;exports.useAsyncAPIDocumentContext=$o;exports.useDocumentContext=Ke;exports.useOpenAPIDocumentContext=Co;exports.useOperationTabPlugins=Oa;exports.usePluginSlot=Ia;
|