@mcp-use/inspector 5.0.0-canary.4 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -337,7 +337,7 @@ void main() {
337
337
 
338
338
  fragColor = vec4(color, opacity);
339
339
  }
340
- `;function ku(e){if(Array.isArray(e))return e.length===4?e:e.length===3?[...e,1]:Fu;if(typeof e!=`string`)return Fu;let t,n,r,i=1;if(e.startsWith(`#`))[t,n,r,i]=Au(e);else if(e.startsWith(`rgb`))[t,n,r,i]=ju(e);else if(e.startsWith(`hsl`))[t,n,r,i]=Nu(Mu(e));else return console.error(`Unsupported color format`,e),Fu;return[Pu(t,0,1),Pu(n,0,1),Pu(r,0,1),Pu(i,0,1)]}function Au(e){return e=e.replace(/^#/,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``)),e.length===6&&(e+=`ff`),[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255,parseInt(e.slice(6,8),16)/255]}function ju(e){let t=e.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([0-9.]+))?\s*\)$/i);return t?[parseInt(t[1]??`0`)/255,parseInt(t[2]??`0`)/255,parseInt(t[3]??`0`)/255,t[4]===void 0?1:parseFloat(t[4])]:[0,0,0,1]}function Mu(e){let t=e.match(/^hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([0-9.]+))?\s*\)$/i);return t?[parseInt(t[1]??`0`),parseInt(t[2]??`0`),parseInt(t[3]??`0`),t[4]===void 0?1:parseFloat(t[4])]:[0,0,0,1]}function Nu(e){let[t,n,r,i]=e,a=t/360,o=n/100,s=r/100,c,l,u;if(n===0)c=l=u=s;else{let e=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),t=s<.5?s*(1+o):s+o-s*o,n=2*s-t;c=e(n,t,a+1/3),l=e(n,t,a),u=e(n,t,a-1/3)}return[c,l,u,i]}var Pu=(e,t,n)=>Math.min(Math.max(e,t),n),Fu=[0,0,0,1];function Iu(e){let t=w.useRef(void 0),n=w.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return w.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}function Lu(e){if(e.naturalWidth<1024&&e.naturalHeight<1024){if(e.naturalWidth<1||e.naturalHeight<1)return;let t=e.naturalWidth/e.naturalHeight;e.width=Math.round(t>1?1024*t:1024),e.height=Math.round(t>1?1024:1024/t)}}async function Ru(e){let t={},n=[],r=e=>{try{return e.startsWith(`/`)||new URL(e),!0}catch{return!1}},i=e=>{try{return e.startsWith(`/`)?!1:new URL(e,window.location.origin).origin!==window.location.origin}catch{return!1}};return Object.entries(e).forEach(([e,a])=>{if(typeof a==`string`){let o=a||`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`;if(!r(o)){console.warn(`Uniform "${e}" has invalid URL "${o}". Skipping image loading.`);return}let s=new Promise((n,r)=>{let a=new Image;i(o)&&(a.crossOrigin=`anonymous`),a.onload=()=>{Lu(a),t[e]=a,n()},a.onerror=()=>{console.error(`Could not set uniforms. Failed to load image at ${o}`),r()},a.src=o});n.push(s)}else a instanceof HTMLImageElement&&Lu(a),t[e]=a}),await Promise.all(n),t}var zu=(0,w.forwardRef)(function({fragmentShader:e,uniforms:t,webGlContextAttributes:n,speed:r=0,frame:i=0,width:a,height:o,minPixelRatio:s,maxPixelCount:c,mipmaps:l,style:u,...d},f){let[p,m]=(0,w.useState)(!1),h=(0,w.useRef)(null),g=(0,w.useRef)(null),_=(0,w.useRef)(n);return(0,w.useEffect)(()=>((async()=>{let n=await Ru(t);h.current&&!g.current&&(g.current=new gu(h.current,e,n,_.current,r,i,s,c,l),m(!0))})(),()=>{g.current?.dispose(),g.current=null}),[e]),(0,w.useEffect)(()=>{let e=!1;return(async()=>{let n=await Ru(t);e||g.current?.setUniforms(n)})(),()=>{e=!0}},[t,p]),(0,w.useEffect)(()=>{g.current?.setSpeed(r)},[r,p]),(0,w.useEffect)(()=>{g.current?.setMaxPixelCount(c)},[c,p]),(0,w.useEffect)(()=>{g.current?.setMinPixelRatio(s)},[s,p]),(0,w.useEffect)(()=>{g.current?.setFrame(i)},[i,p]),(0,S.jsx)(`div`,{ref:Iu([h,f]),style:a!==void 0||o!==void 0?{width:typeof a==`string`&&isNaN(+a)===!1?+a:a,height:typeof o==`string`&&isNaN(+o)===!1?+o:o,...u}:u,...d})});zu.displayName=`ShaderMount`;function Bu(e,t){for(let n in e){if(n===`colors`){let n=Array.isArray(e.colors),r=Array.isArray(t.colors);if(!n||!r){if(Object.is(e.colors,t.colors)===!1)return!1;continue}if(e.colors?.length!==t.colors?.length||!e.colors?.every((e,n)=>e===t.colors?.[n]))return!1;continue}if(Object.is(e[n],t[n])===!1)return!1}return!0}var Vu={name:`Default`,params:{...Su,speed:1,frame:0,colors:[`#e0eaff`,`#241d9a`,`#f75092`,`#9f50d3`],distortion:.8,swirl:.1,grainMixer:0,grainOverlay:0}};({...Su}),{...Su},{...Su};var Hu=(0,w.memo)(function({speed:e=Vu.params.speed,frame:t=Vu.params.frame,colors:n=Vu.params.colors,distortion:r=Vu.params.distortion,swirl:i=Vu.params.swirl,grainMixer:a=Vu.params.grainMixer,grainOverlay:o=Vu.params.grainOverlay,fit:s=Vu.params.fit,rotation:c=Vu.params.rotation,scale:l=Vu.params.scale,originX:u=Vu.params.originX,originY:d=Vu.params.originY,offsetX:f=Vu.params.offsetX,offsetY:p=Vu.params.offsetY,worldWidth:m=Vu.params.worldWidth,worldHeight:h=Vu.params.worldHeight,...g}){let _={u_colors:n.map(ku),u_colorsCount:n.length,u_distortion:r,u_swirl:i,u_grainMixer:a,u_grainOverlay:o,u_fit:Cu[s],u_rotation:c,u_scale:l,u_offsetX:f,u_offsetY:p,u_originX:u,u_originY:d,u_worldWidth:m,u_worldHeight:h};return(0,S.jsx)(zu,{...g,speed:e,frame:t,fragmentShader:Ou,uniforms:_})},Bu),Uu=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Wu=`VisuallyHidden`,Gu=w.forwardRef((e,t)=>(0,S.jsx)(Jt.span,{...e,ref:t,style:{...Uu,...e.style}}));Gu.displayName=Wu;var Ku=Gu,[qu,Ju]=Nt(`Tooltip`,[aa]),Yu=aa(),Xu=`TooltipProvider`,Zu=700,Qu=`tooltip.open`,[$u,ed]=qu(Xu),td=e=>{let{__scopeTooltip:t,delayDuration:n=Zu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=w.useRef(!0),s=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,S.jsx)($u,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:w.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};td.displayName=Xu;var nd=`Tooltip`,[rd,id]=qu(nd),ad=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ed(nd,e.__scopeTooltip),l=Yu(t),[u,d]=w.useState(null),f=Fn(),p=w.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=w.useRef(!1),[_,v]=Lt({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qu))):c.onClose(),a?.(e)},caller:nd}),y=w.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=w.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=w.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=w.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return w.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,S.jsx)(xa,{...l,children:(0,S.jsx)(rd,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?C():b()},[c.isOpenDelayedRef,C,b]),onTriggerLeave:w.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ad.displayName=nd;var od=`TooltipTrigger`,sd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=id(od,n),a=ed(od,n),o=Yu(n),s=D(t,w.useRef(null),i.onTriggerChange),c=w.useRef(!1),l=w.useRef(!1),u=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,S.jsx)(Sa,{asChild:!0,...o,children:(0,S.jsx)(Jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:jt(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:jt(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:jt(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:jt(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:jt(e.onBlur,i.onClose),onClick:jt(e.onClick,i.onClose)})})});sd.displayName=od;var cd=`TooltipPortal`,[ld,ud]=qu(cd,{forceMount:void 0}),dd=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=id(cd,t);return(0,S.jsx)(ld,{scope:t,forceMount:n,children:(0,S.jsx)(Oa,{present:n||a.open,children:(0,S.jsx)(Ea,{asChild:!0,container:i,children:r})})})};dd.displayName=cd;var fd=`TooltipContent`,pd=w.forwardRef((e,t)=>{let n=ud(fd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=id(fd,e.__scopeTooltip);return(0,S.jsx)(Oa,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(vd,{side:i,...a,ref:t}):(0,S.jsx)(md,{side:i,...a,ref:t})})}),md=w.forwardRef((e,t)=>{let n=id(fd,e.__scopeTooltip),r=ed(fd,e.__scopeTooltip),i=w.useRef(null),a=D(t,i),[o,s]=w.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{s(null),d(!1)},[d]),p=w.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Sd(r,xd(r,n.getBoundingClientRect())),a=Cd(t.getBoundingClientRect());s(Td([...i,...a])),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),w.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!wd(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,S.jsx)(vd,{...e,ref:a})}),[hd,gd]=qu(nd,{isInside:!1}),_d=Wt(`TooltipContent`),vd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=id(fd,n),l=Yu(n),{onClose:u}=c;return w.useEffect(()=>(document.addEventListener(Qu,u),()=>document.removeEventListener(Qu,u)),[u]),w.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,S.jsx)(cn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,S.jsxs)(Ca,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,S.jsx)(_d,{children:r}),(0,S.jsx)(hd,{scope:n,isInside:!0,children:(0,S.jsx)(Ku,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});pd.displayName=fd;var yd=`TooltipArrow`,bd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Yu(n);return gd(yd,n).isInside?null:(0,S.jsx)(wa,{...i,...r,ref:t})});bd.displayName=yd;function xd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Sd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Cd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function wd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Td(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ed(t)}function Ed(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Dd=td,Od=ad,kd=sd,Ad=dd,jd=pd,Md=bd;function Nd({delayDuration:e=0,...t}){return(0,S.jsx)(Dd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Pd({...e}){return(0,S.jsx)(Nd,{children:(0,S.jsx)(Od,{"data-slot":`tooltip`,...e})})}function Fd({...e}){return(0,S.jsx)(kd,{"data-slot":`tooltip-trigger`,...e})}function Id({className:e,sideOffset:t=0,children:n,...r}){return(0,S.jsx)(Ad,{children:(0,S.jsxs)(jd,{"data-slot":`tooltip-content`,sideOffset:t,className:H(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,S.jsx)(Md,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var Ld=class{name=`mcp_inspector_open`;properties;constructor(e){this.properties={server_url:e.serverUrl,connection_count:e.connectionCount}}},Rd=class{name=`mcp_tool_execution`;properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId,success:e.success,duration:e.duration,error:e.error}}},zd=class{name=`mcp_resource_read`;properties;constructor(e){this.properties={resource_uri:e.resourceUri,server_id:e.serverId,success:e.success,error:e.error}}},Bd=class{name=`mcp_prompt_call`;properties;constructor(e){this.properties={prompt_name:e.promptName,server_id:e.serverId,success:e.success,error:e.error}}},Vd=class{name=`mcp_server_connection`;properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,success:e.success,connection_type:e.connectionType,error:e.error}}},Hd=class{name=`mcp_chat_message`;properties;constructor(e){this.properties={server_id:e.serverId,provider:e.provider,model:e.model,message_count:e.messageCount,tool_calls_count:e.toolCallsCount,success:e.success,execution_mode:e.executionMode,duration:e.duration,error:e.error}}},Ud=class{name=`mcp_server_added`;properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,connection_type:e.connectionType,via_proxy:e.viaProxy}}},Wd=class{name=`mcp_server_removed`;properties;constructor(e){this.properties={server_id:e.serverId}}},Gd=class{name=`mcp_command_palette_open`;properties;constructor(e){this.properties={trigger:e.trigger}}},Kd=class{name=`mcp_tool_saved`;properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId}}},qd=class{name=`mcp_tunnel_action`;properties;constructor(e){this.properties={action:e.action,success:e.success,tunnel_url:e.tunnelUrl}}},Jd=class{name=`mcp_deploy_click`;properties;constructor(e){this.properties={referrer:e.referrer}}},Yd=class{name=`mcp_chat_configured`;properties;constructor(e){this.properties={provider:e.provider,model:e.model}}},Xd=class{name=`mcp_tab_navigation`;properties;constructor(e){this.properties={tab:e.tab,previous_tab:e.previousTab}}},Zd=class{name=`mcp_add_to_client`;properties;constructor(e){this.properties={client:e.client}}},Qd=class{name=`mcp_session_duration`;properties;constructor(e){this.properties={duration_seconds:e.durationSeconds,tabs_visited:e.tabsVisited,tools_executed:e.toolsExecuted}}};function $d(){try{return`5.0.0-canary.4`}catch{return`0.0.0`}}function ef(){try{return typeof window<`u`&&typeof document<`u`}catch{return!1}}var tf=class{endpoint;timeout;constructor(e,t=3e3){this.endpoint=e,this.timeout=t}async logEvent(e){try{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout),r=await fetch(this.endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:t.signal});if(clearTimeout(n),!r.ok)throw Error(`HTTP error! status: ${r.status}`)}catch{}}};function nf(e){return`mcp_inspector_telemetry_${e}`}function rf(){if(typeof window>`u`)return`standalone`;let e=window.__MCP_INSPECTOR_MODE__;return e===`standalone`||e===`embedded`||e===`cloud`?e:`standalone`}function af(){return typeof localStorage<`u`&&typeof localStorage.getItem==`function`&&typeof localStorage.setItem==`function`}var of=class e{static instance=null;POSTHOG_PROXY_URL=`/inspector/api/tel/posthog`;SCARF_PROXY_URL=`/inspector/api/tel/scarf`;UNKNOWN_USER_ID=`UNKNOWN_USER_ID`;_currUserId=null;_posthogClient=null;_scarfClient=null;_source=`inspector`;_mode=`standalone`;constructor(){let e=ef(),t=this.isTelemetryDisabled();if(this._source=this.getStoredSource()||`inspector`,this._mode=rf(),t)this._posthogClient=null,this._scarfClient=null;else if(!e)this._posthogClient=null,this._scarfClient=null;else{try{this._posthogClient=new tf(this.POSTHOG_PROXY_URL,3e3)}catch{this._posthogClient=null}try{this._scarfClient=new tf(this.SCARF_PROXY_URL,3e3)}catch{this._scarfClient=null}}}isTelemetryDisabled(){return!!(af()&&localStorage.getItem(nf(`disabled`))===`true`||typeof process<`u`&&{}?.MCP_USE_ANONYMIZED_TELEMETRY===`false`)}getStoredSource(){return af()?localStorage.getItem(nf(`source`)):null}static getInstance(){return e.instance||=new e,e.instance}setSource(e){this._source=e,af()&&localStorage.setItem(nf(`source`),e)}getSource(){return this._source}getMode(){return this._mode}get userId(){if(this._currUserId)return this._currUserId;if(!ef())return this._currUserId=this.UNKNOWN_USER_ID,this._currUserId;try{if(!af())throw Error(`localStorage is not available or not functional`);let e=localStorage.getItem(nf(`user_id`));if(e)this._currUserId=e;else{let e=this.generateUserId();localStorage.setItem(nf(`user_id`),e),this._currUserId=e}this.trackPackageDownload({triggered_by:`user_id_property`}).catch(()=>{})}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}generateUserId(){let e=window.crypto;if(e){let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``);return n.slice(0,8)+`-`+n.slice(8,12)+`-`+n.slice(12,16)+`-`+n.slice(16,20)+`-`+n.slice(20,32)}else return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}async capture(e){if(!(!this._posthogClient&&!this._scarfClient)){if(this._posthogClient)try{let t={event:e.name,user_id:this.userId,properties:{...e.properties,mcp_use_version:$d(),language:`typescript`,source:this._source,package:`inspector`,mode:this._mode}};await this._posthogClient.logEvent(t)}catch{}if(this._scarfClient)try{let t={};t.mcp_use_version=$d(),t.user_id=this.userId,t.event=e.name,t.language=`typescript`,t.source=this._source,t.package=`inspector`,t.mode=this._mode,await this._scarfClient.logEvent(t)}catch{}}}async trackPackageDownload(e){if(this._scarfClient&&ef())try{if(!af())throw Error(`localStorage is not available or not functional`);let t=$d(),n=!1,r=!1,i=localStorage.getItem(nf(`download_version`));if(i?t>i&&(n=!0,r=!1,localStorage.setItem(nf(`download_version`),t)):(n=!0,r=!0,localStorage.setItem(nf(`download_version`),t)),n){let n={...e||{}};n.mcp_use_version=t,n.user_id=this.userId,n.event=`package_download`,n.first_download=r,n.language=`typescript`,n.source=this._source,n.package=`inspector`,n.mode=this._mode,await this._scarfClient.logEvent(n)}}catch{}}async trackInspectorOpen(e){let t=new Ld(e);await this.capture(t)}},sf=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),cf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),lf=e=>{let t=cf(e);return t.charAt(0).toUpperCase()+t.slice(1)},uf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),df=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},ff={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},pf=(0,w.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,w.createElement)(`svg`,{ref:c,...ff,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:uf(`lucide`,i),...!a&&!df(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),mf=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(pf,{ref:i,iconNode:t,className:uf(`lucide-${sf(lf(e))}`,`lucide-${e}`,n),...r}));return n.displayName=lf(e),n},hf=mf(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),gf=mf(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),_f=mf(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),vf=mf(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),yf=mf(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),bf=mf(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),xf=mf(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]),Sf=mf(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Cf=mf(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),wf=mf(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Tf=mf(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ef=mf(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Df=mf(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Of=mf(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),kf=mf(`chevrons-left-right-ellipsis`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]),Af=mf(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),jf=mf(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Mf=mf(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Nf=mf(`clock`,[[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Pf=mf(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ff=mf(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),If=mf(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Lf=mf(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Rf=mf(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),zf=mf(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Bf=mf(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Vf=mf(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Hf=mf(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Uf=mf(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Wf=mf(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Gf=mf(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Kf=mf(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),qf=mf(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Jf=mf(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Yf=mf(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Xf=mf(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Zf=mf(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Qf=mf(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),$f=mf(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ep=mf(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),tp=mf(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),np=mf(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),rp=mf(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ip=mf(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ap=mf(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),op=mf(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),sp=mf(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),cp=mf(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]),lp=mf(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),up=mf(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),dp=mf(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),fp=mf(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),pp=mf(`picture-in-picture`,[[`path`,{d:`M2 10h6V4`,key:`zwrco`}],[`path`,{d:`m2 4 6 6`,key:`ug085t`}],[`path`,{d:`M21 10V7a2 2 0 0 0-2-2h-7`,key:`git5jr`}],[`path`,{d:`M3 14v2a2 2 0 0 0 2 2h3`,key:`1f7fh3`}],[`rect`,{x:`12`,y:`14`,width:`10`,height:`7`,rx:`1`,key:`1wjs3o`}]]),mp=mf(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),hp=mf(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),gp=mf(`pointer`,[[`path`,{d:`M22 14a8 8 0 0 1-8 8`,key:`56vcr3`}],[`path`,{d:`M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1agjmk`}],[`path`,{d:`M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1`,key:`wdbh2u`}],[`path`,{d:`M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10`,key:`1ibuk9`}],[`path`,{d:`M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`g6ys72`}]]),_p=mf(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),vp=mf(`rocket`,[[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z`,key:`m3kijz`}],[`path`,{d:`m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z`,key:`1fmvmk`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0`,key:`1f8sc4`}],[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}]]),yp=mf(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),bp=mf(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),xp=mf(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Sp=mf(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Cp=mf(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),wp=mf(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tp=mf(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ep=mf(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Dp=mf(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Op=mf(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),kp=mf(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ap=mf(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),jp=mf(`square-dashed-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]]),Mp=mf(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Np=mf(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Pp=mf(`sun-dim`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M20 12h.01`,key:`1ykeid`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M4 12h.01`,key:`158zrr`}],[`path`,{d:`M17.657 6.343h.01`,key:`31pqzk`}],[`path`,{d:`M17.657 17.657h.01`,key:`jehnf4`}],[`path`,{d:`M6.343 17.657h.01`,key:`gdk6ow`}],[`path`,{d:`M6.343 6.343h.01`,key:`1uurf0`}]]),Fp=mf(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ip=mf(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),Lp=mf(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Rp=mf(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),zp=mf(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Bp=mf(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Vp=mf(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Hp=mf(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Up=Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Wp=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Gp=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Kp={};function qp(e){return e&&Object.assign(Kp,e),Kp}function Jp(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Yp(e,t){return typeof t==`bigint`?t.toString():t}function Xp(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Zp(e){return e==null}function Qp(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function nee(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var $p=Symbol(`evaluating`);function em(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==$p)return r===void 0&&(r=$p,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tm(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function nm(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function rm(e){return JSON.stringify(e)}function ree(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var iee=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function im(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var aee=Xp(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function am(e){if(im(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(im(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function oee(e){return am(e)?{...e}:Array.isArray(e)?[...e]:e}var see=new Set([`string`,`number`,`symbol`]);function om(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sm(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cm(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function cee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var lee={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function uee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return sm(e,nm(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return tm(this,`shape`,e),e},checks:[]}))}function dee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return sm(e,nm(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return tm(this,`shape`,r),r},checks:[]}))}function fee(e,t){if(!am(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tm(this,`shape`,n),n}}))}function pee(e,t){if(!am(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tm(this,`shape`,n),n}}))}function mee(e,t){return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return tm(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function hee(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return sm(t,nm(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return tm(this,`shape`,i),i},checks:[]}))}function gee(e,t,n){return sm(t,nm(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return tm(this,`shape`,i),i}}))}function lm(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function um(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function dm(e){return typeof e==`string`?e:e?.message}function fm(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=dm(e.inst?._zod.def?.error?.(e))??dm(t?.error?.(e))??dm(n.customError?.(e))??dm(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function pm(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function mm(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var hm=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Yp,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},gm=W(`$ZodError`,hm),_m=W(`$ZodError`,hm,{Parent:Error});function _ee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vee(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var vm=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Wp;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>fm(e,a,qp())));throw iee(t,i?.callee),t}return o.value},ym=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>fm(e,a,qp())));throw iee(t,i?.callee),t}return o.value},bm=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Wp;return a.issues.length?{success:!1,error:new(e??gm)(a.issues.map(e=>fm(e,i,qp())))}:{success:!0,data:a.value}},yee=bm(_m),xm=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>fm(e,i,qp())))}:{success:!0,data:a.value}},bee=xm(_m),xee=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return vm(e)(t,n,i)},See=e=>(t,n,r)=>vm(e)(t,n,r),Cee=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ym(e)(t,n,i)},wee=e=>async(t,n,r)=>ym(e)(t,n,r),Tee=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return bm(e)(t,n,i)},Eee=e=>(t,n,r)=>bm(e)(t,n,r),Dee=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xm(e)(t,n,i)},Oee=e=>async(t,n,r)=>xm(e)(t,n,r),kee=/^[cC][^\s-]{8,}$/,Aee=/^[0-9a-z]+$/,jee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mee=/^[0-9a-vA-V]{20}$/,Nee=/^[A-Za-z0-9]{27}$/,Pee=/^[a-zA-Z0-9_-]{21}$/,Fee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Iee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sm=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lee=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ree=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function zee(){return new RegExp(Ree,`u`)}var Bee=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hee=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Uee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cm=/^[A-Za-z0-9_-]*$/,Gee=/^\+[1-9]\d{6,14}$/,wm=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Kee=RegExp(`^${wm}$`);function Tm(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qee(e){return RegExp(`^${Tm(e)}$`)}function Jee(e){let t=Tm({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${wm}T(?:${r})$`)}var Yee=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Xee=/^-?\d+$/,Em=/^-?\d+(?:\.\d+)?$/,Zee=/^(?:true|false)$/i,Qee=/^null$/i,$ee=/^[^A-Z]*$/,ete=/^[^a-z]*$/,Dm=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Om={number:`number`,bigint:`bigint`,object:`date`},km=W(`$ZodCheckLessThan`,(e,t)=>{Dm.init(e,t);let n=Om[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Am=W(`$ZodCheckGreaterThan`,(e,t)=>{Dm.init(e,t);let n=Om[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tte=W(`$ZodCheckMultipleOf`,(e,t)=>{Dm.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):nee(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nte=W(`$ZodCheckNumberFormat`,(e,t)=>{Dm.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=lee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Xee)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),rte=W(`$ZodCheckMaxLength`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=pm(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ite=W(`$ZodCheckMinLength`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=pm(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ate=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=pm(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jm=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Dm.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ote=W(`$ZodCheckRegex`,(e,t)=>{jm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ste=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$ee,jm.init(e,t)}),cte=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ete,jm.init(e,t)}),lte=W(`$ZodCheckIncludes`,(e,t)=>{Dm.init(e,t);let n=om(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ute=W(`$ZodCheckStartsWith`,(e,t)=>{Dm.init(e,t);let n=RegExp(`^${om(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dte=W(`$ZodCheckEndsWith`,(e,t)=>{Dm.init(e,t);let n=RegExp(`.*${om(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fte=W(`$ZodCheckOverwrite`,(e,t)=>{Dm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),pte=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
340
+ `;function ku(e){if(Array.isArray(e))return e.length===4?e:e.length===3?[...e,1]:Fu;if(typeof e!=`string`)return Fu;let t,n,r,i=1;if(e.startsWith(`#`))[t,n,r,i]=Au(e);else if(e.startsWith(`rgb`))[t,n,r,i]=ju(e);else if(e.startsWith(`hsl`))[t,n,r,i]=Nu(Mu(e));else return console.error(`Unsupported color format`,e),Fu;return[Pu(t,0,1),Pu(n,0,1),Pu(r,0,1),Pu(i,0,1)]}function Au(e){return e=e.replace(/^#/,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``)),e.length===6&&(e+=`ff`),[parseInt(e.slice(0,2),16)/255,parseInt(e.slice(2,4),16)/255,parseInt(e.slice(4,6),16)/255,parseInt(e.slice(6,8),16)/255]}function ju(e){let t=e.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([0-9.]+))?\s*\)$/i);return t?[parseInt(t[1]??`0`)/255,parseInt(t[2]??`0`)/255,parseInt(t[3]??`0`)/255,t[4]===void 0?1:parseFloat(t[4])]:[0,0,0,1]}function Mu(e){let t=e.match(/^hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([0-9.]+))?\s*\)$/i);return t?[parseInt(t[1]??`0`),parseInt(t[2]??`0`),parseInt(t[3]??`0`),t[4]===void 0?1:parseFloat(t[4])]:[0,0,0,1]}function Nu(e){let[t,n,r,i]=e,a=t/360,o=n/100,s=r/100,c,l,u;if(n===0)c=l=u=s;else{let e=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),t=s<.5?s*(1+o):s+o-s*o,n=2*s-t;c=e(n,t,a+1/3),l=e(n,t,a),u=e(n,t,a-1/3)}return[c,l,u,i]}var Pu=(e,t,n)=>Math.min(Math.max(e,t),n),Fu=[0,0,0,1];function Iu(e){let t=w.useRef(void 0),n=w.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return w.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}function Lu(e){if(e.naturalWidth<1024&&e.naturalHeight<1024){if(e.naturalWidth<1||e.naturalHeight<1)return;let t=e.naturalWidth/e.naturalHeight;e.width=Math.round(t>1?1024*t:1024),e.height=Math.round(t>1?1024:1024/t)}}async function Ru(e){let t={},n=[],r=e=>{try{return e.startsWith(`/`)||new URL(e),!0}catch{return!1}},i=e=>{try{return e.startsWith(`/`)?!1:new URL(e,window.location.origin).origin!==window.location.origin}catch{return!1}};return Object.entries(e).forEach(([e,a])=>{if(typeof a==`string`){let o=a||`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`;if(!r(o)){console.warn(`Uniform "${e}" has invalid URL "${o}". Skipping image loading.`);return}let s=new Promise((n,r)=>{let a=new Image;i(o)&&(a.crossOrigin=`anonymous`),a.onload=()=>{Lu(a),t[e]=a,n()},a.onerror=()=>{console.error(`Could not set uniforms. Failed to load image at ${o}`),r()},a.src=o});n.push(s)}else a instanceof HTMLImageElement&&Lu(a),t[e]=a}),await Promise.all(n),t}var zu=(0,w.forwardRef)(function({fragmentShader:e,uniforms:t,webGlContextAttributes:n,speed:r=0,frame:i=0,width:a,height:o,minPixelRatio:s,maxPixelCount:c,mipmaps:l,style:u,...d},f){let[p,m]=(0,w.useState)(!1),h=(0,w.useRef)(null),g=(0,w.useRef)(null),_=(0,w.useRef)(n);return(0,w.useEffect)(()=>((async()=>{let n=await Ru(t);h.current&&!g.current&&(g.current=new gu(h.current,e,n,_.current,r,i,s,c,l),m(!0))})(),()=>{g.current?.dispose(),g.current=null}),[e]),(0,w.useEffect)(()=>{let e=!1;return(async()=>{let n=await Ru(t);e||g.current?.setUniforms(n)})(),()=>{e=!0}},[t,p]),(0,w.useEffect)(()=>{g.current?.setSpeed(r)},[r,p]),(0,w.useEffect)(()=>{g.current?.setMaxPixelCount(c)},[c,p]),(0,w.useEffect)(()=>{g.current?.setMinPixelRatio(s)},[s,p]),(0,w.useEffect)(()=>{g.current?.setFrame(i)},[i,p]),(0,S.jsx)(`div`,{ref:Iu([h,f]),style:a!==void 0||o!==void 0?{width:typeof a==`string`&&isNaN(+a)===!1?+a:a,height:typeof o==`string`&&isNaN(+o)===!1?+o:o,...u}:u,...d})});zu.displayName=`ShaderMount`;function Bu(e,t){for(let n in e){if(n===`colors`){let n=Array.isArray(e.colors),r=Array.isArray(t.colors);if(!n||!r){if(Object.is(e.colors,t.colors)===!1)return!1;continue}if(e.colors?.length!==t.colors?.length||!e.colors?.every((e,n)=>e===t.colors?.[n]))return!1;continue}if(Object.is(e[n],t[n])===!1)return!1}return!0}var Vu={name:`Default`,params:{...Su,speed:1,frame:0,colors:[`#e0eaff`,`#241d9a`,`#f75092`,`#9f50d3`],distortion:.8,swirl:.1,grainMixer:0,grainOverlay:0}};({...Su}),{...Su},{...Su};var Hu=(0,w.memo)(function({speed:e=Vu.params.speed,frame:t=Vu.params.frame,colors:n=Vu.params.colors,distortion:r=Vu.params.distortion,swirl:i=Vu.params.swirl,grainMixer:a=Vu.params.grainMixer,grainOverlay:o=Vu.params.grainOverlay,fit:s=Vu.params.fit,rotation:c=Vu.params.rotation,scale:l=Vu.params.scale,originX:u=Vu.params.originX,originY:d=Vu.params.originY,offsetX:f=Vu.params.offsetX,offsetY:p=Vu.params.offsetY,worldWidth:m=Vu.params.worldWidth,worldHeight:h=Vu.params.worldHeight,...g}){let _={u_colors:n.map(ku),u_colorsCount:n.length,u_distortion:r,u_swirl:i,u_grainMixer:a,u_grainOverlay:o,u_fit:Cu[s],u_rotation:c,u_scale:l,u_offsetX:f,u_offsetY:p,u_originX:u,u_originY:d,u_worldWidth:m,u_worldHeight:h};return(0,S.jsx)(zu,{...g,speed:e,frame:t,fragmentShader:Ou,uniforms:_})},Bu),Uu=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Wu=`VisuallyHidden`,Gu=w.forwardRef((e,t)=>(0,S.jsx)(Jt.span,{...e,ref:t,style:{...Uu,...e.style}}));Gu.displayName=Wu;var Ku=Gu,[qu,Ju]=Nt(`Tooltip`,[aa]),Yu=aa(),Xu=`TooltipProvider`,Zu=700,Qu=`tooltip.open`,[$u,ed]=qu(Xu),td=e=>{let{__scopeTooltip:t,delayDuration:n=Zu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=w.useRef(!0),s=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,S.jsx)($u,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:w.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};td.displayName=Xu;var nd=`Tooltip`,[rd,id]=qu(nd),ad=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ed(nd,e.__scopeTooltip),l=Yu(t),[u,d]=w.useState(null),f=Fn(),p=w.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=w.useRef(!1),[_,v]=Lt({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qu))):c.onClose(),a?.(e)},caller:nd}),y=w.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=w.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=w.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=w.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return w.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,S.jsx)(xa,{...l,children:(0,S.jsx)(rd,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?C():b()},[c.isOpenDelayedRef,C,b]),onTriggerLeave:w.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ad.displayName=nd;var od=`TooltipTrigger`,sd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=id(od,n),a=ed(od,n),o=Yu(n),s=D(t,w.useRef(null),i.onTriggerChange),c=w.useRef(!1),l=w.useRef(!1),u=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,S.jsx)(Sa,{asChild:!0,...o,children:(0,S.jsx)(Jt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:jt(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:jt(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:jt(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:jt(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:jt(e.onBlur,i.onClose),onClick:jt(e.onClick,i.onClose)})})});sd.displayName=od;var cd=`TooltipPortal`,[ld,ud]=qu(cd,{forceMount:void 0}),dd=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=id(cd,t);return(0,S.jsx)(ld,{scope:t,forceMount:n,children:(0,S.jsx)(Oa,{present:n||a.open,children:(0,S.jsx)(Ea,{asChild:!0,container:i,children:r})})})};dd.displayName=cd;var fd=`TooltipContent`,pd=w.forwardRef((e,t)=>{let n=ud(fd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=id(fd,e.__scopeTooltip);return(0,S.jsx)(Oa,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(vd,{side:i,...a,ref:t}):(0,S.jsx)(md,{side:i,...a,ref:t})})}),md=w.forwardRef((e,t)=>{let n=id(fd,e.__scopeTooltip),r=ed(fd,e.__scopeTooltip),i=w.useRef(null),a=D(t,i),[o,s]=w.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{s(null),d(!1)},[d]),p=w.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Sd(r,xd(r,n.getBoundingClientRect())),a=Cd(t.getBoundingClientRect());s(Td([...i,...a])),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),w.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!wd(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,S.jsx)(vd,{...e,ref:a})}),[hd,gd]=qu(nd,{isInside:!1}),_d=Wt(`TooltipContent`),vd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=id(fd,n),l=Yu(n),{onClose:u}=c;return w.useEffect(()=>(document.addEventListener(Qu,u),()=>document.removeEventListener(Qu,u)),[u]),w.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,S.jsx)(cn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,S.jsxs)(Ca,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,S.jsx)(_d,{children:r}),(0,S.jsx)(hd,{scope:n,isInside:!0,children:(0,S.jsx)(Ku,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});pd.displayName=fd;var yd=`TooltipArrow`,bd=w.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Yu(n);return gd(yd,n).isInside?null:(0,S.jsx)(wa,{...i,...r,ref:t})});bd.displayName=yd;function xd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Sd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Cd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function wd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Td(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ed(t)}function Ed(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Dd=td,Od=ad,kd=sd,Ad=dd,jd=pd,Md=bd;function Nd({delayDuration:e=0,...t}){return(0,S.jsx)(Dd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Pd({...e}){return(0,S.jsx)(Nd,{children:(0,S.jsx)(Od,{"data-slot":`tooltip`,...e})})}function Fd({...e}){return(0,S.jsx)(kd,{"data-slot":`tooltip-trigger`,...e})}function Id({className:e,sideOffset:t=0,children:n,...r}){return(0,S.jsx)(Ad,{children:(0,S.jsxs)(jd,{"data-slot":`tooltip-content`,sideOffset:t,className:H(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,S.jsx)(Md,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var Ld=class{name=`mcp_inspector_open`;properties;constructor(e){this.properties={server_url:e.serverUrl,connection_count:e.connectionCount}}},Rd=class{name=`mcp_tool_execution`;properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId,success:e.success,duration:e.duration,error:e.error}}},zd=class{name=`mcp_resource_read`;properties;constructor(e){this.properties={resource_uri:e.resourceUri,server_id:e.serverId,success:e.success,error:e.error}}},Bd=class{name=`mcp_prompt_call`;properties;constructor(e){this.properties={prompt_name:e.promptName,server_id:e.serverId,success:e.success,error:e.error}}},Vd=class{name=`mcp_server_connection`;properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,success:e.success,connection_type:e.connectionType,error:e.error}}},Hd=class{name=`mcp_chat_message`;properties;constructor(e){this.properties={server_id:e.serverId,provider:e.provider,model:e.model,message_count:e.messageCount,tool_calls_count:e.toolCallsCount,success:e.success,execution_mode:e.executionMode,duration:e.duration,error:e.error}}},Ud=class{name=`mcp_server_added`;properties;constructor(e){this.properties={server_id:e.serverId,server_url:e.serverUrl,connection_type:e.connectionType,via_proxy:e.viaProxy}}},Wd=class{name=`mcp_server_removed`;properties;constructor(e){this.properties={server_id:e.serverId}}},Gd=class{name=`mcp_command_palette_open`;properties;constructor(e){this.properties={trigger:e.trigger}}},Kd=class{name=`mcp_tool_saved`;properties;constructor(e){this.properties={tool_name:e.toolName,server_id:e.serverId}}},qd=class{name=`mcp_tunnel_action`;properties;constructor(e){this.properties={action:e.action,success:e.success,tunnel_url:e.tunnelUrl}}},Jd=class{name=`mcp_deploy_click`;properties;constructor(e){this.properties={referrer:e.referrer}}},Yd=class{name=`mcp_chat_configured`;properties;constructor(e){this.properties={provider:e.provider,model:e.model}}},Xd=class{name=`mcp_tab_navigation`;properties;constructor(e){this.properties={tab:e.tab,previous_tab:e.previousTab}}},Zd=class{name=`mcp_add_to_client`;properties;constructor(e){this.properties={client:e.client}}},Qd=class{name=`mcp_session_duration`;properties;constructor(e){this.properties={duration_seconds:e.durationSeconds,tabs_visited:e.tabsVisited,tools_executed:e.toolsExecuted}}};function $d(){try{return`5.0.0`}catch{return`0.0.0`}}function ef(){try{return typeof window<`u`&&typeof document<`u`}catch{return!1}}var tf=class{endpoint;timeout;constructor(e,t=3e3){this.endpoint=e,this.timeout=t}async logEvent(e){try{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout),r=await fetch(this.endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:t.signal});if(clearTimeout(n),!r.ok)throw Error(`HTTP error! status: ${r.status}`)}catch{}}};function nf(e){return`mcp_inspector_telemetry_${e}`}function rf(){if(typeof window>`u`)return`standalone`;let e=window.__MCP_INSPECTOR_MODE__;return e===`standalone`||e===`embedded`||e===`cloud`?e:`standalone`}function af(){return typeof localStorage<`u`&&typeof localStorage.getItem==`function`&&typeof localStorage.setItem==`function`}var of=class e{static instance=null;POSTHOG_PROXY_URL=`/inspector/api/tel/posthog`;SCARF_PROXY_URL=`/inspector/api/tel/scarf`;UNKNOWN_USER_ID=`UNKNOWN_USER_ID`;_currUserId=null;_posthogClient=null;_scarfClient=null;_source=`inspector`;_mode=`standalone`;constructor(){let e=ef(),t=this.isTelemetryDisabled();if(this._source=this.getStoredSource()||`inspector`,this._mode=rf(),t)this._posthogClient=null,this._scarfClient=null;else if(!e)this._posthogClient=null,this._scarfClient=null;else{try{this._posthogClient=new tf(this.POSTHOG_PROXY_URL,3e3)}catch{this._posthogClient=null}try{this._scarfClient=new tf(this.SCARF_PROXY_URL,3e3)}catch{this._scarfClient=null}}}isTelemetryDisabled(){return!!(typeof window<`u`&&window.__MCP_USE_ANONYMIZED_TELEMETRY__===!1||af()&&localStorage.getItem(nf(`disabled`))===`true`||typeof process<`u`&&{}?.MCP_USE_ANONYMIZED_TELEMETRY===`false`)}getStoredSource(){return af()?localStorage.getItem(nf(`source`)):null}static getInstance(){return e.instance||=new e,e.instance}setSource(e){this._source=e,af()&&localStorage.setItem(nf(`source`),e)}getSource(){return this._source}getMode(){return this._mode}get userId(){if(this._currUserId)return this._currUserId;if(!ef())return this._currUserId=this.UNKNOWN_USER_ID,this._currUserId;try{if(!af())throw Error(`localStorage is not available or not functional`);let e=localStorage.getItem(nf(`user_id`));if(e)this._currUserId=e;else{let e=this.generateUserId();localStorage.setItem(nf(`user_id`),e),this._currUserId=e}this.trackPackageDownload({triggered_by:`user_id_property`}).catch(()=>{})}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}generateUserId(){let e=window.crypto;if(e){let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``);return n.slice(0,8)+`-`+n.slice(8,12)+`-`+n.slice(12,16)+`-`+n.slice(16,20)+`-`+n.slice(20,32)}else return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}async capture(e){if(!(!this._posthogClient&&!this._scarfClient)){if(this._posthogClient)try{let t={event:e.name,user_id:this.userId,properties:{...e.properties,mcp_use_version:$d(),language:`typescript`,source:this._source,package:`inspector`,mode:this._mode}};await this._posthogClient.logEvent(t)}catch{}if(this._scarfClient)try{let t={};t.mcp_use_version=$d(),t.user_id=this.userId,t.event=e.name,t.language=`typescript`,t.source=this._source,t.package=`inspector`,t.mode=this._mode,await this._scarfClient.logEvent(t)}catch{}}}async trackPackageDownload(e){if(this._scarfClient&&ef())try{if(!af())throw Error(`localStorage is not available or not functional`);let t=$d(),n=!1,r=!1,i=localStorage.getItem(nf(`download_version`));if(i?t>i&&(n=!0,r=!1,localStorage.setItem(nf(`download_version`),t)):(n=!0,r=!0,localStorage.setItem(nf(`download_version`),t)),n){let n={...e||{}};n.mcp_use_version=t,n.user_id=this.userId,n.event=`package_download`,n.first_download=r,n.language=`typescript`,n.source=this._source,n.package=`inspector`,n.mode=this._mode,await this._scarfClient.logEvent(n)}}catch{}}async trackInspectorOpen(e){let t=new Ld(e);await this.capture(t)}},sf=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),cf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),lf=e=>{let t=cf(e);return t.charAt(0).toUpperCase()+t.slice(1)},uf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),df=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},ff={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},pf=(0,w.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,w.createElement)(`svg`,{ref:c,...ff,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:uf(`lucide`,i),...!a&&!df(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),mf=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(pf,{ref:i,iconNode:t,className:uf(`lucide-${sf(lf(e))}`,`lucide-${e}`,n),...r}));return n.displayName=lf(e),n},hf=mf(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),gf=mf(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),_f=mf(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),vf=mf(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),yf=mf(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),bf=mf(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),xf=mf(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]),Sf=mf(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Cf=mf(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),wf=mf(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Tf=mf(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ef=mf(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Df=mf(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Of=mf(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),kf=mf(`chevrons-left-right-ellipsis`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]),Af=mf(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),jf=mf(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Mf=mf(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Nf=mf(`clock`,[[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Pf=mf(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ff=mf(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),If=mf(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Lf=mf(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Rf=mf(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),zf=mf(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Bf=mf(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Vf=mf(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Hf=mf(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Uf=mf(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Wf=mf(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Gf=mf(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Kf=mf(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),qf=mf(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Jf=mf(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Yf=mf(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Xf=mf(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Zf=mf(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Qf=mf(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),$f=mf(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ep=mf(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),tp=mf(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),np=mf(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),rp=mf(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ip=mf(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ap=mf(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),op=mf(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),sp=mf(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),cp=mf(`minimize`,[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]),lp=mf(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),up=mf(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),dp=mf(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),fp=mf(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),pp=mf(`picture-in-picture`,[[`path`,{d:`M2 10h6V4`,key:`zwrco`}],[`path`,{d:`m2 4 6 6`,key:`ug085t`}],[`path`,{d:`M21 10V7a2 2 0 0 0-2-2h-7`,key:`git5jr`}],[`path`,{d:`M3 14v2a2 2 0 0 0 2 2h3`,key:`1f7fh3`}],[`rect`,{x:`12`,y:`14`,width:`10`,height:`7`,rx:`1`,key:`1wjs3o`}]]),mp=mf(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),hp=mf(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),gp=mf(`pointer`,[[`path`,{d:`M22 14a8 8 0 0 1-8 8`,key:`56vcr3`}],[`path`,{d:`M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1agjmk`}],[`path`,{d:`M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1`,key:`wdbh2u`}],[`path`,{d:`M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10`,key:`1ibuk9`}],[`path`,{d:`M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`g6ys72`}]]),_p=mf(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),vp=mf(`rocket`,[[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z`,key:`m3kijz`}],[`path`,{d:`m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z`,key:`1fmvmk`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0`,key:`1f8sc4`}],[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}]]),yp=mf(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),bp=mf(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),xp=mf(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Sp=mf(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Cp=mf(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),wp=mf(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tp=mf(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ep=mf(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Dp=mf(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Op=mf(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),kp=mf(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ap=mf(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),jp=mf(`square-dashed-mouse-pointer`,[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]]),Mp=mf(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Np=mf(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Pp=mf(`sun-dim`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M20 12h.01`,key:`1ykeid`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M4 12h.01`,key:`158zrr`}],[`path`,{d:`M17.657 6.343h.01`,key:`31pqzk`}],[`path`,{d:`M17.657 17.657h.01`,key:`jehnf4`}],[`path`,{d:`M6.343 17.657h.01`,key:`gdk6ow`}],[`path`,{d:`M6.343 6.343h.01`,key:`1uurf0`}]]),Fp=mf(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ip=mf(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),Lp=mf(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Rp=mf(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),zp=mf(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Bp=mf(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Vp=mf(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Hp=mf(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Up=Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Wp=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Gp=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Kp={};function qp(e){return e&&Object.assign(Kp,e),Kp}function Jp(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Yp(e,t){return typeof t==`bigint`?t.toString():t}function Xp(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Zp(e){return e==null}function Qp(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function nee(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var $p=Symbol(`evaluating`);function em(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==$p)return r===void 0&&(r=$p,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tm(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function nm(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function rm(e){return JSON.stringify(e)}function ree(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var iee=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function im(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var aee=Xp(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function am(e){if(im(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(im(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function oee(e){return am(e)?{...e}:Array.isArray(e)?[...e]:e}var see=new Set([`string`,`number`,`symbol`]);function om(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sm(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function cm(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function cee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var lee={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function uee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return sm(e,nm(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return tm(this,`shape`,e),e},checks:[]}))}function dee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return sm(e,nm(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return tm(this,`shape`,r),r},checks:[]}))}function fee(e,t){if(!am(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tm(this,`shape`,n),n}}))}function pee(e,t){if(!am(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return tm(this,`shape`,n),n}}))}function mee(e,t){return sm(e,nm(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return tm(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function hee(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return sm(t,nm(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return tm(this,`shape`,i),i},checks:[]}))}function gee(e,t,n){return sm(t,nm(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return tm(this,`shape`,i),i}}))}function lm(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function um(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function dm(e){return typeof e==`string`?e:e?.message}function fm(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=dm(e.inst?._zod.def?.error?.(e))??dm(t?.error?.(e))??dm(n.customError?.(e))??dm(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function pm(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function mm(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var hm=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Yp,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},gm=W(`$ZodError`,hm),_m=W(`$ZodError`,hm,{Parent:Error});function _ee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vee(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var vm=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Wp;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>fm(e,a,qp())));throw iee(t,i?.callee),t}return o.value},ym=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>fm(e,a,qp())));throw iee(t,i?.callee),t}return o.value},bm=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Wp;return a.issues.length?{success:!1,error:new(e??gm)(a.issues.map(e=>fm(e,i,qp())))}:{success:!0,data:a.value}},yee=bm(_m),xm=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>fm(e,i,qp())))}:{success:!0,data:a.value}},bee=xm(_m),xee=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return vm(e)(t,n,i)},See=e=>(t,n,r)=>vm(e)(t,n,r),Cee=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ym(e)(t,n,i)},wee=e=>async(t,n,r)=>ym(e)(t,n,r),Tee=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return bm(e)(t,n,i)},Eee=e=>(t,n,r)=>bm(e)(t,n,r),Dee=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xm(e)(t,n,i)},Oee=e=>async(t,n,r)=>xm(e)(t,n,r),kee=/^[cC][^\s-]{8,}$/,Aee=/^[0-9a-z]+$/,jee=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mee=/^[0-9a-vA-V]{20}$/,Nee=/^[A-Za-z0-9]{27}$/,Pee=/^[a-zA-Z0-9_-]{21}$/,Fee=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Iee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sm=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lee=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ree=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function zee(){return new RegExp(Ree,`u`)}var Bee=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hee=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Uee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cm=/^[A-Za-z0-9_-]*$/,Gee=/^\+[1-9]\d{6,14}$/,wm=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Kee=RegExp(`^${wm}$`);function Tm(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qee(e){return RegExp(`^${Tm(e)}$`)}function Jee(e){let t=Tm({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${wm}T(?:${r})$`)}var Yee=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Xee=/^-?\d+$/,Em=/^-?\d+(?:\.\d+)?$/,Zee=/^(?:true|false)$/i,Qee=/^null$/i,$ee=/^[^A-Z]*$/,ete=/^[^a-z]*$/,Dm=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Om={number:`number`,bigint:`bigint`,object:`date`},km=W(`$ZodCheckLessThan`,(e,t)=>{Dm.init(e,t);let n=Om[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Am=W(`$ZodCheckGreaterThan`,(e,t)=>{Dm.init(e,t);let n=Om[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tte=W(`$ZodCheckMultipleOf`,(e,t)=>{Dm.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):nee(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nte=W(`$ZodCheckNumberFormat`,(e,t)=>{Dm.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=lee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Xee)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),rte=W(`$ZodCheckMaxLength`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=pm(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ite=W(`$ZodCheckMinLength`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=pm(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ate=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;Dm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Zp(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=pm(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jm=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Dm.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ote=W(`$ZodCheckRegex`,(e,t)=>{jm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ste=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$ee,jm.init(e,t)}),cte=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ete,jm.init(e,t)}),lte=W(`$ZodCheckIncludes`,(e,t)=>{Dm.init(e,t);let n=om(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ute=W(`$ZodCheckStartsWith`,(e,t)=>{Dm.init(e,t);let n=RegExp(`^${om(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dte=W(`$ZodCheckEndsWith`,(e,t)=>{Dm.init(e,t);let n=RegExp(`.*${om(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fte=W(`$ZodCheckOverwrite`,(e,t)=>{Dm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),pte=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
341
341
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
342
342
  `))}},mte={major:4,minor:3,patch:5},Mm=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mte;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=lm(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Wp;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=lm(e,t))});else{if(e.issues.length===t)continue;r||=lm(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(lm(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Wp;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Wp;return o.then(e=>t(e,r,a))}return t(o,r,a)}}em(e,`~standard`,()=>({validate:t=>{try{let n=yee(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return bee(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Nm=W(`$ZodString`,(e,t)=>{Mm.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yee(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Pm=W(`$ZodStringFormat`,(e,t)=>{jm.init(e,t),Nm.init(e,t)}),hte=W(`$ZodGUID`,(e,t)=>{t.pattern??=Iee,Pm.init(e,t)}),gte=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Sm(e)}else t.pattern??=Sm();Pm.init(e,t)}),_te=W(`$ZodEmail`,(e,t)=>{t.pattern??=Lee,Pm.init(e,t)}),vte=W(`$ZodURL`,(e,t)=>{Pm.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),yte=W(`$ZodEmoji`,(e,t)=>{t.pattern??=zee(),Pm.init(e,t)}),bte=W(`$ZodNanoID`,(e,t)=>{t.pattern??=Pee,Pm.init(e,t)}),xte=W(`$ZodCUID`,(e,t)=>{t.pattern??=kee,Pm.init(e,t)}),Ste=W(`$ZodCUID2`,(e,t)=>{t.pattern??=Aee,Pm.init(e,t)}),Cte=W(`$ZodULID`,(e,t)=>{t.pattern??=jee,Pm.init(e,t)}),wte=W(`$ZodXID`,(e,t)=>{t.pattern??=Mee,Pm.init(e,t)}),Tte=W(`$ZodKSUID`,(e,t)=>{t.pattern??=Nee,Pm.init(e,t)}),Ete=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=Jee(t),Pm.init(e,t)}),Dte=W(`$ZodISODate`,(e,t)=>{t.pattern??=Kee,Pm.init(e,t)}),Ote=W(`$ZodISOTime`,(e,t)=>{t.pattern??=qee(t),Pm.init(e,t)}),kte=W(`$ZodISODuration`,(e,t)=>{t.pattern??=Fee,Pm.init(e,t)}),Ate=W(`$ZodIPv4`,(e,t)=>{t.pattern??=Bee,Pm.init(e,t),e._zod.bag.format=`ipv4`}),jte=W(`$ZodIPv6`,(e,t)=>{t.pattern??=Vee,Pm.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Mte=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Hee,Pm.init(e,t)}),Nte=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Uee,Pm.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Fm(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Pte=W(`$ZodBase64`,(e,t)=>{t.pattern??=Wee,Pm.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Fm(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Fte(e){if(!Cm.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Fm(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ite=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=Cm,Pm.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Fte(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Lte=W(`$ZodE164`,(e,t)=>{t.pattern??=Gee,Pm.init(e,t)});function Rte(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var zte=W(`$ZodJWT`,(e,t)=>{Pm.init(e,t),e._zod.check=n=>{Rte(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Im=W(`$ZodNumber`,(e,t)=>{Mm.init(e,t),e._zod.pattern=e._zod.bag.pattern??Em,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Bte=W(`$ZodNumberFormat`,(e,t)=>{nte.init(e,t),Im.init(e,t)}),Vte=W(`$ZodBoolean`,(e,t)=>{Mm.init(e,t),e._zod.pattern=Zee,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Hte=W(`$ZodNull`,(e,t)=>{Mm.init(e,t),e._zod.pattern=Qee,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ute=W(`$ZodAny`,(e,t)=>{Mm.init(e,t),e._zod.parse=e=>e}),Wte=W(`$ZodUnknown`,(e,t)=>{Mm.init(e,t),e._zod.parse=e=>e}),Gte=W(`$ZodNever`,(e,t)=>{Mm.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Lm(e,t,n){e.issues.length&&t.issues.push(...um(n,e.issues)),t.value[n]=e.value}var Kte=W(`$ZodArray`,(e,t)=>{Mm.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Lm(t,n,e))):Lm(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Rm(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...um(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function zm(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=cee(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Bm(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Rm(e,n,i,t,u))):Rm(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var qte=W(`$ZodObject`,(e,t)=>{if(Mm.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Xp(()=>zm(t));em(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=im,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Rm(n,t,e,s,r))):Rm(i,t,e,s,r)}return i?Bm(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Jte=W(`$ZodObjectJIT`,(e,t)=>{qte.init(e,t);let n=e._zod.parse,r=Xp(()=>zm(t)),i=e=>{let t=new pte([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=rm(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=rm(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
343
343
  if (${n}.issues.length) {
@@ -435,7 +435,7 @@ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Rec
435
435
  for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);K.object({method:K.literal(`ui/open-link`),params:K.object({url:K.string().describe(`URL to open in the host's browser`)})}),K.object({isError:K.boolean().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),K.object({isError:K.boolean().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),K.object({method:K.literal(`ui/notifications/sandbox-proxy-ready`),params:K.object({})});var cO=K.object({connectDomains:K.array(K.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).`),resourceDomains:K.array(K.string()).optional().describe(`Origins for static resources (scripts, images, styles, fonts).`),frameDomains:K.array(K.string()).optional().describe(`Origins for nested iframes (frame-src directive).`),baseUriDomains:K.array(K.string()).optional().describe(`Allowed base URIs for the document (base-uri directive).`)}),lO=K.object({camera:K.object({}).optional().describe("Request camera access (Permission Policy `camera` feature)."),microphone:K.object({}).optional().describe("Request microphone access (Permission Policy `microphone` feature)."),geolocation:K.object({}).optional().describe("Request geolocation access (Permission Policy `geolocation` feature)."),clipboardWrite:K.object({}).optional().describe("Request clipboard write access (Permission Policy `clipboard-write` feature).")});K.object({method:K.literal(`ui/notifications/size-changed`),params:K.object({width:K.number().optional().describe(`New width in pixels.`),height:K.number().optional().describe(`New height in pixels.`)})}),K.object({method:K.literal(`ui/notifications/tool-input`),params:K.object({arguments:K.record(K.string(),K.unknown().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),K.object({method:K.literal(`ui/notifications/tool-input-partial`),params:K.object({arguments:K.record(K.string(),K.unknown().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),K.object({method:K.literal(`ui/notifications/tool-cancelled`),params:K.object({reason:K.string().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Zle=K.object({fonts:K.string().optional()}),Qle=K.object({variables:Xle.optional().describe(`CSS variables for theming the app.`),css:Zle.optional().describe(`CSS blocks that apps can inject.`)});K.object({method:K.literal(`ui/resource-teardown`),params:K.object({})}),K.record(K.string(),K.unknown());var uO=K.object({text:K.object({}).optional().describe(`Host supports text content blocks.`),image:K.object({}).optional().describe(`Host supports image content blocks.`),audio:K.object({}).optional().describe(`Host supports audio content blocks.`),resource:K.object({}).optional().describe(`Host supports resource content blocks.`),resourceLink:K.object({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:K.object({}).optional().describe(`Host supports structured content.`)}),$le=K.object({experimental:K.object({}).optional().describe(`Experimental features (structure TBD).`),openLinks:K.object({}).optional().describe(`Host supports opening external URLs.`),serverTools:K.object({listChanged:K.boolean().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:K.object({listChanged:K.boolean().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:K.object({}).optional().describe(`Host accepts log messages.`),sandbox:K.object({permissions:lO.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:cO.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:uO.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:uO.optional().describe(`Host supports receiving content messages (ui/message) from the view.`)}),eue=K.object({experimental:K.object({}).optional().describe(`Experimental features (structure TBD).`),tools:K.object({listChanged:K.boolean().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:K.array(sO).optional().describe(`Display modes the app supports.`)});K.object({method:K.literal(`ui/notifications/initialized`),params:K.object({}).optional()}),K.object({csp:cO.optional().describe(`Content Security Policy configuration.`),permissions:lO.optional().describe(`Sandbox permissions requested by the UI.`),domain:K.string().optional().describe(`Dedicated origin for view sandbox.`),prefersBorder:K.boolean().optional().describe(`Visual boundary preference - true if UI prefers a visible border.`)}),K.object({method:K.literal(`ui/request-display-mode`),params:K.object({mode:sO.describe(`The display mode being requested.`)})}),K.object({mode:sO.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var tue=K.union([K.literal(`model`),K.literal(`app`)]).describe(`Tool visibility scope - who can access the tool.`);K.object({resourceUri:K.string().optional(),visibility:K.array(tue).optional().describe(`Who can access this tool. Default: ["model", "app"]
436
436
  - "model": Tool visible to and callable by the agent
437
437
  - "app": Tool callable by the app from this server only`)}),K.object({mimeTypes:K.array(K.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),K.object({method:K.literal(`ui/message`),params:K.object({role:K.literal(`user`).describe(`Message role, currently only "user" is supported.`),content:K.array(n_).describe(`Message content blocks (text, image, etc.).`)})}),K.object({method:K.literal(`ui/notifications/sandbox-resource-ready`),params:K.object({html:K.string().describe(`HTML content to load into the inner iframe.`),sandbox:K.string().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:cO.optional().describe(`CSP configuration from resource metadata.`),permissions:lO.optional().describe(`Sandbox permissions from resource metadata.`)})}),K.object({method:K.literal(`ui/notifications/tool-result`),params:s_.describe(`Standard MCP tool execution result.`)});var dO=K.object({toolInfo:K.object({id:sg.optional().describe(`JSON-RPC id of the tools/call request.`),tool:a_.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Jle.optional().describe(`Current color theme preference.`),styles:Qle.optional().describe(`Style configuration for theming the app.`),displayMode:sO.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:K.array(sO).optional().describe(`Display modes the host supports.`),containerDimensions:K.union([K.object({height:K.number().describe(`Fixed container height in pixels.`)}),K.object({maxHeight:K.union([K.number(),K.undefined()]).optional().describe(`Maximum container height in pixels.`)})]).and(K.union([K.object({width:K.number().describe(`Fixed container width in pixels.`)}),K.object({maxWidth:K.union([K.number(),K.undefined()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
438
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:K.string().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:K.string().optional().describe(`User's timezone in IANA format.`),userAgent:K.string().optional().describe(`Host application identifier.`),platform:K.union([K.literal(`web`),K.literal(`desktop`),K.literal(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:K.object({touch:K.boolean().optional().describe(`Whether the device supports touch input.`),hover:K.boolean().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:K.object({top:K.number().describe(`Top safe area inset in pixels.`),right:K.number().describe(`Right safe area inset in pixels.`),bottom:K.number().describe(`Bottom safe area inset in pixels.`),left:K.number().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();K.object({method:K.literal(`ui/notifications/host-context-changed`),params:dO.describe(`Partial context update containing only changed fields.`)}),K.object({method:K.literal(`ui/update-model-context`),params:K.object({content:K.array(n_).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:K.record(K.string(),K.unknown().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),K.object({method:K.literal(`ui/initialize`),params:K.object({appInfo:bg.describe(`App identification (name and version).`),appCapabilities:eue.describe(`Features and capabilities this app provides.`),protocolVersion:K.string().describe(`Protocol version this app supports.`)})}),K.object({protocolVersion:K.string().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:bg.describe(`Host application identification and version.`),hostCapabilities:$le.describe(`Features and capabilities provided by the host.`),hostContext:dO.describe(`Rich context about the host environment.`)}).passthrough();var nue=`text/html;profile=mcp-app`,rue=`modulepreload`,iue=function(e){return`/inspector/`+e},fO={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=iue(t,n),t in fO)return;fO[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:rue,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},aue=`1.27.0-canary.4`;function pO(){return aue}a(pO,`getPackageVersion`);var mO=class{static{a(this,`BaseTelemetryEvent`)}},oue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`MCPAgentExecutionEvent`)}get name(){return`mcp_agent_execution`}get properties(){return{execution_method:this.data.executionMethod,query:this.data.query,query_length:this.data.query.length,success:this.data.success,model_provider:this.data.modelProvider,model_name:this.data.modelName,server_count:this.data.serverCount,server_identifiers:this.data.serverIdentifiers,total_tools_available:this.data.totalToolsAvailable,tools_available_names:this.data.toolsAvailableNames,max_steps_configured:this.data.maxStepsConfigured,memory_enabled:this.data.memoryEnabled,use_server_manager:this.data.useServerManager,max_steps_used:this.data.maxStepsUsed,manage_connector:this.data.manageConnector,external_history_used:this.data.externalHistoryUsed,steps_taken:this.data.stepsTaken??null,tools_used_count:this.data.toolsUsedCount??null,tools_used_names:this.data.toolsUsedNames??null,response:this.data.response??null,response_length:this.data.response?this.data.response.length:null,execution_time_ms:this.data.executionTimeMs??null,error_type:this.data.errorType??null,conversation_history_length:this.data.conversationHistoryLength??null}}};function hO(e,t){let n=Array.from(e.registrations.tools.values()),r=Array.from(e.registrations.prompts.values()),i=Array.from(e.registrations.resources.values()),a=Array.from(e.registrations.resourceTemplates.values()),o=i.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,uri:e.config.uri??null,mime_type:e.config.mimeType??null})),s=o.filter(e=>e.mime_type===`text/html+skybridge`),c=o.filter(e=>e.mime_type===`text/uri-list`||e.mime_type===`text/html`),l=o.filter(e=>e.mime_type===nue);return{transport:t,toolsNumber:e.registeredTools.length,resourcesNumber:e.registeredResources.length,promptsNumber:e.registeredPrompts.length,auth:!!e.oauthProvider,name:e.config.name,description:e.config.description??null,baseUrl:e.serverBaseUrl??null,toolNames:e.registeredTools.length>0?e.registeredTools:null,resourceNames:e.registeredResources.length>0?e.registeredResources:null,promptNames:e.registeredPrompts.length>0?e.registeredPrompts:null,tools:n.length>0?n.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,input_schema:e.config.schema?JSON.stringify(e.config.schema):null,output_schema:e.config.outputSchema?JSON.stringify(e.config.outputSchema):null})):null,resources:o.length>0?o:null,prompts:r.length>0?r.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,args:e.config.args?JSON.stringify(e.config.args):null})):null,templates:a.length>0?a.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null})):null,capabilities:{logging:!0,resources:{subscribe:!0,listChanged:!0}},appsSdkResources:s.length>0?s:null,appsSdkResourcesNumber:s.length,mcpUiResources:c.length>0?c:null,mcpUiResourcesNumber:c.length,mcpAppsResources:l.length>0?l:null,mcpAppsResourcesNumber:l.length}}a(hO,`createServerRunEventData`);var sue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerRunEvent`)}get name(){return`server_run`}get properties(){return{transport:this.data.transport,tools_number:this.data.toolsNumber,resources_number:this.data.resourcesNumber,prompts_number:this.data.promptsNumber,auth:this.data.auth,name:this.data.name,description:this.data.description??null,base_url:this.data.baseUrl??null,tool_names:this.data.toolNames??null,resource_names:this.data.resourceNames??null,prompt_names:this.data.promptNames??null,tools:this.data.tools??null,resources:this.data.resources??null,prompts:this.data.prompts??null,templates:this.data.templates??null,capabilities:this.data.capabilities?JSON.stringify(this.data.capabilities):null,apps_sdk_resources:this.data.appsSdkResources?JSON.stringify(this.data.appsSdkResources):null,apps_sdk_resources_number:this.data.appsSdkResourcesNumber??0,mcp_ui_resources:this.data.mcpUiResources?JSON.stringify(this.data.mcpUiResources):null,mcp_ui_resources_number:this.data.mcpUiResourcesNumber??0,mcp_apps_resources:this.data.mcpAppsResources?JSON.stringify(this.data.mcpAppsResources):null,mcp_apps_resources_number:this.data.mcpAppsResourcesNumber??0}}},cue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerInitializeEvent`)}get name(){return`server_initialize_call`}get properties(){return{protocol_version:this.data.protocolVersion,client_info:JSON.stringify(this.data.clientInfo),client_capabilities:JSON.stringify(this.data.clientCapabilities),session_id:this.data.sessionId??null}}},lue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerToolCallEvent`)}get name(){return`server_tool_call`}get properties(){return{tool_name:this.data.toolName,length_input_argument:this.data.lengthInputArgument,success:this.data.success,error_type:this.data.errorType??null,execution_time_ms:this.data.executionTimeMs??null}}},uue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerResourceCallEvent`)}get name(){return`server_resource_call`}get properties(){return{name:this.data.name,description:this.data.description,contents:this.data.contents,success:this.data.success,error_type:this.data.errorType??null}}},due=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerPromptCallEvent`)}get name(){return`server_prompt_call`}get properties(){return{name:this.data.name,description:this.data.description,success:this.data.success,error_type:this.data.errorType??null}}},fue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerContextEvent`)}get name(){return`server_context_${this.data.contextType}`}get properties(){return{context_type:this.data.contextType,notification_type:this.data.notificationType??null}}},pue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`MCPClientInitEvent`)}get name(){return`mcpclient_init`}get properties(){return{code_mode:this.data.codeMode,sandbox:this.data.sandbox,all_callbacks:this.data.allCallbacks,verify:this.data.verify,servers:this.data.servers,num_servers:this.data.numServers,is_browser:this.data.isBrowser}}},mue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ConnectorInitEvent`)}get name(){return`connector_init`}get properties(){return{connector_type:this.data.connectorType,server_command:this.data.serverCommand??null,server_args:this.data.serverArgs??null,server_url:this.data.serverUrl??null,public_identifier:this.data.publicIdentifier??null}}},hue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ClientAddServerEvent`)}get name(){return`client_add_server`}get properties(){let{serverName:e,serverConfig:t}=this.data,n=t.url;return{server_name:e,server_url_domain:n?this._extractHostname(n):null,transport:t.transport??null,has_auth:!!(t.authToken||t.authProvider)}}_extractHostname(e){try{return new URL(e).hostname}catch{return null}}},gue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ClientRemoveServerEvent`)}get name(){return`client_remove_server`}get properties(){return{server_name:this.data.serverName}}};function gO(e){return e._llm_type||e.constructor.name.toLowerCase()}a(gO,`getModelProvider`);function _O(e){if(`_identifyingParams`in e){let t=e._identifyingParams;if(typeof t==`object`&&t){for(let e of[`model`,`modelName`,`model_name`,`modelId`,`model_id`,`deploymentName`,`deployment_name`])if(e in t)return String(t[e])}}return e.model||e.modelName||e.constructor.name}a(_O,`getModelName`);function _ue(e){return[gO(e),_O(e)]}a(_ue,`extractModelInfo`);function vO(){if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.randomUUID==`function`)return globalThis.crypto.randomUUID();if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==`function`){let e=new Uint8Array(16);globalThis.crypto.getRandomValues(e);let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.substring(0,8)}-${t.substring(8,12)}-${t.substring(12,16)}-${t.substring(16,20)}-${t.substring(20)}`}return`${Date.now()}-${Math.random().toString(36).substring(2,15)}-${Math.random().toString(36).substring(2,15)}`}a(vO,`generateUUID`);function yO(){if(typeof window<`u`&&window.crypto&&typeof window.crypto.getRandomValues==`function`){let e=new Uint8Array(8);return window.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==`function`){let e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}return Math.random().toString(36).substring(2,15)}a(yO,`secureRandomString`);var bO=`mcp_use_user_id`;function xO(){return typeof localStorage<`u`&&typeof localStorage.getItem==`function`&&typeof localStorage.setItem==`function`&&typeof localStorage.removeItem==`function`}a(xO,`isLocalStorageFunctional`);function SO(){try{return typeof window<`u`&&typeof document<`u`?`browser`:`unknown`}catch{return`unknown`}}a(SO,`detectRuntimeEnvironment`);function CO(e){if(e===`browser`)try{if(xO())return localStorage.setItem(`__mcp_use_test__`,`1`),localStorage.removeItem(`__mcp_use_test__`),`localStorage`}catch{}return`session-only`}a(CO,`getStorageCapability`);var wO=null;function TO(){return wO===null&&(wO=SO()),wO}a(TO,`getRuntimeEnvironment`);var EO=class e{static{a(this,`Telemetry`)}static instance=null;PROJECT_API_KEY=`phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI`;HOST=`https://eu.i.posthog.com`;UNKNOWN_USER_ID=`UNKNOWN_USER_ID`;_currUserId=null;_posthogBrowserClient=null;_posthogLoading=null;_runtimeEnvironment;_storageCapability;_source;constructor(){this._runtimeEnvironment=TO(),this._storageCapability=CO(this._runtimeEnvironment),this._source=this._getSourceFromLocalStorage()||this._runtimeEnvironment;let e=this._checkTelemetryDisabled(),t=this._runtimeEnvironment!==`unknown`;e?(this._posthogBrowserClient=null,l.debug(`Telemetry disabled via localStorage`)):t?(l.debug(`Anonymized telemetry enabled. Set MCP_USE_ANONYMIZED_TELEMETRY=false in localStorage to disable.`),this._posthogLoading=this._initPostHogBrowser()):(this._posthogBrowserClient=null,l.debug(`Telemetry disabled - unknown environment: ${this._runtimeEnvironment}`))}_getSourceFromLocalStorage(){try{if(xO())return localStorage.getItem(`MCP_USE_TELEMETRY_SOURCE`)}catch{}return null}_checkTelemetryDisabled(){return!!(xO()&&localStorage.getItem(`MCP_USE_ANONYMIZED_TELEMETRY`)===`false`)}async _initPostHogBrowser(){try{let e=await J(()=>import(`./module-DjisYqbk.js`),[]),t=e.default||e.posthog;if(!t||typeof t.init!=`function`)throw Error(`posthog-js module did not export expected interface`);t.init(this.PROJECT_API_KEY,{api_host:this.HOST,persistence:`localStorage`,autocapture:!1,capture_pageview:!1,disable_session_recording:!0,loaded:a(()=>{l.debug(`PostHog browser client initialized`)},`loaded`)}),this._posthogBrowserClient=t}catch(e){l.warn(`Failed to initialize PostHog browser telemetry: ${e}`),this._posthogBrowserClient=null}}get runtimeEnvironment(){return this._runtimeEnvironment}get storageCapability(){return this._storageCapability}static getInstance(){return e.instance||=new e,e.instance}setSource(e){this._source=e;try{xO()&&localStorage.setItem(`MCP_USE_TELEMETRY_SOURCE`,e)}catch{}l.debug(`Telemetry source set to: ${e}`)}getSource(){return this._source}get isEnabled(){return this._posthogBrowserClient!==null}get userId(){if(this._currUserId)return this._currUserId;try{switch(this._storageCapability){case`localStorage`:this._currUserId=this._getUserIdFromLocalStorage();break;default:try{this._currUserId=`session-${vO()}`}catch{this._currUserId=`session-${Date.now()}-${yO()}`}break}}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}_getUserIdFromLocalStorage(){try{if(!xO())throw Error(`localStorage is not available or not functional`);localStorage.setItem(`__mcp_use_test__`,`1`),localStorage.removeItem(`__mcp_use_test__`);let e=localStorage.getItem(bO);if(!e){try{e=vO()}catch{e=`${Date.now()}-${yO()}`}localStorage.setItem(bO,e)}return e}catch(e){l.debug(`Failed to access localStorage for user ID: ${e}`);let t;try{t=`session-${vO()}`}catch{t=`session-${Date.now()}-${yO()}`}return t}}async capture(e){if(this._posthogLoading&&await this._posthogLoading,!this._posthogBrowserClient)return;let t=this.userId,n={...e.properties};if(n.mcp_use_version=pO(),n.language=`typescript`,n.source=this._source,n.runtime=this._runtimeEnvironment,this._posthogBrowserClient)try{this._posthogBrowserClient.capture(e.name,{...n,distinct_id:t})}catch(t){l.debug(`Failed to track PostHog Browser event ${e.name}: ${t}`)}}async trackAgentExecution(e){if(!this.isEnabled)return;let t=new oue(e);await this.capture(t)}async trackServerRunFromServer(e,t){if(!this.isEnabled)return;let n=new sue(hO(e,t));await this.capture(n)}async trackServerInitialize(e){if(!this.isEnabled)return;let t=new cue(e);await this.capture(t)}async trackServerToolCall(e){if(!this.isEnabled)return;let t=new lue(e);await this.capture(t)}async trackServerResourceCall(e){if(!this.isEnabled)return;let t=new uue(e);await this.capture(t)}async trackServerPromptCall(e){if(!this.isEnabled)return;let t=new due(e);await this.capture(t)}async trackServerContext(e){if(!this.isEnabled)return;let t=new fue(e);await this.capture(t)}async trackMCPClientInit(e){if(!this.isEnabled)return;let t=new pue(e);await this.capture(t)}async trackConnectorInit(e){if(!this.isEnabled)return;let t=new mue(e);await this.capture(t)}async trackClientAddServer(e,t){if(!this.isEnabled)return;let n=new hue({serverName:e,serverConfig:t});await this.capture(n)}async trackClientRemoveServer(e){if(!this.isEnabled)return;let t=new gue({serverName:e});await this.capture(t)}async trackUseMcpConnection(e){this.isEnabled&&await this.capture({name:`usemcp_connection`,properties:{url_domain:new URL(e.url).hostname,transport_type:e.transportType,success:e.success,error_type:e.errorType??null,connection_time_ms:e.connectionTimeMs??null,has_oauth:e.hasOAuth,has_sampling:e.hasSampling,has_elicitation:e.hasElicitation}})}async trackUseMcpToolCall(e){this.isEnabled&&await this.capture({name:`usemcp_tool_call`,properties:{tool_name:e.toolName,success:e.success,error_type:e.errorType??null,execution_time_ms:e.executionTimeMs??null}})}async trackUseMcpResourceRead(e){this.isEnabled&&await this.capture({name:`usemcp_resource_read`,properties:{resource_uri_scheme:e.resourceUri.split(`:`)[0],success:e.success,error_type:e.errorType??null}})}identify(e,t){if(this._posthogBrowserClient)try{this._posthogBrowserClient.identify(e,t)}catch(e){l.debug(`Failed to identify user: ${e}`)}}reset(){if(this._posthogBrowserClient)try{this._posthogBrowserClient.reset()}catch(e){l.debug(`Failed to reset user: ${e}`)}this._currUserId=null}flush(){}shutdown(){}async trackPackageDownload(e){}},DO=EO;function vue(e){DO.getInstance().setSource(e)}a(vue,`setTelemetrySource`);var yue=class{static{a(this,`BaseConnector`)}client=null;connectionManager=null;toolsCache=null;capabilitiesCache=null;serverInfoCache=null;connected=!1;opts;notificationHandlers=[];rootsCache=[];constructor(e={}){let t={...e,onSampling:e.onSampling??e.samplingCallback,onElicitation:e.onElicitation??e.elicitationCallback};e.samplingCallback&&!e.onSampling&&l.warn(`[BaseConnector] The "samplingCallback" option is deprecated. Use "onSampling" instead.`),e.elicitationCallback&&!e.onElicitation&&console.warn(`[BaseConnector] The "elicitationCallback" option is deprecated. Use "onElicitation" instead.`),this.opts=t,t.roots&&(this.rootsCache=[...t.roots]),t.onNotification&&this.notificationHandlers.push(t.onNotification)}trackConnectorInit(e){let t=this.constructor.name;EO.getInstance().trackConnectorInit({connectorType:t,...e}).catch(e=>l.debug(`Failed to track connector init: ${e}`))}onNotification(e){this.notificationHandlers.push(e),this.client&&this.setupNotificationHandler()}setupNotificationHandler(){if(!this.client)return;let e=a(async e=>{for(let t of this.notificationHandlers)try{await t(e)}catch(e){l.error(`Error in notification handler:`,e)}},`forwardToUserHandlers`);this.client.fallbackNotificationHandler=async t=>{switch(t.method){case`notifications/tools/list_changed`:await this.refreshToolsCache();break;case`notifications/resources/list_changed`:await this.onResourcesListChanged();break;case`notifications/prompts/list_changed`:await this.onPromptsListChanged();break;default:break}await e(t)};let t=this.client._notificationHandlers;for(let n of[`notifications/progress`,`notifications/cancelled`]){let r=t.get(n);r&&t.set(n,async t=>{await r(t),await e(t)})}}async refreshToolsCache(){if(this.client)try{l.debug(`[Auto] Refreshing tools cache due to list_changed notification`),this.toolsCache=(await this.client.listTools()).tools??[],l.debug(`[Auto] Refreshed tools cache: ${this.toolsCache.length} tools`)}catch(e){l.warn(`[Auto] Failed to refresh tools cache:`,e)}}async onResourcesListChanged(){l.debug(`[Auto] Resources list changed - clients should re-fetch if needed`)}async onPromptsListChanged(){l.debug(`[Auto] Prompts list changed - clients should re-fetch if needed`)}async setRoots(e){this.rootsCache=[...e],this.client&&(l.debug(`Sending roots/list_changed notification with ${e.length} root(s)`),await this.client.sendRootsListChanged())}getRoots(){return[...this.rootsCache]}setupRootsHandler(){this.client&&this.client.setRequestHandler(y_,async(e,t)=>(l.debug(`Server requested roots list, returning ${this.rootsCache.length} root(s)`),{roots:this.rootsCache}))}setupSamplingHandler(){if(!this.client){l.debug(`setupSamplingHandler: No client available`);return}let e=this.opts.onSampling??this.opts.samplingCallback;if(!e){l.debug(`setupSamplingHandler: No sampling callback provided`);return}l.debug(`setupSamplingHandler: Setting up sampling request handler`),this.client.setRequestHandler(p_,async(t,n)=>(l.debug(`Server requested sampling, forwarding to callback`),await e(t.params))),l.debug(`setupSamplingHandler: Sampling handler registered successfully`)}setupElicitationHandler(){if(!this.client){l.debug(`setupElicitationHandler: No client available`);return}let e=this.opts.onElicitation??this.opts.elicitationCallback;if(!e){l.debug(`setupElicitationHandler: No elicitation callback provided`);return}l.debug(`setupElicitationHandler: Setting up elicitation request handler`),this.client.setRequestHandler(g_,async(t,n)=>(l.debug(`Server requested elicitation, forwarding to callback`),await e(t.params))),l.debug(`setupElicitationHandler: Elicitation handler registered successfully`)}async disconnect(){if(!this.connected){l.debug(`Not connected to MCP implementation`);return}l.debug(`Disconnecting from MCP implementation`),await this.cleanupResources(),this.connected=!1,l.debug(`Disconnected from MCP implementation`)}get isClientConnected(){return this.client!=null}async initialize(e=this.opts.defaultRequestOptions??{}){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`Caching server capabilities & tools`);let t=this.client.getServerCapabilities();this.capabilitiesCache=t||null;let n=this.client.getServerVersion();this.serverInfoCache=n||null;try{this.toolsCache=(await this.client.listTools(void 0,e)).tools??[],l.debug(`Fetched ${this.toolsCache.length} tools from server`)}catch(e){let t=e;t.code===-32601?l.debug(`Server does not implement tools/list, assuming no tools`):l.debug(`Failed to list tools, assuming empty:`,t.message),this.toolsCache=[]}return l.debug(`Server capabilities:`,t),l.debug(`Server info:`,n),t}get tools(){if(!this.toolsCache)throw Error(`MCP client is not initialized; call initialize() first`);return this.toolsCache}get serverCapabilities(){return this.capabilitiesCache||{}}get serverInfo(){return this.serverInfoCache}async callTool(e,t,n){if(!this.client)throw Error(`MCP client is not connected`);let r=n?{...n}:void 0;r?.resetTimeoutOnProgress&&!r.onprogress&&(r.onprogress=()=>{},l.debug(`[BaseConnector] Added onprogress callback for tool '${e}' to enable progressToken`)),l.debug(`Calling tool '${e}' with args`,t);let i=await this.client.callTool({name:e,arguments:t},void 0,r);return l.debug(`Tool '${e}' returned`,i),i}async listTools(e){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`[listTools] Fetching fresh tools from server...`);let t=await this.client.listTools(void 0,e),n=t.tools?[...t.tools]:[];return l.debug(`[listTools] Returned ${n.length} tools:`,n.map(e=>e.name)),n}async listResources(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Listing resources`,e?`with cursor: ${e}`:``),await this.client.listResources({cursor:e},t)}async listAllResources(e){if(!this.client)throw Error(`MCP client is not connected`);if(!this.capabilitiesCache?.resources)return l.debug(`Server does not advertise resources capability, skipping`),{resources:[]};try{l.debug(`Listing all resources (with auto-pagination)`);let t=[],n;do{let r=await this.client.listResources({cursor:n},e);t.push(...r.resources||[]),n=r.nextCursor}while(n);return{resources:t}}catch(e){if(e.code===-32601)return l.debug(`Server advertised resources but method not found`),{resources:[]};throw e}}async listResourceTemplates(e){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Listing resource templates`),await this.client.listResourceTemplates(void 0,e)}async complete(e,t){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`[complete] Requesting completions for:`,e.ref);let n=await this.client.complete(e,t);return l.debug(`[complete] Received ${n.completion.values.length} suggestions`),n}async readResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Reading resource ${e}`),await this.client.readResource({uri:e},t)}async subscribeToResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Subscribing to resource: ${e}`),await this.client.subscribeResource({uri:e},t)}async unsubscribeFromResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Unsubscribing from resource: ${e}`),await this.client.unsubscribeResource({uri:e},t)}async listPrompts(){if(!this.client)throw Error(`MCP client is not connected`);if(!this.capabilitiesCache?.prompts)return l.debug(`Server does not advertise prompts capability, skipping`),{prompts:[]};try{return l.debug(`Listing prompts`),await this.client.listPrompts()}catch(e){if(e.code===-32601)return l.debug(`Server advertised prompts but method not found`),{prompts:[]};throw e}}async getPrompt(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Getting prompt ${e}`),await this.client.getPrompt({name:e,arguments:t})}async request(e,t=null,n){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Sending raw request '${e}' with params`,t),await this.client.request({method:e,params:t??{}},void 0,n)}async cleanupResources(){let e=[];if(this.client)try{typeof this.client.close==`function`&&await this.client.close()}catch(t){let n=`Error closing client: ${t}`;l.warn(n),e.push(n)}finally{this.client=null}if(this.connectionManager)try{await this.connectionManager.stop()}catch(t){let n=`Error stopping connection manager: ${t}`;l.warn(n),e.push(n)}finally{this.connectionManager=null}this.toolsCache=null,e.length&&l.warn(`Resource cleanup finished with ${e.length} issue(s)`)}},bue=class{static{a(this,`ConnectionManager`)}_readyPromise;_readyResolver;_donePromise;_doneResolver;_exception=null;_connection=null;_task=null;_abortController=null;constructor(){this.reset()}async start(){if(this.reset(),l.debug(`Starting ${this.constructor.name}`),this._task=this.connectionTask(),await this._readyPromise,this._exception)throw this._exception;if(this._connection===null)throw Error(`Connection was not established`);return this._connection}async stop(){if(this._task&&this._abortController){l.debug(`Cancelling ${this.constructor.name} task`),this._abortController.abort();try{await this._task}catch(e){e instanceof Error&&e.name===`AbortError`?l.debug(`${this.constructor.name} task aborted successfully`):l.warn(`Error stopping ${this.constructor.name} task: ${e}`)}}await this._donePromise,l.debug(`${this.constructor.name} task completed`)}reset(){this._readyPromise=new Promise(e=>this._readyResolver=e),this._donePromise=new Promise(e=>this._doneResolver=e),this._exception=null,this._connection=null,this._task=null,this._abortController=new AbortController}async connectionTask(){l.debug(`Running ${this.constructor.name} task`);try{this._connection=await this.establishConnection(),l.debug(`${this.constructor.name} connected successfully`),this._readyResolver(),await this.waitForAbort()}catch(e){this._exception=e,l.error(`Error in ${this.constructor.name} task: ${e}`),this._readyResolver()}finally{if(this._connection!==null){try{await this.closeConnection(this._connection)}catch(e){l.warn(`Error closing connection in ${this.constructor.name}: ${e}`)}this._connection=null}this._doneResolver()}}async waitForAbort(){return new Promise((e,t)=>{if(!this._abortController)return;let n=this._abortController.signal;if(n.aborted){e();return}let r=a(()=>{n.removeEventListener(`abort`,r),e()},`onAbort`);n.addEventListener(`abort`,r)})}},OO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),kO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=OO(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),AO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=OO(),n=kO(),r=OO();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=kO();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
438
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:K.string().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:K.string().optional().describe(`User's timezone in IANA format.`),userAgent:K.string().optional().describe(`Host application identifier.`),platform:K.union([K.literal(`web`),K.literal(`desktop`),K.literal(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:K.object({touch:K.boolean().optional().describe(`Whether the device supports touch input.`),hover:K.boolean().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:K.object({top:K.number().describe(`Top safe area inset in pixels.`),right:K.number().describe(`Right safe area inset in pixels.`),bottom:K.number().describe(`Bottom safe area inset in pixels.`),left:K.number().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();K.object({method:K.literal(`ui/notifications/host-context-changed`),params:dO.describe(`Partial context update containing only changed fields.`)}),K.object({method:K.literal(`ui/update-model-context`),params:K.object({content:K.array(n_).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:K.record(K.string(),K.unknown().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),K.object({method:K.literal(`ui/initialize`),params:K.object({appInfo:bg.describe(`App identification (name and version).`),appCapabilities:eue.describe(`Features and capabilities this app provides.`),protocolVersion:K.string().describe(`Protocol version this app supports.`)})}),K.object({protocolVersion:K.string().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:bg.describe(`Host application identification and version.`),hostCapabilities:$le.describe(`Features and capabilities provided by the host.`),hostContext:dO.describe(`Rich context about the host environment.`)}).passthrough();var nue=`text/html;profile=mcp-app`,rue=`modulepreload`,iue=function(e){return`/inspector/`+e},fO={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=iue(t,n),t in fO)return;fO[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:rue,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},aue=`1.27.0`;function pO(){return aue}a(pO,`getPackageVersion`);var mO=class{static{a(this,`BaseTelemetryEvent`)}},oue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`MCPAgentExecutionEvent`)}get name(){return`mcp_agent_execution`}get properties(){return{execution_method:this.data.executionMethod,query:this.data.query,query_length:this.data.query.length,success:this.data.success,model_provider:this.data.modelProvider,model_name:this.data.modelName,server_count:this.data.serverCount,server_identifiers:this.data.serverIdentifiers,total_tools_available:this.data.totalToolsAvailable,tools_available_names:this.data.toolsAvailableNames,max_steps_configured:this.data.maxStepsConfigured,memory_enabled:this.data.memoryEnabled,use_server_manager:this.data.useServerManager,max_steps_used:this.data.maxStepsUsed,manage_connector:this.data.manageConnector,external_history_used:this.data.externalHistoryUsed,steps_taken:this.data.stepsTaken??null,tools_used_count:this.data.toolsUsedCount??null,tools_used_names:this.data.toolsUsedNames??null,response:this.data.response??null,response_length:this.data.response?this.data.response.length:null,execution_time_ms:this.data.executionTimeMs??null,error_type:this.data.errorType??null,conversation_history_length:this.data.conversationHistoryLength??null}}};function hO(e,t){let n=Array.from(e.registrations.tools.values()),r=Array.from(e.registrations.prompts.values()),i=Array.from(e.registrations.resources.values()),a=Array.from(e.registrations.resourceTemplates.values()),o=i.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,uri:e.config.uri??null,mime_type:e.config.mimeType??null})),s=o.filter(e=>e.mime_type===`text/html+skybridge`),c=o.filter(e=>e.mime_type===`text/uri-list`||e.mime_type===`text/html`),l=o.filter(e=>e.mime_type===nue);return{transport:t,toolsNumber:e.registeredTools.length,resourcesNumber:e.registeredResources.length,promptsNumber:e.registeredPrompts.length,auth:!!e.oauthProvider,name:e.config.name,description:e.config.description??null,baseUrl:e.serverBaseUrl??null,toolNames:e.registeredTools.length>0?e.registeredTools:null,resourceNames:e.registeredResources.length>0?e.registeredResources:null,promptNames:e.registeredPrompts.length>0?e.registeredPrompts:null,tools:n.length>0?n.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,input_schema:e.config.schema?JSON.stringify(e.config.schema):null,output_schema:e.config.outputSchema?JSON.stringify(e.config.outputSchema):null})):null,resources:o.length>0?o:null,prompts:r.length>0?r.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null,args:e.config.args?JSON.stringify(e.config.args):null})):null,templates:a.length>0?a.map(e=>({name:e.config.name,title:e.config.title??null,description:e.config.description??null})):null,capabilities:{logging:!0,resources:{subscribe:!0,listChanged:!0}},appsSdkResources:s.length>0?s:null,appsSdkResourcesNumber:s.length,mcpUiResources:c.length>0?c:null,mcpUiResourcesNumber:c.length,mcpAppsResources:l.length>0?l:null,mcpAppsResourcesNumber:l.length}}a(hO,`createServerRunEventData`);var sue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerRunEvent`)}get name(){return`server_run`}get properties(){return{transport:this.data.transport,tools_number:this.data.toolsNumber,resources_number:this.data.resourcesNumber,prompts_number:this.data.promptsNumber,auth:this.data.auth,name:this.data.name,description:this.data.description??null,base_url:this.data.baseUrl??null,tool_names:this.data.toolNames??null,resource_names:this.data.resourceNames??null,prompt_names:this.data.promptNames??null,tools:this.data.tools??null,resources:this.data.resources??null,prompts:this.data.prompts??null,templates:this.data.templates??null,capabilities:this.data.capabilities?JSON.stringify(this.data.capabilities):null,apps_sdk_resources:this.data.appsSdkResources?JSON.stringify(this.data.appsSdkResources):null,apps_sdk_resources_number:this.data.appsSdkResourcesNumber??0,mcp_ui_resources:this.data.mcpUiResources?JSON.stringify(this.data.mcpUiResources):null,mcp_ui_resources_number:this.data.mcpUiResourcesNumber??0,mcp_apps_resources:this.data.mcpAppsResources?JSON.stringify(this.data.mcpAppsResources):null,mcp_apps_resources_number:this.data.mcpAppsResourcesNumber??0}}},cue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerInitializeEvent`)}get name(){return`server_initialize_call`}get properties(){return{protocol_version:this.data.protocolVersion,client_info:JSON.stringify(this.data.clientInfo),client_capabilities:JSON.stringify(this.data.clientCapabilities),session_id:this.data.sessionId??null}}},lue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerToolCallEvent`)}get name(){return`server_tool_call`}get properties(){return{tool_name:this.data.toolName,length_input_argument:this.data.lengthInputArgument,success:this.data.success,error_type:this.data.errorType??null,execution_time_ms:this.data.executionTimeMs??null}}},uue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerResourceCallEvent`)}get name(){return`server_resource_call`}get properties(){return{name:this.data.name,description:this.data.description,contents:this.data.contents,success:this.data.success,error_type:this.data.errorType??null}}},due=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerPromptCallEvent`)}get name(){return`server_prompt_call`}get properties(){return{name:this.data.name,description:this.data.description,success:this.data.success,error_type:this.data.errorType??null}}},fue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ServerContextEvent`)}get name(){return`server_context_${this.data.contextType}`}get properties(){return{context_type:this.data.contextType,notification_type:this.data.notificationType??null}}},pue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`MCPClientInitEvent`)}get name(){return`mcpclient_init`}get properties(){return{code_mode:this.data.codeMode,sandbox:this.data.sandbox,all_callbacks:this.data.allCallbacks,verify:this.data.verify,servers:this.data.servers,num_servers:this.data.numServers,is_browser:this.data.isBrowser}}},mue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ConnectorInitEvent`)}get name(){return`connector_init`}get properties(){return{connector_type:this.data.connectorType,server_command:this.data.serverCommand??null,server_args:this.data.serverArgs??null,server_url:this.data.serverUrl??null,public_identifier:this.data.publicIdentifier??null}}},hue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ClientAddServerEvent`)}get name(){return`client_add_server`}get properties(){let{serverName:e,serverConfig:t}=this.data,n=t.url;return{server_name:e,server_url_domain:n?this._extractHostname(n):null,transport:t.transport??null,has_auth:!!(t.authToken||t.authProvider)}}_extractHostname(e){try{return new URL(e).hostname}catch{return null}}},gue=class extends mO{constructor(e){super(),this.data=e}static{a(this,`ClientRemoveServerEvent`)}get name(){return`client_remove_server`}get properties(){return{server_name:this.data.serverName}}};function gO(e){return e._llm_type||e.constructor.name.toLowerCase()}a(gO,`getModelProvider`);function _O(e){if(`_identifyingParams`in e){let t=e._identifyingParams;if(typeof t==`object`&&t){for(let e of[`model`,`modelName`,`model_name`,`modelId`,`model_id`,`deploymentName`,`deployment_name`])if(e in t)return String(t[e])}}return e.model||e.modelName||e.constructor.name}a(_O,`getModelName`);function _ue(e){return[gO(e),_O(e)]}a(_ue,`extractModelInfo`);function vO(){if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.randomUUID==`function`)return globalThis.crypto.randomUUID();if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==`function`){let e=new Uint8Array(16);globalThis.crypto.getRandomValues(e);let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.substring(0,8)}-${t.substring(8,12)}-${t.substring(12,16)}-${t.substring(16,20)}-${t.substring(20)}`}return`${Date.now()}-${Math.random().toString(36).substring(2,15)}-${Math.random().toString(36).substring(2,15)}`}a(vO,`generateUUID`);function yO(){if(typeof window<`u`&&window.crypto&&typeof window.crypto.getRandomValues==`function`){let e=new Uint8Array(8);return window.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}if(typeof globalThis<`u`&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==`function`){let e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}return Math.random().toString(36).substring(2,15)}a(yO,`secureRandomString`);var bO=`mcp_use_user_id`;function xO(){return typeof localStorage<`u`&&typeof localStorage.getItem==`function`&&typeof localStorage.setItem==`function`&&typeof localStorage.removeItem==`function`}a(xO,`isLocalStorageFunctional`);function SO(){try{return typeof window<`u`&&typeof document<`u`?`browser`:`unknown`}catch{return`unknown`}}a(SO,`detectRuntimeEnvironment`);function CO(e){if(e===`browser`)try{if(xO())return localStorage.setItem(`__mcp_use_test__`,`1`),localStorage.removeItem(`__mcp_use_test__`),`localStorage`}catch{}return`session-only`}a(CO,`getStorageCapability`);var wO=null;function TO(){return wO===null&&(wO=SO()),wO}a(TO,`getRuntimeEnvironment`);var EO=class e{static{a(this,`Telemetry`)}static instance=null;PROJECT_API_KEY=`phc_lyTtbYwvkdSbrcMQNPiKiiRWrrM1seyKIMjycSvItEI`;HOST=`https://eu.i.posthog.com`;UNKNOWN_USER_ID=`UNKNOWN_USER_ID`;_currUserId=null;_posthogBrowserClient=null;_posthogLoading=null;_runtimeEnvironment;_storageCapability;_source;constructor(){this._runtimeEnvironment=TO(),this._storageCapability=CO(this._runtimeEnvironment),this._source=this._getSourceFromLocalStorage()||this._runtimeEnvironment;let e=this._checkTelemetryDisabled(),t=this._runtimeEnvironment!==`unknown`;e?(this._posthogBrowserClient=null,l.debug(`Telemetry disabled via localStorage`)):t?(l.debug(`Anonymized telemetry enabled. Set MCP_USE_ANONYMIZED_TELEMETRY=false in localStorage to disable.`),this._posthogLoading=this._initPostHogBrowser()):(this._posthogBrowserClient=null,l.debug(`Telemetry disabled - unknown environment: ${this._runtimeEnvironment}`))}_getSourceFromLocalStorage(){try{if(xO())return localStorage.getItem(`MCP_USE_TELEMETRY_SOURCE`)}catch{}return null}_checkTelemetryDisabled(){return!!(typeof window<`u`&&window.__MCP_USE_ANONYMIZED_TELEMETRY__===!1||xO()&&localStorage.getItem(`MCP_USE_ANONYMIZED_TELEMETRY`)===`false`)}async _initPostHogBrowser(){try{let e=await J(()=>import(`./module-DjisYqbk.js`),[]),t=e.default||e.posthog;if(!t||typeof t.init!=`function`)throw Error(`posthog-js module did not export expected interface`);t.init(this.PROJECT_API_KEY,{api_host:this.HOST,persistence:`localStorage`,autocapture:!1,capture_pageview:!1,disable_session_recording:!0,loaded:a(()=>{l.debug(`PostHog browser client initialized`)},`loaded`)}),this._posthogBrowserClient=t}catch(e){l.warn(`Failed to initialize PostHog browser telemetry: ${e}`),this._posthogBrowserClient=null}}get runtimeEnvironment(){return this._runtimeEnvironment}get storageCapability(){return this._storageCapability}static getInstance(){return e.instance||=new e,e.instance}setSource(e){this._source=e;try{xO()&&localStorage.setItem(`MCP_USE_TELEMETRY_SOURCE`,e)}catch{}l.debug(`Telemetry source set to: ${e}`)}getSource(){return this._source}get isEnabled(){return this._posthogBrowserClient!==null}get userId(){if(this._currUserId)return this._currUserId;try{switch(this._storageCapability){case`localStorage`:this._currUserId=this._getUserIdFromLocalStorage();break;default:try{this._currUserId=`session-${vO()}`}catch{this._currUserId=`session-${Date.now()}-${yO()}`}break}}catch{this._currUserId=this.UNKNOWN_USER_ID}return this._currUserId}_getUserIdFromLocalStorage(){try{if(!xO())throw Error(`localStorage is not available or not functional`);localStorage.setItem(`__mcp_use_test__`,`1`),localStorage.removeItem(`__mcp_use_test__`);let e=localStorage.getItem(bO);if(!e){try{e=vO()}catch{e=`${Date.now()}-${yO()}`}localStorage.setItem(bO,e)}return e}catch(e){l.debug(`Failed to access localStorage for user ID: ${e}`);let t;try{t=`session-${vO()}`}catch{t=`session-${Date.now()}-${yO()}`}return t}}async capture(e){if(this._posthogLoading&&await this._posthogLoading,!this._posthogBrowserClient)return;let t=this.userId,n={...e.properties};if(n.mcp_use_version=pO(),n.language=`typescript`,n.source=this._source,n.runtime=this._runtimeEnvironment,this._posthogBrowserClient)try{this._posthogBrowserClient.capture(e.name,{...n,distinct_id:t})}catch(t){l.debug(`Failed to track PostHog Browser event ${e.name}: ${t}`)}}async trackAgentExecution(e){if(!this.isEnabled)return;let t=new oue(e);await this.capture(t)}async trackServerRunFromServer(e,t){if(!this.isEnabled)return;let n=new sue(hO(e,t));await this.capture(n)}async trackServerInitialize(e){if(!this.isEnabled)return;let t=new cue(e);await this.capture(t)}async trackServerToolCall(e){if(!this.isEnabled)return;let t=new lue(e);await this.capture(t)}async trackServerResourceCall(e){if(!this.isEnabled)return;let t=new uue(e);await this.capture(t)}async trackServerPromptCall(e){if(!this.isEnabled)return;let t=new due(e);await this.capture(t)}async trackServerContext(e){if(!this.isEnabled)return;let t=new fue(e);await this.capture(t)}async trackMCPClientInit(e){if(!this.isEnabled)return;let t=new pue(e);await this.capture(t)}async trackConnectorInit(e){if(!this.isEnabled)return;let t=new mue(e);await this.capture(t)}async trackClientAddServer(e,t){if(!this.isEnabled)return;let n=new hue({serverName:e,serverConfig:t});await this.capture(n)}async trackClientRemoveServer(e){if(!this.isEnabled)return;let t=new gue({serverName:e});await this.capture(t)}async trackUseMcpConnection(e){this.isEnabled&&await this.capture({name:`usemcp_connection`,properties:{url_domain:new URL(e.url).hostname,transport_type:e.transportType,success:e.success,error_type:e.errorType??null,connection_time_ms:e.connectionTimeMs??null,has_oauth:e.hasOAuth,has_sampling:e.hasSampling,has_elicitation:e.hasElicitation}})}async trackUseMcpToolCall(e){this.isEnabled&&await this.capture({name:`usemcp_tool_call`,properties:{tool_name:e.toolName,success:e.success,error_type:e.errorType??null,execution_time_ms:e.executionTimeMs??null}})}async trackUseMcpResourceRead(e){this.isEnabled&&await this.capture({name:`usemcp_resource_read`,properties:{resource_uri_scheme:e.resourceUri.split(`:`)[0],success:e.success,error_type:e.errorType??null}})}identify(e,t){if(this._posthogBrowserClient)try{this._posthogBrowserClient.identify(e,t)}catch(e){l.debug(`Failed to identify user: ${e}`)}}reset(){if(this._posthogBrowserClient)try{this._posthogBrowserClient.reset()}catch(e){l.debug(`Failed to reset user: ${e}`)}this._currUserId=null}flush(){}shutdown(){}async trackPackageDownload(e){}},DO=EO;function vue(e){DO.getInstance().setSource(e)}a(vue,`setTelemetrySource`);var yue=class{static{a(this,`BaseConnector`)}client=null;connectionManager=null;toolsCache=null;capabilitiesCache=null;serverInfoCache=null;connected=!1;opts;notificationHandlers=[];rootsCache=[];constructor(e={}){let t={...e,onSampling:e.onSampling??e.samplingCallback,onElicitation:e.onElicitation??e.elicitationCallback};e.samplingCallback&&!e.onSampling&&l.warn(`[BaseConnector] The "samplingCallback" option is deprecated. Use "onSampling" instead.`),e.elicitationCallback&&!e.onElicitation&&console.warn(`[BaseConnector] The "elicitationCallback" option is deprecated. Use "onElicitation" instead.`),this.opts=t,t.roots&&(this.rootsCache=[...t.roots]),t.onNotification&&this.notificationHandlers.push(t.onNotification)}trackConnectorInit(e){let t=this.constructor.name;EO.getInstance().trackConnectorInit({connectorType:t,...e}).catch(e=>l.debug(`Failed to track connector init: ${e}`))}onNotification(e){this.notificationHandlers.push(e),this.client&&this.setupNotificationHandler()}setupNotificationHandler(){if(!this.client)return;let e=a(async e=>{for(let t of this.notificationHandlers)try{await t(e)}catch(e){l.error(`Error in notification handler:`,e)}},`forwardToUserHandlers`);this.client.fallbackNotificationHandler=async t=>{switch(t.method){case`notifications/tools/list_changed`:await this.refreshToolsCache();break;case`notifications/resources/list_changed`:await this.onResourcesListChanged();break;case`notifications/prompts/list_changed`:await this.onPromptsListChanged();break;default:break}await e(t)};let t=this.client._notificationHandlers;for(let n of[`notifications/progress`,`notifications/cancelled`]){let r=t.get(n);r&&t.set(n,async t=>{await r(t),await e(t)})}}async refreshToolsCache(){if(this.client)try{l.debug(`[Auto] Refreshing tools cache due to list_changed notification`),this.toolsCache=(await this.client.listTools()).tools??[],l.debug(`[Auto] Refreshed tools cache: ${this.toolsCache.length} tools`)}catch(e){l.warn(`[Auto] Failed to refresh tools cache:`,e)}}async onResourcesListChanged(){l.debug(`[Auto] Resources list changed - clients should re-fetch if needed`)}async onPromptsListChanged(){l.debug(`[Auto] Prompts list changed - clients should re-fetch if needed`)}async setRoots(e){this.rootsCache=[...e],this.client&&(l.debug(`Sending roots/list_changed notification with ${e.length} root(s)`),await this.client.sendRootsListChanged())}getRoots(){return[...this.rootsCache]}setupRootsHandler(){this.client&&this.client.setRequestHandler(y_,async(e,t)=>(l.debug(`Server requested roots list, returning ${this.rootsCache.length} root(s)`),{roots:this.rootsCache}))}setupSamplingHandler(){if(!this.client){l.debug(`setupSamplingHandler: No client available`);return}let e=this.opts.onSampling??this.opts.samplingCallback;if(!e){l.debug(`setupSamplingHandler: No sampling callback provided`);return}l.debug(`setupSamplingHandler: Setting up sampling request handler`),this.client.setRequestHandler(p_,async(t,n)=>(l.debug(`Server requested sampling, forwarding to callback`),await e(t.params))),l.debug(`setupSamplingHandler: Sampling handler registered successfully`)}setupElicitationHandler(){if(!this.client){l.debug(`setupElicitationHandler: No client available`);return}let e=this.opts.onElicitation??this.opts.elicitationCallback;if(!e){l.debug(`setupElicitationHandler: No elicitation callback provided`);return}l.debug(`setupElicitationHandler: Setting up elicitation request handler`),this.client.setRequestHandler(g_,async(t,n)=>(l.debug(`Server requested elicitation, forwarding to callback`),await e(t.params))),l.debug(`setupElicitationHandler: Elicitation handler registered successfully`)}async disconnect(){if(!this.connected){l.debug(`Not connected to MCP implementation`);return}l.debug(`Disconnecting from MCP implementation`),await this.cleanupResources(),this.connected=!1,l.debug(`Disconnected from MCP implementation`)}get isClientConnected(){return this.client!=null}async initialize(e=this.opts.defaultRequestOptions??{}){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`Caching server capabilities & tools`);let t=this.client.getServerCapabilities();this.capabilitiesCache=t||null;let n=this.client.getServerVersion();this.serverInfoCache=n||null;try{this.toolsCache=(await this.client.listTools(void 0,e)).tools??[],l.debug(`Fetched ${this.toolsCache.length} tools from server`)}catch(e){let t=e;t.code===-32601?l.debug(`Server does not implement tools/list, assuming no tools`):l.debug(`Failed to list tools, assuming empty:`,t.message),this.toolsCache=[]}return l.debug(`Server capabilities:`,t),l.debug(`Server info:`,n),t}get tools(){if(!this.toolsCache)throw Error(`MCP client is not initialized; call initialize() first`);return this.toolsCache}get serverCapabilities(){return this.capabilitiesCache||{}}get serverInfo(){return this.serverInfoCache}async callTool(e,t,n){if(!this.client)throw Error(`MCP client is not connected`);let r=n?{...n}:void 0;r?.resetTimeoutOnProgress&&!r.onprogress&&(r.onprogress=()=>{},l.debug(`[BaseConnector] Added onprogress callback for tool '${e}' to enable progressToken`)),l.debug(`Calling tool '${e}' with args`,t);let i=await this.client.callTool({name:e,arguments:t},void 0,r);return l.debug(`Tool '${e}' returned`,i),i}async listTools(e){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`[listTools] Fetching fresh tools from server...`);let t=await this.client.listTools(void 0,e),n=t.tools?[...t.tools]:[];return l.debug(`[listTools] Returned ${n.length} tools:`,n.map(e=>e.name)),n}async listResources(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Listing resources`,e?`with cursor: ${e}`:``),await this.client.listResources({cursor:e},t)}async listAllResources(e){if(!this.client)throw Error(`MCP client is not connected`);if(!this.capabilitiesCache?.resources)return l.debug(`Server does not advertise resources capability, skipping`),{resources:[]};try{l.debug(`Listing all resources (with auto-pagination)`);let t=[],n;do{let r=await this.client.listResources({cursor:n},e);t.push(...r.resources||[]),n=r.nextCursor}while(n);return{resources:t}}catch(e){if(e.code===-32601)return l.debug(`Server advertised resources but method not found`),{resources:[]};throw e}}async listResourceTemplates(e){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Listing resource templates`),await this.client.listResourceTemplates(void 0,e)}async complete(e,t){if(!this.client)throw Error(`MCP client is not connected`);l.debug(`[complete] Requesting completions for:`,e.ref);let n=await this.client.complete(e,t);return l.debug(`[complete] Received ${n.completion.values.length} suggestions`),n}async readResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Reading resource ${e}`),await this.client.readResource({uri:e},t)}async subscribeToResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Subscribing to resource: ${e}`),await this.client.subscribeResource({uri:e},t)}async unsubscribeFromResource(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Unsubscribing from resource: ${e}`),await this.client.unsubscribeResource({uri:e},t)}async listPrompts(){if(!this.client)throw Error(`MCP client is not connected`);if(!this.capabilitiesCache?.prompts)return l.debug(`Server does not advertise prompts capability, skipping`),{prompts:[]};try{return l.debug(`Listing prompts`),await this.client.listPrompts()}catch(e){if(e.code===-32601)return l.debug(`Server advertised prompts but method not found`),{prompts:[]};throw e}}async getPrompt(e,t){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Getting prompt ${e}`),await this.client.getPrompt({name:e,arguments:t})}async request(e,t=null,n){if(!this.client)throw Error(`MCP client is not connected`);return l.debug(`Sending raw request '${e}' with params`,t),await this.client.request({method:e,params:t??{}},void 0,n)}async cleanupResources(){let e=[];if(this.client)try{typeof this.client.close==`function`&&await this.client.close()}catch(t){let n=`Error closing client: ${t}`;l.warn(n),e.push(n)}finally{this.client=null}if(this.connectionManager)try{await this.connectionManager.stop()}catch(t){let n=`Error stopping connection manager: ${t}`;l.warn(n),e.push(n)}finally{this.connectionManager=null}this.toolsCache=null,e.length&&l.warn(`Resource cleanup finished with ${e.length} issue(s)`)}},bue=class{static{a(this,`ConnectionManager`)}_readyPromise;_readyResolver;_donePromise;_doneResolver;_exception=null;_connection=null;_task=null;_abortController=null;constructor(){this.reset()}async start(){if(this.reset(),l.debug(`Starting ${this.constructor.name}`),this._task=this.connectionTask(),await this._readyPromise,this._exception)throw this._exception;if(this._connection===null)throw Error(`Connection was not established`);return this._connection}async stop(){if(this._task&&this._abortController){l.debug(`Cancelling ${this.constructor.name} task`),this._abortController.abort();try{await this._task}catch(e){e instanceof Error&&e.name===`AbortError`?l.debug(`${this.constructor.name} task aborted successfully`):l.warn(`Error stopping ${this.constructor.name} task: ${e}`)}}await this._donePromise,l.debug(`${this.constructor.name} task completed`)}reset(){this._readyPromise=new Promise(e=>this._readyResolver=e),this._donePromise=new Promise(e=>this._doneResolver=e),this._exception=null,this._connection=null,this._task=null,this._abortController=new AbortController}async connectionTask(){l.debug(`Running ${this.constructor.name} task`);try{this._connection=await this.establishConnection(),l.debug(`${this.constructor.name} connected successfully`),this._readyResolver(),await this.waitForAbort()}catch(e){this._exception=e,l.error(`Error in ${this.constructor.name} task: ${e}`),this._readyResolver()}finally{if(this._connection!==null){try{await this.closeConnection(this._connection)}catch(e){l.warn(`Error closing connection in ${this.constructor.name}: ${e}`)}this._connection=null}this._doneResolver()}}async waitForAbort(){return new Promise((e,t)=>{if(!this._abortController)return;let n=this._abortController.signal;if(n.aborted){e();return}let r=a(()=>{n.removeEventListener(`abort`,r),e()},`onAbort`);n.addEventListener(`abort`,r)})}},OO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),kO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=OO(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),AO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=OO(),n=kO(),r=OO();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=kO();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
439
439
  `:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function k(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function A(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function j(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${L(e)}`}e.not=j;var M=I(e.operators.AND);function N(...e){return e.reduce(M)}e.and=N;var P=I(e.operators.OR);function F(...e){return e.reduce(P)}e.or=F;function I(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${L(n)} ${e} ${L(r)}`}function L(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),jO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=AO(),n=OO();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),MO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=AO();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),NO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=AO(),n=jO(),r=MO();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),xue=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=NO(),n=AO(),r=MO(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),PO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),FO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),IO=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=PO(),n=FO(),r=NO(),i=AO(),a=jO(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
440
440
  || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
441
441
  || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
@@ -528,7 +528,7 @@ print(f"Available resources: {[resource.name for resource in resources]}")
528
528
  # result = await session.call_tool("tool_name", {"param": "value"})
529
529
 
530
530
  # Read a resource (example)
531
- # resource_content = await session.read_resource("resource_uri")`}function Vwe({className:e,size:t=`md`}){return(0,S.jsxs)(`svg`,{viewBox:`0 0 303 303`,className:H(`text-current`,{sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`}[t],e),fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`m105.5 34.8.6.6c9.5 9.5 14.4 21.9 14.6 34.4a112.6 112.6 0 0 0 112.2 112.1h.6c12 .4 24 5.1 33.2 14.1l.6.6a50 50 0 0 1-70.1 71.3l-.6-.6A49.9 49.9 0 0 1 182 230 112.6 112.6 0 0 0 73.4 120.7h-.8a49.9 49.9 0 0 1-36.7-14l-.5-.6a50 50 0 0 1-.6-70.2l.6-.5a50 50 0 0 1 69.5-1.2l.6.6Z`}),(0,S.jsx)(`circle`,{cx:`70.3`,cy:`232.3`,r:`50`}),(0,S.jsx)(`circle`,{cx:`232.3`,cy:`70.3`,r:`50`})]})}function PJ({className:e}){return(0,S.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,S.jsx)(`path`,{d:`M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})})}function Hwe({className:e}){return(0,S.jsxs)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`ModelContextProtocol`,children:[(0,S.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),(0,S.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`})]})}function Uwe({className:e}){return(0,S.jsx)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`OpenAI`,children:(0,S.jsx)(`path`,{d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`})})}function Wwe({className:e}){return(0,S.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,S.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}function Gwe({isOpen:e,onOpenChange:t,tools:n,prompts:r,resources:i,savedRequests:a,connections:o,selectedServer:s,tunnelUrl:c,onNavigate:l,onServerSelect:u}){let[d,f]=(0,w.useState)(``),p=(0,w.useRef)(null),m=aM(),h=s?c?`${c}/mcp`:s.url:null,g=s?.name||`MCP Server`,_=s?.customHeaders,v=s?[{id:`open-in-cursor`,name:`Open in Cursor`,description:`Add this server to Cursor`,type:`global`,category:`Open in Client`,action:()=>{try{let e=EJ(h,g,_);window.location.href=e,BM.success(`Opening in Cursor...`),t(!1)}catch{BM.error(`Failed to open in Cursor`)}}},{id:`open-in-claude-code`,name:`Open in Claude Code`,description:`Add this server to Claude Code CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=AJ(h,g,_);yj(e),BM.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-claude-desktop`,name:`Open in Claude Desktop`,description:`Download .mcpb configuration file`,type:`global`,category:`Open in Client`,action:()=>{try{kJ(h,g,_),BM.success(`Downloaded .mcpb file`),t(!1)}catch{BM.error(`Failed to download configuration file`)}}},{id:`open-in-vscode`,name:`Open in VS Code`,description:`Add this server to VS Code`,type:`global`,category:`Open in Client`,action:()=>{try{let e=DJ(h,g,_);window.location.href=e,BM.success(`Opening in VS Code...`),t(!1)}catch{BM.error(`Failed to open in VS Code`)}}},{id:`open-in-vscode-insiders`,name:`Open in VS Code Insiders`,description:`Add this server to VS Code Insiders`,type:`global`,category:`Open in Client`,action:()=>{try{let e=OJ(h,g,_);window.location.href=e,BM.success(`Opening in VS Code Insiders...`),t(!1)}catch{BM.error(`Failed to open in VS Code Insiders`)}}},{id:`open-in-gemini`,name:`Open in Gemini CLI`,description:`Add this server to Gemini CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=jJ(h,g,_);yj(e),BM.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-codex`,name:`Open in Codex CLI`,description:`Add this server to Codex CLI`,type:`global`,category:`Open in Client`,action:()=>{let{config:e}=MJ(h,g,_);yj(e),BM.success(`Config copied to clipboard`),t(!1)}}]:[],y=[{id:`connect-server`,name:`Connect Server`,description:`Add a new MCP server connection`,type:`global`,category:`Navigation`,action:()=>m(`/`)},{id:`mcp-use-website`,name:`MCP Use Website`,description:`Visit mcp-use.com for tools and resources`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com`,`_blank`)},{id:`mcp-use-docs`,name:`How to Create an MCP Server`,description:`Step-by-step guide to building MCP servers`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com/docs`,`_blank`)},{id:`mcp-docs`,name:`MCP Official Documentation`,description:`Learn about the Model Context Protocol`,type:`global`,category:`Documentation`,action:()=>window.open(`https://modelcontextprotocol.io/docs/getting-started/intro`,`_blank`)},{id:`discord`,name:`Join Discord Community`,description:`Connect with the MCP community`,type:`global`,category:`Community`,action:()=>window.open(`https://discord.gg/XkNkSkMz3V`,`_blank`)},{id:`clear-localstorage`,name:`Clear localStorage & Reload`,description:`Having trouble connecting? Clear stored auth data and refresh`,type:`global`,category:`Troubleshooting`,action:()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`mcp:auth`)||n.startsWith(`mcp-inspector`))&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),BM.success(`Cleared ${e.length} localStorage item(s). Refreshing page...`,{duration:2e3}),setTimeout(()=>{window.location.reload()},500),t(!1)}}],b=o.map(e=>({id:`server-${e.id}`,name:Tj(e),description:`Connected server (${e.state})`,type:`global`,category:`Connected Servers`,metadata:{serverId:e.id,state:e.state},action:()=>u(e.id)})),x=[...y,...v,...b,...n.map(e=>({id:`tool-${e.name}`,name:e.name,description:e.description,type:`tool`,category:e._serverName?`Tools - ${e._serverName}`:`Tools`,metadata:{inputSchema:e.inputSchema,serverId:e._serverId,serverName:e._serverName}})),...r.map(e=>({id:`prompt-${e.name}`,name:e.name,description:e.description,type:`prompt`,category:e._serverName?`Prompts - ${e._serverName}`:`Prompts`,metadata:{arguments:e.arguments,serverId:e._serverId,serverName:e._serverName}})),...i.map(e=>({id:`resource-${e.uri}`,name:e.name,description:e.description,type:`resource`,category:e._serverName?`Resources - ${e._serverName}`:`Resources`,metadata:{uri:e.uri,mimeType:e.mimeType,serverId:e._serverId,serverName:e._serverName}})),...a.map(e=>({id:`saved-${e.id}`,name:e.name,description:`Saved request for ${e.toolName}`,type:`saved-request`,category:`Saved Requests`,metadata:{toolName:e.toolName,args:e.args,savedAt:e.savedAt,serverId:e.serverId,serverName:e.serverName}}))],C=(0,w.useCallback)(e=>{if(console.warn(`[CommandPalette] Item selected:`,{itemType:e.type,itemName:e.name,itemId:e.id,metadata:e.metadata}),e.action)console.warn(`[CommandPalette] Executing action for global item`),e.action(),t(!1);else if(e.type===`global`)e.metadata?.serverId&&(console.warn(`[CommandPalette] Selecting server:`,e.metadata.serverId),u(e.metadata.serverId),t(!1));else{let n=e.type===`resource`?e.metadata?.uri:e.name,r=e.type===`tool`?`tools`:e.type===`prompt`?`prompts`:e.type===`saved-request`?`tools`:`resources`;console.warn(`[CommandPalette] Navigating to item:`,{tab:r,itemIdentifier:n,serverId:e.metadata?.serverId}),l(r,n,e.metadata?.serverId),t(!1)}},[l,t,u]),T=(e,t,n)=>{switch(e){case`tool`:return(0,S.jsx)(`div`,{className:`bg-blue-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Bp,{className:`h-4 w-4 text-blue-500`})});case`prompt`:return(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(sp,{className:`h-4 w-4 text-purple-500`})});case`resource`:return(0,S.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Kf,{className:`h-4 w-4 text-green-500`})});case`saved-request`:return(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Qf,{className:`h-4 w-4 text-orange-500`})});case`global`:if(t===`Navigation`)return(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(hp,{className:`h-4 w-4 text-gray-600 dark:text-gray-300`})});if(t===`Open in Client`){if(n?.includes(`Cursor`))return(0,S.jsx)(`div`,{className:`bg-gray-200 dark:bg-gray-800 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`})});if(n?.includes(`Claude Code`)||n?.includes(`Claude Desktop`))return(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`})});if(n?.includes(`VS Code`))return(0,S.jsx)(`div`,{className:`bg-blue-600/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(PJ,{className:`h-4 w-4 text-blue-600`})});if(n?.includes(`Gemini`))return(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`})});if(n?.includes(`Codex`))return(0,S.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`})})}return t===`Documentation`?n?.includes(`MCP Use`)||n?.includes(`mcp-use`)?(0,S.jsx)(`div`,{className:`bg-black/10 dark:bg-white/10 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vwe,{className:`h-4 w-4 text-black dark:text-white`,size:`sm`})}):(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vf,{className:`h-4 w-4 text-orange-500`})}):t===`Community`?(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Wwe,{className:`h-4 w-4 text-purple-500`})}):t===`Troubleshooting`?(0,S.jsx)(`div`,{className:`bg-yellow-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(xf,{className:`h-4 w-4 text-yellow-500`})}):t===`Connected Servers`?(0,S.jsx)(`div`,{className:`bg-cyan-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Cp,{className:`h-4 w-4 text-cyan-500`})}):(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vf,{className:`h-4 w-4 text-gray-500`})});default:return(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(xp,{className:`h-4 w-4 text-gray-500`})})}};return(0,w.useEffect)(()=>{e&&f(``)},[e,f]),(0,w.useEffect)(()=>{p.current&&(p.current.scrollTop=0)},[d]),(0,S.jsxs)(gJ.Dialog,{open:e,onOpenChange:t,label:`Command Palette`,className:`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[51] max-w-[640px] w-[calc(100vw-2rem)] sm:w-full p-2 bg-white dark:bg-zinc-900/90 backdrop-blur-xl rounded-xl overflow-hidden border border-border shadow-[var(--cmdk-shadow)] transition-transform duration-100 ease-out outline-none`,overlayClassName:`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm`,"data-testid":`command-palette-dialog`,children:[(0,S.jsx)(gJ.Input,{placeholder:`What do you need?`,value:d,onValueChange:f,className:`border-none w-full text-[17px] px-4 pt-2 pb-4 outline-none bg-transparent text-foreground border-b border-border mb-0 rounded-none placeholder:text-muted-foreground`,"data-testid":`command-palette-input`}),(0,S.jsxs)(gJ.List,{ref:p,className:`min-h-[200px] sm:min-h-[330px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100 ease-out`,"data-testid":`command-palette-list`,children:[(0,S.jsx)(gJ.Empty,{className:`text-sm flex items-center justify-center h-12 whitespace-pre-wrap text-muted-foreground`,children:`No results found.`}),x.map(e=>(0,S.jsxs)(gJ.Item,{"data-testid":`command-palette-item-${e.id}`,value:`${e.name} ${e.description||``} ${e.category}`,onSelect:()=>C(e),className:`[content-visibility:auto] cursor-pointer h-12 rounded-lg text-sm flex items-center gap-3 px-4 text-foreground select-none will-change-[background,color] transition-all duration-150 data-[selected=true]:bg-accent data-[selected=true]:text-foreground data-[disabled=true]:text-muted-foreground/50 data-[disabled=true]:cursor-not-allowed active:bg-accent/80 mt-1 first:mt-0`,children:[T(e.type,e.category,e.name),(0,S.jsx)(`span`,{className:`font-medium truncate flex-1 min-w-0`,children:e.name}),(e.metadata?.serverName||e.metadata?.serverId)&&e.category!==`Connected Servers`&&(()=>{let t=o.find(t=>t.id===e.metadata?.serverId);return t?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 pr-2 py-1 rounded-full bg-zinc-200 dark:bg-zinc-800 shrink-0`,children:[(0,S.jsx)(Kq,{server:t,size:`sm`}),(0,S.jsx)(`span`,{className:`text-xs font-base text-muted-foreground`,children:e.metadata?.serverName||e.metadata?.serverId})]}):null})()]},e.id))]}),(0,S.jsxs)(`div`,{className:`border-t border-border px-4 py-3 pb-1 flex items-center justify-between text-xs text-muted-foreground `,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`t`}),(0,S.jsx)(`span`,{children:`Tools`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`p`}),(0,S.jsx)(`span`,{children:`Prompts`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`r`}),(0,S.jsx)(`span`,{children:`Resources`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`c`}),(0,S.jsx)(`span`,{children:`Chat`})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`h`}),(0,S.jsx)(`span`,{children:`Home`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center px-2 h-5 font-mono text-[10px] font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`esc`}),(0,S.jsx)(`span`,{children:`Close`})]})]})]})]})}function FJ({prompts:e,callPrompt:t,serverId:n}){let[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)({}),[s,c]=(0,w.useState)([]),[l,u]=(0,w.useState)(!1),[d,f]=(0,w.useState)(``),p=(0,w.useMemo)(()=>{if(!d.trim())return e;let t=d.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e,d]),m=(0,w.useCallback)(e=>{i(e);let t={};e.arguments&&e.arguments.forEach(e=>{t[e.name]=``}),o(t)},[]),h=(0,w.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),g=(0,w.useCallback)(async(e,r)=>{if(l)return;u(!0);let i=Date.now();try{let a=await t(e.name,r),o=Date.now()-i;of.getInstance().capture(new Bd({promptName:e.name,serverId:n,success:!0})).catch(()=>{}),c(t=>[{promptName:e.name,args:r,result:a,timestamp:i,duration:o},...t])}catch(t){of.getInstance().capture(new Bd({promptName:e.name,serverId:n,success:!1,error:t instanceof Error?t.message:`Unknown error`})).catch(()=>{});let a=t instanceof Error?t.message:String(t),o={promptName:e.name,args:r,result:{error:a,isError:!0},error:a,timestamp:i,duration:Date.now()-i};c(e=>[o,...e])}finally{u(!1)}},[l,t,n]),_=(0,w.useCallback)(e=>{c(t=>t.filter((t,n)=>n!==e))},[]),v=(0,w.useCallback)(()=>{c([])},[]);return(0,w.useEffect)(()=>{if(r){let t=e.find(e=>e.name===r.name);if(!t){i(null);return}t!==r&&(JSON.stringify(t.arguments)!==JSON.stringify(r.arguments)||t.description!==r.description)&&i(t)}},[e,r]),{filteredPrompts:p,selectedPrompt:r,setSelectedPrompt:i,results:s,handleDeleteResult:_,promptArgs:a,setPromptArgs:o,isExecuting:l,handlePromptSelect:m,handleArgChange:h,executePrompt:g,executeSelectedPrompt:(0,w.useCallback)(async()=>{!r||l||g(r,a)},[r,a,l,g]),searchQuery:d,setSearchQuery:f,clearPromptResults:v}}var IJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ,{ref:n,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));IJ.displayName=gJ.displayName;var LJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:(0,S.jsx)(gJ.Input,{ref:n,className:H(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}));LJ.displayName=gJ.Input.displayName;var RJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.List,{ref:n,className:H(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));RJ.displayName=gJ.List.displayName;var zJ=w.forwardRef((e,t)=>(0,S.jsx)(gJ.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));zJ.displayName=gJ.Empty.displayName;var BJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.Group,{ref:n,className:H(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));BJ.displayName=gJ.Group.displayName;var VJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.Item,{ref:n,className:H(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));VJ.displayName=gJ.Item.displayName;var HJ=`Popover`,[UJ,Kwe]=Nt(HJ,[aa]),WJ=aa(),[qwe,GJ]=UJ(HJ),KJ=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=WJ(t),c=w.useRef(null),[l,u]=w.useState(!1),[d,f]=Lt({prop:r,defaultProp:i??!1,onChange:a,caller:HJ});return(0,S.jsx)(xa,{...s,children:(0,S.jsx)(qwe,{scope:t,contentId:Fn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:o,children:n})})};KJ.displayName=HJ;var qJ=`PopoverAnchor`,Jwe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(qJ,n),a=WJ(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return w.useEffect(()=>(o(),()=>s()),[o,s]),(0,S.jsx)(Sa,{...a,...r,ref:t})});Jwe.displayName=qJ;var JJ=`PopoverTrigger`,YJ=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(JJ,n),a=WJ(n),o=D(t,i.triggerRef),s=(0,S.jsx)(Jt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":nY(i.open),...r,ref:o,onClick:jt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,S.jsx)(Sa,{asChild:!0,...a,children:s})});YJ.displayName=JJ;var XJ=`PopoverPortal`,[Ywe,Xwe]=UJ(XJ,{forceMount:void 0}),ZJ=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=GJ(XJ,t);return(0,S.jsx)(Ywe,{scope:t,forceMount:n,children:(0,S.jsx)(Oa,{present:n||a.open,children:(0,S.jsx)(Ea,{asChild:!0,container:i,children:r})})})};ZJ.displayName=XJ;var QJ=`PopoverContent`,$J=w.forwardRef((e,t)=>{let n=Xwe(QJ,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=GJ(QJ,e.__scopePopover);return(0,S.jsx)(Oa,{present:r||a.open,children:a.modal?(0,S.jsx)(Qwe,{...i,ref:t}):(0,S.jsx)($we,{...i,ref:t})})});$J.displayName=QJ;var Zwe=Vt(`PopoverContent.RemoveScroll`),Qwe=w.forwardRef((e,t)=>{let n=GJ(QJ,e.__scopePopover),r=w.useRef(null),i=D(t,r),a=w.useRef(!1);return w.useEffect(()=>{let e=r.current;if(e)return so(e)},[]),(0,S.jsx)(_s,{as:Zwe,allowPinchZoom:!0,children:(0,S.jsx)(eY,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:jt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:jt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),$we=w.forwardRef((e,t)=>{let n=GJ(QJ,e.__scopePopover),r=w.useRef(!1),i=w.useRef(!1);return(0,S.jsx)(eY,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),eY=w.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=GJ(QJ,n),p=WJ(n);return gn(),(0,S.jsx)(Sn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,S.jsx)(cn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,S.jsx)(Ca,{"data-state":nY(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),tY=`PopoverClose`,eTe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(tY,n);return(0,S.jsx)(Jt.button,{type:`button`,...r,ref:t,onClick:jt(e.onClick,()=>i.onOpenChange(!1))})});eTe.displayName=tY;var tTe=`PopoverArrow`,nTe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=WJ(n);return(0,S.jsx)(wa,{...i,...r,ref:t})});nTe.displayName=tTe;function nY(e){return e?`open`:`closed`}var rTe=KJ,iTe=YJ,aTe=ZJ,rY=$J,iY=rTe,aY=iTe,oY=w.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,S.jsx)(aTe,{children:(0,S.jsx)(rY,{ref:i,align:t,sideOffset:n,className:H(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...r})}));oY.displayName=rY.displayName;var sY=`mcp-inspector-models-cache`,oTe=1440*60*1e3,cY=`data:image/svg+xml,%3Csvg%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22%2394A3B8%22%20stroke%3D%22%2394A3B8%22%3E%3Cg%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M3%20248.945C18%20248.945%2076%20236%20106%20219C136%20202%20136%20202%20198%20158C276.497%20102.293%20332%20120.945%20423%20120.945%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M511%20121.5L357.25%20210.268L357.25%2032.7324L511%20121.5Z%22%2F%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%20249C15%20249%2073%20261.945%20103%20278.945C133%20295.945%20133%20295.945%20195%20339.945C273.497%20395.652%20329%20377%20420%20377%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M508%20376.445L354.25%20287.678L354.25%20465.213L508%20376.445Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;function lY(){try{let e=localStorage.getItem(sY);if(e)return JSON.parse(e)}catch(e){console.error(`Failed to load models cache:`,e)}return{}}function sTe(e,t){try{let n=lY();n[e]={models:t,timestamp:Date.now()},localStorage.setItem(sY,JSON.stringify(n))}catch(e){console.error(`Failed to save models cache:`,e)}}function cTe(e){try{let t=lY(),n=t[e];if(n){if(Date.now()-n.timestamp<oTe)return n.models;delete t[e],localStorage.setItem(sY,JSON.stringify(t))}}catch(e){console.error(`Failed to get cached models:`,e)}return null}async function lTe(e,t){let n=e.replace(/\/+$/,``),r={};t&&(r.Authorization=`Bearer ${t}`);let i;try{i=await fetch(`${n}/models`,{headers:r})}catch{throw Error(`Failed to reach the server. Check the URL is correct and that CORS is enabled on the server.`)}if(!i.ok)throw Error(`Failed to fetch models: ${i.statusText}`);if(!(i.headers.get(`content-type`)??``).includes(`application/json`))throw Error(`Invalid URL — response was not JSON`);let a=await i.json();if(!Array.isArray(a?.data))throw Error(`Unexpected response format — expected { data: [...] } from the OpenAI-compatible endpoint`);return a.data.map(e=>({id:e.id}))}async function uTe(e){let t=await fetch(`https://api.openai.com/v1/models`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to fetch OpenAI models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id}))}async function dTe(e){let t=await fetch(`https://api.anthropic.com/v1/models`,{headers:{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`}});if(!t.ok)throw Error(`Failed to fetch Anthropic models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id,displayName:e.display_name}))}async function fTe(e){let t=await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${e}`);if(!t.ok)throw Error(`Failed to fetch Google models: ${t.statusText}`);return((await t.json()).models||[]).map(e=>({id:e.name,displayName:e.displayName}))}async function pTe(e){let t=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to fetch OpenRouter models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id,displayName:e.name}))}function uY({open:e,onOpenChange:t,tempProvider:n,tempModel:r,tempApiKey:i,tempBaseUrl:a=``,onProviderChange:o,onModelChange:s,onApiKeyChange:c,onBaseUrlChange:l,onSave:u,onClear:d,showClearButton:f=!1,buttonLabel:p=`Configure API Key`,freeTierInfo:m}){let[h,g]=(0,w.useState)([]),[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)(null),[x,C]=(0,w.useState)(!1),[T,E]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let t=n===`openai-compatible`?!!a.trim():!!i.trim();if(!e||!t){g([]),b(null);return}let r=setTimeout(async()=>{let e=n===`openai-compatible`?`${n}:${a}`:n,t=cTe(e);if(t){g(t),b(null);return}v(!0),b(null);try{let t=[];n===`openai-compatible`?t=await lTe(a,i):n===`openai`?t=await uTe(i):n===`anthropic`?t=await dTe(i):n===`google`?t=await fTe(i):n===`openrouter`&&(t=await pTe(i)),sTe(e,t),g(t)}catch(e){b(e instanceof Error?e.message:`Failed to fetch models. Please check your API key.`),g([])}finally{v(!1)}},500);return()=>clearTimeout(r)},[i,n,a,e]),(0,w.useEffect)(()=>{e&&s(``)},[n,e,s]);let D=e=>e===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e}.png`;return(0,S.jsx)(TN,{open:e,onOpenChange:t,children:(0,S.jsxs)(DN,{className:`max-w-md`,"data-testid":`chat-config-dialog`,children:[(0,S.jsxs)(ON,{children:[(0,S.jsx)(kN,{children:m?`Model & usage`:`LLM Provider Configuration`}),(0,S.jsx)(AN,{children:m?`You're using Manufact's free tier. Sign in to increase your limits, or bring your own key to pick any model.`:`Configure your LLM provider and API key to start chatting with the MCP server`})]}),(0,S.jsxs)(`div`,{className:`space-y-4`,children:[m&&(0,S.jsx)(`div`,{className:`rounded-md border bg-muted/40 p-3 space-y-2`,children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`text-sm`,children:[(0,S.jsx)(`div`,{className:`font-medium`,children:`Manufact free tier`}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Sign in for increased generous limits.`})]}),(0,S.jsx)(U,{size:`sm`,onClick:m.onLoginClick,children:`Sign in`})]})}),m&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,S.jsx)(`span`,{children:`or use your own API key`}),(0,S.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Provider`}),(0,S.jsxs)(EP,{value:n,onValueChange:e=>o(e),children:[(0,S.jsx)(OP,{className:`flex items-center gap-2`,children:(0,S.jsx)(DP,{})}),(0,S.jsxs)(kP,{children:[(0,S.jsx)(AP,{value:`openai`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`openai`),alt:`OpenAI`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`OpenAI`})]})}),(0,S.jsx)(AP,{value:`anthropic`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`anthropic`),alt:`Anthropic`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`Anthropic`})]})}),(0,S.jsx)(AP,{value:`google`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`google`),alt:`Google`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`Google`})]})}),(0,S.jsx)(AP,{value:`openrouter`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`openrouter`),alt:`OpenRouter`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`OpenRouter`})]})}),(0,S.jsx)(AP,{value:`openai-compatible`,children:(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{children:`OpenAI Compatible`})})})]})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`API Key`}),(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(jN,{type:T?`text`:`password`,value:i,onChange:e=>c(e.target.value),placeholder:n===`openai-compatible`?`Enter your API key (optional)`:`Enter your API key`,className:`pr-10`,"data-testid":`chat-config-api-key-input`}),(0,S.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent`,onClick:()=>E(!T),children:T?(0,S.jsx)(Hf,{className:`h-4 w-4 text-muted-foreground`}):(0,S.jsx)(Uf,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your API key is stored locally and never sent to our servers`})]}),n===`openai-compatible`&&(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Base URL`}),(0,S.jsx)(jN,{value:a,onChange:e=>l?.(e.target.value),placeholder:`http://localhost:11434/v1`,"data-testid":`chat-config-base-url-input`}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Base URL of your OpenAI-compatible API. Local servers must have CORS enabled.`})]}),(n===`openai-compatible`?!!a.trim():!!i.trim())&&(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Model`}),_?(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(rp,{className:`h-4 w-4 animate-spin`}),(0,S.jsx)(`span`,{children:`Loading models...`})]}):y?(0,S.jsx)(`div`,{className:`text-sm text-destructive`,children:y}):h.length>0?(0,S.jsxs)(iY,{open:x,modal:!0,onOpenChange:C,children:[(0,S.jsx)(aY,{asChild:!0,children:(0,S.jsxs)(U,{variant:`outline`,role:`combobox`,"aria-expanded":x,className:`w-full justify-between rounded-md`,"data-testid":`chat-config-model-select`,children:[r&&(h.find(e=>e.id===r)?.displayName||h.find(e=>e.id===r)?.id)||`Select a model...`,(0,S.jsx)(Af,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,S.jsx)(oY,{className:`w-full p-0`,align:`start`,children:(0,S.jsxs)(IJ,{children:[(0,S.jsx)(LJ,{placeholder:`Search models...`,className:`h-9`}),(0,S.jsxs)(RJ,{children:[(0,S.jsx)(zJ,{children:`No model found.`}),(0,S.jsx)(BJ,{children:h.map(e=>(0,S.jsxs)(VJ,{value:e.id,onSelect:e=>{s(e===r?``:e),C(!1)},children:[e.displayName||e.id,(0,S.jsx)(wf,{className:H(`ml-auto h-4 w-4`,r===e.id?`opacity-100`:`opacity-0`)})]},e.id))})]})]})})]}):(0,S.jsx)(jN,{value:r,onChange:e=>s(e.target.value),placeholder:`Enter model name manually`,"data-testid":`chat-config-model-input`})]}),(0,S.jsxs)(`div`,{className:`flex justify-between`,children:[f&&d&&(0,S.jsx)(U,{variant:`outline`,onClick:d,children:`Clear Config`}),(0,S.jsxs)(U,{onClick:u,disabled:n===`openai-compatible`?!a.trim()||!r.trim():!i.trim()||!r.trim(),className:f?`ml-auto`:``,"data-testid":`chat-config-save-button`,children:[(0,S.jsx)(tp,{className:`h-4 w-4 mr-2`}),`Save Configuration`]})]})]})]})})}function mTe({llmConfig:e,hasMessages:t,configDialogOpen:n,onConfigDialogOpenChange:r,onClearChat:i,tempProvider:a,tempModel:o,tempApiKey:s,tempBaseUrl:c,onProviderChange:l,onModelChange:u,onApiKeyChange:d,onBaseUrlChange:f,onSaveConfig:p,onClearConfig:m,hideConfigButton:h,freeTierInfo:g,clearButtonLabel:_,hideTitle:v,clearButtonHideIcon:y,clearButtonHideShortcut:b,clearButtonVariant:x,hideClearButton:C,onCopyChat:w,onExportChat:T}){return(0,S.jsxs)(`div`,{className:`flex flex-row absolute top-0 right-0 z-10 w-full items-center justify-between p-1 pt-2 gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full p-2 px-2 sm:px-4`,children:[!v&&(0,S.jsx)(`h3`,{className:`text-xl sm:text-3xl font-base`,children:`Chat`}),e&&(!h||g)&&(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(kt,{variant:`secondary`,className:`hidden sm:flex ml-2 pl-1 font-mono text-[11px] cursor-pointer hover:bg-secondary/80 transition-colors`,onClick:()=>r(!0),children:[e.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:e.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e.provider}.png`,alt:e.provider,className:`w-4 h-4 mr-0`}),e.provider,`/`,e.model]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:g?`Change model / upgrade`:`Change API Key`})})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 pr-2 sm:pr-3 pt-0 sm:pt-2 shrink-0`,children:[e&&(!h||g)&&(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsx)(U,{variant:`secondary`,size:`sm`,className:`p-2 sm:hidden`,onClick:()=>r(!0),children:e.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:e.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e.provider}.png`,alt:e.provider,className:`w-4 h-4`})})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:`Change API Key`})})]}),!C&&t&&(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[w&&(0,S.jsxs)(U,{"data-testid":`chat-copy-button`,variant:`ghost`,size:`sm`,className:`h-9 gap-1.5 px-3`,onClick:w,children:[(0,S.jsx)(Lf,{className:`h-4 w-4`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:`Copy`})]}),T&&(0,S.jsxs)(Jl,{children:[(0,S.jsx)(Yl,{asChild:!0,children:(0,S.jsxs)(U,{"data-testid":`chat-export-button`,variant:`ghost`,size:`sm`,className:`h-9 gap-1.5 px-3`,children:[(0,S.jsx)(zf,{className:`h-4 w-4`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:`Export`})]})}),(0,S.jsxs)(eu,{align:`end`,children:[(0,S.jsx)(tu,{"data-testid":`chat-export-json`,onClick:()=>T(`json`),children:`Export as JSON`}),(0,S.jsx)(tu,{"data-testid":`chat-export-markdown`,onClick:()=>T(`markdown`),children:`Export as Markdown`})]})]}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border mx-1`}),(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(U,{variant:x??`default`,size:`default`,className:`p-2 cursor-pointer ${b?`sm:px-3`:`sm:pr-1 sm:pl-3`}`,onClick:i,children:[!y&&(0,S.jsx)(Mp,{className:`h-4 w-4 sm:mr-2`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:_??`New Chat`}),!b&&(0,S.jsx)(`span`,{className:`hidden sm:inline text-[12px] border text-zinc-300 p-1 rounded-full border-zinc-300 dark:text-zinc-600 dark:border-zinc-500 ml-2`,children:`⌘O`})]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:_??`New Chat`})})]})]}),(!h||g)&&(0,S.jsx)(uY,{open:n,onOpenChange:r,tempProvider:a,tempModel:o,tempApiKey:s,tempBaseUrl:c,onProviderChange:l,onModelChange:u,onApiKeyChange:d,onBaseUrlChange:f,onSave:p,onClear:m,showClearButton:!!e&&!g,buttonLabel:e?`Change API Key`:`Configure API Key`,freeTierInfo:g})]})]})}function dY({className:e,...t}){return(0,S.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}var fY=`Checkbox`,[hTe,gTe]=Nt(fY),[_Te,pY]=hTe(fY);function vTe(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Lt({prop:n,defaultProp:i??!1,onChange:c,caller:fY}),[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:xY(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,S.jsx)(_Te,{scope:t,...b,children:yTe(d)?d(b):r})}var mY=`CheckboxTrigger`,hY=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=pY(mY,e),h=D(i,u),g=w.useRef(c);return w.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,S.jsx)(Jt.button,{type:`button`,role:`checkbox`,"aria-checked":xY(c)?`mixed`:c,"aria-required":l,"data-state":SY(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:jt(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:jt(n,e=>{d(e=>xY(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});hY.displayName=mY;var gY=w.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,S.jsx)(vTe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hY,{...d,ref:t,__scopeCheckbox:n}),e&&(0,S.jsx)(bY,{__scopeCheckbox:n})]})})});gY.displayName=fY;var _Y=`CheckboxIndicator`,vY=w.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=pY(_Y,n);return(0,S.jsx)(Oa,{present:r||xY(a.checked)||a.checked===!0,children:(0,S.jsx)(Jt.span,{"data-state":SY(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});vY.displayName=_Y;var yY=`CheckboxBubbleInput`,bY=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=pY(yY,e),m=D(n,p),h=IN(a),g=na(r);w.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=xY(a),n.call(e,xY(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=w.useRef(xY(a)?!1:a);return(0,S.jsx)(Jt.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});bY.displayName=yY;function yTe(e){return typeof e==`function`}function xY(e){return e===`indeterminate`}function SY(e){return xY(e)?`indeterminate`:e?`checked`:`unchecked`}var CY=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gY,{ref:n,className:H(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,S.jsx)(vY,{className:H(`flex items-center justify-center text-current`),children:(0,S.jsx)(wf,{className:`h-4 w-4`})})}));CY.displayName=gY.displayName;function bTe({tools:e,disabledTools:t,onDisabledToolsChange:n,disabled:r}){let[i,a]=(0,w.useState)(!1),o=e.length-t.size,s=t.size===0,c=t.size>0&&t.size<e.length,l=(0,w.useCallback)(e=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e),n(r)},[t,n]),u=(0,w.useCallback)(()=>{n(s?new Set(e.map(e=>e.name)):new Set)},[s,e,n]),d=(0,w.useMemo)(()=>[...e].sort((e,t)=>e.name.localeCompare(t.name)),[e]);return e.length===0?null:(0,S.jsxs)(iY,{open:i,onOpenChange:a,children:[(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsx)(aY,{asChild:!0,children:(0,S.jsxs)(U,{variant:`ghost`,size:`sm`,disabled:r,className:H(`h-auto w-auto aspect-square rounded-full p-2 relative`,c?`text-amber-500 dark:text-amber-400`:`text-muted-foreground hover:text-foreground`),type:`button`,"data-testid":`chat-tool-selector`,children:[(0,S.jsx)(Bp,{className:`h-4 w-4`}),c&&(0,S.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-amber-500 text-[9px] font-bold text-white leading-none`,children:o})]})})}),(0,S.jsx)(Id,{side:`top`,children:(0,S.jsxs)(`p`,{children:[`Tools (`,o,`/`,e.length,`)`]})})]}),(0,S.jsxs)(oY,{className:`w-72 p-0`,align:`start`,side:`top`,sideOffset:8,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b`,children:[(0,S.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:[`Allowed Tools (`,o,`/`,e.length,`)`]}),(0,S.jsx)(U,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:u,type:`button`,children:s?`Disable All`:`Enable All`})]}),(0,S.jsx)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:d.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2.5 w-full px-3 py-1.5 text-left hover:bg-accent/50 transition-colors cursor-pointer`,onClick:()=>l(e.name),children:[(0,S.jsx)(CY,{checked:!t.has(e.name),className:`pointer-events-none`,tabIndex:-1}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`text-sm font-mono truncate`,children:e.name}),e.description&&(0,S.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate`,children:e.description})]})]},e.name))})]})]})}function wY(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t).toString(16)}var xTe=10*1024*1024,STe=20*1024*1024,CTe=[`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`];function wTe(e){return CTe.includes(e.type)}function TTe(e){return e.size<=xTe}function TY(e){return e.reduce((e,t)=>e+(t.size||0),0)<=STe}function ETe(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;t(e.includes(`,`)?e.split(`,`)[1]:e)},r.onerror=()=>{n(Error(`Failed to read file: ${e.name}`))},r.readAsDataURL(e)})}async function EY(e){if(!wTe(e))throw Error(`Unsupported file type: ${e.type}. Only images are supported.`);if(!TTe(e))throw Error(`File too large: ${e.name}. Maximum size is 10MB.`);return{type:`image`,data:await ETe(e),mimeType:e.type,name:e.name,size:e.size}}function DTe(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**+r).toFixed(1))} ${n[r]}`}function DY({inputValue:e,isConnected:t,isLoading:n,textareaRef:r,attachments:i,placeholder:a=`Ask a question`,className:o,showAttachButton:s=!0,tools:c,disabledTools:l,onDisabledToolsChange:u,onInputChange:d,onKeyDown:f,onKeyUp:p,onClick:m,onAttachmentAdd:h,onAttachmentRemove:g}){let _=(0,w.useRef)(null),v=e=>{let t=e.target.files;if(t&&t.length>0)for(let e=0;e<t.length;e++)h(t[e]);_.current&&(_.current.value=``)},y=i.length>0;return(0,S.jsxs)(`div`,{className:`relative w-full`,children:[y&&(0,S.jsx)(`div`,{className:`absolute top-0 left-0 right-0 z-20 p-3 flex gap-2 flex-wrap`,children:i.map((e,t)=>(0,S.jsxs)(`div`,{className:`relative group bg-zinc-100/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg p-2 flex items-center gap-2 border border-zinc-200 dark:border-zinc-700`,"data-testid":`chat-attachment-${t}`,children:[(0,S.jsx)($f,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,S.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,S.jsx)(`span`,{className:`text-xs font-medium truncate max-w-[150px]`,children:e.name||`Image`}),e.size&&(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:DTe(e.size)})]}),(0,S.jsx)(`button`,{onClick:()=>g(t),className:`shrink-0 p-1 rounded-full hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors`,title:`Remove attachment`,type:`button`,"data-testid":`chat-attachment-remove-${t}`,children:(0,S.jsx)(Vp,{className:`h-3 w-3`})})]},t))}),(0,S.jsx)(dY,{ref:r,value:e,onChange:e=>d(e.target.value),onKeyDown:f,onKeyUp:p,onClick:m,placeholder:t?a:`Server not connected`,className:H(`p-4 min-h-[150px] max-h-[300px] rounded-xl`,y&&`pt-20`,o),disabled:!t||n,"data-testid":`chat-input`}),(0,S.jsx)(`input`,{ref:_,type:`file`,accept:`image/*`,multiple:!0,onChange:v,className:`hidden`,"aria-label":`Upload images`}),(0,S.jsxs)(`div`,{className:`absolute left-0 p-3 bottom-0 flex items-center gap-0.5`,children:[s&&(0,S.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>_.current?.click(),disabled:!t||n,className:`h-auto w-auto aspect-square rounded-full p-2 text-muted-foreground hover:text-foreground`,title:`Attach images`,type:`button`,"data-testid":`chat-attach-button`,children:(0,S.jsx)(fp,{className:`h-4 w-4`})}),c&&c.length>0&&l&&u&&(0,S.jsx)(bTe,{tools:c,disabledTools:l,onDisabledToolsChange:u,disabled:!t||n})]})]})}function OY({promptResults:e,onDeletePromptResult:t}){return(0,S.jsx)(`div`,{className:`absolute top-4 left-4 right-4 flex gap-2 overflow-x-auto z-20 flex-nowrap`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`},children:e.map(({promptName:e},n)=>(0,S.jsxs)(U,{type:`button`,className:`flex items-center gap-2 bg-zinc-200 text-zinc-700 dark:text-zinc-300 text-[10px] px-1.5 py-0.5 dark:bg-zinc-700 rounded-lg border border-zinc-200 dark:border-zinc-300 font-medium hover:bg-zinc-300 dark:hover:bg-zinc-600`,children:[(0,S.jsx)(sp,{className:`h-3.5 w-3.5 shrink-0`}),(0,S.jsx)(`span`,{className:`truncate`,title:e,children:e}),(0,S.jsx)(`span`,{className:`ml-1 h-4 w-4 rounded-full bg-zinc-400 dark:bg-zinc-600 hover:bg-zinc-500 dark:hover:bg-zinc-500 flex items-center justify-center cursor-pointer shrink-0 transition-colors`,onClick:e=>{e.stopPropagation(),t(n)},title:`Remove prompt`,role:`button`,tabIndex:0,children:(0,S.jsx)(Vp,{className:`h-2.5 w-2.5 text-white`})})]},n))})}function kY({isOpen:e,focusedIndex:t,prompts:n,selectedPrompt:r,onPromptSelect:i}){return e?((0,w.useEffect)(()=>{if(t>=0){let e=document.getElementById(`prompt-${t}`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`})}},[t]),(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 max-w-3xl w-full max-h-[300px] overflow-y-auto rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 shadow-lg z-30 flex flex-col gap-2 mb-1`,"data-testid":`chat-prompts-dropdown`,children:(0,S.jsxs)(`div`,{className:`p-2`,children:[(0,S.jsx)(`div`,{className:`text-xs font-medium text-zinc-900 dark:text-zinc-100 mb-2`,children:`Prompts`}),n.map((e,n)=>(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(U,{id:`prompt-${n}`,type:`button`,variant:`ghost`,className:H(`w-full flex items-center px-3 py-2 rounded-md hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors text-left justify-start`,t===n&&`bg-zinc-200 dark:bg-zinc-700`),onClick:()=>i(e),"data-testid":`chat-prompt-option-${n}`,children:[(0,S.jsx)(`div`,{className:`flex items-center justify-center shrink-0`,children:(0,S.jsx)(sp,{className:`h-4 w-4 text-zinc-600 dark:text-zinc-400`})}),(0,S.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,S.jsxs)(`div`,{className:`text-sm font-medium text-zinc-900 dark:text-zinc-100 flex items-center gap-2`,children:[e.name,r?.name===e.name&&(0,S.jsx)(Gq,{className:`size-3 text-zinc-600 dark:text-zinc-400`})]})})]})}),(0,S.jsx)(Id,{children:e.description})]},n))]})})):null}function OTe({inputValue:e,isConnected:t,isLoading:n,textareaRef:r,promptsDropdownOpen:i,promptFocusedIndex:a,prompts:o,selectedPrompt:s,promptResults:c,attachments:l,tools:u,disabledTools:d,onDisabledToolsChange:f,onInputChange:p,onKeyDown:m,onKeyUp:h,onClick:g,onSendMessage:_,onStopStreaming:v,onPromptSelect:y,onDeletePromptResult:b,onAttachmentAdd:x,onAttachmentRemove:C,followups:w=[],onFollowupSelect:T}){let E=e.trim()||c.length>0||l.length>0;return(0,S.jsx)(`div`,{className:`w-full flex flex-col justify-center items-center p-2 sm:p-4 sm:pt-0 text-foreground`,children:(0,S.jsxs)(`div`,{className:`relative w-full max-w-3xl backdrop-blur-xl`,children:[w.length>0&&(0,S.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:w.map(e=>(0,S.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,onClick:()=>T?.(e),disabled:n||!t,children:e},e))}),(0,S.jsx)(kY,{isOpen:i,prompts:o,selectedPrompt:s,focusedIndex:a,onPromptSelect:y}),(0,S.jsx)(OY,{promptResults:c,onDeletePromptResult:b}),(0,S.jsx)(DY,{inputValue:e,isConnected:t,isLoading:n,textareaRef:r,attachments:l,placeholder:`Ask a question`,className:H(`bg-zinc-50 z-10 focus:bg-zinc-100 dark:text-white dark:bg-black border-gray-200 dark:border-zinc-800`,c.length>0&&`pt-16`),tools:u,disabledTools:d,onDisabledToolsChange:f,onInputChange:p,onKeyDown:m,onKeyUp:h,onClick:g,onAttachmentAdd:x,onAttachmentRemove:C}),(0,S.jsx)(`div`,{className:`absolute right-0 p-3 bottom-0 flex items-center gap-2`,children:n?(0,S.jsx)(U,{className:`min-w-none h-auto w-auto aspect-square rounded-full items-center justify-center flex`,title:`Stop streaming`,type:`button`,onClick:v,children:(0,S.jsx)(Np,{className:`h-4 w-4`})}):(0,S.jsx)(U,{disabled:!E||!t||n,className:`min-w-none h-auto w-auto aspect-square rounded-full items-center justify-center flex`,title:`Send`,type:`button`,onClick:_,"data-testid":`chat-send-button`,children:(0,S.jsx)(Sp,{className:`h-4 w-4`})})})]})})}function kTe({className:e,children:t,showRadialGradient:n=!0,...r}){return(0,S.jsxs)(`div`,{className:H(`transition-bg relative flex size-full flex-col items-center justify-center bg-zinc-50 text-slate-950 dark:bg-zinc-900`,e),...r,children:[(0,S.jsx)(`div`,{className:`absolute inset-0 overflow-hidden dark:opacity-50 dark:contrast-200`,style:{"--aurora":`repeating-linear-gradient(100deg,#3b82f6_10%,#a5b4fc_15%,#93c5fd_20%,#ddd6fe_25%,#60a5fa_30%)`,"--dark-gradient":`repeating-linear-gradient(100deg,#000_0%,#000_7%,transparent_10%,transparent_12%,#000_16%)`,"--white-gradient":`repeating-linear-gradient(100deg,#fff_0%,#fff_7%,transparent_10%,transparent_12%,#fff_16%)`,"--blue-300":`#93c5fd`,"--blue-400":`#60a5fa`,"--blue-500":`#3b82f6`,"--indigo-300":`#a5b4fc`,"--violet-200":`#ddd6fe`,"--black":`#000`,"--white":`#fff`,"--transparent":`transparent`},children:(0,S.jsx)(`div`,{className:H(`after:animate-aurora pointer-events-none absolute -inset-[10px] [background-image:var(--white-gradient),var(--aurora)] [background-size:300%,_200%] [background-position:50%_50%,50%_50%] opacity-50 blur-[10px] invert filter will-change-transform [--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] [--dark-gradient:repeating-linear-gradient(100deg,var(--black)_0%,var(--black)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--black)_16%)] [--white-gradient:repeating-linear-gradient(100deg,var(--white)_0%,var(--white)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--white)_16%)] after:absolute after:inset-0 after:[background-image:var(--white-gradient),var(--aurora)] after:[background-size:200%,_100%] after:[background-attachment:fixed] after:mix-blend-difference after:content-[""] dark:[background-image:var(--dark-gradient),var(--aurora)] dark:invert-0 after:dark:[background-image:var(--dark-gradient),var(--aurora)]`,n&&`[mask-image:radial-gradient(ellipse_at_100%_0%,black_10%,var(--transparent)_70%)]`)})}),t]})}function ATe({mcpServerUrl:e,inputValue:t,isConnected:n,isLoading:r,textareaRef:i,llmConfig:a,promptsDropdownOpen:o,promptFocusedIndex:s,prompts:c,selectedPrompt:l,promptResults:u,attachments:d,tools:f,disabledTools:p,onDisabledToolsChange:m,onInputChange:h,onKeyDown:g,onKeyUp:_,onClick:v,onSubmit:y,onConfigDialogOpenChange:b,onPromptSelect:x,onDeletePromptResult:C,onAttachmentAdd:w,onAttachmentRemove:T,hideModelBadge:E,hideServerUrl:D,quickQuestions:O=[],onQuickQuestionSelect:k,freeTierInfo:A}){let j=t.trim()||u.length>0||d.length>0;return(0,S.jsx)(kTe,{children:(0,S.jsxs)(Wq,{className:`w-full max-w-4xl mx-auto px-2 sm:px-4`,children:[(0,S.jsxs)(`div`,{className:`text-center mb-6 sm:mb-8`,children:[(0,S.jsx)(`h1`,{className:`text-2xl sm:text-4xl font-light mb-2 dark:text-white`,"data-testid":`chat-landing-header`,children:`Chat with MCP Server`}),!D&&(0,S.jsx)(`p`,{className:`text-xs sm:text-sm text-zinc-600 dark:text-zinc-400 font-light break-all px-2`,children:e})]}),(0,S.jsxs)(`form`,{onSubmit:y,className:`space-y-6`,children:[(0,S.jsx)(`div`,{className:`flex justify-center`,children:(0,S.jsxs)(`div`,{className:`relative w-full max-w-2xl`,children:[(0,S.jsx)(kY,{prompts:c,isOpen:o,selectedPrompt:l,focusedIndex:s,onPromptSelect:x}),(0,S.jsx)(OY,{promptResults:u,onDeletePromptResult:C}),(0,S.jsx)(DY,{inputValue:t,isConnected:n,isLoading:r,textareaRef:i,attachments:d,placeholder:`Ask a question or request an action...`,className:H(`bg-white/80 dark:text-white dark:bg-black backdrop-blur-sm border-gray-200 dark:border-zinc-800`,u.length>0&&`pt-16`),tools:f,disabledTools:p,onDisabledToolsChange:m,onInputChange:h,onKeyDown:g,onKeyUp:_,onClick:v,onAttachmentAdd:w,onAttachmentRemove:T}),(0,S.jsx)(`div`,{className:`absolute right-0 p-3 bottom-0`,children:(0,S.jsx)(U,{type:`submit`,size:`sm`,className:H(`h-10 w-10 rounded-full`,r&&`animate-spin`,!j&&`bg-zinc-400`),disabled:r||!j||!n,"data-testid":`chat-send-button`,children:r?(0,S.jsx)(rp,{className:`h-4 w-4 animate-spin`}):(0,S.jsx)(vf,{className:`h-4 w-4`})})})]})}),O.length>0&&(0,S.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2 px-2`,children:O.map(e=>(0,S.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full bg-white/70 dark:bg-black/50 text-gray-900 dark:text-white`,onClick:()=>k?.(e),disabled:r||!n,children:e},e))}),a&&(!E||A)&&(0,S.jsx)(`div`,{className:`flex justify-center mt-4`,children:(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(kt,{variant:`secondary`,className:`pl-1 font-mono text-[11px] cursor-pointer hover:bg-secondary/80 transition-colors`,onClick:()=>b(!0),children:[a.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:a.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${a.provider}.png`,alt:a.provider,className:`w-4 h-4 mr-0 rounded-full`}),a.provider,`/`,a.model]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:A?`Change model / upgrade`:`Change API Key`})})]})})]})]})})}function jTe({onConfigureClick:e}){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center`,children:[(0,S.jsx)(tp,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,S.jsx)(`h3`,{className:`text-lg font-semibold mb-2`,children:`Configure Your LLM Provider`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4 max-w-md`,children:`To start chatting with the MCP server, you need to configure your LLM provider and API key. Your credentials are stored locally and used only for this chat.`}),(0,S.jsxs)(U,{onClick:e,"data-testid":`chat-configure-api-key-button`,children:[(0,S.jsx)(wp,{className:`h-4 w-4 mr-2`}),`Configure API Key`]})]})}function AY({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2}){let a=Uq.create(t),o=(0,w.useMemo)(()=>e.length*i,[e,i]);return(0,S.jsx)(a,{className:H(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text`,`text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,`dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]`,n),initial:{backgroundPosition:`100% center`},animate:{backgroundPosition:`0% center`},transition:{repeat:1/0,duration:r,ease:`linear`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--base-color), var(--base-color))`},children:e})}var jY;function MTe(e){if(!jY)if(typeof document<`u`)jY=document.createElement(`textarea`);else return;var t=`&`+e+`;`;jY.innerHTML=t;var n=jY.value;return n===t?void 0:n}var MY=32,NY=9,PY=13,FY=10,IY=96,LY=126,RY=91,zY=94,BY=62,VY=35,NTe=36,HY=37,UY=45,WY=61,GY=92,KY=42,qY=95,JY=60,YY=64,XY=93,ZY=33,QY=38,$Y=58,eX=70,tX=102,nX=104,rX=119,iX=116,aX=112,PTe=115,FTe=160,ITe=12,oX=44,sX=59,cX=63,lX=46,uX=47,dX=39,fX=34,pX=43,mX=124,hX=123,gX=125,_X=40,vX=41,yX=30,bX=31,xX=48,SX=57,CX=65,wX=90,TX=97,EX=122,DX=128,OX=32,Z={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22};function LTe(e){if(!LX(e,`---`))return null;let t=3;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t<e.length&&e[t]===`\r`&&t++,t>=e.length||e[t]!==`
531
+ # resource_content = await session.read_resource("resource_uri")`}function Vwe({className:e,size:t=`md`}){return(0,S.jsxs)(`svg`,{viewBox:`0 0 303 303`,className:H(`text-current`,{sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`}[t],e),fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`m105.5 34.8.6.6c9.5 9.5 14.4 21.9 14.6 34.4a112.6 112.6 0 0 0 112.2 112.1h.6c12 .4 24 5.1 33.2 14.1l.6.6a50 50 0 0 1-70.1 71.3l-.6-.6A49.9 49.9 0 0 1 182 230 112.6 112.6 0 0 0 73.4 120.7h-.8a49.9 49.9 0 0 1-36.7-14l-.5-.6a50 50 0 0 1-.6-70.2l.6-.5a50 50 0 0 1 69.5-1.2l.6.6Z`}),(0,S.jsx)(`circle`,{cx:`70.3`,cy:`232.3`,r:`50`}),(0,S.jsx)(`circle`,{cx:`232.3`,cy:`70.3`,r:`50`})]})}function PJ({className:e}){return(0,S.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,S.jsx)(`path`,{d:`M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})})}function Hwe({className:e}){return(0,S.jsxs)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`ModelContextProtocol`,children:[(0,S.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),(0,S.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`})]})}function Uwe({className:e}){return(0,S.jsx)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`OpenAI`,children:(0,S.jsx)(`path`,{d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`})})}function Wwe({className:e}){return(0,S.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,S.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}function Gwe({isOpen:e,onOpenChange:t,tools:n,prompts:r,resources:i,savedRequests:a,connections:o,selectedServer:s,tunnelUrl:c,onNavigate:l,onServerSelect:u}){let[d,f]=(0,w.useState)(``),p=(0,w.useRef)(null),m=aM(),h=s?c?`${c}/mcp`:s.url:null,g=s?.name||`MCP Server`,_=s?.customHeaders,v=s?[{id:`open-in-cursor`,name:`Open in Cursor`,description:`Add this server to Cursor`,type:`global`,category:`Open in Client`,action:()=>{try{let e=EJ(h,g,_);window.location.href=e,BM.success(`Opening in Cursor...`),t(!1)}catch{BM.error(`Failed to open in Cursor`)}}},{id:`open-in-claude-code`,name:`Open in Claude Code`,description:`Add this server to Claude Code CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=AJ(h,g,_);yj(e),BM.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-claude-desktop`,name:`Open in Claude Desktop`,description:`Download .mcpb configuration file`,type:`global`,category:`Open in Client`,action:()=>{try{kJ(h,g,_),BM.success(`Downloaded .mcpb file`),t(!1)}catch{BM.error(`Failed to download configuration file`)}}},{id:`open-in-vscode`,name:`Open in VS Code`,description:`Add this server to VS Code`,type:`global`,category:`Open in Client`,action:()=>{try{let e=DJ(h,g,_);window.location.href=e,BM.success(`Opening in VS Code...`),t(!1)}catch{BM.error(`Failed to open in VS Code`)}}},{id:`open-in-vscode-insiders`,name:`Open in VS Code Insiders`,description:`Add this server to VS Code Insiders`,type:`global`,category:`Open in Client`,action:()=>{try{let e=OJ(h,g,_);window.location.href=e,BM.success(`Opening in VS Code Insiders...`),t(!1)}catch{BM.error(`Failed to open in VS Code Insiders`)}}},{id:`open-in-gemini`,name:`Open in Gemini CLI`,description:`Add this server to Gemini CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=jJ(h,g,_);yj(e),BM.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-codex`,name:`Open in Codex CLI`,description:`Add this server to Codex CLI`,type:`global`,category:`Open in Client`,action:()=>{let{config:e}=MJ(h,g,_);yj(e),BM.success(`Config copied to clipboard`),t(!1)}}]:[],y=[{id:`connect-server`,name:`Connect Server`,description:`Add a new MCP server connection`,type:`global`,category:`Navigation`,action:()=>m(`/`)},{id:`mcp-use-website`,name:`MCP Use Website`,description:`Visit mcp-use.com for tools and resources`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com`,`_blank`)},{id:`mcp-use-docs`,name:`How to Create an MCP Server`,description:`Step-by-step guide to building MCP servers`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com/docs`,`_blank`)},{id:`mcp-docs`,name:`MCP Official Documentation`,description:`Learn about the Model Context Protocol`,type:`global`,category:`Documentation`,action:()=>window.open(`https://modelcontextprotocol.io/docs/getting-started/intro`,`_blank`)},{id:`discord`,name:`Join Discord Community`,description:`Connect with the MCP community`,type:`global`,category:`Community`,action:()=>window.open(`https://discord.gg/XkNkSkMz3V`,`_blank`)},{id:`clear-localstorage`,name:`Clear localStorage & Reload`,description:`Having trouble connecting? Clear stored auth data and refresh`,type:`global`,category:`Troubleshooting`,action:()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`mcp:auth`)||n.startsWith(`mcp-inspector`))&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),BM.success(`Cleared ${e.length} localStorage item(s). Refreshing page...`,{duration:2e3}),setTimeout(()=>{window.location.reload()},500),t(!1)}}],b=o.map(e=>({id:`server-${e.id}`,name:Tj(e),description:`Connected server (${e.state})`,type:`global`,category:`Connected Servers`,metadata:{serverId:e.id,state:e.state},action:()=>u(e.id)})),x=[...y,...v,...b,...n.map(e=>({id:`tool-${e.name}`,name:e.name,description:e.description,type:`tool`,category:e._serverName?`Tools - ${e._serverName}`:`Tools`,metadata:{inputSchema:e.inputSchema,serverId:e._serverId,serverName:e._serverName}})),...r.map(e=>({id:`prompt-${e.name}`,name:e.name,description:e.description,type:`prompt`,category:e._serverName?`Prompts - ${e._serverName}`:`Prompts`,metadata:{arguments:e.arguments,serverId:e._serverId,serverName:e._serverName}})),...i.map(e=>({id:`resource-${e.uri}`,name:e.name,description:e.description,type:`resource`,category:e._serverName?`Resources - ${e._serverName}`:`Resources`,metadata:{uri:e.uri,mimeType:e.mimeType,serverId:e._serverId,serverName:e._serverName}})),...a.map(e=>({id:`saved-${e.id}`,name:e.name,description:`Saved request for ${e.toolName}`,type:`saved-request`,category:`Saved Requests`,metadata:{toolName:e.toolName,args:e.args,savedAt:e.savedAt,serverId:e.serverId,serverName:e.serverName}}))],C=(0,w.useCallback)(e=>{if(console.warn(`[CommandPalette] Item selected:`,{itemType:e.type,itemName:e.name,itemId:e.id,metadata:e.metadata}),e.action)console.warn(`[CommandPalette] Executing action for global item`),e.action(),t(!1);else if(e.type===`global`)e.metadata?.serverId&&(console.warn(`[CommandPalette] Selecting server:`,e.metadata.serverId),u(e.metadata.serverId),t(!1));else{let n=e.type===`resource`?e.metadata?.uri:e.name,r=e.type===`tool`?`tools`:e.type===`prompt`?`prompts`:e.type===`saved-request`?`tools`:`resources`;console.warn(`[CommandPalette] Navigating to item:`,{tab:r,itemIdentifier:n,serverId:e.metadata?.serverId}),l(r,n,e.metadata?.serverId),t(!1)}},[l,t,u]),T=(e,t,n)=>{switch(e){case`tool`:return(0,S.jsx)(`div`,{className:`bg-blue-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Bp,{className:`h-4 w-4 text-blue-500`})});case`prompt`:return(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(sp,{className:`h-4 w-4 text-purple-500`})});case`resource`:return(0,S.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Kf,{className:`h-4 w-4 text-green-500`})});case`saved-request`:return(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Qf,{className:`h-4 w-4 text-orange-500`})});case`global`:if(t===`Navigation`)return(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(hp,{className:`h-4 w-4 text-gray-600 dark:text-gray-300`})});if(t===`Open in Client`){if(n?.includes(`Cursor`))return(0,S.jsx)(`div`,{className:`bg-gray-200 dark:bg-gray-800 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`})});if(n?.includes(`Claude Code`)||n?.includes(`Claude Desktop`))return(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`})});if(n?.includes(`VS Code`))return(0,S.jsx)(`div`,{className:`bg-blue-600/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(PJ,{className:`h-4 w-4 text-blue-600`})});if(n?.includes(`Gemini`))return(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`})});if(n?.includes(`Codex`))return(0,S.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`})})}return t===`Documentation`?n?.includes(`MCP Use`)||n?.includes(`mcp-use`)?(0,S.jsx)(`div`,{className:`bg-black/10 dark:bg-white/10 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vwe,{className:`h-4 w-4 text-black dark:text-white`,size:`sm`})}):(0,S.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vf,{className:`h-4 w-4 text-orange-500`})}):t===`Community`?(0,S.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Wwe,{className:`h-4 w-4 text-purple-500`})}):t===`Troubleshooting`?(0,S.jsx)(`div`,{className:`bg-yellow-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(xf,{className:`h-4 w-4 text-yellow-500`})}):t===`Connected Servers`?(0,S.jsx)(`div`,{className:`bg-cyan-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Cp,{className:`h-4 w-4 text-cyan-500`})}):(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(Vf,{className:`h-4 w-4 text-gray-500`})});default:return(0,S.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,S.jsx)(xp,{className:`h-4 w-4 text-gray-500`})})}};return(0,w.useEffect)(()=>{e&&f(``)},[e,f]),(0,w.useEffect)(()=>{p.current&&(p.current.scrollTop=0)},[d]),(0,S.jsxs)(gJ.Dialog,{open:e,onOpenChange:t,label:`Command Palette`,className:`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[51] max-w-[640px] w-[calc(100vw-2rem)] sm:w-full p-2 bg-white dark:bg-zinc-900/90 backdrop-blur-xl rounded-xl overflow-hidden border border-border shadow-[var(--cmdk-shadow)] transition-transform duration-100 ease-out outline-none`,overlayClassName:`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm`,"data-testid":`command-palette-dialog`,children:[(0,S.jsx)(gJ.Input,{placeholder:`What do you need?`,value:d,onValueChange:f,className:`border-none w-full text-[17px] px-4 pt-2 pb-4 outline-none bg-transparent text-foreground border-b border-border mb-0 rounded-none placeholder:text-muted-foreground`,"data-testid":`command-palette-input`}),(0,S.jsxs)(gJ.List,{ref:p,className:`min-h-[200px] sm:min-h-[330px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100 ease-out`,"data-testid":`command-palette-list`,children:[(0,S.jsx)(gJ.Empty,{className:`text-sm flex items-center justify-center h-12 whitespace-pre-wrap text-muted-foreground`,children:`No results found.`}),x.map(e=>(0,S.jsxs)(gJ.Item,{"data-testid":`command-palette-item-${e.id}`,value:`${e.name} ${e.description||``} ${e.category}`,onSelect:()=>C(e),className:`[content-visibility:auto] cursor-pointer h-12 rounded-lg text-sm flex items-center gap-3 px-4 text-foreground select-none will-change-[background,color] transition-all duration-150 data-[selected=true]:bg-accent data-[selected=true]:text-foreground data-[disabled=true]:text-muted-foreground/50 data-[disabled=true]:cursor-not-allowed active:bg-accent/80 mt-1 first:mt-0`,children:[T(e.type,e.category,e.name),(0,S.jsx)(`span`,{className:`font-medium truncate flex-1 min-w-0`,children:e.name}),(e.metadata?.serverName||e.metadata?.serverId)&&e.category!==`Connected Servers`&&(()=>{let t=o.find(t=>t.id===e.metadata?.serverId);return t?(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 pr-2 py-1 rounded-full bg-zinc-200 dark:bg-zinc-800 shrink-0`,children:[(0,S.jsx)(Kq,{server:t,size:`sm`}),(0,S.jsx)(`span`,{className:`text-xs font-base text-muted-foreground`,children:e.metadata?.serverName||e.metadata?.serverId})]}):null})()]},e.id))]}),(0,S.jsxs)(`div`,{className:`border-t border-border px-4 py-3 pb-1 flex items-center justify-between text-xs text-muted-foreground `,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`t`}),(0,S.jsx)(`span`,{children:`Tools`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`p`}),(0,S.jsx)(`span`,{children:`Prompts`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`r`}),(0,S.jsx)(`span`,{children:`Resources`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`c`}),(0,S.jsx)(`span`,{children:`Chat`})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`h`}),(0,S.jsx)(`span`,{children:`Home`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`inline-flex items-center justify-center px-2 h-5 font-mono text-[10px] font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`esc`}),(0,S.jsx)(`span`,{children:`Close`})]})]})]})]})}function FJ({prompts:e,callPrompt:t,serverId:n}){let[r,i]=(0,w.useState)(null),[a,o]=(0,w.useState)({}),[s,c]=(0,w.useState)([]),[l,u]=(0,w.useState)(!1),[d,f]=(0,w.useState)(``),p=(0,w.useMemo)(()=>{if(!d.trim())return e;let t=d.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e,d]),m=(0,w.useCallback)(e=>{i(e);let t={};e.arguments&&e.arguments.forEach(e=>{t[e.name]=``}),o(t)},[]),h=(0,w.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),g=(0,w.useCallback)(async(e,r)=>{if(l)return;u(!0);let i=Date.now();try{let a=await t(e.name,r),o=Date.now()-i;of.getInstance().capture(new Bd({promptName:e.name,serverId:n,success:!0})).catch(()=>{}),c(t=>[{promptName:e.name,args:r,result:a,timestamp:i,duration:o},...t])}catch(t){of.getInstance().capture(new Bd({promptName:e.name,serverId:n,success:!1,error:t instanceof Error?t.message:`Unknown error`})).catch(()=>{});let a=t instanceof Error?t.message:String(t),o={promptName:e.name,args:r,result:{error:a,isError:!0},error:a,timestamp:i,duration:Date.now()-i};c(e=>[o,...e])}finally{u(!1)}},[l,t,n]),_=(0,w.useCallback)(e=>{c(t=>t.filter((t,n)=>n!==e))},[]),v=(0,w.useCallback)(()=>{c([])},[]);return(0,w.useEffect)(()=>{if(r){let t=e.find(e=>e.name===r.name);if(!t){i(null);return}t!==r&&(JSON.stringify(t.arguments)!==JSON.stringify(r.arguments)||t.description!==r.description)&&i(t)}},[e,r]),{filteredPrompts:p,selectedPrompt:r,setSelectedPrompt:i,results:s,handleDeleteResult:_,promptArgs:a,setPromptArgs:o,isExecuting:l,handlePromptSelect:m,handleArgChange:h,executePrompt:g,executeSelectedPrompt:(0,w.useCallback)(async()=>{!r||l||g(r,a)},[r,a,l,g]),searchQuery:d,setSearchQuery:f,clearPromptResults:v}}var IJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ,{ref:n,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));IJ.displayName=gJ.displayName;var LJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:(0,S.jsx)(gJ.Input,{ref:n,className:H(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}));LJ.displayName=gJ.Input.displayName;var RJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.List,{ref:n,className:H(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));RJ.displayName=gJ.List.displayName;var zJ=w.forwardRef((e,t)=>(0,S.jsx)(gJ.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));zJ.displayName=gJ.Empty.displayName;var BJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.Group,{ref:n,className:H(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));BJ.displayName=gJ.Group.displayName;var VJ=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gJ.Item,{ref:n,className:H(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));VJ.displayName=gJ.Item.displayName;var HJ=`Popover`,[UJ,Kwe]=Nt(HJ,[aa]),WJ=aa(),[qwe,GJ]=UJ(HJ),KJ=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=WJ(t),c=w.useRef(null),[l,u]=w.useState(!1),[d,f]=Lt({prop:r,defaultProp:i??!1,onChange:a,caller:HJ});return(0,S.jsx)(xa,{...s,children:(0,S.jsx)(qwe,{scope:t,contentId:Fn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:o,children:n})})};KJ.displayName=HJ;var qJ=`PopoverAnchor`,Jwe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(qJ,n),a=WJ(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return w.useEffect(()=>(o(),()=>s()),[o,s]),(0,S.jsx)(Sa,{...a,...r,ref:t})});Jwe.displayName=qJ;var JJ=`PopoverTrigger`,YJ=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(JJ,n),a=WJ(n),o=D(t,i.triggerRef),s=(0,S.jsx)(Jt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":nY(i.open),...r,ref:o,onClick:jt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,S.jsx)(Sa,{asChild:!0,...a,children:s})});YJ.displayName=JJ;var XJ=`PopoverPortal`,[Ywe,Xwe]=UJ(XJ,{forceMount:void 0}),ZJ=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=GJ(XJ,t);return(0,S.jsx)(Ywe,{scope:t,forceMount:n,children:(0,S.jsx)(Oa,{present:n||a.open,children:(0,S.jsx)(Ea,{asChild:!0,container:i,children:r})})})};ZJ.displayName=XJ;var QJ=`PopoverContent`,$J=w.forwardRef((e,t)=>{let n=Xwe(QJ,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=GJ(QJ,e.__scopePopover);return(0,S.jsx)(Oa,{present:r||a.open,children:a.modal?(0,S.jsx)(Qwe,{...i,ref:t}):(0,S.jsx)($we,{...i,ref:t})})});$J.displayName=QJ;var Zwe=Vt(`PopoverContent.RemoveScroll`),Qwe=w.forwardRef((e,t)=>{let n=GJ(QJ,e.__scopePopover),r=w.useRef(null),i=D(t,r),a=w.useRef(!1);return w.useEffect(()=>{let e=r.current;if(e)return so(e)},[]),(0,S.jsx)(_s,{as:Zwe,allowPinchZoom:!0,children:(0,S.jsx)(eY,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:jt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:jt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),$we=w.forwardRef((e,t)=>{let n=GJ(QJ,e.__scopePopover),r=w.useRef(!1),i=w.useRef(!1);return(0,S.jsx)(eY,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),eY=w.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=GJ(QJ,n),p=WJ(n);return gn(),(0,S.jsx)(Sn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,S.jsx)(cn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,S.jsx)(Ca,{"data-state":nY(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),tY=`PopoverClose`,eTe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=GJ(tY,n);return(0,S.jsx)(Jt.button,{type:`button`,...r,ref:t,onClick:jt(e.onClick,()=>i.onOpenChange(!1))})});eTe.displayName=tY;var tTe=`PopoverArrow`,nTe=w.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=WJ(n);return(0,S.jsx)(wa,{...i,...r,ref:t})});nTe.displayName=tTe;function nY(e){return e?`open`:`closed`}var rTe=KJ,iTe=YJ,aTe=ZJ,rY=$J,iY=rTe,aY=iTe,oY=w.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,S.jsx)(aTe,{children:(0,S.jsx)(rY,{ref:i,align:t,sideOffset:n,className:H(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...r})}));oY.displayName=rY.displayName;var sY=`mcp-inspector-models-cache`,oTe=1440*60*1e3,cY=`data:image/svg+xml,%3Csvg%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22%2394A3B8%22%20stroke%3D%22%2394A3B8%22%3E%3Cg%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M3%20248.945C18%20248.945%2076%20236%20106%20219C136%20202%20136%20202%20198%20158C276.497%20102.293%20332%20120.945%20423%20120.945%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M511%20121.5L357.25%20210.268L357.25%2032.7324L511%20121.5Z%22%2F%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%20249C15%20249%2073%20261.945%20103%20278.945C133%20295.945%20133%20295.945%20195%20339.945C273.497%20395.652%20329%20377%20420%20377%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M508%20376.445L354.25%20287.678L354.25%20465.213L508%20376.445Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;function lY(){try{let e=localStorage.getItem(sY);if(e)return JSON.parse(e)}catch(e){console.error(`Failed to load models cache:`,e)}return{}}function sTe(e,t){try{let n=lY();n[e]={models:t,timestamp:Date.now()},localStorage.setItem(sY,JSON.stringify(n))}catch(e){console.error(`Failed to save models cache:`,e)}}function cTe(e){try{let t=lY(),n=t[e];if(n){if(Date.now()-n.timestamp<oTe)return n.models;delete t[e],localStorage.setItem(sY,JSON.stringify(t))}}catch(e){console.error(`Failed to get cached models:`,e)}return null}async function lTe(e,t){let n={};t&&(n.Authorization=`Bearer ${t}`);let r;try{r=await fetch(`${e}/models`,{headers:n})}catch{throw Error(`Failed to reach the server. Check the URL is correct and that CORS is enabled on the server.`)}if(!r.ok)throw Error(`Failed to fetch models: ${r.statusText}`);if(!(r.headers.get(`content-type`)??``).includes(`application/json`))throw Error(`Invalid URL — response was not JSON`);let i=await r.json();if(!Array.isArray(i?.data))throw Error(`Unexpected response format — expected { data: [...] } from the OpenAI-compatible endpoint`);return i.data.map(e=>({id:e.id}))}async function uTe(e){let t=await fetch(`https://api.openai.com/v1/models`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to fetch OpenAI models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id}))}async function dTe(e){let t=await fetch(`https://api.anthropic.com/v1/models`,{headers:{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`}});if(!t.ok)throw Error(`Failed to fetch Anthropic models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id,displayName:e.display_name}))}async function fTe(e){let t=await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${e}`);if(!t.ok)throw Error(`Failed to fetch Google models: ${t.statusText}`);return((await t.json()).models||[]).map(e=>({id:e.name,displayName:e.displayName}))}async function pTe(e){let t=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw Error(`Failed to fetch OpenRouter models: ${t.statusText}`);return(await t.json()).data.map(e=>({id:e.id,displayName:e.name}))}function uY({open:e,onOpenChange:t,tempProvider:n,tempModel:r,tempApiKey:i,tempBaseUrl:a=``,onProviderChange:o,onModelChange:s,onApiKeyChange:c,onBaseUrlChange:l,onSave:u,onClear:d,showClearButton:f=!1,buttonLabel:p=`Configure API Key`,freeTierInfo:m}){let[h,g]=(0,w.useState)([]),[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)(null),[x,C]=(0,w.useState)(!1),[T,E]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let t=n===`openai-compatible`?!!a.trim():!!i.trim();if(!e||!t){g([]),b(null);return}let r=setTimeout(async()=>{let e=n===`openai-compatible`?`${n}:${a}`:n,t=cTe(e);if(t){g(t),b(null);return}v(!0),b(null);try{let t=[];n===`openai-compatible`?t=await lTe(a,i):n===`openai`?t=await uTe(i):n===`anthropic`?t=await dTe(i):n===`google`?t=await fTe(i):n===`openrouter`&&(t=await pTe(i)),sTe(e,t),g(t)}catch(e){b(e instanceof Error?e.message:`Failed to fetch models. Please check your API key.`),g([])}finally{v(!1)}},500);return()=>clearTimeout(r)},[i,n,a,e]),(0,w.useEffect)(()=>{e&&s(``)},[n,e,s]);let D=e=>e===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e}.png`;return(0,S.jsx)(TN,{open:e,onOpenChange:t,children:(0,S.jsxs)(DN,{className:`max-w-md`,"data-testid":`chat-config-dialog`,children:[(0,S.jsxs)(ON,{children:[(0,S.jsx)(kN,{children:m?`Model & usage`:`LLM Provider Configuration`}),(0,S.jsx)(AN,{children:m?`You're using Manufact's free tier. Sign in to increase your limits, or bring your own key to pick any model.`:`Configure your LLM provider and API key to start chatting with the MCP server`})]}),(0,S.jsxs)(`div`,{className:`space-y-4`,children:[m&&(0,S.jsx)(`div`,{className:`rounded-md border bg-muted/40 p-3 space-y-2`,children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`text-sm`,children:[(0,S.jsx)(`div`,{className:`font-medium`,children:`Manufact free tier`}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Sign in for increased generous limits.`})]}),(0,S.jsx)(U,{size:`sm`,onClick:m.onLoginClick,children:`Sign in`})]})}),m&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,S.jsx)(`span`,{children:`or use your own API key`}),(0,S.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Provider`}),(0,S.jsxs)(EP,{value:n,onValueChange:e=>o(e),children:[(0,S.jsx)(OP,{className:`flex items-center gap-2`,children:(0,S.jsx)(DP,{})}),(0,S.jsxs)(kP,{children:[(0,S.jsx)(AP,{value:`openai`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`openai`),alt:`OpenAI`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`OpenAI`})]})}),(0,S.jsx)(AP,{value:`anthropic`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`anthropic`),alt:`Anthropic`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`Anthropic`})]})}),(0,S.jsx)(AP,{value:`google`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`google`),alt:`Google`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`Google`})]})}),(0,S.jsx)(AP,{value:`openrouter`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`img`,{src:D(`openrouter`),alt:`OpenRouter`,className:`w-4 h-4`}),(0,S.jsx)(`span`,{children:`OpenRouter`})]})}),(0,S.jsx)(AP,{value:`openai-compatible`,children:(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{children:`OpenAI Compatible`})})})]})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`API Key`}),(0,S.jsxs)(`div`,{className:`relative`,children:[(0,S.jsx)(jN,{type:T?`text`:`password`,value:i,onChange:e=>c(e.target.value),placeholder:n===`openai-compatible`?`Enter your API key (optional)`:`Enter your API key`,className:`pr-10`,"data-testid":`chat-config-api-key-input`}),(0,S.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent`,onClick:()=>E(!T),children:T?(0,S.jsx)(Hf,{className:`h-4 w-4 text-muted-foreground`}):(0,S.jsx)(Uf,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your API key is stored locally and never sent to our servers`})]}),n===`openai-compatible`&&(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Base URL`}),(0,S.jsx)(jN,{value:a,onChange:e=>l?.(e.target.value),placeholder:`http://localhost:11434/v1`,"data-testid":`chat-config-base-url-input`}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Base URL of your OpenAI-compatible API. Local servers must have CORS enabled.`})]}),(n===`openai-compatible`?!!a.trim():!!i.trim())&&(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(PN,{children:`Model`}),_?(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(rp,{className:`h-4 w-4 animate-spin`}),(0,S.jsx)(`span`,{children:`Loading models...`})]}):y?(0,S.jsx)(`div`,{className:`text-sm text-destructive`,children:y}):h.length>0?(0,S.jsxs)(iY,{open:x,modal:!0,onOpenChange:C,children:[(0,S.jsx)(aY,{asChild:!0,children:(0,S.jsxs)(U,{variant:`outline`,role:`combobox`,"aria-expanded":x,className:`w-full justify-between rounded-md`,"data-testid":`chat-config-model-select`,children:[r&&(h.find(e=>e.id===r)?.displayName||h.find(e=>e.id===r)?.id)||`Select a model...`,(0,S.jsx)(Af,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,S.jsx)(oY,{className:`w-full p-0`,align:`start`,children:(0,S.jsxs)(IJ,{children:[(0,S.jsx)(LJ,{placeholder:`Search models...`,className:`h-9`}),(0,S.jsxs)(RJ,{children:[(0,S.jsx)(zJ,{children:`No model found.`}),(0,S.jsx)(BJ,{children:h.map(e=>(0,S.jsxs)(VJ,{value:e.id,onSelect:e=>{s(e===r?``:e),C(!1)},children:[e.displayName||e.id,(0,S.jsx)(wf,{className:H(`ml-auto h-4 w-4`,r===e.id?`opacity-100`:`opacity-0`)})]},e.id))})]})]})})]}):(0,S.jsx)(jN,{value:r,onChange:e=>s(e.target.value),placeholder:`Enter model name manually`,"data-testid":`chat-config-model-input`})]}),(0,S.jsxs)(`div`,{className:`flex justify-between`,children:[f&&d&&(0,S.jsx)(U,{variant:`outline`,onClick:d,children:`Clear Config`}),(0,S.jsxs)(U,{onClick:u,disabled:n===`openai-compatible`?!a.trim()||!r.trim():!i.trim()||!r.trim(),className:f?`ml-auto`:``,"data-testid":`chat-config-save-button`,children:[(0,S.jsx)(tp,{className:`h-4 w-4 mr-2`}),`Save Configuration`]})]})]})]})})}function mTe({llmConfig:e,hasMessages:t,configDialogOpen:n,onConfigDialogOpenChange:r,onClearChat:i,tempProvider:a,tempModel:o,tempApiKey:s,tempBaseUrl:c,onProviderChange:l,onModelChange:u,onApiKeyChange:d,onBaseUrlChange:f,onSaveConfig:p,onClearConfig:m,hideConfigButton:h,freeTierInfo:g,clearButtonLabel:_,hideTitle:v,clearButtonHideIcon:y,clearButtonHideShortcut:b,clearButtonVariant:x,hideClearButton:C,onCopyChat:w,onExportChat:T}){return(0,S.jsxs)(`div`,{className:`flex flex-row absolute top-0 right-0 z-10 w-full items-center justify-between p-1 pt-2 gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full p-2 px-2 sm:px-4`,children:[!v&&(0,S.jsx)(`h3`,{className:`text-xl sm:text-3xl font-base`,children:`Chat`}),e&&(!h||g)&&(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(kt,{variant:`secondary`,className:`hidden sm:flex ml-2 pl-1 font-mono text-[11px] cursor-pointer hover:bg-secondary/80 transition-colors`,onClick:()=>r(!0),children:[e.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:e.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e.provider}.png`,alt:e.provider,className:`w-4 h-4 mr-0`}),e.provider,`/`,e.model]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:g?`Change model / upgrade`:`Change API Key`})})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 pr-2 sm:pr-3 pt-0 sm:pt-2 shrink-0`,children:[e&&(!h||g)&&(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsx)(U,{variant:`secondary`,size:`sm`,className:`p-2 sm:hidden`,onClick:()=>r(!0),children:e.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:e.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${e.provider}.png`,alt:e.provider,className:`w-4 h-4`})})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:`Change API Key`})})]}),!C&&t&&(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[w&&(0,S.jsxs)(U,{"data-testid":`chat-copy-button`,variant:`ghost`,size:`sm`,className:`h-9 gap-1.5 px-3`,onClick:w,children:[(0,S.jsx)(Lf,{className:`h-4 w-4`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:`Copy`})]}),T&&(0,S.jsxs)(Jl,{children:[(0,S.jsx)(Yl,{asChild:!0,children:(0,S.jsxs)(U,{"data-testid":`chat-export-button`,variant:`ghost`,size:`sm`,className:`h-9 gap-1.5 px-3`,children:[(0,S.jsx)(zf,{className:`h-4 w-4`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:`Export`})]})}),(0,S.jsxs)(eu,{align:`end`,children:[(0,S.jsx)(tu,{"data-testid":`chat-export-json`,onClick:()=>T(`json`),children:`Export as JSON`}),(0,S.jsx)(tu,{"data-testid":`chat-export-markdown`,onClick:()=>T(`markdown`),children:`Export as Markdown`})]})]}),(0,S.jsx)(`div`,{className:`w-px h-4 bg-border mx-1`}),(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(U,{variant:x??`default`,size:`default`,className:`p-2 cursor-pointer ${b?`sm:px-3`:`sm:pr-1 sm:pl-3`}`,onClick:i,children:[!y&&(0,S.jsx)(Mp,{className:`h-4 w-4 sm:mr-2`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:_??`New Chat`}),!b&&(0,S.jsx)(`span`,{className:`hidden sm:inline text-[12px] border text-zinc-300 p-1 rounded-full border-zinc-300 dark:text-zinc-600 dark:border-zinc-500 ml-2`,children:`⌘O`})]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:_??`New Chat`})})]})]}),(!h||g)&&(0,S.jsx)(uY,{open:n,onOpenChange:r,tempProvider:a,tempModel:o,tempApiKey:s,tempBaseUrl:c,onProviderChange:l,onModelChange:u,onApiKeyChange:d,onBaseUrlChange:f,onSave:p,onClear:m,showClearButton:!!e&&!g,buttonLabel:e?`Change API Key`:`Configure API Key`,freeTierInfo:g})]})]})}function dY({className:e,...t}){return(0,S.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}var fY=`Checkbox`,[hTe,gTe]=Nt(fY),[_Te,pY]=hTe(fY);function vTe(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Lt({prop:n,defaultProp:i??!1,onChange:c,caller:fY}),[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:xY(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,S.jsx)(_Te,{scope:t,...b,children:yTe(d)?d(b):r})}var mY=`CheckboxTrigger`,hY=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=pY(mY,e),h=D(i,u),g=w.useRef(c);return w.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,S.jsx)(Jt.button,{type:`button`,role:`checkbox`,"aria-checked":xY(c)?`mixed`:c,"aria-required":l,"data-state":SY(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:jt(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:jt(n,e=>{d(e=>xY(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});hY.displayName=mY;var gY=w.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,S.jsx)(vTe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hY,{...d,ref:t,__scopeCheckbox:n}),e&&(0,S.jsx)(bY,{__scopeCheckbox:n})]})})});gY.displayName=fY;var _Y=`CheckboxIndicator`,vY=w.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=pY(_Y,n);return(0,S.jsx)(Oa,{present:r||xY(a.checked)||a.checked===!0,children:(0,S.jsx)(Jt.span,{"data-state":SY(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});vY.displayName=_Y;var yY=`CheckboxBubbleInput`,bY=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=pY(yY,e),m=D(n,p),h=IN(a),g=na(r);w.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=xY(a),n.call(e,xY(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=w.useRef(xY(a)?!1:a);return(0,S.jsx)(Jt.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});bY.displayName=yY;function yTe(e){return typeof e==`function`}function xY(e){return e===`indeterminate`}function SY(e){return xY(e)?`indeterminate`:e?`checked`:`unchecked`}var CY=w.forwardRef(({className:e,...t},n)=>(0,S.jsx)(gY,{ref:n,className:H(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,S.jsx)(vY,{className:H(`flex items-center justify-center text-current`),children:(0,S.jsx)(wf,{className:`h-4 w-4`})})}));CY.displayName=gY.displayName;function bTe({tools:e,disabledTools:t,onDisabledToolsChange:n,disabled:r}){let[i,a]=(0,w.useState)(!1),o=e.length-t.size,s=t.size===0,c=t.size>0&&t.size<e.length,l=(0,w.useCallback)(e=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e),n(r)},[t,n]),u=(0,w.useCallback)(()=>{n(s?new Set(e.map(e=>e.name)):new Set)},[s,e,n]),d=(0,w.useMemo)(()=>[...e].sort((e,t)=>e.name.localeCompare(t.name)),[e]);return e.length===0?null:(0,S.jsxs)(iY,{open:i,onOpenChange:a,children:[(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsx)(aY,{asChild:!0,children:(0,S.jsxs)(U,{variant:`ghost`,size:`sm`,disabled:r,className:H(`h-auto w-auto aspect-square rounded-full p-2 relative`,c?`text-amber-500 dark:text-amber-400`:`text-muted-foreground hover:text-foreground`),type:`button`,"data-testid":`chat-tool-selector`,children:[(0,S.jsx)(Bp,{className:`h-4 w-4`}),c&&(0,S.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-amber-500 text-[9px] font-bold text-white leading-none`,children:o})]})})}),(0,S.jsx)(Id,{side:`top`,children:(0,S.jsxs)(`p`,{children:[`Tools (`,o,`/`,e.length,`)`]})})]}),(0,S.jsxs)(oY,{className:`w-72 p-0`,align:`start`,side:`top`,sideOffset:8,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b`,children:[(0,S.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:[`Allowed Tools (`,o,`/`,e.length,`)`]}),(0,S.jsx)(U,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:u,type:`button`,children:s?`Disable All`:`Enable All`})]}),(0,S.jsx)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:d.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2.5 w-full px-3 py-1.5 text-left hover:bg-accent/50 transition-colors cursor-pointer`,onClick:()=>l(e.name),children:[(0,S.jsx)(CY,{checked:!t.has(e.name),className:`pointer-events-none`,tabIndex:-1}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`text-sm font-mono truncate`,children:e.name}),e.description&&(0,S.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate`,children:e.description})]})]},e.name))})]})]})}function wY(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t).toString(16)}var xTe=10*1024*1024,STe=20*1024*1024,CTe=[`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`];function wTe(e){return CTe.includes(e.type)}function TTe(e){return e.size<=xTe}function TY(e){return e.reduce((e,t)=>e+(t.size||0),0)<=STe}function ETe(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;t(e.includes(`,`)?e.split(`,`)[1]:e)},r.onerror=()=>{n(Error(`Failed to read file: ${e.name}`))},r.readAsDataURL(e)})}async function EY(e){if(!wTe(e))throw Error(`Unsupported file type: ${e.type}. Only images are supported.`);if(!TTe(e))throw Error(`File too large: ${e.name}. Maximum size is 10MB.`);return{type:`image`,data:await ETe(e),mimeType:e.type,name:e.name,size:e.size}}function DTe(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**+r).toFixed(1))} ${n[r]}`}function DY({inputValue:e,isConnected:t,isLoading:n,textareaRef:r,attachments:i,placeholder:a=`Ask a question`,className:o,showAttachButton:s=!0,tools:c,disabledTools:l,onDisabledToolsChange:u,onInputChange:d,onKeyDown:f,onKeyUp:p,onClick:m,onAttachmentAdd:h,onAttachmentRemove:g}){let _=(0,w.useRef)(null),v=e=>{let t=e.target.files;if(t&&t.length>0)for(let e=0;e<t.length;e++)h(t[e]);_.current&&(_.current.value=``)},y=i.length>0;return(0,S.jsxs)(`div`,{className:`relative w-full`,children:[y&&(0,S.jsx)(`div`,{className:`absolute top-0 left-0 right-0 z-20 p-3 flex gap-2 flex-wrap`,children:i.map((e,t)=>(0,S.jsxs)(`div`,{className:`relative group bg-zinc-100/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg p-2 flex items-center gap-2 border border-zinc-200 dark:border-zinc-700`,"data-testid":`chat-attachment-${t}`,children:[(0,S.jsx)($f,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,S.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,S.jsx)(`span`,{className:`text-xs font-medium truncate max-w-[150px]`,children:e.name||`Image`}),e.size&&(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:DTe(e.size)})]}),(0,S.jsx)(`button`,{onClick:()=>g(t),className:`shrink-0 p-1 rounded-full hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors`,title:`Remove attachment`,type:`button`,"data-testid":`chat-attachment-remove-${t}`,children:(0,S.jsx)(Vp,{className:`h-3 w-3`})})]},t))}),(0,S.jsx)(dY,{ref:r,value:e,onChange:e=>d(e.target.value),onKeyDown:f,onKeyUp:p,onClick:m,placeholder:t?a:`Server not connected`,className:H(`p-4 min-h-[150px] max-h-[300px] rounded-xl`,y&&`pt-20`,o),disabled:!t||n,"data-testid":`chat-input`}),(0,S.jsx)(`input`,{ref:_,type:`file`,accept:`image/*`,multiple:!0,onChange:v,className:`hidden`,"aria-label":`Upload images`}),(0,S.jsxs)(`div`,{className:`absolute left-0 p-3 bottom-0 flex items-center gap-0.5`,children:[s&&(0,S.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>_.current?.click(),disabled:!t||n,className:`h-auto w-auto aspect-square rounded-full p-2 text-muted-foreground hover:text-foreground`,title:`Attach images`,type:`button`,"data-testid":`chat-attach-button`,children:(0,S.jsx)(fp,{className:`h-4 w-4`})}),c&&c.length>0&&l&&u&&(0,S.jsx)(bTe,{tools:c,disabledTools:l,onDisabledToolsChange:u,disabled:!t||n})]})]})}function OY({promptResults:e,onDeletePromptResult:t}){return(0,S.jsx)(`div`,{className:`absolute top-4 left-4 right-4 flex gap-2 overflow-x-auto z-20 flex-nowrap`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`},children:e.map(({promptName:e},n)=>(0,S.jsxs)(U,{type:`button`,className:`flex items-center gap-2 bg-zinc-200 text-zinc-700 dark:text-zinc-300 text-[10px] px-1.5 py-0.5 dark:bg-zinc-700 rounded-lg border border-zinc-200 dark:border-zinc-300 font-medium hover:bg-zinc-300 dark:hover:bg-zinc-600`,children:[(0,S.jsx)(sp,{className:`h-3.5 w-3.5 shrink-0`}),(0,S.jsx)(`span`,{className:`truncate`,title:e,children:e}),(0,S.jsx)(`span`,{className:`ml-1 h-4 w-4 rounded-full bg-zinc-400 dark:bg-zinc-600 hover:bg-zinc-500 dark:hover:bg-zinc-500 flex items-center justify-center cursor-pointer shrink-0 transition-colors`,onClick:e=>{e.stopPropagation(),t(n)},title:`Remove prompt`,role:`button`,tabIndex:0,children:(0,S.jsx)(Vp,{className:`h-2.5 w-2.5 text-white`})})]},n))})}function kY({isOpen:e,focusedIndex:t,prompts:n,selectedPrompt:r,onPromptSelect:i}){return e?((0,w.useEffect)(()=>{if(t>=0){let e=document.getElementById(`prompt-${t}`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`})}},[t]),(0,S.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 max-w-3xl w-full max-h-[300px] overflow-y-auto rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 shadow-lg z-30 flex flex-col gap-2 mb-1`,"data-testid":`chat-prompts-dropdown`,children:(0,S.jsxs)(`div`,{className:`p-2`,children:[(0,S.jsx)(`div`,{className:`text-xs font-medium text-zinc-900 dark:text-zinc-100 mb-2`,children:`Prompts`}),n.map((e,n)=>(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(U,{id:`prompt-${n}`,type:`button`,variant:`ghost`,className:H(`w-full flex items-center px-3 py-2 rounded-md hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors text-left justify-start`,t===n&&`bg-zinc-200 dark:bg-zinc-700`),onClick:()=>i(e),"data-testid":`chat-prompt-option-${n}`,children:[(0,S.jsx)(`div`,{className:`flex items-center justify-center shrink-0`,children:(0,S.jsx)(sp,{className:`h-4 w-4 text-zinc-600 dark:text-zinc-400`})}),(0,S.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,S.jsxs)(`div`,{className:`text-sm font-medium text-zinc-900 dark:text-zinc-100 flex items-center gap-2`,children:[e.name,r?.name===e.name&&(0,S.jsx)(Gq,{className:`size-3 text-zinc-600 dark:text-zinc-400`})]})})]})}),(0,S.jsx)(Id,{children:e.description})]},n))]})})):null}function OTe({inputValue:e,isConnected:t,isLoading:n,textareaRef:r,promptsDropdownOpen:i,promptFocusedIndex:a,prompts:o,selectedPrompt:s,promptResults:c,attachments:l,tools:u,disabledTools:d,onDisabledToolsChange:f,onInputChange:p,onKeyDown:m,onKeyUp:h,onClick:g,onSendMessage:_,onStopStreaming:v,onPromptSelect:y,onDeletePromptResult:b,onAttachmentAdd:x,onAttachmentRemove:C,followups:w=[],onFollowupSelect:T}){let E=e.trim()||c.length>0||l.length>0;return(0,S.jsx)(`div`,{className:`w-full flex flex-col justify-center items-center p-2 sm:p-4 sm:pt-0 text-foreground`,children:(0,S.jsxs)(`div`,{className:`relative w-full max-w-3xl backdrop-blur-xl`,children:[w.length>0&&(0,S.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:w.map(e=>(0,S.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,onClick:()=>T?.(e),disabled:n||!t,children:e},e))}),(0,S.jsx)(kY,{isOpen:i,prompts:o,selectedPrompt:s,focusedIndex:a,onPromptSelect:y}),(0,S.jsx)(OY,{promptResults:c,onDeletePromptResult:b}),(0,S.jsx)(DY,{inputValue:e,isConnected:t,isLoading:n,textareaRef:r,attachments:l,placeholder:`Ask a question`,className:H(`bg-zinc-50 z-10 focus:bg-zinc-100 dark:text-white dark:bg-black border-gray-200 dark:border-zinc-800`,c.length>0&&`pt-16`),tools:u,disabledTools:d,onDisabledToolsChange:f,onInputChange:p,onKeyDown:m,onKeyUp:h,onClick:g,onAttachmentAdd:x,onAttachmentRemove:C}),(0,S.jsx)(`div`,{className:`absolute right-0 p-3 bottom-0 flex items-center gap-2`,children:n?(0,S.jsx)(U,{className:`min-w-none h-auto w-auto aspect-square rounded-full items-center justify-center flex`,title:`Stop streaming`,type:`button`,onClick:v,children:(0,S.jsx)(Np,{className:`h-4 w-4`})}):(0,S.jsx)(U,{disabled:!E||!t||n,className:`min-w-none h-auto w-auto aspect-square rounded-full items-center justify-center flex`,title:`Send`,type:`button`,onClick:_,"data-testid":`chat-send-button`,children:(0,S.jsx)(Sp,{className:`h-4 w-4`})})})]})})}function kTe({className:e,children:t,showRadialGradient:n=!0,...r}){return(0,S.jsxs)(`div`,{className:H(`transition-bg relative flex size-full flex-col items-center justify-center bg-zinc-50 text-slate-950 dark:bg-zinc-900`,e),...r,children:[(0,S.jsx)(`div`,{className:`absolute inset-0 overflow-hidden dark:opacity-50 dark:contrast-200`,style:{"--aurora":`repeating-linear-gradient(100deg,#3b82f6_10%,#a5b4fc_15%,#93c5fd_20%,#ddd6fe_25%,#60a5fa_30%)`,"--dark-gradient":`repeating-linear-gradient(100deg,#000_0%,#000_7%,transparent_10%,transparent_12%,#000_16%)`,"--white-gradient":`repeating-linear-gradient(100deg,#fff_0%,#fff_7%,transparent_10%,transparent_12%,#fff_16%)`,"--blue-300":`#93c5fd`,"--blue-400":`#60a5fa`,"--blue-500":`#3b82f6`,"--indigo-300":`#a5b4fc`,"--violet-200":`#ddd6fe`,"--black":`#000`,"--white":`#fff`,"--transparent":`transparent`},children:(0,S.jsx)(`div`,{className:H(`after:animate-aurora pointer-events-none absolute -inset-[10px] [background-image:var(--white-gradient),var(--aurora)] [background-size:300%,_200%] [background-position:50%_50%,50%_50%] opacity-50 blur-[10px] invert filter will-change-transform [--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] [--dark-gradient:repeating-linear-gradient(100deg,var(--black)_0%,var(--black)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--black)_16%)] [--white-gradient:repeating-linear-gradient(100deg,var(--white)_0%,var(--white)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--white)_16%)] after:absolute after:inset-0 after:[background-image:var(--white-gradient),var(--aurora)] after:[background-size:200%,_100%] after:[background-attachment:fixed] after:mix-blend-difference after:content-[""] dark:[background-image:var(--dark-gradient),var(--aurora)] dark:invert-0 after:dark:[background-image:var(--dark-gradient),var(--aurora)]`,n&&`[mask-image:radial-gradient(ellipse_at_100%_0%,black_10%,var(--transparent)_70%)]`)})}),t]})}function ATe({mcpServerUrl:e,inputValue:t,isConnected:n,isLoading:r,textareaRef:i,llmConfig:a,promptsDropdownOpen:o,promptFocusedIndex:s,prompts:c,selectedPrompt:l,promptResults:u,attachments:d,tools:f,disabledTools:p,onDisabledToolsChange:m,onInputChange:h,onKeyDown:g,onKeyUp:_,onClick:v,onSubmit:y,onConfigDialogOpenChange:b,onPromptSelect:x,onDeletePromptResult:C,onAttachmentAdd:w,onAttachmentRemove:T,hideModelBadge:E,hideServerUrl:D,quickQuestions:O=[],onQuickQuestionSelect:k,freeTierInfo:A}){let j=t.trim()||u.length>0||d.length>0;return(0,S.jsx)(kTe,{children:(0,S.jsxs)(Wq,{className:`w-full max-w-4xl mx-auto px-2 sm:px-4`,children:[(0,S.jsxs)(`div`,{className:`text-center mb-6 sm:mb-8`,children:[(0,S.jsx)(`h1`,{className:`text-2xl sm:text-4xl font-light mb-2 dark:text-white`,"data-testid":`chat-landing-header`,children:`Chat with MCP Server`}),!D&&(0,S.jsx)(`p`,{className:`text-xs sm:text-sm text-zinc-600 dark:text-zinc-400 font-light break-all px-2`,children:e})]}),(0,S.jsxs)(`form`,{onSubmit:y,className:`space-y-6`,children:[(0,S.jsx)(`div`,{className:`flex justify-center`,children:(0,S.jsxs)(`div`,{className:`relative w-full max-w-2xl`,children:[(0,S.jsx)(kY,{prompts:c,isOpen:o,selectedPrompt:l,focusedIndex:s,onPromptSelect:x}),(0,S.jsx)(OY,{promptResults:u,onDeletePromptResult:C}),(0,S.jsx)(DY,{inputValue:t,isConnected:n,isLoading:r,textareaRef:i,attachments:d,placeholder:`Ask a question or request an action...`,className:H(`bg-white/80 dark:text-white dark:bg-black backdrop-blur-sm border-gray-200 dark:border-zinc-800`,u.length>0&&`pt-16`),tools:f,disabledTools:p,onDisabledToolsChange:m,onInputChange:h,onKeyDown:g,onKeyUp:_,onClick:v,onAttachmentAdd:w,onAttachmentRemove:T}),(0,S.jsx)(`div`,{className:`absolute right-0 p-3 bottom-0`,children:(0,S.jsx)(U,{type:`submit`,size:`sm`,className:H(`h-10 w-10 rounded-full`,r&&`animate-spin`,!j&&`bg-zinc-400`),disabled:r||!j||!n,"data-testid":`chat-send-button`,children:r?(0,S.jsx)(rp,{className:`h-4 w-4 animate-spin`}):(0,S.jsx)(vf,{className:`h-4 w-4`})})})]})}),O.length>0&&(0,S.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2 px-2`,children:O.map(e=>(0,S.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full bg-white/70 dark:bg-black/50 text-gray-900 dark:text-white`,onClick:()=>k?.(e),disabled:r||!n,children:e},e))}),a&&(!E||A)&&(0,S.jsx)(`div`,{className:`flex justify-center mt-4`,children:(0,S.jsxs)(Pd,{children:[(0,S.jsx)(Fd,{asChild:!0,children:(0,S.jsxs)(kt,{variant:`secondary`,className:`pl-1 font-mono text-[11px] cursor-pointer hover:bg-secondary/80 transition-colors`,onClick:()=>b(!0),children:[a.provider!==`openai-compatible`&&(0,S.jsx)(`img`,{src:a.provider===`openrouter`?cY:`https://inspector-cdn.mcp-use.com/providers/${a.provider}.png`,alt:a.provider,className:`w-4 h-4 mr-0 rounded-full`}),a.provider,`/`,a.model]})}),(0,S.jsx)(Id,{children:(0,S.jsx)(`p`,{children:A?`Change model / upgrade`:`Change API Key`})})]})})]})]})})}function jTe({onConfigureClick:e}){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center`,children:[(0,S.jsx)(tp,{className:`h-12 w-12 text-muted-foreground mb-4`}),(0,S.jsx)(`h3`,{className:`text-lg font-semibold mb-2`,children:`Configure Your LLM Provider`}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4 max-w-md`,children:`To start chatting with the MCP server, you need to configure your LLM provider and API key. Your credentials are stored locally and used only for this chat.`}),(0,S.jsxs)(U,{onClick:e,"data-testid":`chat-configure-api-key-button`,children:[(0,S.jsx)(wp,{className:`h-4 w-4 mr-2`}),`Configure API Key`]})]})}function AY({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2}){let a=Uq.create(t),o=(0,w.useMemo)(()=>e.length*i,[e,i]);return(0,S.jsx)(a,{className:H(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text`,`text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,`dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]`,n),initial:{backgroundPosition:`100% center`},animate:{backgroundPosition:`0% center`},transition:{repeat:1/0,duration:r,ease:`linear`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--base-color), var(--base-color))`},children:e})}var jY;function MTe(e){if(!jY)if(typeof document<`u`)jY=document.createElement(`textarea`);else return;var t=`&`+e+`;`;jY.innerHTML=t;var n=jY.value;return n===t?void 0:n}var MY=32,NY=9,PY=13,FY=10,IY=96,LY=126,RY=91,zY=94,BY=62,VY=35,NTe=36,HY=37,UY=45,WY=61,GY=92,KY=42,qY=95,JY=60,YY=64,XY=93,ZY=33,QY=38,$Y=58,eX=70,tX=102,nX=104,rX=119,iX=116,aX=112,PTe=115,FTe=160,ITe=12,oX=44,sX=59,cX=63,lX=46,uX=47,dX=39,fX=34,pX=43,mX=124,hX=123,gX=125,_X=40,vX=41,yX=30,bX=31,xX=48,SX=57,CX=65,wX=90,TX=97,EX=122,DX=128,OX=32,Z={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22};function LTe(e){if(!LX(e,`---`))return null;let t=3;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t<e.length&&e[t]===`\r`&&t++,t>=e.length||e[t]!==`
532
532
  `)return null;t++;let n=!1;for(;t<e.length;){let r=t;for(;t<e.length&&e[t]!==`
533
533
  `&&e[t]!==`\r`;)t++;if(t>=e.length)break;let i=t;if(e[t]===`\r`&&t++,t<e.length&&e[t]===`
534
534
  `&&t++,LX(e,`---`,r))return{endPos:t,hasValidYaml:n};let a=e.indexOf(`:`,r);a!==-1&&a<i&&(n=!0)}return null}var RTe=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,zTe={class:`className`,for:`htmlFor`,allowfullscreen:`allowFullScreen`,allowtransparency:`allowTransparency`,autocomplete:`autoComplete`,autofocus:`autoFocus`,autoplay:`autoPlay`,cellpadding:`cellPadding`,cellspacing:`cellSpacing`,charset:`charSet`,classid:`classId`,colspan:`colSpan`,contenteditable:`contentEditable`,contextmenu:`contextMenu`,crossorigin:`crossOrigin`,enctype:`encType`,formaction:`formAction`,formenctype:`formEncType`,formmethod:`formMethod`,formnovalidate:`formNoValidate`,formtarget:`formTarget`,frameborder:`frameBorder`,hreflang:`hrefLang`,inputmode:`inputMode`,keyparams:`keyParams`,keytype:`keyType`,marginheight:`marginHeight`,marginwidth:`marginWidth`,maxlength:`maxLength`,mediagroup:`mediaGroup`,minlength:`minLength`,novalidate:`noValidate`,radiogroup:`radioGroup`,readonly:`readOnly`,rowspan:`rowSpan`,spellcheck:`spellCheck`,srcdoc:`srcDoc`,srclang:`srcLang`,srcset:`srcSet`,tabindex:`tabIndex`,usemap:`useMap`,viewbox:`viewBox`};function kX(e){var t={};for(var n in e){var r=zTe[n.toLowerCase()];if(r)t[r]=e[n];else{var i=n.indexOf(`:`);i===-1?t[n]=e[n]:t[n.slice(0,i)+n[i+1].toUpperCase()+n.slice(i+2)]=e[n]}}return t}var BTe=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function AX(e){return e.indexOf(`&`)===-1?e:e.replace(RTe,(e,t)=>{var n=MTe(t);if(n)return n;if(t[0]===`#`){var r=t[1]===`x`||t[1]===`X`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return r===0||r>=55296&&r<=57343||r>1114111?`�`:r<=65535?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>10),56320+(r-65536&1023))}return e})}var jX=/(javascript|vbscript|data(?!:image)):/i;function MX(e){if(jX.test(e))return null;if(e.indexOf(`%`)===-1)return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,``);if(jX.test(t))return null}catch{return null}return e}var NX={},PX,FX;for(PX=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],FX=0;FX<PX.length;FX++)NX[PX[FX]]=`a`;for(NX[231]=NX[199]=`c`,NX[240]=NX[208]=`d`,PX=[200,201,202,203,233,232,234,235],FX=0;FX<PX.length;FX++)NX[PX[FX]]=`e`;for(PX=[207,239,206,238,205,237,204,236],FX=0;FX<PX.length;FX++)NX[PX[FX]]=`i`;for(NX[209]=NX[241]=`n`,PX=[248,216,339,338,213,245,212,244,211,243,210,242],FX=0;FX<PX.length;FX++)NX[PX[FX]]=`o`;for(PX=[220,252,219,251,218,250,217,249],FX=0;FX<PX.length;FX++)NX[PX[FX]]=`u`;NX[376]=NX[255]=NX[221]=NX[253]=`y`;function VTe(e){return e<DX&&(KTe[e]&(HX|UX))!==0}function IX(e){for(var t=``,n=-1,r=0;r<e.length;r++){var i=e.charCodeAt(r);if(VTe(i))i>=CX&&i<=wX?(n>=0&&(t+=e.slice(n,r),n=-1),t+=String.fromCharCode(i+OX)):n<0&&(n=r);else if(i===MY||i===UY)n>=0&&(t+=e.slice(n,r),n=-1),t+=`-`;else{n>=0&&(t+=e.slice(n,r),n=-1);var a=NX[i];a&&(t+=a)}}return n>=0&&(t+=e.slice(n)),t}function LX(e,t,n){return e.startsWith(t,n)}var RX=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`,`circle`,`ellipse`,`line`,`path`,`polygon`,`polyline`,`rect`,`use`,`stop`,`animate`,`set`]);function zX(e){let t=e.toLowerCase();if(RX.has(t))return!0;let n=t.indexOf(`:`);return n===-1?!1:(t=t.slice(n+1),RX.has(t))}var BX=1,VX=2,HX=4,UX=8,WX=16,GX=32,HTe=64,KX=1,UTe=2,WTe=3,GTe=4,KTe=(function(){let e=new Uint8Array(128),t;for(e[NY]=BX|GX,e[FY]=BX|WX,e[ITe]=BX,e[PY]=BX|WX,e[MY]=BX|GX,t=ZY;t<=uX;t++)e[t]=VX;for(t=$Y;t<=YY;t++)e[t]=VX;for(t=RY;t<=IY;t++)e[t]=VX;for(t=hX;t<=LY;t++)e[t]=VX;for(t=xX;t<=SX;t++)e[t]=UX;for(t=CX;t<=wX;t++)e[t]=HX|HTe;for(t=TX;t<=EX;t++)e[t]=HX;return e})();(function(){let e=new Uint8Array(128);return e[GY]=UTe,e[RY]=GTe,e[KY]=e[qY]=e[LY]=e[WY]=WTe,e[IY]=e[JY]=e[YY]=e[XY]=e[FY]=e[MY]=e[ZY]=KX,e[tX]=e[nX]=e[rX]=KX,e})();var qX=[];function qTe(e){var t=e.indexOf(`\r`),n=e.indexOf(`\0`);if(t===-1&&n===-1)return e;var r=e.length;qX.length=0;var i=0,a=0;for(a=t===-1?n:n===-1||t<n?t:n;a<r;a++){var o=e.charCodeAt(a);o===PY?(i<a&&qX.push(e.slice(i,a)),a+1<r&&e.charCodeAt(a+1)===FY&&a++,qX.push(`
@@ -767,7 +767,7 @@ container holding the app. Specify either width or maxWidth, and either height o
767
767
  `),n=e.indexOf(`\r
768
768
  \r
769
769
  `);return t===-1?n:n===-1?t:Math.min(t,n)}function eMe(e){let t,n=[];for(let r of e.split(/\r?\n/)){if(!r||r.startsWith(`:`))continue;let e=r.indexOf(`:`),i=e===-1?r:r.slice(0,e),a=e===-1?``:r.slice(e+1);a.startsWith(` `)&&(a=a.slice(1)),i===`event`?t=a:i===`data`&&n.push(a)}return n.length===0?null:{event:t,data:n.join(`
770
- `)}}var tMe=`https://api.anthropic.com/v1/messages`,nMe=`2023-06-01`,rMe=4096;function iMe(e){if(e.type!==`image`)return null;if(e.data&&e.mimeType)return{type:`image`,source:{type:`base64`,media_type:e.mimeType,data:e.data}};let t=Qje(e.url);return t?{type:`image`,source:{type:`base64`,media_type:t.mimeType,data:t.data}}:{type:`image`,source:{type:`url`,url:e.url}}}function aMe(e){if(typeof e==`string`)return[{type:`text`,text:e||`[no content]`}];let t=[];for(let n of e)if(n.type===`text`)n.text&&t.push({type:`text`,text:n.text});else{let e=iMe(n);e&&t.push(e)}return t.length===0&&t.push({type:`text`,text:`[no content]`}),t}function oMe(e){let t=[];for(let n of e){if(n.role===`tool`){let e=t[t.length-1],r={type:`tool_result`,tool_use_id:n.toolCallId,content:typeof n.content==`string`?n.content:JSON.stringify(n.toolResult??n.content),...n.toolIsError?{is_error:!0}:{}};e&&e.role===`user`&&Array.isArray(e.content)?e.content.push(r):t.push({role:`user`,content:[r]});continue}if(n.role===`assistant`){let e=[],r=typeof n.content==`string`?n.content:Array.isArray(n.content)?n.content.map(e=>e.type===`text`?e.text:``).join(``):``;if(r&&e.push({type:`text`,text:r}),n.toolCalls?.length)for(let t of n.toolCalls)e.push({type:`tool_use`,id:t.id,name:t.name,input:t.args??{}});e.length===0&&e.push({type:`text`,text:`[no content]`}),t.push({role:`assistant`,content:e});continue}t.push({role:`user`,content:aMe(n.content)})}return t}function sMe(e,t){let{config:n,messages:r,tools:i}=e,{system:a,rest:o}=Zje(r),s={model:n.model,max_tokens:n.maxTokens??rMe,messages:oMe(o),...t?{stream:!0}:{}};return n.temperature!==void 0&&(s.temperature=n.temperature),a&&(s.system=a),i&&i.length>0&&(s.tools=i.map(e=>({name:e.name,description:e.description,input_schema:e.inputSchema}))),s}async function*cMe(e){let{config:t,signal:n}=e,r=await fetch(tMe,{method:`POST`,headers:{"Content-Type":`application/json`,"x-api-key":t.apiKey,"anthropic-version":nMe,"anthropic-dangerous-direct-browser-access":`true`},body:JSON.stringify(sMe(e,!0)),signal:n});if(!r.ok||!r.body){let e=await r.text().catch(()=>``);throw Error(`Anthropic request failed (${r.status} ${r.statusText}): ${e}`)}let i=new Map;for await(let e of V7(r.body,n)){let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.type;if(n===`content_block_start`){let e=t.index,n=t.content_block??{};if(n.type===`tool_use`){i.set(e,{kind:`tool_use`,id:n.id,name:n.name,argsJson:``,emittedStart:!1}),yield{type:`tool-call-start`,index:e,toolCallId:n.id,toolName:n.name};let t=i.get(e);t&&(t.emittedStart=!0)}else i.set(e,{kind:`text`,argsJson:``,emittedStart:!1})}else if(n===`content_block_delta`){let e=t.index,n=t.delta??{},r=i.get(e);if(!r)continue;n.type===`text_delta`&&typeof n.text==`string`?yield{type:`text-delta`,delta:n.text}:n.type===`input_json_delta`&&typeof n.partial_json==`string`&&r.kind===`tool_use`&&(r.argsJson+=n.partial_json,yield{type:`tool-call-args-delta`,index:e,toolCallId:r.id,toolName:r.name,argsDelta:n.partial_json})}else if(n===`content_block_stop`){let e=t.index,n=i.get(e);if(n&&n.kind===`tool_use`&&n.id&&n.name){let t={};if(n.argsJson)try{t=JSON.parse(n.argsJson)}catch{t={}}yield{type:`tool-call-ready`,index:e,toolCallId:n.id,toolName:n.name,args:t}}}else n===`message_stop`||n===`error`&&(yield{type:`error`,message:t?.error?.message??`Anthropic stream error`})}yield{type:`done`}}async function lMe(e){let{config:t,signal:n}=e,r=await fetch(tMe,{method:`POST`,headers:{"Content-Type":`application/json`,"x-api-key":t.apiKey,"anthropic-version":nMe,"anthropic-dangerous-direct-browser-access":`true`},body:JSON.stringify(sMe(e,!1)),signal:n});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`Anthropic request failed (${r.status} ${r.statusText}): ${e}`)}let i=await r.json(),a=``,o=[];for(let e of i?.content??[])e.type===`text`&&typeof e.text==`string`?a+=e.text:e.type===`tool_use`&&o.push({id:e.id,name:e.name,args:e.input&&typeof e.input==`object`?e.input:{}});return{text:a,toolCalls:o}}var uMe=new Set([`type`,`description`,`enum`,`properties`,`required`,`items`,`format`,`nullable`,`minimum`,`maximum`,`minItems`,`maxItems`,`minLength`,`maxLength`,`pattern`]);function dMe(e){if(!e||typeof e!=`object`)return{type:`object`};let t=H7(e);if(typeof t!=`object`||!t)return{type:`object`};let n=t;return n.type||=`object`,n}function H7(e){if(Array.isArray(e))return e.map(H7);if(!e||typeof e!=`object`)return e;let t=e;for(let e of[`oneOf`,`anyOf`,`allOf`]){let n=t[e];if(Array.isArray(n)&&n.length===1)return H7(n[0])}let n={};for(let[e,r]of Object.entries(t))if(uMe.has(e))if(e===`properties`&&r&&typeof r==`object`){let t={};for(let[e,n]of Object.entries(r))t[e]=H7(n);n[e]=t}else e===`items`?n[e]=H7(r):n[e]=r;return n}function fMe(e){let t=e.trim();return t.startsWith(`models/`)?t.slice(7):t}function pMe(e,t){let n=t===`stream`?`streamGenerateContent?alt=sse`:`generateContent`;return`https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(fMe(e))}:${n}`}function mMe(e){if(e.type!==`image`)return null;if(e.data&&e.mimeType)return{inlineData:{mimeType:e.mimeType,data:e.data}};let t=Qje(e.url);return t?{inlineData:{mimeType:t.mimeType,data:t.data}}:null}function hMe(e){if(typeof e==`string`)return[{text:e||`[no content]`}];let t=[];for(let n of e)if(n.type===`text`)n.text&&t.push({text:n.text});else{let e=mMe(n);e&&t.push(e)}return t.length===0&&t.push({text:`[no content]`}),t}function gMe(e){let t=[];for(let n of e){if(n.role===`tool`){let e;try{e=typeof n.content==`string`?JSON.parse(n.content):n.toolResult}catch{e={result:typeof n.content==`string`?n.content:n.toolResult}}(!e||typeof e!=`object`)&&(e={result:e});let r=t[t.length-1],i={functionResponse:{name:n.toolName,response:e}};r&&r.role===`function`?r.parts.push(i):t.push({role:`function`,parts:[i]});continue}if(n.role===`assistant`){let e=[],r=typeof n.content==`string`?n.content:Array.isArray(n.content)?n.content.map(e=>e.type===`text`?e.text:``).join(``):``;if(r&&e.push({text:r}),n.toolCalls?.length)for(let t of n.toolCalls)e.push({functionCall:{name:t.name,args:t.args??{}}});e.length===0&&e.push({text:`[no content]`}),t.push({role:`model`,parts:e});continue}t.push({role:`user`,parts:hMe(n.content)})}return t}function _Me(e){let{config:t,messages:n,tools:r}=e,{system:i,rest:a}=Zje(n),o={contents:gMe(a)};i&&(o.systemInstruction={parts:[{text:i}]});let s={};return t.temperature!==void 0&&(s.temperature=t.temperature),t.maxTokens!==void 0&&(s.maxOutputTokens=t.maxTokens),Object.keys(s).length>0&&(o.generationConfig=s),r&&r.length>0&&(o.tools=[{functionDeclarations:r.map(e=>({name:e.name,description:e.description,parameters:dMe(e.inputSchema)}))}]),o}async function*vMe(e){let{config:t,signal:n}=e,r=`${pMe(t.model,`stream`)}&key=${encodeURIComponent(t.apiKey)}`,i=await fetch(r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(_Me(e)),signal:n});if(!i.ok||!i.body){let e=await i.text().catch(()=>``);throw Error(`Google request failed (${i.status} ${i.statusText}): ${e}`)}let a=0;for await(let e of V7(i.body,n)){let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.candidates?.[0]?.content?.parts??[];for(let e of n)if(typeof e.text==`string`&&e.text.length>0)yield{type:`text-delta`,delta:e.text};else if(e.functionCall&&typeof e.functionCall==`object`){let t=a++,n=`call_${t}_${e.functionCall.name??`tool`}`,r=e.functionCall.name??``,i=e.functionCall.args&&typeof e.functionCall.args==`object`?e.functionCall.args:{};yield{type:`tool-call-start`,index:t,toolCallId:n,toolName:r};let o=JSON.stringify(i);o&&o!==`{}`&&(yield{type:`tool-call-args-delta`,index:t,toolCallId:n,toolName:r,argsDelta:o}),yield{type:`tool-call-ready`,index:t,toolCallId:n,toolName:r,args:i}}}yield{type:`done`}}async function yMe(e){let{config:t,signal:n}=e,r=`${pMe(t.model,`single`)}?key=${encodeURIComponent(t.apiKey)}`,i=await fetch(r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(_Me(e)),signal:n});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`Google request failed (${i.status} ${i.statusText}): ${e}`)}let a=await i.json(),o=``,s=[],c=a?.candidates?.[0]?.content?.parts??[];for(let e of c)typeof e.text==`string`?o+=e.text:e.functionCall&&s.push({id:`call_${s.length}_${e.functionCall.name??`tool`}`,name:e.functionCall.name??``,args:e.functionCall.args&&typeof e.functionCall.args==`object`?e.functionCall.args:{}});return{text:o,toolCalls:s}}var bMe=`https://api.openai.com/v1`;function xMe(e,t){return`${(e.baseUrl??bMe).replace(/\/+$/,``)}${t}`}function SMe(e){let t={"Content-Type":`application/json`,...e.extraHeaders};return e.apiKey&&(t.Authorization=`Bearer ${e.apiKey}`),t}function CMe(e){return typeof e==`string`?e:e.map(e=>e.type===`text`?{type:`text`,text:e.text}:{type:`image_url`,image_url:{url:e.url}})}function wMe(e){let t=[];for(let n of e){if(n.role===`tool`){t.push({role:`tool`,tool_call_id:n.toolCallId,content:typeof n.content==`string`?n.content:JSON.stringify(n.toolResult??n.content)});continue}if(n.role===`assistant`){let e={role:`assistant`,content:typeof n.content==`string`&&n.content.length>0?n.content:null};n.toolCalls?.length&&(e.tool_calls=n.toolCalls.map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.args)}}))),t.push(e);continue}t.push({role:n.role,content:CMe(n.content)})}return t}async function*TMe(e){let{config:t,messages:n,tools:r,signal:i}=e,a={model:t.model,messages:wMe(n),stream:!0};t.temperature!==void 0&&(a.temperature=t.temperature),t.maxTokens!==void 0&&(a.max_tokens=t.maxTokens),r&&r.length>0&&(a.tools=r.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.inputSchema}})));let o=xMe(t,`/chat/completions`),s=await fetch(o,{method:`POST`,headers:SMe(t),body:JSON.stringify(a),signal:i});if(!s.ok||!s.body){let e=await s.text().catch(()=>``);throw Error(`OpenAI request failed (${s.status} ${s.statusText}): ${e}`)}let c=new Map;for await(let e of V7(s.body,i)){if(!e.data||e.data===`[DONE]`)continue;let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.choices?.[0];if(!n)continue;let r=n.delta??{};if(typeof r.content==`string`&&r.content.length>0&&(yield{type:`text-delta`,delta:r.content}),Array.isArray(r.tool_calls))for(let e of r.tool_calls){let t=typeof e.index==`number`?e.index:0,n=c.get(t);n||(n={id:e.id??`call_${t}`,name:e.function?.name??``,argsJson:``,started:!1},c.set(t,n)),(e.id&&!n.id.startsWith(`call_`)||e.id)&&(n.id=e.id),e.function?.name&&(n.name=e.function.name),!n.started&&n.name&&(n.started=!0,yield{type:`tool-call-start`,index:t,toolCallId:n.id,toolName:n.name});let r=e.function?.arguments;typeof r==`string`&&r.length>0&&(n.argsJson+=r,n.started&&(yield{type:`tool-call-args-delta`,index:t,toolCallId:n.id,toolName:n.name,argsDelta:r}))}if(n.finish_reason){for(let[e,t]of c){let n={};if(t.argsJson)try{n=JSON.parse(t.argsJson)}catch{n={}}yield{type:`tool-call-ready`,index:e,toolCallId:t.id,toolName:t.name,args:n}}c.clear()}}yield{type:`done`}}async function EMe(e){let{config:t,messages:n,tools:r,signal:i}=e,a={model:t.model,messages:wMe(n)};t.temperature!==void 0&&(a.temperature=t.temperature),t.maxTokens!==void 0&&(a.max_tokens=t.maxTokens),r&&r.length>0&&(a.tools=r.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.inputSchema}})));let o=xMe(t,`/chat/completions`),s=await fetch(o,{method:`POST`,headers:SMe(t),body:JSON.stringify(a),signal:i});if(!s.ok){let e=await s.text().catch(()=>``);throw Error(`OpenAI request failed (${s.status} ${s.statusText}): ${e}`)}let c=(await s.json())?.choices?.[0]?.message;return{text:typeof c?.content==`string`?c.content:``,toolCalls:Array.isArray(c?.tool_calls)?c.tool_calls.map(e=>{let t={};try{t=JSON.parse(e?.function?.arguments??`{}`)}catch{t={}}return{id:e.id,name:e.function?.name??``,args:t}}):[]}}function DMe(e){return{...e,config:{...e.config,baseUrl:`https://openrouter.ai/api/v1`,extraHeaders:{"HTTP-Referer":`https://inspector.mcp-use.com`,"X-Title":`mcp-use Inspector`}}}}function OMe(e){switch(e.config.provider){case`openai`:case`openai-compatible`:return TMe(e);case`anthropic`:return cMe(e);case`google`:return vMe(e);case`openrouter`:return TMe(DMe(e));default:throw Error(`Unsupported LLM provider: ${e.config.provider}`)}}function U7(e){switch(e.config.provider){case`openai`:case`openai-compatible`:return EMe(e);case`anthropic`:return lMe(e);case`google`:return yMe(e);case`openrouter`:return EMe(DMe(e));default:throw Error(`Unsupported LLM provider: ${e.config.provider}`)}}function kMe(e){let t=e.trim(),n=t.match(/```(?:json)?\s*([\s\S]*?)```/);n&&(t=n[1].trim());let r=t.indexOf(`{`);if(r<0)return null;let i=0;for(let e=r;e<t.length;e++)if(t[e]===`{`)i++;else if(t[e]===`}`&&(i--,i===0))try{return JSON.parse(t.slice(r,e+1))}catch{return null}return null}function AMe({llmConfig:e}){return{generateProps:(0,w.useCallback)(async({resource:t,resourceAnnotations:n,propsSchema:r})=>{if(!e)throw Error(`LLM config is not available`);let i=t.mimeType||n?.mimeType||`unknown`,a=t.description||n?.description||`N/A`;if(r?.properties){let n=Object.keys(r.properties).map(e=>{let t=r.properties[e],n=` - ${e} (${t.type||`string`})`,i=t.description?`: ${t.description}`:``,a=``;return t.type===`array`&&t.items?.type===`object`&&t.items?.properties&&(a=` — array of objects with keys: {${Object.keys(t.items.properties).join(`, `)}}`),`${n}${a}${i}`}).join(`
770
+ `)}}var tMe=`https://api.anthropic.com/v1/messages`,nMe=`2023-06-01`,rMe=4096;function iMe(e){if(e.type!==`image`)return null;if(e.data&&e.mimeType)return{type:`image`,source:{type:`base64`,media_type:e.mimeType,data:e.data}};let t=Qje(e.url);return t?{type:`image`,source:{type:`base64`,media_type:t.mimeType,data:t.data}}:{type:`image`,source:{type:`url`,url:e.url}}}function aMe(e){if(typeof e==`string`)return[{type:`text`,text:e||`[no content]`}];let t=[];for(let n of e)if(n.type===`text`)n.text&&t.push({type:`text`,text:n.text});else{let e=iMe(n);e&&t.push(e)}return t.length===0&&t.push({type:`text`,text:`[no content]`}),t}function oMe(e){let t=[];for(let n of e){if(n.role===`tool`){let e=t[t.length-1],r={type:`tool_result`,tool_use_id:n.toolCallId,content:typeof n.content==`string`?n.content:JSON.stringify(n.toolResult??n.content),...n.toolIsError?{is_error:!0}:{}};e&&e.role===`user`&&Array.isArray(e.content)?e.content.push(r):t.push({role:`user`,content:[r]});continue}if(n.role===`assistant`){let e=[],r=typeof n.content==`string`?n.content:Array.isArray(n.content)?n.content.map(e=>e.type===`text`?e.text:``).join(``):``;if(r&&e.push({type:`text`,text:r}),n.toolCalls?.length)for(let t of n.toolCalls)e.push({type:`tool_use`,id:t.id,name:t.name,input:t.args??{}});e.length===0&&e.push({type:`text`,text:`[no content]`}),t.push({role:`assistant`,content:e});continue}t.push({role:`user`,content:aMe(n.content)})}return t}function sMe(e,t){let{config:n,messages:r,tools:i}=e,{system:a,rest:o}=Zje(r),s={model:n.model,max_tokens:n.maxTokens??rMe,messages:oMe(o),...t?{stream:!0}:{}};return n.temperature!==void 0&&(s.temperature=n.temperature),a&&(s.system=a),i&&i.length>0&&(s.tools=i.map(e=>({name:e.name,description:e.description,input_schema:e.inputSchema}))),s}async function*cMe(e){let{config:t,signal:n}=e,r=await fetch(tMe,{method:`POST`,headers:{"Content-Type":`application/json`,"x-api-key":t.apiKey,"anthropic-version":nMe,"anthropic-dangerous-direct-browser-access":`true`},body:JSON.stringify(sMe(e,!0)),signal:n});if(!r.ok||!r.body){let e=await r.text().catch(()=>``);throw Error(`Anthropic request failed (${r.status} ${r.statusText}): ${e}`)}let i=new Map;for await(let e of V7(r.body,n)){let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.type;if(n===`content_block_start`){let e=t.index,n=t.content_block??{};if(n.type===`tool_use`){i.set(e,{kind:`tool_use`,id:n.id,name:n.name,argsJson:``,emittedStart:!1}),yield{type:`tool-call-start`,index:e,toolCallId:n.id,toolName:n.name};let t=i.get(e);t&&(t.emittedStart=!0)}else i.set(e,{kind:`text`,argsJson:``,emittedStart:!1})}else if(n===`content_block_delta`){let e=t.index,n=t.delta??{},r=i.get(e);if(!r)continue;n.type===`text_delta`&&typeof n.text==`string`?yield{type:`text-delta`,delta:n.text}:n.type===`input_json_delta`&&typeof n.partial_json==`string`&&r.kind===`tool_use`&&(r.argsJson+=n.partial_json,yield{type:`tool-call-args-delta`,index:e,toolCallId:r.id,toolName:r.name,argsDelta:n.partial_json})}else if(n===`content_block_stop`){let e=t.index,n=i.get(e);if(n&&n.kind===`tool_use`&&n.id&&n.name){let t={};if(n.argsJson)try{t=JSON.parse(n.argsJson)}catch{t={}}yield{type:`tool-call-ready`,index:e,toolCallId:n.id,toolName:n.name,args:t}}}else n===`message_stop`||n===`error`&&(yield{type:`error`,message:t?.error?.message??`Anthropic stream error`})}yield{type:`done`}}async function lMe(e){let{config:t,signal:n}=e,r=await fetch(tMe,{method:`POST`,headers:{"Content-Type":`application/json`,"x-api-key":t.apiKey,"anthropic-version":nMe,"anthropic-dangerous-direct-browser-access":`true`},body:JSON.stringify(sMe(e,!1)),signal:n});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`Anthropic request failed (${r.status} ${r.statusText}): ${e}`)}let i=await r.json(),a=``,o=[];for(let e of i?.content??[])e.type===`text`&&typeof e.text==`string`?a+=e.text:e.type===`tool_use`&&o.push({id:e.id,name:e.name,args:e.input&&typeof e.input==`object`?e.input:{}});return{text:a,toolCalls:o}}var uMe=new Set([`type`,`description`,`enum`,`properties`,`required`,`items`,`format`,`nullable`,`minimum`,`maximum`,`minItems`,`maxItems`,`minLength`,`maxLength`,`pattern`]);function dMe(e){if(!e||typeof e!=`object`)return{type:`object`};let t=H7(e);if(typeof t!=`object`||!t)return{type:`object`};let n=t;return n.type||=`object`,n}function H7(e){if(Array.isArray(e))return e.map(H7);if(!e||typeof e!=`object`)return e;let t=e;for(let e of[`oneOf`,`anyOf`,`allOf`]){let n=t[e];if(Array.isArray(n)&&n.length===1)return H7(n[0])}let n={};for(let[e,r]of Object.entries(t))if(uMe.has(e))if(e===`properties`&&r&&typeof r==`object`){let t={};for(let[e,n]of Object.entries(r))t[e]=H7(n);n[e]=t}else e===`items`?n[e]=H7(r):n[e]=r;return n}function fMe(e){let t=e.trim();return t.startsWith(`models/`)?t.slice(7):t}function pMe(e,t){let n=t===`stream`?`streamGenerateContent?alt=sse`:`generateContent`;return`https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(fMe(e))}:${n}`}function mMe(e){if(e.type!==`image`)return null;if(e.data&&e.mimeType)return{inlineData:{mimeType:e.mimeType,data:e.data}};let t=Qje(e.url);return t?{inlineData:{mimeType:t.mimeType,data:t.data}}:null}function hMe(e){if(typeof e==`string`)return[{text:e||`[no content]`}];let t=[];for(let n of e)if(n.type===`text`)n.text&&t.push({text:n.text});else{let e=mMe(n);e&&t.push(e)}return t.length===0&&t.push({text:`[no content]`}),t}function gMe(e){let t=[];for(let n of e){if(n.role===`tool`){let e;try{e=typeof n.content==`string`?JSON.parse(n.content):n.toolResult}catch{e={result:typeof n.content==`string`?n.content:n.toolResult}}(!e||typeof e!=`object`)&&(e={result:e});let r=t[t.length-1],i={functionResponse:{name:n.toolName,response:e}};r&&r.role===`function`?r.parts.push(i):t.push({role:`function`,parts:[i]});continue}if(n.role===`assistant`){let e=[],r=typeof n.content==`string`?n.content:Array.isArray(n.content)?n.content.map(e=>e.type===`text`?e.text:``).join(``):``;if(r&&e.push({text:r}),n.toolCalls?.length)for(let t of n.toolCalls)e.push({functionCall:{name:t.name,args:t.args??{}}});e.length===0&&e.push({text:`[no content]`}),t.push({role:`model`,parts:e});continue}t.push({role:`user`,parts:hMe(n.content)})}return t}function _Me(e){let{config:t,messages:n,tools:r}=e,{system:i,rest:a}=Zje(n),o={contents:gMe(a)};i&&(o.systemInstruction={parts:[{text:i}]});let s={};return t.temperature!==void 0&&(s.temperature=t.temperature),t.maxTokens!==void 0&&(s.maxOutputTokens=t.maxTokens),Object.keys(s).length>0&&(o.generationConfig=s),r&&r.length>0&&(o.tools=[{functionDeclarations:r.map(e=>({name:e.name,description:e.description,parameters:dMe(e.inputSchema)}))}]),o}async function*vMe(e){let{config:t,signal:n}=e,r=`${pMe(t.model,`stream`)}&key=${encodeURIComponent(t.apiKey)}`,i=await fetch(r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(_Me(e)),signal:n});if(!i.ok||!i.body){let e=await i.text().catch(()=>``);throw Error(`Google request failed (${i.status} ${i.statusText}): ${e}`)}let a=0;for await(let e of V7(i.body,n)){let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.candidates?.[0]?.content?.parts??[];for(let e of n)if(typeof e.text==`string`&&e.text.length>0)yield{type:`text-delta`,delta:e.text};else if(e.functionCall&&typeof e.functionCall==`object`){let t=a++,n=`call_${t}_${e.functionCall.name??`tool`}`,r=e.functionCall.name??``,i=e.functionCall.args&&typeof e.functionCall.args==`object`?e.functionCall.args:{};yield{type:`tool-call-start`,index:t,toolCallId:n,toolName:r};let o=JSON.stringify(i);o&&o!==`{}`&&(yield{type:`tool-call-args-delta`,index:t,toolCallId:n,toolName:r,argsDelta:o}),yield{type:`tool-call-ready`,index:t,toolCallId:n,toolName:r,args:i}}}yield{type:`done`}}async function yMe(e){let{config:t,signal:n}=e,r=`${pMe(t.model,`single`)}?key=${encodeURIComponent(t.apiKey)}`,i=await fetch(r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(_Me(e)),signal:n});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`Google request failed (${i.status} ${i.statusText}): ${e}`)}let a=await i.json(),o=``,s=[],c=a?.candidates?.[0]?.content?.parts??[];for(let e of c)typeof e.text==`string`?o+=e.text:e.functionCall&&s.push({id:`call_${s.length}_${e.functionCall.name??`tool`}`,name:e.functionCall.name??``,args:e.functionCall.args&&typeof e.functionCall.args==`object`?e.functionCall.args:{}});return{text:o,toolCalls:s}}var bMe=`https://api.openai.com/v1`;function xMe(e,t){return`${e.baseUrl??bMe}${t}`}function SMe(e){let t={"Content-Type":`application/json`,...e.extraHeaders};return e.apiKey&&(t.Authorization=`Bearer ${e.apiKey}`),t}function CMe(e){return typeof e==`string`?e:e.map(e=>e.type===`text`?{type:`text`,text:e.text}:{type:`image_url`,image_url:{url:e.url}})}function wMe(e){let t=[];for(let n of e){if(n.role===`tool`){t.push({role:`tool`,tool_call_id:n.toolCallId,content:typeof n.content==`string`?n.content:JSON.stringify(n.toolResult??n.content)});continue}if(n.role===`assistant`){let e={role:`assistant`,content:typeof n.content==`string`&&n.content.length>0?n.content:null};n.toolCalls?.length&&(e.tool_calls=n.toolCalls.map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.args)}}))),t.push(e);continue}t.push({role:n.role,content:CMe(n.content)})}return t}async function*TMe(e){let{config:t,messages:n,tools:r,signal:i}=e,a={model:t.model,messages:wMe(n),stream:!0};t.temperature!==void 0&&(a.temperature=t.temperature),t.maxTokens!==void 0&&(a.max_tokens=t.maxTokens),r&&r.length>0&&(a.tools=r.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.inputSchema}})));let o=xMe(t,`/chat/completions`),s=await fetch(o,{method:`POST`,headers:SMe(t),body:JSON.stringify(a),signal:i});if(!s.ok||!s.body){let e=await s.text().catch(()=>``);throw Error(`OpenAI request failed (${s.status} ${s.statusText}): ${e}`)}let c=new Map;for await(let e of V7(s.body,i)){if(!e.data||e.data===`[DONE]`)continue;let t;try{t=JSON.parse(e.data)}catch{continue}let n=t?.choices?.[0];if(!n)continue;let r=n.delta??{};if(typeof r.content==`string`&&r.content.length>0&&(yield{type:`text-delta`,delta:r.content}),Array.isArray(r.tool_calls))for(let e of r.tool_calls){let t=typeof e.index==`number`?e.index:0,n=c.get(t);n||(n={id:e.id??`call_${t}`,name:e.function?.name??``,argsJson:``,started:!1},c.set(t,n)),(e.id&&!n.id.startsWith(`call_`)||e.id)&&(n.id=e.id),e.function?.name&&(n.name=e.function.name),!n.started&&n.name&&(n.started=!0,yield{type:`tool-call-start`,index:t,toolCallId:n.id,toolName:n.name});let r=e.function?.arguments;typeof r==`string`&&r.length>0&&(n.argsJson+=r,n.started&&(yield{type:`tool-call-args-delta`,index:t,toolCallId:n.id,toolName:n.name,argsDelta:r}))}if(n.finish_reason){for(let[e,t]of c){let n={};if(t.argsJson)try{n=JSON.parse(t.argsJson)}catch{n={}}yield{type:`tool-call-ready`,index:e,toolCallId:t.id,toolName:t.name,args:n}}c.clear()}}yield{type:`done`}}async function EMe(e){let{config:t,messages:n,tools:r,signal:i}=e,a={model:t.model,messages:wMe(n)};t.temperature!==void 0&&(a.temperature=t.temperature),t.maxTokens!==void 0&&(a.max_tokens=t.maxTokens),r&&r.length>0&&(a.tools=r.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.inputSchema}})));let o=xMe(t,`/chat/completions`),s=await fetch(o,{method:`POST`,headers:SMe(t),body:JSON.stringify(a),signal:i});if(!s.ok){let e=await s.text().catch(()=>``);throw Error(`OpenAI request failed (${s.status} ${s.statusText}): ${e}`)}let c=(await s.json())?.choices?.[0]?.message;return{text:typeof c?.content==`string`?c.content:``,toolCalls:Array.isArray(c?.tool_calls)?c.tool_calls.map(e=>{let t={};try{t=JSON.parse(e?.function?.arguments??`{}`)}catch{t={}}return{id:e.id,name:e.function?.name??``,args:t}}):[]}}function DMe(e){return{...e,config:{...e.config,baseUrl:`https://openrouter.ai/api/v1`,extraHeaders:{"HTTP-Referer":`https://inspector.mcp-use.com`,"X-Title":`mcp-use Inspector`}}}}function OMe(e){switch(e.config.provider){case`openai`:case`openai-compatible`:return TMe(e);case`anthropic`:return cMe(e);case`google`:return vMe(e);case`openrouter`:return TMe(DMe(e));default:throw Error(`Unsupported LLM provider: ${e.config.provider}`)}}function U7(e){switch(e.config.provider){case`openai`:case`openai-compatible`:return EMe(e);case`anthropic`:return lMe(e);case`google`:return yMe(e);case`openrouter`:return EMe(DMe(e));default:throw Error(`Unsupported LLM provider: ${e.config.provider}`)}}function kMe(e){let t=e.trim(),n=t.match(/```(?:json)?\s*([\s\S]*?)```/);n&&(t=n[1].trim());let r=t.indexOf(`{`);if(r<0)return null;let i=0;for(let e=r;e<t.length;e++)if(t[e]===`{`)i++;else if(t[e]===`}`&&(i--,i===0))try{return JSON.parse(t.slice(r,e+1))}catch{return null}return null}function AMe({llmConfig:e}){return{generateProps:(0,w.useCallback)(async({resource:t,resourceAnnotations:n,propsSchema:r})=>{if(!e)throw Error(`LLM config is not available`);let i=t.mimeType||n?.mimeType||`unknown`,a=t.description||n?.description||`N/A`;if(r?.properties){let n=Object.keys(r.properties).map(e=>{let t=r.properties[e],n=` - ${e} (${t.type||`string`})`,i=t.description?`: ${t.description}`:``,a=``;return t.type===`array`&&t.items?.type===`object`&&t.items?.properties&&(a=` — array of objects with keys: {${Object.keys(t.items.properties).join(`, `)}}`),`${n}${a}${i}`}).join(`
771
771
  `),i=[{role:`system`,content:`You are helping a developer configure props for a UI widget. The widget has a defined schema with specific props. Generate appropriate values for ONLY the props listed in the schema. Return ONLY a JSON object with these exact keys. For array props, each item must match the specified structure.`},{role:`user`,content:`Widget: ${t.name||t.uri}
772
772
  Description: ${a}
773
773