apiuikit 0.2.1 → 0.3.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/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +16 -9
- package/dist/components/Bindings.d.ts +3 -1
- package/dist/components/Navigation.d.ts +11 -4
- package/dist/components/SearchPanel.d.ts +9 -0
- package/dist/components/schema/SchemaNode.d.ts +10 -1
- package/dist/components/schema/SchemaTab.d.ts +3 -1
- package/dist/components/schema/SchemaTree.d.ts +5 -1
- package/dist/components/schema/SchemaTreeRow.d.ts +2 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/containers/AsyncAPI/AsyncAPIDocumentProvider.d.ts +12 -0
- package/dist/containers/AsyncAPI/tests/searchHighlight.test.d.ts +1 -0
- package/dist/containers/Messages/MessageDetails.d.ts +3 -1
- package/dist/containers/Messages/Messages.d.ts +3 -1
- package/dist/containers/Operation/Operation.d.ts +3 -1
- package/dist/containers/Operation/Operations.d.ts +3 -1
- package/dist/containers/Schema/Schemas.d.ts +6 -1
- package/dist/containers/Server/Server.d.ts +8 -1
- package/dist/containers/Server/Servers.d.ts +7 -3
- package/dist/helpers/protobuf/lazyProtoToJsonSchema.d.ts +14 -0
- package/dist/helpers/schemaFormat.d.ts +3 -0
- package/dist/helpers/searchIndex.d.ts +18 -0
- package/dist/helpers/textHighlight.d.ts +2 -0
- package/dist/hooks/useSpecSearch.d.ts +13 -0
- package/dist/icons/Server.d.ts +4 -3
- package/dist/index-Bad1aEIj.js +11352 -0
- package/dist/{index-yG3rYT_D.js → index-CzcxQGxP.js} +1 -1
- package/dist/{index-DqcOEYz_.cjs → index-D7GelPk0.cjs} +1 -1
- package/dist/index-gn5KpvCL.cjs +73 -0
- package/dist/index.d.ts +2 -0
- package/dist/protoToJsonSchema-8Mm10CIx.cjs +83 -0
- package/dist/protoToJsonSchema-BJpwl2Am.js +6174 -0
- package/dist/protobufSchemaParser-Cj2WOp05.js +55 -0
- package/dist/protobufSchemaParser-D_2rEsD4.cjs +1 -0
- package/dist/public/sections.d.ts +42 -0
- package/dist/public/tests/sections.test.d.ts +1 -0
- package/dist/stories/Authorization.stories.d.ts +13 -0
- package/dist/stories/Bindings.stories.d.ts +12 -0
- package/dist/stories/ChannelAddress.stories.d.ts +13 -0
- package/dist/stories/CodeBlock.stories.d.ts +11 -0
- package/dist/stories/Examples.stories.d.ts +11 -0
- package/dist/stories/Information.stories.d.ts +1 -0
- package/dist/stories/Message.stories.d.ts +11 -0
- package/dist/stories/Messages.stories.d.ts +10 -0
- package/dist/stories/Operation.stories.d.ts +10 -0
- package/dist/stories/Operations.stories.d.ts +10 -0
- package/dist/stories/SchemaTab.stories.d.ts +11 -0
- package/dist/stories/SearchPanel.stories.d.ts +16 -0
- package/dist/stories/Server.stories.d.ts +3 -1
- package/dist/stories/TabToggle.stories.d.ts +10 -0
- package/dist/stories/Tabs.stories.d.ts +11 -0
- package/dist/stories/documentContextDecorator.d.ts +25 -0
- package/package.json +2 -3
- package/dist/index-BYmrdiVi.cjs +0 -155
- package/dist/index-DfH4J5EL.js +0 -15436
- package/dist/stories/Button.d.ts +0 -14
- package/dist/stories/Button.stories.d.ts +0 -23
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";var Al=Object.defineProperty;var El=(e,t,n)=>t in e?Al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>El(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),N=require("react"),Do=require("react-dom"),Ks=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Js=(e,t)=>{const n=t.length>0?t:Ks,s=(e%n.length+n.length)%n.length;return n[s]},Qs={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:Ks},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!1}},Bo=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",_r=e=>typeof e=="object"&&e!==null,kl=e=>e.replace(/^#\//,"").split("/").pop()??e,Fo=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Bo(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(s=>Fo(s,t))),jl=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let s=e;for(const r of n){if(!_r(s)&&!Array.isArray(s))return;const i=r.replace(/~1/g,"/").replace(/~0/g,"~");if(s=s[i],s==null)return}return s};function Gs(e){if(!Fo(e))return e;const t=new Map,n=new Set,s=r=>{if(Array.isArray(r)){const i=t.get(r);if(i!==void 0)return i;const a=[];t.set(r,a),n.add(r);try{for(const l of r)a.push(s(l))}finally{n.delete(r)}return a}if(Bo(r)){const i=jl(e,r.$ref),a=_r(i)||Array.isArray(i);if(a&&!n.has(i)){const l=s(i);return _r(l)&&l["x-parser-schema-id"]===void 0&&(l["x-parser-schema-id"]=kl(r.$ref)),l}if(i!==void 0&&!a)return i}if(_r(r)){const i=t.get(r);if(i!==void 0)return i;const a={};t.set(r,a),n.add(r);try{for(const[l,c]of Object.entries(r))a[l]=s(c)}finally{n.delete(r)}return a}return r};return s(e)}const ei=N.createContext(null),St=()=>{const e=N.useContext(ei);if(!e)throw new Error("useAsyncAPIDocument must be used within an AsyncAPIDocumentProvider");return e},Sl="Contact",Nl="Email",Ui="License",Wi="External Documentation",Tl="Tags",_l="Implicit",Cl=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
|
+
for native apps and JavaScript apps where the access token is returned
|
|
3
|
+
immediately without an extra authorization code exchange step.`,Ol="Client Credentials",Il="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",Ml="Password",Rl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",Ll="Authorization Code",Pl="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Dl="Connecting to a server",Bl="",$i=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],Fl=[50,100,200,300,500,600,700],zl={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"}};function zo(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),s=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return`${n} ${s} ${r}`}function hs(e,t,n){if(e)for(const s of Fl){const r=e[s];r&&(n[`--color-${t}-${s}`]=zo(r))}}const Hl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Ul={50:"15 23 42",100:"30 41 59",200:"51 65 85",300:"71 85 105",500:"148 163 184",600:"203 213 225",700:"226 232 240",800:"241 245 249",900:"248 250 252"};function Wl(e){const t={},n=e.light?"light":e.dark?"dark":null,s=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[r,i]of Object.entries(Ul))t[`--color-neutral-${r}`]=i;if(s)for(const[r,i]of Hl){const a=s[r];a&&(t[i]=zo(a))}return e.colors&&(hs(e.colors.primary,"primary",t),hs(e.colors.secondary,"secondary",t),hs(e.colors.neutral,"neutral",t)),t}const $l=e=>typeof e=="object"&&e!==null;function ti({document:e,config:t=Qs,className:n="",children:s}){var v,E,k;const r=N.useMemo(()=>new Map,[]),[i,a]=N.useState(null),[l,c]=N.useState(null);N.useEffect(()=>{r.clear()},[e,r]);const u=N.useCallback(C=>{if(r.has(C))return r.get(C);const j=C.replace(/^#\//,"").split("/");let w=e;for(const y of j){if(!$l(w)){w=void 0;break}const M=y.replace(/~1/g,"/").replace(/~0/g,"~");if(w=w[M],w==null)break}return w!==void 0&&r.set(C,w),w},[e,r]),d=((v=t.expand)==null?void 0:v.schemas)===!0,f=(k=(E=t.theme)==null?void 0:E.depthColors)!=null&&k.length?t.theme.depthColors:Ks,m=N.useMemo(()=>({document:e,deref:u,portalHost:i,rootElement:l,defaultSchemaExpanded:d,depthColors:f}),[e,u,i,l,d,f]),g=t.theme?Wl(t.theme):{};return o.jsx(ei.Provider,{value:m,children:o.jsxs("div",{ref:c,style:g,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[o.jsx("div",{ref:a,className:"asyncapi-portal-root"}),s]})})}function pn({title:e,content:t,sideContent:n,stickySideContent:s=!1,info:r=!1,reverseLayoutOnMobile:i=!1}){return o.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[e&&o.jsx("h1",{className:`${r?"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:`${s&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Sn(...e){return e.filter(Boolean).join(" ")}function ni({tabs:e,current:t,onChange:n=()=>{},ariaLabel:s="Tabs",selectLabel:r="Select a tab"}){var d;const i=N.useId(),a=N.useRef([]),l=t??((d=e[0])==null?void 0:d.id)??"",c=e.some(f=>!!f.icon),u=(f,m)=>{var E;if(e.length===0)return;const g=k=>(k+e.length)%e.length;let v=m;if(f.key==="ArrowRight"&&(f.preventDefault(),v=g(m+1)),f.key==="ArrowLeft"&&(f.preventDefault(),v=g(m-1)),f.key==="Home"&&(f.preventDefault(),v=0),f.key==="End"&&(f.preventDefault(),v=e.length-1),v!==m){const k=e[v];n(k.id),(E=a.current[v])==null||E.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:"@sm:hidden",children:[o.jsx("label",{htmlFor:i,className:"sr-only",children:r}),o.jsx("select",{id:i,name:"tabs",value:l,onChange:f=>n(f.target.value),className:Sn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",c?"mt-0":"mt-4"),children:e.map(f=>o.jsx("option",{value:f.id,children:f.name},f.id))})]}),o.jsx("div",{className:Sn("hidden @sm:block",c?"":"mt-6"),children:c?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":s,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((f,m)=>{const g=f.id===t,v=f.icon;return o.jsx("button",{ref:E=>{a.current[m]=E},id:`tab-${f.id}`,type:"button",role:"tab",tabIndex:g?0:-1,"aria-selected":g,"aria-controls":`panel-${f.id}`,onClick:()=>n(f.id),onKeyDown:E=>u(E,m),className:Sn("border-b-2 px-1 py-3 text-sm font-semibold transition-colors",g?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[v?o.jsx(v,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:f.name})]})},f.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":s,children:e.map((f,m)=>{const g=f.id===t;return o.jsxs("button",{ref:v=>{a.current[m]=v},id:`tab-${f.id}`,type:"button",role:"tab",tabIndex:g?0:-1,"aria-selected":g,"aria-controls":`panel-${f.id}`,onClick:()=>n(f.id),onKeyDown:v=>u(v,m),className:Sn(g?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",m===0?"rounded-l-lg":"",m===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 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:f.name}),o.jsx("span",{"aria-hidden":"true",className:Sn(g?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},f.id)})})})]}):null}function Vl({tabs:e,current:t,onChange:n}){if(!e.length)return null;const s=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(ni,{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(pn,{content:s,stickySideContent:!1})})}const ql=({isCollapsed:e})=>o.jsxs("svg",{width:22,height:22,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.jsx("path",{d:"M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"}),o.jsx("rect",{className:`panel-icon-rect ${e?"panel-icon-rect-collapsed":""}`,x:"2",y:"3",height:"10",rx:"1"})]});function Xl(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Zl(e){let t=e;for(;t&&t!==document.body;){if(Xl(t))return t;t=t.parentElement}return document.documentElement}function Yl(e){const t=e.style.overflow,n=e.style.paddingRight,s=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",s>0){const r=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${r+s}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function Ho(e,t){const[n,s]=N.useState(null);return N.useLayoutEffect(()=>{if(!e||!t){s(null);return}let r=null;const i=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null,s(e.getBoundingClientRect())}))};s(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{r!==null&&cancelAnimationFrame(r),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),n}const Uo=N.forwardRef(function({isOpen:t,side:n,onClose:s,title:r,children:i,width:a="w-[50rem]"},l){N.useEffect(()=>{const v=E=>{E.key==="Escape"&&s()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[s]);const c=n==="right"?"translate-x-full":"-translate-x-full",u=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:f}=St();N.useEffect(()=>{if(!(!t||!d))return Yl(Zl(d))},[t,d]);const m=Ho(f,!0),g=m?{position:"fixed",top:0,left:m.left,width:m.width,height:"100vh"}:{position:"fixed",inset:0};return d?Do.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...g,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:s,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:l,className:`absolute top-0 ${u} h-full ${a} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":c}`,children:[r&&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 r=="string"?o.jsx("span",{className:"truncate block",children:r}):r}),o.jsx("button",{onClick:s,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:i})]})]}),d):null});function Wo({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 $o({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"})]})}function Vo({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 Kl({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"})})}var Qt=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Qt||{});function Jl(e,t){const[n,s]=N.useState("docked"),r=N.useRef(t);return r.current=t,N.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?s("docked"):r.current||d>0?s("pinned"):d<0?s("hidden"):s(f=>f==="docked"?"hidden":f)},c=()=>{a===null&&(a=requestAnimationFrame(l))};return l(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),N.useEffect(()=>{t&&s(i=>i==="hidden"?"pinned":i)},[t]),n}function Ql(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((s,r)=>o.jsxs(N.Fragment,{children:[o.jsx("code",{children:s}),", "," "]},r)),n=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function Gl(e){return e.map(t=>`\`${t}\``).join(", ")}function ec(e){const t=[],n=/\{([^}]+)\}/g;let s=0,r;for(;(r=n.exec(e))!==null;)r.index>s&&t.push({type:"text",value:e.slice(s,r.index)}),t.push({type:"param",value:r[1]}),s=r.index+r[0].length;return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}function Zn({address:e,parameters:t,className:n="text-xs",truncate:s=!1}){const{portalHost:r}=St(),[i,a]=N.useState(null),[l,c]=N.useState({top:0,left:0,placement:"top"}),[u,d]=N.useState(!1),f=N.useRef(null),m=ec(e);let g=0;const v=40;N.useEffect(()=>{if(!s)return;const j=f.current;if(!j)return;const w=()=>d(j.scrollWidth>j.clientWidth);w();const y=new ResizeObserver(w);return y.observe(j),()=>y.disconnect()},[s,e]);const E=(j,w)=>{const y=w.getBoundingClientRect(),M=y.top<v?"bottom":"top";c({top:M==="top"?y.top-8:y.bottom+8,left:y.left+y.width/2,placement:M}),a(j)},k=()=>a(null),C=m.map((j,w)=>{if(j.type==="text")return o.jsx("span",{children:j.value},w);const y=t==null?void 0:t[j.value],M=$i[g++%$i.length],S=i===w,_=!!y&&(y.description||y.default||y.enum&&y.enum.length>0||y.examples&&y.examples.length>0),K=`channel-address-tooltip-${w}`,A=_&&S?K:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:B=>_&&E(w,B.currentTarget),onMouseLeave:k,children:[o.jsx("span",{className:`font-semibold ${M} ${_?"cursor-help underline decoration-dotted":""}`,role:_?"button":void 0,tabIndex:_?0:void 0,"aria-expanded":_?S:void 0,"aria-describedby":A,onFocus:B=>_&&E(w,B.currentTarget),onBlur:k,onKeyDown:B=>{_&&((B.key==="Enter"||B.key===" ")&&(B.preventDefault(),E(w,B.currentTarget)),B.key==="Escape"&&(B.preventDefault(),k(),B.currentTarget.blur()))},children:`{${j.value}}`}),_&&S&&r&&Do.createPortal(o.jsxs("div",{id:K,className:`fixed -translate-x-1/2 max-w-xs px-2.5 py-1.5 bg-neutral-50 text-foreground-muted text-xs rounded pointer-events-none z-[60] shadow-lg text-left leading-snug ${l.placement==="top"?"-translate-y-full":""}`,style:{top:l.top,left:l.left},children:[y.description&&o.jsx("div",{children:y.description}),y.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:y.default})]}),y.enum&&y.enum.length>0&&o.jsx("div",{className:"mt-1",children:Ql(y.enum)}),y.examples&&y.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",y.examples.join(", ")]})]}),r)]},w)});return s?o.jsxs("code",{className:`px-2 py-1 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:C}),u&&o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):o.jsx("code",{className:`px-2 py-1 rounded text-foreground-secondary break-all ${n}`,children:C})}function tc({info:e,operations:t={},messages:n={},schemas:s={},servers:r={},activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const[f,m]=N.useState(!1),[g,v]=N.useState(0),[E,k]=N.useState(null),{rootElement:C}=St(),j=Jl(C,f),w=j!=="docked",y=Ho(C,w),S={transform:`translate(${f&&g?g-2:0}px, ${j==="hidden"?"-150%":"0px"})`,...w?{position:"fixed",top:10,left:((y==null?void 0:y.left)??0)+12,pointerEvents:j==="hidden"?"none":void 0}:{}};N.useEffect(()=>{if(!E)return;const X=new ResizeObserver(([le])=>v(le.contentRect.width));return X.observe(E),()=>X.disconnect()},[E]);const _=X=>{var se;return d!=null&&d.useChannelAddressAsIdentifier?((se=t[X])==null?void 0:se.channel)??null:null},K=[{id:"servers",label:"Servers",icon:Kl,items:Object.keys(r)},{id:"operations",label:"Operations",icon:Wo,items:Object.keys(t)},{id:"messages",label:"Messages",icon:$o,items:Object.keys(n)},{id:"schemas",label:"Schemas",icon:Vo,items:Object.keys(s)}],A=X=>X!=="servers",B=(X,le)=>{A(X)&&a(X),le&&setTimeout(()=>{var se;(se=document.getElementById(le))==null||se.scrollIntoView({behavior:"smooth",block:"start"})},50)};return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>m(X=>!X),title:f?"Close navigation":"Open navigation",className:"panel-toggle-btn bg-neutral-100",style:S,children:o.jsx(ql,{isCollapsed:f})}),o.jsx(Uo,{ref:k,isOpen:f,side:"left",onClose:()=>m(!1),width:"min-w-[450px] w-auto",children:o.jsxs("nav",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2 pb-4 mb-2 border-b border-border",children:[o.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:e.title}),e.version&&o.jsxs("span",{className:"shrink-0 text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:["v",e.version]})]}),K.map(({id:X,label:le,icon:se,items:Ee})=>{const fe=i===X;if(!(Ee.length<1))return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>B(X),className:`flex items-center gap-2 w-full text-left px-2 py-2 rounded-md group transition-colors ${fe?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(se,{className:`w-3.5 h-3.5 shrink-0 transition-colors ${fe?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${fe?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:le}),o.jsx("span",{className:`ml-auto text-[10px] font-mono px-1.5 py-0.5 rounded transition-colors ${fe?"bg-primary-100 text-primary-500 border border-primary-200":"bg-neutral-100 text-foreground-muted"}`,children:Ee.length})]}),Ee.length>0&&o.jsx("ul",{className:"mt-0.5 space-y-0.5 pl-3 border-l border-border ml-4",children:Ee.map(Ce=>{const ie=X==="operations"?t[Ce]:null,Te=X==="operations"?_(Ce):null,be=ie==null?void 0:ie.action,$e=be===Qt.SEND?"bg-green-100 text-green-700":be===Qt.RECEIVE?"bg-blue-100 text-blue-700":null,pe=(u==null?void 0:u.tab)===X&&(u==null?void 0:u.key)===Ce;return o.jsx("li",{children:o.jsxs("button",{onClick:()=>{B(X,`${X.slice(0,-1)}-${Ce}`),A(X)?l==null||l(X,Ce):c==null||c(Ce)},className:`w-full text-left flex items-center gap-2 text-xs py-1.5 px-2 rounded-md transition-colors ${pe?"bg-primary-50 text-primary-500 font-medium":fe?"text-foreground-secondary hover:text-foreground hover:bg-primary-50":"text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-50"}`,children:[$e&&o.jsx("span",{className:`shrink-0 text-[10px] font-medium uppercase px-1.5 py-0.5 rounded ${$e}`,children:be}),Te!=null&&Te.address?o.jsx(Zn,{address:Te.address,parameters:Te.parameters,className:"text-xs bg-transparent p-0"}):o.jsx("span",{className:"truncate",children:Ce})]})},Ce)})})]},X)})]})})]})}function nc({query:e,onQueryChange:t,results:n,onSelectResult:s}){const r=N.useRef(null),[i,a]=N.useState(!1),[l,c]=N.useState(-1),u="asyncapi-search-results";N.useEffect(()=>{e.trim()?(a(!0),c(-1)):a(!1)},[e]),N.useEffect(()=>{if(!i)return;const k=C=>{r.current&&!r.current.contains(C.target)&&a(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);const d=i&&e.trim().length>0;N.useEffect(()=>{l>=n.length&&c(n.length-1)},[l,n.length]);const f=k=>{a(!1),c(-1),s(k)},m=k=>{if(d){if(k.key==="ArrowDown"){k.preventDefault(),c(C=>n.length===0?-1:Math.min(C+1,n.length-1));return}if(k.key==="ArrowUp"){k.preventDefault(),c(C=>n.length===0?-1:C<=0?n.length-1:C-1);return}if(k.key==="Home"){k.preventDefault(),n.length>0&&c(0);return}if(k.key==="End"){k.preventDefault(),n.length>0&&c(n.length-1);return}if(k.key==="Enter"&&l>=0&&n[l]){k.preventDefault(),f(n[l]);return}if(k.key==="Escape"){k.preventDefault(),a(!1),c(-1);return}}},g=k=>`asyncapi-search-result-${k}`,v=d?`${n.length} result${n.length===1?"":"s"} found`:"",E=o.jsxs("div",{className:"relative mb-4",ref:r,children:[o.jsx("input",{id:"asyncapi-search",type:"search",value:e,onChange:k=>t(k.target.value),onFocus:()=>{e.trim()&&a(!0)},onKeyDown:m,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":d,"aria-controls":u,"aria-autocomplete":"list","aria-activedescendant":l>=0?g(l):void 0,className:"w-full rounded-lg border border-border bg-surface px-4 py-2 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none focus:ring-1 focus:ring-primary-300"}),o.jsx("div",{"aria-live":"polite",className:"sr-only",children:v}),d&&o.jsx("div",{id:u,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-2 max-h-80 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((k,C)=>o.jsx("li",{children:o.jsxs("button",{id:g(C),type:"button",role:"option","aria-selected":l===C,onClick:()=>f(k),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===C?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:k.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:k.location}),k.subtitle&&o.jsxs("span",{children:["• ",k.subtitle]})]})]})},k.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})})]});return o.jsx("div",{children:o.jsx(pn,{content:E,sideContent:null,stickySideContent:!1,reverseLayoutOnMobile:!0,info:!0})})}function Gt(e){return Array.isArray?Array.isArray(e):Xo(e)==="[object Array]"}function rc(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ss(e){return e==null?"":rc(e)}function Xe(e){return typeof e=="string"}function Cr(e){return typeof e=="number"}function sc(e){return e===!0||e===!1||ic(e)&&Xo(e)=="[object Boolean]"}function qo(e){return typeof e=="object"}function ic(e){return qo(e)&&e!==null}function ct(e){return e!=null}function Ar(e){return!e.trim().length}function Xo(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const oc="Incorrect 'index' type",Ns="Invalid doc index: must be a non-negative integer within the bounds of the docs array",ac=e=>`Invalid value for key ${e}`,lc=e=>`Pattern length exceeds max of ${e}.`,cc=e=>`Missing ${e} property in key`,uc=e=>`Property 'weight' in key '${e}' must be a positive integer`,dc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Vi=Object.prototype.hasOwnProperty;var fc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const s=Zo(n);this._keys.push(s),this._keyMap[s.id]=s,t+=s.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 Zo(e){let t=null,n=null,s=null,r=1,i=null;if(Xe(e)||Gt(e))s=e,t=qi(e),n=Or(e);else{if(!Vi.call(e,"name"))throw new Error(cc("name"));const a=e.name;if(s=a,Vi.call(e,"weight")&&e.weight!==void 0&&(r=e.weight,r<=0))throw new Error(uc(Or(a)));t=qi(a),n=Or(a),i=e.getFn??null}return{path:t,id:n,weight:r,src:s,getFn:i}}function qi(e){return Gt(e)?e:e.split(".")}function Or(e){return Gt(e)?e.join("."):e}function pc(e,t){const n=[];let s=!1;const r=(i,a,l,c)=>{if(ct(i))if(!a[l])n.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!ct(u))return;if(l===a.length-1&&(Xe(u)||Cr(u)||sc(u)||typeof u=="bigint"))n.push(c!==void 0?{v:Ss(u),i:c}:Ss(u));else if(Gt(u)){s=!0;for(let d=0,f=u.length;d<f;d+=1)r(u[d],a,l+1,d)}else a.length&&r(u,a,l+1,c)}};return r(e,Xe(t)?t.split("."):t,0),s?n:n[0]}const hc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},mc={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},gc={location:0,threshold:.6,distance:100},xc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:pc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Q=Object.freeze({...mc,...hc,...gc,...xc});function bc(e){return e>=9&&e<=13||e===32||e===160}function yc(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(r){let i=0,a=!1;for(let c=0;c<r.length;c++)bc(r.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const l=Math.round(s/Math.pow(i,.5*e))/s;return n.set(i,l),l},clear(){n.clear()}}}var ri=class{constructor({getFn:e=Q.getFn,fieldNormWeight:t=Q.fieldNormWeight}={}){this.norm=yc(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,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(Xe(this.docs[0]))for(let n=0;n<e;n++){const s=this._createStringRecord(this.docs[n],n);s&&(this.records[t++]=s)}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(Ns);if(Xe(e)){const s=this._createStringRecord(e,t);return s&&this.records.push(s),s}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(Ns);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 s of e)Number.isInteger(s)&&s>=0&&t.add(s);if(t.size===0)return;this.records=this.records.filter(s=>!t.has(s.i));const n=Array.from(t).sort((s,r)=>s-r);for(const s of this.records){let r=0,i=n.length;for(;r<i;){const a=r+i>>>1;n[a]<s.i?r=a+1:i=a}s.i-=r}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ct(e)||Ar(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let s=0,r=this.keys.length;s<r;s++){const i=this.keys[s],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ct(a)){if(Gt(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(ct(d)){if(Xe(d)){if(!Ar(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(ct(d.v)){const f=Xe(d.v)?d.v:Ss(d.v);if(!Ar(f)){const m={v:f,i:d.i,n:this.norm.get(f)};l.push(m)}}}}n.$[s]=l}else if(Xe(a)&&!Ar(a)){const l={v:a,n:this.norm.get(a)};n.$[s]=l}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function Yo(e,t,{getFn:n=Q.getFn,fieldNormWeight:s=Q.fieldNormWeight}={}){const r=new ri({getFn:n,fieldNormWeight:s});return r.setKeys(e.map(Zo)),r.setSources(t),r.create(),r}function vc(e,{getFn:t=Q.getFn,fieldNormWeight:n=Q.fieldNormWeight}={}){const{keys:s,records:r}=e,i=new ri({getFn:t,fieldNormWeight:n});return i.setKeys(s),i.setIndexRecords(r),i}function wc(e=[],t=Q.minMatchCharLength){const n=[];let s=-1,r=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&s===-1?s=i:!l&&s!==-1&&(r=i-1,r-s+1>=t&&n.push([s,r]),s=-1)}return e[i-1]&&i-s>=t&&n.push([s,i-1]),n}function Ac(e,t,n,{location:s=Q.location,distance:r=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(lc(32));const d=t.length,f=e.length,m=Math.max(0,Math.min(s,f));let g=i,v=m;const E=(A,B)=>{const X=A/d;if(u)return X;const le=Math.abs(m-B);return r?X+le/r:le?1:X},k=l>1||c,C=k?Array(f):[];let j;for(;(j=e.indexOf(t,v))>-1;){const A=E(0,j);if(g=Math.min(A,g),v=j+d,k){let B=0;for(;B<d;)C[j+B]=1,B+=1}}v=-1;let w=[],y=1,M=0,S=d+f;const _=1<<d-1;for(let A=0;A<d;A+=1){let B=0,X=S;for(;B<X;)E(A,m+X)<=g?B=X:S=X,X=Math.floor((S-B)/2+B);S=X;let le=Math.max(1,m-X+1);const se=a?f:Math.min(m+X,f)+d,Ee=Array(se+2);Ee[se+1]=(1<<A)-1;for(let fe=se;fe>=le;fe-=1){const Ce=fe-1,ie=n[e[Ce]];if(Ee[fe]=(Ee[fe+1]<<1|1)&ie,A&&(Ee[fe]|=(w[fe+1]|w[fe])<<1|1|w[fe+1]),Ee[fe]&_&&(y=E(A,Ce),y<=g)){if(g=y,v=Ce,M=A,v<=m)break;le=Math.max(1,2*m-v)}}if(E(A+1,m)>g)break;w=Ee}if(k&&v>=0){const A=Math.min(f-1,v+d-1+M);for(let B=v;B<=A;B+=1)n[e[B]]&&(C[B]=1)}const K={isMatch:v>=0,score:Math.max(.001,y)};if(k){const A=wc(C,l);A.length?c&&(K.indices=A):K.isMatch=!1}return K}function Ec(e){const t={};for(let n=0,s=e.length;n<s;n+=1){const r=e.charAt(n);t[r]=(t[r]||0)|1<<s-n-1}return t}function si(e){if(e.length<=1)return e;e.sort((n,s)=>n[0]-s[0]||n[1]-s[1]);const t=[e[0]];for(let n=1,s=e.length;n<s;n+=1){const r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}const Ko={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},kc=new RegExp("["+Object.keys(Ko).join("")+"]","g"),Yn=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(kc,t=>Ko[t]):e=>e;var ii=class{constructor(e,{location:t=Q.location,threshold:n=Q.threshold,distance:s=Q.distance,includeMatches:r=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:s,includeMatches:r,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?Yn(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(m,g)=>{this.chunks.push({pattern:m,alphabet:Ec(m),startIndex:g})},f=this.pattern.length;if(f>32){let m=0;const g=f%32,v=f-g;for(;m<v;)d(this.pattern.substr(m,32),m),m+=32;if(g){const E=f-32;d(this.pattern.substr(E),E)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:s}=this.options;if(e=t?e:e.toLowerCase(),e=n?Yn(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const v={isMatch:!0,score:0};return s&&(v.indices=[[0,e.length-1]]),v}const{location:r,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let f=0,m=!1;this.chunks.forEach(({pattern:v,alphabet:E,startIndex:k})=>{const{isMatch:C,score:j,indices:w}=Ac(e,v,E,{location:r+k,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:s,ignoreLocation:u});C&&(m=!0),f+=j,C&&w&&d.push(...w)});const g={isMatch:m,score:m?f/this.chunks.length:1};return m&&s&&(g.indices=si(d)),g}};const jc=new Set(["fuzzy","include"]);function Sc(e){return e.startsWith("inverse")}const Ts=[{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,s;const r=[],i=e.length;for(;(s=t.indexOf(e,n))>-1;)n=s+i,r.push([s,n-1]);const a=!!r.length;return{isMatch:a,score:a?0:1,indices:r}}})},{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 ii(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(s){return n.searchIn(s)}}}}],Xi=Ts.length,Nc="\0",Tc="|";function _c(e){const t=[],n=e.length;let s=0;for(;s<n;){for(;s<n&&e[s]===" ";)s++;if(s>=n)break;let r=s;for(;r<n&&e[r]!==" "&&e[r]!=='"';)r++;if(r<n&&e[r]==='"'){for(r++;r<n;){if(e[r]==='"'){const i=r+1;if(i>=n||e[i]===" "){r++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){r+=2;break}}r++}t.push(e.substring(s,r)),s=r}else{for(;r<n&&e[r]!==" ";)r++;t.push(e.substring(s,r)),s=r}}return t}function Zi(e,t){const n=e.match(t);return n?n[1]:null}function Cc(e,t={}){return e.replace(/\\\|/g,Nc).split(Tc).map(n=>{const s=_c(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),r=[];for(let i=0,a=s.length;i<a;i+=1){const l=s[i];let c=!1,u=-1;for(;!c&&++u<Xi;){const d=Ts[u],f=Zi(l,d.multiRegex);f&&(r.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Xi;){const d=Ts[u],f=Zi(l,d.singleRegex);if(f){r.push(d.create(f,t));break}}}return r})}var Oc=class{constructor(e,{isCaseSensitive:t=Q.isCaseSensitive,ignoreDiacritics:n=Q.ignoreDiacritics,includeMatches:s=Q.includeMatches,minMatchCharLength:r=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:s,minMatchCharLength:r,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?Yn(e):e,this.pattern=e,this.query=Cc(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:r}=this.options;e=s?e:e.toLowerCase(),e=r?Yn(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const f=t[u];a.length=0,i=0,c=!1;for(let m=0,g=f.length;m<g;m+=1){const v=f[m],{isMatch:E,indices:k,score:C}=v.search(e);if(E)i+=1,l+=C,Sc(v.type)&&(c=!0),n&&(jc.has(v.type)?a.push(...k):a.push(k));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const m={isMatch:!0,score:l/i};return c&&(m.hasInverse=!0),n&&(m.indices=si(a)),m}}return{isMatch:!1,score:1}}};const _s=[];function oi(...e){_s.push(...e)}function Lr(e,t){for(let n=0,s=_s.length;n<s;n+=1){const r=_s[n];if(r.condition(e,t))return new r(e,t)}return new ii(e,t)}const Pr={AND:"$and",OR:"$or"},Cs={PATH:"$path",PATTERN:"$val"},Os=e=>!!(e[Pr.AND]||e[Pr.OR]),Ic=e=>!!e[Cs.PATH],Mc=e=>!Gt(e)&&qo(e)&&!Os(e),Yi=e=>({[Pr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Jo(e,t,{auto:n=!0}={}){const s=r=>{if(Xe(r)){const c={keyId:null,pattern:r};return n&&(c.searcher=Lr(r,t)),c}const i=Object.keys(r),a=Ic(r);if(!a&&i.length>1&&!Os(r))return s(Yi(r));if(Mc(r)){const c=a?r[Cs.PATH]:i[0],u=a?r[Cs.PATTERN]:r[c];if(!Xe(u))throw new Error(ac(c));const d={keyId:Or(c),pattern:u};return n&&(d.searcher=Lr(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=r[c];Gt(u)&&u.forEach(d=>{l.children.push(s(d))})}),l};return Os(e)||(e=Yi(e)),s(e)}function Is(e,{ignoreFieldNorm:t=Q.ignoreFieldNorm}){let n=1;return e.forEach(({key:s,norm:r,score:i})=>{const a=s?s.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:r))}),n}function Rc(e,{ignoreFieldNorm:t=Q.ignoreFieldNorm}){e.forEach(n=>{n.score=Is(n.matches,{ignoreFieldNorm:t})})}var Lc=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 s=t[e];t[e]=t[n],t[n]=s,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let s=e;do{e=s;const r=2*e+1,i=2*e+2;if(r<n&&this.comparator(t[r],t[s])>0&&(s=r),i<n&&this.comparator(t[i],t[s])>0&&(s=i),s!==e){const a=t[e];t[e]=t[s],t[s]=a}}while(s!==e)}};function Pc(e){const t=[];return e.matches.forEach(n=>{if(!ct(n.indices)||!n.indices.length)return;const s={indices:n.indices,value:n.value};n.key&&(s.key=n.key.id),n.idx>-1&&(s.refIndex=n.idx),t.push(s)}),t}function Dc(e,t,{includeMatches:n=Q.includeMatches,includeScore:s=Q.includeScore}={}){return e.map(r=>{const{idx:i}=r,a={item:t[i],refIndex:i};return n&&(a.matches=Pc(r)),s&&(a.score=r.score),a})}const Bc=/[\p{L}\p{M}\p{N}_]+/gu,Ki=new WeakSet;function Fc(e){Ki.has(e)||(Ki.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 zc(e){if(typeof e=="function"){let t=!1;return n=>{const s=e(n);if(!t&&(t=!0,!Array.isArray(s)||s.some(r=>typeof r!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(s)?"array containing non-strings":typeof s}.`);return s}}return e instanceof RegExp?(e.global||Fc(e),t=>t.match(e)||[]):t=>t.match(Bc)||[]}function Ms({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const s=zc(n);return{tokenize(r){return e||(r=r.toLowerCase()),t&&(r=Yn(r)),s(r)}}}var Hc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Ms({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:s,fieldCount:r}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new ii(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=s.get(i)||0,l=Math.log(1+(r-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,s=0,r=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),f=this.idfWeights[u];s+=f,d.isMatch&&(r++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(r===0)return{isMatch:!1,score:1};const l=s>0?1-n/s:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=si(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function ms(e,t,n,s){const r=s.tokenize(t);if(!r.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(r);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 Qo(e,t,n,s){const{i:r,v:i,$:a}=t;if(i!==void 0){ms(e,i,r,s);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)ms(e,u.v,r,s);else ms(e,c.v,r,s)}}function Uc(e,t,n){const s={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const r of e)Qo(s,r,t,n);return s}function Wc(e,t,n,s){Qo(e,t,n,s)}function $c(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const s=e.docTermFieldHits.get(t);if(s){for(const[r,i]of s){const a=(e.df.get(r)||0)-i;a<=0?e.df.delete(r):e.df.set(r,a)}e.docTermFieldHits.delete(t)}}function Ji(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of n)$c(e,l);const s=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},r=n[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>r?s(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>r?s(l):l,c);e.docTermFieldHits=a}var en=class{constructor(e,t,n){this.options={...Q,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new fc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=Lr(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 ri))throw new Error(oc);if(this._myIndex=t||Yo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Ms({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Uc(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ct(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Ms({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Wc(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let s=0,r=this._docs.length;s<r;s+=1)e(this._docs[s],s)&&(t.push(this._docs[s]),n.push(s));if(n.length){this._invertedIndex&&Ji(this._invertedIndex,n);const s=new Set(n);this._docs=this._docs.filter((r,i)=>!s.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(Ns);this._invertedIndex&&Ji(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:s,includeScore:r,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(Xe(e)&&!e.trim()){let m=this._docs.map((g,v)=>({item:g,refIndex:v}));return Cr(n)&&n>-1&&(m=m.slice(0,n)),m}const c=i&&Cr(n)&&n>0&&Xe(e),u=a,d=(m,g)=>u(m,g)||m.idx-g.idx;let f;if(c){const m=new Lc(n,d);Xe(this._docs[0])?this._searchStringList(e,{heap:m,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:m,ignoreFieldNorm:l}),f=m.extractSorted()}else f=Xe(e)?Xe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Rc(f,{ignoreFieldNorm:l}),i&&f.sort(Xe(e)?d:u),Cr(n)&&n>-1&&(f=f.slice(0,n));return Dc(f,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const s=this._getSearcher(e),r=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!ct(l))return;const d=s.searchIn(l);if(d.isMatch){const f={score:d.score,value:l,norm:u,indices:d.indices};r&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const m=[f];if(!r||this._coversAllTokens(m)){const g={item:l,idx:c,matches:m};t?(g.score=Is(g.matches,{ignoreFieldNorm:n}),t.insert(g)):a.push(g)}}}),a}_searchLogical(e){const t=Jo(e,this.options),n=this._normalizedKeys(),s=(l,c,u)=>{if(!("children"in l)){const{keyId:g,searcher:v}=l;let E;return g===null?(E=[],n.forEach((k,C)=>{E.push(...this._findMatches({key:k,value:c[C],searcher:v}))})):E=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(c,g),searcher:v}),E&&E.length?[{idx:u,item:c,matches:E}]:[]}const{children:d,operator:f}=l,m=[];for(let g=0,v=d.length;g<v;g+=1){const E=d[g],k=s(E,c,u);if(k.length)m.push(...k);else if(f===Pr.AND)return[]}return m},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:l,i:c})=>{if(ct(l)){const u=s(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 s=this._getSearcher(e),r=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!ct(c))return;const d=[];let f=!1,m=!1;if(a.forEach((g,v)=>{const E=this._findMatches({key:g,value:c[v],searcher:s});E.length?(d.push(...E),E[0].hasInverse&&(m=!0)):f=!0}),!(m&&f)&&d.length&&(!r||this._coversAllTokens(d))){const g={idx:u,item:c,matches:d};t?(g.score=Is(g.matches,{ignoreFieldNorm:n}),t.insert(g)):l.push(g)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!ct(t))return[];const s=[];if(Gt(t))t.forEach(({v:r,i,n:a})=>{if(!ct(r))return;const l=n.searchIn(r);if(l.isMatch){const c={score:l.score,key:e,value:r,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),s.push(c)}});else{const{v:r,n:i}=t,a=n.searchIn(r);if(a.isMatch){const l={score:a.score,key:e,value:r,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),s.push(l)}}return s}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let s=0;for(let r=0;r<e.length;r++)s|=e[r].matchedMask||0;return s===2**t-1}const n=new Set;for(let s=0;s<e.length;s++){const r=e[s].matchedTerms;if(r)for(const i of r)n.add(i)}return n.size===t}};en.version="7.5.0";en.createIndex=Yo;en.parseIndex=vc;en.config=Q;en.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(dc);return Lr(e,{...Q,...n}).searchIn(t)};en.parseQuery=Jo;oi(Oc);oi(Hc);en.use=function(...e){e.forEach(t=>oi(t))};var Vc=en;const Ht=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ir=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>Ir(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,s])=>[n,Ir(s,t)]).join(" "):Ht(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,s])=>[n,Ir(s,t)]).join(" ")):"",At=e=>Ir(e).trim().replace(/\s+/g," "),qc=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Xc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Zc=e=>{if(!Ht(e))return e;const t={};for(const[n,s]of Object.entries(e))Xc.has(n)||(t[n]=s);return t},Yc=(e,t,n,s)=>{const r=`schema-${n}`,i=(l,c,u,d)=>{const f=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,m=`Schemas > ${s}${u.length?` > ${u.join(" > ")}`:""}`,g=Ht(l)?l.description:void 0,v=c.length?`${s}.${c.join(".")}`:s;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:d?qc(n,d):r,type:"schema",tab:"schemas",key:n,name:v,path:f,location:m,subtitle:g,text:At([Zc(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[])=>{if(i(l,c,u,d),!Ht(l))return;if(Ht(l.properties))for(const[m,g]of Object.entries(l.properties))a(g,[...c,"properties",m],[...u,m],d?[...d,"properties",m]:null);const f=l.items;Ht(f)?a(f,[...c,"items"],[...u,"items"],d?[...d,"items"]:null):Array.isArray(f)&&f.forEach((m,g)=>{a(m,[...c,`items[${g}]`],[...u,`items[${g}]`],null)});for(const m of["allOf","oneOf","anyOf"]){const g=l[m];Array.isArray(g)&&g.forEach((v,E)=>{a(v,[...c,`${m}[${E}]`],[...u,`${m}[${E}]`],d&&m!=="allOf"?[...d,`${m}[${E}]`]:null)})}Ht(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null)};a(t)};function Kc(e){var n,s;const t=[];if(e.info){const r=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:r,path:"info",location:"Info",subtitle:i,text:At([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[r,i]of Object.entries(e.servers)){const a=i,l=a.description??r,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${r}`,targetId:`server-${r}`,type:"server",tab:"servers",key:r,name:r,path:`servers.${r}`,location:`Servers > ${r}`,subtitle:c,text:At([r,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-${r}-security`,targetId:`server-${r}-security`,type:"server",tab:"servers",key:r,name:`${r} > Authorization`,path:`servers.${r}.security`,location:`Servers > ${r} > Authorization`,focusSection:"security",text:At(u)});const d=a.bindings,f=Ht(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${r}-bindings`,targetId:`server-${r}-bindings`,type:"server",tab:"servers",key:r,name:`${r} > ${a.protocol} configuration`,path:`servers.${r}.bindings.${a.protocol}`,location:`Servers > ${r} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:At(f)})}if(e.operations)for(const[r,i]of Object.entries(e.operations)){const a=i.title??r,l=i.summary??i.description??i.action??"";t.push({id:`operation-${r}`,targetId:`operation-${r}-detail`,type:"operation",tab:"operations",key:r,name:a,path:`operations.${r}`,location:`Operations > ${a}`,subtitle:l,text:At([r,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-${r}-security`,targetId:`operation-${r}-security`,type:"operation",tab:"operations",key:r,name:`${a} > Authorization`,path:`operations.${r}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:At(c)});const u=i.bindings;if(Ht(u))for(const[d,f]of Object.entries(u))f!=null&&t.push({id:`operation-${r}-bindings-${d}`,targetId:`operation-${r}-bindings-${d}`,type:"operation",tab:"operations",key:r,name:`${a} > ${d} configuration`,path:`operations.${r}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:At(f)})}if((n=e.components)!=null&&n.messages)for(const[r,i]of Object.entries(e.components.messages)){const a=i.title??i.name??r,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${r}`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:a,path:`components.messages.${r}`,location:`Messages > ${a}`,subtitle:l,text:At([r,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${r}-payload`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:`${a} > Payload`,path:`components.messages.${r}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:At(i.payload)}),i.headers&&t.push({id:`message-${r}-headers`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:`${a} > Headers`,path:`components.messages.${r}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:At(i.headers)})}if((s=e.components)!=null&&s.schemas)for(const[r,i]of Object.entries(e.components.schemas))Yc(t,i,r,r);return t}function Jc(e,t={}){const[n,s]=N.useState(""),[r,i]=N.useState(""),a=t.debounceMs??150;N.useEffect(()=>{const d=setTimeout(()=>i(n),a);return()=>clearTimeout(d)},[n,a]);const l=N.useMemo(()=>Kc(e),[e]),c=N.useMemo(()=>new Vc(l,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:t.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[l,t.threshold]),u=N.useMemo(()=>r.trim()?c.search(r.trim(),{limit:t.limit??20}).map(d=>d.item):[],[c,r,t.limit]);return{query:n,setQuery:s,results:u,searchIndex:l}}const Rs="search-match",Go=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Qc(e,t){const n=t.trim().toLowerCase();if(!n)return[];const s=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=r.nextNode();i;i=r.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),s.push(u),l=c+n.length}}return s}function Gc(e,t){if(!Go())return;const n=Qc(e,t);if(!n.length){CSS.highlights.delete(Rs);return}CSS.highlights.set(Rs,new Highlight(...n))}function gs(){Go()&&CSS.highlights.delete(Rs)}var eu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?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(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),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 xs,Qi;function Gi(){if(Qi)return xs;Qi=1;function e(I,R){(R==null||R>I.length)&&(R=I.length);for(var H=0,h=Array(R);H<R;H++)h[H]=I[H];return h}function t(I){if(Array.isArray(I))return I}function n(I,R){var H=I==null?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(H!=null){var h,b,T,$,Ae=[],ce=!0,z=!1;try{if(T=(H=H.call(I)).next,R!==0)for(;!(ce=(h=T.call(H)).done)&&(Ae.push(h.value),Ae.length!==R);ce=!0);}catch(F){z=!0,b=F}finally{try{if(!ce&&H.return!=null&&($=H.return(),Object($)!==$))return}finally{if(z)throw b}}return Ae}}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(I,R){return t(I)||n(I,R)||i(I,R)||s()}function i(I,R){if(I){if(typeof I=="string")return e(I,R);var H={}.toString.call(I).slice(8,-1);return H==="Object"&&I.constructor&&(H=I.constructor.name),H==="Map"||H==="Set"?Array.from(I):H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H)?e(I,R):void 0}}const a=Object.entries,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let f=Object.freeze,m=Object.seal,g=Object.create,v=typeof Reflect<"u"&&Reflect,E=v.apply,k=v.construct;f||(f=function(R){return R}),m||(m=function(R){return R}),E||(E=function(R,H){for(var h=arguments.length,b=new Array(h>2?h-2:0),T=2;T<h;T++)b[T-2]=arguments[T];return R.apply(H,b)}),k||(k=function(R){for(var H=arguments.length,h=new Array(H>1?H-1:0),b=1;b<H;b++)h[b-1]=arguments[b];return new R(...h)});const C=pe(Array.prototype.forEach),j=pe(Array.prototype.lastIndexOf),w=pe(Array.prototype.pop),y=pe(Array.prototype.push),M=pe(Array.prototype.splice),S=Array.isArray,_=pe(String.prototype.toLowerCase),K=pe(String.prototype.toString),A=pe(String.prototype.match),B=pe(String.prototype.replace),X=pe(String.prototype.indexOf),le=pe(String.prototype.trim),se=pe(Number.prototype.toString),Ee=pe(Boolean.prototype.toString),fe=typeof BigInt>"u"?null:pe(BigInt.prototype.toString),Ce=typeof Symbol>"u"?null:pe(Symbol.prototype.toString),ie=pe(Object.prototype.hasOwnProperty),Te=pe(Object.prototype.toString),be=pe(RegExp.prototype.test),$e=$t(TypeError);function pe(I){return function(R){R instanceof RegExp&&(R.lastIndex=0);for(var H=arguments.length,h=new Array(H>1?H-1:0),b=1;b<H;b++)h[b-1]=arguments[b];return E(I,R,h)}}function $t(I){return function(){for(var R=arguments.length,H=new Array(R),h=0;h<R;h++)H[h]=arguments[h];return k(I,H)}}function te(I,R){let H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_;if(l&&l(I,null),!S(R))return I;let h=R.length;for(;h--;){let b=R[h];if(typeof b=="string"){const T=H(b);T!==b&&(c(R)||(R[h]=T),b=T)}I[b]=!0}return I}function Rt(I){for(let R=0;R<I.length;R++)ie(I,R)||(I[R]=null);return I}function V(I){const R=g(null);for(const h of a(I)){var H=r(h,2);const b=H[0],T=H[1];ie(I,b)&&(S(T)?R[b]=Rt(T):T&&typeof T=="object"&&T.constructor===Object?R[b]=V(T):R[b]=T)}return R}function dt(I){switch(typeof I){case"string":return I;case"number":return se(I);case"boolean":return Ee(I);case"bigint":return fe?fe(I):"0";case"symbol":return Ce?Ce(I):"Symbol()";case"undefined":return Te(I);case"function":case"object":{if(I===null)return Te(I);const R=I,H=W(R,"toString");if(typeof H=="function"){const h=H(R);return typeof h=="string"?h:Te(h)}return Te(I)}default:return Te(I)}}function W(I,R){for(;I!==null;){const h=d(I,R);if(h){if(h.get)return pe(h.get);if(typeof h.value=="function")return pe(h.value)}I=u(I)}function H(){return null}return H}function oe(I){try{return be(I,""),!0}catch{return!1}}const ge=f(["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"]),ae=f(["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"]),ke=f(["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"]),je=f(["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"]),Be=f(["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"]),ft=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),et=f(["#text"]),bt=f(["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"]),Ue=f(["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"]),Le=f(["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"]),Vt=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tn=m(/{{[\w\W]*|^[\w\W]*}}/g),gn=m(/<%[\w\W]*|^[\w\W]*%>/g),xn=m(/\${[\w\W]*/g),bn=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ze=m(/^aria-[\-\w]+$/),qt=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pe=m(/^(?:\w+script|data):/i),rt=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lt=m(/^html$/i),Cn=m(/^[a-z][.\w]*(-[.\w]+)+$/i),ar=m(/<[/\w!]/g),Kr=m(/<[/\w]/g),Jr=m(/<\/no(script|embed|frames)/i),Qr=m(/\/>/i),st={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gr=function(){return typeof window>"u"?null:window},es=function(R,H){if(typeof R!="object"||typeof R.createPolicy!="function")return null;let h=null;const b="data-tt-policy-suffix";H&&H.hasAttribute(b)&&(h=H.getAttribute(b));const T="dompurify"+(h?"#"+h:"");try{return R.createPolicy(T,{createHTML($){return $},createScriptURL($){return $}})}catch{return console.warn("TrustedTypes policy "+T+" could not be created."),null}},lr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},pt=function(R,H,h,b){return ie(R,H)&&S(R[H])?te(b.base?V(b.base):{},R[H],b.transform):h};function On(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gr();const R=P=>On(P);if(R.version="3.4.11",R.removed=[],!I||!I.document||I.document.nodeType!==st.document||!I.Element)return R.isSupported=!1,R;let H=I.document;const h=H,b=h.currentScript;I.DocumentFragment;const T=I.HTMLTemplateElement,$=I.Node,Ae=I.Element,ce=I.NodeFilter,z=I.NamedNodeMap;z===void 0&&(I.NamedNodeMap||I.MozNamedAttrMap),I.HTMLFormElement;const F=I.DOMParser,J=I.trustedTypes,Se=Ae.prototype,Me=W(Se,"cloneNode"),Xt=W(Se,"remove"),In=W(Se,"nextSibling"),Pt=W(Se,"childNodes"),nn=W(Se,"parentNode"),yn=W(Se,"shadowRoot"),Mn=W(Se,"attributes"),Ye=$&&$.prototype?W($.prototype,"nodeType"):null,Nt=$&&$.prototype?W($.prototype,"nodeName"):null;if(typeof T=="function"){const P=H.createElement("template");P.content&&P.content.ownerDocument&&(H=P.content.ownerDocument)}let Ve,ht="",Rn,ur=!1,rn=0;const yt=function(){if(rn>0)throw $e('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.')},Dt=function(p){yt(),rn++;try{return Ve.createHTML(p)}finally{rn--}},dr=function(p){yt(),rn++;try{return Ve.createScriptURL(p)}finally{rn--}},ts=function(){return ur||(Rn=es(J,b),ur=!0),Rn},vn=H,Ln=vn.implementation,sn=vn.createNodeIterator,ns=vn.createDocumentFragment,O=vn.getElementsByTagName,Y=h.importNode;let Z=lr();R.isSupported=typeof a=="function"&&typeof nn=="function"&&Ln&&Ln.createHTMLDocument!==void 0;const ye=tn,De=gn,it=xn,Tt=bn,wn=Ze,Ke=Pe,ot=rt,fr=Cn;let Pn=qt,_e=null;const pr=te({},[...ge,...ae,...ke,...Be,...et]);let Oe=null;const hr=te({},[...bt,...Ue,...Le,...Vt]);let Ie=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}})),_t=null,Dn=null;const ze=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let mr=!0,on=!0,G=!1,Bn=!0,Ne=!1,he=!0,mt=!1,vt=!1,an=null,ln=null,D=!1,U=!1,ne=!1,ue=!1,He=!0,gt=!1;const gr="user-content-";let Fn=!0,rs=!1,An={},Ct=null;const ss=te({},["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 Ni=null;const Ti=te({},["audio","video","img","source","image","track"]);let is=null;const _i=te({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xr="http://www.w3.org/1998/Math/MathML",br="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let En=Ot,os=!1,as=null;const ol=te({},[xr,br,Ot],K),Ci=f(["mi","mo","mn","ms","mtext"]);let ls=te({},Ci);const Oi=f(["annotation-xml"]);let cs=te({},Oi);const al=te({},["title","style","font","a","script"]);let zn=null;const ll=["application/xhtml+xml","text/html"],cl="text/html";let Re=null,kn=null;const ul=H.createElement("form"),Ii=function(p){return p instanceof RegExp||p instanceof Function},us=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===p)return;(!p||typeof p!="object")&&(p={}),p=V(p),zn=ll.indexOf(p.PARSER_MEDIA_TYPE)===-1?cl:p.PARSER_MEDIA_TYPE,Re=zn==="application/xhtml+xml"?K:_,_e=pt(p,"ALLOWED_TAGS",pr,{transform:Re}),Oe=pt(p,"ALLOWED_ATTR",hr,{transform:Re}),as=pt(p,"ALLOWED_NAMESPACES",ol,{transform:K}),is=pt(p,"ADD_URI_SAFE_ATTR",_i,{transform:Re,base:_i}),Ni=pt(p,"ADD_DATA_URI_TAGS",Ti,{transform:Re,base:Ti}),Ct=pt(p,"FORBID_CONTENTS",ss,{transform:Re}),_t=pt(p,"FORBID_TAGS",V({}),{transform:Re}),Dn=pt(p,"FORBID_ATTR",V({}),{transform:Re}),An=ie(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?V(p.USE_PROFILES):p.USE_PROFILES:!1,mr=p.ALLOW_ARIA_ATTR!==!1,on=p.ALLOW_DATA_ATTR!==!1,G=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Bn=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=p.SAFE_FOR_TEMPLATES||!1,he=p.SAFE_FOR_XML!==!1,mt=p.WHOLE_DOCUMENT||!1,U=p.RETURN_DOM||!1,ne=p.RETURN_DOM_FRAGMENT||!1,ue=p.RETURN_TRUSTED_TYPE||!1,D=p.FORCE_BODY||!1,He=p.SANITIZE_DOM!==!1,gt=p.SANITIZE_NAMED_PROPS||!1,Fn=p.KEEP_CONTENT!==!1,rs=p.IN_PLACE||!1,Pn=oe(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:qt,En=typeof p.NAMESPACE=="string"?p.NAMESPACE:Ot,ls=ie(p,"MATHML_TEXT_INTEGRATION_POINTS")&&p.MATHML_TEXT_INTEGRATION_POINTS&&typeof p.MATHML_TEXT_INTEGRATION_POINTS=="object"?V(p.MATHML_TEXT_INTEGRATION_POINTS):te({},Ci),cs=ie(p,"HTML_INTEGRATION_POINTS")&&p.HTML_INTEGRATION_POINTS&&typeof p.HTML_INTEGRATION_POINTS=="object"?V(p.HTML_INTEGRATION_POINTS):te({},Oi);const x=ie(p,"CUSTOM_ELEMENT_HANDLING")&&p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING=="object"?V(p.CUSTOM_ELEMENT_HANDLING):g(null);if(Ie=g(null),ie(x,"tagNameCheck")&&Ii(x.tagNameCheck)&&(Ie.tagNameCheck=x.tagNameCheck),ie(x,"attributeNameCheck")&&Ii(x.attributeNameCheck)&&(Ie.attributeNameCheck=x.attributeNameCheck),ie(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),m(Ie),Ne&&(on=!1),ne&&(U=!0),An&&(_e=te({},et),Oe=g(null),An.html===!0&&(te(_e,ge),te(Oe,bt)),An.svg===!0&&(te(_e,ae),te(Oe,Ue),te(Oe,Vt)),An.svgFilters===!0&&(te(_e,ke),te(Oe,Ue),te(Oe,Vt)),An.mathMl===!0&&(te(_e,Be),te(Oe,Le),te(Oe,Vt))),ze.tagCheck=null,ze.attributeCheck=null,ie(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?ze.tagCheck=p.ADD_TAGS:S(p.ADD_TAGS)&&(_e===pr&&(_e=V(_e)),te(_e,p.ADD_TAGS,Re))),ie(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?ze.attributeCheck=p.ADD_ATTR:S(p.ADD_ATTR)&&(Oe===hr&&(Oe=V(Oe)),te(Oe,p.ADD_ATTR,Re))),ie(p,"ADD_URI_SAFE_ATTR")&&S(p.ADD_URI_SAFE_ATTR)&&te(is,p.ADD_URI_SAFE_ATTR,Re),ie(p,"FORBID_CONTENTS")&&S(p.FORBID_CONTENTS)&&(Ct===ss&&(Ct=V(Ct)),te(Ct,p.FORBID_CONTENTS,Re)),ie(p,"ADD_FORBID_CONTENTS")&&S(p.ADD_FORBID_CONTENTS)&&(Ct===ss&&(Ct=V(Ct)),te(Ct,p.ADD_FORBID_CONTENTS,Re)),Fn&&(_e["#text"]=!0),mt&&te(_e,["html","head","body"]),_e.table&&(te(_e,["tbody"]),delete _t.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw $e('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $e('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const L=Ve;Ve=p.TRUSTED_TYPES_POLICY;try{ht=Dt("")}catch(q){throw Ve=L,q}}else p.TRUSTED_TYPES_POLICY===null?(Ve=void 0,ht=""):(Ve===void 0&&(Ve=ts()),Ve&&typeof ht=="string"&&(ht=Dt("")));f&&f(p),kn=p},Mi=te({},[...ae,...ke,...je]),Ri=te({},[...Be,...ft]),dl=function(p,x,L){return x.namespaceURI===Ot?p==="svg":x.namespaceURI===xr?p==="svg"&&(L==="annotation-xml"||ls[L]):!!Mi[p]},fl=function(p,x,L){return x.namespaceURI===Ot?p==="math":x.namespaceURI===br?p==="math"&&cs[L]:!!Ri[p]},pl=function(p,x,L){return x.namespaceURI===br&&!cs[L]||x.namespaceURI===xr&&!ls[L]?!1:!Ri[p]&&(al[p]||!Mi[p])},hl=function(p){let x=nn(p);(!x||!x.tagName)&&(x={namespaceURI:En,tagName:"template"});const L=_(p.tagName),q=_(x.tagName);return as[p.namespaceURI]?p.namespaceURI===br?dl(L,x,q):p.namespaceURI===xr?fl(L,x,q):p.namespaceURI===Ot?pl(L,x,q):!!(zn==="application/xhtml+xml"&&as[p.namespaceURI]):!1},Zt=function(p){y(R.removed,{element:p});try{nn(p).removeChild(p)}catch{if(Xt(p),!nn(p))throw $e("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Li=function(p){const x=Pt(p);if(x){const q=[];C(x,re=>{y(q,re)}),C(q,re=>{try{Xt(re)}catch{}})}const L=Mn(p);if(L)for(let q=L.length-1;q>=0;--q){const re=L[q],de=re&&re.name;if(typeof de=="string")try{p.removeAttribute(de)}catch{}}},cn=function(p,x){try{y(R.removed,{attribute:x.getAttributeNode(p),from:x})}catch{y(R.removed,{attribute:null,from:x})}if(x.removeAttribute(p),p==="is")if(U||ne)try{Zt(x)}catch{}else try{x.setAttribute(p,"")}catch{}},ml=function(p){const x=Mn(p);if(x)for(let L=x.length-1;L>=0;--L){const q=x[L],re=q&&q.name;if(!(typeof re!="string"||Oe[Re(re)]))try{p.removeAttribute(re)}catch{}}},gl=function(p){const x=[p];for(;x.length>0;){const L=x.pop();(Ye?Ye(L):L.nodeType)===st.element&&ml(L);const re=Pt(L);if(re)for(let de=re.length-1;de>=0;--de)x.push(re[de])}},Pi=function(p){let x=null,L=null;if(D)p="<remove></remove>"+p;else{const de=A(p,/^[\r\n\t ]+/);L=de&&de[0]}zn==="application/xhtml+xml"&&En===Ot&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const q=Ve?Dt(p):p;if(En===Ot)try{x=new F().parseFromString(q,zn)}catch{}if(!x||!x.documentElement){x=Ln.createDocument(En,"template",null);try{x.documentElement.innerHTML=os?ht:q}catch{}}const re=x.body||x.documentElement;return p&&L&&re.insertBefore(H.createTextNode(L),re.childNodes[0]||null),En===Ot?O.call(x,mt?"html":"body")[0]:mt?x.documentElement:re},Di=function(p){return sn.call(p.ownerDocument||p,p,ce.SHOW_ELEMENT|ce.SHOW_COMMENT|ce.SHOW_TEXT|ce.SHOW_PROCESSING_INSTRUCTION|ce.SHOW_CDATA_SECTION,null)},yr=function(p){return p=B(p,ye," "),p=B(p,De," "),p=B(p,it," "),p},ds=function(p){var x;p.normalize();const L=sn.call(p.ownerDocument||p,p,ce.SHOW_TEXT|ce.SHOW_COMMENT|ce.SHOW_CDATA_SECTION|ce.SHOW_PROCESSING_INSTRUCTION,null);let q=L.nextNode();for(;q;)q.data=yr(q.data),q=L.nextNode();const re=(x=p.querySelectorAll)===null||x===void 0?void 0:x.call(p,"template");re&&C(re,de=>{jn(de.content)&&ds(de.content)})},vr=function(p){const x=Nt?Nt(p):null;return typeof x!="string"||Re(x)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==Mn(p)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==Ye(p)||p.childNodes!==Pt(p)},jn=function(p){if(!Ye||typeof p!="object"||p===null)return!1;try{return Ye(p)===st.documentFragment}catch{return!1}},Hn=function(p){if(!Ye||typeof p!="object"||p===null)return!1;try{return typeof Ye(p)=="number"}catch{return!1}};function Bt(P,p,x){P.length!==0&&C(P,L=>{L.call(R,p,x,kn)})}const xl=function(p,x){return!!(he&&p.hasChildNodes()&&!Hn(p.firstElementChild)&&be(ar,p.textContent)&&be(ar,p.innerHTML)||he&&p.namespaceURI===Ot&&x==="style"&&Hn(p.firstElementChild)||p.nodeType===st.processingInstruction||he&&p.nodeType===st.comment&&be(Kr,p.data))},bl=function(p,x){if(!_t[x]&&zi(x)&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,x)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(x)))return!1;if(Fn&&!Ct[x]){const L=nn(p),q=Pt(p);if(q&&L){const re=q.length;for(let de=re-1;de>=0;--de){const We=rs?q[de]:Me(q[de],!0);L.insertBefore(We,In(p))}}}return Zt(p),!0},Bi=function(p){if(Bt(Z.beforeSanitizeElements,p,null),vr(p))return Zt(p),!0;const x=Re(Nt?Nt(p):p.nodeName);if(Bt(Z.uponSanitizeElement,p,{tagName:x,allowedTags:_e}),xl(p,x))return Zt(p),!0;if(_t[x]||!(ze.tagCheck instanceof Function&&ze.tagCheck(x))&&!_e[x])return bl(p,x);if((Ye?Ye(p):p.nodeType)===st.element&&!hl(p)||(x==="noscript"||x==="noembed"||x==="noframes")&&be(Jr,p.innerHTML))return Zt(p),!0;if(Ne&&p.nodeType===st.text){const q=yr(p.textContent);p.textContent!==q&&(y(R.removed,{element:p.cloneNode()}),p.textContent=q)}return Bt(Z.afterSanitizeElements,p,null),!1},Fi=function(p,x,L){if(Dn[x]||He&&(x==="id"||x==="name")&&(L in H||L in ul))return!1;const q=Oe[x]||ze.attributeCheck instanceof Function&&ze.attributeCheck(x,p);if(!(on&&be(Tt,x))){if(!(mr&&be(wn,x))){if(q){if(!is[x]){if(!be(Pn,B(L,ot,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&p!=="script"&&X(L,"data:")===0&&Ni[p])){if(!(G&&!be(Ke,B(L,ot,"")))){if(L)return!1}}}}}else if(!(zi(p)&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,p)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(p))&&(Ie.attributeNameCheck instanceof RegExp&&be(Ie.attributeNameCheck,x)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(x,p))||x==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,L)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(L))))return!1}}return!0},yl=te({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zi=function(p){return!yl[_(p)]&&be(fr,p)},vl=function(p,x,L,q){if(Ve&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!L)switch(J.getAttributeType(p,x)){case"TrustedHTML":return Dt(q);case"TrustedScriptURL":return dr(q)}return q},wl=function(p,x,L,q){try{L?p.setAttributeNS(L,x,q):p.setAttribute(x,q),vr(p)?Zt(p):w(R.removed)}catch{cn(x,p)}},Hi=function(p){Bt(Z.beforeSanitizeAttributes,p,null);const x=p.attributes;if(!x||vr(p))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let q=x.length;const re=Re(p.nodeName);for(;q--;){const de=x[q],We=de.name,Fe=de.namespaceURI,xt=de.value,wt=Re(We),ps=xt;let Je=We==="value"?ps:le(ps);if(L.attrName=wt,L.attrValue=Je,L.keepAttr=!0,L.forceKeepAttr=void 0,Bt(Z.uponSanitizeAttribute,p,L),Je=L.attrValue,gt&&(wt==="id"||wt==="name")&&X(Je,gr)!==0&&(cn(We,p),Je=gr+Je),he&&be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Je)){cn(We,p);continue}if(wt==="attributename"&&A(Je,"href")){cn(We,p);continue}if(!L.forceKeepAttr){if(!L.keepAttr){cn(We,p);continue}if(!Bn&&be(Qr,Je)){cn(We,p);continue}if(Ne&&(Je=yr(Je)),!Fi(re,wt,Je)){cn(We,p);continue}Je=vl(re,wt,Fe,Je),Je!==ps&&wl(p,We,Fe,Je)}}Bt(Z.afterSanitizeAttributes,p,null)},wr=function(p){let x=null;const L=Di(p);for(Bt(Z.beforeSanitizeShadowDOM,p,null);x=L.nextNode();)if(Bt(Z.uponSanitizeShadowNode,x,null),Bi(x),Hi(x),jn(x.content)&&wr(x.content),(Ye?Ye(x):x.nodeType)===st.element){const re=yn(x);jn(re)&&(fs(re),wr(re))}Bt(Z.afterSanitizeShadowDOM,p,null)},fs=function(p){const x=[{node:p,shadow:null}];for(;x.length>0;){const L=x.pop();if(L.shadow){wr(L.shadow);continue}const q=L.node,de=(Ye?Ye(q):q.nodeType)===st.element,We=Pt(q);if(We)for(let Fe=We.length-1;Fe>=0;--Fe)x.push({node:We[Fe],shadow:null});if(de){const Fe=Nt?Nt(q):null;if(typeof Fe=="string"&&Re(Fe)==="template"){const xt=q.content;jn(xt)&&x.push({node:xt,shadow:null})}}if(de){const Fe=yn(q);jn(Fe)&&x.push({node:null,shadow:Fe},{node:Fe,shadow:null})}}};return R.sanitize=function(P){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,L=null,q=null,re=null;if(os=!P,os&&(P="<!-->"),typeof P!="string"&&!Hn(P)&&(P=dt(P),typeof P!="string"))throw $e("dirty is not a string, aborting");if(!R.isSupported)return P;vt?(_e=an,Oe=ln):us(p),(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&(_e=V(_e)),Z.uponSanitizeAttribute.length>0&&(Oe=V(Oe)),R.removed=[];const de=rs&&typeof P!="string"&&Hn(P);if(de){const xt=Nt?Nt(P):P.nodeName;if(typeof xt=="string"){const wt=Re(xt);if(!_e[wt]||_t[wt])throw $e("root node is forbidden and cannot be sanitized in-place")}if(vr(P))throw $e("root node is clobbered and cannot be sanitized in-place");try{fs(P)}catch(wt){throw Li(P),wt}}else if(Hn(P))x=Pi("<!---->"),L=x.ownerDocument.importNode(P,!0),L.nodeType===st.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?x=L:x.appendChild(L),fs(L);else{if(!U&&!Ne&&!mt&&P.indexOf("<")===-1)return Ve&&ue?Dt(P):P;if(x=Pi(P),!x)return U?null:ue?ht:""}x&&D&&Zt(x.firstChild);const We=Di(de?P:x);try{for(;q=We.nextNode();)Bi(q),Hi(q),jn(q.content)&&wr(q.content)}catch(xt){throw de&&Li(P),xt}if(de)return C(R.removed,xt=>{xt.element&&gl(xt.element)}),Ne&&ds(P),P;if(U){if(Ne&&ds(x),ne)for(re=ns.call(x.ownerDocument);x.firstChild;)re.appendChild(x.firstChild);else re=x;return(Oe.shadowroot||Oe.shadowrootmode)&&(re=Y.call(h,re,!0)),re}let Fe=mt?x.outerHTML:x.innerHTML;return mt&&_e["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&be(Lt,x.ownerDocument.doctype.name)&&(Fe="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
|
|
5
|
+
`+Fe),Ne&&(Fe=yr(Fe)),Ve&&ue?Dt(Fe):Fe},R.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};us(P),vt=!0,an=_e,ln=Oe},R.clearConfig=function(){kn=null,vt=!1,an=null,ln=null,Ve=Rn,ht=""},R.isValidAttribute=function(P,p,x){kn||us({});const L=Re(P),q=Re(p);return Fi(L,q,x)},R.addHook=function(P,p){typeof p=="function"&&ie(Z,P)&&y(Z[P],p)},R.removeHook=function(P,p){if(ie(Z,P)){if(p!==void 0){const x=j(Z[P],p);return x===-1?void 0:M(Z[P],x,1)[0]}return w(Z[P])}},R.removeHooks=function(P){ie(Z,P)&&(Z[P]=[])},R.removeAllHooks=function(){Z=lr()},R}var cr=On();return xs=cr,xs}var bs,eo;function nu(){return eo||(eo=1,bs=self.DOMPurify||(self.DOMPurify=Gi().default||Gi())),bs}var ru=nu();const ea=ai(ru);function li(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var hn=li();function ta(e){hn=e}var Xn={exec:()=>null};function xe(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ge.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,t)};return s}var Ge={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")},su=/^(?:[ \t]*(?:\n|$))+/,iu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ou=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,au=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ci=/(?:[*+-]|\d{1,9}[.)])/,na=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ra=xe(na).replace(/bull/g,ci).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(),lu=xe(na).replace(/bull/g,ci).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(),ui=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cu=/^[^\n]+/,di=/(?!\s*\])(?:\\.|[^\[\]\\])+/,uu=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",di).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),du=xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ci).getRegex(),Vr="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",fi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fu=xe("^ {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",fi).replace("tag",Vr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sa=xe(ui).replace("hr",Qn).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",Vr).getRegex(),pu=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sa).getRegex(),pi={blockquote:pu,code:iu,def:uu,fences:ou,heading:au,hr:Qn,html:fu,lheading:ra,list:du,newline:su,paragraph:sa,table:Xn,text:cu},to=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qn).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",Vr).getRegex(),hu={...pi,lheading:lu,table:to,paragraph:xe(ui).replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",to).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",Vr).getRegex()},mu={...pi,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fi).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:Xn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(ui).replace("hr",Qn).replace("heading",` *#{1,6} *[^
|
|
6
|
+
]`).replace("lheading",ra).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ia=/^( {2,}|\\)\n(?!\s*$)/,bu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qr=/[\p{P}\p{S}]/u,hi=/[\s\p{P}\p{S}]/u,oa=/[^\s\p{P}\p{S}]/u,yu=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hi).getRegex(),aa=/(?!~)[\p{P}\p{S}]/u,vu=/(?!~)[\s\p{P}\p{S}]/u,wu=/(?:[^\s\p{P}\p{S}]|~)/u,Au=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,la=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Eu=xe(la,"u").replace(/punct/g,qr).getRegex(),ku=xe(la,"u").replace(/punct/g,aa).getRegex(),ca="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ju=xe(ca,"gu").replace(/notPunctSpace/g,oa).replace(/punctSpace/g,hi).replace(/punct/g,qr).getRegex(),Su=xe(ca,"gu").replace(/notPunctSpace/g,wu).replace(/punctSpace/g,vu).replace(/punct/g,aa).getRegex(),Nu=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,oa).replace(/punctSpace/g,hi).replace(/punct/g,qr).getRegex(),Tu=xe(/\\(punct)/,"gu").replace(/punct/g,qr).getRegex(),_u=xe(/^<(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(),Cu=xe(fi).replace("(?:-->|$)","-->").getRegex(),Ou=xe("^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",Cu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Iu=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Dr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ua=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Dr).replace("ref",di).getRegex(),da=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",di).getRegex(),Mu=xe("reflink|nolink(?!\\()","g").replace("reflink",ua).replace("nolink",da).getRegex(),mi={_backpedal:Xn,anyPunctuation:Tu,autolink:_u,blockSkip:Au,br:ia,code:xu,del:Xn,emStrongLDelim:Eu,emStrongRDelimAst:ju,emStrongRDelimUnd:Nu,escape:gu,link:Iu,nolink:da,punctuation:yu,reflink:ua,reflinkSearch:Mu,tag:Ou,text:bu,url:Xn},Ru={...mi,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Dr).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dr).getRegex()},Ls={...mi,emStrongRDelimAst:Su,emStrongLDelim:ku,url:xe(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Lu={...Ls,br:xe(ia).replace("{2,}","*").getRegex(),text:xe(Ls.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Er={normal:pi,gfm:hu,pedantic:mu},Un={normal:mi,gfm:Ls,breaks:Lu,pedantic:Ru},Pu={"&":"&","<":"<",">":">",'"':""","'":"'"},no=e=>Pu[e];function It(e,t){if(t){if(Ge.escapeTest.test(e))return e.replace(Ge.escapeReplace,no)}else if(Ge.escapeTestNoEncode.test(e))return e.replace(Ge.escapeReplaceNoEncode,no);return e}function ro(e){try{e=encodeURI(e).replace(Ge.percentDecode,"%")}catch{return null}return e}function so(e,t){var i;const n=e.replace(Ge.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),s=n.split(Ge.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ge.slashPipe,"|");return s}function Wn(e,t,n){const s=e.length;if(s===0)return"";let r=0;for(;r<s&&e.charAt(s-r-1)===t;)r++;return e.slice(0,s-r)}function Du(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function io(e,t,n,s,r){const i=t.href,a=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,c}function Bu(e,t,n){const s=e.match(n.other.indentCodeCompensation);if(s===null)return t;const r=s[1];return t.split(`
|
|
7
|
+
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
8
|
+
`)}var Br=class{constructor(e){ve(this,"options");ve(this,"rules");ve(this,"lexer");this.options=e||hn}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:Wn(n,`
|
|
9
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=Bu(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:s}}}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 s=Wn(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.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:Wn(t[0],`
|
|
10
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Wn(t[0],`
|
|
11
|
+
`).split(`
|
|
12
|
+
`),s="",r="";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(`
|
|
13
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
14
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
15
|
+
${u}`:u,r=r?`${r}
|
|
16
|
+
${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;const m=i.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){const g=m,v=g.raw+`
|
|
17
|
+
`+n.join(`
|
|
18
|
+
`),E=this.blockquote(v);i[i.length-1]=E,s=s.substring(0,s.length-g.raw.length)+E.raw,r=r.substring(0,r.length-g.text.length)+E.text;break}else if((m==null?void 0:m.type)==="list"){const g=m,v=g.raw+`
|
|
19
|
+
`+n.join(`
|
|
20
|
+
`),E=this.list(v);i[i.length-1]=E,s=s.substring(0,s.length-m.raw.length)+E.raw,r=r.substring(0,r.length-g.raw.length)+E.raw,n=v.substring(i.at(-1).raw.length).split(`
|
|
21
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?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 f=t[2].split(`
|
|
22
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=e.split(`
|
|
23
|
+
`,1)[0],g=!f.trim(),v=0;if(this.options.pedantic?(v=2,d=f.trimStart()):g?v=t[1].length+1:(v=t[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=f.slice(v),v+=t[1].length),g&&this.rules.other.blankLine.test(m)&&(u+=m+`
|
|
24
|
+
`,e=e.substring(m.length+1),c=!0),!c){const C=this.rules.other.nextBulletRegex(v),j=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),y=this.rules.other.headingBeginRegex(v),M=this.rules.other.htmlBeginRegex(v);for(;e;){const S=e.split(`
|
|
25
|
+
`,1)[0];let _;if(m=S,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),_=m):_=m.replace(this.rules.other.tabCharGlobal," "),w.test(m)||y.test(m)||M.test(m)||C.test(m)||j.test(m))break;if(_.search(this.rules.other.nonSpaceChar)>=v||!m.trim())d+=`
|
|
26
|
+
`+_.slice(v);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||y.test(f)||j.test(f))break;d+=`
|
|
27
|
+
`+m}!g&&!m.trim()&&(g=!0),u+=S+`
|
|
28
|
+
`,e=e.substring(S.length+1),f=_.slice(v)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let E=null,k;this.options.gfm&&(E=this.rules.other.listIsTask.exec(d),E&&(k=E[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!E,checked:k,loose:!1,text:d,tokens:[]}),r.raw+=u}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const u=r.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=d}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}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," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=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:s,title:r}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=so(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
29
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const l of s)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 r)i.rows.push(so(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)===`
|
|
30
|
+
`?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=Wn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=Du(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 s=t[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),io(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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 s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[s.toLowerCase()];if(!r){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return io(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let a,l,c=i,u=0;const d=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(s=d.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...s[0]][0].length,m=e.slice(0,i+s.index+f+l);if(Math.min(i,l)%2){const v=m.slice(1,-1);return{type:"em",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}const g=m.slice(2,-2);return{type:"strong",raw:m,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 s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(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,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;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]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}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}}}},Ut=class Ps{constructor(t){ve(this,"tokens");ve(this,"options");ve(this,"state");ve(this,"tokenizer");ve(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||hn,this.options.tokenizer=this.options.tokenizer||new Br,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:Ge,block:Er.normal,inline:Un.normal};this.options.pedantic?(n.block=Er.pedantic,n.inline=Un.pedantic):this.options.gfm&&(n.block=Er.gfm,this.options.breaks?n.inline=Un.breaks:n.inline=Un.gfm),this.tokenizer.rules=n}static get rules(){return{block:Er,inline:Un}}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(Ge.carriageReturn,`
|
|
31
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){var r,i,a;for(this.options.pedantic&&(t=t.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));t;){let l;if((i=(r=this.options.extensions)==null?void 0:r.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+=`
|
|
32
|
+
`: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+=`
|
|
33
|
+
`+l.raw,u.text+=`
|
|
34
|
+
`+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+=`
|
|
35
|
+
`+l.raw,u.text+=`
|
|
36
|
+
`+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 f;this.options.extensions.startBlock.forEach(m=>{f=m.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const u=n.at(-1);s&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
37
|
+
`+l.raw,u.text+=`
|
|
38
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l),s=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+=`
|
|
39
|
+
`+l.raw,u.text+=`
|
|
40
|
+
`+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 s=t,r=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.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(m=>(d=m.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 m=n.at(-1);d.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,s,a)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let m=1/0;const g=t.slice(1);let v;this.options.extensions.startInline.forEach(E=>{v=E.call({lexer:this},g),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(f=t.substring(0,m+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(t){const m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Fr=class{constructor(e){ve(this,"options");ve(this,"parser");this.options=e||hn}space(e){return""}code({text:e,lang:t,escaped:n}){var i;const s=(i=(t||"").match(Ge.notSpaceStart))==null?void 0:i[0],r=e.replace(Ge.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+It(s)+'">'+(n?r:It(r,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(n?r:It(r,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(e)}</blockquote>
|
|
45
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
46
|
+
`}hr(e){return`<hr>
|
|
47
|
+
`}list(e){const t=e.ordered,n=e.start;let s="";for(let a=0;a<e.items.length;a++){const l=e.items[a];s+=this.listitem(l)}const r=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
48
|
+
`+s+"</"+r+`>
|
|
49
|
+
`}listitem(e){var n;let t="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=s+" "+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=s+" "+It(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):t+=s+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
50
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
51
|
+
`}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let s="";for(let r=0;r<e.rows.length;r++){const i=e.rows[r];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+t+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:e}){return`<tr>
|
|
56
|
+
${e}</tr>
|
|
57
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
58
|
+
`}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>${It(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 s=this.parser.parseInline(n),r=ro(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+It(t)+'"'),i+=">"+s+"</a>",i}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const r=ro(e);if(r===null)return It(n);e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${It(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:It(e.text)}},gi=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""}},Wt=class Ds{constructor(t){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=t||hn,this.options.renderer=this.options.renderer||new Fr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gi}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 r,i;let s="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(r=this.options.extensions)==null?void 0:r.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)){s+=d||"";continue}}const c=l;switch(c.type){case"space":{s+=this.renderer.space(c);continue}case"hr":{s+=this.renderer.hr(c);continue}case"heading":{s+=this.renderer.heading(c);continue}case"code":{s+=this.renderer.code(c);continue}case"table":{s+=this.renderer.table(c);continue}case"blockquote":{s+=this.renderer.blockquote(c);continue}case"list":{s+=this.renderer.list(c);continue}case"html":{s+=this.renderer.html(c);continue}case"paragraph":{s+=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+=`
|
|
59
|
+
`+this.renderer.text(u);n?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=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 s}parseInline(t,n=this.renderer){var r,i;let s="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(r=this.options.extensions)==null?void 0:r.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)){s+=u||"";continue}}const c=l;switch(c.type){case"escape":{s+=n.text(c);break}case"html":{s+=n.html(c);break}case"link":{s+=n.link(c);break}case"image":{s+=n.image(c);break}case"strong":{s+=n.strong(c);break}case"em":{s+=n.em(c);break}case"codespan":{s+=n.codespan(c);break}case"br":{s+=n.br(c);break}case"del":{s+=n.del(c);break}case"text":{s+=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 s}},js,Mr=(js=class{constructor(e){ve(this,"options");ve(this,"block");this.options=e||hn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ut.lex:Ut.lexInline}provideParser(){return this.block?Wt.parse:Wt.parseInline}},ve(js,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),js),fa=class{constructor(...e){ve(this,"defaults",li());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Wt);ve(this,"Renderer",Fr);ve(this,"TextRenderer",gi);ve(this,"Lexer",Ut);ve(this,"Tokenizer",Br);ve(this,"Hooks",Mr);this.use(...e)}walkTokens(e,t){var s,r;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;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[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 s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=t.renderers[r.name];i?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){const r=this.defaults.renderer||new Fr(this.defaults);for(const i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=n.renderer[a],c=r[a];r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Br(this.defaults);for(const i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=n.tokenizer[a],c=r[a];r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new Mr;for(const i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=n.hooks[a],c=r[a];Mr.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(f=>c.call(r,f));const d=l.call(r,u);return c.call(r,d)}:r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ut.lex(e,t??this.defaults)}parser(e,t){return Wt.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const r={...s},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.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?Ut.lex:Ut.lexInline,c=i.hooks?i.hooks.provideParser():e?Wt.parse:Wt.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+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+It(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},dn=new fa;function we(e,t){return dn.parse(e,t)}we.options=we.setOptions=function(e){return dn.setOptions(e),we.defaults=dn.defaults,ta(we.defaults),we};we.getDefaults=li;we.defaults=hn;we.use=function(...e){return dn.use(...e),we.defaults=dn.defaults,ta(we.defaults),we};we.walkTokens=function(e,t){return dn.walkTokens(e,t)};we.parseInline=dn.parseInline;we.Parser=Wt;we.parser=Wt.parse;we.Renderer=Fr;we.TextRenderer=gi;we.Lexer=Ut;we.lexer=Ut.lex;we.Tokenizer=Br;we.Hooks=Mr;we.parse=we;we.options;we.setOptions;we.use;we.walkTokens;we.parseInline;Wt.parse;Ut.lex;function Fu(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=oo(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(ao(t));const s=e.highlight(t.text,n,t.lang||"");if(s 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.");ao(t)(s)},useNewRenderer:!0,renderer:{code(t,n,s){typeof t=="object"&&(s=t.escaped,n=t.lang,t=t.text);const r=oo(n),i=r?e.langPrefix+co(r):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${s?t:co(t,!0)}
|
|
61
|
+
</code></pre>`}}}}function oo(e){return(e||"").match(/\S*/)[0]}function ao(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const pa=/[&<>"']/,zu=new RegExp(pa.source,"g"),ha=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Hu=new RegExp(ha.source,"g"),Uu={"&":"&","<":"<",">":">",'"':""","'":"'"},lo=e=>Uu[e];function co(e,t){if(t){if(pa.test(e))return e.replace(zu,lo)}else if(ha.test(e))return e.replace(Hu,lo);return e}var ys,uo;function Wu(){if(uo)return ys;uo=1;function e(h){return h instanceof Map?h.clear=h.delete=h.set=function(){throw new Error("map is read-only")}:h instanceof Set&&(h.add=h.clear=h.delete=function(){throw new Error("set is read-only")}),Object.freeze(h),Object.getOwnPropertyNames(h).forEach(b=>{const T=h[b],$=typeof T;($==="object"||$==="function")&&!Object.isFrozen(T)&&e(T)}),h}class t{constructor(b){b.data===void 0&&(b.data={}),this.data=b.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(h){return h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(h,...b){const T=Object.create(null);for(const $ in h)T[$]=h[$];return b.forEach(function($){for(const Ae in $)T[Ae]=$[Ae]}),T}const r="</span>",i=h=>!!h.scope,a=(h,{prefix:b})=>{if(h.startsWith("language:"))return h.replace("language:","language-");if(h.includes(".")){const T=h.split(".");return[`${b}${T.shift()}`,...T.map(($,Ae)=>`${$}${"_".repeat(Ae+1)}`)].join(" ")}return`${b}${h}`};class l{constructor(b,T){this.buffer="",this.classPrefix=T.classPrefix,b.walk(this)}addText(b){this.buffer+=n(b)}openNode(b){if(!i(b))return;const T=a(b.scope,{prefix:this.classPrefix});this.span(T)}closeNode(b){i(b)&&(this.buffer+=r)}value(){return this.buffer}span(b){this.buffer+=`<span class="${b}">`}}const c=(h={})=>{const b={children:[]};return Object.assign(b,h),b};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(b){this.top.children.push(b)}openNode(b){const T=c({scope:b});this.add(T),this.stack.push(T)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(b){return this.constructor._walk(b,this.rootNode)}static _walk(b,T){return typeof T=="string"?b.addText(T):T.children&&(b.openNode(T),T.children.forEach($=>this._walk(b,$)),b.closeNode(T)),b}static _collapse(b){typeof b!="string"&&b.children&&(b.children.every(T=>typeof T=="string")?b.children=[b.children.join("")]:b.children.forEach(T=>{u._collapse(T)}))}}class d extends u{constructor(b){super(),this.options=b}addText(b){b!==""&&this.add(b)}startScope(b){this.openNode(b)}endScope(){this.closeNode()}__addSublanguage(b,T){const $=b.root;T&&($.scope=`language:${T}`),this.add($)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(h){return h?typeof h=="string"?h:h.source:null}function m(h){return E("(?=",h,")")}function g(h){return E("(?:",h,")*")}function v(h){return E("(?:",h,")?")}function E(...h){return h.map(T=>f(T)).join("")}function k(h){const b=h[h.length-1];return typeof b=="object"&&b.constructor===Object?(h.splice(h.length-1,1),b):{}}function C(...h){return"("+(k(h).capture?"":"?:")+h.map($=>f($)).join("|")+")"}function j(h){return new RegExp(h.toString()+"|").exec("").length-1}function w(h,b){const T=h&&h.exec(b);return T&&T.index===0}const y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(h,{joinWith:b}){let T=0;return h.map($=>{T+=1;const Ae=T;let ce=f($),z="";for(;ce.length>0;){const F=y.exec(ce);if(!F){z+=ce;break}z+=ce.substring(0,F.index),ce=ce.substring(F.index+F[0].length),F[0][0]==="\\"&&F[1]?z+="\\"+String(Number(F[1])+Ae):(z+=F[0],F[0]==="("&&T++)}return z}).map($=>`(${$})`).join(b)}const S=/\b\B/,_="[a-zA-Z]\\w*",K="[a-zA-Z_]\\w*",A="\\b\\d+(\\.\\d+)?",B="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",X="\\b(0b[01]+)",le="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",se=(h={})=>{const b=/^#![ ]*\//;return h.binary&&(h.begin=E(b,/.*\b/,h.binary,/\b.*/)),s({scope:"meta",begin:b,end:/$/,relevance:0,"on:begin":(T,$)=>{T.index!==0&&$.ignoreMatch()}},h)},Ee={begin:"\\\\[\\s\\S]",relevance:0},fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ee]},Ce={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ee]},ie={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/},Te=function(h,b,T={}){const $=s({scope:"comment",begin:h,end:b,contains:[]},T);$.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 Ae=C("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 $.contains.push({begin:E(/[ ]+/,"(",Ae,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),$},be=Te("//","$"),$e=Te("/\\*","\\*/"),pe=Te("#","$"),$t={scope:"number",begin:A,relevance:0},te={scope:"number",begin:B,relevance:0},Rt={scope:"number",begin:X,relevance:0},V={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ee,{begin:/\[/,end:/\]/,relevance:0,contains:[Ee]}]},dt={scope:"title",begin:_,relevance:0},W={scope:"title",begin:K,relevance:0},oe={begin:"\\.\\s*"+K,relevance:0};var ae=Object.freeze({__proto__:null,APOS_STRING_MODE:fe,BACKSLASH_ESCAPE:Ee,BINARY_NUMBER_MODE:Rt,BINARY_NUMBER_RE:X,COMMENT:Te,C_BLOCK_COMMENT_MODE:$e,C_LINE_COMMENT_MODE:be,C_NUMBER_MODE:te,C_NUMBER_RE:B,END_SAME_AS_BEGIN:function(h){return Object.assign(h,{"on:begin":(b,T)=>{T.data._beginMatch=b[1]},"on:end":(b,T)=>{T.data._beginMatch!==b[1]&&T.ignoreMatch()}})},HASH_COMMENT_MODE:pe,IDENT_RE:_,MATCH_NOTHING_RE:S,METHOD_GUARD:oe,NUMBER_MODE:$t,NUMBER_RE:A,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:Ce,REGEXP_MODE:V,RE_STARTERS_RE:le,SHEBANG:se,TITLE_MODE:dt,UNDERSCORE_IDENT_RE:K,UNDERSCORE_TITLE_MODE:W});function ke(h,b){h.input[h.index-1]==="."&&b.ignoreMatch()}function je(h,b){h.className!==void 0&&(h.scope=h.className,delete h.className)}function Be(h,b){b&&h.beginKeywords&&(h.begin="\\b("+h.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",h.__beforeBegin=ke,h.keywords=h.keywords||h.beginKeywords,delete h.beginKeywords,h.relevance===void 0&&(h.relevance=0))}function ft(h,b){Array.isArray(h.illegal)&&(h.illegal=C(...h.illegal))}function et(h,b){if(h.match){if(h.begin||h.end)throw new Error("begin & end are not supported with match");h.begin=h.match,delete h.match}}function bt(h,b){h.relevance===void 0&&(h.relevance=1)}const Ue=(h,b)=>{if(!h.beforeMatch)return;if(h.starts)throw new Error("beforeMatch cannot be used with starts");const T=Object.assign({},h);Object.keys(h).forEach($=>{delete h[$]}),h.keywords=T.keywords,h.begin=E(T.beforeMatch,m(T.begin)),h.starts={relevance:0,contains:[Object.assign(T,{endsParent:!0})]},h.relevance=0,delete T.beforeMatch},Le=["of","and","for","in","not","or","if","then","parent","list","value"],Vt="keyword";function tn(h,b,T=Vt){const $=Object.create(null);return typeof h=="string"?Ae(T,h.split(" ")):Array.isArray(h)?Ae(T,h):Object.keys(h).forEach(function(ce){Object.assign($,tn(h[ce],b,ce))}),$;function Ae(ce,z){b&&(z=z.map(F=>F.toLowerCase())),z.forEach(function(F){const J=F.split("|");$[J[0]]=[ce,gn(J[0],J[1])]})}}function gn(h,b){return b?Number(b):xn(h)?0:1}function xn(h){return Le.includes(h.toLowerCase())}const bn={},Ze=h=>{console.error(h)},qt=(h,...b)=>{console.log(`WARN: ${h}`,...b)},Pe=(h,b)=>{bn[`${h}/${b}`]||(console.log(`Deprecated as of ${h}. ${b}`),bn[`${h}/${b}`]=!0)},rt=new Error;function Lt(h,b,{key:T}){let $=0;const Ae=h[T],ce={},z={};for(let F=1;F<=b.length;F++)z[F+$]=Ae[F],ce[F+$]=!0,$+=j(b[F-1]);h[T]=z,h[T]._emit=ce,h[T]._multi=!0}function Cn(h){if(Array.isArray(h.begin)){if(h.skip||h.excludeBegin||h.returnBegin)throw Ze("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),rt;if(typeof h.beginScope!="object"||h.beginScope===null)throw Ze("beginScope must be object"),rt;Lt(h,h.begin,{key:"beginScope"}),h.begin=M(h.begin,{joinWith:""})}}function ar(h){if(Array.isArray(h.end)){if(h.skip||h.excludeEnd||h.returnEnd)throw Ze("skip, excludeEnd, returnEnd not compatible with endScope: {}"),rt;if(typeof h.endScope!="object"||h.endScope===null)throw Ze("endScope must be object"),rt;Lt(h,h.end,{key:"endScope"}),h.end=M(h.end,{joinWith:""})}}function Kr(h){h.scope&&typeof h.scope=="object"&&h.scope!==null&&(h.beginScope=h.scope,delete h.scope)}function Jr(h){Kr(h),typeof h.beginScope=="string"&&(h.beginScope={_wrap:h.beginScope}),typeof h.endScope=="string"&&(h.endScope={_wrap:h.endScope}),Cn(h),ar(h)}function Qr(h){function b(z,F){return new RegExp(f(z),"m"+(h.case_insensitive?"i":"")+(h.unicodeRegex?"u":"")+(F?"g":""))}class T{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(F,J){J.position=this.position++,this.matchIndexes[this.matchAt]=J,this.regexes.push([J,F]),this.matchAt+=j(F)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const F=this.regexes.map(J=>J[1]);this.matcherRe=b(M(F,{joinWith:"|"}),!0),this.lastIndex=0}exec(F){this.matcherRe.lastIndex=this.lastIndex;const J=this.matcherRe.exec(F);if(!J)return null;const Se=J.findIndex((Xt,In)=>In>0&&Xt!==void 0),Me=this.matchIndexes[Se];return J.splice(0,Se),Object.assign(J,Me)}}class ${constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(F){if(this.multiRegexes[F])return this.multiRegexes[F];const J=new T;return this.rules.slice(F).forEach(([Se,Me])=>J.addRule(Se,Me)),J.compile(),this.multiRegexes[F]=J,J}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(F,J){this.rules.push([F,J]),J.type==="begin"&&this.count++}exec(F){const J=this.getMatcher(this.regexIndex);J.lastIndex=this.lastIndex;let Se=J.exec(F);if(this.resumingScanAtSamePosition()&&!(Se&&Se.index===this.lastIndex)){const Me=this.getMatcher(0);Me.lastIndex=this.lastIndex+1,Se=Me.exec(F)}return Se&&(this.regexIndex+=Se.position+1,this.regexIndex===this.count&&this.considerAll()),Se}}function Ae(z){const F=new $;return z.contains.forEach(J=>F.addRule(J.begin,{rule:J,type:"begin"})),z.terminatorEnd&&F.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&F.addRule(z.illegal,{type:"illegal"}),F}function ce(z,F){const J=z;if(z.isCompiled)return J;[je,et,Jr,Ue].forEach(Me=>Me(z,F)),h.compilerExtensions.forEach(Me=>Me(z,F)),z.__beforeBegin=null,[Be,ft,bt].forEach(Me=>Me(z,F)),z.isCompiled=!0;let Se=null;return typeof z.keywords=="object"&&z.keywords.$pattern&&(z.keywords=Object.assign({},z.keywords),Se=z.keywords.$pattern,delete z.keywords.$pattern),Se=Se||/\w+/,z.keywords&&(z.keywords=tn(z.keywords,h.case_insensitive)),J.keywordPatternRe=b(Se,!0),F&&(z.begin||(z.begin=/\B|\b/),J.beginRe=b(J.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(J.endRe=b(J.end)),J.terminatorEnd=f(J.end)||"",z.endsWithParent&&F.terminatorEnd&&(J.terminatorEnd+=(z.end?"|":"")+F.terminatorEnd)),z.illegal&&(J.illegalRe=b(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map(function(Me){return Gr(Me==="self"?z:Me)})),z.contains.forEach(function(Me){ce(Me,J)}),z.starts&&ce(z.starts,F),J.matcher=Ae(J),J}if(h.compilerExtensions||(h.compilerExtensions=[]),h.contains&&h.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return h.classNameAliases=s(h.classNameAliases||{}),ce(h)}function st(h){return h?h.endsWithParent||st(h.starts):!1}function Gr(h){return h.variants&&!h.cachedVariants&&(h.cachedVariants=h.variants.map(function(b){return s(h,{variants:null},b)})),h.cachedVariants?h.cachedVariants:st(h)?s(h,{starts:h.starts?s(h.starts):null}):Object.isFrozen(h)?s(h):h}var es="11.11.1";class lr extends Error{constructor(b,T){super(b),this.name="HTMLInjectionError",this.html=T}}const pt=n,On=s,cr=Symbol("nomatch"),I=7,R=function(h){const b=Object.create(null),T=Object.create(null),$=[];let Ae=!0;const ce="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]};let F={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function J(O){return F.noHighlightRe.test(O)}function Se(O){let Y=O.className+" ";Y+=O.parentNode?O.parentNode.className:"";const Z=F.languageDetectRe.exec(Y);if(Z){const ye=yt(Z[1]);return ye||(qt(ce.replace("{}",Z[1])),qt("Falling back to no-highlight mode for this block.",O)),ye?Z[1]:"no-highlight"}return Y.split(/\s+/).find(ye=>J(ye)||yt(ye))}function Me(O,Y,Z){let ye="",De="";typeof Y=="object"?(ye=O,Z=Y.ignoreIllegals,De=Y.language):(Pe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pe("10.7.0",`Please use highlight(code, options) instead.
|
|
62
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),De=O,ye=Y),Z===void 0&&(Z=!0);const it={code:ye,language:De};sn("before:highlight",it);const Tt=it.result?it.result:Xt(it.language,it.code,Z);return Tt.code=it.code,sn("after:highlight",Tt),Tt}function Xt(O,Y,Z,ye){const De=Object.create(null);function it(D,U){return D.keywords[U]}function Tt(){if(!G.keywords){Ne.addText(he);return}let D=0;G.keywordPatternRe.lastIndex=0;let U=G.keywordPatternRe.exec(he),ne="";for(;U;){ne+=he.substring(D,U.index);const ue=ze.case_insensitive?U[0].toLowerCase():U[0],He=it(G,ue);if(He){const[gt,gr]=He;if(Ne.addText(ne),ne="",De[ue]=(De[ue]||0)+1,De[ue]<=I&&(mt+=gr),gt.startsWith("_"))ne+=U[0];else{const Fn=ze.classNameAliases[gt]||gt;ot(U[0],Fn)}}else ne+=U[0];D=G.keywordPatternRe.lastIndex,U=G.keywordPatternRe.exec(he)}ne+=he.substring(D),Ne.addText(ne)}function wn(){if(he==="")return;let D=null;if(typeof G.subLanguage=="string"){if(!b[G.subLanguage]){Ne.addText(he);return}D=Xt(G.subLanguage,he,!0,Bn[G.subLanguage]),Bn[G.subLanguage]=D._top}else D=Pt(he,G.subLanguage.length?G.subLanguage:null);G.relevance>0&&(mt+=D.relevance),Ne.__addSublanguage(D._emitter,D.language)}function Ke(){G.subLanguage!=null?wn():Tt(),he=""}function ot(D,U){D!==""&&(Ne.startScope(U),Ne.addText(D),Ne.endScope())}function fr(D,U){let ne=1;const ue=U.length-1;for(;ne<=ue;){if(!D._emit[ne]){ne++;continue}const He=ze.classNameAliases[D[ne]]||D[ne],gt=U[ne];He?ot(gt,He):(he=gt,Tt(),he=""),ne++}}function Pn(D,U){return D.scope&&typeof D.scope=="string"&&Ne.openNode(ze.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(ot(he,ze.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),he=""):D.beginScope._multi&&(fr(D.beginScope,U),he="")),G=Object.create(D,{parent:{value:G}}),G}function _e(D,U,ne){let ue=w(D.endRe,ne);if(ue){if(D["on:end"]){const He=new t(D);D["on:end"](U,He),He.isMatchIgnored&&(ue=!1)}if(ue){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return _e(D.parent,U,ne)}function pr(D){return G.matcher.regexIndex===0?(he+=D[0],1):(ln=!0,0)}function Oe(D){const U=D[0],ne=D.rule,ue=new t(ne),He=[ne.__beforeBegin,ne["on:begin"]];for(const gt of He)if(gt&&(gt(D,ue),ue.isMatchIgnored))return pr(U);return ne.skip?he+=U:(ne.excludeBegin&&(he+=U),Ke(),!ne.returnBegin&&!ne.excludeBegin&&(he=U)),Pn(ne,D),ne.returnBegin?0:U.length}function hr(D){const U=D[0],ne=Y.substring(D.index),ue=_e(G,D,ne);if(!ue)return cr;const He=G;G.endScope&&G.endScope._wrap?(Ke(),ot(U,G.endScope._wrap)):G.endScope&&G.endScope._multi?(Ke(),fr(G.endScope,D)):He.skip?he+=U:(He.returnEnd||He.excludeEnd||(he+=U),Ke(),He.excludeEnd&&(he=U));do G.scope&&Ne.closeNode(),!G.skip&&!G.subLanguage&&(mt+=G.relevance),G=G.parent;while(G!==ue.parent);return ue.starts&&Pn(ue.starts,D),He.returnEnd?0:U.length}function Ie(){const D=[];for(let U=G;U!==ze;U=U.parent)U.scope&&D.unshift(U.scope);D.forEach(U=>Ne.openNode(U))}let _t={};function Dn(D,U){const ne=U&&U[0];if(he+=D,ne==null)return Ke(),0;if(_t.type==="begin"&&U.type==="end"&&_t.index===U.index&&ne===""){if(he+=Y.slice(U.index,U.index+1),!Ae){const ue=new Error(`0 width match regex (${O})`);throw ue.languageName=O,ue.badRule=_t.rule,ue}return 1}if(_t=U,U.type==="begin")return Oe(U);if(U.type==="illegal"&&!Z){const ue=new Error('Illegal lexeme "'+ne+'" for mode "'+(G.scope||"<unnamed>")+'"');throw ue.mode=G,ue}else if(U.type==="end"){const ue=hr(U);if(ue!==cr)return ue}if(U.type==="illegal"&&ne==="")return he+=`
|
|
63
|
+
`,1;if(an>1e5&&an>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=ne,ne.length}const ze=yt(O);if(!ze)throw Ze(ce.replace("{}",O)),new Error('Unknown language: "'+O+'"');const mr=Qr(ze);let on="",G=ye||mr;const Bn={},Ne=new F.__emitter(F);Ie();let he="",mt=0,vt=0,an=0,ln=!1;try{if(ze.__emitTokens)ze.__emitTokens(Y,Ne);else{for(G.matcher.considerAll();;){an++,ln?ln=!1:G.matcher.considerAll(),G.matcher.lastIndex=vt;const D=G.matcher.exec(Y);if(!D)break;const U=Y.substring(vt,D.index),ne=Dn(U,D);vt=D.index+ne}Dn(Y.substring(vt))}return Ne.finalize(),on=Ne.toHTML(),{language:O,value:on,relevance:mt,illegal:!1,_emitter:Ne,_top:G}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:O,value:pt(Y),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:vt,context:Y.slice(vt-100,vt+100),mode:D.mode,resultSoFar:on},_emitter:Ne};if(Ae)return{language:O,value:pt(Y),illegal:!1,relevance:0,errorRaised:D,_emitter:Ne,_top:G};throw D}}function In(O){const Y={value:pt(O),illegal:!1,relevance:0,_top:z,_emitter:new F.__emitter(F)};return Y._emitter.addText(O),Y}function Pt(O,Y){Y=Y||F.languages||Object.keys(b);const Z=In(O),ye=Y.filter(yt).filter(dr).map(Ke=>Xt(Ke,O,!1));ye.unshift(Z);const De=ye.sort((Ke,ot)=>{if(Ke.relevance!==ot.relevance)return ot.relevance-Ke.relevance;if(Ke.language&&ot.language){if(yt(Ke.language).supersetOf===ot.language)return 1;if(yt(ot.language).supersetOf===Ke.language)return-1}return 0}),[it,Tt]=De,wn=it;return wn.secondBest=Tt,wn}function nn(O,Y,Z){const ye=Y&&T[Y]||Z;O.classList.add("hljs"),O.classList.add(`language-${ye}`)}function yn(O){let Y=null;const Z=Se(O);if(J(Z))return;if(sn("before:highlightElement",{el:O,language:Z}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(F.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(O)),F.throwUnescapedHTML))throw new lr("One of your code blocks includes unescaped HTML.",O.innerHTML);Y=O;const ye=Y.textContent,De=Z?Me(ye,{language:Z,ignoreIllegals:!0}):Pt(ye);O.innerHTML=De.value,O.dataset.highlighted="yes",nn(O,Z,De.language),O.result={language:De.language,re:De.relevance,relevance:De.relevance},De.secondBest&&(O.secondBest={language:De.secondBest.language,relevance:De.secondBest.relevance}),sn("after:highlightElement",{el:O,result:De,text:ye})}function Mn(O){F=On(F,O)}const Ye=()=>{ht(),Pe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Nt(){ht(),Pe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ve=!1;function ht(){function O(){ht()}if(document.readyState==="loading"){Ve||window.addEventListener("DOMContentLoaded",O,!1),Ve=!0;return}document.querySelectorAll(F.cssSelector).forEach(yn)}function Rn(O,Y){let Z=null;try{Z=Y(h)}catch(ye){if(Ze("Language definition for '{}' could not be registered.".replace("{}",O)),Ae)Ze(ye);else throw ye;Z=z}Z.name||(Z.name=O),b[O]=Z,Z.rawDefinition=Y.bind(null,h),Z.aliases&&Dt(Z.aliases,{languageName:O})}function ur(O){delete b[O];for(const Y of Object.keys(T))T[Y]===O&&delete T[Y]}function rn(){return Object.keys(b)}function yt(O){return O=(O||"").toLowerCase(),b[O]||b[T[O]]}function Dt(O,{languageName:Y}){typeof O=="string"&&(O=[O]),O.forEach(Z=>{T[Z.toLowerCase()]=Y})}function dr(O){const Y=yt(O);return Y&&!Y.disableAutodetect}function ts(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=Y=>{O["before:highlightBlock"](Object.assign({block:Y.el},Y))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=Y=>{O["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function vn(O){ts(O),$.push(O)}function Ln(O){const Y=$.indexOf(O);Y!==-1&&$.splice(Y,1)}function sn(O,Y){const Z=O;$.forEach(function(ye){ye[Z]&&ye[Z](Y)})}function ns(O){return Pe("10.7.0","highlightBlock will be removed entirely in v12.0"),Pe("10.7.0","Please use highlightElement now."),yn(O)}Object.assign(h,{highlight:Me,highlightAuto:Pt,highlightAll:ht,highlightElement:yn,highlightBlock:ns,configure:Mn,initHighlighting:Ye,initHighlightingOnLoad:Nt,registerLanguage:Rn,unregisterLanguage:ur,listLanguages:rn,getLanguage:yt,registerAliases:Dt,autoDetection:dr,inherit:On,addPlugin:vn,removePlugin:Ln}),h.debugMode=function(){Ae=!1},h.safeMode=function(){Ae=!0},h.versionString=es,h.regex={concat:E,lookahead:m,either:C,optional:v,anyNumberOfTimes:g};for(const O in ae)typeof ae[O]=="object"&&e(ae[O]);return Object.assign(h,ae),h},H=R({});return H.newInstance=()=>R({}),ys=H,H.HighlightJS=H,H.default=H,ys}var $u=Wu();const Tn=ai($u);function Vu(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function qu(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={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,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={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},v={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},k=[s,{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}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},v,E,i,a],C=[...k];return C.pop(),C.push(l),g.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}function Xu(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const r={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,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],C={match:/(\/[a-z._-]+)+/},j=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],y=["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"],M=["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:E,literal:k,built_in:[...j,...w,"set","shopt",...y,...M]},contains:[g,e.SHEBANG(),v,f,i,a,C,l,c,u,d,n]}}Tn.registerLanguage("json",Vu);Tn.registerLanguage("yaml",qu);Tn.registerLanguage("bash",Xu);const ma=new fa(Fu({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!Tn.getLanguage(t))return e;try{return Tn.highlight(e,{language:t}).value}catch{return e}}}));ma.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 Zu(e){return ma.parse(e)}const mn=({children:e})=>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-blockquote:text-foreground-muted prose-blockquote:border-border",dangerouslySetInnerHTML:{__html:ea.sanitize(Zu(e))}}):null;function Yu({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 ga({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 Ku({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 Ju({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 Qu({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 $n({IconClass:e,term:t,visibleTerm:n=!0,text:s,href:r,vertical:i=!1,className:a=""}){const l=r?c=>o.jsx("a",{href:r,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:`${s}`,alt:`${s}`}),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:s}),i&&o.jsx(l,{children:s})]})]})}function xi({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 Gu({license:e,externalDocs:t,contact:n,tags:s}){const r=t,i={licenseName:e&&e.name?e.name:null,licenseUrl:e&&e.url?e.url:null,externalDocsTitle:r&&r.description?r.description:"External documentation",externalDocsUrl:r&&r.url?r.url:null,externalDocsDescription:r&&r.description?r.description:null,contactName:n&&n.name?n.name:null,contactUrl:n&&n.url?n.url:null,contactEmail:n&&n.email?n.email:null,tags:s};return o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[i.licenseName&&o.jsx($n,{IconClass:Ju,text:`${i.licenseName} ${Ui}`,term:Ui,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"mb-4 text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx($n,{IconClass:ga,text:Wi,href:i.externalDocsUrl,term:Wi,visibleTerm:!i.externalDocsTitle,className:"mb-4 text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx($n,{IconClass:Yu,text:`${i.contactEmail}`,term:Nl,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"mb-4 text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx($n,{IconClass:Ku,text:`${i.contactName}`,term:Sl,visibleTerm:!i.contactName,href:i.contactUrl,className:"mb-4 text-foreground-secondary hover:text-green-500"})]}),o.jsx("dl",{children:i.tags&&o.jsx($n,{IconClass:Qu,term:Tl,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(xi,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const xa=({title:e,description:t,license:n,externalDocs:s,contact:r,tags:i})=>{const a=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(mn,{children:t})}),l=o.jsx(Gu,{license:n,externalDocs:s,contact:r,tags:i});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(pn,{title:e,content:a,sideContent:l,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0})})};function Xr({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 ed({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M15.6 2l-1.2 3H5.6L4.4 2C3.629 2 3 2.629 3 3.4v15.2c0 .77.629 1.4 1.399 1.4h11.2c.77 0 1.4-.631 1.4-1.4V3.4C17 2.629 16.369 2 15.6 2zm-2 2l.9-2h-2.181L11.6 0H8.4l-.72 2H5.5l.899 2H13.6z"})})}function td({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"})})}const nd=1500;function rd(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 sd(e){try{return await navigator.clipboard.writeText(e),!0}catch{return rd(e)}}function ba({code:e,className:t}){const[n,s]=N.useState("idle"),r=N.useRef(void 0);N.useEffect(()=>()=>clearTimeout(r.current),[]);const i=()=>{sd(e).then(c=>{s(c?"copied":"error"),clearTimeout(r.current),r.current=setTimeout(()=>s("idle"),nd)})},a=Tn.highlight(e,{language:"json"}).value,l=n==="copied"?"Copied":n==="error"?"Copy failed":"Copy to clipboard";return o.jsxs("div",{className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:i,"aria-label":l,title:l,className:"absolute top-2 right-2 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:n==="copied"?o.jsx(td,{className:"w-4 h-4 text-green-600"}):o.jsx(ed,{className:`w-4 h-4 ${n==="error"?"text-red-500":""}`})}),o.jsx("pre",{className:"text-xs rounded overflow-x-auto",children:o.jsx("code",{className:"hljs language-json",dangerouslySetInnerHTML:{__html:ea.sanitize(a)}})})]})}const id=/^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(s=>Bs(s,t));const n={};for(const[s,r]of Object.entries(e))id.test(s)||(n[s]=Bs(r,t));return n}finally{t.delete(e)}}return e}const ya=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Bs(e),null,2);return o.jsx(ba,{code:t})},ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ft=e=>ee(e)?e:null,fo="^[\0-ÿ]*$",od=Math.pow(-2,31),ad=Math.pow(2,31)-1,ld=Math.pow(-2,63),cd=Math.pow(2,63)-1,ud={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"},bi=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Kn(e){const t=bi(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Fs(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const s=Kn(e);s!==void 0&&n[s]&&(t["x-parser-schema-id"]=s)}function po(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function dd(e,t){let n=e,s=t;if(Array.isArray(e)&&e.length>0){const r=e.length>1&&e[0]==="null";n=e[+r],s.oneOf!==void 0&&(s=s.oneOf[0])}return{type:n,jsonSchema:s}}function fd(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 zs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Hs(e,t,n){const{type:s,jsonSchema:r}=dd(e,n);fd(s,t.example,r);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&&(r[l]=t[l])})}switch(s){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(r.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function yi(e,t,n){t!==void 0&&(e[t]=n)}function Jn(e,t){let n={};if(Array.isArray(e))return hd(n,e,t);const s=bi(e),r=typeof e=="string"?e:s.type;switch(n.type=ud[r],r){case"int":{n.minimum=od,n.maximum=ad;break}case"long":{n.minimum=ld,n.maximum=cd;break}case"bytes":{n.pattern=fo;break}case"fixed":{n.pattern=fo,n.minLength=s.size,n.maxLength=s.size;break}case"map":{n.additionalProperties=Jn(s.values,t);break}case"array":{n.items=Jn(s.items,t);break}case"enum":{n.enum=s.symbols;break}case"float":case"double":{n.format=r;break}case"record":{const i=pd(s,t,n);yi(t,Kn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Kn(e)]??(typeof r=="string"?t[r]:void 0);i&&(n=zs(s)?{...i}:i);break}}return Fs(s,n,t),Hs(r,s,n),n}function pd(e,t,n){const s=new Map;for(const r of e.fields??[]){const i=typeof r.type=="string"?t[r.type]:void 0;if(i){const a=zs(r)?{...i}:i;po(r,n,r.default!==void 0),zs(r)&&(Fs(r,a,t),Hs(r.type,r,a)),s.set(r.name,a)}else{const a=Jn(r.type,t);po(r,n,r.default!==void 0),Fs(r,a,t),Hs(r.type,r,a),s.set(r.name,a),yi(t,Kn(r.type),a)}}return s}function hd(e,t,n){const s=[];let r=null;for(const i of t){const a=Jn(i,n);(typeof i=="string"?i:bi(i).type)==="null"?r=a:(s.push(a),yi(n,Kn(i),a))}return r&&s.push(r),e.oneOf=s,e}function Us(e){return Jn(e,{})}const ho=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),md=new Set(["record","enum","array","map","fixed"]),mo=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function vi(e){const t=[];return Nn(e,"schema",t,new Set),t}function Nn(e,t,n,s){if(typeof e=="string"){!ho.has(e)&&!mo.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)=>Nn(i,`${t}[${a}]`,n,s));return}if(!ee(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(s.has(e))return;s.add(e);const r=e.type;if(typeof r!="string"){Array.isArray(r)||ee(r)?Nn(r,`${t}.type`,n,s):n.push(`${t}: missing "type"`);return}if(!ho.has(r)&&!md.has(r)&&!mo.test(r)){n.push(`${t}: unknown Avro type "${r}"`);return}switch(r){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(!ee(i)||typeof i.name!="string"){n.push(`${l}: field must have a string "name"`);return}Nn(i.type,`${l}.type`,n,s)});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"`):Nn(e.items,`${t}.items`,n,s);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):Nn(e.values,`${t}.values`,n,s);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let zr=null,vs=null;const Ws=new Set;function gd(){return vs||(vs=Promise.resolve().then(()=>require("./protoToJsonSchema-8Mm10CIx.cjs")).then(e=>{zr=e.protoToJsonSchema,Ws.forEach(t=>t())})),vs}function xd(){return zr||gd(),zr}function bd(e){return Ws.add(e),()=>Ws.delete(e)}function go(){return zr!==null}function wi(){return N.useSyncExternalStore(bd,go,go)}const yd="x-parser-original-payload",Hr="x-lib-conversion-error",vd=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,wd=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Gn(e){return typeof e=="string"&&vd.test(e)}function er(e){return typeof e=="string"&&wd.test(e)}function va(e){return ee(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function wa(e){var t,n;if(typeof e!="string")return null;if(Gn(e)){const s=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return s?`avro ${s}`:"avro"}if(er(e)){const s=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return s?`protobuf ${s}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function Aa(e){return Gn(e)?"Avro":er(e)?"Protobuf":null}function Ad(e,t){return t?!1:!e||Gn(e)||er(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Ed=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],kd=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function jd(e){return typeof e=="string"||Array.isArray(e)?!0:ee(e)?typeof e.type=="string"&&kd.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Ed.some(t=>t in e):!1}function Ur(e,t){let n=e;if(t&&ee(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const s=Sd(n),r=s.schema.description;if(typeof r=="string")return{...s,description:r};const i=va(n)?n.description:void 0;return typeof i=="string"?{...s,description:i}:s}function Sd(e){var a;if(!va(e))return{schema:Ft(e)??e};const{schemaFormat:t}=e,n=e.schema,s=e[yd],r=(a=Ft(n))==null?void 0:a[Hr];if(typeof r=="string")return{schema:Ft(s)??{},schemaFormat:t,originalSchema:s,conversionError:r};if(s!==void 0)return{schema:Ft(n)??{},schemaFormat:t,originalSchema:s};if(Gn(t)&&jd(n)){const l=vi(n);if(l.length>0)return{schema:Ft(n)??{},schemaFormat:t,originalSchema:n,conversionError:l[0]};try{return{schema:Us(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:Ft(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(er(t)&&typeof n=="string"){const l=xd();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=Ft(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const xo=new Set,Ai=e=>e.replace(/^#\//,"").split("/").pop()??e,$s=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Nd={objects:new Set,refs:new Set},zt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:$s(e)};const s=e.$ref,r=Ai(s);if(n.has(s))return{schema:e,refLabel:r,circular:!0};const i=Ft(t(s));if(!i)return{schema:e,refLabel:r};const{schema:a}=Ur(i);n.add(s);try{const l=zt(a,t,n);return{schema:l.schema,refLabel:l.circular?void 0:r,circular:l.circular}}finally{n.delete(s)}},fn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return ee(n)?n:null},Ea=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},Td=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ee(e.additionalItems)?e.additionalItems:null,_d=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ee(e.contains)?e.contains:null,ka=e=>e.contains!==void 0,Wr=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
64
|
+
|
|
65
|
+
${t}`:t},Cd=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Jt=(e,t,n,s)=>{if(e===t)return e;const r={...e};if(t.description&&(r.description=Wr(typeof r.description=="string"?r.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(r.required=Array.from(new Set([...r.required??[],...t.required]))),t.properties){r.properties={...r.properties??{}};for(const[i,a]of Object.entries(t.properties)){if(!ee(a))continue;const l=r.properties[i];ee(l)?r.properties[i]=Jt(l,a):r.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(r.items)?r.items=t.items.map((i,a)=>{const l=r.items[a];return ee(i)&&ee(l)?Jt(l,i):ee(i)?i:l}):r.items=t.items;else{const i=fn(t),a=fn(r);i&&a?r.items=Jt(a,i):i&&(r.items=t.items)}if(t.patternProperties&&ee(t.patternProperties)){const i={...ee(r.patternProperties)?r.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!ee(l)){i[a]=l;continue}const c=i[a];ee(c)?i[a]=Jt(c,l):i[a]=l}r.patternProperties=i}if(t.propertyNames!==void 0)if(ee(t.propertyNames)){const i=r.propertyNames;r.propertyNames=ee(i)?Jt(i,t.propertyNames):t.propertyNames}else r.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ee(t.additionalProperties)){const i=r.additionalProperties;r.additionalProperties=ee(i)?Jt(i,t.additionalProperties):t.additionalProperties}else r.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Cd.has(i)||a===void 0||(r[i]=a);return r},bo=(e,t,n,s)=>{const r={...e};delete r.allOf,r.properties&&(r.properties=Object.fromEntries(Object.entries(r.properties).map(([u,d])=>ee(d)?[u,Qe(d,t,n,s)]:[u,d])));const i=fn(r);i&&(r.items=Qe(i,t,n,s));const a=rr(r);a!==null&&ee(a)&&(r.propertyNames=Qe(a,t,n,s));const l=_n(r);l!==null&&ee(l)&&(r.additionalProperties=Qe(l,t,n,s));const c=Ei(r);return c.length>0&&(r.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,Qe(d,t,n,s)]))),r},Qe=(e,t,n,s=new Set)=>{if(s.has(e))return e;s.add(e);try{const r=e.allOf;if(Array.isArray(r)&&r.length>0){const i=[];let a={};for(const d of r){if(!ee(d))continue;const{schema:f,circular:m}=zt(d,t,n);if(m)continue;const g=Qe(f,t,n,s);if(g.if!==void 0){const v={if:g.if};g.then!==void 0&&(v.then=g.then),g.else!==void 0&&(v.else=g.else),i.push(v)}i.push(...Na(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=bo(c,t,n,s);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 bo(e,t,n,s)}finally{s.delete(e)}},tr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},nr=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},ja=e=>e.not===void 0?null:typeof e.not=="boolean"||ee(e.not)?e.not:null,nt=e=>ja(e)!==null,Sa=e=>{const{not:t,...n}=e;return n},Od=e=>{const{if:t,then:n,else:s,...r}=e;return r},at=e=>e.if!==void 0,ws=e=>e===void 0?null:typeof e=="boolean"||ee(e)?e:null,Na=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ee(t)):[],lt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,rr=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ee(e.propertyNames)?e.propertyNames:null,_n=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ee(e.additionalProperties)?e.additionalProperties:null,Ei=e=>{const t=e.patternProperties;return ee(t)?Object.entries(t).flatMap(([n,s])=>ee(s)?[[n,s]]:[]):[]},Id=(e,t)=>`${e}.[pattern:${t}]`,sr=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Zr=e=>{const t=rr(e);if(t!==null&&ee(t))return!0;const n=_n(e);return n!==null&&ee(n)?!0:Ei(e).length>0},Ta=e=>!!(tr(e)||nr(e)||sr(e)||Zr(e)||e.type==="array"||e.items||e.type!==void 0),kt=e=>!(nt(e)||at(e)||lt(e)||tr(e)||nr(e)||sr(e)||Zr(e)||e.items||ka(e)||e.type==="array"||e.type==="object");function Md(e){if(typeof _n(e)=="boolean")return!0;const n=rr(e);return!!(typeof n=="boolean"||n!==null&&ee(n)&&kt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function yo(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||Md(e)}const _a=(e,t)=>yo(e)?!0:t?yo(t):!1,Rd=(e,t)=>{if(nt(e)||at(e)||lt(e)||tr(e)||nr(e)||sr(e)||Zr(e))return!0;if(e.type==="array"||e.items){if(ka(e)||Ea(e)!==null)return!0;const n=fn(e);if(!n)return!1;if(n.$ref&&t){const{schema:s}=zt(n,t,xo),r=Qe(s,t,xo);return!kt(r)}return!kt(n)}return!1};function Ca(e){return JSON.stringify(e)}function vo(e){return typeof e=="string"?e:JSON.stringify(e)}function ut({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function Oa({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 Ld(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Pd(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Dd(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Bd(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function wo(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function Ao(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function kr({name:e,lower:t,upper:n,suffix:s}){return!t&&!n?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{children:String(t.value)}),o.jsx(ut,{children:t.op})]}),o.jsx(ut,{children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{children:n.op}),o.jsx(ut,{children:String(n.value)})]}),s&&o.jsx(ut,{children:s})]})}function Rr({value:e,displayValue:t}){const n=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(vo(e))},s=r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),navigator.clipboard.writeText(vo(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:s,children:t??Ca(e)})}function Fd({schema:e}){const t=_n(e);return typeof t!="boolean"?null:o.jsx(ut,{children:t?"additional properties allowed":"additional properties not allowed"})}function zd({schema:e}){const t=rr(e);return typeof t=="boolean"?o.jsx(Oa,{children:t?"any property name":"no property names"}):t!==null&&ee(t)&&kt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"property name pattern:"}),o.jsx(Rr,{value:t.pattern,displayValue:t.pattern})]}):null}function Eo({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,s=Ld(e),r=Pd(e),i=Dd(e),a=Bd(e),l=wo(e,"minItems"),c=Ao(e,"maxItems"),u=wo(e,"minProperties"),d=Ao(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(ut,{children:"multiple of :"}),o.jsx(Oa,{children:String(e.multipleOf)})]}),(s||r)&&o.jsx(kr,{name:t,lower:s,upper:r}),(i||a)&&o.jsx(kr,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(kr,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(kr,{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(ut,{children:"regex pattern:"}),o.jsx(Rr,{value:e.pattern,displayValue:e.pattern})]}),n&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(ut,{children:"enum values:"}),n.map((f,m)=>o.jsx(Rr,{value:f},`${m}-${Ca(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"const value:"}),o.jsx(Rr,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(ut,{children:"unique"}),o.jsx(Fd,{schema:e}),o.jsx(zd,{schema:e})]})}function Ia({schema:e,itemSchema:t,fieldName:n,className:s="flex flex-col gap-1"}){const r=t!=null&&kt(t),i=n??"value";return o.jsxs("div",{className:s,children:[o.jsx(Eo,{schema:e,rangeName:i}),r&&o.jsx(Eo,{schema:t,rangeName:"item"})]})}const Ma=(e,t)=>{const n=tr(e);if(n)return{text:`one of (${n.length})`};const s=nr(e);if(s)return{text:`any of (${s.length})`};if(nt(e)&&!Ta(Sa(e)))return{text:"not"};if(e.type==="array"||e.items){const u=fn(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?Ai(u.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const r=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=r?`${r}`:"type: unknown";const a=_n(e);!sr(e)&&a!==null&&ee(a)&&(r==="object"||i==="type: unknown")&&(i=r==="object"?"object (map)":"map");const l=typeof e.format=="string"?e.format:void 0,c=t&&(r==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:l,refHint:c}},Hd=(e,t)=>{if(!t)return!1;const n=Ma(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Ra({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:s,format:r,refHint:i}=Ma(e,t);return o.jsxs("span",{className:n,children:[r??s,i&&!s.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const ko="ml-6";function jr({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(Ra,{schema:e})]}),_a(e)&&o.jsx(Ia,{schema:e,className:`flex flex-col gap-1 mt-1 ${ko}`}),n&&n.split(`
|
|
66
|
+
|
|
67
|
+
`).map((s,r)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${ko} leading-relaxed`,children:s},r))]})}function As({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 Ud({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 La({tabs:e,selected:t,onChange:n,ariaLabel:s}){const r=N.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=r.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":s,children:e.map(({id:l,label:c},u)=>{const d=l===t;return o.jsx("button",{ref:f=>{r.current[u]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>n(l),onKeyDown:f=>a(f,u),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:c},l)})})}function Wd({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:s,onSelectCase:r,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(La,{tabs:a.map((u,d)=>({id:String(d),label:u})),selected:String(s),onChange:u=>r(Number(u)),ariaLabel:c}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const $d="ml-0 border-dashed border-border";function un({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:s}=St();return n==="none"?o.jsx("div",{children:t}):n==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${$d}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Js(e,s)},children:t})}function Vd({depth:e,expanded:t,onToggle:n}){const{depthColors:s}=St(),r=Js(e,s);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:r,color:r},children:t?"−":"+"}),!t&&o.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const qd="ml-6";function tt({id:e,path:t,depth:n,schema:s,refLabel:r,itemSchema:i,typeLabelOverride:a,required:l,description:c,expandable:u,expanded:d,onToggle:f,showBorder:m=!0}){const{depthColors:g}=St(),v=Js(n,g),E=s&&Hd(s,r),k=u?qd:"";let C="",j=t;if(t.endsWith("[]")){const w=t.slice(0,-2),y=w.lastIndexOf(".");y>=0?(C=w.slice(0,y+1),j=`${w.slice(y+1)}[]`):j=t}else{const w=t.lastIndexOf("."),y=t.lastIndexOf("[]"),M=Math.max(w,y);M>=0&&(C=t.slice(0,M+(t[M]==="."?1:2)),j=t.slice(M+(t[M]==="."?1:2)))}return m=m&&!d,o.jsxs("div",{id:e,className:`py-2 ${m?"border-b border-gray-200 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:[C&&o.jsx("span",{className:"text-foreground-muted",children:C}),o.jsx("span",{className:"font-semibold",style:{color:v},children:j})]}),l&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(s==null?void 0:s.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(s==null?void 0:s.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(s==null?void 0:s.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),s?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(Ra,{schema:s,refLabel:r}),E&&o.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",r,")"]})]}):a&&o.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:a})]}),s&&_a(s,i)&&o.jsx(Ia,{schema:s,itemSchema:i,fieldName:j,className:`flex flex-col gap-1 mt-1 ${k}`}),c&&c.split(`
|
|
68
|
+
|
|
69
|
+
`).map((w,y)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${k} leading-relaxed`,children:w},y)),u&&o.jsx(Vd,{depth:n,expanded:d,onToggle:f})]})}function Es({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 Xd({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(un,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(Es,{label:"If schema matches:",children:e}),t!=null&&o.jsx(Es,{label:"Then schema should follow:",children:t}),n!=null&&o.jsx(Es,{label:"Else schema should follow:",children:n})]})})]})}function Sr({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 Zd=e=>e==="none"?"depth":e;function Et({schema:e,path:t,depth:n,required:s,refStack:r,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=Nd,focusTokens:d=null,focusId:f=null}){var dt;const m=Zd(l),g=d!=null,E=g&&d.length===0?f??void 0:void 0,[k,C]=N.useState(c||g),[j,w]=N.useState(c);j!==c&&(w(c),C(c||g)),N.useEffect(()=>{g&&C(!0)},[g]);const[y,M]=N.useState(0),S=(dt=d==null?void 0:d[0])==null?void 0:dt.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),_=S?Number(S[1]):-1;N.useEffect(()=>{_>=0&&M(_)},[_]);const K=wi(),{schema:A,refLabel:B,circular:X}=N.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:$s(e),circular:!0};const W=zt(e,i,r);return W.circular?W:{...W,schema:Qe(W.schema,i,r)}},[e,i,r,u,K]),le=N.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),se=Sa(Od(A)),Ee=!Ta(se)&&(nt(A)||at(A)||lt(A)),fe=()=>{const W=ja(A);if(W===null)return null;if(typeof W=="boolean")return o.jsx(As,{children:o.jsx(Ud,{value:W})});const oe=zt(W,i,r);if(oe.circular)return o.jsx(As,{children:o.jsx(tt,{path:t,depth:n+1,typeLabelOverride:`↩ ${W.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ge=Qe(oe.schema,i,r),ae=kt(ge);return o.jsx(As,{children:ae?o.jsx(jr,{schema:ge,showBorder:!1}):o.jsx(Et,{schema:W,path:t,depth:n+1,refStack:r,deref:i,ancestors:le,suppressRow:!0,branchLineVariant:m,defaultExpanded:c})})},Ce=(W,oe)=>{if(typeof W=="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:W?"any value":"false schema"});const ge=zt(W,i,r);if(ge.circular)return o.jsx(tt,{path:oe,depth:n+1,typeLabelOverride:`↩ ${W.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ae=Qe(ge.schema,i,r);return kt(ae)?o.jsx(jr,{schema:ae,showBorder:!1}):o.jsx(Et,{schema:W,path:oe,depth:n+1,refStack:r,deref:i,ancestors:le,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},ie=W=>{const oe=ws(W.if);if(oe===null)return null;const ge=ws(W.then),ae=ws(W.else);return o.jsx(Xd,{ifContent:Ce(oe,t),thenContent:ge!==null?Ce(ge,t):void 0,elseContent:ae!==null?Ce(ae,t):void 0})},Te=()=>{const W=Na(A);return W.length===0?null:o.jsx(o.Fragment,{children:W.map((oe,ge)=>o.jsx("div",{children:ie(oe)},ge))})};if(X)return o.jsx(tt,{id:E,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??B??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(Ee){const W=o.jsxs(o.Fragment,{children:[nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]});return a?W:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:t,depth:n,schema:A,refLabel:B,required:s,description:A.description,expandable:!0,expanded:k,onToggle:()=>C(oe=>!oe)}),k&&o.jsx(un,{depth:n,lineVariant:l,children:W})]})}const be=tr(se),$e=nr(se),pe=be??$e,$t=be?"oneOf":"anyOf";if(pe){const W=pe.map((Ue,Le)=>typeof Ue.title=="string"?Ue.title:`case ${Le+1}`),oe=a?1:n+1,ge=pe[y],ae=zt(ge,i,r),ke=ae.circular?ae.schema:Qe(ae.schema,i,r),je=!ae.circular&&kt(ke),Be=d&&_===y?d.slice(1):null,ft=je?o.jsx(jr,{schema:ke,showBorder:!1}):o.jsx(Et,{schema:ge,path:t,depth:oe-1,refStack:r,deref:i,ancestors:le,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:Be,focusId:f},y),et=o.jsx(Wd,{variant:$t,caseCount:pe.length,caseLabels:W,selectedCase:y,onSelectCase:M,children:ft}),bt=o.jsxs(o.Fragment,{children:[et,nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]});return a?bt:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:t,depth:n,schema:A,refLabel:B,required:s,description:A.description,expandable:!0,expanded:k,onToggle:()=>C(Ue=>!Ue)}),k&&o.jsx(un,{depth:n,lineVariant:l,children:bt})]})}const te=(W,oe,ge)=>{const ae=zt(W,i,r);if(ae.circular)return o.jsx(tt,{path:oe,depth:ge,typeLabelOverride:`↩ ${W.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ke=Qe(ae.schema,i,r);return kt(ke)?o.jsx(jr,{schema:ke,showBorder:!1}):o.jsx(Et,{schema:W,path:oe,depth:ge,refStack:r,deref:i,ancestors:le,branchLineVariant:m,defaultExpanded:c})},Rt=W=>{const oe=se.properties??{},ge=new Set(se.required??[]),ae=rr(se),ke=_n(se),je=Ei(se);return o.jsxs(o.Fragment,{children:[Object.entries(oe).map(([Be,ft])=>{if(!ee(ft))return null;const et=d&&d[0]==="properties"&&d[1]===Be?d.slice(2):null;return o.jsx(Et,{schema:ft,path:`${t}.${Be}`,depth:W,required:ge.has(Be),refStack:r,deref:i,ancestors:le,branchLineVariant:m,defaultExpanded:c,focusTokens:et,focusId:f},Be)}),ae!==null&&ee(ae)&&o.jsx(Sr,{label:"Property names must adhere to:",children:te(ae,`${t}.[propertyName]`,W)}),je.map(([Be,ft])=>o.jsx(Et,{schema:ft,path:Id(t,Be),depth:W,refStack:r,deref:i,ancestors:le,branchLineVariant:m,defaultExpanded:c},Be)),ke!==null&&ee(ke)&&o.jsx(Sr,{label:"Additional properties must adhere to:",children:te(ke,`${t}.[additionalProperty]`,W)}),nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]})};if(sr(se)||Zr(se))return a?Rt(n+1):o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:t,depth:n,schema:A,refLabel:B,required:s,description:A.description,expandable:!0,expanded:k,onToggle:()=>C(W=>!W)}),k&&o.jsx(un,{depth:n,lineVariant:l,children:Rt(n+1)})]});if(se.type==="array"||se.items){const W=Ea(se),oe=W!==null,ge=oe?Td(se):null,ae=_d(se),ke=ae!==null,je=oe?null:fn(se),Be=je!==null,ft=oe||Be||ke||nt(A)||at(A)||lt(A),et=`${t}[]`,bt=Be?zt(je,i,r):null,Ue=(bt==null?void 0:bt.schema)??null,Le=Ue?Qe(Ue,i,r):null,Vt=Ue!==null&&(le.objects.has(Ue)||typeof(je==null?void 0:je.$ref)=="string"&&le.refs.has(je.$ref)),tn=Ue!==null?{objects:new Set(le.objects).add(Ue),refs:typeof(je==null?void 0:je.$ref)=="string"?new Set(le.refs).add(je.$ref):le.refs}:le,gn=!oe&&!ke&&Le!==null&&kt(Le),xn=Le!=null&&Le.properties?Object.entries(Le.properties).filter(([,Pe])=>ee(Pe)):[],bn=new Set(Le&&Array.isArray(Le.required)?Le.required:[]),Ze=!oe&&d&&d[0]==="items"?d.slice(1):null,qt=Pe=>o.jsxs(o.Fragment,{children:[oe?o.jsxs(o.Fragment,{children:[W.map((rt,Lt)=>o.jsx(Et,{schema:rt,path:`${t}[${Lt}]`,depth:Pe,refStack:r,deref:i,ancestors:le,branchLineVariant:m,defaultExpanded:c},Lt)),ge!==null&&typeof ge!="boolean"&&o.jsx(Sr,{label:"Additional items:",children:te(ge,`${t}[*]`,Pe)}),ge===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):Be&&(Vt?o.jsx(tt,{path:et,depth:Pe,typeLabelOverride:`↩ ${je.$ref??$s(Ue)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):xn.length>0?xn.map(([rt,Lt])=>{const Cn=Ze&&Ze[0]==="properties"&&Ze[1]===rt?Ze.slice(2):null;return o.jsx(Et,{schema:Lt,path:`${t}[].${rt}`,depth:Pe,required:bn.has(rt),refStack:r,deref:i,ancestors:tn,branchLineVariant:m,defaultExpanded:c,focusTokens:Cn,focusId:f},rt)}):o.jsx(Et,{schema:je,path:et,depth:Pe,refStack:r,deref:i,ancestors:tn,branchLineVariant:m,defaultExpanded:c,focusTokens:Ze,focusId:f})),ke&&o.jsx(Sr,{label:"Contains at least one:",children:typeof ae=="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:ae?"any item":"impossible constraint"}):te(ae,`${t}[contains]`,Pe)}),nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]});return gn&&!nt(A)&&!at(A)&&!lt(A)?o.jsx(tt,{id:E,path:et,depth:n,schema:A,itemSchema:Le,refLabel:B,required:s,description:Wr(A.description,Le.description),expandable:!1,expanded:!1,onToggle:()=>{}}):gn?o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:et,depth:n,schema:A,itemSchema:Le,refLabel:B,required:s,description:Wr(A.description,Le.description),expandable:!0,expanded:k,onToggle:()=>C(Pe=>!Pe)}),k&&o.jsxs(un,{depth:n,lineVariant:l,children:[nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]})]}):a?ft?qt(n+1):null:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:et,depth:n,schema:A,itemSchema:Le,refLabel:B,required:s,description:A.description,expandable:oe||Be||ke||nt(A)||at(A)||lt(A),expanded:k,onToggle:()=>C(Pe=>!Pe)}),k&&o.jsx(un,{depth:n,lineVariant:l,children:qt(n+1)})]})}if(nt(A)||at(A)||lt(A)){const W=o.jsxs(o.Fragment,{children:[nt(A)&&fe(),at(A)&&ie(A),lt(A)&&Te()]});return a?W:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:E,path:t,depth:n,schema:A,refLabel:B,required:s,description:A.description,expandable:!0,expanded:k,onToggle:()=>C(oe=>!oe)}),k&&o.jsx(un,{depth:n,lineVariant:l,children:W})]})}return a?null:o.jsx(tt,{id:E,path:t,depth:n,schema:A,refLabel:B,required:s,description:A.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function ki({schema:e,rootName:t,className:n="",focusTokens:s=null,focusId:r=null}){const{deref:i,defaultSchemaExpanded:a=!1}=St(),l=N.useMemo(()=>new Set,[]),c=Ft(e),u=N.useMemo(()=>c?Qe(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?Ai(c.$ref):void 0)??"schema",f=!!t;if(!Rd(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:n,children:o.jsx(Et,{schema:c,path:d,depth:0,refStack:l,deref:i,defaultExpanded:a,focusTokens:s,focusId:r})}):null;const g=u.type==="array"||u.items?`${d}[]`:d,v=fn(u),E=v?Qe(v,i,l):null,k=E!==null&&kt(E);return o.jsx("div",{className:n,children:o.jsx(tt,{path:g,depth:0,schema:u,itemSchema:k?E:void 0,description:u.type==="array"||u.items?Wr(u.description,v==null?void 0:v.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:n,children:o.jsx(Et,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:s,focusId:r})})}function Yd(e){let t=e|0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function Pa(e){let t=Yd(e),n={next(){return t()},int(s,r){return s+Math.floor(n.next()*(r-s+1))},bool(s=.5){return n.next()<s},pick(s){return s[n.int(0,s.length-1)]},shuffle(s){let r=[...s];for(let i=r.length-1;i>0;i--){let a=n.int(0,i);[r[i],r[a]]=[r[a],r[i]]}return r},fork(){let s=Math.floor(n.next()*4294967296);return Pa(s)}};return n}function Kd(e){return null}function Jd(e){return e.random.bool()}function Da(e,t,n=!1){let s=-1e3,r=1e3,i=!1,a=!1;if(e.minimum!==void 0&&(s=e.minimum),e.maximum!==void 0&&(r=e.maximum),e.exclusiveMinimum!==void 0&&(s=e.exclusiveMinimum,i=!0),e.exclusiveMaximum!==void 0&&(r=e.exclusiveMaximum,a=!0),e.multipleOf!==void 0)return Qd(e.multipleOf,s,r,i,a,t);if(n){let u=i?Math.floor(s)+1:Math.ceil(s),d=a?Math.ceil(r)-1:Math.floor(r);return t.random.int(u,d)}let l=i?s+Number.EPSILON:s,c=a?r-Number.EPSILON:r;return l+t.random.next()*(c-l)}function Qd(e,t,n,s,r,i){let a=Math.ceil(t/e),l=Math.floor(n/e);return s&&a*e===t&&a++,r&&l*e===n&&l--,a>l?a*e:i.random.int(a,l)*e}function Gd(e,t){if(e.autoIncrement){let n=e.initialOffset??1,s=ef(t.path),r=t.autoIncrementCounters??new Map,i=(r.get(s)??n-1)+1;return r.set(s,i),t.autoIncrementCounters&&t.autoIncrementCounters.set(s,i),i}return Da(e,t,!0)}function ef(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function jo(e,t){let n=Ba(e,0);return qn(n.node,t)}function qn(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return tf(e,t);case"sequence":return e.nodes.map(n=>qn(n,t)).join("");case"alternation":return qn(t.pick(e.branches),t);case"quantifier":{let n=t.int(e.min,Math.min(e.max,e.min+5));return Array.from({length:n},()=>qn(e.node,t)).join("")}case"group":return qn(e.node,t)}}function tf(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),s=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(r=>!n.has(r));return s.length>0?t.pick(s):"a"}function Ba(e,t){let n=[],s=[];for(;t<e.length;){let r=e[t];if(r===")")break;if(r==="|"){n.push(So(s)),s=[],t++;continue}if(r==="("){let l=t+1;if(e[l]==="?")if(e[l+1]===":")l+=2;else if(e[l+1]==="="||e[l+1]==="!"){let f=1,m=l;for(;m<e.length&&f>0;)m++,e[m]==="("&&f++,e[m]===")"&&f--;t=m+1;continue}else{for(l+=2;l<e.length&&e[l]!==">";)l++;l++}let c=Ba(e,l),u={type:"group",node:c.node};t=c.pos+1;let d=Vn(e,t,u);s.push(d.node),t=d.pos;continue}if(r==="["){let l=rf(e,t),c=Vn(e,l.pos,l.node);s.push(c.node),t=c.pos;continue}if(r==="."){let l={type:"dot"};t++;let c=Vn(e,t,l);s.push(c.node),t=c.pos;continue}if(r==="^"||r==="$"){s.push({type:"anchor"}),t++;continue}if(r==="\\"){t++;let l=nf(e,t);t=l.pos;let c=Vn(e,t,l.node);s.push(c.node),t=c.pos;continue}let i={type:"literal",value:r};t++;let a=Vn(e,t,i);s.push(a.node),t=a.pos}return n.push(So(s)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function So(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function nf(e,t){let n=e[t];switch(t++,n){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:t};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:t};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:t};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:t};case"s":return{node:{type:"charClass",chars:[...`
|
|
70
|
+
`],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
|
|
71
|
+
`],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function rf(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let s=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let r=e[t];switch(r){case"d":s.push(..."0123456789");break;case"w":s.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":s.push(...`
|
|
72
|
+
`);break;default:s.push(r)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let r=e.charCodeAt(t),i=e.charCodeAt(t+2);for(let a=r;a<=i;a++)s.push(String.fromCharCode(a));t+=3;continue}s.push(e[t]),t++}return t++,{node:{type:"charClass",chars:s,negated:n},pos:t}}function Vn(e,t,n){if(t>=e.length)return{node:n,pos:t};let s=e[t],r,i;switch(s){case"*":r=0,i=5,t++;break;case"+":r=1,i=5,t++;break;case"?":r=0,i=1,t++;break;case"{":{let a=sf(e,t);if(a)r=a.min,i=a.max,t=a.pos;else return{node:n,pos:t};break}default:return{node:n,pos:t}}return t<e.length&&(e[t]==="?"||e[t]==="+")&&t++,{node:{type:"quantifier",node:n,min:r,max:i},pos:t}}function sf(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let s=parseInt(n[1],10),r;return n[2]===void 0?r=s:n[2]===""?r=s+5:r=parseInt(n[2],10),{min:s,max:r,pos:t+n[0].length}}function jt(e){return e<10?`0${e}`:`${e}`}function of(e,t){return new Date(e,t,0).getDate()}var Fa="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function af(e){return!(e==="^"||e==="$"||e==="^$")}function lf(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return cf(t);let a=t.formatRegistry.get(e.format);if(a){let l=a(t.random),c=t.minLength??e.minLength,u=t.maxLength??e.maxLength;return c!==void 0&&l.length<c?ks(l,c,t):u!==void 0&&l.length>u?l.slice(0,u):l}}if(e.pattern){let a=t.minLength??e.minLength,l=t.maxLength??e.maxLength;for(let d=0;d<50;d++){let f=jo(e.pattern,t.random);if(!(a!==void 0&&f.length<a)&&!(l!==void 0&&f.length>l))return f}let c=jo(e.pattern,t.random),u=af(e.pattern);return a!==void 0&&c.length<a&&u?ks(c,a,t):l!==void 0&&c.length>l?c.slice(0,l):c}let n=e.minLength??0,s=e.maxLength??Math.max(n+10,10),r=t.random.int(n,s),i="";for(let a=0;a<r;a++)i+=t.random.pick([...Fa]);return t.maxLength!==void 0&&i.length>t.maxLength&&(i=i.slice(0,t.maxLength)),t.minLength!==void 0&&i.length<t.minLength&&(i=ks(i,t.minLength,t)),i}function ks(e,t,n){for(;e.length<t;)e+=n.random.pick([...Fa]);return e}function cf(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,s=t.getTime(),r=n.getTime(),i=s+e.random.next()*(r-s),a=new Date(i),l=a.getFullYear(),c=jt(a.getMonth()+1),u=jt(a.getDate());return`${l}-${c}-${u}T01:01:01.0Z`}function No(e,t){if(e.const!==void 0)return structuredClone(e.const);if(e.enum!==void 0&&e.enum.length>0){let n=e.enum;if(e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0){let r=e.exclusiveMinimum??e.minimum??-1/0,i=e.exclusiveMaximum??e.maximum??1/0,a=e.exclusiveMinimum!==void 0,l=e.exclusiveMaximum!==void 0;n=n.filter(c=>{if(typeof c!="number")return!0;let u=a?c>r:c>=r,d=l?c<i:c<=i;if(!u||!d)return!1;if(e.multipleOf!==void 0){let f=e.multipleOf,m=f.toString().includes(".")?f.toString().split(".")[1].length:0,g=Math.pow(10,m),v=Math.round(c*g),E=Math.round(f*g);if(v%E!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let r=e.minLength??0,i=e.maxLength??1/0;n=n.filter(a=>typeof a!="string"?!0:a.length>=r&&a.length<=i)}if(e.minItems!==void 0||e.maxItems!==void 0){let r=e.minItems??0,i=e.maxItems??1/0;n=n.filter(a=>Array.isArray(a)?a.length>=r&&a.length<=i:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let r=e.minProperties??0,i=e.maxProperties??1/0;n=n.filter(a=>typeof a!="object"||a===null||Array.isArray(a)?!0:Object.keys(a).length>=r&&Object.keys(a).length<=i)}if(n.length===0){let r=[];throw e.minLength!==void 0&&r.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&r.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&r.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&r.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&r.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&r.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&r.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&r.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&r.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&r.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&r.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${r.join(", ")}] at ${t.path}`)}let s=t.random.pick(n);return typeof s=="object"&&s!==null?structuredClone(s):s}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Mt(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}Ha(t,n)}return t}function za(e,t){if(typeof e=="boolean"||typeof t=="boolean")return{};if(typeof e!="object"||e===null)return typeof t=="object"&&t!==null?t:{};if(typeof t!="object"||t===null)return e;let n={...e};return Ha(n,t),n}function Ha(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=uf(e.type,t.type)),t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.max(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.min(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=e.exclusiveMinimum!==void 0?Math.max(e.exclusiveMinimum,t.exclusiveMinimum):t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=e.exclusiveMaximum!==void 0?Math.min(e.exclusiveMaximum,t.exclusiveMaximum):t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.max(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.min(e.maxLength,t.maxLength):t.maxLength),t.pattern!==void 0&&(e.pattern=t.pattern),t.format!==void 0&&(e.format=t.format),t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.max(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.min(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.items!==void 0&&(e.items=t.items),t.prefixItems!==void 0)if(e.prefixItems===void 0)e.prefixItems=t.prefixItems;else{let n=[],s=Math.max(e.prefixItems.length,t.prefixItems.length);for(let r=0;r<s;r++){let i=e.prefixItems[r],a=t.prefixItems[r];i!==void 0&&a!==void 0?n.push(za(i,a)):i!==void 0?n.push(i):a!==void 0&&n.push(a)}e.prefixItems=n}if(t.contains!==void 0&&(e.containsAll!==void 0?e.containsAll=[...e.containsAll,t.contains]:e.contains!==void 0?(e.containsAll=[e.contains,t.contains],delete e.contains):e.contains=t.contains),t.properties&&(e.properties=df(e.properties??{},t.properties)),t.required&&(e.required=[...new Set([...e.required??[],...t.required])]),t.additionalProperties!==void 0&&(e.additionalProperties=t.additionalProperties),t.patternProperties&&(e.patternProperties={...e.patternProperties??{},...t.patternProperties}),t.minProperties!==void 0&&(e.minProperties=e.minProperties!==void 0?Math.max(e.minProperties,t.minProperties):t.minProperties),t.maxProperties!==void 0&&(e.maxProperties=e.maxProperties!==void 0?Math.min(e.maxProperties,t.maxProperties):t.maxProperties),t.const!==void 0&&(e.const=t.const),t.enum!==void 0)if(e.enum!==void 0){let n=new Set(t.enum.map(s=>JSON.stringify(s)));e.enum=e.enum.filter(s=>n.has(JSON.stringify(s)))}else e.enum=t.enum;t.$ref&&(e.$ref=t.$ref),t.$defs&&(e.$defs={...e.$defs??{},...t.$defs}),t.allOf&&(e.allOf=[...e.allOf??[],...t.allOf]),t.anyOf&&(e.anyOf=t.anyOf),t.oneOf&&(e.oneOf=t.oneOf)}function uf(e,t){let n=Array.isArray(e)?e:[e],s=Array.isArray(t)?t:[t],r=n.filter(i=>s.includes(i));return r.length===0?n[0]:r.length===1?r[0]:r}function df(e,t){let n={...e};for(let[s,r]of Object.entries(t)){let i=e[s];i===void 0?n[s]=r:typeof i=="object"&&typeof r=="object"?n[s]=za(i,r):n[s]=r}return n}var Yr=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function Ua(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>Yr.has(t))}function To(e,t){if(typeof t!="object"||t===null)return!1;let n=t;return n.const!==void 0?e===n.const:n.enum!==void 0?n.enum.some(s=>s===e):!1}function ff(e){return typeof e=="boolean"?!e:typeof e!="object"||e===null?!1:e.not===!0||typeof e.not=="object"&&e.not!==null&&Object.keys(e.not).length===0}function pf(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[s,r]of Object.entries(e))Yr.has(s)||(Ua(r)?(t[s]=r,n=!0):(t[s]={const:r},n=!0));if(n)return t}return{}}function hf(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function mf(e,t){var j;let n=pf(e),s=hf(e,n);if(t.depth>=t.maxDepth){if(s.length===0)return{};let w={};for(let y of s){let M=n[y];if(M&&typeof M=="object"&&M!==null){let S=M;S.const!==void 0?w[y]=S.const:S.default!==void 0?w[y]=S.default:S.enum!==void 0&&S.enum.length>0?w[y]=S.enum[0]:w[y]=yf(S.type)}else w[y]=null}return w}if(e.additionalProperties===!1){let w=Object.keys(n).length>0,y=e.patternProperties&&Object.keys(e.patternProperties).length>0,M=new Set(Object.keys(n)),S=[...new Set(s)].filter(_=>!M.has(_));if((e.minProperties??0)>0&&!w&&!y)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(S.length>0&&!y&&!w)throw Error(`missing properties for ${S.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let r=t.path==="/"?"/properties":`${t.path}/properties`,i={...t,depth:t.depth+1,path:r},a={},l=new Set,c=new Set(s),u=t.alwaysFakeOptionals??!1,d=t.fillProperties??!0,f=t.fixedProbabilities??!1,m=t.optionalsProbability??.5,g=Object.keys(n).filter(w=>!c.has(w)),v;if(f&&!u&&g.length>0){let w=Math.round(g.length*m);v=new Set(g.slice(0,w))}let E=w=>u?!0:v?v.has(w):t.random.bool(m);if(Object.keys(n).length>0)for(let[w,y]of Object.entries(n)){if(ff(y))continue;l.add(w);let M=Yt(i,w),S=c.has(w),_=typeof y=="object"&&y!==null&&y.type==="object",K=y;if(e.patternProperties&&typeof y=="object"&&y!==null){let A=[];for(let[B,X]of Object.entries(e.patternProperties))try{new RegExp(B).test(w)&&A.push(X)}catch{}A.length>0&&(K=Mt([y,...A]))}if(S){let A=await me(K,M);A!==void 0&&(a[w]=A)}else if(E(w)){let A=await me(K,M);A!==void 0&&(a[w]=A)}else if(_&&!d){let A=y.required??[];if(A.length>0){let B={};for(let X of A){let le=(y.properties??{})[X]??{},se=Yt(M,X),Ee=await me(le,se);Ee!==void 0&&(B[X]=Ee)}a[w]=B}}}for(let w of c)if(!(a[w]!==void 0||l.has(w))){if(e.patternProperties){let y=[];for(let[M,S]of Object.entries(e.patternProperties))new RegExp(M).test(w)&&y.push(S);if(y.length>0){let M=y.length===1?y[0]:Mt(y),S=Yt(i,w),_=await me(M,S);_!==void 0&&(a[w]=_),l.add(w)}}if(!l.has(w)){let y=e.additionalProperties??!0;if(y!==!1){let M=Yt(i,w),S=await me(y===!0?{}:y,M);S!==void 0&&(a[w]=S),l.add(w)}}}if(e.dependencies){for(let[w,y]of Object.entries(e.dependencies))if(!(typeof y!="object"||y===null||Array.isArray(y))&&a[w]!==void 0&&!l.has(w+"_dep")){l.add(w+"_dep");let M=y.oneOf??y.anyOf??y.allOf??[y],S=null;for(let _ of M){if(typeof _!="object"||_===null)continue;let{properties:K,not:A}=_;if(K&&K[w]){let B=K[w],X=a[w];if(To(X,B)){S=_;break}}if(A!=null&&A.properties){let B=A.properties[w];if(B){let X=a[w];if(!To(X,B)){S=_;break}}}}if(!S&&M.length>0&&typeof M[0]=="object"&&(S=M[0]),S!=null&&S.not){let _=S.not;if(_.required&&Array.isArray(_.required))for(let K of _.required)delete a[K]}if(S!=null&&S.required)for(let _ of S.required){if(_===w||a[_]!==void 0)continue;let K=((j=S.properties)==null?void 0:j[_])??{type:"object"},A=Yt(i,_),B=await me(K,A);B!==void 0&&(a[_]=B)}if(S&&S.properties)for(let[_,K]of Object.entries(S.properties)){if(_===w)continue;let A=Yt(i,_),B=await me(K,A);B!==void 0&&(a[_]=B)}}}let k=e.minProperties??0,C=e.maxProperties;if(Object.keys(a).length<k){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let w=Object.entries(e.patternProperties),y=0,M=1e3;for(;Object.keys(a).length<k&&y<M;){y++;let[S,_]=t.random.pick(w),K=bf(S,t);if(K&&!a[K]){let A=Yt(i,K),B=await me(_,A);B!==void 0&&(a[K]=B),l.add(K)}}}if(Object.keys(a).length<k){let w=e.additionalProperties,y=w===void 0||w===!0?{type:"string"}:w;if(y!==!1){let M=0,S=1e3;for(;Object.keys(a).length<k&&M<S;){M++;let _=`prop${t.random.int(0,99999)}`;if(!a[_]){let K=Yt(i,_),A=await me(y,K);A!==void 0&&(a[_]=A),l.add(_)}}}}if(Object.keys(a).length<k){let w=Object.keys(n).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${t.path}`)}}if(C!==void 0&&Object.keys(a).length>C){let w=Object.keys(a).filter(y=>!c.has(y));for(t.random.shuffle(w);Object.keys(a).length>C&&w.length>0;){let y=w.pop();delete a[y]}}return t.pruneProperties&&t.pruneProperties.length>0&&Vs(a,t.pruneProperties),xf(a,n),a}function Yt(e,t){let n=gf(t),s=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:s}}function gf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function xf(e,t){for(let[n,s]of Object.entries(t)){if(typeof s!="object"||s===null)continue;let r=s;if(r.template===void 0)continue;let i=r.template;if(typeof i!="string")continue;let a=i.replace(/#\{(\w+)\}/g,(l,c)=>{let u=e[c];return u!==void 0?String(u):""});e[n]=a}}function bf(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let c=n[1],u=n[2];if(u===".*"||u!=null&&u.includes("?:")){let d=t.random.int(0,10),f="";for(let m=0;m<d;m++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return c+f}return c}let s=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(s){let c=s[2],u=t.random.int(1,10),d="";for(let f=0;f<u;f++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return d+c}let r=e.match(/^\^([a-zA-Z]+)\$$/);if(r)return r[1];let i=t.random.int(3,10),a="abcdefghijklmnopqrstuvwxyz",l="";for(let c=0;c<i;c++)l+=t.random.pick(a.split(""));try{if(new RegExp(e).test(l))return l}catch{}return null}function Vs(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let s of e)Vs(s,t);return}let n=e;for(let s of Object.keys(n))t.includes(s)?delete n[s]:Vs(n[s],t)}function yf(e){switch(Array.isArray(e)?e[0]:e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function vf(e,t){var C;if(t.depth>=t.maxDepth){let j=e.minItems??0;return j>0?Array.from({length:j},()=>null):[]}if(t.refDepthReached){let j=e.minItems??0;return j>0?Array.from({length:j},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let j=((C=e.prefixItems)==null?void 0:C.length)??0;if((e.minItems??0)>j)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${j})`)}let n=t.path==="/"?"/items":`${t.path}/items`,s={...t,depth:t.depth+1,path:n},r=[],i=t.refDepthMax,a=t.minItems??e.minItems??0,l=t.maxItems??e.maxItems??Math.max(a,t.maxDefaultItems);e.maxItems!==void 0&&l>e.maxItems&&(l=e.maxItems),e.minItems!==void 0&&a<e.minItems&&(a=e.minItems),l<a&&(e.maxItems!==void 0?a=l:l=a),t.alwaysFakeOptionals&&(l=Math.max(a,l));let c=e.uniqueItems?new Set:null,u=async(j,w)=>{let y=await me(j,w);if(y===void 0)return"omitted";if(c){let M=JSON.stringify(y);if(c.has(M)){for(let S=0;S<50;S++){if(y=await me(j,Kt(s,r.length)),y===void 0)continue;let _=JSON.stringify(y);if(!c.has(_))return c.add(_),r.push(y),"added"}return"failed"}c.add(M)}return r.push(y),"added"};if(e.prefixItems)for(let j=0;j<e.prefixItems.length&&r.length<l;j++){let w=Kt(s,j);if(await u(e.prefixItems[j],w)==="failed")break}let d;if(i!==void 0&&t.refDepth>=i-1){let j=e.minItems??0;return j>0?Array.from({length:j},()=>null):[]}let f=t.alwaysFakeOptionals??!1,m=t.fixedProbabilities??!1,g=t.optionalsProbability??.5;if(f)d=l;else if(m){let j=l-Math.max(a,r.length),w=Math.round(j*g);d=Math.max(a,r.length)+w}else d=t.random.int(Math.max(a,r.length),l);e.items;let v=e.prefixItems!==void 0,E=e.additionalItems!==void 0,k;if(v?E?k=e.additionalItems:e.items!==void 0&&(k=e.items):k=e.items,k!==!1&&k!==void 0){let j=k??{},w=0,y=Math.max(d*20,50);for(;r.length<d;){let M=await u(j,Kt(s,r.length));if(M==="added"){w=0;continue}if(w++,M==="failed"||w>=y)break}}if(e.contains){let j=e.minContains??1,w=e.maxContains??Math.max(j,1),y=t.random.int(j,w);for(let M=0;M<y;M++){let S=await me(e.contains,Kt(s,r.length));if(S!==void 0){if(c){let _=JSON.stringify(S);if(c.has(_)){let K=!1;for(let A=0;A<50;A++){if(S=await me(e.contains,Kt(s,r.length)),S===void 0)continue;let B=JSON.stringify(S);if(!c.has(B)){c.add(B),K=!0;break}}if(!K)continue}else c.add(_)}if(r.length<l){let _=t.random.int(0,r.length);r.splice(_,0,S)}else if(r.length>0){let _=t.random.int(0,r.length-1);r[_]=S}}}for(;r.length>l;)r.pop()}if(e.containsAll){let j=new Set;for(let w of e.containsAll){let y=await me(w,Kt(s,r.length));if(y!==void 0){if(c){let M=JSON.stringify(y);if(c.has(M)){let S=!1;for(let _=0;_<50;_++){if(y=await me(w,Kt(s,r.length)),y===void 0)continue;let K=JSON.stringify(y);if(!c.has(K)){c.add(K),S=!0;break}}if(!S)continue}else c.add(M)}if(r.length<l){let M=t.random.int(0,r.length);r.splice(M,0,y);let S=new Set;for(let _ of j)S.add(_>=M?_+1:_);j.clear();for(let _ of S)j.add(_);j.add(M)}else if(r.length>0){let M=Array.from({length:r.length},(S,_)=>_).filter(S=>!j.has(S));if(M.length>0){let S=M[t.random.int(0,M.length-1)];r[S]=y,j.add(S)}else r.push(y),j.add(r.length-1)}}}for(;r.length>l;)r.pop()}return e.uniqueItems&&r.length>0?wf(r,e,s,a,l,c):r}async function wf(e,t,n,s,r,i){let a=t.items??{},l=0,c=100;for(;e.length<s&&l<c;){l++;let u=await me(a,Kt(n,e.length));if(u===void 0)continue;let d=JSON.stringify(u);i.has(d)||(i.add(d),e.push(u))}for(;e.length>r;)e.pop();return e}function Kt(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function _o(e,t){if(!t||t==="")return e;if(typeof e!="object"||e===null)throw Error(`Cannot resolve fragment "${t}" in non-object schema`);if(t.startsWith("/"))return Af(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function Af(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),s=e;for(let r of n){let i=r.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof s!="object"||s===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${i}"`);if(Array.isArray(s)){let a=parseInt(i,10);if(isNaN(a)||a<0||a>=s.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${i}"`);s=s[a]}else{if(!(i in s))throw Error(`Cannot resolve JSON pointer "${t}": property "${i}" not found`);s=s[i]}}return s}function Ef(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,s=n.$id,{$id:r,...i}=n;t.set(s,i)}if(e.$defs)for(let[n,s]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,s);return t}async function $r(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let s=t.refDepth+1;if(t.refDepthMax!==void 0&&s>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}};if(t.refStack.has(n)){if(t.refDepthMax!==void 0){if(t.refDepth>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}}}else if(t.depth>=t.maxDepth)return{schema:{type:"null"},ctx:t}}let r,i;if(n.startsWith("#/")){if(r=t.refRegistry.get(n),r===void 0&&n.length>2){let f=t.refRegistry.get("#");if(f!==void 0&&typeof f=="object")try{r=_o(f,n.slice(1))}catch{}}r===void 0&&t.refResolver&&(r=await t.refResolver(n),r!==void 0&&t.refRegistry.set(n,r))}else if(n==="#")r=t.refRegistry.get("#")??{};else if(r=t.refRegistry.get(n),r===void 0&&t.refResolver){i=await t.refResolver(n);let f=n.indexOf("#");if(f!==-1){let m=n.slice(f+1);m?r=_o(i,m):r=i}else r=i;if(i&&typeof i=="object"&&i!==null){let m=i;if(m.$defs)for(let[g,v]of Object.entries(m.$defs))t.refRegistry.set(`#/$defs/${g}`,v)}}if(r===void 0)throw Error(`Unresolved $ref: ${n}`);let a=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:l,...c}=e,u=Object.fromEntries(Object.entries(c).filter(([f])=>!a.has(f)));Object.keys(u).length>0&&typeof r=="object"&&r!==null&&(r={...r,...u});let d={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:r,ctx:d}}function kf(e,t){typeof e!="boolean"&&(t.set("#",e),qs(e,"#",t))}function qs(e,t,n){if(e.$id){let{$id:s,...r}=e;n.set(s,r)}if(e.$defs)for(let[s,r]of Object.entries(e.$defs)){let i=`${t}/$defs/${s}`;n.set(i,r),typeof r=="object"&&r!==null&&qs(r,i,n)}if(e.properties)for(let[s,r]of Object.entries(e.properties))typeof r=="object"&&r!==null&&qs(r,`${t}/properties/${s}`,n)}async function jf(e,t){return e.$ref?(await $r(e,t)).schema:e}async function Sf(e,t){let n=[];for(let s of e)if(typeof s=="object"&&s!==null&&"$ref"in s){let r=await jf(s,t);n.push(r)}else typeof s=="object"&&s!==null&&n.push(s);return n}async function Nf(e,t){let{allOf:n,anyOf:s,oneOf:r,not:i,if:a,then:l,else:c,...u}=e;if(n){let d=await Sf(n,t),f=Mt([u,...d]);return me(f,t)}if(r){let d=t.random.shuffle([...r]),f=u.required??[];for(let w of d){let y=typeof w=="object"&&w!==null?w:{};y.$ref&&(y=(await $r(y,t)).schema);let M=y.required??[],S=[...new Set([...f,...M])],_={...u,required:S},K=Mt([_,y]),A={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await me(K,A)}catch{}}let m=r[0],g=typeof m=="object"&&m!==null?m:{};g.$ref&&(g=(await $r(g,t)).schema);let v=g.required??[],E=[...new Set([...f,...v])],k={...u,required:E},C=Mt([k,g]),j={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return me(C,j)}if(s){let d=t.random.shuffle([...s]);for(let g of d){let v=Mt([u,g]);try{return await me(v,t)}catch{}}let f=s[0],m=Mt([u,f]);return me(m,t)}return a!==void 0?Tf(u,a,l,c,t):i?_f(u,i,t):me(u,t)}async function Tf(e,t,n,s,r){if(n!==void 0){let i=Mt([e,t,n]);try{return await me(i,r)}catch{}}if(s!==void 0){let i=Mt([e,s]);try{return await me(i,r)}catch{}}return me(e,r)}async function _f(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return me(e,n)}if(t.type&&!t.enum&&!t.const){let s=Array.isArray(t.type)?t.type:[t.type],r=["string","number","integer","boolean","null","object","array"].filter(i=>!s.includes(i));if(r.length>0){let i=n.random.pick(r),a=Mt([e,{type:i}]);return me(a,n)}}if(t.const!==void 0||t.enum!==void 0){let s=t.enum??[t.const],r=new Set(s.map(i=>JSON.stringify(i)));for(let i=0;i<20;i++){let a=await me(e,n);if(!r.has(JSON.stringify(a)))return a}}return me(e,n)}class Cf{constructor(){ve(this,"extensions",new Map)}define(t,n){this.extensions.set(t,{callback:n,context:{}})}has(t){return this.extensions.has(t)}reset(t){if(t){let n=this.extensions.get(t);n&&(n.context={},this.extensions.delete(t))}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(t,n){let s=Object.keys(t);for(let r=s.length-1;r>=0;r--){let i=s[r],a=i.startsWith("x-")?i.slice(2):i,l=this.extensions.get(a);if(l){let c=t[i],u=l.callback.call(l.context,c,t,n);if(u!==void 0)return u}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var Of=new Cf;function If(e,t){return Of.generate(e,t)}var Mf=["string","number","integer","boolean","null","object","array"];function Co(e,t,n){if(e.faker!==void 0&&e.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${t.path}`);if(e.faker!==void 0)try{let s=Rf(e.faker,t),r=Io(s,n??e.type,t.path);return typeof r=="string"&&e.format?Oo(r,e.format,t):r}catch{}if(e.chance!==void 0)try{let s=Lf(e.chance,t),r=Io(s,n??e.type,t.path);return typeof r=="string"&&e.format?Oo(r,e.format,t):r}catch{}}function Oo(e,t,n){if(t==="date"){let s=typeof e=="string"?new Date(e):e;if(s instanceof Date&&!isNaN(s.getTime())){let r=s.getFullYear(),i=jt(s.getMonth()+1),a=jt(s.getDate());return`${r}-${i}-${a}`}if(typeof e=="string"){let r=Date.parse(e);if(!isNaN(r)){let i=new Date(r),a=i.getFullYear(),l=jt(i.getMonth()+1),c=jt(i.getDate());return`${a}-${l}-${c}`}}}if(t==="date-time"){let s=typeof e=="string"?new Date(e):e;if(s instanceof Date&&!isNaN(s.getTime()))return s.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function Io(e,t,n){if(t===void 0)return e;let s=Array.isArray(t)?t[0]:t;switch(s){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let r=Number(e);return s==="integer"?Math.floor(r):r;case"boolean":return!!e;case"null":return null;default:return e}}function Rf(e,t){var a;if(!((a=t.extensions)!=null&&a.faker)){let l=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${l} in ${t.path}`)}let n,s;if(typeof e=="object"&&e!==null){let l=e,c=Object.keys(l);if(c.length>0)n=c[0],s=l[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let r=n.split("."),i=t.extensions.faker;for(let l of r)try{i=i[l]}catch{throw Error(`failed to resolve .${l} (${n})`)}if(typeof i=="function")return s?i(...s):i();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function Lf(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let s=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${s} in ${t.path}`)}if(typeof e=="string"){let s=t.extensions.chance[e];if(typeof s=="function")return s.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let s=e,r=Object.keys(s)[0],i=s[r],a=t.extensions.chance[r];if(typeof a=="function")return i?a.call(t.extensions.chance,i):a.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function Pf(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function qe(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function me(e,t){if(e===!0)return me({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let i=e,a=null;for(let[l,c]of Object.entries(t.propAliases))l in i&&!(c in i)&&(a||(a={...i}),a[c]=a[l],delete a[l]);a&&(e=a)}let n;if(Array.isArray(e.type)){let i=e.type;n=t.random.pick(i);let a={...t,resolvedType:n},l=Co(e,a,n);if(l!==void 0)return typeof l=="string"&&a.maxLength!==void 0&&l.length>a.maxLength?qe(l.slice(0,a.maxLength),e,a):qe(l,e,a)}else{let i=Co(e,t,n);if(i!==void 0)return typeof i=="string"&&t.maxLength!==void 0&&i.length>t.maxLength?qe(i.slice(0,t.maxLength),e,t):qe(i,e,t)}let s=If(e,t);if(s!==void 0)return qe(s,e,t);if(e.$ref){let i=await $r(e,t);return me(i.schema,Pf(i.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return Nf(e,t);if(e.const!==void 0)return qe(No(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return qe(e.default,e,t);if(e.enum!==void 0)return qe(No(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return qe(t.random.pick(e.examples),e,t);if(e.example!==void 0)return qe(e.example,e,t)}let r=Df(e,t);if(r===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let i=t.defaultInvalidTypeProduct;return typeof i=="string"?Ff(i):i}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(r){case"null":return qe(Kd(),e,t);case"boolean":return qe(Jd(t),e,t);case"number":return qe(Da(e,t),e,t);case"integer":return qe(Gd(e,t),e,t);case"string":return qe(lf(e,t),e,t);case"object":return qe(await mf(e,t),e,t);case"array":return qe(await vf(e,t),e,t);default:throw Error(`Unknown type: ${r} at ${t.path}`)}}function Df(e,t){return t.resolvedType!==void 0?t.resolvedType:typeof e.type=="string"?["string","number","integer","boolean","null","object","array"].includes(e.type)?e.type:null:Array.isArray(e.type)?t.random.pick(e.type):e.properties||e.required||e.additionalProperties!==void 0||e.patternProperties||e.minProperties!==void 0||e.maxProperties!==void 0||Bf(e)?"object":e.items||e.prefixItems||e.contains||e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"number":e.minLength!==void 0||e.maxLength!==void 0||e.pattern||e.format||e.faker!==void 0||e.chance!==void 0?"string":t.random.pick(Mf)}function Bf(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(Yr.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function Ff(e,t){switch(e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function zf(e){let t=Wa(e),n=$a(e);return`${t}T${n}`}function Wa(e){let t=e.int(2e3,2030),n=e.int(1,12),s=of(t,n),r=e.int(1,s);return`${t}-${jt(n)}-${jt(r)}`}function $a(e){let t=e.int(0,23),n=e.int(0,59),s=e.int(0,59);return`${jt(t)}:${jt(n)}:${jt(s)}Z`}var Hf=["alice","bob","charlie","dave","eve","frank","grace","heidi"],Uf=["example.com","test.org","demo.net","sample.io"];function Mo(e){let t=e.pick(Hf),n=e.int(1,999),s=e.pick(Uf);return`${t}${n}@${s}`}var Wf=["https"],$f=["example.com","test.org","demo.net"],Vf=["api","v1","users","items","data","resource"];function Nr(e){let t=e.pick(Wf),n=e.pick($f),s=e.int(1,3),r=[];for(let i=0;i<s;i++)r.push(e.pick(Vf));return`${t}://${n}/${r.join("/")}`}var qf=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],Xf=["com","org","net","io","dev"];function Ro(e){let t=e.int(1,3),n=[];for(let s=0;s<t;s++)n.push(e.pick(qf));return n.push(e.pick(Xf)),n.join(".")}function Zf(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function Yf(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function Kf(e){let t=n=>{let s="";for(let r=0;r<n;r++)s+=e.int(0,15).toString(16);return s};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var Jf=["foo","bar","baz","items","0","1","2","name","value"];function Lo(e){let t=e.int(1,4),n=[];for(let s=0;s<t;s++)n.push(e.pick(Jf));return"/"+n.join("/")}function Qf(e){let t=["P"],n=e.bool(),s=e.bool();return n&&(e.bool()&&t.push(`${e.int(0,100)}Y`),e.bool()&&t.push(`${e.int(0,12)}M`),e.bool()&&t.push(`${e.int(0,30)}D`)),s&&(t.push("T"),e.bool()&&t.push(`${e.int(0,23)}H`),e.bool()&&t.push(`${e.int(0,59)}M`),e.bool()&&t.push(`${e.int(0,59)}S`)),(t.length===1||t.length===2&&t[1]==="T")&&t.push("0D"),t.join("")}var Gf=new Map([["date-time",zf],["date",Wa],["time",$a],["duration",Qf],["email",Mo],["idn-email",Mo],["uri",Nr],["uri-reference",Nr],["iri",Nr],["iri-reference",Nr],["hostname",Ro],["idn-hostname",Ro],["ipv4",Zf],["ipv6",Yf],["uuid",Kf],["json-pointer",Lo],["relative-json-pointer",e=>`${e.int(0,5)}${Lo(e)}`]]);function Va(e){let t=new Map(Gf);if(e)for(let[n,s]of Object.entries(e))t.set(n,s);return t}function ep(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),s=[t];for(let r of n){if(r==="")continue;let i=[];for(let a of s)if(a!=null)if(r==="*")Array.isArray(a)&&i.push(...a);else if(/^\d+$/.test(r)){let l=parseInt(r,10);Array.isArray(a)&&l<a.length&&i.push(a[l])}else r===""?Xs(a,i):typeof a=="object"&&a!==null&&r in a&&i.push(a[r]);s=i}return s}function Xs(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),Xs(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),Xs(n,t)}}function tp(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[s,r]of Object.entries(e))Yr.has(s)||(Ua(r)?(t[s]=r,n=!0):(t[s]={const:r},n=!0));if(n)return t}return{}}async function Zs(e,t,n,s){if(!n.resolveJsonPath)return e;let r=s??e;if(t===!0||t===!1||t.$ref)return e;let i=t;if(i.allOf||i.anyOf||i.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let a={...e},l=tp(i);for(let[c,u]of Object.entries(l))if(c in a){let d=a[c];if(typeof u=="object"&&u!==null&&"jsonPath"in u&&typeof u.jsonPath=="string"){let f=ep(u.jsonPath,r);f.length>0&&(a[c]=n.random.pick(f))}else{let f=await Zs(d,u,n,r);a[c]=f}}return a}if(Array.isArray(e)&&i.items){let a=[];for(let l of e){let c=await Zs(l,i.items,n,r);a.push(c)}return a}return e}var np=Va(),Po=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function rp(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let f=e.$schema;if(typeof f=="string"&&!Po.has(f))throw Error(`Unsupported JSON Schema version: ${f}. Supported versions: ${[...Po].join(", ")}`)}let n=ip(t),s=Pa((t==null?void 0:t.seed)??1),r=n.propAliases?sp(e,n.propAliases):e,i=Ef(r);kf(r,i);let a=n.formats?Va(n.formats):new Map(np),l=n.refDepthMin??n.refDepth,c=n.refDepthMax??n.refDepth;if(l!==void 0&&c!==void 0&&l>c)throw Error(`refDepthMin (${l}) cannot be greater than refDepthMax (${c})`);let u={random:s,maxDepth:n.maxDepth??(c?c+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:i,refStack:new Set,formatRegistry:a,refResolver:n.refResolver,minItems:n.minItems,maxItems:n.maxItems,minLength:n.minLength,maxLength:n.maxLength,useDefaultValue:n.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:n.alwaysFakeOptionals,fixedProbabilities:n.fixedProbabilities,fillProperties:n.fillProperties,extensions:n.extensions,resolveJsonPath:n.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:l,refDepthMax:c,useExamplesValue:n.useExamplesValue,pruneProperties:n.pruneProperties,failOnInvalidTypes:n.failOnInvalidTypes,defaultInvalidTypeProduct:n.defaultInvalidTypeProduct,minDateTime:n.minDateTime,maxDateTime:n.maxDateTime,propAliases:n.propAliases,outputTransform:n.outputTransform},d=await me(r,u);return n.resolveJsonPath?Zs(d,e,u,d):d}function sp(e,t){if(typeof e!="object"||e===null)return e;let n=e,s=null;for(let[r,i]of Object.entries(t))r in n&&!(i in n)&&(s||(s={...n}),s[i]=s[r],delete s[r]);return s??e}function ip(e){if(!e)return{};let t=e,n={...e};return t.requiredOnly===!0&&n.optionalsProbability===void 0&&(n={...n,optionalsProbability:0,alwaysFakeOptionals:!1}),t.ignoreProperties&&t.ignoreProperties.length>0&&(n={...n,outputTransform:op(n.outputTransform,ap(t.ignoreProperties))}),n}function op(e,t){return e?t?async(n,s,r)=>{let i=await e(n,s,r);return t(i,s,r)}:e:t}function ap(e){return(t,n,s)=>{if(s==="/")return t;let r=lp(s.slice(s.lastIndexOf("/")+1));return e.some(i=>typeof i=="string"?i===r:i instanceof RegExp?i.test(r):i(n))?void 0:t}}function lp(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qa(e,t=new Set){if(t.has(e))return e;if(e.type==="object"&&e.properties&&typeof e.properties=="object"){t.add(e);try{const n={};for(const[s,r]of Object.entries(e.properties)){const i=/id$/i.test(s)&&r.type==="string"&&!r.format&&!r.examples,a=r.type==="string"&&!r.format&&!r.examples&&!r.enum;n[s]=i?{...r,format:"uuid"}:a?{...r,examples:["string"]}:qa(r,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}function cp({schema:e}){const[t,n]=N.useState(null);if(N.useEffect(()=>{let r=!1;try{rp(qa(e),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(i=>{r||n(i)}).catch(()=>{})}catch{}return()=>{r=!0}},[e]),t===null)return null;const s=JSON.stringify(t,null,2);return o.jsxs("div",{children:[o.jsx(ba,{code:s}),o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function Ys({schema:e,label:t,description:n,schemaFormat:s,originalSchema:r,conversionError:i,pendingConversion:a}){const l=wa(s),c=!a&&Ad(s,i),[u,d]=N.useState(c?"example":"schema");return N.useEffect(()=>{!c&&u==="example"&&d("schema")},[c,u]),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}),l&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:l})]}),n&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:n})]}),o.jsx(La,{tabs:[...c?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:u,onChange:f=>d(f),ariaLabel:"Schema view toggle"})]}),i&&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 ",Aa(s)??"the"," schema — showing raw definition. ",i]}),a?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[u==="schema"&&o.jsx(ki,{schema:e,rootName:t}),u==="json"&&o.jsx(ya,{schema:r??e}),u==="example"&&c&&o.jsx(cp,{schema:e})]})]})}function Xa({message:e,expanded:t,onToggleExpanded:n,paddingX:s="px-4",focusSection:r=null}){const[i,a]=N.useState("payload");N.useEffect(()=>{(r==="headers"||r==="payload")&&a(r)},[r]);const{deref:l}=St(),c=wi(),u=N.useMemo(()=>e.payload?Ur(e.payload,l):null,[e.payload,l,c]),d=N.useMemo(()=>e.headers?Ur(e.headers,l):null,[e.headers,l,c]),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:`${s} 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(ni,{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(Ys,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion}),(i==="headers"||!e.payload)&&d&&o.jsx(Ys,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,g)=>o.jsx(xi,{name:`#${m.name}`},g))})]})})}),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(Xr,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function up({messageKey:e,message:t,first:n,isSelected:s,focusSection:r}){const[i,a]=N.useState(!1);return N.useEffect(()=>{s&&a(!0)},[s]),o.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${s?"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(Xa,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:s?r:null})})})]})}function Za({messages:e,selectedKey:t,focusSection:n}){const s=Object.entries(e),r=s.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"})]})}),s.map(([i,a],l)=>o.jsx(up,{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(pn,{content:r,stickySideContent:!1})})}function dp({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(s=>o.jsx("button",{type:"button",onClick:()=>n(s),"aria-current":t===s?"page":void 0,className:Sn(t===s?"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 capitalize cursor-pointer w-full text-left"),children:o.jsx("span",{className:"truncate",children:s})},s))})}function Ya({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 fp(e){return o.jsx(Ya,{...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 pp(e){return o.jsx(Ya,{...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 ji({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"})})}const hp=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"openIdConnect",name:"OpenID"},{id:"X509",name:"X.509 certificate"},{id:"scramSha256",name:"SASL"},{id:"scramSha512",name:"SASL"},{id:"plain",name:"SASL"},{id:"gssapi",name:"SASL"}];function Ka({securities:e}){var a;const t=N.useMemo(()=>hp.filter(l=>{const c=l.id;return e==null?void 0:e.some(u=>u.type.toLowerCase()===c.toLowerCase())}),[e]),[n,s]=N.useState(t.length>0?t[0].id:null);N.useEffect(()=>{t.length>0&&s(t[0].id)},[t]);function r(l){return e.find(c=>c.type===l)}const i=n?(a=r(n))==null?void 0:a.description:void 0;return o.jsxs("div",{children:[o.jsx(ni,{tabs:t,current:n,onChange:s}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[n==="userPassword"&&o.jsxs(Tr,{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),n&&["scramSha256","scramSha512","plain"].includes(n)&&o.jsxs(Tr,{description:i,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),n==="gssapi"&&o.jsxs(Tr,{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),n==="X509"&&o.jsxs(Tr,{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."]}),n==="apiKey"&&o.jsx(mp,{security:r("apiKey")}),n==="openIdConnect"&&o.jsx(gp,{security:r("openIdConnect")}),n==="oauth2"&&o.jsx(xp,{security:r("oauth2")})]})]})}const Tr=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(mn,{children:e})}):o.jsx("span",{children:t}),mp=({security:e})=>e!=null&&e.description?o.jsx(mn,{children:e.description}):(e==null?void 0:e.in)==="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."]}),gp=({security:e})=>o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(mn,{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}),"."]}),(e==null?void 0:e.scopes)&&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:"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("code",{children:Gl(e.scopes)})})]})]}),xp=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(mn,{children:e.description}),t&&Object.entries(t).map(([n,s])=>{let r="",i="";switch(n){case"clientCredentials":r=Ol,i=Il;break;case"implicit":r=_l,i=Cl;break;case"password":r=Ml,i=Rl;break;case"authorizationCode":r=Ll,i=Pl;break}return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:r}),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:[s.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:s.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.authorizationUrl})})]}),s.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:s.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.tokenUrl})})]}),s.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:s.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.refreshUrl})})]}),s.availableScopes&&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:"Scopes"}),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(s.availableScopes)?s.availableScopes:Object.keys(s.availableScopes)).map(a=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:a},a))})})]})]})})]},n)})]})};function bp({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"})]})}function yp(e){return e.startsWith("http://")||e.startsWith("https://")}function Ja(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Qa({value:e}){if(e==null)return null;if(typeof e=="string"&&yp(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,s)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},s))}):o.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,s])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:Ja(n)}),o.jsx(Qa,{value:s})]},n))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Ga({bindings:e,expand:t=!1,protocol:n,focused:s}){const[r,i]=N.useState(t);N.useEffect(()=>{s&&i(!0)},[s]);const a=zl[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},l=Object.entries(e??{}).filter(([u,d])=>u!=="bindingVersion"&&d!==void 0&&d!==null),c=N.useId();return l.length===0?null:o.jsxs("div",{className:"mt-2 rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:()=>i(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:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${a.color}`,children:a.label})}),r?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted"}):o.jsx(ji,{className:"w-4 h-4 text-foreground-muted"})]}),o.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${r?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"divide-y divide-neutral-100",children:l.length===0?o.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):l.map(([u,d])=>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:Ja(u)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Qa,{value:d})})]},u))})})})]})}function vp({host:e,protocol:t,description:n,tags:s,variables:r,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=r,[d,f]=N.useState(!1),m=N.useId(),g=N.useId();return N.useEffect(()=>{c==="security"&&f(!0)},[c]),o.jsxs("div",{children:[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(fp,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Zn,{address:e,parameters:u,className:"font-bold leading-tight tracking-tight px-0"})]}),o.jsx("div",{className:"mt-2",children:s&&s.map((v,E)=>{const k=v,C=k.externalDocs;return o.jsx(xi,{href:C&&C.url,title:k.description||(C&&C.description?C.description:void 0),name:k.name},E)})})]}),o.jsx(mn,{children:n}),i&&i.length>0&&o.jsxs("div",{id:l?`server-${l}-security`:void 0,children:[o.jsxs("h3",{id:m,className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(pp,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),o.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following authorization mechanisms:"}),o.jsxs("div",{className:"mt-4 rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":g,"aria-labelledby":m,onClick:()=>f(v=>!v),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[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}),d?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(ji,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:g,className:`grid transition-all duration-200 ease-in-out ${d?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Ka,{securities:i})})})})]})]}),(()=>{const v=a==null?void 0:a[t];return v&&Object.keys(v).some(k=>k!=="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(bp,{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(Ga,{bindings:v,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function el({servers:e,selectedServer:t,onSelectServer:n,focusSection:s=null}){const r=Object.keys(e),[i,a]=N.useState(void 0),l=[t,i].find(d=>!!d&&r.includes(d))??r[0],c=d=>{a(d),n==null||n(d)},u=o.jsx(vp,{...e[l],serverKey:l,focusSection:t||i?s:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(pn,{title:Dl,content:u,sideContent:o.jsx(dp,{serverNames:r,current:l,setCurrent:c}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function tl({message:e,messageId:t,i:n}){const[s,r]=N.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(Xa,{message:e,expanded:s,onToggleExpanded:()=>r(i=>!i)})]})}function wp({requestMessages:e,reply:t,isSend:n,operationId:s}){const[r,i]=N.useState("request"),a=t.messages??[],l=t.channel,c=t.address,u=r==="request"?e:a,d=r==="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(Zn,{address:l.address,parameters:l.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>o.jsx("button",{onClick:()=>i(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
73
|
+
${r===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:s})," ",d,u.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:u.map((f,m)=>o.jsx(tl,{message:f,messageId:f.name,i:m},m))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function Ap({op:e,id:t,focusSection:n=null}){var C;const[s,r]=N.useState(!1),i=N.useId(),a=N.useId();N.useEffect(()=>{n==="security"&&r(!0)},[n]);const l=e.messages??[],c=e.tags??[],u=e.bindings,d=e.traits,f=e.reply,m=e.externalDocs,g=e.security,v=u??(Array.isArray(d)?(C=d.find(j=>j.bindings))==null?void 0:C.bindings:void 0),E=e.action===Qt.SEND,k=o.jsx("div",{className:"space-y-2",children:l.map((j,w)=>o.jsx(tl,{message:j,messageId:j.name,i:w},w))});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]}),(m==null?void 0:m.url)&&o.jsxs("a",{href:m.url,target:"_blank",rel:"noreferrer",title:m.description||m.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(ga,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(mn,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),g&&g.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{id:i,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":a,"aria-labelledby":i,onClick:()=>r(j=>!j),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[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:g.length}),s?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(ji,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:a,className:`grid transition-all duration-200 ease-in-out ${s?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Ka,{securities:g})})})})]})]}),v&&Object.entries(v).map(([j,w])=>w?o.jsxs("div",{id:`operation-${t}-bindings-${j}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Ga,{protocol:j,bindings:w,focused:n===`binding:${j}`})]},j):null),f?o.jsx(wp,{requestMessages:l,reply:f,isSend:E,operationId:t}):l.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})," ",E?"accepts":"expects",l.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:"]}),k]}),c.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:c.map((j,w)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:j.name},w))})]})]})}function nl({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:s=null}){const r=m=>n==null?void 0:n(m);if(!Object.keys(e).length)return null;const i=t?e[t]:null,a=Object.keys(e).map(m=>{var M;const g=e[m],v=g.channel,E=v==null?void 0:v.address,k=v==null?void 0:v.parameters,C=g.action===Qt.SEND,j=((M=g.action)==null?void 0:M.toUpperCase())??"",w=C?"bg-green-100 text-green-800":g.action===Qt.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",y=t===m;return o.jsxs("tr",{id:`operation-${m}`,onClick:()=>r(m),role:"button",tabIndex:0,"aria-label":`${j||"Operation"} ${E??m}`,"aria-current":y?"true":void 0,onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),r(m))},className:`group cursor-pointer ${y?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:E&&o.jsx(Zn,{address:E,parameters:k,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:o.jsx("div",{className:`inline-flex w-24 items-center justify-center px-2 py-1 text-center rounded-md text-xs font-medium uppercase ${w}`,children:j})}),o.jsx("td",{className:"group-hover:bg-neutral-50"})]},m)}),l=i?i.channel:null,u=(i==null?void 0:i.action)===Qt.SEND?"bg-green-100 text-green-800":(i==null?void 0:i.action)===Qt.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",d=i&&(l!=null&&l.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium uppercase ${u}`,children:i.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Zn,{address:l.address,parameters:l.parameters})})]}):t??"Operation",f=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:a})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(pn,{title:Bl,content:f,stickySideContent:!1})}),o.jsx(Uo,{isOpen:!!i,side:"right",onClose:()=>r(null),title:d,children:i&&o.jsx(Ap,{op:i,id:t,focusSection:s})})]})}function rl({schemas:e,selectedKey:t,focusTarget:n}){const{deref:s}=St(),r=wi(),i=N.useMemo(()=>Object.entries(e).map(([l,c])=>[l,Ur(c,s)]),[e,s,r]),a=i.length?o.jsx("div",{className:"grid gap-6 w-full",children:i.map(([l,c])=>{const u=c.schema,d=wa(c.schemaFormat),f=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||f>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}),f>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[f," 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"," ",Aa(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(ya,{schema:c.originalSchema})}):o.jsx(ki,{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(pn,{content:a,stickySideContent:!1})})}const Ep=e=>e==="operations"||e==="messages"||e==="schemas";function kp({asyncapi:e,config:t}){var $e,pe,$t,te,Rt;const n=t.show??{},s=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Wo}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:$o}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Vo}]:[]],r=(($e=s[0])==null?void 0:$e.id)??"operations",[i,a]=N.useState(r),[l,c]=N.useState(null),u=V=>{a(V),c(V)},[d,f]=N.useState(null),[m,g]=N.useState(null),[v,E]=N.useState(null),[k,C]=N.useState(null),j=s.some(V=>V.id===i)?i:r,w=n.operations!==!1?d:null,y=n.messages!==!1?m:null,M=n.schemas!==!1?v:null,S=n.servers!==!1?k:null,_=e.servers?Object.keys(e.servers):[],{query:K,setQuery:A,results:B}=Jc(e,{threshold:.3,limit:20}),[X,le]=N.useState(null),[se,Ee]=N.useState(null),[fe,Ce]=N.useState(null),ie=N.useRef(null),Te=V=>{V.tab==="operations"||V.tab==="messages"||V.tab==="schemas"?u(V.tab):V.tab==="servers"&&c("servers"),f(V.tab==="operations"?V.key:null),g(V.tab==="messages"?V.key:null),E(V.tab==="schemas"?V.key:null),C(V.tab==="servers"?V.key:null),le(V.focusSection??null),Ee(V.tab==="schemas"&&V.schemaFocusTokens?{tokens:V.schemaFocusTokens,id:V.targetId}:null),V.tab==="schemas"&&gs(),Ce({targetId:V.targetId,query:K,highlight:V.tab!=="schemas"})};N.useEffect(()=>{if(!fe)return;const{targetId:V,query:dt,highlight:W}=fe;let oe=!1;const ge=ke=>{if(oe)return;const je=document.getElementById(V);if(!je){ke<40&&setTimeout(()=>ge(ke+1),50);return}if(ie.current!==V){try{je.scrollIntoView({behavior:"smooth",block:"start"})}catch{}ie.current=V}W&&ae(0)},ae=ke=>{if(oe)return;const je=document.getElementById(V);je&&Gc(je,dt),ke<6&&setTimeout(()=>ae(ke+1),100)};return setTimeout(()=>ge(0),50),()=>{oe=!0}},[fe,j,w,y,M,S,X,se]),N.useEffect(()=>{K.trim()||(Ce(null),gs())},[K]),N.useEffect(()=>gs,[]);const be=j==="operations"?o.jsx(nl,{operations:e.operations??{},selectedKey:w,onSelectKey:f,focusSection:X}):j==="messages"?o.jsx(Za,{messages:((pe=e.components)==null?void 0:pe.messages)??{},selectedKey:y,focusSection:X}):j==="schemas"?o.jsx(rl,{schemas:(($t=e.components)==null?void 0:$t.schemas)??{},selectedKey:M,focusTarget:se}):null;return o.jsx(ti,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:o.jsxs("div",{className:"px-4",children:[n.search!==!1&&o.jsx(nc,{query:K,onQueryChange:A,results:B,onSelectResult:Te}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(xa,{...e.info})}),n.servers!==!1&&_.length>0&&o.jsx("div",{id:`server-${S??_[0]}`,children:o.jsx(el,{servers:e.servers,selectedServer:S,onSelectServer:C,focusSection:X})}),n.sidebar!==!1&&o.jsx(tc,{info:e.info,operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(te=e.components)==null?void 0:te.messages:void 0,schemas:n.schemas!==!1?(Rt=e.components)==null?void 0:Rt.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,sidebarConfig:t.sidebar,activeTab:l,onTabChange:u,onItemSelect:(V,dt)=>{u(V),f(V==="operations"?dt:null),g(V==="messages"?dt:null),E(V==="schemas"?dt:null)},onSelectServer:V=>{c("servers"),f(null),g(null),E(null),C(V)},selectedItem:w?{tab:"operations",key:w}:y?{tab:"messages",key:y}:M?{tab:"schemas",key:M}:S?{tab:"servers",key:S}:null}),o.jsx(Vl,{tabs:s,current:j,onChange:V=>{Ep(V)&&u(V)}}),j&&o.jsx("div",{id:`panel-${j}`,role:"tabpanel","aria-labelledby":`tab-${j}`,children:be})]})})}const Si=e=>{const t=e.asyncapi,n=N.useMemo(()=>Gs(t),[t]),s=e.config??Qs;return o.jsx(kp,{asyncapi:n,config:s})};function sl(e,t,n){e.registerSchemaParser(t);const s=e.parserRegistry,r=s.get.bind(s);s.get=i=>{const a=r(i);return a!==void 0?a:n(i)?t:void 0}}const jp=["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 Sp(){return{validate:Tp,parse:_p,getMimeTypes:()=>jp}}function Np(e){sl(e,Sp(),Gn)}function Tp(e){return vi(e.data).map(t=>({message:t,path:e.path}))}function _p(e){var n,s;const t=vi(e.data);if(t.length>0)return{[Hr]:t[0]};try{const r=Us(e.data),i=e.meta.message,a=(s=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:s.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=Us(a)),r}catch(r){return{[Hr]:r instanceof Error?r.message:"Failed to convert Avro schema"}}}async function Cp(){try{const e=await Promise.resolve().then(()=>require("./index-D7GelPk0.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 il(e){const t=await Cp(),n=new t;Np(n);const{registerProtobufSchemaParser:s}=await Promise.resolve().then(()=>require("./protobufSchemaParser-D_2rEsD4.cjs"));s(n);try{const{document:r,diagnostics:i}=await n.parse(e);return{diagnostics:i,document:r?Ip(r):null}}catch(r){return{diagnostics:[{message:r instanceof Error?r.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Op(e,t){const{diagnostics:n,document:s}=await il(e);return{diagnostics:n,view:s?o.jsx(Si,{kind:"resolved",asyncapi:s,config:t}):null}}function Ip(e){return e.json()}function Mp({raw:e,config:t,onDiagnostics:n}){const[s,r]=N.useState(null),i=N.useRef(n);return i.current=n,N.useEffect(()=>{let a=!0;return il(e).then(({document:l,diagnostics:c})=>{var u;a&&(r(l),(u=i.current)==null||u.call(i,c))}),()=>{a=!1}},[e]),s?o.jsx(Si,{kind:"resolved",asyncapi:s,config:t}):null}function Rp({document:e,config:t,children:n}){const s=N.useMemo(()=>Gs(e),[e]);return o.jsx(ti,{document:s,config:t,children:n})}function ir({document:e,config:t,children:n}){const s=N.useContext(ei),r=N.useMemo(()=>e?Gs(e):null,[e]);if(s)return o.jsx(o.Fragment,{children:n});if(!r)throw new Error("This AsyncAPI section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <AsyncAPI>.");return o.jsx(ti,{document:r,config:t,children:n})}function or(){return St().document}function Lp(){const e=or();return!e.servers||Object.keys(e.servers).length===0?null:o.jsx(el,{servers:e.servers})}function Pp(e){return o.jsx(ir,{...e,children:o.jsx(Lp,{})})}function Dp(){const e=or(),[t,n]=N.useState(null);return o.jsx(nl,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function Bp(e){return o.jsx(ir,{...e,children:o.jsx(Dp,{})})}function Fp(){var t;const e=or();return o.jsx(Za,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function zp(e){return o.jsx(ir,{...e,children:o.jsx(Fp,{})})}function Hp(){var t;const e=or();return o.jsx(rl,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function Up(e){return o.jsx(ir,{...e,children:o.jsx(Hp,{})})}function Wp(){const e=or();return e.info?o.jsx(xa,{...e.info}):null}function $p(e){return o.jsx(ir,{...e,children:o.jsx(Wp,{})})}exports.AsyncAPI=Si;exports.AsyncAPIProvider=Rp;exports.AsyncAPIRenderer=Mp;exports.Info=$p;exports.Messages=zp;exports.Operations=Bp;exports.SchemaTabs=Ys;exports.SchemaTree=ki;exports.Schemas=Up;exports.Servers=Pp;exports.X_LIB_CONVERSION_ERROR=Hr;exports.commonjsGlobal=eu;exports.defaultConfig=Qs;exports.getAugmentedNamespace=tu;exports.getDefaultExportFromCjs=ai;exports.isProtobufSchemaFormat=er;exports.parseAndRender=Op;exports.registerSchemaParserWithFallback=sl;exports.useAsyncAPIDocument=St;
|