apiuikit 1.1.0 → 1.2.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.
- package/README.md +1 -0
- package/dist/CodeSamples-CXtSA6EK.js +4298 -0
- package/dist/CodeSamples-D7dq1xEM.cjs +50 -0
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.es.js +30 -22
- package/dist/config/config.d.ts +48 -0
- package/dist/contexts/useSpec.d.ts +3 -0
- package/dist/helpers/jsonPointer.d.ts +5 -0
- package/dist/helpers/llmsTxt.d.ts +51 -0
- package/dist/helpers/specAdapters.d.ts +32 -0
- package/dist/helpers/toMarkdown.d.ts +5 -6
- package/dist/hooks/useDocumentProviderValue.d.ts +3 -1
- package/dist/index-BJ0X8yP3.cjs +133 -0
- package/dist/{index-DM2MTkYV.js → index-BMRPdMaB.js} +1 -1
- package/dist/{index-EeGvEXPN.cjs → index-BoAORjov.cjs} +1 -1
- package/dist/{index-B5IBIM-V.cjs → index-CZjVUeK4.cjs} +1 -1
- package/dist/index-DCDYBZcY.js +1461 -0
- package/dist/index-DwzxTmOd.js +13614 -0
- package/dist/index-d8kJa7YD.cjs +4 -0
- package/dist/{index-iXpNcBcP.js → index-ib-tk7y5.js} +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/markdown-assets/protoToJsonSchema-CBPWaboT.js +6193 -0
- package/dist/markdown-assets/protoToJsonSchema-CgkcluFJ.js +83 -0
- package/dist/markdown.cjs +91 -0
- package/dist/markdown.d.ts +8 -0
- package/dist/markdown.es.js +2101 -0
- package/dist/{protoToJsonSchema-CcEvAEt4.js → protoToJsonSchema-Btyc_WLL.js} +112 -108
- package/dist/{protoToJsonSchema-BNZrP3Fa.cjs → protoToJsonSchema-wxazjeYy.cjs} +10 -10
- package/dist/{protobufSchemaParser-BaWs_7UI.js → protobufSchemaParser-9KjS7p8W.js} +2 -2
- package/dist/{protobufSchemaParser-7sU6XBEb.cjs → protobufSchemaParser-G1NujZ28.cjs} +1 -1
- package/dist/shims/utilInspect.d.ts +2 -0
- package/package.json +8 -3
- package/dist/components/Navigation/tests/spineTicks.test.d.ts +0 -1
- package/dist/components/schema/tests/SchemaTab.test.d.ts +0 -1
- package/dist/components/schema/tests/schemaUtils.test.d.ts +0 -1
- package/dist/components/tests/Authorization.test.d.ts +0 -1
- package/dist/components/tests/Bindings.test.d.ts +0 -1
- package/dist/components/tests/ChannelAddress.test.d.ts +0 -1
- package/dist/components/tests/CodeBlock.test.d.ts +0 -1
- package/dist/components/tests/CodeSamples.test.d.ts +0 -1
- package/dist/components/tests/CopyMarkdownButton.test.d.ts +0 -1
- package/dist/components/tests/ErrorBoundary.test.d.ts +0 -1
- package/dist/components/tests/MarkdownExportMenu.test.d.ts +0 -1
- package/dist/components/tests/RenderExtensions.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPI.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPIErrorBoundary.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPIRenderer.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/searchHighlight.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPI.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPIErrorBoundary.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPIRenderer.test.d.ts +0 -1
- package/dist/containers/Path/tests/PathOperation.test.d.ts +0 -1
- package/dist/containers/Path/tests/Paths.test.d.ts +0 -1
- package/dist/helpers/avro/tests/avroToJsonSchema.test.d.ts +0 -1
- package/dist/helpers/protobuf/tests/protoToJsonSchema.test.d.ts +0 -1
- package/dist/helpers/protobuf/tests/protobufSchemaParser.test.d.ts +0 -1
- package/dist/helpers/tests/codeSamples.test.d.ts +0 -1
- package/dist/helpers/tests/exampleSchema.test.d.ts +0 -1
- package/dist/helpers/tests/openapiSearchIndex.test.d.ts +0 -1
- package/dist/helpers/tests/resolveDocument.test.d.ts +0 -1
- package/dist/helpers/tests/schemaFormat.test.d.ts +0 -1
- package/dist/helpers/tests/toMarkdown.test.d.ts +0 -1
- package/dist/index-BqogUhNO.js +0 -19011
- package/dist/index-mYBY1Eu8.cjs +0 -177
- package/dist/public/tests/sections.test.d.ts +0 -1
- package/dist/stories/AsyncAPI.stories.d.ts +0 -14
- package/dist/stories/AsyncAPIRenderer.stories.d.ts +0 -17
- package/dist/stories/Authorization.stories.d.ts +0 -13
- package/dist/stories/Bindings.stories.d.ts +0 -12
- package/dist/stories/ChannelAddress.stories.d.ts +0 -13
- package/dist/stories/CodeBlock.stories.d.ts +0 -11
- package/dist/stories/Examples.stories.d.ts +0 -11
- package/dist/stories/Information.stories.d.ts +0 -9
- package/dist/stories/Message.stories.d.ts +0 -11
- package/dist/stories/Messages.stories.d.ts +0 -11
- package/dist/stories/Operation.stories.d.ts +0 -10
- package/dist/stories/Operations.stories.d.ts +0 -16
- package/dist/stories/SchemaTab.stories.d.ts +0 -12
- package/dist/stories/SchemaTree.stories.d.ts +0 -24
- package/dist/stories/SearchPanel.stories.d.ts +0 -16
- package/dist/stories/Server.stories.d.ts +0 -12
- package/dist/stories/TabToggle.stories.d.ts +0 -10
- package/dist/stories/Tabs.stories.d.ts +0 -11
- package/dist/stories/documentContextDecorator.d.ts +0 -25
- package/dist/stories/noCanvasDocsPage.d.ts +0 -9
- package/dist/utils/tests/hasRef.test.d.ts +0 -1
- package/dist/utils/tests/theme.test.d.ts +0 -1
- package/dist/utils/tests/useElementRect.test.d.ts +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";var qc=Object.defineProperty;var Vc=(e,t,n)=>t in e?qc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>Vc(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),b=require("react"),Tn=require("react-dom"),zs=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Us=(e,t)=>{const n=t.length>0?t:zs,r=(e%n.length+n.length)%n.length;return n[r]},nn={show:{sidebar:!0,info:!0,servers:!0,operations:!0,messages:!0,messageExamples:!1,schemas:!0},theme:{colors:{primary:{50:"#ddf4ff",100:"#b6e3ff",200:"#80ccff",300:"#54aeff",500:"#58a6ff",600:"#1f6feb",700:"#0d419d"}},light:{background:"#f8fafc",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:zs},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0}},Hs=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Kc=e=>typeof e=="object"&&e!==null;function Yc(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function fa(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let n=e;for(const r of t.slice(2).split("/")){if(!Kc(n))return;const s=Yc(r);if(s===void 0||(n=n[s],n===void 0))return}return n}function _n(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=fa(e,n);return t.set(n,r),r}}const os=e=>typeof e=="object"&&e!==null,Zc=e=>e.replace(/^#\//,"").split("/").pop()??e,Gs=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Hs(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>Gs(r,t))),pa=(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),Hs(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>pa(s,t,n))}finally{t.delete(e)}},Xc=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),mi=e=>e.length?`#/${e.map(Xc).join("/")}`:"#";function Cn(e){if(!pa(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 l=t.get(i);if(l!==void 0)return l;const c=[];r.set(i,mi(a)),t.set(i,c),n.add(i);try{i.forEach((u,d)=>c.push(s(u,[...a,String(d)])))}finally{n.delete(i)}return c}if(Hs(i)){const l=fa(e,i.$ref),c=os(l)||Array.isArray(l);if(c&&!n.has(l)){const u=s(l,a);return os(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=Zc(i.$ref)),u}if(l!==void 0&&!c)return l}if(os(i)){if(n.has(i))return{$ref:r.get(i)};const l=t.get(i);if(l!==void 0)return l;const c={};r.set(i,mi(a)),t.set(i,c),n.add(i);try{for(const[u,d]of Object.entries(i))c[u]=s(d,[...a,u])}finally{n.delete(i)}return c}return i};return s(e,[])}class Ws extends b.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)}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 Sr=b.createContext(null),qs=()=>{const e=b.useContext(Sr);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},$e=qs;var hr=(e=>(e.SEND="send",e.RECEIVE="receive",e))(hr||{});const Qc="Contact",Jc="Email",gi="License",xi="External Documentation",eu="Tags",tu="Implicit",nu=`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.`,ru="Client Credentials",su="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",ou="Password",iu="The Password grant type is a legacy way to exchange a user's credentials for an access token.",au="Authorization Code",lu="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",ha="Connecting to a server",cu="",bi=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],uu=[50,100,200,300,500,600,700],du={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"}},fu=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],pu={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",[hr.SEND]:"bg-green-100 text-green-800",[hr.RECEIVE]:"bg-blue-100 text-blue-800"};function ma(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 is(e,t,n){if(e)for(const r of uu){const s=e[r];s&&(n[`--color-${t}-${r}`]=ma(s))}}const hu=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],mu={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 gu(e){const t={},n=e.light?"light":e.dark?"dark":null,r=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[s,i]of Object.entries(mu))t[`--color-neutral-${s}`]=i;if(r)for(const[s,i]of hu){const a=r[s];a&&(t[i]=ma(a))}return e.colors&&(is(e.colors.primary,"primary",t),is(e.colors.secondary,"secondary",t),is(e.colors.neutral,"neutral",t)),t}function ga(e,t,n=nn){var v,A,T,F,S,R;const[r,s]=b.useState(null),[i,a]=b.useState(null),l=b.useMemo(()=>_n(t),[t]),c=((v=n.expand)==null?void 0:v.schemas)===!0,u=(T=(A=n.theme)==null?void 0:A.depthColors)!=null&&T.length?n.theme.depthColors:zs,d=((F=n.show)==null?void 0:F.extensions)!==!1,p=((S=n.show)==null?void 0:S.codeSamples)!==!1,f=(R=n.markdown)==null?void 0:R.url,g=b.useMemo(()=>{if(typeof f=="function")return f;if(typeof f=="string")return()=>f},[f]),m=b.useMemo(()=>({specType:e,document:t,deref:l,portalHost:r,rootElement:i,defaultSchemaExpanded:c,depthColors:u,showExtensions:d,showCodeSamples:p,markdownUrl:g}),[e,t,l,r,i,c,u,d,p,g]),x=n.theme?gu(n.theme):{};return{contextValue:m,themeVars:x,setPortalHost:s,setRootElement:a}}function Vs({document:e,config:t=nn,className:n="",children:r}){const{contextValue:s,themeVars:i,setPortalHost:a,setRootElement:l}=ga("asyncapi",e,t);return o.jsx(Sr.Provider,{value:s,children:o.jsxs("div",{ref:l,style:i,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[o.jsx("div",{ref:a,className:"asyncapi-portal-root"}),r]})})}function _t({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a}){return o.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("h1",{className:`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),o.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:o.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Xt(...e){return e.filter(Boolean).join(" ")}function rn({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",placeholder:i}){var g;const a=b.useId(),l=b.useRef([]),c=t??(i?"":((g=e[0])==null?void 0:g.id)??""),u=e.some(m=>!!m.icon),d=t?e.findIndex(m=>m.id===t):-1,p=d>=0?d:0,f=(m,x)=>{var T;if(e.length===0)return;const v=F=>(F+e.length)%e.length;let A=x;if(m.key==="ArrowRight"&&(m.preventDefault(),A=v(x+1)),m.key==="ArrowLeft"&&(m.preventDefault(),A=v(x-1)),m.key==="Home"&&(m.preventDefault(),A=0),m.key==="End"&&(m.preventDefault(),A=e.length-1),A!==x){const F=e[A];n(F.id),(T=l.current[A])==null||T.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:"@sm:hidden",children:[o.jsx("label",{htmlFor:a,className:"sr-only",children:s}),o.jsxs("select",{id:a,name:"tabs",value:c,onChange:m=>n(m.target.value),className:Xt("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",u?"mt-0":"mt-4"),children:[i&&o.jsx("option",{value:"",children:i}),e.map(m=>o.jsx("option",{value:m.id,children:m.name},m.id))]})]}),o.jsx("div",{className:Xt("hidden @sm:block",u?"":"mt-6"),children:u?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((m,x)=>{const v=m.id===t,A=m.icon;return o.jsx("button",{ref:T=>{l.current[x]=T},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:x===p?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:T=>f(T,x),className:Xt("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",v?"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:m.name})]})},m.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((m,x)=>{const v=m.id===t;return o.jsxs("button",{ref:A=>{l.current[x]=A},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:x===p?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:A=>f(A,x),className:Xt(v?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",x===0?"rounded-l-lg":"",x===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:m.name}),o.jsx("span",{"aria-hidden":"true",className:Xt(v?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},m.id)})})})]}):null}function xa({tabs:e,current:t,onChange:n}){if(!e.length)return null;const r=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(rn,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:o.jsx(_t,{content:r,stickySideContent:!1})})}function xu(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(b.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 bu(e){return e.map(t=>`\`${t}\``).join(", ")}function yu(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}function Nt({address:e,parameters:t,className:n="text-xs",truncate:r=!1,padded:s=!0}){const{portalHost:i}=$e(),[a,l]=b.useState(null),[c,u]=b.useState({top:0,left:0,placement:"top"}),[d,p]=b.useState(!1),f=b.useRef(null),g=yu(e);let m=0;const x=40;b.useEffect(()=>{if(!r)return;const S=f.current;if(!S)return;const R=()=>p(S.scrollWidth>S.clientWidth);R();const N=new ResizeObserver(R);return N.observe(S),()=>N.disconnect()},[r,e]);const v=(S,R)=>{const N=R.getBoundingClientRect(),D=N.top<x?"bottom":"top";u({top:D==="top"?N.top-8:N.bottom+8,left:N.left+N.width/2,placement:D}),l(S)},A=()=>l(null),T=g.map((S,R)=>{if(S.type==="text")return o.jsx("span",{children:S.value},R);const N=t==null?void 0:t[S.value],D=bi[m++%bi.length],U=a===R,k=!!N&&(N.description||N.type||N.default||N.enum&&N.enum.length>0||N.examples&&N.examples.length>0),w=`channel-address-tooltip-${R}`,M=k&&U?w:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:j=>k&&v(R,j.currentTarget),onMouseLeave:A,children:[o.jsx("span",{className:`font-semibold ${D} ${k?"cursor-help underline decoration-dotted":""}`,role:k?"button":void 0,tabIndex:k?0:void 0,"aria-expanded":k?U:void 0,"aria-describedby":M,onFocus:j=>k&&v(R,j.currentTarget),onBlur:A,onKeyDown:j=>{k&&((j.key==="Enter"||j.key===" ")&&(j.preventDefault(),v(R,j.currentTarget)),j.key==="Escape"&&(j.preventDefault(),A(),j.currentTarget.blur()))},children:`{${S.value}}`}),k&&U&&i&&Tn.createPortal(o.jsxs("div",{id:w,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 ${c.placement==="top"?"-translate-y-full":""}`,style:{top:c.top,left:c.left},children:[N.description&&o.jsx("div",{children:N.description}),N.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:N.type})}),N.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:N.default})]}),N.enum&&N.enum.length>0&&o.jsx("div",{className:"mt-1",children:xu(N.enum)}),N.examples&&N.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",N.examples.join(", ")]})]}),i)]},R)}),F=s?"px-2 py-1 ":"";return r?o.jsxs("code",{className:`${F}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[o.jsx("span",{ref:f,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),d&&o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):o.jsx("code",{className:`${F}rounded text-foreground-secondary break-all ${n}`,children:T})}const wu={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Tt({method:e,size:t="sm",className:n=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${wu[t]} ${pu[e]} ${n}`,children:e}):null}function Nr(e,t){const[n,r]=b.useState(null);return b.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 yi=6,vu=12,Eu=8,ku=.7;function Au(e,t){if(e===0)return 1/0;const n=e*ku-Eu*2,r=t*yi+Math.max(0,t-1)*vu;return Math.max(1,Math.floor((n-r)/yi))}function ju(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 wi=20;function Su({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[i,a]=b.useState(!1),[l,c]=b.useState(!1),u=i||l,{rootElement:d,portalHost:p}=$e(),f=b.useRef(null),g=b.useRef(null),m=b.useMemo(()=>e.filter(Y=>Y.items.length>0),[e]),x=b.useMemo(()=>m.filter(Y=>Y.isTab===!1||Y.id===t),[m,t]),v=b.useMemo(()=>m.filter(Y=>Y.showInPopover!==!1),[m]),[A,T]=b.useState(null),F=b.useRef(null),S=b.useRef(null),R=b.useCallback((Y,B)=>{T({section:Y,key:B}),F.current={section:Y,key:B},S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{F.current=null},600)},[]);b.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),b.useEffect(()=>{const B=e.filter(C=>C.items.length>0).flatMap(C=>C.items.map(J=>({section:C.id,key:C.itemKey(J),id:C.targetId(J)}))).map(C=>({...C,el:document.getElementById(C.id)})).filter(C=>!!C.el);if(B.length===0)return;const pe=new Map(B.map(C=>[C.el,C])),ie=new Map,Oe=new IntersectionObserver(C=>{for(const be of C)be.isIntersecting?ie.set(be.target,be.boundingClientRect.top):ie.delete(be.target);if(ie.size===0)return;let J=null,ue=-1/0;for(const[be,ye]of ie)ye>ue&&(J=be,ue=ye);const oe=J&&pe.get(J);if(!oe)return;const we=F.current;if(we){if(oe.section!==we.section||oe.key!==we.key)return;F.current=null}T({section:oe.section,key:oe.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return B.forEach(C=>Oe.observe(C.el)),()=>Oe.disconnect()},[e]);const N=(A==null?void 0:A.section)??t,D=A??s,U=Nr(d,!0),k=typeof window>"u"?0:window.innerWidth,w=typeof window>"u"?0:window.innerHeight,M=!!U&&U.bottom>0&&U.top<w,j=!!U&&U.width<1024,W={opacity:M?1:0,pointerEvents:M?"auto":"none",transition:"opacity 0.2s ease"},re={position:"fixed",top:"50%",left:((U==null?void 0:U.left)??0)+wi,transform:"translateY(-50%)",zIndex:51,...W},se=Math.min((U==null?void 0:U.right)??0,k)-60,E={position:"fixed",bottom:16,left:se,zIndex:51,...W},_=j?{position:"fixed",bottom:68,right:k-(se+44),zIndex:52}:{position:"fixed",top:"50%",left:((U==null?void 0:U.left)??0)+wi,transform:"translateY(-50%)",zIndex:52};b.useEffect(()=>{if(!i)return;const Y=pe=>{pe.key==="Escape"&&a(!1)},B=pe=>{var Oe,C;const ie=pe.target;(Oe=f.current)!=null&&Oe.contains(ie)||(C=g.current)!=null&&C.contains(ie)||a(!1)};return document.addEventListener("keydown",Y),document.addEventListener("mousedown",B),()=>{document.removeEventListener("keydown",Y),document.removeEventListener("mousedown",B)}},[i]);const G=b.useCallback((Y,B)=>{Y.isTab!==!1&&n(Y.id),B&&setTimeout(()=>{var pe;(pe=document.getElementById(B))==null||pe.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),K=b.useMemo(()=>v.map(Y=>{const B=N===Y.id,pe=(D==null?void 0:D.section)===Y.id,ie=Y.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{G(Y),R(Y.id,""),j&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${B?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(ie,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${B?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${B?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:Y.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 ${B?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:Y.items.length})]}),Y.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:Y.items.map(Oe=>{const C=Y.itemKey(Oe),J=pe&&(D==null?void 0:D.key)===C;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{G(Y,Y.targetId(Oe)),r(Y.id,C),R(Y.id,C),j&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${J?"bg-primary-50 font-medium text-primary-500":B?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:Y.renderItem(Oe,{isSelected:J,isSectionActive:B})})},C)})})]},Y.id)}),[v,N,D,j,G,r,R]),le=Au(w,x.length),ne=b.useMemo(()=>{const Y=ju(x.map(B=>B.items.length),le);return x.map((B,pe)=>{const ie=N===B.id,Oe=B.items.length,C=Y[pe];let J=-1;if((D==null?void 0:D.section)===B.id){const ue=B.items.findIndex(oe=>B.itemKey(oe)===D.key);ue>=0&&(J=Math.min(C-1,Math.floor(ue*C/Oe)))}return o.jsxs("div",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${ie?"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:C},(ue,oe)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${oe===J?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},oe))})]},B.id)})},[x,N,D,le]);return o.jsxs(o.Fragment,{children:[!j&&o.jsx("button",{ref:f,onClick:()=>a(Y=>!Y),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2",style:re,children:ne}),j&&o.jsx("button",{ref:f,onClick:()=>a(Y=>!Y),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:E,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"})]})}),p&&Tn.createPortal(o.jsx("div",{ref:g,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${j?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:_,children:K}),p)]})}function ba({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:i}){return o.jsx(Su,{sections:e,activeSection:t,onTabChange:a=>n(a),onItemSelect:(a,l)=>{a!=="info"&&(a==="servers"?s==null||s(l):r==null||r(a,l))},selectedItem:i?{section:i.tab,key:i.key}:null})}function Ks({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 Nu(e){return o.jsxs(Ks,{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 Ys({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 ya(e){return{id:"info",label:"Info",icon:Nu,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function wa(e){return{id:"schemas",label:"Schemas",icon:Ys,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function va({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 Tr({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 Ea({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 Jn={};function Tu({operations:e=Jn,messages:t=Jn,schemas:n=Jn,servers:r=Jn,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const p=b.useMemo(()=>{const f=g=>{var x;return d!=null&&d.useChannelAddressAsIdentifier?((x=e[g])==null?void 0:x.channel)??null:null};return[ya(s),{id:"servers",label:"Servers",icon:va,isTab:!1,items:Object.keys(r),itemKey:g=>g,targetId:g=>`server-${g}`,renderItem:g=>o.jsx("span",{className:"truncate",children:g})},{id:"operations",label:"Operations",icon:Tr,items:Object.keys(e),itemKey:g=>g,targetId:g=>`operation-${g}`,renderItem:g=>{var x;const m=f(g);return m!=null&&m.address?o.jsx(Nt,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(Tt,{method:(x=e[g])==null?void 0:x.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g})]})}},{id:"messages",label:"Messages",icon:Ea,items:Object.keys(t),itemKey:g=>g,targetId:g=>`message-${g}`,renderItem:g=>o.jsx("span",{className:"truncate",children:g})},wa(n)]},[e,t,n,r,s,d]);return o.jsx(ba,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const _r=["get","put","post","delete","options","head","patch","trace"],_u=(e,t)=>`${e} ${t}`;function vi(e,t){const n=new Map;for(const r of(e==null?void 0:e.parameters)??[])n.set(`${r.in}:${r.name}`,r);for(const r of(t==null?void 0:t.parameters)??[])n.set(`${r.in}:${r.name}`,r);return Array.from(n.values())}function vn(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?_r.filter(r=>n[r]).map(r=>({key:_u(r,t),method:r,path:t})):[]})}function Zs({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 Ei={},Cu={},Iu=[];function Ru({paths:e=Ei,webhooks:t=Ei,schemas:n=Cu,servers:r=Iu,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=b.useMemo(()=>vn(e),[e]),p=b.useMemo(()=>vn(t),[t]),f=b.useMemo(()=>{const g=r.map((m,x)=>({key:`server-${x}`,url:m}));return[ya(s),{id:"servers",label:"Servers",icon:va,isTab:!1,items:g,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>o.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Tr,items:d,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Tt,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx(Nt,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:Zs,items:p,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Tt,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m.path})]})},wa(n)]},[d,p,n,r,s]);return o.jsx(ba,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Ou=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 ka(e,t){const[n,r]=b.useState("docked"),s=b.useRef(t);return s.current=t,b.useEffect(()=>{if(!e)return;let i=null,a=null;const l=()=>{a=null;const u=e.getBoundingClientRect().top,d=i===null?0:u-i;i=u,u>=0?r("docked"):s.current||d>0?r("pinned"):d<0?r("hidden"):r(p=>p==="docked"?"hidden":p)},c=()=>{a===null&&(a=requestAnimationFrame(l))};return l(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),b.useEffect(()=>{t&&r(i=>i==="hidden"?"pinned":i)},[t]),n}function Mu(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Aa(e){let t=e;for(;t&&t!==document.body;){if(Mu(t))return t;t=t.parentElement}return document.documentElement}function ja(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}}const ki=12;function Sa({query:e,onQueryChange:t,results:n,onSelectResult:r}){const s=b.useRef(null),i=b.useRef(null),[a,l]=b.useState(!1),[c,u]=b.useState(-1),d="asyncapi-search-results",{portalHost:p,rootElement:f}=$e(),g=ka(f,a),m=g!=="docked",x=Nr(f,m),v={left:m?((x==null?void 0:x.left)??0)+ki:ki,transform:`translateY(${g==="hidden"?"-150%":"0px"})`,zIndex:40,...m?{position:"fixed",top:10,pointerEvents:g==="hidden"?"none":void 0}:{}},A=()=>{l(!1),u(-1)},T=b.useRef(!1),F=b.useRef(!1);b.useEffect(()=>{if(!f)return;const w=()=>{T.current=!0},M=()=>{T.current=!1};return f.addEventListener("mouseenter",w),f.addEventListener("mouseleave",M),()=>{f.removeEventListener("mouseenter",w),f.removeEventListener("mouseleave",M)}},[f]),b.useEffect(()=>{if(!f)return;const w=M=>{F.current=f.contains(M.target)};return document.addEventListener("mousedown",w,!0),()=>document.removeEventListener("mousedown",w,!0)},[f]),b.useEffect(()=>{if(!f)return;const w=M=>{!(M.metaKey||M.ctrlKey)||M.key.toLowerCase()!=="k"||!(f.contains(document.activeElement)||T.current||F.current)||(M.preventDefault(),l(!0))};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[f]),b.useEffect(()=>{if(!a)return;const w=requestAnimationFrame(()=>{var M;return(M=i.current)==null?void 0:M.focus()});return()=>cancelAnimationFrame(w)},[a]),b.useEffect(()=>{if(!(!a||!p))return ja(Aa(p))},[a,p]),b.useEffect(()=>{if(!a)return;const w=M=>{M.key==="Escape"&&A()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a]),b.useEffect(()=>{if(!a)return;const w=M=>{s.current&&!s.current.contains(M.target)&&A()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[a]),b.useEffect(()=>{c>=n.length&&u(n.length-1)},[c,n.length]);const S=a&&e.trim().length>0,R=w=>{A(),r(w)},N=w=>{if(w.key==="Escape"){w.preventDefault(),A();return}if(S){if(w.key==="ArrowDown"){w.preventDefault(),u(M=>n.length===0?-1:Math.min(M+1,n.length-1));return}if(w.key==="ArrowUp"){w.preventDefault(),u(M=>n.length===0?-1:M<=0?n.length-1:M-1);return}if(w.key==="Home"){w.preventDefault(),n.length>0&&u(0);return}if(w.key==="End"){w.preventDefault(),n.length>0&&u(n.length-1);return}if(w.key==="Enter"&&c>=0&&n[c]){w.preventDefault(),R(n[c]);return}}},D=w=>`asyncapi-search-result-${w}`,U=S?`${n.length} result${n.length===1?"":"s"} found`:"",k=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>l(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",style:v,children:o.jsx(Ou,{})}),a&&p&&Tn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",children:[o.jsx("div",{className:"absolute inset-0 bg-black/30"}),o.jsxs("div",{ref:s,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:i,id:"asyncapi-search",type:"search",value:e,onChange:w=>t(w.target.value),onKeyDown:N,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":d,"aria-autocomplete":"list","aria-activedescendant":c>=0?D(c):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:U}),S&&o.jsx("div",{id:d,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((w,M)=>o.jsx("li",{children:o.jsxs("button",{id:D(M),type:"button",role:"option","aria-selected":c===M,onClick:()=>R(w),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(c===M?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:w.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:w.location}),w.subtitle&&o.jsxs("span",{children:["• ",w.subtitle]})]})]})},w.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),o.jsxs("div",{className:"flex items-center justify-center gap-1 px-4 py-1.5 text-xs text-foreground-muted",children:["Press",o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:k?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]}),p)]})}function Xs({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 Qs({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 Cr({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"})})}function In({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 "})})}function Na({serialize:e,leftOffset:t}){const[n,r]=b.useState(!1),[s,i]=b.useState(!1),a=b.useRef(null),l=b.useRef(void 0),{portalHost:c,rootElement:u,deref:d,document:p,markdownUrl:f}=$e(),g=()=>e(d),m=ka(u,n),x=m!=="docked",v=Nr(u,x),A={left:x?((v==null?void 0:v.left)??0)+t:t,transform:`translateY(${m==="hidden"?"-150%":"0px"})`,zIndex:40,...x?{position:"fixed",top:10,pointerEvents:m==="hidden"?"none":void 0}:{}};b.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),b.useEffect(()=>{if(!n)return;const S=R=>{R.key==="Escape"&&r(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[n]),b.useEffect(()=>{if(!n)return;const S=R=>{a.current&&!a.current.contains(R.target)&&r(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[n]);const T=async()=>{const S=g();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:S.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(S),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),i(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(!1),2e3)}catch(R){console.error("[MarkdownExportMenu] Copy for LLM failed:",R)}r(!1)},F=()=>{const S=f==null?void 0:f({kind:"document",document:p});if(S){window.open(S,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),r(!1);return}const R=g(),N=new Blob([R],{type:"text/markdown"}),D=URL.createObjectURL(N);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:R.length,blobUrl:D}),window.open(D,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(D),3e4),r(!1)};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>r(S=>!S),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",style:A,children:[s?o.jsx(Qs,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Xs,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(In,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&c&&Tn.createPortal(o.jsxs("div",{ref:a,role:"menu",style:{position:x?"fixed":"absolute",top:54,left:A.left,zIndex:41},className:"w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:T,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(Cr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]}),c)]})}const xt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),lr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>lr(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,lr(r,t)]).join(" "):xt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,lr(r,t)]).join(" ")):"",We=e=>lr(e).trim().replace(/\s+/g," "),$u=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Lu=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Pu=e=>{if(!xt(e))return e;const t={};for(const[n,r]of Object.entries(e))Lu.has(n)||(t[n]=r);return t},Ta=(e,t,n,r)=>{const s=`schema-${n}`,i=(l,c,u,d)=>{const p=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,f=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,g=xt(l)?l.description:void 0,m=c.length?`${r}.${c.join(".")}`:r;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:d?$u(n,d):s,type:"schema",tab:"schemas",key:n,name:m,path:p,location:f,subtitle:g,text:We([Pu(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],p=new Set)=>{if(i(l,c,u,d),!xt(l)||p.has(l))return;if(p.add(l),xt(l.properties))for(const[g,m]of Object.entries(l.properties))a(m,[...c,"properties",g],[...u,g],d?[...d,"properties",g]:null,p);const f=l.items;xt(f)?a(f,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,p):Array.isArray(f)&&f.forEach((g,m)=>{a(g,[...c,`items[${m}]`],[...u,`items[${m}]`],null,p)});for(const g of["allOf","oneOf","anyOf"]){const m=l[g];Array.isArray(m)&&m.forEach((x,v)=>{a(x,[...c,`${g}[${v}]`],[...u,`${g}[${v}]`],d&&g!=="allOf"?[...d,`${g}[${v}]`]:null,p)})}xt(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,p)};a(t)};function Du(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:We([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,i]of Object.entries(e.servers)){const a=i,l=a.description??s,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:c,text:We([s,l,c,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const u=a.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:We(u)});const d=a.bindings,p=xt(d)&&a.protocol?d[a.protocol]:void 0;p!=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:We(p)})}if(e.operations)for(const[s,i]of Object.entries(e.operations)){const a=i.title??s,l=i.summary??i.description??i.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:a,path:`operations.${s}`,location:`Operations > ${a}`,subtitle:l,text:We([s,a,l,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const c=i.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${a} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:We(c)});const u=i.bindings;if(xt(u))for(const[d,p]of Object.entries(u))p!=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:We(p)})}if((n=e.components)!=null&&n.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:a,path:`components.messages.${s}`,location:`Messages > ${a}`,subtitle:l,text:We([s,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:We(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:We(i.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))Ta(t,i,s,s);return t}function Ct(e){return Array.isArray?Array.isArray(e):Ca(e)==="[object Array]"}function Bu(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 Es(e){return e==null?"":Bu(e)}function De(e){return typeof e=="string"}function cr(e){return typeof e=="number"}function Fu(e){return e===!0||e===!1||zu(e)&&Ca(e)=="[object Boolean]"}function _a(e){return typeof e=="object"}function zu(e){return _a(e)&&e!==null}function Xe(e){return e!=null}function er(e){return!e.trim().length}function Ca(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Uu="Incorrect 'index' type",ks="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Hu=e=>`Invalid value for key ${e}`,Gu=e=>`Pattern length exceeds max of ${e}.`,Wu=e=>`Missing ${e} property in key`,qu=e=>`Property 'weight' in key '${e}' must be a positive integer`,Vu="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.",Ai=Object.prototype.hasOwnProperty;var Ku=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=Ia(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 Ia(e){let t=null,n=null,r=null,s=1,i=null;if(De(e)||Ct(e))r=e,t=ji(e),n=ur(e);else{if(!Ai.call(e,"name"))throw new Error(Wu("name"));const a=e.name;if(r=a,Ai.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(qu(ur(a)));t=ji(a),n=ur(a),i=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:i}}function ji(e){return Ct(e)?e:e.split(".")}function ur(e){return Ct(e)?e.join("."):e}function Yu(e,t){const n=[];let r=!1;const s=(i,a,l,c)=>{if(Xe(i))if(!a[l])n.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Xe(u))return;if(l===a.length-1&&(De(u)||cr(u)||Fu(u)||typeof u=="bigint"))n.push(c!==void 0?{v:Es(u),i:c}:Es(u));else if(Ct(u)){r=!0;for(let d=0,p=u.length;d<p;d+=1)s(u[d],a,l+1,d)}else a.length&&s(u,a,l+1,c)}};return s(e,De(t)?t.split("."):t,0),r?n:n[0]}const Zu={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Xu={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},Qu={location:0,threshold:.6,distance:100},Ju={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Yu,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Q=Object.freeze({...Xu,...Zu,...Qu,...Ju});function ed(e){return e>=9&&e<=13||e===32||e===160}function td(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let c=0;c<s.length;c++)ed(s.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const l=Math.round(r/Math.pow(i,.5*e))/r;return n.set(i,l),l},clear(){n.clear()}}}var Js=class{constructor({getFn:e=Q.getFn,fieldNormWeight:t=Q.fieldNormWeight}={}){this.norm=td(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(De(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(ks);if(De(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(ks);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!Xe(e)||er(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(Xe(a)){if(Ct(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Xe(d)){if(De(d)){if(!er(d)){const p={v:d,i:c,n:this.norm.get(d)};l.push(p)}}else if(Xe(d.v)){const p=De(d.v)?d.v:Es(d.v);if(!er(p)){const f={v:p,i:d.i,n:this.norm.get(p)};l.push(f)}}}}n.$[r]=l}else if(De(a)&&!er(a)){const l={v:a,n:this.norm.get(a)};n.$[r]=l}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function Ra(e,t,{getFn:n=Q.getFn,fieldNormWeight:r=Q.fieldNormWeight}={}){const s=new Js({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(Ia)),s.setSources(t),s.create(),s}function nd(e,{getFn:t=Q.getFn,fieldNormWeight:n=Q.fieldNormWeight}={}){const{keys:r,records:s}=e,i=new Js({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(s),i}function rd(e=[],t=Q.minMatchCharLength){const n=[];let r=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&r===-1?r=i:!l&&r!==-1&&(s=i-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function sd(e,t,n,{location:r=Q.location,distance:s=Q.distance,threshold:i=Q.threshold,findAllMatches:a=Q.findAllMatches,minMatchCharLength:l=Q.minMatchCharLength,includeMatches:c=Q.includeMatches,ignoreLocation:u=Q.ignoreLocation}={}){if(t.length>32)throw new Error(Gu(32));const d=t.length,p=e.length,f=Math.max(0,Math.min(r,p));let g=i,m=f;const x=(k,w)=>{const M=k/d;if(u)return M;const j=Math.abs(f-w);return s?M+j/s:j?1:M},v=l>1||c,A=v?Array(p):[];let T;for(;(T=e.indexOf(t,m))>-1;){const k=x(0,T);if(g=Math.min(k,g),m=T+d,v){let w=0;for(;w<d;)A[T+w]=1,w+=1}}m=-1;let F=[],S=1,R=0,N=d+p;const D=1<<d-1;for(let k=0;k<d;k+=1){let w=0,M=N;for(;w<M;)x(k,f+M)<=g?w=M:N=M,M=Math.floor((N-w)/2+w);N=M;let j=Math.max(1,f-M+1);const W=a?p:Math.min(f+M,p)+d,re=Array(W+2);re[W+1]=(1<<k)-1;for(let se=W;se>=j;se-=1){const E=se-1,_=n[e[E]];if(re[se]=(re[se+1]<<1|1)&_,k&&(re[se]|=(F[se+1]|F[se])<<1|1|F[se+1]),re[se]&D&&(S=x(k,E),S<=g)){if(g=S,m=E,R=k,m<=f)break;j=Math.max(1,2*f-m)}}if(x(k+1,f)>g)break;F=re}if(v&&m>=0){const k=Math.min(p-1,m+d-1+R);for(let w=m;w<=k;w+=1)n[e[w]]&&(A[w]=1)}const U={isMatch:m>=0,score:Math.max(.001,S)};if(v){const k=rd(A,l);k.length?c&&(U.indices=k):U.isMatch=!1}return U}function od(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 eo(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 Oa={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},id=new RegExp("["+Object.keys(Oa).join("")+"]","g"),En=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(id,t=>Oa[t]):e=>e;var to=class{constructor(e,{location:t=Q.location,threshold:n=Q.threshold,distance:r=Q.distance,includeMatches:s=Q.includeMatches,findAllMatches:i=Q.findAllMatches,minMatchCharLength:a=Q.minMatchCharLength,isCaseSensitive:l=Q.isCaseSensitive,ignoreDiacritics:c=Q.ignoreDiacritics,ignoreLocation:u=Q.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?En(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(f,g)=>{this.chunks.push({pattern:f,alphabet:od(f),startIndex:g})},p=this.pattern.length;if(p>32){let f=0;const g=p%32,m=p-g;for(;f<m;)d(this.pattern.substr(f,32),f),f+=32;if(g){const x=p-32;d(this.pattern.substr(x),x)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?En(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let p=0,f=!1;this.chunks.forEach(({pattern:m,alphabet:x,startIndex:v})=>{const{isMatch:A,score:T,indices:F}=sd(e,m,x,{location:s+v,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});A&&(f=!0),p+=T,A&&F&&d.push(...F)});const g={isMatch:f,score:f?p/this.chunks.length:1};return f&&r&&(g.indices=eo(d)),g}};const ad=new Set(["fuzzy","include"]);function ld(e){return e.startsWith("inverse")}const As=[{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 to(e,{location:t.location??Q.location,threshold:t.threshold??Q.threshold,distance:t.distance??Q.distance,includeMatches:t.includeMatches??Q.includeMatches,findAllMatches:t.findAllMatches??Q.findAllMatches,minMatchCharLength:t.minMatchCharLength??Q.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??Q.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??Q.ignoreDiacritics,ignoreLocation:t.ignoreLocation??Q.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Si=As.length,cd="\0",ud="|";function dd(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 Ni(e,t){const n=e.match(t);return n?n[1]:null}function fd(e,t={}){return e.replace(/\\\|/g,cd).split(ud).map(n=>{const r=dd(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=r.length;i<a;i+=1){const l=r[i];let c=!1,u=-1;for(;!c&&++u<Si;){const d=As[u],p=Ni(l,d.multiRegex);p&&(s.push(d.create(p,t)),c=!0)}if(!c)for(u=-1;++u<Si;){const d=As[u],p=Ni(l,d.singleRegex);if(p){s.push(d.create(p,t));break}}}return s})}var pd=class{constructor(e,{isCaseSensitive:t=Q.isCaseSensitive,ignoreDiacritics:n=Q.ignoreDiacritics,includeMatches:r=Q.includeMatches,minMatchCharLength:s=Q.minMatchCharLength,ignoreLocation:i=Q.ignoreLocation,findAllMatches:a=Q.findAllMatches,location:l=Q.location,threshold:c=Q.threshold,distance:u=Q.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?En(e):e,this.pattern=e,this.query=fd(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?En(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const p=t[u];a.length=0,i=0,c=!1;for(let f=0,g=p.length;f<g;f+=1){const m=p[f],{isMatch:x,indices:v,score:A}=m.search(e);if(x)i+=1,l+=A,ld(m.type)&&(c=!0),n&&(ad.has(m.type)?a.push(...v):a.push(v));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const f={isMatch:!0,score:l/i};return c&&(f.hasInverse=!0),n&&(f.indices=eo(a)),f}}return{isMatch:!1,score:1}}};const js=[];function no(...e){js.push(...e)}function mr(e,t){for(let n=0,r=js.length;n<r;n+=1){const s=js[n];if(s.condition(e,t))return new s(e,t)}return new to(e,t)}const gr={AND:"$and",OR:"$or"},Ss={PATH:"$path",PATTERN:"$val"},Ns=e=>!!(e[gr.AND]||e[gr.OR]),hd=e=>!!e[Ss.PATH],md=e=>!Ct(e)&&_a(e)&&!Ns(e),Ti=e=>({[gr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ma(e,t,{auto:n=!0}={}){const r=s=>{if(De(s)){const c={keyId:null,pattern:s};return n&&(c.searcher=mr(s,t)),c}const i=Object.keys(s),a=hd(s);if(!a&&i.length>1&&!Ns(s))return r(Ti(s));if(md(s)){const c=a?s[Ss.PATH]:i[0],u=a?s[Ss.PATTERN]:s[c];if(!De(u))throw new Error(Hu(c));const d={keyId:ur(c),pattern:u};return n&&(d.searcher=mr(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];Ct(u)&&u.forEach(d=>{l.children.push(r(d))})}),l};return Ns(e)||(e=Ti(e)),r(e)}function Ts(e,{ignoreFieldNorm:t=Q.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 gd(e,{ignoreFieldNorm:t=Q.ignoreFieldNorm}){e.forEach(n=>{n.score=Ts(n.matches,{ignoreFieldNorm:t})})}var xd=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 bd(e){const t=[];return e.matches.forEach(n=>{if(!Xe(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 yd(e,t,{includeMatches:n=Q.includeMatches,includeScore:r=Q.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return n&&(a.matches=bd(s)),r&&(a.score=s.score),a})}const wd=/[\p{L}\p{M}\p{N}_]+/gu,_i=new WeakSet;function vd(e){_i.has(e)||(_i.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 Ed(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||vd(e),t=>t.match(e)||[]):t=>t.match(wd)||[]}function _s({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=Ed(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=En(s)),r(s)}}}var kd=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=_s({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 to(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=r.get(i)||0,l=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),p=this.idfWeights[u];r+=p,d.isMatch&&(s++,n+=p*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(s===0)return{isMatch:!1,score:1};const l=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=eo(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function as(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const l of i)a.set(l,(a.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function $a(e,t,n,r){const{i:s,v:i,$:a}=t;if(i!==void 0){as(e,i,s,r);return}if(a)for(let l=0;l<n;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)as(e,u.v,s,r);else as(e,c.v,s,r)}}function Ad(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)$a(r,s,t,n);return r}function jd(e,t,n,r){$a(e,t,n,r)}function Sd(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 Ci(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of n)Sd(e,l);const r=l=>{let c=0,u=n.length;for(;c<u;){const d=c+u>>>1;n[d]<l?c=d+1:u=d}return l-c},s=n[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>s?r(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>s?r(l):l,c);e.docTermFieldHits=a}var It=class{constructor(e,t,n){this.options={...Q,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Ku(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=mr(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 Js))throw new Error(Uu);if(this._myIndex=t||Ra(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=_s({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Ad(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Xe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=_s({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});jd(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&&Ci(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(ks);this._invertedIndex&&Ci(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(De(e)&&!e.trim()){let f=this._docs.map((g,m)=>({item:g,refIndex:m}));return cr(n)&&n>-1&&(f=f.slice(0,n)),f}const c=i&&cr(n)&&n>0&&De(e),u=a,d=(f,g)=>u(f,g)||f.idx-g.idx;let p;if(c){const f=new xd(n,d);De(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),p=f.extractSorted()}else p=De(e)?De(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),gd(p,{ignoreFieldNorm:l}),i&&p.sort(De(e)?d:u),cr(n)&&n>-1&&(p=p.slice(0,n));return yd(p,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!Xe(l))return;const d=r.searchIn(l);if(d.isMatch){const p={score:d.score,value:l,norm:u,indices:d.indices};s&&(p.matchedMask=d.matchedMask,p.matchedTerms=d.matchedTerms,p.termCount=d.termCount);const f=[p];if(!s||this._coversAllTokens(f)){const g={item:l,idx:c,matches:f};t?(g.score=Ts(g.matches,{ignoreFieldNorm:n}),t.insert(g)):a.push(g)}}}),a}_searchLogical(e){const t=Ma(e,this.options),n=this._normalizedKeys(),r=(l,c,u)=>{if(!("children"in l)){const{keyId:g,searcher:m}=l;let x;return g===null?(x=[],n.forEach((v,A)=>{x.push(...this._findMatches({key:v,value:c[A],searcher:m}))})):x=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(c,g),searcher:m}),x&&x.length?[{idx:u,item:c,matches:x}]:[]}const{children:d,operator:p}=l,f=[];for(let g=0,m=d.length;g<m;g+=1){const x=d[g],v=r(x,c,u);if(v.length)f.push(...v);else if(p===gr.AND)return[]}return f},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Xe(l)){const u=r(t,l,c);u.length&&(i.has(c)||(i.set(c,{idx:c,item:l,matches:[]}),a.push(i.get(c))),u.forEach(({matches:d})=>{i.get(c).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!Xe(c))return;const d=[];let p=!1,f=!1;if(a.forEach((g,m)=>{const x=this._findMatches({key:g,value:c[m],searcher:r});x.length?(d.push(...x),x[0].hasInverse&&(f=!0)):p=!0}),!(f&&p)&&d.length&&(!s||this._coversAllTokens(d))){const g={idx:u,item:c,matches:d};t?(g.score=Ts(g.matches,{ignoreFieldNorm:n}),t.insert(g)):l.push(g)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Xe(t))return[];const r=[];if(Ct(t))t.forEach(({v:s,i,n:a})=>{if(!Xe(s))return;const l=n.searchIn(s);if(l.isMatch){const c={score:l.score,key:e,value:s,idx:i,norm:a,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(c.matchedMask=l.matchedMask,c.matchedTerms=l.matchedTerms,c.termCount=l.termCount),r.push(c)}});else{const{v:s,n:i}=t,a=n.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),r.push(l)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const i of s)n.add(i)}return n.size===t}};It.version="7.5.0";It.createIndex=Ra;It.parseIndex=nd;It.config=Q;It.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(Vu);return mr(e,{...Q,...n}).searchIn(t)};It.parseQuery=Ma;no(pd);no(kd);It.use=function(...e){e.forEach(t=>no(t))};var Nd=It;function La(e,t,n={}){const[r,s]=b.useState(""),[i,a]=b.useState(""),l=n.debounceMs??150;b.useEffect(()=>{const p=setTimeout(()=>a(r),l);return()=>clearTimeout(p)},[r,l]);const c=b.useMemo(()=>t(e),[e,t]),u=b.useMemo(()=>new Nd(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,n.threshold]),d=b.useMemo(()=>i.trim()?u.search(i.trim(),{limit:n.limit??20}).map(p=>p.item):[],[u,i,n.limit]);return{query:r,setQuery:s,results:d,searchIndex:c}}function Td(e,t={}){return La(e,Du,t)}const Cs="search-match",Pa=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function _d(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let l=0;for(let c=a.indexOf(n);c!==-1;c=a.indexOf(n,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+n.length),r.push(u),l=c+n.length}}return r}function Cd(e,t){if(!Pa())return;const n=_d(e,t);if(!n.length){CSS.highlights.delete(Cs);return}CSS.highlights.set(Cs,new Highlight(...n))}function ls(){Pa()&&CSS.highlights.delete(Cs)}function Id(e,t){const n=b.useRef(null);b.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:i}=e;let a=!1;const l=u=>{if(a)return;const d=document.getElementById(r);if(!d){u<40&&setTimeout(()=>l(u+1),50);return}if(n.current!==r){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}i&&c(0)},c=u=>{if(a)return;const d=document.getElementById(r);d&&Cd(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function Da({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s}){var M;const i=((M=e[0])==null?void 0:M.id)??t,[a,l]=b.useState(i),[c,u]=b.useState(null),d=j=>{l(j),u(j)},[p,f]=b.useState({}),g=e.some(j=>j.id===a)?a:i,m={};for(const j of r)m[j.id]=j.visible?p[j.id]??null:null;const x=(j,W)=>f(re=>({...re,[j]:W})),[v,A]=b.useState(null),[T,F]=b.useState(null),[S,R]=b.useState(null),N=j=>{n(j.tab)?d(j.tab):j.tab==="servers"&&u("servers");const W={};for(const re of r)W[re.id]=re.id===j.tab?j.key:null;f(W),A(j.focusSection??null),F(j.tab==="schemas"&&j.schemaFocusTokens?{tokens:j.schemaFocusTokens,id:j.targetId}:null),j.tab==="schemas"&&ls(),R({targetId:j.targetId,query:s,highlight:j.tab!=="schemas"})},D=(j,W)=>{d(j),f(re=>{const se={...re};for(const E of r)E.id!=="servers"&&(se[E.id]=E.id===j?W:null);return se})},U=j=>{u("servers");const W={};for(const re of r)W[re.id]=re.id==="servers"?j:null;f(W)},k=j=>{n(j)&&d(j)},w=(()=>{for(const j of r){const W=m[j.id];if(W)return{tab:j.id,key:W}}return null})();return Id(S,[g,v,T,...r.map(j=>m[j.id])]),b.useEffect(()=>{s.trim()||(R(null),ls())},[s]),b.useEffect(()=>ls,[]),{effectiveTab:g,focusTab:d,navActiveSection:c??g,selected:m,setSelectedKey:x,selectedNavItem:w,handleSearchSelect:N,handleNavItemSelect:D,handleNavServerSelect:U,handleContentTabChange:k,focusSection:v,schemaFocusTarget:T}}const te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),mt=e=>te(e)?e:null,Ii="^[\0-ÿ]*$",Rd=Math.pow(-2,31),Od=Math.pow(2,31)-1,Md=Math.pow(-2,63),$d=Math.pow(2,63)-1,Ld={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"},ro=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function kn(e){const t=ro(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Is(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=kn(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Ri(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function Pd(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 Dd(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 Rs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Os(e,t,n){const{type:r,jsonSchema:s}=Pd(e,n);Dd(r,t.example,s);function i(...a){a.forEach(l=>{let c=!0;l==="minLength"||l==="maxLength"?c=t[l]>-1:l==="multipleOf"&&(c=t[l]>0),t[l]!==void 0&&c&&(s[l]=t[l])})}switch(r){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function so(e,t,n){t!==void 0&&(e[t]=n)}function An(e,t){let n={};if(Array.isArray(e))return Fd(n,e,t);const r=ro(e),s=typeof e=="string"?e:r.type;switch(n.type=Ld[s],s){case"int":{n.minimum=Rd,n.maximum=Od;break}case"long":{n.minimum=Md,n.maximum=$d;break}case"bytes":{n.pattern=Ii;break}case"fixed":{n.pattern=Ii,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=An(r.values,t);break}case"array":{n.items=An(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const i=Bd(r,t,n);so(t,kn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[kn(e)]??(typeof s=="string"?t[s]:void 0);i&&(n=Rs(r)?{...i}:i);break}}return Is(r,n,t),Os(s,r,n),n}function Bd(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=Rs(s)?{...i}:i;Ri(s,n,s.default!==void 0),Rs(s)&&(Is(s,a,t),Os(s.type,s,a)),r.set(s.name,a)}else{const a=An(s.type,t);Ri(s,n,s.default!==void 0),Is(s,a,t),Os(s.type,s,a),r.set(s.name,a),so(t,kn(s.type),a)}}return r}function Fd(e,t,n){const r=[];let s=null;for(const i of t){const a=An(i,n);(typeof i=="string"?i:ro(i).type)==="null"?s=a:(r.push(a),so(n,kn(i),a))}return s&&r.push(s),e.oneOf=r,e}function Ms(e){return An(e,{})}const Oi=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),zd=new Set(["record","enum","array","map","fixed"]),Mi=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function oo(e){const t=[];return Qt(e,"schema",t,new Set),t}function Qt(e,t,n,r){if(typeof e=="string"){!Oi.has(e)&&!Mi.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)=>Qt(i,`${t}[${a}]`,n,r));return}if(!te(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)||te(s)?Qt(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Oi.has(s)&&!zd.has(s)&&!Mi.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const l=`${t}.fields[${a}]`;if(!te(i)||typeof i.name!="string"){n.push(`${l}: field must have a string "name"`);return}Qt(i.type,`${l}.type`,n,r)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):Qt(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):Qt(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let xr=null,cs=null;const $s=new Set;function Ud(){return cs||(cs=Promise.resolve().then(()=>require("./protoToJsonSchema-wxazjeYy.cjs")).then(e=>{xr=e.protoToJsonSchema,$s.forEach(t=>t())})),cs}function Hd(){return xr||Ud(),xr}function Gd(e){return $s.add(e),()=>$s.delete(e)}function $i(){return xr!==null}function io(){return b.useSyncExternalStore(Gd,$i,$i)}const Wd="x-parser-original-payload",br="x-lib-conversion-error",qd=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,Vd=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Rn(e){return typeof e=="string"&&qd.test(e)}function On(e){return typeof e=="string"&&Vd.test(e)}function Ba(e){return te(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Fa(e){var t,n;if(typeof e!="string")return null;if(Rn(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(On(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 za(e){return Rn(e)?"Avro":On(e)?"Protobuf":null}function Kd(e,t){return t?!1:!e||Rn(e)||On(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Yd=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Zd=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Xd(e){return typeof e=="string"||Array.isArray(e)?!0:te(e)?typeof e.type=="string"&&Zd.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Yd.some(t=>t in e):!1}function jn(e,t){let n=e;if(t&&te(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const r=Qd(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const i=Ba(n)?n.description:void 0;return typeof i=="string"?{...r,description:i}:r}function Qd(e){var a;if(!Ba(e))return{schema:mt(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[Wd],s=(a=mt(n))==null?void 0:a[br];if(typeof s=="string")return{schema:mt(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:mt(n)??{},schemaFormat:t,originalSchema:r};if(Rn(t)&&Xd(n)){const l=oo(n);if(l.length>0)return{schema:mt(n)??{},schemaFormat:t,originalSchema:n,conversionError:l[0]};try{return{schema:Ms(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:mt(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(On(t)&&typeof n=="string"){const l=Hd();if(!l)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:l(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=mt(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const Ie=(e,t)=>`${"#".repeat(e)} ${t}`,z=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),mn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Jd={objects:new Set,refs:new Set};function dr(e,t,n=Jd){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||mn(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const i=mn(e)?e["x-parser-schema-id"]:void 0;return typeof i=="string"?{$ref:`#/components/schemas/${i} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:mn(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(i=>dr(i,t,r));if(mn(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return mn(i)||Array.isArray(i)?dr(i,t,r):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=dr(a,t,r);return s}function yr(e,t,n){if(!t)return"";const r=dr(t,n);return`${Ie(4,`\`${z(e)}\``)}
|
|
4
|
+
|
|
5
|
+
\`\`\`json
|
|
6
|
+
${JSON.stringify(r,null,2)}
|
|
7
|
+
\`\`\``}function yn(e,t,n){if(!t||typeof t=="boolean")return"";const{schema:r,description:s,conversionError:i,pendingConversion:a}=jn(t,n);if(a)return`${Ie(4,`\`${z(e)}\``)}
|
|
8
|
+
|
|
9
|
+
_(schema conversion still in progress)_`;if(i)return`${Ie(4,`\`${z(e)}\``)}
|
|
10
|
+
|
|
11
|
+
_(could not convert schema: ${z(i)})_`;const l=s&&!r.description?{...r,description:s}:r;return yr(e,l,n)}function Ua(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${z(e.in)}${e.name?`: \`${z(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${z(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 z(e.type)}}function ef(e){if(!(e!=null&&e.length))return"";const t=[];for(const n of e)if(n!=null&&n.type&&(t.push(`- **${Ua(n)}**`),n.description&&t.push(` ${z(n.description)}`),n.type==="openIdConnect"&&n.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${z(n.openIdConnectUrl)}\``),n.type==="oauth2"))for(const[r,s]of Object.entries(n.flows??{})){t.push(` - Flow \`${z(r)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${z(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${z(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${z(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${z(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
|
|
12
|
+
`)].join(`
|
|
13
|
+
|
|
14
|
+
`):""}function Ha(e){const t=[],{info:n}=e;t.push(Ie(1,z(n.title)));const r=[`**Version:** ${z(n.version)}`];if(n.license&&r.push(`**License:** ${z(n.license.name)}${n.license.url?` (${z(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(z).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
|
|
15
|
+
`)),n.description&&t.push(z(n.description)),e.servers&&Object.keys(e.servers).length){const s=[Ie(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(Ie(3,z(i)));const l=[`**Host:** \`${z(a.host)}${a.pathname?z(a.pathname):""}\``];l.push(`**Protocol:** ${z(a.protocol)}${a.protocolVersion?` ${z(a.protocolVersion)}`:""}`),a.description&&l.push(z(a.description)),s.push(l.join(`
|
|
16
|
+
`));const c=ef(a.security);c&&s.push(c)}t.push(s.join(`
|
|
17
|
+
|
|
18
|
+
`))}return t}function ao(e,t=_n(e)){var i,a,l;const n=Ha(e);if(e.operations&&Object.keys(e.operations).length){const c=[Ie(2,"Operations")];for(const[u,d]of Object.entries(e.operations)){const p=d.channel;c.push(Ie(3,`${z((i=d.action)==null?void 0:i.toUpperCase())} \`${z(u)}\``));const f=[];p!=null&&p.address&&f.push(`**Channel:** \`${z(p.address)}\``),d.summary&&f.push(z(d.summary)),d.description&&f.push(z(d.description));const g=d.messages??[];g.length&&f.push(`**Messages:** ${g.map(m=>`\`${z(m.name??m.title??"message")}\``).join(", ")}`),c.push(f.join(`
|
|
19
|
+
|
|
20
|
+
`))}n.push(c.join(`
|
|
21
|
+
|
|
22
|
+
`))}const r=(a=e.components)==null?void 0:a.messages;if(r&&Object.keys(r).length){const c=[Ie(2,"Messages")];for(const[u,d]of Object.entries(r)){c.push(Ie(3,z(d.title??d.name??u)));const p=[];d.summary&&p.push(z(d.summary)),d.description&&p.push(z(d.description)),d.contentType&&p.push(`**Content-Type:** \`${z(d.contentType)}\``),c.push(p.join(`
|
|
23
|
+
|
|
24
|
+
`)),d.payload&&c.push(yn("payload",d.payload,t)),d.headers&&c.push(yn("headers",d.headers,t))}n.push(c.join(`
|
|
25
|
+
|
|
26
|
+
`))}const s=(l=e.components)==null?void 0:l.schemas;if(s&&Object.keys(s).length){const c=[Ie(2,"Schemas")];for(const[u,d]of Object.entries(s))c.push(yn(u,d,t));n.push(c.join(`
|
|
27
|
+
|
|
28
|
+
`))}return n.filter(Boolean).join(`
|
|
29
|
+
|
|
30
|
+
`)}function tf(e,t,n){var l;const r=t.channel,s=[Ie(3,`${z((l=t.action)==null?void 0:l.toUpperCase())} \`${z(e)}\``)],i=[];r!=null&&r.address&&i.push(`**Channel:** \`${z(r.address)}\``),t.summary&&i.push(z(t.summary)),t.description&&i.push(z(t.description)),s.push(i.join(`
|
|
31
|
+
|
|
32
|
+
`));const a=t.messages??[];for(const c of a){const u=[Ie(4,z(c.title??c.name??"Message"))],d=[];c.summary&&d.push(z(c.summary)),c.description&&d.push(z(c.description)),c.contentType&&d.push(`**Content-Type:** \`${z(c.contentType)}\``),d.length&&u.push(d.join(`
|
|
33
|
+
|
|
34
|
+
`)),s.push(u.join(`
|
|
35
|
+
|
|
36
|
+
`)),c.payload&&s.push(yn("payload",c.payload,n)),c.headers&&s.push(yn("headers",c.headers,n))}return s.filter(Boolean).join(`
|
|
37
|
+
|
|
38
|
+
`)}function lo(e,t,n=_n(e)){var i;const r=(i=e.operations)==null?void 0:i[t];if(!r)return"";const s=Ha(e);return s.push(tf(t,r,n)),s.filter(Boolean).join(`
|
|
39
|
+
|
|
40
|
+
`)}function nf(e,t){if(!e.length||!t)return"";const n=new Map;for(const i of e)for(const[a,l]of Object.entries(i)){if(!l.length)continue;const c=n.get(a)??[];n.set(a,Array.from(new Set([...c,...l])))}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 l=n.get(i);if(s.push(`- **${Ua(a)}** (\`${z(i)}\`)`),a.description&&s.push(` ${z(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${z(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${z(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${z(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${z(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${z(u.refreshUrl)}\``);const d=l!=null&&l.length?l:Object.keys(u.scopes??{});d.length&&s.push(` - ${l!=null&&l.length?"Required scopes":"Scopes"}: ${d.map(p=>`\`${z(p)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${z(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
|
|
41
|
+
`)].join(`
|
|
42
|
+
|
|
43
|
+
`):""}function Ga(e,t,n,r,s,i){var f;const a=[Ie(3,`${e.toUpperCase()} \`${z(t)}\``)],l=[];n.summary&&l.push(z(n.summary)),n.description&&l.push(z(n.description)),n.deprecated&&l.push("**Deprecated**");const c=n.security??i??[],u=nf(c,s);u&&l.push(u);for(const g of["path","query","header","cookie"]){const m=(n.parameters??[]).filter(x=>x.in===g);if(m.length){l.push(`**${g[0].toUpperCase()}${g.slice(1)} Parameters:**`);for(const x of m){const v=x.schema;l.push(`- \`${z(x.name)}\`${x.required?" (required)":""}${v!=null&&v.type?` — ${z(v.type)}`:""}${x.description?`: ${z(x.description)}`:""}`)}}}a.push(l.join(`
|
|
44
|
+
|
|
45
|
+
`));const d=((f=n.requestBody)==null?void 0:f.content)??{};for(const[g,m]of Object.entries(d))a.push([`**Request Body** (\`${z(g)}\`)`,yr("body",m.schema,r)].join(`
|
|
46
|
+
|
|
47
|
+
`));const p=n.responses??{};for(const[g,m]of Object.entries(p)){const x=[Ie(4,`${g}${m.description?`: ${z(m.description)}`:""}`)];for(const[v,A]of Object.entries(m.content??{}))x.push([`**Body** (\`${z(v)}\`)`,yr("body",A.schema,r)].join(`
|
|
48
|
+
|
|
49
|
+
`));a.push(x.join(`
|
|
50
|
+
|
|
51
|
+
`))}return a.join(`
|
|
52
|
+
|
|
53
|
+
`)}function co(e,t=_n(e)){var a,l,c,u,d;const n=[],{info:r}=e;if(n.push(Ie(1,z(r.title))),n.push(`**Version:** ${z(r.version)}`),r.description&&n.push(z(r.description)),(a=e.servers)!=null&&a.length){const p=[Ie(2,"Servers")];for(const f of e.servers)p.push(`- \`${z(f.url)}\`${f.description?` — ${z(f.description)}`:""}`);n.push(p.join(`
|
|
54
|
+
`))}const s=e.paths?vn(e.paths):[];if(s.length){const p=[Ie(2,"Endpoints")];for(const{method:f,path:g}of s){const m=(c=(l=e.paths)==null?void 0:l[g])==null?void 0:c[f];m&&p.push(Ga(f,g,m,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}n.push(p.join(`
|
|
55
|
+
|
|
56
|
+
`))}const i=(d=e.components)==null?void 0:d.schemas;if(i&&Object.keys(i).length){const p=[Ie(2,"Schemas")];for(const[f,g]of Object.entries(i))p.push(yr(f,g,t));n.push(p.join(`
|
|
57
|
+
|
|
58
|
+
`))}return n.filter(Boolean).join(`
|
|
59
|
+
|
|
60
|
+
`)}function uo(e,t,n,r=_n(e)){var l,c,u,d;const s=(c=(l=e.paths)==null?void 0:l[n])==null?void 0:c[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(Ie(1,z(a.title))),i.push(`**Version:** ${z(a.version)}`),a.description&&i.push(z(a.description)),(u=e.servers)!=null&&u.length){const p=[Ie(2,"Servers")];for(const f of e.servers)p.push(`- \`${z(f.url)}\`${f.description?` — ${z(f.description)}`:""}`);i.push(p.join(`
|
|
61
|
+
`))}return i.push(Ga(t,n,s,r,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
|
|
62
|
+
|
|
63
|
+
`)}const Wa={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},rf=()=>Promise.resolve().then(()=>require("./LogoExtension-BOYrY_RE.cjs"));var sf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function of(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}/*! @license DOMPurify 3.4.11 | (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.11/LICENSE */var us,Li;function Pi(){if(Li)return us;Li=1;function e(I,O){(O==null||O>I.length)&&(O=I.length);for(var V=0,ee=Array(O);V<O;V++)ee[V]=I[V];return ee}function t(I){if(Array.isArray(I))return I}function n(I,O){var V=I==null?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(V!=null){var ee,de,ve,Pe,on=[],Ve=!0,an=!1;try{if(ve=(V=V.call(I)).next,O!==0)for(;!(Ve=(ee=ve.call(V)).done)&&(on.push(ee.value),on.length!==O);Ve=!0);}catch(Dr){an=!0,de=Dr}finally{try{if(!Ve&&V.return!=null&&(Pe=V.return(),Object(Pe)!==Pe))return}finally{if(an)throw de}}return on}}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(I,O){return t(I)||n(I,O)||i(I,O)||r()}function i(I,O){if(I){if(typeof I=="string")return e(I,O);var V={}.toString.call(I).slice(8,-1);return V==="Object"&&I.constructor&&(V=I.constructor.name),V==="Map"||V==="Set"?Array.from(I):V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V)?e(I,O):void 0}}const a=Object.entries,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let p=Object.freeze,f=Object.seal,g=Object.create,m=typeof Reflect<"u"&&Reflect,x=m.apply,v=m.construct;p||(p=function(O){return O}),f||(f=function(O){return O}),x||(x=function(O,V){for(var ee=arguments.length,de=new Array(ee>2?ee-2:0),ve=2;ve<ee;ve++)de[ve-2]=arguments[ve];return O.apply(V,de)}),v||(v=function(O){for(var V=arguments.length,ee=new Array(V>1?V-1:0),de=1;de<V;de++)ee[de-1]=arguments[de];return new O(...ee)});const A=ne(Array.prototype.forEach),T=ne(Array.prototype.lastIndexOf),F=ne(Array.prototype.pop),S=ne(Array.prototype.push),R=ne(Array.prototype.splice),N=Array.isArray,D=ne(String.prototype.toLowerCase),U=ne(String.prototype.toString),k=ne(String.prototype.match),w=ne(String.prototype.replace),M=ne(String.prototype.indexOf),j=ne(String.prototype.trim),W=ne(Number.prototype.toString),re=ne(Boolean.prototype.toString),se=typeof BigInt>"u"?null:ne(BigInt.prototype.toString),E=typeof Symbol>"u"?null:ne(Symbol.prototype.toString),_=ne(Object.prototype.hasOwnProperty),G=ne(Object.prototype.toString),K=ne(RegExp.prototype.test),le=Y(TypeError);function ne(I){return function(O){O instanceof RegExp&&(O.lastIndex=0);for(var V=arguments.length,ee=new Array(V>1?V-1:0),de=1;de<V;de++)ee[de-1]=arguments[de];return x(I,O,ee)}}function Y(I){return function(){for(var O=arguments.length,V=new Array(O),ee=0;ee<O;ee++)V[ee]=arguments[ee];return v(I,V)}}function B(I,O){let V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:D;if(l&&l(I,null),!N(O))return I;let ee=O.length;for(;ee--;){let de=O[ee];if(typeof de=="string"){const ve=V(de);ve!==de&&(c(O)||(O[ee]=ve),de=ve)}I[de]=!0}return I}function pe(I){for(let O=0;O<I.length;O++)_(I,O)||(I[O]=null);return I}function ie(I){const O=g(null);for(const ee of a(I)){var V=s(ee,2);const de=V[0],ve=V[1];_(I,de)&&(N(ve)?O[de]=pe(ve):ve&&typeof ve=="object"&&ve.constructor===Object?O[de]=ie(ve):O[de]=ve)}return O}function Oe(I){switch(typeof I){case"string":return I;case"number":return W(I);case"boolean":return re(I);case"bigint":return se?se(I):"0";case"symbol":return E?E(I):"Symbol()";case"undefined":return G(I);case"function":case"object":{if(I===null)return G(I);const O=I,V=C(O,"toString");if(typeof V=="function"){const ee=V(O);return typeof ee=="string"?ee:G(ee)}return G(I)}default:return G(I)}}function C(I,O){for(;I!==null;){const ee=d(I,O);if(ee){if(ee.get)return ne(ee.get);if(typeof ee.value=="function")return ne(ee.value)}I=u(I)}function V(){return null}return V}function J(I){try{return K(I,""),!0}catch{return!1}}const ue=p(["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"]),oe=p(["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"]),we=p(["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"]),be=p(["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"]),ye=p(["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"]),qe=p(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ee=p(["#text"]),nt=p(["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"]),Le=p(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),Z=p(["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"]),ke=p(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Te=f(/{{[\w\W]*|^[\w\W]*}}/g),he=f(/<%[\w\W]*|^[\w\W]*%>/g),pt=f(/\${[\w\W]*/g),Je=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),Rt=f(/^aria-[\-\w]+$/),et=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),P=f(/^(?:\w+script|data):/i),H=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=f(/^html$/i),ce=f(/^[a-z][.\w]*(-[.\w]+)+$/i),_e=f(/<[/\w!]/g),rt=f(/<[/\w]/g),Lr=f(/<\/no(script|embed|frames)/i),Pr=f(/\/>/i),lt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},pc=function(){return typeof window>"u"?null:window},hc=function(O,V){if(typeof O!="object"||typeof O.createPolicy!="function")return null;let ee=null;const de="data-tt-policy-suffix";V&&V.hasAttribute(de)&&(ee=V.getAttribute(de));const ve="dompurify"+(ee?"#"+ee:"");try{return O.createPolicy(ve,{createHTML(Pe){return Pe},createScriptURL(Pe){return Pe}})}catch{return console.warn("TrustedTypes policy "+ve+" could not be created."),null}},Lo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},wt=function(O,V,ee,de){return _(O,V)&&N(O[V])?B(de.base?ie(de.base):{},O[V],de.transform):ee};function Po(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pc();const O=L=>Po(L);if(O.version="3.4.11",O.removed=[],!I||!I.document||I.document.nodeType!==lt.document||!I.Element)return O.isSupported=!1,O;let V=I.document;const ee=V,de=ee.currentScript;I.DocumentFragment;const ve=I.HTMLTemplateElement,Pe=I.Node,on=I.Element,Ve=I.NodeFilter,an=I.NamedNodeMap;an===void 0&&(I.NamedNodeMap||I.MozNamedAttrMap),I.HTMLFormElement;const Dr=I.DOMParser,Gn=I.trustedTypes,Ot=on.prototype,gc=C(Ot,"cloneNode"),Do=C(Ot,"remove"),xc=C(Ot,"nextSibling"),ln=C(Ot,"childNodes"),cn=C(Ot,"parentNode"),Bo=C(Ot,"shadowRoot"),Br=C(Ot,"attributes"),Ke=Pe&&Pe.prototype?C(Pe.prototype,"nodeType"):null,vt=Pe&&Pe.prototype?C(Pe.prototype,"nodeName"):null;if(typeof ve=="function"){const L=V.createElement("template");L.content&&L.content.ownerDocument&&(V=L.content.ownerDocument)}let Ue,Mt="",Fr,Fo=!1,un=0;const zo=function(){if(un>0)throw le('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.')},Gt=function(h){zo(),un++;try{return Ue.createHTML(h)}finally{un--}},bc=function(h){zo(),un++;try{return Ue.createScriptURL(h)}finally{un--}},yc=function(){return Fo||(Fr=hc(Gn,de),Fo=!0),Fr},Wn=V,zr=Wn.implementation,Uo=Wn.createNodeIterator,wc=Wn.createDocumentFragment,vc=Wn.getElementsByTagName,Ec=ee.importNode;let Ce=Lo();O.isSupported=typeof a=="function"&&typeof cn=="function"&&zr&&zr.createHTMLDocument!==void 0;const kc=Te,Ac=he,jc=pt,Sc=Je,Nc=Rt,Tc=P,Ho=H,_c=ce;let Go=et,Ae=null;const Wo=B({},[...ue,...oe,...we,...ye,...Ee]);let je=null;const qo=B({},[...nt,...Le,...Z,...ke]);let Se=Object.seal(g(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}})),dn=null,Vo=null;const Et=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ko=!0,Ur=!0,Yo=!1,Zo=!0,kt=!1,fn=!0,$t=!1,Hr=!1,Gr=null,Wr=null,qr=!1,Wt=!1,qn=!1,Vn=!1,Xo=!0,Qo=!1;const Jo="user-content-";let Vr=!0,Kr=!1,qt={},ct=null;const Yr=B({},["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 ei=null;const ti=B({},["audio","video","img","source","image","track"]);let Zr=null;const ni=B({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Vt=ut,Xr=!1,Qr=null;const Cc=B({},[Kn,Yn,ut],U),ri=p(["mi","mo","mn","ms","mtext"]);let Jr=B({},ri);const si=p(["annotation-xml"]);let es=B({},si);const Ic=B({},["title","style","font","a","script"]);let pn=null;const Rc=["application/xhtml+xml","text/html"],Oc="text/html";let Ne=null,Kt=null;const Mc=V.createElement("form"),oi=function(h){return h instanceof RegExp||h instanceof Function},ts=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kt&&Kt===h)return;(!h||typeof h!="object")&&(h={}),h=ie(h),pn=Rc.indexOf(h.PARSER_MEDIA_TYPE)===-1?Oc:h.PARSER_MEDIA_TYPE,Ne=pn==="application/xhtml+xml"?U:D,Ae=wt(h,"ALLOWED_TAGS",Wo,{transform:Ne}),je=wt(h,"ALLOWED_ATTR",qo,{transform:Ne}),Qr=wt(h,"ALLOWED_NAMESPACES",Cc,{transform:U}),Zr=wt(h,"ADD_URI_SAFE_ATTR",ni,{transform:Ne,base:ni}),ei=wt(h,"ADD_DATA_URI_TAGS",ti,{transform:Ne,base:ti}),ct=wt(h,"FORBID_CONTENTS",Yr,{transform:Ne}),dn=wt(h,"FORBID_TAGS",ie({}),{transform:Ne}),Vo=wt(h,"FORBID_ATTR",ie({}),{transform:Ne}),qt=_(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?ie(h.USE_PROFILES):h.USE_PROFILES:!1,Ko=h.ALLOW_ARIA_ATTR!==!1,Ur=h.ALLOW_DATA_ATTR!==!1,Yo=h.ALLOW_UNKNOWN_PROTOCOLS||!1,Zo=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,kt=h.SAFE_FOR_TEMPLATES||!1,fn=h.SAFE_FOR_XML!==!1,$t=h.WHOLE_DOCUMENT||!1,Wt=h.RETURN_DOM||!1,qn=h.RETURN_DOM_FRAGMENT||!1,Vn=h.RETURN_TRUSTED_TYPE||!1,qr=h.FORCE_BODY||!1,Xo=h.SANITIZE_DOM!==!1,Qo=h.SANITIZE_NAMED_PROPS||!1,Vr=h.KEEP_CONTENT!==!1,Kr=h.IN_PLACE||!1,Go=J(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:et,Vt=typeof h.NAMESPACE=="string"?h.NAMESPACE:ut,Jr=_(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?ie(h.MATHML_TEXT_INTEGRATION_POINTS):B({},ri),es=_(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?ie(h.HTML_INTEGRATION_POINTS):B({},si);const y=_(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?ie(h.CUSTOM_ELEMENT_HANDLING):g(null);if(Se=g(null),_(y,"tagNameCheck")&&oi(y.tagNameCheck)&&(Se.tagNameCheck=y.tagNameCheck),_(y,"attributeNameCheck")&&oi(y.attributeNameCheck)&&(Se.attributeNameCheck=y.attributeNameCheck),_(y,"allowCustomizedBuiltInElements")&&typeof y.allowCustomizedBuiltInElements=="boolean"&&(Se.allowCustomizedBuiltInElements=y.allowCustomizedBuiltInElements),f(Se),kt&&(Ur=!1),qn&&(Wt=!0),qt&&(Ae=B({},Ee),je=g(null),qt.html===!0&&(B(Ae,ue),B(je,nt)),qt.svg===!0&&(B(Ae,oe),B(je,Le),B(je,ke)),qt.svgFilters===!0&&(B(Ae,we),B(je,Le),B(je,ke)),qt.mathMl===!0&&(B(Ae,ye),B(je,Z),B(je,ke))),Et.tagCheck=null,Et.attributeCheck=null,_(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Et.tagCheck=h.ADD_TAGS:N(h.ADD_TAGS)&&(Ae===Wo&&(Ae=ie(Ae)),B(Ae,h.ADD_TAGS,Ne))),_(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Et.attributeCheck=h.ADD_ATTR:N(h.ADD_ATTR)&&(je===qo&&(je=ie(je)),B(je,h.ADD_ATTR,Ne))),_(h,"ADD_URI_SAFE_ATTR")&&N(h.ADD_URI_SAFE_ATTR)&&B(Zr,h.ADD_URI_SAFE_ATTR,Ne),_(h,"FORBID_CONTENTS")&&N(h.FORBID_CONTENTS)&&(ct===Yr&&(ct=ie(ct)),B(ct,h.FORBID_CONTENTS,Ne)),_(h,"ADD_FORBID_CONTENTS")&&N(h.ADD_FORBID_CONTENTS)&&(ct===Yr&&(ct=ie(ct)),B(ct,h.ADD_FORBID_CONTENTS,Ne)),Vr&&(Ae["#text"]=!0),$t&&B(Ae,["html","head","body"]),Ae.table&&(B(Ae,["tbody"]),delete dn.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=Ue;Ue=h.TRUSTED_TYPES_POLICY;try{Mt=Gt("")}catch(q){throw Ue=$,q}}else h.TRUSTED_TYPES_POLICY===null?(Ue=void 0,Mt=""):(Ue===void 0&&(Ue=yc()),Ue&&typeof Mt=="string"&&(Mt=Gt("")));p&&p(h),Kt=h},ii=B({},[...oe,...we,...be]),ai=B({},[...ye,...qe]),$c=function(h,y,$){return y.namespaceURI===ut?h==="svg":y.namespaceURI===Kn?h==="svg"&&($==="annotation-xml"||Jr[$]):!!ii[h]},Lc=function(h,y,$){return y.namespaceURI===ut?h==="math":y.namespaceURI===Yn?h==="math"&&es[$]:!!ai[h]},Pc=function(h,y,$){return y.namespaceURI===Yn&&!es[$]||y.namespaceURI===Kn&&!Jr[$]?!1:!ai[h]&&(Ic[h]||!ii[h])},Dc=function(h){let y=cn(h);(!y||!y.tagName)&&(y={namespaceURI:Vt,tagName:"template"});const $=D(h.tagName),q=D(y.tagName);return Qr[h.namespaceURI]?h.namespaceURI===Yn?$c($,y,q):h.namespaceURI===Kn?Lc($,y,q):h.namespaceURI===ut?Pc($,y,q):!!(pn==="application/xhtml+xml"&&Qr[h.namespaceURI]):!1},At=function(h){S(O.removed,{element:h});try{cn(h).removeChild(h)}catch{if(Do(h),!cn(h))throw le("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},li=function(h){const y=ln(h);if(y){const q=[];A(y,ae=>{S(q,ae)}),A(q,ae=>{try{Do(ae)}catch{}})}const $=Br(h);if($)for(let q=$.length-1;q>=0;--q){const ae=$[q],fe=ae&&ae.name;if(typeof fe=="string")try{h.removeAttribute(fe)}catch{}}},Lt=function(h,y){try{S(O.removed,{attribute:y.getAttributeNode(h),from:y})}catch{S(O.removed,{attribute:null,from:y})}if(y.removeAttribute(h),h==="is")if(Wt||qn)try{At(y)}catch{}else try{y.setAttribute(h,"")}catch{}},Bc=function(h){const y=Br(h);if(y)for(let $=y.length-1;$>=0;--$){const q=y[$],ae=q&&q.name;if(!(typeof ae!="string"||je[Ne(ae)]))try{h.removeAttribute(ae)}catch{}}},Fc=function(h){const y=[h];for(;y.length>0;){const $=y.pop();(Ke?Ke($):$.nodeType)===lt.element&&Bc($);const ae=ln($);if(ae)for(let fe=ae.length-1;fe>=0;--fe)y.push(ae[fe])}},ci=function(h){let y=null,$=null;if(qr)h="<remove></remove>"+h;else{const fe=k(h,/^[\r\n\t ]+/);$=fe&&fe[0]}pn==="application/xhtml+xml"&&Vt===ut&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const q=Ue?Gt(h):h;if(Vt===ut)try{y=new Dr().parseFromString(q,pn)}catch{}if(!y||!y.documentElement){y=zr.createDocument(Vt,"template",null);try{y.documentElement.innerHTML=Xr?Mt:q}catch{}}const ae=y.body||y.documentElement;return h&&$&&ae.insertBefore(V.createTextNode($),ae.childNodes[0]||null),Vt===ut?vc.call(y,$t?"html":"body")[0]:$t?y.documentElement:ae},ui=function(h){return Uo.call(h.ownerDocument||h,h,Ve.SHOW_ELEMENT|Ve.SHOW_COMMENT|Ve.SHOW_TEXT|Ve.SHOW_PROCESSING_INSTRUCTION|Ve.SHOW_CDATA_SECTION,null)},Zn=function(h){return h=w(h,kc," "),h=w(h,Ac," "),h=w(h,jc," "),h},ns=function(h){var y;h.normalize();const $=Uo.call(h.ownerDocument||h,h,Ve.SHOW_TEXT|Ve.SHOW_COMMENT|Ve.SHOW_CDATA_SECTION|Ve.SHOW_PROCESSING_INSTRUCTION,null);let q=$.nextNode();for(;q;)q.data=Zn(q.data),q=$.nextNode();const ae=(y=h.querySelectorAll)===null||y===void 0?void 0:y.call(h,"template");ae&&A(ae,fe=>{Yt(fe.content)&&ns(fe.content)})},Xn=function(h){const y=vt?vt(h):null;return typeof y!="string"||Ne(y)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==Br(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==Ke(h)||h.childNodes!==ln(h)},Yt=function(h){if(!Ke||typeof h!="object"||h===null)return!1;try{return Ke(h)===lt.documentFragment}catch{return!1}},hn=function(h){if(!Ke||typeof h!="object"||h===null)return!1;try{return typeof Ke(h)=="number"}catch{return!1}};function ht(L,h,y){L.length!==0&&A(L,$=>{$.call(O,h,y,Kt)})}const zc=function(h,y){return!!(fn&&h.hasChildNodes()&&!hn(h.firstElementChild)&&K(_e,h.textContent)&&K(_e,h.innerHTML)||fn&&h.namespaceURI===ut&&y==="style"&&hn(h.firstElementChild)||h.nodeType===lt.processingInstruction||fn&&h.nodeType===lt.comment&&K(rt,h.data))},Uc=function(h,y){if(!dn[y]&&pi(y)&&(Se.tagNameCheck instanceof RegExp&&K(Se.tagNameCheck,y)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(y)))return!1;if(Vr&&!ct[y]){const $=cn(h),q=ln(h);if(q&&$){const ae=q.length;for(let fe=ae-1;fe>=0;--fe){const Me=Kr?q[fe]:gc(q[fe],!0);$.insertBefore(Me,xc(h))}}}return At(h),!0},di=function(h){if(ht(Ce.beforeSanitizeElements,h,null),Xn(h))return At(h),!0;const y=Ne(vt?vt(h):h.nodeName);if(ht(Ce.uponSanitizeElement,h,{tagName:y,allowedTags:Ae}),zc(h,y))return At(h),!0;if(dn[y]||!(Et.tagCheck instanceof Function&&Et.tagCheck(y))&&!Ae[y])return Uc(h,y);if((Ke?Ke(h):h.nodeType)===lt.element&&!Dc(h)||(y==="noscript"||y==="noembed"||y==="noframes")&&K(Lr,h.innerHTML))return At(h),!0;if(kt&&h.nodeType===lt.text){const q=Zn(h.textContent);h.textContent!==q&&(S(O.removed,{element:h.cloneNode()}),h.textContent=q)}return ht(Ce.afterSanitizeElements,h,null),!1},fi=function(h,y,$){if(Vo[y]||Xo&&(y==="id"||y==="name")&&($ in V||$ in Mc))return!1;const q=je[y]||Et.attributeCheck instanceof Function&&Et.attributeCheck(y,h);if(!(Ur&&K(Sc,y))){if(!(Ko&&K(Nc,y))){if(q){if(!Zr[y]){if(!K(Go,w($,Ho,""))){if(!((y==="src"||y==="xlink:href"||y==="href")&&h!=="script"&&M($,"data:")===0&&ei[h])){if(!(Yo&&!K(Tc,w($,Ho,"")))){if($)return!1}}}}}else if(!(pi(h)&&(Se.tagNameCheck instanceof RegExp&&K(Se.tagNameCheck,h)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(h))&&(Se.attributeNameCheck instanceof RegExp&&K(Se.attributeNameCheck,y)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(y,h))||y==="is"&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&K(Se.tagNameCheck,$)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck($))))return!1}}return!0},Hc=B({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pi=function(h){return!Hc[D(h)]&&K(_c,h)},Gc=function(h,y,$,q){if(Ue&&typeof Gn=="object"&&typeof Gn.getAttributeType=="function"&&!$)switch(Gn.getAttributeType(h,y)){case"TrustedHTML":return Gt(q);case"TrustedScriptURL":return bc(q)}return q},Wc=function(h,y,$,q){try{$?h.setAttributeNS($,y,q):h.setAttribute(y,q),Xn(h)?At(h):F(O.removed)}catch{Lt(y,h)}},hi=function(h){ht(Ce.beforeSanitizeAttributes,h,null);const y=h.attributes;if(!y||Xn(h))return;const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je,forceKeepAttr:void 0};let q=y.length;const ae=Ne(h.nodeName);for(;q--;){const fe=y[q],Me=fe.name,Re=fe.namespaceURI,tt=fe.value,st=Ne(Me),ss=tt;let Be=Me==="value"?ss:j(ss);if($.attrName=st,$.attrValue=Be,$.keepAttr=!0,$.forceKeepAttr=void 0,ht(Ce.uponSanitizeAttribute,h,$),Be=$.attrValue,Qo&&(st==="id"||st==="name")&&M(Be,Jo)!==0&&(Lt(Me,h),Be=Jo+Be),fn&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Be)){Lt(Me,h);continue}if(st==="attributename"&&k(Be,"href")){Lt(Me,h);continue}if(!$.forceKeepAttr){if(!$.keepAttr){Lt(Me,h);continue}if(!Zo&&K(Pr,Be)){Lt(Me,h);continue}if(kt&&(Be=Zn(Be)),!fi(ae,st,Be)){Lt(Me,h);continue}Be=Gc(ae,st,Re,Be),Be!==ss&&Wc(h,Me,Re,Be)}}ht(Ce.afterSanitizeAttributes,h,null)},Qn=function(h){let y=null;const $=ui(h);for(ht(Ce.beforeSanitizeShadowDOM,h,null);y=$.nextNode();)if(ht(Ce.uponSanitizeShadowNode,y,null),di(y),hi(y),Yt(y.content)&&Qn(y.content),(Ke?Ke(y):y.nodeType)===lt.element){const ae=Bo(y);Yt(ae)&&(rs(ae),Qn(ae))}ht(Ce.afterSanitizeShadowDOM,h,null)},rs=function(h){const y=[{node:h,shadow:null}];for(;y.length>0;){const $=y.pop();if($.shadow){Qn($.shadow);continue}const q=$.node,fe=(Ke?Ke(q):q.nodeType)===lt.element,Me=ln(q);if(Me)for(let Re=Me.length-1;Re>=0;--Re)y.push({node:Me[Re],shadow:null});if(fe){const Re=vt?vt(q):null;if(typeof Re=="string"&&Ne(Re)==="template"){const tt=q.content;Yt(tt)&&y.push({node:tt,shadow:null})}}if(fe){const Re=Bo(q);Yt(Re)&&y.push({node:null,shadow:Re},{node:Re,shadow:null})}}};return O.sanitize=function(L){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=null,$=null,q=null,ae=null;if(Xr=!L,Xr&&(L="<!-->"),typeof L!="string"&&!hn(L)&&(L=Oe(L),typeof L!="string"))throw le("dirty is not a string, aborting");if(!O.isSupported)return L;Hr?(Ae=Gr,je=Wr):ts(h),(Ce.uponSanitizeElement.length>0||Ce.uponSanitizeAttribute.length>0)&&(Ae=ie(Ae)),Ce.uponSanitizeAttribute.length>0&&(je=ie(je)),O.removed=[];const fe=Kr&&typeof L!="string"&&hn(L);if(fe){const tt=vt?vt(L):L.nodeName;if(typeof tt=="string"){const st=Ne(tt);if(!Ae[st]||dn[st])throw le("root node is forbidden and cannot be sanitized in-place")}if(Xn(L))throw le("root node is clobbered and cannot be sanitized in-place");try{rs(L)}catch(st){throw li(L),st}}else if(hn(L))y=ci("<!---->"),$=y.ownerDocument.importNode(L,!0),$.nodeType===lt.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?y=$:y.appendChild($),rs($);else{if(!Wt&&!kt&&!$t&&L.indexOf("<")===-1)return Ue&&Vn?Gt(L):L;if(y=ci(L),!y)return Wt?null:Vn?Mt:""}y&&qr&&At(y.firstChild);const Me=ui(fe?L:y);try{for(;q=Me.nextNode();)di(q),hi(q),Yt(q.content)&&Qn(q.content)}catch(tt){throw fe&&li(L),tt}if(fe)return A(O.removed,tt=>{tt.element&&Fc(tt.element)}),kt&&ns(L),L;if(Wt){if(kt&&ns(y),qn)for(ae=wc.call(y.ownerDocument);y.firstChild;)ae.appendChild(y.firstChild);else ae=y;return(je.shadowroot||je.shadowrootmode)&&(ae=Ec.call(ee,ae,!0)),ae}let Re=$t?y.outerHTML:y.innerHTML;return $t&&Ae["!doctype"]&&y.ownerDocument&&y.ownerDocument.doctype&&y.ownerDocument.doctype.name&&K(X,y.ownerDocument.doctype.name)&&(Re="<!DOCTYPE "+y.ownerDocument.doctype.name+`>
|
|
65
|
+
`+Re),kt&&(Re=Zn(Re)),Ue&&Vn?Gt(Re):Re},O.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ts(L),Hr=!0,Gr=Ae,Wr=je},O.clearConfig=function(){Kt=null,Hr=!1,Gr=null,Wr=null,Ue=Fr,Mt=""},O.isValidAttribute=function(L,h,y){Kt||ts({});const $=Ne(L),q=Ne(h);return fi($,q,y)},O.addHook=function(L,h){typeof h=="function"&&_(Ce,L)&&S(Ce[L],h)},O.removeHook=function(L,h){if(_(Ce,L)){if(h!==void 0){const y=T(Ce[L],h);return y===-1?void 0:R(Ce[L],y,1)[0]}return F(Ce[L])}},O.removeHooks=function(L){_(Ce,L)&&(Ce[L]=[])},O.removeAllHooks=function(){Ce=Lo()},O}var mc=Po();return us=mc,us}var af=self.DOMPurify||(self.DOMPurify=Pi().default||Pi());const qa=fo(af);function po(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ut=po();function Va(e){Ut=e}var wn={exec:()=>null};function me(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")},lf=/^(?:[ \t]*(?:\n|$))+/,cf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,uf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ho=/(?:[*+-]|\d{1,9}[.)])/,Ka=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ya=me(Ka).replace(/bull/g,ho).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(),ff=me(Ka).replace(/bull/g,ho).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(),mo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pf=/^[^\n]+/,go=/(?!\s*\])(?:\\.|[^\[\]\\])+/,hf=me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",go).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mf=me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ho).getRegex(),Ir="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",xo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gf=me("^ {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",xo).replace("tag",Ir).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Za=me(mo).replace("hr",Mn).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",Ir).getRegex(),xf=me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Za).getRegex(),bo={blockquote:xf,code:cf,def:hf,fences:uf,heading:df,hr:Mn,html:gf,lheading:Ya,list:mf,newline:lf,paragraph:Za,table:wn,text:pf},Di=me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mn).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",Ir).getRegex(),bf={...bo,lheading:ff,table:Di,paragraph:me(mo).replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Di).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",Ir).getRegex()},yf={...bo,html:me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xo).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:wn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:me(mo).replace("hr",Mn).replace("heading",` *#{1,6} *[^
|
|
66
|
+
]`).replace("lheading",Ya).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xa=/^( {2,}|\\)\n(?!\s*$)/,Ef=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Rr=/[\p{P}\p{S}]/u,yo=/[\s\p{P}\p{S}]/u,Qa=/[^\s\p{P}\p{S}]/u,kf=me(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yo).getRegex(),Ja=/(?!~)[\p{P}\p{S}]/u,Af=/(?!~)[\s\p{P}\p{S}]/u,jf=/(?:[^\s\p{P}\p{S}]|~)/u,Sf=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,el=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Nf=me(el,"u").replace(/punct/g,Rr).getRegex(),Tf=me(el,"u").replace(/punct/g,Ja).getRegex(),tl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_f=me(tl,"gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,yo).replace(/punct/g,Rr).getRegex(),Cf=me(tl,"gu").replace(/notPunctSpace/g,jf).replace(/punctSpace/g,Af).replace(/punct/g,Ja).getRegex(),If=me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,yo).replace(/punct/g,Rr).getRegex(),Rf=me(/\\(punct)/,"gu").replace(/punct/g,Rr).getRegex(),Of=me(/^<(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(),Mf=me(xo).replace("(?:-->|$)","-->").getRegex(),$f=me("^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",Mf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Lf=me(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",wr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nl=me(/^!?\[(label)\]\[(ref)\]/).replace("label",wr).replace("ref",go).getRegex(),rl=me(/^!?\[(ref)\](?:\[\])?/).replace("ref",go).getRegex(),Pf=me("reflink|nolink(?!\\()","g").replace("reflink",nl).replace("nolink",rl).getRegex(),wo={_backpedal:wn,anyPunctuation:Rf,autolink:Of,blockSkip:Sf,br:Xa,code:vf,del:wn,emStrongLDelim:Nf,emStrongRDelimAst:_f,emStrongRDelimUnd:If,escape:wf,link:Lf,nolink:rl,punctuation:kf,reflink:nl,reflinkSearch:Pf,tag:$f,text:Ef,url:wn},Df={...wo,link:me(/^!?\[(label)\]\((.*?)\)/).replace("label",wr).getRegex(),reflink:me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wr).getRegex()},Ls={...wo,emStrongRDelimAst:Cf,emStrongLDelim:Tf,url:me(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Bf={...Ls,br:me(Xa).replace("{2,}","*").getRegex(),text:me(Ls.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tr={normal:bo,gfm:bf,pedantic:yf},gn={normal:wo,gfm:Ls,breaks:Bf,pedantic:Df},Ff={"&":"&","<":"<",">":">",'"':""","'":"'"},Bi=e=>Ff[e];function dt(e,t){if(t){if(ze.escapeTest.test(e))return e.replace(ze.escapeReplace,Bi)}else if(ze.escapeTestNoEncode.test(e))return e.replace(ze.escapeReplaceNoEncode,Bi);return e}function Fi(e){try{e=encodeURI(e).replace(ze.percentDecode,"%")}catch{return null}return e}function zi(e,t){var i;const n=e.replace(ze.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),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 xn(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 zf(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 Ui(e,t,n,r,s){const i=t.href,a=t.title||null,l=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function Uf(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
67
|
+
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
68
|
+
`)}var vr=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:xn(n,`
|
|
69
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Uf(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=xn(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:xn(t[0],`
|
|
70
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=xn(t[0],`
|
|
71
|
+
`).split(`
|
|
72
|
+
`),r="",s="";const i=[];for(;n.length>0;){let a=!1;const l=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);const u=l.join(`
|
|
73
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
74
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
75
|
+
${u}`:u,s=s?`${s}
|
|
76
|
+
${d}`:d;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=p,n.length===0)break;const f=i.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){const g=f,m=g.raw+`
|
|
77
|
+
`+n.join(`
|
|
78
|
+
`),x=this.blockquote(m);i[i.length-1]=x,r=r.substring(0,r.length-g.raw.length)+x.raw,s=s.substring(0,s.length-g.text.length)+x.text;break}else if((f==null?void 0:f.type)==="list"){const g=f,m=g.raw+`
|
|
79
|
+
`+n.join(`
|
|
80
|
+
`),x=this.list(m);i[i.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,s=s.substring(0,s.length-g.raw.length)+x.raw,n=m.substring(i.at(-1).raw.length).split(`
|
|
81
|
+
`);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 c=!1,u="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let p=t[2].split(`
|
|
82
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),f=e.split(`
|
|
83
|
+
`,1)[0],g=!p.trim(),m=0;if(this.options.pedantic?(m=2,d=p.trimStart()):g?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=p.slice(m),m+=t[1].length),g&&this.rules.other.blankLine.test(f)&&(u+=f+`
|
|
84
|
+
`,e=e.substring(f.length+1),c=!0),!c){const A=this.rules.other.nextBulletRegex(m),T=this.rules.other.hrRegex(m),F=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),R=this.rules.other.htmlBeginRegex(m);for(;e;){const N=e.split(`
|
|
85
|
+
`,1)[0];let D;if(f=N,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),D=f):D=f.replace(this.rules.other.tabCharGlobal," "),F.test(f)||S.test(f)||R.test(f)||A.test(f)||T.test(f))break;if(D.search(this.rules.other.nonSpaceChar)>=m||!f.trim())d+=`
|
|
86
|
+
`+D.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||F.test(p)||S.test(p)||T.test(p))break;d+=`
|
|
87
|
+
`+f}!g&&!f.trim()&&(g=!0),u+=N+`
|
|
88
|
+
`,e=e.substring(N.length+1),p=D.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let x=null,v;this.options.gfm&&(x=this.rules.other.listIsTask.exec(d),x&&(v=x[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!x,checked:v,loose:!1,text:d,tokens:[]}),s.raw+=u}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const u=s.items[c].tokens.filter(p=>p.type==="space"),d=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const 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=zi(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(`
|
|
89
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(const l of s)i.rows.push(zi(l,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
90
|
+
`?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=xn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=zf(t[2],"()");if(i===-2)return;if(i>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let 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)),Ui(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 Ui(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,l,c=i,u=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(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const p=[...r[0]][0].length,f=e.slice(0,i+r.index+p+l);if(Math.min(i,l)%2){const m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}const g=f.slice(2,-2);return{type:"strong",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}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}}}},bt=class Ps{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 vr,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:tr.normal,inline:gn.normal};this.options.pedantic?(n.block=tr.pedantic,n.inline=gn.pedantic):this.options.gfm&&(n.block=tr.gfm,this.options.breaks?n.inline=gn.breaks:n.inline=gn.gfm),this.tokenizer.rules=n}static get rules(){return{block:tr,inline:gn}}static lex(t,n){return new Ps(n).lex(t)}static lexInline(t,n){return new Ps(n).inlineTokens(t)}lex(t){t=t.replace(ze.carriageReturn,`
|
|
91
|
+
`),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 l;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(u=>(l=u.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const u=n.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
92
|
+
`:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
93
|
+
`+l.raw,u.text+=`
|
|
94
|
+
`+l.text,this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
95
|
+
`+l.raw,u.text+=`
|
|
96
|
+
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0;const d=t.slice(1);let p;this.options.extensions.startBlock.forEach(f=>{p=f.call({lexer:this},d),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
97
|
+
`+l.raw,u.text+=`
|
|
98
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
99
|
+
`+l.raw,u.text+=`
|
|
100
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,u;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((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(f=>(d=f.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 f=n.at(-1);d.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.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 p=t;if((u=this.options.extensions)!=null&&u.startInline){let f=1/0;const g=t.slice(1);let m;this.options.extensions.startInline.forEach(x=>{m=x.call({lexer:this},g),typeof m=="number"&&m>=0&&(f=Math.min(f,m))}),f<1/0&&f>=0&&(p=t.substring(0,f+1))}if(d=this.tokenizer.inlineText(p)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const f=n.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.text+=d.text):n.push(d);continue}if(t){const f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Er=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,"")+`
|
|
101
|
+
`;return r?'<pre><code class="language-'+dt(r)+'">'+(n?s:dt(s,!0))+`</code></pre>
|
|
102
|
+
`:"<pre><code>"+(n?s:dt(s,!0))+`</code></pre>
|
|
103
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
104
|
+
${this.parser.parse(e)}</blockquote>
|
|
105
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
106
|
+
`}hr(e){return`<hr>
|
|
107
|
+
`}list(e){const t=e.ordered,n=e.start;let r="";for(let a=0;a<e.items.length;a++){const l=e.items[a];r+=this.listitem(l)}const s=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
|
|
108
|
+
`+r+"</"+s+`>
|
|
109
|
+
`}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>
|
|
110
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
111
|
+
`}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>
|
|
112
|
+
<thead>
|
|
113
|
+
`+t+`</thead>
|
|
114
|
+
`+r+`</table>
|
|
115
|
+
`}tablerow({text:e}){return`<tr>
|
|
116
|
+
${e}</tr>
|
|
117
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
118
|
+
`}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=Fi(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=Fi(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)}},vo=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""}},yt=class Ds{constructor(t){ge(this,"options");ge(this,"renderer");ge(this,"textRenderer");this.options=t||Ut,this.options.renderer=this.options.renderer||new Er,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vo}static parse(t,n){return new Ds(n).parse(t)}static parseInline(t,n){return new Ds(n).parseInline(t)}parse(t,n=!0){var s,i;let r="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=l,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=d||"";continue}}const c=l;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],d+=`
|
|
119
|
+
`+this.renderer.text(u);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 u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(t,n=this.renderer){var s,i;let r="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}const c=l;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},vs,fr=(vs=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?bt.lex:bt.lexInline}provideParser(){return this.block?yt.parse:yt.parseInline}},ge(vs,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),vs),sl=class{constructor(...e){ge(this,"defaults",po());ge(this,"options",this.setOptions);ge(this,"parse",this.parseMarkdown(!0));ge(this,"parseInline",this.parseMarkdown(!1));ge(this,"Parser",yt);ge(this,"Renderer",Er);ge(this,"TextRenderer",vo);ge(this,"Lexer",bt);ge(this,"Tokenizer",vr);ge(this,"Hooks",fr);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 l of a.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)n=n.concat(this.walkTokens(c.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(l=>{const c=a[l].flat(1/0);n=n.concat(this.walkTokens(c,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 l=s.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Er(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,l=n.renderer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new vr(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,l=n.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new fr;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,l=n.hooks[a],c=s[a];fr.passThroughHooks.has(i)?s[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(s,u)).then(p=>c.call(s,p));const d=l.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return bt.lex(e,t??this.defaults)}parser(e,t){return yt.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 l=i.hooks?i.hooks.provideLexer():e?bt.lex:bt.lexInline,c=i.hooks?i.hooks.provideParser():e?yt.parse:yt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>c(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let u=l(n,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let d=c(u,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(u){return a(u)}}}onError(e,t){return n=>{if(n.message+=`
|
|
120
|
+
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}}},Bt=new sl;function xe(e,t){return Bt.parse(e,t)}xe.options=xe.setOptions=function(e){return Bt.setOptions(e),xe.defaults=Bt.defaults,Va(xe.defaults),xe};xe.getDefaults=po;xe.defaults=Ut;xe.use=function(...e){return Bt.use(...e),xe.defaults=Bt.defaults,Va(xe.defaults),xe};xe.walkTokens=function(e,t){return Bt.walkTokens(e,t)};xe.parseInline=Bt.parseInline;xe.Parser=yt;xe.parser=yt.parse;xe.Renderer=Er;xe.TextRenderer=vo;xe.Lexer=bt;xe.lexer=bt.lex;xe.Tokenizer=vr;xe.Hooks=fr;xe.parse=xe;xe.options;xe.setOptions;xe.use;xe.walkTokens;xe.parseInline;yt.parse;bt.lex;function Hf(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=Hi(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Gi(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.");Gi(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=Hi(n),i=s?e.langPrefix+qi(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${r?t:qi(t,!0)}
|
|
121
|
+
</code></pre>`}}}}function Hi(e){return(e||"").match(/\S*/)[0]}function Gi(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const ol=/[&<>"']/,Gf=new RegExp(ol.source,"g"),il=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wf=new RegExp(il.source,"g"),qf={"&":"&","<":"<",">":">",'"':""","'":"'"},Wi=e=>qf[e];function qi(e,t){if(t){if(ol.test(e))return e.replace(Gf,Wi)}else if(il.test(e))return e.replace(Wf,Wi);return e}function al(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)&&al(n)}),e}class Vi{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ll(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function St(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 Vf="</span>",Ki=e=>!!e.scope,Kf=(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 Yf{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=ll(t)}openNode(t){if(!Ki(t))return;const n=Kf(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Ki(t)&&(this.buffer+=Vf)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Yi=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Eo{constructor(){this.rootNode=Yi(),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=Yi({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=>{Eo._collapse(n)}))}}class Zf extends Eo{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 Yf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sn(e){return e?typeof e=="string"?e:e.source:null}function cl(e){return Ht("(?=",e,")")}function Xf(e){return Ht("(?:",e,")*")}function Qf(e){return Ht("(?:",e,")?")}function Ht(...e){return e.map(n=>Sn(n)).join("")}function Jf(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ko(...e){return"("+(Jf(e).capture?"":"?:")+e.map(r=>Sn(r)).join("|")+")"}function ul(e){return new RegExp(e.toString()+"|").exec("").length-1}function ep(e,t){const n=e&&e.exec(t);return n&&n.index===0}const tp=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ao(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Sn(r),a="";for(;i.length>0;){const l=tp.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const np=/\b\B/,dl="[a-zA-Z]\\w*",jo="[a-zA-Z_]\\w*",fl="\\b\\d+(\\.\\d+)?",pl="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",hl="\\b(0b[01]+)",rp="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",sp=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ht(t,/.*\b/,e.binary,/\b.*/)),St({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Nn={begin:"\\\\[\\s\\S]",relevance:0},op={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Nn]},ip={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Nn]},ap={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/},Or=function(e,t,n={}){const r=St({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=ko("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:Ht(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},lp=Or("//","$"),cp=Or("/\\*","\\*/"),up=Or("#","$"),dp={scope:"number",begin:fl,relevance:0},fp={scope:"number",begin:pl,relevance:0},pp={scope:"number",begin:hl,relevance:0},hp={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Nn,{begin:/\[/,end:/\]/,relevance:0,contains:[Nn]}]},mp={scope:"title",begin:dl,relevance:0},gp={scope:"title",begin:jo,relevance:0},xp={begin:"\\.\\s*"+jo,relevance:0},bp=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 nr=Object.freeze({__proto__:null,APOS_STRING_MODE:op,BACKSLASH_ESCAPE:Nn,BINARY_NUMBER_MODE:pp,BINARY_NUMBER_RE:hl,COMMENT:Or,C_BLOCK_COMMENT_MODE:cp,C_LINE_COMMENT_MODE:lp,C_NUMBER_MODE:fp,C_NUMBER_RE:pl,END_SAME_AS_BEGIN:bp,HASH_COMMENT_MODE:up,IDENT_RE:dl,MATCH_NOTHING_RE:np,METHOD_GUARD:xp,NUMBER_MODE:dp,NUMBER_RE:fl,PHRASAL_WORDS_MODE:ap,QUOTE_STRING_MODE:ip,REGEXP_MODE:hp,RE_STARTERS_RE:rp,SHEBANG:sp,TITLE_MODE:mp,UNDERSCORE_IDENT_RE:jo,UNDERSCORE_TITLE_MODE:gp});function yp(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function wp(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function vp(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=yp,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Ep(e,t){Array.isArray(e.illegal)&&(e.illegal=ko(...e.illegal))}function kp(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 Ap(e,t){e.relevance===void 0&&(e.relevance=1)}const jp=(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=Ht(n.beforeMatch,cl(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Sp=["of","and","for","in","not","or","if","then","parent","list","value"],Np="keyword";function ml(e,t,n=Np){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,ml(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,Tp(c[0],c[1])]})}}function Tp(e,t){return t?Number(t):_p(e)?0:1}function _p(e){return Sp.includes(e.toLowerCase())}const Zi={},Dt=e=>{console.error(e)},Xi=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Zt=(e,t)=>{Zi[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Zi[`${e}/${t}`]=!0)},kr=new Error;function gl(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=ul(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Cp(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Dt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kr;if(typeof e.beginScope!="object"||e.beginScope===null)throw Dt("beginScope must be object"),kr;gl(e,e.begin,{key:"beginScope"}),e.begin=Ao(e.begin,{joinWith:""})}}function Ip(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Dt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kr;if(typeof e.endScope!="object"||e.endScope===null)throw Dt("endScope must be object"),kr;gl(e,e.end,{key:"endScope"}),e.end=Ao(e.end,{joinWith:""})}}function Rp(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Op(e){Rp(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Cp(e),Ip(e)}function Mp(e){function t(a,l){return new RegExp(Sn(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=ul(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(Ao(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((p,f)=>f>0&&p!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[wp,kp,Op,jp].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[vp,Ep,Ap].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=ml(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Sn(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return $p(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),c.matcher=s(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=St(e.classNameAliases||{}),i(e)}function xl(e){return e?e.endsWithParent||xl(e.starts):!1}function $p(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return St(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:xl(e)?St(e,{starts:e.starts?St(e.starts):null}):Object.isFrozen(e)?St(e):e}var Lp="11.11.1";class Pp extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const ds=ll,Qi=St,Ji=Symbol("nomatch"),Dp=7,bl=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Zf};function c(E){return l.noHighlightRe.test(E)}function u(E){let _=E.className+" ";_+=E.parentNode?E.parentNode.className:"";const G=l.languageDetectRe.exec(_);if(G){const K=U(G[1]);return K||(Xi(i.replace("{}",G[1])),Xi("Falling back to no-highlight mode for this block.",E)),K?G[1]:"no-highlight"}return _.split(/\s+/).find(K=>c(K)||U(K))}function d(E,_,G){let K="",le="";typeof _=="object"?(K=E,G=_.ignoreIllegals,le=_.language):(Zt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Zt("10.7.0",`Please use highlight(code, options) instead.
|
|
122
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),le=E,K=_),G===void 0&&(G=!0);const ne={code:K,language:le};re("before:highlight",ne);const Y=ne.result?ne.result:p(ne.language,ne.code,G);return Y.code=ne.code,re("after:highlight",Y),Y}function p(E,_,G,K){const le=Object.create(null);function ne(P,H){return P.keywords[H]}function Y(){if(!Z.keywords){Te.addText(he);return}let P=0;Z.keywordPatternRe.lastIndex=0;let H=Z.keywordPatternRe.exec(he),X="";for(;H;){X+=he.substring(P,H.index);const ce=Ee.case_insensitive?H[0].toLowerCase():H[0],_e=ne(Z,ce);if(_e){const[rt,Lr]=_e;if(Te.addText(X),X="",le[ce]=(le[ce]||0)+1,le[ce]<=Dp&&(pt+=Lr),rt.startsWith("_"))X+=H[0];else{const Pr=Ee.classNameAliases[rt]||rt;ie(H[0],Pr)}}else X+=H[0];P=Z.keywordPatternRe.lastIndex,H=Z.keywordPatternRe.exec(he)}X+=he.substring(P),Te.addText(X)}function B(){if(he==="")return;let P=null;if(typeof Z.subLanguage=="string"){if(!t[Z.subLanguage]){Te.addText(he);return}P=p(Z.subLanguage,he,!0,ke[Z.subLanguage]),ke[Z.subLanguage]=P._top}else P=g(he,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(pt+=P.relevance),Te.__addSublanguage(P._emitter,P.language)}function pe(){Z.subLanguage!=null?B():Y(),he=""}function ie(P,H){P!==""&&(Te.startScope(H),Te.addText(P),Te.endScope())}function Oe(P,H){let X=1;const ce=H.length-1;for(;X<=ce;){if(!P._emit[X]){X++;continue}const _e=Ee.classNameAliases[P[X]]||P[X],rt=H[X];_e?ie(rt,_e):(he=rt,Y(),he=""),X++}}function C(P,H){return P.scope&&typeof P.scope=="string"&&Te.openNode(Ee.classNameAliases[P.scope]||P.scope),P.beginScope&&(P.beginScope._wrap?(ie(he,Ee.classNameAliases[P.beginScope._wrap]||P.beginScope._wrap),he=""):P.beginScope._multi&&(Oe(P.beginScope,H),he="")),Z=Object.create(P,{parent:{value:Z}}),Z}function J(P,H,X){let ce=ep(P.endRe,X);if(ce){if(P["on:end"]){const _e=new Vi(P);P["on:end"](H,_e),_e.isMatchIgnored&&(ce=!1)}if(ce){for(;P.endsParent&&P.parent;)P=P.parent;return P}}if(P.endsWithParent)return J(P.parent,H,X)}function ue(P){return Z.matcher.regexIndex===0?(he+=P[0],1):(et=!0,0)}function oe(P){const H=P[0],X=P.rule,ce=new Vi(X),_e=[X.__beforeBegin,X["on:begin"]];for(const rt of _e)if(rt&&(rt(P,ce),ce.isMatchIgnored))return ue(H);return X.skip?he+=H:(X.excludeBegin&&(he+=H),pe(),!X.returnBegin&&!X.excludeBegin&&(he=H)),C(X,P),X.returnBegin?0:H.length}function we(P){const H=P[0],X=_.substring(P.index),ce=J(Z,P,X);if(!ce)return Ji;const _e=Z;Z.endScope&&Z.endScope._wrap?(pe(),ie(H,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(pe(),Oe(Z.endScope,P)):_e.skip?he+=H:(_e.returnEnd||_e.excludeEnd||(he+=H),pe(),_e.excludeEnd&&(he=H));do Z.scope&&Te.closeNode(),!Z.skip&&!Z.subLanguage&&(pt+=Z.relevance),Z=Z.parent;while(Z!==ce.parent);return ce.starts&&C(ce.starts,P),_e.returnEnd?0:H.length}function be(){const P=[];for(let H=Z;H!==Ee;H=H.parent)H.scope&&P.unshift(H.scope);P.forEach(H=>Te.openNode(H))}let ye={};function qe(P,H){const X=H&&H[0];if(he+=P,X==null)return pe(),0;if(ye.type==="begin"&&H.type==="end"&&ye.index===H.index&&X===""){if(he+=_.slice(H.index,H.index+1),!s){const ce=new Error(`0 width match regex (${E})`);throw ce.languageName=E,ce.badRule=ye.rule,ce}return 1}if(ye=H,H.type==="begin")return oe(H);if(H.type==="illegal"&&!G){const ce=new Error('Illegal lexeme "'+X+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw ce.mode=Z,ce}else if(H.type==="end"){const ce=we(H);if(ce!==Ji)return ce}if(H.type==="illegal"&&X==="")return he+=`
|
|
123
|
+
`,1;if(Rt>1e5&&Rt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=X,X.length}const Ee=U(E);if(!Ee)throw Dt(i.replace("{}",E)),new Error('Unknown language: "'+E+'"');const nt=Mp(Ee);let Le="",Z=K||nt;const ke={},Te=new l.__emitter(l);be();let he="",pt=0,Je=0,Rt=0,et=!1;try{if(Ee.__emitTokens)Ee.__emitTokens(_,Te);else{for(Z.matcher.considerAll();;){Rt++,et?et=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Je;const P=Z.matcher.exec(_);if(!P)break;const H=_.substring(Je,P.index),X=qe(H,P);Je=P.index+X}qe(_.substring(Je))}return Te.finalize(),Le=Te.toHTML(),{language:E,value:Le,relevance:pt,illegal:!1,_emitter:Te,_top:Z}}catch(P){if(P.message&&P.message.includes("Illegal"))return{language:E,value:ds(_),illegal:!0,relevance:0,_illegalBy:{message:P.message,index:Je,context:_.slice(Je-100,Je+100),mode:P.mode,resultSoFar:Le},_emitter:Te};if(s)return{language:E,value:ds(_),illegal:!1,relevance:0,errorRaised:P,_emitter:Te,_top:Z};throw P}}function f(E){const _={value:ds(E),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return _._emitter.addText(E),_}function g(E,_){_=_||l.languages||Object.keys(t);const G=f(E),K=_.filter(U).filter(w).map(pe=>p(pe,E,!1));K.unshift(G);const le=K.sort((pe,ie)=>{if(pe.relevance!==ie.relevance)return ie.relevance-pe.relevance;if(pe.language&&ie.language){if(U(pe.language).supersetOf===ie.language)return 1;if(U(ie.language).supersetOf===pe.language)return-1}return 0}),[ne,Y]=le,B=ne;return B.secondBest=Y,B}function m(E,_,G){const K=_&&n[_]||G;E.classList.add("hljs"),E.classList.add(`language-${K}`)}function x(E){let _=null;const G=u(E);if(c(G))return;if(re("before:highlightElement",{el:E,language:G}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),l.throwUnescapedHTML))throw new Pp("One of your code blocks includes unescaped HTML.",E.innerHTML);_=E;const K=_.textContent,le=G?d(K,{language:G,ignoreIllegals:!0}):g(K);E.innerHTML=le.value,E.dataset.highlighted="yes",m(E,G,le.language),E.result={language:le.language,re:le.relevance,relevance:le.relevance},le.secondBest&&(E.secondBest={language:le.secondBest.language,relevance:le.secondBest.relevance}),re("after:highlightElement",{el:E,result:le,text:K})}function v(E){l=Qi(l,E)}const A=()=>{S(),Zt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){S(),Zt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let F=!1;function S(){function E(){S()}if(document.readyState==="loading"){F||window.addEventListener("DOMContentLoaded",E,!1),F=!0;return}document.querySelectorAll(l.cssSelector).forEach(x)}function R(E,_){let G=null;try{G=_(e)}catch(K){if(Dt("Language definition for '{}' could not be registered.".replace("{}",E)),s)Dt(K);else throw K;G=a}G.name||(G.name=E),t[E]=G,G.rawDefinition=_.bind(null,e),G.aliases&&k(G.aliases,{languageName:E})}function N(E){delete t[E];for(const _ of Object.keys(n))n[_]===E&&delete n[_]}function D(){return Object.keys(t)}function U(E){return E=(E||"").toLowerCase(),t[E]||t[n[E]]}function k(E,{languageName:_}){typeof E=="string"&&(E=[E]),E.forEach(G=>{n[G.toLowerCase()]=_})}function w(E){const _=U(E);return _&&!_.disableAutodetect}function M(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=_=>{E["before:highlightBlock"](Object.assign({block:_.el},_))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=_=>{E["after:highlightBlock"](Object.assign({block:_.el},_))})}function j(E){M(E),r.push(E)}function W(E){const _=r.indexOf(E);_!==-1&&r.splice(_,1)}function re(E,_){const G=E;r.forEach(function(K){K[G]&&K[G](_)})}function se(E){return Zt("10.7.0","highlightBlock will be removed entirely in v12.0"),Zt("10.7.0","Please use highlightElement now."),x(E)}Object.assign(e,{highlight:d,highlightAuto:g,highlightAll:S,highlightElement:x,highlightBlock:se,configure:v,initHighlighting:A,initHighlightingOnLoad:T,registerLanguage:R,unregisterLanguage:N,listLanguages:D,getLanguage:U,registerAliases:k,autoDetection:w,inherit:Qi,addPlugin:j,removePlugin:W}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Lp,e.regex={concat:Ht,lookahead:cl,either:ko,optional:Qf,anyNumberOfTimes:Xf};for(const E in nr)typeof nr[E]=="object"&&al(nr[E]);return Object.assign(e,nr),e},tn=bl({});tn.newInstance=()=>bl({});var Bp=tn;tn.HighlightJS=tn;tn.default=tn;const ft=fo(Bp);function Fp(e){const t={className:"attr",begin:/"(\\.|[^\\"\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"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function zp(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]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={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"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},v=[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}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,x,i,a],A=[...v];return A.pop(),A.push(l),g.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function Up(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],A={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],F=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["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"],R=["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:x,literal:v,built_in:[...T,...F,"set","shopt",...S,...R]},contains:[g,e.SHEBANG(),m,p,i,a,A,l,c,u,d,n]}}const ea="[A-Za-z$_][0-9A-Za-z$_]*",Hp=["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"],Gp=["true","false","null","undefined","NaN","Infinity"],yl=["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"],wl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qp=[].concat(vl,yl,wl);function Vp(e){const t=e.regex,n=(G,{after:K})=>{const le="</"+G[0].slice(1);return G.input.indexOf(le,K)!==-1},r=ea,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,K)=>{const le=G[0].length+G.index,ne=G.input[le];if(ne==="<"||ne===","){K.ignoreMatch();return}ne===">"&&(n(G,{after:le})||K.ignoreMatch());let Y;const B=G.input.substring(le);if(Y=B.match(/^\s*=/)){K.ignoreMatch();return}if((Y=B.match(/^\s+extends\s+/))&&Y.index===0){K.ignoreMatch();return}}},l={$pattern:ea,keyword:Hp,literal:Gp,built_in:qp,"variable.language":Wp},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},T={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]},F=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,m,x,v,{match:/\$\d+/},p];f.contains=F.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(F)});const S=[].concat(T,f.contains),R=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:R},D={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"}}]},U={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:{_:[...yl,...wl]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},w={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(G){return t.concat("(?!",G.join("|"),")")}const W={match:t.concat(/\b/,j([...vl,"super","import"].map(G=>`${G}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,m,x,v,T,{match:/\$\d+/},p,U,{scope:"attr",match:r+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,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:l,contains:R}]}]},{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"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},W,M,D,se,{match:/\$[(.]/}]}}function Kp(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","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",g=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${g}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,x,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,x,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{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:[x,A,p]}]}}ft.registerLanguage("json",Fp);ft.registerLanguage("yaml",zp);ft.registerLanguage("bash",Up);ft.registerLanguage("javascript",Vp);ft.registerLanguage("python",Kp);const El=new sl(Hf({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!ft.getLanguage(t))return e;try{return ft.highlight(e,{language:t}).value}catch{return e}}}));El.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function Yp(e){return El.parse(e)}const at=({children:e,className:t=""})=>e?typeof e!="string"?o.jsx(o.Fragment,{children:e}):o.jsx("div",{className:`prose max-w-none text-foreground-muted prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary-600 prose-code:text-foreground-secondary prose-code:before:content-none prose-code:after:content-none prose-blockquote:text-foreground-muted prose-blockquote:border-border ${t}`,dangerouslySetInnerHTML:{__html:qa.sanitize(Yp(e))}}):null;function Zp({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 Xp({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 Qp({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 Jp({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 bn({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:i=!1,className:a=""}){const l=s?c=>o.jsx("a",{href:s,target:"_blank",...c}):c=>o.jsx("div",{...c});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(l,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${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(l,{children:r}),i&&o.jsx(l,{children:r})]})]})}function So({name:e,href:t,title:n}){return o.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${t&&"hover:bg-cyan-500 hover:text-white"}`,href:t,target:"_blank",title:n,children:e})}function eh({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(bn,{IconClass:Qp,text:`${i.licenseName} ${gi}`,term:gi,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(bn,{IconClass:Cr,text:xi,href:i.externalDocsUrl,term:xi,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(bn,{IconClass:Zp,text:`${i.contactEmail}`,term:Jc,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(bn,{IconClass:Xp,text:`${i.contactName}`,term:Qc,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(bn,{IconClass:Jp,term:eu,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:i.tags&&o.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:i.tags.map((a,l)=>{const c=a,u=c.externalDocs;return o.jsx(So,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const th=[/^x-parser-/i,/^x-lib-/i];function nh(e){return th.some(t=>t.test(e))}const ta=new Map;function rh(e){let t=ta.get(e);return t||(t=b.lazy(Wa[e]),ta.set(e,t)),t}const sh=e=>e.startsWith("x-"),kl=(e,t)=>e?e[t]:void 0;function oh({source:e,pathPrefix:t}){const{showExtensions:n}=$e();if(!n||!e)return null;const r=Object.keys(e).filter(s=>sh(s)&&!nh(s)&&Object.prototype.hasOwnProperty.call(Wa,s));return r.length===0?null:o.jsx(o.Fragment,{children:r.map(s=>{const i=rh(s);return o.jsx(b.Suspense,{fallback:null,children:o.jsx(i,{value:kl(e,s),path:`${t}.${s}`})},s)})})}const ih=b.lazy(rf);function Al({title:e,description:t,license:n,contact:r,externalDocs:s,tags:i,extensionsSource:a}){const l=kl(a,"x-logo"),c=l!==void 0&&o.jsx(b.Suspense,{fallback:null,children:o.jsx(ih,{value:l,path:"info.x-logo"})}),u=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(at,{children:t})}),d=o.jsxs(o.Fragment,{children:[o.jsx(eh,{logo:c,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(oh,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{title:e,content:u,sideContent:d,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:c})})}const jl=e=>{const{title:t,description:n,license:r,externalDocs:s,contact:i,tags:a}=e;return o.jsx(Al,{title:t,description:n,license:r,externalDocs:s,contact:i,tags:a,extensionsSource:e})},ah=1500,lh=320,ch=48,uh="#011627";function dh(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 fh(e){try{return await navigator.clipboard.writeText(e),!0}catch{return dh(e)}}function No({code:e,className:t,language:n="json",collapsedMaxHeight:r=lh}){const[s,i]=b.useState("idle"),a=b.useRef(void 0),[l,c]=b.useState(!1),[u,d]=b.useState(!1),[p,f]=b.useState(0),g=b.useRef(null),m=b.useRef(null),x=b.useId();b.useEffect(()=>()=>clearTimeout(a.current),[]),b.useEffect(()=>{const D=m.current;if(!D)return;const U=()=>{f(D.scrollHeight),d(D.scrollHeight>r+ch)};U();const k=new ResizeObserver(U);return k.observe(D),()=>k.disconnect()},[e,n,r]);const v=()=>{fh(e).then(D=>{i(D?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),ah)})},T=ft.getLanguage(n)?ft.highlight(e,{language:n}).value:null,F=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",S=u&&!l,R=e.replace(/\n+$/,"").split(`
|
|
124
|
+
`).length,N=()=>{var D,U;l&&(((D=g.current)==null?void 0:D.getBoundingClientRect().top)??0)<0&&((U=g.current)==null||U.scrollIntoView({block:"nearest"})),c(k=>!k)};return o.jsxs("div",{ref:g,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:v,"aria-label":F,title:F,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(Qs,{className:"w-4 h-4 text-green-600"}):o.jsx(Xs,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:m,id:x,style:u?{maxHeight:l?p:r}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${u?"overflow-y-hidden":""}`,children:T!==null?o.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:qa.sanitize(T)}}):o.jsx("code",{className:"hljs",children:e})}),u&&o.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${S?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${uh})`}})]}),u&&o.jsxs("button",{type:"button",onClick:N,"aria-expanded":l,"aria-controls":x,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[l?"Show less":`Show all ${R} lines`,o.jsx(In,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]})]})}const ph=/^x-parser-/i;function Bs(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=>Bs(r,t));const n={};for(const[r,s]of Object.entries(e))ph.test(r)||(n[r]=Bs(s,t));return n}finally{t.delete(e)}}return e}const Sl=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Bs(e),null,2);return o.jsx(No,{code:t})},na=new Set,To=e=>e.replace(/^#\//,"").split("/").pop()??e,Fs=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},hh={objects:new Set,refs:new Set},gt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:Fs(e)};const r=e.$ref,s=To(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const i=mt(t(r));if(!i)return{schema:e,refLabel:s};const{schema:a}=jn(i);n.add(r);try{const l=gt(a,t,n);return{schema:l.schema,refLabel:l.circular?void 0:s,circular:l.circular}}finally{n.delete(r)}},Ft=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return te(n)?n:null},Nl=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>te(r));return n.length>0?n:null},mh=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||te(e.additionalItems)?e.additionalItems:null,gh=e=>e.contains===void 0?null:typeof e.contains=="boolean"||te(e.contains)?e.contains:null,Tl=e=>e.contains!==void 0,Ar=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
125
|
+
|
|
126
|
+
${t}`:t},xh=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),jt=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Ar(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(!te(a))continue;const l=s.properties[i];te(l)?s.properties[i]=jt(l,a):s.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((i,a)=>{const l=s.items[a];return te(i)&&te(l)?jt(l,i):te(i)?i:l}):s.items=t.items;else{const i=Ft(t),a=Ft(s);i&&a?s.items=jt(a,i):i&&(s.items=t.items)}if(t.patternProperties&&te(t.patternProperties)){const i={...te(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!te(l)){i[a]=l;continue}const c=i[a];te(c)?i[a]=jt(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(te(t.propertyNames)){const i=s.propertyNames;s.propertyNames=te(i)?jt(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(te(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=te(i)?jt(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))xh.has(i)||a===void 0||(s[i]=a);return s},ra=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>te(d)?[u,Fe(d,t,n,r)]:[u,d])));const i=Ft(s);i&&(s.items=Fe(i,t,n,r));const a=Pn(s);a!==null&&te(a)&&(s.propertyNames=Fe(a,t,n,r));const l=sn(s);l!==null&&te(l)&&(s.additionalProperties=Fe(l,t,n,r));const c=_o(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,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(!te(d))continue;const{schema:p,circular:f}=gt(d,t,n);if(f)continue;const g=Fe(p,t,n,r);if(g.if!==void 0){const m={if:g.if};g.then!==void 0&&(m.then=g.then),g.else!==void 0&&(m.else=g.else),i.push(m)}i.push(...Il(g)),a=jt(a,g,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 l={...e};delete l.allOf;const c=Object.keys(l).length>0?jt(a,l,t,n):a,u=ra(c,t,n,r);if(i.length===1){const d=i[0];u.if=d.if,d.then!==void 0&&(u.then=d.then),d.else!==void 0&&(u.else=d.else)}else i.length>1&&(u._allOfConditionals=i);return u}return ra(e,t,n,r)}finally{r.delete(e)}},$n=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>te(r));return n.length>0?n:null},Ln=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>te(r));return n.length>0?n:null},_l=e=>e.not===void 0?null:typeof e.not=="boolean"||te(e.not)?e.not:null,Ge=e=>_l(e)!==null,Cl=e=>{const{not:t,...n}=e;return n},bh=e=>{const{if:t,then:n,else:r,...s}=e;return s},Ye=e=>e.if!==void 0,fs=e=>e===void 0?null:typeof e=="boolean"||te(e)?e:null,Il=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>te(t)):[],Ze=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Pn=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||te(e.propertyNames)?e.propertyNames:null,sn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||te(e.additionalProperties)?e.additionalProperties:null,_o=e=>{const t=e.patternProperties;return te(t)?Object.entries(t).flatMap(([n,r])=>te(r)?[[n,r]]:[]):[]},yh=(e,t)=>`${e}.[pattern:${t}]`,Dn=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Mr=e=>{const t=Pn(e);if(t!==null&&te(t))return!0;const n=sn(e);return n!==null&&te(n)?!0:_o(e).length>0},Rl=e=>!!($n(e)||Ln(e)||Dn(e)||Mr(e)||e.type==="array"||e.items||e.type!==void 0),it=e=>!(Ge(e)||Ye(e)||Ze(e)||$n(e)||Ln(e)||Dn(e)||Mr(e)||e.items||Tl(e)||e.type==="array"||e.type==="object");function wh(e){if(typeof sn(e)=="boolean")return!0;const n=Pn(e);return!!(typeof n=="boolean"||n!==null&&te(n)&&it(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function sa(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||wh(e)}const Ol=(e,t)=>sa(e)?!0:t?sa(t):!1,vh=(e,t)=>{if(Ge(e)||Ye(e)||Ze(e)||$n(e)||Ln(e)||Dn(e)||Mr(e))return!0;if(e.type==="array"||e.items){if(Tl(e)||Nl(e)!==null)return!0;const n=Ft(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=gt(n,t,na),s=Fe(r,t,na);return!it(s)}return!it(n)}return!1};function Ml(e){return JSON.stringify(e)}function oa(e){return typeof e=="string"?e:JSON.stringify(e)}function Qe({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function $l({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 Eh(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function kh(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Ah(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function jh(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function ia(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function aa(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function rr({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(Qe,{children:String(t.value)}),o.jsx(Qe,{children:t.op})]}),o.jsx(Qe,{children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx(Qe,{children:n.op}),o.jsx(Qe,{children:String(n.value)})]}),r&&o.jsx(Qe,{children:r})]})}function pr({value:e,displayValue:t}){const n=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(oa(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(oa(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??Ml(e)})}function Sh({schema:e}){const t=sn(e);return typeof t!="boolean"?null:o.jsx(Qe,{children:t?"additional properties allowed":"additional properties not allowed"})}function Nh({schema:e}){const t=Pn(e);return typeof t=="boolean"?o.jsx($l,{children:t?"any property name":"no property names"}):t!==null&&te(t)&&it(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Qe,{children:"property name pattern:"}),o.jsx(pr,{value:t.pattern,displayValue:t.pattern})]}):null}function la({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=Eh(e),s=kh(e),i=Ah(e),a=jh(e),l=ia(e,"minItems"),c=aa(e,"maxItems"),u=ia(e,"minProperties"),d=aa(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(Qe,{children:"multiple of :"}),o.jsx($l,{children:String(e.multipleOf)})]}),(r||s)&&o.jsx(rr,{name:t,lower:r,upper:s}),(i||a)&&o.jsx(rr,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(rr,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(rr,{name:t,lower:u,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Qe,{children:"regex pattern:"}),o.jsx(pr,{value:e.pattern,displayValue:e.pattern})]}),n&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(Qe,{children:"enum values:"}),n.map((p,f)=>o.jsx(pr,{value:p},`${f}-${Ml(p)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Qe,{children:"const value:"}),o.jsx(pr,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Qe,{children:"unique"}),o.jsx(Sh,{schema:e}),o.jsx(Nh,{schema:e})]})}function Ll({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&it(t),i=n??"value";return o.jsxs("div",{className:r,children:[o.jsx(la,{schema:e,rangeName:i}),s&&o.jsx(la,{schema:t,rangeName:"item"})]})}const Pl=(e,t)=>{const n=$n(e);if(n)return{text:`one of (${n.length})`};const r=Ln(e);if(r)return{text:`any of (${r.length})`};if(Ge(e)&&!Rl(Cl(e)))return{text:"not"};if(e.type==="array"||e.items){const u=Ft(e);if(u){const d=u.type;if(d==="object"){const p=u.$ref?To(u.$ref):t;return p?{text:"Array of objects",refHint:p}:{text:"Array of objects"}}if(typeof d=="string"){const p=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${d}`,format:p}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=s?`${s}`:"type: unknown";const a=sn(e);!Dn(e)&&a!==null&&te(a)&&(s==="object"||i==="type: unknown")&&(i=s==="object"?"object (map)":"map");const l=typeof e.format=="string"?e.format:void 0,c=t&&(s==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:l,refHint:c}},Th=(e,t)=>{if(!t)return!1;const n=Pl(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Dl({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:i}=Pl(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 ca="ml-6";function sr({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(Dl,{schema:e})]}),Ol(e)&&o.jsx(Ll,{schema:e,className:`flex flex-col gap-1 mt-1 ${ca}`}),n&&n.split(`
|
|
127
|
+
|
|
128
|
+
`).map((r,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${ca} leading-relaxed`,children:r},s))]})}function ps({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 _h({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 Bl({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=b.useRef([]),i=l=>(l+e.length)%e.length,a=(l,c)=>{var d;let u=c;l.key==="ArrowRight"&&(l.preventDefault(),u=i(c+1)),l.key==="ArrowLeft"&&(l.preventDefault(),u=i(c-1)),l.key==="Home"&&(l.preventDefault(),u=0),l.key==="End"&&(l.preventDefault(),u=e.length-1),u!==c&&(n(e[u].id),(d=s.current[u])==null||d.focus())};return o.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":r,children:e.map(({id:l,label:c},u)=>{const d=l===t;return o.jsx("button",{ref:p=>{s.current[u]=p},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>n(l),onKeyDown:p=>a(p,u),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:c},l)})})}function Ch({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},(u,d)=>`case ${d+1}`),l=e==="anyOf"?"Any of:":"One of:",c=e==="anyOf"?"Any of cases":"One of cases";return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:l}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(Bl,{tabs:a.map((u,d)=>({id:String(d),label:u})),selected:String(r),onChange:u=>s(Number(u)),ariaLabel:c}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const Ih="ml-0 border-dashed border-border";function Pt({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=$e();return n==="none"?o.jsx("div",{children:t}):n==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Ih}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Us(e,r)},children:t})}function Rh({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=$e(),s=Us(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 Oh="ml-6";function He({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:i,typeLabelOverride:a,required:l,description:c,expandable:u,expanded:d,onToggle:p,showBorder:f=!0}){const{depthColors:g}=$e(),m=Us(n,g),x=r&&Th(r,s),v=u?Oh:"";let A="",T=t;if(t.endsWith("[]")){const F=t.slice(0,-2),S=F.lastIndexOf(".");S>=0?(A=F.slice(0,S+1),T=`${F.slice(S+1)}[]`):T=t}else{const F=t.lastIndexOf("."),S=t.lastIndexOf("[]"),R=Math.max(F,S);R>=0&&(A=t.slice(0,R+(t[R]==="."?1:2)),T=t.slice(R+(t[R]==="."?1:2)))}return f=f&&!d,o.jsxs("div",{id:e,className:`py-2 ${f?"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:[A&&o.jsx("span",{className:"text-foreground-muted",children:A}),o.jsx("span",{className:"font-semibold",style:{color:m},children:T})]}),l&&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(Dl,{schema:r,refLabel:s}),x&&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&&Ol(r,i)&&o.jsx(Ll,{schema:r,itemSchema:i,fieldName:T,className:`flex flex-col gap-1 mt-1 ${v}`}),c&&c.split(`
|
|
129
|
+
|
|
130
|
+
`).map((F,S)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${v} leading-relaxed`,children:F},S)),u&&o.jsx(Rh,{depth:n,expanded:d,onToggle:p})]})}function hs({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 Mh({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(Pt,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(hs,{label:"If schema matches:",children:e}),t!=null&&o.jsx(hs,{label:"Then schema should follow:",children:t}),n!=null&&o.jsx(hs,{label:"Else schema should follow:",children:n})]})})]})}function or({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 $h=e=>e==="none"?"depth":e;function ot({schema:e,path:t,depth:n,required:r,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=hh,focusTokens:d=null,focusId:p=null}){var Oe;const f=$h(l),g=d!=null,x=g&&d.length===0?p??void 0:void 0,[v,A]=b.useState(c||g),[T,F]=b.useState(c);T!==c&&(F(c),A(c||g)),b.useEffect(()=>{g&&A(!0)},[g]);const[S,R]=b.useState(0),N=(Oe=d==null?void 0:d[0])==null?void 0:Oe.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),D=N?Number(N[1]):-1;b.useEffect(()=>{D>=0&&R(D)},[D]);const U=io(),{schema:k,refLabel:w,circular:M}=b.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Fs(e),circular:!0};const C=gt(e,i,s);return C.circular?C:{...C,schema:Fe(C.schema,i,s)}},[e,i,s,u,U]),j=b.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),W=Cl(bh(k)),re=!Rl(W)&&(Ge(k)||Ye(k)||Ze(k)),se=()=>{const C=_l(k);if(C===null)return null;if(typeof C=="boolean")return o.jsx(ps,{children:o.jsx(_h,{value:C})});const J=gt(C,i,s);if(J.circular)return o.jsx(ps,{children:o.jsx(He,{path:t,depth:n+1,typeLabelOverride:`↩ ${C.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ue=Fe(J.schema,i,s),oe=it(ue);return o.jsx(ps,{children:oe?o.jsx(sr,{schema:ue,showBorder:!1}):o.jsx(ot,{schema:C,path:t,depth:n+1,refStack:s,deref:i,ancestors:j,suppressRow:!0,branchLineVariant:f,defaultExpanded:c})})},E=(C,J)=>{if(typeof C=="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:C?"any value":"false schema"});const ue=gt(C,i,s);if(ue.circular)return o.jsx(He,{path:J,depth:n+1,typeLabelOverride:`↩ ${C.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const oe=Fe(ue.schema,i,s);return it(oe)?o.jsx(sr,{schema:oe,showBorder:!1}):o.jsx(ot,{schema:C,path:J,depth:n+1,refStack:s,deref:i,ancestors:j,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},_=C=>{const J=fs(C.if);if(J===null)return null;const ue=fs(C.then),oe=fs(C.else);return o.jsx(Mh,{ifContent:E(J,t),thenContent:ue!==null?E(ue,t):void 0,elseContent:oe!==null?E(oe,t):void 0})},G=()=>{const C=Il(k);return C.length===0?null:o.jsx(o.Fragment,{children:C.map((J,ue)=>o.jsx("div",{children:_(J)},ue))})};if(M)return o.jsx(He,{id:x,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??w??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(re){const C=o.jsxs(o.Fragment,{children:[Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]});return a?C:o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:t,depth:n,schema:k,refLabel:w,required:r,description:k.description,expandable:!0,expanded:v,onToggle:()=>A(J=>!J)}),v&&o.jsx(Pt,{depth:n,lineVariant:l,children:C})]})}const K=$n(W),le=Ln(W),ne=K??le,Y=K?"oneOf":"anyOf";if(ne){const C=ne.map((Le,Z)=>typeof Le.title=="string"?Le.title:`case ${Z+1}`),J=a?1:n+1,ue=ne[S],oe=gt(ue,i,s),we=oe.circular?oe.schema:Fe(oe.schema,i,s),be=!oe.circular&&it(we),ye=d&&D===S?d.slice(1):null,qe=be?o.jsx(sr,{schema:we,showBorder:!1}):o.jsx(ot,{schema:ue,path:t,depth:J-1,refStack:s,deref:i,ancestors:j,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:ye,focusId:p},S),Ee=o.jsx(Ch,{variant:Y,caseCount:ne.length,caseLabels:C,selectedCase:S,onSelectCase:R,children:qe}),nt=o.jsxs(o.Fragment,{children:[Ee,Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]});return a?nt:o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:t,depth:n,schema:k,refLabel:w,required:r,description:k.description,expandable:!0,expanded:v,onToggle:()=>A(Le=>!Le)}),v&&o.jsx(Pt,{depth:n,lineVariant:l,children:nt})]})}const B=(C,J,ue)=>{const oe=gt(C,i,s);if(oe.circular)return o.jsx(He,{path:J,depth:ue,typeLabelOverride:`↩ ${C.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const we=Fe(oe.schema,i,s);return it(we)?o.jsx(sr,{schema:we,showBorder:!1}):o.jsx(ot,{schema:C,path:J,depth:ue,refStack:s,deref:i,ancestors:j,branchLineVariant:f,defaultExpanded:c})},pe=C=>{const J=W.properties??{},ue=new Set(W.required??[]),oe=Pn(W),we=sn(W),be=_o(W);return o.jsxs(o.Fragment,{children:[Object.entries(J).map(([ye,qe])=>{if(!te(qe))return null;const Ee=d&&d[0]==="properties"&&d[1]===ye?d.slice(2):null;return o.jsx(ot,{schema:qe,path:`${t}.${ye}`,depth:C,required:ue.has(ye),refStack:s,deref:i,ancestors:j,branchLineVariant:f,defaultExpanded:c,focusTokens:Ee,focusId:p},ye)}),oe!==null&&te(oe)&&o.jsx(or,{label:"Property names must adhere to:",children:B(oe,`${t}.[propertyName]`,C)}),be.map(([ye,qe])=>o.jsx(ot,{schema:qe,path:yh(t,ye),depth:C,refStack:s,deref:i,ancestors:j,branchLineVariant:f,defaultExpanded:c},ye)),we!==null&&te(we)&&o.jsx(or,{label:"Additional properties must adhere to:",children:B(we,`${t}.[additionalProperty]`,C)}),Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]})};if(Dn(W)||Mr(W))return a?pe(n+1):o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:t,depth:n,schema:k,refLabel:w,required:r,description:k.description,expandable:!0,expanded:v,onToggle:()=>A(C=>!C)}),v&&o.jsx(Pt,{depth:n,lineVariant:l,children:pe(n+1)})]});if(W.type==="array"||W.items){const C=Nl(W),J=C!==null,ue=J?mh(W):null,oe=gh(W),we=oe!==null,be=J?null:Ft(W),ye=be!==null,qe=J||ye||we||Ge(k)||Ye(k)||Ze(k),Ee=`${t}[]`,nt=a?t:Ee,Le=ye?gt(be,i,s):null,Z=(Le==null?void 0:Le.schema)??null,ke=Z?Fe(Z,i,s):null,Te=Z!==null&&(j.objects.has(Z)||typeof(be==null?void 0:be.$ref)=="string"&&j.refs.has(be.$ref)),he=Z!==null?{objects:new Set(j.objects).add(Z),refs:typeof(be==null?void 0:be.$ref)=="string"?new Set(j.refs).add(be.$ref):j.refs}:j,pt=!J&&!we&&ke!==null&&it(ke),Je=ke!=null&&ke.properties?Object.entries(ke.properties).filter(([,H])=>te(H)):[],Rt=new Set(ke&&Array.isArray(ke.required)?ke.required:[]),et=!J&&d&&d[0]==="items"?d.slice(1):null,P=H=>o.jsxs(o.Fragment,{children:[J?o.jsxs(o.Fragment,{children:[C.map((X,ce)=>o.jsx(ot,{schema:X,path:`${t}[${ce}]`,depth:H,refStack:s,deref:i,ancestors:j,branchLineVariant:f,defaultExpanded:c},ce)),ue!==null&&typeof ue!="boolean"&&o.jsx(or,{label:"Additional items:",children:B(ue,`${t}[*]`,H)}),ue===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):ye&&(Te?o.jsx(He,{path:nt,depth:H,typeLabelOverride:`↩ ${be.$ref??Fs(Z)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Je.length>0?Je.map(([X,ce])=>{const _e=et&&et[0]==="properties"&&et[1]===X?et.slice(2):null;return o.jsx(ot,{schema:ce,path:`${nt}.${X}`,depth:H,required:Rt.has(X),refStack:s,deref:i,ancestors:he,branchLineVariant:f,defaultExpanded:c,focusTokens:_e,focusId:p},X)}):o.jsx(ot,{schema:be,path:nt,depth:H,refStack:s,deref:i,ancestors:he,branchLineVariant:f,defaultExpanded:c,focusTokens:et,focusId:p})),we&&o.jsx(or,{label:"Contains at least one:",children:typeof oe=="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:oe?"any item":"impossible constraint"}):B(oe,`${t}[contains]`,H)}),Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]});return pt&&!Ge(k)&&!Ye(k)&&!Ze(k)?o.jsx(He,{id:x,path:Ee,depth:n,schema:k,itemSchema:ke,refLabel:w,required:r,description:Ar(k.description,ke.description),expandable:!1,expanded:!1,onToggle:()=>{}}):pt?o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:Ee,depth:n,schema:k,itemSchema:ke,refLabel:w,required:r,description:Ar(k.description,ke.description),expandable:!0,expanded:v,onToggle:()=>A(H=>!H)}),v&&o.jsxs(Pt,{depth:n,lineVariant:l,children:[Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]})]}):a?qe?P(n+1):null:o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:Ee,depth:n,schema:k,itemSchema:ke,refLabel:w,required:r,description:k.description,expandable:J||ye||we||Ge(k)||Ye(k)||Ze(k),expanded:v,onToggle:()=>A(H=>!H)}),v&&o.jsx(Pt,{depth:n,lineVariant:l,children:P(n+1)})]})}if(Ge(k)||Ye(k)||Ze(k)){const C=o.jsxs(o.Fragment,{children:[Ge(k)&&se(),Ye(k)&&_(k),Ze(k)&&G()]});return a?C:o.jsxs(o.Fragment,{children:[o.jsx(He,{id:x,path:t,depth:n,schema:k,refLabel:w,required:r,description:k.description,expandable:!0,expanded:v,onToggle:()=>A(J=>!J)}),v&&o.jsx(Pt,{depth:n,lineVariant:l,children:C})]})}return a?null:o.jsx(He,{id:x,path:t,depth:n,schema:k,refLabel:w,required:r,description:k.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Co({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=$e(),l=b.useMemo(()=>new Set,[]),c=mt(e),u=b.useMemo(()=>c?Fe(c,i,l):null,[c,i,l]);if(!c||!u)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(c.$ref?To(c.$ref):void 0)??"schema",p=!!t;if(!vh(u,i)&&!c.$ref){if(p)return u.type==="array"||u.items?o.jsx("div",{className:n,children:o.jsx(ot,{schema:c,path:d,depth:0,refStack:l,deref:i,defaultExpanded:a,focusTokens:r,focusId:s})}):null;const g=u.type==="array"||u.items?`${d}[]`:d,m=Ft(u),x=m?Fe(m,i,l):null,v=x!==null&&it(x);return o.jsx("div",{className:n,children:o.jsx(He,{path:g,depth:0,schema:u,itemSchema:v?x:void 0,description:u.type==="array"||u.items?Ar(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:n,children:o.jsx(ot,{schema:c,path:d,depth:p?-1:0,refStack:l,deref:i,suppressRow:p,defaultExpanded:a,focusTokens:r,focusId:s})})}const Lh=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ir(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function Jt(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return Lh(i)?r.has(s)?ir(i,"null")?{type:"null"}:{}:Jt(i,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return ir(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return Jt({...i,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return Jt({...i,...s[0]},t,n,r)}if(ir(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[i,a]of Object.entries(e.properties)){const l=/id$/i.test(i)&&a.type==="string"&&!a.format&&!a.examples,c=a.type==="string"&&!a.format&&!a.examples&&!a.enum;s[i]=l?{...a,format:"uuid"}:c?{...a,examples:["string"]}:Jt(a,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(ir(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:Jt(e.items,t,n,r)}}finally{n.delete(e)}}return e}function Ph({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=b.useState(n?t:null),{deref:i}=$e();if(b.useEffect(()=>{if(n){s(t);return}let l=!1;return Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs")).then(({generate:c})=>c(Jt(e,i),{seed:42,useExamplesValue:!0,optionalsProbability:1})).then(c=>{l||s(c)}).catch(()=>{}),()=>{l=!0}},[e,i,n,t]),r===null)return null;const a=JSON.stringify(r,null,2);return o.jsxs("div",{children:[o.jsx(No,{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 zt({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:l,example:c,defaultView:u="example"}){const d=Fa(s),p=!l&&Kd(s,a),[f,g]=b.useState(p&&u==="example"?"example":"schema");return b.useEffect(()=>{!p&&f==="example"&&g("schema")},[p,f]),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(Bl,{tabs:[...p?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:f,onChange:m=>g(m),ariaLabel:"Schema view toggle"})]}),a&&o.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",za(s)??"the"," schema, showing raw definition. ",a]}),l?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[f==="schema"&&o.jsx(Co,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),f==="json"&&o.jsx(Sl,{schema:i??e}),f==="example"&&p&&o.jsx(Ph,{schema:e,providedExample:c})]})]})}function Fl({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var g;const[i,a]=b.useState("payload");b.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:l}=$e(),c=io(),u=b.useMemo(()=>e.payload?jn(e.payload,l):null,[e.payload,l,c]),d=b.useMemo(()=>e.headers?jn(e.headers,l):null,[e.headers,l,c]),p=(g=e.examples)==null?void 0:g[0],f=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(rn,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:m=>a(m)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(zt,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:p==null?void 0:p.payload}),(i==="headers"||!e.payload)&&d&&o.jsx(zt,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion,example:p==null?void 0:p.headers})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,x)=>o.jsx(So,{name:`#${m.name}`},x))})]})})}),f&&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(In,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Dh({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[i,a]=b.useState(!1);return b.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(Fl,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:r?s:null})})})]})}function zl({messages:e,selectedKey:t,focusSection:n}){const r=Object.entries(e),s=r.length?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",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"})]})}),r.map(([i,a],l)=>o.jsx(Dh,{messageKey:i,message:a,first:l===0,isSelected:t===i,focusSection:n},i))]})}):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(_t,{content:s,stickySideContent:!1})})}function Ul({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:Xt(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 Hl(e){return o.jsx(Ks,{...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 Bh(e){return o.jsx(Ks,{...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 Gl({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(Bh,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Nt,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function Wl({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 Bn({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:i=""}){const[a,l]=b.useState(n),c=b.useId();return b.useEffect(()=>{r&&l(!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":c,"aria-labelledby":s,onClick:()=>l(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,a?o.jsx(In,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Wl,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${a?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:t})})]})}const ms={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 gs(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 Fh(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function zh(e){const t=(e??[]).filter(s=>ms[gs(s)]),n=new Map;for(const s of t){const i=ms[gs(s)];n.set(i,(n.get(i)??0)+1)}const r=new Set;return t.map((s,i)=>{const a=gs(s),l=ms[a],c=(n.get(l)??0)>1?Fh(s):void 0;let u=c?`${l} (${c})`:l;return r.has(u)&&(u=`${u} #${i+1}`),r.add(u),{id:`${a}-${i}`,name:u,kind:a,scheme:s}})}function Io({securities:e}){var u;const t=b.useMemo(()=>zh(e),[e]),n=t.length>1,[r,s]=b.useState(n?null:((u=t[0])==null?void 0:u.id)??null);b.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(d=>d&&t.some(p=>p.id===d)?d:null)},[t]);const i=t.find(d=>d.id===r),a=i==null?void 0:i.kind,l=i==null?void 0:i.scheme,c=l==null?void 0:l.description;return o.jsxs("div",{children:[n&&o.jsx(rn,{tabs:t,current:r,onChange:d=>s(p=>d&&p===d?null:d||null),placeholder:"Select an authorization method"}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[a==="userPassword"&&o.jsxs(ar,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),a&&["scramSha256","scramSha512","plain"].includes(a)&&o.jsxs(ar,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),a==="gssapi"&&o.jsxs(ar,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),a==="X509"&&o.jsxs(ar,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),a==="bearer"&&o.jsx(Uh,{security:l}),a==="apiKey"&&o.jsx(Hh,{security:l}),a==="openIdConnect"&&o.jsx(Gh,{security:l}),a==="oauth2"&&o.jsx(Wh,{security:l})]})]})}const ar=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(at,{children:e})}):o.jsx("span",{children:t}),Uh=({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."]}),Hh=({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."]})},Gh=({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"," ",o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(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:bu(t)})})]})]})},Wh=({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 c,u;let s="",i="";switch(n){case"clientCredentials":s=ru,i=su;break;case"implicit":s=tu,i=nu;break;case"password":s=ou,i=iu;break;case"authorizationCode":s=au,i=lu;break}const a=(c=e.requiredScopes)!=null&&c.length?e.requiredScopes:r.availableScopes??r.scopes,l=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:i})]}),o.jsx("div",{className:"mt-5 border-t border-border",children:o.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[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:o.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children: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:o.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children: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:o.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children: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:l}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(a)?a:Object.keys(a)).map(d=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:d},d))})})]})]})})]},n)})]})};function qh(e){return e.startsWith("http://")||e.startsWith("https://")}function ql(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Vl({value:e}){if(e==null)return null;if(typeof e=="string"&&qh(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:ql(n)}),o.jsx(Vl,{value:r})]},n))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Kl({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=du[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},i=Object.entries(e??{}).filter(([a,l])=>a!=="bindingVersion"&&l!==void 0&&l!==null);return i.length===0?null:o.jsx(Bn,{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,l])=>o.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[o.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:ql(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Vl,{value:l})})]},a))})})}function Vh({host:e,protocol:t,description:n,tags:r,variables:s,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=s,d=b.useId();return o.jsxs("div",{children:[o.jsx(Gl,{address:e,variables:u,children:o.jsx("div",{className:"mt-2",children:r&&r.map((p,f)=>{const g=p,m=g.externalDocs;return o.jsx(So,{href:m&&m.url,title:g.description||(m&&m.description?m.description:void 0),name:g.name},f)})})}),o.jsx(at,{children:n}),i&&i.length>0&&o.jsxs("div",{id:l?`server-${l}-security`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Hl,{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(Bn,{className:"mt-4",ariaLabelledBy:d,forceExpanded:c==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:i.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Io,{securities:i})})})]}),(()=>{const p=a==null?void 0:a[t];return p&&Object.keys(p).some(g=>g!=="bindingVersion")?o.jsxs("div",{id:l?`server-${l}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Zs,{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(Kl,{bindings:p,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function Yl({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null}){const s=Object.keys(e),[i,a]=b.useState(void 0),l=[t,i].find(d=>!!d&&s.includes(d))??s[0],c=d=>{a(d),n==null||n(d)},u=o.jsx(Vh,{...e[l],serverKey:l,focusSection:t||i?r:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{title:ha,content:u,sideContent:o.jsx(Ul,{serverNames:s,current:l,setCurrent:c}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}const Zl=b.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:i,children:a,width:l="w-[50rem]"},c){b.useEffect(()=>{const x=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]);const u=n==="right"?"translate-x-full":"-translate-x-full",d=n==="right"?"right-0":"left-0",{portalHost:p,rootElement:f}=$e();b.useEffect(()=>{if(!(!t||!p))return ja(Aa(p))},[t,p]);const g=Nr(f,!0),m=g?{position:"fixed",top:0,left:g.left,width:g.width,height:"100vh"}:{position:"fixed",inset:0};return p?Tn.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...m,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:c,className:`absolute top-0 ${d} h-full ${l} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":u}`,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})]})]}),p):null});function Xl({getMarkdown:e,label:t}){const[n,r]=b.useState(!1),s=b.useRef(void 0);b.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const i=async()=>{try{await navigator.clipboard.writeText(e()),r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),2e3)}catch(a){console.error("[CopyMarkdownButton] copy failed:",a)}};return o.jsx("button",{type:"button",onClick:i,title:t,"aria-label":t,className:"ml-2 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors",children:n?o.jsx(Qs,{className:"w-4 h-4 text-green-600"}):o.jsx(Xs,{className:"w-4 h-4"})})}function Ql({message:e,messageId:t,i:n}){const[r,s]=b.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(Fl,{message:e,expanded:r,onToggleExpanded:()=>s(i=>!i)})]})}function Kh({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,i]=b.useState("request"),a=t.messages??[],l=t.channel,c=t.address,u=s==="request"?e:a,d=s==="request"?n?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",c?o.jsxs(o.Fragment,{children:["a channel in"," ",o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:c.location})]}):(l==null?void 0:l.address)&&o.jsx(Nt,{address:l.address,parameters:l.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(p=>o.jsx("button",{onClick:()=>i(p),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
131
|
+
${s===p?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:p},p))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:r})," ",d,u.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:u.map((p,f)=>o.jsx(Ql,{message:p,messageId:p.name,i:f},f))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function Yh({op:e,id:t,focusSection:n=null}){var m;const r=b.useId(),s=e.messages??[],i=e.tags??[],a=e.bindings,l=e.traits,c=e.reply,u=e.externalDocs,d=e.security,p=a??(Array.isArray(l)?(m=l.find(x=>x.bindings))==null?void 0:m.bindings:void 0),f=e.action===hr.SEND,g=o.jsx("div",{className:"space-y-2",children:s.map((x,v)=>o.jsx(Ql,{message:x,messageId:x.name,i:v},v))});return o.jsxs("div",{className:"space-y-6",id:`operation-${t}-detail`,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]}),(u==null?void 0:u.url)&&o.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",title:u.description||u.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(Cr,{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})}),d&&d.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(Bn,{ariaLabelledBy:r,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:d.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Io,{securities:d})})})]}),p&&Object.entries(p).map(([x,v])=>v?o.jsxs("div",{id:`operation-${t}-bindings-${x}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Kl,{protocol:x,bindings:v,focused:n===`binding:${x}`})]},x):null),c?o.jsx(Kh,{requestMessages:s,reply:c,isSend:f,operationId:t}):s.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})," ",f?"accepts":"expects",s.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]}),i.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:i.map((x,v)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:x.name},v))})]})]})}function Jl({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,showCopyMarkdown:s}){const i=m=>n==null?void 0:n(m),{document:a,deref:l}=$e(),c=a;if(!Object.keys(e).length)return null;const u=t?e[t]:null,d=Object.keys(e).map(m=>{var R;const x=e[m],v=x.channel,A=v==null?void 0:v.address,T=v==null?void 0:v.parameters,F=((R=x.action)==null?void 0:R.toUpperCase())??"",S=t===m;return o.jsxs("tr",{id:`operation-${m}`,onClick:()=>i(m),role:"button",tabIndex:0,"aria-label":`${F||"Operation"} ${A??m}`,"aria-current":S?"true":void 0,onKeyDown:N=>{N.key!=="Enter"&&N.key!==" "||(N.preventDefault(),i(m))},className:`group cursor-pointer ${S?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:A&&o.jsx(Nt,{address:A,parameters:T,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:o.jsx(Tt,{method:x.action,className:"w-24"})}),o.jsx("td",{className:"group-hover:bg-neutral-50"})]},m)}),p=u?u.channel:null,f=u&&(p!=null&&p.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Tt,{method:u.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Nt,{address:p.address,parameters:p.parameters})})]}):t??"Operation",g=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("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:d})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{title:cu,content:g,stickySideContent:!1})}),o.jsx(Zl,{isOpen:!!u,side:"right",onClose:()=>i(null),title:f,headerActions:u&&t&&s?o.jsx(Xl,{getMarkdown:()=>lo(c,t,l),label:"Copy operation for LLM"}):void 0,children:u&&o.jsx(Yh,{op:u,id:t,focusSection:r})})]})}function $r({schemas:e,selectedKey:t,focusTarget:n}){const{deref:r}=$e(),s=io(),i=b.useMemo(()=>Object.entries(e).map(([l,c])=>[l,jn(c,r)]),[e,r,s]),a=i.length?o.jsx("div",{className:"grid gap-6 w-full",children:i.map(([l,c])=>{const u=c.schema,d=Fa(c.schemaFormat),p=u.properties?Object.keys(u.properties).length:0;return o.jsxs("article",{id:`schema-${l}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===l?"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:l}),c.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:c.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:u.type??"unknown"})]}),(u.format||d||p>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[u.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",u.format]}),d&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:c.schemaFormat,children:d}),p>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[p," properties"]})]}),c.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"," ",za(c.schemaFormat)??"the"," schema — showing raw definition. ",c.conversionError]}),c.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),c.pendingConversion?null:c.conversionError&&typeof c.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(Sl,{schema:c.originalSchema})}):o.jsx(Co,{schema:u,rootName:l,className:"mt-4",focusTokens:l===t?(n==null?void 0:n.tokens)??null:null,focusId:l===t?(n==null?void 0:n.id)??null:null})]},l)})}):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 AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{content:a,stickySideContent:!1})})}const Zh=e=>e==="operations"||e==="messages"||e==="schemas";function Xh({asyncapi:e,config:t}){var R,N,D,U;const n=t.show??{},r=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Tr}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Ea}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Ys}]:[]],{query:s,setQuery:i,results:a}=Td(e,{threshold:.3,limit:20}),{effectiveTab:l,focusTab:c,navActiveSection:u,selected:d,setSelectedKey:p,selectedNavItem:f,handleSearchSelect:g,handleNavItemSelect:m,handleNavServerSelect:x,handleContentTabChange:v,focusSection:A,schemaFocusTarget:T}=Da({tabs:r,defaultTab:"operations",isTabKey:Zh,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:s}),F=e.servers?Object.keys(e.servers):[],S=l==="operations"?o.jsx(Jl,{operations:e.operations??{},selectedKey:d.operations,onSelectKey:k=>p("operations",k),focusSection:A,showCopyMarkdown:n.copyMarkdown!==!1}):l==="messages"?o.jsx(zl,{messages:((R=e.components)==null?void 0:R.messages)??{},selectedKey:d.messages,focusSection:A}):l==="schemas"?o.jsx($r,{schemas:((N=e.components)==null?void 0:N.schemas)??{},selectedKey:d.schemas,focusTarget:T}):null;return o.jsx(Vs,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:o.jsxs("div",{className:"px-4",children:[n.search!==!1&&o.jsx(Sa,{query:s,onQueryChange:i,results:a,onSelectResult:g}),n.copyMarkdown!==!1&&o.jsx(Na,{serialize:k=>ao(e,k),leftOffset:n.search!==!1?60:12}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(jl,{...e.info})}),n.servers!==!1&&F.length>0&&o.jsx("div",{id:`server-${d.servers??F[0]}`,children:o.jsx(Yl,{servers:e.servers,selectedServer:d.servers,onSelectServer:k=>p("servers",k),focusSection:A})}),n.sidebar!==!1&&o.jsx(Tu,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(D=e.components)==null?void 0:D.messages:void 0,schemas:n.schemas!==!1?(U=e.components)==null?void 0:U.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:u,onTabChange:c,onItemSelect:m,onSelectServer:x,selectedItem:f}),o.jsx(xa,{tabs:r,current:l,onChange:v}),l&&o.jsx("div",{id:`panel-${l}`,role:"tabpanel","aria-labelledby":`tab-${l}`,children:S})]})})}const Ro=e=>o.jsx(Ws,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Qh,{...e})}),Qh=e=>{const t=e.asyncapi,n=b.useMemo(()=>Cn(t),[t]),r=e.kind;b.useEffect(()=>{r==="resolved"&&n!==t&&Gs(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??nn;return o.jsx(Xh,{asyncapi:n,config:s})};function Oo({document:e,config:t=nn,className:n="",children:r}){const{contextValue:s,themeVars:i,setPortalHost:a,setRootElement:l}=ga("openapi",e,t);return o.jsx(Sr.Provider,{value:s,children:o.jsxs("div",{ref:l,style:i,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[o.jsx("div",{ref:a,className:"openapi-portal-root"}),r]})})}function Jh(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:We([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:We([s.url,s.description,s.variables])})});const n=(s,{tab:i,type:a,idPrefix:l,docKey:c,sectionLabel:u})=>{for(const d of Object.keys(s)){const p=s[d];if(p)for(const f of _r){const g=p[f];if(!g)continue;const m=`${f} ${d}`,x=g.summary??`${f.toUpperCase()} ${d}`;t.push({id:`${l}-${m}`,targetId:`${l}-${m}-detail`,type:a,tab:i,key:m,name:x,path:`${c}.${d}.${f}`,location:`${u} > ${f.toUpperCase()} ${d}`,subtitle:g.description,text:We([f,d,g.summary,g.description,g.operationId,g.tags,g.parameters,g.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,i]of Object.entries(e.components.schemas))Ta(t,i,s,s);return t}function em(e,t={}){return La(e,Jh,t)}function ec({info:e,tags:t,externalDocs:n}){const{title:r,description:s,license:i,contact:a}=e;return o.jsx(Al,{title:r,description:s,license:i,contact:a,externalDocs:n,tags:t,extensionsSource:e})}function tm({url:e,description:t,variables:n}){return o.jsxs("div",{children:[o.jsx(Gl,{address:e,variables:n}),t&&o.jsx(at,{children:t})]})}const xs=e=>`server-${e}`,bs=e=>Number(e.slice(7));function tc({servers:e,selectedServer:t,onSelectServer:n}){const r=e.map((p,f)=>p.url||xs(f)),[s,i]=b.useState(void 0),a=p=>!!p&&bs(p)>=0&&bs(p)<e.length,l=a(t)?t:a(s)?s:xs(0),c=e[bs(l)],u=p=>{i(p),n==null||n(p)},d=c?o.jsx(tm,{...c}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{title:ha,content:d,sideContent:o.jsx(Ul,{serverNames:r,current:(c==null?void 0:c.url)||l,setCurrent:p=>{const f=r.indexOf(p);u(f>=0?xs(f):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function nm({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 nc(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function rm(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${nc(`$${n}`)}}`)}function sm(e){return e.operationId??e.operationRef??null}const om=e=>e.trim().replace(/[.:;]+$/,""),ys=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function im({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=sm(s),a=Object.entries(s.parameters??{}),l=s.description?om(s.description):null,c=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=l??i??r;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(nm,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[c?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):o.jsx("span",{className:"text-foreground-secondary",children:u}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([p,f],g)=>o.jsxs(b.Fragment,{children:[g>0&&(g===a.length-1?" and ":", "),o.jsx(ys,{children:p})," from ",o.jsx(ys,{children:nc(f)})]},p))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(ys,{children:s.server.url})]}):null,"."]})]},r)})})}function am(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],i)=>_r.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:r,method:a,op:s[a],urlIndex:i}))))}function lm({callbacks:e,id:t,renderOperation:n,depth:r}){const s=am(e);return s.length===0?null:o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),o.jsx("div",{className:"space-y-2",children:s.map(({name:i,url:a,method:l,op:c,urlIndex:u})=>o.jsx(Bn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Tt,{method:l,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:i}),o.jsx("code",{className:"font-mono text-foreground-muted truncate",children:rm(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(n,{method:l,path:a,op:c,id:`${t}-${i}-${u}-${l}`,idPrefix:"callback",depth:r+1})})},`${i}-${u}-${l}`))})]})}const cm=b.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-D7dq1xEM.cjs")).then(({CodeSamples:e})=>({default:e})));function um(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function rc({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 sc(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 dm(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 fm({responses:e,onFollowOperation:t,isOperationKnown:n}){var N,D;const r=Object.keys(e),[s,i]=b.useState(r[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=b.useState(l[0]),d=c?(N=a==null?void 0:a.content)==null?void 0:N[c]:void 0,p=(a==null?void 0:a.headers)??{},f=(a==null?void 0:a.links)??{},[g,m]=b.useState("body"),x=l.length>0&&!!d,v=Object.keys(p).length>0,A=Object.keys(f).length>0,T=[...x?[{id:"body",name:"Body"}]:[],...v?[{id:"headers",name:"Headers"}]:[]],F=T.length>1,S=T.some(U=>U.id===g)?g:(D=T[0])==null?void 0:D.id,R=T.length>0;return b.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),m("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(U=>o.jsx("button",{role:"tab","aria-selected":s===U,onClick:()=>i(U),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${dm(U)} ${s===U?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:U},U))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),R?o.jsxs(o.Fragment,{children:[F&&o.jsx(rn,{tabs:T,current:S,onChange:U=>m(U)}),o.jsx("div",{className:F?"mt-4":void 0,children:S==="headers"?o.jsx(zt,{schema:hm(p),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(zt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(rc,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:sc(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),A&&o.jsx(im,{links:f,onFollowOperation:t,isOperationKnown:n})]})}function oc(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 pm=e=>oc(e),hm=e=>oc(Object.entries(e).map(([t,n])=>({name:t,...n})));function mm({parameters:e}){var l;const t=fu.filter(({location:c})=>e.some(u=>u.in===c)),[n,r]=b.useState(((l=t[0])==null?void 0:l.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===n)?n:t[0].location,i=t.find(c=>c.location===s),a=pm(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(rn,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(zt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function gm({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,i=Object.keys(n),a=i.length>0,[l,c]=b.useState(s?"parameters":"body"),[u,d]=b.useState(i[0]),p=u?n[u]:void 0;if(!s&&!a)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const f=[a?"request body":null,t.some(g=>g.in==="header")?"headers":null,t.some(g=>g.in==="cookie")?"cookie":null].filter(g=>!!g);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 ",xm(f),":"]}),s&&a&&o.jsx(rn,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:l,onChange:g=>c(g)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(l==="parameters"||!a)&&s&&o.jsx(mm,{parameters:t}),(l==="body"||!s)&&a&&p&&o.jsx(zt,{schema:p.schema??{},label:o.jsx(rc,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:r,example:sc(p)})]})]})}function xm(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 bm({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:i,id:a,depth:l,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:d}){const p=t.length>0||Object.keys(n).length>0,f=Object.keys(s).length>0,g=!!i&&Object.keys(i).length>0&&l<ym,m=[...p?["request"]:[],...f?["response"]:[],...g?["callbacks"]:[]],[x,v]=b.useState(m[0]??"request");if(m.length===0)return null;const A=m.includes(x)?x:m[0];return o.jsxs("div",{className:c?"flex-1 flex flex-col min-h-0":void 0,children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(T=>o.jsx("button",{role:"tab","aria-selected":A===T,onClick:()=>v(T),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${A===T?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:T},T))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${c?"flex-1 -mb-4":""}`,children:[A==="request"&&o.jsx(gm,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),A==="response"&&o.jsx(fm,{responses:s,onFollowOperation:u,isOperationKnown:d}),A==="callbacks"&&i&&o.jsx(lm,{callbacks:i,id:a,depth:l,renderOperation:ic})]})]})}const ym=1;function ic({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var T,F,S;const d=(n.parameters??[]).filter(R=>R.in!=="query"&&R.in!=="path"),p=n.security??i??[],f=n.responses??{},g=((T=n.requestBody)==null?void 0:T.content)??{},m=n.operationId?um(n.operationId):`${e.toUpperCase()} ${t}`,x=new Map;for(const R of p)for(const[N,D]of Object.entries(R)){if(D.length===0)continue;const U=x.get(N)??[];x.set(N,Array.from(new Set([...U,...D])))}const v=Array.from(new Set(p.flatMap(R=>Object.keys(R)))).map(R=>{const N=a==null?void 0:a[R];if(!N)return null;const D=x.get(R);return D?{...N,requiredScopes:D}:N}).filter(R=>!!R),A=u===0;return o.jsxs("div",{className:`flex flex-col gap-6 ${A?"min-h-full":""}`,id:`${s}-${r}-detail`,children:[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)&&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(Cr,{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(b.Suspense,{fallback:null,children:o.jsx(cm,{method:e,path:t,parameters:d,requestBody:n.requestBody,security:p,id:r})}),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"}),v.length>0&&o.jsx(Bn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Hl,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:v.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Io,{securities:v})})})]}),o.jsx(bm,{label:m,parameters:d,requestBodyContent:g,requestBodyDescription:(S=n.requestBody)==null?void 0:S.description,responses:f,callbacks:n.callbacks,id:r,depth:u,fillHeight:A,onFollowOperation:l,isOperationKnown:c})]})}function wm(e,t){const n=t.filter(r=>r.in==="query");return n.length===0?e:`${e}?${n.map(r=>`${r.name}={${r.name}}`).join("&")}`}function ua(e){var n;const t={};for(const r of e){const s=r.schema;t[r.name]={description:r.description,type:s==null?void 0:s.type,default:(s==null?void 0:s.default)!==void 0?String(s.default):void 0,enum:(n=s==null?void 0:s.enum)==null?void 0:n.map(String),examples:"example"in r&&r.example!==void 0?[String(r.example)]:void 0}}return t}function jr({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,showCopyMarkdown:i,columnLabel:a="Path",idPrefix:l="endpoint"}){var k;const c=w=>s==null?void 0:s(w),{document:u,deref:d}=$e(),p=u,f=b.useMemo(()=>vn(e),[e]),g=b.useMemo(()=>{var M,j,W;const w=new Map;for(const re of f){const se=((W=(j=(M=e[re.path])==null?void 0:M[re.method])==null?void 0:j.tags)==null?void 0:W[0])||"Other",E=w.get(se)??[];E.push(re),w.set(se,E)}return Array.from(w,([re,se])=>({label:re,items:se}))},[f,e]),[m,x]=b.useState(()=>new Set),v=m.size===0;b.useEffect(()=>{if(!r)return;const w=g.find(({items:M})=>M.some(({key:j})=>j===r));w&&x(M=>{if(!M.has(w.label))return M;const j=new Set(M);return j.delete(w.label),j})},[g,r]);const A=b.useMemo(()=>{var M,j;const w=new Map;for(const{key:W,method:re,path:se}of f){const E=(j=(M=e[se])==null?void 0:M[re])==null?void 0:j.operationId;E&&w.set(E,W)}return w},[f,e]);if(f.length===0)return null;const T=r?f.find(w=>w.key===r):null,F=T?(k=e[T.path])==null?void 0:k[T.method]:null,S=({key:w,method:M,path:j},W)=>{var E;const re=r===w,se=vi(e[j],(E=e[j])==null?void 0:E[M]);return o.jsxs("tr",{id:`${l}-${w}`,onClick:()=>c(w),role:"button",tabIndex:W?0:-1,"aria-hidden":!W,"aria-label":`${M.toUpperCase()} ${j}`,"aria-current":re?"true":void 0,onKeyDown:_=>{_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),c(w))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${W?`cursor-pointer opacity-100 visible ${re?"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 ${W?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${W?"max-h-12":"max-h-0"}`,children:o.jsx(Nt,{address:j,parameters:ua(se),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 ${W?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${W?"max-h-12":"max-h-0"}`,children:o.jsx(Tt,{method:M,className:"w-20"})})})]},w)},R=g.map(({label:w,items:M},j)=>{const W=!m.has(w),re=`${l}-group-${j}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(b.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":`${w} endpoints (${M.length})`,"aria-expanded":W,"aria-controls":re,onClick:()=>x(se=>{const E=new Set(se);return W?E.add(w):E.delete(w),E}),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:W?o.jsx(In,{className:"h-2.5 w-2.5"}):o.jsx(Wl,{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:w}),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:M.length})]})})})}),o.jsx("tbody",{id:re,"aria-hidden":!W,className:`bg-surface ${W?"divide-y divide-border":""}`,children:M.map(se=>S(se,W))})]},w)}),N=vi(T?e[T.path]:void 0,F),D=T?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Tt,{method:T.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Nt,{address:wm(T.path,N),parameters:ua(N),className:"text-xs"})})]}):r,U=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:v,onChange:w=>x(w.target.checked?new Set:new Set(g.map(({label:M})=>M))),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),x(v?new Set(g.map(({label:M})=>M)):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:a}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),R]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(_t,{content:U,stickySideContent:!1})}),o.jsx(Zl,{isOpen:!!T,side:"right",onClose:()=>c(null),title:D,headerActions:T&&F&&i?o.jsx(Xl,{getMarkdown:()=>uo(p,T.method,T.path,d),label:"Copy endpoint for LLM"}):void 0,children:T&&F&&o.jsx(ic,{method:T.method,path:T.path,op:{...F,parameters:N},id:T.key,idPrefix:l,globalSecurity:t,securitySchemes:n,isOperationKnown:w=>A.has(w),onFollowOperation:w=>{const M=A.get(w);M&&c(M)}})})]})}const vm=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function Em({openapi:e,config:t}){var N,D,U,k;const n=t.show??{},r=e.webhooks??{},s=Object.keys(r).length>0,i=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Tr}]:[],...s&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Zs}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Ys}]:[]],{query:a,setQuery:l,results:c}=em(e,{threshold:.3,limit:20}),{effectiveTab:u,focusTab:d,navActiveSection:p,selected:f,setSelectedKey:g,selectedNavItem:m,handleSearchSelect:x,handleNavItemSelect:v,handleNavServerSelect:A,handleContentTabChange:T,schemaFocusTarget:F}=Da({tabs:i,defaultTab:"endpoints",isTabKey:vm,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:s&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:a}),S=(e.servers??[]).map(w=>w.url),R=u==="endpoints"?o.jsx(jr,{paths:e.paths??{},security:e.security,securitySchemes:(N=e.components)==null?void 0:N.securitySchemes,selectedKey:f.endpoints,onSelectKey:w=>g("endpoints",w),showCopyMarkdown:n.copyMarkdown!==!1}):u==="webhooks"?o.jsx(jr,{paths:r,security:e.security,securitySchemes:(D=e.components)==null?void 0:D.securitySchemes,selectedKey:f.webhooks,onSelectKey:w=>g("webhooks",w),columnLabel:"Webhook",idPrefix:"webhook",showCopyMarkdown:n.copyMarkdown!==!1}):u==="schemas"?o.jsx($r,{schemas:((U=e.components)==null?void 0:U.schemas)??{},selectedKey:f.schemas,focusTarget:F}):null;return o.jsx(Oo,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:o.jsxs("div",{className:"px-4",children:[n.search!==!1&&o.jsx(Sa,{query:a,onQueryChange:l,results:c,onSelectResult:x}),n.copyMarkdown!==!1&&o.jsx(Na,{serialize:w=>co(e,w),leftOffset:n.search!==!1?60:12}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(ec,{info:e.info,tags:e.tags,externalDocs:e.externalDocs})}),n.servers!==!1&&S.length>0&&o.jsx("div",{id:f.servers??"server-0",children:o.jsx(tc,{servers:e.servers,selectedServer:f.servers,onSelectServer:w=>g("servers",w)})}),n.sidebar!==!1&&o.jsx(Ru,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:s&&n.webhooks!==!1?r:void 0,schemas:n.schemas!==!1?(k=e.components)==null?void 0:k.schemas:void 0,servers:n.servers!==!1?S:void 0,hasInfo:n.info!==!1,activeTab:p,onTabChange:d,onItemSelect:v,onSelectServer:A,selectedItem:m}),o.jsx(xa,{tabs:i,current:u,onChange:T}),u&&o.jsx("div",{id:`panel-${u}`,role:"tabpanel","aria-labelledby":`tab-${u}`,children:R})]})})}const Mo=e=>o.jsx(Ws,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(km,{...e})}),km=e=>{const t=e.openapi,n=b.useMemo(()=>Cn(t),[t]),r=e.kind;b.useEffect(()=>{r==="resolved"&&n!==t&&Gs(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??nn;return o.jsx(Em,{openapi:n,config:s})};function ac(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 en=e=>{var n;return typeof e!="string"?void 0:((n=e.trim().split(`
|
|
132
|
+
`)[0])==null?void 0:n.trim())||void 0},Am=e=>_r.some(t=>t===e),jm=ac({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 en((t=e.info)==null?void 0:t.description)},targets:e=>vn(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:en(s==null?void 0:s.summary)??en(s==null?void 0:s.description),target:{kind:"operation",document:e,method:n,path:r}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return co(e);if(typeof t.path!="string"||!Am(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return uo(e,t.method,t.path)}}),Sm=ac({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 en((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:en(n==null?void 0:n.summary)??en(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 lo(e,t.id)}}),da=[jm,Sm];function $o(e){const t=typeof e=="object"&&e!==null?e:{},n=da.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: ${da.map(r=>r.name).join(", ")}.`);return n}function lc(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Nm(e){return $o(e).targets(e)}function Tm(e,t){const n=$o(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return n.toMarkdown(e,t)}function _m(e,t={}){const n=$o(e),{baseUrl:r,url:s,optional:i}=t,a=(r==null?void 0:r.replace(/\/+$/,""))??"",c=s??(f=>`${a}/${lc(f.key)}.md`),u=[`# ${t.title??n.title(e)}`],d=t.summary??n.summary(e);d&&u.push("",`> ${d}`);const p=n.targets(e).map(f=>({entry:f,href:c(f)})).filter(f=>!!f.href);if(p.length){u.push("",`## ${n.sectionTitle}`,"");for(const{entry:f,href:g}of p)u.push(`- [${f.label}](${g})${f.summary?`: ${f.summary}`:""}`)}if(i!=null&&i.length){u.push("","## Optional","");for(const f of i)u.push(`- [${f.label}](${f.url})${f.description?`: ${f.description}`:""}`)}return u.push(""),u.join(`
|
|
133
|
+
`)}function cc(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 Cm=["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 Im(){return{validate:Om,parse:Mm,getMimeTypes:()=>Cm}}function Rm(e){cc(e,Im(),Rn)}function Om(e){return oo(e.data).map(t=>({message:t,path:e.path}))}function Mm(e){var n,r;const t=oo(e.data);if(t.length>0)return{[br]:t[0]};try{const s=Ms(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=Ms(a)),s}catch(s){return{[br]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function $m(){try{const e=await Promise.resolve().then(()=>require("./index-BoAORjov.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 uc(e){try{const t=await $m(),n=new t;Rm(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-G1NujZ28.cjs"));r(n);const{document:s,diagnostics:i}=await n.parse(e);return{diagnostics:i,document:s?Pm(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Lm(e,t){const{diagnostics:n,document:r}=await uc(e);return{diagnostics:n,view:r?o.jsx(Ro,{kind:"resolved",asyncapi:r,config:t}):null}}function Pm(e){return e.json()}function Dm({raw:e,config:t,onDiagnostics:n,errorFallback:r,onError:s}){const[i,a]=b.useState(null),l=b.useRef(n);return l.current=n,b.useEffect(()=>{let c=!0;return uc(e).then(({document:u,diagnostics:d})=>{var p;c&&(a(u),(p=l.current)==null||p.call(l,d))}),()=>{c=!1}},[e]),i?o.jsx(Ro,{kind:"resolved",asyncapi:i,config:t,errorFallback:r,onError:s}):null}async function Bm(){try{return await Promise.resolve().then(()=>require("./index-CZjVUeK4.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 ws=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function dc(e){try{const{validate:t,dereference:n}=await Bm(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(l=>ws(l,0)),document:null};const s=(r.errors??[]).map(l=>ws(l,1)),{schema:i,errors:a}=n(e);return a!=null&&a.length&&s.push(...a.map(l=>ws(l,0))),{diagnostics:s,document:i??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Fm(e,t){const{diagnostics:n,document:r}=await dc(e);return{diagnostics:n,view:r?o.jsx(Mo,{kind:"resolved",openapi:r,config:t}):null}}function zm({raw:e,config:t,onDiagnostics:n,errorFallback:r,onError:s}){const[i,a]=b.useState(null),l=b.useRef(n);return l.current=n,b.useEffect(()=>{let c=!0;return dc(e).then(({document:u,diagnostics:d})=>{var p;c&&(a(u),(p=l.current)==null||p.call(l,d))}),()=>{c=!1}},[e]),i?o.jsx(Mo,{kind:"resolved",openapi:i,config:t,errorFallback:r,onError:s}):null}function fc(e,t,n){return function({document:s,config:i,children:a}){const l=b.useContext(Sr),c=b.useMemo(()=>s?Cn(s):null,[s]),u=!!l&&l.specType!==n;if(b.useEffect(()=>{u&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${l.specType} document provider, which cannot supply the document it needs. `+(c?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[l,u,c]),l&&!u)return o.jsx(o.Fragment,{children:a});if(!c){if(l)return o.jsx(o.Fragment,{children:a});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:c,config:i,children:a})}}function Um({document:e,config:t,children:n}){const r=b.useMemo(()=>Cn(e),[e]);return o.jsx(Vs,{document:r,config:t,children:n})}const Fn=fc(Vs,"AsyncAPI","asyncapi");function zn(){const e=$e();return e.specType==="asyncapi",e.document}function Hm(){const e=zn();return!e.servers||Object.keys(e.servers).length===0?null:o.jsx(Yl,{servers:e.servers})}function Gm(e){return o.jsx(Fn,{...e,children:o.jsx(Hm,{})})}function Wm(){const e=zn(),[t,n]=b.useState(null);return o.jsx(Jl,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function qm(e){return o.jsx(Fn,{...e,children:o.jsx(Wm,{})})}function Vm(){var t;const e=zn();return o.jsx(zl,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function Km(e){return o.jsx(Fn,{...e,children:o.jsx(Vm,{})})}function Ym(){var t;const e=zn();return o.jsx($r,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function Zm(e){return o.jsx(Fn,{...e,children:o.jsx(Ym,{})})}function Xm(){const e=zn();return e.info?o.jsx(jl,{...e.info}):null}function Qm(e){return o.jsx(Fn,{...e,children:o.jsx(Xm,{})})}function Jm({document:e,config:t,children:n}){const r=b.useMemo(()=>Cn(e),[e]);return o.jsx(Oo,{document:r,config:t,children:n})}const Un=fc(Oo,"OpenAPI","openapi");function Hn(){const e=qs();return e.specType==="openapi",e.document}function eg(){const e=Hn();return!e.servers||e.servers.length===0?null:o.jsx(tc,{servers:e.servers})}function tg(e){return o.jsx(Un,{...e,children:o.jsx(eg,{})})}function ng(){var r;const e=Hn(),[t,n]=b.useState(null);return o.jsx(jr,{paths:e.paths??{},security:e.security,securitySchemes:(r=e.components)==null?void 0:r.securitySchemes,selectedKey:t,onSelectKey:n})}function rg(e){return o.jsx(Un,{...e,children:o.jsx(ng,{})})}function sg(){var s;const e=Hn(),[t,n]=b.useState(null),r=e.webhooks??{};return Object.keys(r).length===0?null:o.jsx(jr,{paths:r,security:e.security,securitySchemes:(s=e.components)==null?void 0:s.securitySchemes,selectedKey:t,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook"})}function og(e){return o.jsx(Un,{...e,children:o.jsx(sg,{})})}function ig(){var t;const e=Hn();return o.jsx($r,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function ag(e){return o.jsx(Un,{...e,children:o.jsx(ig,{})})}function lg(){const e=Hn();return e.info?o.jsx(ec,{info:e.info,tags:e.tags,externalDocs:e.externalDocs}):null}function cg(e){return o.jsx(Un,{...e,children:o.jsx(lg,{})})}exports.AsyncAPI=Ro;exports.AsyncAPIProvider=Um;exports.AsyncAPIRenderer=Dm;exports.CodeBlock=No;exports.ErrorBoundary=Ws;exports.HighlightJS=ft;exports.Info=Qm;exports.Messages=Km;exports.OpenAPI=Mo;exports.OpenAPIEndpoints=rg;exports.OpenAPIInfo=cg;exports.OpenAPIProvider=Jm;exports.OpenAPIRenderer=zm;exports.OpenAPISchemas=ag;exports.OpenAPIServers=tg;exports.OpenAPIWebhooks=og;exports.Operations=qm;exports.SchemaTabs=zt;exports.SchemaTree=Co;exports.Schemas=Zm;exports.Servers=Gm;exports.X_LIB_CONVERSION_ERROR=br;exports.asyncApiOperationToMarkdown=lo;exports.asyncApiToMarkdown=ao;exports.commonjsGlobal=sf;exports.defaultConfig=nn;exports.documentToLlmsTxt=_m;exports.documentToMarkdown=Tm;exports.getAugmentedNamespace=of;exports.getDefaultExportFromCjs=fo;exports.isProtobufSchemaFormat=On;exports.listDocumentTargets=Nm;exports.openApiEndpointToMarkdown=uo;exports.openApiToMarkdown=co;exports.parseAndRender=Lm;exports.parseAndRender$1=Fm;exports.registerSchemaParserWithFallback=cc;exports.targetSlug=lc;exports.useAsyncAPIDocument=$e;exports.useDocumentContext=qs;
|