apiuikit 2.4.0 → 2.5.0

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.
Files changed (26) hide show
  1. package/README.md +1 -0
  2. package/dist/{CodeSamples-cudhC1Tt.cjs → CodeSamples-CaQ-Plnx.cjs} +1 -1
  3. package/dist/{CodeSamples-DlTU0NQt.js → CodeSamples-DevA5LND.js} +1 -1
  4. package/dist/{LogoExtension-CWmh9Ac1.cjs → LogoExtension-D0VY8gpU.cjs} +1 -1
  5. package/dist/{LogoExtension-CB2hokoQ.js → LogoExtension-DMBdjLMS.js} +1 -1
  6. package/dist/apiuikit.cjs.js +1 -1
  7. package/dist/apiuikit.css +1 -1
  8. package/dist/apiuikit.es.js +1 -1
  9. package/dist/components/Section.d.ts +7 -1
  10. package/dist/config/config.d.ts +4 -0
  11. package/dist/helpers/marked.d.ts +11 -1
  12. package/dist/helpers/sanitize.d.ts +10 -0
  13. package/dist/hooks/useSystemColorScheme.d.ts +4 -0
  14. package/dist/{index-B0PAsEtK.js → index-BVwqtADi.js} +1 -1
  15. package/dist/{index-9nxb2bCY.js → index-BXI--_xO.js} +1 -1
  16. package/dist/{index-jpFnjoiM.cjs → index-BjVWe_rQ.cjs} +1 -1
  17. package/dist/index-DKItRZCR.cjs +182 -0
  18. package/dist/{index-JfEtoyra.cjs → index-Djr20zD8.cjs} +1 -1
  19. package/dist/{index-D1eDZSHR.js → index-vxDO_J_a.js} +6253 -5300
  20. package/dist/{protoToJsonSchema-BtR0DMuR.js → protoToJsonSchema-Br2jKuIZ.js} +1 -1
  21. package/dist/{protoToJsonSchema-sAcBTEqG.cjs → protoToJsonSchema-C2GoWuZu.cjs} +1 -1
  22. package/dist/{protobufSchemaParser-DQwQQY_N.cjs → protobufSchemaParser-Cbb8hQnz.cjs} +1 -1
  23. package/dist/{protobufSchemaParser-C5H7VtBA.js → protobufSchemaParser-DzWDLqeW.js} +2 -2
  24. package/dist/public/createSectionRoot.d.ts +13 -1
  25. package/package.json +2 -2
  26. package/dist/index-Dgi7m_9C.cjs +0 -180
@@ -0,0 +1,182 @@
1
+ "use strict";var Yu=Object.create;var ls=Object.defineProperty;var Xu=Object.getOwnPropertyDescriptor;var Zu=Object.getOwnPropertyNames;var Qu=Object.getPrototypeOf,qu=Object.prototype.hasOwnProperty;var ed=(e,t,n)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var td=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Zu(t))!qu.call(e,s)&&s!==n&&ls(e,s,{get:()=>t[s],enumerable:!(r=Xu(t,s))||r.enumerable});return e};var Si=(e,t,n)=>(n=e!=null?Yu(Qu(e)):{},td(t||!e||!e.__esModule?ls(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>ed(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),x=require("react"),an=require("react-dom"),ao=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],co=(e,t)=>{const n=t.length>0?t:ao,r=(e%n.length+n.length)%n.length;return n[r]},Rt={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:"#ffffff",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:ao},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},lo=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",nd=e=>typeof e=="object"&&e!==null;function rd(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Ja(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let n=e;for(const r of t.slice(2).split("/")){if(!nd(n))return;const s=rd(r);if(s===void 0||(n=n[s],n===void 0))return}return n}function Bt(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=Ja(e,n);return t.set(n,r),r}}const us=e=>typeof e=="object"&&e!==null,sd=e=>e.replace(/^#\//,"").split("/").pop()??e,uo=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),lo(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>uo(r,t))),Ya=(e,t=new Set,n=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(n.has(e))return!1;if(n.add(e),lo(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Ya(s,t,n))}finally{t.delete(e)}},od=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Ai=e=>e.length?`#/${e.map(od).join("/")}`:"#";function fn(e){if(!Ya(e))return e;const t=new Map,n=new Set,r=new Map,s=(i,a)=>{if(Array.isArray(i)){if(n.has(i))return{$ref:r.get(i)};const c=t.get(i);if(c!==void 0)return c;const u=[];r.set(i,Ai(a)),t.set(i,u),n.add(i);try{i.forEach((l,d)=>u.push(s(l,[...a,String(d)])))}finally{n.delete(i)}return u}if(lo(i)){const c=Ja(e,i.$ref),u=us(c)||Array.isArray(c);if(u&&!n.has(c)){const l=s(c,a);return us(l)&&l["x-parser-schema-id"]===void 0&&(l["x-parser-schema-id"]=sd(i.$ref)),l}if(c!==void 0&&!u)return c}if(us(i)){if(n.has(i))return{$ref:r.get(i)};const c=t.get(i);if(c!==void 0)return c;const u={};r.set(i,Ai(a)),t.set(i,u),n.add(i);try{for(const[l,d]of Object.entries(i))u[l]=s(d,[...a,l])}finally{n.delete(i)}return u}return i};return s(e,[])}class Ft extends x.Component{constructor(){super(...arguments);ge(this,"state",{error:null});ge(this,"reset",()=>{this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var s,i;console.error("[apiuikit] Rendering error:",n,r.componentStack),(i=(s=this.props).onError)==null||i.call(s,n,r)}componentDidUpdate(n){this.state.error&&n.resetKey!==this.props.resetKey&&this.reset()}render(){const{error:n}=this.state;if(!n)return this.props.children;const{fallback:r}=this.props;return typeof r=="function"?r(n,this.reset):r!==void 0?r: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:n.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 zt=x.createContext(null),it=()=>{const e=x.useContext(zt);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Xa=()=>{const e=it();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Za=()=>{const e=it();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},De=it;var Er=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Er||{});const id="Contact",ad="Email",Ei="License",Ni="External Documentation",cd="Tags",ld="Implicit",ud=`The Implicit flow is a simplified OAuth flow previously recommended
2
+ for native apps and JavaScript apps where the access token is returned
3
+ immediately without an extra authorization code exchange step.`,dd="Client Credentials",fd="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",pd="Password",hd="The Password grant type is a legacy way to exchange a user's credentials for an access token.",md="Authorization Code",gd="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Qa="Connecting to a server",xd="",Nr=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],bd=[50,100,200,300,500,600,700],yd={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"}},wd=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],kd={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",[Er.SEND]:"bg-green-100 text-green-800",[Er.RECEIVE]:"bg-blue-100 text-blue-800"};function qa(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${n} ${r} ${s}`}function ds(e,t,n){if(e)for(const r of bd){const s=e[r];s&&(n[`--color-${t}-${r}`]=qa(s))}}const vd=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],jd={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 Sd(e,t){var s,i,a,c,u,l;if(!t)return e??{};if(!e)return t;const n=(d,f)=>d||f?{...d,...f}:void 0,r=(d,f)=>d||f?{...d,...f}:void 0;return{...e,...t,colors:{primary:n((s=e.colors)==null?void 0:s.primary,(i=t.colors)==null?void 0:i.primary),secondary:n((a=e.colors)==null?void 0:a.secondary,(c=t.colors)==null?void 0:c.secondary),neutral:n((u=e.colors)==null?void 0:u.neutral,(l=t.colors)==null?void 0:l.neutral)},light:r(e.light,t.light),dark:r(e.dark,t.dark)}}function Ad(e,t){const n=e==null?void 0:e.mode;return n==="light"||n==="dark"?n:n==="system"?t?"dark":"light":e!=null&&e.dark&&!(e!=null&&e.light)?"dark":"light"}function Ed(e,t){const n={},r=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(jd))n[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of vd){const a=r[s];a&&(n[i]=qa(a))}return e.colors&&(ds(e.colors.primary,"primary",n),ds(e.colors.secondary,"secondary",n),ds(e.colors.neutral,"neutral",n)),n}const Nd=e=>e.endsWith(".tab"),Ti=new WeakMap;let Td=0;const Cd=e=>{const t=Ti.get(e);if(t)return t;const n=`plugin-${Td++}`;return Ti.set(e,n),n};function ec(e){const t=new Map;for(const n of e){const r=Cd(n);for(const s of Object.keys(n.slots)){const i=n.slots[s];if(!i)continue;const a=t.get(s)??[];if(t.has(s)||t.set(s,a),Nd(s)){const c=i;a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,label:c.label,Component:c.component})}else a.push({id:`${s.replace(/\./g,"-")}-${r}`,pluginName:n.name,Component:i})}}return t}const Ci="(prefers-color-scheme: dark)",_i=()=>typeof window<"u"&&typeof window.matchMedia=="function",_d=()=>!1;function $d(e){const t=x.useCallback(r=>{if(!e||!_i())return()=>{};const s=window.matchMedia(Ci);return s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),n=()=>e&&_i()&&window.matchMedia(Ci).matches;return x.useSyncExternalStore(t,n,_d)}const Id=[];function tc(e,t,n=Rt,r=Id){var _,L,U,P,X,ie,E,S,M,W;const[s,i]=x.useState(null),[a,c]=x.useState(null),u=x.useMemo(()=>Bt(t),[t]),l=((_=n.expand)==null?void 0:_.schemas)===!0,d=(U=(L=n.theme)==null?void 0:L.depthColors)!=null&&U.length?n.theme.depthColors:ao,f=((P=n.show)==null?void 0:P.extensions)!==!1,p=((X=n.show)==null?void 0:X.codeSamples)!==!1,m=((ie=n.show)==null?void 0:ie.tryIt)===!0,g=n.topOffset,y=typeof g=="number"&&Number.isFinite(g)?Math.max(0,g):0,b=((E=n.sidePanel)==null?void 0:E.containment)??"viewport",j=(S=n.sidePanel)==null?void 0:S.topOffset,N=typeof j=="number"&&Number.isFinite(j)?Math.max(0,j):y,A=(M=n.markdown)==null?void 0:M.url,$=x.useMemo(()=>{if(typeof A=="function")return A;if(typeof A=="string")return()=>A},[A]),F=x.useMemo(()=>ec(r),[r]),G=$d(((W=n.theme)==null?void 0:W.mode)==="system"),T=x.useMemo(()=>Ad(n.theme,G),[n.theme,G]),v=x.useMemo(()=>Ed(Sd(Rt.theme,n.theme),T),[n.theme,T]);return{contextValue:x.useMemo(()=>({specType:e,document:t,deref:u,portalHost:s,rootElement:a,topOffset:y,sidePanelContainment:b,sidePanelTopOffset:N,defaultSchemaExpanded:l,depthColors:d,showExtensions:f,showCodeSamples:p,showTryIt:m,markdownUrl:$,plugins:r,pluginSlotRegistry:F,config:n,resolvedMode:T}),[e,t,u,s,a,y,b,N,l,d,f,p,m,$,r,F,n,T]),themeVars:v,resolvedMode:T,setPortalHost:i,setRootElement:c}}function Fr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("asyncapi",e,t,n);return o.jsx(zt.Provider,{value:i,children:o.jsxs("div",{ref:l,"data-theme":c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:u,className:"asyncapi-portal-root"}),s]})})}const fo="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function nt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:c="columns",topSpacing:u=!0,bottomSpacing:l=!0}){const d=c==="stacked",f=n!=null&&n!==!1,p=`${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 ${u?"mt-6":""} ${l?"mb-6":""} ${d?"":fo}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:d?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:p,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${d?"flex-col":f&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${d?"w-full":"@lg:w-prose"} min-w-0`,children:t}),d?f&&o.jsx("div",{className:r?"@lg:sticky @lg:top-4":void 0,children:n}):o.jsx("div",{className:`@lg:pl-12 @lg:w-[400px] shrink-0 ${f?"":"hidden @lg:block"}`,"data-testid":"section-side-column",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function $t(...e){return e.filter(Boolean).join(" ")}function pn({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 br=(e,t)=>`${e?`${e}-`:""}tab-${t}`,yr=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function Ht({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:c}){var y;const u=x.useId(),l=x.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,m=p>=0?p:0,g=(b,j)=>{var $;if(e.length===0)return;const N=F=>(F+e.length)%e.length;let A=j;if(b.key==="ArrowRight"&&(b.preventDefault(),A=N(j+1)),b.key==="ArrowLeft"&&(b.preventDefault(),A=N(j-1)),b.key==="Home"&&(b.preventDefault(),A=0),b.key==="End"&&(b.preventDefault(),A=e.length-1),A!==j){const F=e[A];n(F.id),($=l.current[A])==null||$.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:$t("@sm:hidden relative",f?"mt-0":"mt-4"),children:[o.jsx("label",{htmlFor:u,className:"sr-only",children:s}),o.jsxs("select",{id:u,name:"tabs",value:d,onChange:b=>n(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(pn,{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:$t("hidden @sm:block",f||c==="segmented"?"":"mt-6"),children:c==="segmented"?o.jsx("div",{className:"inline-flex h-9.5 w-77.5 items-center gap-1 rounded-lg bg-neutral-100 p-1",role:"tablist","aria-label":r,children:e.map((b,j)=>{const N=b.id===t;return o.jsx("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",N?"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":r,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((b,j)=>{const N=b.id===t,A=b.icon;return o.jsx("button",{ref:$=>{l.current[j]=$},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:$=>g($,j),className:$t("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",N?"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:[A?o.jsx(A,{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":r,children:e.map((b,j)=>{const N=b.id===t;return o.jsxs("button",{ref:A=>{l.current[j]=A},id:br(i,b.id),type:"button",role:"tab",tabIndex:j===m?0:-1,"aria-selected":N,"aria-controls":yr(i,b.id),onClick:()=>n(b.id),onKeyDown:A=>g(A,j),className:$t(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",j===0?"rounded-l-lg":"",j===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[o.jsx("span",{children:b.name}),o.jsx("span",{"aria-hidden":"true",className:$t(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},b.id)})})})]}):null}function Od({tabs:e,current:t,idPrefix:n,renderPanel:r}){return o.jsx(o.Fragment,{children:e.map(s=>{const i=s.id===t;return o.jsx("div",{id:yr(n,s.id),role:"tabpanel","aria-labelledby":br(n,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:r(s,i)},s.id)})})}function nc(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function po(e){let t=e;for(;t&&t!==document.body;){if(nc(t))return t;t=t.parentElement}return document.documentElement}function Md(e,t){if(!e||!t||!t.contains(e))return null;let n=e;for(;n;){if(nc(n))return n;if(n===t)break;n=n.parentElement}return null}function rc(e){const t=e.style.overflow,n=e.style.paddingRight,r=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",r>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+r}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function sc({tabs:e,current:t,onChange:n}){const{rootElement:r,topOffset:s=0}=it();if(!e.length)return null;const i=typeof document<"u"&&po(r)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full",children:o.jsx(Ht,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky z-10 flex w-full justify-center bg-background pb-2",style:{top:i},children:o.jsx(nt,{content:a,stickySideContent:!1,bottomSpacing:!1})})}function Rd(e,t){const[n,r]=x.useState("docked"),s=x.useRef(t);return s.current=t,x.useEffect(()=>{if(!e)return;let i=null,a=null;const c=()=>{a=null;const l=e.getBoundingClientRect().top,d=i===null?0:l-i;i=l,l>=0?r("docked"):s.current||d>0?r("pinned"):d<0?r("hidden"):r(f=>f==="docked"?"hidden":f)},u=()=>{a===null&&(a=requestAnimationFrame(c))};return c(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[e]),x.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}const Ld=56,Pd=8;function oc({logo:e,children:t,forceVisible:n=!1}){const{rootElement:r,topOffset:s=0}=it(),i=Rd(r,n),a=s,c=a+Ld+Pd,u={top:a,transform:`translateY(${i==="hidden"?`-${c}px`:"0px"})`,pointerEvents:i==="hidden"?"none":void 0};return o.jsx("header",{className:"document-topbar",style:u,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${fo}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function ic(e){if(e.length===0)return o.jsx("span",{children:"No allowed values."});if(e.length===1)return o.jsxs("span",{children:["Allowed value is ",o.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>o.jsxs(x.Fragment,{children:[o.jsx("code",{children:r}),", "," "]},s)),n=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function Dd(e){return e.map(t=>`\`${t}\``).join(", ")}function Is(e,{align:t="center",gap:n=8,clearance:r=40,width:s=0,margin:i=8}={}){const a=e.getBoundingClientRect(),c=a.top<r?"bottom":"top",u=c==="top"?a.top-n:a.bottom+n;if(t==="center")return{top:u,left:a.left+a.width/2,placement:c};const l=a.right-s,d=window.innerWidth-s-i;return{top:u,left:Math.max(i,Math.min(l,d)),placement:c}}function Bd(e){const t=[],n=/\{([^}]+)\}/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push({type:"text",value:e.slice(r,s.index)}),t.push({type:"param",value:s[1]}),r=s.index+s[0].length;return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}const $i=360;function Fd(e){let t=0;return e.map((n,r)=>n.type==="text"?o.jsx("span",{children:n.value},r):o.jsx("span",{className:`font-semibold ${Nr[t++%Nr.length]}`,children:`{${n.value}}`},r))}function Et({address:e,parameters:t,className:n="text-xs",truncate:r=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=De(),[c,u]=x.useState(null),[l,d]=x.useState({top:0,left:0,placement:"top"}),[f,p]=x.useState(!1),[m,g]=x.useState(null),y=x.useRef(null),b=x.useId(),j=Bd(e);let N=0;x.useEffect(()=>{if(!r)return;const w=y.current;if(!w)return;const _=()=>p(w.scrollWidth>w.clientWidth);_();const L=new ResizeObserver(_);return L.observe(w),()=>L.disconnect()},[r,e]);const A=(w,_)=>{d(Is(_)),u(w)},$=()=>u(null),F=w=>g(Is(w,{align:"end",width:$i})),G=()=>g(null),T=j.map((w,_)=>{if(w.type==="text")return o.jsx("span",{children:w.value},_);const L=t==null?void 0:t[w.value],U=Nr[N++%Nr.length],P=c===_,X=!!L&&(L.description||L.type||L.default||L.enum&&L.enum.length>0||L.examples&&L.examples.length>0),ie=`channel-address-tooltip-${_}`,E=X&&P?ie:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:S=>X&&A(_,S.currentTarget),onMouseLeave:$,children:[o.jsx("span",{className:`font-semibold ${U} ${X?"cursor-help underline decoration-dotted":""}`,role:X?"button":void 0,tabIndex:X?0:void 0,"aria-expanded":X?P:void 0,"aria-describedby":E,onFocus:S=>X&&A(_,S.currentTarget),onBlur:$,onKeyDown:S=>{X&&((S.key==="Enter"||S.key===" ")&&(S.preventDefault(),A(_,S.currentTarget)),S.key==="Escape"&&(S.preventDefault(),$(),S.currentTarget.blur()))},children:`{${w.value}}`}),X&&P&&a&&an.createPortal(o.jsxs("div",{id:ie,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 ${l.placement==="top"?"-translate-y-full":""}`,style:{top:l.top,left:l.left},children:[L.description&&o.jsx("div",{children:L.description}),L.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:L.type})}),L.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:L.default})]}),L.enum&&L.enum.length>0&&o.jsx("div",{className:"mt-1",children:ic(L.enum)}),L.examples&&L.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",L.examples.join(", ")]})]}),a)]},_)}),v=i?"px-2 py-1 ":"";return r?o.jsxs("code",{className:`${v}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[o.jsx("span",{ref:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!m,"aria-describedby":m?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:w=>F(w.currentTarget),onMouseLeave:G,onFocus:w=>F(w.currentTarget),onBlur:G,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),F(w.currentTarget)),w.key==="Escape"&&(w.preventDefault(),G(),w.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&m&&a&&an.createPortal(o.jsx("div",{id:b,role:"tooltip",style:{top:m.top,left:m.left,width:$i},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${m.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:Fd(j)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${n}`,children:T})}const zd={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function wt({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${zd[t]} ${kd[e]} ${n}`,children:e}):null}function Os(e,t){const[n,r]=x.useState(null);return x.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const i=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{s!==null&&cancelAnimationFrame(s),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),n}const Ii=6,Hd=12,Ud=8,Wd=.7,Gd=240;function Kd(e,t){if(e===0)return 1/0;const n=Math.min(e*Wd,Gd)-Ud*2,r=t*Ii+Math.max(0,t-1)*Hd;return Math.max(1,Math.floor((n-r)/Ii))}function Vd(e,t){const n=e.reduce((s,i)=>s+i,0);if(n<=t)return e;if(t<=e.length)return e.map(()=>1);const r=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/n*r)))}const Jd=12,Yd=48,Xd=40;function Zd({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=x.useState(!1),[c,u]=x.useState(!1),l=i||c,{rootElement:d,portalHost:f,topOffset:p=0}=De(),m=x.useRef(null),g=x.useRef(null),[y,b]=x.useState(null),[j,N]=x.useState(null),A=x.useMemo(()=>e.filter(J=>J.items.length>0),[e]),$=x.useMemo(()=>A.filter(J=>J.isTab===!1||J.id===t),[A,t]),F=x.useMemo(()=>A.filter(J=>J.showInPopover!==!1),[A]),[G,T]=x.useState(null),v=x.useRef(null),w=x.useRef(null),_=x.useCallback((J,H)=>{T({section:J,key:H}),v.current={section:J,key:H},w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{v.current=null},600)},[]);x.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),x.useEffect(()=>{const H=e.filter(V=>V.items.length>0).flatMap(V=>V.items.map(me=>({section:V.id,key:V.itemKey(me),id:V.targetId(me)}))).map(V=>({...V,el:document.getElementById(V.id)})).filter(V=>!!V.el);if(H.length===0)return;const B=new Map(H.map(V=>[V.el,V])),se=new Map,ue=new IntersectionObserver(V=>{for(const O of V)O.isIntersecting?se.set(O.target,O.boundingClientRect.top):se.delete(O.target);if(se.size===0)return;let me=null,Ce=-1/0;for(const[O,R]of se)R>Ce&&(me=O,Ce=R);const _e=me&&B.get(me);if(!_e)return;const Re=v.current;if(Re){if(_e.section!==Re.section||_e.key!==Re.key)return;v.current=null}T({section:_e.section,key:_e.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return H.forEach(V=>ue.observe(V.el)),()=>ue.disconnect()},[e]);const L=(G==null?void 0:G.section)??t,U=G??s,P=Os(d,!0),X=typeof window>"u"?0:window.innerWidth,ie=typeof window>"u"?0:window.innerHeight,E=!!P&&P.bottom>p&&P.top<ie,S=Math.max((P==null?void 0:P.top)??p,p),M=Math.min((P==null?void 0:P.bottom)??ie,ie),W=Math.max(0,M-S),Q=(S+M)/2,[ne,Ae]=x.useState(null);x.useLayoutEffect(()=>{if(!j||!d)return;const J=()=>{const B=j.getBoundingClientRect().left-d.getBoundingClientRect().left;Ae(se=>se===B?se:B)};J();const H=new ResizeObserver(J);return H.observe(j),H.observe(d),window.addEventListener("resize",J),()=>{H.disconnect(),window.removeEventListener("resize",J)}},[j,d]);const Ne=ne===null?null:((P==null?void 0:P.left)??0)+ne,ye=((P==null?void 0:P.left)??0)+Jd,q=Ne!==null?Ne-ye>=Xd+Yd:!!P&&P.width>=1024,le=!!P&&!q,K={opacity:E?1:0,pointerEvents:E?"auto":"none",transition:"opacity 0.2s ease"},ae={position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",zIndex:45,...K},he={position:"sticky",bottom:0,height:0,zIndex:45,pointerEvents:"none"},de=Os(y,le),Te=le?{position:"fixed",bottom:de?ie-de.top+8:68,right:de?X-de.right:16,zIndex:46}:{position:"fixed",top:Q,left:ye,transform:"translateY(-50%)",maxHeight:`${Math.max(0,W-32)}px`,zIndex:46};x.useEffect(()=>{if(!i)return;const J=B=>{var se;B.key==="Escape"&&(a(!1),u(!1),(se=m.current)==null||se.focus())},H=B=>{var ue,V;const se=B.target;(ue=m.current)!=null&&ue.contains(se)||(V=g.current)!=null&&V.contains(se)||a(!1)};return document.addEventListener("keydown",J),document.addEventListener("mousedown",H),()=>{document.removeEventListener("keydown",J),document.removeEventListener("mousedown",H)}},[i]);const we=x.useCallback((J,H)=>{J.isTab!==!1&&n(J.id),H&&setTimeout(()=>{var B;(B=document.getElementById(H))==null||B.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),ke=x.useMemo(()=>F.map(J=>{const H=L===J.id,B=(U==null?void 0:U.section)===J.id,se=J.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{we(J),_(J.id,""),le&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${H?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(se,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${H?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${H?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:J.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 ${H?"border border-primary-200 bg-primary-100 text-primary-700":"bg-neutral-100 text-foreground-muted"}`,children:J.items.length})]}),J.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:J.items.map(ue=>{const V=J.itemKey(ue),me=B&&(U==null?void 0:U.key)===V;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{we(J,J.targetId(ue)),r(J.id,V),_(J.id,V),le&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${me?"bg-primary-50 font-medium text-primary-700":H?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:J.renderItem(ue,{isSelected:me,isSectionActive:H})})},V)})})]},J.id)}),[F,L,U,le,we,r,_]),Me=Kd(W,$.length),re=x.useMemo(()=>{const J=Vd($.map(H=>H.items.length),Me);return $.map((H,B)=>{const se=L===H.id,ue=H.items.length,V=J[B];let me=-1;if((U==null?void 0:U.section)===H.id){const Ce=H.items.findIndex(_e=>H.itemKey(_e)===U.key);Ce>=0&&(me=Math.min(V-1,Math.floor(Ce*V/ue)))}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 ${se?"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:V},(Ce,_e)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${_e===me?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},_e))})]},H.id)})},[$,L,U,Me]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:N,"aria-hidden":"true",className:`w-full ${fo}`,style:{height:0}}),!le&&o.jsx("button",{ref:m,onClick:()=>a(J=>!J),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),title:l?"Close navigation":"Open navigation","aria-label":l?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2","aria-expanded":l,style:{...ae,visibility:E?"visible":"hidden"},children:re}),le&&o.jsx("div",{style:he,children:o.jsx("button",{ref:J=>{m.current=J,b(J)},onClick:()=>a(J=>!J),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"absolute bottom-4 right-4 flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg","aria-expanded":l,style:{...K,visibility:E?"visible":"hidden"},children:o.jsxs("span",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})})}),f&&an.createPortal(o.jsx("div",{ref:g,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!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 ${le?"origin-bottom-right":""} ${l?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:{...Te,visibility:l?"visible":"hidden"},children:ke}),f)]})}function ac({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(Zd,{sections:e,activeSection:t,onTabChange:a=>n(a),onItemSelect:(a,c)=>{a!=="info"&&(a==="servers"?s==null||s(c):r==null||r(a,c))},selectedItem:i?{section:i.tab,key:i.key}:null})}function ho({className:e,children:t,...n}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...n,children:t})}function Qd(e){return o.jsxs(ho,{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 mo({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 cc(e){return{id:"info",label:"Info",icon:Qd,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function lc(e){return{id:"schemas",label:"Schemas",icon:mo,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function uc({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 zr({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 dc({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 ar={};function qd({operations:e=ar,messages:t=ar,schemas:n=ar,servers:r=ar,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l,sidebarConfig:d}){const f=x.useMemo(()=>{const p=m=>{var y;return d!=null&&d.useChannelAddressAsIdentifier?((y=e[m])==null?void 0:y.channel)??null:null};return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:Object.keys(r),itemKey:m=>m,targetId:m=>`server-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},{id:"operations",label:"Operations",icon:zr,items:Object.keys(e),itemKey:m=>m,targetId:m=>`operation-${m}`,renderItem:m=>{var y;const g=p(m);return g!=null&&g.address?o.jsx(Et,{address:g.address,parameters:g.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:(y=e[m])==null?void 0:y.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m})]})}},{id:"messages",label:"Messages",icon:dc,items:Object.keys(t),itemKey:m=>m,targetId:m=>`message-${m}`,renderItem:m=>o.jsx("span",{className:"truncate",children:m})},lc(n)]},[e,t,n,r,s,d]);return o.jsx(ac,{sections:f,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const hn=["get","put","post","delete","options","head","patch","trace"],fc=(e,t)=>`${e} ${t}`;function Ms(e,t){const n=new Map;for(const r of[e==null?void 0:e.parameters,t==null?void 0:t.parameters])if(Array.isArray(r))for(const s of r)s&&typeof s=="object"&&n.set(`${s.in}:${s.name}`,s);return Array.from(n.values())}function cn(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?hn.filter(r=>n[r]).map(r=>({key:fc(r,t),method:r,path:t})):[]})}function go({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 Oi={},ef={},tf=[];function nf({paths:e=Oi,webhooks:t=Oi,schemas:n=ef,servers:r=tf,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l}){const d=x.useMemo(()=>cn(e),[e]),f=x.useMemo(()=>cn(t),[t]),p=x.useMemo(()=>{const m=r.map((g,y)=>({key:`server-${y}`,url:g}));return[cc(s),{id:"servers",label:"Servers",icon:uc,isTab:!1,items:m,itemKey:g=>g.key,targetId:g=>g.key,renderItem:g=>o.jsx("span",{className:"truncate",children:g.url})},{id:"endpoints",label:"Endpoints",icon:zr,items:d,itemKey:g=>g.key,targetId:g=>`endpoint-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx(Et,{address:g.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:go,items:f,itemKey:g=>g.key,targetId:g=>`webhook-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(wt,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g.path})]})},lc(n)]},[d,f,n,r,s]);return o.jsx(ac,{sections:p,activeTab:i,onTabChange:a,onItemSelect:c,onSelectServer:u,selectedItem:l})}const rf=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 pc({query:e,onQueryChange:t,results:n,onSelectResult:r,onOpenChange:s}){const i=x.useRef(null),a=x.useRef(null),[c,u]=x.useState(!1),[l,d]=x.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:m,rootElement:g,topOffset:y=0}=De(),b=()=>{u(!1),d(-1)};x.useEffect(()=>(s==null||s(c),()=>s==null?void 0:s(!1)),[c,s]);const j=x.useRef(!1),N=x.useRef(!1);x.useEffect(()=>{if(!g)return;const v=()=>{j.current=!0},w=()=>{j.current=!1};return g.addEventListener("mouseenter",v),g.addEventListener("mouseleave",w),()=>{g.removeEventListener("mouseenter",v),g.removeEventListener("mouseleave",w)}},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{N.current=g.contains(w.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[g]),x.useEffect(()=>{if(!g)return;const v=w=>{!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k"||!(g.contains(document.activeElement)||j.current||N.current)||(w.preventDefault(),u(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[g]),x.useEffect(()=>{if(!c)return;const v=requestAnimationFrame(()=>{var w;return(w=a.current)==null?void 0:w.focus()});return()=>cancelAnimationFrame(v)},[c]),x.useEffect(()=>{if(!(!c||!m))return rc(po(m))},[c,m]),x.useEffect(()=>{if(!c)return;const v=w=>{w.key==="Escape"&&b()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),x.useEffect(()=>{if(!c)return;const v=w=>{i.current&&!i.current.contains(w.target)&&b()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c]),x.useEffect(()=>{l>=n.length&&d(n.length-1)},[l,n.length]),x.useEffect(()=>{var v;l<0||(v=document.getElementById(p(l)))==null||v.scrollIntoView({block:"nearest"})},[l]);const A=c&&e.trim().length>0,$=v=>{b(),r(v)},F=v=>{if(v.key==="Escape"){v.preventDefault(),b();return}if(A){if(v.key==="ArrowDown"){v.preventDefault(),d(w=>n.length===0?-1:Math.min(w+1,n.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(w=>n.length===0?-1:Math.max(w-1,0));return}if(v.key==="Home"){v.preventDefault(),n.length>0&&d(0);return}if(v.key==="End"){v.preventDefault(),n.length>0&&d(n.length-1);return}if((v.key==="Enter"||v.key===" ")&&l>=0&&n[l]){v.preventDefault(),$(n[l]);return}}},G=A?`${n.length} result${n.length===1?"":"s"} found`:"",T=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>u(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",children:o.jsx(rf,{})}),c&&m&&an.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:v=>t(v.target.value),onKeyDown:F,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":l>=0?p(l):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:G}),A&&o.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((v,w)=>o.jsx("li",{children:o.jsxs("button",{id:p(w),type:"button",role:"option","aria-selected":l===w,onClick:()=>$(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===w?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:v.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:v.location}),v.subtitle&&o.jsxs("span",{children:["• ",v.subtitle]})]})]})},v.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:T?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),m)]})}function hc({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 mc({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 Hr({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 sf=["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 gc(e){return`${["> ## Agent Instructions",...sf.map(n=>`> ${n}`)].join(`
4
+ `)}
5
+
6
+ ${e.trimStart()}`}function xc({serialize:e,onOpenChange:t}){const[n,r]=x.useState(!1),[s,i]=x.useState(!1),a=x.useRef(null),c=x.useRef(void 0),{deref:u}=De(),l=()=>gc(e(u));x.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),x.useEffect(()=>(t==null||t(n),()=>t==null?void 0:t(!1)),[n,t]),x.useEffect(()=>{if(!n)return;const p=m=>{m.key==="Escape"&&r(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]),x.useEffect(()=>{if(!n)return;const p=m=>{a.current&&!a.current.contains(m.target)&&r(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const d=async()=>{const p=l();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),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>i(!1),2e3)}catch(m){console.error("[MarkdownExportMenu] Copy for LLM failed:",m)}r(!1)},f=()=>{const p=l(),m=new Blob([p],{type:"text/markdown"}),g=URL.createObjectURL(m);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:g}),window.open(g,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(g),3e4),r(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>r(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(mc,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(hc,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(pn,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-[41] w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:d,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:f,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[o.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),o.jsx(Hr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const fs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),bc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Mi=Array.from(bc),Ri="#/components/schemas/",of=e=>e.replace(/~1/g,"/").replace(/~0/g,"~"),af=e=>{if(!e.startsWith(Ri))return;const t=e.slice(Ri.length).split("/")[0];return t?of(t):void 0},xo=(e,t)=>{const n=new Map,r=new Map;for(const[s,i]of Object.entries(e??{}))if(fs(i)){n.has(i)||n.set(i,s);for(const a of Mi){const c=i[a];typeof c=="object"&&c!==null&&!r.has(c)&&r.set(c,{name:s,schema:i,key:a})}}return s=>{if(!fs(s))return;const i=n.get(s);if(i!==void 0)return i;for(const a of Mi){let c=s[a];if(fs(c)&&typeof c.$ref=="string"&&t&&(c=t(c.$ref)),typeof c!="object"||c===null)continue;const u=r.get(c);if(u&&u.key===a&&u.schema.type===s.type)return u.name}}},gt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),wr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>wr(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,wr(r,t)]).join(" "):gt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,wr(r,t)]).join(" ")):"",Ve=e=>wr(e).trim().replace(/\s+/g," "),cf=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Li=e=>e===null||typeof e!="object",lf=e=>{if(!gt(e))return e;const t={};for(const[n,r]of Object.entries(e))bc.has(n)||(Li(r)||Array.isArray(r)&&r.every(Li))&&(t[n]=r);return t},yc=(e,t,n,r,s)=>{const i=`schema-${n}`,a=(u,l,d,f)=>{const p=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,m=`Schemas > ${r}${d.length?` > ${d.join(" > ")}`:""}`,g=gt(u)?u.description:void 0,y=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?cf(n,f):i,type:"schema",tab:"schemas",key:n,name:y,path:p,location:m,subtitle:g,text:Ve([lf(u)]),schemaFocusTokens:f&&f.length>0?f:void 0})},c=(u,l=[],d=[],f=[],p=new Set)=>{if(a(u,l,d,f),!gt(u)||p.has(u)||(p.add(u),l.length>0&&(s==null?void 0:s(u))!==void 0))return;if(gt(u.properties))for(const[g,y]of Object.entries(u.properties))c(y,[...l,"properties",g],[...d,g],f?[...f,"properties",g]:null,p);const m=u.items;gt(m)?c(m,[...l,"items"],[...d,"items"],f?[...f,"items"]:null,p):Array.isArray(m)&&m.forEach((g,y)=>{c(g,[...l,`items[${y}]`],[...d,`items[${y}]`],null,p)});for(const g of["allOf","oneOf","anyOf"]){const y=u[g];Array.isArray(y)&&y.forEach((b,j)=>{c(b,[...l,`${g}[${j}]`],[...d,`${g}[${j}]`],f&&g!=="allOf"?[...f,`${g}[${j}]`]:null,p)})}gt(u.additionalProperties)&&c(u.additionalProperties,[...l,"additionalProperties"],[...d,"additionalProperties"],null,p)};c(t)};function uf(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:i,text: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,c=a.description??s,u=[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:u,text:Ve([s,c,u,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const l=a.security;Array.isArray(l)&&l.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(l)});const d=a.bindings,f=gt(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,c=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:c,text:Ve([s,a,c,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const u=i.security;Array.isArray(u)&&u.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(u)});const l=i.bindings;if(gt(l))for(const[d,f]of Object.entries(l))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((n=e.components)!=null&&n.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,c=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:c,text:Ve([s,a,c,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((r=e.components)!=null&&r.schemas){const s=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function Nt(e){return Array.isArray?Array.isArray(e):kc(e)==="[object Array]"}function df(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 Rs(e){return e==null?"":df(e)}function Pe(e){return typeof e=="string"}function kr(e){return typeof e=="number"}function ff(e){return e===!0||e===!1||pf(e)&&kc(e)=="[object Boolean]"}function wc(e){return typeof e=="object"}function pf(e){return wc(e)&&e!==null}function qe(e){return e!=null}function cr(e){return!e.trim().length}function kc(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hf="Incorrect 'index' type",Ls="Invalid doc index: must be a non-negative integer within the bounds of the docs array",mf=e=>`Invalid value for key ${e}`,gf=e=>`Pattern length exceeds max of ${e}.`,xf=e=>`Missing ${e} property in key`,bf=e=>`Property 'weight' in key '${e}' must be a positive integer`,yf="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.",Pi=Object.prototype.hasOwnProperty;var wf=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=vc(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function vc(e){let t=null,n=null,r=null,s=1,i=null;if(Pe(e)||Nt(e))r=e,t=Di(e),n=vr(e);else{if(!Pi.call(e,"name"))throw new Error(xf("name"));const a=e.name;if(r=a,Pi.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(bf(vr(a)));t=Di(a),n=vr(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function Di(e){return Nt(e)?e:e.split(".")}function vr(e){return Nt(e)?e.join("."):e}function kf(e,t){const n=[];let r=!1;const s=(i,a,c,u)=>{if(qe(i))if(!a[c])n.push(u!==void 0?{v:i,i:u}:i);else{const l=i[a[c]];if(!qe(l))return;if(c===a.length-1&&(Pe(l)||kr(l)||ff(l)||typeof l=="bigint"))n.push(u!==void 0?{v:Rs(l),i:u}:Rs(l));else if(Nt(l)){r=!0;for(let d=0,f=l.length;d<f;d+=1)s(l[d],a,c+1,d)}else a.length&&s(l,a,c+1,u)}};return s(e,Pe(t)?t.split("."):t,0),r?n:n[0]}const vf={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},jf={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},Sf={location:0,threshold:.6,distance:100},Af={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:kf,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ee=Object.freeze({...jf,...vf,...Sf,...Af});function Ef(e){return e>=9&&e<=13||e===32||e===160}function Nf(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let u=0;u<s.length;u++)Ef(s.charCodeAt(u))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const c=Math.round(r/Math.pow(i,.5*e))/r;return n.set(i,c),c},clear(){n.clear()}}}var bo=class{constructor({getFn:e=ee.getFn,fieldNormWeight:t=ee.fieldNormWeight}={}){this.norm=Nf(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(Pe(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(Ls);if(Pe(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(Ls);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,i=n.length;for(;s<i;){const a=s+i>>>1;n[a]<r.i?s=a+1:i=a}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!qe(e)||cr(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const i=this.keys[r],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(qe(a)){if(Nt(a)){const c=[];for(let u=0,l=a.length;u<l;u+=1){const d=a[u];if(qe(d)){if(Pe(d)){if(!cr(d)){const f={v:d,i:u,n:this.norm.get(d)};c.push(f)}}else if(qe(d.v)){const f=Pe(d.v)?d.v:Rs(d.v);if(!cr(f)){const p={v:f,i:d.i,n:this.norm.get(f)};c.push(p)}}}}n.$[r]=c}else if(Pe(a)&&!cr(a)){const c={v:a,n:this.norm.get(a)};n.$[r]=c}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function jc(e,t,{getFn:n=ee.getFn,fieldNormWeight:r=ee.fieldNormWeight}={}){const s=new bo({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(vc)),s.setSources(t),s.create(),s}function Tf(e,{getFn:t=ee.getFn,fieldNormWeight:n=ee.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new bo({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function Cf(e=[],t=ee.minMatchCharLength){const n=[];let r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const c=e[i];c&&r===-1?r=i:!c&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function _f(e,t,n,{location:r=ee.location,distance:s=ee.distance,threshold:i=ee.threshold,findAllMatches:a=ee.findAllMatches,minMatchCharLength:c=ee.minMatchCharLength,includeMatches:u=ee.includeMatches,ignoreLocation:l=ee.ignoreLocation}={}){if(t.length>32)throw new Error(gf(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let m=i,g=p;const y=(w,_)=>{const L=w/d;if(l)return L;const U=Math.abs(p-_);return s?L+U/s:U?1:L},b=c>1||u,j=b?Array(f):[];let N;for(;(N=e.indexOf(t,g))>-1;){const w=y(0,N);if(m=Math.min(w,m),g=N+d,b){let _=0;for(;_<d;)j[N+_]=1,_+=1}}g=-1;let A=[],$=1,F=0,G=d+f;const T=1<<d-1;for(let w=0;w<d;w+=1){let _=0,L=G;for(;_<L;)y(w,p+L)<=m?_=L:G=L,L=Math.floor((G-_)/2+_);G=L;let U=Math.max(1,p-L+1);const P=a?f:Math.min(p+L,f)+d,X=Array(P+2);X[P+1]=(1<<w)-1;for(let ie=P;ie>=U;ie-=1){const E=ie-1,S=n[e[E]];if(X[ie]=(X[ie+1]<<1|1)&S,w&&(X[ie]|=(A[ie+1]|A[ie])<<1|1|A[ie+1]),X[ie]&T&&($=y(w,E),$<=m)){if(m=$,g=E,F=w,g<=p)break;U=Math.max(1,2*p-g)}}if(y(w+1,p)>m)break;A=X}if(b&&g>=0){const w=Math.min(f-1,g+d-1+F);for(let _=g;_<=w;_+=1)n[e[_]]&&(j[_]=1)}const v={isMatch:g>=0,score:Math.max(.001,$)};if(b){const w=Cf(j,c);w.length?u&&(v.indices=w):v.isMatch=!1}return v}function $f(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function yo(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],i=e[n];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const Sc={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},If=new RegExp("["+Object.keys(Sc).join("")+"]","g"),On=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(If,t=>Sc[t]):e=>e;var wo=class{constructor(e,{location:t=ee.location,threshold:n=ee.threshold,distance:r=ee.distance,includeMatches:s=ee.includeMatches,findAllMatches:i=ee.findAllMatches,minMatchCharLength:a=ee.minMatchCharLength,isCaseSensitive:c=ee.isCaseSensitive,ignoreDiacritics:u=ee.ignoreDiacritics,ignoreLocation:l=ee.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l},e=c?e:e.toLowerCase(),e=u?On(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,m)=>{this.chunks.push({pattern:p,alphabet:$f(p),startIndex:m})},f=this.pattern.length;if(f>32){let p=0;const m=f%32,g=f-m;for(;p<g;)d(this.pattern.substr(p,32),p),p+=32;if(m){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?On(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return r&&(g.indices=[[0,e.length-1]]),g}const{location:s,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,ignoreLocation:l}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:g,alphabet:y,startIndex:b})=>{const{isMatch:j,score:N,indices:A}=_f(e,g,y,{location:s+b,distance:i,threshold:a,findAllMatches:c,minMatchCharLength:u,includeMatches:r,ignoreLocation:l});j&&(p=!0),f+=N,j&&A&&d.push(...A)});const m={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(m.indices=yo(d)),m}};const Of=new Set(["fuzzy","include"]);function Mf(e){return e.startsWith("inverse")}const Ps=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,r;const s=[],i=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+i,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new wo(e,{location:t.location??ee.location,threshold:t.threshold??ee.threshold,distance:t.distance??ee.distance,includeMatches:t.includeMatches??ee.includeMatches,findAllMatches:t.findAllMatches??ee.findAllMatches,minMatchCharLength:t.minMatchCharLength??ee.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??ee.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??ee.ignoreDiacritics,ignoreLocation:t.ignoreLocation??ee.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Bi=Ps.length,Rf="\0",Lf="|";function Pf(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const i=s+1;if(i>=n||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Fi(e,t){const n=e.match(t);return n?n[1]:null}function Df(e,t={}){return e.replace(/\\\|/g,Rf).split(Lf).map(n=>{const r=Pf(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const c=r[i];let u=!1,l=-1;for(;!u&&++l<Bi;){const d=Ps[l],f=Fi(c,d.multiRegex);f&&(s.push(d.create(f,t)),u=!0)}if(!u)for(l=-1;++l<Bi;){const d=Ps[l],f=Fi(c,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Bf=class{constructor(e,{isCaseSensitive:t=ee.isCaseSensitive,ignoreDiacritics:n=ee.ignoreDiacritics,includeMatches:r=ee.includeMatches,minMatchCharLength:s=ee.minMatchCharLength,ignoreLocation:i=ee.ignoreLocation,findAllMatches:a=ee.findAllMatches,location:c=ee.location,threshold:u=ee.threshold,distance:l=ee.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:c,threshold:u,distance:l},e=t?e:e.toLowerCase(),e=n?On(e):e,this.pattern=e,this.query=Df(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?On(e):e;let i=0;const a=[];let c=0,u=!1;for(let l=0,d=t.length;l<d;l+=1){const f=t[l];a.length=0,i=0,u=!1;for(let p=0,m=f.length;p<m;p+=1){const g=f[p],{isMatch:y,indices:b,score:j}=g.search(e);if(y)i+=1,c+=j,Mf(g.type)&&(u=!0),n&&(Of.has(g.type)?a.push(...b):a.push(b));else{c=0,i=0,a.length=0,u=!1;break}}if(i){const p={isMatch:!0,score:c/i};return u&&(p.hasInverse=!0),n&&(p.indices=yo(a)),p}}return{isMatch:!1,score:1}}};const Ds=[];function ko(...e){Ds.push(...e)}function Tr(e,t){for(let n=0,r=Ds.length;n<r;n+=1){const s=Ds[n];if(s.condition(e,t))return new s(e,t)}return new wo(e,t)}const Cr={AND:"$and",OR:"$or"},Bs={PATH:"$path",PATTERN:"$val"},Fs=e=>!!(e[Cr.AND]||e[Cr.OR]),Ff=e=>!!e[Bs.PATH],zf=e=>!Nt(e)&&wc(e)&&!Fs(e),zi=e=>({[Cr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ac(e,t,{auto:n=!0}={}){const r=s=>{if(Pe(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=Tr(s,t)),u}const i=Object.keys(s),a=Ff(s);if(!a&&i.length>1&&!Fs(s))return r(zi(s));if(zf(s)){const u=a?s[Bs.PATH]:i[0],l=a?s[Bs.PATTERN]:s[u];if(!Pe(l))throw new Error(mf(u));const d={keyId:vr(u),pattern:l};return n&&(d.searcher=Tr(l,t)),d}const c={children:[],operator:i[0]};return i.forEach(u=>{const l=s[u];Nt(l)&&l.forEach(d=>{c.children.push(r(d))})}),c};return Fs(e)||(e=zi(e)),r(e)}function zs(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:i})=>{const a=r?r.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n}function Hf(e,{ignoreFieldNorm:t=ee.ignoreFieldNorm}){e.forEach(n=>{n.score=zs(n.matches,{ignoreFieldNorm:t})})}var Uf=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,i=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),i<n&&this.comparator(t[i],t[r])>0&&(r=i),r!==e){const a=t[e];t[e]=t[r],t[r]=a}}while(r!==e)}};function Wf(e){const t=[];return e.matches.forEach(n=>{if(!qe(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function Gf(e,t,{includeMatches:n=ee.includeMatches,includeScore:r=ee.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=Wf(s)),r&&(a.score=s.score),a})}const Kf=/[\p{L}\p{M}\p{N}_]+/gu,Hi=new WeakSet;function Vf(e){Hi.has(e)||(Hi.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 Jf(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||Vf(e),t=>t.match(e)||[]):t=>t.match(Kf)||[]}function Hs({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Jf(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=On(s)),r(s)}}}var Yf=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Hs({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new wo(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=r.get(i)||0,c=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(c)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),f=this.idfWeights[l];r+=f,d.isMatch&&(s++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<l:a.add(l)))}if(s===0)return{isMatch:!1,score:1};const c=r>0?1-n/r:0,u={isMatch:!0,score:Math.max(.001,c)};return this.options.includeMatches&&t.length&&(u.indices=yo(t)),this.combineAll&&(this.useMask?u.matchedMask=i:u.matchedTerms=a,u.termCount=this.numTerms),u}};function ps(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const c of i)a.set(c,(a.get(c)||0)+1),e.df.set(c,(e.df.get(c)||0)+1)}function Ec(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){ps(e,i,s,r);return}if(a)for(let c=0;c<n;c++){const u=a[c];if(u)if(Array.isArray(u))for(const l of u)ps(e,l.v,s,r);else ps(e,u.v,s,r)}}function Xf(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)Ec(r,s,t,n);return r}function Zf(e,t,n,r){Ec(e,t,n,r)}function Qf(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,i]of r){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Ui(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((c,u)=>c-u);for(const c of n)Qf(e,c);const r=c=>{let u=0,l=n.length;for(;u<l;){const d=u+l>>>1;n[d]<c?u=d+1:l=d}return c-u},s=n[0],i=new Map;for(const[c,u]of e.docFieldCount)i.set(c>s?r(c):c,u);e.docFieldCount=i;const a=new Map;for(const[c,u]of e.docTermFieldHits)a.set(c>s?r(c):c,u);e.docTermFieldHits=a}var Tt=class{constructor(e,t,n){this.options={...ee,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new wf(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=Tr(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 bo))throw new Error(hf);if(this._myIndex=t||jc(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Xf(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!qe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Hs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Zf(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Ui(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,i)=>!r.has(i)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(Ls);this._invertedIndex&&Ui(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:c}=this.options;if(Pe(e)&&!e.trim()){let p=this._docs.map((m,g)=>({item:m,refIndex:g}));return kr(n)&&n>-1&&(p=p.slice(0,n)),p}const u=i&&kr(n)&&n>0&&Pe(e),l=a,d=(p,m)=>l(p,m)||p.idx-m.idx;let f;if(u){const p=new Uf(n,d);Pe(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:c}),f=p.extractSorted()}else f=Pe(e)?Pe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Hf(f,{ignoreFieldNorm:c}),i&&f.sort(Pe(e)?d:l),kr(n)&&n>-1&&(f=f.slice(0,n));return Gf(f,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:c,i:u,n:l})=>{if(!qe(c))return;const d=r.searchIn(c);if(d.isMatch){const f={score:d.score,value:c,norm:l,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 m={item:c,idx:u,matches:p};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):a.push(m)}}}),a}_searchLogical(e){const t=Ac(e,this.options),n=this._normalizedKeys(),r=(c,u,l)=>{if(!("children"in c)){const{keyId:m,searcher:g}=c;let y;return m===null?(y=[],n.forEach((b,j)=>{y.push(...this._findMatches({key:b,value:u[j],searcher:g}))})):y=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:g}),y&&y.length?[{idx:l,item:u,matches:y}]:[]}const{children:d,operator:f}=c,p=[];for(let m=0,g=d.length;m<g;m+=1){const y=d[m],b=r(y,u,l);if(b.length)p.push(...b);else if(f===Cr.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:c,i:u})=>{if(qe(c)){const l=r(t,c,u);l.length&&(i.has(u)||(i.set(u,{idx:u,item:c,matches:[]}),a.push(i.get(u))),l.forEach(({matches:d})=>{i.get(u).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),c=t?null:[];return i.forEach(({$:u,i:l})=>{if(!qe(u))return;const d=[];let f=!1,p=!1;if(a.forEach((m,g)=>{const y=this._findMatches({key:m,value:u[g],searcher:r});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const m={idx:l,item:u,matches:d};t?(m.score=zs(m.matches,{ignoreFieldNorm:n}),t.insert(m)):c.push(m)}}),c}_findMatches({key:e,value:t,searcher:n}){if(!qe(t))return[];const r=[];if(Nt(t))t.forEach(({v:s,i,n:a})=>{if(!qe(s))return;const c=n.searchIn(s);if(c.isMatch){const u={score:c.score,key:e,value:s,idx:i,norm:a,indices:c.indices,hasInverse:c.hasInverse};c.termCount!==void 0&&(u.matchedMask=c.matchedMask,u.matchedTerms=c.matchedTerms,u.termCount=c.termCount),r.push(u)}});else{const{v:s,n:i}=t,a=n.searchIn(s);if(a.isMatch){const c={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(c.matchedMask=a.matchedMask,c.matchedTerms=a.matchedTerms,c.termCount=a.termCount),r.push(c)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const i of s)n.add(i)}return n.size===t}};Tt.version="7.5.0";Tt.createIndex=jc;Tt.parseIndex=Tf;Tt.config=ee;Tt.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(yf);return Tr(e,{...ee,...n}).searchIn(t)};Tt.parseQuery=Ac;ko(Bf);ko(Yf);Tt.use=function(...e){e.forEach(t=>ko(t))};var qf=Tt;function Nc(e,t,n={}){const[r,s]=x.useState(""),[i,a]=x.useState(""),c=n.debounceMs??150;x.useEffect(()=>{const f=setTimeout(()=>a(r),c);return()=>clearTimeout(f)},[r,c]);const u=x.useMemo(()=>t(e),[e,t]),l=x.useMemo(()=>new qf(u,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[u,n.threshold]),d=x.useMemo(()=>i.trim()?l.search(i.trim(),{limit:n.limit??20}).map(f=>f.item):[],[l,i,n.limit]);return{query:r,setQuery:s,results:d,searchIndex:u}}function ep(e,t={}){return Nc(e,uf,t)}const Us="search-match",Tc=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function tp(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let c=0;for(let u=a.indexOf(n);u!==-1;u=a.indexOf(n,c)){const l=document.createRange();l.setStart(i,u),l.setEnd(i,u+n.length),r.push(l),c=u+n.length}}return r}function np(e,t){if(!Tc())return;const n=tp(e,t);if(!n.length){CSS.highlights.delete(Us);return}CSS.highlights.set(Us,new Highlight(...n))}function hs(){Tc()&&CSS.highlights.delete(Us)}function Wi(e,t){const n=x.useRef(null);x.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:i}=e;let a=!1;const c=l=>{if(a)return;const d=document.getElementById(r);if(!d){l<40&&setTimeout(()=>c(l+1),50);return}if(n.current!==r){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}i&&u(0)},u=l=>{if(a)return;const d=document.getElementById(r);d&&np(d,s),l<6&&setTimeout(()=>u(l+1),100)};return setTimeout(()=>c(0),50),()=>{a=!0}},[e,...t])}function Cc({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s,initialLocation:i,onLocationChange:a,getTargetId:c}){var E;const u=((E=e[0])==null?void 0:E.id)??t,l=i&&(i.tab==="servers"||n(i.tab))?i.tab:null,[d,f]=x.useState(()=>l&&l!=="servers"?l:u),[p,m]=x.useState(()=>l),g=S=>{f(S),m(S)},[y,b]=x.useState(()=>{const S={};return l&&(i!=null&&i.key)&&(S[l]=i.key),S}),j=e.some(S=>S.id===d)?d:u,N={};for(const S of r)N[S.id]=S.visible?y[S.id]??null:null;const A=(S,M)=>b(W=>({...W,[S]:M})),[$,F]=x.useState(null),[G,T]=x.useState(null),[v,w]=x.useState(null),_=S=>{n(S.tab)?g(S.tab):S.tab==="servers"&&m("servers");const M={};for(const W of r)M[W.id]=W.id===S.tab?S.key:null;b(M),F(S.focusSection??null),T(S.tab==="schemas"&&S.schemaFocusTokens?{tokens:S.schemaFocusTokens,id:S.targetId}:null),S.tab==="schemas"&&hs(),w({targetId:S.targetId,query:s,highlight:S.tab!=="schemas"})},L=(S,M)=>{g(S),b(W=>{const Q={...W};for(const ne of r)ne.id!=="servers"&&(Q[ne.id]=ne.id===S?M:null);return Q})},U=S=>{m("servers");const M={};for(const W of r)M[W.id]=W.id==="servers"?S:null;b(M)},P=S=>{n(S)&&g(S)},X=x.useMemo(()=>{for(const S of r){const M=N[S.id];if(M)return{tab:S.id,key:M}}return null},[...r.map(S=>N[S.id])]);Wi(v,[j,$,G,...r.map(S=>N[S.id])]);const[ie]=x.useState(()=>l&&(i!=null&&i.key)&&c?{targetId:c(l,i.key),query:"",highlight:!1}:null);return Wi(ie,[j]),x.useEffect(()=>{a==null||a(X?{tab:X.tab,key:X.key}:{tab:j,key:null})},[j,X]),x.useEffect(()=>{s.trim()||(w(null),hs())},[s]),x.useEffect(()=>hs,[]),{effectiveTab:j,focusTab:g,navActiveSection:p??j,selected:N,setSelectedKey:A,selectedNavItem:X,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,focusSection:$,schemaFocusTarget:G}}const oe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ht=e=>oe(e)?e:null,Gi="^[\0-ÿ]*$",rp=Math.pow(-2,31),sp=Math.pow(2,31)-1,op=Math.pow(-2,63),ip=Math.pow(2,63)-1,ap={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"},vo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Mn(e){const t=vo(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ws(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=Mn(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Ki(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function cp(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function lp(e,t,n){if(!(t===void 0||n.examples||Array.isArray(e)))switch(e){case"boolean":n.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":n.examples=[parseInt(t,10)];break;default:n.examples=[t]}}function Gs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Ks(e,t,n){const{type:r,jsonSchema:s}=cp(e,n);lp(r,t.example,s);function i(...a){a.forEach(c=>{let u=!0;c==="minLength"||c==="maxLength"?u=t[c]>-1:c==="multipleOf"&&(u=t[c]>0),t[c]!==void 0&&u&&(s[c]=t[c])})}switch(r){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function jo(e,t,n){t!==void 0&&(e[t]=n)}function Rn(e,t){let n={};if(Array.isArray(e))return dp(n,e,t);const r=vo(e),s=typeof e=="string"?e:r.type;switch(n.type=ap[s],s){case"int":{n.minimum=rp,n.maximum=sp;break}case"long":{n.minimum=op,n.maximum=ip;break}case"bytes":{n.pattern=Gi;break}case"fixed":{n.pattern=Gi,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=Rn(r.values,t);break}case"array":{n.items=Rn(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=up(r,t,n);jo(t,Mn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Mn(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=Gs(r)?{...i}:i);break}}return Ws(r,n,t),Ks(s,r,n),n}function up(e,t,n){const r=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=Gs(s)?{...i}:i;Ki(s,n,s.default!==void 0),Gs(s)&&(Ws(s,a,t),Ks(s.type,s,a)),r.set(s.name,a)}else{const a=Rn(s.type,t);Ki(s,n,s.default!==void 0),Ws(s,a,t),Ks(s.type,s,a),r.set(s.name,a),jo(t,Mn(s.type),a)}}return r}function dp(e,t,n){const r=[];let s=null;for(const i of t){const a=Rn(i,n);(typeof i=="string"?i:vo(i).type)==="null"?s=a:(r.push(a),jo(n,Mn(i),a))}return s&&r.push(s),e.oneOf=r,e}function Vs(e){return Rn(e,{})}const Vi=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),fp=new Set(["record","enum","array","map","fixed"]),Ji=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function So(e){const t=[];return en(e,"schema",t,new Set),t}function en(e,t,n,r){if(typeof e=="string"){!Vi.has(e)&&!Ji.test(e)&&n.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&n.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>en(i,`${t}[${a}]`,n,r));return}if(!oe(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||oe(s)?en(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Vi.has(s)&&!fp.has(s)&&!Ji.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const c=`${t}.fields[${a}]`;if(!oe(i)||typeof i.name!="string"){n.push(`${c}: field must have a string "name"`);return}en(i.type,`${c}.type`,n,r)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):en(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):en(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let _r=null,ms=null;const Js=new Set;function pp(){return ms||(ms=Promise.resolve().then(()=>require("./protoToJsonSchema-C2GoWuZu.cjs")).then(e=>{_r=e.protoToJsonSchema,Js.forEach(t=>t())})),ms}function hp(){return _r||pp(),_r}function mp(e){return Js.add(e),()=>Js.delete(e)}function Yi(){return _r!==null}function Ur(){return x.useSyncExternalStore(mp,Yi,Yi)}const gp="x-parser-original-payload",$r="x-lib-conversion-error",xp=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,bp=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Dn(e){return typeof e=="string"&&xp.test(e)}function Bn(e){return typeof e=="string"&&bp.test(e)}function _c(e){return oe(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function $c(e){var t,n;if(typeof e!="string")return null;if(Dn(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Bn(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function Ic(e){return Dn(e)?"Avro":Bn(e)?"Protobuf":null}function yp(e,t){return t?!1:!e||Dn(e)||Bn(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const wp=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],kp=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function vp(e){return typeof e=="string"||Array.isArray(e)?!0:oe(e)?typeof e.type=="string"&&kp.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!wp.some(t=>t in e):!1}function ln(e,t){let n=e;if(t&&oe(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=jp(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=_c(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function jp(e){var a;if(!_c(e))return{schema:ht(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[gp],s=(a=ht(n))==null?void 0:a[$r];if(typeof s=="string")return{schema:ht(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:r};if(Dn(t)&&vp(n)){const c=So(n);if(c.length>0)return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:c[0]};try{return{schema:Vs(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:ht(n)??{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Avro schema"}}}if(Bn(t)&&typeof n=="string"){const c=hp();if(!c)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:c(n),schemaFormat:t,originalSchema:n}}catch(u){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:u instanceof Error?u.message:"Failed to convert Protobuf schema"}}}const i=ht(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const Se=(e,t)=>`${"#".repeat(e)} ${t}`,D=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),Qt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Sp={objects:new Set,refs:new Set},Wr=(e,t)=>({schemas:e??{},nameOf:xo(e,t),referenced:new Set}),Ap=e=>`#/components/schemas/${e.replace(/~/g,"~0").replace(/\//g,"~1")}`;function jr(e,t,n,r=Sp,s=!0){if(e===null||typeof e!="object")return e;if(n&&!s){const c=Qt(e)&&typeof e.$ref=="string"?e.$ref:void 0,u=c!==void 0?(t==null?void 0:t(c))??e:e,l=n.nameOf(u);if(l!==void 0)return n.referenced.add(l),{$ref:Ap(l)};const d=c!==void 0?af(c):void 0;if(d!==void 0&&Object.prototype.hasOwnProperty.call(n.schemas,d))return n.referenced.add(d),{$ref:c}}if(r.objects.has(e)||Qt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const c=Qt(e)?e["x-parser-schema-id"]:void 0;return typeof c=="string"?{$ref:`#/components/schemas/${c} (circular)`}:"[circular reference]"}const i={objects:new Set(r.objects).add(e),refs:Qt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(c=>jr(c,t,n,i,!1));if(Qt(e)&&typeof e.$ref=="string"){const c=t==null?void 0:t(e.$ref);return Qt(c)||Array.isArray(c)?jr(c,t,n,i,s):{$ref:e.$ref}}const a={};for(const[c,u]of Object.entries(e))a[c]=jr(u,t,n,i,!1);return a}function Ir(e,t,n,r){if(!t)return"";const s=jr(t,n,r);return`${Se(4,`\`${D(e)}\``)}
7
+
8
+ \`\`\`json
9
+ ${JSON.stringify(s,null,2)}
10
+ \`\`\``}function rn(e,t,n,r){if(!t||typeof t=="boolean")return"";const{schema:s,description:i,conversionError:a,pendingConversion:c}=ln(t,n);if(c)return`${Se(4,`\`${D(e)}\``)}
11
+
12
+ _(schema conversion still in progress)_`;if(a)return`${Se(4,`\`${D(e)}\``)}
13
+
14
+ _(could not convert schema: ${D(a)})_`;const u=i&&!s.description?{...s,description:i}:s;return Ir(e,u,n,r)}function Oc(e,t){const n=[],r=new Set;for(const s of e.referenced)r.has(s)||(r.add(s),n.push(rn(s,e.schemas[s],t,e)));return n.length?[Se(2,"Referenced Schemas"),...n].join(`
15
+
16
+ `):""}function Mc(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${D(e.in)}${e.name?`: \`${D(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${D(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 D(e.type)}}function Ep(e){if(!(e!=null&&e.length))return"";const t=[];for(const n of e)if(n!=null&&n.type&&(t.push(`- **${Mc(n)}**`),n.description&&t.push(` ${D(n.description)}`),n.type==="openIdConnect"&&n.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${D(n.openIdConnectUrl)}\``),n.type==="oauth2"))for(const[r,s]of Object.entries(n.flows??{})){t.push(` - Flow \`${D(r)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${D(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${D(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${D(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${D(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
17
+ `)].join(`
18
+
19
+ `):""}function Rc(e){const t=[],{info:n}=e;t.push(Se(1,D(n.title)));const r=[`**Version:** ${D(n.version)}`];if(n.license&&r.push(`**License:** ${D(n.license.name)}${n.license.url?` (${D(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(D).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
20
+ `)),n.description&&t.push(D(n.description)),e.servers&&Object.keys(e.servers).length){const s=[Se(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(Se(3,D(i)));const c=[`**Host:** \`${D(a.host)}${a.pathname?D(a.pathname):""}\``];c.push(`**Protocol:** ${D(a.protocol)}${a.protocolVersion?` ${D(a.protocolVersion)}`:""}`),a.description&&c.push(D(a.description)),s.push(c.join(`
21
+ `));const u=Ep(a.security);u&&s.push(u)}t.push(s.join(`
22
+
23
+ `))}return t}function Ao(e,t=Bt(e)){var a,c,u,l;const n=Rc(e),r=Wr((a=e.components)==null?void 0:a.schemas,t);if(e.operations&&Object.keys(e.operations).length){const d=[Se(2,"Operations")];for(const[f,p]of Object.entries(e.operations)){const m=p.channel;d.push(Se(3,`${D((c=p.action)==null?void 0:c.toUpperCase())} \`${D(f)}\``));const g=[];m!=null&&m.address&&g.push(`**Channel:** \`${D(m.address)}\``),p.summary&&g.push(D(p.summary)),p.description&&g.push(D(p.description));const y=p.messages??[];y.length&&g.push(`**Messages:** ${y.map(b=>`\`${D(b.name??b.title??"message")}\``).join(", ")}`),d.push(g.join(`
24
+
25
+ `))}n.push(d.join(`
26
+
27
+ `))}const s=(u=e.components)==null?void 0:u.messages;if(s&&Object.keys(s).length){const d=[Se(2,"Messages")];for(const[f,p]of Object.entries(s)){d.push(Se(3,D(p.title??p.name??f)));const m=[];p.summary&&m.push(D(p.summary)),p.description&&m.push(D(p.description)),p.contentType&&m.push(`**Content-Type:** \`${D(p.contentType)}\``),d.push(m.join(`
28
+
29
+ `)),p.payload&&d.push(rn("payload",p.payload,t,r)),p.headers&&d.push(rn("headers",p.headers,t,r))}n.push(d.join(`
30
+
31
+ `))}const i=(l=e.components)==null?void 0:l.schemas;if(i&&Object.keys(i).length){const d=[Se(2,"Schemas")];for(const[f,p]of Object.entries(i))d.push(rn(f,p,t,r));n.push(d.join(`
32
+
33
+ `))}return n.filter(Boolean).join(`
34
+
35
+ `)}function Np(e,t,n,r){var u;const s=t.channel,i=[Se(3,`${D((u=t.action)==null?void 0:u.toUpperCase())} \`${D(e)}\``)],a=[];s!=null&&s.address&&a.push(`**Channel:** \`${D(s.address)}\``),t.summary&&a.push(D(t.summary)),t.description&&a.push(D(t.description)),i.push(a.join(`
36
+
37
+ `));const c=t.messages??[];for(const l of c){const d=[Se(4,D(l.title??l.name??"Message"))],f=[];l.summary&&f.push(D(l.summary)),l.description&&f.push(D(l.description)),l.contentType&&f.push(`**Content-Type:** \`${D(l.contentType)}\``),f.length&&d.push(f.join(`
38
+
39
+ `)),i.push(d.join(`
40
+
41
+ `)),l.payload&&i.push(rn("payload",l.payload,n,r)),l.headers&&i.push(rn("headers",l.headers,n,r))}return i.filter(Boolean).join(`
42
+
43
+ `)}function Lc(e,t,n=Bt(e)){var a,c;const r=(a=e.operations)==null?void 0:a[t];if(!r)return"";const s=Rc(e),i=Wr((c=e.components)==null?void 0:c.schemas,n);return s.push(Np(t,r,n,i)),s.push(Oc(i,n)),s.filter(Boolean).join(`
44
+
45
+ `)}function Tp(e,t){if(!e.length||!t)return"";const n=new Map;for(const i of e)for(const[a,c]of Object.entries(i)){if(!c.length)continue;const u=n.get(a)??[];n.set(a,Array.from(new Set([...u,...c])))}const r=Array.from(new Set(e.flatMap(i=>Object.keys(i)))),s=[];for(const i of r){const a=t[i];if(!a)continue;const c=n.get(i);if(s.push(`- **${Mc(a)}** (\`${D(i)}\`)`),a.description&&s.push(` ${D(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${D(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[u,l]of Object.entries(a.flows??{})){s.push(` - Flow \`${D(u)}\`:`),l.authorizationUrl&&s.push(` - Authorization URL: \`${D(l.authorizationUrl)}\``),l.tokenUrl&&s.push(` - Token URL: \`${D(l.tokenUrl)}\``),l.refreshUrl&&s.push(` - Refresh URL: \`${D(l.refreshUrl)}\``);const d=c!=null&&c.length?c:Object.keys(l.scopes??{});d.length&&s.push(` - ${c!=null&&c.length?"Required scopes":"Scopes"}: ${d.map(f=>`\`${D(f)}\``).join(", ")}`)}else c!=null&&c.length&&s.push(` - Required scopes: ${c.map(u=>`\`${D(u)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
46
+ `)].join(`
47
+
48
+ `):""}function Pc(e,t,n,r,s,i,a){var m;const c=[Se(3,`${e.toUpperCase()} \`${D(t)}\``)],u=[];n.summary&&u.push(D(n.summary)),n.description&&u.push(D(n.description)),n.deprecated&&u.push("**Deprecated**");const l=n.security??a??[],d=Tp(l,i);d&&u.push(d);for(const g of["path","query","header","cookie"]){const y=(n.parameters??[]).filter(b=>b.in===g);if(y.length){u.push(`**${g[0].toUpperCase()}${g.slice(1)} Parameters:**`);for(const b of y){const j=b.schema;u.push(`- \`${D(b.name)}\`${b.required?" (required)":""}${j!=null&&j.type?` — ${D(j.type)}`:""}${b.description?`: ${D(b.description)}`:""}`)}}}c.push(u.join(`
49
+
50
+ `));const f=((m=n.requestBody)==null?void 0:m.content)??{};for(const[g,y]of Object.entries(f))c.push([`**Request Body** (\`${D(g)}\`)`,Ir("body",y.schema,r,s)].join(`
51
+
52
+ `));const p=n.responses??{};for(const[g,y]of Object.entries(p)){const b=[Se(4,`${g}${y.description?`: ${D(y.description)}`:""}`)];for(const[j,N]of Object.entries(y.content??{}))b.push([`**Body** (\`${D(j)}\`)`,Ir("body",N.schema,r,s)].join(`
53
+
54
+ `));c.push(b.join(`
55
+
56
+ `))}return c.join(`
57
+
58
+ `)}function Eo(e,t=Bt(e)){var c,u,l,d,f,p;const n=[],{info:r}=e;if(n.push(Se(1,D(r.title))),n.push(`**Version:** ${D(r.version)}`),r.description&&n.push(D(r.description)),(c=e.servers)!=null&&c.length){const m=[Se(2,"Servers")];for(const g of e.servers)m.push(`- \`${D(g.url)}\`${g.description?` — ${D(g.description)}`:""}`);n.push(m.join(`
59
+ `))}const s=Wr((u=e.components)==null?void 0:u.schemas,t),i=e.paths?cn(e.paths):[];if(i.length){const m=[Se(2,"Endpoints")];for(const{method:g,path:y}of i){const b=(d=(l=e.paths)==null?void 0:l[y])==null?void 0:d[g];b&&m.push(Pc(g,y,b,t,s,(f=e.components)==null?void 0:f.securitySchemes,e.security))}n.push(m.join(`
60
+
61
+ `))}const a=(p=e.components)==null?void 0:p.schemas;if(a&&Object.keys(a).length){const m=[Se(2,"Schemas")];for(const[g,y]of Object.entries(a))m.push(Ir(g,y,t,s));n.push(m.join(`
62
+
63
+ `))}return n.filter(Boolean).join(`
64
+
65
+ `)}function Dc(e,t,n,r=Bt(e)){var u,l,d,f,p;const s=(l=(u=e.paths)==null?void 0:u[n])==null?void 0:l[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(Se(1,D(a.title))),i.push(`**Version:** ${D(a.version)}`),a.description&&i.push(D(a.description)),(d=e.servers)!=null&&d.length){const m=[Se(2,"Servers")];for(const g of e.servers)m.push(`- \`${D(g.url)}\`${g.description?` — ${D(g.description)}`:""}`);i.push(m.join(`
66
+ `))}const c=Wr((f=e.components)==null?void 0:f.schemas,r);return i.push(Pc(t,n,s,r,c,(p=e.components)==null?void 0:p.securitySchemes,e.security)),i.push(Oc(c,r)),i.filter(Boolean).join(`
67
+
68
+ `)}function Gr({label:e,children:t}){return o.jsx(Ft,{fallback:null,onError:n=>console.error(`[apiuikit] plugin error in slot "${e}":`,n),children:o.jsx(x.Suspense,{fallback:null,children:t})})}function Bc(){const{plugins:e,pluginSlotRegistry:t}=it();return x.useMemo(()=>t??ec(e??[]),[t,e])}function Fc(e){return Bc().get(e)??[]}function Fn({name:e,context:t}){const n=Fc(e);return n.length===0?null:o.jsx(o.Fragment,{children:n.map(({id:r,pluginName:s,Component:i})=>o.jsx(Gr,{label:`${e}:${s} (${r})`,children:o.jsx(i,{...t})},r))})}function zc(e){return Bc().get(e)??[]}const Cp=/^(https?:|data:image\/)/i;function No(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:n,altText:r,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof n!="string"||!Cp.test(n)?null:{url:n,altText:typeof r=="string"&&r?r:void 0,backgroundColor:typeof s=="string"?s:void 0}}const Hc={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},_p=()=>Promise.resolve().then(()=>require("./LogoExtension-D0VY8gpU.cjs"));function To(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ut=To();function Uc(e){Ut=e}var $n={exec:()=>null};function pe(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(ze.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,t)};return r}var ze={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")},$p=/^(?:[ \t]*(?:\n|$))+/,Ip=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Op=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Co=/(?:[*+-]|\d{1,9}[.)])/,Wc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gc=pe(Wc).replace(/bull/g,Co).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(),Rp=pe(Wc).replace(/bull/g,Co).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(),_o=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lp=/^[^\n]+/,$o=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$o).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Dp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Co).getRegex(),Kr="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",Io=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bp=pe("^ {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",Io).replace("tag",Kr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kc=pe(_o).replace("hr",zn).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",Kr).getRegex(),Fp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kc).getRegex(),Oo={blockquote:Fp,code:Ip,def:Pp,fences:Op,heading:Mp,hr:zn,html:Bp,lheading:Gc,list:Dp,newline:$p,paragraph:Kc,table:$n,text:Lp},Xi=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zn).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",Kr).getRegex(),zp={...Oo,lheading:Rp,table:Xi,paragraph:pe(_o).replace("hr",zn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xi).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",Kr).getRegex()},Hp={...Oo,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Io).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:$n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(_o).replace("hr",zn).replace("heading",` *#{1,6} *[^
69
+ ]`).replace("lheading",Gc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Up=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vc=/^( {2,}|\\)\n(?!\s*$)/,Gp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vr=/[\p{P}\p{S}]/u,Mo=/[\s\p{P}\p{S}]/u,Jc=/[^\s\p{P}\p{S}]/u,Kp=pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Mo).getRegex(),Yc=/(?!~)[\p{P}\p{S}]/u,Vp=/(?!~)[\s\p{P}\p{S}]/u,Jp=/(?:[^\s\p{P}\p{S}]|~)/u,Yp=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Xc=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Xp=pe(Xc,"u").replace(/punct/g,Vr).getRegex(),Zp=pe(Xc,"u").replace(/punct/g,Yc).getRegex(),Zc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qp=pe(Zc,"gu").replace(/notPunctSpace/g,Jc).replace(/punctSpace/g,Mo).replace(/punct/g,Vr).getRegex(),qp=pe(Zc,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,Vp).replace(/punct/g,Yc).getRegex(),eh=pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jc).replace(/punctSpace/g,Mo).replace(/punct/g,Vr).getRegex(),th=pe(/\\(punct)/,"gu").replace(/punct/g,Vr).getRegex(),nh=pe(/^<(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(),rh=pe(Io).replace("(?:-->|$)","-->").getRegex(),sh=pe("^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",rh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Or=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oh=pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Or).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qc=pe(/^!?\[(label)\]\[(ref)\]/).replace("label",Or).replace("ref",$o).getRegex(),qc=pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",$o).getRegex(),ih=pe("reflink|nolink(?!\\()","g").replace("reflink",Qc).replace("nolink",qc).getRegex(),Ro={_backpedal:$n,anyPunctuation:th,autolink:nh,blockSkip:Yp,br:Vc,code:Wp,del:$n,emStrongLDelim:Xp,emStrongRDelimAst:Qp,emStrongRDelimUnd:eh,escape:Up,link:oh,nolink:qc,punctuation:Kp,reflink:Qc,reflinkSearch:ih,tag:sh,text:Gp,url:$n},ah={...Ro,link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",Or).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Or).getRegex()},Ys={...Ro,emStrongRDelimAst:qp,emStrongLDelim:Zp,url:pe(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ch={...Ys,br:pe(Vc).replace("{2,}","*").getRegex(),text:pe(Ys.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lr={normal:Oo,gfm:zp,pedantic:Hp},jn={normal:Ro,gfm:Ys,breaks:ch,pedantic:ah},lh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zi=e=>lh[e];function dt(e,t){if(t){if(ze.escapeTest.test(e))return e.replace(ze.escapeReplace,Zi)}else if(ze.escapeTestNoEncode.test(e))return e.replace(ze.escapeReplaceNoEncode,Zi);return e}function Qi(e){try{e=encodeURI(e).replace(ze.percentDecode,"%")}catch{return null}return e}function qi(e,t){var i;const n=e.replace(ze.findPipe,(a,c,u)=>{let l=!1,d=c;for(;--d>=0&&u[d]==="\\";)l=!l;return l?"|":" |"}),r=n.split(ze.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(ze.slashPipe,"|");return r}function Sn(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function uh(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ea(e,t,n,r,s){const i=t.href,a=t.title||null,c=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,u}function dh(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
70
+ `).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[c]=a;return c.length>=s.length?i.slice(s.length):i}).join(`
71
+ `)}var Mr=class{constructor(e){ge(this,"options");ge(this,"rules");ge(this,"lexer");this.options=e||Ut}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Sn(n,`
72
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=dh(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Sn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Sn(t[0],`
73
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Sn(t[0],`
74
+ `).split(`
75
+ `),r="",s="";const i=[];for(;n.length>0;){let a=!1;const c=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))c.push(n[u]),a=!0;else if(!a)c.push(n[u]);else break;n=n.slice(u);const l=c.join(`
76
+ `),d=l.replace(this.rules.other.blockquoteSetextReplace,`
77
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
78
+ ${l}`:l,s=s?`${s}
79
+ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const m=p,g=m.raw+`
80
+ `+n.join(`
81
+ `),y=this.blockquote(g);i[i.length-1]=y,r=r.substring(0,r.length-m.raw.length)+y.raw,s=s.substring(0,s.length-m.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){const m=p,g=m.raw+`
82
+ `+n.join(`
83
+ `),y=this.list(g);i[i.length-1]=y,r=r.substring(0,r.length-p.raw.length)+y.raw,s=s.substring(0,s.length-m.raw.length)+y.raw,n=g.substring(i.at(-1).raw.length).split(`
84
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let u=!1,l="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let f=t[2].split(`
85
+ `,1)[0].replace(this.rules.other.listReplaceTabs,j=>" ".repeat(3*j.length)),p=e.split(`
86
+ `,1)[0],m=!f.trim(),g=0;if(this.options.pedantic?(g=2,d=f.trimStart()):m?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=f.slice(g),g+=t[1].length),m&&this.rules.other.blankLine.test(p)&&(l+=p+`
87
+ `,e=e.substring(p.length+1),u=!0),!u){const j=this.rules.other.nextBulletRegex(g),N=this.rules.other.hrRegex(g),A=this.rules.other.fencesBeginRegex(g),$=this.rules.other.headingBeginRegex(g),F=this.rules.other.htmlBeginRegex(g);for(;e;){const G=e.split(`
88
+ `,1)[0];let T;if(p=G,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),T=p):T=p.replace(this.rules.other.tabCharGlobal," "),A.test(p)||$.test(p)||F.test(p)||j.test(p)||N.test(p))break;if(T.search(this.rules.other.nonSpaceChar)>=g||!p.trim())d+=`
89
+ `+T.slice(g);else{if(m||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(f)||$.test(f)||N.test(f))break;d+=`
90
+ `+p}!m&&!p.trim()&&(m=!0),l+=G+`
91
+ `,e=e.substring(G.length+1),f=T.slice(g)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(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:l,task:!!y,checked:b,loose:!1,text:d,tokens:[]}),s.raw+=l}const c=s.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u=0;u<s.items.length;u++)if(this.lexer.state.top=!1,s.items[u].tokens=this.lexer.blockTokens(s.items[u].text,[]),!s.loose){const l=s.items[u].tokens.filter(f=>f.type==="space"),d=l.length>0&&l.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let u=0;u<s.items.length;u++)s.items[u].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 n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=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:n,raw:t[0],href:r,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 n=qi(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const c of r)this.rules.other.tableAlignRight.test(c)?i.align.push("right"):this.rules.other.tableAlignCenter.test(c)?i.align.push("center"):this.rules.other.tableAlignLeft.test(c)?i.align.push("left"):i.align.push(null);for(let c=0;c<n.length;c++)i.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:i.align[c]});for(const c of s)i.rows.push(qi(c,i.header.length).map((u,l)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[l]})));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 n=t[1].charAt(t[1].length-1)===`
93
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}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 n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Sn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=uh(t[2],"()");if(i===-2)return;if(i>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),ea(t,{href:r&&r.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 n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return ea(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...r[0]].length-1;let a,c,u=i,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(c=[...a].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&i%3&&!((i+c)%3)){l+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+l);const f=[...r[0]][0].length,p=e.slice(0,i+r.index+f+c);if(Math.min(i,c)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}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 n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},xt=class Xs{constructor(t){ge(this,"tokens");ge(this,"options");ge(this,"state");ge(this,"tokenizer");ge(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ut,this.options.tokenizer=this.options.tokenizer||new Mr,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 n={other:ze,block:lr.normal,inline:jn.normal};this.options.pedantic?(n.block=lr.pedantic,n.inline=jn.pedantic):this.options.gfm&&(n.block=lr.gfm,this.options.breaks?n.inline=jn.breaks:n.inline=jn.gfm),this.tokenizer.rules=n}static get rules(){return{block:lr,inline:jn}}static lex(t,n){return new Xs(n).lex(t)}static lexInline(t,n){return new Xs(n).inlineTokens(t)}lex(t){t=t.replace(ze.carriageReturn,`
94
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,i,a;for(this.options.pedantic&&(t=t.replace(ze.tabCharGlobal," ").replace(ze.spaceLine,""));t;){let c;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(l=>(c=l.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);const l=n.at(-1);c.raw.length===1&&l!==void 0?l.raw+=`
95
+ `:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
96
+ `+c.raw,l.text+=`
97
+ `+c.text,this.inlineQueue.at(-1).src=l.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
98
+ `+c.raw,l.text+=`
99
+ `+c.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let u=t;if((a=this.options.extensions)!=null&&a.startBlock){let l=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(u=t.substring(0,l+1))}if(this.state.top&&(c=this.tokenizer.paragraph(u))){const l=n.at(-1);r&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=`
100
+ `+c.raw,l.text+=`
101
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(c),r=u.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);const l=n.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=`
102
+ `+c.raw,l.text+=`
103
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(c);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var c,u,l;let r=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(r))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((u=(c=this.options.extensions)==null?void 0:c.inline)!=null&&u.some(p=>(d=p.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const p=n.at(-1);d.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,a)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((l=this.options.extensions)!=null&&l.startInline){let p=1/0;const m=t.slice(1);let g;this.options.extensions.startInline.forEach(y=>{g=y.call({lexer:this},m),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),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=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):n.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 n}},Rr=class{constructor(e){ge(this,"options");ge(this,"parser");this.options=e||Ut}space(e){return""}code({text:e,lang:t,escaped:n}){var i;const r=(i=(t||"").match(ze.notSpaceStart))==null?void 0:i[0],s=e.replace(ze.endingNewline,"")+`
104
+ `;return r?'<pre><code class="language-'+dt(r)+'">'+(n?s:dt(s,!0))+`</code></pre>
105
+ `:"<pre><code>"+(n?s:dt(s,!0))+`</code></pre>
106
+ `}blockquote({tokens:e}){return`<blockquote>
107
+ ${this.parser.parse(e)}</blockquote>
108
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
109
+ `}hr(e){return`<hr>
110
+ `}list(e){const t=e.ordered,n=e.start;let r="";for(let a=0;a<e.items.length;a++){const c=e.items[a];r+=this.listitem(c)}const s=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
111
+ `+r+"</"+s+`>
112
+ `}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+dt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
113
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
114
+ `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const i=e.rows[s];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
115
+ <thead>
116
+ `+t+`</thead>
117
+ `+r+`</table>
118
+ `}tablerow({text:e}){return`<tr>
119
+ ${e}</tr>
120
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
121
+ `}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>${dt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=Qi(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+dt(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=Qi(e);if(s===null)return dt(n);e=s;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${dt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:dt(e.text)}},Lo=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""}},bt=class Zs{constructor(t){ge(this,"options");ge(this,"renderer");ge(this,"textRenderer");this.options=t||Ut,this.options.renderer=this.options.renderer||new Rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Lo}static parse(t,n){return new Zs(n).parse(t)}static parseInline(t,n){return new Zs(n).parseInline(t)}parse(t,n=!0){var s,i;let r="";for(let a=0;a<t.length;a++){const c=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){const l=c,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=d||"";continue}}const u=c;switch(u.type){case"space":{r+=this.renderer.space(u);continue}case"hr":{r+=this.renderer.hr(u);continue}case"heading":{r+=this.renderer.heading(u);continue}case"code":{r+=this.renderer.code(u);continue}case"table":{r+=this.renderer.table(u);continue}case"blockquote":{r+=this.renderer.blockquote(u);continue}case"list":{r+=this.renderer.list(u);continue}case"html":{r+=this.renderer.html(u);continue}case"paragraph":{r+=this.renderer.paragraph(u);continue}case"text":{let l=u,d=this.renderer.text(l);for(;a+1<t.length&&t[a+1].type==="text";)l=t[++a],d+=`
122
+ `+this.renderer.text(l);n?r+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):r+=d;continue}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,n=this.renderer){var s,i;let r="";for(let a=0;a<t.length;a++){const c=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[c.type]){const l=this.options.extensions.renderers[c.type].call({parser:this},c);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=l||"";continue}}const u=c;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},$s,Sr=($s=class{constructor(e){ge(this,"options");ge(this,"block");this.options=e||Ut}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?xt.lex:xt.lexInline}provideParser(){return this.block?bt.parse:bt.parseInline}},ge($s,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),$s),el=class{constructor(...e){ge(this,"defaults",To());ge(this,"options",this.setOptions);ge(this,"parse",this.parseMarkdown(!0));ge(this,"parseInline",this.parseMarkdown(!1));ge(this,"Parser",bt);ge(this,"Renderer",Rr);ge(this,"TextRenderer",Lo);ge(this,"Lexer",xt);ge(this,"Tokenizer",Mr);ge(this,"Hooks",Sr);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const c of a.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const u=a[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.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 c=s.renderer.apply(this,a);return c===!1&&(c=i.apply(this,a)),c}: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)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Rr(this.defaults);for(const i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,c=n.renderer[a],u=s[a];s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Mr(this.defaults);for(const i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,c=n.tokenizer[a],u=s[a];s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new Sr;for(const i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,c=n.hooks[a],u=s[a];Sr.passThroughHooks.has(i)?s[a]=l=>{if(this.defaults.async)return Promise.resolve(c.call(s,l)).then(f=>u.call(s,f));const d=c.call(s,l);return u.call(s,d)}:s[a]=(...l)=>{let d=c.apply(s,l);return d===!1&&(d=u.apply(s,l)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let c=[];return c.push(i.call(this,a)),s&&(c=c.concat(s.call(this,a))),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return xt.lex(e,t??this.defaults)}parser(e,t){return bt.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},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 n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const c=i.hooks?i.hooks.provideLexer():e?xt.lex:xt.lexInline,u=i.hooks?i.hooks.provideParser():e?bt.parse:bt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(l=>c(l,i)).then(l=>i.hooks?i.hooks.processAllTokens(l):l).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>u(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let l=c(n,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let d=u(l,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(e,t){return n=>{if(n.message+=`
123
+ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+dt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Lt=new el;function xe(e,t){return Lt.parse(e,t)}xe.options=xe.setOptions=function(e){return Lt.setOptions(e),xe.defaults=Lt.defaults,Uc(xe.defaults),xe};xe.getDefaults=To;xe.defaults=Ut;xe.use=function(...e){return Lt.use(...e),xe.defaults=Lt.defaults,Uc(xe.defaults),xe};xe.walkTokens=function(e,t){return Lt.walkTokens(e,t)};xe.parseInline=Lt.parseInline;xe.Parser=bt;xe.parser=bt.parse;xe.Renderer=Rr;xe.TextRenderer=Lo;xe.Lexer=xt;xe.lexer=xt.lex;xe.Tokenizer=Mr;xe.Hooks=Sr;xe.parse=xe;xe.options;xe.setOptions;xe.use;xe.walkTokens;xe.parseInline;bt.parse;xt.lex;function fh(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 n=ta(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(na(t));const r=e.highlight(t.text,n,t.lang||"");if(r 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.");na(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=ta(n),i=s?e.langPrefix+sa(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${r?t:sa(t,!0)}
124
+ </code></pre>`}}}}function ta(e){return(e||"").match(/\S*/)[0]}function na(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const tl=/[&<>"']/,ph=new RegExp(tl.source,"g"),nl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,hh=new RegExp(nl.source,"g"),mh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ra=e=>mh[e];function sa(e,t){if(t){if(tl.test(e))return e.replace(ph,ra)}else if(nl.test(e))return e.replace(hh,ra);return e}var gh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xh(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}function sl(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 n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&sl(n)}),e}class oa{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ol(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const bh="</span>",ia=e=>!!e.scope,yh=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class wh{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=ol(t)}openNode(t){if(!ia(t))return;const n=yh(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){ia(t)&&(this.buffer+=bh)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const aa=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Po{constructor(){this.rootNode=aa(),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 n=aa({scope:t});this.add(n),this.stack.push(n)}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,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Po._collapse(n)}))}}class kh extends Po{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new wh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ln(e){return e?typeof e=="string"?e:e.source:null}function il(e){return Wt("(?=",e,")")}function vh(e){return Wt("(?:",e,")*")}function jh(e){return Wt("(?:",e,")?")}function Wt(...e){return e.map(n=>Ln(n)).join("")}function Sh(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Jr(...e){return"("+(Sh(e).capture?"":"?:")+e.map(r=>Ln(r)).join("|")+")"}function al(e){return new RegExp(e.toString()+"|").exec("").length-1}function Ah(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Eh=new RegExp(Jr(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Do(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Ln(r),a="";for(;i.length>0;){const c=Eh.exec(i);if(!c){a+=i;break}a+=i.substring(0,c.index),i=i.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?a+="\\"+String(Number(c[1])+s):(a+=c[0],(c[0]==="("||/^\(\?[<']/.test(c[0]))&&n++)}return a}).map(r=>`(${r})`).join(t)}const Nh=/\b\B/,cl="[a-zA-Z]\\w*",Bo="[a-zA-Z_]\\w*",ll="\\b\\d+(\\.\\d+)?",ul="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",dl="\\b(0b[01]+)",Th="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ch=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Wt(t,/.*\b/,e.binary,/\b.*/)),At({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Pn={begin:"\\\\[\\s\\S]",relevance:0},_h={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pn]},$h={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pn]},Ih={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/},Yr=function(e,t,n={}){const r=At({scope:"comment",begin:e,end:t,contains:[]},n);r.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=Jr("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 r.contains.push({begin:Wt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Oh=Yr("//","$"),Mh=Yr("/\\*","\\*/"),Rh=Yr("#","$"),Lh={scope:"number",begin:ll,relevance:0},Ph={scope:"number",begin:ul,relevance:0},Dh={scope:"number",begin:dl,relevance:0},Bh={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pn,{begin:/\[/,end:/\]/,relevance:0,contains:[Pn]}]},Fh={scope:"title",begin:cl,relevance:0},zh={scope:"title",begin:Bo,relevance:0},Hh={begin:"\\.\\s*"+Bo,relevance:0},Uh=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ur=Object.freeze({__proto__:null,APOS_STRING_MODE:_h,BACKSLASH_ESCAPE:Pn,BINARY_NUMBER_MODE:Dh,BINARY_NUMBER_RE:dl,COMMENT:Yr,C_BLOCK_COMMENT_MODE:Mh,C_LINE_COMMENT_MODE:Oh,C_NUMBER_MODE:Ph,C_NUMBER_RE:ul,END_SAME_AS_BEGIN:Uh,HASH_COMMENT_MODE:Rh,IDENT_RE:cl,MATCH_NOTHING_RE:Nh,METHOD_GUARD:Hh,NUMBER_MODE:Lh,NUMBER_RE:ll,PHRASAL_WORDS_MODE:Ih,QUOTE_STRING_MODE:$h,REGEXP_MODE:Bh,RE_STARTERS_RE:Th,SHEBANG:Ch,TITLE_MODE:Fh,UNDERSCORE_IDENT_RE:Bo,UNDERSCORE_TITLE_MODE:zh});function Wh(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Gh(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Kh(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Wh,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Vh(e,t){Array.isArray(e.illegal)&&(e.illegal=Jr(...e.illegal))}function Jh(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 Yh(e,t){e.relevance===void 0&&(e.relevance=1)}const Xh=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Wt(n.beforeMatch,il(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Zh=["of","and","for","in","not","or","if","then","parent","list","value"],Qh="keyword";function fl(e,t,n=Qh){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,fl(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(c=>c.toLowerCase())),a.forEach(function(c){const u=c.split("|");r[u[0]]=[i,qh(u[0],u[1])]})}}function qh(e,t){return t?Number(t):em(e)?0:1}function em(e){return Zh.includes(e.toLowerCase())}const ca={},Mt=e=>{console.error(e)},la=(e,...t)=>{console.log(`WARN: ${e}`,...t)},qt=(e,t)=>{ca[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ca[`${e}/${t}`]=!0)},Lr=new Error;function pl(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let c=1;c<=t.length;c++)a[c+r]=s[c],i[c+r]=!0,r+=al(t[c-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function tm(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Mt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Lr;if(typeof e.beginScope!="object"||e.beginScope===null)throw Mt("beginScope must be object"),Lr;pl(e,e.begin,{key:"beginScope"}),e.begin=Do(e.begin,{joinWith:""})}}function nm(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Mt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Lr;if(typeof e.endScope!="object"||e.endScope===null)throw Mt("endScope must be object"),Lr;pl(e,e.end,{key:"endScope"}),e.end=Do(e.end,{joinWith:""})}}function rm(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function sm(e){rm(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),tm(e),nm(e)}function om(e){function t(a,c){return new RegExp(Ln(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=al(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=t(Do(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const l=u.findIndex((f,p)=>p>0&&f!==void 0),d=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new n;return this.rules.slice(c).forEach(([l,d])=>u.addRule(l,d)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(c);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(c)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function s(a){const c=new r;return a.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),a.terminatorEnd&&c.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&c.addRule(a.illegal,{type:"illegal"}),c}function i(a,c){const u=a;if(a.isCompiled)return u;[Gh,Jh,sm,Xh].forEach(d=>d(a,c)),e.compilerExtensions.forEach(d=>d(a,c)),a.__beforeBegin=null,[Kh,Vh,Yh].forEach(d=>d(a,c)),a.isCompiled=!0;let l=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),l=a.keywords.$pattern,delete a.keywords.$pattern),l=l||/\w+/,a.keywords&&(a.keywords=fl(a.keywords,e.case_insensitive)),u.keywordPatternRe=t(l,!0),c&&(a.begin||(a.begin=/\B|\b/),u.beginRe=t(u.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(u.endRe=t(u.end)),u.terminatorEnd=Ln(u.end)||"",a.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(a.end?"|":"")+c.terminatorEnd)),a.illegal&&(u.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return im(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,u)}),a.starts&&i(a.starts,c),u.matcher=s(u),u}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=At(e.classNameAliases||{}),i(e)}function hl(e){return e?e.endsWithParent||hl(e.starts):!1}function im(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return At(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:hl(e)?At(e,{starts:e.starts?At(e.starts):null}):Object.isFrozen(e)?At(e):e}var am="11.12.0";class cm extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const gs=ol,ua=At,da=Symbol("nomatch"),lm=7,ml=function(e){const t=Object.create(null),n=Object.create(null),r=[];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 c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:kh};function u(E){return c.noHighlightRe.test(E)}function l(E){let S=E.className+" ";S+=E.parentNode?E.parentNode.className:"";const M=c.languageDetectRe.exec(S);if(M){const W=v(M[1]);return W||(la(i.replace("{}",M[1])),la("Falling back to no-highlight mode for this block.",E)),W?M[1]:"no-highlight"}return S.split(/\s+/).find(W=>u(W)||v(W))}function d(E,S,M){let W="",Q="";typeof S=="object"?(W=E,M=S.ignoreIllegals,Q=S.language):(qt("10.7.0","highlight(lang, code, ...args) has been deprecated."),qt("10.7.0",`Please use highlight(code, options) instead.
125
+ https://github.com/highlightjs/highlight.js/issues/2277`),Q=E,W=S),M===void 0&&(M=!0);const ne={code:W,language:Q};X("before:highlight",ne);const Ae=ne.result?ne.result:f(ne.language,ne.code,M);return Ae.code=ne.code,X("after:highlight",Ae),Ae}function f(E,S,M,W){const Q=Object.create(null);function ne(O,R){return O.keywords[R]}function Ae(){if(!B.keywords){ue.addText(V);return}let O=0;B.keywordPatternRe.lastIndex=0;let R=B.keywordPatternRe.exec(V),Z="";for(;R;){Z+=V.substring(O,R.index);const ce=re.case_insensitive?R[0].toLowerCase():R[0],je=ne(B,ce);if(je){const[He,Gt]=je;if(ue.addText(Z),Z="",Q[ce]=(Q[ce]||0)+1,Q[ce]<=lm&&(me+=Gt),He.startsWith("_"))Z+=R[0];else{const wn=re.classNameAliases[He]||He;q(R[0],wn)}}else Z+=R[0];O=B.keywordPatternRe.lastIndex,R=B.keywordPatternRe.exec(V)}Z+=V.substring(O),ue.addText(Z)}function Ne(){if(V==="")return;let O=null;if(typeof B.subLanguage=="string"){if(!t[B.subLanguage]){ue.addText(V);return}O=f(B.subLanguage,V,!0,se[B.subLanguage]),se[B.subLanguage]=O._top}else O=m(V,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(me+=O.relevance),ue.__addSublanguage(O._emitter,O.language)}function ye(){B.subLanguage!=null?Ne():Ae(),V=""}function q(O,R){O!==""&&(ue.startScope(R),ue.addText(O),ue.endScope())}function le(O,R){let Z=1;const ce=R.length-1;for(;Z<=ce;){if(!O._emit[Z]){Z++;continue}const je=re.classNameAliases[O[Z]]||O[Z],He=R[Z];je?q(He,je):(V=He,Ae(),V=""),Z++}}function K(O,R){return O.scope&&typeof O.scope=="string"&&ue.openNode(re.classNameAliases[O.scope]||O.scope),O.beginScope&&(O.beginScope._wrap?(q(V,re.classNameAliases[O.beginScope._wrap]||O.beginScope._wrap),V=""):O.beginScope._multi&&(le(O.beginScope,R),V="")),B=Object.create(O,{parent:{value:B}}),B}function ae(O,R,Z){let ce=Ah(O.endRe,Z);if(ce){if(O["on:end"]){const je=new oa(O);O["on:end"](R,je),je.isMatchIgnored&&(ce=!1)}if(ce){for(;O.endsParent&&O.parent;)O=O.parent;return O}}if(O.endsWithParent)return ae(O.parent,R,Z)}function he(O){return B.matcher.regexIndex===0?(V+=O[0],1):(Re=!0,0)}function de(O){const R=O[0],Z=O.rule,ce=new oa(Z),je=[Z.__beforeBegin,Z["on:begin"]];for(const He of je)if(He&&(He(O,ce),ce.isMatchIgnored))return he(R);return Z.skip?V+=R:(Z.excludeBegin&&(V+=R),ye(),!Z.returnBegin&&!Z.excludeBegin&&(V=R)),K(Z,O),Z.returnBegin?0:R.length}function Te(O){const R=O[0],Z=S.substring(O.index),ce=ae(B,O,Z);if(!ce)return da;const je=B;B.endScope&&B.endScope._wrap?(ye(),q(R,B.endScope._wrap)):B.endScope&&B.endScope._multi?(ye(),le(B.endScope,O)):je.skip?V+=R:(je.returnEnd||je.excludeEnd||(V+=R),ye(),je.excludeEnd&&(V=R));do B.scope&&ue.closeNode(),!B.skip&&!B.subLanguage&&(me+=B.relevance),B=B.parent;while(B!==ce.parent);return ce.starts&&K(ce.starts,O),je.returnEnd?0:R.length}function we(){const O=[];for(let R=B;R!==re;R=R.parent)R.scope&&O.unshift(R.scope);O.forEach(R=>ue.openNode(R))}let ke={};function Me(O,R){const Z=R&&R[0];if(V+=O,Z==null)return ye(),0;if(ke.type==="begin"&&R.type==="end"&&ke.index===R.index&&Z===""){if(V+=S.slice(R.index,R.index+1),!s){const ce=new Error(`0 width match regex (${E})`);throw ce.languageName=E,ce.badRule=ke.rule,ce}return 1}if(ke=R,R.type==="begin")return de(R);if(R.type==="illegal"&&!M){const ce=new Error('Illegal lexeme "'+Z+'" for mode "'+(B.scope||"<unnamed>")+'"');throw ce.mode=B,ce}else if(R.type==="end"){const ce=Te(R);if(ce!==da)return ce}if(R.type==="illegal"&&Z==="")return R.index===S.length||(V+=`
126
+ `),1;if(_e>1e5&&_e>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return V+=Z,Z.length}const re=v(E);if(!re)throw Mt(i.replace("{}",E)),new Error('Unknown language: "'+E+'"');const J=om(re);let H="",B=W||J;const se={},ue=new c.__emitter(c);we();let V="",me=0,Ce=0,_e=0,Re=!1;try{if(re.__emitTokens)re.__emitTokens(S,ue);else{for(B.matcher.considerAll();;){_e++,Re?Re=!1:B.matcher.considerAll(),B.matcher.lastIndex=Ce;const O=B.matcher.exec(S);if(!O)break;const R=S.substring(Ce,O.index),Z=Me(R,O);Ce=O.index+Z}Me(S.substring(Ce))}return ue.finalize(),H=ue.toHTML(),{language:E,value:H,relevance:me,illegal:!1,_emitter:ue,_top:B}}catch(O){if(O.message&&O.message.includes("Illegal"))return{language:E,value:gs(S),illegal:!0,relevance:0,_illegalBy:{message:O.message,index:Ce,context:S.slice(Ce-100,Ce+100),mode:O.mode,resultSoFar:H},_emitter:ue};if(s)return{language:E,value:gs(S),illegal:!1,relevance:0,errorRaised:O,_emitter:ue,_top:B};throw O}}function p(E){const S={value:gs(E),illegal:!1,relevance:0,_top:a,_emitter:new c.__emitter(c)};return S._emitter.addText(E),S}function m(E,S){S=S||c.languages||Object.keys(t);const M=p(E),W=S.filter(v).filter(_).map(ye=>f(ye,E,!1));W.unshift(M);const Q=W.sort((ye,q)=>{if(ye.relevance!==q.relevance)return q.relevance-ye.relevance;if(ye.language&&q.language){if(v(ye.language).supersetOf===q.language)return 1;if(v(q.language).supersetOf===ye.language)return-1}return 0}),[ne,Ae]=Q,Ne=ne;return Ne.secondBest=Ae,Ne}function g(E,S,M){const W=S&&n[S]||M;E.classList.add("hljs"),E.classList.add(`language-${W}`)}function y(E){let S=null;const M=l(E);if(u(M))return;if(X("before:highlightElement",{el:E,language:M}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(c.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(E)),c.throwUnescapedHTML))throw new cm("One of your code blocks includes unescaped HTML.",E.innerHTML);S=E;const W=S.textContent,Q=M?d(W,{language:M,ignoreIllegals:!0}):m(W);E.innerHTML=Q.value,E.dataset.highlighted="yes",g(E,M,Q.language),E.result={language:Q.language,re:Q.relevance,relevance:Q.relevance},Q.secondBest&&(E.secondBest={language:Q.secondBest.language,relevance:Q.secondBest.relevance}),X("after:highlightElement",{el:E,result:Q,text:W})}function b(E){c=ua(c,E)}const j=()=>{$(),qt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){$(),qt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=!1;function $(){function E(){$()}if(document.readyState==="loading"){A||window.addEventListener("DOMContentLoaded",E,!1),A=!0;return}document.querySelectorAll(c.cssSelector).forEach(y)}function F(E,S){let M=null;try{M=S(e)}catch(W){if(Mt("Language definition for '{}' could not be registered.".replace("{}",E)),s)Mt(W);else throw W;M=a}M.name||(M.name=E),t[E]=M,M.rawDefinition=S.bind(null,e),M.aliases&&w(M.aliases,{languageName:E})}function G(E){delete t[E];for(const S of Object.keys(n))n[S]===E&&delete n[S]}function T(){return Object.keys(t)}function v(E){return E=(E||"").toLowerCase(),t[E]||t[n[E]]}function w(E,{languageName:S}){typeof E=="string"&&(E=[E]),E.forEach(M=>{n[M.toLowerCase()]=S})}function _(E){const S=v(E);return S&&!S.disableAutodetect}function L(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=S=>{E["before:highlightBlock"](Object.assign({block:S.el},S))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=S=>{E["after:highlightBlock"](Object.assign({block:S.el},S))})}function U(E){L(E),r.push(E)}function P(E){const S=r.indexOf(E);S!==-1&&r.splice(S,1)}function X(E,S){const M=E;r.forEach(function(W){W[M]&&W[M](S)})}function ie(E){return qt("10.7.0","highlightBlock will be removed entirely in v12.0"),qt("10.7.0","Please use highlightElement now."),y(E)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:$,highlightElement:y,highlightBlock:ie,configure:b,initHighlighting:j,initHighlightingOnLoad:N,registerLanguage:F,unregisterLanguage:G,listLanguages:T,getLanguage:v,registerAliases:w,autoDetection:_,inherit:ua,addPlugin:U,removePlugin:P}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=am,e.regex={concat:Wt,lookahead:il,either:Jr,optional:jh,anyNumberOfTimes:vh};for(const E in ur)typeof ur[E]=="object"&&sl(ur[E]);return Object.assign(e,ur),e},un=ml({});un.newInstance=()=>ml({});var um=un;un.HighlightJS=un;un.default=un;const ot=rl(um),dm="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",fm={scope:"number",match:dm,relevance:0};function pm(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,fm,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function hm(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={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]},c=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"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},b=[r,{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+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{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},g,y,i,a],j=[...b];return j.pop(),j.push(c),m.contains=j,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}function mm(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});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"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(c);const u={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),g={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"],j={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],$=["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"],F=["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:[...N,...A,"set","shopt",...$,...F]},contains:[m,e.SHEBANG(),g,f,i,a,j,c,u,l,d,n]}}const fa="[A-Za-z$_][0-9A-Za-z$_]*",gm=["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"],xm=["true","false","null","undefined","NaN","Infinity"],gl=["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"],xl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],bm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],ym=[].concat(bl,gl,xl);function wm(e){const t=e.regex,n=(M,{after:W})=>{const Q="</"+M[0].slice(1);return M.input.indexOf(Q,W)!==-1},r=fa,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,W)=>{const Q=M[0].length+M.index,ne=M.input[Q];if(ne==="<"||ne===","){W.ignoreMatch();return}ne===">"&&(n(M,{after:Q})||W.ignoreMatch());let Ae;const Ne=M.input.substring(Q);if(Ae=Ne.match(/^\s*=/)){W.ignoreMatch();return}if((Ae=Ne.match(/^\s+extends\s+/))&&Ae.index===0){W.ignoreMatch();return}}},c={$pattern:fa,keyword:gm,literal:xm,built_in:ym,"variable.language":bm},u="[0-9](_?[0-9])*",l=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\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:c,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={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]},N={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,y,b,{match:/\$\d+/},f];p.contains=A.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(A)});const $=[].concat(N,p.contains),F=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat($)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:F},T={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},v={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:{_:[...gl,...xl]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(M){return t.concat("(?!",M.join("|"),")")}const P={match:t.concat(/\b/,U([...bl,"super","import","await"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ie={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:v},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,y,b,N,{match:/\$\d+/},f,v,{scope:"attr",match:r+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:E,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:c,contains:F}]}]},{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:[G,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},P,L,T,ie,{match:/\$[(.]/}]}}function km(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","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","sentinel","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"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:c,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,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,d,l]},{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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,g=`\\b|${r.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${p})[jJ](?=${g})`}]},b={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},j={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,y,f,e.HASH_COMMENT_MODE]}]};return l.contains=[f,y,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,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+/,n],scope:{1:"keyword",3:"title.function"},contains:[j]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,j,f]}]}}ot.registerLanguage("json",pm);ot.registerLanguage("yaml",hm);ot.registerLanguage("bash",mm);ot.registerLanguage("javascript",wm);ot.registerLanguage("python",km);const pa=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),vm=new Set(["http","https","mailto","tel"]);function jm(e){const t=/^([a-z][a-z0-9+.-]*):/i.exec(e.replace(/[\u0000-\u0020]/g,""));return!t||vm.has(t[1].toLowerCase())?e:null}function yl({rawHtml:e}){const t=new el(fh({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(n,r){if(!ot.getLanguage(r))return n;try{return ot.highlight(n,{language:r}).value}catch{return n}}}));return t.use({extensions:[{name:"link",renderer(n){const r=this.parser.parseInline(n.tokens??[]),s=jm(n.href);return s===null?r:`<a class="hover:underline hover:text-secondary-600" href="${pa(s)}" rel="noopener noreferrer" target="_blank">${r}</a>`}}]}),e==="text"&&t.use({renderer:{html({text:n}){return pa(n.replace(/<(script|style)[\s\S]*?<\/\1\s*>/gi,"").replace(/<[^>]*>/g,""))}}}),t}const Sm=yl({rawHtml:"keep"}),Am=yl({rawHtml:"text"});function ha(e,{serverSafe:t=!1}={}){return(t?Am:Sm).parse(e)}/*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */function ma(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Em(e){if(Array.isArray(e))return e}function Nm(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(d){l=!0,s=d}finally{try{if(!u&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw s}}return c}}function Tm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
127
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cm(e,t){return Em(e)||Nm(e,t)||_m(e,t)||Tm()}function _m(e,t){if(e){if(typeof e=="string")return ma(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ma(e,t):void 0}}const wl=Object.entries,ga=Object.setPrototypeOf,$m=Object.isFrozen,Im=Object.getPrototypeOf,Om=Object.getOwnPropertyDescriptor;let Ie=Object.freeze,Oe=Object.seal,tn=Object.create,kl=typeof Reflect<"u"&&Reflect,Qs=kl.apply,qs=kl.construct;Ie||(Ie=function(t){return t});Oe||(Oe=function(t){return t});Qs||(Qs=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return t.apply(n,s)});qs||(qs=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new t(...r)});const It=$e(Array.prototype.forEach),Mm=$e(Array.prototype.lastIndexOf),xa=$e(Array.prototype.pop),An=$e(Array.prototype.push),Rm=$e(Array.prototype.splice),sn=Array.isArray,_n=$e(String.prototype.toLowerCase),xs=$e(String.prototype.toString),ba=$e(String.prototype.match),En=$e(String.prototype.replace),ya=$e(String.prototype.indexOf),Lm=$e(String.prototype.trim),Pm=$e(Number.prototype.toString),Dm=$e(Boolean.prototype.toString),wa=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),ka=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),Je=$e(Object.prototype.hasOwnProperty),Nn=$e(Object.prototype.toString),Le=$e(RegExp.prototype.test),_t=Bm(TypeError);function $e(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Qs(e,t,r)}}function Bm(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qs(e,n)}}function fe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_n;if(ga&&ga(e,null),!sn(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const i=n(s);i!==s&&($m(t)||(t[r]=i),s=i)}e[s]=!0}return e}function Fm(e){for(let t=0;t<e.length;t++)Je(e,t)||(e[t]=null);return e}function Qe(e){const t=tn(null);for(const r of wl(e)){var n=Cm(r,2);const s=n[0],i=n[1];Je(e,s)&&(sn(i)?t[s]=Fm(i):i&&typeof i=="object"&&i.constructor===Object?t[s]=Qe(i):t[s]=i)}return t}function zm(e){switch(typeof e){case"string":return e;case"number":return Pm(e);case"boolean":return Dm(e);case"bigint":return wa?wa(e):"0";case"symbol":return ka?ka(e):"Symbol()";case"undefined":return Nn(e);case"function":case"object":{if(e===null)return Nn(e);const t=e,n=tt(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Nn(r)}return Nn(e)}default:return Nn(e)}}function tt(e,t){for(;e!==null;){const r=Om(e,t);if(r){if(r.get)return $e(r.get);if(typeof r.value=="function")return $e(r.value)}e=Im(e)}function n(){return null}return n}function Hm(e){try{return Le(e,""),!0}catch{return!1}}const va=Ie(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bs=Ie(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ys=Ie(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Um=Ie(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ws=Ie(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wm=Ie(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ja=Ie(["#text"]),Sa=Ie(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ks=Ie(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Aa=Ie(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),dr=Ie(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Gm=Oe(/{{[\w\W]*|^[\w\W]*}}/g),Km=Oe(/<%[\w\W]*|^[\w\W]*%>/g),Vm=Oe(/\${[\w\W]*/g),Jm=Oe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ym=Oe(/^aria-[\-\w]+$/),Ea=Oe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xm=Oe(/^(?:\w+script|data):/i),Zm=Oe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qm=Oe(/^html$/i),qm=Oe(/^[a-z][.\w]*(-[.\w]+)+$/i),Na=Oe(/<[/\w!]/g),Ta=Oe(/<[/\w]/g),eg=Oe(/<\/no(script|embed|frames)/i),tg=Oe(/\/>/i),Ye={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vl=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ng=Ie(fe({},vl)),rg=(function(){const e={};return It(vl,t=>{e[t]=Oe(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ie(e)})(),sg=function(){return typeof window>"u"?null:window},og=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Ca=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},jt=function(t,n,r,s){return Je(t,n)&&sn(t[n])?fe(s.base?Qe(s.base):{},t[n],s.transform):r},vs=function(t,n,r){const s=Je(t,n)?t[n]:void 0;return s&&typeof s=="object"?Qe(s):r()};function jl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sg();const t=I=>jl(I);if(t.version="3.4.15",t.removed=[],!e||!e.document||e.document.nodeType!==Ye.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,s=r.currentScript;e.DocumentFragment;const i=e.HTMLTemplateElement,a=e.Node,c=e.Element,u=e.NodeFilter,l=e.NamedNodeMap;l===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,f=e.trustedTypes,p=c.prototype,m=tt(p,"cloneNode"),g=tt(p,"remove"),y=tt(p,"removeAttributeNode"),b=tt(p,"nextSibling"),j=tt(p,"childNodes"),N=tt(p,"parentNode"),A=tt(p,"shadowRoot"),$=tt(p,"attributes"),F=a&&a.prototype?tt(a.prototype,"nodeType"):null,G=a&&a.prototype?tt(a.prototype,"nodeName"):null,T=a&&a.prototype?tt(a.prototype,"ownerDocument"):null,v=function(h){return F?F(h):h.nodeType},w=function(h){return G?G(h):h.nodeName};if(typeof i=="function"){const I=n.createElement("template");I.content&&I.content.ownerDocument&&(n=I.content.ownerDocument)}let _,L="",U,P=!1,X=0;const ie=function(){if(X>0)throw _t('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},E=function(h){ie(),X++;try{return _.createHTML(h)}finally{X--}},S=function(h){ie(),X++;try{return _.createScriptURL(h)}finally{X--}},M=function(){return P||(U=og(f,s),P=!0),U},W=n,Q=W.implementation,ne=W.createNodeIterator,Ae=W.createDocumentFragment,Ne=W.getElementsByTagName,ye=r.importNode;let q=Ca();t.isSupported=typeof wl=="function"&&typeof N=="function"&&Q&&Q.createHTMLDocument!==void 0;const le=Gm,K=Km,ae=Vm,he=Jm,de=Ym,Te=Xm,we=Zm,ke=qm;let Me=Ea,re=null;const J=fe({},[...va,...bs,...ys,...ws,...ja]);let H=null;const B=fe({},[...Sa,...ks,...Aa,...dr]);let se=Object.seal(tn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,V=null;const me=Object.seal(tn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ce=!0,_e=!0,Re=!1,O=!0,R=!1,Z=!0,ce=!1,je=!1,He=null,Gt=null,wn=!1,Kt=!1,Zn=!1,Qn=!1,ei=!0,ti=!1;const ni="user-content-";let qr=!0,es=!1,Vt={},Jt=null;const ri=fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let si=null;const oi=fe({},["audio","video","img","source","image","track"]);let ii=null;const ai=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qn="http://www.w3.org/1998/Math/MathML",er="http://www.w3.org/2000/svg",lt="http://www.w3.org/1999/xhtml";let Yt=lt,ts=!1,ns=null;const Ou=fe({},[qn,er,lt],xs),ci=Ie(["mi","mo","mn","ms","mtext"]);let rs=fe({},ci);const li=Ie(["annotation-xml"]);let ss=fe({},li);const Mu=fe({},["title","style","font","a","script"]);let kn=null;const Ru=["application/xhtml+xml","text/html"],Lu="text/html";let Ee=null,Xt=null;const Pu=n.createElement("form"),ui=function(h){return h instanceof RegExp||h instanceof Function},os=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Xt&&Xt===h)return;(!h||typeof h!="object")&&(h={}),h=Qe(h),kn=Ru.indexOf(h.PARSER_MEDIA_TYPE)===-1?Lu:h.PARSER_MEDIA_TYPE,Ee=kn==="application/xhtml+xml"?xs:_n,re=jt(h,"ALLOWED_TAGS",J,{transform:Ee}),H=jt(h,"ALLOWED_ATTR",B,{transform:Ee}),ns=jt(h,"ALLOWED_NAMESPACES",Ou,{transform:xs}),ii=jt(h,"ADD_URI_SAFE_ATTR",ai,{transform:Ee,base:ai}),si=jt(h,"ADD_DATA_URI_TAGS",oi,{transform:Ee,base:oi}),Jt=jt(h,"FORBID_CONTENTS",ri,{transform:Ee}),ue=jt(h,"FORBID_TAGS",Qe({}),{transform:Ee}),V=jt(h,"FORBID_ATTR",Qe({}),{transform:Ee}),Vt=Je(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?Qe(h.USE_PROFILES):h.USE_PROFILES:!1,Ce=h.ALLOW_ARIA_ATTR!==!1,_e=h.ALLOW_DATA_ATTR!==!1,Re=h.ALLOW_UNKNOWN_PROTOCOLS||!1,O=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R=h.SAFE_FOR_TEMPLATES||!1,Z=h.SAFE_FOR_XML!==!1,ce=h.WHOLE_DOCUMENT||!1,Kt=h.RETURN_DOM||!1,Zn=h.RETURN_DOM_FRAGMENT||!1,Qn=h.RETURN_TRUSTED_TYPE||!1,wn=h.FORCE_BODY||!1,ei=h.SANITIZE_DOM!==!1,ti=h.SANITIZE_NAMED_PROPS||!1,qr=h.KEEP_CONTENT!==!1,es=h.IN_PLACE||!1,Me=Hm(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Ea,Yt=typeof h.NAMESPACE=="string"?h.NAMESPACE:lt,rs=vs(h,"MATHML_TEXT_INTEGRATION_POINTS",()=>fe({},ci)),ss=vs(h,"HTML_INTEGRATION_POINTS",()=>fe({},li));const k=vs(h,"CUSTOM_ELEMENT_HANDLING",()=>tn(null));if(se=tn(null),Je(k,"tagNameCheck")&&ui(k.tagNameCheck)&&(se.tagNameCheck=k.tagNameCheck),Je(k,"attributeNameCheck")&&ui(k.attributeNameCheck)&&(se.attributeNameCheck=k.attributeNameCheck),Je(k,"allowCustomizedBuiltInElements")&&typeof k.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=k.allowCustomizedBuiltInElements),Oe(se),R&&(_e=!1),Zn&&(Kt=!0),Vt&&(re=fe({},ja),H=tn(null),Vt.html===!0&&(fe(re,va),fe(H,Sa)),Vt.svg===!0&&(fe(re,bs),fe(H,ks),fe(H,dr)),Vt.svgFilters===!0&&(fe(re,ys),fe(H,ks),fe(H,dr)),Vt.mathMl===!0&&(fe(re,ws),fe(H,Aa),fe(H,dr))),me.tagCheck=null,me.attributeCheck=null,Je(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?me.tagCheck=h.ADD_TAGS:sn(h.ADD_TAGS)&&(re===J&&(re=Qe(re)),fe(re,h.ADD_TAGS,Ee))),Je(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?me.attributeCheck=h.ADD_ATTR:sn(h.ADD_ATTR)&&(H===B&&(H=Qe(H)),fe(H,h.ADD_ATTR,Ee))),Je(h,"ADD_FORBID_CONTENTS")&&sn(h.ADD_FORBID_CONTENTS)&&(Jt===ri&&(Jt=Qe(Jt)),fe(Jt,h.ADD_FORBID_CONTENTS,Ee)),qr&&(re["#text"]=!0),ce&&fe(re,["html","head","body"]),re.table&&(fe(re,["tbody"]),delete ue.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw _t('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw _t('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const C=_;_=h.TRUSTED_TYPES_POLICY;try{L=E("")}catch(z){throw _=C,z}}else h.TRUSTED_TYPES_POLICY===null?(_=void 0,L=""):(_===void 0&&(_=M()),_&&typeof L=="string"&&(L=E("")));Ie&&Ie(h),Xt=h},di=fe({},[...bs,...ys,...Um]),fi=fe({},[...ws,...Wm]),Du=function(h,k,C){return k.namespaceURI===lt?h==="svg":k.namespaceURI===qn?h==="svg"&&(C==="annotation-xml"||rs[C]):!!di[h]},Bu=function(h,k,C){return k.namespaceURI===lt?h==="math":k.namespaceURI===er?h==="math"&&ss[C]:!!fi[h]},Fu=function(h,k,C){return k.namespaceURI===er&&!ss[C]||k.namespaceURI===qn&&!rs[C]?!1:!fi[h]&&(Mu[h]||!di[h])},zu=function(h){let k=N(h);(!k||!k.tagName)&&(k={namespaceURI:Yt,tagName:"template"});const C=_n(h.tagName),z=_n(k.tagName);return ns[h.namespaceURI]?h.namespaceURI===er?Du(C,k,z):h.namespaceURI===qn?Bu(C,k,z):h.namespaceURI===lt?Fu(C,k,z):!!(kn==="application/xhtml+xml"&&ns[h.namespaceURI]):!1},vt=function(h){An(t.removed,{element:h});try{N(h).removeChild(h)}catch{if(g(h),!N(h))throw _t("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},pi=function(h,k,C){try{y(h,k)}catch{try{h.removeAttribute(C)}catch{}}},tr=function(h){nr(h);const k=j(h);if(k){const z=[];It(k,Y=>{An(z,Y)}),It(z,Y=>{try{g(Y)}catch{}})}const C=$(h);if(C)for(let z=C.length-1;z>=0;--z){const Y=C[z],te=Y&&Y.name;typeof te=="string"&&pi(h,Y,te)}},Ct=function(h,k,C){if(!C)try{C=k.getAttributeNode(h)}catch{C=null}An(t.removed,{attribute:C||null,from:k});try{C?y(k,C):k.removeAttribute(h)}catch{try{k.removeAttribute(h)}catch{}}if(h==="is")if(Kt||Zn)try{vt(k)}catch{}else try{k.setAttribute(h,"")}catch{}},Hu=function(h){const k=$(h);if(k)for(let C=k.length-1;C>=0;--C){const z=k[C],Y=z&&z.name;typeof Y!="string"||H[Ee(Y)]||pi(h,z,Y)}},nr=function(h){const k=[h];for(;k.length>0;){const C=k.pop();v(C)===Ye.element&&Hu(C);const Y=j(C);if(Y)for(let te=Y.length-1;te>=0;--te)k.push(Y[te])}},hi=function(h,k){return Z?h==="patchsrc"?!0:h==="for"&&k!=="label"&&k!=="output":!1},Uu=function(h){if(!Z)return;const k=[h];for(;k.length>0;){const C=k.pop(),z=v(C);if(z===Ye.processingInstruction||z===Ye.comment&&Le(Ta,C.data)){try{g(C)}catch{}continue}if(z===Ye.element){const te=C,be=Ee(w(C));try{te.hasAttribute&&te.hasAttribute("patchsrc")&&te.removeAttribute("patchsrc"),te.hasAttribute&&te.hasAttribute("for")&&hi("for",be)&&te.removeAttribute("for")}catch{}}const Y=j(C);if(Y)for(let te=Y.length-1;te>=0;--te)k.push(Y[te])}},mi=function(h){let k=null,C=null;if(wn)h="<remove></remove>"+h;else{const te=ba(h,/^[\r\n\t ]+/);C=te&&te[0]}kn==="application/xhtml+xml"&&Yt===lt&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const z=_?E(h):h;if(Yt===lt)try{k=new d().parseFromString(z,kn)}catch{}if(!k||!k.documentElement){k=Q.createDocument(Yt,"template",null);try{k.documentElement.innerHTML=ts?L:z}catch{}}const Y=k.body||k.documentElement;return h&&C&&Y.insertBefore(n.createTextNode(C),Y.childNodes[0]||null),Yt===lt?Ne.call(k,ce?"html":"body")[0]:ce?k.documentElement:Y},gi=function(h){const k=T?T(h):h.ownerDocument;return ne.call(k||h,h,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},rr=function(h){return h=En(h,le," "),h=En(h,K," "),h=En(h,ae," "),h},is=function(h){var k;h.normalize();const C=T?T(h):h.ownerDocument,z=ne.call(C||h,h,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Y=z.nextNode();for(;Y;)Y.data=rr(Y.data),Y=z.nextNode();const te=(k=h.querySelectorAll)===null||k===void 0?void 0:k.call(h,"template");te&&It(te,be=>{Zt(be.content)&&is(be.content)})},sr=function(h){const k=G?G(h):null;return typeof k!="string"||Ee(k)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==$(h)||typeof h.removeAttribute!="function"||typeof h.removeAttributeNode!="function"||typeof h.getAttributeNode!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==F(h)||h.childNodes!==j(h)},Zt=function(h){if(!F||typeof h!="object"||h===null)return!1;try{return F(h)===Ye.documentFragment}catch{return!1}},vn=function(h){if(!F||typeof h!="object"||h===null)return!1;try{return typeof F(h)=="number"}catch{return!1}};function ut(I,h,k){I.length!==0&&It(I,C=>{C.call(t,h,k,Xt)})}const Wu=function(h,k){return!!(Z&&h.hasChildNodes()&&!vn(h.firstElementChild)&&Le(Na,h.textContent)&&Le(Na,h.innerHTML)||Z&&h.namespaceURI===lt&&ng[k]&&(vn(h.firstElementChild)||typeof h.textContent=="string"&&Le(rg[k],h.textContent))||h.nodeType===Ye.processingInstruction||Z&&h.nodeType===Ye.comment&&Le(Ta,h.data))},or=function(h,k){if(h instanceof RegExp)return Le(h,k);if(h instanceof Function){for(var C=arguments.length,z=new Array(C>2?C-2:0),Y=2;Y<C;Y++)z[Y-2]=arguments[Y];return!!h(k,...z)}return!1},Gu=function(h,k,C){if(!ue[k]&&ki(k)&&or(se.tagNameCheck,k))return!1;if(qr&&!Jt[k]){const z=N(h),Y=j(h);if(Y&&z){const te=Y.length;for(let be=te-1;be>=0;--be){const ve=h===C?m(Y[be],!0):Y[be];z.insertBefore(ve,b(h))}}}return vt(h),!0},xi=function(h,k,C,z){return h.length===0?k:k===C||k===z?Qe(k):k},bi=function(h,k){return h===k||N(h)!==null?!1:(es&&nr(h),!0)},yi=function(h,k){if(ut(q.beforeSanitizeElements,h,null),bi(h,k))return!0;if(sr(h))return vt(h),!0;const C=Ee(w(h));if(re=xi(q.uponSanitizeElement,re,J,He),ut(q.uponSanitizeElement,h,{tagName:C,allowedTags:re}),bi(h,k))return!0;if(Wu(h,C))return vt(h),!0;if(ue[C]||!(me.tagCheck instanceof Function&&me.tagCheck(C))&&!re[C]){const Y=Gu(h,C,k);return Y===!1&&ut(q.afterSanitizeElements,h,null),Y}if(v(h)===Ye.element&&!zu(h)||(C==="noscript"||C==="noembed"||C==="noframes")&&Le(eg,h.innerHTML))return vt(h),!0;if(R&&h.nodeType===Ye.text){const Y=rr(h.textContent);h.textContent!==Y&&(An(t.removed,{element:h.cloneNode()}),h.textContent=Y)}return ut(q.afterSanitizeElements,h,null),!1},wi=function(h,k,C){if(V[k]||hi(k,h)||ei&&(k==="id"||k==="name")&&(C in n||C in Pu))return!1;const z=H[k]||me.attributeCheck instanceof Function&&me.attributeCheck(k,h);return _e&&Le(he,k)||Ce&&Le(de,k)?!0:z?ii[k]||Le(Me,En(C,we,""))||(k==="src"||k==="xlink:href"||k==="href")&&h!=="script"&&ya(C,"data:")===0&&si[h]||Re&&!Le(Te,En(C,we,""))?!0:!C:ki(h)&&or(se.tagNameCheck,h)&&or(se.attributeNameCheck,k,h)||k==="is"&&se.allowCustomizedBuiltInElements&&or(se.tagNameCheck,C)},Ku=fe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ki=function(h){return!Ku[_n(h)]&&Le(ke,h)},Vu=function(h,k,C,z){if(_&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!C)switch(f.getAttributeType(h,k)){case"TrustedHTML":return E(z);case"TrustedScriptURL":return S(z)}return z},Ju=function(h,k,C,z){try{return C?h.setAttributeNS(C,k,z):h.setAttribute(k,z),sr(h)?(vt(h),!1):!0}catch{return Ct(k,h),!1}},vi=function(h){ut(q.beforeSanitizeAttributes,h,null);const k=h.attributes;if(!k||sr(h))return;H=xi(q.uponSanitizeAttribute,H,B,Gt);const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let z=k.length;const Y=Ee(h.nodeName);for(;z--;){const te=k[z],be=te.name,ve=te.namespaceURI,Ue=te.value,We=Ee(be),cs=Ue;let Be=be==="value"?cs:Lm(cs),ji=!1;if(C.attrName=We,C.attrValue=Be,C.keepAttr=!0,C.forceKeepAttr=void 0,ut(q.uponSanitizeAttribute,h,C),Be=C.attrValue,ti&&(We==="id"||We==="name")&&ya(Be,ni)!==0&&(Ct(be,h,te),Be=ni+Be,ji=!0),Z&&Le(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Be)){Ct(be,h,te);continue}if(We==="attributename"&&ba(Be,"href")){Ct(be,h,te);continue}if(!C.forceKeepAttr){if(!C.keepAttr){Ct(be,h,te);continue}if(!O&&Le(tg,Be)){Ct(be,h,te);continue}if(R&&(Be=rr(Be)),!wi(Y,We,Be)){Ct(be,h,te);continue}Be=Vu(Y,We,ve,Be),Be!==cs&&Ju(h,be,ve,Be)&&ji&&xa(t.removed)}}ut(q.afterSanitizeAttributes,h,null)},ir=function(h){let k=null;const C=gi(h);for(ut(q.beforeSanitizeShadowDOM,h,null);k=C.nextNode();)if(ut(q.uponSanitizeShadowNode,k,null),yi(k,h),vi(k),Zt(k.content)&&ir(k.content),v(k)===Ye.element){const z=A(k);Zt(z)&&(as(z),ir(z))}ut(q.afterSanitizeShadowDOM,h,null)},as=function(h){const k=[{node:h,shadow:null}];for(;k.length>0;){const C=k.pop();if(C.shadow){ir(C.shadow);continue}const z=C.node,te=v(z)===Ye.element,be=j(z);if(be)for(let ve=be.length-1;ve>=0;--ve)k.push({node:be[ve],shadow:null});if(te){const ve=G?G(z):null;if(typeof ve=="string"&&Ee(ve)==="template"){const Ue=z.content;Zt(Ue)&&k.push({node:Ue,shadow:null})}}if(te){const ve=A(z);Zt(ve)&&k.push({node:null,shadow:ve},{node:ve,shadow:null})}}};return t.sanitize=function(I){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=null,C=null,z=null,Y=null;if(ts=!I,ts&&(I="<!-->"),typeof I!="string"&&!vn(I)&&(I=zm(I),typeof I!="string"))throw _t("dirty is not a string, aborting");if(!t.isSupported)return I;je?(re=He,H=Gt):os(h),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(re=Qe(re)),q.uponSanitizeAttribute.length>0&&(H=Qe(H)),t.removed=[];const te=es&&typeof I!="string"&&vn(I);if(te){Uu(I);const Ue=w(I);if(typeof Ue=="string"){const We=Ee(Ue);if(!re[We]||ue[We])throw tr(I),_t("root node is forbidden and cannot be sanitized in-place")}if(sr(I))throw tr(I),_t("root node is clobbered and cannot be sanitized in-place");try{as(I)}catch(We){throw tr(I),We}}else if(vn(I))k=mi("<!---->"),C=k.ownerDocument.importNode(I,!0),C.nodeType===Ye.element&&C.nodeName==="BODY"||C.nodeName==="HTML"?k=C:k.appendChild(C),as(k);else{if(!Kt&&!R&&!ce&&I.indexOf("<")===-1)return _&&Qn?E(I):I;if(k=mi(I),!k)return Kt?null:Qn?L:""}k&&wn&&vt(k.firstChild);const be=te?I:k;try{const Ue=gi(be);for(;z=Ue.nextNode();)yi(z,be),vi(z),Zt(z.content)&&ir(z.content)}catch(Ue){throw te&&(tr(I),It(t.removed,We=>{We.element&&nr(We.element)})),Ue}if(te)return It(t.removed,Ue=>{Ue.element&&nr(Ue.element)}),R&&is(I),I;if(Kt){if(R&&is(k),Zn)for(Y=Ae.call(k.ownerDocument);k.firstChild;)Y.appendChild(k.firstChild);else Y=k;return(H.shadowroot||H.shadowrootmode)&&(Y=ye.call(r,Y,!0)),Y}let ve=ce?k.outerHTML:k.innerHTML;return ce&&re["!doctype"]&&k.ownerDocument&&k.ownerDocument.doctype&&k.ownerDocument.doctype.name&&Le(Qm,k.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+k.ownerDocument.doctype.name+`>
128
+ `+ve),R&&(ve=rr(ve)),_&&Qn?E(ve):ve},t.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};os(I),je=!0,He=re,Gt=H},t.clearConfig=function(){Xt=null,je=!1,He=null,Gt=null,_=U,L=""},t.isValidAttribute=function(I,h,k){Xt||os({});const C=Ee(I),z=Ee(h);return wi(C,z,k)},t.addHook=function(I,h){typeof h=="function"&&Je(q,I)&&An(q[I],h)},t.removeHook=function(I,h){if(Je(q,I)){if(h!==void 0){const k=Mm(q[I],h);return k===-1?void 0:Rm(q[I],k,1)[0]}return xa(q[I])}},t.removeHooks=function(I){Je(q,I)&&(q[I]=[])},t.removeAllHooks=function(){q=Ca()},t}var Sl=jl();function Al(){return Sl.isSupported}function El(e){return Sl.sanitize(e)}const ig=()=>()=>{};function ag(){return x.useSyncExternalStore(ig,Al,()=>!1)}const cg={"--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)"},at=({children:e,className:t=""})=>{const n=ag();return 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:cg,dangerouslySetInnerHTML:{__html:n?El(ha(e)):ha(e,{serverSafe:!0})}}):null};function lg({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 ug({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 dg({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 fg({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 yt(e){return e.startsWith("http://")||e.startsWith("https://")}function Tn({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:i=!1,className:a=""}){const c=s&&(yt(s)||s.startsWith("mailto:"))?s:void 0,u=c?l=>o.jsx("a",{href:c,target:"_blank",rel:"noreferrer",...l}):l=>o.jsx("div",{...l});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(u,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${r}`,alt:`${r}`}),n?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:[!n&&o.jsx(u,{children:r}),i&&o.jsx(u,{children:r})]})]})}function Fo({name:e,href:t,title:n}){const r=t&&yt(t)?t:void 0;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 ${r&&"hover:bg-cyan-500 hover:text-white"}`,href:r,target:"_blank",rel:"noreferrer",title:n,children:e})}function pg({license:e,externalDocs:t,contact:n,tags:r,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:(n==null?void 0:n.name)??null,contactUrl:(n==null?void 0:n.url)??null,contactEmail:(n==null?void 0:n.email)??null,tags:r};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(Tn,{IconClass:dg,text:`${i.licenseName} ${Ei}`,term:Ei,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Tn,{IconClass:Hr,text:Ni,href:i.externalDocsUrl,term:Ni,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Tn,{IconClass:lg,text:`${i.contactEmail}`,term:ad,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Tn,{IconClass:ug,text:`${i.contactName}`,term:id,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(Tn,{IconClass:fg,term:cd,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,c)=>{const u=a,l=u.externalDocs;return o.jsx(Fo,{href:l&&l.url,title:u.description||(l&&l.description?l.description:void 0),name:u.name},c)})})})})]})}const hg=[/^x-parser-/i,/^x-lib-/i];function mg(e){return hg.some(t=>t.test(e))}const _a=new Map;function gg(e){let t=_a.get(e);return t||(t=x.lazy(Hc[e]),_a.set(e,t)),t}const xg=e=>e.startsWith("x-"),zo=(e,t)=>e?e[t]:void 0;function bg({source:e,pathPrefix:t}){const{showExtensions:n}=De();if(!n||!e)return null;const r=Object.keys(e).filter(s=>xg(s)&&!mg(s)&&Object.prototype.hasOwnProperty.call(Hc,s));return r.length===0?null:o.jsx(o.Fragment,{children:r.map(s=>{const i=gg(s);return o.jsx(x.Suspense,{fallback:null,children:o.jsx(i,{value:zo(e,s),path:`${t}.${s}`})},s)})})}const yg=x.lazy(_p),Nl=e=>No(zo(e,"x-logo"))!==null;function Ho({source:e}){const t=zo(e,"x-logo");return No(t)?o.jsx(x.Suspense,{fallback:null,children:o.jsx(yg,{value:t,path:"info.x-logo"})}):null}function Tl({title:e,description:t,license:n,contact:r,externalDocs:s,tags:i,extensionsSource:a,layout:c,showLogo:u=!0}){const l=u?o.jsx(Ho,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(at,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(pg,{logo:l,license:n,externalDocs:s,contact:r,tags:i}),a&&o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:o.jsx(bg,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:l,layout:c})})}const Cl=({title:e,description:t,license:n,externalDocs:r,contact:s,tags:i,layout:a,showLogo:c,...u})=>o.jsx(Tl,{title:e,description:t,license:n,externalDocs:r,contact:s,tags:i,extensionsSource:u,layout:a,showLogo:c}),wg=1500,kg=320,vg=48,jg="#011627";function Sg(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 Ag(e){try{return await navigator.clipboard.writeText(e),!0}catch{return Sg(e)}}function Xr({code:e,className:t,language:n="json",collapsedMaxHeight:r=kg}){const[s,i]=x.useState("idle"),a=x.useRef(void 0),[c,u]=x.useState(!1),[l,d]=x.useState(!1),[f,p]=x.useState(0),m=x.useRef(null),g=x.useRef(null),y=x.useId();x.useEffect(()=>()=>clearTimeout(a.current),[]),x.useEffect(()=>{const v=g.current;if(!v)return;const w=()=>{p(v.scrollHeight),d(v.scrollHeight>r+vg)};w();const _=new ResizeObserver(w);return _.observe(v),()=>_.disconnect()},[e,n,r]);const b=()=>{Ag(e).then(v=>{i(v?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),wg)})},N=ot.getLanguage(n)?ot.highlight(e,{language:n}).value:null,A=N!==null&&Al()?El(N):N,$=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",F=l&&!c,G=e.replace(/\n+$/,"").split(`
129
+ `).length,T=()=>{var v,w;c&&(((v=m.current)==null?void 0:v.getBoundingClientRect().top)??0)<0&&((w=m.current)==null||w.scrollIntoView({block:"nearest"})),u(_=>!_)};return o.jsxs("div",{ref:m,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:b,"aria-label":$,title:$,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(mc,{className:"w-4 h-4 text-green-600"}):o.jsx(hc,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:g,id:y,style:l?{maxHeight:c?f:r}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${l?"overflow-y-hidden":""}`,children:A!==null?o.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:A}}):o.jsx("code",{className:"hljs",children:e})}),l&&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 ${F?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${jg})`}})]}),l&&o.jsxs("button",{type:"button",onClick:T,"aria-expanded":c,"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:[c?"Show less":`Show all ${G} lines`,o.jsx(pn,{className:`w-3 h-3 transition-transform ${c?"rotate-180":""}`})]})]})}const Eg=/^x-parser-/i;function eo(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(r=>eo(r,t));const n={};for(const[r,s]of Object.entries(e))Eg.test(r)||(n[r]=eo(s,t));return n}finally{t.delete(e)}}return e}const _l=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(eo(e),null,2);return o.jsx(Xr,{code:t})},$a=new Set,Uo=e=>e.replace(/^#\//,"").split("/").pop()??e,to=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Ng={objects:new Set,refs:new Set},mt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:to(e)};const r=e.$ref,s=Uo(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const i=ht(t(r));if(!i)return{schema:e,refLabel:s};const{schema:a}=ln(i);n.add(r);try{const c=mt(a,t,n);return{schema:c.schema,refLabel:c.circular?void 0:s,circular:c.circular}}finally{n.delete(r)}},Pt=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return oe(n)?n:null},$l=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>oe(r));return n.length>0?n:null},Tg=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||oe(e.additionalItems)?e.additionalItems:null,Cg=e=>e.contains===void 0?null:typeof e.contains=="boolean"||oe(e.contains)?e.contains:null,Il=e=>e.contains!==void 0,Pr=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
130
+
131
+ ${t}`:t},_g=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),St=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Pr(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(!oe(a))continue;const c=s.properties[i];oe(c)?s.properties[i]=St(c,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 c=s.items[a];return oe(i)&&oe(c)?St(c,i):oe(i)?i:c}):s.items=t.items;else{const i=Pt(t),a=Pt(s);i&&a?s.items=St(a,i):i&&(s.items=t.items)}if(t.patternProperties&&oe(t.patternProperties)){const i={...oe(s.patternProperties)?s.patternProperties:{}};for(const[a,c]of Object.entries(t.patternProperties)){if(!oe(c)){i[a]=c;continue}const u=i[a];oe(u)?i[a]=St(u,c):i[a]=c}s.patternProperties=i}if(t.propertyNames!==void 0)if(oe(t.propertyNames)){const i=s.propertyNames;s.propertyNames=oe(i)?St(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(oe(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=oe(i)?St(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))_g.has(i)||a===void 0||(s[i]=a);return s},Ia=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([l,d])=>oe(d)?[l,Fe(d,t,n,r)]:[l,d])));const i=Pt(s);i&&(s.items=Fe(i,t,n,r));const a=Wn(s);a!==null&&oe(a)&&(s.propertyNames=Fe(a,t,n,r));const c=mn(s);c!==null&&oe(c)&&(s.additionalProperties=Fe(c,t,n,r));const u=Wo(s);return u.length>0&&(s.patternProperties=Object.fromEntries(u.map(([l,d])=>[l,Fe(d,t,n,r)]))),s},Fe=(e,t,n,r=new Set)=>{if(r.has(e))return e;r.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const i=[];let a={};for(const d of s){if(!oe(d))continue;const{schema:f,circular:p}=mt(d,t,n);if(p)continue;const m=Fe(f,t,n,r);if(m.if!==void 0){const g={if:m.if};m.then!==void 0&&(g.then=m.then),m.else!==void 0&&(g.else=m.else),i.push(g)}i.push(...Rl(m)),a=St(a,m,t,n)}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 c={...e};delete c.allOf;const u=Object.keys(c).length>0?St(a,c,t,n):a,l=Ia(u,t,n,r);if(i.length===1){const d=i[0];l.if=d.if,d.then!==void 0&&(l.then=d.then),d.else!==void 0&&(l.else=d.else)}else i.length>1&&(l._allOfConditionals=i);return l}return Ia(e,t,n,r)}finally{r.delete(e)}},Hn=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>oe(r));return n.length>0?n:null},Un=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>oe(r));return n.length>0?n:null},Ol=e=>e.not===void 0?null:typeof e.not=="boolean"||oe(e.not)?e.not:null,Ke=e=>Ol(e)!==null,Ml=e=>{const{not:t,...n}=e;return n},$g=e=>{const{if:t,then:n,else:r,...s}=e;return s},Xe=e=>e.if!==void 0,js=e=>e===void 0?null:typeof e=="boolean"||oe(e)?e:null,Rl=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>oe(t)):[],Ze=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Wn=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||oe(e.propertyNames)?e.propertyNames:null,mn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||oe(e.additionalProperties)?e.additionalProperties:null,Wo=e=>{const t=e.patternProperties;return oe(t)?Object.entries(t).flatMap(([n,r])=>oe(r)?[[n,r]]:[]):[]},Ig=(e,t)=>`${e}.[pattern:${t}]`,Gn=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Zr=e=>{const t=Wn(e);if(t!==null&&oe(t))return!0;const n=mn(e);return n!==null&&oe(n)?!0:Wo(e).length>0},Ll=e=>!!(Hn(e)||Un(e)||Gn(e)||Zr(e)||e.type==="array"||e.items||e.type!==void 0),st=e=>!(Ke(e)||Xe(e)||Ze(e)||Hn(e)||Un(e)||Gn(e)||Zr(e)||e.items||Il(e)||e.type==="array"||e.type==="object");function Og(e){if(typeof mn(e)=="boolean")return!0;const n=Wn(e);return!!(typeof n=="boolean"||n!==null&&oe(n)&&st(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function Oa(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||Og(e)}const Pl=(e,t)=>Oa(e)?!0:t?Oa(t):!1,Mg=(e,t)=>{if(Ke(e)||Xe(e)||Ze(e)||Hn(e)||Un(e)||Gn(e)||Zr(e))return!0;if(e.type==="array"||e.items){if(Il(e)||$l(e)!==null)return!0;const n=Pt(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=mt(n,t,$a),s=Fe(r,t,$a);return!st(s)}return!st(n)}return!1};function Dl(e){return JSON.stringify(e)}function Ma(e){return typeof e=="string"?e:JSON.stringify(e)}function et({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function Bl({children:e,mono:t=!1,title:n}){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:n,children:t?o.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function Rg(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Lg(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Pg(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Dg(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function Ra(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function La(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function fr({name:e,lower:t,upper:n,suffix:r}){return!t&&!n?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(et,{children:String(t.value)}),o.jsx(et,{children:t.op})]}),o.jsx(et,{children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx(et,{children:n.op}),o.jsx(et,{children:String(n.value)})]}),r&&o.jsx(et,{children:r})]})}function Ar({value:e,displayValue:t}){const n=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(Ma(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(Ma(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:n,onKeyDown:r,children:t??Dl(e)})}function Bg({schema:e}){const t=mn(e);return typeof t!="boolean"?null:o.jsx(et,{children:t?"additional properties allowed":"additional properties not allowed"})}function Fg({schema:e}){const t=Wn(e);return typeof t=="boolean"?o.jsx(Bl,{children:t?"any property name":"no property names"}):t!==null&&oe(t)&&st(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(et,{children:"property name pattern:"}),o.jsx(Ar,{value:t.pattern,displayValue:t.pattern})]}):null}function Pa({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=Rg(e),s=Lg(e),i=Pg(e),a=Dg(e),c=Ra(e,"minItems"),u=La(e,"maxItems"),l=Ra(e,"minProperties"),d=La(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(et,{children:"multiple of :"}),o.jsx(Bl,{children:String(e.multipleOf)})]}),(r||s)&&o.jsx(fr,{name:t,lower:r,upper:s}),(i||a)&&o.jsx(fr,{name:t,lower:i,upper:a,suffix:"chars"}),(c||u)&&o.jsx(fr,{name:t,lower:c,upper:u,suffix:"items"}),(l||d)&&o.jsx(fr,{name:t,lower:l,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(et,{children:"regex pattern:"}),o.jsx(Ar,{value:e.pattern,displayValue:e.pattern})]}),n&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(et,{children:"enum values:"}),n.map((f,p)=>o.jsx(Ar,{value:f},`${p}-${Dl(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(et,{children:"const value:"}),o.jsx(Ar,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(et,{children:"unique"}),o.jsx(Bg,{schema:e}),o.jsx(Fg,{schema:e})]})}function Fl({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&st(t),i=n??"value";return o.jsxs("div",{className:r,children:[o.jsx(Pa,{schema:e,rangeName:i}),s&&o.jsx(Pa,{schema:t,rangeName:"item"})]})}const zl=(e,t)=>{const n=Hn(e);if(n)return{text:`one of (${n.length})`};const r=Un(e);if(r)return{text:`any of (${r.length})`};if(Ke(e)&&!Ll(Ml(e)))return{text:"not"};if(e.type==="array"||e.items){const l=Pt(e);if(l){const d=l.type;if(d==="object"){const f=l.$ref?Uo(l.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof l.format=="string"?l.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=mn(e);!Gn(e)&&a!==null&&oe(a)&&(s==="object"||i==="type: unknown")&&(i=s==="object"?"object (map)":"map");const c=typeof e.format=="string"?e.format:void 0,u=t&&(s==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:c,refHint:u}},zg=(e,t)=>{if(!t)return!1;const n=zl(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Hl({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:i}=zl(e,t);return o.jsxs("span",{className:n,children:[s??r,i&&!r.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const Da="ml-6";function pr({schema:e,showBorder:t=!0}){const n=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(Hl,{schema:e})]}),Pl(e)&&o.jsx(Fl,{schema:e,className:`flex flex-col gap-1 mt-1 ${Da}`}),n&&n.split(`
132
+
133
+ `).map((r,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${Da} leading-relaxed`,children:r},s))]})}function Ss({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 Hg({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 Ul({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=x.useRef([]),i=c=>(c+e.length)%e.length,a=(c,u)=>{var d;let l=u;c.key==="ArrowRight"&&(c.preventDefault(),l=i(u+1)),c.key==="ArrowLeft"&&(c.preventDefault(),l=i(u-1)),c.key==="Home"&&(c.preventDefault(),l=0),c.key==="End"&&(c.preventDefault(),l=e.length-1),l!==u&&(n(e[l].id),(d=s.current[l])==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":r,children:e.map(({id:c,label:u},l)=>{const d=c===t;return o.jsx("button",{ref:f=>{s.current[l]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>n(c),onKeyDown:f=>a(f,l),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:u},c)})})}function Ug({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:r,onSelectCase:s,children:i}){if(t===0)return null;const a=(n==null?void 0:n.length)===t?n:Array.from({length:t},(l,d)=>`case ${d+1}`),c=e==="anyOf"?"Any of:":"One of:",u=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:c}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(Ul,{tabs:a.map((l,d)=>({id:String(d),label:l})),selected:String(r),onChange:l=>s(Number(l)),ariaLabel:u}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const Wg="ml-0 border-dashed border-border";function Ot({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=De();return n==="none"?o.jsx("div",{children:t}):n==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Wg}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:co(e,r)},children:t})}function Gg({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=De(),s=co(e,r);return o.jsxs("button",{type:"button",onClick:n,"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 Kg="ml-6";function Ge({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:i,typeLabelOverride:a,required:c,description:u,expandable:l,expanded:d,onToggle:f,showBorder:p=!0}){const{depthColors:m}=De(),g=co(n,m),y=r&&zg(r,s),b=l?Kg:"";let j="",N=t;if(t.endsWith("[]")){const A=t.slice(0,-2),$=A.lastIndexOf(".");$>=0?(j=A.slice(0,$+1),N=`${A.slice($+1)}[]`):N=t}else{const A=t.lastIndexOf("."),$=t.lastIndexOf("[]"),F=Math.max(A,$);F>=0&&(j=t.slice(0,F+(t[F]==="."?1:2)),N=t.slice(F+(t[F]==="."?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:[j&&o.jsx("span",{className:"text-foreground-muted",children:j}),o.jsx("span",{className:"font-semibold",style:{color:g},children:N})]}),c&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(r==null?void 0:r.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(r==null?void 0:r.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(r==null?void 0:r.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),r?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(Hl,{schema:r,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})]}),r&&Pl(r,i)&&o.jsx(Fl,{schema:r,itemSchema:i,fieldName:N,className:`flex flex-col gap-1 mt-1 ${b}`}),u&&u.split(`
134
+
135
+ `).map((A,$)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${b} leading-relaxed`,children:A},$)),l&&o.jsx(Gg,{depth:n,expanded:d,onToggle:f})]})}function As({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 Vg({ifContent:e,thenContent:t,elseContent:n}){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(Ot,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(As,{label:"If schema matches:",children:e}),t!=null&&o.jsx(As,{label:"Then schema should follow:",children:t}),n!=null&&o.jsx(As,{label:"Else schema should follow:",children:n})]})})]})}function hr({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 Jg=e=>e==="none"?"depth":e;function rt({schema:e,path:t,depth:n,required:r,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:c="depth",defaultExpanded:u=!1,ancestors:l=Ng,focusTokens:d=null,focusId:f=null}){var le;const p=Jg(c),m=d!=null,y=m&&d.length===0?f??void 0:void 0,[b,j]=x.useState(u||m),[N,A]=x.useState(u);N!==u&&(A(u),j(u||m)),x.useEffect(()=>{m&&j(!0)},[m]);const[$,F]=x.useState(0),G=(le=d==null?void 0:d[0])==null?void 0:le.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),T=G?Number(G[1]):-1;x.useEffect(()=>{T>=0&&F(T)},[T]);const v=Ur(),{schema:w,refLabel:_,circular:L}=x.useMemo(()=>{if(l.objects.has(e)||typeof e.$ref=="string"&&l.refs.has(e.$ref))return{schema:e,refLabel:to(e),circular:!0};const K=mt(e,i,s);return K.circular?K:{...K,schema:Fe(K.schema,i,s)}},[e,i,s,l,v]),U=x.useMemo(()=>({objects:new Set(l.objects).add(e),refs:typeof e.$ref=="string"?new Set(l.refs).add(e.$ref):l.refs}),[l,e]),P=Ml($g(w)),X=!Ll(P)&&(Ke(w)||Xe(w)||Ze(w)),ie=()=>{const K=Ol(w);if(K===null)return null;if(typeof K=="boolean")return o.jsx(Ss,{children:o.jsx(Hg,{value:K})});const ae=mt(K,i,s);if(ae.circular)return o.jsx(Ss,{children:o.jsx(Ge,{path:t,depth:n+1,typeLabelOverride:`↩ ${K.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const he=Fe(ae.schema,i,s),de=st(he);return o.jsx(Ss,{children:de?o.jsx(pr,{schema:he,showBorder:!1}):o.jsx(rt,{schema:K,path:t,depth:n+1,refStack:s,deref:i,ancestors:U,suppressRow:!0,branchLineVariant:p,defaultExpanded:u})})},E=(K,ae)=>{if(typeof K=="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:K?"any value":"false schema"});const he=mt(K,i,s);if(he.circular)return o.jsx(Ge,{path:ae,depth:n+1,typeLabelOverride:`↩ ${K.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const de=Fe(he.schema,i,s);return st(de)?o.jsx(pr,{schema:de,showBorder:!1}):o.jsx(rt,{schema:K,path:ae,depth:n+1,refStack:s,deref:i,ancestors:U,suppressRow:!0,branchLineVariant:"none",defaultExpanded:u})},S=K=>{const ae=js(K.if);if(ae===null)return null;const he=js(K.then),de=js(K.else);return o.jsx(Vg,{ifContent:E(ae,t),thenContent:he!==null?E(he,t):void 0,elseContent:de!==null?E(de,t):void 0})},M=()=>{const K=Rl(w);return K.length===0?null:o.jsx(o.Fragment,{children:K.map((ae,he)=>o.jsx("div",{children:S(ae)},he))})};if(L)return o.jsx(Ge,{id:y,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??_??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(X){const K=o.jsxs(o.Fragment,{children:[Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]});return a?K:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:t,depth:n,schema:w,refLabel:_,required:r,description:w.description,expandable:!0,expanded:b,onToggle:()=>j(ae=>!ae)}),b&&o.jsx(Ot,{depth:n,lineVariant:c,children:K})]})}const W=Hn(P),Q=Un(P),ne=W??Q,Ae=W?"oneOf":"anyOf";if(ne){const K=ne.map((H,B)=>typeof H.title=="string"?H.title:`case ${B+1}`),ae=a?1:n+1,he=ne[$],de=mt(he,i,s),Te=de.circular?de.schema:Fe(de.schema,i,s),we=!de.circular&&st(Te),ke=d&&T===$?d.slice(1):null,Me=we?o.jsx(pr,{schema:Te,showBorder:!1}):o.jsx(rt,{schema:he,path:t,depth:ae-1,refStack:s,deref:i,ancestors:U,suppressRow:!0,branchLineVariant:"none",defaultExpanded:u,focusTokens:ke,focusId:f},$),re=o.jsx(Ug,{variant:Ae,caseCount:ne.length,caseLabels:K,selectedCase:$,onSelectCase:F,children:Me}),J=o.jsxs(o.Fragment,{children:[re,Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]});return a?J:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:t,depth:n,schema:w,refLabel:_,required:r,description:w.description,expandable:!0,expanded:b,onToggle:()=>j(H=>!H)}),b&&o.jsx(Ot,{depth:n,lineVariant:c,children:J})]})}const Ne=(K,ae,he)=>{const de=mt(K,i,s);if(de.circular)return o.jsx(Ge,{path:ae,depth:he,typeLabelOverride:`↩ ${K.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const Te=Fe(de.schema,i,s);return st(Te)?o.jsx(pr,{schema:Te,showBorder:!1}):o.jsx(rt,{schema:K,path:ae,depth:he,refStack:s,deref:i,ancestors:U,branchLineVariant:p,defaultExpanded:u})},ye=K=>{const ae=P.properties??{},he=new Set(P.required??[]),de=Wn(P),Te=mn(P),we=Wo(P);return o.jsxs(o.Fragment,{children:[Object.entries(ae).map(([ke,Me])=>{if(!oe(Me))return null;const re=d&&d[0]==="properties"&&d[1]===ke?d.slice(2):null;return o.jsx(rt,{schema:Me,path:`${t}.${ke}`,depth:K,required:he.has(ke),refStack:s,deref:i,ancestors:U,branchLineVariant:p,defaultExpanded:u,focusTokens:re,focusId:f},ke)}),de!==null&&oe(de)&&o.jsx(hr,{label:"Property names must adhere to:",children:Ne(de,`${t}.[propertyName]`,K)}),we.map(([ke,Me])=>o.jsx(rt,{schema:Me,path:Ig(t,ke),depth:K,refStack:s,deref:i,ancestors:U,branchLineVariant:p,defaultExpanded:u},ke)),Te!==null&&oe(Te)&&o.jsx(hr,{label:"Additional properties must adhere to:",children:Ne(Te,`${t}.[additionalProperty]`,K)}),Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]})};if(Gn(P)||Zr(P))return a?ye(n+1):o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:t,depth:n,schema:w,refLabel:_,required:r,description:w.description,expandable:!0,expanded:b,onToggle:()=>j(K=>!K)}),b&&o.jsx(Ot,{depth:n,lineVariant:c,children:ye(n+1)})]});if(P.type==="array"||P.items){const K=$l(P),ae=K!==null,he=ae?Tg(P):null,de=Cg(P),Te=de!==null,we=ae?null:Pt(P),ke=we!==null,Me=ae||ke||Te||Ke(w)||Xe(w)||Ze(w),re=`${t}[]`,J=a?t:re,H=ke?mt(we,i,s):null,B=(H==null?void 0:H.schema)??null,se=B?Fe(B,i,s):null,ue=B!==null&&(U.objects.has(B)||typeof(we==null?void 0:we.$ref)=="string"&&U.refs.has(we.$ref)),V=B!==null?{objects:new Set(U.objects).add(B),refs:typeof(we==null?void 0:we.$ref)=="string"?new Set(U.refs).add(we.$ref):U.refs}:U,me=!ae&&!Te&&se!==null&&st(se),Ce=se!=null&&se.properties?Object.entries(se.properties).filter(([,R])=>oe(R)):[],_e=new Set(se&&Array.isArray(se.required)?se.required:[]),Re=!ae&&d&&d[0]==="items"?d.slice(1):null,O=R=>o.jsxs(o.Fragment,{children:[ae?o.jsxs(o.Fragment,{children:[K.map((Z,ce)=>o.jsx(rt,{schema:Z,path:`${t}[${ce}]`,depth:R,refStack:s,deref:i,ancestors:U,branchLineVariant:p,defaultExpanded:u},ce)),he!==null&&typeof he!="boolean"&&o.jsx(hr,{label:"Additional items:",children:Ne(he,`${t}[*]`,R)}),he===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):ke&&(ue?o.jsx(Ge,{path:J,depth:R,typeLabelOverride:`↩ ${we.$ref??to(B)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Ce.length>0?Ce.map(([Z,ce])=>{const je=Re&&Re[0]==="properties"&&Re[1]===Z?Re.slice(2):null;return o.jsx(rt,{schema:ce,path:`${J}.${Z}`,depth:R,required:_e.has(Z),refStack:s,deref:i,ancestors:V,branchLineVariant:p,defaultExpanded:u,focusTokens:je,focusId:f},Z)}):o.jsx(rt,{schema:we,path:J,depth:R,refStack:s,deref:i,ancestors:V,branchLineVariant:p,defaultExpanded:u,focusTokens:Re,focusId:f})),Te&&o.jsx(hr,{label:"Contains at least one:",children:typeof de=="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:de?"any item":"impossible constraint"}):Ne(de,`${t}[contains]`,R)}),Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]});return me&&!Ke(w)&&!Xe(w)&&!Ze(w)?o.jsx(Ge,{id:y,path:re,depth:n,schema:w,itemSchema:se,refLabel:_,required:r,description:Pr(w.description,se.description),expandable:!1,expanded:!1,onToggle:()=>{}}):me?o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:re,depth:n,schema:w,itemSchema:se,refLabel:_,required:r,description:Pr(w.description,se.description),expandable:!0,expanded:b,onToggle:()=>j(R=>!R)}),b&&o.jsxs(Ot,{depth:n,lineVariant:c,children:[Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]})]}):a?Me?O(n+1):null:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:re,depth:n,schema:w,itemSchema:se,refLabel:_,required:r,description:w.description,expandable:ae||ke||Te||Ke(w)||Xe(w)||Ze(w),expanded:b,onToggle:()=>j(R=>!R)}),b&&o.jsx(Ot,{depth:n,lineVariant:c,children:O(n+1)})]})}if(Ke(w)||Xe(w)||Ze(w)){const K=o.jsxs(o.Fragment,{children:[Ke(w)&&ie(),Xe(w)&&S(w),Ze(w)&&M()]});return a?K:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:y,path:t,depth:n,schema:w,refLabel:_,required:r,description:w.description,expandable:!0,expanded:b,onToggle:()=>j(ae=>!ae)}),b&&o.jsx(Ot,{depth:n,lineVariant:c,children:K})]})}return a?null:o.jsx(Ge,{id:y,path:t,depth:n,schema:w,refLabel:_,required:r,description:w.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Go({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=De(),c=x.useMemo(()=>new Set,[]),u=ht(e),l=x.useMemo(()=>u?Fe(u,i,c):null,[u,i,c]);if(!u||!l)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(u.$ref?Uo(u.$ref):void 0)??"schema",f=!!t;if(!Mg(l,i)&&!u.$ref){if(f)return l.type==="array"||l.items?o.jsx("div",{className:n,children:o.jsx(rt,{schema:u,path:d,depth:0,refStack:c,deref:i,defaultExpanded:a,focusTokens:r,focusId:s})}):null;const m=l.type==="array"||l.items?`${d}[]`:d,g=Pt(l),y=g?Fe(g,i,c):null,b=y!==null&&st(y);return o.jsx("div",{className:n,children:o.jsx(Ge,{path:m,depth:0,schema:l,itemSchema:b?y:void 0,description:l.type==="array"||l.items?Pr(l.description,g==null?void 0:g.description):l.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:n,children:o.jsx(rt,{schema:u,path:d,depth:f?-1:0,refStack:c,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:r,focusId:s})})}const Yg=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function mr(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function nn(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return Yg(i)?r.has(s)?mr(i,"null")?{type:"null"}:{}:nn(i,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return mr(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return nn({...i,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return nn({...i,...s[0]},t,n,r)}if(mr(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[i,a]of Object.entries(e.properties)){const c=/id$/i.test(i)&&a.type==="string"&&!a.format&&!a.examples,u=a.type==="string"&&!a.format&&!a.examples&&!a.enum;s[i]=c?{...a,format:"uuid"}:u?{...a,examples:["string"]}:nn(a,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(mr(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:nn(e.items,t,n,r)}}finally{n.delete(e)}}return e}function Xg({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=x.useState(n?t:null),{deref:i}=De();if(x.useEffect(()=>{if(n){s(t);return}let c=!1;return Promise.resolve().then(()=>require("./index-Ccy_JZ0T.cjs")).then(({generate:u})=>u(nn(e,i),{seed:42,useExamplesValue:!0,optionalsProbability:1})).then(u=>{c||s(u)}).catch(()=>{}),()=>{c=!0}},[e,i,n,t]),r===null)return null;const a=JSON.stringify(r,null,2);return o.jsxs("div",{children:[o.jsx(Xr,{code:a}),!n&&o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function Dt({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:c,example:u,defaultView:l="example"}){const d=$c(s),f=!c&&yp(s,a),[p,m]=x.useState(f&&l==="example"?"example":"schema");return x.useEffect(()=>{!f&&p==="example"&&m("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})]}),r&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:r})]}),o.jsx(Ul,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:g=>m(g),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 ",Ic(s)??"the"," schema, showing raw definition. ",a]}),c?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[p==="schema"&&o.jsx(Go,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(_l,{schema:i??e}),p==="example"&&f&&o.jsx(Xg,{schema:e,providedExample:u})]})]})}function Ko({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var m;const[i,a]=x.useState("payload");x.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:c}=De(),u=Ur(),l=x.useMemo(()=>e.payload?ln(e.payload,c):null,[e.payload,c,u]),d=x.useMemo(()=>e.headers?ln(e.headers,c):null,[e.headers,c,u]),f=(m=e.examples)==null?void 0:m[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:`${r} 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(Ht,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:g=>a(g)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&l&&o.jsx(Dt,{schema:l.schema,label:"Payload",description:l.description,schemaFormat:l.schemaFormat,originalSchema:l.originalSchema,conversionError:l.conversionError,pendingConversion:l.pendingConversion,example:f==null?void 0:f.payload}),(i==="headers"||!e.payload)&&d&&o.jsx(Dt,{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((g,y)=>o.jsx(Fo,{name:`#${g.name}`},y))})]})})}),p&&o.jsxs("button",{onClick:n,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(pn,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Zg({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[i,a]=x.useState(!1);return x.useEffect(()=>{r&&a(!0)},[r]),o.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${r?"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(Ko,{message:t,expanded:i,onToggleExpanded:()=>a(c=>!c),paddingX:"px-6",focusSection:r?s:null})})})]})}function Wl({messages:e,selectedKey:t,focusSection:n,layout:r}){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,c],u)=>o.jsx(Zg,{messageKey:a,message:c,first:u===0,isSelected:t===a,focusSection:n},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(nt,{content:i,stickySideContent:!1,layout:r})})}function Gl({serverNames:e=[],current:t,setCurrent:n}){return o.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(r=>o.jsx("button",{type:"button",onClick:()=>n(r),"aria-current":t===r?"page":void 0,className:$t(t===r?"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:r})},r))})}function Kl(e){return o.jsx(ho,{...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 Qg(e){return o.jsx(ho,{...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 Vl({address:e,variables:t,children:n}){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(Qg,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Et,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function Jl({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 Kn({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:i=""}){const[a,c]=x.useState(n),u=x.useId();return x.useEffect(()=>{r&&c(!0)},[r]),o.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${i}`,children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":u,"aria-labelledby":s,onClick:()=>c(l=>!l),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(pn,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Jl,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:u,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 Es={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 Ns(e){var n,r;const t=(n=e.type)==null?void 0:n.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(r=e.scheme)==null?void 0:r.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function qg(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function ex(e){const t=(e??[]).filter(s=>Es[Ns(s)]),n=new Map;for(const s of t){const i=Es[Ns(s)];n.set(i,(n.get(i)??0)+1)}const r=new Set;return t.map((s,i)=>{const a=Ns(s),c=Es[a],u=(n.get(c)??0)>1?qg(s):void 0;let l=u?`${c} (${u})`:c;return r.has(l)&&(l=`${l} #${i+1}`),r.add(l),{id:`${a}-${i}`,name:l,kind:a,scheme:s}})}function Vo({securities:e}){var l;const t=x.useMemo(()=>ex(e),[e]),n=t.length>1,[r,s]=x.useState(n?null:((l=t[0])==null?void 0:l.id)??null);x.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===r),a=i==null?void 0:i.kind,c=i==null?void 0:i.scheme,u=c==null?void 0:c.description;return o.jsxs("div",{children:[n&&o.jsx(Ht,{tabs:t,current:r,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(gr,{description:u,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(gr,{description:u,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(gr,{description:u,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(gr,{description:u,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(tx,{security:c}),a==="apiKey"&&o.jsx(nx,{security:c}),a==="openIdConnect"&&o.jsx(rx,{security:c}),a==="oauth2"&&o.jsx(sx,{security:c})]})]})}const gr=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(at,{children:e})}):o.jsx("span",{children:t}),tx=({security:e})=>e!=null&&e.description?o.jsx(at,{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."]}),nx=({security:e})=>{if(e!=null&&e.description)return o.jsx(at,{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."]})},rx=({security:e})=>{var n,r;const t=(n=e.requiredScopes)!=null&&n.length?e.requiredScopes:e.scopes;return o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(at,{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"," ",yt(e.openIdConnectUrl??"")?o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}):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:(r=e.requiredScopes)!=null&&r.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:Dd(t)})})]})]})},sx=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(at,{children:e.description}),t&&Object.entries(t).map(([n,r])=>{var u,l;let s="",i="";switch(n){case"clientCredentials":s=dd,i=fd;break;case"implicit":s=ld,i=ud;break;case"password":s=pd,i=hd;break;case"authorizationCode":s=md,i=gd;break}const a=(u=e.requiredScopes)!=null&&u.length?e.requiredScopes:r.availableScopes??r.scopes,c=(l=e.requiredScopes)!=null&&l.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:[r.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:yt(r.authorizationUrl)?o.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.authorizationUrl}):r.authorizationUrl})]}),r.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:yt(r.tokenUrl)?o.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.tokenUrl}):r.tokenUrl})]}),r.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:yt(r.refreshUrl)?o.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.refreshUrl}):r.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:c}),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))})})]})]})})]},n)})]})};function Yl(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Xl({value:e}){if(e==null)return null;if(typeof e=="string"&&yt(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((n,r)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},r))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?o.jsx(at,{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(([n,r])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:Yl(n)}),o.jsx(Xl,{value:r})]},n))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Zl({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=yd[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},i=Object.entries(e??{}).filter(([a,c])=>a!=="bindingVersion"&&c!==void 0&&c!==null);return i.length===0?null:o.jsx(Kn,{className:"mt-2",defaultExpanded:t,forceExpanded:r,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,c])=>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:Yl(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Xl,{value:c})})]},a))})})}function ox({host:e,protocol:t,description:n,tags:r,variables:s,security:i,bindings:a,serverKey:c,focusSection:u=null}){const l=s,d=x.useId();return o.jsxs("div",{children:[o.jsx(Vl,{address:e,variables:l,children:o.jsx("div",{className:"mt-2",children:r&&r.map((f,p)=>{const m=f,g=m.externalDocs;return o.jsx(Fo,{href:g&&g.url,title:m.description||(g&&g.description?g.description:void 0),name:m.name},p)})})}),o.jsx(at,{children:n}),i&&i.length>0&&o.jsxs("div",{id:c?`server-${c}-security`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Kl,{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(Kn,{className:"mt-4",ariaLabelledBy:d,forceExpanded:u==="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(Vo,{securities:i})})})]}),(()=>{const f=a==null?void 0:a[t];return f&&Object.keys(f).some(m=>m!=="bindingVersion")?o.jsxs("div",{id:c?`server-${c}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(go,{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(Zl,{bindings:f,protocol:t,focused:u===`binding:${t}`})]}):null})()]})}function Ql({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null,layout:s}){const i=Object.keys(e),[a,c]=x.useState(void 0),u=[t,a].find(f=>!!f&&i.includes(f))??i[0],l=f=>{c(f),n==null||n(f)},d=o.jsx(ox,{...e[u],serverKey:u,focusSection:t||a?r:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:Qa,content:d,sideContent:o.jsx(Gl,{serverNames:i,current:u,setCurrent:l}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const ql=x.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:i,children:a,width:c="w-[50rem]"},u){x.useEffect(()=>{if(!t)return;const N=A=>{A.key==="Escape"&&r()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[t,r]);const l=n==="right"?"right-0":"left-0",d=n==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:m,sidePanelTopOffset:g=0}=De(),y=m==="component";x.useEffect(()=>{if(!t||!f)return;const N=y?Md(f,p):po(f);if(N)return rc(N)},[y,t,f,p]);const b=Os(p,y),j=(()=>{if(!y)return{position:"fixed",inset:0};if(!b)return{position:"fixed",inset:0};const N=Math.max(g,b.top),A=Math.max(0,b.left),$=Math.min(window.innerHeight,b.bottom),F=Math.min(window.innerWidth,b.right);return{position:"fixed",top:N,left:A,width:Math.max(0,F-A),height:Math.max(0,$-N)}})();return f?an.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...j,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:r,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:u,className:`absolute top-0 ${l} h-full ${c} 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:r,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 eu({message:e,messageId:t,i:n}){const[r,s]=x.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 ${n+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(Ko,{message:e,expanded:r,onToggleExpanded:()=>s(i=>!i)})]})}function ix({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,i]=x.useState("request"),a=t.messages??[],c=t.channel,u=t.address,l=s==="request"?e:a,d=s==="request"?n?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",u?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:u.location})]}):(c==null?void 0:c.address)&&o.jsx(Et,{address:c.address,parameters:c.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
136
+ ${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:l.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:r})," ",d,l.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:l.map((f,p)=>o.jsx(eu,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const ax="",cx=`
137
+ `;var ft=class{constructor({indent:e,join:t}={}){this.code=[],this.indentLine=(n,r=0)=>`${this.indentationCharacter.repeat(r)}${n}`,this.push=(n,r=0)=>{this.code.push(this.indentLine(n,r))},this.blank=()=>{this.code.push("")},this.join=()=>this.code.join(this.lineJoin),this.indentationCharacter=e??ax,this.lineJoin=t??cx}},Vn=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},lx=class extends Vn{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},ux=class extends Vn{constructor(e,t,n=[]){const r=n.length>0?` Registered targetId/clientId pairs: ${n.join(", ")}.`:" No targets are registered — did you forget to import a client module?";super(`Unsupported target "${e}/${t}".${r}`),this.name="UnsupportedTargetError"}},dx=class extends Vn{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},fx=class extends Vn{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"}},Ba=class extends Vn{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 Fa=10;function px(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function hx(e,t){if(!t.startsWith("#/"))throw new Error(`Unsupported $ref "${t}": only local refs (starting with "#/") are supported`);const n=t.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const s of n){if(typeof r!="object"||r===null)throw new Error(`Cannot resolve $ref "${t}": no value at "${s}"`);r=r[s]}return r}function kt(e,t){let n=t;for(let r=0;px(n);r++){if(r>=Fa)throw new Error(`Exceeded max $ref depth (${Fa}) resolving "${n.$ref}" — possible cycle`);n=hx(e,n.$ref)}return n}const mx=10;function gx(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 xx(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function no(e,t,n=0){if(n>mx)return;const r=kt(e,t);if(!r||typeof r!="object")return;const s=r;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(xx(s.type)){case"object":{const i={};for(const[a,c]of Object.entries(s.properties??{})){const u=no(e,c,n+1);u!==void 0&&(i[a]=u)}return i}case"array":{if(s.items===void 0)return[];const i=no(e,s.items,n+1);return i!==void 0?[i]:[]}case"string":return gx(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const bx=10;function yx(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function In(e,t,n=0){if(n>=bx||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>In(e,s,n+1));if(yx(t))return In(e,kt(e,t),n+1);const r={};for(const[s,i]of Object.entries(t))r[s]=In(e,i,n+1);return r}function tu(e,t,n){return e!==void 0?{value:String(e),isPlaceholder:!1}:t&&t.length>0?{value:String(t[0]),isPlaceholder:!1}:{value:`<${n}>`,isPlaceholder:!0}}function xr(e,t){return e?tu(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function za(e){const t={},n=[];for(const[r,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=tu(s.default,s.examples,r);t[r]=i.value,i.isPlaceholder&&n.push(r)}return{values:t,placeholders:n}}function Ha(e,t){return t!=null&&t.length?t.map(n=>kt(e,n)).filter(n=>!!(n!=null&&n.type)):[]}const wx={"kafka-secure":"kafka",wss:"ws"};function kx(e){return wx[e]??e}function vx(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function jx(e){return e.slice(e.lastIndexOf("/")+1)}function Sx(e,t){return t&&t.length>0?t.map(n=>{const r=kt(e,n);if(r)return{name:vx(n)?jx(n.$ref):"",server:r}}).filter(n=>!!n):Object.entries(e.servers??{}).map(([n,r])=>{const s=kt(e,r);return s?{name:n,server:s}:void 0}).filter(n=>!!n)}function nu(e,t){var i;const n=(i=e.operations)==null?void 0:i[t],r=n&&kt(e,n);if(!r)throw new lx(t);const s=kt(e,r.channel);if(!s)throw new dx(t);return{operation:r,channel:s}}function ru(e,t,n,r){var c;const s=Sx(e,n.servers??t.servers),i=s.find(u=>kx(u.server.protocol)===r),a=(c=t.bindings)==null?void 0:c[r];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function Ax(e,t,n){try{const{operation:r,channel:s}=nu(e,t);return ru(e,s,r,n).eligible}catch{return!1}}function Ex(e,t,n){var L,U,P,X,ie,E,S,M,W,Q,ne,Ae,Ne,ye;const{operation:r,channel:s}=nu(e,t),{servers:i,matchedServer:a,eligible:c}=ru(e,s,r,n);if(!c)throw new fx(t,n);const u=[];let l={},d={},f;if(n==="ws"){const q=za((U=(L=s.bindings)==null?void 0:L.ws)==null?void 0:U.query),le=za((X=(P=s.bindings)==null?void 0:P.ws)==null?void 0:X.headers);l=q.values,d=le.values,u.push(...q.placeholders.map(K=>`query param "${K}"`)),u.push(...le.placeholders.map(K=>`header "${K}"`))}else n==="kafka"&&(f=(E=(ie=s.bindings)==null?void 0:ie.kafka)==null?void 0:E.topic);const p=s.address??"";let m=p;for(const[q,le]of Object.entries(s.parameters??{})){const K=xr(le,q);m=m.replace(`{${q}}`,K.value),K.isPlaceholder&&u.push(`channel parameter "${q}"`)}n==="kafka"&&f&&(m=f);const g=(S=a??i[0])==null?void 0:S.server,y=g?`${g.protocol}://${g.host}${g.pathname??""}`:"",b=(g==null?void 0:g.host)??"",j=Ha(e,g==null?void 0:g.security),N=i.map(({name:q,server:le})=>({name:q,host:le.host,protocol:le.protocol,pathname:le.pathname,url:`${le.protocol}://${le.host}${le.pathname??""}`,description:le.description,security:Ha(e,le.security)})),A=r.messages!==void 0?kt(e,r.messages[0]):kt(e,Object.values(s.messages??{})[0]),$=(M=A==null?void 0:A.examples)==null?void 0:M[0];let F,G;if($)F=$.name,G=$.payload;else if((A==null?void 0:A.payload)!==void 0){if(G=no(e,A.payload),G===void 0)throw new Ba(t);u.push("message payload (no explicit example — generated from its schema)")}else throw new Ba(t);const T=(A==null?void 0:A.payload)!==void 0?In(e,A.payload):void 0,v=(A==null?void 0:A.headers)!==void 0?In(e,A.headers):void 0,w=r.action==="send"?"send":"receive";let _;if(n==="kafka"){const q=(Q=(W=A==null?void 0:A.bindings)==null?void 0:W.kafka)==null?void 0:Q.key,le=q?xr(q,"kafka message key"):void 0;le!=null&&le.isPlaceholder&&u.push("kafka message key");const K=xr((Ae=(ne=r.bindings)==null?void 0:ne.kafka)==null?void 0:Ae.clientId,"kafka clientId");K.isPlaceholder&&u.push("kafka clientId");let ae;w==="receive"&&(ae=xr((ye=(Ne=r.bindings)==null?void 0:Ne.kafka)==null?void 0:ye.groupId,"kafka consumer group id"),ae.isPlaceholder&&u.push("kafka consumer group id")),_={key:le==null?void 0:le.value,groupId:ae==null?void 0:ae.value,clientId:K.value}}return{operationId:t,action:w,protocol:n,serverUrl:y,serverHost:b,servers:N,channelAddress:m,channelTemplate:p,query:l,headers:d,operationSummary:r.summary,operationDescription:r.description,message:{name:F,payload:G,title:(A==null?void 0:A.title)??(A==null?void 0:A.name),summary:A==null?void 0:A.summary,description:A==null?void 0:A.description,contentType:A==null?void 0:A.contentType,payloadSchema:T,headersSchema:v},placeholders:u,info:e.info,security:j,..._?{kafka:_}:{}}}function Nx(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 Tx(e,t){if(t.length!==0){e("**Authorization:**");for(const n of t)if(e(`- **${Nx(n)}**`),n.description&&e(n.description,1),n.type==="openIdConnect"&&n.openIdConnectUrl&&e(`- OpenID Connect URL: \`${n.openIdConnectUrl}\``,1),n.type==="oauth2")for(const[r,s]of Object.entries(n.flows??{})){e(`- Flow \`${r}\`:`,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 Cx(e,t,n){e(`### ${n.name||n.host}`),t(),e(`**Host:** \`${n.host}${n.pathname??""}\``),e(`**Protocol:** ${n.protocol}`),n.description&&e(n.description),t(),n.security.length>0&&(Tx(e,n.security),t())}function Ua(e,t,n,r){e(`#### \`${n}\``),t(),e("```json");for(const s of JSON.stringify(r,null,2).split(`
138
+ `))e(s);e("```"),t()}function su(e,t){var l,d,f,p,m,g,y;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});r(`# ${((l=e.info)==null?void 0:l.title)??e.operationId}`),s();const a=(d=e.info)==null?void 0:d.license;if(r(`**Version:** ${((f=e.info)==null?void 0:f.version)??"unknown"}${a?" ":""}`),a&&r(`**License:** ${a.name??""}${a.url?` (${a.url})`:""}`),s(),(p=e.info)!=null&&p.description&&(r(e.info.description),s()),r(`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){r("## Servers"),s();for(const b of e.servers)Cx(r,s,b)}r(`### ${e.action.toUpperCase()} \`${e.operationId}\``),s(),r(`**Channel:** \`${e.channelTemplate}\``);const c=Object.keys(e.query),u=Object.keys(e.headers);if(c.length>0&&r(`**Query parameters:** ${c.map(b=>`\`${b}=${e.query[b]}\``).join(", ")}`),u.length>0&&r(`**Headers:** ${u.map(b=>`\`${b}: ${e.headers[b]}\``).join(", ")}`),((m=e.kafka)==null?void 0:m.clientId)!==void 0&&r(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((g=e.kafka)==null?void 0:g.groupId)!==void 0&&r(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((y=e.kafka)==null?void 0:y.key)!==void 0&&r(`**Kafka message key:** \`${e.kafka.key}\``),s(),e.operationSummary&&(r(e.operationSummary),s()),e.operationDescription&&(r(e.operationDescription),s()),r(`#### ${e.message.title??e.operationId}`),s(),e.message.summary&&(r(e.message.summary),s()),e.message.description&&(r(e.message.description),s()),e.message.contentType&&(r(`**Content-Type:** \`${e.message.contentType}\``),s()),e.message.payloadSchema!==void 0&&Ua(r,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&Ua(r,s,"headers",e.message.headersSchema),r("## Instructions"),s(),e.action==="send"?(r("1. Construct a JSON payload that conforms to the `payload` schema above."),r(`2. Send it to the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`)):(r(`1. Subscribe/listen on the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`),r("2. Expect incoming messages conforming to the `payload` schema above.")),e.placeholders.length>0){r("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)r(`- ${b}`,1)}return i()}const _x={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)=>su(e,t)},$x={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)=>su(e,t)};function Jn(e,t,n){const r=e.replace(/\/$/,""),s=t.startsWith("/")?t:`/${t}`,i=new URLSearchParams(n).toString();return i?`${r}${s}?${i}`:`${r}${s}`}const Ix={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 n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const u of e.placeholders)r(`// - ${u}`);s()}const a=Jn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(r("use futures_util::{SinkExt, StreamExt};"),c.length>0?r("use tokio_tungstenite::{connect_async, tungstenite::client::IntoClientRequest, tungstenite::Message};"):r("use tokio_tungstenite::{connect_async, tungstenite::Message};"),s(),s(),r("#[tokio::main]"),r("async fn main() {"),r(`let url = ${JSON.stringify(a)};`,1),s(),c.length>0){r('let mut request = url.into_client_request().expect("Invalid URL");',1);for(const[u,l]of c)r("request",1),r(".headers_mut()",2),r(`.insert(${JSON.stringify(u)}, ${JSON.stringify(l)}.parse().expect("Invalid header value"));`,2);s(),r('let (ws_stream, _) = connect_async(request).await.expect("Failed to connect");',1)}else r('let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");',1);if(r(`let (${e.action==="send"?"mut write":"_write"}, mut read) = ws_stream.split();`,1),s(),e.action==="send"){const u=JSON.stringify(e.message.payload,null,2).split(`
139
+ `);u[u.length-1]+=");",r(`let payload = serde_json::json!(${u[0]}`,1);for(const l of u.slice(1))r(l,1);s(),r("write",1),r(".send(Message::Text(payload.to_string().into()))",2),r(".await",2),r('.expect("Failed to send message");',2),s(),r("if let Some(msg) = read.next().await {",1),r('println!("{}", msg.expect("Failed to read message"));',2),r("}",1)}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const u of JSON.stringify(e.message.payload,null,2).split(`
140
+ `))r(`// ${u}`,1);s(),r("while let Some(msg) = read.next().await {",1),r('println!("{}", msg.expect("Failed to read message"));',2),r("}",1)}return r("}"),i()}},Ox={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 c,u,l;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const d of e.placeholders)r(`// - ${d}`);s()}const a=((c=e.kafka)==null?void 0:c.clientId)??"";if(e.action==="send"){r("use rdkafka::config::ClientConfig;"),r("use rdkafka::producer::{FutureProducer, FutureRecord};"),r("use std::time::Duration;"),s(),s(),r("#[tokio::main]"),r("async fn main() {"),r("let producer: FutureProducer = ClientConfig::new()",1),r(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),r(`.set("client.id", ${JSON.stringify(a)})`,2),r(".create()",2),r('.expect("Failed to create producer");',2),s();const d=JSON.stringify(e.message.payload,null,2).split(`
141
+ `);d[d.length-1]+=");",r(`let payload = serde_json::json!(${d[0]}`,1);for(const f of d.slice(1))r(f,1);s(),r(`let record = FutureRecord::to(${JSON.stringify(e.channelAddress)})`,1),r(".payload(&payload.to_string())",2),((u=e.kafka)==null?void 0:u.key)!==void 0?r(`.key(${JSON.stringify(e.kafka.key)});`,2):r('.key("");',2),s(),r("producer",1),r(".send(record, Duration::from_secs(0))",2),r(".await",2),r('.expect("Failed to send message");',2),r("}")}else{const d=((l=e.kafka)==null?void 0:l.groupId)??"";r("use rdkafka::config::ClientConfig;"),r("use rdkafka::consumer::{Consumer, StreamConsumer};"),r("use rdkafka::Message;"),r("use futures_util::StreamExt;"),s(),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
142
+ `))r(`// ${f}`);s(),r("#[tokio::main]"),r("async fn main() {"),r("let consumer: StreamConsumer = ClientConfig::new()",1),r(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),r(`.set("group.id", ${JSON.stringify(d)})`,2),r(`.set("client.id", ${JSON.stringify(a)})`,2),r('.set("auto.offset.reset", "earliest")',2),r(".create()",2),r('.expect("Failed to create consumer");',2),s(),r(`consumer.subscribe(&[${JSON.stringify(e.channelAddress)}]).expect("Failed to subscribe");`,1),s(),r("let mut stream = consumer.stream();",1),r("while let Some(message) = stream.next().await {",1),r('let message = message.expect("Failed to read message");',2),r("if let Some(payload) = message.payload_view::<str>().and_then(Result::ok) {",2),r('println!("{}", payload);',3),r("}",2),r("}",1),r("}")}return i()}};function ro(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+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?"[]":`[
143
+ ${e.map(a=>`${s}${ro(a,t,n+1)}`).join(`,
144
+ `)},
145
+ ${r}]`;const i=Object.entries(e);return i.length===0?"{}":`{
146
+ ${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${ro(c,t,n+1)}`).join(`,
147
+ `)},
148
+ ${r}}`}const Mx={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 n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("# NOTE: some values could not be resolved from the AsyncAPI document's"),r("# default/examples and were filled with a placeholder — replace them"),r("# with real values before running this snippet:");for(const u of e.placeholders)r(`# - ${u}`);s()}r("import asyncio"),e.action==="send"&&r("import json"),s(),r("import websockets"),s(),s(),r("async def main() -> None:");const a=Jn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(c.length>0){r("async with websockets.connect(",1),r(`${JSON.stringify(a)},`,2),r("additional_headers={",2);for(const[u,l]of c)r(`${JSON.stringify(u)}: ${JSON.stringify(l)},`,3);r("},",2),r(") as websocket:",1)}else r(`async with websockets.connect(${JSON.stringify(a)}) as websocket:`,1);if(s(),e.action==="send"){const u=ro(e.message.payload,n.indent).split(`
149
+ `);u[u.length-1]+=")",r("await websocket.send(",2),r(`json.dumps(${u[0]}`,3);for(const l of u.slice(1))r(l,3);r(")",2),s(),r("message = await websocket.recv()",2),r("print(message)",2)}else{r(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,2);for(const u of JSON.stringify(e.message.payload,null,2).split(`
150
+ `))r(`# ${u}`,2);s(),r("async for message in websocket:",2),r("print(message)",3)}return s(),s(),r("asyncio.run(main())"),i()}};function so(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+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?"[]":`[
151
+ ${e.map(a=>`${s}${so(a,t,n+1)}`).join(`,
152
+ `)},
153
+ ${r}]`;const i=Object.entries(e);return i.length===0?"{}":`{
154
+ ${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${so(c,t,n+1)}`).join(`,
155
+ `)},
156
+ ${r}}`}const Rx={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 c,u,l;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("# NOTE: some values could not be resolved from the AsyncAPI document's"),r("# default/examples and were filled with a placeholder — replace them"),r("# with real values before running this snippet:");for(const d of e.placeholders)r(`# - ${d}`);s()}r("import json"),s(),e.action==="send"?r("from confluent_kafka import Producer"):r("from confluent_kafka import Consumer"),s(),s();const a=((c=e.kafka)==null?void 0:c.clientId)??"";if(e.action==="send"){r("producer = Producer({",0),r(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),r(`"client.id": ${JSON.stringify(a)},`,1),r("})"),s();const d=so(e.message.payload,n.indent).split(`
157
+ `);d[d.length-1]+=")",r(`payload = json.dumps(${d[0]}`);for(const f of d.slice(1))r(f);s(),r("producer.produce(",0),r(`${JSON.stringify(e.channelAddress)},`,1),r("value=payload.encode('utf-8'),",1),((u=e.kafka)==null?void 0:u.key)!==void 0&&r(`key=${JSON.stringify(e.kafka.key)},`,1),r(")"),r("producer.flush()")}else{const d=((l=e.kafka)==null?void 0:l.groupId)??"";r("consumer = Consumer({",0),r(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),r(`"group.id": ${JSON.stringify(d)},`,1),r(`"client.id": ${JSON.stringify(a)},`,1),r('"auto.offset.reset": "earliest",',1),r("})"),s(),r(`# 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
+ `))r(`# ${f}`);s(),r(`consumer.subscribe([${JSON.stringify(e.channelAddress)}])`),s(),r("try:"),r("while True:",1),r("msg = consumer.poll(1.0)",2),r("if msg is None:",2),r("continue",3),r("if msg.error():",2),r("print(msg.error())",3),r("continue",3),r("print(msg.value().decode('utf-8'))",2),r("finally:"),r("consumer.close()",1)}return i()}},Lx={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 n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent}),a=Object.keys(e.headers);if(a.length>0&&(r(`// NOTE: this operation's "ws" binding declares handshake headers`),r(`// (${a.join(", ")}), but the browser-native WebSocket API cannot`),r("// set custom headers on the handshake request — they are omitted below."),r("// Move any required auth into the query string, or generate a Node.js"),r('// snippet instead (targetId: "javascript", clientId: "ws").'),s()),e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const c of e.placeholders)r(`// - ${c}`);s()}if(r(`const socket = new WebSocket('${Jn(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){r("socket.addEventListener('open', () => {");const c=JSON.stringify(e.message.payload,null,2).split(`
159
+ `);c[c.length-1]+="));",r(`socket.send(JSON.stringify(${c[0]}`,1);for(const u of c.slice(1))r(u,1);r("});"),s(),r("socket.addEventListener('message', (event) => {"),r("console.log(event.data);",1),r("});")}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const c of JSON.stringify(e.message.payload,null,2).split(`
160
+ `))r(`// ${c}`);s(),r("socket.addEventListener('message', (event) => {"),r("console.log(event.data);",1),r("});")}return i()}},Px={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 u,l,d;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const f of e.placeholders)r(`// - ${f}`);s()}r("import { Kafka } from 'kafkajs';"),s();const a=e.serverHost.split(",").map(f=>f.trim()).filter(Boolean),c=((u=e.kafka)==null?void 0:u.clientId)??"";if(r("const kafka = new Kafka({"),r(`clientId: '${c}',`,1),r(`brokers: [${a.map(f=>`'${f}'`).join(", ")}],`,1),r("});"),s(),e.action==="send"){r("const producer = kafka.producer();"),s(),r("async function main() {"),r("await producer.connect();",1),r("await producer.send({",1),r(`topic: '${e.channelAddress}',`,2),r("messages: [",2),r("{",3),((l=e.kafka)==null?void 0:l.key)!==void 0&&r(`key: '${e.kafka.key}',`,4);const f=JSON.stringify(e.message.payload,null,2).split(`
161
+ `);f[f.length-1]+="),",r(`value: JSON.stringify(${f[0]}`,4);for(const p of f.slice(1))r(p,4);r("},",3),r("],",2),r("});",1),r("await producer.disconnect();",1),r("}"),s(),r("main();")}else{r(`const consumer = kafka.consumer({ groupId: '${((d=e.kafka)==null?void 0:d.groupId)??""}' });`),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
162
+ `))r(`// ${f}`);s(),r("async function main() {"),r("await consumer.connect();",1),r(`await consumer.subscribe({ topic: '${e.channelAddress}', fromBeginning: true });`,1),s(),r("await consumer.run({",1),r("eachMessage: async ({ message }) => {",2),r("console.log(message.value?.toString());",3),r("},",2),r("});",1),r("}"),s(),r("main();")}return i()}};function oo(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+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{}{
163
+ ${e.map(a=>`${s}${oo(a,t,n+1)}`).join(`,
164
+ `)},
165
+ ${r}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
166
+ ${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${oo(c,t,n+1)}`).join(`,
167
+ `)},
168
+ ${r}}`}const Dx={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 n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const u of e.placeholders)r(`// - ${u}`);s()}const a=Jn(e.serverUrl,e.channelAddress,e.query),c=Object.entries(e.headers);if(r("package main"),s(),r("import ("),e.action==="send"&&r('"encoding/json"',1),r('"log"',1),c.length>0&&r('"net/http"',1),s(),r('"github.com/gorilla/websocket"',1),r(")"),s(),r("func main() {"),r(`url := ${JSON.stringify(a)}`,1),s(),c.length>0){r("header := http.Header{}",1);for(const[u,l]of c)r(`header.Set(${JSON.stringify(u)}, ${JSON.stringify(l)})`,1);s(),r("conn, _, err := websocket.DefaultDialer.Dial(url, header)",1)}else r("conn, _, err := websocket.DefaultDialer.Dial(url, nil)",1);if(r("if err != nil {",1),r('log.Fatal("dial:", err)',2),r("}",1),r("defer conn.Close()",1),s(),e.action==="send"){const u=oo(e.message.payload,n.indent).split(`
169
+ `);r(`payload := ${u[0]}`,1);for(const l of u.slice(1))r(l,1);s(),r("data, err := json.Marshal(payload)",1),r("if err != nil {",1),r('log.Fatal("marshal:", err)',2),r("}",1),r("if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {",1),r('log.Fatal("write:", err)',2),r("}",1),s(),r("_, message, err := conn.ReadMessage()",1),r("if err != nil {",1),r('log.Fatal("read:", err)',2),r("}",1),r("log.Println(string(message))",1)}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const u of JSON.stringify(e.message.payload,null,2).split(`
170
+ `))r(`// ${u}`,1);s(),r("for {",1),r("_, message, err := conn.ReadMessage()",2),r("if err != nil {",2),r('log.Println("read:", err)',3),r("return",3),r("}",2),r("log.Println(string(message))",2),r("}",1)}return r("}"),i()}};function io(e,t,n=0){const r=t.repeat(n),s=t.repeat(n+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{}{
171
+ ${e.map(a=>`${s}${io(a,t,n+1)}`).join(`,
172
+ `)},
173
+ ${r}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
174
+ ${i.map(([a,c])=>`${s}${JSON.stringify(a)}: ${io(c,t,n+1)}`).join(`,
175
+ `)},
176
+ ${r}}`}const Bx={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 c,u;const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const l of e.placeholders)r(`// - ${l}`);s()}const a=e.serverHost.split(",").map(l=>l.trim()).filter(Boolean);if(r("package main"),s(),r("import ("),e.action==="send"?(r('"context"',1),r('"encoding/json"',1),r('"log"',1)):(r('"context"',1),r('"log"',1)),s(),r('"github.com/segmentio/kafka-go"',1),r(")"),s(),r("func main() {"),e.action==="send"){r("writer := &kafka.Writer{",1),r(`Addr: kafka.TCP(${a.map(d=>JSON.stringify(d)).join(", ")}),`,2),r(`Topic: ${JSON.stringify(e.channelAddress)},`,2),r("Balancer: &kafka.LeastBytes{},",2),r("}",1),r("defer writer.Close()",1),s();const l=io(e.message.payload,n.indent).split(`
177
+ `);r(`payload := ${l[0]}`,1);for(const d of l.slice(1))r(d,1);s(),r("data, err := json.Marshal(payload)",1),r("if err != nil {",1),r('log.Fatal("marshal:", err)',2),r("}",1),s(),r("message := kafka.Message{Value: data}",1),((c=e.kafka)==null?void 0:c.key)!==void 0&&r(`message.Key = []byte(${JSON.stringify(e.kafka.key)})`,1),s(),r("if err := writer.WriteMessages(context.Background(), message); err != nil {",1),r('log.Fatal("write:", err)',2),r("}",1)}else{const l=((u=e.kafka)==null?void 0:u.groupId)??"";r("reader := kafka.NewReader(kafka.ReaderConfig{",1),r(`Brokers: []string{${a.map(d=>JSON.stringify(d)).join(", ")}},`,2),r(`Topic: ${JSON.stringify(e.channelAddress)},`,2),r(`GroupID: ${JSON.stringify(l)},`,2),r("})",1),r("defer reader.Close()",1),s(),r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const d of JSON.stringify(e.message.payload,null,2).split(`
178
+ `))r(`// ${d}`,1);s(),r("for {",1),r("message, err := reader.ReadMessage(context.Background())",2),r("if err != nil {",2),r('log.Println("read:", err)',3),r("return",3),r("}",2),r("log.Println(string(message.Value))",2),r("}",1)}return r("}"),i()}},Fx={info:{key:"ws",title:"ws",description:"WebSocket client for Node.js — chosen over the browser-native WebSocket API because it supports custom handshake headers",link:"https://github.com/websockets/ws",extname:".js",protocol:"ws"},convert:(e,t)=>{const n={indent:" ",...t},{push:r,blank:s,join:i}=new ft({indent:n.indent});if(e.placeholders.length>0){r("// NOTE: some values could not be resolved from the AsyncAPI document's"),r("// default/examples and were filled with a placeholder — replace them"),r("// with real values before running this snippet:");for(const c of e.placeholders)r(`// - ${c}`);s()}r("import WebSocket from 'ws';"),s();const a=Jn(e.serverUrl,e.channelAddress,e.query);if(Object.keys(e.headers).length>0){r(`const socket = new WebSocket('${a}', {`),r("headers: {",1);const c=Object.entries(e.headers);c.forEach(([u,l],d)=>{const f=d<c.length-1?",":"";r(`'${u}': '${l}'${f}`,2)}),r("},",1),r("});")}else r(`const socket = new WebSocket('${a}');`);if(s(),e.action==="send"){r("socket.on('open', () => {");const c=JSON.stringify(e.message.payload,null,2).split(`
179
+ `);c[c.length-1]+="));",r(`socket.send(JSON.stringify(${c[0]}`,1);for(const u of c.slice(1))r(u,1);r("});"),s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}else{r(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const c of JSON.stringify(e.message.payload,null,2).split(`
180
+ `))r(`// ${c}`);s(),r("socket.on('message', (data) => {"),r("console.log(data.toString());",1),r("});")}return i()}},dn={};function Yn(e){if(dn[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);dn[e.info.key]={...e,clientsById:{...e.clientsById}}}function ct(e,t){const n=dn[e];if(!n)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(n.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);n.clientsById[t.info.key]=t}function zx(){return Object.values(dn).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Hx(e,t){const n=[];for(const r of zx()){const s=r.clients.filter(i=>Ax(e,t,i.protocol));s.length>0&&n.push({...r,default:s[0].key,clients:s})}return n}Yn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});ct("agent",$x);ct("agent",_x);Yn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});ct("javascript",Fx);ct("javascript",Lx);ct("javascript",Px);Yn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});ct("python",Mx);ct("python",Rx);Yn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});ct("rust",Ix);ct("rust",Ox);Yn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});ct("go",Dx);ct("go",Bx);var Ux=class{constructor(e){this.document=e}convert(e,t,n,r={}){var a;const s=(a=dn[t])==null?void 0:a.clientsById[n];if(!s){const c=Object.values(dn).flatMap(u=>Object.keys(u.clientsById).map(l=>`${u.info.key}/${l}`));throw new ux(t,n,c)}const i=Ex(this.document,e,s.info.protocol);return s.convert(i,r)}};const Wx="javascript",Gx="ws";function Kx(e,t){return Hx(e,t)}function ou(e,t,n,r){try{return new Ux(e).convert(t,n,r)}catch{return null}}function Vx(e,t,n){if(t){for(const r of n)for(const s of r.clients)if(ou(e,t,r.key,s.key)!==null)return`${r.key}:${s.key}`}return`${Wx}:${Gx}`}const Jx={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 iu(e){return Jx[e]??"plaintext"}const Yx={c:()=>Promise.resolve().then(()=>require("./c-B4BAHWS4.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BA1RB3o9.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-IihVQN8U.cjs")),go:()=>Promise.resolve().then(()=>require("./go-By8nj0Vi.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-DFXAwvvK.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-B3HlgtFq.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-BMUCoWpx.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-CGL4kvvH.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-_vvcEGSJ.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-BAji1QIq.cjs"))};function Dr(e){return e==="plaintext"||!!ot.getLanguage(e)}async function au(e){if(Dr(e))return;const t=Yx[e];if(!t)return;const n=await t();ot.registerLanguage(e,n.default)}function Xx({operationId:e}){const{document:t,showCodeSamples:n}=it(),r=x.useId(),s=x.useMemo(()=>e?Kx(t,e):[],[t,e]),i=x.useMemo(()=>Vx(t,e,s),[t,e,s]),[a,c]=x.useState(null),u=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[l,d]=u.split(":"),f=iu(l),[,p]=x.useState(()=>Dr(f));x.useEffect(()=>{p(Dr(f));let g=!1;return au(f).then(()=>{g||p(!0)}),()=>{g=!0}},[f]);const m=x.useMemo(()=>e?ou(t,e,l,d):null,[t,e,l,d]);return!n||!m?null:o.jsxs("div",{id:`operation-${e}-code-sample`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{htmlFor:r,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:r,value:u,onChange:g=>c({document:t,operationId:e,selection:g.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(g=>o.jsx("optgroup",{label:g.title,children:g.clients.map(y=>o.jsx("option",{value:`${g.key}:${y.key}`,children:y.title},y.key))},g.key))})]}),o.jsx(Xr,{code:m,language:f})]})}const Cn="reference";function cu({name:e,context:t,enabled:n=!0,children:r}){const s=zc(e),[i,a]=x.useState(Cn),[c,u]=x.useState(()=>new Set([Cn])),l=x.useId(),d=x.useMemo(()=>new Map(s.map(b=>[b.id,b])),[s]),f=n&&s.length>0,p=f?d.get(i):void 0,m=(p==null?void 0:p.id)??Cn,g=[{id:Cn,name:"Reference"},...s.map(b=>({id:b.id,name:b.label}))],y=b=>{u(j=>j.has(b)?j:new Set([...j,b])),a(b)};return f?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:l,tabs:g,current:m,onChange:y}),o.jsx(Od,{tabs:g,current:m,idPrefix:l,renderPanel:(b,j)=>{if(!j&&!c.has(b.id))return null;if(b.id===Cn)return r;const N=d.get(b.id);if(!N)return null;const A=N.Component;return o.jsx(Gr,{label:`${e}:${N.pluginName}`,children:o.jsx(A,{...t})})}})]}):o.jsx(o.Fragment,{children:r})}function lu({op:e,id:t,focusSection:n=null}){var y;const{document:r}=Xa(),s=x.useId(),i=e.messages??[],a=e.tags??[],c=e.bindings,u=e.traits,l=e.reply,d=e.externalDocs,f=e.security,p=c??(Array.isArray(u)?(y=u.find(b=>b.bindings))==null?void 0:y.bindings:void 0),m=e.action===Er.SEND,g=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,j)=>o.jsx(eu,{message:b,messageId:b.name,i:j},j))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(cu,{name:"asyncapi.operation.tab",context:{document:r,operationId:t??""},enabled:!!t,children:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(d==null?void 0:d.url)&&yt(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(Hr,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(at,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Xx,{operationId:t}),t&&o.jsx(Fn,{name:"asyncapi.operation.reference.supplementary",context:{document:r,operationId:t}}),f&&f.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsx(Kn,{ariaLabelledBy:s,forceExpanded:n==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Vo,{securities:f})})})]}),p&&Object.entries(p).map(([b,j])=>j?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(Zl,{protocol:b,bindings:j,focused:n===`binding:${b}`})]},b):null),l?o.jsx(ix,{requestMessages:i,reply:l,isSend:m,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})," ",m?"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:"]}),g]}),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,j)=>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},j))})]})]})})})}const Zx=x.lazy(()=>import("@apiuikit/ws-try-it-plugin").then(({WsHeaderButton:e})=>({default:e})));function uu({op:e,operationKey:t}){var s;const n=e.channel,r=((s=e.title)==null?void 0:s.trim())||void 0;return r?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(wt,{method:e.action}),o.jsx("span",{className:"min-w-0 flex-1 truncate",title:(n==null?void 0:n.address)??void 0,children:r})]}):n!=null&&n.address?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(wt,{method:e.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:n.address,parameters:n.parameters,truncate:!0,peek:!0})})]}):o.jsx(o.Fragment,{children:t})}function du({operationKey:e}){const t=it(),n=t.specType==="asyncapi"?t.document:null;return t.showTryIt!==!0||!n?null:o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Gr,{label:"built-in:asyncapi.operation.tryIt",children:o.jsx(Zx,{document:n,operationId:e})})})}function fu({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,layout:s}){const i=d=>n==null?void 0:n(d);if(!Object.keys(e).length)return null;const a=t?e[t]:null,c=Object.keys(e).map(d=>{var N,A;const f=e[d],p=f.channel,m=p==null?void 0:p.address,g=p==null?void 0:p.parameters,y=((N=f.action)==null?void 0:N.toUpperCase())??"",b=((A=f.title)==null?void 0:A.trim())||void 0,j=t===d;return o.jsxs("tr",{id:`operation-${d}`,onClick:()=>i(d),role:"button",tabIndex:0,"aria-label":`${y||"Operation"} ${b??m??d}`,"aria-current":j?"true":void 0,onKeyDown:$=>{$.key!=="Enter"&&$.key!==" "||($.preventDefault(),i(d))},className:`cursor-pointer hover:bg-neutral-50 ${j?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:b?o.jsx("div",{className:"truncate text-sm font-medium text-foreground",title:m??void 0,children:b}):m&&o.jsx(Et,{address:m,parameters:g,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(wt,{method:f.action,className:"w-24"})})]},d)}),u=a&&t?o.jsx(uu,{op:a,operationKey:t}):t??"Operation",l=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:c})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:xd,content:l,stickySideContent:!1,layout:s})}),o.jsx(ql,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,headerActions:a&&t&&o.jsx(du,{operationKey:t}),children:a&&o.jsx(lu,{op:a,id:t,focusSection:r},t)})]})}function pu({schemaName:e,resolved:t,anchorId:n,selected:r=!1,focusTarget:s=null}){const i=t.schema,a=$c(t.schemaFormat),c=i.properties?Object.keys(i.properties).length:0;return o.jsxs("article",{id:n,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${r?"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:e}),t.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:t.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:i.type??"unknown"})]}),(i.format||a||c>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[i.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",i.format]}),a&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:t.schemaFormat,children:a}),c>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[c," properties"]})]}),t.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"," ",Ic(t.schemaFormat)??"the"," schema — showing raw definition. ",t.conversionError]}),t.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),t.pendingConversion?null:t.conversionError&&typeof t.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(_l,{schema:t.originalSchema})}):o.jsx(Go,{schema:i,rootName:e,className:"mt-4",focusTokens:r?(s==null?void 0:s.tokens)??null:null,focusId:r?(s==null?void 0:s.id)??null:null})]})}function Jo({schemas:e,selectedKey:t,focusTarget:n,layout:r}){const{deref:s}=De(),i=Ur(),a=x.useMemo(()=>Object.entries(e).map(([u,l])=>[u,ln(l,s)]),[e,s,i]),c=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([u,l])=>o.jsx(pu,{schemaName:u,resolved:l,anchorId:`schema-${u}`,selected:t===u,focusTarget:n},u))}):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(nt,{content:c,stickySideContent:!1,layout:r})})}const Qx=e=>e==="operations"||e==="messages"||e==="schemas",qx=(e,t)=>{switch(e){case"messages":return`message-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`operation-${t}`}};function e0({asyncapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var E,S,M,W;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(Q=>!!Q.slots["asyncapi.document.topbar"]))??!1,m=d||f||p,g=[...i.operations!==!1?[{id:"operations",name:"Operations",icon:zr}]:[],...i.messages!==!1?[{id:"messages",name:"Messages",icon:dc}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:y,setQuery:b,results:j}=ep(e,{threshold:.3,limit:20}),{effectiveTab:N,focusTab:A,navActiveSection:$,selected:F,setSelectedKey:G,selectedNavItem:T,handleSearchSelect:v,handleNavItemSelect:w,handleNavServerSelect:_,handleContentTabChange:L,focusSection:U,schemaFocusTarget:P}=Cc({tabs:g,defaultTab:"operations",isTabKey:Qx,sections:[{id:"operations",visible:i.operations!==!1},{id:"messages",visible:i.messages!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:y,initialLocation:r,onLocationChange:s,getTargetId:qx}),X=e.servers?Object.keys(e.servers):[],ie=N==="operations"?o.jsx(fu,{operations:e.operations??{},selectedKey:F.operations,onSelectKey:Q=>G("operations",Q),focusSection:U}):N==="messages"?o.jsx(Wl,{messages:((E=e.components)==null?void 0:E.messages)??{},selectedKey:F.messages,focusSection:U}):N==="schemas"?o.jsx(Jo,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:F.schemas,focusTarget:P}):null;return o.jsx(Fr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"asyncapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:y,onQueryChange:b,results:j,onSelectResult:v,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:Q=>Ao(e,Q),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Cl,{...e.info,showLogo:!1})}),i.servers!==!1&&X.length>0&&o.jsx("div",{id:`server-${F.servers??X[0]}`,children:o.jsx(Ql,{servers:e.servers,selectedServer:F.servers,onSelectServer:Q=>G("servers",Q),focusSection:U})}),o.jsx(sc,{tabs:g,current:N,onChange:L}),N&&o.jsx("div",{id:`panel-${N}`,role:"tabpanel","aria-labelledby":`tab-${N}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:ie},`${N}-${F.operations}-${F.messages}-${F.schemas}`)}),i.sidebar!==!1&&o.jsx(qd,{operations:i.operations!==!1?e.operations:void 0,messages:i.messages!==!1?(M=e.components)==null?void 0:M.messages:void 0,schemas:i.schemas!==!1?(W=e.components)==null?void 0:W.schemas:void 0,servers:i.servers!==!1?e.servers:void 0,hasInfo:i.info!==!1,sidebarConfig:t.sidebar,activeTab:$,onTabChange:A,onItemSelect:w,onSelectServer:_,selectedItem:T})]})})}const Yo=e=>o.jsx(Ft,{resetKey:e.asyncapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(t0,{...e})}),t0=e=>{const t=e.asyncapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??Rt;return o.jsx(e0,{asyncapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Qr({document:e,config:t=Rt,plugins:n,className:r="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:c,setPortalHost:u,setRootElement:l}=tc("openapi",e,t,n);return o.jsx(zt.Provider,{value:i,children:o.jsxs("div",{ref:l,"data-theme":c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${r}`,children:[o.jsx("div",{ref:u,className:"openapi-portal-root"}),s]})})}function n0(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text: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 n=(s,{tab:i,type:a,idPrefix:c,docKey:u,sectionLabel:l})=>{for(const d of Object.keys(s)){const f=s[d];if(f)for(const p of hn){const m=f[p];if(!m)continue;const g=`${p} ${d}`,y=m.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${c}-${g}`,targetId:`${c}-${g}-detail`,type:a,tab:i,key:g,name:y,path:`${u}.${d}.${p}`,location:`${l} > ${p.toUpperCase()} ${d}`,subtitle:m.description,text:Ve([p,d,m.summary,m.description,m.operationId,m.tags,m.parameters,m.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas){const s=xo(e.components.schemas,Bt(e));for(const[i,a]of Object.entries(e.components.schemas))yc(t,a,i,i,s)}return t}function r0(e,t={}){return Nc(e,n0,t)}function hu({info:e,tags:t,externalDocs:n,layout:r,showLogo:s}){const{title:i,description:a,license:c,contact:u}=e??{};return o.jsx(Tl,{title:i,description:a,license:c,contact:u,externalDocs:n,tags:t,extensionsSource:e,layout:r,showLogo:s})}function s0({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(Vl,{address:e,variables:n}),t&&o.jsx(at,{children:t})]})}const Ts=e=>`server-${e}`,Cs=e=>Number(e.slice(7));function mu({servers:e,selectedServer:t,onSelectServer:n,layout:r}){const s=e.map((p,m)=>p.url||Ts(m)),[i,a]=x.useState(void 0),c=p=>!!p&&Cs(p)>=0&&Cs(p)<e.length,u=c(t)?t:c(i)?i:Ts(0),l=e[Cs(u)],d=p=>{a(p),n==null||n(p)},f=l?o.jsx(s0,{...l}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{title:Qa,content:f,sideContent:o.jsx(Gl,{serverNames:s,current:(l==null?void 0:l.url)||u,setCurrent:p=>{const m=s.indexOf(p);d(m>=0?Ts(m):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:r})})}function o0({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 gu(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function i0(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${gu(`$${n}`)}}`)}function a0(e){return e.operationId??e.operationRef??null}const c0=e=>e.trim().replace(/[.:;]+$/,""),_s=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function l0({links:e,onFollowOperation:t,isOperationKnown:n}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var d;const i=a0(s),a=Object.entries(s.parameters??{}),c=s.description?c0(s.description):null,u=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),l=c??i??r;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(o0,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[u?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:l}):o.jsx("span",{className:"text-foreground-secondary",children:l}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([f,p],m)=>o.jsxs(x.Fragment,{children:[m>0&&(m===a.length-1?" and ":", "),o.jsx(_s,{children:f})," from ",o.jsx(_s,{children:gu(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(_s,{children:s.server.url})]}):null,"."]})]},r)})})}function u0(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>hn.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function d0({callbacks:e,id:t,renderOperation:n,depth:r}){const s=u0(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:c,op:u,urlIndex:l})=>o.jsx(Kn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(wt,{method:c,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:i0(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(n,{method:c,path:a,op:u,id:`${t}-${i}-${l}-${c}`,idPrefix:"callback",depth:r+1})})},`${i}-${l}-${c}`))})]})}const f0=x.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-CaQ-Plnx.cjs")).then(({CodeSamples:e})=>({default:e})));function p0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function xu({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?o.jsx(o.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):o.jsxs(o.Fragment,{children:[e," (",o.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>o.jsx("option",{value:s,children:s},s))}),")"]})}function bu(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 h0(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 m0({responses:e,onFollowOperation:t,isOperationKnown:n}){var G,T;const r=Object.keys(e),[s,i]=x.useState(r[0]),a=e[s],c=Object.keys((a==null?void 0:a.content)??{}),[u,l]=x.useState(c[0]),d=u?(G=a==null?void 0:a.content)==null?void 0:G[u]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[m,g]=x.useState("body"),y=c.length>0&&!!d,b=Object.keys(f).length>0,j=Object.keys(p).length>0,N=[...y?[{id:"body",name:"Body"}]:[],...b?[{id:"headers",name:"Headers"}]:[]],A=N.length>1,$=N.some(v=>v.id===m)?m:(T=N[0])==null?void 0:T.id,F=N.length>0;return x.useEffect(()=>{l(Object.keys((a==null?void 0:a.content)??{})[0]),g("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(v=>o.jsx("button",{role:"tab","aria-selected":s===v,onClick:()=>i(v),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${h0(v)} ${s===v?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:v},v))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),F?o.jsxs(o.Fragment,{children:[A&&o.jsx(Ht,{tabs:N,current:$,onChange:v=>g(v)}),o.jsx("div",{className:A?"mt-4":void 0,children:$==="headers"?o.jsx(Dt,{schema:x0(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(Dt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(xu,{prefix:"Body",mediaTypes:c,selected:u,onChange:l}),rootName:"Body",example:bu(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&o.jsx(l0,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function yu(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const g0=e=>yu(e),x0=e=>yu(Object.entries(e).map(([t,n])=>({name:t,...n})));function b0({parameters:e}){var c;const t=wd.filter(({location:u})=>e.some(l=>l.in===u)),[n,r]=x.useState(((c=t[0])==null?void 0:c.location)??null);if(t.length===0)return null;const s=t.some(u=>u.location===n)?n:t[0].location,i=t.find(u=>u.location===s),a=g0(e.filter(u=>u.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(Ht,{tabs:t.map(({location:u,label:l})=>({id:u,name:l.replace(/ Parameters$/,"")})),current:s,onChange:r}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(Dt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function y0({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[c,u]=x.useState(s?"parameters":"body"),[l,d]=x.useState(i[0]),f=l?n[l]: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(m=>m.in==="header")?"headers":null,t.some(m=>m.in==="cookie")?"cookie":null].filter(m=>!!m);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 ",w0(p),":"]}),s&&a&&o.jsx(Ht,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:c,onChange:m=>u(m)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(c==="parameters"||!a)&&s&&o.jsx(b0,{parameters:t}),(c==="body"||!s)&&a&&f&&o.jsx(Dt,{schema:f.schema??{},label:o.jsx(xu,{prefix:"Request Body",mediaTypes:i,selected:l,onChange:d}),rootName:"Body ",description:r,example:bu(f)})]})]})}function w0(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 k0({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:i,id:a,depth:c,fillHeight:u=!1,onFollowOperation:l,isOperationKnown:d}){const f=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,m=!!i&&Object.keys(i).length>0&&c<v0,g=[...f?["request"]:[],...p?["response"]:[],...m?["callbacks"]:[]],[y,b]=x.useState(g[0]??"request");if(g.length===0)return null;const j=g.includes(y)?y:g[0];return o.jsxs("div",{className:u?"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:g.map(N=>o.jsx("button",{role:"tab","aria-selected":j===N,onClick:()=>b(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===N?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:N},N))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${u?"flex-1 -mb-4":""}`,children:[j==="request"&&o.jsx(y0,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&o.jsx(m0,{responses:s,onFollowOperation:l,isOperationKnown:d}),j==="callbacks"&&i&&o.jsx(d0,{callbacks:i,id:a,depth:c,renderOperation:Xo})]})]})}const v0=1;function Xo({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:c,isOperationKnown:u,depth:l=0}){var A,$,F,G;const{document:d}=Za(),f=(n.parameters??[]).filter(T=>T.in!=="query"&&T.in!=="path"),p=n.security??i??[],m=n.responses??{},g=((A=n.requestBody)==null?void 0:A.content)??{},y=n.operationId?p0(n.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const T of p)for(const[v,w]of Object.entries(T)){if(w.length===0)continue;const _=b.get(v)??[];b.set(v,Array.from(new Set([..._,...w])))}const j=Array.from(new Set(p.flatMap(T=>Object.keys(T)))).map(T=>{const v=a==null?void 0:a[T];if(!v)return null;const w=b.get(T);return w?{...v,requiredScopes:w}:v}).filter(T=>!!T),N=l===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${r}-detail`,children:o.jsx(cu,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,children:o.jsxs(o.Fragment,{children:[(n.deprecated||(($=n.externalDocs)==null?void 0:$.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((F=n.externalDocs)==null?void 0:F.url)&&yt(n.externalDocs.url)&&o.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Hr,{className:"w-3.5 h-3.5"})]})]}),n.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&o.jsx(at,{children:n.description}),o.jsx(x.Suspense,{fallback:null,children:o.jsx(f0,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:p,id:r})}),o.jsx(Fn,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${r}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),j.length>0&&o.jsx(Kn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Kl,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:j.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Vo,{securities:j})})})]}),o.jsx(k0,{label:y,parameters:f,requestBodyContent:g,requestBodyDescription:(G=n.requestBody)==null?void 0:G.description,responses:m,callbacks:n.callbacks,id:r,depth:l,fillHeight:N,onFollowOperation:c,isOperationKnown:u})]})})})}const Wa=320;function j0({parameters:e}){const{portalHost:t}=De(),[n,r]=x.useState(!1),[s,i]=x.useState({top:0,left:0,placement:"bottom"}),a=x.useRef(null),c=x.useRef(null),u=x.useId();return x.useEffect(()=>{if(!n)return;const l=a.current;if(!l)return;const d=()=>i(Is(l,{align:"end",width:Wa}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n]),x.useEffect(()=>{if(!n)return;const l=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),r(!1),(p=a.current)==null||p.focus())},d=f=>{var m;const p=((m=f.composedPath)==null?void 0:m.call(f))??[];p.includes(c.current)||p.includes(a.current)||r(!1)};return document.addEventListener("keydown",l,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",l,!0),document.removeEventListener("pointerdown",d,!0)}},[n]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>r(l=>!l),"aria-expanded":n,"aria-haspopup":"dialog","aria-controls":n?u:void 0,"aria-label":`${e.length} query ${e.length===1?"parameter":"parameters"}`,className:`shrink-0 inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-mono text-[11px] leading-4 transition-colors ${n?"border-neutral-300 bg-neutral-200/70 text-foreground-secondary":"border-border bg-neutral-100 text-foreground-muted hover:border-neutral-300 hover:text-foreground-secondary"}`,children:[o.jsxs("span",{"aria-hidden":!0,children:["?",e.length]}),o.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 10 10",className:`h-2 w-2 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M1.5 3.5L5 7l3.5-3.5"})})]}),n&&t&&an.createPortal(o.jsxs("div",{ref:c,id:u,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Wa},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(l=>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:l.name}),l.type&&o.jsx("span",{className:"text-[10px] text-foreground-muted",children:l.type}),l.required&&o.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium uppercase tracking-wide text-red-600",children:"Required"})]}),l.description&&o.jsx("p",{className:"mt-1 text-xs leading-snug text-foreground-secondary",children:l.description}),l.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:l.default})]}),l.enum&&l.enum.length>0&&o.jsx("p",{className:"mt-1 text-[11px] text-foreground-muted",children:ic(l.enum)}),l.examples&&l.examples.length>0&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Examples:"})," ",l.examples.join(", ")]})]},l.name))})]}),t)]})}function wu(e){var n;const t=e.schema;return{description:e.description,type:t==null?void 0:t.type,default:(t==null?void 0:t.default)!==void 0?String(t.default):void 0,enum:(n=t==null?void 0:t.enum)==null?void 0:n.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function ku(e){const t={};for(const n of e)t[n.name]=wu(n);return t}function S0(e){return e.filter(t=>t.in==="query").map(t=>({...wu(t),name:t.name,required:t.required}))}const A0=x.lazy(()=>import("@apiuikit/openapi-try-it-plugin").then(({TryItHeaderButton:e})=>({default:e})));function vu({method:e,path:t,parameters:n}){return o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(wt,{method:e}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Et,{address:t,parameters:ku(n),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(j0,{parameters:S0(n)})]})}function ju({method:e,path:t}){const n=it(),r=n.specType==="openapi"?n.document:null;return n.showTryIt!==!0||!r?null:o.jsx("div",{className:"flex shrink-0 items-center gap-2",children:o.jsx(Gr,{label:"built-in:openapi.operation.tryIt",children:o.jsx(A0,{document:r,method:e,path:t})})})}function Br({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:c}){var G;const u=T=>s==null?void 0:s(T),l=x.useMemo(()=>cn(e),[e]),d=x.useMemo(()=>{var v,w,_;const T=new Map;for(const L of l){const U=((_=(w=(v=e[L.path])==null?void 0:v[L.method])==null?void 0:w.tags)==null?void 0:_[0])||"Other",P=T.get(U)??[];P.push(L),T.set(U,P)}return Array.from(T,([L,U])=>({label:L,items:U}))},[l,e]),[f,p]=x.useState(()=>new Set),m=f.size===0;x.useEffect(()=>{if(!r)return;const T=d.find(({items:v})=>v.some(({key:w})=>w===r));T&&p(v=>{if(!v.has(T.label))return v;const w=new Set(v);return w.delete(T.label),w})},[d,r]);const g=x.useMemo(()=>{var v,w;const T=new Map;for(const{key:_,method:L,path:U}of l){const P=(w=(v=e[U])==null?void 0:v[L])==null?void 0:w.operationId;P&&T.set(P,_)}return T},[l,e]);if(l.length===0)return null;const y=r?l.find(T=>T.key===r):null,b=y?(G=e[y.path])==null?void 0:G[y.method]:null,j=({key:T,method:v,path:w},_)=>{var P;const L=r===T,U=Ms(e[w],(P=e[w])==null?void 0:P[v]);return o.jsxs("tr",{id:`${a}-${T}`,onClick:()=>u(T),role:"button",tabIndex:_?0:-1,"aria-hidden":!_,"aria-label":`${v.toUpperCase()} ${w}`,"aria-current":L?"true":void 0,onKeyDown:X=>{X.key!=="Enter"&&X.key!==" "||(X.preventDefault(),u(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${_?`cursor-pointer opacity-100 visible ${L?"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(Et,{address:w,parameters:ku(U),truncate:!0,className:"text-xs"})})}),o.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${_?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${_?"max-h-12":"max-h-0"}`,children:o.jsx(wt,{method:v,className:"w-20"})})})]},T)},N=d.map(({label:T,items:v},w)=>{const _=!f.has(T),L=`${a}-group-${w}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(x.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":`${T} endpoints (${v.length})`,"aria-expanded":_,"aria-controls":L,onClick:()=>p(U=>{const P=new Set(U);return _?P.add(T):P.delete(T),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(pn,{className:"h-2.5 w-2.5"}):o.jsx(Jl,{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:T}),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:v.length})]})})})}),o.jsx("tbody",{id:L,"aria-hidden":!_,className:`bg-surface ${_?"divide-y divide-border":""}`,children:v.map(U=>j(U,_))})]},T)}),A=Ms(y?e[y.path]:void 0,b),$=y?o.jsx(vu,{method:y.method,path:y.path,parameters:A}):r,F=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:m,onChange:T=>p(T.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),p(m?new Set(d.map(({label:v})=>v)):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"})]})}),N]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:F,stickySideContent:!1,layout:c})}),o.jsx(ql,{isOpen:!!y,side:"right",onClose:()=>u(null),title:$,headerActions:y&&o.jsx(ju,{method:y.method,path:y.path}),children:y&&b&&o.jsx(Ft,{resetKey:b,fallback:o.jsx("p",{role:"alert",children:"This operation could not be rendered. Select another operation to continue."}),children:o.jsx(Xo,{method:y.method,path:y.path,op:{...b,parameters:A},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:T=>g.has(T),onFollowOperation:T=>{const v=g.get(T);v&&u(v)}},y.key)},y.key)})]})}const E0=e=>e==="endpoints"||e==="webhooks"||e==="schemas",N0=(e,t)=>{switch(e){case"webhooks":return`webhook-${t}`;case"schemas":return`schema-${t}`;case"servers":return`server-${t}`;default:return`endpoint-${t}`}};function T0({openapi:e,config:t,plugins:n,initialLocation:r,onLocationChange:s}){var S,M,W,Q;const i=t.show??{},[a,c]=x.useState(!1),[u,l]=x.useState(!1),d=i.search!==!1||i.copyMarkdown!==!1,f=i.info!==!1&&Nl(e.info),p=(n==null?void 0:n.some(ne=>!!ne.slots["openapi.document.topbar"]))??!1,m=d||f||p,g=e.webhooks??{},y=Object.keys(g).length>0,b=[...i.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:zr}]:[],...y&&i.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:go}]:[],...i.schemas!==!1?[{id:"schemas",name:"Schemas",icon:mo}]:[]],{query:j,setQuery:N,results:A}=r0(e,{threshold:.3,limit:20}),{effectiveTab:$,focusTab:F,navActiveSection:G,selected:T,setSelectedKey:v,selectedNavItem:w,handleSearchSelect:_,handleNavItemSelect:L,handleNavServerSelect:U,handleContentTabChange:P,schemaFocusTarget:X}=Cc({tabs:b,defaultTab:"endpoints",isTabKey:E0,sections:[{id:"endpoints",visible:i.endpoints!==!1},{id:"webhooks",visible:y&&i.webhooks!==!1},{id:"schemas",visible:i.schemas!==!1},{id:"servers",visible:i.servers!==!1}],searchQuery:j,initialLocation:r,onLocationChange:s,getTargetId:N0}),ie=(e.servers??[]).map(ne=>ne.url),E=$==="endpoints"?o.jsx(Br,{paths:e.paths??{},security:e.security,securitySchemes:(S=e.components)==null?void 0:S.securitySchemes,selectedKey:T.endpoints,onSelectKey:ne=>v("endpoints",ne)}):$==="webhooks"?o.jsx(Br,{paths:g,security:e.security,securitySchemes:(M=e.components)==null?void 0:M.securitySchemes,selectedKey:T.webhooks,onSelectKey:ne=>v("webhooks",ne),columnLabel:"Webhook",idPrefix:"webhook"}):$==="schemas"?o.jsx(Jo,{schemas:((W=e.components)==null?void 0:W.schemas)??{},selectedKey:T.schemas,focusTarget:X}):null;return o.jsx(Qr,{document:e,config:t,plugins:n,children:o.jsxs("div",{className:"px-4",children:[m&&o.jsxs(oc,{logo:f?o.jsx(Ho,{source:e.info}):void 0,forceVisible:a||u,children:[o.jsx(Fn,{name:"openapi.document.topbar",context:{document:e}}),i.search!==!1&&o.jsx(pc,{query:j,onQueryChange:N,results:A,onSelectResult:_,onOpenChange:c}),i.copyMarkdown!==!1&&o.jsx(xc,{serialize:ne=>Eo(e,ne),onOpenChange:l})]}),i.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(hu,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),i.servers!==!1&&ie.length>0&&o.jsx("div",{id:T.servers??"server-0",children:o.jsx(mu,{servers:e.servers,selectedServer:T.servers,onSelectServer:ne=>v("servers",ne)})}),o.jsx(sc,{tabs:b,current:$,onChange:P}),$&&o.jsx("div",{id:`panel-${$}`,role:"tabpanel","aria-labelledby":`tab-${$}`,children:o.jsx(Ft,{resetKey:e,fallback:o.jsx("p",{role:"alert",children:"This section could not be rendered. Other sections are still available."}),children:E},`${$}-${T.endpoints}-${T.webhooks}-${T.schemas}`)}),i.sidebar!==!1&&o.jsx(nf,{paths:i.endpoints!==!1?e.paths:void 0,webhooks:y&&i.webhooks!==!1?g:void 0,schemas:i.schemas!==!1?(Q=e.components)==null?void 0:Q.schemas:void 0,servers:i.servers!==!1?ie:void 0,hasInfo:i.info!==!1,activeTab:G,onTabChange:F,onItemSelect:L,onSelectServer:U,selectedItem:w})]})})}const Zo=e=>o.jsx(Ft,{resetKey:e.openapi,fallback:e.errorFallback,onError:e.onError,children:o.jsx(C0,{...e})}),C0=e=>{const t=e.openapi,n=x.useMemo(()=>fn(t),[t]),r=e.kind;x.useEffect(()=>{r==="resolved"&&n!==t&&uo(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??Rt;return o.jsx(T0,{openapi:n,config:s,plugins:e.plugins,initialLocation:e.initialLocation,onLocationChange:e.onLocationChange})};function Su(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,n)=>e.toMarkdown(t,n)}}const on=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
181
+ `)[0])==null?void 0:n.trim())||void 0},_0=e=>hn.some(t=>t===e),$0=Su({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 on((t=e.info)==null?void 0:t.description)},targets:e=>cn(e.paths??{}).map(({key:t,method:n,path:r})=>{var i,a;const s=(a=(i=e.paths)==null?void 0:i[r])==null?void 0:a[n];return{key:t,label:`${n.toUpperCase()} ${r}`,summary:on(s==null?void 0:s.summary)??on(s==null?void 0:s.description),target:{kind:"operation",document:e,method:n,path:r}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Eo(e);if(typeof t.path!="string"||!_0(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return Dc(e,t.method,t.path)}}),I0=Su({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 on((t=e.info)==null?void 0:t.description)},targets:e=>Object.entries(e.operations??{}).map(([t,n])=>({key:t,label:n!=null&&n.action?`${n.action.toUpperCase()} ${t}`:t,summary:on(n==null?void 0:n.summary)??on(n==null?void 0:n.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Ao(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return Lc(e,t.id)}}),Ga=[$0,I0];function Qo(e){const t=typeof e=="object"&&e!==null?e:{},n=Ga.find(r=>r.matches(t));if(!n)throw new Error(`[apiuikit] Unrecognized document: expected a top-level "openapi", "swagger", or "asyncapi" version key. Supported specs: ${Ga.map(r=>r.name).join(", ")}.`);return n}function Au(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function O0(e){return Qo(e).targets(e)}function M0(e,t){const n=Qo(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return n.toMarkdown(e,t)}function R0(e,t={}){const n=Qo(e),{baseUrl:r,url:s,optional:i}=t,a=(r==null?void 0:r.replace(/\/+$/,""))??"",u=s??(p=>`${a}/${Au(p.key)}.md`),l=[`# ${t.title??n.title(e)}`],d=t.summary??n.summary(e);d&&l.push("",`> ${d}`);const f=n.targets(e).map(p=>({entry:p,href:u(p)})).filter(p=>!!p.href);if(f.length){l.push("",`## ${n.sectionTitle}`,"");for(const{entry:p,href:m}of f)l.push(`- [${p.label}](${m})${p.summary?`: ${p.summary}`:""}`)}if(i!=null&&i.length){l.push("","## Optional","");for(const p of i)l.push(`- [${p.label}](${p.url})${p.description?`: ${p.description}`:""}`)}return l.push(""),l.join(`
182
+ `)}function Eu(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=i=>{const a=s(i);return a!==void 0?a:n(i)?t:void 0}}const L0=["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 P0(){return{validate:B0,parse:F0,getMimeTypes:()=>L0}}function D0(e){Eu(e,P0(),Dn)}function B0(e){return So(e.data).map(t=>({message:t,path:e.path}))}function F0(e){var n,r;const t=So(e.data);if(t.length>0)return{[$r]:t[0]};try{const s=Vs(e.data),i=e.meta.message,a=(r=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=Vs(a)),s}catch(s){return{[$r]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function z0(){try{const e=await Promise.resolve().then(()=>require("./index-BjVWe_rQ.cjs")).then(n=>n.index),t=e.default??e;if(typeof t!="function")throw new Error("Unexpected export shape from '@asyncapi/parser/browser'.");return t}catch(e){throw console.error("[apiuikit] Failed to load '@asyncapi/parser/browser':",e),new Error("[apiuikit] The parsed entry requires '@asyncapi/parser'. Install it (`npm i @asyncapi/parser`), or use the `AsyncAPI` component with a pre-resolved document instead.")}}async function Nu(e){try{const t=await z0(),n=new t;D0(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-Cbb8hQnz.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e,{validateOptions:{allowedSeverity:{error:!0}}});return{diagnostics:i,document:s?U0(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function H0(e,t){const{diagnostics:n,document:r}=await Nu(e);return{diagnostics:n,view:r?o.jsx(Yo,{kind:"resolved",asyncapi:r,config:t}):null}}function U0(e){return e.json()}function W0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);return d.current=r,x.useEffect(()=>{let f=!0;return Nu(e).then(({document:p,diagnostics:m})=>{var g;f&&(l(p),(g=d.current)==null||g.call(d,m))}),()=>{f=!1}},[e]),u?o.jsx(Yo,{kind:"resolved",asyncapi:u,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}async function G0(){try{return await Promise.resolve().then(()=>require("./index-Djr20zD8.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 K0=e=>Array.isArray(e)?e:typeof e!="string"||e===""?[]:e.startsWith("/")?e.slice(1).split("/").map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")):[e],Ka=(e,t)=>({message:e.message,path:K0(e.path),severity:t}),Va=new Set(["must have required property '$ref'","must match exactly one schema in oneOf"]),V0=(e,t)=>e.length>=t.length&&t.every((n,r)=>e[r]===n);function J0(e){const t=new Set,n=e.filter(s=>{const i=JSON.stringify([s.severity,s.message,s.path]);return t.has(i)?!1:(t.add(i),!0)}),r=n.filter(s=>!Va.has(s.message));return n.filter(s=>!Va.has(s.message)||!r.some(i=>V0(i.path,s.path)))}async function Tu(e){var n;const t=[];try{const{validate:r,dereference:s,normalize:i}=await G0();let a=i(e);if(!a||typeof a!="object"||Array.isArray(a)||typeof a.openapi!="string"||!/^3\.(0|1)\.\d+$/.test(a.openapi))return t.push({message:"Expected an OpenAPI 3.0 or 3.1 document.",path:[],severity:0}),{status:"unrenderable",diagnostics:t,document:null};const c=a.info;c&&typeof c=="object"&&!Array.isArray(c)&&typeof c.version!="string"&&t.push({message:"info.version must be a string.",path:["info","version"],severity:0});try{const l=s(e);t.push(...(l.errors??[]).map(d=>Ka(d,0))),l.schema&&!((n=l.errors)!=null&&n.length)&&(a=l.schema)}catch(l){t.push({message:l instanceof Error?l.message:"Reference resolution failed",path:[],severity:0})}try{const l=await r(e);t.push(...(l.errors??[]).map(d=>Ka(d,l.valid?1:0)))}catch(l){t.push({message:l instanceof Error?l.message:"Validation failed",path:[],severity:0})}const u=J0(t);return{status:u.some(l=>l.severity===0)?"partial":"ready",diagnostics:u,document:a}}catch(r){return t.push({message:r instanceof Error?r.message:"Failed to parse document",path:[],severity:0}),{status:"unrenderable",diagnostics:t,document:null}}}async function Y0(e,t){const{diagnostics:n,document:r}=await Tu(e);return{diagnostics:n,view:r?o.jsx(Zo,{openapi:r,config:t}):null}}function X0({raw:e,config:t,plugins:n,onDiagnostics:r,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}){const[u,l]=x.useState(null),d=x.useRef(r);d.current=r,x.useEffect(()=>{let p=!0;return Tu(e).then(m=>{var g;p&&(l(m),(g=d.current)==null||g.call(d,m.diagnostics))}),()=>{p=!1}},[e]);const f=u==null?void 0:u.document;return f?o.jsx(Zo,{openapi:f,config:t,plugins:n,errorFallback:s,onError:i,initialLocation:a,onLocationChange:c}):null}function Cu({title:e,headerActions:t,children:n}){return o.jsxs("article",{className:"rounded-lg border border-border bg-background overflow-hidden",children:[o.jsxs("header",{className:"flex items-center justify-between gap-4 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:e}),t]}),o.jsx("div",{className:"px-5 py-4",children:n})]})}function Z0({operationKey:e,op:t,layout:n}){return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(uu,{op:t,operationKey:e}),headerActions:o.jsx(du,{operationKey:e}),children:o.jsx(lu,{op:t,id:e})})})})}function Q0({messageKey:e,message:t,layout:n}){const[r,s]=x.useState(!0),i=t.correlationId,a=o.jsxs("article",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:[o.jsxs("header",{className:"flex flex-wrap items-start justify-between gap-3 px-6 py-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5 min-w-0",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}),t.summary&&o.jsx("span",{className:"text-sm text-foreground-muted",children:t.summary})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",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"}),i&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:i.description??i.location,children:i.location})]})]}),o.jsx(Ko,{message:t,expanded:r,onToggleExpanded:()=>s(c=>!c),paddingX:"px-6"})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:a,stickySideContent:!1,layout:n,topSpacing:!1,bottomSpacing:!1})})}const pt="apiuikit-root--transparent";function _u(e,t,n){return function({document:s,config:i,plugins:a,className:c,children:u}){const l=x.useContext(zt),d=x.useMemo(()=>s?fn(s):null,[s]),f=!!l&&l.specType!==n;if(x.useEffect(()=>{f&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${l.specType} document provider, which cannot supply the document it needs. `+(d?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[l,f,d]),l&&!f)return o.jsx(o.Fragment,{children:u});if(!d){if(l)return o.jsx(o.Fragment,{children:u});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:d,config:i,plugins:a,className:c,children:u})}}function Xn(e,t){x.useEffect(()=>{e&&console.warn(`[apiuikit] ${t}`)},[e,t])}function q0({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Fr,{document:s,config:t,plugins:n,children:r})}const gn=_u(Fr,"AsyncAPI","asyncapi");function xn(){const e=De();return e.specType==="asyncapi",e.document}function eb({layout:e}){const t=xn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Ql,{servers:t.servers,layout:e})}function tb({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(eb,{layout:e})})}function nb({layout:e}){const t=xn(),[n,r]=x.useState(null);return o.jsx(fu,{operations:t.operations??{},selectedKey:n,onSelectKey:r,layout:e})}function rb({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(nb,{layout:e})})}function sb({operationId:e,layout:t}){var s;const r=(s=xn().operations)==null?void 0:s[e];return Xn(!r,`AsyncAPIOperation: no operation "${e}" in this document.`),r?o.jsx(Z0,{operationKey:e,op:r,layout:t}):null}function ob({operationId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(sb,{operationId:e,layout:t})})}function ib({layout:e}){var n;const t=xn();return o.jsx(Wl,{messages:((n=t.components)==null?void 0:n.messages)??{},layout:e})}function ab({layout:e,...t}){return o.jsx(gn,{...t,className:pt,children:o.jsx(ib,{layout:e})})}function cb({messageId:e,layout:t}){var s,i;const r=(i=(s=xn().components)==null?void 0:s.messages)==null?void 0:i[e];return Xn(!r,`AsyncAPIMessage: no message "${e}" in components.messages.`),r?o.jsx(Q0,{messageKey:e,message:r,layout:t}):null}function lb({messageId:e,layout:t="stacked",...n}){return o.jsx(gn,{...n,className:pt,children:o.jsx(cb,{messageId:e,layout:t})})}function ub({layout:e}){const t=xn();return t.info?o.jsx(Cl,{...t.info,layout:e}):null}function db({layout:e,...t}){return o.jsx(gn,{...t,children:o.jsx(ub,{layout:e})})}const fb=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function pb({layout:e}){var r,s;const t=x.useContext(zt),n=((s=(r=t==null?void 0:t.document)==null?void 0:r.components)==null?void 0:s.schemas)??{};return o.jsx(Jo,{schemas:n,layout:e})}function $u({document:e,config:t,plugins:n,sectionName:r,className:s,children:i}){const a=x.useContext(zt),c=x.useMemo(()=>e?fn(e):null,[e]);if(a)return o.jsx(o.Fragment,{children:i});if(!c)throw new Error(`The ${r} section needs a \`document\` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.`);return fb(c)?o.jsx(Qr,{document:c,config:t,plugins:n,className:s,children:i}):o.jsx(Fr,{document:c,config:t,plugins:n,className:s,children:i})}function qo({layout:e,...t}){return o.jsx($u,{...t,sectionName:"Schemas",className:pt,children:o.jsx(pb,{layout:e})})}function hb({name:e,layout:t}){var c,u,l;const n=x.useContext(zt),r=n==null?void 0:n.deref,s=(l=(u=(c=n==null?void 0:n.document)==null?void 0:c.components)==null?void 0:u.schemas)==null?void 0:l[e],i=Ur(),a=x.useMemo(()=>s&&r?ln(s,r):null,[s,r,i]);return Xn(!s,`Schema: no schema "${e}" in components.schemas.`),a?o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{content:o.jsx(pu,{schemaName:e,resolved:a}),stickySideContent:!1,layout:t,topSpacing:!1,bottomSpacing:!1})}):null}function mb({name:e,layout:t="stacked",...n}){return o.jsx($u,{...n,sectionName:"Schema",className:pt,children:o.jsx(hb,{name:e,layout:t})})}const gb=qo,xb=qo;function Iu({method:e,path:t,pathItem:n,paths:r,security:s,securitySchemes:i,idPrefix:a="endpoint",onNavigate:c,layout:u}){const l=n[e],d=Ms(n,l),f=x.useMemo(()=>{var g,y;const m=new Set;for(const b of cn(r)){const j=(y=(g=r[b.path])==null?void 0:g[b.method])==null?void 0:y.operationId;j&&m.add(j)}return m},[r]);if(!l)return null;const p=fc(e,t);return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(nt,{stickySideContent:!1,layout:u,topSpacing:!1,bottomSpacing:!1,content:o.jsx(Cu,{title:o.jsx(vu,{method:e,path:t,parameters:d}),headerActions:o.jsx(ju,{method:e,path:t}),children:o.jsx(Xo,{method:e,path:t,op:{...l,parameters:d},id:p,idPrefix:a,globalSecurity:s,securitySchemes:i,isOperationKnown:m=>!!c&&f.has(m),onFollowOperation:c})})})})}function bb(e,t){if("operationId"in t){for(const[s,i]of Object.entries(e)){if(!i)continue;const a=hn.find(c=>{var u;return((u=i[c])==null?void 0:u.operationId)===t.operationId});if(a)return{method:a,path:s,pathItem:i}}return null}const n=e[t.path],r=t.method.toLowerCase();return n!=null&&n[r]?{method:r,path:t.path,pathItem:n}:null}function yb(e){return"operationId"in e?`operationId "${e.operationId}"`:`${e.method.toUpperCase()} ${e.path}`}function wb({document:e,config:t,plugins:n,children:r}){const s=x.useMemo(()=>fn(e),[e]);return o.jsx(Qr,{document:s,config:t,plugins:n,children:r})}const bn=_u(Qr,"OpenAPI","openapi");function yn(){const e=it();return e.specType==="openapi",e.document}function kb({layout:e}){const t=yn();return!t.servers||t.servers.length===0?null:o.jsx(mu,{servers:t.servers,layout:e})}function vb({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx(kb,{layout:e})})}function jb({layout:e}){var s;const t=yn(),[n,r]=x.useState(null);return o.jsx(Br,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:n,onSelectKey:r,layout:e})}function Sb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(jb,{layout:e})})}function Ab({layout:e}){var i;const t=yn(),[n,r]=x.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Br,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:n,onSelectKey:r,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function Eb({layout:e,...t}){return o.jsx(bn,{...t,className:pt,children:o.jsx(Ab,{layout:e})})}function Nb({selector:e,onNavigate:t,layout:n}){var a;const r=yn(),s=x.useMemo(()=>r.paths??{},[r.paths]),i=bb(s,e);return Xn(!i,`OpenAPIEndpoint: no endpoint with ${yb(e)} in this document.`),i?o.jsx(Iu,{...i,paths:s,security:r.security,securitySchemes:(a=r.components)==null?void 0:a.securitySchemes,onNavigate:t,layout:n}):null}function Tb(e){const{document:t,config:n,plugins:r,layout:s="stacked",onNavigate:i}=e,a="operationId"in e?{operationId:e.operationId}:{method:e.method,path:e.path};return o.jsx(bn,{document:t,config:n,plugins:r,className:pt,children:o.jsx(Nb,{selector:a,onNavigate:i,layout:s})})}function Cb({name:e,method:t,onNavigate:n,layout:r}){var l;const s=yn(),i=x.useMemo(()=>s.webhooks??{},[s.webhooks]),a=i[e],c=t?t.toLowerCase():a&&hn.find(d=>a[d]),u=a&&c&&a[c];return Xn(!u,`OpenAPIWebhook: no webhook "${e}"${t?` with method ${t.toUpperCase()}`:""} in this document.`),!u||!a||!c?null:o.jsx(Iu,{method:c,path:e,pathItem:a,paths:i,security:s.security,securitySchemes:(l=s.components)==null?void 0:l.securitySchemes,idPrefix:"webhook",onNavigate:n,layout:r})}function _b({name:e,method:t,onNavigate:n,layout:r="stacked",...s}){return o.jsx(bn,{...s,className:pt,children:o.jsx(Cb,{name:e,method:t,onNavigate:n,layout:r})})}function $b({layout:e}){const t=yn();return t.info?o.jsx(hu,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function Ib({layout:e,...t}){return o.jsx(bn,{...t,children:o.jsx($b,{layout:e})})}exports.AsyncAPI=Yo;exports.AsyncAPIInfo=db;exports.AsyncAPIMessage=lb;exports.AsyncAPIMessages=ab;exports.AsyncAPIOperation=ob;exports.AsyncAPIOperations=rb;exports.AsyncAPIProvider=q0;exports.AsyncAPIRenderer=W0;exports.AsyncAPISchemas=gb;exports.AsyncAPIServers=tb;exports.CodeBlock=Xr;exports.ErrorBoundary=Ft;exports.OpenAPI=Zo;exports.OpenAPIEndpoint=Tb;exports.OpenAPIEndpoints=Sb;exports.OpenAPIInfo=Ib;exports.OpenAPIProvider=wb;exports.OpenAPIRenderer=X0;exports.OpenAPISchemas=xb;exports.OpenAPIServers=vb;exports.OpenAPIWebhook=_b;exports.OpenAPIWebhooks=Eb;exports.PluginSlot=Fn;exports.Schema=mb;exports.SchemaTabs=Dt;exports.SchemaTree=Go;exports.Schemas=qo;exports.X_LIB_CONVERSION_ERROR=$r;exports.asyncApiOperationToMarkdown=Lc;exports.asyncApiToMarkdown=Ao;exports.commonjsGlobal=gh;exports.defaultConfig=Rt;exports.documentToLlmsTxt=R0;exports.documentToMarkdown=M0;exports.ensureHljsLanguage=au;exports.getAugmentedNamespace=xh;exports.getDefaultExportFromCjs=rl;exports.hljsLanguageForTarget=iu;exports.isHljsLanguageReady=Dr;exports.isProtobufSchemaFormat=Bn;exports.listDocumentTargets=O0;exports.markdownForLlm=gc;exports.openApiEndpointToMarkdown=Dc;exports.openApiToMarkdown=Eo;exports.parseAndRender=H0;exports.parseAndRender$1=Y0;exports.registerSchemaParserWithFallback=Eu;exports.resolveLogo=No;exports.targetSlug=Au;exports.useAsyncAPIDocument=De;exports.useAsyncAPIDocumentContext=Xa;exports.useDocumentContext=it;exports.useOpenAPIDocumentContext=Za;exports.useOperationTabPlugins=zc;exports.usePluginSlot=Fc;