apiuikit 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,177 +0,0 @@
1
- "use strict";var zp=Object.defineProperty;var Wp=(e,t,n)=>t in e?zp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ee=(e,t,n)=>Wp(e,typeof t!="symbol"?t+"":t,n);const c=require("react/jsx-runtime"),A=require("react"),Ar=require("react-dom"),Xi=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Qi=(e,t)=>{const n=t.length>0?t:Xi,r=(e%n.length+n.length)%n.length;return n[r]},zn={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:Xi},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0}},Gi=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",fs=e=>typeof e=="object"&&e!==null,Vp=e=>e.replace(/^#\//,"").split("/").pop()??e,ea=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Gi(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>ea(r,t))),Eu=(e,t=new Set,n=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(n.has(e))return!1;if(n.add(e),Gi(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Eu(s,t,n))}finally{t.delete(e)}},Kp=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let r=e;for(const s of n){if(!fs(r)&&!Array.isArray(r))return;const o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(r=r[o],r==null)return}return r},Jp=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Al=e=>e.length?`#/${e.map(Jp).join("/")}`:"#";function Tr(e){if(!Eu(e))return e;const t=new Map,n=new Set,r=new Map,s=(o,i)=>{if(Array.isArray(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const l=[];r.set(o,Al(i)),t.set(o,l),n.add(o);try{o.forEach((u,f)=>l.push(s(u,[...i,String(f)])))}finally{n.delete(o)}return l}if(Gi(o)){const a=Kp(e,o.$ref),l=fs(a)||Array.isArray(a);if(l&&!n.has(a)){const u=s(a,i);return fs(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=Vp(o.$ref)),u}if(a!==void 0&&!l)return a}if(fs(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const l={};r.set(o,Al(i)),t.set(o,l),n.add(o);try{for(const[u,f]of Object.entries(o))l[u]=s(f,[...i,u])}finally{n.delete(o)}return l}return o};return s(e,[])}const Ws=A.createContext(null),ta=()=>{const e=A.useContext(Ws);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Ve=ta;var Es=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Es||{});const Yp="Contact",Zp="Email",Tl="License",Ol="External Documentation",Xp="Tags",Qp="Implicit",Gp=`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.`,eh="Client Credentials",th="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",nh="Password",rh="The Password grant type is a legacy way to exchange a user's credentials for an access token.",sh="Authorization Code",oh="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",ku="Connecting to a server",ih="",Nl=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ah=[50,100,200,300,500,600,700],lh={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"}},ch=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],uh={get:"bg-blue-100 text-blue-800",post:"bg-green-100 text-green-800",put:"bg-yellow-100 text-yellow-800",patch:"bg-orange-100 text-orange-800",delete:"bg-red-100 text-red-800",options:"bg-neutral-100 text-foreground-secondary",head:"bg-neutral-100 text-foreground-secondary",trace:"bg-neutral-100 text-foreground-secondary",[Es.SEND]:"bg-green-100 text-green-800",[Es.RECEIVE]:"bg-blue-100 text-blue-800"};function Au(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${n} ${r} ${s}`}function Ro(e,t,n){if(e)for(const r of ah){const s=e[r];s&&(n[`--color-${t}-${r}`]=Au(s))}}const fh=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],dh={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 ph(e){const t={},n=e.light?"light":e.dark?"dark":null,r=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[s,o]of Object.entries(dh))t[`--color-neutral-${s}`]=o;if(r)for(const[s,o]of fh){const i=r[s];i&&(t[o]=Au(i))}return e.colors&&(Ro(e.colors.primary,"primary",t),Ro(e.colors.secondary,"secondary",t),Ro(e.colors.neutral,"neutral",t)),t}const hh=e=>typeof e=="object"&&e!==null;function Tu(e,t,n=zn){var g,v,j,y,x;const r=A.useMemo(()=>new Map,[]),[s,o]=A.useState(null),[i,a]=A.useState(null);A.useEffect(()=>{r.clear()},[t,r]);const l=A.useCallback(w=>{if(r.has(w))return r.get(w);const E=w.replace(/^#\//,"").split("/");let S=t;for(const k of E){if(!hh(S)){S=void 0;break}const C=k.replace(/~1/g,"/").replace(/~0/g,"~");if(S=S[C],S==null)break}return S!==void 0&&r.set(w,S),S},[t,r]),u=((g=n.expand)==null?void 0:g.schemas)===!0,f=(j=(v=n.theme)==null?void 0:v.depthColors)!=null&&j.length?n.theme.depthColors:Xi,d=((y=n.show)==null?void 0:y.extensions)!==!1,p=((x=n.show)==null?void 0:x.codeSamples)!==!1,h=A.useMemo(()=>({specType:e,document:t,deref:l,portalHost:s,rootElement:i,defaultSchemaExpanded:u,depthColors:f,showExtensions:d,showCodeSamples:p}),[e,t,l,s,i,u,f,d,p]),m=n.theme?ph(n.theme):{};return{contextValue:h,themeVars:m,setPortalHost:o,setRootElement:a}}function na({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Tu("asyncapi",e,t);return c.jsx(Ws.Provider,{value:s,children:c.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[c.jsx("div",{ref:i,className:"asyncapi-portal-root"}),r]})})}function Gt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:o=!1,mobileLeadContent:i}){return c.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[i&&c.jsx("div",{className:"@lg:hidden mb-3",children:i}),e&&c.jsx("h1",{className:`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),c.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&o?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[c.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),c.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:c.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Cn(...e){return e.filter(Boolean).join(" ")}function Wn({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",placeholder:o}){var h;const i=A.useId(),a=A.useRef([]),l=t??(o?"":((h=e[0])==null?void 0:h.id)??""),u=e.some(m=>!!m.icon),f=t?e.findIndex(m=>m.id===t):-1,d=f>=0?f:0,p=(m,g)=>{var y;if(e.length===0)return;const v=x=>(x+e.length)%e.length;let j=g;if(m.key==="ArrowRight"&&(m.preventDefault(),j=v(g+1)),m.key==="ArrowLeft"&&(m.preventDefault(),j=v(g-1)),m.key==="Home"&&(m.preventDefault(),j=0),m.key==="End"&&(m.preventDefault(),j=e.length-1),j!==g){const x=e[j];n(x.id),(y=a.current[j])==null||y.focus()}};return e.length?c.jsxs("div",{children:[c.jsxs("div",{className:"@sm:hidden",children:[c.jsx("label",{htmlFor:i,className:"sr-only",children:s}),c.jsxs("select",{id:i,name:"tabs",value:l,onChange:m=>n(m.target.value),className:Cn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",u?"mt-0":"mt-4"),children:[o&&c.jsx("option",{value:"",children:o}),e.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]})]}),c.jsx("div",{className:Cn("hidden @sm:block",u?"":"mt-6"),children:u?c.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":r,children:c.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((m,g)=>{const v=m.id===t,j=m.icon;return c.jsx("button",{ref:y=>{a.current[g]=y},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:y=>p(y,g),className:Cn("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",v?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[j?c.jsx(j,{className:"h-4 w-4 shrink-0"}):null,c.jsx("span",{children:m.name})]})},m.id)})})}):c.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((m,g)=>{const v=m.id===t;return c.jsxs("button",{ref:j=>{a.current[g]=j},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:j=>p(j,g),className:Cn(v?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",g===0?"rounded-l-lg":"",g===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[c.jsx("span",{children:m.name}),c.jsx("span",{"aria-hidden":"true",className:Cn(v?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},m.id)})})})]}):null}function Ou({tabs:e,current:t,onChange:n}){if(!e.length)return null;const r=c.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:c.jsx(Wn,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return c.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:c.jsx(Gt,{content:r,stickySideContent:!1})})}function mh(e){if(e.length===0)return c.jsx("span",{children:"No allowed values."});if(e.length===1)return c.jsxs("span",{children:["Allowed value is ",c.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>c.jsxs(A.Fragment,{children:[c.jsx("code",{children:r}),", "," "]},s)),n=c.jsx("code",{children:e[e.length-1]},"last");return c.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function gh(e){return e.map(t=>`\`${t}\``).join(", ")}function yh(e){const t=[],n=/\{([^}]+)\}/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push({type:"text",value:e.slice(r,s.index)}),t.push({type:"param",value:s[1]}),r=s.index+s[0].length;return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}function Xt({address:e,parameters:t,className:n="text-xs",truncate:r=!1}){const{portalHost:s}=Ve(),[o,i]=A.useState(null),[a,l]=A.useState({top:0,left:0,placement:"top"}),[u,f]=A.useState(!1),d=A.useRef(null),p=yh(e);let h=0;const m=40;A.useEffect(()=>{if(!r)return;const y=d.current;if(!y)return;const x=()=>f(y.scrollWidth>y.clientWidth);x();const w=new ResizeObserver(x);return w.observe(y),()=>w.disconnect()},[r,e]);const g=(y,x)=>{const w=x.getBoundingClientRect(),E=w.top<m?"bottom":"top";l({top:E==="top"?w.top-8:w.bottom+8,left:w.left+w.width/2,placement:E}),i(y)},v=()=>i(null),j=p.map((y,x)=>{if(y.type==="text")return c.jsx("span",{children:y.value},x);const w=t==null?void 0:t[y.value],E=Nl[h++%Nl.length],S=o===x,k=!!w&&(w.description||w.type||w.default||w.enum&&w.enum.length>0||w.examples&&w.examples.length>0),C=`channel-address-tooltip-${x}`,T=k&&S?C:void 0;return c.jsxs("span",{className:"inline-block",onMouseEnter:N=>k&&g(x,N.currentTarget),onMouseLeave:v,children:[c.jsx("span",{className:`font-semibold ${E} ${k?"cursor-help underline decoration-dotted":""}`,role:k?"button":void 0,tabIndex:k?0:void 0,"aria-expanded":k?S:void 0,"aria-describedby":T,onFocus:N=>k&&g(x,N.currentTarget),onBlur:v,onKeyDown:N=>{k&&((N.key==="Enter"||N.key===" ")&&(N.preventDefault(),g(x,N.currentTarget)),N.key==="Escape"&&(N.preventDefault(),v(),N.currentTarget.blur()))},children:`{${y.value}}`}),k&&S&&s&&Ar.createPortal(c.jsxs("div",{id:C,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 ${a.placement==="top"?"-translate-y-full":""}`,style:{top:a.top,left:a.left},children:[w.description&&c.jsx("div",{children:w.description}),w.type&&c.jsx("div",{className:"mt-1",children:c.jsx("code",{children:w.type})}),w.default&&c.jsxs("div",{className:"mt-1",children:[c.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",c.jsx("code",{children:w.default})]}),w.enum&&w.enum.length>0&&c.jsx("div",{className:"mt-1",children:mh(w.enum)}),w.examples&&w.examples.length>0&&c.jsxs("div",{className:"mt-1",children:[c.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",w.examples.join(", ")]})]}),s)]},x)});return r?c.jsxs("code",{className:`px-2 py-1 rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[c.jsx("span",{ref:d,className:"overflow-hidden whitespace-nowrap min-w-0",children:j}),u&&c.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):c.jsx("code",{className:`px-2 py-1 rounded text-foreground-secondary break-all ${n}`,children:j})}const xh={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Qt({method:e,size:t="sm",className:n=""}){return e?c.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${xh[t]} ${uh[e]} ${n}`,children:e}):null}function Vs(e,t){const[n,r]=A.useState(null);return A.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const o=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const i=new ResizeObserver(o);return i.observe(e),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{s!==null&&cancelAnimationFrame(s),i.disconnect(),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[e,t]),n}const Cl=20;function bh({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[o,i]=A.useState(!1),[a,l]=A.useState(!1),u=o||a,{rootElement:f,portalHost:d}=Ve(),p=A.useRef(null),h=A.useRef(null),m=A.useMemo(()=>e.filter(_=>_.items.length>0),[e]),g=A.useMemo(()=>m.filter(_=>_.isTab===!1||_.id===t),[m,t]),v=A.useMemo(()=>m.filter(_=>_.showInPopover!==!1),[m]),[j,y]=A.useState(null),x=A.useRef(null),w=A.useRef(null),E=A.useCallback((_,W)=>{y({section:_,key:W}),x.current={section:_,key:W},w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{x.current=null},600)},[]);A.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),A.useEffect(()=>{const W=e.filter(te=>te.items.length>0).flatMap(te=>te.items.map(D=>({section:te.id,key:te.itemKey(D),id:te.targetId(D)}))).map(te=>({...te,el:document.getElementById(te.id)})).filter(te=>!!te.el);if(W.length===0)return;const L=new Map(W.map(te=>[te.el,te])),ee=new Map,Q=new IntersectionObserver(te=>{for(const fe of te)fe.isIntersecting?ee.set(fe.target,fe.boundingClientRect.top):ee.delete(fe.target);if(ee.size===0)return;let D=null,ne=-1/0;for(const[fe,me]of ee)me>ne&&(D=fe,ne=me);const ce=D&&L.get(D);if(!ce)return;const ue=x.current;if(ue){if(ce.section!==ue.section||ce.key!==ue.key)return;x.current=null}y({section:ce.section,key:ce.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return W.forEach(te=>Q.observe(te.el)),()=>Q.disconnect()},[e]);const S=(j==null?void 0:j.section)??t,k=j??s,C=Vs(f,!0),T=typeof window>"u"?0:window.innerWidth,N=typeof window>"u"?0:window.innerHeight,F=!!C&&C.bottom>0&&C.top<N,$=!!C&&C.width<1024,K={opacity:F?1:0,pointerEvents:F?"auto":"none",transition:"opacity 0.2s ease"},re={position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+Cl,transform:"translateY(-50%)",zIndex:51,...K},ie=Math.min((C==null?void 0:C.right)??0,T)-60,R={position:"fixed",bottom:16,left:ie,zIndex:51,...K},P=$?{position:"fixed",bottom:68,right:T-(ie+44),zIndex:52}:{position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+Cl,transform:"translateY(-50%)",zIndex:52};A.useEffect(()=>{if(!o)return;const _=L=>{L.key==="Escape"&&i(!1)},W=L=>{var Q,te;const ee=L.target;(Q=p.current)!=null&&Q.contains(ee)||(te=h.current)!=null&&te.contains(ee)||i(!1)};return document.addEventListener("keydown",_),document.addEventListener("mousedown",W),()=>{document.removeEventListener("keydown",_),document.removeEventListener("mousedown",W)}},[o]);const V=A.useCallback((_,W)=>{_.isTab!==!1&&n(_.id),W&&setTimeout(()=>{var L;(L=document.getElementById(W))==null||L.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),J=A.useMemo(()=>v.map(_=>{const W=S===_.id,L=(k==null?void 0:k.section)===_.id,ee=_.icon;return c.jsxs("div",{className:"pb-1",children:[c.jsxs("button",{onClick:()=>{V(_),E(_.id,""),$&&i(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${W?"bg-primary-50":"hover:bg-neutral-50"}`,children:[c.jsx(ee,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${W?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),c.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${W?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:_.label}),c.jsx("span",{className:`ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 font-mono text-[10px] transition-colors ${W?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:_.items.length})]}),_.items.length>0&&c.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:_.items.map(Q=>{const te=_.itemKey(Q),D=L&&(k==null?void 0:k.key)===te;return c.jsx("li",{children:c.jsx("button",{onClick:()=>{V(_,_.targetId(Q)),r(_.id,te),E(_.id,te),$&&i(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${D?"bg-primary-50 font-medium text-primary-500":W?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:_.renderItem(Q,{isSelected:D,isSectionActive:W})})},te)})})]},_.id)}),[v,S,k,$,V,r,E]),I=A.useMemo(()=>g.map(_=>{const W=S===_.id;return c.jsxs("div",{className:"flex flex-col items-start gap-1",children:[c.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${W?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),c.jsx("div",{className:"flex flex-col items-start gap-1",children:_.items.map(L=>{const ee=_.itemKey(L),Q=(k==null?void 0:k.section)===_.id&&(k==null?void 0:k.key)===ee;return c.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${Q?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},ee)})})]},_.id)}),[g,S,k]);return c.jsxs(c.Fragment,{children:[!$&&c.jsx("button",{ref:p,onClick:()=>i(_=>!_),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2",style:re,children:I}),$&&c.jsx("button",{ref:p,onClick:()=>i(_=>!_),title:o?"Close navigation":"Open navigation","aria-label":o?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:R,children:c.jsxs("span",{className:"flex flex-col items-start gap-1",children:[c.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),c.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),c.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})}),d&&Ar.createPortal(c.jsx("div",{ref:h,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${$?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:P,children:J}),d)]})}function Nu({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:o}){return c.jsx(bh,{sections:e,activeSection:t,onTabChange:i=>n(i),onItemSelect:(i,a)=>{i!=="info"&&(i==="servers"?s==null||s(a):r==null||r(i,a))},selectedItem:o?{section:o.tab,key:o.key}:null})}function ra({className:e,children:t,...n}){return c.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 vh(e){return c.jsxs(ra,{stroke:"url(#icon-book-open-gradient)",...e,children:[c.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[c.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),c.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})]})}function sa({className:e}){return c.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[c.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"}),c.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 Cu(e){return{id:"info",label:"Info",icon:vh,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>c.jsx("span",{className:"truncate",children:"Overview"})}}function _u(e){return{id:"schemas",label:"Schemas",icon:sa,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>c.jsx("span",{className:"truncate",children:t})}}function Ru({className:e}){return c.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:c.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}function Ks({className:e}){return c.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:c.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 Iu({className:e}){return c.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[c.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"}),c.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}const Qr={};function wh({operations:e=Qr,messages:t=Qr,schemas:n=Qr,servers:r=Qr,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u,sidebarConfig:f}){const d=A.useMemo(()=>{const p=h=>{var g;return f!=null&&f.useChannelAddressAsIdentifier?((g=e[h])==null?void 0:g.channel)??null:null};return[Cu(s),{id:"servers",label:"Servers",icon:Ru,isTab:!1,items:Object.keys(r),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>c.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:Ks,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var g;const m=p(h);return m!=null&&m.address?c.jsx(Xt,{address:m.address,parameters:m.parameters,className:"text-xs bg-transparent p-0"}):c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:(g=e[h])==null?void 0:g.action,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:Iu,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>c.jsx("span",{className:"truncate",children:h})},_u(n)]},[e,t,n,r,s,f]);return c.jsx(Nu,{sections:d,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u})}const oa=["get","put","post","delete","options","head","patch","trace"],Sh=(e,t)=>`${e} ${t}`;function _l(e,t){const n=new Map;for(const r of(e==null?void 0:e.parameters)??[])n.set(`${r.in}:${r.name}`,r);for(const r of(t==null?void 0:t.parameters)??[])n.set(`${r.in}:${r.name}`,r);return Array.from(n.values())}function ks(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?oa.filter(r=>n[r]).map(r=>({key:Sh(r,t),method:r,path:t})):[]})}function ia({className:e}){return c.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),c.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"}),c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}const Rl={},jh={},Eh=[];function kh({paths:e=Rl,webhooks:t=Rl,schemas:n=jh,servers:r=Eh,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u}){const f=A.useMemo(()=>ks(e),[e]),d=A.useMemo(()=>ks(t),[t]),p=A.useMemo(()=>{const h=r.map((m,g)=>({key:`server-${g}`,url:m}));return[Cu(s),{id:"servers",label:"Servers",icon:Ru,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>c.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Ks,items:f,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),c.jsx(Xt,{address:m.path,className:"text-xs bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:ia,items:d,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>c.jsxs(c.Fragment,{children:[c.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"truncate",children:m.path})]})},_u(n)]},[f,d,n,r,s]);return c.jsx(Nu,{sections:p,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:l,selectedItem:u})}const Ah=e=>c.jsxs("svg",{width:18,height:18,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[c.jsx("circle",{cx:"7",cy:"7",r:"5"}),c.jsx("path",{d:"M14 14l-3.5-3.5"})]});function Pu(e,t){const[n,r]=A.useState("docked"),s=A.useRef(t);return s.current=t,A.useEffect(()=>{if(!e)return;let o=null,i=null;const a=()=>{i=null;const u=e.getBoundingClientRect().top,f=o===null?0:u-o;o=u,u>=0?r("docked"):s.current||f>0?r("pinned"):f<0?r("hidden"):r(d=>d==="docked"?"hidden":d)},l=()=>{i===null&&(i=requestAnimationFrame(a))};return a(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{i!==null&&cancelAnimationFrame(i),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e]),A.useEffect(()=>{t&&r(o=>o==="hidden"?"pinned":o)},[t]),n}function Th(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function $u(e){let t=e;for(;t&&t!==document.body;){if(Th(t))return t;t=t.parentElement}return document.documentElement}function Mu(e){const t=e.style.overflow,n=e.style.paddingRight,r=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",r>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+r}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}const Il=12;function Lu({query:e,onQueryChange:t,results:n,onSelectResult:r}){const s=A.useRef(null),o=A.useRef(null),[i,a]=A.useState(!1),[l,u]=A.useState(-1),f="asyncapi-search-results",{portalHost:d,rootElement:p}=Ve(),h=Pu(p,i),m=h!=="docked",g=Vs(p,m),v={left:m?((g==null?void 0:g.left)??0)+Il:Il,transform:`translateY(${h==="hidden"?"-150%":"0px"})`,zIndex:40,...m?{position:"fixed",top:10,pointerEvents:h==="hidden"?"none":void 0}:{}},j=()=>{a(!1),u(-1)},y=A.useRef(!1),x=A.useRef(!1);A.useEffect(()=>{if(!p)return;const N=()=>{y.current=!0},F=()=>{y.current=!1};return p.addEventListener("mouseenter",N),p.addEventListener("mouseleave",F),()=>{p.removeEventListener("mouseenter",N),p.removeEventListener("mouseleave",F)}},[p]),A.useEffect(()=>{if(!p)return;const N=F=>{x.current=p.contains(F.target)};return document.addEventListener("mousedown",N,!0),()=>document.removeEventListener("mousedown",N,!0)},[p]),A.useEffect(()=>{if(!p)return;const N=F=>{!(F.metaKey||F.ctrlKey)||F.key.toLowerCase()!=="k"||!(p.contains(document.activeElement)||y.current||x.current)||(F.preventDefault(),a(!0))};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[p]),A.useEffect(()=>{if(!i)return;const N=requestAnimationFrame(()=>{var F;return(F=o.current)==null?void 0:F.focus()});return()=>cancelAnimationFrame(N)},[i]),A.useEffect(()=>{if(!(!i||!d))return Mu($u(d))},[i,d]),A.useEffect(()=>{if(!i)return;const N=F=>{F.key==="Escape"&&j()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[i]),A.useEffect(()=>{if(!i)return;const N=F=>{s.current&&!s.current.contains(F.target)&&j()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[i]),A.useEffect(()=>{l>=n.length&&u(n.length-1)},[l,n.length]);const w=i&&e.trim().length>0,E=N=>{j(),r(N)},S=N=>{if(N.key==="Escape"){N.preventDefault(),j();return}if(w){if(N.key==="ArrowDown"){N.preventDefault(),u(F=>n.length===0?-1:Math.min(F+1,n.length-1));return}if(N.key==="ArrowUp"){N.preventDefault(),u(F=>n.length===0?-1:F<=0?n.length-1:F-1);return}if(N.key==="Home"){N.preventDefault(),n.length>0&&u(0);return}if(N.key==="End"){N.preventDefault(),n.length>0&&u(n.length-1);return}if(N.key==="Enter"&&l>=0&&n[l]){N.preventDefault(),E(n[l]);return}}},k=N=>`asyncapi-search-result-${N}`,C=w?`${n.length} result${n.length===1?"":"s"} found`:"",T=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>a(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",style:v,children:c.jsx(Ah,{})}),i&&d&&Ar.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",children:[c.jsx("div",{className:"absolute inset-0 bg-black/30"}),c.jsxs("div",{ref:s,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[c.jsx("div",{className:"p-4",children:c.jsx("input",{ref:o,id:"asyncapi-search",type:"search",value:e,onChange:N=>t(N.target.value),onKeyDown:S,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":l>=0?k(l):void 0,className:"w-full rounded-md bg-surface px-4 py-3 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none"})}),c.jsx("div",{"aria-live":"polite",className:"sr-only",children:C}),w&&c.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?c.jsx("ul",{className:"divide-y divide-border",children:n.map((N,F)=>c.jsx("li",{children:c.jsxs("button",{id:k(F),type:"button",role:"option","aria-selected":l===F,onClick:()=>E(N),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(l===F?"bg-neutral-100":""),children:[c.jsx("div",{className:"text-sm font-semibold text-foreground",children:N.name}),c.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[c.jsx("span",{children:N.location}),N.subtitle&&c.jsxs("span",{children:["• ",N.subtitle]})]})]})},N.id))}):c.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),c.jsxs("div",{className:"flex items-center justify-center gap-1 px-4 py-1.5 text-xs text-foreground-muted",children:["Press",c.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:T?"⌘ Cmd":"Ctrl"}),c.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]}),d)]})}function aa({className:e}){return c.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function la({className:e}){return c.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:c.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function Js({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.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 Ys({className:e}){return c.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:c.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}function Du({serialize:e,leftOffset:t}){const[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useRef(null),a=A.useRef(void 0),{portalHost:l,rootElement:u,deref:f}=Ve(),d=()=>e(f),p=Pu(u,n),h=p!=="docked",m=Vs(u,h),g={left:h?((m==null?void 0:m.left)??0)+t:t,transform:`translateY(${p==="hidden"?"-150%":"0px"})`,zIndex:40,...h?{position:"fixed",top:10,pointerEvents:p==="hidden"?"none":void 0}:{}};A.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),A.useEffect(()=>{if(!n)return;const y=x=>{x.key==="Escape"&&r(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),A.useEffect(()=>{if(!n)return;const y=x=>{i.current&&!i.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const v=async()=>{const y=d();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:y.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(y),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),o(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>o(!1),2e3)}catch(x){console.error("[MarkdownExportMenu] Copy for LLM failed:",x)}r(!1)},j=()=>{const y=d(),x=new Blob([y],{type:"text/markdown"}),w=URL.createObjectURL(x);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:y.length,blobUrl:w}),window.open(w,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(w),3e4),r(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>r(y=>!y),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",style:g,children:[s?c.jsx(la,{className:"w-4 h-4 shrink-0 text-green-600"}):c.jsx(aa,{className:"w-4 h-4 shrink-0"}),c.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),c.jsx(Ys,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&l&&Ar.createPortal(c.jsxs("div",{ref:i,role:"menu",style:{position:h?"fixed":"absolute",top:54,left:g.left,zIndex:41},className:"w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:v,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),c.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:j,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[c.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),c.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),c.jsx(Js,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]}),l)]})}const Dt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ds=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>ds(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,ds(r,t)]).join(" "):Dt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,ds(r,t)]).join(" ")):"",st=e=>ds(e).trim().replace(/\s+/g," "),Oh=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Nh=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Ch=e=>{if(!Dt(e))return e;const t={};for(const[n,r]of Object.entries(e))Nh.has(n)||(t[n]=r);return t},Bu=(e,t,n,r)=>{const s=`schema-${n}`,o=(a,l,u,f)=>{const d=`components.schemas.${n}${l.length?`.${l.join(".")}`:""}`,p=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,h=Dt(a)?a.description:void 0,m=l.length?`${r}.${l.join(".")}`:r;e.push({id:`schema-${n}-${l.join("-")||"root"}`,targetId:f?Oh(n,f):s,type:"schema",tab:"schemas",key:n,name:m,path:d,location:p,subtitle:h,text:st([Ch(a)]),schemaFocusTokens:f&&f.length>0?f:void 0})},i=(a,l=[],u=[],f=[],d=new Set)=>{if(o(a,l,u,f),!Dt(a)||d.has(a))return;if(d.add(a),Dt(a.properties))for(const[h,m]of Object.entries(a.properties))i(m,[...l,"properties",h],[...u,h],f?[...f,"properties",h]:null,d);const p=a.items;Dt(p)?i(p,[...l,"items"],[...u,"items"],f?[...f,"items"]:null,d):Array.isArray(p)&&p.forEach((h,m)=>{i(h,[...l,`items[${m}]`],[...u,`items[${m}]`],null,d)});for(const h of["allOf","oneOf","anyOf"]){const m=a[h];Array.isArray(m)&&m.forEach((g,v)=>{i(g,[...l,`${h}[${v}]`],[...u,`${h}[${v}]`],f&&h!=="allOf"?[...f,`${h}[${v}]`]:null,d)})}Dt(a.additionalProperties)&&i(a.additionalProperties,[...l,"additionalProperties"],[...u,"additionalProperties"],null,d)};i(t)};function _h(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",o=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:o,text:st([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,o]of Object.entries(e.servers)){const i=o,a=i.description??s,l=[i.protocol,i.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:l,text:st([s,a,l,i.description,i.protocol,i.host,i.variables,i.security,i.bindings])});const u=i.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:st(u)});const f=i.bindings,d=Dt(f)&&i.protocol?f[i.protocol]:void 0;d!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${i.protocol} configuration`,path:`servers.${s}.bindings.${i.protocol}`,location:`Servers > ${s} > ${i.protocol} configuration`,focusSection:`binding:${i.protocol}`,text:st(d)})}if(e.operations)for(const[s,o]of Object.entries(e.operations)){const i=o.title??s,a=o.summary??o.description??o.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:i,path:`operations.${s}`,location:`Operations > ${i}`,subtitle:a,text:st([s,i,a,o.action,o.channel,o.messages,o.reply,o.traits,o.bindings,o.security,o.tags])});const l=o.security;Array.isArray(l)&&l.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${i} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${i} > Authorization`,focusSection:"security",text:st(l)});const u=o.bindings;if(Dt(u))for(const[f,d]of Object.entries(u))d!=null&&t.push({id:`operation-${s}-bindings-${f}`,targetId:`operation-${s}-bindings-${f}`,type:"operation",tab:"operations",key:s,name:`${i} > ${f} configuration`,path:`operations.${s}.bindings.${f}`,location:`Operations > ${i} > ${f} configuration`,focusSection:`binding:${f}`,text:st(d)})}if((n=e.components)!=null&&n.messages)for(const[s,o]of Object.entries(e.components.messages)){const i=o.title??o.name??s,a=o.summary??o.description??o.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:i,path:`components.messages.${s}`,location:`Messages > ${i}`,subtitle:a,text:st([s,i,a,o.contentType,o.payload,o.headers,o.correlationId,o.tags,o.externalDocs,o.bindings])}),o.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${i} > Payload`,focusSection:"payload",text:st(o.payload)}),o.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${i} > Headers`,focusSection:"headers",text:st(o.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Bu(t,o,s,s);return t}function en(e){return Array.isArray?Array.isArray(e):Uu(e)==="[object Array]"}function Rh(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 mi(e){return e==null?"":Rh(e)}function Ye(e){return typeof e=="string"}function ps(e){return typeof e=="number"}function Ih(e){return e===!0||e===!1||Ph(e)&&Uu(e)=="[object Boolean]"}function Fu(e){return typeof e=="object"}function Ph(e){return Fu(e)&&e!==null}function ct(e){return e!=null}function Gr(e){return!e.trim().length}function Uu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const $h="Incorrect 'index' type",gi="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Mh=e=>`Invalid value for key ${e}`,Lh=e=>`Pattern length exceeds max of ${e}.`,Dh=e=>`Missing ${e} property in key`,Bh=e=>`Property 'weight' in key '${e}' must be a positive integer`,Fh="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.",Pl=Object.prototype.hasOwnProperty;var Uh=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=Hu(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Hu(e){let t=null,n=null,r=null,s=1,o=null;if(Ye(e)||en(e))r=e,t=$l(e),n=hs(e);else{if(!Pl.call(e,"name"))throw new Error(Dh("name"));const i=e.name;if(r=i,Pl.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(Bh(hs(i)));t=$l(i),n=hs(i),o=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:o}}function $l(e){return en(e)?e:e.split(".")}function hs(e){return en(e)?e.join("."):e}function Hh(e,t){const n=[];let r=!1;const s=(o,i,a,l)=>{if(ct(o))if(!i[a])n.push(l!==void 0?{v:o,i:l}:o);else{const u=o[i[a]];if(!ct(u))return;if(a===i.length-1&&(Ye(u)||ps(u)||Ih(u)||typeof u=="bigint"))n.push(l!==void 0?{v:mi(u),i:l}:mi(u));else if(en(u)){r=!0;for(let f=0,d=u.length;f<d;f+=1)s(u[f],i,a+1,f)}else i.length&&s(u,i,a+1,l)}};return s(e,Ye(t)?t.split("."):t,0),r?n:n[0]}const qh={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},zh={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},Wh={location:0,threshold:.6,distance:100},Vh={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Hh,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},oe=Object.freeze({...zh,...qh,...Wh,...Vh});function Kh(e){return e>=9&&e<=13||e===32||e===160}function Jh(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let o=0,i=!1;for(let l=0;l<s.length;l++)Kh(s.charCodeAt(l))?i=!1:i||(o++,i=!0);if(o===0&&(o=1),n.has(o))return n.get(o);const a=Math.round(r/Math.pow(o,.5*e))/r;return n.set(o,a),a},clear(){n.clear()}}}var ca=class{constructor({getFn:e=oe.getFn,fieldNormWeight:t=oe.fieldNormWeight}={}){this.norm=Jh(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(Ye(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(gi);if(Ye(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(gi);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,o=n.length;for(;s<o;){const i=s+o>>>1;n[i]<r.i?s=i+1:o=i}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ct(e)||Gr(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const o=this.keys[r],i=o.getFn?o.getFn(e):this.getFn(e,o.path);if(ct(i)){if(en(i)){const a=[];for(let l=0,u=i.length;l<u;l+=1){const f=i[l];if(ct(f)){if(Ye(f)){if(!Gr(f)){const d={v:f,i:l,n:this.norm.get(f)};a.push(d)}}else if(ct(f.v)){const d=Ye(f.v)?f.v:mi(f.v);if(!Gr(d)){const p={v:d,i:f.i,n:this.norm.get(d)};a.push(p)}}}}n.$[r]=a}else if(Ye(i)&&!Gr(i)){const a={v:i,n:this.norm.get(i)};n.$[r]=a}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function qu(e,t,{getFn:n=oe.getFn,fieldNormWeight:r=oe.fieldNormWeight}={}){const s=new ca({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(Hu)),s.setSources(t),s.create(),s}function Yh(e,{getFn:t=oe.getFn,fieldNormWeight:n=oe.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new ca({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function Zh(e=[],t=oe.minMatchCharLength){const n=[];let r=-1,s=-1,o=0;for(let i=e.length;o<i;o+=1){const a=e[o];a&&r===-1?r=o:!a&&r!==-1&&(s=o-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function Xh(e,t,n,{location:r=oe.location,distance:s=oe.distance,threshold:o=oe.threshold,findAllMatches:i=oe.findAllMatches,minMatchCharLength:a=oe.minMatchCharLength,includeMatches:l=oe.includeMatches,ignoreLocation:u=oe.ignoreLocation}={}){if(t.length>32)throw new Error(Lh(32));const f=t.length,d=e.length,p=Math.max(0,Math.min(r,d));let h=o,m=p;const g=(T,N)=>{const F=T/f;if(u)return F;const $=Math.abs(p-N);return s?F+$/s:$?1:F},v=a>1||l,j=v?Array(d):[];let y;for(;(y=e.indexOf(t,m))>-1;){const T=g(0,y);if(h=Math.min(T,h),m=y+f,v){let N=0;for(;N<f;)j[y+N]=1,N+=1}}m=-1;let x=[],w=1,E=0,S=f+d;const k=1<<f-1;for(let T=0;T<f;T+=1){let N=0,F=S;for(;N<F;)g(T,p+F)<=h?N=F:S=F,F=Math.floor((S-N)/2+N);S=F;let $=Math.max(1,p-F+1);const K=i?d:Math.min(p+F,d)+f,re=Array(K+2);re[K+1]=(1<<T)-1;for(let ie=K;ie>=$;ie-=1){const R=ie-1,P=n[e[R]];if(re[ie]=(re[ie+1]<<1|1)&P,T&&(re[ie]|=(x[ie+1]|x[ie])<<1|1|x[ie+1]),re[ie]&k&&(w=g(T,R),w<=h)){if(h=w,m=R,E=T,m<=p)break;$=Math.max(1,2*p-m)}}if(g(T+1,p)>h)break;x=re}if(v&&m>=0){const T=Math.min(d-1,m+f-1+E);for(let N=m;N<=T;N+=1)n[e[N]]&&(j[N]=1)}const C={isMatch:m>=0,score:Math.max(.001,w)};if(v){const T=Zh(j,a);T.length?l&&(C.indices=T):C.isMatch=!1}return C}function Qh(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function ua(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],o=e[n];o[0]<=s[1]+1?s[1]=Math.max(s[1],o[1]):t.push(o)}return t}const zu={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Gh=new RegExp("["+Object.keys(zu).join("")+"]","g"),yr=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(Gh,t=>zu[t]):e=>e;var fa=class{constructor(e,{location:t=oe.location,threshold:n=oe.threshold,distance:r=oe.distance,includeMatches:s=oe.includeMatches,findAllMatches:o=oe.findAllMatches,minMatchCharLength:i=oe.minMatchCharLength,isCaseSensitive:a=oe.isCaseSensitive,ignoreDiacritics:l=oe.ignoreDiacritics,ignoreLocation:u=oe.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:i,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:u},e=a?e:e.toLowerCase(),e=l?yr(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const f=(p,h)=>{this.chunks.push({pattern:p,alphabet:Qh(p),startIndex:h})},d=this.pattern.length;if(d>32){let p=0;const h=d%32,m=d-h;for(;p<m;)f(this.pattern.substr(p,32),p),p+=32;if(h){const g=d-32;f(this.pattern.substr(g),g)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:l,ignoreLocation:u}=this.options,f=[];let d=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:g,startIndex:v})=>{const{isMatch:j,score:y,indices:x}=Xh(e,m,g,{location:s+v,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:u});j&&(p=!0),d+=y,j&&x&&f.push(...x)});const h={isMatch:p,score:p?d/this.chunks.length:1};return p&&r&&(h.indices=ua(f)),h}};const em=new Set(["fuzzy","include"]);function tm(e){return e.startsWith("inverse")}const yi=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,r;const s=[],o=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+o,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new fa(e,{location:t.location??oe.location,threshold:t.threshold??oe.threshold,distance:t.distance??oe.distance,includeMatches:t.includeMatches??oe.includeMatches,findAllMatches:t.findAllMatches??oe.findAllMatches,minMatchCharLength:t.minMatchCharLength??oe.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??oe.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??oe.ignoreDiacritics,ignoreLocation:t.ignoreLocation??oe.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],Ml=yi.length,nm="\0",rm="|";function sm(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const o=s+1;if(o>=n||e[o]===" "){s++;break}if(e[o]==="$"&&(o+1>=n||e[o+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Ll(e,t){const n=e.match(t);return n?n[1]:null}function om(e,t={}){return e.replace(/\\\|/g,nm).split(rm).map(n=>{const r=sm(n.replace(/\u0000/g,"|").trim()).filter(o=>o&&!!o.trim()),s=[];for(let o=0,i=r.length;o<i;o+=1){const a=r[o];let l=!1,u=-1;for(;!l&&++u<Ml;){const f=yi[u],d=Ll(a,f.multiRegex);d&&(s.push(f.create(d,t)),l=!0)}if(!l)for(u=-1;++u<Ml;){const f=yi[u],d=Ll(a,f.singleRegex);if(d){s.push(f.create(d,t));break}}}return s})}var im=class{constructor(e,{isCaseSensitive:t=oe.isCaseSensitive,ignoreDiacritics:n=oe.ignoreDiacritics,includeMatches:r=oe.includeMatches,minMatchCharLength:s=oe.minMatchCharLength,ignoreLocation:o=oe.ignoreLocation,findAllMatches:i=oe.findAllMatches,location:a=oe.location,threshold:l=oe.threshold,distance:u=oe.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:i,ignoreLocation:o,location:a,threshold:l,distance:u},e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern=e,this.query=om(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?yr(e):e;let o=0;const i=[];let a=0,l=!1;for(let u=0,f=t.length;u<f;u+=1){const d=t[u];i.length=0,o=0,l=!1;for(let p=0,h=d.length;p<h;p+=1){const m=d[p],{isMatch:g,indices:v,score:j}=m.search(e);if(g)o+=1,a+=j,tm(m.type)&&(l=!0),n&&(em.has(m.type)?i.push(...v):i.push(v));else{a=0,o=0,i.length=0,l=!1;break}}if(o){const p={isMatch:!0,score:a/o};return l&&(p.hasInverse=!0),n&&(p.indices=ua(i)),p}}return{isMatch:!1,score:1}}};const xi=[];function da(...e){xi.push(...e)}function As(e,t){for(let n=0,r=xi.length;n<r;n+=1){const s=xi[n];if(s.condition(e,t))return new s(e,t)}return new fa(e,t)}const Ts={AND:"$and",OR:"$or"},bi={PATH:"$path",PATTERN:"$val"},vi=e=>!!(e[Ts.AND]||e[Ts.OR]),am=e=>!!e[bi.PATH],lm=e=>!en(e)&&Fu(e)&&!vi(e),Dl=e=>({[Ts.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Wu(e,t,{auto:n=!0}={}){const r=s=>{if(Ye(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=As(s,t)),l}const o=Object.keys(s),i=am(s);if(!i&&o.length>1&&!vi(s))return r(Dl(s));if(lm(s)){const l=i?s[bi.PATH]:o[0],u=i?s[bi.PATTERN]:s[l];if(!Ye(u))throw new Error(Mh(l));const f={keyId:hs(l),pattern:u};return n&&(f.searcher=As(u,t)),f}const a={children:[],operator:o[0]};return o.forEach(l=>{const u=s[l];en(u)&&u.forEach(f=>{a.children.push(r(f))})}),a};return vi(e)||(e=Dl(e)),r(e)}function wi(e,{ignoreFieldNorm:t=oe.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:o})=>{const i=r?r.weight:null;n*=Math.pow(o===0&&i?Number.EPSILON:o,(i||1)*(t?1:s))}),n}function cm(e,{ignoreFieldNorm:t=oe.ignoreFieldNorm}){e.forEach(n=>{n.score=wi(n.matches,{ignoreFieldNorm:t})})}var um=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,o=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),o<n&&this.comparator(t[o],t[r])>0&&(r=o),r!==e){const i=t[e];t[e]=t[r],t[r]=i}}while(r!==e)}};function fm(e){const t=[];return e.matches.forEach(n=>{if(!ct(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function dm(e,t,{includeMatches:n=oe.includeMatches,includeScore:r=oe.includeScore}={}){return e.map(s=>{const{idx:o}=s,i={item:t[o],refIndex:o};return n&&(i.matches=fm(s)),r&&(i.score=s.score),i})}const pm=/[\p{L}\p{M}\p{N}_]+/gu,Bl=new WeakSet;function hm(e){Bl.has(e)||(Bl.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 mm(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||hm(e),t=>t.match(e)||[]):t=>t.match(pm)||[]}function Si({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=mm(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=yr(s)),r(s)}}}var gm=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Si({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const o of n){this.termSearchers.push(new fa(o,{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 i=r.get(o)||0,a=Math.log(1+(s-i+.5)/(i+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,r=0,s=0,o=0;const i=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const f=this.termSearchers[u].searchIn(e),d=this.idfWeights[u];r+=d,f.isMatch&&(s++,n+=d*(1-f.score),f.indices&&t.push(...f.indices),this.combineAll&&(this.useMask?o|=1<<u:i.add(u)))}if(s===0)return{isMatch:!1,score:1};const a=r>0?1-n/r:0,l={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&t.length&&(l.indices=ua(t)),this.combineAll&&(this.useMask?l.matchedMask=o:l.matchedTerms=i,l.termCount=this.numTerms),l}};function Io(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const o=new Set(s);let i=e.docTermFieldHits.get(n);i||(i=new Map,e.docTermFieldHits.set(n,i));for(const a of o)i.set(a,(i.get(a)||0)+1),e.df.set(a,(e.df.get(a)||0)+1)}function Vu(e,t,n,r){const{i:s,v:o,$:i}=t;if(o!==void 0){Io(e,o,s,r);return}if(i)for(let a=0;a<n;a++){const l=i[a];if(l)if(Array.isArray(l))for(const u of l)Io(e,u.v,s,r);else Io(e,l.v,s,r)}}function ym(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)Vu(r,s,t,n);return r}function xm(e,t,n,r){Vu(e,t,n,r)}function bm(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,o]of r){const i=(e.df.get(s)||0)-o;i<=0?e.df.delete(s):e.df.set(s,i)}e.docTermFieldHits.delete(t)}}function Fl(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((a,l)=>a-l);for(const a of n)bm(e,a);const r=a=>{let l=0,u=n.length;for(;l<u;){const f=l+u>>>1;n[f]<a?l=f+1:u=f}return a-l},s=n[0],o=new Map;for(const[a,l]of e.docFieldCount)o.set(a>s?r(a):a,l);e.docFieldCount=o;const i=new Map;for(const[a,l]of e.docTermFieldHits)i.set(a>s?r(a):a,l);e.docTermFieldHits=i}var tn=class{constructor(e,t,n){this.options={...oe,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Uh(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=As(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 ca))throw new Error($h);if(this._myIndex=t||qu(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Si({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=ym(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=Si({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});xm(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Fl(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,o)=>!r.has(o)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(gi);this._invertedIndex&&Fl(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:s,shouldSort:o,sortFn:i,ignoreFieldNorm:a}=this.options;if(Ye(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return ps(n)&&n>-1&&(p=p.slice(0,n)),p}const l=o&&ps(n)&&n>0&&Ye(e),u=i,f=(p,h)=>u(p,h)||p.idx-h.idx;let d;if(l){const p=new um(n,f);Ye(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:a}),d=p.extractSorted()}else d=Ye(e)?Ye(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),cm(d,{ignoreFieldNorm:a}),o&&d.sort(Ye(e)?f:u),ps(n)&&n>-1&&(d=d.slice(0,n));return dm(d,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:o}=this._myIndex,i=t?null:[];return o.forEach(({v:a,i:l,n:u})=>{if(!ct(a))return;const f=r.searchIn(a);if(f.isMatch){const d={score:f.score,value:a,norm:u,indices:f.indices};s&&(d.matchedMask=f.matchedMask,d.matchedTerms=f.matchedTerms,d.termCount=f.termCount);const p=[d];if(!s||this._coversAllTokens(p)){const h={item:a,idx:l,matches:p};t?(h.score=wi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):i.push(h)}}}),i}_searchLogical(e){const t=Wu(e,this.options),n=this._normalizedKeys(),r=(a,l,u)=>{if(!("children"in a)){const{keyId:h,searcher:m}=a;let g;return h===null?(g=[],n.forEach((v,j)=>{g.push(...this._findMatches({key:v,value:l[j],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(l,h),searcher:m}),g&&g.length?[{idx:u,item:l,matches:g}]:[]}const{children:f,operator:d}=a,p=[];for(let h=0,m=f.length;h<m;h+=1){const g=f[h],v=r(g,l,u);if(v.length)p.push(...v);else if(d===Ts.AND)return[]}return p},s=this._myIndex.records,o=new Map,i=[];return s.forEach(({$:a,i:l})=>{if(ct(a)){const u=r(t,a,l);u.length&&(o.has(l)||(o.set(l,{idx:l,item:a,matches:[]}),i.push(o.get(l))),u.forEach(({matches:f})=>{o.get(l).matches.push(...f)}))}}),i}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:o}=this._myIndex,i=this._normalizedKeys(),a=t?null:[];return o.forEach(({$:l,i:u})=>{if(!ct(l))return;const f=[];let d=!1,p=!1;if(i.forEach((h,m)=>{const g=this._findMatches({key:h,value:l[m],searcher:r});g.length?(f.push(...g),g[0].hasInverse&&(p=!0)):d=!0}),!(p&&d)&&f.length&&(!s||this._coversAllTokens(f))){const h={idx:u,item:l,matches:f};t?(h.score=wi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}),a}_findMatches({key:e,value:t,searcher:n}){if(!ct(t))return[];const r=[];if(en(t))t.forEach(({v:s,i:o,n:i})=>{if(!ct(s))return;const a=n.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,idx:o,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),r.push(l)}});else{const{v:s,n:o}=t,i=n.searchIn(s);if(i.isMatch){const a={score:i.score,key:e,value:s,norm:o,indices:i.indices,hasInverse:i.hasInverse};i.termCount!==void 0&&(a.matchedMask=i.matchedMask,a.matchedTerms=i.matchedTerms,a.termCount=i.termCount),r.push(a)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const o of s)n.add(o)}return n.size===t}};tn.version="7.5.0";tn.createIndex=qu;tn.parseIndex=Yh;tn.config=oe;tn.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(Fh);return As(e,{...oe,...n}).searchIn(t)};tn.parseQuery=Wu;da(im);da(gm);tn.use=function(...e){e.forEach(t=>da(t))};var vm=tn;function Ku(e,t,n={}){const[r,s]=A.useState(""),[o,i]=A.useState(""),a=n.debounceMs??150;A.useEffect(()=>{const d=setTimeout(()=>i(r),a);return()=>clearTimeout(d)},[r,a]);const l=A.useMemo(()=>t(e),[e,t]),u=A.useMemo(()=>new vm(l,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[l,n.threshold]),f=A.useMemo(()=>o.trim()?u.search(o.trim(),{limit:n.limit??20}).map(d=>d.item):[],[u,o,n.limit]);return{query:r,setQuery:s,results:f,searchIndex:l}}function wm(e,t={}){return Ku(e,_h,t)}const ji="search-match",Ju=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Sm(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=s.nextNode();o;o=s.nextNode()){const i=(o.textContent??"").toLowerCase();let a=0;for(let l=i.indexOf(n);l!==-1;l=i.indexOf(n,a)){const u=document.createRange();u.setStart(o,l),u.setEnd(o,l+n.length),r.push(u),a=l+n.length}}return r}function jm(e,t){if(!Ju())return;const n=Sm(e,t);if(!n.length){CSS.highlights.delete(ji);return}CSS.highlights.set(ji,new Highlight(...n))}function Po(){Ju()&&CSS.highlights.delete(ji)}function Em(e,t){const n=A.useRef(null);A.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:o}=e;let i=!1;const a=u=>{if(i)return;const f=document.getElementById(r);if(!f){u<40&&setTimeout(()=>a(u+1),50);return}if(n.current!==r){try{f.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}o&&l(0)},l=u=>{if(i)return;const f=document.getElementById(r);f&&jm(f,s),u<6&&setTimeout(()=>l(u+1),100)};return setTimeout(()=>a(0),50),()=>{i=!0}},[e,...t])}function Yu({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s}){var F;const o=((F=e[0])==null?void 0:F.id)??t,[i,a]=A.useState(o),[l,u]=A.useState(null),f=$=>{a($),u($)},[d,p]=A.useState({}),h=e.some($=>$.id===i)?i:o,m={};for(const $ of r)m[$.id]=$.visible?d[$.id]??null:null;const g=($,K)=>p(re=>({...re,[$]:K})),[v,j]=A.useState(null),[y,x]=A.useState(null),[w,E]=A.useState(null),S=$=>{n($.tab)?f($.tab):$.tab==="servers"&&u("servers");const K={};for(const re of r)K[re.id]=re.id===$.tab?$.key:null;p(K),j($.focusSection??null),x($.tab==="schemas"&&$.schemaFocusTokens?{tokens:$.schemaFocusTokens,id:$.targetId}:null),$.tab==="schemas"&&Po(),E({targetId:$.targetId,query:s,highlight:$.tab!=="schemas"})},k=($,K)=>{f($),p(re=>{const ie={...re};for(const R of r)R.id!=="servers"&&(ie[R.id]=R.id===$?K:null);return ie})},C=$=>{u("servers");const K={};for(const re of r)K[re.id]=re.id==="servers"?$:null;p(K)},T=$=>{n($)&&f($)},N=(()=>{for(const $ of r){const K=m[$.id];if(K)return{tab:$.id,key:K}}return null})();return Em(w,[h,v,y,...r.map($=>m[$.id])]),A.useEffect(()=>{s.trim()||(E(null),Po())},[s]),A.useEffect(()=>Po,[]),{effectiveTab:h,focusTab:f,navActiveSection:l??h,selected:m,setSelectedKey:g,selectedNavItem:N,handleSearchSelect:S,handleNavItemSelect:k,handleNavServerSelect:C,handleContentTabChange:T,focusSection:v,schemaFocusTarget:y}}const le=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$t=e=>le(e)?e:null,Ul="^[\0-ÿ]*$",km=Math.pow(-2,31),Am=Math.pow(2,31)-1,Tm=Math.pow(-2,63),Om=Math.pow(2,63)-1,Nm={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"},pa=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function xr(e){const t=pa(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ei(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=xr(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Hl(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function Cm(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function _m(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 ki(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Ai(e,t,n){const{type:r,jsonSchema:s}=Cm(e,n);_m(r,t.example,s);function o(...i){i.forEach(a=>{let l=!0;a==="minLength"||a==="maxLength"?l=t[a]>-1:a==="multipleOf"&&(l=t[a]>0),t[a]!==void 0&&l&&(s[a]=t[a])})}switch(r){case"int":case"long":case"float":case"double":o("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),o("pattern","minLength","maxLength");break;case"array":o("minItems","maxItems","uniqueItems");break}}function ha(e,t,n){t!==void 0&&(e[t]=n)}function br(e,t){let n={};if(Array.isArray(e))return Im(n,e,t);const r=pa(e),s=typeof e=="string"?e:r.type;switch(n.type=Nm[s],s){case"int":{n.minimum=km,n.maximum=Am;break}case"long":{n.minimum=Tm,n.maximum=Om;break}case"bytes":{n.pattern=Ul;break}case"fixed":{n.pattern=Ul,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=br(r.values,t);break}case"array":{n.items=br(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const o=Rm(r,t,n);ha(t,xr(e),n),n.properties=Object.fromEntries(o.entries());break}default:{const o=t[xr(e)]??(typeof s=="string"?t[s]:void 0);o&&(n=ki(r)?{...o}:o);break}}return Ei(r,n,t),Ai(s,r,n),n}function Rm(e,t,n){const r=new Map;for(const s of e.fields??[]){const o=typeof s.type=="string"?t[s.type]:void 0;if(o){const i=ki(s)?{...o}:o;Hl(s,n,s.default!==void 0),ki(s)&&(Ei(s,i,t),Ai(s.type,s,i)),r.set(s.name,i)}else{const i=br(s.type,t);Hl(s,n,s.default!==void 0),Ei(s,i,t),Ai(s.type,s,i),r.set(s.name,i),ha(t,xr(s.type),i)}}return r}function Im(e,t,n){const r=[];let s=null;for(const o of t){const i=br(o,n);(typeof o=="string"?o:pa(o).type)==="null"?s=i:(r.push(i),ha(n,xr(o),i))}return s&&r.push(s),e.oneOf=r,e}function Ti(e){return br(e,{})}const ql=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Pm=new Set(["record","enum","array","map","fixed"]),zl=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function ma(e){const t=[];return _n(e,"schema",t,new Set),t}function _n(e,t,n,r){if(typeof e=="string"){!ql.has(e)&&!zl.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((o,i)=>_n(o,`${t}[${i}]`,n,r));return}if(!le(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||le(s)?_n(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!ql.has(s)&&!Pm.has(s)&&!zl.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((o,i)=>{const a=`${t}.fields[${i}]`;if(!le(o)||typeof o.name!="string"){n.push(`${a}: field must have a string "name"`);return}_n(o.type,`${a}.type`,n,r)});break}case"enum":{const o=e.symbols;(!Array.isArray(o)||o.some(i=>typeof i!="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"`):_n(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):_n(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let Os=null,$o=null;const Oi=new Set;function $m(){return $o||($o=Promise.resolve().then(()=>require("./protoToJsonSchema-AciPTlBK.cjs")).then(e=>{Os=e.protoToJsonSchema,Oi.forEach(t=>t())})),$o}function Mm(){return Os||$m(),Os}function Lm(e){return Oi.add(e),()=>Oi.delete(e)}function Wl(){return Os!==null}function ga(){return A.useSyncExternalStore(Lm,Wl,Wl)}const Dm="x-parser-original-payload",Ns="x-lib-conversion-error",Bm=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,Fm=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Or(e){return typeof e=="string"&&Bm.test(e)}function Nr(e){return typeof e=="string"&&Fm.test(e)}function Zu(e){return le(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Xu(e){var t,n;if(typeof e!="string")return null;if(Or(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Nr(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function Qu(e){return Or(e)?"Avro":Nr(e)?"Protobuf":null}function Um(e,t){return t?!1:!e||Or(e)||Nr(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Hm=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],qm=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function zm(e){return typeof e=="string"||Array.isArray(e)?!0:le(e)?typeof e.type=="string"&&qm.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Hm.some(t=>t in e):!1}function vr(e,t){let n=e;if(t&&le(n)&&typeof n.$ref=="string"){const i=t(n.$ref);i!==void 0&&(n=i)}const r=Wm(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const o=Zu(n)?n.description:void 0;return typeof o=="string"?{...r,description:o}:r}function Wm(e){var i;if(!Zu(e))return{schema:$t(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[Dm],s=(i=$t(n))==null?void 0:i[Ns];if(typeof s=="string")return{schema:$t(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:r};if(Or(t)&&zm(n)){const a=ma(n);if(a.length>0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:a[0]};try{return{schema:Ti(n),schemaFormat:t,originalSchema:n}}catch(l){return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:l instanceof Error?l.message:"Failed to convert Avro schema"}}}if(Nr(t)&&typeof n=="string"){const a=Mm();if(!a)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:a(n),schemaFormat:t,originalSchema:n}}catch(l){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:l instanceof Error?l.message:"Failed to convert Protobuf schema"}}}const o=$t(n);return o?{schema:o,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const De=(e,t)=>`${"#".repeat(e)} ${t}`,G=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),rr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Vm={objects:new Set,refs:new Set};function ms(e,t,n=Vm){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||rr(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const o=rr(e)?e["x-parser-schema-id"]:void 0;return typeof o=="string"?{$ref:`#/components/schemas/${o} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:rr(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(o=>ms(o,t,r));if(rr(e)&&typeof e.$ref=="string"){const o=t==null?void 0:t(e.$ref);return rr(o)||Array.isArray(o)?ms(o,t,r):{$ref:e.$ref}}const s={};for(const[o,i]of Object.entries(e))s[o]=ms(i,t,r);return s}function Cs(e,t,n){if(!t)return"";const r=ms(t,n);return`${De(4,`\`${G(e)}\``)}
4
-
5
- \`\`\`json
6
- ${JSON.stringify(r,null,2)}
7
- \`\`\``}function fr(e,t,n){if(!t||typeof t=="boolean")return"";const{schema:r,description:s,conversionError:o,pendingConversion:i}=vr(t,n);if(i)return`${De(4,`\`${G(e)}\``)}
8
-
9
- _(schema conversion still in progress)_`;if(o)return`${De(4,`\`${G(e)}\``)}
10
-
11
- _(could not convert schema: ${G(o)})_`;const a=s&&!r.description?{...r,description:s}:r;return Cs(e,a,n)}function Gu(e){const t=[],{info:n}=e;t.push(De(1,G(n.title)));const r=[`**Version:** ${G(n.version)}`];if(n.license&&r.push(`**License:** ${G(n.license.name)}${n.license.url?` (${G(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(G).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
12
- `)),n.description&&t.push(G(n.description)),e.servers&&Object.keys(e.servers).length){const s=[De(2,"Servers")];for(const[o,i]of Object.entries(e.servers)){s.push(De(3,G(o)));const a=[`**Host:** \`${G(i.host)}${i.pathname?G(i.pathname):""}\``];a.push(`**Protocol:** ${G(i.protocol)}${i.protocolVersion?` ${G(i.protocolVersion)}`:""}`),i.description&&a.push(G(i.description)),s.push(a.join(`
13
- `))}t.push(s.join(`
14
-
15
- `))}return t}function Km(e,t){var o,i,a;const n=Gu(e);if(e.operations&&Object.keys(e.operations).length){const l=[De(2,"Operations")];for(const[u,f]of Object.entries(e.operations)){const d=f.channel;l.push(De(3,`${G((o=f.action)==null?void 0:o.toUpperCase())} \`${G(u)}\``));const p=[];d!=null&&d.address&&p.push(`**Channel:** \`${G(d.address)}\``),f.summary&&p.push(G(f.summary)),f.description&&p.push(G(f.description));const h=f.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${G(m.name??m.title??"message")}\``).join(", ")}`),l.push(p.join(`
16
-
17
- `))}n.push(l.join(`
18
-
19
- `))}const r=(i=e.components)==null?void 0:i.messages;if(r&&Object.keys(r).length){const l=[De(2,"Messages")];for(const[u,f]of Object.entries(r)){l.push(De(3,G(f.title??f.name??u)));const d=[];f.summary&&d.push(G(f.summary)),f.description&&d.push(G(f.description)),f.contentType&&d.push(`**Content-Type:** \`${G(f.contentType)}\``),l.push(d.join(`
20
-
21
- `)),f.payload&&l.push(fr("payload",f.payload,t)),f.headers&&l.push(fr("headers",f.headers,t))}n.push(l.join(`
22
-
23
- `))}const s=(a=e.components)==null?void 0:a.schemas;if(s&&Object.keys(s).length){const l=[De(2,"Schemas")];for(const[u,f]of Object.entries(s))l.push(fr(u,f,t));n.push(l.join(`
24
-
25
- `))}return n.filter(Boolean).join(`
26
-
27
- `)}function Jm(e,t,n){var a;const r=t.channel,s=[De(3,`${G((a=t.action)==null?void 0:a.toUpperCase())} \`${G(e)}\``)],o=[];r!=null&&r.address&&o.push(`**Channel:** \`${G(r.address)}\``),t.summary&&o.push(G(t.summary)),t.description&&o.push(G(t.description)),s.push(o.join(`
28
-
29
- `));const i=t.messages??[];for(const l of i){const u=[De(4,G(l.title??l.name??"Message"))],f=[];l.summary&&f.push(G(l.summary)),l.description&&f.push(G(l.description)),l.contentType&&f.push(`**Content-Type:** \`${G(l.contentType)}\``),f.length&&u.push(f.join(`
30
-
31
- `)),s.push(u.join(`
32
-
33
- `)),l.payload&&s.push(fr("payload",l.payload,n)),l.headers&&s.push(fr("headers",l.headers,n))}return s.filter(Boolean).join(`
34
-
35
- `)}function Ym(e,t,n){var o;const r=(o=e.operations)==null?void 0:o[t];if(!r)return"";const s=Gu(e);return s.push(Jm(t,r,n)),s.filter(Boolean).join(`
36
-
37
- `)}function ef(e,t,n,r){var l;const s=[De(3,`${e.toUpperCase()} \`${G(t)}\``)],o=[];n.summary&&o.push(G(n.summary)),n.description&&o.push(G(n.description)),n.deprecated&&o.push("**Deprecated**");for(const u of["path","query","header","cookie"]){const f=(n.parameters??[]).filter(d=>d.in===u);if(f.length){o.push(`**${u[0].toUpperCase()}${u.slice(1)} Parameters:**`);for(const d of f){const p=d.schema;o.push(`- \`${G(d.name)}\`${d.required?" (required)":""}${p!=null&&p.type?` — ${G(p.type)}`:""}${d.description?`: ${G(d.description)}`:""}`)}}}s.push(o.join(`
38
-
39
- `));const i=((l=n.requestBody)==null?void 0:l.content)??{};for(const[u,f]of Object.entries(i))s.push([`**Request Body** (\`${G(u)}\`)`,Cs("body",f.schema,r)].join(`
40
-
41
- `));const a=n.responses??{};for(const[u,f]of Object.entries(a)){const d=[De(4,`${u}${f.description?`: ${G(f.description)}`:""}`)];for(const[p,h]of Object.entries(f.content??{}))d.push([`**Body** (\`${G(p)}\`)`,Cs("body",h.schema,r)].join(`
42
-
43
- `));s.push(d.join(`
44
-
45
- `))}return s.join(`
46
-
47
- `)}function Zm(e,t){var i,a,l,u;const n=[],{info:r}=e;if(n.push(De(1,G(r.title))),n.push(`**Version:** ${G(r.version)}`),r.description&&n.push(G(r.description)),(i=e.servers)!=null&&i.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${G(d.url)}\`${d.description?` — ${G(d.description)}`:""}`);n.push(f.join(`
48
- `))}const s=e.paths?ks(e.paths):[];if(s.length){const f=[De(2,"Endpoints")];for(const{method:d,path:p}of s){const h=(l=(a=e.paths)==null?void 0:a[p])==null?void 0:l[d];h&&f.push(ef(d,p,h,t))}n.push(f.join(`
49
-
50
- `))}const o=(u=e.components)==null?void 0:u.schemas;if(o&&Object.keys(o).length){const f=[De(2,"Schemas")];for(const[d,p]of Object.entries(o))f.push(Cs(d,p,t));n.push(f.join(`
51
-
52
- `))}return n.filter(Boolean).join(`
53
-
54
- `)}function Xm(e,t,n,r){var a,l,u;const s=(l=(a=e.paths)==null?void 0:a[n])==null?void 0:l[t];if(!s)return"";const o=[],{info:i}=e;if(o.push(De(1,G(i.title))),o.push(`**Version:** ${G(i.version)}`),i.description&&o.push(G(i.description)),(u=e.servers)!=null&&u.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${G(d.url)}\`${d.description?` — ${G(d.description)}`:""}`);o.push(f.join(`
55
- `))}return o.push(ef(t,n,s,r)),o.filter(Boolean).join(`
56
-
57
- `)}const tf={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},Qm=()=>Promise.resolve().then(()=>require("./LogoExtension-BOYrY_RE.cjs"));var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Gm(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */var Mo,Vl;function Kl(){if(Vl)return Mo;Vl=1;function e(M,B){(B==null||B>M.length)&&(B=M.length);for(var Z=0,ae=Array(B);Z<B;Z++)ae[Z]=M[Z];return ae}function t(M){if(Array.isArray(M))return M}function n(M,B){var Z=M==null?null:typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(Z!=null){var ae,xe,Te,Je,Jn=[],ot=!0,Yn=!1;try{if(Te=(Z=Z.call(M)).next,B!==0)for(;!(ot=(ae=Te.call(Z)).done)&&(Jn.push(ae.value),Jn.length!==B);ot=!0);}catch(uo){Yn=!0,xe=uo}finally{try{if(!ot&&Z.return!=null&&(Je=Z.return(),Object(Je)!==Je))return}finally{if(Yn)throw xe}}return Jn}}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
58
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(M,B){return t(M)||n(M,B)||o(M,B)||r()}function o(M,B){if(M){if(typeof M=="string")return e(M,B);var Z={}.toString.call(M).slice(8,-1);return Z==="Object"&&M.constructor&&(Z=M.constructor.name),Z==="Map"||Z==="Set"?Array.from(M):Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z)?e(M,B):void 0}}const i=Object.entries,a=Object.setPrototypeOf,l=Object.isFrozen,u=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor;let d=Object.freeze,p=Object.seal,h=Object.create,m=typeof Reflect<"u"&&Reflect,g=m.apply,v=m.construct;d||(d=function(B){return B}),p||(p=function(B){return B}),g||(g=function(B,Z){for(var ae=arguments.length,xe=new Array(ae>2?ae-2:0),Te=2;Te<ae;Te++)xe[Te-2]=arguments[Te];return B.apply(Z,xe)}),v||(v=function(B){for(var Z=arguments.length,ae=new Array(Z>1?Z-1:0),xe=1;xe<Z;xe++)ae[xe-1]=arguments[xe];return new B(...ae)});const j=_(Array.prototype.forEach),y=_(Array.prototype.lastIndexOf),x=_(Array.prototype.pop),w=_(Array.prototype.push),E=_(Array.prototype.splice),S=Array.isArray,k=_(String.prototype.toLowerCase),C=_(String.prototype.toString),T=_(String.prototype.match),N=_(String.prototype.replace),F=_(String.prototype.indexOf),$=_(String.prototype.trim),K=_(Number.prototype.toString),re=_(Boolean.prototype.toString),ie=typeof BigInt>"u"?null:_(BigInt.prototype.toString),R=typeof Symbol>"u"?null:_(Symbol.prototype.toString),P=_(Object.prototype.hasOwnProperty),V=_(Object.prototype.toString),J=_(RegExp.prototype.test),I=W(TypeError);function _(M){return function(B){B instanceof RegExp&&(B.lastIndex=0);for(var Z=arguments.length,ae=new Array(Z>1?Z-1:0),xe=1;xe<Z;xe++)ae[xe-1]=arguments[xe];return g(M,B,ae)}}function W(M){return function(){for(var B=arguments.length,Z=new Array(B),ae=0;ae<B;ae++)Z[ae]=arguments[ae];return v(M,Z)}}function L(M,B){let Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:k;if(a&&a(M,null),!S(B))return M;let ae=B.length;for(;ae--;){let xe=B[ae];if(typeof xe=="string"){const Te=Z(xe);Te!==xe&&(l(B)||(B[ae]=Te),xe=Te)}M[xe]=!0}return M}function ee(M){for(let B=0;B<M.length;B++)P(M,B)||(M[B]=null);return M}function Q(M){const B=h(null);for(const ae of i(M)){var Z=s(ae,2);const xe=Z[0],Te=Z[1];P(M,xe)&&(S(Te)?B[xe]=ee(Te):Te&&typeof Te=="object"&&Te.constructor===Object?B[xe]=Q(Te):B[xe]=Te)}return B}function te(M){switch(typeof M){case"string":return M;case"number":return K(M);case"boolean":return re(M);case"bigint":return ie?ie(M):"0";case"symbol":return R?R(M):"Symbol()";case"undefined":return V(M);case"function":case"object":{if(M===null)return V(M);const B=M,Z=D(B,"toString");if(typeof Z=="function"){const ae=Z(B);return typeof ae=="string"?ae:V(ae)}return V(M)}default:return V(M)}}function D(M,B){for(;M!==null;){const ae=f(M,B);if(ae){if(ae.get)return _(ae.get);if(typeof ae.value=="function")return _(ae.value)}M=u(M)}function Z(){return null}return Z}function ne(M){try{return J(M,""),!0}catch{return!1}}const ce=d(["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"]),ue=d(["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"]),fe=d(["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"]),me=d(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ye=d(["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"]),Ne=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Se=d(["#text"]),Xe=d(["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"]),Ke=d(["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"]),X=d(["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"]),Ce=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$e=p(/{{[\w\W]*|^[\w\W]*}}/g),we=p(/<%[\w\W]*|^[\w\W]*%>/g),It=p(/\${[\w\W]*/g),ft=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),rn=p(/^aria-[\-\w]+$/),dt=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=p(/^(?:\w+script|data):/i),z=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=p(/^html$/i),ge=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Me=p(/<[/\w!]/g),ht=p(/<[/\w]/g),lo=p(/<\/no(script|embed|frames)/i),co=p(/\/>/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},fp=function(){return typeof window>"u"?null:window},dp=function(B,Z){if(typeof B!="object"||typeof B.createPolicy!="function")return null;let ae=null;const xe="data-tt-policy-suffix";Z&&Z.hasAttribute(xe)&&(ae=Z.getAttribute(xe));const Te="dompurify"+(ae?"#"+ae:"");try{return B.createPolicy(Te,{createHTML(Je){return Je},createScriptURL(Je){return Je}})}catch{return console.warn("TrustedTypes policy "+Te+" could not be created."),null}},Ka=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ut=function(B,Z,ae,xe){return P(B,Z)&&S(B[Z])?L(xe.base?Q(xe.base):{},B[Z],xe.transform):ae};function Ja(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fp();const B=H=>Ja(H);if(B.version="3.4.11",B.removed=[],!M||!M.document||M.document.nodeType!==St.document||!M.Element)return B.isSupported=!1,B;let Z=M.document;const ae=Z,xe=ae.currentScript;M.DocumentFragment;const Te=M.HTMLTemplateElement,Je=M.Node,Jn=M.Element,ot=M.NodeFilter,Yn=M.NamedNodeMap;Yn===void 0&&(M.NamedNodeMap||M.MozNamedAttrMap),M.HTMLFormElement;const uo=M.DOMParser,qr=M.trustedTypes,sn=Jn.prototype,hp=D(sn,"cloneNode"),Ya=D(sn,"remove"),mp=D(sn,"nextSibling"),Zn=D(sn,"childNodes"),Xn=D(sn,"parentNode"),Za=D(sn,"shadowRoot"),fo=D(sn,"attributes"),it=Je&&Je.prototype?D(Je.prototype,"nodeType"):null,Ht=Je&&Je.prototype?D(Je.prototype,"nodeName"):null;if(typeof Te=="function"){const H=Z.createElement("template");H.content&&H.content.ownerDocument&&(Z=H.content.ownerDocument)}let tt,on="",po,Xa=!1,Qn=0;const Qa=function(){if(Qn>0)throw I('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.')},wn=function(b){Qa(),Qn++;try{return tt.createHTML(b)}finally{Qn--}},gp=function(b){Qa(),Qn++;try{return tt.createScriptURL(b)}finally{Qn--}},yp=function(){return Xa||(po=dp(qr,xe),Xa=!0),po},zr=Z,ho=zr.implementation,Ga=zr.createNodeIterator,xp=zr.createDocumentFragment,bp=zr.getElementsByTagName,vp=ae.importNode;let Le=Ka();B.isSupported=typeof i=="function"&&typeof Xn=="function"&&ho&&ho.createHTMLDocument!==void 0;const wp=$e,Sp=we,jp=It,Ep=ft,kp=rn,Ap=q,el=z,Tp=ge;let tl=dt,_e=null;const nl=L({},[...ce,...ue,...fe,...ye,...Se]);let Re=null;const rl=L({},[...Xe,...Ke,...X,...Ce]);let Ie=Object.seal(h(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}})),Gn=null,sl=null;const qt=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ol=!0,mo=!0,il=!1,al=!0,zt=!1,er=!0,an=!1,go=!1,yo=null,xo=null,bo=!1,Sn=!1,Wr=!1,Vr=!1,ll=!0,cl=!1;const ul="user-content-";let vo=!0,wo=!1,jn={},jt=null;const So=L({},["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 fl=null;const dl=L({},["audio","video","img","source","image","track"]);let jo=null;const pl=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kr="http://www.w3.org/1998/Math/MathML",Jr="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml";let En=Et,Eo=!1,ko=null;const Op=L({},[Kr,Jr,Et],C),hl=d(["mi","mo","mn","ms","mtext"]);let Ao=L({},hl);const ml=d(["annotation-xml"]);let To=L({},ml);const Np=L({},["title","style","font","a","script"]);let tr=null;const Cp=["application/xhtml+xml","text/html"],_p="text/html";let Pe=null,kn=null;const Rp=Z.createElement("form"),gl=function(b){return b instanceof RegExp||b instanceof Function},Oo=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===b)return;(!b||typeof b!="object")&&(b={}),b=Q(b),tr=Cp.indexOf(b.PARSER_MEDIA_TYPE)===-1?_p:b.PARSER_MEDIA_TYPE,Pe=tr==="application/xhtml+xml"?C:k,_e=Ut(b,"ALLOWED_TAGS",nl,{transform:Pe}),Re=Ut(b,"ALLOWED_ATTR",rl,{transform:Pe}),ko=Ut(b,"ALLOWED_NAMESPACES",Op,{transform:C}),jo=Ut(b,"ADD_URI_SAFE_ATTR",pl,{transform:Pe,base:pl}),fl=Ut(b,"ADD_DATA_URI_TAGS",dl,{transform:Pe,base:dl}),jt=Ut(b,"FORBID_CONTENTS",So,{transform:Pe}),Gn=Ut(b,"FORBID_TAGS",Q({}),{transform:Pe}),sl=Ut(b,"FORBID_ATTR",Q({}),{transform:Pe}),jn=P(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?Q(b.USE_PROFILES):b.USE_PROFILES:!1,ol=b.ALLOW_ARIA_ATTR!==!1,mo=b.ALLOW_DATA_ATTR!==!1,il=b.ALLOW_UNKNOWN_PROTOCOLS||!1,al=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=b.SAFE_FOR_TEMPLATES||!1,er=b.SAFE_FOR_XML!==!1,an=b.WHOLE_DOCUMENT||!1,Sn=b.RETURN_DOM||!1,Wr=b.RETURN_DOM_FRAGMENT||!1,Vr=b.RETURN_TRUSTED_TYPE||!1,bo=b.FORCE_BODY||!1,ll=b.SANITIZE_DOM!==!1,cl=b.SANITIZE_NAMED_PROPS||!1,vo=b.KEEP_CONTENT!==!1,wo=b.IN_PLACE||!1,tl=ne(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:dt,En=typeof b.NAMESPACE=="string"?b.NAMESPACE:Et,Ao=P(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?Q(b.MATHML_TEXT_INTEGRATION_POINTS):L({},hl),To=P(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?Q(b.HTML_INTEGRATION_POINTS):L({},ml);const O=P(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?Q(b.CUSTOM_ELEMENT_HANDLING):h(null);if(Ie=h(null),P(O,"tagNameCheck")&&gl(O.tagNameCheck)&&(Ie.tagNameCheck=O.tagNameCheck),P(O,"attributeNameCheck")&&gl(O.attributeNameCheck)&&(Ie.attributeNameCheck=O.attributeNameCheck),P(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),p(Ie),zt&&(mo=!1),Wr&&(Sn=!0),jn&&(_e=L({},Se),Re=h(null),jn.html===!0&&(L(_e,ce),L(Re,Xe)),jn.svg===!0&&(L(_e,ue),L(Re,Ke),L(Re,Ce)),jn.svgFilters===!0&&(L(_e,fe),L(Re,Ke),L(Re,Ce)),jn.mathMl===!0&&(L(_e,ye),L(Re,X),L(Re,Ce))),qt.tagCheck=null,qt.attributeCheck=null,P(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?qt.tagCheck=b.ADD_TAGS:S(b.ADD_TAGS)&&(_e===nl&&(_e=Q(_e)),L(_e,b.ADD_TAGS,Pe))),P(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?qt.attributeCheck=b.ADD_ATTR:S(b.ADD_ATTR)&&(Re===rl&&(Re=Q(Re)),L(Re,b.ADD_ATTR,Pe))),P(b,"ADD_URI_SAFE_ATTR")&&S(b.ADD_URI_SAFE_ATTR)&&L(jo,b.ADD_URI_SAFE_ATTR,Pe),P(b,"FORBID_CONTENTS")&&S(b.FORBID_CONTENTS)&&(jt===So&&(jt=Q(jt)),L(jt,b.FORBID_CONTENTS,Pe)),P(b,"ADD_FORBID_CONTENTS")&&S(b.ADD_FORBID_CONTENTS)&&(jt===So&&(jt=Q(jt)),L(jt,b.ADD_FORBID_CONTENTS,Pe)),vo&&(_e["#text"]=!0),an&&L(_e,["html","head","body"]),_e.table&&(L(_e,["tbody"]),delete Gn.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw I('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw I('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=tt;tt=b.TRUSTED_TYPES_POLICY;try{on=wn("")}catch(Y){throw tt=U,Y}}else b.TRUSTED_TYPES_POLICY===null?(tt=void 0,on=""):(tt===void 0&&(tt=yp()),tt&&typeof on=="string"&&(on=wn("")));d&&d(b),kn=b},yl=L({},[...ue,...fe,...me]),xl=L({},[...ye,...Ne]),Ip=function(b,O,U){return O.namespaceURI===Et?b==="svg":O.namespaceURI===Kr?b==="svg"&&(U==="annotation-xml"||Ao[U]):!!yl[b]},Pp=function(b,O,U){return O.namespaceURI===Et?b==="math":O.namespaceURI===Jr?b==="math"&&To[U]:!!xl[b]},$p=function(b,O,U){return O.namespaceURI===Jr&&!To[U]||O.namespaceURI===Kr&&!Ao[U]?!1:!xl[b]&&(Np[b]||!yl[b])},Mp=function(b){let O=Xn(b);(!O||!O.tagName)&&(O={namespaceURI:En,tagName:"template"});const U=k(b.tagName),Y=k(O.tagName);return ko[b.namespaceURI]?b.namespaceURI===Jr?Ip(U,O,Y):b.namespaceURI===Kr?Pp(U,O,Y):b.namespaceURI===Et?$p(U,O,Y):!!(tr==="application/xhtml+xml"&&ko[b.namespaceURI]):!1},Wt=function(b){w(B.removed,{element:b});try{Xn(b).removeChild(b)}catch{if(Ya(b),!Xn(b))throw I("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bl=function(b){const O=Zn(b);if(O){const Y=[];j(O,de=>{w(Y,de)}),j(Y,de=>{try{Ya(de)}catch{}})}const U=fo(b);if(U)for(let Y=U.length-1;Y>=0;--Y){const de=U[Y],be=de&&de.name;if(typeof be=="string")try{b.removeAttribute(be)}catch{}}},ln=function(b,O){try{w(B.removed,{attribute:O.getAttributeNode(b),from:O})}catch{w(B.removed,{attribute:null,from:O})}if(O.removeAttribute(b),b==="is")if(Sn||Wr)try{Wt(O)}catch{}else try{O.setAttribute(b,"")}catch{}},Lp=function(b){const O=fo(b);if(O)for(let U=O.length-1;U>=0;--U){const Y=O[U],de=Y&&Y.name;if(!(typeof de!="string"||Re[Pe(de)]))try{b.removeAttribute(de)}catch{}}},Dp=function(b){const O=[b];for(;O.length>0;){const U=O.pop();(it?it(U):U.nodeType)===St.element&&Lp(U);const de=Zn(U);if(de)for(let be=de.length-1;be>=0;--be)O.push(de[be])}},vl=function(b){let O=null,U=null;if(bo)b="<remove></remove>"+b;else{const be=T(b,/^[\r\n\t ]+/);U=be&&be[0]}tr==="application/xhtml+xml"&&En===Et&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Y=tt?wn(b):b;if(En===Et)try{O=new uo().parseFromString(Y,tr)}catch{}if(!O||!O.documentElement){O=ho.createDocument(En,"template",null);try{O.documentElement.innerHTML=Eo?on:Y}catch{}}const de=O.body||O.documentElement;return b&&U&&de.insertBefore(Z.createTextNode(U),de.childNodes[0]||null),En===Et?bp.call(O,an?"html":"body")[0]:an?O.documentElement:de},wl=function(b){return Ga.call(b.ownerDocument||b,b,ot.SHOW_ELEMENT|ot.SHOW_COMMENT|ot.SHOW_TEXT|ot.SHOW_PROCESSING_INSTRUCTION|ot.SHOW_CDATA_SECTION,null)},Yr=function(b){return b=N(b,wp," "),b=N(b,Sp," "),b=N(b,jp," "),b},No=function(b){var O;b.normalize();const U=Ga.call(b.ownerDocument||b,b,ot.SHOW_TEXT|ot.SHOW_COMMENT|ot.SHOW_CDATA_SECTION|ot.SHOW_PROCESSING_INSTRUCTION,null);let Y=U.nextNode();for(;Y;)Y.data=Yr(Y.data),Y=U.nextNode();const de=(O=b.querySelectorAll)===null||O===void 0?void 0:O.call(b,"template");de&&j(de,be=>{An(be.content)&&No(be.content)})},Zr=function(b){const O=Ht?Ht(b):null;return typeof O!="string"||Pe(O)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==fo(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==it(b)||b.childNodes!==Zn(b)},An=function(b){if(!it||typeof b!="object"||b===null)return!1;try{return it(b)===St.documentFragment}catch{return!1}},nr=function(b){if(!it||typeof b!="object"||b===null)return!1;try{return typeof it(b)=="number"}catch{return!1}};function Pt(H,b,O){H.length!==0&&j(H,U=>{U.call(B,b,O,kn)})}const Bp=function(b,O){return!!(er&&b.hasChildNodes()&&!nr(b.firstElementChild)&&J(Me,b.textContent)&&J(Me,b.innerHTML)||er&&b.namespaceURI===Et&&O==="style"&&nr(b.firstElementChild)||b.nodeType===St.processingInstruction||er&&b.nodeType===St.comment&&J(ht,b.data))},Fp=function(b,O){if(!Gn[O]&&El(O)&&(Ie.tagNameCheck instanceof RegExp&&J(Ie.tagNameCheck,O)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(O)))return!1;if(vo&&!jt[O]){const U=Xn(b),Y=Zn(b);if(Y&&U){const de=Y.length;for(let be=de-1;be>=0;--be){const He=wo?Y[be]:hp(Y[be],!0);U.insertBefore(He,mp(b))}}}return Wt(b),!0},Sl=function(b){if(Pt(Le.beforeSanitizeElements,b,null),Zr(b))return Wt(b),!0;const O=Pe(Ht?Ht(b):b.nodeName);if(Pt(Le.uponSanitizeElement,b,{tagName:O,allowedTags:_e}),Bp(b,O))return Wt(b),!0;if(Gn[O]||!(qt.tagCheck instanceof Function&&qt.tagCheck(O))&&!_e[O])return Fp(b,O);if((it?it(b):b.nodeType)===St.element&&!Mp(b)||(O==="noscript"||O==="noembed"||O==="noframes")&&J(lo,b.innerHTML))return Wt(b),!0;if(zt&&b.nodeType===St.text){const Y=Yr(b.textContent);b.textContent!==Y&&(w(B.removed,{element:b.cloneNode()}),b.textContent=Y)}return Pt(Le.afterSanitizeElements,b,null),!1},jl=function(b,O,U){if(sl[O]||ll&&(O==="id"||O==="name")&&(U in Z||U in Rp))return!1;const Y=Re[O]||qt.attributeCheck instanceof Function&&qt.attributeCheck(O,b);if(!(mo&&J(Ep,O))){if(!(ol&&J(kp,O))){if(Y){if(!jo[O]){if(!J(tl,N(U,el,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&b!=="script"&&F(U,"data:")===0&&fl[b])){if(!(il&&!J(Ap,N(U,el,"")))){if(U)return!1}}}}}else if(!(El(b)&&(Ie.tagNameCheck instanceof RegExp&&J(Ie.tagNameCheck,b)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(b))&&(Ie.attributeNameCheck instanceof RegExp&&J(Ie.attributeNameCheck,O)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(O,b))||O==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&J(Ie.tagNameCheck,U)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(U))))return!1}}return!0},Up=L({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),El=function(b){return!Up[k(b)]&&J(Tp,b)},Hp=function(b,O,U,Y){if(tt&&typeof qr=="object"&&typeof qr.getAttributeType=="function"&&!U)switch(qr.getAttributeType(b,O)){case"TrustedHTML":return wn(Y);case"TrustedScriptURL":return gp(Y)}return Y},qp=function(b,O,U,Y){try{U?b.setAttributeNS(U,O,Y):b.setAttribute(O,Y),Zr(b)?Wt(b):x(B.removed)}catch{ln(O,b)}},kl=function(b){Pt(Le.beforeSanitizeAttributes,b,null);const O=b.attributes;if(!O||Zr(b))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let Y=O.length;const de=Pe(b.nodeName);for(;Y--;){const be=O[Y],He=be.name,Be=be.namespaceURI,pt=be.value,mt=Pe(He),_o=pt;let Qe=He==="value"?_o:$(_o);if(U.attrName=mt,U.attrValue=Qe,U.keepAttr=!0,U.forceKeepAttr=void 0,Pt(Le.uponSanitizeAttribute,b,U),Qe=U.attrValue,cl&&(mt==="id"||mt==="name")&&F(Qe,ul)!==0&&(ln(He,b),Qe=ul+Qe),er&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qe)){ln(He,b);continue}if(mt==="attributename"&&T(Qe,"href")){ln(He,b);continue}if(!U.forceKeepAttr){if(!U.keepAttr){ln(He,b);continue}if(!al&&J(co,Qe)){ln(He,b);continue}if(zt&&(Qe=Yr(Qe)),!jl(de,mt,Qe)){ln(He,b);continue}Qe=Hp(de,mt,Be,Qe),Qe!==_o&&qp(b,He,Be,Qe)}}Pt(Le.afterSanitizeAttributes,b,null)},Xr=function(b){let O=null;const U=wl(b);for(Pt(Le.beforeSanitizeShadowDOM,b,null);O=U.nextNode();)if(Pt(Le.uponSanitizeShadowNode,O,null),Sl(O),kl(O),An(O.content)&&Xr(O.content),(it?it(O):O.nodeType)===St.element){const de=Za(O);An(de)&&(Co(de),Xr(de))}Pt(Le.afterSanitizeShadowDOM,b,null)},Co=function(b){const O=[{node:b,shadow:null}];for(;O.length>0;){const U=O.pop();if(U.shadow){Xr(U.shadow);continue}const Y=U.node,be=(it?it(Y):Y.nodeType)===St.element,He=Zn(Y);if(He)for(let Be=He.length-1;Be>=0;--Be)O.push({node:He[Be],shadow:null});if(be){const Be=Ht?Ht(Y):null;if(typeof Be=="string"&&Pe(Be)==="template"){const pt=Y.content;An(pt)&&O.push({node:pt,shadow:null})}}if(be){const Be=Za(Y);An(Be)&&O.push({node:null,shadow:Be},{node:Be,shadow:null})}}};return B.sanitize=function(H){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,U=null,Y=null,de=null;if(Eo=!H,Eo&&(H="<!-->"),typeof H!="string"&&!nr(H)&&(H=te(H),typeof H!="string"))throw I("dirty is not a string, aborting");if(!B.isSupported)return H;go?(_e=yo,Re=xo):Oo(b),(Le.uponSanitizeElement.length>0||Le.uponSanitizeAttribute.length>0)&&(_e=Q(_e)),Le.uponSanitizeAttribute.length>0&&(Re=Q(Re)),B.removed=[];const be=wo&&typeof H!="string"&&nr(H);if(be){const pt=Ht?Ht(H):H.nodeName;if(typeof pt=="string"){const mt=Pe(pt);if(!_e[mt]||Gn[mt])throw I("root node is forbidden and cannot be sanitized in-place")}if(Zr(H))throw I("root node is clobbered and cannot be sanitized in-place");try{Co(H)}catch(mt){throw bl(H),mt}}else if(nr(H))O=vl("<!---->"),U=O.ownerDocument.importNode(H,!0),U.nodeType===St.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?O=U:O.appendChild(U),Co(U);else{if(!Sn&&!zt&&!an&&H.indexOf("<")===-1)return tt&&Vr?wn(H):H;if(O=vl(H),!O)return Sn?null:Vr?on:""}O&&bo&&Wt(O.firstChild);const He=wl(be?H:O);try{for(;Y=He.nextNode();)Sl(Y),kl(Y),An(Y.content)&&Xr(Y.content)}catch(pt){throw be&&bl(H),pt}if(be)return j(B.removed,pt=>{pt.element&&Dp(pt.element)}),zt&&No(H),H;if(Sn){if(zt&&No(O),Wr)for(de=xp.call(O.ownerDocument);O.firstChild;)de.appendChild(O.firstChild);else de=O;return(Re.shadowroot||Re.shadowrootmode)&&(de=vp.call(ae,de,!0)),de}let Be=an?O.outerHTML:O.innerHTML;return an&&_e["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&J(se,O.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
59
- `+Be),zt&&(Be=Yr(Be)),tt&&Vr?wn(Be):Be},B.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oo(H),go=!0,yo=_e,xo=Re},B.clearConfig=function(){kn=null,go=!1,yo=null,xo=null,tt=po,on=""},B.isValidAttribute=function(H,b,O){kn||Oo({});const U=Pe(H),Y=Pe(b);return jl(U,Y,O)},B.addHook=function(H,b){typeof b=="function"&&P(Le,H)&&w(Le[H],b)},B.removeHook=function(H,b){if(P(Le,H)){if(b!==void 0){const O=y(Le[H],b);return O===-1?void 0:E(Le[H],O,1)[0]}return x(Le[H])}},B.removeHooks=function(H){P(Le,H)&&(Le[H]=[])},B.removeAllHooks=function(){Le=Ka()},B}var pp=Ja();return Mo=pp,Mo}var eg=self.DOMPurify||(self.DOMPurify=Kl().default||Kl());const nf=Zs(eg);function ya(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xn=ya();function rf(e){xn=e}var dr={exec:()=>null};function je(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(et.caret,"$1"),n=n.replace(s,i),r},getRegex:()=>new RegExp(n,t)};return r}var et={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")},tg=/^(?:[ \t]*(?:\n|$))+/,ng=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rg=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sg=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xa=/(?:[*+-]|\d{1,9}[.)])/,sf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,of=je(sf).replace(/bull/g,xa).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(),og=je(sf).replace(/bull/g,xa).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(),ba=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ig=/^[^\n]+/,va=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ag=je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",va).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lg=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xa).getRegex(),Xs="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",wa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cg=je("^ {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",wa).replace("tag",Xs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),af=je(ba).replace("hr",Cr).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",Xs).getRegex(),ug=je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",af).getRegex(),Sa={blockquote:ug,code:ng,def:ag,fences:rg,heading:sg,hr:Cr,html:cg,lheading:of,list:lg,newline:tg,paragraph:af,table:dr,text:ig},Jl=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cr).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",Xs).getRegex(),fg={...Sa,lheading:og,table:Jl,paragraph:je(ba).replace("hr",Cr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jl).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",Xs).getRegex()},dg={...Sa,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wa).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:dr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(ba).replace("hr",Cr).replace("heading",` *#{1,6} *[^
60
- ]`).replace("lheading",of).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hg=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lf=/^( {2,}|\\)\n(?!\s*$)/,mg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qs=/[\p{P}\p{S}]/u,ja=/[\s\p{P}\p{S}]/u,cf=/[^\s\p{P}\p{S}]/u,gg=je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ja).getRegex(),uf=/(?!~)[\p{P}\p{S}]/u,yg=/(?!~)[\s\p{P}\p{S}]/u,xg=/(?:[^\s\p{P}\p{S}]|~)/u,bg=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ff=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vg=je(ff,"u").replace(/punct/g,Qs).getRegex(),wg=je(ff,"u").replace(/punct/g,uf).getRegex(),df="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Sg=je(df,"gu").replace(/notPunctSpace/g,cf).replace(/punctSpace/g,ja).replace(/punct/g,Qs).getRegex(),jg=je(df,"gu").replace(/notPunctSpace/g,xg).replace(/punctSpace/g,yg).replace(/punct/g,uf).getRegex(),Eg=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cf).replace(/punctSpace/g,ja).replace(/punct/g,Qs).getRegex(),kg=je(/\\(punct)/,"gu").replace(/punct/g,Qs).getRegex(),Ag=je(/^<(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(),Tg=je(wa).replace("(?:-->|$)","-->").getRegex(),Og=je("^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",Tg).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_s=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ng=je(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",_s).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pf=je(/^!?\[(label)\]\[(ref)\]/).replace("label",_s).replace("ref",va).getRegex(),hf=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",va).getRegex(),Cg=je("reflink|nolink(?!\\()","g").replace("reflink",pf).replace("nolink",hf).getRegex(),Ea={_backpedal:dr,anyPunctuation:kg,autolink:Ag,blockSkip:bg,br:lf,code:hg,del:dr,emStrongLDelim:vg,emStrongRDelimAst:Sg,emStrongRDelimUnd:Eg,escape:pg,link:Ng,nolink:hf,punctuation:gg,reflink:pf,reflinkSearch:Cg,tag:Og,text:mg,url:dr},_g={...Ea,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",_s).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_s).getRegex()},Ni={...Ea,emStrongRDelimAst:jg,emStrongLDelim:wg,url:je(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Rg={...Ni,br:je(lf).replace("{2,}","*").getRegex(),text:je(Ni.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},es={normal:Sa,gfm:fg,pedantic:dg},sr={normal:Ea,gfm:Ni,breaks:Rg,pedantic:_g},Ig={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Yl=e=>Ig[e];function At(e,t){if(t){if(et.escapeTest.test(e))return e.replace(et.escapeReplace,Yl)}else if(et.escapeTestNoEncode.test(e))return e.replace(et.escapeReplaceNoEncode,Yl);return e}function Zl(e){try{e=encodeURI(e).replace(et.percentDecode,"%")}catch{return null}return e}function Xl(e,t){var o;const n=e.replace(et.findPipe,(i,a,l)=>{let u=!1,f=a;for(;--f>=0&&l[f]==="\\";)u=!u;return u?"|":" |"}),r=n.split(et.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(et.slashPipe,"|");return r}function or(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Pg(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ql(e,t,n,r,s){const o=t.href,i=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function $g(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
61
- `).map(o=>{const i=o.match(n.other.beginningSpace);if(i===null)return o;const[a]=i;return a.length>=s.length?o.slice(s.length):o}).join(`
62
- `)}var Rs=class{constructor(e){Ee(this,"options");Ee(this,"rules");Ee(this,"lexer");this.options=e||xn}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:or(n,`
63
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=$g(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=or(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:or(t[0],`
64
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=or(t[0],`
65
- `).split(`
66
- `),r="",s="";const o=[];for(;n.length>0;){let i=!1;const a=[];let l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),i=!0;else if(!i)a.push(n[l]);else break;n=n.slice(l);const u=a.join(`
67
- `),f=u.replace(this.rules.other.blockquoteSetextReplace,`
68
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
69
- ${u}`:u,s=s?`${s}
70
- ${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=d,n.length===0)break;const p=o.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
71
- `+n.join(`
72
- `),g=this.blockquote(m);o[o.length-1]=g,r=r.substring(0,r.length-h.raw.length)+g.raw,s=s.substring(0,s.length-h.text.length)+g.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
73
- `+n.join(`
74
- `),g=this.list(m);o[o.length-1]=g,r=r.substring(0,r.length-p.raw.length)+g.raw,s=s.substring(0,s.length-h.raw.length)+g.raw,n=m.substring(o.at(-1).raw.length).split(`
75
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let i=!1;for(;e;){let l=!1,u="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=t[2].split(`
76
- `,1)[0].replace(this.rules.other.listReplaceTabs,j=>" ".repeat(3*j.length)),p=e.split(`
77
- `,1)[0],h=!d.trim(),m=0;if(this.options.pedantic?(m=2,f=d.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=d.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(u+=p+`
78
- `,e=e.substring(p.length+1),l=!0),!l){const j=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),x=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),E=this.rules.other.htmlBeginRegex(m);for(;e;){const S=e.split(`
79
- `,1)[0];let k;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),k=p):k=p.replace(this.rules.other.tabCharGlobal," "),x.test(p)||w.test(p)||E.test(p)||j.test(p)||y.test(p))break;if(k.search(this.rules.other.nonSpaceChar)>=m||!p.trim())f+=`
80
- `+k.slice(m);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(d)||w.test(d)||y.test(d))break;f+=`
81
- `+p}!h&&!p.trim()&&(h=!0),u+=S+`
82
- `,e=e.substring(S.length+1),d=k.slice(m)}}s.loose||(i?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0));let g=null,v;this.options.gfm&&(g=this.rules.other.listIsTask.exec(f),g&&(v=g[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!g,checked:v,loose:!1,text:f,tokens:[]}),s.raw+=u}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const u=s.items[l].tokens.filter(d=>d.type==="space"),f=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=f}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Xl(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
83
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<n.length;a++)o.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(Xl(a,o.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[u]})));return o}}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)===`
84
- `?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 o=or(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Pg(t[2],"()");if(o===-2)return;if(o>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Ql(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Ql(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let i,a,l=o,u=0;const f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(r=f.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&o%3&&!((o+a)%3)){u+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+u);const d=[...r[0]][0].length,p=e.slice(0,o+r.index+d+a);if(Math.min(o,a)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Bt=class Ci{constructor(t){Ee(this,"tokens");Ee(this,"options");Ee(this,"state");Ee(this,"tokenizer");Ee(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xn,this.options.tokenizer=this.options.tokenizer||new Rs,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:et,block:es.normal,inline:sr.normal};this.options.pedantic?(n.block=es.pedantic,n.inline=sr.pedantic):this.options.gfm&&(n.block=es.gfm,this.options.breaks?n.inline=sr.breaks:n.inline=sr.gfm),this.tokenizer.rules=n}static get rules(){return{block:es,inline:sr}}static lex(t,n){return new Ci(n).lex(t)}static lexInline(t,n){return new Ci(n).inlineTokens(t)}lex(t){t=t.replace(et.carriageReturn,`
85
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,o,i;for(this.options.pedantic&&(t=t.replace(et.tabCharGlobal," ").replace(et.spaceLine,""));t;){let a;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(a=u.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);const u=n.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
86
- `:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
87
- `+a.raw,u.text+=`
88
- `+a.text,this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
89
- `+a.raw,u.text+=`
90
- `+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let l=t;if((i=this.options.extensions)!=null&&i.startBlock){let u=1/0;const f=t.slice(1);let d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=t.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
91
- `+a.raw,u.text+=`
92
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a),r=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
93
- `+a.raw,u.text+=`
94
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a);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 a,l,u;let r=t,s=null;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)f.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;t;){o||(i=""),o=!1;let f;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(p=>(f=p.call({lexer:this},t,n))?(t=t.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);const p=n.at(-1);f.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(f=this.tokenizer.emStrong(t,r,i)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.del(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),n.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),n.push(f);continue}let d=t;if((u=this.options.extensions)!=null&&u.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(f=this.tokenizer.inlineText(d)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(i=f.raw.slice(-1)),o=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Is=class{constructor(e){Ee(this,"options");Ee(this,"parser");this.options=e||xn}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(et.notSpaceStart))==null?void 0:o[0],s=e.replace(et.endingNewline,"")+`
95
- `;return r?'<pre><code class="language-'+At(r)+'">'+(n?s:At(s,!0))+`</code></pre>
96
- `:"<pre><code>"+(n?s:At(s,!0))+`</code></pre>
97
- `}blockquote({tokens:e}){return`<blockquote>
98
- ${this.parser.parse(e)}</blockquote>
99
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
100
- `}hr(e){return`<hr>
101
- `}list(e){const t=e.ordered,n=e.start;let r="";for(let i=0;i<e.items.length;i++){const a=e.items[i];r+=this.listitem(a)}const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
102
- `+r+"</"+s+`>
103
- `}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+At(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
104
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
105
- `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];n="";for(let i=0;i<o.length;i++)n+=this.tablecell(o[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
106
- <thead>
107
- `+t+`</thead>
108
- `+r+`</table>
109
- `}tablerow({text:e}){return`<tr>
110
- ${e}</tr>
111
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
112
- `}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>${At(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=Zl(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+At(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=Zl(e);if(s===null)return At(n);e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${At(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:At(e.text)}},ka=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""}},Ft=class _i{constructor(t){Ee(this,"options");Ee(this,"renderer");Ee(this,"textRenderer");this.options=t||xn,this.options.renderer=this.options.renderer||new Is,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ka}static parse(t,n){return new _i(n).parse(t)}static parseInline(t,n){return new _i(n).parseInline(t)}parse(t,n=!0){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=a,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=f||"";continue}}const l=a;switch(l.type){case"space":{r+=this.renderer.space(l);continue}case"hr":{r+=this.renderer.hr(l);continue}case"heading":{r+=this.renderer.heading(l);continue}case"code":{r+=this.renderer.code(l);continue}case"table":{r+=this.renderer.table(l);continue}case"blockquote":{r+=this.renderer.blockquote(l);continue}case"list":{r+=this.renderer.list(l);continue}case"html":{r+=this.renderer.html(l);continue}case"paragraph":{r+=this.renderer.paragraph(l);continue}case"text":{let u=l,f=this.renderer.text(u);for(;i+1<t.length&&t[i+1].type==="text";)u=t[++i],f+=`
113
- `+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):r+=f;continue}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(t,n=this.renderer){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},hi,gs=(hi=class{constructor(e){Ee(this,"options");Ee(this,"block");this.options=e||xn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Bt.lex:Bt.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},Ee(hi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),hi),mf=class{constructor(...e){Ee(this,"defaults",ya());Ee(this,"options",this.setOptions);Ee(this,"parse",this.parseMarkdown(!0));Ee(this,"parseInline",this.parseMarkdown(!1));Ee(this,"Parser",Ft);Ee(this,"Renderer",Is);Ee(this,"TextRenderer",ka);Ee(this,"Lexer",Bt);Ee(this,"Tokenizer",Rs);Ee(this,"Hooks",gs);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const i=o;for(const a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(const a of i.rows)for(const l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{const i=o;n=n.concat(this.walkTokens(i.items,t));break}default:{const i=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const l=i[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...i){let a=s.renderer.apply(this,i);return a===!1&&(a=o.apply(this,i)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Is(this.defaults);for(const o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const i=o,a=n.renderer[i],l=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Rs(this.defaults);for(const o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const i=o,a=n.tokenizer[i],l=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new gs;for(const o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const i=o,a=n.hooks[i],l=s[i];gs.passThroughHooks.has(o)?s[i]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(d=>l.call(s,d));const f=a.call(s,u);return l.call(s,f)}:s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=l.apply(s,u)),f}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(o.call(this,i)),s&&(a=a.concat(s.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Bt.lex(e,t??this.defaults)}parser(e,t){return Ft.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?Bt.lex:Bt.lexInline,l=o.hooks?o.hooks.provideParser():e?Ft.parse:Ft.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(u=>a(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>l(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let u=a(n,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let f=l(u,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(u){return i(u)}}}onError(e,t){return n=>{if(n.message+=`
114
- Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+At(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},mn=new mf;function ke(e,t){return mn.parse(e,t)}ke.options=ke.setOptions=function(e){return mn.setOptions(e),ke.defaults=mn.defaults,rf(ke.defaults),ke};ke.getDefaults=ya;ke.defaults=xn;ke.use=function(...e){return mn.use(...e),ke.defaults=mn.defaults,rf(ke.defaults),ke};ke.walkTokens=function(e,t){return mn.walkTokens(e,t)};ke.parseInline=mn.parseInline;ke.Parser=Ft;ke.parser=Ft.parse;ke.Renderer=Is;ke.TextRenderer=ka;ke.Lexer=Bt;ke.lexer=Bt.lex;ke.Tokenizer=Rs;ke.Hooks=gs;ke.parse=ke;ke.options;ke.setOptions;ke.use;ke.walkTokens;ke.parseInline;Ft.parse;Bt.lex;function Mg(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=Gl(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(ec(t));const r=e.highlight(t.text,n,t.lang||"");if(r instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");ec(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=Gl(n),o=s?e.langPrefix+nc(s):e.emptyLangClass,i=o?` class="${o}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${r?t:nc(t,!0)}
115
- </code></pre>`}}}}function Gl(e){return(e||"").match(/\S*/)[0]}function ec(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const gf=/[&<>"']/,Lg=new RegExp(gf.source,"g"),yf=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Dg=new RegExp(yf.source,"g"),Bg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tc=e=>Bg[e];function nc(e,t){if(t){if(gf.test(e))return e.replace(Lg,tc)}else if(yf.test(e))return e.replace(Dg,tc);return e}function xf(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&xf(n)}),e}class rc{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function bf(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Yt(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const Fg="</span>",sc=e=>!!e.scope,Ug=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Hg{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=bf(t)}openNode(t){if(!sc(t))return;const n=Ug(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){sc(t)&&(this.buffer+=Fg)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const oc=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Aa{constructor(){this.rootNode=oc(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=oc({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Aa._collapse(n)}))}}class qg extends Aa{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Hg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sr(e){return e?typeof e=="string"?e:e.source:null}function vf(e){return bn("(?=",e,")")}function zg(e){return bn("(?:",e,")*")}function Wg(e){return bn("(?:",e,")?")}function bn(...e){return e.map(n=>Sr(n)).join("")}function Vg(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ta(...e){return"("+(Vg(e).capture?"":"?:")+e.map(r=>Sr(r)).join("|")+")"}function wf(e){return new RegExp(e.toString()+"|").exec("").length-1}function Kg(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Jg=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Oa(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let o=Sr(r),i="";for(;o.length>0;){const a=Jg.exec(o);if(!a){i+=o;break}i+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+s):(i+=a[0],a[0]==="("&&n++)}return i}).map(r=>`(${r})`).join(t)}const Yg=/\b\B/,Sf="[a-zA-Z]\\w*",Na="[a-zA-Z_]\\w*",jf="\\b\\d+(\\.\\d+)?",Ef="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",kf="\\b(0b[01]+)",Zg="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Xg=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=bn(t,/.*\b/,e.binary,/\b.*/)),Yt({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},jr={begin:"\\\\[\\s\\S]",relevance:0},Qg={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[jr]},Gg={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[jr]},ey={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/},Gs=function(e,t,n={}){const r=Yt({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=Ta("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:bn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ty=Gs("//","$"),ny=Gs("/\\*","\\*/"),ry=Gs("#","$"),sy={scope:"number",begin:jf,relevance:0},oy={scope:"number",begin:Ef,relevance:0},iy={scope:"number",begin:kf,relevance:0},ay={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[jr,{begin:/\[/,end:/\]/,relevance:0,contains:[jr]}]},ly={scope:"title",begin:Sf,relevance:0},cy={scope:"title",begin:Na,relevance:0},uy={begin:"\\.\\s*"+Na,relevance:0},fy=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ts=Object.freeze({__proto__:null,APOS_STRING_MODE:Qg,BACKSLASH_ESCAPE:jr,BINARY_NUMBER_MODE:iy,BINARY_NUMBER_RE:kf,COMMENT:Gs,C_BLOCK_COMMENT_MODE:ny,C_LINE_COMMENT_MODE:ty,C_NUMBER_MODE:oy,C_NUMBER_RE:Ef,END_SAME_AS_BEGIN:fy,HASH_COMMENT_MODE:ry,IDENT_RE:Sf,MATCH_NOTHING_RE:Yg,METHOD_GUARD:uy,NUMBER_MODE:sy,NUMBER_RE:jf,PHRASAL_WORDS_MODE:ey,QUOTE_STRING_MODE:Gg,REGEXP_MODE:ay,RE_STARTERS_RE:Zg,SHEBANG:Xg,TITLE_MODE:ly,UNDERSCORE_IDENT_RE:Na,UNDERSCORE_TITLE_MODE:cy});function dy(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function py(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function hy(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=dy,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function my(e,t){Array.isArray(e.illegal)&&(e.illegal=Ta(...e.illegal))}function gy(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function yy(e,t){e.relevance===void 0&&(e.relevance=1)}const xy=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=bn(n.beforeMatch,vf(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},by=["of","and","for","in","not","or","if","then","parent","list","value"],vy="keyword";function Af(e,t,n=vy){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(o){Object.assign(r,Af(e[o],t,o))}),r;function s(o,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){const l=a.split("|");r[l[0]]=[o,wy(l[0],l[1])]})}}function wy(e,t){return t?Number(t):Sy(e)?0:1}function Sy(e){return by.includes(e.toLowerCase())}const ic={},pn=e=>{console.error(e)},ac=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Tn=(e,t)=>{ic[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ic[`${e}/${t}`]=!0)},Ps=new Error;function Tf(e,t,{key:n}){let r=0;const s=e[n],o={},i={};for(let a=1;a<=t.length;a++)i[a+r]=s[a],o[a+r]=!0,r+=wf(t[a-1]);e[n]=i,e[n]._emit=o,e[n]._multi=!0}function jy(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw pn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ps;if(typeof e.beginScope!="object"||e.beginScope===null)throw pn("beginScope must be object"),Ps;Tf(e,e.begin,{key:"beginScope"}),e.begin=Oa(e.begin,{joinWith:""})}}function Ey(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw pn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ps;if(typeof e.endScope!="object"||e.endScope===null)throw pn("endScope must be object"),Ps;Tf(e,e.end,{key:"endScope"}),e.end=Oa(e.end,{joinWith:""})}}function ky(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ay(e){ky(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),jy(e),Ey(e)}function Ty(e){function t(i,a){return new RegExp(Sr(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=wf(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=t(Oa(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const u=l.findIndex((d,p)=>p>0&&d!==void 0),f=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([u,f])=>l.addRule(u,f)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,u=f.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(i){const a=new r;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function o(i,a){const l=i;if(i.isCompiled)return l;[py,gy,Ay,xy].forEach(f=>f(i,a)),e.compilerExtensions.forEach(f=>f(i,a)),i.__beforeBegin=null,[hy,my,yy].forEach(f=>f(i,a)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=Af(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Sr(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(f){return Oy(f==="self"?i:f)})),i.contains.forEach(function(f){o(f,l)}),i.starts&&o(i.starts,a),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Yt(e.classNameAliases||{}),o(e)}function Of(e){return e?e.endsWithParent||Of(e.starts):!1}function Oy(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Yt(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Of(e)?Yt(e,{starts:e.starts?Yt(e.starts):null}):Object.isFrozen(e)?Yt(e):e}var Ny="11.11.1";class Cy extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Lo=bf,lc=Yt,cc=Symbol("nomatch"),_y=7,Nf=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:qg};function l(R){return a.noHighlightRe.test(R)}function u(R){let P=R.className+" ";P+=R.parentNode?R.parentNode.className:"";const V=a.languageDetectRe.exec(P);if(V){const J=C(V[1]);return J||(ac(o.replace("{}",V[1])),ac("Falling back to no-highlight mode for this block.",R)),J?V[1]:"no-highlight"}return P.split(/\s+/).find(J=>l(J)||C(J))}function f(R,P,V){let J="",I="";typeof P=="object"?(J=R,V=P.ignoreIllegals,I=P.language):(Tn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tn("10.7.0",`Please use highlight(code, options) instead.
116
- https://github.com/highlightjs/highlight.js/issues/2277`),I=R,J=P),V===void 0&&(V=!0);const _={code:J,language:I};re("before:highlight",_);const W=_.result?_.result:d(_.language,_.code,V);return W.code=_.code,re("after:highlight",W),W}function d(R,P,V,J){const I=Object.create(null);function _(q,z){return q.keywords[z]}function W(){if(!X.keywords){$e.addText(we);return}let q=0;X.keywordPatternRe.lastIndex=0;let z=X.keywordPatternRe.exec(we),se="";for(;z;){se+=we.substring(q,z.index);const ge=Se.case_insensitive?z[0].toLowerCase():z[0],Me=_(X,ge);if(Me){const[ht,lo]=Me;if($e.addText(se),se="",I[ge]=(I[ge]||0)+1,I[ge]<=_y&&(It+=lo),ht.startsWith("_"))se+=z[0];else{const co=Se.classNameAliases[ht]||ht;Q(z[0],co)}}else se+=z[0];q=X.keywordPatternRe.lastIndex,z=X.keywordPatternRe.exec(we)}se+=we.substring(q),$e.addText(se)}function L(){if(we==="")return;let q=null;if(typeof X.subLanguage=="string"){if(!t[X.subLanguage]){$e.addText(we);return}q=d(X.subLanguage,we,!0,Ce[X.subLanguage]),Ce[X.subLanguage]=q._top}else q=h(we,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(It+=q.relevance),$e.__addSublanguage(q._emitter,q.language)}function ee(){X.subLanguage!=null?L():W(),we=""}function Q(q,z){q!==""&&($e.startScope(z),$e.addText(q),$e.endScope())}function te(q,z){let se=1;const ge=z.length-1;for(;se<=ge;){if(!q._emit[se]){se++;continue}const Me=Se.classNameAliases[q[se]]||q[se],ht=z[se];Me?Q(ht,Me):(we=ht,W(),we=""),se++}}function D(q,z){return q.scope&&typeof q.scope=="string"&&$e.openNode(Se.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(Q(we,Se.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),we=""):q.beginScope._multi&&(te(q.beginScope,z),we="")),X=Object.create(q,{parent:{value:X}}),X}function ne(q,z,se){let ge=Kg(q.endRe,se);if(ge){if(q["on:end"]){const Me=new rc(q);q["on:end"](z,Me),Me.isMatchIgnored&&(ge=!1)}if(ge){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return ne(q.parent,z,se)}function ce(q){return X.matcher.regexIndex===0?(we+=q[0],1):(dt=!0,0)}function ue(q){const z=q[0],se=q.rule,ge=new rc(se),Me=[se.__beforeBegin,se["on:begin"]];for(const ht of Me)if(ht&&(ht(q,ge),ge.isMatchIgnored))return ce(z);return se.skip?we+=z:(se.excludeBegin&&(we+=z),ee(),!se.returnBegin&&!se.excludeBegin&&(we=z)),D(se,q),se.returnBegin?0:z.length}function fe(q){const z=q[0],se=P.substring(q.index),ge=ne(X,q,se);if(!ge)return cc;const Me=X;X.endScope&&X.endScope._wrap?(ee(),Q(z,X.endScope._wrap)):X.endScope&&X.endScope._multi?(ee(),te(X.endScope,q)):Me.skip?we+=z:(Me.returnEnd||Me.excludeEnd||(we+=z),ee(),Me.excludeEnd&&(we=z));do X.scope&&$e.closeNode(),!X.skip&&!X.subLanguage&&(It+=X.relevance),X=X.parent;while(X!==ge.parent);return ge.starts&&D(ge.starts,q),Me.returnEnd?0:z.length}function me(){const q=[];for(let z=X;z!==Se;z=z.parent)z.scope&&q.unshift(z.scope);q.forEach(z=>$e.openNode(z))}let ye={};function Ne(q,z){const se=z&&z[0];if(we+=q,se==null)return ee(),0;if(ye.type==="begin"&&z.type==="end"&&ye.index===z.index&&se===""){if(we+=P.slice(z.index,z.index+1),!s){const ge=new Error(`0 width match regex (${R})`);throw ge.languageName=R,ge.badRule=ye.rule,ge}return 1}if(ye=z,z.type==="begin")return ue(z);if(z.type==="illegal"&&!V){const ge=new Error('Illegal lexeme "'+se+'" for mode "'+(X.scope||"<unnamed>")+'"');throw ge.mode=X,ge}else if(z.type==="end"){const ge=fe(z);if(ge!==cc)return ge}if(z.type==="illegal"&&se==="")return we+=`
117
- `,1;if(rn>1e5&&rn>z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=se,se.length}const Se=C(R);if(!Se)throw pn(o.replace("{}",R)),new Error('Unknown language: "'+R+'"');const Xe=Ty(Se);let Ke="",X=J||Xe;const Ce={},$e=new a.__emitter(a);me();let we="",It=0,ft=0,rn=0,dt=!1;try{if(Se.__emitTokens)Se.__emitTokens(P,$e);else{for(X.matcher.considerAll();;){rn++,dt?dt=!1:X.matcher.considerAll(),X.matcher.lastIndex=ft;const q=X.matcher.exec(P);if(!q)break;const z=P.substring(ft,q.index),se=Ne(z,q);ft=q.index+se}Ne(P.substring(ft))}return $e.finalize(),Ke=$e.toHTML(),{language:R,value:Ke,relevance:It,illegal:!1,_emitter:$e,_top:X}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:R,value:Lo(P),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:ft,context:P.slice(ft-100,ft+100),mode:q.mode,resultSoFar:Ke},_emitter:$e};if(s)return{language:R,value:Lo(P),illegal:!1,relevance:0,errorRaised:q,_emitter:$e,_top:X};throw q}}function p(R){const P={value:Lo(R),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return P._emitter.addText(R),P}function h(R,P){P=P||a.languages||Object.keys(t);const V=p(R),J=P.filter(C).filter(N).map(ee=>d(ee,R,!1));J.unshift(V);const I=J.sort((ee,Q)=>{if(ee.relevance!==Q.relevance)return Q.relevance-ee.relevance;if(ee.language&&Q.language){if(C(ee.language).supersetOf===Q.language)return 1;if(C(Q.language).supersetOf===ee.language)return-1}return 0}),[_,W]=I,L=_;return L.secondBest=W,L}function m(R,P,V){const J=P&&n[P]||V;R.classList.add("hljs"),R.classList.add(`language-${J}`)}function g(R){let P=null;const V=u(R);if(l(V))return;if(re("before:highlightElement",{el:R,language:V}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(a.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(R)),a.throwUnescapedHTML))throw new Cy("One of your code blocks includes unescaped HTML.",R.innerHTML);P=R;const J=P.textContent,I=V?f(J,{language:V,ignoreIllegals:!0}):h(J);R.innerHTML=I.value,R.dataset.highlighted="yes",m(R,V,I.language),R.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(R.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),re("after:highlightElement",{el:R,result:I,text:J})}function v(R){a=lc(a,R)}const j=()=>{w(),Tn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){w(),Tn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function w(){function R(){w()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",R,!1),x=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function E(R,P){let V=null;try{V=P(e)}catch(J){if(pn("Language definition for '{}' could not be registered.".replace("{}",R)),s)pn(J);else throw J;V=i}V.name||(V.name=R),t[R]=V,V.rawDefinition=P.bind(null,e),V.aliases&&T(V.aliases,{languageName:R})}function S(R){delete t[R];for(const P of Object.keys(n))n[P]===R&&delete n[P]}function k(){return Object.keys(t)}function C(R){return R=(R||"").toLowerCase(),t[R]||t[n[R]]}function T(R,{languageName:P}){typeof R=="string"&&(R=[R]),R.forEach(V=>{n[V.toLowerCase()]=P})}function N(R){const P=C(R);return P&&!P.disableAutodetect}function F(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=P=>{R["before:highlightBlock"](Object.assign({block:P.el},P))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=P=>{R["after:highlightBlock"](Object.assign({block:P.el},P))})}function $(R){F(R),r.push(R)}function K(R){const P=r.indexOf(R);P!==-1&&r.splice(P,1)}function re(R,P){const V=R;r.forEach(function(J){J[V]&&J[V](P)})}function ie(R){return Tn("10.7.0","highlightBlock will be removed entirely in v12.0"),Tn("10.7.0","Please use highlightElement now."),g(R)}Object.assign(e,{highlight:f,highlightAuto:h,highlightAll:w,highlightElement:g,highlightBlock:ie,configure:v,initHighlighting:j,initHighlightingOnLoad:y,registerLanguage:E,unregisterLanguage:S,listLanguages:k,getLanguage:C,registerAliases:T,autoDetection:N,inherit:lc,addPlugin:$,removePlugin:K}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Ny,e.regex={concat:bn,lookahead:vf,either:Ta,optional:Wg,anyNumberOfTimes:zg};for(const R in ts)typeof ts[R]=="object"&&xf(ts[R]);return Object.assign(e,ts),e},Fn=Nf({});Fn.newInstance=()=>Nf({});var Ry=Fn;Fn.HighlightJS=Fn;Fn.default=Fn;const vt=Zs(Ry);function Iy(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Py(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},a=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,o,i],j=[...v];return j.pop(),j.push(a),h.contains=j,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function $y(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(a);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],j={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["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"],E=["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:g,literal:v,built_in:[...y,...x,"set","shopt",...w,...E]},contains:[h,e.SHEBANG(),m,d,o,i,j,a,l,u,f,n]}}const uc="[A-Za-z$_][0-9A-Za-z$_]*",My=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ly=["true","false","null","undefined","NaN","Infinity"],Cf=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_f=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Rf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dy=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],By=[].concat(Rf,Cf,_f);function Fy(e){const t=e.regex,n=(V,{after:J})=>{const I="</"+V[0].slice(1);return V.input.indexOf(I,J)!==-1},r=uc,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,J)=>{const I=V[0].length+V.index,_=V.input[I];if(_==="<"||_===","){J.ignoreMatch();return}_===">"&&(n(V,{after:I})||J.ignoreMatch());let W;const L=V.input.substring(I);if(W=L.match(/^\s*=/)){J.ignoreMatch();return}if((W=L.match(/^\s+extends\s+/))&&W.index===0){J.ignoreMatch();return}}},a={$pattern:uc,keyword:My,literal:Ly,built_in:By,"variable.language":Dy},l="[0-9](_?[0-9])*",u=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,{match:/\$\d+/},d];p.contains=x.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(x)});const w=[].concat(y,p.contains),E=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Cf,..._f]}},T={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(V){return t.concat("(?!",V.join("|"),")")}const K={match:t.concat(/\b/,$([...Rf,"super","import"].map(V=>`${V}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ie={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),T,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,y,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},K,F,k,ie,{match:/\$[(.]/}]}}function Uy(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},j={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,d,e.HASH_COMMENT_MODE]}]};return u.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[j]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,j,d]}]}}vt.registerLanguage("json",Iy);vt.registerLanguage("yaml",Py);vt.registerLanguage("bash",$y);vt.registerLanguage("javascript",Fy);vt.registerLanguage("python",Uy);const If=new mf(Mg({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!vt.getLanguage(t))return e;try{return vt.highlight(e,{language:t}).value}catch{return e}}}));If.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 Hy(e){return If.parse(e)}const wt=({children:e,className:t=""})=>e?typeof e!="string"?c.jsx(c.Fragment,{children:e}):c.jsx("div",{className:`prose max-w-none text-foreground-muted prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary-600 prose-code:text-foreground-secondary prose-code:before:content-none prose-code:after:content-none prose-blockquote:text-foreground-muted prose-blockquote:border-border ${t}`,dangerouslySetInnerHTML:{__html:nf.sanitize(Hy(e))}}):null;function qy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.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 zy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.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 Wy({className:e,...t}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:c.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 Vy({className:e}){return c.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.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 ir({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:o=!1,className:i=""}){const a=s?l=>c.jsx("a",{href:s,target:"_blank",...l}):l=>c.jsx("div",{...l});return c.jsxs("div",{className:`${!o&&"flex"} ${i}`,children:[c.jsx("dt",{children:c.jsxs(a,{className:"flex",children:[e&&c.jsx(e,{className:"w-5 h-5",title:`${r}`,alt:`${r}`}),n?c.jsx("span",{className:"pl-2 text-sm",children:t}):c.jsx("span",{className:"sr-only",children:t})]})}),c.jsxs("dd",{className:`${o&&"pt-2"} pl-2 text-sm`,children:[!n&&c.jsx(a,{children:r}),o&&c.jsx(a,{children:r})]})]})}function Ca({name:e,href:t,title:n}){return c.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 Ky({license:e,externalDocs:t,contact:n,tags:r,logo:s}){const o={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(n==null?void 0:n.name)??null,contactUrl:(n==null?void 0:n.url)??null,contactEmail:(n==null?void 0:n.email)??null,tags:r};return c.jsxs(c.Fragment,{children:[s&&c.jsx("div",{className:"hidden @lg:block mb-3",children:s}),c.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[o.licenseName&&c.jsx(ir,{IconClass:Wy,text:`${o.licenseName} ${Tl}`,term:Tl,visibleTerm:!o.licenseName,href:o.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),o.externalDocsUrl&&c.jsx(ir,{IconClass:Js,text:Ol,href:o.externalDocsUrl,term:Ol,visibleTerm:!o.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),o.contactEmail&&c.jsx(ir,{IconClass:qy,text:`${o.contactEmail}`,term:Zp,visibleTerm:!o.contactEmail,href:`mailto:${o.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),o.contactUrl&&c.jsx(ir,{IconClass:zy,text:`${o.contactName}`,term:Yp,visibleTerm:!o.contactName,href:o.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),c.jsx("dl",{className:"mt-[10px]",children:o.tags&&c.jsx(ir,{IconClass:Vy,term:Xp,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:o.tags&&c.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:o.tags.map((i,a)=>{const l=i,u=l.externalDocs;return c.jsx(Ca,{href:u&&u.url,title:l.description||(u&&u.description?u.description:void 0),name:l.name},a)})})})})]})}const Jy=[/^x-parser-/i,/^x-lib-/i];function Yy(e){return Jy.some(t=>t.test(e))}const fc=new Map;function Zy(e){let t=fc.get(e);return t||(t=A.lazy(tf[e]),fc.set(e,t)),t}const Xy=e=>e.startsWith("x-"),Pf=(e,t)=>e?e[t]:void 0;function Qy({source:e,pathPrefix:t}){const{showExtensions:n}=Ve();if(!n||!e)return null;const r=Object.keys(e).filter(s=>Xy(s)&&!Yy(s)&&Object.prototype.hasOwnProperty.call(tf,s));return r.length===0?null:c.jsx(c.Fragment,{children:r.map(s=>{const o=Zy(s);return c.jsx(A.Suspense,{fallback:null,children:c.jsx(o,{value:Pf(e,s),path:`${t}.${s}`})},s)})})}const Gy=A.lazy(Qm);function $f({title:e,description:t,license:n,contact:r,externalDocs:s,tags:o,extensionsSource:i}){const a=Pf(i,"x-logo"),l=a!==void 0&&c.jsx(A.Suspense,{fallback:null,children:c.jsx(Gy,{value:a,path:"info.x-logo"})}),u=c.jsx("div",{className:"mt-4 w-full",children:c.jsx(wt,{children:t})}),f=c.jsxs(c.Fragment,{children:[c.jsx(Ky,{logo:l,license:n,externalDocs:s,contact:r,tags:o}),i&&c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:c.jsx(Qy,{source:i,pathPrefix:"info"})})]});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:e,content:u,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:l})})}const Mf=e=>{const{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i}=e;return c.jsx($f,{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i,extensionsSource:e})},e0=1500,t0=320,n0=48,r0="#011627";function s0(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 o0(e){try{return await navigator.clipboard.writeText(e),!0}catch{return s0(e)}}function _a({code:e,className:t,language:n="json",collapsedMaxHeight:r=t0}){const[s,o]=A.useState("idle"),i=A.useRef(void 0),[a,l]=A.useState(!1),[u,f]=A.useState(!1),d=A.useRef(null),p=A.useRef(null),h=A.useId();A.useEffect(()=>()=>clearTimeout(i.current),[]),A.useEffect(()=>{const E=p.current;if(!E)return;const S=()=>f(E.scrollHeight>r+n0);S();const k=new ResizeObserver(S);return k.observe(E),()=>k.disconnect()},[e,n,r]);const m=()=>{o0(e).then(E=>{o(E?"copied":"error"),clearTimeout(i.current),i.current=setTimeout(()=>o("idle"),e0)})},v=vt.getLanguage(n)?vt.highlight(e,{language:n}).value:null,j=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",y=u&&!a,x=e.replace(/\n+$/,"").split(`
118
- `).length,w=()=>{var E,S;a&&(((E=d.current)==null?void 0:E.getBoundingClientRect().top)??0)<0&&((S=d.current)==null||S.scrollIntoView({block:"nearest"})),l(k=>!k)};return c.jsxs("div",{ref:d,className:`relative ${t??""}`,children:[c.jsx("button",{type:"button",onClick:m,"aria-label":j,title:j,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?c.jsx(la,{className:"w-4 h-4 text-green-600"}):c.jsx(aa,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),c.jsxs("div",{className:"relative",children:[c.jsx("pre",{ref:p,id:h,style:y?{maxHeight:r}:void 0,className:`text-xs rounded overflow-x-auto ${y?"overflow-y-hidden":""}`,children:v!==null?c.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:nf.sanitize(v)}}):c.jsx("code",{className:"hljs",children:e})}),y&&c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b",style:{background:`linear-gradient(to bottom, transparent, ${r0})`}})]}),u&&c.jsxs("button",{type:"button",onClick:w,"aria-expanded":a,"aria-controls":h,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[a?"Show less":`Show all ${x} lines`,c.jsx(Ys,{className:`w-3 h-3 transition-transform ${a?"rotate-180":""}`})]})]})}const i0=/^x-parser-/i;function Ri(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(r=>Ri(r,t));const n={};for(const[r,s]of Object.entries(e))i0.test(r)||(n[r]=Ri(s,t));return n}finally{t.delete(e)}}return e}const Lf=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Ri(e),null,2);return c.jsx(_a,{code:t})},dc=new Set,Ra=e=>e.replace(/^#\//,"").split("/").pop()??e,Ii=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},a0={objects:new Set,refs:new Set},Lt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:Ii(e)};const r=e.$ref,s=Ra(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const o=$t(t(r));if(!o)return{schema:e,refLabel:s};const{schema:i}=vr(o);n.add(r);try{const a=Lt(i,t,n);return{schema:a.schema,refLabel:a.circular?void 0:s,circular:a.circular}}finally{n.delete(r)}},gn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return le(n)?n:null},Df=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>le(r));return n.length>0?n:null},l0=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||le(e.additionalItems)?e.additionalItems:null,c0=e=>e.contains===void 0?null:typeof e.contains=="boolean"||le(e.contains)?e.contains:null,Bf=e=>e.contains!==void 0,$s=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
119
-
120
- ${t}`:t},u0=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Jt=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=$s(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[o,i]of Object.entries(t.properties)){if(!le(i))continue;const a=s.properties[o];le(a)?s.properties[o]=Jt(a,i):s.properties[o]=i}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((o,i)=>{const a=s.items[i];return le(o)&&le(a)?Jt(a,o):le(o)?o:a}):s.items=t.items;else{const o=gn(t),i=gn(s);o&&i?s.items=Jt(i,o):o&&(s.items=t.items)}if(t.patternProperties&&le(t.patternProperties)){const o={...le(s.patternProperties)?s.patternProperties:{}};for(const[i,a]of Object.entries(t.patternProperties)){if(!le(a)){o[i]=a;continue}const l=o[i];le(l)?o[i]=Jt(l,a):o[i]=a}s.patternProperties=o}if(t.propertyNames!==void 0)if(le(t.propertyNames)){const o=s.propertyNames;s.propertyNames=le(o)?Jt(o,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(le(t.additionalProperties)){const o=s.additionalProperties;s.additionalProperties=le(o)?Jt(o,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[o,i]of Object.entries(t))u0.has(o)||i===void 0||(s[o]=i);return s},pc=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,f])=>le(f)?[u,Ge(f,t,n,r)]:[u,f])));const o=gn(s);o&&(s.items=Ge(o,t,n,r));const i=Ir(s);i!==null&&le(i)&&(s.propertyNames=Ge(i,t,n,r));const a=Vn(s);a!==null&&le(a)&&(s.additionalProperties=Ge(a,t,n,r));const l=Ia(s);return l.length>0&&(s.patternProperties=Object.fromEntries(l.map(([u,f])=>[u,Ge(f,t,n,r)]))),s},Ge=(e,t,n,r=new Set)=>{if(r.has(e))return e;r.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const o=[];let i={};for(const f of s){if(!le(f))continue;const{schema:d,circular:p}=Lt(f,t,n);if(p)continue;const h=Ge(d,t,n,r);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),o.push(m)}o.push(...Hf(h)),i=Jt(i,h,t,n)}if(e.if!==void 0){const f={if:e.if};e.then!==void 0&&(f.then=e.then),e.else!==void 0&&(f.else=e.else),o.push(f)}const a={...e};delete a.allOf;const l=Object.keys(a).length>0?Jt(i,a,t,n):i,u=pc(l,t,n,r);if(o.length===1){const f=o[0];u.if=f.if,f.then!==void 0&&(u.then=f.then),f.else!==void 0&&(u.else=f.else)}else o.length>1&&(u._allOfConditionals=o);return u}return pc(e,t,n,r)}finally{r.delete(e)}},_r=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>le(r));return n.length>0?n:null},Rr=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>le(r));return n.length>0?n:null},Ff=e=>e.not===void 0?null:typeof e.not=="boolean"||le(e.not)?e.not:null,rt=e=>Ff(e)!==null,Uf=e=>{const{not:t,...n}=e;return n},f0=e=>{const{if:t,then:n,else:r,...s}=e;return s},at=e=>e.if!==void 0,Do=e=>e===void 0?null:typeof e=="boolean"||le(e)?e:null,Hf=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>le(t)):[],lt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Ir=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||le(e.propertyNames)?e.propertyNames:null,Vn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||le(e.additionalProperties)?e.additionalProperties:null,Ia=e=>{const t=e.patternProperties;return le(t)?Object.entries(t).flatMap(([n,r])=>le(r)?[[n,r]]:[]):[]},d0=(e,t)=>`${e}.[pattern:${t}]`,Pr=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,eo=e=>{const t=Ir(e);if(t!==null&&le(t))return!0;const n=Vn(e);return n!==null&&le(n)?!0:Ia(e).length>0},qf=e=>!!(_r(e)||Rr(e)||Pr(e)||eo(e)||e.type==="array"||e.items||e.type!==void 0),yt=e=>!(rt(e)||at(e)||lt(e)||_r(e)||Rr(e)||Pr(e)||eo(e)||e.items||Bf(e)||e.type==="array"||e.type==="object");function p0(e){if(typeof Vn(e)=="boolean")return!0;const n=Ir(e);return!!(typeof n=="boolean"||n!==null&&le(n)&&yt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function hc(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||p0(e)}const zf=(e,t)=>hc(e)?!0:t?hc(t):!1,h0=(e,t)=>{if(rt(e)||at(e)||lt(e)||_r(e)||Rr(e)||Pr(e)||eo(e))return!0;if(e.type==="array"||e.items){if(Bf(e)||Df(e)!==null)return!0;const n=gn(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=Lt(n,t,dc),s=Ge(r,t,dc);return!yt(s)}return!yt(n)}return!1};function Wf(e){return JSON.stringify(e)}function mc(e){return typeof e=="string"?e:JSON.stringify(e)}function ut({children:e}){return c.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function Vf({children:e,mono:t=!1,title:n}){return c.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?c.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function m0(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function g0(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function y0(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function x0(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function gc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function yc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function ns({name:e,lower:t,upper:n,suffix:r}){return!t&&!n?null:c.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(ut,{children:String(t.value)}),c.jsx(ut,{children:t.op})]}),c.jsx(ut,{children:e}),n&&c.jsxs(c.Fragment,{children:[c.jsx(ut,{children:n.op}),c.jsx(ut,{children:String(n.value)})]}),r&&c.jsx(ut,{children:r})]})}function ys({value:e,displayValue:t}){const n=()=>{var o;(o=window.getSelection())!=null&&o.toString()||navigator.clipboard.writeText(mc(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(mc(e)))};return c.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:n,onKeyDown:r,children:t??Wf(e)})}function b0({schema:e}){const t=Vn(e);return typeof t!="boolean"?null:c.jsx(ut,{children:t?"additional properties allowed":"additional properties not allowed"})}function v0({schema:e}){const t=Ir(e);return typeof t=="boolean"?c.jsx(Vf,{children:t?"any property name":"no property names"}):t!==null&&le(t)&&yt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"property name pattern:"}),c.jsx(ys,{value:t.pattern,displayValue:t.pattern})]}):null}function xc({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=m0(e),s=g0(e),o=y0(e),i=x0(e),a=gc(e,"minItems"),l=yc(e,"maxItems"),u=gc(e,"minProperties"),f=yc(e,"maxProperties");return c.jsxs(c.Fragment,{children:[typeof e.multipleOf=="number"&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"multiple of :"}),c.jsx(Vf,{children:String(e.multipleOf)})]}),(r||s)&&c.jsx(ns,{name:t,lower:r,upper:s}),(o||i)&&c.jsx(ns,{name:t,lower:o,upper:i,suffix:"chars"}),(a||l)&&c.jsx(ns,{name:t,lower:a,upper:l,suffix:"items"}),(u||f)&&c.jsx(ns,{name:t,lower:u,upper:f,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"regex pattern:"}),c.jsx(ys,{value:e.pattern,displayValue:e.pattern})]}),n&&c.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[c.jsx(ut,{children:"enum values:"}),n.map((d,p)=>c.jsx(ys,{value:d},`${p}-${Wf(d)}`))]}),e.const!==void 0&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ut,{children:"const value:"}),c.jsx(ys,{value:e.const})]}),e.uniqueItems===!0&&c.jsx(ut,{children:"unique"}),c.jsx(b0,{schema:e}),c.jsx(v0,{schema:e})]})}function Kf({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&yt(t),o=n??"value";return c.jsxs("div",{className:r,children:[c.jsx(xc,{schema:e,rangeName:o}),s&&c.jsx(xc,{schema:t,rangeName:"item"})]})}const Jf=(e,t)=>{const n=_r(e);if(n)return{text:`one of (${n.length})`};const r=Rr(e);if(r)return{text:`any of (${r.length})`};if(rt(e)&&!qf(Uf(e)))return{text:"not"};if(e.type==="array"||e.items){const u=gn(e);if(u){const f=u.type;if(f==="object"){const d=u.$ref?Ra(u.$ref):t;return d?{text:"Array of objects",refHint:d}:{text:"Array of objects"}}if(typeof f=="string"){const d=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${f}`,format:d}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let o=s?`${s}`:"type: unknown";const i=Vn(e);!Pr(e)&&i!==null&&le(i)&&(s==="object"||o==="type: unknown")&&(o=s==="object"?"object (map)":"map");const a=typeof e.format=="string"?e.format:void 0,l=t&&(s==="object"||o.startsWith("object"))?t:void 0;return{text:o,format:a,refHint:l}},w0=(e,t)=>{if(!t)return!1;const n=Jf(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Yf({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:o}=Jf(e,t);return c.jsxs("span",{className:n,children:[s??r,o&&!r.includes(`(${o})`)&&c.jsxs("span",{className:"text-foreground-muted",children:[" (",o,")"]})]})}const bc="ml-6";function rs({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return c.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[c.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),c.jsx(Yf,{schema:e})]}),zf(e)&&c.jsx(Kf,{schema:e,className:`flex flex-col gap-1 mt-1 ${bc}`}),n&&n.split(`
121
-
122
- `).map((r,s)=>c.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${bc} leading-relaxed`,children:r},s))]})}function Bo({children:e}){return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.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:"}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function S0({value:e}){const t=e?"any value":"false schema";return c.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 Zf({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=A.useRef([]),o=a=>(a+e.length)%e.length,i=(a,l)=>{var f;let u=l;a.key==="ArrowRight"&&(a.preventDefault(),u=o(l+1)),a.key==="ArrowLeft"&&(a.preventDefault(),u=o(l-1)),a.key==="Home"&&(a.preventDefault(),u=0),a.key==="End"&&(a.preventDefault(),u=e.length-1),u!==l&&(n(e[u].id),(f=s.current[u])==null||f.focus())};return c.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":r,children:e.map(({id:a,label:l},u)=>{const f=a===t;return c.jsx("button",{ref:d=>{s.current[u]=d},type:"button",role:"tab","aria-selected":f,tabIndex:0,onClick:()=>n(a),onKeyDown:d=>i(d,u),className:f?"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:l},a)})})}function j0({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:r,onSelectCase:s,children:o}){if(t===0)return null;const i=(n==null?void 0:n.length)===t?n:Array.from({length:t},(u,f)=>`case ${f+1}`),a=e==="anyOf"?"Any of:":"One of:",l=e==="anyOf"?"Any of cases":"One of cases";return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.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:a}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),c.jsx(Zf,{tabs:i.map((u,f)=>({id:String(f),label:u})),selected:String(r),onChange:u=>s(Number(u)),ariaLabel:l}),c.jsx("div",{role:"tabpanel",className:"mt-2",children:o})]})}const E0="ml-0 border-dashed border-border";function cn({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=Ve();return n==="none"?c.jsx("div",{children:t}):n==="muted"?c.jsx("div",{className:`pl-3 border-l-2 ${E0}`,children:t}):c.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Qi(e,r)},children:t})}function k0({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=Ve(),s=Qi(e,r);return c.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:[c.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&c.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const A0="ml-6";function nt({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:o,typeLabelOverride:i,required:a,description:l,expandable:u,expanded:f,onToggle:d,showBorder:p=!0}){const{depthColors:h}=Ve(),m=Qi(n,h),g=r&&w0(r,s),v=u?A0:"";let j="",y=t;if(t.endsWith("[]")){const x=t.slice(0,-2),w=x.lastIndexOf(".");w>=0?(j=x.slice(0,w+1),y=`${x.slice(w+1)}[]`):y=t}else{const x=t.lastIndexOf("."),w=t.lastIndexOf("[]"),E=Math.max(x,w);E>=0&&(j=t.slice(0,E+(t[E]==="."?1:2)),y=t.slice(E+(t[E]==="."?1:2)))}return p=p&&!f,c.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[c.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[c.jsxs("span",{className:"truncate min-w-0",children:[j&&c.jsx("span",{className:"text-foreground-muted",children:j}),c.jsx("span",{className:"font-semibold",style:{color:m},children:y})]}),a&&c.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(r==null?void 0:r.readOnly)===!0&&c.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(r==null?void 0:r.writeOnly)===!0&&c.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(r==null?void 0:r.deprecated)===!0&&c.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),r?c.jsxs("div",{className:"shrink-0 text-right",children:[c.jsx(Yf,{schema:r,refLabel:s}),g&&c.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):i&&c.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:i})]}),r&&zf(r,o)&&c.jsx(Kf,{schema:r,itemSchema:o,fieldName:y,className:`flex flex-col gap-1 mt-1 ${v}`}),l&&l.split(`
123
-
124
- `).map((x,w)=>c.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${v} leading-relaxed`,children:x},w)),u&&c.jsx(k0,{depth:n,expanded:f,onToggle:d})]})}function Fo({label:e,children:t}){return c.jsxs("div",{children:[c.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:c.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),c.jsx("div",{children:t})]})}function T0({ifContent:e,thenContent:t,elseContent:n}){return c.jsxs("div",{className:"py-2 pt-5 px-1",children:[c.jsx("div",{className:"flex flex-col items-start",children:c.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:"})}),c.jsx(cn,{depth:0,lineVariant:"muted",children:c.jsxs("div",{className:"divide-y divide-border",children:[c.jsx(Fo,{label:"If schema matches:",children:e}),t!=null&&c.jsx(Fo,{label:"Then schema should follow:",children:t}),n!=null&&c.jsx(Fo,{label:"Else schema should follow:",children:n})]})})]})}function ss({label:e,children:t}){return c.jsxs("div",{className:"py-2",children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.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}),c.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const O0=e=>e==="none"?"depth":e;function gt({schema:e,path:t,depth:n,required:r,refStack:s,deref:o,suppressRow:i=!1,branchLineVariant:a="depth",defaultExpanded:l=!1,ancestors:u=a0,focusTokens:f=null,focusId:d=null}){var te;const p=O0(a),h=f!=null,g=h&&f.length===0?d??void 0:void 0,[v,j]=A.useState(l||h),[y,x]=A.useState(l);y!==l&&(x(l),j(l||h)),A.useEffect(()=>{h&&j(!0)},[h]);const[w,E]=A.useState(0),S=(te=f==null?void 0:f[0])==null?void 0:te.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),k=S?Number(S[1]):-1;A.useEffect(()=>{k>=0&&E(k)},[k]);const C=ga(),{schema:T,refLabel:N,circular:F}=A.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Ii(e),circular:!0};const D=Lt(e,o,s);return D.circular?D:{...D,schema:Ge(D.schema,o,s)}},[e,o,s,u,C]),$=A.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),K=Uf(f0(T)),re=!qf(K)&&(rt(T)||at(T)||lt(T)),ie=()=>{const D=Ff(T);if(D===null)return null;if(typeof D=="boolean")return c.jsx(Bo,{children:c.jsx(S0,{value:D})});const ne=Lt(D,o,s);if(ne.circular)return c.jsx(Bo,{children:c.jsx(nt,{path:t,depth:n+1,typeLabelOverride:`↩ ${D.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ce=Ge(ne.schema,o,s),ue=yt(ce);return c.jsx(Bo,{children:ue?c.jsx(rs,{schema:ce,showBorder:!1}):c.jsx(gt,{schema:D,path:t,depth:n+1,refStack:s,deref:o,ancestors:$,suppressRow:!0,branchLineVariant:p,defaultExpanded:l})})},R=(D,ne)=>{if(typeof D=="boolean")return c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:D?"any value":"false schema"});const ce=Lt(D,o,s);if(ce.circular)return c.jsx(nt,{path:ne,depth:n+1,typeLabelOverride:`↩ ${D.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ue=Ge(ce.schema,o,s);return yt(ue)?c.jsx(rs,{schema:ue,showBorder:!1}):c.jsx(gt,{schema:D,path:ne,depth:n+1,refStack:s,deref:o,ancestors:$,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l})},P=D=>{const ne=Do(D.if);if(ne===null)return null;const ce=Do(D.then),ue=Do(D.else);return c.jsx(T0,{ifContent:R(ne,t),thenContent:ce!==null?R(ce,t):void 0,elseContent:ue!==null?R(ue,t):void 0})},V=()=>{const D=Hf(T);return D.length===0?null:c.jsx(c.Fragment,{children:D.map((ne,ce)=>c.jsx("div",{children:P(ne)},ce))})};if(F)return c.jsx(nt,{id:g,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??N??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(re){const D=c.jsxs(c.Fragment,{children:[rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]});return i?D:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:T,refLabel:N,required:r,description:T.description,expandable:!0,expanded:v,onToggle:()=>j(ne=>!ne)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:D})]})}const J=_r(K),I=Rr(K),_=J??I,W=J?"oneOf":"anyOf";if(_){const D=_.map((Ke,X)=>typeof Ke.title=="string"?Ke.title:`case ${X+1}`),ne=i?1:n+1,ce=_[w],ue=Lt(ce,o,s),fe=ue.circular?ue.schema:Ge(ue.schema,o,s),me=!ue.circular&&yt(fe),ye=f&&k===w?f.slice(1):null,Ne=me?c.jsx(rs,{schema:fe,showBorder:!1}):c.jsx(gt,{schema:ce,path:t,depth:ne-1,refStack:s,deref:o,ancestors:$,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l,focusTokens:ye,focusId:d},w),Se=c.jsx(j0,{variant:W,caseCount:_.length,caseLabels:D,selectedCase:w,onSelectCase:E,children:Ne}),Xe=c.jsxs(c.Fragment,{children:[Se,rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]});return i?Xe:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:T,refLabel:N,required:r,description:T.description,expandable:!0,expanded:v,onToggle:()=>j(Ke=>!Ke)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:Xe})]})}const L=(D,ne,ce)=>{const ue=Lt(D,o,s);if(ue.circular)return c.jsx(nt,{path:ne,depth:ce,typeLabelOverride:`↩ ${D.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const fe=Ge(ue.schema,o,s);return yt(fe)?c.jsx(rs,{schema:fe,showBorder:!1}):c.jsx(gt,{schema:D,path:ne,depth:ce,refStack:s,deref:o,ancestors:$,branchLineVariant:p,defaultExpanded:l})},ee=D=>{const ne=K.properties??{},ce=new Set(K.required??[]),ue=Ir(K),fe=Vn(K),me=Ia(K);return c.jsxs(c.Fragment,{children:[Object.entries(ne).map(([ye,Ne])=>{if(!le(Ne))return null;const Se=f&&f[0]==="properties"&&f[1]===ye?f.slice(2):null;return c.jsx(gt,{schema:Ne,path:`${t}.${ye}`,depth:D,required:ce.has(ye),refStack:s,deref:o,ancestors:$,branchLineVariant:p,defaultExpanded:l,focusTokens:Se,focusId:d},ye)}),ue!==null&&le(ue)&&c.jsx(ss,{label:"Property names must adhere to:",children:L(ue,`${t}.[propertyName]`,D)}),me.map(([ye,Ne])=>c.jsx(gt,{schema:Ne,path:d0(t,ye),depth:D,refStack:s,deref:o,ancestors:$,branchLineVariant:p,defaultExpanded:l},ye)),fe!==null&&le(fe)&&c.jsx(ss,{label:"Additional properties must adhere to:",children:L(fe,`${t}.[additionalProperty]`,D)}),rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]})};if(Pr(K)||eo(K))return i?ee(n+1):c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:T,refLabel:N,required:r,description:T.description,expandable:!0,expanded:v,onToggle:()=>j(D=>!D)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:ee(n+1)})]});if(K.type==="array"||K.items){const D=Df(K),ne=D!==null,ce=ne?l0(K):null,ue=c0(K),fe=ue!==null,me=ne?null:gn(K),ye=me!==null,Ne=ne||ye||fe||rt(T)||at(T)||lt(T),Se=`${t}[]`,Xe=i?t:Se,Ke=ye?Lt(me,o,s):null,X=(Ke==null?void 0:Ke.schema)??null,Ce=X?Ge(X,o,s):null,$e=X!==null&&($.objects.has(X)||typeof(me==null?void 0:me.$ref)=="string"&&$.refs.has(me.$ref)),we=X!==null?{objects:new Set($.objects).add(X),refs:typeof(me==null?void 0:me.$ref)=="string"?new Set($.refs).add(me.$ref):$.refs}:$,It=!ne&&!fe&&Ce!==null&&yt(Ce),ft=Ce!=null&&Ce.properties?Object.entries(Ce.properties).filter(([,z])=>le(z)):[],rn=new Set(Ce&&Array.isArray(Ce.required)?Ce.required:[]),dt=!ne&&f&&f[0]==="items"?f.slice(1):null,q=z=>c.jsxs(c.Fragment,{children:[ne?c.jsxs(c.Fragment,{children:[D.map((se,ge)=>c.jsx(gt,{schema:se,path:`${t}[${ge}]`,depth:z,refStack:s,deref:o,ancestors:$,branchLineVariant:p,defaultExpanded:l},ge)),ce!==null&&typeof ce!="boolean"&&c.jsx(ss,{label:"Additional items:",children:L(ce,`${t}[*]`,z)}),ce===!1&&c.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):ye&&($e?c.jsx(nt,{path:Xe,depth:z,typeLabelOverride:`↩ ${me.$ref??Ii(X)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):ft.length>0?ft.map(([se,ge])=>{const Me=dt&&dt[0]==="properties"&&dt[1]===se?dt.slice(2):null;return c.jsx(gt,{schema:ge,path:`${Xe}.${se}`,depth:z,required:rn.has(se),refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:l,focusTokens:Me,focusId:d},se)}):c.jsx(gt,{schema:me,path:Xe,depth:z,refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:l,focusTokens:dt,focusId:d})),fe&&c.jsx(ss,{label:"Contains at least one:",children:typeof ue=="boolean"?c.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:ue?"any item":"impossible constraint"}):L(ue,`${t}[contains]`,z)}),rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]});return It&&!rt(T)&&!at(T)&&!lt(T)?c.jsx(nt,{id:g,path:Se,depth:n,schema:T,itemSchema:Ce,refLabel:N,required:r,description:$s(T.description,Ce.description),expandable:!1,expanded:!1,onToggle:()=>{}}):It?c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:Se,depth:n,schema:T,itemSchema:Ce,refLabel:N,required:r,description:$s(T.description,Ce.description),expandable:!0,expanded:v,onToggle:()=>j(z=>!z)}),v&&c.jsxs(cn,{depth:n,lineVariant:a,children:[rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]})]}):i?Ne?q(n+1):null:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:Se,depth:n,schema:T,itemSchema:Ce,refLabel:N,required:r,description:T.description,expandable:ne||ye||fe||rt(T)||at(T)||lt(T),expanded:v,onToggle:()=>j(z=>!z)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:q(n+1)})]})}if(rt(T)||at(T)||lt(T)){const D=c.jsxs(c.Fragment,{children:[rt(T)&&ie(),at(T)&&P(T),lt(T)&&V()]});return i?D:c.jsxs(c.Fragment,{children:[c.jsx(nt,{id:g,path:t,depth:n,schema:T,refLabel:N,required:r,description:T.description,expandable:!0,expanded:v,onToggle:()=>j(ne=>!ne)}),v&&c.jsx(cn,{depth:n,lineVariant:a,children:D})]})}return i?null:c.jsx(nt,{id:g,path:t,depth:n,schema:T,refLabel:N,required:r,description:T.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Pa({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:o,defaultSchemaExpanded:i=!1}=Ve(),a=A.useMemo(()=>new Set,[]),l=$t(e),u=A.useMemo(()=>l?Ge(l,o,a):null,[l,o,a]);if(!l||!u)return c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const f=t??(l.$ref?Ra(l.$ref):void 0)??"schema",d=!!t;if(!h0(u,o)&&!l.$ref){if(d)return u.type==="array"||u.items?c.jsx("div",{className:n,children:c.jsx(gt,{schema:l,path:f,depth:0,refStack:a,deref:o,defaultExpanded:i,focusTokens:r,focusId:s})}):null;const h=u.type==="array"||u.items?`${f}[]`:f,m=gn(u),g=m?Ge(m,o,a):null,v=g!==null&&yt(g);return c.jsx("div",{className:n,children:c.jsx(nt,{path:h,depth:0,schema:u,itemSchema:v?g:void 0,description:u.type==="array"||u.items?$s(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return c.jsx("div",{className:n,children:c.jsx(gt,{schema:l,path:f,depth:d?-1:0,refStack:a,deref:o,suppressRow:d,defaultExpanded:i,focusTokens:r,focusId:s})})}function N0(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 Xf(e){let t=N0(e),n={next(){return t()},int(r,s){return r+Math.floor(n.next()*(s-r+1))},bool(r=.5){return n.next()<r},pick(r){return r[n.int(0,r.length-1)]},shuffle(r){let s=[...r];for(let o=s.length-1;o>0;o--){let i=n.int(0,o);[s[o],s[i]]=[s[i],s[o]]}return s},fork(){let r=Math.floor(n.next()*4294967296);return Xf(r)}};return n}function C0(e){return null}function _0(e){return e.random.bool()}function Qf(e,t,n=!1){let r=-1e3,s=1e3,o=!1,i=!1;if(e.minimum!==void 0&&(r=e.minimum),e.maximum!==void 0&&(s=e.maximum),e.exclusiveMinimum!==void 0&&(r=e.exclusiveMinimum,o=!0),e.exclusiveMaximum!==void 0&&(s=e.exclusiveMaximum,i=!0),e.multipleOf!==void 0)return R0(e.multipleOf,r,s,o,i,t);if(n){let u=o?Math.floor(r)+1:Math.ceil(r),f=i?Math.ceil(s)-1:Math.floor(s);return t.random.int(u,f)}let a=o?r+Number.EPSILON:r,l=i?s-Number.EPSILON:s;return a+t.random.next()*(l-a)}function R0(e,t,n,r,s,o){let i=Math.ceil(t/e),a=Math.floor(n/e);return r&&i*e===t&&i++,s&&a*e===n&&a--,i>a?i*e:o.random.int(i,a)*e}function I0(e,t){if(e.autoIncrement){let n=e.initialOffset??1,r=P0(t.path),s=t.autoIncrementCounters??new Map,o=(s.get(r)??n-1)+1;return s.set(r,o),t.autoIncrementCounters&&t.autoIncrementCounters.set(r,o),o}return Qf(e,t,!0)}function P0(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function vc(e,t){let n=Gf(e,0);return cr(n.node,t)}function cr(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return $0(e,t);case"sequence":return e.nodes.map(n=>cr(n,t)).join("");case"alternation":return cr(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},()=>cr(e.node,t)).join("")}case"group":return cr(e.node,t)}}function $0(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),r=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(s=>!n.has(s));return r.length>0?t.pick(r):"a"}function Gf(e,t){let n=[],r=[];for(;t<e.length;){let s=e[t];if(s===")")break;if(s==="|"){n.push(wc(r)),r=[],t++;continue}if(s==="("){let a=t+1;if(e[a]==="?")if(e[a+1]===":")a+=2;else if(e[a+1]==="="||e[a+1]==="!"){let d=1,p=a;for(;p<e.length&&d>0;)p++,e[p]==="("&&d++,e[p]===")"&&d--;t=p+1;continue}else{for(a+=2;a<e.length&&e[a]!==">";)a++;a++}let l=Gf(e,a),u={type:"group",node:l.node};t=l.pos+1;let f=ar(e,t,u);r.push(f.node),t=f.pos;continue}if(s==="["){let a=L0(e,t),l=ar(e,a.pos,a.node);r.push(l.node),t=l.pos;continue}if(s==="."){let a={type:"dot"};t++;let l=ar(e,t,a);r.push(l.node),t=l.pos;continue}if(s==="^"||s==="$"){r.push({type:"anchor"}),t++;continue}if(s==="\\"){t++;let a=M0(e,t);t=a.pos;let l=ar(e,t,a.node);r.push(l.node),t=l.pos;continue}let o={type:"literal",value:s};t++;let i=ar(e,t,o);r.push(i.node),t=i.pos}return n.push(wc(r)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function wc(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function M0(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:[...`
125
- `],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
126
- `],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function L0(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let r=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let s=e[t];switch(s){case"d":r.push(..."0123456789");break;case"w":r.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":r.push(...`
127
- `);break;default:r.push(s)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let s=e.charCodeAt(t),o=e.charCodeAt(t+2);for(let i=s;i<=o;i++)r.push(String.fromCharCode(i));t+=3;continue}r.push(e[t]),t++}return t++,{node:{type:"charClass",chars:r,negated:n},pos:t}}function ar(e,t,n){if(t>=e.length)return{node:n,pos:t};let r=e[t],s,o;switch(r){case"*":s=0,o=5,t++;break;case"+":s=1,o=5,t++;break;case"?":s=0,o=1,t++;break;case"{":{let i=D0(e,t);if(i)s=i.min,o=i.max,t=i.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:s,max:o},pos:t}}function D0(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let r=parseInt(n[1],10),s;return n[2]===void 0?s=r:n[2]===""?s=r+5:s=parseInt(n[2],10),{min:r,max:s,pos:t+n[0].length}}function xt(e){return e<10?`0${e}`:`${e}`}function B0(e,t){return new Date(e,t,0).getDate()}var ed="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function F0(e){return!(e==="^"||e==="$"||e==="^$")}function U0(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return H0(t);let i=t.formatRegistry.get(e.format);if(i){let a=i(t.random),l=t.minLength??e.minLength,u=t.maxLength??e.maxLength;return l!==void 0&&a.length<l?Uo(a,l,t):u!==void 0&&a.length>u?a.slice(0,u):a}}if(e.pattern){let i=t.minLength??e.minLength,a=t.maxLength??e.maxLength;for(let f=0;f<50;f++){let d=vc(e.pattern,t.random);if(!(i!==void 0&&d.length<i)&&!(a!==void 0&&d.length>a))return d}let l=vc(e.pattern,t.random),u=F0(e.pattern);return i!==void 0&&l.length<i&&u?Uo(l,i,t):a!==void 0&&l.length>a?l.slice(0,a):l}let n=e.minLength??0,r=e.maxLength??Math.max(n+10,10),s=t.random.int(n,r),o="";for(let i=0;i<s;i++)o+=t.random.pick([...ed]);return t.maxLength!==void 0&&o.length>t.maxLength&&(o=o.slice(0,t.maxLength)),t.minLength!==void 0&&o.length<t.minLength&&(o=Uo(o,t.minLength,t)),o}function Uo(e,t,n){for(;e.length<t;)e+=n.random.pick([...ed]);return e}function H0(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,r=t.getTime(),s=n.getTime(),o=r+e.random.next()*(s-r),i=new Date(o),a=i.getFullYear(),l=xt(i.getMonth()+1),u=xt(i.getDate());return`${a}-${l}-${u}T01:01:01.0Z`}function Sc(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 s=e.exclusiveMinimum??e.minimum??-1/0,o=e.exclusiveMaximum??e.maximum??1/0,i=e.exclusiveMinimum!==void 0,a=e.exclusiveMaximum!==void 0;n=n.filter(l=>{if(typeof l!="number")return!0;let u=i?l>s:l>=s,f=a?l<o:l<=o;if(!u||!f)return!1;if(e.multipleOf!==void 0){let d=e.multipleOf,p=d.toString().includes(".")?d.toString().split(".")[1].length:0,h=Math.pow(10,p),m=Math.round(l*h),g=Math.round(d*h);if(m%g!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let s=e.minLength??0,o=e.maxLength??1/0;n=n.filter(i=>typeof i!="string"?!0:i.length>=s&&i.length<=o)}if(e.minItems!==void 0||e.maxItems!==void 0){let s=e.minItems??0,o=e.maxItems??1/0;n=n.filter(i=>Array.isArray(i)?i.length>=s&&i.length<=o:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let s=e.minProperties??0,o=e.maxProperties??1/0;n=n.filter(i=>typeof i!="object"||i===null||Array.isArray(i)?!0:Object.keys(i).length>=s&&Object.keys(i).length<=o)}if(n.length===0){let s=[];throw e.minLength!==void 0&&s.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&s.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&s.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&s.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&s.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&s.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&s.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&s.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&s.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&s.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&s.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${s.join(", ")}] at ${t.path}`)}let r=t.random.pick(n);return typeof r=="object"&&r!==null?structuredClone(r):r}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Ct(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}nd(t,n)}return t}function td(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 nd(n,t),n}function nd(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=q0(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=[],r=Math.max(e.prefixItems.length,t.prefixItems.length);for(let s=0;s<r;s++){let o=e.prefixItems[s],i=t.prefixItems[s];o!==void 0&&i!==void 0?n.push(td(o,i)):o!==void 0?n.push(o):i!==void 0&&n.push(i)}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=z0(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(r=>JSON.stringify(r)));e.enum=e.enum.filter(r=>n.has(JSON.stringify(r)))}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 q0(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],s=n.filter(o=>r.includes(o));return s.length===0?n[0]:s.length===1?s[0]:s}function z0(e,t){let n={...e};for(let[r,s]of Object.entries(t)){let o=e[r];o===void 0?n[r]=s:typeof o=="object"&&typeof s=="object"?n[r]=td(o,s):n[r]=s}return n}var to=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 rd(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>to.has(t))}function jc(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(r=>r===e):!1}function W0(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 V0(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(rd(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}function K0(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function J0(e,t){var y;let n=V0(e),r=K0(e,n);if(t.depth>=t.maxDepth){if(r.length===0)return{};let x={};for(let w of r){let E=n[w];if(E&&typeof E=="object"&&E!==null){let S=E;S.const!==void 0?x[w]=S.const:S.default!==void 0?x[w]=S.default:S.enum!==void 0&&S.enum.length>0?x[w]=S.enum[0]:x[w]=Q0(S.type)}else x[w]=null}return x}if(e.additionalProperties===!1){let x=Object.keys(n).length>0,w=e.patternProperties&&Object.keys(e.patternProperties).length>0,E=new Set(Object.keys(n)),S=[...new Set(r)].filter(k=>!E.has(k));if((e.minProperties??0)>0&&!x&&!w)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(S.length>0&&!w&&!x)throw Error(`missing properties for ${S.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let s=t.path==="/"?"/properties":`${t.path}/properties`,o={...t,depth:t.depth+1,path:s},i={},a=new Set,l=new Set(r),u=t.alwaysFakeOptionals??!1,f=t.fillProperties??!0,d=t.fixedProbabilities??!1,p=t.optionalsProbability??.5,h=Object.keys(n).filter(x=>!l.has(x)),m;if(d&&!u&&h.length>0){let x=Math.round(h.length*p);m=new Set(h.slice(0,x))}let g=x=>u?!0:m?m.has(x):t.random.bool(p);if(Object.keys(n).length>0)for(let[x,w]of Object.entries(n)){if(W0(w))continue;a.add(x);let E=Vt(o,x),S=l.has(x),k=typeof w=="object"&&w!==null&&w.type==="object",C=w;if(e.patternProperties&&typeof w=="object"&&w!==null){let T=[];for(let[N,F]of Object.entries(e.patternProperties))try{new RegExp(N).test(x)&&T.push(F)}catch{}T.length>0&&(C=Ct([w,...T]))}if(S){let T=await ve(C,E);T!==void 0&&(i[x]=T)}else if(g(x)){let T=await ve(C,E);T!==void 0&&(i[x]=T)}else if(k&&!f){let T=w.required??[];if(T.length>0){let N={};for(let F of T){let $=(w.properties??{})[F]??{},K=Vt(E,F),re=await ve($,K);re!==void 0&&(N[F]=re)}i[x]=N}}}for(let x of l)if(!(i[x]!==void 0||a.has(x))){if(e.patternProperties){let w=[];for(let[E,S]of Object.entries(e.patternProperties))new RegExp(E).test(x)&&w.push(S);if(w.length>0){let E=w.length===1?w[0]:Ct(w),S=Vt(o,x),k=await ve(E,S);k!==void 0&&(i[x]=k),a.add(x)}}if(!a.has(x)){let w=e.additionalProperties??!0;if(w!==!1){let E=Vt(o,x),S=await ve(w===!0?{}:w,E);S!==void 0&&(i[x]=S),a.add(x)}}}if(e.dependencies){for(let[x,w]of Object.entries(e.dependencies))if(!(typeof w!="object"||w===null||Array.isArray(w))&&i[x]!==void 0&&!a.has(x+"_dep")){a.add(x+"_dep");let E=w.oneOf??w.anyOf??w.allOf??[w],S=null;for(let k of E){if(typeof k!="object"||k===null)continue;let{properties:C,not:T}=k;if(C&&C[x]){let N=C[x],F=i[x];if(jc(F,N)){S=k;break}}if(T!=null&&T.properties){let N=T.properties[x];if(N){let F=i[x];if(!jc(F,N)){S=k;break}}}}if(!S&&E.length>0&&typeof E[0]=="object"&&(S=E[0]),S!=null&&S.not){let k=S.not;if(k.required&&Array.isArray(k.required))for(let C of k.required)delete i[C]}if(S!=null&&S.required)for(let k of S.required){if(k===x||i[k]!==void 0)continue;let C=((y=S.properties)==null?void 0:y[k])??{type:"object"},T=Vt(o,k),N=await ve(C,T);N!==void 0&&(i[k]=N)}if(S&&S.properties)for(let[k,C]of Object.entries(S.properties)){if(k===x)continue;let T=Vt(o,k),N=await ve(C,T);N!==void 0&&(i[k]=N)}}}let v=e.minProperties??0,j=e.maxProperties;if(Object.keys(i).length<v){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let x=Object.entries(e.patternProperties),w=0,E=1e3;for(;Object.keys(i).length<v&&w<E;){w++;let[S,k]=t.random.pick(x),C=X0(S,t);if(C&&!i[C]){let T=Vt(o,C),N=await ve(k,T);N!==void 0&&(i[C]=N),a.add(C)}}}if(Object.keys(i).length<v){let x=e.additionalProperties,w=x===void 0||x===!0?{type:"string"}:x;if(w!==!1){let E=0,S=1e3;for(;Object.keys(i).length<v&&E<S;){E++;let k=`prop${t.random.int(0,99999)}`;if(!i[k]){let C=Vt(o,k),T=await ve(w,C);T!==void 0&&(i[k]=T),a.add(k)}}}}if(Object.keys(i).length<v){let x=Object.keys(n).join(", ");throw Error(`properties '${x}' were not found while additionalProperties is false in ${t.path}`)}}if(j!==void 0&&Object.keys(i).length>j){let x=Object.keys(i).filter(w=>!l.has(w));for(t.random.shuffle(x);Object.keys(i).length>j&&x.length>0;){let w=x.pop();delete i[w]}}return t.pruneProperties&&t.pruneProperties.length>0&&Pi(i,t.pruneProperties),Z0(i,n),i}function Vt(e,t){let n=Y0(t),r=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:r}}function Y0(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Z0(e,t){for(let[n,r]of Object.entries(t)){if(typeof r!="object"||r===null)continue;let s=r;if(s.template===void 0)continue;let o=s.template;if(typeof o!="string")continue;let i=o.replace(/#\{(\w+)\}/g,(a,l)=>{let u=e[l];return u!==void 0?String(u):""});e[n]=i}}function X0(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let l=n[1],u=n[2];if(u===".*"||u!=null&&u.includes("?:")){let f=t.random.int(0,10),d="";for(let p=0;p<f;p++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return l+d}return l}let r=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(r){let l=r[2],u=t.random.int(1,10),f="";for(let d=0;d<u;d++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return f+l}let s=e.match(/^\^([a-zA-Z]+)\$$/);if(s)return s[1];let o=t.random.int(3,10),i="abcdefghijklmnopqrstuvwxyz",a="";for(let l=0;l<o;l++)a+=t.random.pick(i.split(""));try{if(new RegExp(e).test(a))return a}catch{}return null}function Pi(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let r of e)Pi(r,t);return}let n=e;for(let r of Object.keys(n))t.includes(r)?delete n[r]:Pi(n[r],t)}function Q0(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 G0(e,t){var j;if(t.depth>=t.maxDepth){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(t.refDepthReached){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let y=((j=e.prefixItems)==null?void 0:j.length)??0;if((e.minItems??0)>y)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${y})`)}let n=t.path==="/"?"/items":`${t.path}/items`,r={...t,depth:t.depth+1,path:n},s=[],o=t.refDepthMax,i=t.minItems??e.minItems??0,a=t.maxItems??e.maxItems??Math.max(i,t.maxDefaultItems);e.maxItems!==void 0&&a>e.maxItems&&(a=e.maxItems),e.minItems!==void 0&&i<e.minItems&&(i=e.minItems),a<i&&(e.maxItems!==void 0?i=a:a=i),t.alwaysFakeOptionals&&(a=Math.max(i,a));let l=e.uniqueItems?new Set:null,u=async(y,x)=>{let w=await ve(y,x);if(w===void 0)return"omitted";if(l){let E=JSON.stringify(w);if(l.has(E)){for(let S=0;S<50;S++){if(w=await ve(y,Kt(r,s.length)),w===void 0)continue;let k=JSON.stringify(w);if(!l.has(k))return l.add(k),s.push(w),"added"}return"failed"}l.add(E)}return s.push(w),"added"};if(e.prefixItems)for(let y=0;y<e.prefixItems.length&&s.length<a;y++){let x=Kt(r,y);if(await u(e.prefixItems[y],x)==="failed")break}let f;if(o!==void 0&&t.refDepth>=o-1){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}let d=t.alwaysFakeOptionals??!1,p=t.fixedProbabilities??!1,h=t.optionalsProbability??.5;if(d)f=a;else if(p){let y=a-Math.max(i,s.length),x=Math.round(y*h);f=Math.max(i,s.length)+x}else f=t.random.int(Math.max(i,s.length),a);e.items;let m=e.prefixItems!==void 0,g=e.additionalItems!==void 0,v;if(m?g?v=e.additionalItems:e.items!==void 0&&(v=e.items):v=e.items,v!==!1&&v!==void 0){let y=v??{},x=0,w=Math.max(f*20,50);for(;s.length<f;){let E=await u(y,Kt(r,s.length));if(E==="added"){x=0;continue}if(x++,E==="failed"||x>=w)break}}if(e.contains){let y=e.minContains??1,x=e.maxContains??Math.max(y,1),w=t.random.int(y,x);for(let E=0;E<w;E++){let S=await ve(e.contains,Kt(r,s.length));if(S!==void 0){if(l){let k=JSON.stringify(S);if(l.has(k)){let C=!1;for(let T=0;T<50;T++){if(S=await ve(e.contains,Kt(r,s.length)),S===void 0)continue;let N=JSON.stringify(S);if(!l.has(N)){l.add(N),C=!0;break}}if(!C)continue}else l.add(k)}if(s.length<a){let k=t.random.int(0,s.length);s.splice(k,0,S)}else if(s.length>0){let k=t.random.int(0,s.length-1);s[k]=S}}}for(;s.length>a;)s.pop()}if(e.containsAll){let y=new Set;for(let x of e.containsAll){let w=await ve(x,Kt(r,s.length));if(w!==void 0){if(l){let E=JSON.stringify(w);if(l.has(E)){let S=!1;for(let k=0;k<50;k++){if(w=await ve(x,Kt(r,s.length)),w===void 0)continue;let C=JSON.stringify(w);if(!l.has(C)){l.add(C),S=!0;break}}if(!S)continue}else l.add(E)}if(s.length<a){let E=t.random.int(0,s.length);s.splice(E,0,w);let S=new Set;for(let k of y)S.add(k>=E?k+1:k);y.clear();for(let k of S)y.add(k);y.add(E)}else if(s.length>0){let E=Array.from({length:s.length},(S,k)=>k).filter(S=>!y.has(S));if(E.length>0){let S=E[t.random.int(0,E.length-1)];s[S]=w,y.add(S)}else s.push(w),y.add(s.length-1)}}}for(;s.length>a;)s.pop()}return e.uniqueItems&&s.length>0?ex(s,e,r,i,a,l):s}async function ex(e,t,n,r,s,o){let i=t.items??{},a=0,l=100;for(;e.length<r&&a<l;){a++;let u=await ve(i,Kt(n,e.length));if(u===void 0)continue;let f=JSON.stringify(u);o.has(f)||(o.add(f),e.push(u))}for(;e.length>s;)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 Ec(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 tx(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function tx(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),r=e;for(let s of n){let o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof r!="object"||r===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${o}"`);if(Array.isArray(r)){let i=parseInt(o,10);if(isNaN(i)||i<0||i>=r.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${o}"`);r=r[i]}else{if(!(o in r))throw Error(`Cannot resolve JSON pointer "${t}": property "${o}" not found`);r=r[o]}}return r}function nx(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,r=n.$id,{$id:s,...o}=n;t.set(r,o)}if(e.$defs)for(let[n,r]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,r);return t}async function Ms(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let r=t.refDepth+1;if(t.refDepthMax!==void 0&&r>=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 s,o;if(n.startsWith("#/")){if(s=t.refRegistry.get(n),s===void 0&&n.length>2){let d=t.refRegistry.get("#");if(d!==void 0&&typeof d=="object")try{s=Ec(d,n.slice(1))}catch{}}s===void 0&&t.refResolver&&(s=await t.refResolver(n),s!==void 0&&t.refRegistry.set(n,s))}else if(n==="#")s=t.refRegistry.get("#")??{};else if(s=t.refRegistry.get(n),s===void 0&&t.refResolver){o=await t.refResolver(n);let d=n.indexOf("#");if(d!==-1){let p=n.slice(d+1);p?s=Ec(o,p):s=o}else s=o;if(o&&typeof o=="object"&&o!==null){let p=o;if(p.$defs)for(let[h,m]of Object.entries(p.$defs))t.refRegistry.set(`#/$defs/${h}`,m)}}if(s===void 0)throw Error(`Unresolved $ref: ${n}`);let i=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:a,...l}=e,u=Object.fromEntries(Object.entries(l).filter(([d])=>!i.has(d)));Object.keys(u).length>0&&typeof s=="object"&&s!==null&&(s={...s,...u});let f={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:s,ctx:f}}function rx(e,t){typeof e!="boolean"&&(t.set("#",e),$i(e,"#",t))}function $i(e,t,n){if(e.$id){let{$id:r,...s}=e;n.set(r,s)}if(e.$defs)for(let[r,s]of Object.entries(e.$defs)){let o=`${t}/$defs/${r}`;n.set(o,s),typeof s=="object"&&s!==null&&$i(s,o,n)}if(e.properties)for(let[r,s]of Object.entries(e.properties))typeof s=="object"&&s!==null&&$i(s,`${t}/properties/${r}`,n)}async function sx(e,t){return e.$ref?(await Ms(e,t)).schema:e}async function ox(e,t){let n=[];for(let r of e)if(typeof r=="object"&&r!==null&&"$ref"in r){let s=await sx(r,t);n.push(s)}else typeof r=="object"&&r!==null&&n.push(r);return n}async function ix(e,t){let{allOf:n,anyOf:r,oneOf:s,not:o,if:i,then:a,else:l,...u}=e;if(n){let f=await ox(n,t),d=Ct([u,...f]);return ve(d,t)}if(s){let f=t.random.shuffle([...s]),d=u.required??[];for(let x of f){let w=typeof x=="object"&&x!==null?x:{};w.$ref&&(w=(await Ms(w,t)).schema);let E=w.required??[],S=[...new Set([...d,...E])],k={...u,required:S},C=Ct([k,w]),T={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await ve(C,T)}catch{}}let p=s[0],h=typeof p=="object"&&p!==null?p:{};h.$ref&&(h=(await Ms(h,t)).schema);let m=h.required??[],g=[...new Set([...d,...m])],v={...u,required:g},j=Ct([v,h]),y={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return ve(j,y)}if(r){let f=t.random.shuffle([...r]);for(let h of f){let m=Ct([u,h]);try{return await ve(m,t)}catch{}}let d=r[0],p=Ct([u,d]);return ve(p,t)}return i!==void 0?ax(u,i,a,l,t):o?lx(u,o,t):ve(u,t)}async function ax(e,t,n,r,s){if(n!==void 0){let o=Ct([e,t,n]);try{return await ve(o,s)}catch{}}if(r!==void 0){let o=Ct([e,r]);try{return await ve(o,s)}catch{}}return ve(e,s)}async function lx(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return ve(e,n)}if(t.type&&!t.enum&&!t.const){let r=Array.isArray(t.type)?t.type:[t.type],s=["string","number","integer","boolean","null","object","array"].filter(o=>!r.includes(o));if(s.length>0){let o=n.random.pick(s),i=Ct([e,{type:o}]);return ve(i,n)}}if(t.const!==void 0||t.enum!==void 0){let r=t.enum??[t.const],s=new Set(r.map(o=>JSON.stringify(o)));for(let o=0;o<20;o++){let i=await ve(e,n);if(!s.has(JSON.stringify(i)))return i}}return ve(e,n)}class cx{constructor(){Ee(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 r=Object.keys(t);for(let s=r.length-1;s>=0;s--){let o=r[s],i=o.startsWith("x-")?o.slice(2):o,a=this.extensions.get(i);if(a){let l=t[o],u=a.callback.call(a.context,l,t,n);if(u!==void 0)return u}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var ux=new cx;function fx(e,t){return ux.generate(e,t)}var dx=["string","number","integer","boolean","null","object","array"];function kc(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 r=px(e.faker,t),s=Tc(r,n??e.type,t.path);return typeof s=="string"&&e.format?Ac(s,e.format,t):s}catch{}if(e.chance!==void 0)try{let r=hx(e.chance,t),s=Tc(r,n??e.type,t.path);return typeof s=="string"&&e.format?Ac(s,e.format,t):s}catch{}}function Ac(e,t,n){if(t==="date"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime())){let s=r.getFullYear(),o=xt(r.getMonth()+1),i=xt(r.getDate());return`${s}-${o}-${i}`}if(typeof e=="string"){let s=Date.parse(e);if(!isNaN(s)){let o=new Date(s),i=o.getFullYear(),a=xt(o.getMonth()+1),l=xt(o.getDate());return`${i}-${a}-${l}`}}}if(t==="date-time"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime()))return r.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function Tc(e,t,n){if(t===void 0)return e;let r=Array.isArray(t)?t[0]:t;switch(r){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let s=Number(e);return r==="integer"?Math.floor(s):s;case"boolean":return!!e;case"null":return null;default:return e}}function px(e,t){var i;if(!((i=t.extensions)!=null&&i.faker)){let a=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${a} in ${t.path}`)}let n,r;if(typeof e=="object"&&e!==null){let a=e,l=Object.keys(a);if(l.length>0)n=l[0],r=a[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let s=n.split("."),o=t.extensions.faker;for(let a of s)try{o=o[a]}catch{throw Error(`failed to resolve .${a} (${n})`)}if(typeof o=="function")return r?o(...r):o();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function hx(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let r=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${r} in ${t.path}`)}if(typeof e=="string"){let r=t.extensions.chance[e];if(typeof r=="function")return r.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let r=e,s=Object.keys(r)[0],o=r[s],i=t.extensions.chance[s];if(typeof i=="function")return o?i.call(t.extensions.chance,o):i.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function mx(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function ze(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function ve(e,t){if(e===!0)return ve({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let o=e,i=null;for(let[a,l]of Object.entries(t.propAliases))a in o&&!(l in o)&&(i||(i={...o}),i[l]=i[a],delete i[a]);i&&(e=i)}let n;if(Array.isArray(e.type)){let o=e.type;n=t.random.pick(o);let i={...t,resolvedType:n},a=kc(e,i,n);if(a!==void 0)return typeof a=="string"&&i.maxLength!==void 0&&a.length>i.maxLength?ze(a.slice(0,i.maxLength),e,i):ze(a,e,i)}else{let o=kc(e,t,n);if(o!==void 0)return typeof o=="string"&&t.maxLength!==void 0&&o.length>t.maxLength?ze(o.slice(0,t.maxLength),e,t):ze(o,e,t)}let r=fx(e,t);if(r!==void 0)return ze(r,e,t);if(e.$ref){let o=await Ms(e,t);return ve(o.schema,mx(o.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return ix(e,t);if(e.const!==void 0)return ze(Sc(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return ze(e.default,e,t);if(e.enum!==void 0)return ze(Sc(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return ze(t.random.pick(e.examples),e,t);if(e.example!==void 0)return ze(e.example,e,t)}let s=gx(e,t);if(s===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let o=t.defaultInvalidTypeProduct;return typeof o=="string"?xx(o):o}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(s){case"null":return ze(C0(),e,t);case"boolean":return ze(_0(t),e,t);case"number":return ze(Qf(e,t),e,t);case"integer":return ze(I0(e,t),e,t);case"string":return ze(U0(e,t),e,t);case"object":return ze(await J0(e,t),e,t);case"array":return ze(await G0(e,t),e,t);default:throw Error(`Unknown type: ${s} at ${t.path}`)}}function gx(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||yx(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(dx)}function yx(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(to.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function xx(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 bx(e){let t=sd(e),n=od(e);return`${t}T${n}`}function sd(e){let t=e.int(2e3,2030),n=e.int(1,12),r=B0(t,n),s=e.int(1,r);return`${t}-${xt(n)}-${xt(s)}`}function od(e){let t=e.int(0,23),n=e.int(0,59),r=e.int(0,59);return`${xt(t)}:${xt(n)}:${xt(r)}Z`}var vx=["alice","bob","charlie","dave","eve","frank","grace","heidi"],wx=["example.com","test.org","demo.net","sample.io"];function Oc(e){let t=e.pick(vx),n=e.int(1,999),r=e.pick(wx);return`${t}${n}@${r}`}var Sx=["https"],jx=["example.com","test.org","demo.net"],Ex=["api","v1","users","items","data","resource"];function os(e){let t=e.pick(Sx),n=e.pick(jx),r=e.int(1,3),s=[];for(let o=0;o<r;o++)s.push(e.pick(Ex));return`${t}://${n}/${s.join("/")}`}var kx=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],Ax=["com","org","net","io","dev"];function Nc(e){let t=e.int(1,3),n=[];for(let r=0;r<t;r++)n.push(e.pick(kx));return n.push(e.pick(Ax)),n.join(".")}function Tx(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function Ox(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function Nx(e){let t=n=>{let r="";for(let s=0;s<n;s++)r+=e.int(0,15).toString(16);return r};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var Cx=["foo","bar","baz","items","0","1","2","name","value"];function Cc(e){let t=e.int(1,4),n=[];for(let r=0;r<t;r++)n.push(e.pick(Cx));return"/"+n.join("/")}function _x(e){let t=["P"],n=e.bool(),r=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`)),r&&(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 Rx=new Map([["date-time",bx],["date",sd],["time",od],["duration",_x],["email",Oc],["idn-email",Oc],["uri",os],["uri-reference",os],["iri",os],["iri-reference",os],["hostname",Nc],["idn-hostname",Nc],["ipv4",Tx],["ipv6",Ox],["uuid",Nx],["json-pointer",Cc],["relative-json-pointer",e=>`${e.int(0,5)}${Cc(e)}`]]);function id(e){let t=new Map(Rx);if(e)for(let[n,r]of Object.entries(e))t.set(n,r);return t}function Ix(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),r=[t];for(let s of n){if(s==="")continue;let o=[];for(let i of r)if(i!=null)if(s==="*")Array.isArray(i)&&o.push(...i);else if(/^\d+$/.test(s)){let a=parseInt(s,10);Array.isArray(i)&&a<i.length&&o.push(i[a])}else s===""?Mi(i,o):typeof i=="object"&&i!==null&&s in i&&o.push(i[s]);r=o}return r}function Mi(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),Mi(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),Mi(n,t)}}function Px(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(rd(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}async function Li(e,t,n,r){if(!n.resolveJsonPath)return e;let s=r??e;if(t===!0||t===!1||t.$ref)return e;let o=t;if(o.allOf||o.anyOf||o.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let i={...e},a=Px(o);for(let[l,u]of Object.entries(a))if(l in i){let f=i[l];if(typeof u=="object"&&u!==null&&"jsonPath"in u&&typeof u.jsonPath=="string"){let d=Ix(u.jsonPath,s);d.length>0&&(i[l]=n.random.pick(d))}else{let d=await Li(f,u,n,s);i[l]=d}}return i}if(Array.isArray(e)&&o.items){let i=[];for(let a of e){let l=await Li(a,o.items,n,s);i.push(l)}return i}return e}var $x=id(),_c=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function ad(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let d=e.$schema;if(typeof d=="string"&&!_c.has(d))throw Error(`Unsupported JSON Schema version: ${d}. Supported versions: ${[..._c].join(", ")}`)}let n=Lx(t),r=Xf((t==null?void 0:t.seed)??1),s=n.propAliases?Mx(e,n.propAliases):e,o=nx(s);rx(s,o);let i=n.formats?id(n.formats):new Map($x),a=n.refDepthMin??n.refDepth,l=n.refDepthMax??n.refDepth;if(a!==void 0&&l!==void 0&&a>l)throw Error(`refDepthMin (${a}) cannot be greater than refDepthMax (${l})`);let u={random:r,maxDepth:n.maxDepth??(l?l+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:o,refStack:new Set,formatRegistry:i,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:a,refDepthMax:l,useExamplesValue:n.useExamplesValue,pruneProperties:n.pruneProperties,failOnInvalidTypes:n.failOnInvalidTypes,defaultInvalidTypeProduct:n.defaultInvalidTypeProduct,minDateTime:n.minDateTime,maxDateTime:n.maxDateTime,propAliases:n.propAliases,outputTransform:n.outputTransform},f=await ve(s,u);return n.resolveJsonPath?Li(f,e,u,f):f}function Mx(e,t){if(typeof e!="object"||e===null)return e;let n=e,r=null;for(let[s,o]of Object.entries(t))s in n&&!(o in n)&&(r||(r={...n}),r[o]=r[s],delete r[s]);return r??e}function Lx(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:Dx(n.outputTransform,Bx(t.ignoreProperties))}),n}function Dx(e,t){return e?t?async(n,r,s)=>{let o=await e(n,r,s);return t(o,r,s)}:e:t}function Bx(e){return(t,n,r)=>{if(r==="/")return t;let s=Fx(r.slice(r.lastIndexOf("/")+1));return e.some(o=>typeof o=="string"?o===s:o instanceof RegExp?o.test(s):o(n))?void 0:t}}function Fx(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}const Ux=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function is(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function Rn(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,o=t(s);return Ux(o)?r.has(s)?is(o,"null")?{type:"null"}:{}:Rn(o,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return is(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(is(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[o,i]of Object.entries(e.properties)){const a=/id$/i.test(o)&&i.type==="string"&&!i.format&&!i.examples,l=i.type==="string"&&!i.format&&!i.examples&&!i.enum;s[o]=a?{...i,format:"uuid"}:l?{...i,examples:["string"]}:Rn(i,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(is(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:Rn(e.items,t,n,r)}}finally{n.delete(e)}}return e}function Hx({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=A.useState(n?t:null),{deref:o}=Ve();if(A.useEffect(()=>{if(n){s(t);return}let a=!1;try{ad(Rn(e,o),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(l=>{a||s(l)}).catch(()=>{})}catch{}return()=>{a=!0}},[e,o,n,t]),r===null)return null;const i=JSON.stringify(r,null,2);return c.jsxs("div",{children:[c.jsx(_a,{code:i}),!n&&c.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function yn({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:o,conversionError:i,pendingConversion:a,example:l,defaultView:u="example"}){const f=Xu(s),d=!a&&Um(s,i),[p,h]=A.useState(d&&u==="example"?"example":"schema");return A.useEffect(()=>{!d&&p==="example"&&h("schema")},[d,p]),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),f&&c.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:f})]}),r&&c.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:r})]}),c.jsx(Zf,{tabs:[...d?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),i&&c.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 ",Qu(s)??"the"," schema, showing raw definition. ",i]}),a?c.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):c.jsxs(c.Fragment,{children:[p==="schema"&&c.jsx(Pa,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),p==="json"&&c.jsx(Lf,{schema:o??e}),p==="example"&&d&&c.jsx(Hx,{schema:e,providedExample:l})]})]})}function ld({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var h;const[o,i]=A.useState("payload");A.useEffect(()=>{(s==="headers"||s==="payload")&&i(s)},[s]);const{deref:a}=Ve(),l=ga(),u=A.useMemo(()=>e.payload?vr(e.payload,a):null,[e.payload,a,l]),f=A.useMemo(()=>e.headers?vr(e.headers,a):null,[e.headers,a,l]),d=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:c.jsx("div",{className:"overflow-hidden",children:c.jsxs("div",{className:`${r} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&c.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&c.jsxs("div",{children:[e.payload&&e.headers&&c.jsx(Wn,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:o,onChange:m=>i(m)}),c.jsxs("div",{className:"mt-4",children:[(o==="payload"||!e.headers)&&u&&c.jsx(yn,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:d==null?void 0:d.payload}),(o==="headers"||!e.payload)&&f&&c.jsx(yn,{schema:f.schema,label:"Headers",description:f.description,schemaFormat:f.schemaFormat,originalSchema:f.originalSchema,conversionError:f.conversionError,pendingConversion:f.pendingConversion,example:d==null?void 0:d.headers})]})]}),e.tags&&e.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,g)=>c.jsx(Ca,{name:`#${m.name}`},g))})]})})}),p&&c.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:[c.jsx("span",{children:t?"Show less":"Show more"}),c.jsx(Ys,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function qx({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[o,i]=A.useState(!1);return A.useEffect(()=>{r&&i(!0)},[r]),c.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${r?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[c.jsxs("tr",{className:"",children:[c.jsx("td",{className:"px-6 py-4",children:c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),c.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})]})}),c.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),c.jsx("td",{className:"px-6 py-4",children:c.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{}),c.jsx("div",{children:t.contentType&&c.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&&c.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),c.jsxs("div",{className:"flex justify-between w-full",children:[c.jsx("div",{}),c.jsx("div",{children:t.correlationId&&c.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})})]})]})})]}),c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"p-0",children:c.jsx(ld,{message:t,expanded:o,onToggleExpanded:()=>i(a=>!a),paddingX:"px-6",focusSection:r?s:null})})})]})}function cd({messages:e,selectedKey:t,focusSection:n}){const r=Object.entries(e),s=r.length?c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),r.map(([o,i],a)=>c.jsx(qx,{messageKey:o,message:i,first:a===0,isSelected:t===o,focusSection:n},o))]})}):c.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 c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:s,stickySideContent:!1})})}function ud({serverNames:e=[],current:t,setCurrent:n}){return c.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(r=>c.jsx("button",{type:"button",onClick:()=>n(r),"aria-current":t===r?"page":void 0,className:Cn(t===r?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:c.jsx("span",{className:"truncate",children:r})},r))})}function fd(e){return c.jsx(ra,{...e,children:c.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 zx(e){return c.jsx(ra,{...e,children:c.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 dd({address:e,variables:t,children:n}){return c.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[c.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[c.jsx(zx,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&c.jsx(Xt,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function Wx({className:e}){return c.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:c.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function $r({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:o=""}){const[i,a]=A.useState(n),l=A.useId();return A.useEffect(()=>{r&&a(!0)},[r]),c.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${o}`,children:[c.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":l,"aria-labelledby":s,onClick:()=>a(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,i?c.jsx(Ys,{className:"w-4 h-4 text-foreground-muted shrink-0"}):c.jsx(Wx,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),c.jsx("div",{id:l,className:`grid transition-all duration-200 ease-in-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:c.jsx("div",{className:"overflow-hidden",children:t})})]})}const Vx=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"bearer",name:"Bearer Token"},{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 Rc(e){var n,r;const t=(n=e.type)==null?void 0:n.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(r=e.scheme)==null?void 0:r.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function $a({securities:e}){var a,l;const t=A.useMemo(()=>Vx.filter(u=>e==null?void 0:e.some(f=>Rc(f).toLowerCase()===u.id.toLowerCase())),[e]),n=t.length>1,[r,s]=A.useState(n?null:((a=t[0])==null?void 0:a.id)??null);A.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(u=>u&&t.some(f=>f.id===u)?u:null)},[t]);function o(u){return e.find(f=>Rc(f).toLowerCase()===u.toLowerCase())}const i=r?(l=o(r))==null?void 0:l.description:void 0;return c.jsxs("div",{children:[n&&c.jsx(Wn,{tabs:t,current:r,onChange:u=>s(f=>u&&f===u?null:u||null),placeholder:"Select an authorization method"}),c.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[r==="userPassword"&&c.jsxs(as,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),r&&["scramSha256","scramSha512","plain"].includes(r)&&c.jsxs(as,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),r==="gssapi"&&c.jsxs(as,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),r==="X509"&&c.jsxs(as,{description:i,children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),r==="bearer"&&c.jsx(Kx,{security:o("bearer")}),r==="apiKey"&&c.jsx(Jx,{security:o("apiKey")}),r==="openIdConnect"&&c.jsx(Yx,{security:o("openIdConnect")}),r==="oauth2"&&c.jsx(Zx,{security:o("oauth2")})]})]})}const as=({description:e,children:t})=>e?c.jsx(c.Fragment,{children:c.jsx(wt,{children:e})}):c.jsx("span",{children:t}),Kx=({security:e})=>e!=null&&e.description?c.jsx(wt,{children:e.description}):c.jsxs("span",{children:["You have to"," ",c.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",c.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?c.jsxs(c.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),Jx=({security:e})=>{if(e!=null&&e.description)return c.jsx(wt,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?c.jsxs("span",{children:["You have to"," ",c.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?c.jsxs(c.Fragment,{children:[" named ",c.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?c.jsxs("span",{children:["You have to"," ",c.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."]}):c.jsxs("span",{children:["You have to"," ",c.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."]})},Yx=({security:e})=>{var n,r;const t=(n=e.requiredScopes)!=null&&n.length?e.requiredScopes:e.scopes;return c.jsxs(c.Fragment,{children:[e!=null&&e.description?c.jsx(wt,{children:e.description}):c.jsx("p",{children:"You can use OpenID to connect to this server."}),c.jsxs("p",{children:["The OpenID Connect URL is"," ",c.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(r=e.requiredScopes)!=null&&r.length?"Required scopes":"Scopes"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("code",{children:gh(t)})})]})]})},Zx=({security:e})=>{const t=e==null?void 0:e.flows;return c.jsxs(c.Fragment,{children:[(e==null?void 0:e.description)&&c.jsx(wt,{children:e.description}),t&&Object.entries(t).map(([n,r])=>{var l,u;let s="",o="";switch(n){case"clientCredentials":s=eh,o=th;break;case"implicit":s=Qp,o=Gp;break;case"password":s=nh,o=rh;break;case"authorizationCode":s=sh,o=oh;break}const i=(l=e.requiredScopes)!=null&&l.length?e.requiredScopes:r.availableScopes??r.scopes,a=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),c.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:o})]}),c.jsx("div",{className:"mt-5 border-t border-border",children:c.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[r.authorizationUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.authorizationUrl})})]}),r.tokenUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.tokenUrl})})]}),r.refreshUrl&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.refreshUrl})})]}),i&&c.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[c.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:a}),c.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:c.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(i)?i:Object.keys(i)).map(f=>c.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:f},f))})})]})]})})]},n)})]})};function Xx(e){return e.startsWith("http://")||e.startsWith("https://")}function pd(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function hd({value:e}){if(e==null)return null;if(typeof e=="string"&&Xx(e))return c.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 c.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return c.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)?c.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,r)=>c.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},r))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?c.jsx(wt,{className:"prose-sm",children:t.description}):c.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,r])=>c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:pd(n)}),c.jsx(hd,{value:r})]},n))})}return c.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function md({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=lh[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},o=Object.entries(e??{}).filter(([i,a])=>i!=="bindingVersion"&&a!==void 0&&a!==null);return o.length===0?null:c.jsx($r,{className:"mt-2",defaultExpanded:t,forceExpanded:r,trigger:c.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:c.jsx("div",{className:"divide-y divide-neutral-100",children:o.length===0?c.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):o.map(([i,a])=>c.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[c.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:pd(i)}),c.jsx("div",{className:"flex-1 min-w-0",children:c.jsx(hd,{value:a})})]},i))})})}function Qx({host:e,protocol:t,description:n,tags:r,variables:s,security:o,bindings:i,serverKey:a,focusSection:l=null}){const u=s,f=A.useId();return c.jsxs("div",{children:[c.jsx(dd,{address:e,variables:u,children:c.jsx("div",{className:"mt-2",children:r&&r.map((d,p)=>{const h=d,m=h.externalDocs;return c.jsx(Ca,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),c.jsx(wt,{children:n}),o&&o.length>0&&c.jsxs("div",{id:a?`server-${a}-security`:void 0,children:[c.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[c.jsx(fd,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),c.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",o.length>1?"s":"",":"]}),c.jsx($r,{className:"mt-4",ariaLabelledBy:f,forceExpanded:l==="security",trigger:c.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:o.length}),children:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:o})})})]}),(()=>{const d=i==null?void 0:i[t];return d&&Object.keys(d).some(h=>h!=="bindingVersion")?c.jsxs("div",{id:a?`server-${a}-bindings`:void 0,children:[c.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[c.jsx(ia,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),c.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),c.jsx(md,{bindings:d,protocol:t,focused:l===`binding:${t}`})]}):null})()]})}function gd({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null}){const s=Object.keys(e),[o,i]=A.useState(void 0),a=[t,o].find(f=>!!f&&s.includes(f))??s[0],l=f=>{i(f),n==null||n(f)},u=c.jsx(Qx,{...e[a],serverKey:a,focusSection:t||o?r:null});return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:ku,content:u,sideContent:c.jsx(ud,{serverNames:s,current:a,setCurrent:l}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}const yd=A.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:o,children:i,width:a="w-[50rem]"},l){A.useEffect(()=>{const g=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);const u=n==="right"?"translate-x-full":"-translate-x-full",f=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:p}=Ve();A.useEffect(()=>{if(!(!t||!d))return Mu($u(d))},[t,d]);const h=Vs(p,!0),m=h?{position:"fixed",top:0,left:h.left,width:h.width,height:"100vh"}:{position:"fixed",inset:0};return d?Ar.createPortal(c.jsxs("div",{className:"z-50 overflow-hidden",style:{...m,pointerEvents:t?"auto":"none"},children:[c.jsx("div",{onClick:r,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),c.jsxs("div",{ref:l,className:`absolute top-0 ${f} h-full ${a} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":u}`,children:[s&&c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[c.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?c.jsx("span",{className:"truncate block",children:s}):s}),o,c.jsx("button",{onClick:r,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:c.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i})]})]}),d):null});function xd({getMarkdown:e,label:t}){const[n,r]=A.useState(!1),s=A.useRef(void 0);A.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const o=async()=>{try{await navigator.clipboard.writeText(e()),r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),2e3)}catch(i){console.error("[CopyMarkdownButton] copy failed:",i)}};return c.jsx("button",{type:"button",onClick:o,title:t,"aria-label":t,className:"ml-2 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors",children:n?c.jsx(la,{className:"w-4 h-4 text-green-600"}):c.jsx(aa,{className:"w-4 h-4"})})}function bd({message:e,messageId:t,i:n}){const[r,s]=A.useState(!1);return c.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[c.jsxs("div",{className:"px-4 py-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&c.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&&c.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&c.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&&c.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&&c.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),c.jsx(ld,{message:e,expanded:r,onToggleExpanded:()=>s(o=>!o)})]})}function Gx({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,o]=A.useState("request"),i=t.messages??[],a=t.channel,l=t.address,u=s==="request"?e:i,f=s==="request"?n?"accepts":"expects":c.jsxs(c.Fragment,{children:["replies to"," ",l?c.jsxs(c.Fragment,{children:["a channel in"," ",c.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:l.location})]}):(a==null?void 0:a.address)&&c.jsx(Xt,{address:a.address,parameters:a.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 c.jsxs("div",{children:[c.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(d=>c.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
128
- ${s===d?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:d},d))}),c.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[c.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:r})," ",f,u.length>1?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):c.jsxs("span",{children:[" "," with the following message:"]})]}),c.jsx("div",{className:"space-y-2",children:u.map((d,p)=>c.jsx(bd,{message:d,messageId:d.name,i:p},p))})]}):c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function eb({op:e,id:t,focusSection:n=null}){var m;const r=A.useId(),s=e.messages??[],o=e.tags??[],i=e.bindings,a=e.traits,l=e.reply,u=e.externalDocs,f=e.security,d=i??(Array.isArray(a)?(m=a.find(g=>g.bindings))==null?void 0:m.bindings:void 0),p=e.action===Es.SEND,h=c.jsx("div",{className:"space-y-2",children:s.map((g,v)=>c.jsx(bd,{message:g,messageId:g.name,i:v},v))});return c.jsxs("div",{className:"space-y-6",id:`operation-${t}-detail`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(u==null?void 0:u.url)&&c.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",title:u.description||u.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",c.jsx(Js,{className:"w-3.5 h-3.5"})]})]}),e.description&&c.jsx("div",{children:c.jsx(wt,{children:e.description})}),e.summary&&c.jsx("div",{children:c.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),f&&f.length>0&&c.jsxs("div",{id:`operation-${t}-security`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),c.jsx($r,{ariaLabelledBy:r,forceExpanded:n==="security",trigger:c.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:f})})})]}),d&&Object.entries(d).map(([g,v])=>v?c.jsxs("div",{id:`operation-${t}-bindings-${g}`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),c.jsx(md,{protocol:g,bindings:v,focused:n===`binding:${g}`})]},g):null),l?c.jsx(Gx,{requestMessages:s,reply:l,isSend:p,operationId:t}):s.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[c.jsx("span",{className:"font-bold",children:t})," ",p?"accepts":"expects",s.length>1?c.jsxs(c.Fragment,{children:[c.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:"]}),h]}),o.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map((g,v)=>c.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:g.name},v))})]})]})}function vd({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,showCopyMarkdown:s}){const o=m=>n==null?void 0:n(m),{document:i,deref:a}=Ve(),l=i;if(!Object.keys(e).length)return null;const u=t?e[t]:null,f=Object.keys(e).map(m=>{var E;const g=e[m],v=g.channel,j=v==null?void 0:v.address,y=v==null?void 0:v.parameters,x=((E=g.action)==null?void 0:E.toUpperCase())??"",w=t===m;return c.jsxs("tr",{id:`operation-${m}`,onClick:()=>o(m),role:"button",tabIndex:0,"aria-label":`${x||"Operation"} ${j??m}`,"aria-current":w?"true":void 0,onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),o(m))},className:`group cursor-pointer ${w?"bg-neutral-50":""}`,children:[c.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:j&&c.jsx(Xt,{address:j,parameters:y,truncate:!0})}),c.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:c.jsx(Qt,{method:g.action,className:"w-24"})}),c.jsx("td",{className:"group-hover:bg-neutral-50"})]},m)}),d=u?u.channel:null,p=u&&(d!=null&&d.address)?c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(Qt,{method:u.action}),c.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:c.jsx(Xt,{address:d.address,parameters:d.parameters})})]}):t??"Operation",h=c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100 w-full",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),c.jsx("tbody",{className:"bg-surface divide-y divide-border",children:f})]})});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:ih,content:h,stickySideContent:!1})}),c.jsx(yd,{isOpen:!!u,side:"right",onClose:()=>o(null),title:p,headerActions:u&&t&&s?c.jsx(xd,{getMarkdown:()=>Ym(l,t,a),label:"Copy operation for LLM"}):void 0,children:u&&c.jsx(eb,{op:u,id:t,focusSection:r})})]})}function no({schemas:e,selectedKey:t,focusTarget:n}){const{deref:r}=Ve(),s=ga(),o=A.useMemo(()=>Object.entries(e).map(([a,l])=>[a,vr(l,r)]),[e,r,s]),i=o.length?c.jsx("div",{className:"grid gap-6 w-full",children:o.map(([a,l])=>{const u=l.schema,f=Xu(l.schemaFormat),d=u.properties?Object.keys(u.properties).length:0;return c.jsxs("article",{id:`schema-${a}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===a?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),l.description&&c.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:l.description})]}),c.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||f||d>0)&&c.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[u.format&&c.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",u.format]}),f&&c.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:l.schemaFormat,children:f}),d>0&&c.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[d," properties"]})]}),l.conversionError&&c.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"," ",Qu(l.schemaFormat)??"the"," schema — showing raw definition. ",l.conversionError]}),l.pendingConversion&&c.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),l.pendingConversion?null:l.conversionError&&typeof l.originalSchema=="string"?c.jsx("div",{className:"mt-4",children:c.jsx(Lf,{schema:l.originalSchema})}):c.jsx(Pa,{schema:u,rootName:a,className:"mt-4",focusTokens:a===t?(n==null?void 0:n.tokens)??null:null,focusId:a===t?(n==null?void 0:n.id)??null:null})]},a)})}):c.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 c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:i,stickySideContent:!1})})}const tb=e=>e==="operations"||e==="messages"||e==="schemas";function nb({asyncapi:e,config:t}){var E,S,k,C;const n=t.show??{},r=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Ks}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Iu}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:sa}]:[]],{query:s,setQuery:o,results:i}=wm(e,{threshold:.3,limit:20}),{effectiveTab:a,focusTab:l,navActiveSection:u,selected:f,setSelectedKey:d,selectedNavItem:p,handleSearchSelect:h,handleNavItemSelect:m,handleNavServerSelect:g,handleContentTabChange:v,focusSection:j,schemaFocusTarget:y}=Yu({tabs:r,defaultTab:"operations",isTabKey:tb,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:s}),x=e.servers?Object.keys(e.servers):[],w=a==="operations"?c.jsx(vd,{operations:e.operations??{},selectedKey:f.operations,onSelectKey:T=>d("operations",T),focusSection:j,showCopyMarkdown:n.copyMarkdown!==!1}):a==="messages"?c.jsx(cd,{messages:((E=e.components)==null?void 0:E.messages)??{},selectedKey:f.messages,focusSection:j}):a==="schemas"?c.jsx(no,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:f.schemas,focusTarget:y}):null;return c.jsx(na,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:c.jsxs("div",{className:"px-4",children:[n.search!==!1&&c.jsx(Lu,{query:s,onQueryChange:o,results:i,onSelectResult:h}),n.copyMarkdown!==!1&&c.jsx(Du,{serialize:T=>Km(e,T),leftOffset:n.search!==!1?60:12}),n.info!==!1&&c.jsx("div",{id:"info-panel",children:c.jsx(Mf,{...e.info})}),n.servers!==!1&&x.length>0&&c.jsx("div",{id:`server-${f.servers??x[0]}`,children:c.jsx(gd,{servers:e.servers,selectedServer:f.servers,onSelectServer:T=>d("servers",T),focusSection:j})}),n.sidebar!==!1&&c.jsx(wh,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(k=e.components)==null?void 0:k.messages:void 0,schemas:n.schemas!==!1?(C=e.components)==null?void 0:C.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:u,onTabChange:l,onItemSelect:m,onSelectServer:g,selectedItem:p}),c.jsx(Ou,{tabs:r,current:a,onChange:v}),a&&c.jsx("div",{id:`panel-${a}`,role:"tabpanel","aria-labelledby":`tab-${a}`,children:w})]})})}const Ma=e=>{const t=e.asyncapi,n=A.useMemo(()=>Tr(t),[t]),r=e.kind;A.useEffect(()=>{r==="resolved"&&n!==t&&ea(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??zn;return c.jsx(nb,{asyncapi:n,config:s})};function La({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Tu("openapi",e,t);return c.jsx(Ws.Provider,{value:s,children:c.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[c.jsx("div",{ref:i,className:"openapi-portal-root"}),r]})})}function rb(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:st([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,o)=>{const i=`server-${o}`;t.push({id:i,targetId:i,type:"server",tab:"servers",key:i,name:s.description??s.url??i,path:`servers[${o}]`,location:`Servers > ${s.url??i}`,subtitle:s.url,text:st([s.url,s.description,s.variables])})});const n=(s,{tab:o,type:i,idPrefix:a,docKey:l,sectionLabel:u})=>{for(const f of Object.keys(s)){const d=s[f];if(d)for(const p of oa){const h=d[p];if(!h)continue;const m=`${p} ${f}`,g=h.summary??`${p.toUpperCase()} ${f}`;t.push({id:`${a}-${m}`,targetId:`${a}-${m}-detail`,type:i,tab:o,key:m,name:g,path:`${l}.${f}.${p}`,location:`${u} > ${p.toUpperCase()} ${f}`,subtitle:h.description,text:st([p,f,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Bu(t,o,s,s);return t}function sb(e,t={}){return Ku(e,rb,t)}function wd({info:e,tags:t,externalDocs:n}){const{title:r,description:s,license:o,contact:i}=e;return c.jsx($f,{title:r,description:s,license:o,contact:i,externalDocs:n,tags:t,extensionsSource:e})}function ob({url:e,description:t,variables:n}){return c.jsxs("div",{children:[c.jsx(dd,{address:e,variables:n}),t&&c.jsx(wt,{children:t})]})}const Ho=e=>`server-${e}`,qo=e=>Number(e.slice(7));function Sd({servers:e,selectedServer:t,onSelectServer:n}){const r=e.map((d,p)=>d.url||Ho(p)),[s,o]=A.useState(void 0),i=d=>!!d&&qo(d)>=0&&qo(d)<e.length,a=i(t)?t:i(s)?s:Ho(0),l=e[qo(a)],u=d=>{o(d),n==null||n(d)},f=l?c.jsx(ob,{...l}):null;return c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{title:ku,content:f,sideContent:c.jsx(ud,{serverNames:r,current:(l==null?void 0:l.url)||a,setCurrent:d=>{const p=r.indexOf(d);u(p>=0?Ho(p):d)}}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function jd(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[r,s]of Object.entries(e.properties)){const o=/id$/i.test(r)&&s.type==="string"&&!s.format&&!s.examples,i=s.type==="string"&&!s.format&&!s.examples&&!s.enum;n[r]=o?{...s,format:"uuid"}:i?{...s,examples:["string"]}:jd(s,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}async function ib(e){try{return await ad(jd(e),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const Ic="",Pc=`
129
- `;var pe=class{constructor({indent:e,join:t}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=Ic,this.lineJoin=Pc,this.indentLine=(n,r=0)=>`${this.indentationCharacter.repeat(r)}${n}`,this.unshift=(n,r)=>{const s=this.indentLine(n,r);this.code.unshift(s)},this.push=(n,r)=>{const s=this.indentLine(n,r);this.code.push(s)},this.pushToLast=n=>{this.code||this.push(n);const r=`${this.code[this.code.length-1]}${n}`;this.code[this.code.length-1]=r},this.blank=()=>{this.code.push("")},this.join=()=>{const n=this.code.join(this.lineJoin);return this.postProcessors.reduce((r,s)=>s(r),n)},this.addPostProcessor=n=>{this.postProcessors=[...this.postProcessors,n]},this.indentationCharacter=e||Ic,this.lineJoin=t??Pc}},ab=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},lb=function(e){var t=typeof e;return e!==null&&(t==="object"||t==="function")},Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t));const cb=ab,ub=lb,fb=Da.default;var db=(e,t,n)=>{const r=[];return(function s(o,i,a){i=i||{},i.indent=i.indent||" ",a=a||"";let l;i.inlineCharacterLimit===void 0?l={newLine:`
130
- `,newLineOrSpace:`
131
- `,pad:a,indent:a+i.indent}:l={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const u=f=>{if(i.inlineCharacterLimit===void 0)return f;const d=f.replace(new RegExp(l.newLine,"g"),"").replace(new RegExp(l.newLineOrSpace,"g")," ").replace(new RegExp(l.pad+"|"+l.indent,"g"),"");return d.length<=i.inlineCharacterLimit?d:f.replace(new RegExp(l.newLine+"|"+l.newLineOrSpace,"g"),`
132
- `).replace(new RegExp(l.pad,"g"),a).replace(new RegExp(l.indent,"g"),a+i.indent)};if(r.indexOf(o)!==-1)return'"[Circular]"';if(o==null||typeof o=="number"||typeof o=="boolean"||typeof o=="function"||typeof o=="symbol"||cb(o))return String(o);if(o instanceof Date)return`new Date('${o.toISOString()}')`;if(Array.isArray(o)){if(o.length===0)return"[]";r.push(o);const f="["+l.newLine+o.map((d,p)=>{const h=o.length-1===p?l.newLine:","+l.newLineOrSpace;let m=s(d,i,a+i.indent);return i.transform&&(m=i.transform(o,p,m)),l.indent+m+h}).join("")+l.pad+"]";return r.pop(),u(f)}if(ub(o)){let f=Object.keys(o).concat(fb(o));if(i.filter&&(f=f.filter(p=>i.filter(o,p))),f.length===0)return"{}";r.push(o);const d="{"+l.newLine+f.map((p,h)=>{const m=f.length-1===h?l.newLine:","+l.newLineOrSpace,g=typeof p=="symbol",v=!g&&/^[a-z$_][a-z$_0-9]*$/i.test(p),j=g||v?p:s(p,i);let y=s(o[p],i,a+i.indent);return i.transform&&(y=i.transform(o,p,y)),l.indent+String(j)+": "+y+m}).join("")+l.pad+"}";return r.pop(),u(d)}return o=String(o).replace(/[\r\n]/g,f=>f===`
133
- `?"\\n":"\\r"),i.singleQuotes===!1?(o=o.replace(/"/g,'\\"'),`"${o}"`):(o=o.replace(/\\?'/g,"\\'"),`'${o}'`)})(e,t,n)};const Ot=Zs(db),Ze=(e,t)=>Object.keys(e).find(n=>n.toLowerCase()===t.toLowerCase()),Rt=(e,t)=>{const n=Ze(e,t);if(n)return e[n]},Ls=(e,t)=>!!Ze(e,t),pb=e=>["application/json","application/x-json","text/json","text/x-json","+json"].some(t=>e.indexOf(t)>-1),hb={info:{key:"agent",title:"Agent",default:"prompt"},clientsById:{prompt:{info:{key:"prompt",title:"Agent Prompt",link:"https://github.com/readmeio/httpsnippet",description:"A copy-and-pastable prompt, for any AI agent, describing how to make the request.",extname:".txt"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const o={indent:" ",join:`
134
- `,...s},{blank:i,push:a,join:l}=new pe(o);a("Write code that makes the HTTP request described below. Use my preferred programming language and HTTP client library — if I haven't told you what those are, ask me before writing any code."),i(),a(`Method: ${e}`),a(`URL: ${t}`);const u=Object.keys(n);return u.length&&(i(),a("Headers:"),u.forEach(f=>{a(`${f}: ${n[f]}`,1)})),r.text&&(i(),a(`Body (${r.mimeType}):`),a(r.text)),i(),a("The request the code makes must match the method, URL, headers, and body exactly as described above."),o.markdownURL&&(i(),a(`Check ${o.markdownURL} for more info.`)),l()}}}};function Er(e,t={}){const{delimiter:n='"',escapeChar:r="\\",escapeNewlines:s=!0}=t;return[...e.toString()].map(o=>o==="\b"?`${r}b`:o===" "?`${r}t`:o===`
135
- `?s?`${r}n`:o:o==="\f"?`${r}f`:o==="\r"?s?`${r}r`:o:o===r?r+r:o===n?r+n:o<" "||o>"~"?JSON.stringify(o).slice(1,-1):o).join("")}const Un=e=>Er(e,{delimiter:"'"}),Ue=e=>Er(e,{delimiter:'"'}),mb={info:{key:"c",title:"C",default:"libcurl",cli:"c"},clientsById:{libcurl:{info:{key:"libcurl",title:"Libcurl",link:"http://curl.haxx.se/libcurl",description:"Simple REST and HTTP API Client for C",extname:".c"},convert:({method:e,fullUrl:t,headersObj:n,allHeaders:r,postData:s})=>{const{push:o,blank:i,join:a}=new pe;o("CURL *hnd = curl_easy_init();"),i(),o(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`),o("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"),o(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);const l=Object.keys(n);return l.length&&(i(),o("struct curl_slist *headers = NULL;"),l.forEach(u=>{o(`headers = curl_slist_append(headers, "${u}: ${Ue(n[u])}");`)}),o("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),r.cookie&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${r.cookie}");`)),s.text&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(s.text)});`)),i(),o("CURLcode ret = curl_easy_perform(hnd);"),a()}}}};var $c=class{constructor(e){this.name="",this.toString=()=>`:${this.name}`,this.name=e}},gb=class{constructor(e){this.path="",this.toString=()=>`(clojure.java.io/file "${this.path}")`,this.path=e}};const Ed=e=>e===void 0?null:e===null?"null":e.constructor.name.toLowerCase(),kd=e=>e===void 0?!0:Ed(e)==="object"?Object.keys(e).length===0:!1,Mc=e=>(Object.keys(e).filter(t=>kd(e[t])).forEach(t=>{delete e[t]}),e),xs=(e,t)=>{const n=" ".repeat(e);return t.replace(/\n/g,`
136
- ${n}`)},Di=e=>{switch(Ed(e)){case"string":return`"${e.replace(/"/g,'\\"')}"`;case"file":return e.toString();case"keyword":return e.toString();case"null":return"nil";case"regexp":return`#"${e.source}"`;case"object":{const t=Object.keys(e).reduce((n,r)=>`${n}:${r} ${xs(r.length+2,Di(e[r]))}
137
- `,"").trim();return`{${xs(1,t)}}`}case"array":{const t=e.reduce((n,r)=>`${n} ${Di(r)}`,"").trim();return`[${xs(1,t)}]`}default:return e.toString()}},yb={info:{key:"clojure",title:"Clojure",default:"clj_http"},clientsById:{clj_http:{info:{key:"clj_http",title:"clj-http",link:"https://github.com/dakrone/clj-http",description:"An idiomatic clojure http client wrapping the apache client.",extname:".clj"},convert:({queryObj:e,method:t,postData:n,url:r,allHeaders:s},o)=>{const{push:i,join:a}=new pe({indent:o==null?void 0:o.indent}),l=["get","post","put","delete","patch","head","options"];if(t=t.toLowerCase(),!l.includes(t))return i("Method not supported"),a();const u={headers:s,"query-params":e};switch(n.mimeType){case"application/json":{u["content-type"]=new $c("json"),u["form-params"]=n.jsonObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"application/x-www-form-urlencoded":{u["form-params"]=n.paramsObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"text/plain":{u.body=n.text;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"multipart/form-data":if(n.params){u.multipart=n.params.map(d=>d.fileName&&!d.value?{name:d.name,content:new gb(d.fileName)}:{name:d.name,content:d.value});const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break}switch(Rt(u.headers,"accept")){case"application/json":{u.accept=new $c("json");const f=Ze(u.headers,"accept");f&&delete u.headers[f]}break}if(i(`(require '[clj-http.client :as client])
138
- `),kd(Mc(u)))i(`(client/${t} "${r}")`);else{const f=11+t.length+r.length,d=xs(f,Di(Mc(u)));i(`(client/${t} "${r}" ${d})`)}return a()}}}},xb={info:{key:"crystal",title:"Crystal",default:"native"},clientsById:{native:{info:{key:"native",title:"http::client",link:"https://crystal-lang.org/api/master/HTTP/Client.html",description:"Crystal HTTP client",extname:".cr"},convert:({method:e,fullUrl:t,postData:n,allHeaders:r},s={})=>{const{insecureSkipVerify:o=!1}=s,{push:i,blank:a,join:l}=new pe;i('require "http/client"'),a(),i(`url = "${t}"`);const u=Object.keys(r);u.length&&(i("headers = HTTP::Headers{"),u.forEach(g=>{i(` "${g}" => "${Ue(r[g])}"`)}),i("}")),n.text&&i(`reqBody = ${JSON.stringify(n.text)}`),a();const f=e.toUpperCase(),d=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS"],p=u.length?", headers: headers":"",h=n.text?", body: reqBody":"",m=o?", tls: OpenSSL::SSL::Context::Client.insecure":"";return d.includes(f)?i(`response = HTTP::Client.${f.toLowerCase()} url${p}${h}${m}`):i(`response = HTTP::Client.exec "${f}", url${p}${h}${m}`),i("puts response.body"),l()}}}},bb=e=>{let t=Rt(e,"accept-encoding");if(!t)return[];const n={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},r=[];return typeof t=="string"&&(t=[t]),t.forEach(s=>{s.split(",").forEach(o=>{const i=/\s*([^;\s]+)/.exec(o);if(i){const a=n[i[1]];a&&r.push(a)}})}),r},vb={info:{key:"httpclient",title:"HttpClient",link:"https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",description:".NET Standard HTTP Client",extname:".cs"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var p,h;const{push:o,join:i}=new pe({indent:{indent:" ",...s}.indent});o("using System.Net.Http.Headers;");let a="";const l=!!e.cookie,u=bb(e);(l||u.length)&&(a="clientHandler",o("var clientHandler = new HttpClientHandler"),o("{"),l&&o("UseCookies = false,",1),u.length&&o(`AutomaticDecompression = ${u.join(" | ")},`,1),o("};")),o(`var client = new HttpClient(${a});`),o("var request = new HttpRequestMessage"),o("{");const f=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"];n=n.toUpperCase(),n&&f.includes(n)?n=`HttpMethod.${n[0]}${n.substring(1).toLowerCase()}`:n=`new HttpMethod("${n}")`,o(`Method = ${n},`,1),o(`RequestUri = new Uri("${r}"),`,1);const d=Object.keys(e).filter(m=>{switch(m.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(d.length&&(o("Headers =",1),o("{",1),d.forEach(m=>{o(`{ "${m}", "${Ue(e[m])}" },`,2)}),o("},",1)),t.text){const m=t.mimeType;switch(m){case"application/x-www-form-urlencoded":o("Content = new FormUrlEncodedContent(new Dictionary<string, string>",1),o("{",1),(p=t.params)==null||p.forEach(g=>{o(`{ "${g.name}", "${g.value}" },`,2)}),o("}),",1);break;case"multipart/form-data":o("Content = new MultipartFormDataContent",1),o("{",1),(h=t.params)==null||h.forEach(g=>{o(`new StringContent(${JSON.stringify(g.value||"")})`,2),o("{",2),o("Headers =",3),o("{",3),g.contentType&&o(`ContentType = new MediaTypeHeaderValue("${g.contentType}"),`,4),o('ContentDisposition = new ContentDispositionHeaderValue("form-data")',4),o("{",4),o(`Name = "${g.name}",`,5),g.fileName&&o(`FileName = "${g.fileName}",`,5),o("}",4),o("}",3),o("},",2)}),o("},",1);break;default:o(`Content = new StringContent(${JSON.stringify(t.text||"")})`,1),o("{",1),o("Headers =",2),o("{",2),o(`ContentType = new MediaTypeHeaderValue("${m}")`,3),o("}",2),o("}",1);break}}return o("};"),o("using (var response = await client.SendAsync(request))"),o("{"),o("response.EnsureSuccessStatusCode();",1),o("var body = await response.Content.ReadAsStringAsync();",1),o("Console.WriteLine(body);",1),o("}"),i()}};function wb(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}const Sb={info:{key:"csharp",title:"C#",default:"restsharp",cli:"dotnet"},clientsById:{httpclient:vb,restsharp:{info:{key:"restsharp",title:"RestSharp",link:"http://restsharp.org/",description:"Simple REST and HTTP API Client for .NET",extname:".cs",installation:()=>"dotnet add package RestSharp"},convert:({method:e,fullUrl:t,headersObj:n,cookies:r,postData:s,uriObj:o})=>{const{push:i,join:a}=new pe;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase()))return"Method not supported";i(`using RestSharp;
139
-
140
- `),i(`var options = new RestClientOptions("${t}");`),i("var client = new RestClient(options);"),i('var request = new RestRequest("");');const l=s.mimeType&&s.mimeType==="multipart/form-data";switch(l&&i("request.AlwaysMultipartFormData = true;"),Object.keys(n).forEach(u=>{if(s.mimeType&&u.toLowerCase()==="content-type"&&s.text){l&&s.boundary&&i(`request.FormBoundary = "${s.boundary}";`);return}i(`request.AddHeader("${u}", "${Ue(n[u])}");`)}),r.forEach(({name:u,value:f})=>{i(`request.AddCookie("${u}", "${Ue(f)}", "${o.pathname}", "${o.host}");`)}),s.mimeType){case"multipart/form-data":if(!s.params)break;s.params.forEach(u=>{u.fileName?i(`request.AddFile("${u.name}", "${u.fileName}");`):i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/x-www-form-urlencoded":if(!s.params)break;s.params.forEach(u=>{i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/json":if(!s.text)break;i(`request.AddJsonBody(${JSON.stringify(s.text)}, false);`);break;default:if(!s.text)break;i(`request.AddStringBody("${s.text}", "${s.mimeType}");`)}return i(`var response = await client.${wb(e)}Async(request);
141
- `),i(`Console.WriteLine("{0}", response.Content);
142
- `),a()}}}},jb={info:{key:"go",title:"Go",default:"native",cli:"go"},clientsById:{native:{info:{key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request",extname:".go"},convert:({postData:e,method:t,allHeaders:n,fullUrl:r},s={})=>{const{blank:o,push:i,join:a}=new pe({indent:" "}),{showBoilerplate:l=!0,checkErrors:u=!1,printBody:f=!0,timeout:d=-1,insecureSkipVerify:p=!1}=s,h=u?"err":"_",m=l?1:0,g=()=>{u&&(i("if err != nil {",m),i("panic(err)",m+1),i("}",m))};l&&(i("package main"),o(),i("import ("),i('"fmt"',m),d>0&&i('"time"',m),p&&i('"crypto/tls"',m),e.text&&i('"strings"',m),i('"net/http"',m),f&&i('"io"',m),i(")"),o(),i("func main() {"),o()),p&&(i("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()",m),i("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}",m));const v=d>0,j=v||p,y=j?"client":"http.DefaultClient";return j&&(i("client := http.Client{",m),v&&i(`Timeout: time.Duration(${d} * time.Second),`,m+1),p&&i("Transport: insecureTransport,",m+1),i("}",m),o()),i(`url := "${r}"`,m),o(),e.text?(i(`payload := strings.NewReader(${JSON.stringify(e.text)})`,m),o(),i(`req, ${h} := http.NewRequest("${t}", url, payload)`,m),o()):(i(`req, ${h} := http.NewRequest("${t}", url, nil)`,m),o()),g(),Object.keys(n).length&&(Object.keys(n).forEach(x=>{i(`req.Header.Add("${x}", "${Ue(n[x])}")`,m)}),o()),i(`res, ${h} := ${y}.Do(req)`,m),g(),f&&(o(),i("defer res.Body.Close()",m),i(`body, ${h} := io.ReadAll(res.Body)`,m),g()),o(),f&&i("fmt.Println(string(body))",m),l&&(o(),i("}")),a()}}}},Lc=`\r
143
- `,Eb={info:{key:"http",title:"HTTP",default:"http1.1"},clientsById:{"http1.1":{info:{key:"http1.1",title:"HTTP/1.1",link:"https://tools.ietf.org/html/rfc7230",description:"HTTP/1.1 request string in accordance with RFC 7230",extname:null},convert:({method:e,fullUrl:t,uriObj:n,httpVersion:r,allHeaders:s,postData:o},i)=>{const a={absoluteURI:!1,autoContentLength:!0,autoHost:!0,...i},{blank:l,push:u,join:f}=new pe({indent:"",join:Lc});u(`${e} ${a.absoluteURI?t:n.path} ${r}`);const d=Object.keys(s);d.forEach(m=>{const g=m.toLowerCase().replace(/(^|-)(\w)/g,v=>v.toUpperCase());u(`${g}: ${s[m]}`)}),a.autoHost&&!d.includes("host")&&u(`Host: ${n.host}`),a.autoContentLength&&o.text&&!d.includes("content-length")&&u(`Content-Length: ${Buffer.byteLength(o.text,"ascii").toString()}`),l();const p=f(),h=o.text||"";return`${p}${Lc}${h}`}}}},kb={info:{key:"java",title:"Java",default:"unirest"},clientsById:{asynchttp:{info:{key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpClient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{blank:o,push:i,join:a}=new pe({indent:{indent:" ",...s}.indent});return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"),i(`client.prepare("${e.toUpperCase()}", "${r}")`),Object.keys(t).forEach(l=>{i(`.setHeader("${l}", "${Ue(t[l])}")`,1)}),n.text&&i(`.setBody(${JSON.stringify(n.text)})`,1),i(".execute()",1),i(".toCompletableFuture()",1),i(".thenAccept(System.out::println)",1),i(".join();",1),o(),i("client.close();"),a()}},nethttp:{info:{key:"nethttp",title:"java.net.http",link:"https://openjdk.java.net/groups/net/httpclient/intro.html",description:"Java Standardized HTTP Client API",extname:".java"},convert:({allHeaders:e,fullUrl:t,method:n,postData:r},s)=>{const{push:o,join:i}=new pe({indent:{indent:" ",...s}.indent});return o("HttpRequest request = HttpRequest.newBuilder()"),o(`.uri(URI.create("${t}"))`,2),Object.keys(e).forEach(a=>{o(`.header("${a}", "${Ue(e[a])}")`,2)}),r.text?o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`,2):o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`,2),o(".build();",2),o("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"),o("System.out.println(response.body());"),i()}},okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".java"},convert:({postData:e,method:t,fullUrl:n,allHeaders:r},s)=>{const{push:o,blank:i,join:a}=new pe({indent:{indent:" ",...s}.indent}),l=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return o("OkHttpClient client = new OkHttpClient();"),i(),e.text&&(e.boundary?o(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`):o(`MediaType mediaType = MediaType.parse("${e.mimeType}");`),o(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)),o("Request request = new Request.Builder()"),o(`.url("${n}")`,1),l.includes(t.toUpperCase())?u.includes(t.toUpperCase())?e.text?o(`.${t.toLowerCase()}(body)`,1):o(`.${t.toLowerCase()}(null)`,1):o(`.${t.toLowerCase()}()`,1):e.text?o(`.method("${t.toUpperCase()}", body)`,1):o(`.method("${t.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{o(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),o(".build();",1),i(),o("Response response = client.newCall(request).execute();"),a()}},unirest:{info:{key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{join:o,push:i}=new pe({indent:{indent:" ",...s}.indent});return["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase())?i(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${r}")`):i(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${r}")`),Object.keys(t).forEach(a=>{i(`.header("${a}", "${Ue(t[a])}")`,1)}),n.text&&i(`.body(${JSON.stringify(n.text)})`,1),i(".asString();",1),o()}}}},Ab={info:{key:"javascript",title:"JavaScript",default:"fetch"},clientsById:{xhr:{info:{key:"xhr",title:"XMLHttpRequest",link:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",description:"W3C Standard API that provides scripted client functionality",extname:".js"},convert:({postData:e,allHeaders:t,method:n,fullUrl:r},s)=>{var u;const o={indent:" ",cors:!0,...s},{blank:i,push:a,join:l}=new pe({indent:o.indent});switch(e.mimeType){case"application/json":a(`const data = JSON.stringify(${Ot(e.jsonObj,{indent:o.indent})});`),i();break;case"multipart/form-data":if(!e.params)break;if(a("const data = new FormData();"),e.params.forEach(f=>{a(`data.append('${f.name}', '${f.value||f.fileName||""}');`)}),Ls(t,"content-type")&&(u=Rt(t,"content-type"))!=null&&u.includes("boundary")){const f=Ze(t,"content-type");f&&delete t[f]}i();break;default:a(`const data = ${e.text?`'${e.text}'`:"null"};`),i()}return a("const xhr = new XMLHttpRequest();"),o.cors&&a("xhr.withCredentials = true;"),i(),a("xhr.addEventListener('readystatechange', function () {"),a("if (this.readyState === this.DONE) {",1),a("console.log(this.responseText);",2),a("}",1),a("});"),i(),a(`xhr.open('${n}', '${r}');`),Object.keys(t).forEach(f=>{a(`xhr.setRequestHeader('${f}', '${Un(t[f])}');`)}),i(),a("xhr.send(data);"),l()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({allHeaders:e,method:t,url:n,queryObj:r,postData:s},o)=>{const{blank:i,push:a,join:l,addPostProcessor:u}=new pe({indent:{indent:" ",...o}.indent});a("import axios from 'axios';"),i();const f={method:t,url:n};switch(Object.keys(r).length&&(f.params=r),Object.keys(e).length&&(f.headers=e),s.mimeType){case"application/x-www-form-urlencoded":s.params&&(a("const encodedParams = new URLSearchParams();"),s.params.forEach(d=>{a(`encodedParams.set('${d.name}', '${d.value}');`)}),i(),f.data="encodedParams,",u(d=>d.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":s.jsonObj&&(f.data=s.jsonObj);break;case"multipart/form-data":if(!s.params)break;a("const form = new FormData();"),s.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i(),f.data="[form]";break;default:s.text&&(f.data=s.text)}return a(`const options = ${Ot(f,{indent:" ",inlineCharacterLimit:80}).replace('"[form]"',"form")};`),i(),a("try {"),a("const { data } = await axios.request(options);",1),a("console.log(data);",1),a("} catch (error) {"),a("console.error(error);",1),a("}"),l()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const o={indent:" ",credentials:null,...s},{blank:i,join:a,push:l}=new pe({indent:o.indent}),u={method:e};switch(Object.keys(t).length&&(u.headers=t),o.credentials!==null&&(u.credentials=o.credentials),n.mimeType){case"application/x-www-form-urlencoded":u.body=n.paramsObj?n.paramsObj:n.text;break;case"application/json":n.jsonObj&&(u.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const f=Ze(t,"content-type");f&&delete t[f],l("const form = new FormData();"),n.params.forEach(d=>{l(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i();break}default:n.text&&(u.body=n.text)}return u.headers&&!Object.keys(u.headers).length&&delete u.headers,l(`const options = ${Ot(u,{indent:o.indent,inlineCharacterLimit:80,transform:(f,d,p)=>{if(d==="body"){if(n.mimeType==="application/x-www-form-urlencoded")return`new URLSearchParams(${p})`;if(n.mimeType==="application/json")return`JSON.stringify(${p})`}return p}})};`),i(),n.params&&n.mimeType==="multipart/form-data"&&(l("options.body = form;"),i()),l(`fetch('${r}', options)`),l(".then(res => res.json())",1),l(".then(res => console.log(res))",1),l(".catch(err => console.error(err));",1),a()}},jquery:{info:{key:"jquery",title:"jQuery",link:"http://api.jquery.com/jquery.ajax/",description:"Perform an asynchronous HTTP (Ajax) requests with jQuery",extname:".js"},convert:({fullUrl:e,method:t,allHeaders:n,postData:r},s)=>{var f;const o={indent:" ",...s},{blank:i,push:a,join:l}=new pe({indent:o.indent}),u={async:!0,crossDomain:!0,url:e,method:t,headers:n};switch(r.mimeType){case"application/x-www-form-urlencoded":u.data=r.paramsObj?r.paramsObj:r.text;break;case"application/json":u.processData=!1,u.data=r.text;break;case"multipart/form-data":if(!r.params)break;if(a("const form = new FormData();"),r.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),u.processData=!1,u.contentType=!1,u.mimeType="multipart/form-data",u.data="[form]",Ls(n,"content-type")&&(f=Rt(n,"content-type"))!=null&&f.includes("boundary")){const d=Ze(n,"content-type");d&&delete u.headers[d]}i();break;default:r.text&&(u.data=r.text)}return a(`const settings = ${Ot(u,{indent:o.indent}).replace("'[form]'","form")};`),i(),a("$.ajax(settings).done(res => {"),a("console.log(res);",1),a("});"),l()}}}},Tb={info:{key:"json",title:"JSON",default:"native"},clientsById:{native:{info:{key:"native",title:"Native JSON",link:"https://www.json.org/json-en.html",description:"A JSON represetation of any HAR payload.",extname:".json"},convert:({postData:e},t)=>{const n={indent:" ",...t};let r="";switch(e.mimeType){case"application/x-www-form-urlencoded":r=e.paramsObj?e.paramsObj:e.text;break;case"application/json":e.jsonObj&&(r=e.jsonObj);break;case"multipart/form-data":{if(!e.params)break;const s={};e.params.forEach(o=>{s[o.name]=o.value}),r=s;break}default:e.text&&(r=e.text)}return typeof r>"u"||r===""?"No JSON body":JSON.stringify(r,null,n.indent)}}}},Ob={info:{key:"kotlin",title:"Kotlin",default:"okhttp"},clientsById:{okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".kt"},convert:({postData:e,fullUrl:t,method:n,allHeaders:r},s)=>{const{blank:o,join:i,push:a}=new pe({indent:{indent:" ",...s}.indent}),l=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return a("val client = OkHttpClient()"),o(),e.text&&(e.boundary?a(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`):a(`val mediaType = MediaType.parse("${e.mimeType}")`),a(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)),a("val request = Request.Builder()"),a(`.url("${t}")`,1),l.includes(n.toUpperCase())?u.includes(n.toUpperCase())?e.text?a(`.${n.toLowerCase()}(body)`,1):a(`.${n.toLowerCase()}(null)`,1):a(`.${n.toLowerCase()}()`,1):e.text?a(`.method("${n.toUpperCase()}", body)`,1):a(`.method("${n.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{a(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),a(".build()",1),o(),a("val response = client.newCall(request).execute()"),i()}}}},Nb={info:{key:"node",title:"Node.js",default:"fetch",cli:"node %s"},clientsById:{native:{info:{key:"native",title:"HTTP",link:"http://nodejs.org/api/http.html#http_http_request_options_callback",description:"Node.js native HTTP interface",extname:".cjs"},convert:({uriObj:e,method:t,allHeaders:n,postData:r},s={})=>{var d;const{indent:o=" "}=s,{blank:i,join:a,push:l,unshift:u}=new pe({indent:o}),f={method:t,hostname:e.hostname,port:e.port,path:e.path,headers:n};switch(l(`const http = require('${(d=e.protocol)==null?void 0:d.replace(":","")}');`),i(),l(`const options = ${Ot(f,{indent:o})};`),i(),l("const req = http.request(options, function (res) {"),l("const chunks = [];",1),i(),l("res.on('data', function (chunk) {",1),l("chunks.push(chunk);",2),l("});",1),i(),l("res.on('end', function () {",1),l("const body = Buffer.concat(chunks);",2),l("console.log(body.toString());",2),l("});",1),l("});"),i(),r.mimeType){case"application/x-www-form-urlencoded":r.paramsObj&&(u("const qs = require('querystring');"),l(`req.write(qs.stringify(${Ot(r.paramsObj,{indent:" ",inlineCharacterLimit:80})}));`));break;case"application/json":r.jsonObj&&l(`req.write(JSON.stringify(${Ot(r.jsonObj,{indent:" ",inlineCharacterLimit:80})}));`);break;default:r.text&&l(`req.write(${Ot(r.text,{indent:o})});`)}return l("req.end();"),a()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const{blank:o,join:i,push:a,addPostProcessor:l}=new pe({indent:{indent:" ",...s}.indent});a("import axios from 'axios';"),o();const u={method:e,url:t};switch(Object.keys(n).length&&(u.headers=n),r.mimeType){case"application/x-www-form-urlencoded":r.params&&(a("const encodedParams = new URLSearchParams();"),r.params.forEach(f=>{a(`encodedParams.set('${f.name}', '${f.value}');`)}),o(),u.data="encodedParams,",l(f=>f.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":r.jsonObj&&(u.data=r.jsonObj);break;default:r.text&&(u.data=r.text)}return a(`const options = ${Ot(u,{indent:" ",inlineCharacterLimit:80})};`),o(),a("axios"),a(".request(options)",1),a(".then(res => console.log(res.data))",1),a(".catch(err => console.error(err));",1),i()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://nodejs.org/docs/latest/api/globals.html#fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,fullUrl:t,postData:n,headersObj:r,cookies:s},o)=>{var m;const i={indent:" ",...o};let a=!1;const{blank:l,push:u,join:f,unshift:d}=new pe({indent:i.indent}),p=t,h={method:e};switch(Object.keys(r).length&&(h.headers=r),n.mimeType){case"application/x-www-form-urlencoded":u("const encodedParams = new URLSearchParams();"),(m=n.params)==null||m.forEach(g=>{u(`encodedParams.set('${g.name}', '${g.value}');`)}),h.body="encodedParams",l();break;case"application/json":n.jsonObj&&(h.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const g=Ze(r,"content-type");g&&delete r[g],u("const formData = new FormData();"),n.params.forEach(v=>{if(!v.fileName&&!v.contentType){u(`formData.append('${v.name}', '${v.value}');`);return}v.fileName&&(a=!0,u(`formData.append('${v.name}', await new Response(fs.createReadStream('${v.fileName}')).blob());`))}),h.body="formData",l();break}default:n.text&&(h.body=n.text)}if(s.length){const g=s.map(({name:v,value:j})=>`${encodeURIComponent(v)}=${encodeURIComponent(j)}`).join("; ");h.headers||(h.headers={}),h.headers.cookie=g}return u(`const url = '${p}';`),h.headers&&!Object.keys(h.headers).length&&delete h.headers,u(`const options = ${Ot(h,{indent:" ",inlineCharacterLimit:80,transform:(g,v,j)=>v==="body"&&n.mimeType==="application/json"?`JSON.stringify(${j})`:j})};`),l(),a&&d(`import fs from 'fs';
144
- `),u("fetch(url, options)"),u(".then(res => res.json())",1),u(".then(json => console.log(json))",1),u(".catch(err => console.error(err));",1),f().replace(/'encodedParams'/,"encodedParams").replace(/'formData'/,"formData")}}}},zo=(e,t,n,r)=>{const s=`${e} *${t} = `;return`${s}${Bi(n,r?s.length:void 0)};`},Bi=(e,t)=>{const n=t===void 0?", ":`,
145
- ${" ".repeat(t)}`;switch(Object.prototype.toString.call(e)){case"[object Number]":return`@${e}`;case"[object Array]":return`@[ ${e.map(r=>Bi(r)).join(n)} ]`;case"[object Object]":{const r=[];return Object.keys(e).forEach(s=>{r.push(`@"${s}": ${Bi(e[s])}`)}),`@{ ${r.join(n)} }`}case"[object Boolean]":return e?"@YES":"@NO";default:return e==null?"":`@"${e.toString().replace(/"/g,'\\"')}"`}},Cb={info:{key:"objc",title:"Objective-C",default:"nsurlsession"},clientsById:{nsurlsession:{info:{key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request",extname:".m"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var f;const o={indent:" ",pretty:!0,timeout:10,...s},{push:i,join:a,blank:l}=new pe({indent:o.indent}),u={hasHeaders:!1,hasBody:!1};if(i("#import <Foundation/Foundation.h>"),Object.keys(e).length&&(u.hasHeaders=!0,l(),i(zo("NSDictionary","headers",e,o.pretty))),t.text||t.jsonObj||t.params)switch(u.hasBody=!0,t.mimeType){case"application/x-www-form-urlencoded":if((f=t.params)!=null&&f.length){l();const[d,...p]=t.params;i(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${d.name}=${d.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),p.forEach(({name:h,value:m})=>{i(`[postData appendData:[@"&${h}=${m}" dataUsingEncoding:NSUTF8StringEncoding]];`)})}else u.hasBody=!1;break;case"application/json":t.jsonObj&&(i(zo("NSDictionary","parameters",t.jsonObj,o.pretty)),l(),i("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));break;case"multipart/form-data":i(zo("NSArray","parameters",t.params||[],o.pretty)),i(`NSString *boundary = @"${t.boundary}";`),l(),i("NSError *error;"),i("NSMutableString *body = [NSMutableString string];"),i("for (NSDictionary *param in parameters) {"),i('[body appendFormat:@"--%@\\r\\n", boundary];',1),i('if (param[@"fileName"]) {',1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',2),i('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];',2),i('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',2),i("if (error) {",2),i('NSLog(@"%@", error);',3),i("}",2),i("} else {",1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];',2),i('[body appendFormat:@"%@", param[@"value"]];',2),i("}",1),i("}"),i('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'),i("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:l(),i(`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`)}return l(),i(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${r}"]`),i(" cachePolicy:NSURLRequestUseProtocolCachePolicy"),i(` timeoutInterval:${o.timeout.toFixed(1)}];`),i(`[request setHTTPMethod:@"${n}"];`),u.hasHeaders&&i("[request setAllHTTPHeaderFields:headers];"),u.hasBody&&i("[request setHTTPBody:postData];"),l(),i("NSURLSession *session = [NSURLSession sharedSession];"),i("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"),i(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"),i(" if (error) {",1),i(' NSLog(@"%@", error);',2),i(" } else {",1),i(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",2),i(' NSLog(@"%@", httpResponse);',2),i(" }",1),i(" }];"),i("[dataTask resume];"),a()}}}},_b={info:{key:"ocaml",title:"OCaml",default:"cohttp"},clientsById:{cohttp:{info:{key:"cohttp",title:"CoHTTP",link:"https://github.com/mirage/ocaml-cohttp",description:"Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",extname:".ml",installation:()=>"opam install cohttp-lwt-unix cohttp-async"},convert:({fullUrl:e,allHeaders:t,postData:n,method:r},s)=>{const o={indent:" ",...s},i=["get","post","head","delete","patch","put","options"],{push:a,blank:l,join:u}=new pe({indent:o.indent});a("open Cohttp_lwt_unix"),a("open Cohttp"),a("open Lwt"),l(),a(`let uri = Uri.of_string "${e}" in`);const f=Object.keys(t);return f.length===1?a(`let headers = Header.add (Header.init ()) "${f[0]}" "${Ue(t[f[0]])}" in`):f.length>1&&(a("let headers = Header.add_list (Header.init ()) ["),f.forEach(d=>{a(`("${d}", "${Ue(t[d])}");`,1)}),a("] in")),n.text&&a(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`),l(),a(`Client.call ${f.length?"~headers ":""}${n.text?"~body ":""}${i.includes(r.toLowerCase())?`\`${r.toUpperCase()}`:`(Code.method_of_string "${r}")`} uri`),a(">>= fun (res, body_stream) ->"),a("(* Do stuff with the result *)",1),u()}}}},Ae=(e,t,n)=>{switch(n=n||"",t=t||"",Object.prototype.toString.call(e)){case"[object Boolean]":return e;case"[object Null]":return"null";case"[object Undefined]":return"null";case"[object String]":return`'${Er(e,{delimiter:"'",escapeNewlines:!1})}'`;case"[object Number]":return e.toString();case"[object Array]":{const r=e.map(s=>Ae(s,`${t}${t}`,t)).join(`,
146
- ${t}`);return`[
147
- ${t}${r}
148
- ${n}]`}case"[object Object]":{const r=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.push(`${Ae(s,t)} => ${Ae(e[s],`${t}${t}`,t)}`);return`[
149
- ${t}${r.join(`,
150
- ${t}`)}
151
- ${n}]`}default:return"null"}},Dc=["ACL","BASELINE_CONTROL","CHECKIN","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LABEL","LOCK","MERGE","MKACTIVITY","MKCOL","MKWORKSPACE","MOVE","OPTIONS","POST","PROPFIND","PROPPATCH","PUT","REPORT","TRACE","UNCHECKOUT","UNLOCK","UPDATE","VERSION_CONTROL"],Rb={info:{key:"php",title:"PHP",default:"curl",cli:"php %s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://php.net/manual/en/book.curl.php",description:"PHP with ext-curl",extname:".php"},convert:({uriObj:e,postData:t,fullUrl:n,method:r,httpVersion:s,cookies:o,headersObj:i},a={})=>{const{closingTag:l=!1,indent:u=" ",maxRedirects:f=10,namedErrors:d=!1,noTags:p=!1,shortTags:h=!1,timeout:m=30}=a,{push:g,blank:v,join:j}=new pe({indent:u});p||(g(h?"<?":"<?php"),v()),g("$curl = curl_init();"),v();const y=[{escape:!0,name:"CURLOPT_PORT",value:e.port},{escape:!0,name:"CURLOPT_URL",value:n},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:f},{escape:!1,name:"CURLOPT_TIMEOUT",value:m},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:s==="HTTP/1.0"?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:r},{escape:!t.jsonObj,name:"CURLOPT_POSTFIELDS",value:t?t.jsonObj?`json_encode(${Ae(t.jsonObj,u.repeat(2),u)})`:t.text:void 0}];g("curl_setopt_array($curl, [");const x=new pe({indent:u,join:`
152
- ${u}`});y.forEach(({value:S,name:k,escape:C})=>{S!=null&&x.push(`${k} => ${C?JSON.stringify(S):S},`)});const w=o.map(S=>`${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);w.length&&x.push(`CURLOPT_COOKIE => "${w.join("; ")}",`);const E=Object.keys(i).sort().map(S=>`"${S}: ${Ue(i[S])}"`);return E.length&&(x.push("CURLOPT_HTTPHEADER => ["),x.push(E.join(`,
153
- ${u}${u}`),1),x.push("],")),g(x.join(),1),g("]);"),v(),g("$response = curl_exec($curl);"),g("$err = curl_error($curl);"),v(),g("curl_close($curl);"),v(),g("if ($err) {"),g(d?'echo array_flip(get_defined_constants(true)["curl"])[$err];':'echo "cURL Error #:" . $err;',1),g("} else {"),g("echo $response;",1),g("}"),!p&&l&&(v(),g("?>")),j()}},guzzle:{info:{key:"guzzle",title:"Guzzle",link:"http://docs.guzzlephp.org/en/stable/",description:"PHP with Guzzle",extname:".php",installation:()=>"composer require guzzlehttp/guzzle"},convert:({postData:e,fullUrl:t,method:n,cookies:r,headersObj:s},o)=>{var g;const i={closingTag:!1,indent:" ",noTags:!1,shortTags:!1,...o},{push:a,blank:l,join:u}=new pe({indent:i.indent}),{code:f,push:d,join:p}=new pe({indent:i.indent});switch(i.noTags||a(i.shortTags?"<?":"<?php"),a("require_once('vendor/autoload.php');"),l(),e.mimeType){case"application/x-www-form-urlencoded":d(`'form_params' => ${Ae(e.paramsObj,i.indent+i.indent,i.indent)},`,1);break;case"multipart/form-data":{const v=[];if(e.params&&e.params.forEach(j=>{if(j.fileName){const y={name:j.name,filename:j.fileName,contents:j.value};j.contentType&&(y.headers={"Content-Type":j.contentType}),v.push(y)}else j.value&&v.push({name:j.name,contents:j.value})}),v.length&&(d(`'multipart' => ${Ae(v,i.indent+i.indent,i.indent)}`,1),Ls(s,"content-type")&&(g=Rt(s,"content-type"))!=null&&g.indexOf("boundary"))){const j=Ze(s,"content-type");j&&delete s[j]}break}default:e.text&&d(`'body' => ${Ae(e.text)},`,1)}const h=Object.keys(s).sort().map(v=>`${i.indent}${i.indent}'${v}' => '${Un(s[v])}',`),m=r.map(v=>`${encodeURIComponent(v.name)}=${encodeURIComponent(v.value)}`).join("; ");return m.length&&h.push(`${i.indent}${i.indent}'cookie' => '${Un(m)}',`),h.length&&(d("'headers' => [",1),d(h.join(`
154
- `)),d("],",1)),a("$client = new \\GuzzleHttp\\Client();"),l(),f.length?(a(`$response = $client->request('${n}', '${t}', [`),a(p()),a("]);")):a(`$response = $client->request('${n}', '${t}');`),l(),a("echo $response->getBody();"),!i.noTags&&i.closingTag&&(l(),a("?>")),u()}},http1:{info:{key:"http1",title:"HTTP v1",link:"http://php.net/manual/en/book.http.php",description:"PHP with pecl/http v1",extname:".php"},convert:({method:e,url:t,postData:n,queryObj:r,headersObj:s,cookiesObj:o},i={})=>{const{closingTag:a=!1,indent:l=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new pe({indent:l});switch(u||(d(f?"<?":"<?php"),p()),Dc.includes(e.toUpperCase())||d(`HttpRequest::methodRegister('${e}');`),d("$request = new HttpRequest();"),d(`$request->setUrl(${Ae(t)});`),Dc.includes(e.toUpperCase())?d(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`):d(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`),p(),Object.keys(r).length&&(d(`$request->setQueryData(${Ae(r,l)});`),p()),Object.keys(s).length&&(d(`$request->setHeaders(${Ae(s,l)});`),p()),Object.keys(o).length&&(d(`$request->setCookies(${Ae(o,l)});`),p()),n.mimeType){case"application/x-www-form-urlencoded":d(`$request->setContentType(${Ae(n.mimeType)});`),d(`$request->setPostFields(${Ae(n.paramsObj,l)});`),p();break;case"application/json":d(`$request->setContentType(${Ae(n.mimeType)});`),d(`$request->setBody(json_encode(${Ae(n.jsonObj,l)}));`),p();break;default:n.text&&(d(`$request->setBody(${Ae(n.text)});`),p())}return d("try {"),d("$response = $request->send();",1),p(),d("echo $response->getBody();",1),d("} catch (HttpException $ex) {"),d("echo $ex;",1),d("}"),!u&&a&&(p(),d("?>")),h()}},http2:{info:{key:"http2",title:"HTTP v2",link:"http://devel-m6w6.rhcloud.com/mdref/http",description:"PHP with pecl/http v2",extname:".php"},convert:({postData:e,headersObj:t,method:n,queryObj:r,cookiesObj:s,url:o},i={})=>{var g;const{closingTag:a=!1,indent:l=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new pe({indent:l});let m=!1;switch(u||(d(f?"<?":"<?php"),p()),d("$client = new http\\Client;"),d("$request = new http\\Client\\Request;"),p(),e.mimeType){case"application/x-www-form-urlencoded":d("$body = new http\\Message\\Body;"),d(`$body->append(new http\\QueryString(${Ae(e.paramsObj,l)}));`),p(),m=!0;break;case"multipart/form-data":{if(!e.params)break;const v=[],j={};e.params.forEach(({name:w,fileName:E,value:S,contentType:k})=>{if(E){v.push({name:w,type:k,file:E,data:S});return}S&&(j[w]=S)});const y=Object.keys(j).length?Ae(j,l):"null",x=v.length?Ae(v,l):"null";if(d("$body = new http\\Message\\Body;"),d(`$body->addForm(${y}, ${x});`),Ls(t,"content-type")&&(g=Rt(t,"content-type"))!=null&&g.indexOf("boundary")){const w=Ze(t,"content-type");w&&delete t[w]}p(),m=!0;break}case"application/json":d("$body = new http\\Message\\Body;"),d(`$body->append(json_encode(${Ae(e.jsonObj,l)}));`),m=!0;break;default:e.text&&(d("$body = new http\\Message\\Body;"),d(`$body->append(${Ae(e.text)});`),p(),m=!0)}return d(`$request->setRequestUrl(${Ae(o)});`),d(`$request->setRequestMethod(${Ae(n)});`),m&&(d("$request->setBody($body);"),p()),Object.keys(r).length&&(d(`$request->setQuery(new http\\QueryString(${Ae(r,l)}));`),p()),Object.keys(t).length&&(d(`$request->setHeaders(${Ae(t,l)});`),p()),Object.keys(s).length&&(p(),d(`$client->setCookies(${Ae(s,l)});`),p()),d("$client->enqueue($request)->send();"),d("$response = $client->getResponse();"),p(),d("echo $response->getBody();"),!u&&a&&(p(),d("?>")),h()}}}},Ad=e=>({method:n,headersObj:r,cookies:s,uriObj:o,fullUrl:i,postData:a,allHeaders:l})=>{const{push:u,join:f}=new pe;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(n.toUpperCase()))return"Method not supported";const d=[],p=Object.keys(r);return p.length&&(u("$headers=@{}"),p.forEach(h=>{h!=="connection"&&u(`$headers.Add("${h}", "${Er(r[h],{escapeChar:"`"})}")`)}),d.push("-Headers $headers")),s.length&&(u("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),s.forEach(h=>{u("$cookie = New-Object System.Net.Cookie"),u(`$cookie.Name = '${h.name}'`),u(`$cookie.Value = '${h.value}'`),u(`$cookie.Domain = '${o.host}'`),u("$session.Cookies.Add($cookie)")}),d.push("-WebSession $session")),a.text&&(d.push(`-ContentType '${Er(Rt(l,"content-type"),{delimiter:"'",escapeChar:"`"})}'`),d.push(`-Body '${a.text}'`)),u(`$response = ${e} -Uri '${i}' -Method ${n} ${d.join(" ")}`.trim()),f()},Ib={info:{key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client",extname:".ps1"},convert:Ad("Invoke-RestMethod")},Pb={info:{key:"powershell",title:"Powershell",default:"webrequest"},clientsById:{webrequest:{info:{key:"webrequest",title:"Invoke-WebRequest",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",description:"Powershell Invoke-WebRequest client",extname:".ps1"},convert:Ad("Invoke-WebRequest")},restmethod:Ib}};function Bc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
155
- ${o}`:", ",l=e==="object"?"{":"[",u=e==="object"?"}":"]";return n?`${l}
156
- ${o}${t.join(a)}
157
- ${i}${u}`:e==="object"&&t.length>0?`${l} ${t.join(a)} ${u}`:`${l}${t.join(a)}${u}`}const Pn=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;return Bc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),Pn(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Pn(e[s],t,n)}`);return Bc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"None";case"[object Boolean]":return e?"True":"False";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},$b=["HEAD","GET","POST","PUT","PATCH","DELETE","OPTIONS"],Mb={info:{key:"python",title:"Python",default:"requests",cli:"python3 %s"},clientsById:{requests:{info:{key:"requests",title:"Requests",link:"http://docs.python-requests.org/en/latest/api/#requests.request",description:"Requests HTTP library",extname:".py",installation:()=>"python -m pip install requests"},convert:({fullUrl:e,postData:t,allHeaders:n,method:r},s)=>{const o={indent:" ",pretty:!0,...s},{push:i,blank:a,join:l,addPostProcessor:u}=new pe({indent:o.indent});i("import requests"),a(),i(`url = "${e}"`),a();const f=n;let d={};const p={};let h=!1,m=!1,g=!1;switch(t.mimeType){case"application/json":t.jsonObj&&(i(`payload = ${Pn(t.jsonObj,o)}`),g=!0,m=!0);break;case"multipart/form-data":if(!t.params)break;if(d={},t.params.forEach(y=>{y.fileName?(y.contentType?p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')`:p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'))`,h=!0):(d[y.name]=y.value,m=!0)}),h){i(`files = ${Pn(p,o)}`),m&&i(`payload = ${Pn(d,o)}`);const y=Ze(f,"content-type");y&&delete f[y]}else{const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}u(y=>y.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g,'("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g,'("$1", open("$2", "rb"), "$3")'));break;default:{if(t.mimeType==="application/x-www-form-urlencoded"&&t.paramsObj){i(`payload = ${Pn(t.paramsObj,o)}`),m=!0;break}const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}}const v=Object.keys(f).length;if(v===0&&(m||h))a();else if(v===1)Object.keys(f).forEach(y=>{i(`headers = {"${y}": "${Ue(f[y])}"}`),a()});else if(v>1){let y=1;i("headers = {"),Object.keys(f).forEach(x=>{i(y!==v?`"${x}": "${Ue(f[x])}",`:`"${x}": "${Ue(f[x])}"`,1),y+=1}),i("}"),a()}let j=$b.includes(r)?`response = requests.${r.toLowerCase()}(url`:`response = requests.request("${r}", url`;return m&&(g?j+=", json=payload":j+=", data=payload"),h&&(j+=", files=files"),v>0&&(j+=", headers=headers"),j+=")",i(j),a(),i("print(response.text)"),l()}}}},Lb={info:{key:"r",title:"R",default:"httr"},clientsById:{httr:{info:{key:"httr",title:"httr",link:"https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",description:"httr: Tools for Working with URLs and HTTP",extname:".r"},convert:({url:e,queryObj:t,queryString:n,postData:r,allHeaders:s,method:o})=>{const{push:i,blank:a,join:l}=new pe;i("library(httr)"),a(),i(`url <- "${e}"`),a();const u=t;delete t.key;const f=Object.keys(u).length;n.length===1?(i(`queryString <- list(${Object.keys(u)} = "${Object.values(u).toString()}")`),a()):n.length>1&&(i("queryString <- list("),Object.keys(u).forEach((E,S)=>{S!==f-1?i(` ${E} = "${u[E].toString()}",`):i(` ${E} = "${u[E].toString()}"`)}),i(")"),a());const d=JSON.stringify(r.text);if(d&&(i(`payload <- ${d}`),a()),r.text||r.jsonObj||r.params)switch(r.mimeType){case"application/x-www-form-urlencoded":i('encode <- "form"'),a();break;case"application/json":i('encode <- "json"'),a();break;case"multipart/form-data":i('encode <- "multipart"'),a();break;default:i('encode <- "raw"'),a();break}const p=Rt(s,"cookie"),h=Rt(s,"accept"),m=p?`set_cookies(\`${String(p).replace(/;/g,'", `').replace(/` /g,"`").replace(/[=]/g,'` = "')}")`:void 0,g=h?`accept("${Ue(h)}")`:void 0,v=`content_type("${Ue(r.mimeType)}")`,j=Object.entries(s).filter(([E])=>!["cookie","accept","content-type"].includes(E.toLowerCase())).map(([E,S])=>`'${E}' = '${Un(S)}'`).join(", "),y=j?`add_headers(${j})`:void 0;let x=`response <- VERB("${o}", url`;d&&(x+=", body = payload"),n.length&&(x+=", query = queryString");const w=[y,v,g,m].filter(E=>!!E).join(", ");return w&&(x+=`, ${w}`),(r.text||r.jsonObj||r.params)&&(x+=", encode = encode"),x+=")",i(x),a(),i('content(response, "text")'),l()}}}},Db={info:{key:"ruby",title:"Ruby",default:"native"},clientsById:{native:{info:{key:"native",title:"net::http",link:"http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",description:"Ruby HTTP client",extname:".rb"},convert:({uriObj:e,method:t,fullUrl:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new pe;o("require 'uri'"),o("require 'net/http'"),i();const l=t.toUpperCase(),u=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"],f=l.charAt(0)+l.substring(1).toLowerCase();u.includes(l)||(o(`class Net::HTTP::${f} < Net::HTTPRequest`),o(` METHOD = '${l.toUpperCase()}'`),o(` REQUEST_HAS_BODY = '${r.text?"true":"false"}'`),o(" RESPONSE_HAS_BODY = true"),o("end"),i()),o(`url = URI("${n}")`),i(),o("http = Net::HTTP.new(url.host, url.port)"),e.protocol==="https:"&&o("http.use_ssl = true"),i(),o(`request = Net::HTTP::${f}.new(url)`);const d=Object.keys(s);return d.length&&d.forEach(p=>{o(`request["${p}"] = '${Un(s[p])}'`)}),r.text&&o(`request.body = ${JSON.stringify(r.text)}`),i(),o("response = http.request(request)"),o("puts response.read_body"),a()}},faraday:{info:{key:"faraday",title:"faraday",link:"https://github.com/lostisland/faraday",description:"Faraday HTTP client",extname:".rb"},convert:({uriObj:e,queryObj:t,method:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new pe,l=n.toUpperCase();if(!["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"].includes(l))return o(`# Faraday cannot currently run ${l} requests. Please use another client.`),a();o("require 'faraday'"),i(),r.mimeType==="application/x-www-form-urlencoded"&&r.params&&(o("data = {"),r.params.forEach(f=>{o(` :${f.name} => ${JSON.stringify(f.value)},`)}),o("}"),i()),o("conn = Faraday.new("),o(` url: '${e.protocol}//${e.host}',`),(s["content-type"]||s["Content-Type"])&&o(` headers: {'Content-Type' => '${s["content-type"]||s["Content-Type"]}'}`),o(")"),i(),o(`response = conn.${l.toLowerCase()}('${e.pathname}') do |req|`);const u=Object.keys(s);switch(u.length&&u.forEach(f=>{f.toLowerCase()!=="content-type"&&o(` req.headers['${f}'] = '${Un(s[f])}'`)}),Object.keys(t).forEach(f=>{const d=t[f];Array.isArray(d)?o(` req.params['${f}'] = ${JSON.stringify(d)}`):o(` req.params['${f}'] = '${d}'`)}),r.mimeType){case"application/x-www-form-urlencoded":r.params&&o(" req.body = URI.encode_www_form(data)");break;case"application/json":r.jsonObj&&o(` req.body = ${JSON.stringify(r.text)}`);break;default:r.text&&o(` req.body = ${JSON.stringify(r.text)}`)}return o("end"),i(),o("puts response.status"),o("puts response.body"),a()}}}};function Fc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
158
- ${o}`:", ",l=e==="object"?"json!({":"(",u=e==="object"?"})":")";return n?`${l}
159
- ${o}${t.join(a)}
160
- ${i}${u}`:`${l}${t.join(a)}${u}`}const $n=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{if(e.length===0)return"json!([])";let r=!1;return Fc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),$n(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${$n(e[s],t,n)}`);return Fc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"json!(null)";case"[object Boolean]":return e?"true":"false";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},Bb={info:{key:"reqwest",title:"reqwest",link:"https://docs.rs/reqwest/latest/reqwest/",description:"reqwest HTTP library",extname:".rs"},convert:({queryObj:e,url:t,postData:n,allHeaders:r,method:s},o)=>{const i={indent:" ",pretty:!0,...o};let a=0;const{push:l,blank:u,join:f,pushToLast:d,unshift:p}=new pe({indent:i.indent});l("use reqwest;",a),u(),l("#[tokio::main]",a),l("pub async fn main() {",a),a+=1,l(`let url = "${t}";`,a),u();let h=!1;if(Object.keys(e).length){h=!0,l("let querystring = [",a),a+=1;for(const[S,k]of Object.entries(e))if(Array.isArray(k))for(const C of k)l(`("${S}", "${decodeURIComponent(C)}"),`,a);else l(`("${S}", "${decodeURIComponent(String(k))}"),`,a);a-=1,l("];",a),u()}let m={};const g={};let v=!1,j=!1,y=!1,x=!1,w=!1;switch(n.mimeType){case"application/json":n.jsonObj&&l(`let payload = ${$n(n.jsonObj,i,a)};`,a),x=!0;break;case"multipart/form-data":if(w=!0,!n.params){l("let form = reqwest::multipart::Form::new()",a),l('.text("", "");',a+1);break}if(m={},n.params.forEach(S=>{S.fileName?(g[S.name]=S.fileName,v=!0):m[S.name]=S.value}),v){for(const S of Fb)l(S,a);u()}l("let form = reqwest::multipart::Form::new()",a);for(const[S,k]of Object.entries(g))l(`.part("${S}", file_to_part("${k}").await)`,a+1);for(const[S,k]of Object.entries(m))l(`.text("${S}", "${k}")`,a+1);d(";");break;default:if(n.mimeType==="application/x-www-form-urlencoded"&&n.paramsObj){l(`let payload = ${$n(n.paramsObj,i,a)};`,a),j=!0;break}if(n.text){l(`let payload = ${$n(n.text,i,a)};`,a),y=!0;break}}(j||x)&&p("use serde_json::json;"),(j||x||y||w)&&u();const E=Object.entries(r).filter(([S])=>!(S.toLowerCase()==="content-type"&&w));switch(l("let client = reqwest::Client::new();",a),s){case"POST":l("let response = client.post(url)",a);break;case"GET":l("let response = client.get(url)",a);break;default:l(`let response = client.request(reqwest::Method::from_str("${s}").unwrap(), url)`,a),p("use std::str::FromStr;");break}h&&l(".query(&querystring)",a+1),w&&l(".multipart(form)",a+1);for(const[S,k]of E)l(`.header("${S}", ${$n(k,i)})`,a+1);return x&&l(".json(&payload)",a+1),j&&l(".form(&payload)",a+1),y&&l(".body(payload)",a+1),l(".send()",a+1),l(".await;",a+1),u(),l("let results = response.unwrap()",a),l(".json::<serde_json::Value>()",a+1),l(".await",a+1),l(".unwrap();",a+1),u(),l('println!("{}", results);',a),l(`}
161
- `),f()}},Fb=["async fn file_to_part(file_name: &'static str) -> reqwest::multipart::Part {"," let bytes = tokio::fs::read(file_name).await.unwrap();"," reqwest::multipart::Part::bytes(bytes)"," .file_name(file_name)",' .mime_str("text/plain").unwrap()',"}"],Ub={info:{key:"rust",title:"Rust",default:"reqwest",cli:"rust"},clientsById:{reqwest:Bb}},We=(e="")=>/^[a-z0-9-_/.@%^=:]+$/i.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`,Hb=e=>e.replace(/\r/g,"\\r").replace(/\n/g,"\\n"),qb={"http1.0":"0","url ":"",cookie:"b",data:"d",form:"F",globoff:"g",header:"H",insecure:"k",request:"X"},zb=e=>t=>{if(e){const n=qb[t];return n?`-${n}`:""}return`--${t}`},Wb={info:{key:"shell",title:"Shell",default:"curl",cli:"%s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://curl.haxx.se/",description:"cURL is a command line tool and library for transferring data with URL syntax",extname:".sh"},convert:({fullUrl:e,method:t,httpVersion:n,headersObj:r,allHeaders:s,postData:o},i={})=>{var j;const{binary:a=!1,globOff:l=!1,indent:u=" ",insecureSkipVerify:f=!1,short:d=!1}=i,p=" ",{push:h,join:m}=new pe({...typeof u=="string"?{indent:u}:{},join:u!==!1?` \\
162
- ${u}`:" "}),g=zb(d);let v=We(e);if(h(`curl ${g("request")} ${t}`),l&&(v=unescape(v),h(g("globoff"))),h(`${g("url ")}${v}`),f&&h(g("insecure")),n==="HTTP/1.0"&&h(g("http1.0")),Rt(s,"accept-encoding")&&h("--compressed"),o.mimeType==="multipart/form-data"){const y=Ze(r,"content-type");if(y){const x=r[y];if(y&&x){const w=String(x).replace(/; boundary.+?(?=(;|$))/,"");r[y]=w,s[y]=w}}}switch(Object.keys(r).sort().forEach(y=>{const x=`${y}: ${r[y]}`;h(`${g("header")} ${We(x)}`)}),s.cookie&&h(`${g("cookie")} ${We(s.cookie)}`),o.mimeType){case"multipart/form-data":(j=o.params)==null||j.forEach(y=>{let x="";y.fileName?x=`${y.name}='@${y.fileName}'`:x=We(`${y.name}=${y.value}`),h(`${g("form")} ${x}`)});break;case"application/x-www-form-urlencoded":o.params?o.params.forEach(y=>{const x=encodeURIComponent(y.name),w=x!==y.name?x:y.name;h(`${a?"--data-binary":"--data-urlencode"} ${We(`${w}=${y.value}`)}`)}):h(`${a?"--data-binary":g("data")} ${We(o.text)}`);break;default:{if(!o.text)break;let y=!1;if(pb(o.mimeType)&&o.text.length>20)try{const x=JSON.parse(o.text);y=!0,o.text.indexOf("'")>0?h(`${a?"--data-binary":g("data")} @- <<EOF
163
- ${JSON.stringify(x,null,p)}
164
- EOF`):h(`${a?"--data-binary":g("data")} '
165
- ${JSON.stringify(x,null,p)}
166
- '`)}catch{}y||h(`${a?"--data-binary":g("data")} ${We(o.text)}`)}}return m()}},httpie:{info:{key:"httpie",title:"HTTPie",link:"http://httpie.org/",description:"a CLI, cURL-like tool for humans",extname:".sh",installation:()=>"brew install httpie"},convert:({allHeaders:e,postData:t,queryObj:n,fullUrl:r,method:s,url:o},i)=>{var m;const a={body:!1,cert:!1,headers:!1,indent:" ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1,...i},{push:l,join:u,unshift:f}=new pe({indent:a.indent,join:a.indent!==!1?` \\
167
- ${a.indent}`:" "});let d=!1;const p=[];a.headers&&p.push(a.short?"-h":"--headers"),a.body&&p.push(a.short?"-b":"--body"),a.verbose&&p.push(a.short?"-v":"--verbose"),a.print&&p.push(`${a.short?"-p":"--print"}=${a.print}`),a.verify&&p.push(`--verify=${a.verify}`),a.cert&&p.push(`--cert=${a.cert}`),a.pretty&&p.push(`--pretty=${a.pretty}`),a.style&&p.push(`--style=${a.style}`),a.timeout&&p.push(`--timeout=${a.timeout}`),a.queryParams&&Object.keys(n).forEach(g=>{const v=n[g];Array.isArray(v)?v.forEach(j=>{l(`${g}==${We(j)}`)}):l(`${g}==${We(v)}`)}),Object.keys(e).sort().forEach(g=>{l(`${g}:${We(e[g])}`)}),t.mimeType==="application/x-www-form-urlencoded"?(m=t.params)!=null&&m.length&&(p.push(a.short?"-f":"--form"),t.params.forEach(g=>{l(`${g.name}=${We(g.value)}`)})):d=!0;const h=p.length?`${p.join(" ")} `:"";return o=We(a.queryParams?o:r),f(`http ${h}${s} ${o}`),d&&t.text&&f(`echo ${We(t.text)} | `),u()}},wget:{info:{key:"wget",title:"Wget",link:"https://www.gnu.org/software/wget/",description:"a free software package for retrieving files using HTTP, HTTPS",extname:".sh"},convert:({method:e,postData:t,allHeaders:n,fullUrl:r},s)=>{const o={indent:" ",short:!1,verbose:!1,...s},{push:i,join:a}=new pe({...typeof o.indent=="string"?{indent:o.indent}:{},join:o.indent!==!1?` \\
168
- ${o.indent}`:" "});return o.verbose?i(`wget ${o.short?"-v":"--verbose"}`):i(`wget ${o.short?"-q":"--quiet"}`),i(`--method ${We(e)}`),Object.keys(n).forEach(l=>{const u=`${l}: ${n[l]}`;i(`--header ${We(u)}`)}),t.text&&i(`--body-data ${Hb(We(t.text))}`),i(o.short?"-O":"--output-document"),i(`- ${We(r)}`),a()}}}},Uc=(e,t)=>t.repeat(e),Hc=(e,t,n,r)=>{const s=Uc(r,n),o=Uc(r-1,n),i=t?`,
169
- ${s}`:", ";return t?`[
170
- ${s}${e.join(i)}
171
- ${o}]`:`[${e.join(i)}]`},qc=(e,t,n)=>`let ${e} = ${Ds(t,n)}`,Ds=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;const s=e.map(o=>(Object.prototype.toString.call(o)==="[object Object]"&&(r=Object.keys(o).length>1),Ds(o,t,n)));return Hc(s,r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Ds(e[s],t,n)}`);return Hc(r,t.pretty&&r.length>1,t.indent,n)}case"[object Boolean]":return e.toString();default:return e==null?"nil":`"${e.toString().replace(/"/g,'\\"')}"`}},Mn={agent:hb,c:mb,clojure:yb,crystal:xb,csharp:Sb,go:jb,http:Eb,java:kb,javascript:Ab,json:Tb,kotlin:Ob,node:Nb,objc:Cb,ocaml:_b,php:Rb,powershell:Pb,python:Mb,r:Lb,ruby:Db,rust:Ub,shell:Wb,swift:{info:{key:"swift",title:"Swift",default:"urlsession"},clientsById:{urlsession:{info:{key:"urlsession",title:"URLSession",link:"https://developer.apple.com/documentation/foundation/urlsession",description:"Foundation's URLSession request",extname:".swift"},convert:({allHeaders:e,postData:t,uriObj:n,queryObj:r,method:s},o)=>{var p;const i={indent:" ",pretty:!0,timeout:10,...o},{push:a,blank:l,join:u}=new pe({indent:i.indent});a("import Foundation"),l();const f=t.text||t.jsonObj||t.params;if(f)switch(t.mimeType){case"application/x-www-form-urlencoded":if((p=t.params)!=null&&p.length){const h=t.params.map(m=>`"${m.name}": "${m.value}"`);i.pretty?(a("let parameters = ["),h.forEach(m=>{a(`${m},`,1)}),a("]")):a(`let parameters = [${h.join(", ")}]`),a('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'),a("let postData = Data(joinedParameters.utf8)"),l()}break;case"application/json":t.jsonObj&&(a(`${qc("parameters",t.jsonObj,i)} as [String : Any?]`),l(),a("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"),l());break;case"multipart/form-data":a(qc("parameters",t.params,i)),l(),a(`let boundary = "${t.boundary}"`),l(),a('var body = ""'),a("for param in parameters {"),a('let paramName = param["name"]!',1),a('body += "--\\(boundary)\\r\\n"',1),a('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',1),a('if let filename = param["fileName"] {',1),a('let contentType = param["contentType"]!',2),a("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)",2),a('body += "; filename=\\"\\(filename)\\"\\r\\n"',2),a('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"',2),a("body += fileContent",2),a('} else if let paramValue = param["value"] {',1),a('body += "\\r\\n\\r\\n\\(paramValue)"',2),a("}",1),a("}"),l(),a("let postData = Data(body.utf8)"),l();break;default:a(`let postData = Data("${t.text}".utf8)`),l()}a(`let url = URL(string: "${n.href}")!`);const d=r?Object.entries(r):[];return d.length<1?a("var request = URLRequest(url: url)"):(a("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"),a("let queryItems: [URLQueryItem] = ["),d.forEach(h=>{const m=h[0],g=h[1];switch(Object.prototype.toString.call(g)){case"[object String]":a(`URLQueryItem(name: "${m}", value: "${g}"),`,1);break;case"[object Array]":g.forEach(v=>{a(`URLQueryItem(name: "${m}", value: "${v}"),`,1)});break}}),a("]"),a("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),l(),a("var request = URLRequest(url: components.url!)")),a(`request.httpMethod = "${s}"`),a(`request.timeoutInterval = ${i.timeout}`),Object.keys(e).length&&a(`request.allHTTPHeaderFields = ${Ds(e,i)}`),f&&a("request.httpBody = postData"),l(),a("let (data, _) = try await URLSession.shared.data(for: request)"),a("print(String(decoding: data, as: UTF8.self))"),u()}}}}},zc=(e,t)=>{const n=e[t.name];return n===void 0?(e[t.name]=t.value,e):Array.isArray(n)?(n.push(t.value),e):(e[t.name]=[n,t.value],e)};var Bs={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Vb=Bs.exports;(function(e,t){(function(n){var r=t&&!t.nodeType&&t,s=e&&!e.nodeType&&e,o=typeof wr=="object"&&wr;(o.global===o||o.window===o||o.self===o)&&(n=o);var i,a=2147483647,l=36,u=1,f=26,d=38,p=700,h=72,m=128,g="-",v=/^xn--/,j=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-u,E=Math.floor,S=String.fromCharCode,k;function C(I){throw new RangeError(x[I])}function T(I,_){for(var W=I.length,L=[];W--;)L[W]=_(I[W]);return L}function N(I,_){var W=I.split("@"),L="";W.length>1&&(L=W[0]+"@",I=W[1]),I=I.replace(y,".");var ee=I.split("."),Q=T(ee,_).join(".");return L+Q}function F(I){for(var _=[],W=0,L=I.length,ee,Q;W<L;)ee=I.charCodeAt(W++),ee>=55296&&ee<=56319&&W<L?(Q=I.charCodeAt(W++),(Q&64512)==56320?_.push(((ee&1023)<<10)+(Q&1023)+65536):(_.push(ee),W--)):_.push(ee);return _}function $(I){return T(I,function(_){var W="";return _>65535&&(_-=65536,W+=S(_>>>10&1023|55296),_=56320|_&1023),W+=S(_),W}).join("")}function K(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:l}function re(I,_){return I+22+75*(I<26)-((_!=0)<<5)}function ie(I,_,W){var L=0;for(I=W?E(I/p):I>>1,I+=E(I/_);I>w*f>>1;L+=l)I=E(I/w);return E(L+(w+1)*I/(I+d))}function R(I){var _=[],W=I.length,L,ee=0,Q=m,te=h,D,ne,ce,ue,fe,me,ye,Ne,Se;for(D=I.lastIndexOf(g),D<0&&(D=0),ne=0;ne<D;++ne)I.charCodeAt(ne)>=128&&C("not-basic"),_.push(I.charCodeAt(ne));for(ce=D>0?D+1:0;ce<W;){for(ue=ee,fe=1,me=l;ce>=W&&C("invalid-input"),ye=K(I.charCodeAt(ce++)),(ye>=l||ye>E((a-ee)/fe))&&C("overflow"),ee+=ye*fe,Ne=me<=te?u:me>=te+f?f:me-te,!(ye<Ne);me+=l)Se=l-Ne,fe>E(a/Se)&&C("overflow"),fe*=Se;L=_.length+1,te=ie(ee-ue,L,ue==0),E(ee/L)>a-Q&&C("overflow"),Q+=E(ee/L),ee%=L,_.splice(ee++,0,Q)}return $(_)}function P(I){var _,W,L,ee,Q,te,D,ne,ce,ue,fe,me=[],ye,Ne,Se,Xe;for(I=F(I),ye=I.length,_=m,W=0,Q=h,te=0;te<ye;++te)fe=I[te],fe<128&&me.push(S(fe));for(L=ee=me.length,ee&&me.push(g);L<ye;){for(D=a,te=0;te<ye;++te)fe=I[te],fe>=_&&fe<D&&(D=fe);for(Ne=L+1,D-_>E((a-W)/Ne)&&C("overflow"),W+=(D-_)*Ne,_=D,te=0;te<ye;++te)if(fe=I[te],fe<_&&++W>a&&C("overflow"),fe==_){for(ne=W,ce=l;ue=ce<=Q?u:ce>=Q+f?f:ce-Q,!(ne<ue);ce+=l)Xe=ne-ue,Se=l-ue,me.push(S(re(ue+Xe%Se,0))),ne=E(Xe/Se);me.push(S(re(ne,0))),Q=ie(W,Ne,L==ee),W=0,++L}++W,++_}return me.join("")}function V(I){return N(I,function(_){return v.test(_)?R(_.slice(4).toLowerCase()):_})}function J(I){return N(I,function(_){return j.test(_)?"xn--"+P(_):_})}if(i={version:"1.4.1",ucs2:{decode:F,encode:$},decode:R,encode:P,toASCII:J,toUnicode:V},r&&s)if(e.exports==r)s.exports=i;else for(k in i)i.hasOwnProperty(k)&&(r[k]=i[k]);else n.punycode=i})(Vb)})(Bs,Bs.exports);var Kb=Bs.exports,Kn=TypeError;const Jb={},Yb=Object.freeze(Object.defineProperty({__proto__:null,default:Jb},Symbol.toStringTag,{value:"Module"})),Td=Gm(Yb);var Ba=typeof Map=="function"&&Map.prototype,Wo=Object.getOwnPropertyDescriptor&&Ba?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fs=Ba&&Wo&&typeof Wo.get=="function"?Wo.get:null,Wc=Ba&&Map.prototype.forEach,Fa=typeof Set=="function"&&Set.prototype,Vo=Object.getOwnPropertyDescriptor&&Fa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Us=Fa&&Vo&&typeof Vo.get=="function"?Vo.get:null,Vc=Fa&&Set.prototype.forEach,Zb=typeof WeakMap=="function"&&WeakMap.prototype,pr=Zb?WeakMap.prototype.has:null,Xb=typeof WeakSet=="function"&&WeakSet.prototype,hr=Xb?WeakSet.prototype.has:null,Qb=typeof WeakRef=="function"&&WeakRef.prototype,Kc=Qb?WeakRef.prototype.deref:null,Gb=Boolean.prototype.valueOf,e1=Object.prototype.toString,t1=Function.prototype.toString,n1=String.prototype.match,Ua=String.prototype.slice,Zt=String.prototype.replace,r1=String.prototype.toUpperCase,Jc=String.prototype.toLowerCase,Od=RegExp.prototype.test,Yc=Array.prototype.concat,Nt=Array.prototype.join,s1=Array.prototype.slice,Zc=Math.floor,Fi=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ko=Object.getOwnPropertySymbols,Ui=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",mr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Hn||!0)?Symbol.toStringTag:null,Nd=Object.prototype.propertyIsEnumerable,Xc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Qc(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Od.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Zc(-e):Zc(e);if(r!==e){var s=String(r),o=Ua.call(t,s.length+1);return Zt.call(s,n,"$&_")+"."+Zt.call(Zt.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zt.call(t,n,"$&_")}var Hi=Td,Gc=Hi.custom,eu=Rd(Gc)?Gc:null,Cd={__proto__:null,double:'"',single:"'"},o1={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ro=function e(t,n,r,s){var o=n||{};if(Mt(o,"quoteStyle")&&!Mt(Cd,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Mt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=Mt(o,"customInspect")?o.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Mt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Mt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Pd(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?Qc(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return a?Qc(t,u):u}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof t=="object")return qi(t)?"[Array]":"[Object]";var d=j1(o,r);if(typeof s>"u")s=[];else if(Id(s,t)>=0)return"[Circular]";function p(K,re,ie){if(re&&(s=s1.call(s),s.push(re)),ie){var R={depth:o.depth};return Mt(o,"quoteStyle")&&(R.quoteStyle=o.quoteStyle),e(K,R,r+1,s)}return e(K,o,r+1,s)}if(typeof t=="function"&&!tu(t)){var h=h1(t),m=ls(t,p);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+Nt.call(m,", ")+" }":"")}if(Rd(t)){var g=Hn?Zt.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ui.call(t);return typeof t=="object"&&!Hn?lr(g):g}if(v1(t)){for(var v="<"+Jc.call(String(t.nodeName)),j=t.attributes||[],y=0;y<j.length;y++)v+=" "+j[y].name+"="+_d(i1(j[y].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+Jc.call(String(t.nodeName))+">",v}if(qi(t)){if(t.length===0)return"[]";var x=ls(t,p);return d&&!S1(x)?"["+zi(x,d)+"]":"[ "+Nt.call(x,", ")+" ]"}if(l1(t)){var w=ls(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!Nd.call(t,"cause")?"{ ["+String(t)+"] "+Nt.call(Yc.call("[cause]: "+p(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Nt.call(w,", ")+" }"}if(typeof t=="object"&&i){if(eu&&typeof t[eu]=="function"&&Hi)return Hi(t,{depth:f-r});if(i!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(m1(t)){var E=[];return Wc&&Wc.call(t,function(K,re){E.push(p(re,t,!0)+" => "+p(K,t))}),nu("Map",Fs.call(t),E,d)}if(x1(t)){var S=[];return Vc&&Vc.call(t,function(K){S.push(p(K,t))}),nu("Set",Us.call(t),S,d)}if(g1(t))return Jo("WeakMap");if(b1(t))return Jo("WeakSet");if(y1(t))return Jo("WeakRef");if(u1(t))return lr(p(Number(t)));if(d1(t))return lr(p(Fi.call(t)));if(f1(t))return lr(Gb.call(t));if(c1(t))return lr(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof wr<"u"&&t===wr)return"{ [object globalThis] }";if(!a1(t)&&!tu(t)){var k=ls(t,p),C=Xc?Xc(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",N=!C&&mr&&Object(t)===t&&mr in t?Ua.call(nn(t),8,-1):T?"Object":"",F=C||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",$=F+(N||T?"["+Nt.call(Yc.call([],N||[],T||[]),": ")+"] ":"");return k.length===0?$+"{}":d?$+"{"+zi(k,d)+"}":$+"{ "+Nt.call(k,", ")+" }"}return String(t)};function _d(e,t,n){var r=n.quoteStyle||t,s=Cd[r];return s+e+s}function i1(e){return Zt.call(String(e),/"/g,"&quot;")}function vn(e){return!mr||!(typeof e=="object"&&(mr in e||typeof e[mr]<"u"))}function qi(e){return nn(e)==="[object Array]"&&vn(e)}function a1(e){return nn(e)==="[object Date]"&&vn(e)}function tu(e){return nn(e)==="[object RegExp]"&&vn(e)}function l1(e){return nn(e)==="[object Error]"&&vn(e)}function c1(e){return nn(e)==="[object String]"&&vn(e)}function u1(e){return nn(e)==="[object Number]"&&vn(e)}function f1(e){return nn(e)==="[object Boolean]"&&vn(e)}function Rd(e){if(Hn)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Ui)return!1;try{return Ui.call(e),!0}catch{}return!1}function d1(e){if(!e||typeof e!="object"||!Fi)return!1;try{return Fi.call(e),!0}catch{}return!1}var p1=Object.prototype.hasOwnProperty||function(e){return e in this};function Mt(e,t){return p1.call(e,t)}function nn(e){return e1.call(e)}function h1(e){if(e.name)return e.name;var t=n1.call(t1.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Id(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function m1(e){if(!Fs||!e||typeof e!="object")return!1;try{Fs.call(e);try{Us.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function g1(e){if(!pr||!e||typeof e!="object")return!1;try{pr.call(e,pr);try{hr.call(e,hr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function y1(e){if(!Kc||!e||typeof e!="object")return!1;try{return Kc.call(e),!0}catch{}return!1}function x1(e){if(!Us||!e||typeof e!="object")return!1;try{Us.call(e);try{Fs.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function b1(e){if(!hr||!e||typeof e!="object")return!1;try{hr.call(e,hr);try{pr.call(e,pr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function v1(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Pd(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Pd(Ua.call(e,0,t.maxStringLength),t)+r}var s=o1[t.quoteStyle||"single"];s.lastIndex=0;var o=Zt.call(Zt.call(e,s,"\\$1"),/[\x00-\x1f]/g,w1);return _d(o,"single",t)}function w1(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+r1.call(t.toString(16))}function lr(e){return"Object("+e+")"}function Jo(e){return e+" { ? }"}function nu(e,t,n,r){var s=r?zi(n,r):Nt.call(n,", ");return e+" ("+t+") {"+s+"}"}function S1(e){for(var t=0;t<e.length;t++)if(Id(e[t],`
172
- `)>=0)return!1;return!0}function j1(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Nt.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Nt.call(Array(t+1),n)}}function zi(e,t){if(e.length===0)return"";var n=`
173
- `+t.prev+t.base;return n+Nt.call(e,","+n)+`
174
- `+t.prev}function ls(e,t){var n=qi(e),r=[];if(n){r.length=e.length;for(var s=0;s<e.length;s++)r[s]=Mt(e,s)?t(e[s],e):""}var o=typeof Ko=="function"?Ko(e):[],i;if(Hn){i={};for(var a=0;a<o.length;a++)i["$"+o[a]]=o[a]}for(var l in e)Mt(e,l)&&(n&&String(Number(l))===l&&l<e.length||Hn&&i["$"+l]instanceof Symbol||(Od.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if(typeof Ko=="function")for(var u=0;u<o.length;u++)Nd.call(e,o[u])&&r.push("["+t(o[u])+"]: "+t(e[o[u]],e));return r}var E1=ro,k1=Kn,so=function(e,t,n){for(var r=e,s;(s=r.next)!=null;r=s)if(s.key===t)return r.next=s.next,n||(s.next=e.next,e.next=s),s},A1=function(e,t){if(e){var n=so(e,t);return n&&n.value}},T1=function(e,t,n){var r=so(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},O1=function(e,t){return e?!!so(e,t):!1},N1=function(e,t){if(e)return so(e,t,!0)},C1=function(){var t,n={assert:function(r){if(!n.has(r))throw new k1("Side channel does not contain "+E1(r))},delete:function(r){var s=N1(t,r);return s&&t&&!t.next&&(t=void 0),!!s},get:function(r){return A1(t,r)},has:function(r){return O1(t,r)},set:function(r,s){t||(t={next:void 0}),T1(t,r,s)}};return n},$d=Object,_1=Error,R1=EvalError,I1=RangeError,P1=ReferenceError,$1=SyntaxError,M1=URIError,L1=Math.abs,D1=Math.floor,B1=Math.max,F1=Math.min,U1=Math.pow,H1=Math.round,q1=Number.isNaN||function(t){return t!==t},z1=q1,W1=function(t){return z1(t)||t===0?t:t<0?-1:1},V1=Object.getOwnPropertyDescriptor,bs=V1;if(bs)try{bs([],"length")}catch{bs=null}var Md=bs,vs=Object.defineProperty||!1;if(vs)try{vs({},"a",{value:1})}catch{vs=!1}var Ld=vs,Yo,ru;function K1(){return ru||(ru=1,Yo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var s=42;t[n]=s;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==s||a.enumerable!==!0)return!1}return!0}),Yo}var Zo,su;function J1(){if(su)return Zo;su=1;var e=typeof Symbol<"u"&&Symbol,t=K1();return Zo=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Zo}var Xo,ou;function Dd(){return ou||(ou=1,Xo=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xo}var Qo,iu;function Bd(){if(iu)return Qo;iu=1;var e=$d;return Qo=e.getPrototypeOf||null,Qo}var Go,au;function Y1(){if(au)return Go;au=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",s=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var p=0;p<u.length;p+=1)f[p+l.length]=u[p];return f},o=function(l,u){for(var f=[],d=u,p=0;d<l.length;d+=1,p+=1)f[p]=l[d];return f},i=function(a,l){for(var u="",f=0;f<a.length;f+=1)u+=a[f],f+1<a.length&&(u+=l);return u};return Go=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var f=o(arguments,1),d,p=function(){if(this instanceof d){var j=u.apply(this,s(f,arguments));return Object(j)===j?j:this}return u.apply(l,s(f,arguments))},h=n(0,u.length-f.length),m=[],g=0;g<h;g++)m[g]="$"+g;if(d=Function("binder","return function ("+i(m,",")+"){ return binder.apply(this,arguments); }")(p),u.prototype){var v=function(){};v.prototype=u.prototype,d.prototype=new v,v.prototype=null}return d},Go}var ei,lu;function oo(){if(lu)return ei;lu=1;var e=Y1();return ei=Function.prototype.bind||e,ei}var ti,cu;function Ha(){return cu||(cu=1,ti=Function.prototype.call),ti}var ni,uu;function Fd(){return uu||(uu=1,ni=Function.prototype.apply),ni}var Z1=typeof Reflect<"u"&&Reflect&&Reflect.apply,X1=oo(),Q1=Fd(),G1=Ha(),ev=Z1,tv=ev||X1.call(G1,Q1),nv=oo(),rv=Kn,sv=Ha(),ov=tv,Ud=function(t){if(t.length<1||typeof t[0]!="function")throw new rv("a function is required");return ov(nv,sv,t)},ri,fu;function iv(){if(fu)return ri;fu=1;var e=Ud,t=Md,n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var r=!!n&&t&&t(Object.prototype,"__proto__"),s=Object,o=s.getPrototypeOf;return ri=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:s(a))}:!1,ri}var si,du;function av(){if(du)return si;du=1;var e=Dd(),t=Bd(),n=iv();return si=e?function(s){return e(s)}:t?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw new TypeError("getProto: not an object");return t(s)}:n?function(s){return n(s)}:null,si}var oi,pu;function lv(){if(pu)return oi;pu=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=oo();return oi=n.call(e,t),oi}var he,cv=$d,uv=_1,fv=R1,dv=I1,pv=P1,qn=$1,Dn=Kn,hv=M1,mv=L1,gv=D1,yv=B1,xv=F1,bv=U1,vv=H1,wv=W1,Hd=Function,ii=function(e){try{return Hd('"use strict"; return ('+e+").constructor;")()}catch{}},kr=Md,Sv=Ld,ai=function(){throw new Dn},jv=kr?(function(){try{return arguments.callee,ai}catch{try{return kr(arguments,"callee").get}catch{return ai}}})():ai,On=J1()(),qe=av(),Ev=Bd(),kv=Dd(),qd=Fd(),Mr=Ha(),In={},Av=typeof Uint8Array>"u"||!qe?he:qe(Uint8Array),hn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":On&&qe?qe([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":In,"%AsyncGenerator%":In,"%AsyncGeneratorFunction%":In,"%AsyncIteratorPrototype%":In,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":uv,"%eval%":eval,"%EvalError%":fv,"%Float16Array%":typeof Float16Array>"u"?he:Float16Array,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":Hd,"%GeneratorFunction%":In,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":On&&qe?qe(qe([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!On||!qe?he:qe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cv,"%Object.getOwnPropertyDescriptor%":kr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":dv,"%ReferenceError%":pv,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!On||!qe?he:qe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":On&&qe?qe(""[Symbol.iterator]()):he,"%Symbol%":On?Symbol:he,"%SyntaxError%":qn,"%ThrowTypeError%":jv,"%TypedArray%":Av,"%TypeError%":Dn,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":hv,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet,"%Function.prototype.call%":Mr,"%Function.prototype.apply%":qd,"%Object.defineProperty%":Sv,"%Object.getPrototypeOf%":Ev,"%Math.abs%":mv,"%Math.floor%":gv,"%Math.max%":yv,"%Math.min%":xv,"%Math.pow%":bv,"%Math.round%":vv,"%Math.sign%":wv,"%Reflect.getPrototypeOf%":kv};if(qe)try{null.error}catch(e){var Tv=qe(qe(e));hn["%Error.prototype%"]=Tv}var Ov=function e(t){var n;if(t==="%AsyncFunction%")n=ii("async function () {}");else if(t==="%GeneratorFunction%")n=ii("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ii("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&qe&&(n=qe(s.prototype))}return hn[t]=n,n},hu={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Lr=oo(),Hs=lv(),Nv=Lr.call(Mr,Array.prototype.concat),Cv=Lr.call(qd,Array.prototype.splice),mu=Lr.call(Mr,String.prototype.replace),qs=Lr.call(Mr,String.prototype.slice),_v=Lr.call(Mr,RegExp.prototype.exec),Rv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Iv=/\\(\\)?/g,Pv=function(t){var n=qs(t,0,1),r=qs(t,-1);if(n==="%"&&r!=="%")throw new qn("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new qn("invalid intrinsic syntax, expected opening `%`");var s=[];return mu(t,Rv,function(o,i,a,l){s[s.length]=a?mu(l,Iv,"$1"):i||o}),s},$v=function(t,n){var r=t,s;if(Hs(hu,r)&&(s=hu[r],r="%"+s[0]+"%"),Hs(hn,r)){var o=hn[r];if(o===In&&(o=Ov(r)),typeof o>"u"&&!n)throw new Dn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:o}}throw new qn("intrinsic "+t+" does not exist!")},qa=function(t,n){if(typeof t!="string"||t.length===0)throw new Dn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Dn('"allowMissing" argument must be a boolean');if(_v(/^%?[^%]*%?$/,t)===null)throw new qn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Pv(t),s=r.length>0?r[0]:"",o=$v("%"+s+"%",n),i=o.name,a=o.value,l=!1,u=o.alias;u&&(s=u[0],Cv(r,Nv([0,1],u)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],h=qs(p,0,1),m=qs(p,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new qn("property names with quotes must have matching quotes");if((p==="constructor"||!d)&&(l=!0),s+="."+p,i="%"+s+"%",Hs(hn,i))a=hn[i];else if(a!=null){if(!(p in a)){if(!n)throw new Dn("base intrinsic for "+t+" exists, but the property is not available.");return}if(kr&&f+1>=r.length){var g=kr(a,p);d=!!g,d&&"get"in g&&!("originalValue"in g.get)?a=g.get:a=a[p]}else d=Hs(a,p),a=a[p];d&&!l&&(hn[i]=a)}}return a},zd=qa,Wd=Ud,Mv=Wd([zd("%String.prototype.indexOf%")]),Vd=function(t,n){var r=zd(t,!!n);return typeof r=="function"&&Mv(t,".prototype.")>-1?Wd([r]):r},Lv=qa,Dr=Vd,Dv=ro,Bv=Kn,gu=Lv("%Map%",!0),Fv=Dr("Map.prototype.get",!0),Uv=Dr("Map.prototype.set",!0),Hv=Dr("Map.prototype.has",!0),qv=Dr("Map.prototype.delete",!0),zv=Dr("Map.prototype.size",!0),Kd=!!gu&&function(){var t,n={assert:function(r){if(!n.has(r))throw new Bv("Side channel does not contain "+Dv(r))},delete:function(r){if(t){var s=qv(t,r);return zv(t)===0&&(t=void 0),s}return!1},get:function(r){if(t)return Fv(t,r)},has:function(r){return t?Hv(t,r):!1},set:function(r,s){t||(t=new gu),Uv(t,r,s)}};return n},Wv=qa,io=Vd,Vv=ro,cs=Kd,Kv=Kn,Nn=Wv("%WeakMap%",!0),Jv=io("WeakMap.prototype.get",!0),Yv=io("WeakMap.prototype.set",!0),Zv=io("WeakMap.prototype.has",!0),Xv=io("WeakMap.prototype.delete",!0),Qv=Nn?function(){var t,n,r={assert:function(s){if(!r.has(s))throw new Kv("Side channel does not contain "+Vv(s))},delete:function(s){if(Nn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return Xv(t,s)}else if(cs&&n)return n.delete(s);return!1},get:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?Jv(t,s):n&&n.get(s)},has:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?Zv(t,s):!!n&&n.has(s)},set:function(s,o){Nn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Nn),Yv(t,s,o)):cs&&(n||(n=cs()),n.set(s,o))}};return r}:cs,Gv=Kn,ew=ro,tw=C1,nw=Kd,rw=Qv,sw=rw||nw||tw,Jd=function(){var t,n={assert:function(r){if(!n.has(r)){var s=r&&Object(r)===r?"the given object key":ew(r);throw new Gv("Side channel does not contain "+s)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,s){t||(t=sw()),t.set(r,s)}};return n},ow=String.prototype.replace,iw=/%20/g,li={RFC1738:"RFC1738",RFC3986:"RFC3986"},za={default:li.RFC3986,formatters:{RFC1738:function(e){return ow.call(e,iw,"+")},RFC3986:function(e){return String(e)}},RFC1738:li.RFC1738,RFC3986:li.RFC3986},aw=za,Yd=Jd,yu=Ld,ci=Object.prototype.hasOwnProperty,un=Array.isArray,ao=Yd(),fn=function(t,n){return ao.set(t,n),t},dn=function(t){return ao.has(t)},ur=function(t){return ao.get(t)},Wi=function(t,n){ao.set(t,n)},kt=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),lw=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(un(r)){for(var s=[],o=0;o<r.length;++o)typeof r[o]<"u"&&(s[s.length]=r[o]);n.obj[n.prop]=s}}},Ln=function(t,n){for(var r=n&&n.plainObjects?{__proto__:null}:{},s=0;s<t.length;++s)typeof t[s]<"u"&&(r[s]=t[s]);return r},Vi=function(t,n,r){n==="__proto__"&&yu?yu(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r},cw=function e(t,n,r){if(!n)return t;if(typeof n!="object"&&typeof n!="function"){if(un(t)){var s=t.length;if(r&&typeof r.arrayLimit=="number"&&s>=r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t.concat(n),r),s)}t[s]=n}else if(t&&typeof t=="object")if(dn(t)){var o=ur(t)+1;t[o]=n,Wi(t,o)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!ci.call(Object.prototype,n))&&(t[n]=!0)}else return[t,n];return t}if(!t||typeof t!="object"){if(dn(n)){for(var i=Object.keys(n),a=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},l=0;l<i.length;l++){var u=parseInt(i[l],10);a[u+1]=n[i[l]]}return fn(a,ur(n)+1)}var f=[t].concat(n);if(r&&typeof r.arrayLimit=="number"&&f.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(f,r),f.length-1)}return f}var d=t;if(un(t)&&!un(n)&&(d=Ln(t,r)),un(t)&&un(n)){if(n.forEach(function(p,h){if(ci.call(t,h)){var m=t[h];m&&typeof m=="object"&&p&&typeof p=="object"?t[h]=e(m,p,r):t[t.length]=p}else t[h]=p}),r&&typeof r.arrayLimit=="number"&&t.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t,r),t.length-1)}return t}return Object.keys(n).reduce(function(p,h){var m=n[h];if(ci.call(p,h)?Vi(p,h,e(p[h],m,r)):Vi(p,h,m),dn(n)&&!dn(p)&&fn(p,ur(n)),dn(p)){var g=parseInt(h,10);String(g)===h&&g>=0&&g>ur(p)&&Wi(p,g)}return p},d)},uw=function(t,n){return Object.keys(n).reduce(function(r,s){return Vi(r,s,n[s]),r},t)},fw=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},us=1024,dw=function(t,n,r,s,o){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(m){return"%26%23"+parseInt(m.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=us){var u=i.length>=us?i.slice(l,l+us):i;if(l+us<i.length){var f=u.charCodeAt(u.length-1);f>=55296&&f<=56319&&(u=u.slice(0,-1),l-=1)}for(var d=[],p=0;p<u.length;++p){var h=u.charCodeAt(p);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===aw.RFC1738&&(h===40||h===41)){d[d.length]=u.charAt(p);continue}if(h<128){d[d.length]=kt[h];continue}if(h<2048){d[d.length]=kt[192|h>>6]+kt[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=kt[224|h>>12]+kt[128|h>>6&63]+kt[128|h&63];continue}p+=1,h=65536+((h&1023)<<10|u.charCodeAt(p)&1023),d[d.length]=kt[240|h>>18]+kt[128|h>>12&63]+kt[128|h>>6&63]+kt[128|h&63]}a+=d.join("")}return a},pw=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=Yd(),s=0;s<n.length;++s)for(var o=n[s],i=o.obj[o.prop],a=Object.keys(i),l=0;l<a.length;++l){var u=a[l],f=i[u];typeof f=="object"&&f!==null&&!r.has(f)&&(n[n.length]={obj:i,prop:u},r.set(f,!0))}return lw(n),t},hw=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},mw=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},gw=function(t,n,r,s,o){if(dn(t)){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");var i=ur(t)+1;return t[i]=n,Wi(t,i),t}var a=[].concat(t,n);if(a.length>r){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");return fn(Ln(a,{plainObjects:s}),a.length-1)}return a},yw=function(t,n){if(un(t)){for(var r=[],s=0;s<t.length;s+=1)r[r.length]=n(t[s]);return r}return n(t)},Zd={arrayToObject:Ln,assign:uw,combine:gw,compact:pw,decode:fw,encode:dw,isBuffer:mw,isOverflow:dn,isRegExp:hw,markOverflow:fn,maybeMap:yw,merge:cw},Xd=Jd,ws=Zd,gr=za,xw=Object.prototype.hasOwnProperty,Qd={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},Tt=Array.isArray,bw=Array.prototype.push,Gd=function(e,t){bw.apply(e,Tt(t)?t:[t])},vw=Date.prototype.toISOString,xu=gr.default,Fe={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:ws.encode,encodeValuesOnly:!1,filter:void 0,format:xu,formatter:gr.formatters[xu],indices:!1,serializeDate:function(t){return vw.call(t)},skipNulls:!1,strictNullHandling:!1},ww=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ui={},Sw=function e(t,n,r,s,o,i,a,l,u,f,d,p,h,m,g,v,j,y){for(var x=t,w=y,E=0,S=!1;(w=w.get(ui))!==void 0&&!S;){var k=w.get(t);if(E+=1,typeof k<"u"){if(k===E)throw new RangeError("Cyclic object value");S=!0}typeof w.get(ui)>"u"&&(E=0)}if(typeof f=="function"?x=f(n,x):x instanceof Date?x=h(x):r==="comma"&&Tt(x)&&(x=ws.maybeMap(x,function(I){return I instanceof Date?h(I):I})),x===null){if(i)return g(u&&!v?u(n,Fe.encoder,j,"key",m):n);x=""}if(ww(x)||ws.isBuffer(x)){if(u){var C=v?n:u(n,Fe.encoder,j,"key",m);return[g(C)+"="+g(u(x,Fe.encoder,j,"value",m))]}return[g(n)+"="+g(String(x))]}var T=[];if(typeof x>"u")return T;var N;if(r==="comma"&&Tt(x))v&&u&&(x=ws.maybeMap(x,function(I){return I==null?I:u(I)})),N=[{value:x.length>0?x.join(",")||null:void 0}];else if(Tt(f))N=f;else{var F=Object.keys(x);N=d?F.sort(d):F}var $=l?String(n).replace(/\./g,"%2E"):String(n),K=s&&Tt(x)&&x.length===1?$+"[]":$;if(o&&Tt(x)&&x.length===0)return K+"[]";for(var re=0;re<N.length;++re){var ie=N[re],R=typeof ie=="object"&&ie&&typeof ie.value<"u"?ie.value:x[ie];if(!(a&&R===null)){var P=p&&l?String(ie).replace(/\./g,"%2E"):String(ie),V=Tt(x)?typeof r=="function"?r(K,P):K:K+(p?"."+P:"["+P+"]");y.set(t,E);var J=Xd();J.set(ui,y),Gd(T,e(R,V,r,s,o,i,a,l,r==="comma"&&v&&Tt(x)?null:u,f,d,p,h,m,g,v,j,J))}}return T},jw=function(t){if(!t)return Fe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||Fe.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=gr.default;if(typeof t.format<"u"){if(!xw.call(gr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var s=gr.formatters[r],o=Fe.filter;(typeof t.filter=="function"||Tt(t.filter))&&(o=t.filter);var i;if(t.arrayFormat in Qd?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=Fe.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Fe.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Fe.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Fe.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Fe.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Fe.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Fe.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Fe.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Fe.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Fe.encodeValuesOnly,filter:o,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Fe.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Fe.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Fe.strictNullHandling}},Ew=function(e,t){var n=e,r=jw(t),s,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Tt(r.filter)&&(o=r.filter,s=o);var i=[];if(typeof n!="object"||n===null)return"";var a=Qd[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);for(var u=Xd(),f=0;f<s.length;++f){var d=s[f];if(!(typeof d>"u"||d===null)){var p=n[d];r.skipNulls&&p===null||Gd(i,Sw(p,d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}}var h=i.join(r.delimiter),m=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B"+r.delimiter:m+="utf8=%E2%9C%93"+r.delimiter),h.length>0?m+h:""},_t=Zd,Ss=Object.prototype.hasOwnProperty,fi=Array.isArray,Oe={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},kw=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},ep=function(e,t,n,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1){if(r&&t.throwOnLimitExceeded)for(var s=0,o=e.indexOf(",");o>-1;){if(s+=1,s>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Aw="utf8=%26%2310003%3B",Tw="utf8=%E2%9C%93",Ow=function(t,n){var r={__proto__:null},s=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;s=s.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=n.parameterLimit===1/0?void 0:n.parameterLimit,i=s.split(n.delimiter,n.throwOnLimitExceeded&&typeof o<"u"?o+1:o);if(n.throwOnLimitExceeded&&typeof o<"u"&&i.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var a=-1,l,u=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===Tw?u="utf-8":i[l]===Aw&&(u="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var f=i[l],d=f.indexOf("]="),p=d===-1?f.indexOf("="):d+1,h,m;if(p===-1?(h=n.decoder(f,Oe.decoder,u,"key"),m=n.strictNullHandling?null:""):(h=n.decoder(f.slice(0,p),Oe.decoder,u,"key"),h!==null&&(m=_t.maybeMap(ep(f.slice(p+1),n,fi(r[h])?r[h].length:0,f.indexOf("[]=")===-1),function(v){return n.decoder(v,Oe.decoder,u,"value")}))),m&&n.interpretNumericEntities&&u==="iso-8859-1"&&(m=kw(String(m))),f.indexOf("[]=")>-1&&(m=fi(m)?[m]:m),n.comma&&fi(m)&&m.length>n.arrayLimit&&(m=_t.combine([],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded)),h!==null){var g=Ss.call(r,h);g&&(n.duplicates==="combine"||f.indexOf("[]=")>-1)?r[h]=_t.combine(r[h],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded):(!g||n.duplicates==="last")&&(r[h]=m)}}return r},Nw=function(e,t,n,r){var s=0;if(e.length>0&&e[e.length-1]==="[]"){var o=e.slice(0,-1).join("");s=Array.isArray(t)&&t[o]?t[o].length:0}for(var i=r?t:ep(t,n,s),a=e.length-1;a>=0;--a){var l,u=e[a];if(u==="[]"&&n.parseArrays)_t.isOverflow(i)?l=i:l=n.allowEmptyArrays&&(i===""||n.strictNullHandling&&i===null)?[]:_t.combine([],i,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded);else{l=n.plainObjects?{__proto__:null}:{};var f=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=n.decodeDotInKeys?f.replace(/%2E/g,"."):f,p=parseInt(d,10),h=!isNaN(p)&&u!==d&&String(p)===d&&p>=0&&n.parseArrays;if(!n.parseArrays&&d==="")l={0:i};else if(h&&p<n.arrayLimit)l=[],l[p]=i;else{if(h&&n.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(n.arrayLimit===1?"":"s")+" allowed in an array.");h?(l[p]=i,_t.markOverflow(l,p)):d!=="__proto__"&&(l[d]=i)}}i=l}return i},Cw=function(t,n){var r=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(n.depth<=0)return!n.plainObjects&&Ss.call(Object.prototype,r)&&!n.allowPrototypes?void 0:[r];var s=[],o=r.indexOf("["),i=o>=0?r.slice(0,o):r;if(i){if(!n.plainObjects&&Ss.call(Object.prototype,i)&&!n.allowPrototypes)return;s[s.length]=i}for(var a=r.length,l=o,u=0;l>=0&&u<n.depth;){for(var f=1,d=l+1,p=-1;d<a&&p<0;){var h=r.charCodeAt(d);h===91?f+=1:h===93&&(f-=1,f===0&&(p=d)),d+=1}if(p<0)return s[s.length]="["+r.slice(l)+"]",s;var m=r.slice(l,p+1),g=m.slice(1,-1);if(!n.plainObjects&&Ss.call(Object.prototype,g)&&!n.allowPrototypes)return;s[s.length]=m,u+=1,l=r.indexOf("[",p+1)}if(l>=0){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s[s.length]="["+r.slice(l)+"]"}return s},_w=function(t,n,r,s){if(t){var o=Cw(t,r);if(o)return Nw(o,n,r,s)}},Rw=function(t){if(!t)return Oe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var n=typeof t.charset>"u"?Oe.charset:t.charset,r=typeof t.duplicates>"u"?Oe.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var s=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Oe.allowDots:!!t.allowDots;return{allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Oe.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Oe.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Oe.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Oe.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Oe.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Oe.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Oe.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Oe.decoder,delimiter:typeof t.delimiter=="string"||_t.isRegExp(t.delimiter)?t.delimiter:Oe.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Oe.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Oe.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Oe.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Oe.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Oe.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:Oe.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Oe.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},Iw=function(e,t){var n=Rw(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?{__proto__:null}:{};for(var r=typeof e=="string"?Ow(e,n):e,s=n.plainObjects?{__proto__:null}:{},o=Object.keys(r),i=0;i<o.length;++i){var a=o[i],l=_w(a,r[a],n,typeof e=="string");s=_t.merge(s,l,n)}return n.allowSparse===!0?s:_t.compact(s)},Pw=Ew,$w=Iw,Mw=za,js={formats:Mw,parse:$w,stringify:Pw},Lw=Kb;function bt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Dw=/^([a-z0-9.+-]+:)/i,Bw=/:[0-9]*$/,Fw=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Uw=["<",">",'"',"`"," ","\r",`
175
- `," "],Hw=["{","}","|","\\","^","`"].concat(Uw),Ki=["'"].concat(Hw),bu=["%","/","?",";","#"].concat(Ki),vu=["/","?","#"],qw=255,wu=/^[+a-z0-9A-Z_-]{0,63}$/,zw=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ww={javascript:!0,"javascript:":!0},Ji={javascript:!0,"javascript:":!0},Bn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Yi=js;function Wa(e,t,n){if(e&&typeof e=="object"&&e instanceof bt)return e;var r=new bt;return r.parse(e,t,n),r}bt.prototype.parse=function(e,t,n){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),s=r!==-1&&r<e.indexOf("#")?"?":"#",o=e.split(s),i=/\\/g;o[0]=o[0].replace(i,"/"),e=o.join(s);var a=e;if(a=a.trim(),!n&&e.split("#").length===1){var l=Fw.exec(a);if(l)return this.path=a,this.href=a,this.pathname=l[1],l[2]?(this.search=l[2],t?this.query=Yi.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var u=Dw.exec(a);if(u){u=u[0];var f=u.toLowerCase();this.protocol=f,a=a.substr(u.length)}if(n||u||a.match(/^\/\/[^@/]+@[^@/]+/)){var d=a.substr(0,2)==="//";d&&!(u&&Ji[u])&&(a=a.substr(2),this.slashes=!0)}if(!Ji[u]&&(d||u&&!Bn[u])){for(var p=-1,h=0;h<vu.length;h++){var m=a.indexOf(vu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}var g,v;p===-1?v=a.lastIndexOf("@"):v=a.lastIndexOf("@",p),v!==-1&&(g=a.slice(0,v),a=a.slice(v+1),this.auth=decodeURIComponent(g)),p=-1;for(var h=0;h<bu.length;h++){var m=a.indexOf(bu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}p===-1&&(p=a.length),this.host=a.slice(0,p),a=a.slice(p),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var y=this.hostname.split(/\./),h=0,x=y.length;h<x;h++){var w=y[h];if(w&&!w.match(wu)){for(var E="",S=0,k=w.length;S<k;S++)w.charCodeAt(S)>127?E+="x":E+=w[S];if(!E.match(wu)){var C=y.slice(0,h),T=y.slice(h+1),N=w.match(zw);N&&(C.push(N[1]),T.unshift(N[2])),T.length&&(a="/"+T.join(".")+a),this.hostname=C.join(".");break}}}this.hostname.length>qw?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=Lw.toASCII(this.hostname));var F=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Ww[f])for(var h=0,x=Ki.length;h<x;h++){var K=Ki[h];if(a.indexOf(K)!==-1){var re=encodeURIComponent(K);re===K&&(re=escape(K)),a=a.split(K).join(re)}}var ie=a.indexOf("#");ie!==-1&&(this.hash=a.substr(ie),a=a.slice(0,ie));var R=a.indexOf("?");if(R!==-1?(this.search=a.substr(R),this.query=a.substr(R+1),t&&(this.query=Yi.parse(this.query)),a=a.slice(0,R)):t&&(this.search="",this.query={}),a&&(this.pathname=a),Bn[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",P=this.search||"";this.path=F+P}return this.href=this.format(),this};function Vw(e){return typeof e=="string"&&(e=Wa(e)),e instanceof bt?e.format():bt.prototype.format.call(e)}bt.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",s=!1,o="";this.host?s=e+this.host:this.hostname&&(s=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Yi.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var i=this.search||o&&"?"+o||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Bn[t])&&s!==!1?(s="//"+(s||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):s||(s=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),n=n.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),i=i.replace("#","%23"),t+s+n+i+r};bt.prototype.resolve=function(e){return this.resolveObject(Wa(e,!1,!0)).format()};bt.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new bt;t.parse(e,!1,!0),e=t}for(var n=new bt,r=Object.keys(this),s=0;s<r.length;s++){var o=r[s];n[o]=this[o]}if(n.hash=e.hash,e.href==="")return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),a=0;a<i.length;a++){var l=i[a];l!=="protocol"&&(n[l]=e[l])}return Bn[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!Bn[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var d=u[f];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,!e.host&&!Ji[e.protocol]){for(var x=(e.pathname||"").split("/");x.length&&!(e.host=x.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),n.pathname=x.join("/")}else n.pathname=e.pathname;if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",h=n.search||"";n.path=p+h}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&n.pathname.charAt(0)==="/",g=e.host||e.pathname&&e.pathname.charAt(0)==="/",v=g||m||n.host&&e.pathname,j=v,y=n.pathname&&n.pathname.split("/")||[],x=e.pathname&&e.pathname.split("/")||[],w=n.protocol&&!Bn[n.protocol];if(w&&(n.hostname="",n.port=null,n.host&&(y[0]===""?y[0]=n.host:y.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(x[0]===""?x[0]=e.host:x.unshift(e.host)),e.host=null),v=v&&(x[0]===""||y[0]==="")),g)n.host=e.host||e.host===""?e.host:n.host,n.hostname=e.hostname||e.hostname===""?e.hostname:n.hostname,n.search=e.search,n.query=e.query,y=x;else if(x.length)y||(y=[]),y.pop(),y=y.concat(x),n.search=e.search,n.query=e.query;else if(e.search!=null){if(w){n.host=y.shift(),n.hostname=n.host;var E=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;E&&(n.auth=E.shift(),n.hostname=E.shift(),n.host=n.hostname)}return n.search=e.search,n.query=e.query,(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!y.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=y.slice(-1)[0],k=(n.host||e.host||y.length>1)&&(S==="."||S==="..")||S==="",C=0,T=y.length;T>=0;T--)S=y[T],S==="."?y.splice(T,1):S===".."?(y.splice(T,1),C++):C&&(y.splice(T,1),C--);if(!v&&!j)for(;C--;C)y.unshift("..");v&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),k&&y.join("/").substr(-1)!=="/"&&y.push("");var N=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(w){n.hostname=N?"":y.length?y.shift():"",n.host=n.hostname;var E=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;E&&(n.auth=E.shift(),n.hostname=E.shift(),n.host=n.hostname)}return v=v||n.host&&y.length,v&&!N&&y.unshift(""),y.length>0?n.pathname=y.join("/"):(n.pathname=null,n.path=null),(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n};bt.prototype.parseHost=function(){var e=this.host,t=Bw.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Kw=Wa,Su=Vw;const Jw=()=>Object.keys(Mn).map(e=>({...Mn[e].info,clients:Object.keys(Mn[e].clientsById).map(t=>Mn[e].clientsById[t].info)})),Yw=e=>typeof e=="object"&&"log"in e&&typeof e.log=="object"&&"entries"in e.log&&Array.isArray(e.log.entries);var Zw=class{constructor(e,t={}){this.initCalled=!1,this.entries=[],this.requests=[],this.options={},this.options={harIsAlreadyEncoded:!1,...t},this.requests=[],Yw(e)?this.entries=e.log.entries:this.entries=[{request:e}]}init(){return this.initCalled=!0,this.requests=this.entries.map(({request:e})=>{var n;const t={bodySize:0,headersSize:0,headers:[],cookies:[],httpVersion:"HTTP/1.1",queryString:[],postData:{mimeType:((n=e.postData)==null?void 0:n.mimeType)||"application/octet-stream"},...e};return t.postData&&!t.postData.mimeType&&(t.postData.mimeType="application/octet-stream"),this.prepare(t,this.options)}),this}prepare(e,t){var f,d,p;const n={...e,fullUrl:"",uriObj:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{}};if(n!=null&&n.queryString.length&&(n.queryObj=n.queryString.reduce(zc,{})),n!=null&&n.headers.length){const h=/^HTTP\/2/;n.headersObj=n.headers.reduce((m,{name:g,value:v})=>{const j=h.exec(n.httpVersion)?g.toLocaleLowerCase():g;return{...m,[j]:v}},{})}n!=null&&n.cookies.length&&(n.cookiesObj=n.cookies.reduceRight((h,{name:m,value:g})=>({...h,[m]:g}),{}));const r=(f=n.cookies)==null?void 0:f.map(({name:h,value:m})=>t.harIsAlreadyEncoded?`${h}=${m}`:`${encodeURIComponent(h)}=${encodeURIComponent(m)}`);switch(r!=null&&r.length&&(n.allHeaders.cookie=r.join("; ")),n.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(n.postData.text="",n.postData.mimeType="multipart/form-data",(d=n.postData)!=null&&d.params){const h="---011000010111000001101001",m=`${h}--`,g=`\r
176
- `;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const v=w=>w.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),j=w=>w.replace(/\r?\n|\r/g,`\r
177
- `),y=[`--${h}`];(p=n.postData)==null||p.params.forEach((w,E)=>{const S=w.name,k=w.value||"",C=w.fileName||null,T=w.contentType||"application/octet-stream";C?(y.push(`Content-Disposition: form-data; name="${v(j(S))}"; filename="${C}"`),y.push(`Content-Type: ${T}`)):y.push(`Content-Disposition: form-data; name="${escape(j(S))}"`),y.push(""),y.push(j(k)),E!==n.postData.params.length-1&&y.push(`--${h}`)}),y.push(`--${m}`),n.postData.boundary=h,n.postData.text=y.join(g);const x=Ze(n.headersObj,"content-type")||"content-type";n.headersObj[x]=`multipart/form-data; boundary=${h}`}break;case"application/x-www-form-urlencoded":n.postData.params?(n.postData.paramsObj=n.postData.params.reduce(zc,{}),n.postData.text=js.stringify(n.postData.paramsObj)):n.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(n.postData.mimeType="application/json",n.postData.text)try{n.postData.jsonObj=JSON.parse(n.postData.text)}catch{n.postData.mimeType="text/plain"}break}const s={...n.allHeaders,...n.headersObj},o=Kw(n.url,!0,!0);n.queryObj={...n.queryObj,...o.query};let i;t.harIsAlreadyEncoded?i=js.stringify(n.queryObj,{encode:!1,indices:!1}):i=js.stringify(n.queryObj,{indices:!1});const a={...o,query:n.queryObj,search:i,path:i?`${o.pathname}?${i}`:o.pathname},l=Su({...o,query:null,search:null}),u=Su({...o,...a});return{...n,allHeaders:s,fullUrl:u,url:l,uriObj:a}}convert(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{convert:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s(o,n))}installation(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{info:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s!=null&&s.installation?s.installation(o,n):!1)}};const Xw="shell",Qw="curl";function Gw(){return Jw()}function eS(e){var r;const t=e==null?void 0:e[0];if(!t)return"http://localhost";let n=t.url;for(const[s,o]of Object.entries(t.variables??{})){const i=o.default??((r=o.enum)==null?void 0:r[0])??`{${s}}`;n=n.replace(new RegExp(`\\{${s}\\}`,"g"),String(i))}return n}function tS(e){if(e.example!==void 0||e.examples&&Object.keys(e.examples).length>0)return!0;const t=e.schema;return!!((t==null?void 0:t.example)!==void 0||t!=null&&t.enum&&t.enum.length>0)}function tp(e){if(e.example!==void 0)return String(e.example);if(e.examples){for(const n of Object.values(e.examples))if(n&&typeof n=="object"&&"value"in n&&n.value!==void 0)return String(n.value)}const t=e.schema;return(t==null?void 0:t.example)!==void 0?String(t.example):t!=null&&t.enum&&t.enum.length>0?String(t.enum[0]):`{${e.name}}`}function nS(e,t,n){const r=t.replace(/\{([^}]+)\}/g,(s,o)=>{const i=n.find(l=>l.in==="path"&&l.name===o);if(!i)return s;const a=tp(i);return a===`{${o}}`?a:encodeURIComponent(a)});return`${e.replace(/\/$/,"")}${r}`}function rS(e,t){var s;const n=e[0];if(!n||!t)return[];const r=[];for(const o of Object.keys(n)){const i=t[o];if(i)if(i.type==="apiKey"){const a=i.in==="query"||i.in==="cookie"?i.in:"header";r.push({location:a,name:i.name,value:"YOUR_API_KEY"})}else if(i.type==="http"){const a=((s=i.scheme)==null?void 0:s.toLowerCase())==="basic";r.push({location:"header",name:"Authorization",value:a?"Basic BASE64_ENCODED_CREDENTIALS":"Bearer YOUR_ACCESS_TOKEN"})}else(i.type==="oauth2"||i.type==="openIdConnect")&&r.push({location:"header",name:"Authorization",value:"Bearer YOUR_ACCESS_TOKEN"})}return r}function sS(e){const t=e==null?void 0:e.content;if(!t)return null;const n="application/json"in t?"application/json":Object.keys(t)[0];if(!n)return null;const r=t[n];let s=r.example;if(s===void 0&&r.examples){for(const o of Object.values(r.examples))if(o&&typeof o=="object"&&"value"in o&&o.value!==void 0){s=o.value;break}}return{contentType:n,schema:r.schema,authorExample:s}}function oS(e){const t=eS(e.servers),n=nS(t,e.path,e.parameters),r=rS(e.security,e.securitySchemes),s=[],o=[],i=[];for(const l of r)(l.location==="header"?s:l.location==="query"?o:i).push({name:l.name,value:l.value});for(const l of e.parameters)l.in==="query"&&(l.required||tS(l))&&o.push({name:l.name,value:tp(l)});const a={method:e.method.toUpperCase(),url:n,httpVersion:"HTTP/1.1",headers:s,queryString:o,cookies:i};return e.media&&e.resolvedBodyValue!==void 0&&(s.push({name:"Content-Type",value:e.media.contentType}),a.postData={mimeType:e.media.contentType,text:JSON.stringify(e.resolvedBodyValue,null,2)}),a}function iS(e,t,n){try{const r=new Zw(e),[s]=r.convert(t,n);return typeof s=="string"?s:""}catch{return""}}const aS={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function lS(e){return aS[e]??"plaintext"}const cS={c:()=>Promise.resolve().then(()=>require("./c-C_Sx7N-F.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BcGgviMR.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-yuAGIuP4.cjs")),go:()=>Promise.resolve().then(()=>require("./go-BpetKc7b.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-BIk0G-rH.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-kGuORR5a.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-DF4zG2hq.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-nPcbuC2a.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-DKnYCg2f.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-CAnH__EC.cjs"))};function Zi(e){return e==="plaintext"||!!vt.getLanguage(e)}async function uS(e){if(Zi(e))return;const t=cS[e];if(!t)return;const n=await t();vt.registerLanguage(e,n.default)}const fS=`${Xw}:${Qw}`;function dS({method:e,path:t,parameters:n,requestBody:r,security:s,id:o}){var S;const{document:i,showCodeSamples:a}=ta(),l=i,u=A.useId(),f=A.useMemo(()=>Gw(),[]),[d,p]=A.useState(fS),[h,m]=d.split(":"),g=lS(h),v=A.useMemo(()=>sS(r),[r]),[j,y]=A.useState(void 0);A.useEffect(()=>{if(y(void 0),!v||v.authorExample!==void 0||!v.schema)return;let k=!1;return ib(v.schema).then(C=>{k||y(C)}),()=>{k=!0}},[v]);const[,x]=A.useState(()=>Zi(g));A.useEffect(()=>{x(Zi(g));let k=!1;return uS(g).then(()=>{k||x(!0)}),()=>{k=!0}},[g]);const w=A.useMemo(()=>{var k;return oS({method:e,path:t,servers:l.servers,parameters:n,security:s,securitySchemes:(k=l.components)==null?void 0:k.securitySchemes,media:v,resolvedBodyValue:(v==null?void 0:v.authorExample)??j})},[e,t,l.servers,n,s,(S=l.components)==null?void 0:S.securitySchemes,v,j]),E=A.useMemo(()=>iS(w,h,m),[w,h,m]);return a?c.jsxs("div",{id:`endpoint-${o}-code-samples`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("label",{htmlFor:u,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example Request"}),c.jsx("select",{id:u,value:d,onChange:k=>p(k.target.value),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:f.map(k=>c.jsx("optgroup",{label:k.title,children:k.clients.map(C=>c.jsx("option",{value:`${k.key}:${C.key}`,children:C.title},C.key))},k.key))})]}),c.jsx(_a,{code:E,language:g})]}):null}function pS({className:e}){return c.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("circle",{cx:"12",cy:"12",r:"9"}),c.jsx("path",{d:"M12 11v5"}),c.jsx("path",{d:"M12 8h.01"})]})}function np(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function hS(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${np(`$${n}`)}}`)}function mS(e){return e.operationId??e.operationRef??null}const gS=e=>e.trim().replace(/[.:;]+$/,""),di=({children:e})=>c.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function yS({links:e,onFollowOperation:t,isOperationKnown:n}){return c.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var f;const o=mS(s),i=Object.entries(s.parameters??{}),a=s.description?gS(s.description):null,l=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=a??o??r;return c.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[c.jsx(pS,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),c.jsxs("span",{children:[l?c.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):c.jsx("span",{className:"text-foreground-secondary",children:u}),i.length>0&&c.jsxs(c.Fragment,{children:[" using ",i.map(([d,p],h)=>c.jsxs(A.Fragment,{children:[h>0&&(h===i.length-1?" and ":", "),c.jsx(di,{children:d})," from ",c.jsx(di,{children:np(p)})]},d))]}),(f=s.server)!=null&&f.url?c.jsxs(c.Fragment,{children:[" via ",c.jsx(di,{children:s.server.url})]}):null,"."]})]},r)})})}function xS(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],o)=>oa.filter(i=>s==null?void 0:s[i]).map(i=>({name:t,url:r,method:i,op:s[i],urlIndex:o}))))}function bS({callbacks:e,id:t,renderOperation:n,depth:r}){const s=xS(e);return s.length===0?null:c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),c.jsx("div",{className:"space-y-2",children:s.map(({name:o,url:i,method:a,op:l,urlIndex:u})=>c.jsx($r,{trigger:c.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[c.jsx(Qt,{method:a,size:"xs",className:"shrink-0"}),c.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:o}),c.jsx("code",{className:"font-mono text-foreground-muted truncate",children:hS(i)})]}),children:c.jsx("div",{className:"px-4 py-3 border-t border-border",children:c.jsx(n,{method:a,path:i,op:l,id:`${t}-${o}-${u}-${a}`,idPrefix:"callback",depth:r+1})})},`${o}-${u}-${a}`))})]})}function vS(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function rp({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?c.jsx(c.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):c.jsxs(c.Fragment,{children:[e," (",c.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>c.jsx("option",{value:s,children:s},s))}),")"]})}function sp(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function wS(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function SS({responses:e,onFollowOperation:t,isOperationKnown:n}){var S,k;const r=Object.keys(e),[s,o]=A.useState(r[0]),i=e[s],a=Object.keys((i==null?void 0:i.content)??{}),[l,u]=A.useState(a[0]),f=l?(S=i==null?void 0:i.content)==null?void 0:S[l]:void 0,d=(i==null?void 0:i.headers)??{},p=(i==null?void 0:i.links)??{},[h,m]=A.useState("body"),g=a.length>0&&!!f,v=Object.keys(d).length>0,j=Object.keys(p).length>0,y=[...g?[{id:"body",name:"Body"}]:[],...v?[{id:"headers",name:"Headers"}]:[]],x=y.length>1,w=y.some(C=>C.id===h)?h:(k=y[0])==null?void 0:k.id,E=y.length>0;return A.useEffect(()=>{u(Object.keys((i==null?void 0:i.content)??{})[0]),m("body")},[s]),c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(C=>c.jsx("button",{role:"tab","aria-selected":s===C,onClick:()=>o(C),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${wS(C)} ${s===C?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:C},C))}),(i==null?void 0:i.description)&&c.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:i.description}),E?c.jsxs(c.Fragment,{children:[x&&c.jsx(Wn,{tabs:y,current:w,onChange:C=>m(C)}),c.jsx("div",{className:x?"mt-4":void 0,children:w==="headers"?c.jsx(yn,{schema:ES(d),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):c.jsx(yn,{schema:(f==null?void 0:f.schema)??{},label:c.jsx(rp,{prefix:"Body",mediaTypes:a,selected:l,onChange:u}),rootName:"Body",example:sp(f)},"body")})]}):c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&c.jsx(yS,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function op(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const jS=e=>op(e),ES=e=>op(Object.entries(e).map(([t,n])=>({name:t,...n})));function kS({parameters:e}){var a;const t=ch.filter(({location:l})=>e.some(u=>u.in===l)),[n,r]=A.useState(((a=t[0])==null?void 0:a.location)??null);if(t.length===0)return null;const s=t.some(l=>l.location===n)?n:t[0].location,o=t.find(l=>l.location===s),i=jS(e.filter(l=>l.in===s));return c.jsxs("div",{children:[t.length>1&&c.jsx(Wn,{tabs:t.map(({location:l,label:u})=>({id:l,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),c.jsx("div",{className:t.length>1?"mt-4":void 0,children:c.jsx(yn,{schema:i,label:o.label,rootName:o.label,defaultView:"schema"})})]})}function AS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,o=Object.keys(n),i=o.length>0,[a,l]=A.useState(s?"parameters":"body"),[u,f]=A.useState(o[0]),d=u?n[u]:void 0;if(!s&&!i)return c.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[i?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[c.jsx("span",{className:"font-bold",children:e})," expects the following ",TS(p),":"]}),s&&i&&c.jsx(Wn,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:a,onChange:h=>l(h)}),c.jsxs("div",{className:s&&i?"mt-4":void 0,children:[(a==="parameters"||!i)&&s&&c.jsx(kS,{parameters:t}),(a==="body"||!s)&&i&&d&&c.jsx(yn,{schema:d.schema??{},label:c.jsx(rp,{prefix:"Request Body",mediaTypes:o,selected:u,onChange:f}),rootName:"Body ",description:r,example:sp(d)})]})]})}function TS(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function OS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:o,id:i,depth:a,fillHeight:l=!1,onFollowOperation:u,isOperationKnown:f}){const d=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!o&&Object.keys(o).length>0&&a<NS,m=[...d?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[g,v]=A.useState(m[0]??"request");if(m.length===0)return null;const j=m.includes(g)?g:m[0];return c.jsxs("div",{className:l?"flex-1 flex flex-col min-h-0":void 0,children:[c.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(y=>c.jsx("button",{role:"tab","aria-selected":j===y,onClick:()=>v(y),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===y?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:y},y))}),c.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${l?"flex-1 -mb-4":""}`,children:[j==="request"&&c.jsx(AS,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&c.jsx(SS,{responses:s,onFollowOperation:u,isOperationKnown:f}),j==="callbacks"&&o&&c.jsx(bS,{callbacks:o,id:i,depth:a,renderOperation:ip})]})]})}const NS=1;function ip({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:o,securitySchemes:i,onFollowOperation:a,isOperationKnown:l,depth:u=0}){var y,x,w;const f=(n.parameters??[]).filter(E=>E.in!=="query"&&E.in!=="path"),d=n.security??o??[],p=n.responses??{},h=((y=n.requestBody)==null?void 0:y.content)??{},m=n.operationId?vS(n.operationId):`${e.toUpperCase()} ${t}`,g=new Map;for(const E of d)for(const[S,k]of Object.entries(E)){if(k.length===0)continue;const C=g.get(S)??[];g.set(S,Array.from(new Set([...C,...k])))}const v=Array.from(new Set(d.flatMap(E=>Object.keys(E)))).map(E=>{const S=i==null?void 0:i[E];if(!S)return null;const k=g.get(E);return k?{...S,requiredScopes:k}:S}).filter(E=>!!E),j=u===0;return c.jsxs("div",{className:`flex flex-col gap-6 ${j?"min-h-full":""}`,id:`${s}-${r}-detail`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&c.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((x=n.externalDocs)==null?void 0:x.url)&&c.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",c.jsx(Js,{className:"w-3.5 h-3.5"})]})]}),n.summary&&c.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&c.jsx(wt,{children:n.description}),c.jsx(dS,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:d,id:r}),d.length>0&&c.jsxs("div",{id:`${s}-${r}-security`,children:[c.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),v.length>0&&c.jsx($r,{className:"mt-3",trigger:c.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[c.jsx(fd,{className:"h-4 w-4 text-foreground-muted"}),c.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:v.length})]}),children:c.jsx("div",{className:"px-4 py-2 border-t border-border",children:c.jsx($a,{securities:v})})})]}),c.jsx(OS,{label:m,parameters:f,requestBodyContent:h,requestBodyDescription:(w=n.requestBody)==null?void 0:w.description,responses:p,callbacks:n.callbacks,id:r,depth:u,fillHeight:j,onFollowOperation:a,isOperationKnown:l})]})}function CS(e,t){const n=t.filter(r=>r.in==="query");return n.length===0?e:`${e}?${n.map(r=>`${r.name}={${r.name}}`).join("&")}`}function ju(e){var n;const t={};for(const r of e){const s=r.schema;t[r.name]={description:r.description,type:s==null?void 0:s.type,default:(s==null?void 0:s.default)!==void 0?String(s.default):void 0,enum:(n=s==null?void 0:s.enum)==null?void 0:n.map(String),examples:"example"in r&&r.example!==void 0?[String(r.example)]:void 0}}return t}function zs({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,showCopyMarkdown:o,columnLabel:i="Path",idPrefix:a="endpoint"}){var w;const l=E=>s==null?void 0:s(E),{document:u,deref:f}=Ve(),d=u,p=A.useMemo(()=>ks(e),[e]),h=A.useMemo(()=>{var S,k;const E=new Map;for(const{key:C,method:T,path:N}of p){const F=(k=(S=e[N])==null?void 0:S[T])==null?void 0:k.operationId;F&&E.set(F,C)}return E},[p,e]);if(p.length===0)return null;const m=r?p.find(E=>E.key===r):null,g=m?(w=e[m.path])==null?void 0:w[m.method]:null,v=p.map(({key:E,method:S,path:k})=>{var N;const C=r===E,T=_l(e[k],(N=e[k])==null?void 0:N[S]);return c.jsxs("tr",{id:`${a}-${E}`,onClick:()=>l(E),role:"button",tabIndex:0,"aria-label":`${S.toUpperCase()} ${k}`,"aria-current":C?"true":void 0,onKeyDown:F=>{F.key!=="Enter"&&F.key!==" "||(F.preventDefault(),l(E))},className:`group cursor-pointer ${C?"bg-neutral-50":""}`,children:[c.jsx("td",{className:"px-6 py-2 max-w-0 w-full group-hover:bg-neutral-50",children:c.jsx(Xt,{address:k,parameters:ju(T),truncate:!0,className:"text-xs"})}),c.jsx("td",{className:"px-6 py-2 w-28 group-hover:bg-neutral-50",children:c.jsx(Qt,{method:S,className:"w-20"})})]},E)}),j=_l(m?e[m.path]:void 0,g),y=m?c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(Qt,{method:m.method}),c.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:c.jsx(Xt,{address:CS(m.path,j),parameters:ju(j),className:"text-xs"})})]}):r,x=c.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{className:"bg-neutral-100 w-full",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),c.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),c.jsx("tbody",{className:"bg-surface divide-y divide-border",children:v})]})});return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex justify-center w-full",children:c.jsx(Gt,{content:x,stickySideContent:!1})}),c.jsx(yd,{isOpen:!!m,side:"right",onClose:()=>l(null),title:y,headerActions:m&&g&&o?c.jsx(xd,{getMarkdown:()=>Xm(d,m.method,m.path,f),label:"Copy endpoint for LLM"}):void 0,children:m&&g&&c.jsx(ip,{method:m.method,path:m.path,op:{...g,parameters:j},id:m.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:E=>h.has(E),onFollowOperation:E=>{const S=h.get(E);S&&l(S)}})})]})}const _S=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function RS({openapi:e,config:t}){var S,k,C,T;const n=t.show??{},r=e.webhooks??{},s=Object.keys(r).length>0,o=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Ks}]:[],...s&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:ia}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:sa}]:[]],{query:i,setQuery:a,results:l}=sb(e,{threshold:.3,limit:20}),{effectiveTab:u,focusTab:f,navActiveSection:d,selected:p,setSelectedKey:h,selectedNavItem:m,handleSearchSelect:g,handleNavItemSelect:v,handleNavServerSelect:j,handleContentTabChange:y,schemaFocusTarget:x}=Yu({tabs:o,defaultTab:"endpoints",isTabKey:_S,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:s&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:i}),w=(e.servers??[]).map(N=>N.url),E=u==="endpoints"?c.jsx(zs,{paths:e.paths??{},security:e.security,securitySchemes:(S=e.components)==null?void 0:S.securitySchemes,selectedKey:p.endpoints,onSelectKey:N=>h("endpoints",N),showCopyMarkdown:n.copyMarkdown!==!1}):u==="webhooks"?c.jsx(zs,{paths:r,security:e.security,securitySchemes:(k=e.components)==null?void 0:k.securitySchemes,selectedKey:p.webhooks,onSelectKey:N=>h("webhooks",N),columnLabel:"Webhook",idPrefix:"webhook",showCopyMarkdown:n.copyMarkdown!==!1}):u==="schemas"?c.jsx(no,{schemas:((C=e.components)==null?void 0:C.schemas)??{},selectedKey:p.schemas,focusTarget:x}):null;return c.jsx(La,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:c.jsxs("div",{className:"px-4",children:[n.search!==!1&&c.jsx(Lu,{query:i,onQueryChange:a,results:l,onSelectResult:g}),n.copyMarkdown!==!1&&c.jsx(Du,{serialize:N=>Zm(e,N),leftOffset:n.search!==!1?60:12}),n.info!==!1&&c.jsx("div",{id:"info-panel",children:c.jsx(wd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs})}),n.servers!==!1&&w.length>0&&c.jsx("div",{id:p.servers??"server-0",children:c.jsx(Sd,{servers:e.servers,selectedServer:p.servers,onSelectServer:N=>h("servers",N)})}),n.sidebar!==!1&&c.jsx(kh,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:s&&n.webhooks!==!1?r:void 0,schemas:n.schemas!==!1?(T=e.components)==null?void 0:T.schemas:void 0,servers:n.servers!==!1?w:void 0,hasInfo:n.info!==!1,activeTab:d,onTabChange:f,onItemSelect:v,onSelectServer:j,selectedItem:m}),c.jsx(Ou,{tabs:o,current:u,onChange:y}),u&&c.jsx("div",{id:`panel-${u}`,role:"tabpanel","aria-labelledby":`tab-${u}`,children:E})]})})}const Va=e=>{const t=e.openapi,n=A.useMemo(()=>Tr(t),[t]),r=e.kind;A.useEffect(()=>{r==="resolved"&&n!==t&&ea(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??zn;return c.jsx(RS,{openapi:n,config:s})};function ap(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=o=>{const i=s(o);return i!==void 0?i:n(o)?t:void 0}}const IS=["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 PS(){return{validate:MS,parse:LS,getMimeTypes:()=>IS}}function $S(e){ap(e,PS(),Or)}function MS(e){return ma(e.data).map(t=>({message:t,path:e.path}))}function LS(e){var n,r;const t=ma(e.data);if(t.length>0)return{[Ns]:t[0]};try{const s=Ti(e.data),o=e.meta.message,i=(r=(n=o==null?void 0:o.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return i&&o&&(o["x-parser-original-bindings-kafka-key"]=i,o.bindings.kafka.key=Ti(i)),s}catch(s){return{[Ns]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function DS(){try{const e=await Promise.resolve().then(()=>require("./index-ArzwV232.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 lp(e){try{const t=await DS(),n=new t;$S(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-7SgmMhQd.cjs"));r(n);const{document:s,diagnostics:o}=await n.parse(e);return{diagnostics:o,document:s?FS(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function BS(e,t){const{diagnostics:n,document:r}=await lp(e);return{diagnostics:n,view:r?c.jsx(Ma,{kind:"resolved",asyncapi:r,config:t}):null}}function FS(e){return e.json()}function US({raw:e,config:t,onDiagnostics:n}){const[r,s]=A.useState(null),o=A.useRef(n);return o.current=n,A.useEffect(()=>{let i=!0;return lp(e).then(({document:a,diagnostics:l})=>{var u;i&&(s(a),(u=o.current)==null||u.call(o,l))}),()=>{i=!1}},[e]),r?c.jsx(Ma,{kind:"resolved",asyncapi:r,config:t}):null}async function HS(){try{return await Promise.resolve().then(()=>require("./index-C278WDNb.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const pi=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function cp(e){try{const{validate:t,dereference:n}=await HS(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(a=>pi(a,0)),document:null};const s=(r.errors??[]).map(a=>pi(a,1)),{schema:o,errors:i}=n(e);return i!=null&&i.length&&s.push(...i.map(a=>pi(a,0))),{diagnostics:s,document:o??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function qS(e,t){const{diagnostics:n,document:r}=await cp(e);return{diagnostics:n,view:r?c.jsx(Va,{kind:"resolved",openapi:r,config:t}):null}}function zS({raw:e,config:t,onDiagnostics:n}){const[r,s]=A.useState(null),o=A.useRef(n);return o.current=n,A.useEffect(()=>{let i=!0;return cp(e).then(({document:a,diagnostics:l})=>{var u;i&&(s(a),(u=o.current)==null||u.call(o,l))}),()=>{i=!1}},[e]),r?c.jsx(Va,{kind:"resolved",openapi:r,config:t}):null}function up(e,t,n){return function({document:s,config:o,children:i}){const a=A.useContext(Ws),l=A.useMemo(()=>s?Tr(s):null,[s]),u=!!a&&a.specType!==n;if(A.useEffect(()=>{u&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${a.specType} document provider, which cannot supply the document it needs. `+(l?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[a,u,l]),a&&!u)return c.jsx(c.Fragment,{children:i});if(!l){if(a)return c.jsx(c.Fragment,{children:i});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return c.jsx(e,{document:l,config:o,children:i})}}function WS({document:e,config:t,children:n}){const r=A.useMemo(()=>Tr(e),[e]);return c.jsx(na,{document:r,config:t,children:n})}const Br=up(na,"AsyncAPI","asyncapi");function Fr(){const e=Ve();return e.specType==="asyncapi",e.document}function VS(){const e=Fr();return!e.servers||Object.keys(e.servers).length===0?null:c.jsx(gd,{servers:e.servers})}function KS(e){return c.jsx(Br,{...e,children:c.jsx(VS,{})})}function JS(){const e=Fr(),[t,n]=A.useState(null);return c.jsx(vd,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function YS(e){return c.jsx(Br,{...e,children:c.jsx(JS,{})})}function ZS(){var t;const e=Fr();return c.jsx(cd,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function XS(e){return c.jsx(Br,{...e,children:c.jsx(ZS,{})})}function QS(){var t;const e=Fr();return c.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function GS(e){return c.jsx(Br,{...e,children:c.jsx(QS,{})})}function ej(){const e=Fr();return e.info?c.jsx(Mf,{...e.info}):null}function tj(e){return c.jsx(Br,{...e,children:c.jsx(ej,{})})}function nj({document:e,config:t,children:n}){const r=A.useMemo(()=>Tr(e),[e]);return c.jsx(La,{document:r,config:t,children:n})}const Ur=up(La,"OpenAPI","openapi");function Hr(){const e=ta();return e.specType==="openapi",e.document}function rj(){const e=Hr();return!e.servers||e.servers.length===0?null:c.jsx(Sd,{servers:e.servers})}function sj(e){return c.jsx(Ur,{...e,children:c.jsx(rj,{})})}function oj(){var r;const e=Hr(),[t,n]=A.useState(null);return c.jsx(zs,{paths:e.paths??{},security:e.security,securitySchemes:(r=e.components)==null?void 0:r.securitySchemes,selectedKey:t,onSelectKey:n})}function ij(e){return c.jsx(Ur,{...e,children:c.jsx(oj,{})})}function aj(){var s;const e=Hr(),[t,n]=A.useState(null),r=e.webhooks??{};return Object.keys(r).length===0?null:c.jsx(zs,{paths:r,security:e.security,securitySchemes:(s=e.components)==null?void 0:s.securitySchemes,selectedKey:t,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook"})}function lj(e){return c.jsx(Ur,{...e,children:c.jsx(aj,{})})}function cj(){var t;const e=Hr();return c.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function uj(e){return c.jsx(Ur,{...e,children:c.jsx(cj,{})})}function fj(){const e=Hr();return e.info?c.jsx(wd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs}):null}function dj(e){return c.jsx(Ur,{...e,children:c.jsx(fj,{})})}exports.AsyncAPI=Ma;exports.AsyncAPIProvider=WS;exports.AsyncAPIRenderer=US;exports.Info=tj;exports.Messages=XS;exports.OpenAPI=Va;exports.OpenAPIEndpoints=ij;exports.OpenAPIInfo=dj;exports.OpenAPIProvider=nj;exports.OpenAPIRenderer=zS;exports.OpenAPISchemas=uj;exports.OpenAPIServers=sj;exports.OpenAPIWebhooks=lj;exports.Operations=YS;exports.SchemaTabs=yn;exports.SchemaTree=Pa;exports.Schemas=GS;exports.Servers=KS;exports.X_LIB_CONVERSION_ERROR=Ns;exports.commonjsGlobal=wr;exports.defaultConfig=zn;exports.getDefaultExportFromCjs=Zs;exports.isProtobufSchemaFormat=Nr;exports.parseAndRender=BS;exports.parseAndRender$1=qS;exports.registerSchemaParserWithFallback=ap;exports.require$$0=Td;exports.useAsyncAPIDocument=Ve;